Questions Tagged with #Boinc

Berkeley Open Infrastructure for Network Computing (BOINC) is a middleware system for volunteer and Grid computing

Apache: "AuthType not set!" 500 Error

It's been a while since I used the Apache httpd web server. I'm firing up a local server for a project and when I try to request localhost/index.html, I get a 500 error and I see this in the error lo..

Python causing: IOError: [Errno 28] No space left on device: '../results/32766.html' on disk with lots of space

I am running a Python script that is causing the above error. The unusual thing is this script is running on a different machine and is having no problems. The difference is that on the machine that..

If Browser is Internet Explorer: run an alternative script instead

I'm using an image carousel script that is quite heavy on the browser. It works great in Opera and Chrome, half decent in FF and absolutely breaks my balls in IE. So i'd like to give IE users an alter..

Failed linking file resources

This is the java file that is giving the error package com.example.daksh.timetable; import; import android.os.Bundle; import android.view.View; import androi..

grep for multiple strings in file on different lines (ie. whole file, not line based search)?

I want to grep for files containing the words Dansk, Svenska or Norsk on any line, with a usable returncode (as I really only like to have the info that the strings are contained, my one-liner goes a..

Given a class, see if instance has method (Ruby)

I know in Ruby that I can use respond_to? to check if an object has a certain method. But, given the class, how can I check if the instance has a certain method? i.e, something like

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

Node JS Promise.all and forEach

I have an array like structure that exposes async methods. The async method calls return array structures that in turn expose more async methods. I am creating another JSON object to store values obta..

How to call a PHP function on the click of a button

I have created a page called functioncalling.php that contains two buttons, Submit and Insert. I want to test which function is executed when a button gets clicked. I want the output to appear on the ..

How to get pixel data from a UIImage (Cocoa Touch) or CGImage (Core Graphics)?

I have a UIImage (Cocoa Touch). From that, I'm happy to get a CGImage or anything else you'd like that's available. I'd like to write this function: - (int)getRGBAFromImage:(UIImage *)image atX:(int)..

PHP get dropdown value and text

<select id="animal" name="animal"> <option value="0">--Select Animal--</option> <option value="1">Cat</option> <option value="2">Dog</optio..

Get URL of ASP.Net Page in code-behind

I have an ASP.Net page that will be hosted on a couple different servers, and I want to get the URL of the page (or even better: the site where the page is hosted) as a string for use in the code-beh..

What's the difference between align-content and align-items?

Can anybody show me the difference between align-items and align-content?..

How to list physical disks?

How to list physical disks in Windows? In order to obtain a list of "\\\\.\PhysicalDrive0" available...

Tracing XML request/responses with JAX-WS

Is there an easy way (aka: not using a proxy) to get access to the raw request/response XML for a webservice published with JAX-WS reference implementation (the one included in JDK 1.5 and better) ? B..

batch/bat to copy folder and content at once

I'm writing a batch script that does a copy. I want to script it to copy an entire folder. When I want to copy a single file, I do this copy %~dp0file.txt file.txt If I have a folder with this st..

Java 8 forEach with index

Is there a way to build a forEach method in Java 8 that iterates with an index? Ideally I'd like something like this: params.forEach((idx, e) -> query.bind(idx, e)); The best I could do right no..

Storing money in a decimal column - what precision and scale?

I'm using a decimal column to store money values on a database, and today I was wondering what precision and scale to use. Since supposedly char columns of a fixed width are more efficient, I was thi..

Create a batch file to copy and rename file

I need to write a batch file that copies a file to a new folder and renames it. At the moment, my batch file consists of only this command: COPY ABC.PDF \\Documents As you can see, it only copies..

Bash command line and input limit

Is there some sort of character limit imposed in bash (or other shells) for how long an input can be? If so, what is that character limit? I.e. Is it possible to write a command in bash that is too l..

Dump all documents of Elasticsearch

Is there any way to create a dump file that contains all the data of an index among with its settings and mappings? A Similar way as mongoDB does with mongodump or as in Solr its data folder is cop..

How to get host name with port from a http or https request

I have two applications deployed in jboss container(same unix box). If i get a request from app1, i need to frame a corresponding request for app2. eg: if app1 request is:

Auto-increment primary key in SQL tables

Using Sql Express Management Studio 2008 GUI (not with coding), how can I make a primary key auto-incremented? Let me explain: there is a table which has a column named "id" and the items of this col..

Concatenating null strings in Java

Why does the following work? I would expect a NullPointerException to be thrown. String s = null; s = s + "hello"; System.out.println(s); // prints "nullhello" ..

Parse large JSON file in Nodejs

I have a file which stores many JavaScript objects in JSON form and I need to read the file, create each of the objects, and do something with them (insert them into a db in my case). The JavaScript o..

ldap query for group members

I'm trying to make an LDAP query, to get a list from all my groups/members. I can't figure out how can i do this. All my tries were unsuccesfull. My "AD tree": mydomain.local/Mybusiness/Distribution ..

How to make JQuery-AJAX request synchronous

How do i make an ajax request synchronous? I have a form which needs to be submitted. But it needs to be submitted only when the user enters the correct password. Here is the form code: <form na..

How can I determine if a String is non-null and not only whitespace in Groovy?

Groovy adds the isAllWhitespace() method to Strings, which is great, but there doesn't seem to be a good way of determining if a String has something other than just white space in it. The best I've ..

Windows recursive grep command-line

I need to do a recursive grep in Windows, something like this in Unix/Linux: grep -i 'string' `find . -print` or the more-preferred method: find . -print | xargs grep -i 'string' I'm stuck with ..

Why would Oracle.ManagedDataAccess not work when Oracle.DataAccess does?

I'm developing a very simple application which I intend to use to troubleshoot an issue I am having on a few machines but before I even got that far I ran into a few issues, including cpu architecture..

How to create a directory if it doesn't exist using Node.js?

Is this the right way to create a directory if it doesn't exist. It should have full permission for the script and readable by others. var dir = __dirname + '/upload'; if (!path.existsSync(dir)) { ..

How to use enums as flags in C++?

Treating enums as flags works nicely in C# via the [Flags] attribute, but what's the best way to do this in C++? For example, I'd like to write: enum AnimalFlags { HasClaws = 1, CanFly =2, ..

SSH configuration: override the default username

Is it possible to configure ssh to know what my username should be? By default it uses the current username, which is not correct in my case. I'm on a loaner laptop, and my username is loaner, but I..

Extract month and year from a zoo::yearmon object

I have a yearmon object: require(zoo) date1 <- as.yearmon("Mar 2012", "%b %Y") class(date1) # [1] "yearmon" How can I extract the month and year from this? month1 <- fn(date1) year1 <- fn..

URL.Action() including route values

I have an ASP.Net MVC 4 app and am using the Url.Action helper like this: @Url.Action("Information", "Admin") This page is used for both adding a new and edit an admin profile. The URLs are as follow..

Very Simple Image Slider/Slideshow with left and right button. No autoplay

I'm trying to make a very, very simple image slider/slideshow with no autoplay please. I only want to go to next or prev image on click. Having some issues as you can read below. Here's the jsFiddle ..

git remote add with other SSH port

In Git, how can I add a remote origin server when my host uses a different SSH port? git remote add origin ssh://user@host/srv/git/example ..

I want to get Year, Month, Day, etc from Java Date to compare with Gregorian Calendar date in Java. Is this possible?

I have a Date object in Java stored as Java's Date type. I also have a Gregorian Calendar created date. The gregorian calendar date has no parameters and therefore is an instance of today's date (and..

php: Get html source code with cURL

How can I get the html source code of without using file_get_contents()? I need to know this because on some webhosts allow_url_fopen is disabled so you can't..

Read and overwrite a file in Python

Currently I'm using this: f = open(filename, 'r+') text = text = re.sub('foobar', 'bar', text) f.write(text) f.close() But the problem is that the old file is larger than the new..

C# - Insert a variable number of spaces into a string? (Formatting an output file)

Alrighty, I'm taking data from a list that I populate a DataGridView with and am exporting it to a text file. I've already done the function to export it to a CSV, and would like to do a plain text ve..

Truncate with condition

truncate ->this resets the entire table, is there a way via truncate to reset particular records/check conditions. For ex: i want to reset all the data and keep last 30 days inside the table. Thank..

Get Base64 encode file-data from Input Form

I've got a basic HTML form from which I can grab a bit of information that I'm examining in Firebug. My only issues is that I'm trying to base64 encode the file data before it's sent to the server whe..

How to get the index of an element in an IEnumerable?

I wrote this: public static class EnumerableExtensions { public static int IndexOf<T>(this IEnumerable<T> obj, T value) { return obj .Select((a, i) => (a.Eq..

How to iterate through SparseArray?

Is there a way to iterate over Java SparseArray (for Android) ? I used sparsearray to easily get values by index. I could not find one...

Finding modified date of a file/folder

I am very new to PowerShell, and I was hoping I could get some help creating a script that tells me the modified date of a file. I wish I knew more about PowerShell, as I feel like I am asking a lot ..

Why doesn't JavaScript have a last method?

Its kinda weird that the JavaScript Array class does not offer a last method to retrieve the last element of an array. I know the solution is simple (Ar[Ar.length-1] ), but, still, this is too frequen..

Is there a way to run Python on Android?

We are working on an S60 version and this platform has a nice Python API.. However, there is nothing official about Python on Android, but since Jython exists, is there a way to let the snake and the..

MySQL check if a table exists without throwing an exception

What is the best way to check if a table exists in MySQL (preferably via PDO in PHP) without throwing an exception. I do not feel like parsing the results of "SHOW TABLES LIKE" et cetera. There must b..

Pass a simple string from controller to a view MVC3

I know this seems pretty basic, and it should be, but I cant find out where I am going wrong. (I hve read other articles with similar titles on SO, and other resources on the web but still cant figure..

List to array conversion to use ravel() function

I have a list in python and I want to convert it to an array to be able to use ravel() function...

Conditional operator in Python?

do you know if Python supports some keyword or expression like in C++ to return values based on if condition, all in the same line (The C++ if expressed with the question mark ?) // C++ value = ( a &..

How can I clone a JavaScript object except for one key?

I have a flat JS object: {a: 1, b: 2, c: 3, ..., z:26} I want to clone the object except for one element: {a: 1, c: 3, ..., z:26} What's the easiest way to do this (preferring to use es6/7 if po..

Difference between Select Unique and Select Distinct

I thought these were synonomous, but I wrote the following in Microsoft SQL: Select Unique col from (select col from table1 union select col from table2) alias And it failed. Changing it to ..

How to toggle a boolean?

Is there a really easy way to toggle a boolean value in javascript? So far, the best I've got outside of writing a custom function is the ternary: bool = bool ? false : true; ..

How to get the date and time values in a C program?

I have something like this: char *current_day, *current_time; system("date +%F"); system("date +%T"); It prints the current day and time in the stdout, but I want to get this output or assign them ..

How can you export the Visual Studio Code extension list?

I need to send all my installed extensions to my colleagues. How can I export them? The extension manager seems to do nothing... It won't install any extension...

Fix footer to bottom of page

Although most pages on my site have enough content to push the footer to the bottom of the page for most people. I would like to know it's always fixed to the bottom regardless of screen size from now..

How to remove foreign key constraint in sql server?

I want to remove foreign key from another table so i can insert values of my choice. I am new in databases so please tell me correct sql query to drop or remove foreign key value...

node.js - how to write an array to file

I have a sample array as follows var arr = [ [ 1373628934214, 3 ], [ 1373628934218, 3 ], [ 1373628934220, 1 ], [ 1373628934230, 1 ], [ 1373628934234, 0 ], [ 1373628934237, -1 ], [ 1373628..

How do I send a POST request as a JSON?

data = { 'ids': [12, 3, 4, 5, 6 , ...] } urllib2.urlopen("",urllib.urlencode(data)) I want to send a POST request, but one of the fields should be a li..

How do you create a Spring MVC project in Eclipse?

I am trying to follow the basic tutorial for Spring MVC but got lost at creating a new project in Eclipse. It seems to me that most tutorials assume you know how to create a Spring Project in Eclipse...

How can I use numpy.correlate to do autocorrelation?

I need to do auto-correlation of a set of numbers, which as I understand it is just the correlation of the set with itself. I've tried it using numpy's correlate function, but I don't believe the re..

MySQL duplicate entry error even though there is no duplicate entry

I am using MySQL 5.1.56, MyISAM. My table looks like this: CREATE TABLE IF NOT EXISTS `my_table` ( `number` int(11) NOT NULL, `name` varchar(50) NOT NULL, `money` int(11) NOT NULL, PRIMARY KE..

How to post data in PHP using file_get_contents?

I'm using PHP's function file_get_contents() to fetch contents of a URL and then I process headers through the variable $http_response_header. Now the problem is that some of the URLs need some data ..

Replace multiple whitespaces with single whitespace in JavaScript string

I have strings with extra whitespaces, each time there's more than only one whitespace I'd like it be only one. Anyone? I tried searching google, but nothing worked for me. Thanks..

Using the Jersey client to do a POST operation

In a Java method, I'd like to use a Jersey client object to do a POST operation on a RESTful web service (also written using Jersey) but am not sure how to use the client to send the values that will ..

Read input from a JOptionPane.showInputDialog box

I am almost done with this project. It's my very first one and I need to read a little better the inputs from the JOption box. For example, I want to go back to the previous page if the user clicks on..

PHP foreach loop through multidimensional array

I have an array: $arr_nav = array( array( "id" => "apple", "url" => "apple.html", "name" => "My Apple" ), array( "id" => "orange", "url" =..

How to know if .keyup() is a character key (jQuery)

How to know if .keyup() is a character key (jQuery) $("input").keyup(function() { if (key is a character) { //such as a b A b c 5 3 2 $ # ^ ! ^ * # ...etc not enter key or shift or Esc or space ...e..

Retrieving an element from array list in Android?

I am trying to implement voice recognition code in Android. How do I get an element at a particular position from array list in Android? I tried converting arraylist to array and retriving. Still the ..

What does ==$0 (double equals dollar zero) mean in Chrome Developer Tools?

In Google Chrome's developer tools, when I select an element, I see ==$0 next to the selected element. What does that mean? ..

Using Jquery AJAX function with datatype HTML

We have a complete code for getting the values from PHP through Jquery AJAX with JSON datatype. Here are the codes. HTML CODE <html> <head> <meta http-equiv="Content-Type" conten..

load json into variable

I have to do something very simple, but there doesn't seem to be an easy way to do this, as far as I can tell. I just want to load JSON data from a remote source and store it in a global Javascript va..

Best way to format if statement with multiple conditions

If you want to some code to execute based on two or more conditions which is the best way to format that if statement ? first example:- if(ConditionOne && ConditionTwo && ConditionTh..

TCPDF Save file to folder?

I'm using TCPDF to print a receipt and then send it to customer with phpMailer, but I have a problem: I have no idea how to save the file into a pdf. I've tried this: // reset pointer to the last ..

How to run a Python script in the background even after I logout SSH?

I have Python script and I want it to run all the time, because it is part of the web service I build. How can I make it run continuously even after I logout SSH? ..

Is there an easy way to strike through text in an app widget?

I was wondering if there is an easy way to strike text within an app widget in Android. In a normal activity, it is pretty easy, using textview flags: textView.setPaintFlags(textView.getPaintFlags() ..

How to export a mysql database using Command Prompt?

I have a database that is quite large so I want to export it using Command Prompt but I don't know how to. I am using WAMP...

How should I make my VBA code compatible with 64-bit Windows?

I have a VBA application developed in Excel 2007, and it contains the following code to allow access to the ShellExecute function from Shell32.dll: Private Declare Function ShellExecute Lib "shell32...

Running python script inside ipython

Is it possible to run a python script (not module) from inside ipython without indicating its path? I tried to set PYTHONPATH but it seems to work only for modules. I would like to execute %run my_s..

Found shared references to a collection org.hibernate.HibernateException

I got this error message: error: Found shared references to a collection: Person.relatedPersons When I tried to execute addToRelatedPersons(anotherPerson): person.addToRelatedPersons(anotherPer..

How to listen to route changes in react router v4?

I have a couple of buttons that acts as routes. Everytime the route is changed, I want to make sure the button that is active changes. Is there a way to listen to route changes in react router v4?..

How to pad a string to a fixed length with spaces in Python?

I'm sure this is covered in plenty of places, but I don't know the exact name of the action I'm trying to do so I can't really look it up. I've been reading an official Python book for 30 minutes try..

Object reference not set to an instance of an object.

I keep getting this error when I run the program. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web requ..

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

SQL Server Service not available in service list after installation of SQL Server Management Studio

I have Windows 7 Home edition SP1 installed on my system, and downloaded SQL Server 2008 R2 Management Studio and got it installed. But when I try to connect via .\SQLEXPRESS, SSMS shows error A netw..

PHP header(Location: ...): Force URL change in address bar

I'm currently working on a mobile site with authentication using PHP sessions with a database. I have a login page with a form that goes to server_login.php on submit. The php file then creates some s..

Java Wait for thread to finish

I have a thread downloading data and I want to wait until the download is finished before I load the data. Is there a standard way of doing this? More Info: I have a Download class that gets data f..

In Windows cmd, how do I prompt for user input and use the result in another command?

I have a Windows .bat file which I would like to accept user input and then use the results of that input as part of the call to additional commands. For example, I'd like to accept a process ID from..

How to convert a JSON string to a dictionary?

I want to make one function in my swift project that converts String to Dictionary json format but I got one error: Cannot convert expression's type (@lvalue NSData,options:IntegerLitralConvertibl..

How to pop an alert message box using PHP?

How to pop an alert message box using PHP?..

c# write text on bitmap

I have following problem. I want to make some graphics in c# windows form. I want to read bitmap to my program and after it write some text on this bitmap. In the end I want this picture load to pict..

How to implement a lock in JavaScript

How could something equivalent to lock in C# be implemented in JavaScript? So, to explain what I'm thinking a simple use case is: User clicks button B. B raises an onclick event. If B is in event..

Buiding Hadoop with Eclipse / Maven - Missing artifact

I am trying to import cloudera's org.apache.hadoop:hadoop-client:2.0.0-cdh4.0.0 from cdh4 maven repo in a maven project in eclipse 3.81, m2e plugin, with oracle's jdk 1.7.0_05 on win7 using <depe..

How to add content to html body using JS?

I have many <section> in my html <body> and want to add more through javascript. However, using innerHTML is just replacing my existing sections with new ones, instead of adding them to th..

Use basic authentication with jQuery and Ajax

I am trying to create a basic authentication through the browser, but I can't really get there. If this script won't be here the browser authentication will take over, but I want to tell the browser ..

Properties file with a list as the value for an individual key

For my program I want to read a key from a properties file and an associated List of values for the key. Recently I was trying like that public static Map<String,List<String>>categoryMap ..

jQuery SVG vs. Raphael

I'm working on an interactive interface using SVG and JavaScript/jQuery, and I'm trying to decide between Raphael and jQuery SVG. I'd like to know What the trade-offs are between the two Where the ..

Extracting columns from text file with different delimiters in Linux

I have very large genotype files that are basically impossible to open in R, so I am trying to extract the rows and columns of interest using linux command line. Rows are straightforward enough using ..

Excel formula to get week number in month (having Monday)

Using excel formula I need to get week number in month from a given date. But, the condition is it should have Monday in it. Monday through Sunday is the work days. I have tried this: But, week nu..

Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine

I am facing this problem since more than a month, here is what I see when I run java on command line: $ java -Xmx1300m Error occurred during initialization of VM Could not reserve enough space for o..

How to get all elements inside "div" that starts with a known text

I have a div element in an HTML document. I would like to extract all elements inside this div with id attributes starting with a known string (e.g. "q17_"). How can I achieve this using JavaScript ..

Uncaught Invariant Violation: Too many re-renders. React limits the number of renders to prevent an infinite loop

I'm trying to add a snackBar in order to display a message whenever a user signIn or not. SnackBar.jsx: import React from "react"; import PropTypes from "prop-types"; import classNames from "classnam..

How do I create a timer in WPF?

I am a newbie in timer in wpf and I need a code that every 5mins there is a message box will pop up. .can anyone help me for the simple code of timer. That's what I tried so far: System.Windows.Thr..

Mysql SELECT CASE WHEN something then return field

I have two field nnmu and nnmi , if nnmu is equal to 1, I need to return naziv_mesta from **mesto_istovara**, else if it's =0 I need to return naziv_mesta from mesto_utovara table and reverse, if ..

Fill remaining vertical space - only CSS

I need to fill the remaining vertical space of #wrapper under #first with #second div. I need an only CSS solution. _x000D_ _x000D_ #wrapper {_x000D_ width: 300px;_x000D_ height: 100%;_x000D_ }_..

How to read pdf file and write it to outputStream

I need to read a pdf file with filepath "C:\file.pdf" and write it to outputStream. What is the easiest way to do that? @Controller public class ExportTlocrt { @Autowired private PhoneBookService ph..

Update value of a nested dictionary of varying depth

I'm looking for a way to update dict dictionary1 with the contents of dict update wihout overwriting levelA dictionary1={'level1':{'level2':{'levelA':0,'levelB':1}}} update={'level1':{'level2':{'leve..

Move top 1000 lines from text file to a new file using Unix shell commands

I wish to copy the top 1000 lines in a text file containing more than 50 million entries, to another new file, and also delete these lines from the original file. Is there some way to do the same wit..


I would like to create a stored routine for MySQL that figures out the number of business or working days for a month (Working Days are Monday thru Friday). It's a syntax error however I don't know w..

How to install iPhone application in iPhone Simulator

I have a file - an iPhone application developed by xcode. How do I run this (only file) application using my xcode?..

Search for exact match of string in excel row using VBA Macro

How do I search for a string in one particular row in excel? the I have the row index in a long type variable. Dim rowIndex As Long rowIndex = // some value being set here using some code. Now I ne..

How to update the constant height constraint of a UIView programmatically?

I have a UIView and I set the constraints using Xcode Interface Builder. Now I need to update that UIView instance's height constant programmatically. There is a function that goes like myUIView.updat..

Typescript es6 import module "File is not a module error"

I am using typescript 1.6 with es6 modules syntax. My files are: test.ts: module App { export class SomeClass { getName(): string { return 'name'; } } } main.ts: import App fro..

Javascript wait() function

I want to create a JavaScript wait() function. What should I edit? function wait(waitsecs) { setTimeout(donothing(), 'waitsecs'); } function donothing() { // } ..

Get an object attribute

Simple question but since I'm new to python, comming over from php, I get a few errors on it. I have the following simple class: User(object) fullName = "John Doe" user = User() In PHP I c..

Why is the minidlna database not being refreshed?

I am developing a MiniDLNA server to stream media over WiFi. Existing files are shown properly. However, when I add new files to media folders the changes are not updated across MiniDLNA clients. I h..

Is there a C++ gdb GUI for Linux?

Briefly: Does anyone know of a GUI for gdb that brings it on par or close to the feature set you get in the more recent version of Visual C++? In detail: As someone who has spent a lot of time progr..

Const in JavaScript: when to use it and is it necessary?

I've recently come across the const keyword in JavaScript. From what I can tell, it is used to create immutable variables, and I've tested to ensure that it cannot be redefined (in Node.js): const x ..

Chrome:The website uses HSTS. Network errors...this page will probably work later

I am developing against localhost. This morning right after I used fiddler I started getting this error on chrome (works correctly in firefox) "You cannot visit localhost right now because the websit..

What special characters must be escaped in regular expressions?

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps. It is different with, for example, Python, sed, grep, awk, ..

Running an outside program (executable) in Python?

I just started working on Python, and I have been trying to run an outside executable from Python. I have an executable for a program written in Fortran. Let’s say the name for the executable is fl..

navbar color in Twitter Bootstrap

How can I change the background color of the navbar of the Twitter Bootstrap 2.0.2? How can I change color of all the elements of the navbar to reflect the background color?..

How to compare dates in c#

I have two dates. One date is input and other is DateTime.Now. I have them in mm/dd/yyyy format, it can even be m/d/yy format also. Both dates are nullable i.e, datatype is DateTime?, since I can pass..

Enable/Disable a dropdownbox in jquery

I am new to jQuery and I want to enable and disable a dropdown list using a checkbox. This is my html: <select id="dropdown" style="width:200px"> <option value="feedback" name="aft_qst"..

Testing socket connection in Python

This question will expand on: Best way to open a socket in Python When opening a socket how can I test to see if it has been established, and that it did not timeout, or generally fail. Edit: I tried..

How can I detect whether an iframe is loaded?

I am trying to check whether an iframe has loaded after the user clicks a button. I have $('#MainPopupIframe').load(function(){ console.log('load the iframe') //the console won't show anythi..

UTF-8 in Windows 7 CMD

I've tried to display UTF-8 in the win7 cmd. Currently, I'm using the standard font because as I see with the mysql.exe, it works fine with the characters I'm working with (currently the german umlaut..

How do I get my solution in Visual Studio back online in TFS?

I had my solution in Visual Studio 2012 (which is under TFS source control) open and the TFS server (2010) was down. When I then made a change to one of the files and attempted to save it I got a prom..

Static constant string (class member)

I'd like to have a private static constant for a class (in this case a shape-factory). I'd like to have something of the sort. class A { private: static const string RECTANGLE = "rectang..

Android screen size HDPI, LDPI, MDPI

I have a background that I need fit in all screen sizes. I have three folders, hdpi, ldpi and mdpi for drawables, but in the emulator there isn't any referense to what resolution hdpi is and what mdp..

Spring MVC - How to get all request params in a map in Spring controller?

Sample URL: ../search/?attr1=value1&attr2=value2&attr4=value4 I do not know the names of attr1, att2, and attr4. I would like to be able to do something like that (or similar, don't care, ..

How to initialize private static members in C++?

What is the best way to initialize a private, static data member in C++? I tried this in my header file, but it gives me weird linker errors: class foo { private: static int i; }; int f..

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes)

Possible Duplicate: Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php I got the following error when executing my code. Fatal error: Allowed memory ..

Apply CSS to jQuery Dialog Buttons

So I currently have a jQuery dialog with two buttons: Save and Close. I create the dialog using the code below: $dialogDiv.dialog({ autoOpen: false, modal: true, width: 600, resizable..

How to update primary key

Here is my problem - I have 2 tables: WORKER, with columns |ID|OTHER_STAF| , where ID is primary key FIRM, with columns |FPK|ID|SOMETHING_ELSE| , where combination FPK and ID make primary key, and al..

Java: Array with loop

I need to create an array with 100 numbers (1-100) and then calculate how much it all will be (1+2+3+4+..+100 = sum). I don't want to enter these numbers into the arrays manually, 100 spots would tak..

In Postgresql, force unique on combination of two columns

I would like to set up a table in PostgreSQL such that two columns together must be unique. There can be multiple values of either value, so long as there are not two that share both. For instance: ..

Xampp localhost/dashboard

I downloaded the recent version of xampp and I installed it and everything but when i type "localhost" in the browser it redirects me to localhost/dashboard is there a way to type localhost and see th..

efficient way to implement paging

Should I use LINQ's Skip() and Take() method for paging, or implement my own paging with a SQL query? Which is most efficient? Why would I choose one over the other? I'm using SQL Server 2008, ASP.N..

Google Authenticator available as a public service?

Is there public API for using the Google Authenticator (two factor authentication) on self-running (e.g. LAMP stack) web apps?..

How to check if the URL contains a given string?

How could I do something like this: <script type="text/javascript"> $(document).ready(function () { if(window.location.contains("franky")) // This doesn't work, any suggestions? { ..

Change image source in code behind - Wpf

I need to set image source dynamically, please note my image is in somewhere on the Network, here is my code BitmapImage logo = new BitmapImage(); logo.BeginInit(); logo.UriSource = new Uri(@"pack://..

Remove last character from string. Swift language

How can I remove last character from String variable using Swift? Can't find it in documentation. Here is full example: var expression = "45+22" expression = expression.substringToIndex(countElement..

Multiple scenarios @RequestMapping produces JSON/XML together with Accept or ResponseEntity

I am working with Spring 4.0.7 About Spring MVC, for research purposes, I have the following: @RequestMapping(value="/getjsonperson", method=RequestMethod.GET, pro..

How to start Spyder IDE on Windows

I downloaded spyder using the pip install spyder in my windows 10 32-bit operating system, but i dont see any desktop icons or exe files to start running the IDE. I downloaded spyder 3, any my pyth..

How do I make a PHP form that submits to self?

How do I make a self-posting/self-submitting form, i.e. a form that submits the results to itself, instead of submitting to another form?..

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

How to write a unit test for a Spring Boot Controller endpoint

I have a sample Spring Boot app with the following Boot main class @SpringBootApplication public class DemoApplication { public static void main(String[] args) {

Change private static final field using Java reflection

I have a class with a private static final field that, unfortunately, I need to change it at run-time. Using reflection I get this error: java.lang.IllegalAccessException: Can not set static final bo..

Best way to remove from NSMutableArray while iterating?

In Cocoa, if I want to loop through an NSMutableArray and remove multiple objects that fit a certain criteria, what's the best way to do this without restarting the loop each time I remove an object? ..

Listing files in a specific "folder" of a AWS S3 bucket

I need to list all files contained in a certain folder contained in my S3 bucket. The folder structure is the following /my-bucket/users/<user-id>/contacts/<contact-id> I have files re..

Call a REST API in PHP

Our client had given me a REST API to which I need to make a PHP call to. But as a matter of fact the documentation given with the API is very limited, so I don't really know how to call the service. ..

Efficient evaluation of a function at every cell of a NumPy array

Given a NumPy array A, what is the fastest/most efficient way to apply the same function, f, to every cell? Suppose that we will assign to A(i,j) the f(A(i,j)). The function, f, doesn't have a binar..

The best way to calculate the height in a binary search tree? (balancing an AVL-tree)

I'm looking for the best way to calculate a nodes balance in an AVL-tree. I thought I had it working, but after some heavy inserting/updating I can see that it's not working correct (at all). This i..

Parse JSON String into List<string>

string json = "{\"People\":[{\"FirstName\":\"Hans\",\"LastName\":\"Olo\"} {\"FirstName\":\"Jimmy\",\"LastName\":\"Crackedcorn\"}]}"; var obj = JObject.Parse(json); List&l..

Vertical Tabs with JQuery?

I want tabs along the left side of the page instead of across the top. I'm already loading jQuery for other reasons (effects), so I prefer using jQuery to another UI framework. Searches on "vertical..

How to check if variable's type matches Type stored in a variable

User u = new User(); Type t = typeof(User); u is User -> returns true u is t -> compilation error How do I test if some variable is of some type in this way?..

Reading data from DataGridView in C#

How can I read data from DataGridView in C#? I want to read the data appear in Table. How do I navigate through lines?..

vue.js 2 how to watch store values from vuex

I am using vuex and vuejs 2 together. I am new to vuex, I want to watch a store variable change. I want to add the watch function in my vue component This is what I have so far: import Vue from 'v..

VSCode single to double quote automatic replace

When I execute a Format Document command on a Vue Component.vue file VSCode replace all single quoted string with double quoted string. In my specific case this rule conflicts with electron-vue lint ..

Javascript swap array elements

Is there any simpler way to swap two elements in an array? var a = list[x], b = list[y]; list[y] = a; list[x] = b; ..

How do I create variable variables?

How do I accomplish variable variables in Python? Here is an elaborative manual entry, for instance: Variable variables I hear this is a bad idea in general though, and it is a security hole in PHP. I..

Get and Set a Single Cookie with Node.js HTTP Server

I want to be able to set a single cookie, and read that single cookie with each request made to the nodejs server instance. Can it be done in a few lines of code, without the need to pull in a third p..

How to display svg icons(.svg files) in UI using React Component?

I have seen lot libraries for svg on react but none gave me how to import a .svg in the react component , I have seen code which talk about bring the svg code in to react rather than using the .svg ic..

Getting "TypeError: failed to fetch" when the request hasn't actually failed

I'm using fetch API within my React app. The application was deployed on a server and was working perfectly. I tested it multiple times. But, suddenly the application stopped working and I've no clue ..

How to change color of ListView items on focus and on click

i have a list View in my app (this is the xml layout): <?xml version="1.0" encoding="utf-8"?> <ListView xmlns:android="" android:id="@+id/..

Best way to do a split pane in HTML

Is there a good technique to make a resizable split pane in HTML? May it be done using CSS / jQuery / JavaScript or is there a good JavaScript library that have been used? (An example of a split pane ..

Your content must have a ListView whose id attribute is ''

I have created an xml file like this: <?xml version="1.0" encoding="utf-8"?> <ListView xmlns:android="" android:layout_width="match_parent" ..

Import Android volley to Android Studio

I wanna use the google's volley library I am using Android Studio and I know how to add .jar libraries. But I could not create a .jar library with the volley files: https://android.googlesource..

Embed YouTube Video with No Ads

I'm embedding YouTube videos in a widget ( to help non-profits raise money. Unfortunately, some of them are not technically inclined enough to turn off ads that displ..

What is the difference between Sublime text and Github's Atom

Github announced Atom which is very similar to Sublime. Even some keyboard shortcuts like ? + P, ? + Shift + P etc. are same. How is Atom different from Sublime? Does it include IDE features lik..

JAVA_HOME directory in Linux

Is there any linux command I could use to find out JAVA_HOME directory? I've tried print out the environment variables ("env") but I can't find the directory...

How to get the class of the clicked element?

I can't figure it out how to get the class value of the clicked element. When I use the code bellow, I get "node-205" every time. jQuery: .find('> ul') .tabs( { selectedClass: 'active', ..

jQuery checkbox check/uncheck

What would be a proper way to check/uncheck checkbox that's placed inside the element that triggers my function? Here's my code: <table id="news_list"> <tr> <td><input type=..

How to set the max size of upload file

I'm developing application based on Spring Boot and AngularJS using JHipster. My question is how to set max size of uploading files? If I'm trying to upload to big file I'm getting this information i..

finished with non zero exit value

I am trying to import my project. but when I run the application I am getting the following error: Error: Execution failed for task ':app:processDebugResources'. >

Getting all names in an enum as a String[]

What's the easiest and/or shortest way possible to get the names of enum elements as an array of Strings? What I mean by this is that if, for example, I had the following enum: public enum State { ..

JavaScript push to array

How do I push new values to the following array? json = {"cool":"34.33","alsocool":"45454"} I tried json.push("coolness":"34.33");, but it didn't work...

How to get the url parameters using AngularJS

HTML source code <div ng-app=""> <div ng-controller="test"> <div ng-address-bar browser="html5"></div> <br><br> $location.url() = {{$locatio..

How to detect orientation change?

I am using Swift and I want to be able to load a UIViewController when I rotate to landscape, can anyone point me in the right direction? I Can't find anything online and a little bit confused by the..

set height of imageview as matchparent programmatically

I need to set the height of an imageview as matchparent programatically.if it is a fixed height i know how to set. but how can i set it as matchparent? EDIT: actually height of the parent layout ..

How to set a default value for an existing column

This isn't working in SQL Server 2008: ALTER TABLE Employee ALTER COLUMN CityBorn SET DEFAULT 'SANDNES' The error is: Incorrect syntax near the keyword 'SET'. What am I doing wrong?..

Get elements by attribute when querySelectorAll is not available without using libraries?

<p data-foo="bar"> How can you do the equivalent to document.querySelectorAll('[data-foo]') where querySelectorAll is not available? I need a native solution that works at least in IE7. I..

Break out of a While...Wend loop

I am using a While...Wend loop of VBA. Dim count as Integer While True count=count+1 If count = 10 Then ''What should be the statement to break the While...Wend loop? ''Bre..

Simple logical operators in Bash

I have a couple of variables and I want to check the following condition (written out in words, then my failed attempt at bash scripting): if varA EQUALS 1 AND ( varB EQUALS "t1" OR varB EQUALS "t2" ..

MVC 4 client side validation not working

Can anyone tell me why client side validation is not working in my MVC 4 application. _layout.schtml @Scripts.Render("~/bundles/jquery") @RenderSection("scripts", required: false) ..

Setting a log file name to include current date in Log4j

I would like to set the log file name for a log4j and log4net appender to have the current date. We are doing Daily rollovers but the current log file does not have a date. The log file name format ..

How to format html table with inline styles to look like a rendered Excel table?

I'm currently stuck setting borders in an html table. (I use inline styles for a better rendering in e-mail-clients) I have this piece of code: <html> <body> <table style="..

Python integer division yields float

Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> 2/2 1.0 Is this intended? I str..

Postgres manually alter sequence

I'm trying to set a sequence to a specific value. SELECT setval('payments_id_seq'), 21, true This gives an error: ERROR: function setval(unknown) does not exist Using ALTER SEQUENCE doesn't ..

Using a list as a data source for DataGridView

I've extracted the setting names and their respective values out of a configuration file into an ordered dictionary. The dictionary contains keys and values which are of the ICollection class. I want ..

How do I remove files saying "old mode 100755 new mode 100644" from unstaged changes in Git?

For some reason, when I initially did a pull from the repository for a git project of mine, I got a ton of files in my working copy that have no discernible changes made to them, but keep showing up i..

React Native Error: ENOSPC: System limit for number of file watchers reached

I have setup a new blank react native app. After installing few node modules I got this error. Running application on PGN518. internal/fs/watchers.js:173 throw error; ^ Error: ENOSPC: System l..

Preprocessor check if multiple defines are not defined

I have a selection of #defines in a header that are user editable and so I subsequently wish to check that the defines exist in case a user deletes them altogether, e.g. #if defined MANUF && ..

Sorting a list using Lambda/Linq to objects

I have the name of the "sort by property" in a string. I will need to use Lambda/Linq to sort the list of objects. Ex: public class Employee { public string FirstName {set; get;} public string L..

cmake and libpthread

I'm running RHEL 5.1 and use gcc. How I tell cmake to add -pthread to compilation and linking?..

How to fix UITableView separator on iOS 7?

UITableView draws with ragged lines on iOS 7: How to fix it? The line between cells should be on the full width of the screen...

What is SaaS, PaaS and IaaS? With examples

What do the following terms mean? SaaS PaaS IaaS? There are various cloud services available today, such as Amazon's EC2 and AWS, Apache Hadoop, Microsoft Azure and many others. Which category do..

How to force ViewPager to re-instantiate its items

I am using ViewPager to allow user to swipe between its views. Is there a way how to force this ViewPager to reload/re-instantiate its views in case that they are no longer valid or needs to be refres..

How are VST Plugins made?

I would like to make (or learn how to make) VST plugins. Is there a special SDK for this? how does one yield a .vst instead of a .exe? Also, if one is looking to make Audio Units for Logic Pro, how is..