Questions Tagged with #Google eclipse plugin

Google Plugin for Eclipse (GPE) is a set of software development tools that enables Java developers to quickly design, build, optimize, and deploy cloud-based applications.

Failure [INSTALL_FAILED_ALREADY_EXISTS] when I tried to update my application

when I tried to update my applcation with new version that has same signature as previous one, shows above error. What I am missing?..

Downcasting in Java

Upcasting is allowed in Java, however downcasting gives a compile error. The compile error can be removed by adding a cast but would anyway break at the runtime. In this case why Java allows downc..

Adding close button in div to close the box

I have created a URL preview box for the entered URL. Preview is shown in the div box. I want to add a close option on the right top. How could be done so that when users click on its box should be di..

What does hash do in python?

I saw an example of code that where hash function is applied to a tuple. As a result it returns a negative integer. I wonder what does this function do? Google does not help. I found a page that expla..

Safely turning a JSON string into an object

Given a string of JSON data, how can I safely turn that string into a JavaScript object? Obviously I can do this unsafely with something like: var obj = eval("(" + json + ')'); but that leaves me ..

Reset Entity-Framework Migrations

I've mucked up my migrations, I used IgnoreChanges on the initial migration, but now I want to delete all my migrations and start with an initial migration with all of the logic. When I delete the mi..

Add line break to ::after or ::before pseudo-element content

I do not have access to the HTML or PHP for a page and can only edit via CSS. I've been doing modifications on a site and adding text via the ::after or ::before pseudo-elements and have found that es..

sass :first-child not working

I have not been using SASS for a very long time and wanted to know if there are some issues with pseudo-elements such as :first-child or :last-child ?..

MySQL: is a SELECT statement case sensitive?

