Questions Tagged with #Testcomplete

TestComplete is a functional automated testing platform developed by SmartBear Software. TestComplete gives testers the ability to create automated tests for Microsoft Windows, Web, Android (operating system), and iOS applications.

How to concatenate strings in twig

Anyone knows how to concatenate strings in twig? I want to do something like: {{ concat('http://', }} ..

How to put img inline with text

I have this code: <div class = "content-dir-item"> <p>Text input</p> <img src="./images/email.png" class = "mail" alt="img-mail" /> </div> I would put img inli..

Compiling and Running Java Code in Sublime Text 2

I am trying to compile and run Java code in Sublime Text 2. Don't just tell me to do it manually in the Command Prompt. Can anyone tell me how? Btw, I am on Windows 7... ..

Dynamically access object property using variable

I'm trying to access a property of an object using a dynamic name. Is this possible? const something = { bar: "Foobar!" }; const foo = 'bar';; // The idea is to access, ge..

How to read HDF5 files in Python

I am trying to read data from hdf5 file in Python. I can read the hdf5 file using h5py, but I cannot figure out how to access data within the file. My code import h5py import numpy as np f1 ..

How to get week number of the month from the date in sql server 2008

In SQL Statement in microsoft sql server, there is a built-in function to get week number but it is the week of the year. Select DatePart(week, '2012/11/30') // **returns 48** The returned value 48..

Issue with Task Scheduler launching a task

I have a task scheduled in my Windows 2008 R2 machine but it failed to trigger with the following error in the log (Event logs). Error: Task Scheduler failed to start "\Hyatt_International_Distribut..

SQLSTATE[HY093]: Invalid parameter number: parameter was not defined

// BUILD VALUES $count = count($matches); for($i = 0; $i < $count; ++$i) { $values[] = '(?)'; } // INSERT INTO DATABASE $q = $this -> dbc -> prepare("INSERT INTO hashes (hash) VALUES " . ..

How to sync with a remote Git repository?

I forked a project on github, made some changes, so far so good. In the meantime, the repository I forked from changed and I would like to get those changes into my repository. How do I do that ?..

Android: How to bind spinner to custom object list?

In the user interface there has to be a spinner which contains some names (the names are visible) and each name has its own ID (the IDs are not equal to display sequence). When the user selects the na..

Django Reverse with arguments '()' and keyword arguments '{}' not found

Hi I have an infuriating problem. I have a url pattern like this: # mproject/ url(r'^project/(?P<project_id>\d+)/$','user_profile.views.EditProject',name='edit_project'), it wo..

Create a list from two object lists with linq

I have the following situation class Person { string Name; int Value; int Change; } List<Person> list1; List<Person> list2; I need to combine the 2 lists into a new List<..

Android background music service

I am developing an entertainment app in android. I want to play background music, and I want to use service for that. App have 3 activities and music must be played across all activities. Also, when a..

Curl command line for consuming webServices?

Do you guys know how I can use the Curl command line to POST SOAP to test a web service? I have a file (soap.xml) which has all the soap message attached to it I just don't seem to be able to properl..

Plot data in descending order as appears in data frame

I've been battling to order and plot a simple dataframe as a bar chart in ggplot2. I want to plot the data as it appears, so that the values ('count' variable) for the corresponding categories (e.g..

Decoding JSON String in Java

I am new to using the json-simple library in Java and I've been through both the encoding and decoding samples. Duplicating the encoding examples was fine, but I have not been able to get the decoding..

Download image with JavaScript

Right now I have a canvas and I want to save it as PNG. I can do it with all those fancy complicated file system API, but I don't really like them. I know if there is a link with download attribute o..

How to check if a variable is both null and /or undefined in JavaScript

Possible Duplicate: Detecting an undefined object property in JavaScript How to determine if variable is 'undefined' or 'null' Is there a standard function to check for null, ..

How to fix apt-get: command not found on AWS EC2?

I installed Ubuntu 12.04 on my instance and am trying to install packages using apt-get, but I am getting the following error: sudo: apt-get: command not found How do I fix this?..

JS strings "+" vs concat method

I have some experience with Java and I know that strings concatenation with "+" operator produces new object. I'd like to know how to do it in JS in the best way, what is the best practice for it?..

Functional style of Java 8's Optional.ifPresent and if-not-Present?

In Java 8, I want to do something to an Optional object if it is present, and do another thing if it is not present. if (opt.isPresent()) { System.out.println("found"); } else { System.out.printl..

How to run php files on my computer

Could anyone please tell me how to run a php file locally on my system. Currently I am using a server to run files. I know both php & Apache to be installed. I need to see out put of this program,..

In Java, what is the best way to determine the size of an object?

I have an application that reads a CSV file with piles of data rows. I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows..

NameError: name 'python' is not defined

Am encountering this error in Windows Command line,done a wide search but could not get a perfect answer.Please find the error below and help in solving. python Traceback (most recent call last): F..

Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on

I have a scenario. (Windows Forms, C#, .NET) There is a main form which hosts some user control. The user control does some heavy data operation, such that if I directly call the UserControl_Load me..

What's "P=NP?", and why is it such a famous question?

The question of whether P=NP is perhaps the most famous in all of Computer Science. What does it mean? And why is it so interesting? Oh, and for extra credit, please post a proof of the statement's t..

Codeigniter : calling a method of one controller from other

I have two controllers a and b. I would like to call a method of controller a from a method of controller b. Could anyone help explain how I can achieve this?..

Altering user-defined table types in SQL Server

How can I alter a user-defined table type in SQL Server ?..

Iterate through a HashMap

What's the best way to iterate over the items in a HashMap?..

Pythonic way to check if something exists?

This is pretty basic but I was coding and started wondering if there was a pythonic way to check if something does not exist. Here's how I do it if its true: var = 1 if var: print 'it exists' ..

Where do I find the definition of size_t?

I see variables defined with this type but I don't know where it comes from, nor what is its purpose. Why not use int or unsigned int? (What about other "similar" types? Void_t, etc)...

Getting file names without extensions

When getting file names in a certain folder: DirectoryInfo di = new DirectoryInfo(currentDirName); FileInfo[] smFiles = di.GetFiles("*.txt"); foreach (FileInfo fi in smFiles) { builder.Append(fi...

How to truncate text in Angular2?

Is there a way that I could limit the length of the string to a number characters? for e.g: I have to limit a title length to 20 {{ data.title }}. Is there any pipe or filter to limit the length?..

How to find elements by class

I'm having trouble parsing HTML elements with "class" attribute using Beautifulsoup. The code looks like this soup = BeautifulSoup(sdata) mydivs = soup.findAll('div') for div in mydivs: if (div[..

Update data on a page without refreshing

I have a website where I need to update a status. Like for a flight, you are departing, cruise or landed. I want to be able to refresh the status without having my viewers to have and reload the whole..

Disable same origin policy in Chrome

Is there any way to disable the Same-origin policy on Google's Chrome browser?..

How to load an external webpage into a div of a html page

I need to load a responsive website into a div in my HTML page without using an iframe element. I have tried this link; it's working for a single page URL, which I mentioned in the script. $('#mydiv..

jQuery validation plugin: accept only alphabetical characters?

I'd like to use jQuery's validation plugin to validate a field that only accepts alphabetical characters, but there doesn't seem to be a defined rule for it. I've searched google but I've found nothin..

How to remove all leading zeroes in a string

If I have a string 00020300504 00000234892839 000239074 how can I get rid of the leading zeroes so that I will only have this 20300504 234892839 239074 note that the number above was generated r..

SQL Server convert string to datetime

This is not asking how to convert an arbitrary string to datetime in MSSQL such as this question. I can control the string format but I want to know what the MSSQL syntax is for updating a datetime f..

Codeigniter displays a blank page instead of error messages

I'm using Codeigniter, and instead of error messages I'm just getting a blank page. Is there any way to show PHP error messages instead? It's very hard to debug when I get no feedback. My environment..

Jenkins Pipeline Wipe Out Workspace

We are running Jenkins 2.x and love the new Pipeline plugin. However, with so many branches in a repository, disk space fills up quickly. Is there any plugin that's compatible with Pipeline that I..

How do I force my .NET application to run as administrator?

Once my program is installed on a client machine, how do I force my program to run as an administrator on Windows 7?..

What is the best way to test for an empty string in Go?

Which method is best (more idomatic) for testing non-empty strings (in Go)? if len(mystring) > 0 { } Or: if mystring != "" { } Or something else?..

Create an Oracle function that returns a table

I'm trying to create a function in package that returns a table. I hope to call the function once in the package, but be able to re-use its data mulitple times. While I know I create temp tables in ..

how to get text from textview

if I have set text in textview in such way, which is not problem: tv.setText("" + ANS[i]); this simply getting from this way. String a = tv.getText().toString(); int A = Integer.parseI..

How to convert entire dataframe to numeric while preserving decimals?

I have a mixed class dataframe (numeric and factor) where I am trying to convert the entire data frame to numeric. The following illustrates the type of data I am working with as well as the problem ..

Creating multiline strings in JavaScript

I have the following code in Ruby. I want to convert this code into JavaScript. what's the equivalent code in JS? text = <<"HERE" This Is A Multiline String HERE ..

How can I find the maximum value and its index in array in MATLAB?

Suppose I have an array, a = [2 5 4 7]. What is the function returning the maximum value and its index? For example, in my case that function should return 7 as the maximum value and 4 as the index...

Adding image inside table cell in HTML

I am sorry but I am not able to do this simple thing. I am not able to add an image in the table cell. Below is my code which I have written:- <html> <head>CAR APPLICATION</head>..

Security of REST authentication schemes

Background: I'm designing the authentication scheme for a REST web service. This doesn't "really" need to be secure (it's more of a personal project) but I want to make it as secure as possible as an..

equals vs Arrays.equals in Java

When comparing arrays in Java, are there any differences between the following 2 statements? Object[] array1, array2; array1.equals(array2); Arrays.equals(array1, array2); And if so, what are they?..

How to get controls in WPF to fill available space?

Some WPF controls (like the Button) seem to happily consume all the available space in its' container if you don't specify the height it is to have. And some, like the ones I need to use right now, t..

jQuery changing css class to div

If I have one div element for example and class 'first' is defined with many css properties. Can I assign css class 'second' which also has many properties differently defined to this same div just o..

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'username'@'localhost' (using password: YES)

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'username'@'localhost' (using password: YES) in C:\Users\xampp\htdocs\PHP_Login_Script\config.php on line 6 Warning: mysqli_real..

How to check if a string is a valid JSON string in JavaScript without using Try/Catch

Something like: var jsonString = '{ "Id": 1, "Name": "Coke" }'; //should be true IsJsonString(jsonString); //should be false IsJsonString("foo"); IsJsonString("<div>foo</div>") The so..

Query based on multiple where clauses in Firebase

{ "movies": { "movie1": { "genre": "comedy", "name": "As good as it gets", "lead": "Jack Nicholson&qu..

How to change Rails 3 server default port in develoment?

On my development machine, I use port 10524. So I start my server this way : rails s -p 10524 Is there a way to change the default port to 10524 so I wouldn't have to append the port each time I st..

Redirecting to a certain route based on condition

I'm writing a small AngularJS app that has a login view and a main view, configured like so: $routeProvider .when('/main' , {templateUrl: 'partials/main.html', controller: MainController}) .when('..

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?..

Slice indices must be integers or None or have __index__ method

I'm trying something with Python. I want to slice a list (plateau) in several list (L[i]) but I have the following error message: File "C:\Users\adescamp\Skycraper\", line 20, in <mo..

How can I define an array of objects?

I am creating an array of objects in TypeScript: userTestStatus xxxx = { "0": { "id": 0, "name": "Available" }, "1": { "id": 1, "name": "Ready" }, "2": { "id": 2, "name": "Started" } };..

invalid conversion from 'const char*' to 'char*'

Have a code as shown below. I have problem passing the arguments. stringstream data; char *addr=NULL; strcpy(addr,retstring().c_str()); retstring() is a function that returns a string. //more code..

How to disable scientific notation?

I have a dataframe with a column of p-values and I want to make a selection on these p-values. > pvalues_anova [1] 9.693919e-01 9.781728e-01 9.918415e-01 9.716883e-01 1.667183e-02 [6] 9.952762e-0..

C#: Limit the length of a string?

I was just simply wondering how I could limit the length of a string in C#. string foo = "1234567890"; Say we have that. How can I limit foo to say, 5 characters?..

Installing Python 2.7 on Windows 8

So I'm trying python 2.7 on my Windows. It is running Windows 8. I cannot add it to my path. I've done the usual: using the advanced system settings, environment variables, adding C:\Python27 in syste..

How do I count the number of rows and columns in a file using bash?

Say I have a large file with many rows and many columns. I'd like to find out how many rows and columns I have using bash...

Build an iOS app without owning a mac?

Please correct me if I'm wrong. I'm new to mobile development and I would like to develop an app to submit to the apple store. But I am heavily discouraged by the prices of the macs that I am develo..

Getting Current date, time , day in laravel

I need to get the current date, time, day using laravel I tried to echo $ldate = new DateTime('today'); and $ldate = new DateTime('now'); But it is returning 1 always. How can i get the current da..

node.js string.replace doesn't work?

var variableABC = "A B C"; variableABC.replace('B', 'D') //wanted output: 'A D C' but 'variableABC' didn't change : variableABC = 'A B C' when I want it to be 'A D C'...

Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory

The problem Whenever I run my projects JUnit test (using JUnit 5 with Java 9 and Eclipse Oxygen 1.a) I encounter the problem that eclipse can't find any tests. The description Under the run configu..

How to get row index number in R?

Suppose I have a list or data frame in R, and I would like to get the row index, how do I do that? That is, I would like to know how many rows a certain matrix consists of...

Angular HTML binding

I am writing an Angular application and I have an HTML response I want to display. How do I do that? If I simply use the binding syntax {{myVal}} it encodes all HTML characters (of course). I need ..

Setting background colour of Android layout element

I am trying to, somewhat clone the design of an activity from a set of slides on Android UI design. However I am having a problem with a very simple task. I have created the layout as shown in the im..

How to set DataGrid's row Background, based on a property value using data bindings

In my XAML code, I want to set the Background color of each row, based on a value of the object in one specific row. I have an ObservableCollection of z, and each of the z has a property called State...

getColor(int id) deprecated on Android 6.0 Marshmallow (API 23)

The Resources.getColor(int id) method has been deprecated. @ColorInt @Deprecated public int getColor(@ColorRes int id) throws NotFoundException { return getColor(id, null); } What should I do?..

How to calculate probability in a normal distribution given mean & standard deviation?

How to calculate probability in normal distribution given mean, std in Python? I can always explicitly code my own function according to the definition like the OP in this question did: Calculating Pr..

How can I write output from a unit test?

Any call in my unit tests to either Debug.Write(line) or Console.Write(Line) simply gets skipped over while debugging and the output is never printed. Calls to these functions from within classes I'm ..

Concatenating two std::vectors

How do I concatenate two std::vectors?..

How to differentiate single click event and double click event?

I have a single button in li with id "my_id". I attached two jQuery events with this element 1. $("#my_id").click(function() { alert('single click'); }); 2. $("#my_id").dblclick(function() ..

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..

swift 3.0 Data to String?

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {} I want deviceToken to string but: let str = String.init(data: deviceToken, enc..

How can I regenerate ios folder in React Native project?

So a while ago I deleted the /ios directory in my react native app (let's call it X). I've been developing and testing using the android emulator but now I'd like to make sure it works on ios with xco..

Performing user authentication in Java EE / JSF using j_security_check

I'm wondering what the current approach is regarding user authentication for a web application making use of JSF 2.0 (and if any components do exist) and Java EE 6 core mechanisms (login/check permiss..

What is a Memory Heap?

What is a memory heap ?..

How to create custom view programmatically in swift having controls text field, button etc

I am trying to access the MyCustomView from another class using the following code in ViewController.swift .. var view = MyCustomView(frame: CGRectZero) .. in the viewDidLoad method. The problem is..

Overlay a background-image with an rgba background-color

I have a div with a background-image. I want to overlay the background-image with an rgba color (rgba(0,0,0,0.1)) when the user hovers the div. I was wondering if there's a one-div solution (i.e. not..

How do I check if an element is hidden in jQuery?

Is it possible to toggle the visibility of an element, using the functions .hide(), .show() or .toggle()? How would you test if an element is visible or hidden?..

Android OnClickListener - identify a button

I have the activity: public class Mtest extends Activity { Button b1; Button b2; public void onCreate(Bundle savedInstanceState) { ... b1 = (Button) findViewById(; b2 = (But..

How to replace innerHTML of a div using jQuery?

How could I achieve the following: document.all.regTitle.innerHTML = 'Hello World'; Using jQuery where regTitle is my div id?..

How can I disable a button in a jQuery dialog from a function?

I have a jQuery dialog that requires the user to enter certain information. In this form, I have a "continue" button. I would like this "continue" button to only be enabled once all the fields have co..

How to get the pure text without HTML element using JavaScript?

I have the 1 button and some text in my HTML like the following: function get_content(){ // I don't know how to do in here!!! } <input type="button" onclick="get_content()" value="Get Content"..

How to read specific lines from a file (by line number)?

I'm using a for loop to read a file, but I only want to read specific lines, say line #26 and #30. Is there any built-in feature to achieve this?..

Why can templates only be implemented in the header file?

Quote from The C++ standard library: a tutorial and handbook: The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this? ..

How to Write text file Java

The following code does not produce a file (I can't see the file anywhere). What is missing? try { //create a temporary file String timeLog = new SimpleDateFormat("yyyyMMdd_HHmmss").format( ..

How to ignore ansible SSH authenticity checking?

Is there a way to ignore the SSH authenticity checking made by Ansible? For example when I've just setup a new server I have to answer yes to this question: GATHERING FACTS **************************..

Android Error [Attempt to invoke virtual method 'void' on a null object reference]

I have a code module which implements viewpager with navigation drawer, however, when I run the code I get the following error 01-26 09:20:02.958: D/AndroidRuntime(18779): Shutting down VM 01-26 09:2..

Getting the inputstream from a classpath resource (XML file)

In Java web application, Suppose if I want to get the InputStream of an XML file, which is placed in the CLASSPATH (i.e. inside the sources folder), how do I do it?..

Where can I find a list of escape characters required for my JSON ajax return type?

I have an ASP.NET MVC action that is returning a JSON object. The JSON: {status: "1", message:"", output:"<div class="c1"><div class="c2">User generated text, so can be anything</div&..

Catching errors in Angular HttpClient

I have a data service that looks like this: @Injectable() export class DataService { baseUrl = 'http://localhost' constructor( private httpClient: HttpClient) { } get(url,..

Triggering a checkbox value changed event in DataGridView

I have a grid view that has a check box column, and I want to trigger a drawing event as soon as the value of the cell is toggled. I tried the ValueChaged and the CellEndEdit and BeginEdit, and chose ..

html5 localStorage error with Safari: "QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota."

My webapp have javascript errors in ios safari private browsing: JavaScript:error undefined QUOTA_EXCEEDED_ERR:DOM Exception 22:An attempt was made to add something to storage... my co..

Force file download with php using header()

I want the user to be able to download some files I have on my server, but when I try to use any of the many examples of this around the internet nothing seems to work for me. I've tried code like thi..

javascript cell number validation

I want to validate cell number using JavaScript. Here is my code. if(number.value == "") { window.alert("Error: Cell number must not be null."); number.focus(); return false; } if(numbe..

Python URLLib / URLLib2 POST

I'm trying to create a super-simplistic Virtual In / Out Board using wx/Python. I've got the following code in place for one of my requests to the server where I'll be storing the data: data = urlli..

How can I get the current screen orientation?

I just want to set some flags when my orientation is in landscape so that when the activity is recreated in onCreate() i can toggle between what to load in portrait vs. landscape. I already have a lay..

How do you add a scroll bar to a div?

I have a popup that displays some results, and I want a scroll bar to be display since the results are being cutt off (and I don't want the popup to be too long)...

How to select all and copy in vim?

how to select all and copy in vim insert mode? and is there another way to do it in normal mode? I have tried visual mode and gg and shift + gg to select all and then yank, however that doesn't transf..

Conda version pip install -r requirements.txt --target ./lib

What is the conda version of this? pip install -r requirements.txt --target ./lib I've found these commands: while read requirement; do conda install --yes $requirement; done < requirements.txt..

QComboBox - set selected item based on the item's data

What would be the best way of selecting an item in a QT combo box out of a predefined list of enum based unique values. In the past I have become accustomed to .NET's style of selection where the ite..

SQL Server equivalent to MySQL enum data type?

Does SQL Server 2008 have a a data-type like MySQL's enum?..

Javascript reduce() on Object

There is nice Array method reduce() to get one value from the Array. Example: [0,1,2,3,4].reduce(function(previousValue, currentValue, index, array){ return previousValue + currentValue; }); What..

Task<> does not contain a definition for 'GetAwaiter'

Client iGame Channel = new ChannelFactory<iGame> ( new BasicHttpBinding ( BasicHttpSecurityMode . None ) , new EndpointAddress ( new Uri ( "http://localhost:58597/Game.svc" ) ) ) . CreateChanne..

How to convert a list of numbers to jsonarray in Python

I have a row in following format: row = [1L,[0.1,0.2],[[1234L,1],[134L,2]]] Now, what I want is to write the following in the file: [1,[0.1,0.2],[[1234,1],[134,2]]] Basically converting above in..

Add text to textarea - Jquery

How can I add text from a DIV to a textarea? I have this now: $('.oquote').click(function() { $('#replyBox').slideDown('slow', function() { var quote = $('.container').text(); ..

How to define global variable in Google Apps Script

I see most examples from Google is they use only functions in a single giant script. e.g. But in our style, we usually write all function..

Get lengths of a list in a jinja2 template

How do I get the number of elements in a list in jinja2 template? For example, in Python: print(template.render(products=[???])) and in jinja2 <span>You have {{what goes here?}} products<..

Creating a fixed sidebar alongside a centered Bootstrap 3 grid

I'd like to create a fixed sidebar that exists outside my centered Bootstrap Grid. The challenge I face when attempting to do this is determining what additional styles to apply/overwrite to my .conta..

Make a link open a new window (not tab)

Is there a way to make a link open a new browser window (not tab) without using javascript?..

HTML forms - input type submit problem with action=URL when URL contains index.aspx

I have a HTML form that truncates the action parameter after the "?" mark - which is NOT the desired behavior I am looking for. Here is a representative HTML snippet: <form action="http://spufalc..

Logical operators ("and", "or") in DOS batch

How would you implement logical operators in DOS Batch files?..

Spring Security with roles and permissions

I'm trying to set up role-based Security with permissions. I'm trying to do this together with Spring-Security. I don't want to set up ACL as it seems it's an overkill for my requirements. I just w..

How to compile or convert sass / scss to css with node-sass (no Ruby)?

I was struggling with setting up libsass as it wasn't as straight-forward as the Ruby based transpiler. Could someone explain how to: install libsass? use it from command line? use it with task runn..

Is it possible to display inline images from html in an Android TextView?

Given the following HTML: <p>This is text and this is an image <img src="" />.</p> Is it possible to make the image render? When using this snippet:..

How to assign text size in sp value using java code

If I assign an integer value to change a certain text size of a TextView using java code, the value is interpreted as pixel (px). Now does anyone know how to assign it in sp?..

Is the order of elements in a JSON list preserved?

I've noticed the order of elements in a JSON object not being the original order. What about the elements of JSON lists? Is their order maintained?..

Reading in double values with scanf in c

I try to read-in 2 values using scanf() in C, but the values the system writes into memory are not equal to my entered values. Here is the code: double a,b; printf("--------\n"); //seperate lines sca..

Java image resize, maintain aspect ratio

I have an image which I resize: if((width != null) || (height != null)) { try{ // scale image on disk BufferedImage originalImage =; int type = originalI..

How to manually include external aar package using new Gradle Android Build System

I've been experimenting with the new android build system and I've run into a small issue. I've compiled my own aar package of ActionBarSherlock which I've called 'actionbarsherlock.aar'. What I'm t..

How do you send an HTTP Get Web Request in Python?

I am having trouble sending data to a website and getting a response in Python. I have seen similar questions, but none of them seem to accomplish what I am aiming for. This is my C# code I'm trying .. cannot be cast to

I'm trying to change a LinearLayout from another class, but when i run this code: public class IRC extends PircBot { ArrayList<String> channels; ArrayList<Integer> userCount; ArrayList&l..

Get current NSDate in timestamp format

I have a basic method which gets the current time and sets it in a string. However, how can I get it to format the current date & time in a UNIX since-1970 timestamp format? Here is my code: NSD..

How to modify a specified commit?

I usually submit a list of commits for review. If I have the following commits: HEAD Commit3 Commit2 Commit1 ...I know that I can modify head commit with git commit --amend. But how can I modi..

REST API Token-based Authentication

I'm developing a REST API that requires authentication. Because the authentication itself occurs via an external webservice over HTTP, I reasoned that we would dispense tokens to avoid repeatedly call..

Peak-finding algorithm for Python/SciPy

I can write something myself by finding zero-crossings of the first derivative or something, but it seems like a common-enough function to be included in standard libraries. Anyone know of one? My p..

Visual Studio C# IntelliSense not automatically displaying

Just recently, my Visual Studio 2010 stopped displaying IntelliSense suggestions automatically while I am typing. I can still press ctrl+space to get it to work, but it doesn't automatically show a l..

How I can get web page's content and save it into the string variable

How I can get the content of the web page using ASP.NET? I need to write a program to get the HTML of a webpage and store it into a string variable...

How to get a Static property with Reflection

So this seems pretty basic but I can't get it to work. I have an Object, and I am using reflection to get to it's public properties. One of these properties is static and I'm having no luck getting ..

CronJob not running

I have set up a cronjob for root user in ubuntu environment as follows by typing crontab -e 34 11 * * * sh /srv/www/live/CronJobs/ 0 08 * * 2 sh /srv/www/live/CronJobs/ 0 08 1 *..

Replace Both Double and Single Quotes in Javascript String

I am pulling in some information from a database that contains dimensions with both ' and " to denote feet and inches. Those characters being in my string cause me problems later and I need to replac..

CSS content generation before or after 'input' elements

In Firefox 3 and Google Chrome 8.0 the following works as expected: <style type="text/css"> span:before { content: 'span: '; } </style> <span>Test</span> <!-- produces..

How to get input textfield values when enter key is pressed in react js?

I want to pass textfield values when user press enter key from keyboard. In onChange() event, I am getting the value of the textbox, but How to get this value when enter key is pressed ? Code: impo..

CSS to prevent child element from inheriting parent styles

Possible Duplicate: How do I prevent CSS inheritance? Is there a way to declare the CSS property of an element such that it will not affect any of its children or is there a way to declare CSS of a..

Insert json file into mongodb

I am new to MongoDB. After installing MongoDB in Windows I am trying to insert a simple json file using the following command: C:\>mongodb\bin\mongoimport --db test --collection docs < example2..

How to split one string into multiple variables in bash shell?

I've been looking for a solution and found similar questions, only they were attempting to split sentences with spaces between them, and the answers do not work for my situation. Currently a variable..

Wait until page is loaded with Selenium WebDriver for Python

I want to scrape all the data of a page implemented by a infinite scroll. The following python code works. for i in range(100): driver.execute_script("window.scrollTo(0, document.body.scrollHeigh..

How to set an environment variable in a running docker container

If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run comm..

JQuery get data from JSON array

This is part of the JSON i get from foursquare. JSON tips: { count: 2, groups: [ { type: "others", name: "Tips from others", count: 2, items: [ {..

How to redirect on another page and pass parameter in url from table?

How to redirect on another page and pass parameter in url from table ? I've created in tornato template something like this <table data-role="table" id="my-table" data-mode="reflow"> <th..

react router v^4.0.0 Uncaught TypeError: Cannot read property 'location' of undefined

I've been having some trouble with react router (i'm using version^4.0.0). this is my index.js import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import './index.c..

SQL query, if value is null then return 1

I have a query that is returning the exchange rate value set up in our system. Not every order will have an exchange rate (currate.currentrate) so it is returning null values. Can I get it to return..

Bind TextBox on Enter-key press

The default databinding on TextBox is TwoWay and it commits the text to the property only when TextBox lost its focus. Is there any easy XAML way to make the databinding happen when I press the Enter..

Unable to begin a distributed transaction

I'm trying to run SQL against a linked server, but I get the errors below : BEGIN DISTRIBUTED TRANSACTION SELECT TOP 1 * FROM Sessions OLE DB provider "SQLNCLI" for linked server "ASI..

How to get the selected date of a MonthCalendar control in C#

How to get the selected date of a MonthCalendar control in C# (Window forms)..

java.text.ParseException: Unparseable date

I am getting a parsing exception while I am trying the following code: String date="Sat Jun 01 12:53:10 IST 2013"; SimpleDateFormat sdf=new SimpleDateFormat("MMM d, yyyy HH:mm:ss"); Date ..

Maximum value of maxRequestLength?

If we are using IIS 7 and .Net Framework 4, what will be the maximum value of maxRequestLength?..

How to get first N elements of a list in C#?

I would like to use Linq to query a bus schedule in my project, so that at any time I can get the next 5 bus arrival times. How can I limit my query to the first 5 results? More generally, how can I ..

How to open a website when a Button is clicked in Android application?

I am designing an app, with several button for users to click on. Once button is clicked, user is directed to appropriate website. How do I accomplish this?..

How to select a directory and store the location using tkinter in Python

I am creating a GUI with a browse button which I only want to return the path. I've been looking at solutions using code like below. Tkinter.Button(subframe, text = "Browse", command = self.loadtemp..

How to implement the Android ActionBar back button?

I have an activity with a listview. When the user click the item, the item "viewer" opens: List1.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterVi..

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/dbname

I have this Java program: import java.sql.*; import java.util.Properties; public class MySQLConnectExample { public static void main(String[] args) { Connection ..

select dept names who have more than 2 employees whose salary is greater than 1000

How would do the following in SQL "select dept names who have more than 2 employees whose salary is greater than 1000" ? DeptId DeptName ------ -------- 1 one 2 two 3 three ..

How do I limit the number of decimals printed for a double?

This program works, except when the number of nJars is a multiple of 7, I will get an answer like $14.999999999999998. For 6, the output is 14.08. How do I fix exceptions for multiples of 7 so it will..

Signing a Windows EXE file

I have an EXE file that I should like to sign so that Windows will not warn the end user about an application from an "unknown publisher". I am not a Windows developer. The application in question is ..

Passing data between a fragment and its container activity

How can I pass data between a fragment and its container activity? Is there something similar to passing data between activities through intents? I read this, but it didn't help much: http://develope..

What is considered a good response time for a dynamic, personalized web application?

For a complex web application that includes dynamic content and personalization, what is a good response time from the server (so excluding network latency and browser rendering time)? I'm thinking a..

Bootstrap close responsive menu "on click"

On "PRODUCTS" click I slide up a white div (as seen in attached). When in responsive (mobile and tablet), I would like to automaticly close the responsive navbar and only show the white bar. I trie..

Map isn't showing on Google Maps JavaScript API v3 when nested in a div tag

I'm trying to put the div tag that shows the map (<div id="map-canvas"></div>) inside another div, but it doesn't show the map that way. Is it a CSS or a JavaScript problem? Or is it just ..

cast a List to a Collection

i have some pb. I want to cast a List to Collection in java Collection<T> collection = new Collection<T>(mylList); but i have this error Can not instantiate the type Collection ..

How to fix Invalid byte 1 of 1-byte UTF-8 sequence

I am trying to fetch the below xml from db using a java method but I am getting an error Code used to parse the xml DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder..

How to unlock a file from someone else in Team Foundation Server

We have a project that is stored within our TFS server and some files were Checked-Out by me from another computer and another user (both of which are not used anymore). Is there a way to force the un..

Python NoneType object is not callable (beginner)

It tells me line 1 and line 5 (new to debugging/programming, not sure if that helps) def hi(): print('hi') def loop(f, n): # f repeats n times if n <= 0: return else: ..

JAVA Unsupported major.minor version 51.0

I'm not a programmer but I couldn't find any answer on this website. I'm trying to run a game on linux ubuntu with Java Open JDK but nothing happen. I tried to run it with the prompt command and it sa..

How to return temporary table from stored procedure

CREATE PROCEDURE [test].[proc] @ConfiguredContentId int, @NumberOfGames int AS BEGIN SET NOCOUNT ON RETURN @WunNumbers TABLE (WinNumb int) INSERT INTO @WunNumbers (WinNumb) SELECT TOP (@Numb..

MVC If statement in View

I have problem with IF statement inside MVC View. I am trying to use it for creating row for every three items. <div class="content"> <div class="container"> @if (ViewBag.Articles !..

Python set to list

How can I convert a set to a list in Python? Using a = set(["Blah", "Hello"]) a = list(a) doesn't work. It gives me: TypeError: 'set' object is not callable ..

How to show a confirm message before delete?

I want to get a confirm message on clicking delete (this maybe a button or an image). If the user selects 'Ok' then delete is done, else if 'Cancel' is clicked nothing happens. I tried echoing this ..

Ternary operator in AngularJS templates

How do you do a ternary with AngularJS (in the templates)? It would be nice to use some in html attributes (classes and style) instead of creating and calling a function of the controller...

How to append a newline to StringBuilder

I have a StringBuilder object, StringBuilder result = new StringBuilder(); result.append(someChar); Now I want to append a newline character to the StringBuilder. How can I do it? result.append("/..

Alter column, add default constraint

I have a table and one of the columns is "Date" of type datetime. We decided to add a default constraint to that column Alter table TableName alter column dbo.TableName.Date default getutcdate() ..

Understanding Matlab FFT example

I am new to matlab and FFT and want to understand the Matlab FFT example. For now I have two main questions: 1) Why does the x-axis (frequency) end at 500? How do I know that there aren't more freque..

How to enable MySQL Query Log?

How do I enable the MySQL function that logs each SQL query statement received from clients and the time that query statement has submitted? Can I do that in phpmyadmin or NaviCat? How do I analyse th..

Stylesheet not loaded because of MIME-type

I'm working on a website that uses gulp to compile and browser sync to keep the browser synchronised with my changes. The gulp task compiles everything properly, but on the website, I'm unable to see..

How to copy data from another workbook (excel)?

I already have a macro that creates sheets and some other stuff. After a sheet has been created do I want to call another macro that copies data from a second excel (its open) to first and active exce..

NPM doesn't install module dependencies

This is my package.json for the module that I'm including in the parent project: { "version": "0.0.1", "name": "module-name", "dependencies": { "express": "3.3.4", "grunt": "0.4.1", ..

Error java.lang.OutOfMemoryError: GC overhead limit exceeded

I get this error message as I execute my JUnit tests: java.lang.OutOfMemoryError: GC overhead limit exceeded I know what an OutOfMemoryError is, but what does GC overhead limit mean? How can I solv..

Running PowerShell as another user, and launching a script

I won't get into all the details of why I need this, but users must be able to launch PowerShell as a service account and when PowerShell loads it needs to run a script. I already can launch PowerShel..

How to read a single char from the console in Java (as the user types it)?

Is there an easy way to read a single char from the console as the user is typing it in Java? Is it possible? I've tried with these methods but they all wait for the user to press enter key: char tmp..

CREATE DATABASE permission denied in database 'master' (EF code-first)

I use code-first in my project and deploy on host but I get error CREATE DATABASE permission denied in database 'master'. This is my connection string: <add name="DefaultConnection" co..

How to use OrderBy with findAll in Spring Data

I am using spring data and my DAO looks like public interface StudentDAO extends JpaRepository<StudentEntity, Integer> { public findAllOrderByIdAsc(); // I want to use some thing like thi..

Prefer composition over inheritance?

Why prefer composition over inheritance? What trade-offs are there for each approach? When should you choose inheritance over composition?..

Get random sample from list while maintaining ordering of items?

I have a sorted list, let say: (its not really just numbers, its a list of objects that are sorted with a complicated time consuming algorithm) mylist = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ,9 , 10 ] I..

Set background image on grid in WPF using C#

I have a problem: I want to set the image of my grid through code behind. Can anybody tell me how to do this?..

In HTML I can make a checkmark with &#x2713; . Is there a corresponding X-mark?

Is there a corresponding X mark to ✓ (&#x2713;)? What is it?..

How to install a specific version of a package with pip?

Possible Duplicate: Installing specific package versions with Pip I am a bit new to pip install and virtualenv in general. I have setup an virtualenv on my server as well as on my local de..

Fatal error: Call to a member function bind_param() on boolean

I'm busy on a function that gets settings from a DB, and suddenly, I ran into this error: Fatal error: Call to a member function bind_param() on boolean in C:\xampp2\htdocs\application\classes\class...

PostgreSQL database default location on Linux

What is the default directory where PostgreSQL will keep all databases on Linux?..

Cleaning up old remote git branches

I work from two different computers (A and B) and store a common git remote in the dropbox directory. Let's say I have two branches, master and devel. Both are tracking their remote counterparts orig..

In Python, what is the difference between ".append()" and "+= []"?

What is the difference between: some_list1 = [] some_list1.append("something") and some_list2 = [] some_list2 += ["something"] ..

Radio buttons and label to display in same line

Why my labels and radio buttons won't stay in the same line, what can I do ? Here is my form: <form name="submit" id="submit" action="#" method="post"> <?php echo form_hidden('what', 'i..