In Python, without using the traceback module, is there a way to determine a function's name from within that function?
Say I have a module foo with a function bar. When executing foo.bar(), is ther..
I installed Postgres with this command
sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev
Using psql --version on terminal I get psql (PostgreSQL) 9.3.4
then I installe..
I am an AngularJS starter. I am trying to send data from :
Page A : Van Listing page
to
Page B: Van Update page.
When user click the update link for a van, I am invoking a controller and retrievi..
Let's suppose if we have a class like:
class Person {
internal int PersonID;
internal string car;
}
I have a list of this class: List<Person> persons;
And this list can have multi..
Given numbers like 499, 73433, 2348 what VBA can I use to round to the nearest 5 or 10? or an arbitrary number?
By 5:
499 -> 500
2348 -> 2350
7343 -> 7345
By 10:
499 -> 500
2348 -..
I'm trying to read a .csv file into R and upon using this formula:
pheasant<-read.table(file.choose(),header=TRUE,sep=",")
I get this warning message:
"incomplete final line found by readTableH..
I have Strings that are put into an ArrayList randomly.
private ArrayList<String> teamsName = new ArrayList<String>();
String[] helper;
For example:
teamsName.add(helper[0]) where hel..
I have a command line program in Python that takes a while to finish. I want to know the exact time it takes to finish running.
I've looked at the timeit module, but it seems it's only for small snip..
Supposed I have an image that I want to tag as 0.10.24 (in my case it's an image containing Node.js 0.10.24). I built that image using a Dockerfile and executing docker build and by providing a tag us..
From git-clone(1) Manual Page
--branch can also take tags and detaches the HEAD at that commit in the resulting repository.
I tried
git clone --branch <tag_name> <repo_url>
But ..
This might be silly but I am unable to install cPickle with python 3.5 docker image
Dockerfile
FROM python:3.5-onbuild
requirements.txt
cpickle
When I try to build the image
$ docker build -t ..
Given the following table:
id | value
--------------
1 6
2 70
Is there a way to add a column that is automatically calculated based on another column in the same table? Like a VIEW, but pa..
I'd like to have a function behaving as mysql_real_escape_string without connecting to database as at times I need to do dry testing without DB connection. mysql_escape_string is deprecated and theref..
I have a datetime that looks like this:
201210120956
ccyyMMDDhhmm
When I try this:
Dim convertedDate As Date = Date.Parse(DateString)
Return convertedDate
I get back this:
#10/12/2012#
I'm lo..
I need a function written in Excel VBA that will hash passwords using a standard algorithm such as SHA-1. Something with a simple interface like:
Public Function CreateHash(Value As String) As Strin..
I am wondering wether the Password Hasher that is default implemented in the UserManager that comes with MVC 5 and ASP.NET Identity Framework, is secure enough? And if so, if you could explain to me h..
I have a dataframe and I would like to count the number of rows within each group. I reguarly use the aggregate function to sum data as follows:
df2 <- aggregate(x ~ Year + Month, data = df1, sum)..
I'm trying to come up with a good enough anti-spamming mechanism to prevent automatically generated input. I've read that techniques like captcha, 1+1=? stuff work well, but they also present an extra..
I am very new to python. I was trying to pass value from one method to another within the class. I searched about the issue but i could not get proper solution. Because in my code, "if" is calling cla..
I have quite a large list of words in a txt file and I'm trying to do a regex find and replace in Notepad++. I need to add a string before each line and after each line.. So that:
wordone
wordtwo
wo..
I need help regarding working on fragment inside fragment, actually I
am facing a problem on pressing back button. Application Main screen
has buttons and pressing on each button view replace with new..
I have an array, and am looking for duplicates.
duplicates = false;
for(j = 0; j < zipcodeList.length; j++){
for(k = 0; k < zipcodeList.length; k++){
if (zipcodeList[k] == zipcodeLi..
Looking at the new spark dataframe api, it is unclear whether it is possible to modify dataframe columns.
How would I go about changing a value in row x column y of a dataframe?
In pandas this would..
I have an array that might look like this:
ANOVAInputMatrixValuesArray = [[ 0.96488889, 0.73641667, 0.67521429, 0.592875,
0.53172222], [ 0.78008333, 0.5938125, 0.481, 0.39883333, 0.]]
Notice that ..
How can I launch an application using C#?
Requirements:
Must work on Windows XP and Windows Vista.
I have seen a sample from DinnerNow.net sampler that only works in Windows Vista...
I want to validate my form using jquery but it doesn't have an ID property as of now how to add it to the form in asp.net mvc? I am using this...
<% using (Html.BeginForm()) {%>
and my jquery..
I know that if you put a link in a textview it will work but if I want to display for example:
google
stackoverflow
and not the whole link(just the tag)
How do i make those links clickable?..
I would like to test my application on PHP 5.3 up to PHP 7.0.
Where and how can I install the versions and how can I switch them by running a small script?..
I have an existing project that uses @Override on methods that override interface methods, rather than superclass methods. I cannot alter this in code, but I would like Eclpse to stop complaining abou..
I'm creating a mobile website that will include a page from which people can download relevant apps that we recommend. I've found instructions for creating the links to launch the Market but this assu..
I have a huge query which uses case/when often. Now I have this SQL here, which does not work.
(select case when xyz.something = 1
then
'SOMETEXT'
else
(select case when xyz.somethingel..
I can not initialize a List as in the following code:
List<String> supplierNames = new List<String>();
supplierNames.add("sup1");
supplierNames.add("sup2");
supplierNames.add("sup3");
Sys..
What is the proper way of setting the User-Agent header for a WebClient request for Windows Phone 7?
I found 2 options, but not sure which one is the correct one. Considering a WebClient object:
WebC..
How do I select the first column from the TAB separated string?
# echo "LOAD_SETTLED LOAD_INIT 2011-01-13 03:50:01" | awk -F'\t' '{print $1}'
The above will return the entire line and not ..
Is there any way to find out if the current session user is running an Xserver (under Linux) ?
I'v started off with things like:
ps -e | grep X
but this doesn't work always
and one more thing I ..
I just installed MySQL on Ubuntu and the root user can't log in :)
How can I recover or find out my password? Using blank for password does not work...
I'm trying to insert CLOBs into a database (see related question). I can't quite figure out what's wrong. I have a list of about 85 clobs I want to insert into a table. Even when inserting only the fi..
I'm testing one application where Regex pattern match credit card then such numbers should be highlighted. I'm using site http://regexpal.com/ to create test credit credit card numbers for my testing...
I have a plan to use distributed TensorFlow, and I saw TensorFlow can use GPUs for training and testing. In a cluster environment, each machine could have 0 or 1 or more GPUs, and I want to run my Ten..
I'm developing an app on Heroku with a Postgresql backend. Periodically, I get this error message when trying to access the database, both from the CLI and from loading a page on the server:
psql: FA..
I have to use vanilla JavaScript for a project. I have a few functions, one of which is a button that opens a menu. It works on pages where the target id exists, but causes an error on pages where t..
Possible Duplicate:
Truncate leading zeros of a string in Javascript
What is the simplest and cross-browser compatible way to remove leading zeros from a number in Javascript ?
e.g. If I h..
I'm using the httppackage from Go to deal with POST request. How can I access and parse the content of the query string from the Requestobject ? I can't find the answer from the official documentation..
MS Access: How to replace blank (null ) values with 0 for all records?
I guess it has to be done using SQL. I can use Find and Replace to replace 0 with blank, but not the other way around (won't "fi..
How to convert UPPERCASE letter to lowercase and first letter Uppercase for each sentences like below only by using CSS?
From:
THIS IS AN EXAMPLE SENTENCE.
To:
This is an example sentence.
Update:..
Say I want to sum a.x for each element in arr.
arr = [{x:1},{x:2},{x:4}]
arr.reduce(function(a,b){return a.x + b.x})
>> NaN
I have cause to believe that a.x is undefined at some point.
The f..
Can any one tell me what is a the best way to convert a multipart file (org.springframework.web.multipart.MultipartFile) to File (java.io.File) ?
In my spring mvc web project i'm getting uploaded fi..
On my development machine, I use port 10524. So I start my server this way :
rails s -p 10524
Is there a way to change the default port to 10524 so I wouldn't have to append the port each time I st..
Problem
I am writing an application in React and was unable to avoid a super common pitfall, which is calling setState(...) after componentWillUnmount(...).
I looked very carefully at my code and tr..
I'm having trouble using the regex of the find command. Probably something I don't understand about escaping on the command line.
Why are these not the same?
find -regex '.*[1234567890]'
find -regex..
As of today I've been running into an error setting up new projects in Android Studio. Right after creating a blank project the log mentions "Gradle sync failed: failed to find Build Tools revision 2..
I tried to install the Python package dulwich:
pip install dulwich
But I get a cryptic error message:
error: Unable to find vcvarsall.bat
The same happens if I try installing the package manua..
I was wondering if there was any way in JavaScript to loop through an object like so.
for(var i in myObject) {
// ...
}
But get the name of each property like this.
for(var i in myObject) {
..
How do you start debugging the application at the application root? For example: http://localhost:49742/
I'm always getting a page which doesn't exist, such as:
http://localhost:49742/Views/Home/Abou..
I have a simple select option form field in my Angular material project:
component.html
<mat-form-field>
<mat-select [(value)]="modeSelect" placeholder="Mode">
<mat-option..
hello i have a run a query using php it give error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
..
I have a SQL script that has to be run every time a client executes the "database management" functionality. The script includes creating stored procedures on the client database. Some of these clien..
I have a typical javascript function with some parameters
my_function = function(content, options) { action }
if I call the function as such :
my_function (options)
the argument "options" is pas..
I have been using try..catch blocks in my PHP code, but I'm not sure if I've been using them correctly.
For example, some of my code looks like:
try {
$tableAresults = $dbHandler->doSometh..
I need to create a null check in this formula for the books[i] and I am not entirely sure how to go about this as I am not greatly familiar with null checks and very new at programming. Any and all he..
I got the following message when I open the NetBeans. I have got the JDK installed, and set the bin directory in the environment. What I could do next to avoid this problem? Btw, I am using Windows 7 ..
try:
r = requests.get(url, params={'s': thing})
except requests.ConnectionError, e:
print e #should I also sys.exit(1) after this?
Is this correct? Is there a better way to structure this? W..
I am using the following statement to make it readonly but it is not working.
$('#cf_1268591').attr("readonly", "readonly");
I don't want make it disabled, I want to make it readonly...
I have several places with their latitude and longitude. I want to display them in google map. Thats ok, what i can't is to display the marker at the specific lat,long position.
e.g. if i've the foll..
I often see the following code:
(function () {
// init part
})();
but I never could get my head around how it works. I find the last brackets especially confusing.
Could someone explain how it wo..
I have a control which I have to make large modifications to. I'd like to completely prevent it from redrawing while I do that - SuspendLayout and ResumeLayout aren't enough. How do I suspend painti..
I want to create a dynamic object (inside another object) in Python and then add attributes to it.
I tried:
obj = someobject
obj.a = object()
setattr(obj.a, 'somefield', 'somevalue')
but this didn..
How to access PHP session variables from jQuery function in a .js file?
In this code, I want to get "value" from a session variable
$(function() {
$("#progressbar").progressbar({
value: 37
..
I am trying to insert a new row and set the customer_id with max()+1. The reason for this is the table already has a auto_increatment on another column named id and the table will have multiple rows w..
I need to create a solid color inset border. This is the bit of CSS I'm using:
border: 10px inset rgba(51,153,0,0.65);
Unfortunately that creates a 3D ridged border (ignore the squares and dark descr..
Given an array of integers, A1, A2, ..., An, including negatives and positives, and another integer S. Now we need to find three different integers in the array, whose sum is closest to the given inte..
I have a VC++ project in Visual Studio 2008.
It is defining the symbols for unicode on the compiler command line (/D "_UNICODE" /D "UNICODE"), even though I do not have this symbol turned on in the..
I know how to add an IBAction to a button by dragging from the interface builder, but I want to add the action programmatically to save time and to avoid switching back and forth constantly. The solut..
Cannot get data with XMLHttpRequest (status 0 and responseText is empty):
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","http://www.w3schools.com/XML/cd_catalog.xml", true);
xmlhttp.onreadystatec..
How would I have a JavaScript action that may have some effects on the current page but would also change the URL in the browser so if the user hits reload or bookmark, then the new URL is used?
It..
I'm running a curl request on an eXist database through php. The dataset is very large, and as a result, the database consistently takes a long amount of time to return an XML response. To fix that, w..
I have a warning at the bottom of my screen:
Warning 1 'WindowsFormsApplication2.EventControlDataSet.Events' hides
inherited member
'System.ComponentModel.MarshalByValueComponent.Events'...
I have a site that has an IE8-only problem:
The code is:
var w = window.open(urlstring, wname, wfeatures, 'false');
The error is:
Message: Invalid argument.
Line: 419
Char: 5
Code: 0
..
I know there is actually no single right way. However I've found that it's hard to create a directory structure that works well and remain clean for every developer and administrator. There is some st..
Given I have a HUGE array, and a value from it. I want to get index of the value in array. Is there any other way, rather then call Array#index to get it? The problem comes from the need of keeping re..
Does Java have anything to represent infinity for every numerical data type? How is it implemented such that I can do mathematical operations with it?
E.g.
int myInf = infinity; //However it is done..
I have WampServer 2 installed on my Windows 7 computer. I'm using Apache 2.2.11 and PHP 5.2.11. When I attempt to upload any file from a form, it seems to upload, but in PHP, the $_FILES array is empt..
I'm new to PowerShell and have a script which loops through Active Directory searching for certain computers. I get several variables and then run functions to check things like WMI and registry setti..
I receive a JSON object from an AJAX call to a REST server. This object has property names that match my TypeScript class (this is a follow-on to this question).
What is the best way to initialize it..
Alright, so simple problem here. I'm working on a simple back up code. It works fine except if the files have spaces in them. This is how I'm finding files and adding them to a tar archive:
find . ..
I have the following Jquery callback function and I have a litle doubt about it (I don't know very well Jquery):
$("form.readXmlForm").submit(function() {
// Riferimento all'elemento form che ha ..
What I want is to pass the value of txtComments from View (using jquery/ajax) to Controller.
The problem is the ajax/jquery doesn't accept script tags as string. Meaning, when I input any script/htm..
I'm on Ubuntu, and I want to install Boost. I tried with
sudo apt-get install boost
But there was no such package. What is the best way to install Boost on Ubuntu?..
I have some labels which I want to adjust their height to the text, this is the code I wrote for this now
func heightForView(text:String, font:UIFont, width:CGFloat) -> CGFloat{
let label:UILa..
I want to select a file on the local hard disk when I click a "Browse" button.
I don't have any idea how to use the OpenFileDialog control. Can anyone help me?..
I'm trying to connect to a database made by MS Access using Java, but I cannot seem to manage. I am using ODBC and I'm getting this exception:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] ..
I'm practicing using mulitple files and header files etc. So I have this project which takes two numbers and then adds them. Pretty simple.
Here are my files:
main.cpp
#include <iostream>
#in..
I have the following to read a file line by line:
wscript.echo "BEGIN"
filePath = WScript.Arguments(0)
filePath = "C:\Temp\vblist.txt"
Set ObjFso = CreateObject("Scripting.FileSystemObject")
Set Obj..
I am trying to step through my program and I get the following message from Code::Blocks
Selecting target:
Debug
ERROR: You need to specify a debugger program in the debuggers's settings.
(For MinGW..
In a DOS batch file we can only have 1 line if statement body? I think I found somewhere that I could use () for an if block just like the {} used in C-like programming languages, but it is not execut..
I've seen different advice on the best way to do this This question covers creating a jar. Elsewhere, I've seen advice to simply copy the volley source into your own project. This section on libraries..
We can set a image as background image of a <div> like:
<style>
#test {
background-image: url(./images/grad.gif);
background-repeat: no-repeat;
background-p..
Is there a built in way to get the headers of a specific address via node.js?
something like,
var headers = getUrlHeaders("http://stackoverflow.com");
would return
HTTP/1.1 200 OK.
Cache-Control:..
I have heard from people who have switched either way and who swear by the one or the other.
Being a huge Eclipse fan but having not had the time to try out IntelliJ, I am interested in hearing from ..
I've got a legacy code issue that requires that I support random urls as if they were requests for the home page. Some of the URLs have characters in them that generate the error "A potentially danger..
The way I do 80-column indication in Vim seems incorrect:set columns=80.
At times I also set textwidth, but I want to be able to see and anticipate line overflow with the set columns alternative.
Th..
I have a css folder at the root of my Java Web Application. My import statement looks like this:
<link rel="stylesheet" type="text/css" href="/css/styles.css"/>
The style is not being applied..
class Person
{
public:
int age;
};
I want to store objects of the class Person in a priority queue.
priority_queue< Person, vector<Person>, ??? >
I think I need to define a class ..
I'm trying to repeat this simple command 10,000 times (via a simple and easy solution): Tandem <- sample(OUT, size = 815, replace = TRUE, prob = NULL); mean(Tandem) Any advice would be greatly a..
Is there a android standard badge or method to show action bar notification icon with a count like on Google examples?
If not, then what is the best way to make it?
I'm new to android, please help...
The only thing I don't have an automated tool for when working with Oracle is a program that can create INSERT INTO scripts.
I don't desperately need it so I'm not going to spend money on it. I'm ju..
On a fresh installation of Anaconda under Ubuntu... I am preprocessing my data in various ways prior to a classification task using Scikit-Learn.
from sklearn import preprocessing
scaler = preproces..
I am trying to use port 80 for my application server, but when I perform netstat -aon I get:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4
When I look up the process in task manager, it shows PID 4 is SYSTEM..
I am VERY new to ASP.NET MVC (3) and am having a hard time resolving a build error in Visual Studio:
The type or namespace name 'DbContext' could not be found (are you missing a using directive or an..
I have implemented a ListView in my Android application. I bind to this ListView using a custom subclass of the ArrayAdapter class. Inside the overridden ArrayAdapter.getView(...) method, I assign a..
I'm having some trouble with my insertion method for a linked list in C. It seems to only add at the beginning of the list. Any other insertion I make fail. And this CodeBlocks debugger is so hard to ..
I'm looking for a way to find the row count for all my tables in Postgres. I know I can do this one table at a time with:
SELECT count(*) FROM table_name;
but I'd like to see the row count for all..
I have simple HTML code with some javascript, it looks like:
_x000D_
_x000D_
<html>_x000D_
_x000D_
<head>_x000D_
<script type="text/javascript">_x000D_
function changeDivConte..
I've looked into and considered many JavaScript unit tests and testing tools, but have been unable to find a suitable option to remain fully TDD compliant. So, is there a JavaScript unit test tool tha..
I can read the MySQL documentation and it's pretty clear. But, how does one decide which character set to use? On what data does collation have an effect?
I'm asking for an explanation of the two and..
I am aware of function debug_backtrace, but I am looking for some ready to use implementation of function like GetCallingMethodName()? It would be perfect if it gave method's class too (if it is indee..
When trying to reference a managed bean in EL like so #{bean.entity.property}, sometimes a javax.el.PropertyNotFoundException: Target Unreachable exception is being thrown, usually when a bean propert..
I need to execute an action (emptying an array), when the back button of a UINavigationController is pressed, while the button still causes the previous ViewController on the stack to appear. How coul..
I have 3 Columns of ULs each a Dynamic UL container that can have anywhere from 0-9 LI containers (eventually more). All my LI elements have an attribute "rel" which I am trying to ultimately find tha..
I have a question:
Let's say there are two std::strings and I want to compare them, there is the option of using the compare() function of the string class but I also noticed that it is possible usin..
Maybe I'm just not seeing it, but CRC32 seems either needlessly complicated, or insufficiently explained anywhere I could find on the web.
I understand that it is the remainder from a non-carry-based..
I am trying to install python and a series of packages onto a 64bit windows 7 desktop. I have installed Python 3.4, have Microsoft Visual Studio C++ installed, and have successfully installed numpy, p..
I am a bit confused by the fact that although I installed RHEL 5.1 from DVD (RedHat/5.1.x86_64), when I issue command:
cat /etc/redhat-release
I got:
Red Hat Enterprise Linux Server release 5.5 (T..
I downloaded Visual C++ and Visual Studio, but I cannot find cl.exe to compile my C++ file. The path to the install is `C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin.
Where can I find t..
First time poster, so if there is any formatting, or guidelines I failed to adhere to, please let me know so that I can fix it.
So I am basically asking the user for the file directory of the excel ..
I have the following in my application controller:
def is_number?(object)
true if Float(object) rescue false
end
and the following condition in my controller:
if mystring.is_number?
end
The c..
When I change the connection string using this code, it does not reload app.config at runtime. I expected it to reload similarly to how we reload app.config.
config.ConnectionStrings.ConnectionString..
I have a DataTable populated with samo data/values and I want to read data from DataTable and pass it to a string variable.
I have this code:
DataTable dr_art_line_2 = ds.Tables["QuantityInIssueUni..
I need to fetch the IPaddress assigned by the operator after a successful 3G or LTE data call.
$adb shell netcfg >> doesnt have the assigned IP address.
I tried adb shell dumpsys and grep ip ..
I am trying to insert an image into an BLOB field in a signatures which i will then select from the table and render on a report. I cannot seem to figure how to get the image into the table. I did an ..
I'm using my bot to tell important news, but when I using sendMessage to the channel I'm receiving the following error:
{"ok":false,"error_code":403,"description":"Error: Forbidden: bot is not a part..
What is the fastest way to check if a string matches a regular expression in Ruby?
My problem is that I have to "egrep" through a huge list of strings to find which are the ones that match a regexp t..
I'm using a singleTop Activity to receive intents from a search-dialog via onNewIntent().
What I noticed is that onPause() is called before onNewIntent(), and then afterwards it calls onResume(). Vi..
What is the most efficient way to convert a MySQL query to CSV in PHP please?
It would be best to avoid temp files as this reduces portability (dir paths and setting file-system permissions required)..
I installed mysql in Mac after downloding its dmg file version 64 bit.
While trying to create a database it gave me error 1006 -- can't create database. After browsing a number of website, it seems du..
As per my knowledge,
a mutable string can be changed, and
an immutable string cannot be changed.
Here I want to change the value of String like this,
String str="Good";
str=str+" Morning";
and ot..
Is it possible to change the postgresql role a user is using when interacting with postgres after the initial connection?
The database(s) will be used in a web application and I'd like to employ data..
when I do curl to a API call link http://example.com/passkey=wedsmdjsjmdd
curl 'http://example.com/passkey=wedsmdjsjmdd'
I get the employee output data on a csv file format, like:
"Steve","421","0..
When I try to check for an internet connection on my iPhone I get a bunch of errors. Can anyone help me to fix this?
The code:
import Foundation
import SystemConfiguration
public class Reachability..
I want to read a text file containing space separated values. Values are integers.
How can I read it and put it in an array list?
Here is an example of contents of the text file:
1 62 4 55 5 6 77
..
Here is the code I was trying to turn into a list comprehension:
table = ''
for index in xrange(256):
if index in ords_to_keep:
table += chr(index)
else:
table += replace_with..
I am using Excel where certain fields are allowed for user input and other cells are to be protected. I have used Tools Protect sheet, however after doing this I am not able to change the values in th..
I have built this fiddle as an example of what I am doing.
What I am trying to do works fine in Firefox. With the font-size being 14px when you open up the select options.
However looking at it in Goo..
I was confused with usage of %c and %s in the following C program
#include <stdio.h>
void main()
{
char name[]="siva";
printf("%s\n",name);
printf("%c\n..
Possible Duplicate:
Convert character to ASCII code in Javascript
my requirement is to get the ASCII value of the alphabet letters... Can anyone suggest how to do this in JavaScript?..
Is there a simple shell command/script that supports excluding certain files/folders from being archived?
I have a directory that need to be archived with a sub directory that has a number of very la..
I was writing a simple script in the school computer, and committing the changes to Git (in a repo that was in my pendrive, cloned from my computer at home). After several commits I realized I was com..
Is there an efficient way to tell if a DOM element (in an HTML document) is currently visible (appears in the viewport)?
(The question refers to Firefox.)..
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..
I have a WCF web service that is working fine. However there is one particular call that is failing - but only failing for certain users. The call is pretty simple - it is a call to get a list of Pe..
I just want to format current date into yyyymmdd in DB2.
I see the date formats available, but how can I use them?
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.d..
I want to remove commas from the string and calculate those amount using JavaScript.
For example, I have those two values:
100,000.00
500,000.00
Now I want to remove commas from those string a..
How can I fill a multidimensional array in Java without using a loop? I've tried:
double[][] arr = new double[20][4];
Arrays.fill(arr, 0);
This results in java.lang.ArrayStoreException: java.lang.D..
I have a form with several spans with id="myid". I'd like to be able to remove all elements with this id from the DOM, and I think jQuery is the best way to do it. I figured out how to use the $.remov..
In rails >4.0.0 generators creates CRUD operations with before_action not before_filter. It seems to do the same thing. So what's the difference between these two? ..
In this fiddle http://jsfiddle.net/mjmitche/6nar4/3/, if you drag, for example, the little blue box into the yellow box, then the big black box will turn pink. All of the 4 boxes along the left can be..
Since dotnet core moved back to the .csproj format, there is a new autogenerated MyProject.AssemblyInfo.cs which contains, among others:
[assembly: AssemblyCompany("MyProject")]
[assembly: A..
How do I resolve paths relative to an ASP.NET MVC 4 application's root directory? That is, I want to open files belonging to the application from controller actions, referenced like ~/Data/data.html. ..
How would I save a registered Variable to a file? I took this from the tutorial:
- hosts: web_servers
tasks:
- shell: /usr/bin/foo
register: foo_result
ignore_errors: True
..
I've created lots of branches in one of our repositories. Those branches are for testing before it will be pulled to the master. Now I see lots of them on the list and they we will never use it again...
Given an array [1, 2, 3, 4], how can I find the sum of its elements? (In this case, the sum would be 10.)
I thought $.each might be useful, but I'm not sure how to implement it...
I just discovered that every request in an ASP.Net web application gets a Session lock at the beginning of a request, and then releases it at the end of the request!
In case the implications of this ..
I am in a situation where my code takes extremely long to run and I don't want to be staring at it all the time but want to know when it is done.
How can I make the (Python) code sort of sound an "al..
Here's my situation:
on this.handleFormSubmit() I am executing this.setState()
inside this.handleFormSubmit(), I am calling this.findRoutes(); - which depends on the successful completion of this.se..
I use .append to add to a div
$(this).append('<ul><li>test</li></ul>');
how can I search for a <ul> and remove it if it exists in the children of $(this)?..
I have this problem, I have two divs:
<div style="width:100%; height:50px;" id="div1"></div>
<div style="width:100%;" id="div2"></div>
How do I make div2 occupy remaining he..
How can I restart a Java AWT application? I have a button to which I have attached an event handler. What code should I use to restart the application?
I want to do the same thing that Application.Re..
How can you get the selected value from drop down list using JavaScript? I have tried the following but it does not work.
var sel = document.getElementById('select1');
var sv = sel.options[sel.select..
The goal is to display the information that the application is working. So I'm looking for an intelligent implementation sample of a loading spinner using WPF / MVVM...
Can someone explain what the document.getElementById("demo") line does in the example below?
I understand getElementById gets the id of demo but the id is <p id="demo"></p> What exactly i..
I want to execute a function every time the value of a specific input box changes. It almost works with $('input').keyup(function), but nothing happens when pasting text into the box, for example. $in..
Using PowerShell I would like to capture user input, compare the input to data in a comma delimited CSV file and write corresponding data to a variable.
Example:
A user is prompted for a “Store..
Does anyone know how can I get the clicked link's href with jquery? I have the link as following:
<a href="ID=1" class="testClick">Test1.</a>
<br />
<a href="ID=2" ..
I am working with some XML that holds strings like:
<node>This is a string</node>
Some of the strings that I am passing to the nodes will have characters like &, #, $, etc.:
<no..
I have a class that creates a static array of all properties, using a static constructor. I also have a function -- GetNamesAndTypes() -- that lists the name & type of each property in that array..
Is there a way to print text and variable contents on the same line? For example,
wd <- getwd()
print("Current working dir: ", wd)
I couldn't find anything about the syntax that would allow me t..
My current project involves deploying an upgraded .exe file that runs as a Windows Service. In order to overwrite the existing .exe with the new version, I currently need to:
Stop the service
Unins..
I am getting
[Tue Apr 24 12:12:55 2012] [error] [client 127.0.0.1] client denied by server configuration: /labs/Projects/Nebula/bin/
My directory structure looks like (I am using Symfony 2, sho..
If I want to tag the current commit. I know both of the following command lines work:
git tag <tagname>
and
git tag -a <tagname> -m '<message>'
What is the difference between t..
I've one file, main.rb with the following content:
require "tokenizer.rb"
The tokenizer.rb file is in the same directory and its content is:
class Tokenizer
def self.tokenize(string)
r..