Can anyone tell me if a MySQL SELECT query is case sensitive or case insensitive by default? And if not, what query would I have to send so that I can do something like: SELECT * FROM `table` WHERE `..

Re-render React component when prop changes

I'm trying to separate a presentational component from a container component. I have a SitesTable and a SitesTableContainer. The container is responsible for triggering redux actions to fetch the appr..

In angular $http service, How can I catch the "status" of error?

I'm reading a book called, "Pro Angular JS". However, I have a question about how to catch a status of error. What I coded is : $http.get(dataUrl) .success(function (data){ $

How to run a function in jquery

I'm a programming newbie, and I can't figure out how to store a function in JQuery and run in it multiple places. I have: $(function () { $("div.class").click(function(){ //Doo something }..

Global Events in Angular

Is there no equivalent to $scope.emit() or $scope.broadcast() in Angular? I know the EventEmitter functionality, but as far as I understand that will just emit an event to the parent HTML element. W..

Convert array into csv

How to convert an array into a CSV file? This is my array: stdClass Object ( [OrderList_RetrieveByContactResult] => stdClass Object ( [OrderDetails] => stdClass Object..

Unable to locate an executable at "/usr/bin/java/bin/java" (-1)

I am having a pathetic issue with Java in my mac osx 10.7.3 . Previously I installed it and it was working fine. After some changes in the .bash_profile and .profile file in the course of time, I am h..

Should I URL-encode POST data?

I'm POSTing data to an external API (using PHP, if it's relevant). Should I URL-encode the POST variables that I pass? Or do I only need to URL-encode GET data? UPDATE: This is my PHP, in case it is ..

Jackson - Deserialize using generic class

I have a json string, which I should deSerialize to the following class class Data <T> { int found; Class<T> hits } How do I do it? This is the usual way mapper.readValue(jsonS..

How to include !important in jquery

I am trying to add !important in the css attribute using jQuery like $("tabs").css('height','650px;!important'); but !important has no effect. How to include !important in jquery?..

How to set a Default Route (To an Area) in MVC

Ok this has been asked before but there is no solid solution out there. So for purpose of myself and others who may find this useful. In MVC2 (ASP.NET) I want it so when someone navigates to the webs..

Authentication failed to bitbucket

I'm trying to push my project via the https protocol on bitbucket using sourcetree. But I can't connect to bitbucket with my login and password (which work on the website), I have a fatal error : "Aut..

What is the difference between onBlur and onChange attribute in HTML?

When is one called versus the other? Is there a situation were onChange would be called but onBlur would not be called?..

Integrating Dropzone.js into existing HTML form with other fields

I currently have a HTML form which users fill in details of an advert they wish to post. I now want to be able to add a dropzone for uploading images of the item for sale. I have found Dropzone.js wh..

How to debug apk signed for release?

I have an apk which I've signed and uploaded to Android Market, and installed on my phone. I would like to debug this release apk (by means of Eclipse) whilst it is running on my phone. I have done th..

What does the "at" (@) symbol do in Python?

I'm looking at some Python code which used the @ symbol, but I have no idea what it does. I also do not know what to search for as searching Python docs or Google does not return relevant results when..

How to check if an environment variable exists and get its value?

I am writing a shell script. In this shell script, I am have a variable that either takes a default value, or the value of an environment variable. However, the environment variable doesn't have to be..

How to paste the selected range (passed as rng) to the end of the worksheet?

The code below is trying to paste the selected range (passed as rng) to the end of the worksheet. It works if there are two rows already present (A1, A2). Sub copyRow(rng As Range, ws As Worksheet) ..

Array Size (Length) in C#

How can I determine size of an array (length / number of items) in C#?..

Root element is missing

I am reading xml from xxx URl but i am getting error as Root element is missing. My code to read xml response is as follows: XmlDocument doc = new XmlDocument(); doc.Load("URL from which i am re..

Calculate days between two Dates in Java 8

I know there are lots of questions on SO about how to get Dates in Java, but I want an example using new Java 8 Date API. I also know about the JodaTime library, but I want a method without relying on..

Default argument values in JavaScript functions

Possible Duplicate: How do I make a default value for a parameter to a javascript function in PHP: function func($a = 10, $b = 20){ // if func() is called with no arguments $a will be 10..

How do I get the RootViewController from a pushed controller?

So, I push a view controller from RootViewController like: [self.navigationController pushViewController:anotherViewController animated:YES] ; BUT, FROM anotherViewController now, I want to access..

How can I open a link in a new window?

I have a click handler for a specific link, inside that I want to do something similar to the following: window.location = url I need this to actually open the url in a new window though, how do I ..

ASP.NET MVC razor: conditional attribute in HTML

Code below doesn't seems clean. Any suggestion to improve the code? <li @if(ViewData["pagename"].ToString()=="Business details"){ <text>class="active" </text> } > <a @if..

Launching Google Maps Directions via an intent on Android

My app needs to show Google Maps directions from A to B, but I don't want to put the Google Maps into my application - instead, I want to launch it using an Intent. Is this possible? If yes, how?..

How to redirect stderr and stdout to different files in the same line in script?

I know this much: $ command 2>> error $ command 1>> output Is there any way I can output the stderr to the error file and output stdout to the output file in the same line of bash?..

Scanner vs. BufferedReader

As far I know, the two most common methods of reading character-based data from a file in Java is using Scanner or BufferedReader. I also know that the BufferedReader reads files efficiently by using ..

Increasing the maximum number of TCP/IP connections in Linux

I am programming a server and it seems like my number of connections is being limited since my bandwidth isn't being saturated even when I've set the number of connections to "unlimited". How can I i..

Are the PUT, DELETE, HEAD, etc methods available in most web browsers?

I've seen a couple questions around here like How to debug RESTful services, which mentions: Unfortunately that same browser won't allow me to test HTTP PUT, DELETE, and to a certain degree even H..

Increase days to php current Date()

How do I add a certain number of days to the current date in PHP? I already got the current date with: $today = date('y:m:d'); Just need to add x number of days to it..

Get PHP class property by string

How do I get a property in a PHP based on a string? I'll call it magic. So what is magic? $obj->Name = 'something'; $get = $obj->Name; would be like... magic($obj, 'Name', 'something'); $get..

Compare two data.frames to find the rows in data.frame 1 that are not present in data.frame 2

I have the following 2 data.frames: a1 <- data.frame(a = 1:5, b=letters[1:5]) a2 <- data.frame(a = 1:3, b=letters[1:3]) I want to find the row a1 has that a2 doesn't. Is there a built in fun..

Meaning of Choreographer messages in Logcat

I installed the latest versions of SDK (API 16) and got the latest ADT. I'm now seeing these messages in the logcat, that I'm quite sure, I haven't seen before. Does anyone have an idea about this? ..

A formula to copy the values from a formula to another column

I have a column of values created from a formula, I know I can copy the values over to another column by using the clipboard. BUT...I want my spreadsheet to be automatic whilst avoiding the use of VBA..

Private vs Protected - Visibility Good-Practice Concern

I've been searching and I know the theoretic difference. public - Any class/function may access the method/property. protected - Only this class and any subclasses may access the method/property. pr..

Bootstrap radio button "checked" flag

In case #1 works, in case #2 it do not works. Check the code bellow: <div class="container"> <div class="row"> <h1>Radio Group #1</h1> <label class="rad..

Correct way to find max in an Array in Swift

I've so far got a simple (but potentially expensive) way: var myMax = sort(myArray,>)[0] And how I was taught to do it at school: var myMax = 0 for i in 0..myArray.count { if (myArray[i] &g..

Convert integers to strings to create output filenames at run time

I have a program in Fortran that saves the results to a file. At the moment I open the file using OPEN (1, FILE = 'Output.TXT') However, I now want to run a loop, and save the results of each iter..

data type not understood

I'm trying to use a matrix to compute stuff. The code is this import numpy as np # some code mmatrix = np.zeros(nrows, ncols) print mmatrix[0, 0] but I get 'data type not understood', and it works ..

How to get a unique device ID in Swift?

How can I get a devices unique ID in Swift? I need an ID to use in the database and as the API-key for my web service in my social app. Something to keep track of this devices daily use and limit its..

Change the borderColor of the TextBox

How can I change the BorderColor of the Textbox when a user Clicks on it or focuses on it?..

Run a Command Prompt command from Desktop Shortcut

Is it possible to create a desktop shortcut that, when pressed, will open command prompt and run a pre-defined command?..

Copy map values to vector in STL

Working my way through Effective STL at the moment. Item 5 suggests that it's usually preferable to use range member functions to their single element counterparts. I currently wish to copy all the va..

Adding click event listener to elements with the same class

I have a list view for delete id. I'd like to add a listener to all elements with a particular class and do a confirm alert. My problem is that this seems to only add the listener to the first elemen..

Laravel Query Builder where max id

How do I accomplish this in Laravel 4.1 Query Builder? select * from orders where id = (select max(`id`) from orders) I tried this, working but can't get the eloquent feature. DB::select(DB::raw(..

Find substring in the string in TWIG

I want to find substring of the string or check if there is no such substring using Twig. On the words, I need analogue of 'strstr' or 'strpos' in php. I googled and searched this issue in stackoverfl..

How do I specify C:\Program Files without a space in it for programs that can't handle spaces in file paths?

A configuration file needs position of another file, but that file is located in "C:\Program Files", and the path with space in it is not recognized, Is there another way to specify the location wi..

How to install a specific version of a ruby gem?

Using the command-line gem tool, how can I install a specific version of a gem?..

Android Webview - Webpage should fit the device screen

I have tried the following to fit the webpage based on the device screen size. mWebview.setInitialScale(30); and then set the metadata viewport <meta name="viewport" content="width=320, initial..

What is mod_php?

While going through a Zend tutorial, I came across the following statement: Note that the php_flag settings in .htaccess only work if you are using mod_php. Can someone explain what that means?..

How to Get a Specific Column Value from a DataTable?

I have a datatable. I need to fetch a certain column value based on the user input. For example, lets say the datatable has two columns CountryID and CountryName. I need to find CountryID in the data..

Convert string to date then format the date

I am formatting a string to a date using the code String start_dt = '2011-01-01'; DateFormat formatter = new SimpleDateFormat("YYYY-MM-DD"); Date date = (Date)formatter.parse(start_dt); But how d..

How to capture Enter key press?

In my HTML page, I had a textbox for user to input keyword for searching. When they click the search button, the JavaScript function will generate a URL and run in new window. The JavaScript function..

How line ending conversions work with git core.autocrlf between different operating systems

I've read a lot of different questions and answers on Stack Overflow as well as git documentation on how the core.autocrlf setting works. This is my understanding from what I've read: Unix and Mac O..

CSS Font "Helvetica Neue"

I often see the websites using font "Helvetica Neue". Is this font safe to use, like eg. Arial? Or do the browsers have trouble rendering it or not many machines have this font? Thanks...

HTTP could not register URL http://+:8000/HelloWCF/. Your process does not have access rights to this namespace

I'm a beginner in WCF, but trying to improve my experience. And on the first step I faced the problem. I created the simplest WCF service. The listing of code: (all the code in one file) using System..

Android: install .apk programmatically

I made this with help from Android download binary file problems and Install Application programmatically on Android. I want to make auto-update and auto-install at once. It is local so it's non-ma..

What is WebKit and how is it related to CSS?

More recently, I have been seeing questions with the tag "webkit". Such questions usually tend to be web-based questions relating to CSS, jQuery, layouts, cross-browers compatibility issues, etc... S..

Python list rotation

Possible Duplicate: Efficient way to shift a list in python I'd like to rotate a Python list by an arbitrary number of items to the right or left (the latter using a negative argument). So..

No Such Element Exception?

So here is my code: public static void getArmor(String treasure) throws FileNotFoundException{ Random rand=new Random(); Scanner file=new Scanner(new File ("armor.txt")); while(!file...

How to mock a final class with mockito

I have a final class, something like this: public final class RainOnTrees{ public void startRain(){ // some code here } } I am using this class in some other class like this: publi..

Assembly - JG/JNLE/JL/JNGE after CMP

I don't understand the JG/JNLE/JL/JNGE instructions, which come after CMP. for example, If I have: CMP al,dl jg label1 When al=101; dl =200. On what we ask the jg? Is it on al>dl? or al-dl>..

Objective-C and Swift URL encoding

I have a NSString like this: http://www. but I want to transform it to: http%3A%2F%2Fwww. How can I do this?..

Plotting in a non-blocking way with Matplotlib

I have been playing with Numpy and matplotlib in the last few days. I am having problems trying to make matplotlib plot a function without blocking execution. I know there are already many threads her..

FileSystemWatcher Changed event is raised twice

I have an application where I am looking for a text file and if there are any changes made to the file I am using the OnChanged eventhandler to handle the event. I am using the NotifyFilters.LastWrite..

How can I create a Java method that accepts a variable number of arguments?

For example, Java's own String.format() supports a variable number of arguments. String.format("Hello %s! ABC %d!", "World", 123); //=> Hello World! ABC 123! How can I make my own function that ..

Iterate through object properties

_x000D_ _x000D_ var obj = {_x000D_ name: "Simon",_x000D_ age: "20",_x000D_ clothing: {_x000D_ style: "simple",_x000D_ hipster: false_x000D_ }_x000D_ }_x000D_ _x000D_ fo..

Loop through columns and add string lengths as new columns

I have a data frame with a number of columns, and would like to output a separate column for each with the length of each row in it. I am trying to iterate through the column names, and for each colu..

How to display multiple notifications in android

I am receiving only one notification and if there comes another notification, it replaces the previous one and here is my code private static void generateNotification(Context context, String message..

Center align "span" text inside a div

I have a HTML code as; <div class="left"> <span class="panelTitleTxt">Title text</span> </div> My CSS is as follows; .left { background-color: #999999; height: 50px..

Ajax passing data to php script

I am trying to send data to my PHP script to handle some stuff and generate some items. $.ajax({ type: "POST", url: "test.php", data: "album="+ this.title, success: function(resp..

How to print a dictionary's key?

I would like to print a specific Python dictionary key: mydic = {} mydic['key_name'] = 'value_name' Now I can check if mydic.has_key('key_name'), but what I would like to do is print the name of th..

Rollback to last git commit

I just did a git commit -m "blah" then I added some files, how do I rollback and remove what is in my current files that have not yet been added/committed?..

Cursor adapter and sqlite example

Hello I am looking for sample code in which cursor adapter is used with sqlite?..

Truncate string in Laravel blade templates

Is there a truncate modifier for the blade templates in Laravel, pretty much like Smarty? I know I could just write out the actual php in the template but i'm looking for something a little nicer to ..

Why use prefixes on member variables in C++ classes

A lot of C++ code uses syntactical conventions for marking up member variables. Common examples include m_memberName for public members (where public members are used at all) _memberName for private..

HTTP Basic: Access denied fatal: Authentication failed

I use GitLab Community Edition 9.1.3 2e4e522 on Windows 10 Pro x64. With Git client. Error Cloning into 'project_name'... remote: HTTP Basic: Access denied fatal: Authentication failed for 'http://m..

Python Requests library redirect new url

I've been looking through the Python Requests documentation but I cannot see any functionality for what I am trying to achieve. In my script I am setting allow_redirects=True. I would like to know ..

Could not connect to Redis at Connection refused with homebrew

Using homebrew to install Redis but when I try to ping Redis it shows this error: Could not connect to Redis at Connection refused Note : I tried to turn off firewall and edit conf..

How to do Select All(*) in linq to sql

How do you select all rows when doing linq to sql? Select * From TableA In both query syntax and method syntax please...

Stopping a windows service when the stop option is grayed out

I have created a windows service and in the service in control panel -> administrative tools -> services, its status is starting. I want to stop this service, but the stop option is grayed out. How c..

How to pass List from Controller to View in MVC 3

I have a List<> binded with some data in Controller action and I want to pass that List<> to View to bind with DataGrid in Razor View. I am new to MVC.Can any one help me how to pass and how to..

How can I remove a pytz timezone from a datetime object?

Is there a simple way to remove the timezone from a pytz datetime object? e.g. reconstructing dt from dt_tz in this example: >>> import datetime >>> import pytz >>> dt = da..

What data is stored in Ephemeral Storage of Amazon EC2 instance?

I am trying to stop a Amazon EC2 instance and get the warning message Warning: Please note that any data on the ephemeral storage of your instance will be lost when it is stopped. My Question ..

How to remove single character from a String

For accessing individual characters of a String in Java, we have String.charAt(2). Is there any inbuilt function to remove an individual character of a String in java? Something like this: if(Strin..

Algorithm to calculate the number of divisors of a given number

What would be the most optimal algorithm (performance-wise) to calculate the number of divisors of a given number? It'll be great if you could provide pseudocode or a link to some example. EDIT: All..

Declaring variables inside or outside of a loop

Why does the following work fine? String str; while (condition) { str = calculateStr(); ..... } But this one is said to be dangerous/incorrect: while (condition) { String str = calcula..

How to get jQuery to wait until an effect is finished?

I am sure I read about this the other day but I can't seem to find it anywhere. I have a fadeOut() event after which I remove the element, but jQuery is removing the element before it has the chance t..

awk partly string match (if column/word partly matches)

My dummy file looks like this: C1 C2 C3 1 a snow 2 b snowman snow c sowman I want to get line if there is string snow in $3. I can do this like this: awk '(..

How to import large sql file in phpmyadmin

I want to import a sql file of approx 12 mb. But its causing problem while loading. Is there any way to upload it without splitting the sql file ?..

VB6 IDE cannot load MSCOMCTL.OCX after update KB 2687323

After windows update installed security update KB2687323, my VB6 project fails to load. Displayed error message is "'[project_vbp_path]/MSCOMCTL.OCX' could not be loaded--Continue Loading Project?". N..

Is there an API to get bank transaction and bank balance?

I'm using CHASE bank. (Also Bank of America) and I want to get my bank transactions and my balance if I can. Is there an API for that? in PHP or JAVA? If so, please let me know how to get them...

VB.NET Connection string (Web.Config, App.Config)

Really having an annoying time with connection strings. I have two projects together in a single solution. A Web forms application acting as the presentation layer, and a class library supporting it ..

Add timestamp column with default NOW() for new rows only

I have a table that has thousands of rows. Since the table wasn't constructed with created_at column initially, there is no way of getting their creation timestamp. It is crucial though to start getti..

How to get docker-compose to always re-create containers from fresh images?

My docker images are built on a Jenkins CI server and are pushed to our private Docker Registry. My goal is to provision environments with docker-compose which always start the originally built state ..

Calling a PHP function from an HTML form in the same file

I'm trying to execute a PHP function in the same page after the user enters a text and presses a submit button. The first I think of is using forms. When the user submits a form, a PHP function will ..

SQL ServerĀ® 2016, 2017 and 2019 Express full download

All previous version of SQL Server Express were available in both web and full downloads. But I cannot find full download of SQL ServerĀ® 2016 Express. Does it exist? Asked the same question on MSDN ..

"Connection for controluser as defined in your configuration failed" with phpMyAdmin in XAMPP

I have just installed XAMPP on my Windows XP machine, and I get an error saying: Connection for controluser as defined in your configuration failed. Before I installed XAMPP, I had a MySQL datab..

JSON Stringify changes time of date because of UTC

My date objects in JavaScript are always represented by UTC +2 because of where I am located. Hence like this Mon Sep 28 10:00:00 UTC+0200 2009 Problem is doing a JSON.stringify converts the above ..

Setting Margin Properties in code

MyControl.Margin.Left = 10; Error: Cannot modify the return value of 'System.Windows.FrameworkElement.Margin' because it is not a variable ..

Get table names using SELECT statement in MySQL

In MySQL, I know I can list the tables in a database with: SHOW TABLES However, I want to insert these table names into another table, for instance: INSERT INTO metadata(table_name) SHOW TABLES /*..

Allow user to select camera or gallery for image

What I'm trying to do seems very simple, but after a few days of searching I can't quite figure it out. I have an application that allows the user to select multiple(up to 5) images. I'm using an Im..

Find PHP version on windows command line

I just tried to know version of my PHP from windows command typing, C:\> php -v But it is not working. It says php is not recognized as internal or external command...

Is there a better way to run a command N times in bash?

I occasionally run a bash command line like this: n=0; while [[ $n -lt 10 ]]; do some_command; n=$((n+1)); done To run some_command a number of times in a row -- 10 times in this case. Often some_..

What are the differences between struct and class in C++?

This question was already asked in the context of C#/.Net. Now I'd like to learn the differences between a struct and a class in C++. Please discuss the technical differences as well as reasons for c..

How to limit depth for recursive file list?

Is there a way to limit the depth of a recursive file listing in linux? The command I'm using at the moment is: ls -laR > dirlist.txt But I've got about 200 directories and each of them have 10..

How can I list all cookies for the current page with Javascript?

Is there any way to, with help of Javascript, list all cookies associated with the current page? That is, if I don't know the names of the cookies but want to retrieve all the information they contain..

CSS I want a div to be on top of everything

How do I make an html div tag to be on top of everything? ..

Text in HTML Field to disappear when clicked?

I can easily create a html input field that has text already in it. But when the user clicks on the input field the text doesn't disappears but stays there. The user then has to manually remove the te..

Using a dictionary to count the items in a list

I'm new to Python and I have a simple question, say I have a list of items: ['apple','red','apple','red','red','pear'] Whats the simpliest way to add the list items to a dictionary and count how ma..

Want custom title / image / description in facebook share link from a flash app

Possible Duplicate: How does Facebook Sharer select Images? I am making a flash app that demonstrates potensial traffic injuries when driving at different speeds. I want the user to be able..

Java code for getting current time

I am searching code in java for fetching or synchronizing my local PC system time into my application...

Printing integer variable and string on same line in SQL

Ok so I have searched for an answer to this on Technet, to no avail. I just want to print an integer variable concatenated with two String variables. This is my code, that doesn't run: print 'Th..

C99 stdint.h header and MS Visual Studio

To my amazement I just discovered that the C99 stdint.h is missing from MS Visual Studio 2003 upwards. I'm sure they have their reasons, but does anyone know where I can download a copy? Without thi..

When is assembly faster than C?

One of the stated reasons for knowing assembler is that, on occasion, it can be employed to write code that will be more performant than writing that code in a higher-level language, C in particular. ..

Intel's HAXM equivalent for AMD on Windows OS

Is there any equivalent of Intel's HAXM for AMD (Windows OS) or has anybody been able to hack HAXM to make it work on AMD processors (Windows OS)? Also, would Genymotion ( b..

Do you use NULL or 0 (zero) for pointers in C++?

In the early days of C++ when it was bolted on top of C, you could not use NULL as it was defined as (void*)0. You could not assign NULL to any pointer other than void*, which made it kind of useless...

jQuery Dialog Box

Im trying to do a dialog box with jquery. In this dialog box Im going to have terms and conditions. The problem is that the dialog box is only displayed for the FIRST TIME. This is the code. JavaScr..

sqlplus statement from command line

Is it possible to do something like this? $ sqlplus -s user/pass "select 1 from dual" or $ echo "select 1 from dual" | sqlplus -s user/pass I know I can put select 1 from dual in a file and do this:..

how to empty recyclebin through command prompt?

Usually we delete the recycle bin contents by right-clicking it with the mouse and selecting "Empty Recycle Bin". But I have a requirement where I need to delete the recycle bin contents using the com..

How to add custom method to Spring Data JPA

I am looking into Spring Data JPA. Consider the below example where I will get all the crud and finder functionality working by default and if I want to customize a finder then that can be also done e..

Escape a string in SQL Server so that it is safe to use in LIKE expression

How do I escape a string in SQL Server's stored procedure so that it is safe to use in LIKE expression. Suppose I have an NVARCHAR variable like so: declare @myString NVARCHAR(100); And I want to ..

How to use QTimer

In Qt I'm trying to set a QTimer that calls a function called "update" every second. Here is my .cpp file: #include "mainwindow.h" #include "ui_mainwindow.h" #include <QTimer> #include "QDebug"..

Tool to generate JSON schema from JSON data

We have this json schema draft. I would like to get a sample of my JSON data and generate a skeleton for the JSON schema, that I can rework manually, adding things like description, required, etc, whi..

Loading context in Spring using web.xml

Is there a way that a context can be loaded using web.xml in a Spring MVC application?..

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AI" in the equal to operation

I am getting below said collation error since I have moved from a desktop machine to a laptop. My database has hundreds of stored procedures, so any solution like overriding some queries or fix collat..

shell init issue when click tab, what's wrong with getcwd?

once i click Tab on bash, the error message will appear, what's wrong? symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory symlink-ho..

jQuery append text inside of an existing paragraph tag

I am trying to add additional text to the end of a paragraph using jQuery. My thought was to produce a structure like this: Judging by my answers I will clarify. I need to create this structure first..

Get and Set Screen Resolution

How can I collect and change screen resolution using Visual C#?..

Is there a Java equivalent or methodology for the typedef keyword in C++?

Coming from a C and C++ background, I found judicious use of typedef to be incredibly helpful. Do you know of a way to achieve similar functionality in Java, whether that be a Java mechanism, pattern..

Is it really impossible to make a div fit its size to its content?

I'd like to clarify whether it's possible or not to make a div fit its size based on the content's size without having to make elements float or having to make their position absolute. Is it possible?..

PuTTY Connection Manager download?

Where can I still download PuTTY Connection Manager? I am a PuTTY user and finally decided I need to upgrade to a tabbed SSH environment. I found a lot of threads/sites talking about PuTTY Connection..

What are all possible pos tags of NLTK?

How do I find a list with all possible pos tags used by the Natural Language Toolkit (nltk)?..

Convert String to double in Java

How can I convert a String such as "12.34" to a double in Java?..

Can I convert long to int?

I want to convert long to int. If the value of long > int.MaxValue, I am happy to let it wrap around. What is the best way?..

How do I get a consistent byte representation of strings in C# without manually specifying an encoding?

How do I convert a string to a byte[] in .NET (C#) without manually specifying a specific encoding? I'm going to encrypt the string. I can encrypt it without converting, but I'd still like to know wh..

What's the difference between disabled="disabled" and readonly="readonly" for HTML form input fields?

I have read a bit on this, but I can't seem to find anything solid about how different browsers treat things...

How to find good looking font color if background color is known?

There seem to be so many color wheel, color picker, and color matcher web apps out there, where you give one color and the they'll find a couple of other colors that will create a harmonic layout when..

CSS rotate property in IE

I want to rotate the DIV to a certain degree. In FF it functions but in IE I am facing a problem. For example in the following style I can set rotation=1 to 4 filter: progid:DXImageTransform.Micros..

RHEL 6 - how to install 'GLIBC_2.14' or 'GLIBC_2.15'?

I need these 2 packages installed on RHEL 6 linux system. They are required by several other programs. When I do: sudo yum install glibc-devel this is output: Loaded plugins: product-id, securit..

Convert month int to month name

I was simply trying to use the DateTime structure to transform an integer between 1 and 12 into an abbrieviated month name. Here is what I tried: DateTime getMonth = DateTime.ParseExact(Month.ToStri..

jquery how to use multiple ajax calls one after the end of the other

I am in mobile app and I use multiple Ajax calls to receive data from web server like below function get_json() { $(document).ready(function() { $.ajax({ url: 'http://www.xxxx..

Flutter plugin not installed error;. When running flutter doctor

I am configuring Flutter SDK on my Linux Ubuntu 16.4 system. Why am I getting the following error when I run the flutter doctor? I have specified both PATHS for flutter and dart in the .bashrc but I g..

How can one run multiple versions of PHP 5.x on a development LAMP server?

I need to test my PHP applications with multiple versions of PHP 5.x, such as PHP 5.0.0 and PHP 5.2.8. Is there a way that I can configure a development LAMP server so I can quickly test applications..

How to read line by line of a text area HTML tag

I have a text area where each line contains Integer value like follows 1234 4321 123445 I want to check if the user has really enetered valid values and not some funny values like ..

SQL Server : Columns to Rows

Looking for elegant (or any) solution to convert columns to rows. Here is an example: I have a table with the following schema: [ID] [EntityID] [Indicator1] [Indicator2] [Indicator3] ... [Indicator1..

Display XML content in HTML page

How to display XML and other type of data in same page ? <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <cd> <title>Empire Burlesque</title> ..

Listening for variable changes in JavaScript

Is it possible to have an event in JS that fires when the value of a certain variable changes? JQuery is accepted...

How to find the files that are created in the last hour in unix

How to find the files that are created in the last hour in unix..

How to convert HTML to PDF using iTextSharp

I want to convert the below HTML to PDF using iTextSharp but don't know where to start: <style> .headline{font-size:200%} </style> <p> This <em>is </em> <span cla..

Know relationships between all the tables of database in SQL Server

I wish to all know how the tables in my database are related to each other (i.e PK/FK/UK) and hence i created a database diagram of all my tables in SQL Server. The diagram that was created was not ea..

How to get image size (height & width) using JavaScript?

Are there any JavaScript or jQuery APIs or methods to get the dimensions of an image on the page?..

'react-scripts' is not recognized as an internal or external command

I've got a maven project, within which is JavaScript project cloned as a git sub-module. So the directory structure looks like mavenapp/src/main/javascript/[npm project files] Inside my package.json, ..

What is System, out, println in System.out.println() in Java

Possible Duplicate: What's the meaning of System.out.println in Java? I was looking for the answer of what System, out and println are in System.out.println() in the Java. I searched an..

SELECT INTO using Oracle

I'm trying to do a SELECT INTO using Oracle. My query is: SELECT * INTO new_table FROM old_table; But I get the following error: SQL Error: ORA-00905: missing keyword 00905. 00000 - "missing keyw..

jQuery post() with serialize and extra data

I'm trying to find out if it's possible to post serialize() and other data that's outside the form. Here's what I thought would work, but it only sends 'wordlist' and not the form data. $.post("page..

document.all vs. document.getElementById

When should you use document.all vs. document.getElementById?..

Save Javascript objects in sessionStorage

SessionStorage and LocalStorage allows to save key/value pairs in a web browser. The value must be a string, and save js objects is not trivial. var user = {'name':'John'}; sessionStorage.setItem('us..

How to enable CORS in ASP.NET Core

I am trying to enable cross origin resources sharing on my ASP.NET Core Web API, but I am stuck. The EnableCors attribute accepts policyName of type string as parameter: // Summary: // Creates..

Youtube iframe wmode issue

Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", th..

In Eclipse, what can cause Package Explorer "red-x" error-icon when all Java sources compile without errors?

I'm using Eclipse for Java development. All my sources compile fine and the resulting application compiles fine. However, I keep getting an "red-x" error notification in the Package Explorer. All my ..

XPath: How to select elements based on their value?

I am new to using XPath and this may be a basic question. Kindly bear with me and help me in resolving the issue. I have an XML file like this: <RootNode> <FirstChild> <Element a..

Setting PHP default encoding to utf-8?

In the "PHP Cookbook", they say (p.589) that to properly set the char encoding of outgoing data to utf-8 it is necessary to edit the default_encoding configuration to utf-8. However, I cannot find th..

Any reason not to use '+' to concatenate two strings?

A common antipattern in Python is to concatenate a sequence of strings using + in a loop. This is bad because the Python interpreter has to create a new string object for each iteration, and it ends u..

What's a simple way to get a text input popup dialog box on an iPhone

I want to get the user name. A simple text input dialog box. Any simple way to do this?..

Is there any way to have a fieldset width only be as wide as the controls in them?

It seems that fieldset defaults to 100% width of its container. Is there any way that you can have the field set just be as big as the widest control inside the fieldset?..

Order of items in classes: Fields, Properties, Constructors, Methods

Is there an official C# guideline for the order of items in terms of class structure? Does it go: Public Fields Private Fields Properties Constructors Methods ? I'm curious if there is a hard and..

How to multiply a BigDecimal by an integer in Java

How do you multiply a BigDecimal by an integer in Java? I tried this but its not correct. import java.math.BigDecimal; import java.math.MathContext; public class Payment { int itemCost; int ..

How to Use Content-disposition for force a file to download to the hard drive?

I want to force the browser to download a pdf file. I am using the following code : <a href="../doc/quot.pdf" target=_blank>Click here to Download quotation</a> It makes the browser op..

View more than one project/solution in Visual Studio

I am new to visual studio and I am experimenting around with some Windows Services. I have created two solutions and I would like to view both of them at once. Without having to click file->recent pro..

how to get the selected index of a drop down

I have a normal dropdown which I want to get the currently selected index and put that in a variable. Jquery or javascript. Jquery perfered. <select name="CCards"> <option value="0">Selec..

Android: ListView elements with multiple clickable buttons

I've a ListView where every element in the list contains a TextView and two different Buttons. Something like this: ListView -------------------- [Text] [Button 1][Button 2] -------------------- [Tex..

Get next / previous element using JavaScript?

How do I get the next element in HTML using JavaScript? Suppose I have three <div>s and I get a reference to one in JavaScript code, I want to get which is the next <div> and which is the..

Allow multi-line in EditText view in Android?

How to allow multi-line in Android's EditText view?..

Uri content://media/external/file doesn't exist for some devices

I have an issue with some devices. I cannot replicate it on any device but I have quite a lot of crash reports reported by some users. It is this exception: java.lang.IllegalArgumentException: Unkno..

Most efficient way to find mode in numpy array

I have a 2D array containing integers (both positive or negative). Each row represents the values over time for a particular spatial site, whereas each column represents values for various spatial sit..

RegEx match open tags except XHTML self-contained tags

I need to match all of these opening tags: <p> <a href="foo"> But not these: <br /> <hr class="foo" /> I came up with this and wanted to make sure I've got it right. I am..

Unzip a file with php

I want to unzip a file and this works fine system('unzip'); But I need to pass in the file name through the URL and can not get it to work, this is what I have. $master = $_GET["master"]..

AngularJS Multiple ng-app within a page

I have just started learning Angular JS and created some basic samples however I am stuck with the following problem. I have created 2 modules and 2 controllers. shoppingCart -> ShoppingCartContr..

how do I set height of container DIV to 100% of window height?

I have a couple of problems with my container DIV. For one it is not recognising the height of my content correctly (I would have thought it would extend beyond the bottom of the main content and sid..

Convert an integer to an array of digits

I try to convert an integer to an array. For example, 1234 to int[] arr = {1,2,3,4};. I've written a function: public static void convertInt2Array(int guess) { String temp = Integer.toString(gues..

How to comment in Vim's config files: ".vimrc"?

How do I add a comment in Vim's configuration files, like .vimrc?..

How to strip a specific word from a string?

I need to strip a specific word from a string. But I find python strip method seems can't recognize an ordered word. The just strip off any characters passed to the parameter. For example: >>..


I've a table like: +-----------+-------+------------+ | client_id | views | percentage | +-----------+-------+------------+ | 1 | 6 | 20 | | 1 | 4 | 55 | | ..

What is the point of "Initial Catalog" in a SQL Server connection string?

Every SQL Server connection string I ever see looks something like this: Data Source=MyLocalSqlServerInstance;Initial Catalog=My Nifty Database; Integrated Security=SSPI; Do I need the Initial ..

Can you get the column names from a SqlDataReader?

After connecting to the database, can I get the name of all the columns that were returned in my SqlDataReader?..

Color a table row with style="color:#fff" for displaying in an email

We would like to display order details as table in an email ?<table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> ..

Include another JSP file

I am currently trying to learn JSP. My question is, at present I used to include the header and footer of the page using: <%@include file="includes/header.jsp" %> and <%@include file="in..

What does the arrow operator, '->', do in Java?

While hunting through some code I came across the arrow operator, what exactly does it do? I thought Java did not have an arrow operator. return (Collection<Car>)

FtpWebRequest Download File

The following code is intended to retrieve a file via FTP. However, I'm getting an error with it. serverPath = "ftp://x.x.x.x/tmp/myfile.txt"; FtpWebRequest request = (FtpWebRequest)WebRequest.Crea..

How can I do factory reset using adb in android?

How can I do the factory reset in android using ADB command? I had used adb reboot recovery command to get reset. But third party applications couldn't be cleared somehow.Is it correct way to achieve ..