I am using this to get the current time :
java.util.Calendar cal = java.util.Calendar.getInstance();
System.out.println(new java.text.SimpleDateFormat("EEEE, dd/MM/yyyy/hh:mm:ss")
.fo..
Is it is possible to do something like the following in the app.config or web.config files?
<appSettings>
<add key="MyBaseDir" value="C:\MyBase" />
<add key="Dir1" value="[MyBaseDir]..
Android newbie. My processor is AMD, not Intel, so I can't open the emulator in Android studio.
This answer has the comment: 'You can run the ARM (non Intel) emulator image. From your list, just cho..
How do I serialize a Python dictionary into a string, and then back to a dictionary? The dictionary will have lists and other dictionaries inside it...
How can I detect delete (backspace) key event for a editText? I've tried using TextWatcher, but when the editText is empty, when I press delete key, nothing happens. I want to detect delete key press ..
The problem is that I have some dynamically created sets of input tags and I also have a function that is meant to trigger any time an input value is changed.
$('input').on('change', function() {
..
I have a client Server application which communicate using objects.
when I send only one object from the client to server all works well.
when I attempt to send several objects one after another on th..
I am in the middle of designing a highly-scalable application which must store a lot of data. Just for example it will store lots about users and then things like a lot of their messages, comments etc..
I have the following:
answers = Answer.objects.filter(id__in=[answer.id for answer in answer_set.answers.all()])
then later:
for i in range(len(answers)):
# iterate through all existing Questi..
I've created a git repository with a submodule in it. I'm able to tell the submodule itself to change its remote repository path, but I'm not sure how to tell the parent repository how to change the r..
Under Windows Server 2008 with ASP.NET 4.0 installed there is a whole slew of related user accounts, and I can't understand which one is which, how to they differ, and which one is REALLY the one that..
I know I can iterate over a map m by,
for k, v := range m { ... }
and look for a key but is there a more efficient way of testing a key's existence in a map?
I couldn't find the answer in the lan..
So, normally ArrayList.toArray() would return a type of Object[]....but supposed it's an
Arraylist of object Custom, how do I make toArray() to return a type of Custom[] rather than Object[]?..
I need to produce large and big (very) matrices (Markov chains) for scientific purposes. I perform calculus that I put in a list of 20301 elements (=one row of my matrix). I need all those data in mem..
How do I exit a while loop immediately without going to the end of the block?
For example,
while (choice != 99)
{
cin >> choice;
if (choice == 99)
//Exit here and don't get add..
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..
I want to install packages from github to my gopath, I have tried this:
go get github.com:capotej/groupcache-db-experiment.git
the repository is here...
Possible Duplicate:
Return empty cell from formula in Excel
I have an IF statement. If a cell = n, then do something, else output NULL
=IF(A1=5, "Success", NULL) // #NAME?
=IF(A1=5, "Suc..
I am trying to set sql_mode in mysql but it throws an error.
Command:
set global sql_mode='NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLE','NO_AUTO_CREATE_USER','NO_ENGINE_SUBSTITUTION'
Is this not t..
Using pyqt4 and python 2.6, I am using a qcombobox to provide a list of options. I am having problems with using the selected option. I have been able to use a signal to trigger a method when the opti..
I have started to learn Angular but I note that powershell in Windows gives me an error whenever I make an angular command like:
ng new new-app
or
ng serve
this is the error what I got:
ng : Fi..
I have following data:
1||1||Abdul-Jabbar||Karim||1996||1974
I want to delimit the tokens.
Here the delimiter is "||".
My delimiter setter is:
public void setDelimiter(String delimiter) {
ch..
How to write a query to display all tablespaces in database suppose db and it's corresponding datafiles belong to user SCOTT. I can connect to SCOTT account and see it but I like to connect to sys as ..
I go to https://mywebsite/MyApp/Myservice.svc and get the following error:
(The link works if I use http:// )
"The service '/MyApp/MyService.svc' cannot be activated due to an exception during compi..
I have an angular4 application with a form. In this one I have an input to enter a percentage. So, I want to block the input with value between 0 and 100.
I tried to add min="0" and max="100" but I ca..
I'm thinking about putting the virtualenv for a Django web app I am making inside my git repository for the app. It seems like an easy way to keep deploy's simple and easy. Is there any reason why I s..
i am still new on c# and i'm trying to create an application for this page that will tell me when i get a notification (answered, commented, etc..). But for now i'm just trying to make a simple call t..
I'd like to set up a multidimensional list.
For reference, I am working on a playlist analyzer.
I have a file/file-list, which my program saves in a standard list. One line from the file in each list..
In my application, I have an EditText whose default input type is set to android:inputType="textPassword" by default. It has a CheckBox to its right, which is when checked, changes the input..
When I run some programs over SSH, such as firefox &, I get an error
Error: no display specified
I would like to open many displays, still showing the stdout of each program.
Initial Questi..
I have a simple android project that I created with Android Studio 0.4.0.
I use Gradle 1.9 and Gradle Android Plugin 0.7. Yesterday I've added Jake Wharton's ButterKnife library in my gradle build sc..
I'm getting this error message every time I try to submit the form:
The CSRF token is invalid. Please try to resubmit the form
My form code is this:
<form novalidate action="{{path('signup_i..
I need to access the Parent Domain URL from my Iframe which is in another domain.
For example, "example.com" is my website which has an Iframe from another parent domain, such as "google.com". Here I..
I am getting Java exception like:
java.net.MalformedURLException: no protocol
My program is trying to parse an XML string by using:
Document dom;
DocumentBuilderFactory dbf = DocumentBuilderFacto..
I have declared a JSON Object and added some key value pair in that like:
var obj = {};
and added some data into it like:
obj = {
"1":"aa",
"2":"bb"
};
But I want to add more key value pair in ..
I have bin deployed an MVC4 application to my hosting provider, based on advice given here and one or two on-the-fly fixes, but the most immediately apparent problem is that the bundling for css doesn..
In Java, what are the performance and resource implications of using
System.currentTimeMillis()
vs.
new Date()
vs.
Calendar.getInstance().getTime()
As I understand it, System.currentTimeM..
I have a program in C# with a PictureBox object inside a Form. How do I change its picture? The pictures to chose from are in bin/Pics; they are jpeg in format, if that matters....
Why am I getting an error doing an insert when IDENTITY_INSERT is set to OFF?
How do I turn it on properly in SQL Server 2008? Is it by using SQL Server Management Studio?
I have run this query:
..
I have the following in the page
<select name="val" size="1" >
<option value="A">Apple</option>
<option value="C">Cars</option>
<option value="H">Honda</option&..
In PHP, when accessing MySQL database with PDO with parametrized query, how can you check the final query (after having replaced all tokens)?
Is there a way to check what gets really executed by the ..
I'm declaring some strings that are empty, so it won't throw errors later on.
I've read that this was the proper way:
string Camnr = Klantnr = Ordernr = Bonnr = Volgnr = Omschrijving = Startdatum = ..
To be specific, I was trying this code:
package hello;
public class Hello {
Clock clock = new Clock();
public static void main(String args[]) {
clock.sayTime();
}
}
But it ga..
I'm trying to implement the Facebook's logout functionality in my project. Login works just fine. But I'm facing the getting the following message in JavaScript console with the logout code.
[Viol..
This is a really simple question, and it's probably a setting somewhere I don't know about, but Google is being particularly unhelpful for this question, giving results about compilation errors, not h..
Most of the time I'm not worried about it but I have an image carousel and if I click on the next and previous divs quickly, they will be highlighted in Chrome.
I tried using outline:none but no effe..
My page creates multiple buttons as id = 'rbutton_"+i+"'. Below is my code:
<button type='button' id = 'rbutton_"+i+"' onclick=disable(i);>Click me</button>
In Javascript
function disa..
I've written below code, but it only seems to insert the current date and not the current time. Anyone knows how to do that?
insert into errortable
(dateupdated,table1id)
values
(TO_DATE(sysdate, 'dd..
I have as input a string that is a URI. how is it possible to get the last path segment (that in my case is an id)?
This is my input URL:
String uri = "http://base_path/some_segment/id"
and..
I have installed React using create-react-app. It installed fine, but I am trying to load an image in one of my components (Header.js, file path: src/components/common/Header.js) but it's not loading...
I use echo and print_r much, and almost never use print.
I feel echo is a macro, and print_r is an alias of var_dump.
But that's not the standard way to explain the differences...
I got this code from a website which I have modified to my needs:
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>..
In the fiddle below, I've a transition on visibility and opacity separately. The latter works but the former doesn't. Moreover, in case of visibility, the transition time is interpreted as delay on ho..
I installed mySQL for my Mac. Beside starting the SQL server with mySQL.prefPane tool installed in System Preference, I want to know the instruction to start from command-line.
I do as follow:
After
..
I can't compile my code because of some errors.
Here some of them :
In function 'int main(int, char**)':
[Error] no matching function for call to 'deckOfCards::shuffle(deckOfCards&)'
[Note] c..
I am using jquery ui dialogs in my application.
How do I style the "Save" and "Cancel" buttons differently in a jquery dialog?
So "Save" is more appealing than the "Cancel".
I could use a hyper link f..
I have a strange problem.
I have an iPad with iOS 5.0.1 (9A405) and iOS SDK 5.0.1 with Xcode 4.2 (Build 4C199) installed on my Mac.
Xcode doesn't see my device. It says "iOS Device" not "Sauron's iP..
I am developing a character count for my textarea on this website. Right now, it says NaN because it seems to not find the length of how many characters are in the field, which at the beginning is 0, ..
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 ..
I am trying to update Xcode from the command line. Initially I tried running:
xcode-select --install
which resulted in this message:
xcode-select: error: command line tools are already installed..
I am using Entity Framework to populate a grid control. Sometimes when I make updates I get the following error:
Store update, insert, or delete statement affected an unexpected number of rows (0)..
I have the following code:
$project.PropertyGroup | Foreach-Object {
if($_.GetAttribute('Condition').Trim() -eq $propertyGroupConditionName.Trim()) {
$a = $project.RemoveChild($_);
..
How can I wait for a void async method to finish its job?
for example, I have a function like below:
async void LoadBlahBlah()
{
await blah();
...
}
now I want to make sure that everything..
I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or tell Apache to use another po..
How would I go about removing all of the child elements of a DOM node in JavaScript?
Say I have the following (ugly) HTML:
<p id="foo">
<span>hello</span>
<div>world&..
I'm running Wordpress with: Nginx + PHP-FPM + APC + W3 Total Cache + PageSpeed.
After 3 days researching and configuring, I succeeded to make it work.
I configured PHP-FPM to run via 127.0.0.1:9000. ..
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...
A strange error when trying to start Activity. i think the error in my Animation Drawable LogCat: 12-31 06:37:45.138: E/AndroidRuntime(922): FATAL EXCEPTION: main 12-31 06:37:45.138: E/Andr..
Is there a concise way to iterate over a stream whilst having access to the index in the stream?
String[] names = {"Sam","Pamela", "Dave", "Pascal", "Erik"};
List<String> nameList;
Stream<I..
I'm a programmer who knows Python, Ruby and some C who is trying to decide whether to learn GNU Octave or Matlab. I know that they have a lot in common, but it isn't clear to me how similar the syntax..
I'm looking for a way to do something analogous to the MySQL dump from SQL Server. I need to be able to pick the tables and export the schema and the data (or I can export the schema via SQL Server Ma..
I am trying to run a spark program where i have multiple jar files, if I had only one jar I am not able run. I want to add both the jar files which are in same location. I have tried the below but it ..
I want to initialize an array of Player objects for a BlackJack game. I've read a lot about various ways to initialize primitive objects like an array of ints or an array of strings but I cannot take ..
Question
What is the best practice for creating a favicon on a web site?
and is an .ico file with both 16x16 and 32x32 images better than a .png file with 16x16 only?
Could the right method preferre..
I'm trying to do a fetch from backbone.js to my node.js server. However, I get the following error in the console:
Origin http://localhost is not allowed by Access-Control-Allow-Origin.
I added the ..
Please take a look at the picture below.
When we create an object in java with the new keyword, we are getting a memory address from the OS.
When we write out.println(objName) we can see a "special" ..
What is the difference between Visual Studio Express 2013 for Windows and Visual Studio Express 2013 for Windows Desktop?
Do they both support the exactly the same things as Visual Studio Express 201..
I'm really having troubles with the Facebook hash key.
I generated it in my Eclipse.. proof:
Then I went to https://developers.facebook.com/ and registered a new app.
And finally I've set my hash..
I have sql something like this:
SELECT EMP_NAME, DEPT
FROM EMPLOYEE
WHERE TIME_CREATED >= TO_DATE('26/JAN/2011','dd/mon/yyyy')
-> This returns 10 rows and TIME_CREATED = '26-JAN-2011'
Now when ..
I'm trying to collect some of my default settings, and one thing I realized I don't have a standard for is .gitignore files. There's a great thread showing a good .gitignore for Visual Studio projects..
When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was create..
On a windows machine I get this error
'touch' is not recognized as an internal or external command, operable program or batch file.
when I follow the instructions to do:
touch index.html app.js..
Is there any way to theme an HTML table (CSS) with using the jQuery CSS themes?
All of my components look like they belong together except for my HTML table which looks different...
A REST API can have parameters in at least two ways:
As part of the URL-path (i.e. /api/resource/parametervalue )
As a query argument (i.e. /api/resource?parameter=value )
What is the best pract..
I have been looking for an answer and tried many things to this problem.
My script works fine on my webhost but when moving it to an other dedicated server the mail never gets delivered. Now i need t..
I'm having trouble displaying the only date part of a DateTime into a textbox using TextBoxFor<,>(expression, htmlAttributes).
The model is based on Linq2SQL, field is a DateTime on SQL and in the..
How can I do with XPath:
//bookstore/book/title or //bookstore/city/zipcode/title
Just //title won't work because I also have //bookstore/magazine/title
p.s. I saw a lot of or examples but mainly..
There is a laptop on which I have no root privilege.
onto the machine I have a library installed using configure --prefix=$HOME/.usr .
after that, I got these files in ~/.usr/lib :
libXX.so.16.0.0
lib..
Is it possible to define a range based on a value given in a cell.
So, for example:
My selection is A1:A5 That are five cells. is it possible to let excel determine this by setting a cell value (lik..
This seems like a trivial task, but I can't find an option to cleanly de-install the ADT from my Eclipse installation.
Of course, I could just delete the folder of the SDK, but this just throws errors..
I am trying to figure out if it is possible to pass a JSON object to rest API, Or pass a multiple parameters to that API ? And how to read these parameters in Spring ? Lets assume that the url looks l..
I am a bit confused about how to get the key and value of an object in angular2 while using *ngFor for iterating over the object. I know in angular 1.x there is a syntax like
ng-repeat="(key, value)..
If I have a non-scrolling header in an HTML page, fixed to the top, having a defined height:
Is there a way to use the URL anchor (the #fragment part) to have the browser scroll to a certain point in ..
I know that Python does not support method overloading, but I've run into a problem that I can't seem to solve in a nice Pythonic way.
I am making a game where a character needs to shoot a variety of..
I would like to fill a vector<int> using std::fill, but instead of one value, the vector should contain numbers in increasing order after.
I tried achieving this by iterating the third paramete..
Can I assign the opacity property to the background property of a div only and not to the text on it?
I've tried:
background: #CCC;
opacity: 0.6;
but this doesn't change the opacity...
I want to run python code on Ubuntu 14.04, but when I execute it, it gives me the following error message
Traceback (most recent call last):
File "main.py", line 2, in <module>
from tkint..
How can I save all cookies in Python's Selenium WebDriver to a .txt file, and then load them later?
The documentation doesn't say much of anything about the getCookies function...
I want to write a String to a Stream (a MemoryStream in this case) and read the bytes one by one.
stringAsStream = new MemoryStream();
UnicodeEncoding uniEncoding = new UnicodeEncoding();
String mes..
I am using plugin jQuery datatables and load my data which I have loaded in DOM at the bottom of page and initiates plugin in this way:
var myData = [
{
"id": 1,
"first_name": "Jo..
I am more of a PHP person, not JS - and I think my problem is more a syntax problem ..
I have a small jQuery to "validate" and check input value .
It works ok for single words, but I need array.
I ..
I currently try to make a movie out of images, but i could not find anything helpful .
Here is my code so far:
import time
from PIL import ImageGrab
x =0
while True:
try:
x+= 1
..
For some reason the item "description" returns NULL with the following code:
<?php
include('db.php');
$result = mysql_query('SELECT * FROM `staff` ORDER BY `id` DESC LIMIT 2') or die(mysql_error(..
Example: I have a $variable = "_foo", and I want to make absolutely sure that $variable does not start with an underscore "_". How can I do that in PHP? Is there some access to the char array behind t..
I'm currently running an ec2 micro instance and i've been finding that the instance occasionally runs out of memory.
Other than using a larger instance size, what else can be done?..
I would like to get the keys of a JavaScript object as an array, either in jQuery or pure JavaScript.
Is there a less verbose way than this?
var foo = { 'alpha' : 'puffin', 'beta' : 'beagle' };
var ..
I have a bunch of client point of sale (POS) systems that periodically send new sales data to one centralized database, which stores the data into one big database for report generation.
The client P..
I have to use StringBuilder instead of a List of strings because of being stuck with .NET 1.1 for this project.
I want to write a series of debug messages I've written to a file to study at my leisu..
SELECT ORDER_NUM, CUSTOMER_NUM, CUSTOMER_NAME, ADD_DAYS (ORDER_DATE, 20)
FROM CUSTOMER, ORDERS;
Oracle Express says ADD_DAYS invalid? Any ideas what Am I doing wrong?..
I have a dynamic SQL statement I've created in a stored procedure. I need to iterate over the results using a cursor. I'm having a hard time figuring out the right syntax. Here's what I'm doing.
SELE..
I'm trying to use sed to clean up lines of URLs to extract just the domain.
So from:
http://www.suepearson.co.uk/product/174/71/3816/
I want:
http://www.suepearson.co.uk/
(either with or withou..
I took a look at the "Beginner's Guide to LINQ" post here on StackOverflow (Beginners Guide to LINQ), but had a follow-up question:
We're about to ramp up a new project where nearly all of our databa..
If I had: ArrayList<Double> m = new ArrayList<Double>();
with the double values ??inside, how should I do to add up all the ArrayList elements?
public double incassoMargherita()
{
double..
I have an ipython/jupyter notebook that I visualize using NBviewer.
How can I hide all the code from the notebook rendered by NBviewer, so that only the output of code (e.g. plots and tables) and the..
In a Java method, I'd like to use a Jersey client object to do a POST operation on a RESTful web service (also written using Jersey) but am not sure how to use the client to send the values that will ..
So, in PHPDoc one can specify @var above the member variable declaration to hint at its type. Then an IDE, for ex. PHPEd, will know what type of object it's working with and will be able to provide a ..
I have a program that consists of a master server and distributed slave servers. The slave servers send status updates to the server, and if the server hasn't heard from a specific slave in a fixed pe..
I have the following:
var text = "Übergroße Äpfel mit Würmern";
I'm searching for a Javascript function to transform the text so that every special letter is represented by its HTML entity sequ..
We all know how to use <ctrl>-R to reverse search through history, but did you know you can use <ctrl>-S to forward search if you set stty stop ""? Also, have you ever tried running bind ..
How to query user information from Active Directory? I have code that works, but it's really slow. I'm using C#.
This is the code I currently use:
static void Main(string[] args)
{
S..
I have a backup of Database1 from a week ago. The backup is done weekly in the scheduler and I get a .bak file. Now I want to fiddle with some data so I need to restore it to a different database - Da..
I'm getting started with AWS Lambda and I'm trying to request an external service from my handler function. According to this answer, HTTP requests should work just fine, and I haven't found any docum..
One of the very tricky questions asked in an interview.
Swap the values of two variables like a=10 and b=15.
Generally to swap two variables values, we need 3rd variable like:
temp=a;
a=b;
b=temp;
..
I was trying to go to another page using button, but it always fail.
Here is my First Class with its XML:
public class FindPeopleFragment extends Fragment {
public FindPeopleFragment(){}
@..
I'm making a C program where I need to get the directory that the program is started from. This program is written for UNIX computers. I've been looking at opendir() and telldir(), but telldir() retu..
Before moving to PDO, I created SQL queries in PHP by concatenating strings. If I got database syntax error, I could just echo the final SQL query string, try it myself on the database, and tweak it u..
I'm trying to iterate through a group of files in a folder on my local machine and upload only ones where the file names contain "Service_Areas" to my FTP site using using this code (Python 3.6.1 32 b..
I understand the concept of what timeit does but I am not sure how to implement it in my code.
How can I compare two functions, say insertion_sort and tim_sort, with timeit?..
Is there any significant difference between the two python keywords continue and pass like in the examples
for element in some_list:
if not element:
pass
and
for element in some_list:
..
I have a dropdown list with several option, each option has a name attribute. When I select an option, a different list of checkboxes needs to appear - when another options is selected, that checkbox ..
I am trying to set the width and height of a view in code to show an ad for a free app I am working on. All of the UI is done in XML with the exception of this ad. Here is the code that displays the a..
I try to work with a project in vagrant.
I have made the command vagrant ssh, and connected to VM. Now I need to edit .bashrc file to set path to the source code. But first I couldn't find that file...
For some reason I convert a time format like: 03:30 to seconds 3*3600 + 30*60, now. I wanna convert it back to its first (same) format up there. How could that be?
My attempt:
3*3600 + 30*60 = 12600..
I would like to convert a string array to a single string.
string[] test = new string[2];
test[0] = "Hello ";
test[1] = "World!";
I would like to have something like "Hello World!"..
I need to get the number of milliseconds from 1970-01-01 UTC until now UTC in Java.
I would also like to be able to get the number of milliseconds from 1970-01-01 UTC to any other UTC date time...
I want to deny direct access to all .php files except one: index.php
The only access to the other .php files should be through php include.
If possible I want all files in the same folder.
UPDATE:
..
I'm trying to to mix mvc and rest in a single spring boot project.
I want to set base path for all rest controllers (eg. example.com/api)
in a single place (I don't want annotate each controller with ..
I'm teaching myself some basic scraping and I've found that sometimes the URL's that I feed into my code return 404, which gums up all the rest of my code.
So I need a test at the top of the code to ..
Dim wkbkdestination As Workbook
Dim destsheet As Worksheet
For Each ThisWorkSheet In wkbkorigin.Worksheets
'this throws subscript out of range if there is not a sheet in the destination
'wo..
This I thought would be easy. I have not used VB.NET all that much, and I am trying to open up a form from a button click. The form will not show and I get a null exception error.
What is wrong with ..
I have a large bitmap (say 3888x2592) in a file. Now, I want to resize that bitmap to 800x533 and save it to another file.
I normally would scale the bitmap by calling Bitmap.createBitmap method but i..
I have two separate docker-compose.yml files in two different folders:
~/front/docker-compose.yml
~/api/docker-compose.yml
How can I make sure that a container in front can send requests to a cont..
How can I convert seconds to HH:mm:ss?
At the moment I am using the function below
render: function (data){
return new Date(data*1000).toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");;
..
In Swift, I am trying to create an array of 64 SKSpriteNode. I want first to initialize it empty, then I would put Sprites in the first 16 cells, and the last 16 cells (simulating an chess game).
Fro..
I'm interested in sorting a list from a stream. This is the code I'm using:
list.stream()
.sorted((o1, o2)->o1.getItem().getValue().compareTo(o2.getItem().getValue()))
.collect(Collectors...
I am adding a new migration but this message shows:
Unable to generate an explicit migration because the following
explicit migrations are pending: [201203170856167_left]. Apply the
pending ex..
I want to make height of textarea equal to height of the text within it (And remove the scroll bar)
HTML
<textarea id="note">SOME TEXT</textarea>
CSS
textarea#note {
width:100%;
..
Python pandas has a pct_change function which I use to calculate the returns for stock prices in a dataframe:
ndf['Return']= ndf['TypicalPrice'].pct_change()
I am using the following code to get lo..
Why does moment.js UTC always show the wrong date. For example from chrome's developer console:
moment(('07-18-2013')).utc().format("YYYY-MM-DD").toString()
// or
moment.utc(new Date('07-18-2013')).f..
Possible Duplicate:
Length of Javascript Object (ie. Associative Array)
I have an object similar to this one:
var jsonArray = {
'-1': {
'-1': 'b',
'2': 'a',
'10': 'c'
},
..
I'm trying to filter a table in Django based on the value of a particular field of a ForeignKey.
For example, I have two models:
class Asset(models.Model):
name = models.TextField(max_length=150..
In my application I generate files at random opportunities. To ensure a unique naming, I tried to use the nano seconds since 1.1.1970:
long time = DateTime.Now.Ticks;
String fileName = Convert.ToStri..
What is the simplest way to read a full line in a C console program
The text entered might have a variable length and we can't make any assumption about its content...
I have Windows 7, 64-bit.
I'm trying to register a .dll (comdlg32.dll) using regsvr32. But I get an error that says the dll is read but the DLLRegistryServer entry point is not found.
I have run the..
I have a use case where I need to call a (non-static) method in the bean only-once at the ApplicationContext load up. Is it ok, if I use MethodInvokingFactoryBean for this? Or we have a some better so..
I am debugging with breakpoints and I realize the assert call? I thought it was only for unit tests. What does it do more than breakpoint? Since I can breakpoint, why should I use Assert?..
I have a column that looks something like this:
CASE
WHEN col1 > col2 THEN SUM(col3*col4)
ELSE 0
END AS some_product
And I would like to put it in my GROUP BY clause, but this seems to c..
When I run my (C++) program it crashes with this error.
* glibc detected * ./load: double free or corruption (!prev):
0x0000000000c6ed50 ***
How can I track down the error?
I tried using prin..
My google spreadsheet is using GOOGLEFINANCE('symbol','price) function to retrieve stock prices of my portfolio. Unfortunately, I have to refresh manually now. How can I make the spreadsheet refresh i..
Right now when I use ?+O to search for files, the fuzzy matching appears to operate over all files in the current project. Unfortunately, this includes a number of files from build and vendor director..
I am trying to save a csv to a folder after making some edits to the file.
Every time I use pd.to_csv('C:/Path of file.csv') the csv file has a separate column of indexes. I want to avoid printing t..
I have a basic form for which I want to handle buttons inside the form by calling the ActionResult method in the View's associated Controller class. Here is the following HTML5 code for the form:
<..
I'm generating plots for some data, but the number of ticks is too small, I need more precision on the reading.
Is there some way to increase the number of axis ticks in ggplot2?
I know I can tell g..
I am getting a Apple Mach-O Linker Error everytime I import a file from CocoaPods.
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FBSession", referenced from: someFile
ld: symbol(s) not f..
How to disable past dates from the current date on a datetimepicker? I tried few posts for similar question but was unable to achieve it, Below is what I tried
<link href="http://netdna.bootstrapc..
I'm using an MVC 4 web API and asp.net web forms 4.0 to build a rest API. It's working great:
[HttpGet]
public HttpResponseMessage Me(string hash)
{
HttpResponseMessage httpResponseMessage;
L..
I try to add margin values on a div inside another div. All works fine except the top value, it seems to be ignored. But why?
What I expected:
What I get:
Code:
_x000D_
_x000D_
#outer {_x000D_
..
I am working in a JSP project. While runnning the project using Netbeans with Tomcat 6 server, I got the following exception,
org.apache.jasper.JasperException: Unable to compile class for JSP:
An ..
Exact duplicate of many posts:
What is unit testing?
What Makes a Good Unit Test?
New to Unit Testing
Unit Testing - definitions
Learning Unit Testing
How to properly mock and unit test
Unit Te..
I have the code below:
List<string> aa = (from char c in source
select new { Data = c.ToString() }).ToList();
But what about
List<string> aa = (from char c1 in sour..
How can one get the name of the class from a static method in that class. For example
public class MyClass {
public static String getClassName() {
String name = ????; // what goes here so..
This question is identical to How to shut down Android emulator via command line.
However, after attempting the suggested solution from the first answer adb emu kill has not proven successful for me...
It looks like we can use the following in a RadioButton:
android:button="@drawable/myCustomStateBackground"
but that drawable only occupies the spot where the radio drawable would normally go. Idea..
How can I inject values into a Map from the properties file using the @Value annotation in Spring?
My Spring Java class is and I tried using the $, but got the following error message:
Could not auto..