Questions Tagged with #Design time

In opposition to the run-time of a software, its design-time represents the time where it's being created.

Any easy way to use icons from resources?

I have an C# app. I need to add an icon to that app so i added an icon resource. Adding resource went fine, but is there any way to use my (resource) icon as form icon WITHOUT adding additional code? ..

User Control - Custom Properties

I have developed a User Control in Visual Studio (WinForms C#) and have a question. I need the user of my User Control to be able to change certain string values and I would like them to be able to a..

How to limit the number of selected checkboxes?

I have the following HTML: <div class="pricing-levels-3"> <p><strong>Which level would you like? (Select 3 Levels)</strong></p> <input class="single-checkbox"type..

PHP json_encode json_decode UTF-8

How can I save a json-encoded string with international characters to the databse and then parse the decoded string in the browser? <?php $string = "très agréable"; // to th..

Alternative to deprecated getCellType

I'm reading an excel-file (file extension xlsx) using org.apache.poi 3.15. This is my code: try (FileInputStream fileInputStream = new FileInputStream(file); XSSFWorkbook workbook = new XSSFWorkboo..

Undefined behavior and sequence points

What are "sequence points"? What is the relation between undefined behaviour and sequence points? I often use funny and convoluted expressions like a[++i] = i;, to make myself feel better. W..

MySql export schema without data

I'm using a MySql database with a Java program, now I want to give the program to somebody else. How to export the MySql database structure without the data in it, just the structure?..

How to convert list of key-value tuples into dictionary?

I have a list that looks like: [('A', 1), ('B', 2), ('C', 3)] I want to turn it into a dictionary that looks like: {'A': 1, 'B': 2, 'C': 3} What's the best way to go about this? EDIT: My list o..

How to Display Selected Item in Bootstrap Button Dropdown Title

I am using the bootstrap Dropdown component in my application like this: <div class="btn-group"> <button class="btn">Please Select From List</button> <button class="btn d..

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

Xcode "Device Locked" When iPhone is unlocked

When I tried to build and run, Xcode said my device was locked. I looked at my iPhone, and it's not locked at all. How do I fix this?..

Extract Number from String in Python

I am new to Python and I have a String, I want to extract the numbers from the string. For example: str1 = "3158 reviews" print (re.findall('\d+', str1 )) Output is ['4', '3'] I want to get 3158 ..

How to analyze information from a Java core dump?

If a process crashes and leaves a core dump or I create one with gcore then how can I analyze it? I'd like to be able to use jmap, jstack, jstat etc and also to see values of all variables. This w..

Uncaught TypeError: (intermediate value)(...) is not a function

Everything works fine when I wrote the js logic in a closure as a single js file, as: (function(win){ //main logic here win.expose1 = .... win.expose2 = .... })(window) but when I try to i..

How to convert a Django QuerySet to a list

I have the following: answers = Answer.objects.filter(id__in=[ for answer in answer_set.answers.all()]) then later: for i in range(len(answers)): # iterate through all existing Questi..

How do I keep a label centered in WinForms?

In WinForms I am using a Label to display different messages like success, failure, etc. I'd like to center that label in the center form. I want a solution that will keep it centered whether there's..

How to delete node from XML file using C#

Possible Duplicate: How to remove an XmlNode from XmlNodeList Hi, How can i delete a set of nodes from an XML file.? Here is a code snippet. string path = @"C:\Documents and Settings\e45493..

JQuery create a form and add elements to it programmatically

Hi I need to create a form and add elements to it programatically. $form = $("<form></form>"); $form.append("<input type=button value=button"); this doesn't seem to work right...

Import multiple csv files into pandas and concatenate into one DataFrame

I would like to read several csv files from a directory into pandas and concatenate them into one big DataFrame. I have not been able to figure it out though. Here is what I have so far: import glob ..

Convert .class to .java

I have some .class files that I need to convert to .java so I did: javap -c ClassName.class and all the time I have the same error ERROR:Could not find ClassName.class Do you guys have any idea of w..

Losing scope when using ng-include

I have this module routes: var mainModule = angular.module('lpConnect', []). config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/home', {template:'views/home...

Linux/Unix command to determine if process is running?

I need a platform independent (Linux/Unix|OSX) shell/bash command that will determine if a specific process is running. e.g. mysqld, httpd... What is the simplest way/command to do this?..

I can not find my.cnf on my windows computer

My computer is Windows XP. I need to find my.cnf to get all privileges back to the root user. I accidentally removed some privileges of the root user. I still have the password and there is no probl..

How do I detect what .NET Framework versions and service packs are installed?

A similar question was asked here, but it was specific to .NET 3.5. Specifically, I'm looking for the following: What is the correct way to determine which .NET Framework versions and service packs ..

Show red border for all invalid fields after submitting form angularjs

I have a form in which I have some input fields. Some of them are required fields and some are email fields. I am using HTML5 required attribute for required fields and type="email" attribute for em..

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

Why am I getting this database error when I update a table? ERROR at line 1: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired ..

How to set True as default value for BooleanField on Django?

I am using BooleanField in Django. By default, the checkbox generated by it is unchecked state. I want the state to be checked by default. How do I do that?..

How to edit default dark theme for Visual Studio Code?

I'm using Windows 7 64-bit. Is there a way to edit default dark theme in the Visual Studio Code? In %USERPROFILE%\.vscode folder there are only themes from the extensions, while in installation path ..

How to determine a Python variable's type?

How do I see the type of a variable whether it is unsigned 32 bit, signed 16 bit, etc.? How do I view it?..

ASP.Net 2012 Unobtrusive Validation with jQuery

I was playing with Visual Studio 2012 and I created an empty ASP.Net Web Application, when I tried to add the traditional validator controls to a new page, this error occurs: WebForms UnobtrusiveV..

React Router Pass Param to Component

const rootEl = document.getElementById('root'); ReactDOM.render( <BrowserRouter> <Switch> <Route exact path="/"> <MasterPage /> ..

JavaScript: filter() for Objects

ECMAScript 5 has the filter() prototype for Array types, but not Object types, if I understand correctly. How would I implement a filter() for Objects in JavaScript? Let's say I have this object: ..

Python integer incrementing with ++

I've always laughed to myself when I've looked back at my VB6 days and thought, "What modern language doesn't allow incrementing with double plus signs?": number++ To my surprise, I can't find anyt..

How do I disable a href link in JavaScript?

I have a tag <a href="#"> Previous </a> 1 2 3 4 <a href="#"> Next </a> and in some conditions I want this tag to be completely disabled. Code from comments (this is how the li..

How to get arguments with flags in Bash

I know that I can easily get positioned parameters like this in bash: $0 or $1 I want to be able to use flag options like this to specify for what each parameter is used: mysql -u user -h host Wh..

Writing string to a file on a new line every time

I want to append a newline to my string every time I call file.write(). What's the easiest way to do this in Python?..

How to make <div> fill <td> height

I've looked through several posts on StackOverflow, but haven't been able to find an answer to this rather simple question. I have an HTML construct like this: <table> <tr> <td ..

Splitting words into letters in Java

How can you split a word to its constituent letters? Example of code which is not working class Test { public static void main( String[] args) { String[] result = "Stack Me 12..

Adding a slide effect to bootstrap dropdown

I'm using bootstrap, and I'd like to add animation to a dropdown. I want to add an animation to it, slide down and back up when leaving it. How could I do this? Things I tried: Changing the Js drop ..

Python style - line continuation with strings?

In trying to obey the python style rules, I've set my editors to a max of 79 cols. In the PEP, it recommends using python's implied continuation within brackets, parentheses and braces. However, whe..

Accessing localhost (xampp) from another computer over LAN network - how to?

I have just set up a wi-fi network at home. I have all my files on my desktop computer ( and want to access localhost over there from another computer ( On my desktop I can ..

Clear form after submission with jQuery

What's the easiest way to clear this form after refresh. The way I have tried will clear the form but not submit to the database. Could someone else explain to me the best way to do this. <html>..

Facebook Graph API : get larger pictures in one request

I'm currently using the Graph API Explorer to make some tests. That's a good tool. I want to get the user's friend list, with friends' names, ids and pictures. So I type :

Get column from a two dimensional array

How can I retrieve a column from a 2-dimensional array and not a single entry? I'm doing this because I want to search for a string in one of the columns only so if there is another way to accomplish ..

Running Python in PowerShell?

I am attempting to learn the very basics of Python using the guide "Learn Python the hard way" by Zed A. Shaw. The problem that I am having is that I can run Python scripts, but only when using .\ in ..

How to make Regular expression into non-greedy?

I'm using jQuery. I have a string with a block of special characters (begin and end). I want get the text from that special characters block. I used a regular expression object for in-string finding. ..

JQuery - Storing ajax response into global variable

Im still somewhat of a newbie on jQuery and the ajax scene, but I have an $.ajax request performing a GET to retrieve some XML files (~6KB or less), however for the duration the user spends on that pa..

How can I change the text inside my <span> with jQuery?

I have a really simple question but it's something I have not done before. I have the following: <td id="abc" style="width:15px;"><span></span></td> I would like to put some..

Error message 'Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.'

I have developed an application using Entity Framework, SQL Server 2000, Visual Studio 2008 and Enterprise Library. It works absolutely fine locally, but when I deploy the project to our test enviro..

How can I read Chrome Cache files?

A forum I frequent was down today, and upon restoration, I discovered that the last two days of forum posting had been rolled back completely. Needless to say, I'd like to get back what data I can f..

Describe table structure

Which query will give the table structure with column definitions in SQL?..

Extract public/private key from PKCS12 file for later use in SSH-PK-Authentication

I want to extract the public and private key from my PKCS#12 file for later use in SSH-Public-Key-Authentication. Right now, I'm generating keys via ssh-keygen which I put into .ssh/authorized_key, ..

Get query from java.sql.PreparedStatement

In my code I am using java.sql.PreparedStatement. I then execute the setString() method to populate the wildcards of the prepared statement. Is there a way for me to retrieve (and print out) the fin..

Copy from one workbook and paste into another

I have written the following code and continually see pastespecial method of class has failed. I have tried to overcome this issue, but nothing seems to work. I am trying to copy an entire sheet from ..

what is the difference between OLE DB and ODBC data sources?

I was reading a MS Excel help article about pivotcache and wonder what they mean by OLE DB and ODBC sources ...You should use the CommandText property instead of the SQL property, which now ex..

Get all column names of a DataTable into string array using (LINQ/Predicate)

I know we can easily do this by a simple loop, but I want to persue this LINQ/Predicate? string[] columnNames = dt.Columns.? or string[] columnNames = from DataColumn dc in dt.Columns select dc.nam..

How to add additional fields to form before submit?

Is there a way to use javascript and JQuery to add some additional fields to be sent from a HTTP form using POST? I mean: <form action="somewhere" method="POST" id="form"> <input type="su..

Importing PNG files into Numpy?

I have about 200 grayscale PNG images stored within a directory like this. 1.png 2.png 3.png ... ... 200.png I want to import all the PNG images as NumPy arrays. How can I do this?..

Insert the same fixed value into multiple rows

I've got a table with a column, lets call it table_column that is currently null for all rows of the table. I'd like to insert the value "test" into that column for all rows. Can someone give me the..

Set auto height and width in CSS/HTML for different screen sizes

I have 2 issues with this layout : .feature_content (grey background) adapt it's height and width to different screen sizes. Right now, on big screens .feature_content is far from the footer. There ..

{"<user xmlns=''> was not expected.} Deserializing Twitter XML

I'm pulling in the XML from Twitter via OAuth. I'm doing a request to, which returns the following XML: <?xml version="1.0" encoding=&quo..

Setting dynamic scope variables in AngularJs - scope.<some_string>

I have a string I have gotten from a routeParam or a directive attribute or whatever, and I want to create a variable on the scope based on this. So: $scope.<the_string> = "something". Howev..

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

How to use a variable of one method in another method?

I want to know how can I use the variable a[i][j] in the method Scores() to use it in the methods MD() and sumD() in the following code: In my code, the methods MD() and sumD() can't get the result. ..

Java: Calculating the angle between two points in degrees

I need to calculate the angle in degrees between two points for my own Point class, Point a shall be the center point. Method: public float getAngle(Point target) { return (float) Math.toDegrees..

CodeIgniter activerecord, retrieve last insert id?

Are there any options to get the last insert id of a new record in CodeIgniter? $last_id = $this->db->insert('tablename', array('firstcolumn' => 'value', 'secondcolumn' => 'value'..

How to print like printf in Python3?

In Python 2 I used: print "a=%d,b=%d" % (f(x,n),g(x,n)) I've tried: print("a=%d,b=%d") % (f(x,n),g(x,n)) ..

Simple working Example of in

I have the following simplified JSON string from a provider, its been a long time since I used Visual Studio and vb.Net, so I'm very rusty! { "Venue": { "ID": 3145, "Name": "Big Venue, Clap..

Using relative URL in CSS file, what location is it relative to?

When defining something like a background image URL in a CSS file, when using a relative URL, where is it relative to? For example: Suppose the file /stylesheets/base-styles.css contains: div#head..

Pure CSS animation visibility with delay

I am trying to implement some animation onLoad without Javascript. JS is easy, CSS is ... not. I have a div which should be on display: none; and should be display: block; after 3 secondes. Lots of r..

Enum "Inheritance"

I have an enum in a low level namespace. I'd like to provide a class or enum in a mid level namespace that "inherits" the low level enum. namespace low { public enum base { x, y, z } }..

Sort array of objects by string property value

I have an array of JavaScript objects: var objs = [ { first_nom: 'Lazslo', last_nom: 'Jamf' }, { first_nom: 'Pig', last_nom: 'Bodine' }, { first_nom: 'Pirate', last_nom: 'Prenti..

Delegation: EventEmitter or Observable in Angular

I am trying to implement something like a delegation pattern in Angular. When the user clicks on a nav-item, I would like to call a function which then emits an event which should in turn be handled ..

How to display .svg image using swift

I have a .svg image file I want to display in my project. I tried using UIImageView, which works for the .png & .jpg image formats, but not for the .svg extension. Is there any way to display a ..

How do you add CSS with Javascript?

How do you add CSS rules (eg strong { color: red }) by use of Javascript?..

"id cannot be resolved or is not a field" error?

I keep getting this error. Should I just make id a field? My code is: public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); ImageView mainimage = ..

Select a row from html table and send values onclick of a button

I have HTML table where I need to select a row and send its first cell ID to a button and onclick of the button send the selected value to a function in Javascript. How can I achieve this? test.html ..

Can't find file executable in your configured search path for gnc gcc compiler

My problem is that code::blocks error message tells me that it can't find file executable in the search path for gnc gcc compiler. Although, I don't know what that means. Also I typed out some cod..

AVD Manager - No system image installed for this target

Possible Duplicate: Unable to create Android Virtual Device The CPU/ABI field in Android New AVD popup window shows "No system image installed for this target". How do I fix this?..

Jquery sortable 'change' event element position

Is there way to get current position of helper being dragged on over new position ? $("#sortable").sortable({ start: function (event, ui) { var currPos1 = ui.item.index(); ..

jQuery Validation plugin: validate check box

I am using jQuery Validation plugin to validate check box since it does not have default option, One should be selected and max two check boxes can be selected, these is the criteria. I am not getting..

When to use the different log levels

There are different ways to log messages, in order of fatality: FATAL ERROR WARN INFO DEBUG TRACE How do I decide when to use which? What's a good heuristic to use?..

What is the perfect counterpart in Python for "while not EOF"

To read some text file, in C or Pascal, I always use the following snippets to read the data until EOF: while not eof do begin readline(a); do_something; end; Thus, I wonder how can I do this s..

How to determine if a number is odd in JavaScript

Can anyone point me to some code to determine if a number in JavaScript is even or odd?..

Fully backup a git repo?

Is there a simple way to backup an entire git repo including all branches and tags?..

Safest way to convert float to integer in python?

Python's math module contain handy functions like floor & ceil. These functions take a floating point number and return the nearest integer below or above it. However these functions return the an..

What do pty and tty mean?

I noticed many mentions of pty and tty in some open source projects, could someone tell me what do they mean and what is the difference between them?..

How to make an autocomplete address field with google maps api?

Using Google Maps API and JQuery I would like to have an Address field that when typing it will autocomplete the address entered there. How this could be achieved?..

How do I enumerate through a JObject?

I'm trying to determine how to access the data that is in my JObject and I can't for the life of me determine how to use it. JObject Object = (JObject)Response.Data["my_key"]; I can print it to the..

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

Angular: How to update queryParams without changing route

I am trying to update (add, remove) queryParams from a component. In angularJS, it used to be possible thanks to : $'f', 'filters[]'); // setter $['filters[]']; //..

How to get a reversed list view on a list in Java?

I want to have a reversed list view on a list (in a similar way than List#sublist provides a sublist view on a list). Is there some function which provides this functionality? I don't want to make an..

CSS background image to fit width, height should auto-scale in proportion

I have body { background: url(images/background.svg); } The desired effect is that this background image will have width equal to that of the page, height changing to maintain the proportion. e..

How to use a App.config file in WPF applications?

I created an App.config file in my WPF application: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appsettings> <add key="xmlDataDirectory..

List all column except for one in R

Possible Duplicate: Drop Columns R Data frame Let's say I have a dataframe with column c1, c2, c3. I want to list just c1 and c2. How do I do that? I've tried: head(data[column!="c3"]) h..

How to convert a Scikit-learn dataset to a Pandas dataset?

How do I convert data from a Scikit-learn Bunch object to a Pandas DataFrame? from sklearn.datasets import load_iris import pandas as pd data = load_iris() print(type(data)) data1 = pd. # Is there a ..

Pass data to layout that are common to all pages

I have a website which have a layout page. However this layout page have data which all pages model must provide such page title, page name and the location where we actually are for an HTML helper I ..

How to run multiple Python versions on Windows

I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP..

Add number of days to a date

I want to add number of days to current date: I am using following code: $i=30; echo $date = strtotime(date("Y-m-d", strtotime($date)) . " +".$i."days"); But instead of getting proper date i am ge..

Adding Multiple Values in ArrayList at a single index

I have a double ArrayList in java like this. List<double[]> values = new ArrayList<double[]>(2); Now what I want to do is to add 5 values in zero index of list and 5 values in index one..

did you register the component correctly? For recursive components, make sure to provide the "name" option

I configured 'i-tab-pane': Tabpane but report error,the code is bellow: <template> <div class="page-common"> <i-tabs> <i-tab-pane label="wx"> content ..

Understanding PIVOT function in T-SQL

I am very new to SQL. I have a table like this: ID | TeamID | UserID | ElementID | PhaseID | Effort ----------------------------------------------------- 1 | 1 | 1 | 3 | 5 |..

Bootstrap Responsive Text Size

I am trying to build a responsive layout using bootstrap and currently am defining some of the titles with font-size:3em; But when the layout is shrunk down this is too big. How can I responsively re..

1030 Got error 28 from storage engine

I am working on a project where i need to create a database with 300 tables for each user who wants to see the demo application. it was working fine but today when i was testing with a new user to see..

C# How can I check if a URL exists/is valid?

I am making a simple program in visual c# 2005 that looks up a stock symbol on Yahoo! Finance, downloads the historical data, and then plots the price history for the specified ticker symbol. I know ..

Integer to IP Address - C

I'm preparing for a quiz, and I have a strong suspicion I may be tasked with implementing such a function. Basically, given an IP address in network notation, how can we get that from a 32 bit integer..

Deserialize JSON to ArrayList<POJO> using Jackson

I have a Java class MyPojo that I am interested in deserializing from JSON. I have configured a special MixIn class, MyPojoDeMixIn, to assist me with the deserialization. MyPojo has only int and Strin..

CodeIgniter : Unable to load the requested file:

Hi I’m just new in codeigniter. My website works locally, but when I uploaded it, I got this error: An Error Was Encountered Unable to load the requested file: home\home_view.php Here is my contro..

PHP: How to get current time in hour:minute:second?

In order to get the date in the right format I want I used date("d-m-Y"). Now I want to get the time in addition to the date in the following format H:M:S How can I procede ?..

Subscript out of range error in this Excel VBA script

I would like to copy data from a CSV file into an Excel worksheet. There are 11 .csv files. So far I have this (it is a modified version from a previous post): Sub importData() Dim filenum(0 To ..

Array vs ArrayList in performance

Which one is better in performance between Array of type Object and ArrayList of type Object? Assume we have a Array of Animal objects : Animal animal[] and a arraylist : ArrayList list<Animal&g..

Give all permissions to a user on a PostgreSQL database

I would like to give an user all the permissions on a database without making it an admin. The reason why I want to do that is that at the moment DEV and PROD are different DBs on the same cluster so ..

EditText underline below text property

I would like to change the blue colour below the edit text, i don't know what property it is. I tried using a different background colour for it but it didn't work. I've attached an image below: ..

Are these methods thread safe?

i have the following static class with generic methods and i'm wondering if it's safe to use it from different threads and with different objects? i'm not sure how this works below the covers so an ex..

How to get date representing the first day of a month?

I need functionality in a script that will enable me to insert dates into a table. What SQL do I need to insert a date of the format 01/08/2010 00:00:00 where the date is the first day of the curr..

Vertical line using XML drawable

I'm trying to figure out how to define a vertical line (1dp thick) to be used as a drawable. To make a horizontal one, it's pretty straightforward: <shape xmlns:android="

Convert NSArray to NSString in Objective-C

I am wondering how to convert an NSArray [@"Apple", @"Pear ", 323, @"Orange"] to a string in Objective-C...

Eclipse JUnit - possible causes of seeing "initializationError" in Eclipse window

I know this question is pretty general but I haven't found any hints on why this error may show up. What are possible causes of seeing initalizationError in Eclipse window? I get no useful information..

How to convert string to binary?

I am in need of a way to get the binary representation of a string in python. e.g. st = "hello world" toBinary(st) Is there a module of some neat way of doing this?..

SQL Server remove milliseconds from datetime

select * from table where date > '2010-07-20 03:21:52' which I would expect to not give me any results... EXCEPT I'm getting a record with a datetime of 2010-07-20 03:21:52.577 how can I make th..

How to run C program on Mac OS X using Terminal?

I am new to C. Here is my "Hello,world!" program. #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } After I try to run it using Terminal it says: MacBook-Pr..

Python: How to increase/reduce the fontsize of x and y tick labels?

I seem to have a problem in figuring out how to increase or decrease the fontsize of both the x and y tick labels while using matplotlib. I am aware that there is the set_xticklabels(labels, fontdict..

:touch CSS pseudo-class or something similar?

I am trying to make a button, such that when the user clicks on it, it changes its style while the mouse button is being held down. I also want it to change its style in a similar way if it is touched..

What is the $? (dollar question mark) variable in shell scripting?

I'm trying to learn shell scripting, and I need to understand someone else's code. What is the $? variable hold? I can't Google search the answer because they block punctuation characters...

Best Timer for using in a Windows service

I need to create some windows service which will execute every N period of time. The question is: Which timer control should I use: System.Timers.Timer or System.Threading.Timer one? Does it influence..

"getaddrinfo failed", what does that mean?

File "C:\Python27\lib\", line 224, in meth return getattr(self._sock,name)(*args) gaierror: [Errno 11004] getaddrinfo failed Getting this error when launching the hello world sample..

How, in general, does Node.js handle 10,000 concurrent requests?

I understand that Node.js uses a single-thread and an event loop to process requests only processing one at a time (which is non-blocking). But still, how does that work, lets say 10,000 concurrent re..

List all environment variables from the command line

Is it possible to list all environment variables from a Windows' command prompt? Something equivalent to PowerShell's gci env: (or ls env: or dir env:)...

How to vertically align text in input type="text"?

There is <input type="text" /> I need to set vertical alignment of the entered text. For example middle or top.

Indexes of all occurrences of character in a string

The following code will print 2 String word = "bannanas"; String guess = "n"; int index; System.out.println( index = word.indexOf(guess) ); I would like to know how to get all the indexes of "..

Placeholder in IE9

It seems it's a very well known problem but all the solutions I found on Google don't work on my newly downloaded IE9. Which is your favorite way in order to enable the Placeholder property on the in..

Use VBA to Clear Immediate Window?

Does anyone know how to clear the immediate window using VBA? While I can always clear it myself manually, I am curious if there is a way to do this programmatically...

Removing object properties with Lodash

I have to remove unwanted object properties that do not match my model. How can I achieve it with Lodash? My model is: var model = { fname: null, lname: null } My controller output before sendi..

AngularJS performs an OPTIONS HTTP request for a cross-origin resource

I'm trying to setup AngularJS to communicate with a cross-origin resource where the asset host which delivers my template files is on a different domain and therefore the XHR request that angular perf..

Why can I not create a wheel in python?

Here are the commands I am running: $ python bdist_wheel usage: [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: --help [cmd1 cmd2 ...] or: --help-c..

Pointtype command for gnuplot

I'm having trouble using the pointtype command on gnuplot. I've tried several ways such as: set pt 5 set pointtype 5 plot " " w pt 5 plot " " w pointtype 5 And for some reason nothing seems to wor..

Applying .gitignore to committed files

I have committed loads of files that I now want to ignore. How can I tell git to now ignore these files from future commits? EDIT: I do want to remove them from the repository too. They are files cr..

Getting Google+ profile picture url with user_id

I know that lots of social network APIs provide a way to construct a url to the profile picture of a user, using their user_id or username. For Facebook it looks like this:

Regular expression for floating point numbers

I have a task to match floating point numbers. I have written the following regular expression for it: [-+]?[0-9]*\.?[0-9]* But, it returns an error: Invalid escape sequence (valid ones are \..

How do I use Assert to verify that an exception has been thrown?

How do I use Assert (or other Test class?) to verify that an exception has been thrown? ..

Oracle SQL, concatenate multiple columns + add text

So I basically wanna display this (whole row in ONE column): I like [type column] cake with [icing column] and a [fruit column]. The result should be: Cake_Column ---------------- I like chocolat..

Select default option value from typescript angular 6

I have a select html like this: <select ng-model='nrSelect' class='form-control'> <option value='47'>47</option> ..

Can I force a UITableView to hide the separator between empty cells?

When using a plain-style UITableView with a large enough number of cells that the UITableView cannot display them all without scrolling, no separators appear in the empty space below the cells. If I h..

How to select a radio button by default?

I have some radio buttons and I want one of them to be set as selected by default when the page is loaded. How can I do that? <input type="radio" name="imgsel" value="" /> ..

How to split a long array into smaller arrays, with JavaScript

I have an array of e-mails (it can be just 1 email, or 100 emails), and I need to send the array with an ajax request (that I know how to do), but I can only send an array that has 10 or less e-mails ..

Is it possible to create a temporary table in a View and drop it after select?

I need to alter one view and I want to introduce 2 temporary table before the SELECT. Is this possible? And how can I do it? ALTER VIEW myView AS SELECT * INTO #temporary1 SELECT * INTO #temporar..

Exporting results of a Mysql query to excel?

My requirement is to store the entire results of the query SELECT * FROM document WHERE documentid IN (SELECT * FROM TaskResult WHERE taskResult = 2429) to an Excel file...

Query to get all rows from previous month

I need to select all rows in my database that were created last month. For example, if the current month is January, then I want to return all rows that were created in December, if the month is Feb..

Equivalent of LIMIT and OFFSET for SQL Server?

In PostgreSQL there is the Limit and Offset keywords which will allow very easy pagination of result sets. What is the equivalent syntax for SQL Server? ..

Bootstrap: change background color

I'm new to learning Bootstrap and I'm looking have 2 col-md-6 divs next to one another having one background-color blue and the other white. How can I change one background color and not both? I'm tr..

Display a tooltip over a button using Windows Forms

How can I display a tooltip over a button using Windows Forms?..

The Completest Cocos2d-x Tutorial & Guide List

I'm developing a game using Cocos2d-x to Android and iPhone. At the beggining, I had a lot of problems to start using this library, so, in this question, I want to collect all basic, medium and expert..

How to get the wsdl file from a webservice's URL

I want to get the WSDL file for a webservice and the only thing I have is its URL (like webservice.example/foo). If I use the URL directly only an error response is delivered...

jQuery : select all element with custom attribute

Possible Duplicate: jQuery, Select by attribute value, adding new attribute jQuery - How to select by attribute please consider this code: <p>11111111111111</p> <p MyTag="..

Javascript Src Path

Hello I'm having some trouble with the following code within my Index.html file: <SCRIPT LANGUAGE="JavaScript" SRC="clock.js"></SCRIPT> This works when my Index.html file is in the same..

Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASPNET'

I have created a web service which is saving some data into to db. But I am getting this error: Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASP..

What does href expression <a href="javascript:;"></a> do?

I have seen the following href used in webpages from time to time. However, I don't understand what this is trying to do or the technique. Can someone elaborate please? <a href="javascript:;">..

SQL to Entity Framework Count Group-By

I need to translate this SQL statement to a Linq-Entity query... SELECT name, count(name) FROM people GROUP by name ..

Plot different DataFrames in the same figure

I have a temperature file with many years temperature records, in a format as below: 2012-04-12,16:13:09,20.6 2012-04-12,17:13:09,20.9 2012-04-12,18:13:09,20.6 2007-05-12,19:13:09,5.4 2007-05-12,20:1..

How can you detect the version of a browser?

I've been searching around for code that would let me detect if the user visiting the website has Firefox 3 or 4. All I have found is code to detect the type of browser but not the version. How can I..

Assign variable in if condition statement, good practice or not?

I moved one years ago from classic OO languages such like Java to JavaScript. The following code is definitely not recommended (or even not correct) in Java: if(dayNumber = getClickedDayNumber(dayInf..

Regular expression for a hexadecimal number?

How do I create a regular expression that detects hexadecimal numbers in a text? For example, ‘0x0f4’, ‘0acdadecf822eeff32aca5830e438cb54aa722e3’, and ‘8BADF00D’...

Is it possible to set ENV variables for rails development environment in my code?

I know that I can set my ENV variables in bash via export admin_password = "secret" But is there a way to do it in my rails source code somewhere? My first attempt was something like this in enviro..

Call a VBA Function into a Sub Procedure

I know this is a simple question for someone out there, but I have never really used function module at all because I did not understand what they were. So I have a whole bunch of things I can use th..

How do I concatenate strings and variables in PowerShell?

Suppose I have the following snippet: $assoc = New-Object PSObject -Property @{ Id = 42 Name = "Slim Shady" Owner = "Eminem" } Write-Host $assoc.Id + " - "..

encapsulation vs abstraction real world example

For an example of encapsulation i can think of the interaction between a user and a mobile phone. The user does not need to know the internal working of the mobile phone to operate, so this is called ..

How to handle change of checkbox using jQuery?

I have some code <input type="checkbox" id="chk" value="value" /> <label for="chk">Value </label> <br/> <input type="button" id="But1" value="set value" /> <br /> ..

Check if a PHP cookie exists and if not set its value

I am working on a multilingual site so I tried this approach: echo $_COOKIE["lg"]; if (!isset($_COOKIE["lg"])) setcookie("lg", "ro"); echo $_COOKIE["lg"]; The idea is that if the client doesn't..

An App ID with Identifier '' is not available. Please enter a different string

I am trying to add a new APP ID to prepare for App Store submission and got the following error under the bundle ID I provided. An App ID with Identifier 'com.domainName.AppName' is not available. Pl..

argparse module How to add option without any argument?

I have created a script using argparse. The script needs to take a configuration file name as an option, and user can specify whether they need to proceed totally the script or only simulate it. The..

R numbers from 1 to 100

Possible Duplicate: How to generate a vector containing a numeric sequence? In R, how can I get the list of numbers from 1 to 100? Other languages have a function 'range' to do this. R's ra..

How to check the maximum number of allowed connections to an Oracle database?

What's the best way, using SQL, to check the maximum number of connections that is allowed for an Oracle database? In the end, I would like to show the current number of sessions and the total number ..

Send json post using php

I have this json data: { userID: 'a7664093-502e-4d2b-bf30-25a2b26d6021', itemKind: 0, value: 1, description: 'Saude', itemID: '03e76d0a-8bab-11e0-8250-000c29b481aa' } and I nee..

Hosting ASP.NET in IIS7 gives Access is denied?

I have setup a application in my IIS7 that uses .NET Framework 4.0 (runned by NetworkService) but when browsing the site I get this: Access is denied. Description: An error occurred while acces..

filemtime "warning stat failed for"

I already read it so many questions and answers about it but I can't still solve my problem... I'm trying to create a function that deletes all the files with "xml" or "xsl" extension that has been c..

UIScrollView Scrollable Content Size Ambiguity

Fellow devs, I am having trouble with AutoLayout in Interface Builder (Xcode 5 / iOS 7). It's very basic and important so I think everyone should know how this properly works. If this is a bug in Xcod..

How to add a new project to Github using VS Code

All the tutorials i've seen till now shows to first create a repository on github, copy the link go to vscode and git clone it and from that on, you can do commits and pushes. Is that the right way ? ..

Disable PHP in directory (including all sub-directories) with .htaccess

I'm making a website which allows people to upload files, html pages, etc... Now I'm having a problem. I have a directory structure like this: -/USERS -/DEMO1 -/DEMO2 -/DEMO3 -/etc.....

How to find reason of failed Build without any error or warning

I have a WebApplication which contains reference to WCF services. While building using Visual Studio 2010, Build fails without any error or warning. However building the .csproj using MsBuild is succ..

What is REST call and how to send a REST call?

I want to ask some questions about the REST call. I am the green for the REST call and I would like to like what is REST call and how to use the URL to send a REST call to the server. Can anyone give ..

'cannot find or open the pdb file' Visual Studio C++ 2013

I just downloaded VS 2013 Community Edition and I wrote my first app. When I run it it shows in the output section: 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Users\Toshiba\Documents\Visual Studio..

I want to compare two lists in different worksheets in Excel to locate any duplicates

I know this is very simple but I still need help: I have a list of properties that have finished a training. I need the names of the ones that have not done this training, but the system does not giv..

What is the difference between char, nchar, varchar, and nvarchar in SQL Server?

What is meant by nvarchar? What is the difference between char, nchar, varchar, and nvarchar in SQL Server?..

Single controller with multiple GET methods in ASP.NET Web API

In Web API I had a class of similar structure: public class SomeController : ApiController { [WebGet(UriTemplate = "{itemSource}/Items")] public SomeValue GetItems(CustomParam parameter) { ....

EC2 instance types's exact network performance?

I cannot find exact network performance details for different EC2 instance types on Amazon. Instead, they are only saying: High Moderate Low What does this even mean? I especially want to know the..

Run php function on button click

I want to run a php function on button click. for eg : <input type="button" name="test" id="test" value="RUN" onclick="<?php echo testfun(); ?>" /><br/> <?php function testfun..

How to get sp_executesql result into a variable?

I have a piece of dynamic SQL I need to execute, I then need to store the result into a variable. I know I can use sp_executesql but can't find clear examples around about how to do this...

Missing maven .m2 folder

AFAIK maven does not have an installer for Windows, you simply unzip it wherever you like, as explained here. However in many places there are references to a .m2 folder under the user folder (in Win..

Insert all data of a datagridview to database at once

I have a datagridview which is created by various action and user's manipulation of data. I want to insert all the data of the gridview to the database at once, I know I could try a code similar to th..

jQuery $.ajax(), $.post sending "OPTIONS" as REQUEST_METHOD in Firefox

Having trouble with what I thought was a relatively simple jQuery plugin... The plugin should fetch data from a php script via ajax to add options to a <select>. The ajax request is pretty gen..

Java 8, Streams to find the duplicate elements

I am trying to list out duplicate elements in the integer list say for eg, List<Integer> numbers = Arrays.asList(new Integer[]{1,2,1,3,4,4}); using Streams of jdk 8. Has anybody tried out..

UTF-8 problems while reading CSV file with fgetcsv

I try to read a CSV and echo the content. But the content displays the characters wrong. Mäx Müstermänn -> Mäx Müstermänn Encoding of the CSV file is UTF-8 without BOM (checked with No..

How to make responsive table

I have a table to represent some data in my html page. I'm trying to make this table as responsive. How can I do this? Here is the Demo...

How to count lines in a document?

I have lines like these, and I want to know how many lines I actually have... 09:16:39 AM all 2.00 0.00 4.00 0.00 0.00 0.00 0.00 0.00 94.00 09:16:40 AM all 5.00 0.00..

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

PersistentObjectException: detached entity passed to persist thrown by JPA and Hibernate

I have a JPA-persisted object model that contains a many-to-one relationship: an Account has many Transactions. A Transaction has one Account. Here's a snippet of the code: @Entity public class Tran..

Correct MySQL configuration for Ruby on Rails Database.yml file

I have this configuration: development: adapter: mysql2 encoding: utf8 database: my_db_name username: root password: my_password host: mysql:// And I am getting this error..

How to upgrade Git on Windows to the latest version?

I just upgraded to Git for Windows, from my previous version 1.7.9.mysysgit.0. I downloaded the new version from the Git site and installed through the normal Git installer EXE. That said, wh..

Greater than and less than in one statement

I was wondering, do you have a neat way of doing this ? if(orderBean.getFiles().size() > 0 && orderBean.getFiles().size() < 5) without declaring a variable that is not needed anywher..

Real life example, when to use OUTER / CROSS APPLY in SQL

I have been looking at CROSS / OUTER APPLY with a colleague and we're struggling to find real life examples of where to use them. I've spent quite a lot of time looking at When should I use Cross App..

Find element's index in pandas Series

I know this is a very basic question but for some reason I can't find an answer. How can I get the index of certain element of a Series in python pandas? (first occurrence would suffice) I.e., I'd li..

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