Questions Tagged with #Gae eclipse plugin

iPhone - Grand Central Dispatch main thread

I have been using with success, grand central dispatch in my apps, but I was wondering what is the real advantage of using something like this: dispatch_async(dispatch_get_main_queue(), ^{ ... do stu..

Sass calculate percent minus px

I want to be able to do the following: height: 25% - 5px; Obviously when I do that I get the error: Incompatible units: 'px' and '%'. ..

How to disable scrolling in UITableView table when the content fits on the screen

I have a few (grouped style) tables in my iphone app (only on part of the screen and added with Interface Builder though, not subclassed from UITableViewController) that 80% of the time are small and ..

Add / Change parameter of URL and redirect to the new URL

If the &view-all parameter does NOT exist in the URL I need to add it to the end of the URL along with a value. If it DOES exist then I need to be able to just change the value without creating a ..

Set a path variable with spaces in the path in a Windows .cmd file or batch file

I'm new to script writing and can't get this one to work. I could if I moved the files to a path without a space in it, but I'd like it to work with the space if it could. I want to extract a bunc..

Regular expression [Any number]

I need to test for "[any number]" in a string in javascript. how would i match it? Oh, "[" and "]" also need to be matched. so string like "[1]" or "[12345]" is a match. Non match: "[23432" or "1]..

How to remove tab indent from several lines in IDLE?

If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE...

Android Studio error: "Environment variable does not point to a valid JVM installation"

When trying to run Android Studio on my computer, I get the following error: The Environment variable JAVA_HOME (with a value of C:\Program Files(x86)\Java\jdk1.7.0_51\bin) does not point to a va..

Embed Youtube video inside an Android app

I'm using a WebView for displaying embedded Youtube video and that works on Galaxcy S2 (OS 2.3.5) and doesn't on Nexus S (OS 2.3.4), all I get is white screen without any video display. Here is the c..

How to add time to DateTime in SQL

I'm trying to add custom time to datetime in SQL Server 2008 R2. Following is what I've tried. SELECT DATEADD(hh, 03, DATEADD(mi, 30, DATEADD(ss, 00, DATEDIFF(dd, 0,GETDATE())))) as Customtime Us..

Creating a new column based on if-elif-else condition

I have a DataFrame df: A B a 2 2 b 3 1 c 1 3 I want to create a new column based on the following criteria: if row A == B: 0 if rowA > B: 1 if row A < B: -1 so giv..

JS: Uncaught TypeError: object is not a function (onclick)

Edit: Here's a JSfiddle Edit2: The error is on this line: <input type="button" value="totalbandwidthresult" onclick="javascript:totalbandwidth();"> Trying to have a button perform a calculat..

Which ORM should I use for Node.js and MySQL?

I'm rewriting a project to use Node.js. I'd like to keep using MySQL as the DB (even though I don't mind rewriting the schema). I'm looking for a simple-to-use, reasonable-performance ORM, which suppo..

Vue.js getting an element within a component

I have a component, how can I select one of its elements? I'm trying to get an input that is within this component's template. There could be multiple components so the querySelector must only parse t..

How can I get a value from a map?

I have a map named valueMap as follows: typedef std::map<std::string, std::string>MAP; MAP valueMap; ... // Entering data. Then I am passing this map to a function by reference: void functio..

How to make a new line or tab in <string> XML (eclipse/android)?

So, in my strings.xml I have a very long text which I want to format somehow. How can I put a tab before the first sentence of the text? Also, what is the code for new line? Thanks..

Create array of regex matches

In Java, I am trying to return all regex matches to an array but it seems that you can only check whether the pattern matches something or not (boolean). How can I use a regex match to form an array ..

How to create an empty DataFrame with a specified schema?

I want to create on DataFrame with a specified schema in Scala. I have tried to use JSON read (I mean reading empty file) but I don't think that's the best practice...

Replace all double quotes within String

I am retrieving data from a database, where the field contains a String with HTML data. I want to replace all of the double quotes such that it can be used for parseJSON of jQuery. Using Java, I am t..

Python: How exactly can you take a string, split it, reverse it and join it back together again?

How exactly can you take a string, split it, reverse it and join it back together again without the brackets, commas, etc. using python?..

Dynamically update values of a chartjs chart

I created an basic bar chart using chartjs and it works fine. Now I want to update the values on a time based interval. My problem is that after I created the chart, I do not know how to update its va..

Use jQuery to change value of a label

I have a label, costLabel. What I want to be able to do is change the value of this label depending on the selected value of a dropdownlist. This is my HTML: <table> <tr> <td ..

Accessing Google Spreadsheets with C# using Google Data API

I'm having some information in Google Spreadsheets as a single sheet. Is there any way by which I can read this information from .NET by providing the google credentials and spreadsheet address. Is it..

Return from lambda forEach() in java

I am trying to change some for-each loops to lambda forEach()-methods to discover the possibilities of lambda expressions. The following seems to be possible: ArrayList<Player> playersOfTeam = ..

Twitter Bootstrap - add top space between rows

How to add margin top to class="row" elements using twitter bootstrap framework?..

Can I scroll a ScrollView programmatically in Android?

Is there any way to scroll a ScrollView programmatically to a certain position? I have created dynamic TableLayout which is placed in a ScrollView. So I want that on a specific action (like clicking ..

Mongoose limit/offset and count query

Bit of an odd one on query performance... I need to run a query which does a total count of documents, and can also return a result set that can be limited and offset. So, I have 57 documents in tota..

MD5 is 128 bits but why is it 32 characters?

I read some docs about md5, it said that its 128 bits, but why is it 32 characters? I can't compute the characters. 1 byte is 8 bits if 1 character is 1 byte then 128 bits is 128/8 = 16 bytes right?..

Twitter Bootstrap 3, vertically center content

I know this has been asked a thousand time but I can't find a way to make the text and image to be centered vertically. I'm using Twitter Bootstrap 3 with dynamic content so therefor, I do not know t..

Defining private module functions in python

According to http://www.faqs.org/docs/diveintopython/fileinfo_private.html: Like most languages, Python has the concept of private elements: Private functions, which can't be called from outside the..

Is nested function a good approach when required by only one function?

Let's say that a function A is required only by function B, should A be defined inside B? Simple example. Two methods, one called from another: def method_a(arg): some_data = method_b(arg) def me..

How do I get an empty array of any size in python?

I basically want a python equivalent of this in C: int a[x]; but in python I declare an array like: a = [] and the problem is I want to assign random slots with values like: a[4] = 1 but I ca..

Is JVM ARGS '-Xms1024m -Xmx2048m' still useful in Java 8?

I have a Java 7 application using JVM ARGS: -Xms1024m -Xmx2048m, and it runs pretty well. After I upgrade to Java 8, it runs in error state with Exception: Exception in thread "main" java.lang.OutOf..

How to reference image resources in XAML?

I put an Image control on a Window and I would like to display an image that is stored in a project resource file named "Resources.resx". The name of the image in the resource file is 'Search'. Coul..

Mocking static methods with Mockito

I've written a factory to produce java.sql.Connection objects: public class MySQLDatabaseConnectionFactory implements DatabaseConnectionFactory { @Override public Connection getConnection() { ..

How to round down to nearest integer in MySQL?

How would I round down to the nearest integer in MySQL? Example: 12345.7344 rounds to 12345 mysql's round() function rounds up. I don't know how long the values nor the decimal places will be, cou..

'was not declared in this scope' error

So I was writing this simple program to calculate the day of any date using the Gaussian algorithm found here. #include <iostream> using namespace std; //Using the Gaussian algorithm int dayof..

Sending POST parameters with Postman doesn't work, but sending GET parameters does

I'm trying to test a simple PHP page using the Chrome extension Postman. When I send URL parameters, the script works fine (eg the variables are available in the $_REQUEST parameter). When I send them..

How do I populate a JComboBox with an ArrayList?

I need to populate a JComboBox with an ArrayList. Is there any way to do this?..

How can I display an RTSP video stream in a web page?

I have an ip camera which provides a live RTSP video stream. I can use VLC media player to view the feed by providing it with the URL: rtsp://cameraipaddress But I need to display the feed on a web..

What is logits, softmax and softmax_cross_entropy_with_logits?

I was going through the tensorflow API docs here. In the tensorflow documentation, they used a keyword called logits. What is it? In a lot of methods in the API docs it is written like tf.nn.softmax(..

How to create batch file in Windows using "start" with a path and command with spaces

I need to create a batch file which starts multiple console applications in a Windows .cmd file. This can be done using the start command. However, the command has a path in it. I also need to pass..

Placing border inside of div and not on its edge

I have a <div> element and I want to put a border on it. I know I can write style="border: 1px solid black", but this adds 2px to either side of the div, which is not what I want. I would ra..

How to format date in angularjs

I want to format date as mm/dd/yyyy. I tried the following and none of it works for me. Can anyone help me with this? reference: ui-date <input ui-date ui-date-format="mm/dd/yyyy" ng-model="value..

How is CountDownLatch used in Java Multithreading?

Can someone help me to understand what Java CountDownLatch is and when to use it? I don't have a very clear idea of how this program works. As I understand all three threads start at once and each T..

Removing App ID from Developer Connection

How do I remove an App ID from the developer program portal area? I mistakenly added a couple of app id's under the wrong login and would like to remove them, but I am not seeing a way to do so...

Disable Scrolling on Body

I would like to disable scrolling on the HTML body completely. I have tried the following options: overflow: hidden; (not working, did not disable scrolling, it just hid the scrollbar) position: fix..

Untrack files from git temporarily

I have setup a local git on my machine. When I initialized git, I added pre-compiled libs and binaries. However, now during my development I don't want to check in those files intermittently. I dont w..

Get ID of element that called a function

How can I get the ID of an element that called a JS function? body.jpg is an image of a dog as the user points his/her mouse around the screen at different parts of the body an enlarged image is sho..

I want my android application to be only run in portrait mode?

I want my android application to be only run in portrait mode? How can I do that?..

MSOnline can't be imported on PowerShell (Connect-MsolService error)

I had this issue and couldn´t find any answer. The issue was that I was trying to use Azure cdmlets to connect to O365 via c# code, but I couldn´t get the connect-msolservice. ""The term is not..

How to write dynamic variable in Ansible playbook

Based on extra vars parameter I Need to write variable value in ansible playbook ansible-playbook playbook.yml -e "param1=value1 param2=value2 param3=value3" If only param1 passed myvariable: 'par..

MatPlotLib: Multiple datasets on the same scatter plot

I want to plot multiple data sets on the same scatter plot: cases = scatter(x[:4], y[:4], s=10, c='b', marker="s") controls = scatter(x[4:], y[4:], s=10, c='r', marker="o") show() The above only s..

How to fix: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

I am configuring an MVC 3 project to work on a local install of IIS and came across the following 500 error: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in ..

When should I use a trailing slash in my URL?

When should a trailing slash be used in a URL? For example - should my URL look like /about-us/ or like /about-us? I am fully aware of the SEO-related issues - duplicate content and the canonical thi..

Is Safari on iOS 6 caching $.ajax results?

Since the upgrade to iOS 6, we are seeing Safari's web view take the liberty of caching $.ajax calls. This is in the context of a PhoneGap application so it is using the Safari WebView. Our $.ajax cal..

Set default host and port for ng serve in config file

I want to know if i can set a host and a port in a config file so I don't have to type ng serve --host foo.bar --port 80 instead of just ng serve ..

successful/fail message pop up box after submit?

Basically after clicking the submit button, I want a pop up box to pop up saying successful or fail, then clicking OK to confirm the message. At the moment i am getting a pop up box "undefined" follow..

How to check if a query string value is present via JavaScript?

How can I check if the query string contains a q= in it using JavaScript or jQuery?..

Delete forked repo from GitHub

I'm starting with git and GitHub and there's a project I'm watching on GitHub. I unintentionally clicked to fork it. Now it appears as a new project to me. I have some doubts about it: I know if co..

mongodb/mongoose findMany - find all documents with IDs listed in array

I have an array of _ids and I want to get all docs accordingly, what's the best way to do it ? Something like ... // doesn't work ... of course ... model.find({ '_id' : [ '4ed3ede8844f0..

Which icon sizes should my Windows application's icon include?

I have a Windows application which will run in Windows XP and newer (i.e. Vista/7). According to the Vista UI Guidelines, the standard sizes are 16x16, 32x32, 48x48, 256x256 (XP standard sizes do not ..

Missing artifact com.oracle:ojdbc6:jar:11.2.0 in pom.xml

I am using Eclipse Luna and working on a maven project. When I add the entry for ojdbc jar in pom.xml , it is giving error in the xml. I can't find any reason for the issue as groupId, artifactId an..

How to modify memory contents using GDB?

I know that we can use several commands to access and read memory: for example, print, p, x... But how can I change the contents of memory at any specific location (while debugging in GDB)? ..

How to execute cmd commands via Java

I am trying to execute command line arguments via Java. For example: // Execute command String command = "cmd /c start cmd.exe"; Process child = Runtime.getRuntime().exec(command); // Get output str..

How to bring an activity to foreground (top of stack)?

In Android, I defined an activity ExampleActivity. When my application was launched, an instance of this A-Activity was created, say it is A. When user clicked a button in A, another instance of B-A..

Android: remove notification from notification bar

I have created an application and with an event I manage to add notification in android notification bar. Now I need sample how to remove that notification from notification bar on an event ?? ..

enable/disable zoom in Android WebView

There are some methods in WebSettings related to zoom: WebSettings.setSupportZoom WebSettings.setBuiltInZoomControls I noticed they work differently on some devices. For example, on my Galaxy S pi..

List all indexes on ElasticSearch server?

I would like to list all indexes present on an ElasticSearch server. I tried this: curl -XGET localhost:9200/ but it just gives me this: { "ok" : true, "status" : 200, "name" : "El Aguila", ..

"TypeError: (Integer) is not JSON serializable" when serializing JSON in Python?

I am trying to send a simple dictionary to a json file from python, but I keep getting the "TypeError: 1425 is not JSON serializable" message. import json alerts = {'upper':[1425],'lower':[576],'leve..

How to Auto resize HTML table cell to fit the text size

I have a table with 2 rows and variable columns. I tried width = 100% for the column. So the first content in the view will fit. But suppose if i am changing the contents dynamically then it is not dy..

How to download a file from a website in C#

Is it possible to download a file from a website in Windows Application form and put it into a certain directory?..

Can angularjs routes have optional parameter values?

Can I set a route with optional params (same template and controller, but some params should be ignored if they don't exist? So instead of writing the following two rules, have only one? module.conf..

Can't find SDK folder inside Android studio path, and SDK manager not opening

I have installed Android Studio for the millionth time but when i go to C:\Program Files\Android\Android Studio , i can't find any folder named "SDK" , can't find it any where on the computer either. ..

psql - save results of command to a file

I'm using psql's \dt to list all tables in a database and I need to save the results. What is the syntax to export the results of a psql command to a file?..

Ant build failed: "Target "build..xml" does not exist"

When I run the ant file in verbose mode, I got an error like the one below. Does anyone have any ideas what is going wrong? I am new to this antlib:org.apache.tools.ant] Could not load definitions fr..

Refresh or force redraw the fragment

I have a fragment that inflates an xml layout. My requirement is to update the text size on all my views inside my fragment when my Activity is resumed. I tried fragment.getView().invalidate(); ..

Android Text over image

I have an imageView with an image, over that image I want to place a text. How can I achieve that?..

Twitter Bootstrap 3 Sticky Footer

I have been using the twitter bootstrap framework for quite a while now and they recently updated to version 3! I'm having trouble getting the sticky footer to stick to the bottom, I have used the st..

How to convert a string of numbers to an array of numbers?

I have below string - var a = "1,2,3,4"; when I do - var b = a.split(','); I get b as ["1", "2", "3", "4"] can I do something to get b as [1, 2, 3, 4] ?..

Argparse optional positional arguments?

I have a script which is meant to be used like this: usage: installer.py dir [-h] [-v] dir is a positional argument which is defined like this: parser.add_argument('dir', default=os.getcwd()) I wa..

Redirect to Action in another controller

I have two controllers, both called AccountController. One of them, lets call it Controller A, is in an Area called Admin and the other, lets call it Controller B, is not in any Area (I guess that me..

Edittext change border color with shape.xml

I make a shape.xml file under res -> drawable folder. <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" android:shape="recta..

Show tables, describe tables equivalent in redshift

I'm new to aws, can anyone tell me what are redshifts' equivalents to mysql commands? show tables -- redshift command describe table_name -- redshift command ..

Import Excel Spreadsheet Data to an EXISTING sql table?

I have a table called tblAccounts whose contents will come from an excel spreadsheet. I am using MS SQL Server 2008 (x64) on a Windows 8.1 (x64) I tried using the SQL Server Import/Export Wizard but..

How can I create a Windows .exe (standalone executable) using Java/Eclipse?

I'm new to the programming scene. Been working with C++ for about 5 months now, and have decided I want to start getting into Java. I'm using Eclipse as my IDE, and obviously Java for the language. ..

In PHP, what is a closure and why does it use the "use" identifier?

I'm checking out some PHP 5.3.0 features and ran across some code on the site that looks quite funny: public function getTotal($tax) { $total = 0.00; $callback = /* This line here: *..

Git Server Like GitHub?

I am a long time Subversion user that is going to try Git. I have read some about it and understand the distributed nature - I can see a lot of the benefits. However, I do like the idea of a centr..

How to correctly link php-fpm and Nginx Docker containers?

I am trying to link 2 separate containers: nginx:latest php:fpm The problem is that php scripts do not work. Perhaps the php-fpm configuration is incorrect. Here is the source code, which is in my..

How to explain callbacks in plain english? How are they different from calling one function from another function?

How to explain callbacks in plain English? How are they different from calling one function from another function taking some context from the calling function? How can their power be explained to a n..

Failed to load resource: the server responded with a status of 404 (Not Found) css

I'm having trouble getting my browser to display the css for the app I am creating. I have looked at the same question asked by other users but have not found any of the answers to help in my situatio..

How can I de-install a Perl module installed via `cpan`?

I am using Perl running in user space (not installed via root) and installing modules via the command-line cpan. I would like to know if there is a simple way to remove a module without having to do a..

Java - sending HTTP parameters via POST method easily

I am successfully using this code to send HTTP requests with some parameters via GET method void sendRequest(String request) { // i.e.: request = "http://example.com/index.php?param1=a&param..

UIButton: how to center an image and a text using imageEdgeInsets and titleEdgeInsets?

If I put only an image in a button and set the imageEdgeInsets more close to the top, the image stays centered and all works as expected: [button setImage:image forState:UIControlStateNormal]; [butto..

Limiting floats to two decimal points

I want a to be rounded to 13.95. >>> a 13.949999999999999 >>> round(a, 2) 13.949999999999999 The round function does not work the way I expected...

javac option to compile all java files under a given directory recursively

I am using the javac compiler to compile java files in my project. The files are distributed over several packages like this: com.vistas.util, com.vistas.converter, com.vistas.LineHelper, com.current...

Redis command to get all available keys?

Is there a Redis command for fetching all keys in the database? I have seen some python-redis libraries fetching them. But was wondering if it is possible from redis-client...

How to exit from PostgreSQL command line utility: psql

What command or short key can I use to exit the PostgreSQL command line utility psql?..

SqlException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null

What does sqlcode -302 means? Where do i get the sqlcode definitions? Please advice Thanks,..

How to enable curl in Wamp server

I try 30 combination of answer and forum topic but did not find the right answer. I do all but how I can enable the curl int wamp server becouse I need that? is there any solution? I try to uncomme..

How to squash commits in git after they have been pushed?

This gives a good explanation of squashing multiple commits: http://git-scm.com/book/en/Git-Branching-Rebasing but it does not work for commits that have already been pushed. How do I squash the most ..

How to start an Intent by passing some parameters to it?

I would like to pass some variables in the constructor of my ListActivity I start activity via this code: startActivity(new Intent (this, viewContacts.class)); I would like to use similar code, ..

Posting parameters to a url using the POST method without using a form

I want to post parameters to a URL using the POST method but I cannot use a form. Even if I do use a form, it would have to be auto-posted with out user interaction. Is this possible? How can I do thi..

jQuery datepicker set selected date, on the fly

How can I change the selected date of jquery Date picker dynamically on the fly? I have say created a inline date picker. Then after some time, I want to reflect a different date there without recreat..

How to change current Theme at runtime in Android

I've created a PreferenceActivity that allows the user to choose the theme he wants to apply to the entire application. When the user selects a theme, this code is executed: if (...) { getApplic..

Syntax for a single-line Bash infinite while loop

I am having trouble coming up with the right combination of semicolons and/or braces. I'd like to do this, but as a one-liner from the command line: while [ 1 ] do foo sleep 2 done ..

Using Google maps API v3 how do I get LatLng with a given address?

If a user inputs an address, I want to convert to the equivalent LatLng. I've read the documentation, and I think I can use the Geocoder class to do this, but can't figure out how to implement it. T..

Create a folder and sub folder in Excel VBA

I have a pull down menu of companies that is populated by a list on another sheet. Three columns, Company, Job #, and Part Number. When a job is created I need a folder for said company and a sub-fo..

Android - Set fragment id

How can I set a Fragment's Id so that I can use getSupportFragmentManager().findFragmentById(R.id.--)?..

ArrayList vs List<> in C#

What is the difference between ArrayList and List<> in C#? Is it only that List<> has a type while ArrayList doesn't?..

Set QLineEdit to accept only numbers

I have a QLineEdit where the user should input only numbers. So is there a numbers-only setting for QLineEdit?..

Label points in geom_point

The data I'm playing with comes from the internet source listed below nba <- read.csv("http://datasets.flowingdata.com/ppg2008.csv", sep=",") What I want to do, is create a 2D points graph compa..

How to get all key in JSON object (javascript)

{"document": {"people":[ {"name":["Harry Potter"],"age":["18"],"gender":["Male"]}, {"name":["hermione granger"],"age":["18"],"gender":["Female"]}, ]} } From this JSON example, I would li..

Jenkins returned status code 128 with github

With GitHub command I have: ssh -T [email protected] Hi (MyName)! You've successfully authenticated, but GitHub does not provide shell access. My connection with GitHub is ok (no problem), but with Je..

SQL Error: ORA-00922: missing or invalid option

CREATE TABLE chartered flight(flight_no NUMBER(4) PRIMARY KEY , customer_id NUMBER(6) REFERENCES customer(customer_id) , aircraft_no NUMBER(4) REFERENCES aircraft(aircraft_no) , flight_type VARCHAR2 (..

How do I use the JAVA_OPTS environment variable?

How do I use the JAVA_OPTS variable to configure a web server (a linux server)? How can I set -Djava.awt.headless=true using JAVA_OPTS?..

FFT in a single C-file

I was looking for a FFT implementation in C. However, I am not looking for a huge library (like FFTW) but for a easy to use single C-file implementation. Unfortunately I haven't been able to find anyt..

How to get current screen width in CSS?

I use the following CSS code for formatting when screen width is less than 480px, and it works well. @media screen and (min-width: 480px) { body { background-color: lightgreen; } } I ..

Fastest Way of Inserting in Entity Framework

I'm looking for the fastest way of inserting into Entity Framework. I'm asking this because of the scenario where you have an active TransactionScope and the insertion is huge (4000+). It can potentia..

Where do I put my php files to have Xampp parse them?

I finished installing Ubuntu 10 for netbooks, and XAMPP. The XAMPP website tutorial made it very easy to install, then left me high and dry. Everything works, but I have no idea where to put my handwr..

Excel formula to remove space between words in a cell

I've a huge data in excel file. For eg: say i've a word like paul son,i've to make it as paulson. input:paul son output:paulson. In some cells ,i've data like mic-li,when this type of words come,it..

Extract digits from string - StringUtils Java

I have a String and I want to extract the (only) sequence of digits in the string. Example: helloThisIsA1234Sample. I want the 1234 It's a given that the sequence of digits will occur only once wit..

Using dig to search for SPF records

I am using dig installed on my machine to search for SPF records for a particular domain. Is there a way to search a particular DNS server for the SPF records? For example, will the following work? ..

jQuery event for images loaded

Is it possible to detect when all images are loaded via a jQuery event? Ideally, there should be a $(document).idle(function() { } or $(document).contentLoaded(function() { } But I can't find ..

How do I pause my shell script for a second before continuing?

I have only found how to wait for user input. However, I only want to pause so that my while true doesn't crash my computer. I tried pause(1), but it says -bash: syntax error near unexpected token '..

Python, creating objects

I'm trying to learn python and I now I am trying to get the hang of classes and how to manipulate them with instances. I can't seem to understand this practice problem: Create and return a student o..

Where is the IIS Express configuration / metabase file found?

Where can the IIS Express configuration / metabase file be found?..

Copy multiple files with Ansible

How can I copy more than a single file into remote nodes by Ansible in a task? I've tried to duplicate the copy module line in my task to define files but it only copies the first file...

.gitignore is ignored by Git

My .gitignore file seems to be being ignored by Git - could the .gitignore file be corrupt? Which file format, locale or culture does Git expect? My .gitignore: # This is a comment debug.log nbproje..

copy from one database to another using oracle sql developer - connection failed

I am trying to copy a table from one database to another using oracle sql developer. I have the username, password and SIDs. copy from uname1/password1@SID1 to uname2/pwd2@SID2 insert table1 (*) usin..

Selenium WebDriver.get(url) does not open the URL

from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0 import time # Create a new inst..

Keyboard shortcut to paste clipboard content into command prompt window (Win XP)

Is there a keyboard shortcut for pasting the content of the clipboard into a command prompt window on Windows XP (instead of using the right mouse button)? The typical Shift+Insert does not seem to w..

Hide Show content-list with only CSS, no javascript used

I've been searching for a good trick to make a Hide/Show content or a list with only CSS and no javascript. I've managed to make this action: <!DOCTYPE html> <head> <style> ..

How do I put my website's logo to be the icon image in browser tabs?

The image next to the page title in the browser tab - how can you link an image here?..

How can I download a specific Maven artifact in one command line?

I can install an artifact by install:install-file, but how can I download an artifact? For example: mvn download:download-file -DgroupId=.. -DartifactId=.. -Dversion=LATEST ..

How to get the latest record in each group using GROUP BY?

Let's say I have a table called messages with the columns: id | from_id | to_id | subject | message | timestamp I want to get the latest message from each user only, like you would see in your Face..

Why use String.Format?

Why would anyone use String.Format in C# and VB .NET as opposed to the concatenation operators (& in VB, and + in C#)? What is the main difference? Why are everyone so interested in using String...

Reset select value to default

I have select box <select id="my_select"> <option value="a">a</option> <option value="b" selected="selected">b</option> <option value="c">c</option&..

Force flex item to span full row width

I'm trying to retain the first 2 child elements on the same row while the third element is in its own below at full width, all while using flex. I'm particularly interested in using the flex-grow and..

Reference requirements.txt for the install_requires kwarg in setuptools setup.py file

I have a requirements.txt file that I'm using with Travis-CI. It seems silly to duplicate the requirements in both requirements.txt and setup.py, so I was hoping to pass a file handle to the install_..

How does internationalization work in JavaScript?

I'm wondering how to deal internationalization in JavaScript. I googled but I'm not getting convincing answers for: Does JavaScript have native support for internationalization? What is i18n in Jav..

"cannot be used as a function error"

I am writing a simple program that uses functions found in different .cpp files. All of my prototypes are contained in a header file. I pass some of the functions into other functions and am not sure ..

How to set up tmux so that it starts up with specified windows opened?

How to set up tmux so that it starts up with specified windows opened?..

Error "can't use subversion command line client : svn" when opening android project checked out from svn

I'm new to Android development and the development tools around it. I have checked out a project from svn using TortoiseSVN client (can't manage to do it from within Android Studio), then get this err..

How can I position my jQuery dialog to center?

I have tried following code, but it only positions dialogs left upper corner position to center, and that makes element to be aligned to right. How can I center dialog to real center which counts elem..

Raise to power in R

This is a beginner's question. What's the difference between ^ and **? For example: 2 ^ 10 [1] 1024 2 ** 10 [1] 1024 Is there a function such as power(x,y)? ..

How to post SOAP Request from PHP

Anyone know how can I post a SOAP Request from PHP?..

SQL Update to the SUM of its joined values

I'm trying to update a field in the database to the sum of its joined values: UPDATE P SET extrasPrice = SUM(E.price) FROM dbo.BookingPitchExtras AS E INNER JOIN dbo.BookingPitches AS P ON E.pitchID ..

Adding files to a GitHub repository

How do I add files to my GitHub repository? I'm using Windows and all my project files are in one folder and I just need to upload it to my repo...

How to display a gif fullscreen for a webpage background?

I'm trying to make a GIF fit my whole screen, but so far its just a small square that is on my screen while the rest is white. However, I want it to take up all the space. Any ideas?..

What is the best way to do a substring in a batch file?

I want to get the name of the currently running batch file without the file extension. Thanks to this link, I have the file name with the extension... but what is the best way to do a substring in ..

SSL peer shut down incorrectly in Java

I need to make a request through a HTTPS protocol. I wrote the following code: import java.net.HttpURLConnection; import java.net.URL; import org.junit.Test; public class XMLHandlerTest { priva..

What's the difference between "2*2" and "2**2" in Python?

What is the difference between the following codes? code1: var=2**2*3 code2: var2=2*2*3 I see no difference. This raises the following question. Why is the code1 used if we can use code2?..

Create Pandas DataFrame from a string

In order to test some functionality I would like to create a DataFrame from a string. Let's say my test data looks like: TESTDATA="""col1;col2;col3 1;4.4;99 2;4.5;200 3;4.7;65 4;3.2;140 """ What is..

The value violated the integrity constraints for the column

I am trying to import the data from Excel file into SQL Server database. I am unable to do so because I am getting following errors in the log file. Please help. The log erros are as as follows:- [OL..

How to print a groupby object

I want to print the result of grouping with Pandas. I have a dataframe: import pandas as pd df = pd.DataFrame({'A': ['one', 'one', 'two', 'three', 'three', 'one'], 'B': range(6)}) print(df) ..

How to pass a URI to an intent?

I'm trying to pass a URI-Object to my Intent in order to use that URI in another activity... How do I pass a URI ? private Uri imageUri; .... Intent intent = new Intent(this, GoogleActivity.class); ..

Are there pointers in php?

What does this code mean? Is this how you declare a pointer in php? $this->entryId = $entryId; ..

Remove by _id in MongoDB console

In the MongoDB console how can I remove a record by id? Here's my collection : [ { "_id" : { "$oid" : "4d512b45cc9374271b02ec4f" }, "name" : "Gazza" }, { "_id" : { "$oid" : "4d5..

How to monitor the memory usage of Node.js?

How can I monitor the memory usage of Node.js?..

Forward request headers from nginx proxy server

I'm using Nginx as a proxy to filter requests to my application. With the help of the "http_geoip_module" I'm creating a country code http-header, and I want to pass it as a request header using "head..

For every character in string

How would I do a for loop on every character in string in C++?..

How to scroll to top of a div using jQuery?

I have a gridview inside a div.. I want to scroll to top of the div from the bottom of the div using jquery.. Any suggestion.. <div id="GridDiv"> // gridview inside.. </div> My gridview..

What is the difference between HTTP_HOST and SERVER_NAME in PHP?

What is the difference between $_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME'] in PHP? When would you consider using one over the other and why?..

phonegap open link in browser

<a target="_blank" data-rel="external" href="http://www.kidzout.com">www.kidzout.com</a> hey experts i am using phonegap 2.9.0 and i am using the above code to open the link in the brows..

Comments in .gitignore?

Can you write comments in a .gitignore file? If so, should the line be preceded with a # or some other indicator?..

How to set layout_gravity programmatically?

My question is simple, How to set my buttons layout_gravity programmatically? I found this on internet, but it simply throws me a Nullpointer exception: Button MyButton = new Button(this); Li..

Numpy where function multiple conditions

I have an array of distances called dists. I want to select dists which are between two values. I wrote the following line of code to do that: dists[(np.where(dists >= r)) and (np.where(dists <..

JSON array javascript

I need to store 3 pet names in string format, parse them into array and later read one by one Example pets = '{{"name":"jack"},{"name":"john"},{name:"joe"}}'; var arr = JSON.parse(pets); alert(arr..

How can I get selector from jQuery object

$("*").click(function(){ $(this); // how can I get selector from $(this) ? }); Is there an easy way to get selector from $(this)? There is a way to select an element by its selector, but what ab..

Android: how to convert whole ImageView to Bitmap?

I have my application that is displaying images with different ratio, resized inside (centerInside) imageView. What I need is to create bitmap from the ImageView including the background (black in thi..

Pandas: sum DataFrame rows for given columns

I have the following DataFrame: In [1]: import pandas as pd df = pd.DataFrame({'a': [1,2,3], 'b': [2,3,4], 'c':['dd','ee','ff'], 'd':[5,9,1]}) df Out [1]: a b c d 0 1 2 dd 5 1 2 3 ee ..

Receiving "Attempted import error:" in react app

I am receiving the following error when trying to run my React app: ./src/components/App/App.js Attempted import error: 'combineReducers' is not exported from '../../store/reducers/'. Here'..

Tomcat 8 throwing - org.apache.catalina.webresources.Cache.getResource Unable to add the resource

I have just upgraded Tomcat from version 7.0.52 to 8.0.14. I am getting this for lots of static image files: org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/b..

Pylint, PyChecker or PyFlakes?

I would like to get some feedback on these tools on: features; adaptability; ease of use and learning curve. ..

How to get the file path from URI?

Please find my code below. I need to get the file path of the pdf document, selected by the user from SDcard. The issue is that the URI.getPath() returns: /file:///mnt/sdcard/my%20Report.pdf/my Repor..

merge two object arrays with Angular 2 and TypeScript?

I have gone across the JavaScript questions on this topic, this question is specifically about Angular2 with TypeScript. What I am trying to do is to concatenate the json objects to an array. My cod..

Calling a rest api with username and password - how to

I am new to rest api's and calling them via .NET I have an api: https://sub.domain.com/api/operations?param=value&param2=value The notes for the api say that to authorize I need to use the basic..

How to assign pointer address manually in C programming language?

How do you assign a pointer address manually (e.g. to memory address 0x28ff44) in the C programming language?..

Does VBA contain a comment block syntax?

In VBA is there a short way to comment out a block of code the same way java uses /*...*/?..

jQuery events .load(), .ready(), .unload()

Just a simple question, for the jQuery event. Are the .load(), .ready() and .unload() run in order when the DOM is loaded? The answer seems yes when I see the jQuery Documentation. <script type="t..

CSS3 Transition - Fade out effect

I am trying to implement the "fade out" effect in pure CSS. Here is the fiddle. I did look into a couple of solutions online, however, after reading the documentation online, I am trying to figure out..

how to return index of a sorted list?

I need to sort a list and then return a list with the index of the sorted items in the list. For example, if the list I want to sort is [2,3,1,4,5], I need [2,0,1,3,4] to be returned. This question..

XML Parsing - Read a Simple XML File and Retrieve Values

I've written a Task Scheduling program for learning purposes. Currently I'm saving the scheduled tasks just as plain text and then parsing it using Regex. This looks messy (code wise) and is not very ..

SQL MAX of multiple columns?

How do you return 1 value per row of the max of several columns: TableName [Number, Date1, Date2, Date3, Cost] I need to return something like this: [Number, Most_Recent_Date, Cost] Query?..

Error: Cannot find module 'gulp-sass'

When I compile with gulp, I got an error like below. How can I fix it? module.js:339 throw err; ^ Error: Cannot find module 'gulp-sass' at Function.Module._resolveFilename (module.js:337:15) ..

Ruby: character to ascii from a string

this wiki page gave a general idea of how to convert a single char to ascii http://en.wikibooks.org/wiki/Ruby_Programming/ASCII But say if I have a string and I wanted to get each character's ascii f..

How to wrap async function calls into a sync function in Node.js or Javascript?

Suppose you maintain a library that exposes a function getData. Your users call it to get actual data: var output = getData(); Under the hood data is saved in a file so you implemented getData using N..

jQuery ajax post file field

I have a form with a file input. How do I get the file and post it to a php script using jQuery? Can I just use .val() to get the value and then post this? For example say the file input has an id of ..

How do you use youtube-dl to download live streams (that are live)?

Just wondering if that's possible or not- when I copy the video URL into YouTube-dl it spits out [https @ 0x7fc351416080] inflate return value: -3, incorrect header check Last message repeated 15 time..

POSTing JsonObject With HttpClient From Web API

I'm trying to POST a JsonObject using HttpClient from Web API. I'm not quite sure how to go about this and can't find much in the way of sample code. Here's what I have so far: var myObject = (dyna..

How to select a node of treeview programmatically in c#?

Used treeview.SelectedNode to select a child node. How to invoke treeview.AfterSelect event when a node is selected programmatically? this.treeView1.SelectedNode = this.treeView1.Nodes[0].Nodes[0].No..

Make Bootstrap Popover Appear/Disappear on Hover instead of Click

I'm building a website with Bootstrap's Popover and I can't figure out how to make the popover appear on hover instead of click. All I want to do is have a popover appear when someone hovers over a l..

What is the http-header "X-XSS-Protection"?

So I've been toying around with HTTP for fun in telnet now (i.e. just typing in telnet google.com 80 and putting in random GETs and POSTs with different headers and the like) but I've come across some..

How to inject window into a service?

I'm writing an Angular 2 service in TypeScript that will make use of localstorage. I want to inject a reference to the browser window object into my service since I don't want to reference any global ..

inner join in linq to entities

I have entity called Customer and it has three properties: public class Customer { public virtual Guid CompanyId; public virtual long Id; public virtual string Name; } I have also entit..

CodeIgniter Disallowed Key Characters

CodeIgniter is giving me a Disallowed Key Characters error. I've narrowed it down to the name attribute of a form field: name='prod[50-4121.5]' but I'm not sure what to do about it...

Countdown timer using Moment js

I am making a countdown timer for an event page, i used moment js for this. Here is fiddle for this. I am calculating date difference between event date and current date (timestamp), then using "..

SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

I just installed Ubuntu 16.04 and installed web server on it. Everything works well, but I cannot access database. Even if I create new user and grant all privileges, I can't create database In PHP I'..

Parenthesis/Brackets Matching using Stack algorithm

For example if the parenthesis/brackets is matching in the following: ({}) (()){}() () and so on but if the parenthesis/brackets is not matching it should return false, eg: {} ({}( ){}) (() and ..