Questions Tagged with #Data paging

What is /dev/null 2>&1?

I found this piece of code in /etc/cron.daily/apf #!/bin/bash /etc/apf/apf -f >> /dev/null 2>&1 /etc/apf/apf -s >> /dev/null 2>&1 It's flushing and reloading the..

Ruby value of a hash key?

I've got a list of values that are in a Ruby hash. Is there a way to check the value of the key and if it equals "X", then do "Y"? I can test to see if the hash has a key using hash.has_key?, but no..

How do I set the offset for ScrollSpy in Bootstrap?

I have a site with the navbar fixed on top and 3 divs underneath in the main content area. I'm trying to use scrollspy from the bootstrap framework. I have it succesfully highlighting the different ..

jquery change button color onclick

I have multiple buttons that I use when people answer a question. How would I get the buttons to change colors when a person clicks on the button? I do not know jquery, I have been told that it is the..

PostgreSQL: Why psql can't connect to server?

I typed psql and I get this: psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresq..

How to use onSavedInstanceState example please

I'm confused when it comes down to saving a state. So I know that onSaveInstanceState(Bundle) is called when the activity is about to be destroyed. But how do you store your information in it and brin..

Remove CSS "top" and "left" attributes with jQuery

Im building a draggable map that when the map is dragged the element is given a 'left' and 'top' attribute with values for each as so... <div class="map" style="top:200px; left:100px;">Map</..

Running interactive commands in Paramiko

I'm trying to run an interactive command through paramiko. The cmd execution tries to prompt for a password but I do not know how to supply the password through paramiko's exec_command and the execut..

What is console.log?

What is the use of console.log? Please explain how to use it in JavaScript, with a code example...

Why std::cout instead of simply cout?

I get these error messages for all cout and endl: error: ‘cout’ was not declared in this scope note: suggested alternative: /usr/include/c++/4.6/iostream:62:18: note: ..

Printing one character at a time from a string, using the while loop

Im reading "Core Python Programming 2nd Edition", They ask me to print a string, one character at a time using a "while" loop. I know how the while loop works, but for some reason i can not come up w..

Reading DataSet

How do I read data from a DataSet in WPF? I have a train schedule table with just 2 columns and I want to be able to read the departure times and calculate when the next train is leaving. For example,..

Set an empty DateTime variable

I would declare an empty String variable like this: string myString = string.Empty; Is there an equivalent for a 'DateTime' variable ? Update : The problem is I use this 'DateTime' as a param..

Editing the date formatting of x-axis tick labels in matplotlib

I am looking to edit the formatting of the dates on the x-axis. The picture below shows how they appear on my bar graph by default. I would like to remove the repetition of 'Dec' and '2012' and just h..

how to prevent css inherit

Below are the sample code block i use. I have two set of css, and want to apply onto two UL component. however, the result come out, the inner "UL" will hold some of the css which defined for its pare..

How to get input from user at runtime

I want to take runtime input from user in Oracle 10g PL/SQL blocks (i.e. interactive communication with user). Is it possible? declare x number; begin x=&x; end this code gives error as & ca..

Javascript - sort array based on another array

Is it possible to sort and rearrange an array that looks like this: itemsArray = [ ['Anne', 'a'], ['Bob', 'b'], ['Henry', 'b'], ['Andrew', 'd'], ['Jason', 'c'], ['Thomas', 'b..

Set Date in a single line

According to the Java API, the constructor Date(year, month, day) is deprecated. I know that I can replace it with the following code: Calendar myCal = Calendar.getInstance(); myCal.set(Calendar.YEAR..

How to make <input type="file"/> accept only these types?

I want my uploader only allows these types: doc, docx. xls, xlsx. ppt, pptx. txt. pdf. Image types. How can I achieve this? What should I put in the accept attribute? Thanks for your help. EDIT!!..

Hiding and Showing TabPages in tabControl

I am trying to show or hide tabpages as per user choice. If user selects gender male then form for male in a tabpage "male" should be displayed and if user selects female then similar next form should..

What are the uses of "using" in C#?

User kokos answered the wonderful Hidden Features of C# question by mentioning the using keyword. Can you elaborate on that? What are the uses of using?..

Why isn't .ico file defined when setting window's icon?

When I tried to change the window icon in the top left corner from the ugly red "TK" to my own favicon using the code below, Python threw an error: from tkinter import * root = Tk() #some buttons, w..

How to execute a .bat file from a C# windows form app?

What I need to do is have a C# 2005 GUI app call a .bat and several VBScript files at user's request. This is just a stop-gap solution until the end of the holidays and I can write it all in C#. I can..

NuGet Packages are missing

I searched this problem but none of the solutions worked. I have Visual Studio Professional 2015 installed and I am using TFS. My NuGet version is 3.1.6. This problem is happening only in my C# Web AP..

JavaScript checking for null vs. undefined and difference between == and ===

How do I check a variable if it's null or undefined and what is the difference between the null and undefined? What is the difference between == and === (it's hard to search Google for "===" )? ..

Fluid width with equally spaced DIVs

I have a fluid width container DIV. Within this I have 4 DIVs all 300px x 250px... <div id="container"> <div class="box1"> </div> <div class="box2"> </div> <..

position fixed header in html

I have a header (dynamic height) with a fixed position. I need to place the container div right below the header. As the header height is dynamic, I can't use the fixed value for top margin. How ca..

Include CSS,javascript file in Yii Framework

How to include a Javascript or CSS file in Yii Framework? I want to create a page on my site that has a little Javascript application running, so I want to include .js and .css files in a specific vi..

Align image in center and middle within div

I have following div <div id="over" style="position:absolute; width:100%; height:100%> <img src="img.png"> </div> How to align the image so as to be located in the middle and cen..

Add item to array in VBScript

How do you add an item to an existing array in VBScript? Is there a VBScript equivalent to the push function in Javascript? i.e. myArray has three items, "Apples", "Oranges", and "Bananas" and I wa..

How to reposition Chrome Developer Tools

The tools are opened on the bottom of the chrome window per default. This is a rather bad choice for a wide screen display since there is plenty of empty space to the right but not much vertical space..

How can I put the current running linux process in background?

I have a command that uploads files using git to a remote server from the Linux shell and it will take many hours to finish. How can I put that running program in background? So that I can still wor..

Laravel Eloquent: Ordering results of all()

I'm stuck on a simple task. I just need to order results coming from this call $results = Project::all(); Where Project is a model. I've tried this $results = Project::all()->orderBy("name");..

Celery Received unregistered task of type (run example)

I'm trying to run example from Celery documentation. I run: celeryd --loglevel=INFO /usr/local/lib/python2.7/dist-packages/celery/loaders/ NotConfigured: No 'celeryconfig' module found..

Get json value from response

{"id":"2231f87c-a62c-4c2c-8f5d-b76d11942301"} If I alert the response data I see the above, how do I access the id value? My controller returns like this: return Json( new { id = indic..

Android: TextView: Remove spacing and padding on top and bottom

When I have a TextView with a \n in the text,, on the right I have two singleLine TextViews, one below the other with no spacing in between. I have set the following for all three TextViews. android:..

Get only specific attributes with from Laravel Collection

I've been reviewing the documentation and API for Laravel Collections, but don't seem to find what I am looking for: I would like to retrieve an array with model data from a collection, but only get ..

Node.js - Find home directory in platform agnostic way

Process.platform returns "win32" for Windows. On Windows a user's home directory might be C:\Users[USERNAME] or C:\Documents and Settings[USERNAME] depending on which version of Windows is being used...

How to create a dynamic array of integers

How to create a dynamic array of integers in C++ using the new keyword?..

How to Exit a Method without Exiting the Program?

I am still pretty new to C# and am having a difficult time getting used to it compared to C/CPP. How do you exit a function on C# without exiting the program like this function would? if (textBox1...

Creating an index on a table variable

Can you create an index on a table variable in SQL Server 2000? i.e. DECLARE @TEMPTABLE TABLE ( [ID] [int] NOT NULL PRIMARY KEY ,[Name] [nvarchar] (255) COLLATE DATABASE_DEFAULT NULL ) ..

Select all text inside EditText when it gets focus

I have an EditText with some dummy text in it. When the user clicks on it I want it to be selected so that when the user starts typing the dummy text gets deleted. How can I achieve this?..

How to extract year and month from date in PostgreSQL without using to_char() function?

I want to select sql: SELECT "year-month" from table group by "year-month" AND order by date, where year-month - format for date "1978-01","1923-12". select to_char of couse work, but not "right" ord..

Replace new line/return with space using regex

Pretty basic question for someone who knows. Instead of getting from "This is my text. And here is a new line" To: "This is my text. And here is a new line" I get: "This is my text.And her..

Simulate a specific CURL in PostMan

I am using Postman to test some Curl requests to an API server. The API developers gave us the curl command, but I can't send it from the Postman. How to make such a request from the Postman? curl -X..

How to bind WPF button to a command in ViewModelBase?

I have a view AttributeView that contains all sorts of attributes. There's also a button that when pressed, it should set the default values to the attributes. I also have a ViewModelBase class that i..

Initializing a member array in constructor initializer

class C { public: C() : arr({1,2,3}) //doesn't compile {} /* C() : arr{1,2,3} //doesn't compile either {} */ private: int arr[3]; }; I believe the reason is that arrays can be initial..

PHP Composer update "cannot allocate memory" error (using Laravel 4)

I just can't solve this one. I'm on Linode 1G RAM basic plan. Trying to install a package via Composer and it's not letting me. My memory limit is set to "-1" on PHP.ini Is there anything else I can..

Get next element in foreach loop

I have a foreach loop and I want to see if there is a next element in the loop so I can compare the current element with the next. How can I do this? I've read about the current and next functions but..


When I use curl via POST and set CURLOPT_POSTFIELD do I have to urlencode or any special format? for example: If I want to post 2 fields, first and last: first=John&last=Smith what is the exac..

Send message to specific client with and node.js

I'm working with and node.js and until now it seems pretty good, but I don't know how to send a message from the server to an specific client, something like this: client.send(message, rece..

Concatenating bits in VHDL

How do you concatenate bits in VHDL? I'm trying to use the following code: Case b0 & b1 & b2 & b3 is ... and it throws an error Thanks..

Formatting "yesterday's" date in python

I need to find "yesterday's" date in this format MMDDYY in Python. So for instance, today's date would be represented like this: 111009 I can easily do this for today but I have trouble doing it aut..

Interface naming in Java

Most OO languages prefix their interface names with a capital I, why does Java not do this? What was the rationale for not following this convention? To demonstrate what I mean, if I wanted to have ..

How do I declare a 2d array in C++ using new?

How do i declare a 2d array using new? Like, for a "normal" array I would: int* ary = new int[Size] but int** ary = new int[sizeY][sizeX] a) doesn't work/compile and b) doesn't accomplish what:..

Using "super" in C++

My style of coding includes the following idiom: class Derived : public Base { public : typedef Base super; // note that it could be hidden in // protected/private ..

Find elements inside forms and iframe using Java and Selenium WebDriver

I'm trying to access elements that are present under <form> <iFrame> <form> elements </form> </iFrame> </form>. Could you help me on accessing these 'elements', wh..

Django. Override save for model

Before saving model I'm re-size a picture. But how can I check if new picture added or just description updated, so I can skip rescaling every time the model is saved? class Model(model.Model): i..

MySQL JOIN with LIMIT 1 on joined table

I want to join two tables, but only get 1 record of table2 per record on table1 For example: SELECT, c.title, AS product_id, p.title FROM categories AS c JOIN products AS p ON =

What is the difference between “int” and “uint” / “long” and “ulong”?

I know about int and long (32-bit and 64-bit numbers), but what are uint and ulong?..

bind/unbind service example (android)

can you give me a simple example of an application with background service which uses bind/unbind methods to start and stop it? I was googling for it for a half-hour, but those examples use startServi..

How to find the process id of a running Java process on Windows? And how to kill the process alone?

I want to kill the particular Java process in Windows, like in Linux (ps -aux to get processid and then kill processid to kill the process)...

D3 transform scale and translate

I tried to understand how the transform is working in D3 but I think I didn't get it. Does the scale change the size of the SVG object ? meaning if I give a big number the size of the object will loo..

How do I horizontally center an absolute positioned element inside a 100% width div?

In the example below, #logo is positioned absolutely and I need it to be horizontally centered within #header. Normally, I would do a margin:0 auto for relatively positioned elements but I am stuck he..

Update Git submodule to latest commit on origin

I have a project with a Git submodule. It is from an ssh://... URL, and is on commit A. Commit B has been pushed to that URL, and I want the submodule to retrieve the commit, and change to it. Now, m..

Inheritance and init method in Python

I'm begginer of python. I can't understand inheritance and __init__(). class Num: def __init__(self,num): self.n1 = num class Num2(Num): def show(self): print self.n1 mynumb..

IIS Express Windows Authentication

I'm trying to use IIS Express with VS2010 to host a silverlight application. I modified my applicationhost.config file to allow for modification of the proper configuration settings. I have the foll..

Java: Insert multiple rows into MySQL with PreparedStatement

I want to insert multiple rows into a MySQL table at once using Java. The number of rows is dynamic. In the past I was doing... for (String element : array) { myStatement.setString(1, element[0])..

What is the difference between Amazon SNS and Amazon SQS?

When would I use SNS versus SQS, and why are they always coupled together?..

Sorting arrays in NumPy by column

How can I sort an array in NumPy by the nth column? For example, a = array([[9, 2, 3], [4, 5, 6], [7, 0, 5]]) I'd like to sort rows by the second column, such that I get back..

Android Studio says "cannot resolve symbol" but project compiles

I'm importing twitter4j in AndroidStudio, using the following in my build.gradle: dependencies { compile '' compile files('libs/twitter4j-core-3.0.4.jar') } ..

Comparing strings in Java

Im trying to compare the values of two edittext boxes. What i would like is to just compare passw1 = passw2. As my code is now comparing two strings i have entered as i could not get to compare them. ..

Display Records From MySQL Database using JTable in Java

I want to connect a JTable to a ResultSet from a MySQL database so I can view the data. I am looking for some links or code snippets describing this task. I'm using the Netbeans IDE....

Get size of an Iterable in Java

I need to figure out the number of elements in an Iterable in Java. I know I can do this: Iterable values = ... it = values.iterator(); while (it.hasNext()) {; sum++; } I could also d..

Maximum value for long integer

How can I assign the maximum value for a long integer to a variable, similar, for example, to C++'s LONG_MAX...

CSS Equivalent of the "if" statement

Is there any way to use conditional statements in CSS?..

Unzip files programmatically in .net

I am trying to programatically unzip a zipped file. I have tried using the System.IO.Compression.GZipStream class in .NET, but when my app runs (actually a unit test) I get this exception: Syste..

Operation must use an updatable query. (Error 3073) Microsoft Access

On some Microsoft Access queries, I get the following message: Operation must use an updatable query. (Error 3073). I work around it by using temporary tables, but I'm wondering if there's a better ..

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

What is the best way to find the users home directory in Java?

The difficulty is that it should be cross platform. Windows 2000, XP, Vista, OSX, Linux, other unix variants. I am looking for a snippet of code that can accomplish this for all platforms, and a way t..

HTML favicon won't show on google chrome

I am making a HTML page that is unpublished . One of the things I wanted to do was add a favicon to appear next to the title. I'm using google chrome and I noticed that other websites have favicons th..

Convert string to integer type in Go?

I'm trying to convert a string returned from flag.Arg(n) to an int. What is the idiomatic way to do this in Go?..

A reference to the dll could not be added

When I add a .dll file as a reference in C# application it shows an error : A reference to the "....dll" could not be added.Please make sure that the file is accessible and that it is a valid as..

How to use string.replace() in python 3.x

The string.replace() is deprecated on python 3.x. What is the new way of doing this?..

Format datetime to YYYY-MM-DD HH:mm:ss in moment.js

I have a string in this format: var dateTime = "06-17-2015 14:24:36" I am using moment.js and I am trying to convert it into YYYY-MM-DD HH:mm:ss -> 2015-06-17 14:24:36. I have tried this method d..

Encrypt and decrypt a String in java

I am new to cryptography. I wish to learn how to encrypt and decrypt the text in a file... when I refer the related articles in net. I had a doubt that whether the encrypted text will be same for sing..

How do I loop through children objects in javascript?

I have this code in a function: tableFields = tableFields.children; for (item in tableFields) { // Do stuff } According to a console.log of tableFields, I am getting an array back as I assume I..

How to call a stored procedure (with parameters) from another stored procedure without temp table

I have stored procedure A and want to call store procedure B from A by passing a @mydate parameter. Stored procedure B will return a rowset which I can further use in procedure A. I researched this ..

LINK : fatal error LNK1561: entry point must be defined ERROR IN VC++

I installed MS VS VC++ for the first time in order to start programming OpenGL with GLFW library. I follower instructions on how to install it over at

How to cherry pick a range of commits and merge into another branch?

I have the following repository layout: master branch (production) integration working What I want to achieve is to cherry pick a range of commits from the working branch and merge it into the int..

What is "Connect Timeout" in sql server connection string?

I have the following connection string(get from a property of sql server): Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\myUser\Desktop\adoBanche\Banche\bin\Debug\banche.mdf;Integrated Securi..

syntax error near unexpected token `('

I am trying to execute sudo -su db2inst1 /opt/ibm/db2/V9.7/bin/db2 force application (1995) but I get this error bash: syntax error near unexpected token('` sudo -su db2inst1 id gives me correc..

remove all special characters in java

Possible Duplicate: Replacing all non-alphanumeric characters with empty strings import java.util.Scanner; import java.util.regex.*; public class io{ public static void main(String args[]){..

Restore DB — Error RESTORE HEADERONLY is terminating abnormally.

I have taken backup of SQL Server 2008 DB on server, and download them to local environment. I am trying to restore that database and it is keep on giving me following error. An exception o..

Error: No default engine was specified and no extension was provided

I am working through setting up a http server using node.js and engine. However, I keep running into issues that I have little information on how to resolve I would appreciate some help solving this ..

Saving excel worksheet to CSV files with filename+worksheet name using VB

I am very new with VB coding, I am trying to save multiple excel file worksheets to csv, I don't know to do this for multiple sheets, but I found a way to do for single file. I have found code on this..

Delete all records in a table of MYSQL in phpMyAdmin

I use wampserver 2.2. When I want to delete all records of a table in phpMyAdmin (select all) it deletes only one record not all records. Why it does not delete all records?..

What is SYSNAME data type in SQL Server?

What is the SQL Server SYSNAME data type for? BOL says: The sysname data type is used for table columns, variables, and stored procedure parameters that store object names. but I don't rea..

Inline JavaScript onclick function

Is there a way to write following code inline like so? <a href="#" onClick="function(){ //do something; return false; };return false;"></a> Instead of doing this: <a href="..

How to ensure that there is a delay before a service is started in systemd?

I am having a service that depends on Cassandra coming up gracefully and the cluster being up and ready. To ensure that the dependency order is met, I have the following unit file [Unit] Requires=c..

Compare dates with javascript

I have two dates in javascript: var first = '2012-11-21'; var second = '2012-11-03'; i would like make: if(first > second){ //... } how is the best way for this, without external library..

Hide div if screen is smaller than a certain width

I want to hide a floating div if the user screen is < 1024px as it will overlay with my blog content area. I found this jQuery on the net but I am not sure how to use it. $(document).ready(functio..

Fixed size div?

I want a normal div for the body of my text and a bunch of little divs that are exactly 150px by 150px. How might i do this?..

Converting string to byte array in C#

I'm converting something from VB into C#. Having a problem with the syntax of this statement: if ((searchResult.Properties["user"].Count > 0)) { profile.User = System.Text.Encoding.UTF8.GetStr..

Finding index of character in Swift String

It's time to admit defeat... In Objective-C, I could use something like: NSString* str = @"abcdefghi"; [str rangeOfString:@"c"].location; // 2 In Swift, I see something similar: var str = "ab..

Background blur with CSS

I want an Vista/7-aero-glass-style effect on a popup on my site, and it needs to be dynamic. I'm fine with this not being a cross-browser effect as long as the site still works on all modern browsers...

Calculate age based on date of birth

I have a table of users in sql and they each have birth dates. I want to convert their date of birth to their age (years only), e.g. date: 15.03.1999 age: 14 and 15.03.2014 will change to age: 15 Her..

How to store Emoji Character in MySQL Database

I am using Emoji character in my project. That characters are saved (??) into mysql database. I had used database Default collation in utf8mb4_general_ci. It show 1366 Incorrect string value: '\x..

MongoDb shuts down with Code 100

I followed the MongoDb Docs to setup my first MongoDb, When I start MongoDB using the command C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe I get the following error ..

Open images? Python

Im creating a text based labryinth game, but I figured it needed some pictures to illustrate whats going on. For some reason it just dies when I try to go to a2(Where the picture should pop up). I am ..

Web Application Problems (web.config errors) HTTP 500.19 with IIS7.5 and ASP.NET v2

This is driving the whole team crazy. There must be some simple mis-configured part of IIS or our Web Server, but every time we try to run out ASP.NET Web Application on IIS 7.5 we get the following e..

how to modify an existing check constraint?

Is there any way to modify an existing check constraint on a table other than dropping and re-creating it? create table t ( n number); ora10g> Tabelle wurde erstellt. ora10g> alter table t ad..

How to count how many values per level in a given factor?

I have a data.frame mydf with about 2500 rows. These rows correspond to 69 classes of objects in colum 1 mydf$V1, and I want to count how many rows per object class I have. I can get a factor of these..

Access restriction: Is not accessible due to restriction on required library ..\jre\lib\rt.jar

I am trying to modify some legacy code from while back and getting the following kind of errors: Access restriction: The method create(JAXBRIContext, Object) from the type Headers is not accessible d..

How do I capture the output into a variable from an external process in PowerShell?

I'd like to run an external process and capture it's command output to a variable in PowerShell. I'm currently using this: $params = "/verify $pc /" start-process "netdom.exe" $p..

Does C have a string type?

I have recently started programming in C, coming from Java and Python. Now, in my book I have noticed that to make a "Hello World" program, the syntax is something like this: char message[10] strcpy(..

How to get directory size in PHP

function foldersize($path) { $total_size = 0; $files = scandir($path); foreach($files as $t) { if (is_dir(rtrim($path, '/') . '/' . $t)) { if ($t<>"." && $t<>"..")..

How to insert multiple rows from array using CodeIgniter framework?

I'm passing a large dataset into a MySQL table via PHP using insert commands and I'm wondering if it's possible to insert approximately 1000 rows at a time via a query other than appending each value ..

how to change directory using Windows command line

I'm using cmd.exe (C:\WINDOWS\System32\cmd.exe) and I have to change my current directory to "D:\temp" i.e. temp folder in the D drive. When I try to cd nothing happens. C:\> cd D:\temp C:\> ..

$(document).ready(function() is not working

I am using Jquery for getting a json object from a solr server. When I run my html file with Tomcat it is runns fine but when I embed it with my project which is running on weblogic it gets this erro..

If condition inside of map() React

I have a map()function that needs to display views based on a condition. I've looked at the React documentation on how to write conditions and this is how you can write a condition: {if (loggedIn) ? ..

Find the min/max element of an array in JavaScript

How can I easily obtain the min or max element of a JavaScript array? Example pseudocode: let array = [100, 0, 50] array.min() //=> 0 array.max() //=> 100 ..

Is it possible to import modules from all files in a directory, using a wildcard?

With ES6, I can import several exports from a file like this: import {ThingA, ThingB, ThingC} from 'lib/things'; However, I like the organization of having one module per file. I end up with import..

How to hide close button in WPF window?

I'm writing a modal dialog in WPF. How do I set a WPF window to not have a close button? I'd still like for its WindowState to have a normal title bar. I found ResizeMode, WindowState, and WindowStyl..

Uncaught TypeError: Cannot set property 'value' of null

I'm trying to pass the entered text to the controller using an ajax request. But i'm getting athe error "Uncaught TypeError: Cannot set property 'value' of null " when I tried to execute JS file.. H..

How to check whether a pandas DataFrame is empty?

How to check whether a pandas DataFrame is empty? In my case I want to print some message in terminal if the DataFrame is empty. ..

How do I find the current executable filename?

Possible Duplicate: How do I get the name of the current executable in C#? An executable file loads an external library. Is there a way for the library to know the calling executable file? ..

How can I undo a `git commit` locally and on a remote after `git push`

I have performed git commit followed by a git push. How can I revert that change on both local and remote repositories? $ git log commit 364705c23011b0fc6a7ca2d80c86cef4a7c4db7ac8 Author: Michael Si..

How to run Visual Studio post-build events for debug build only

How can I limit my post-build events to running only for one type of build? I'm using the events to copy DLL files to a local IIS virtual directory, but I don't want this happening on the build serve..

Making a Bootstrap table column fit to content

I'm using Bootstrap, and drawing a table. The rightmost column has a button in it, and I want it to drop down to the minimum size it needs to fit said button. _x000D_ _x000D_ <link href="https://m..

Git: Pull from other remote

I have created a fork from a project on GitHub. How can I now pull changes from the project that I forked from?..

What is the difference between <jsp:include page = ... > and <%@ include file = ... >?

Both tags include the content from one page in another. So what is the exact difference between these two tags?..

Automatically create requirements.txt

Sometimes I download the python source code from github and don't know how to install all the dependencies. If there is no requirements.txt file I have to create it by hands. The question is: Given t..

How to remove first and last character of a string?

I have worked in SOAP message to get LoginToken from Webservice, and store the LoginToken in String and used System.out.println(LoginToken); to print. This prints [wdsd34svdf], but I want only wdsd34s..

How do I make an Event in the Usercontrol and have it handled in the Main Form?

I have a custom usercontrol and I want to do something relatively simple. When ever a numeric up down in that usercontrol's value changes, have the main form update a display window. This is not a p..

Datagridview full row selection but get single cell value

I have a datagridview that is a full row select. How would I grab the data from only a certain cell no matter what cell in the row was clicked on since it highlights the entire row...

Convert List<T> to ObservableCollection<T> in WP7

I don't know if it's just too late or what, but I don't see how to do this... What I'm expecting to do, and what the object browser says is there, is this: var oc = new ObservableCollection<T>..

The character encoding of the HTML document was not declared

When I click on my form's submit button the following error message appears: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser ..

Git - Ignore files during merge

I have a repo called myrepo on the remote beanstalk server. I cloned it to my local machine. Created two additional branches: staging and dev. Pushed these branches to remote as well. Now: local ..

Google MAP API Uncaught TypeError: Cannot read property 'offsetWidth' of null

I'm trying to use Google MAP API v3 with the following code. <h2>Topology</h2> <script src="" type="text/javascript"></script>..

variable is not declared it may be inaccessible due to its protection level

My VB skills are not the best, and this problem has had me stumped for a few days. In the list of controls shown in Visual Studio that are not defined in the code behind, I can "mouseover" them and t..

Defining a HTML template to append using JQuery

I have got an array which I am looping through. Every time a condition is true, I want to append a copy of the HTML code below to a container element with some values. Where can I put this HTML to re..

"The following SDK components were not installed: sys-img-x86-addon-google_apis-google-22 and addon-google_apis-google-22"

I'm Windows 7 64-bit user and I got Android Studio problem after I update the latest version of Android Studio and SDK components.. The following SDK components were not installed: sys-img-x86-addon-..

SQL Logic Operator Precedence: And and Or

Are the two statements below equivalent? SELECT [...] FROM [...] WHERE some_col in (1,2,3,4,5) AND some_other_expr and SELECT [...] FROM [...] WHERE some_col in (1,2,3) or some_col in (4,5) AND so..

IOError: [Errno 13] Permission denied

I have this piece of code to create a .json file to store python data. When i run it in my server i get this error: IOError: [Errno 13] Permission denied: 'juliodantas2015.json' at line with open(out..

Favicon not showing up in Google Chrome

I have a favicon icon which isn't showing up in Chrome (I'm not sure about other browsers as I only use Chrome) but the strange thing is if I type the path to the icon in the URL bar it shows up! Why..

How can I take a screenshot with Selenium WebDriver?

Is it possible to take a screenshot using Selenium WebDriver? (Note: Not Selenium Remote Control)..

.htaccess: where is located when not in www base dir

I may need to modify our .htaccess file. Problem is I can't find it. We have several subdomains along side each other in the vhosts directory, and each subdomain has an associated .htpasswd file. H..

Immutable vs Mutable types

I'm confused on what an immutable type is. I know the float object is considered to be immutable, with this type of example from my book: class RoundFloat(float): def __new__(cls, val): r..

Wait Until File Is Completely Written

When a file is created (FileSystemWatcher_Created) in one directory I copy it to another. But When I create a big (>10MB) file it fails to copy the file, because it starts copying already, when the fi..

SQL Server : converting varchar to INT

I am stuck on converting a varchar column UserID to INT. I know, please don't ask why this UserID column was not created as INT initially, long story. So I tried this, but it doesn't work. and give m..

How do I drop a function if it already exists?

I know this must be simple, but how do I preface the creation of a function with a check to see if it already exists? If it exists, I want to drop and re-create it. ..

Confusion: @NotNull vs. @Column(nullable = false) with JPA and Hibernate

When they appear on a field/getter of an @Entity, what is the difference between them? (I persist the Entity through Hibernate). What framework and/or specification each one of them belongs to? @NotN..

What does this square bracket and parenthesis bracket notation mean [first1,last1)?

I have seen number ranges represented as [first1,last1) and [first2,last2). I would like to know what such a notation means...

Why are interface variables static and final by default?

Why are interface variables static and final by default in Java?..

Creating .pem file for APNS?

How do I create a .pem file to be stored in the hosting server for APN payload data?..

Understanding the basics of Git and GitHub

I don't fully understand the purpose of using Git or Github; I know it helps to keep track of your changes and it's helpful for people collaborating with other people, but I don't collaborate with any..

Execute php file from another php

I want to call a PHP file that starts like <?php function connection () { //Statements } I call from the PHP like this: <?php exec ('/opt/lampp/htdocs/stuff/name.php'); ?> I get: l..

Using NULL in C++?

Possible Duplicate: Do you use NULL or 0 (zero) for pointers in C++? Is it a good idea to use NULL in C++ or just the value 0? Is there a special circumstance using NULL in C code calling ..

Dynamic tabs with user-click chosen components

I'm trying to setup a tab system that allows for components to register themselves (with a title). The first tab is like an inbox, there's plenty of actions/link items to choose from for the users, an..

With Spring can I make an optional path variable?

With Spring 3.0, can I have an optional path variable? For example @RequestMapping(value = "/json/{type}", method = RequestMethod.GET) public @ResponseBody TestBean testAjax( HttpServletRequ..

The project type is not supported by this installation

Whenever I try to open a project (csproj) that's downloaded from the internet, most of the times, I get the "The project type is not supported by this installation" It appears that my Visual St..

JavaScript/regex: Remove text between parentheses

Would it be possible to change Hello, this is Mike (example) to Hello, this is Mike using JavaScript with Regex?..

Reading text files using read.table

I have a text file with an id and name column, and I'm trying to read it into a data frame in R: d = read.table("foobar.txt", sep="\t") But for some reason, a lot of lines get merged -- e.g., in ro..

Changing Background Image with CSS3 Animations

Why this isn't working? What am I doing wrong? CSS @-webkit-keyframes test { 0% { background-image: url('frame-01.png'); } 20% { background-image: url('frame-02.png'); } 40% { ..

Singleton: How should it be used

Edit: From another question I provided an answer that has links to a lot of questions/answers about singletons: More info about singletons here: So I have read the thread Singletons: good design o..

Html code as IFRAME source rather than a URL

This standard code for an IFRAME, is there a way to replace the src URL with Just html code? so my problem is simple, I have a page it loads an HTML body from MYSQL I want to present that code in a fr..

Convert bytes to bits in python

I am working with Python3.2. I need to take a hex stream as an input and parse it at bit-level. So I used bytes.fromhex(input_str) to convert the string to actual bytes. Now how do I convert these ..

You have to be inside an angular-cli project in order to use the build command after reinstall of angular-cli

I had the latest angular-cli installed globally and my project was building successfully. While reading a suggested solution for another issue, ( I..

Bootstrap 3 Navbar with Logo

I want to use the Bootstrap 3 default navbar with an image logo instead of text branding. What's the proper way of doing this without causing any issues with different screen sizes? I assume this a co..

Javascript getElementById based on a partial string

I need to get the ID of an element but the value is dynamic with only the beginning of it is the same always. Heres a snippet of the code. <form class="form-poll" id="poll-1225962377536" action=..

phpmyadmin "Not Found" after install on Apache, Ubuntu

Setting up a development environment with Ubuntu 14.04 running in VirtualBox, following this guide: After installing phpmyadmin, it seems I should be able to access it at http://l..

WCF gives an unsecured or incorrectly secured fault error

I am trying to consume a remote svc web service. I created the proxy class using svcutil.exe, and after that I've added that class to my console application, but it yields an error: An unsecured e..

XPath: Get parent node from child node

I need get the parent node for child node title 50 At the moment I am using only //*[title="50"] How could I get its parent? Result should be the store node. <?xml version="1.0" encoding="ut..

Align labels in form next to input

I have very basic and known scenario of form where I need to align labels next to inputs correctly. However I don't know how to do it. My goal would be that labels are aligned next to inputs to the r..

How to resolve "local edit, incoming delete upon update" message

When I do a svn status ., I get this: ! C auto-complete-config.elc > local edit, incoming delete upon update ! + C auto-complete.elc > local edit, incoming delete upon upd..

Recreate the default website in IIS

I've accidentally deleted the default website in IIS; It no longer shows up in the tree of IIS manager and browsing "localhost" returns a 404 error. I've re-installed IIS, but the default website sti..

What is the difference between Digest and Basic Authentication?

What is the difference between Digest and Basic Authentication ?..

How do I get my C# program to sleep for 50 msec?

How do I get my C# program to sleep for 50 milliseconds? This might seem an easy question, but I'm having a temporary brain failure moment!..

IIS7 Permissions Overview - ApplicationPoolIdentity

We have recently upgraded to IIS7 as a core web server and I need an overview in terms of the permissions. Previously, when needing to write to the file system I would have give the AppPool user (Netw..

What is difference between @RequestBody and @RequestParam?

I have gone through the Spring documentation to know about @RequestBody, and they have given the following explanation: The @RequestBody method parameter annotation indicates that a method paramet..

Are members of a C++ struct initialized to 0 by default?

I have this struct: struct Snapshot { double x; int y; }; I want x and y to be 0. Will they be 0 by default or do I have to do: Snapshot s = {0,0}; What are the other ways to zero out t..

SQLAlchemy: What's the difference between flush() and commit()?

What the difference is between flush() and commit() in SQLAlchemy? I've read the docs, but am none the wiser - they seem to assume a pre-understanding that I don't have. I'm particularly interested ..

wamp server does not start: Windows 7, 64Bit

I am trying to install wamp server (following is the exact setup name) on windows 7, 64Bit OS. But it never starts, icon stays in orange color meaning some services did not start. wampserver2.2e-php5..

Android MediaPlayer Stop and Play

I'm creating Android application contains 2 buttons, on click on each button play a mp3 file. The problem is when I play button1 it plays sound1, when I click button2 it plays sound2. I check on each..

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

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

How to read data from java properties file using Spring Boot

I have a spring boot application and I want to read some variable from my file. In fact below codes do that. But I think there is a good method for this alternative. Properties..

Javascript : calling function from another file

I'm just new comer at Javascript so when I read a Javascript document, and there're many complex structures that I cannot follow. Here is the short explanation of Javascript code that I'm reading : i..

jQuery UI Dialog individual CSS styling

I'm looking to style a modal dialog (using UI Dialog) with unique CSS that is separate from the traditional dialog, so in essence to have two jQuery dialogs that each look different. I've styled one,..

Convert JS Object to form data

How can I can convert my JS Object to FormData? The reason why I want to do this is, I have an object that I constructed out of the ~100 form field values. var item = { description: 'Some Item',..

What is the default scope of a method in Java?

If I type: void doThis(){ System.out.println("Hello Stackoverflow."); } what is the default scope of doThis()? Public? Protected? Private?..

PHP Pass by reference in foreach

I have this code: $a = array ('zero','one','two', 'three'); foreach ($a as &$v) { } foreach ($a as $v) { echo $v.PHP_EOL; } Can somebody explain why the output is: zero one two two . From..

String.Format alternative in C++

I don't have much experience working with C++. Rather I have worked more in C# and so, I wanted to ask my question by relating to what I would have done in there. I have to generate a specific format ..

A failure occurred while executing

I am getting this error while I am building APK. Cause 1: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing

Angular 2 @ViewChild annotation returns undefined

I am trying to learn Angular 2. I would like to access to a child component from a parent component using the @ViewChild Annotation. Here some lines of code: In BodyContent.ts I have: import {View..

Unable to login to SQL Server + SQL Server Authentication + Error: 18456

I have created login account on my localhost\sql2008 Server (Eg. User123) Mapped to Database (default) Authentication Mode on SQL Server is set to both (Windows and SQL) But login to SQL Server fai..

Is there a short cut for going back to the beginning of a file by vi editor?

When reading a long file by vi editor, it would be very nice to get back to the beginning of the file by some short cuts when you really need to do so. Even ctrl+B sometimes is too slow. Does anyone k..

Rails get index of "each" loop

So I have this loop: <% @images.each do |page| %> <% end %> How would I get the index of "page" inside of the loop?..

What is a Windows Handle?

What is a "Handle" when discussing resources in Windows? How do they work?..

How to delete columns that contain ONLY NAs?

I have a data.frame containing some columns with all NA values, how can I delete them from the data.frame. Can I use the function na.omit(...) specifying some additional arguments?..