I am new to angular and looking to format date in component ngOnInit method. I have seen some example where pipe operator are used to format the data but i dont know how to format date in component fi..
I want to get current date but time should be 00:00:00.000
I've try this:
var m = moment();
m.set({hour:0,minute:0,second:0,millisecond:0});
console.log(m.toISOString());
but I've got: 2016-01-12T..
When I try to login I get an error:
SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
parametrs.yml:
This file is auto-generated during the composer install
pa..
I have 3 machines:
server where the file is located
server where REST service is running ( Jersey)
client(browser) with access to 2nd server but no access to 1st server
How can I directly (withou..
Update II
It's now July 16th, 2015 and things have changed again. I've
discovered this automagical container from Jason Wilder:
https://github.com/jwilder/nginx-proxy and it solves
this prob..
I tried to install Scrapy for Python 2.7.8 (anaconda 2.1.0) 32-bit using
pip install scrapy
And I got this error
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
I..
What exactly is the difference between Apache's Mesos and Google's Kubernetes?
I understand both are server cluster management software. Can anyone elaborate where the main differences are - when woul..
I am using jspdf.debug.js to export different data from a website but there are a few problems, I can't get it to render the CSS in the exported PDF and if I have an image in the page I am exporting, ..
I am trying to install lxml to install scrapy on my Mac (v 10.9.4)
[email protected] ~
?-? pip install lxml
Downloading/unpacking lxml
Downloading lxml-3.4.0.tar.gz (3.5MB):..
I installed Spark using the AWS EC2 guide and I can launch the program fine using the bin/pyspark script to get to the spark prompt and can also do the Quick Start quide successfully.
However, I cann..
I'm moving my web application to another server and in the next few days I'll refresh the DNS to point to the new IP location.
Unfortunately some browsers and SOs keep a DNS cache that will make user..
Just upgraded an ASP.NET MVC4 project to use Unity.WebApi version 5.0.0.0 and it requires System.Web.Http v 5.0.0.0 as per the following error:
Assembly 'Unity.WebApi, Version=5.1.0.0, Culture=neutral..
Why python 2.7 doesn't include Z character (Zulu or zero offset) at the end of UTC datetime object's isoformat string unlike JavaScript?
>>> datetime.datetime.utcnow().isoformat()
'2013-10-2..
I have a drop down list that fetches values from db as follows
$.get('/getJobs', function (jobs) {
seljobs = jobs;
var i = 0;
jobs.forEach(function (n) {
..
I am trying my hands on developing a simple android application in which I am trying to use sqlcipher, which uses .so libraries internally. I have read the documentation on how to use sqlcipher with a..
I referred to this before asking this question.
AngularJs doesn't bind ng-checked with ng-model
If ng-checked is evaluated to true on the html side, the ng-model is not updated. I can't ng-repea..
I tried to create my DB with Symfony2 typing the command below:
php app/console doctrine:create:database
The result is:
Could not create database for connection named jobeet
SQLSTATE[280..
I have an ArrayList which stores Dates and I sorted them in descending order. Now I want to display them in a ListView. This is what I did so far:
spndata.setOnItemSelectedListener(new OnItemSelecte..
I have a small web application. Which was working fine until I added two genericHandler in my application.
I have made the following changes for the http handler
<system.web>
<authent..
I am trying to convert Twitter datetime to a local iso-string (for prettyDate) now for 2 days. I'm just not getting the local time right..
im using the following function:
function getLocalISOTime(t..
This figure again shows that every object has a prototype. Constructor
function Foo also has its own __proto__ which is Function.prototype,
and which in turn also references via its __proto__ p..
Hi I am having problems with some css classes in joomla. I have two divs in a module, one is the wrapper class="wrapper", the other is the content class="content" . Content is inside wrapper. What I a..
Is there a way to determine if a string has a space(s) in it?
sossjjs sskkk should return true, and sskskjsk should return false.
"sssss".Trim().Length does not seem to work...
One of the things that used to perplex me as a newby to R was how to format a number as a percentage for printing.
For example, display 0.12345 as 12.345%. I have a number of workarounds for this, b..
I want to know how and when can I use the exit() function like the program in my book:
#include<stdio.h>
void main()
{
int goals;
printf("enter number of goals scored");
scanf("%d"..
What tricks do people use to manage the available memory of an interactive R session? I use the functions below [based on postings by Petr Pikal and David Hinds to the r-help list in 2004] to list (a..
I have about 10million values that I need to put in some type of look up table, so I was wondering which would be more efficient a list or dict?
I know you can do something like this for both:
if so..
I'm trying to style a TabControl and have got 75% of the way there, but I'm having difficulty styling the actual TabItems:
What I am trying to achieve is remove the default ContentPresenter so that..
Before, in an older version of express, I could do this:
express.createServer({key:'keyFile', cert:'certFile'});
However, in newer versions of express this no longer works:
var app = express();
..
How can I pass an array as parameter to a bash function?
Note: After not finding an answer here on Stack Overflow, I posted my somewhat crude solution myself. It allows for only one array being passed..
How do I get access to the parent controls of user control in C# (winform). I am using the following code but it is not applicable on all types controls such as ListBox.
Control[] Co = this.TopLevelC..
I'm new to Python and I have a simple question, say I have a list of items:
['apple','red','apple','red','red','pear']
Whats the simpliest way to add the list items to a dictionary and count how ma..
I am using Android Navigation bar in my project,
I want to change the top color in action bar to something red, How can i do that?
I have something like this,
and i want something like this,
how can..
I have a start calendar input box and an end calendar input box. We want defaults start calendar input box 30 days prior to current date and the end calendar input box to be the current date. Here is ..
I have a string in Bash:
string="My string"
How can I test if it contains another string?
if [ $string ?? 'foo' ]; then
echo "It's there!"
fi
Where ?? is my unknown operator. D..
Is there a command I can run to get the container's IP address right from the host after a new container is created?
Basically, once Docker creates the container, I want to roll my own code deploymen..
There is an option to write a script and bind it to a trigger. The question is, how to get the current time in the script body?
function myFunction() {
var currentTime = // <<???
}
..
I have the following XML file, the file is rather large and i haven't been able to get simplexml to open and read the file so i'm trying XMLReader with no success in php
<?xml version="1.0" encodi..
I'm building a process in Java using ProcessBuilder as follows:
ProcessBuilder pb = new ProcessBuilder()
.command("somecommand", "arg1", "arg2")
.redirectErrorStream(true);
Process p ..
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..
What does InitializeComponent() do, and how does it work in WPF?
In general first, but I would especially be interested to know the gory details of order of construction, and what happens when there ..
Does a Java Set retain order? A method is returning a Set to me and supposedly the data is ordered but iterating over the Set, the data is unordered. Is there a better way to manage this? Does the m..
I am trying to use SLF4J (with log4j binding) for the first time.
I would like to configure 3 different named Loggers that can be returned by a LoggerFactory which will log different levels and push ..
In my cms I have a checkbox group for categories. I would like to have a text input below that where the user can input the name of a new category and it will dynamically add a new checkbox with the p..
In MS SQL Server is there a way to detect whether a database has had its isolation level set via the T-SQL command ALTER DATABASE <database> SET READ_COMMITTED_SNAPSHOT ON;
I cannot find a simp..
Using normal C arrays I'd do something like that:
void do_something(int el, int **arr)
{
*arr[0] = el;
// do something else
}
Now, I want to replace standard array with vector, and achieve th..
I would like to get the name of a variable or parameter:
For example if I have:
var myInput = "input";
var nameOfVar = GETNAME(myInput); // ==> nameOfVar should be = myInput
void testName([Typ..
I need to execute a large set of SQL statements (creating a bunch of tables, views and stored procedures) from within a C# program.
These statements need to be separated by GO statements, but SqlComm..
I am trying to install wampserver on a win7-32bit. The installation goes smoothly but the icon doesn't turn green. It stays orange saying "Server online". I've trying different solutions nothing worke..
There is a --user option for pip which can install a Python package per user:
pip install --user [python-package-name]
I used this option to install a package on a server for which I do not have ro..
Given an XML structure like so:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
<title lang="eng">Harry Potter</title>
<price>29.99</price&..
I have this Python application that gets stuck from time to time and I can't find out where.
Is there any way to signal Python interpreter to show you the exact code that's running?
Some kind of on..
I need to create SearchView from my arrayList<String> and show the suggestions in the drop-down list same this
I look for tutorials that explain step by step how to build a SearchView in a ..
I have a script where I launch with popen a shell command.
The problem is that the script doesn't wait until that popen command is finished and go continues right away.
om_points = os.popen(command, ..
I have a working query that is grouping data by hardware model and a result, but the problem is there are many "results". I have tried to reduce that down to "if result = 0 then keep as 0, else set ..
I have two divs side by side. I'd like the height of them to be the same, and stay the same if one of them resizes. I can't figure this one out though. Ideas?
To clarify my confusing question, I'd li..
What's the react way of setting focus on a particular text field after the component is rendered?
Documentation seems to suggest using refs, e.g:
Set ref="nameInput" on my input field in the render ..
I have a JSON object with the following content:
[
{
"_id":"5078c3a803ff4197dc81fbfb",
"email":"[email protected]",
"image":"some_image_url",
"name":"Name 1"
},
{
"_id":"5078c..
I've been smashing my head against a brick wall with this one, i've tried loads of the solutions on stackoverflow but can't find one that works!
Basically when I POST my AJAX the PHP returns JSON bu..
What is the most efficient and elegant SQL query looking for a string containing the words "David", "Moses" and "Robi". Assume the table is named T and the column C...
Why are x and y strings instead of ints in the below code?
(Note: in Python 2.x use raw_input(). In Python 3.x use input(). raw_input() was renamed to input() in Python 3.x)
play = True
while play:..
I am trying to install a specific version of a package using Composer. I tried composer install and composer require but they are installing the latest version of the package. What if I want an older ..
Say you have a javascript object like this:
var data = { foo: 'bar', baz: 'quux' };
You can access the properties by the property name:
var foo = data.foo;
var baz = data["baz"];
But is it possi..
I want to use PowerShell to transfer files with FTP to an anonymous FTP server. I would not use any extra packages. How?
There must be no risk that the script hangs or crashes...
I have two questions, actaully...
First off, Why cant I do this:
List<Object> object = new List<Object>();
And second, I have a method that returns a List<?>, how would I turn tha..
How can I add a field for the count of objects in a database. I have the following models:
class Item(models.Model):
name = models.CharField()
class Contest(models.Model);
name = models.Char..
I'm having trouble displaying the contents of a table which contains nested tables (n-deep). I'd like to just dump it to std out or the console via a print statement or something quick and dirty but I..
I want to install Visual Studio Ultimate 2013 on my Windows 10 but I have this error:
I have done these two things (they have solved the problem on Windows 8)
but still I cannot install it. ..
In R, I'd like to retrieve a list of global variables at the end of my script and iterate over them. Here is my code
#declare a few sample variables
a<-10
b<-"Hello world"
c<-data.frame()
#..
I have an EditText view in android. On this I want to detect swipe left or right. I am able to get it on an empty space using the code below. But this does not work when I swipe on an EditText. How do..
I have a data frame (df) and I was wondering how to return the row number(s) for a particular value (2585) in the 4th column (height_chad1) of the same data frame?
I've tried:
row(mydata_2$height_..
For the following block of code:
For I = 0 To listOfStrings.Count - 1
If myString.Contains(lstOfStrings.Item(I)) Then
Return True
End If
Next
Return False
The output is:
Case 1:
m..
I'm running my code and getting this error. But what does it mean?
The network path was not found Description: An unhandled exception
occurred during the execution of the current web request. P..
I need to delete an exact line from a text file but I cannot for the life of me workout how to go about doing this.
Any suggestions or examples would be greatly appreciated?
Related Questions
Effic..
I would like to add icon/image in UITextField. The icon/image should be left to placeholder.
I tried this:
var imageView = UIImageView();
var image = UIImage(named: "email.png");
imageView.image =..
I've installed the latest RabbitMQ server (rabbitmq-server-3.3.0-1.noarch.rpm) on a fresh Centos 5.10 VM according to the instructions on the official site.
I've done this many times before during de..
I want to delete a branch both locally and remotely.
Failed Attempts to Delete a Remote Branch
$ git branch -d remotes/origin/bugfix
error: branch 'remotes/origin/bugfix' not found.
$ git branch -d o..
Until Office 2007, Excel has a maximum of 65,000 rows. Office 2007 bumped that up to a max of 1 million rows, which is nicer of course; but I'm curious -- why is there a limit at all? Obviously, perfo..
I just can't set the height and width of a elements of my navigation.
#header div#snav div a{
width:150px;
height:77px;
}
#header div#snav div a:link{
width:150px;
height:77px;
}
#..
I am having an issue with JSON, I can't seem to figure out why this is not working. This is supposed to output JSON.
Here is my code
#!/usr/bin/env python
import socket
import struct
import json
d..
I want to find the foreign keys of a table but there may be more than one user / schema with a table with the same name. How can I find the one that the currently logged user is seeing? Is there a fun..
Is this possible at all?
I tried adding this to the page but it didn't change a thing.
<meta http-equiv="X-UA-Compatible" content="IE=8">
UPDATE- I'm trying to do this because our site has so..
I'm using a library that has a dependency on JSF.
When I try to run my project, it show following exception massage..
java.util.MissingResourceException: Can't find bundle for base name /Bundle, lo..
The error message :
"The model backing the 'AddressBook' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an ID..
How can I do this fast?
Sure I can do this:
static bool ByteArrayCompare(byte[] a1, byte[] a2)
{
if (a1.Length != a2.Length)
return false;
for (int i=0; i<a1.Length; i++)
..
I have a design that implements a dark blue UITextField, as the placeholder text is by default a dark grey colour I can barely make out what the place holder text says.
I've googled the problem of co..
I'm wondering what options one has in xhtml 1.0 strict to create a line on both sides of text like-so:
Section one
----------------------- Next section -----------------------
Section two
I've tho..
Is it possible to get the category name of a category given the Post ID, the following code works to get the Category Id, but how can I get the name?
<?php $post_categories = wp_get_post_categorie..
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 am trying to use the Bootstrap tooltip in an app of mine. My app is using AngularJS Currently, I have the following:
<button type="button" class="btn btn-default"
data-toggle="tooltip" ..
In the example below I have two datasets (Z and A). I want to merge or combine these sets by the ILMN numbers. If there is no match, fill in NA.
z <- matrix(c(0,0,1,1,0,0,1,1,0,0,0,0,1,0,1,1,0,1,..
I get this error when I try to do anything with Java in command prompt:
Error opening registry key 'Software\JavaSoft\Java Runtime Environment.3'
Error: could not find Java.dll
Error: could not find ..
In IIS 6.0, is there an easy way to re-direct requests to a folder to another folder, while preserving the rest of the path.
e.g.
If I have moved the content from:
mysite.org.uk/stuff
to
stuff.mysit..
I am attempting to create a div in a container within a container which is scrollable with up and down arrows in jQuery.
The only thing I can find which I wish to use was
http://www.dynamicdrive.com/..
I'd like to git clone the contents of a repository I have on GitHub. When I git clone (git@github:me/name.git...) I get a folder called name/ and inside name I have my contents... How do I get JUST th..
How do I access my IP Camera stream?
Code for displaying a standard webcam stream is
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while(True):
ret, frame = cap.read()
cv2.imshow('..
This is going to sound really stupid, but I cannot figure out why I am getting this error.
I have created a selection box, named "query_age" in my html form:
<form method="get" action="user_list...
Which am I better off doing? .hide() is quicker than writing out .css("display", "none"), but what’s the difference and what are both of them actually doing to the HTML element?..
I want to redirect from one page to another page in ASP.NET MVC 3.0 using JavaScript/jQuery/Ajax. On button click event I have written JavaScript code like below.
function foo(id)
{
$.post('/Bran..
I'm trying to make a "bubble" that can popup when the onmouseover event is fired and will stay open as long as the mouse is over the item that threw the onmouseover event OR if the mouse is moved into..
if I have a JSON object say:
var myObj = {'test' : {'key1' : 'value', 'key2': 'value'}}
can I remove 'key1' so it becomes:
{'test' : {'key2': 'value'}}
..
In a python script I am writing, I am trying to log events using the logging module. I have the following code to configure my logger:
ERROR_FORMAT = "%(levelname)s at %(asctime)s in %(funcName)s in ..
I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from.
How do I retrieve a module's path in python?..
I have created an application with android studio, never change a single word in any file.
when trying to run it on the emulator I got the following error:
W/EGL_emulation? eglSurfaceAttrib not imp..
I have a problem: I need to delete a column from my SQLite database. I wrote this query
alter table table_name drop column column_name
but it does not work. Please help me...
What would a PowerShell script be to return versions of the .NET Framework on a machine?
My first guess is something involving WMI. Is there something better?
It should be a one-liner to return only..
How does one change the font size for all elements (ticks, labels, title) on a matplotlib plot?
I know how to change the tick label sizes, this is done with:
import matplotlib
matplotlib.rc('xtick'..
I have a problem putting the content of pwd command into a shell variable that I'll use later.
Here is my shell code (the loop doesn't stop):
#!/bin/bash
pwd= `pwd`
until [ $pwd = "/" ]
do
..
I don't really get the idea behind how this whole thing works really, so if I have some class A that need the context of a class B which extends Activity, how do i get that context?
I'm searching for..
I am writing a login for a forum, and need to hash the password client side in javascript before sending it on to the server. I'm having trouble figuring out which SHA-256 implementation I can actuall..
How do you make JS think that a string is JSON ?
I have a function which only works if JSON object is passed to it. If I pass a string to it, with same format as JSON, it doesn't work. So I want to m..
I was wondering, is there a way to put text into an input field?
What i've got now is a placeholder, but that's actually an empty inputfield. So that's not what i'm looking for.
I'm looking for an (ki..
The best way to remove duplicate values (NSString) from NSMutableArray in Objective-C?
Is this the easiest and right way to do it?
uniquearray = [[NSSet setWithArray:yourarray] allObjects];
..
I'd like to know if it is possible to extract a single file or diff of a file from a git stash without popping the stash changeset off.
Might anyone be able to provide some suggestions/ideas about th..
I want to replace one context method with Environment variable.
But not sure if they mean the same.
What is the difference between
getFilesDir() and Environment.getDataDirectory() ?
How can I get d..
I have been driving myself mad with this for a day, searched high and low, and am probably trying to be too cute so am totally stuck.
I am trying to run a simple if then
If a cell contains "%" I'd l..
I have an int array and I need to find the number of elements in it. I know it has something to do with sizeof but I'm not sure how to use it exactly...
I want to know the current page position of the ViewPager. I create an adapter and set this adapter to the ViewPager. Now I want to know the current page number or position of the current view, becaus..
I'm using Angular 4 and I am getting an error in the console:
Can't bind to 'ngModel' since it isn't a known property of 'input'
How can I resolve this?..
I have a simple query:
SELECT u_name AS user_name FROM users WHERE user_name = "john";
I get Unknown Column 'user_name' in where clause. Can I not refer to 'user_name' in other parts of the statem..
I have a PowerShell script that monitors an image folder. I need to find a way to automatically run this script after the computer starts.
I already tried the following methods, but I couldn't get it..
Possible Duplicate:
jQuery - Check if element is visible after scroling
I'm trying to determine if an element is visible on screen. In order to to this, I'm trying to find the element's ver..
I want to use multiple private keys to connect to different servers or different portions of the same server (my uses are system administration of server, administration of Git, and normal Git usage w..
I am running a node application on terminal. Have recently upgraded to node v8.5.0, but am getting this error:
Error: The module '/tidee/tidee-au/packages/tidee-au-server/node_modules/bcrypt/lib/bind..
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..
This is probably really easy, but I've never done it before. How do you change your cursor to the finger (like for clicking on links) instead of the regular pointer?
And how to do this with jQuery si..
I'm using Webpack in my application, in which I create two entry points - bundle.js for all my JavaScript files/codes, and vendors.js for all libraries like jQuery and React. What do I do in order to ..
I'm new to android with almost no knowledge about Java and XML.
I'm learning it through pdfs that i'm getting on net.
I have learnt about Toast, a bit about Intents but me not able to understand anyth..
I'm trying to figure out a decent solution (especially from the SEO side) for embedding fonts in web pages. So far I have seen the W3C solution, which doesn't even work on Firefox, and this pretty coo..
I have a function that sums a column of data in an html table. It does so admirably only I would like to have it put the commas in there that are needed to separate the thousands. Initially, you'll no..
I used the code below in order to fulfill this target:
When mouse hover on the anchor, the underline comes out,
but it failed to work,
<a class="hover">click</a>
a .hover :hove..
I want to convert a string into a double and after doing some math on it, convert it back to a string.
How do I do this in Objective-C?
Is there a way to round a double to the nearest integer too?..
Is there a simple way to time the execution of a command in PowerShell, like the 'time' command in Linux?
I came up with this:
$s=Get-Date; .\do_something.ps1 ; $e=Get-Date; ($e - $s).TotalSeconds
..
I am using
Window w = getWindow();
w.setTitle("My title");
to change title of my current Activity but it does not seem to work.
Can anyone guide me on how to change this?..
Can we pass a reference of a variable that is immutable as argument in a function?
Example:
var x = 0;
function a(x)
{
x++;
}
a(x);
alert(x); //Here I want to have 1 instead of 0
..
How do you convert a number to a string showing dollars and cents?
eg:
123.45 => '$123.45'
123.456 => '$123.46'
123 => '$123.00'
.13 => '$0.13'
.1 => '$0.10'
0 ..
I generate normal links like: <a href="/path/to/image"><img src="/path/to/image" /></a> in a web app.
When I click on the link, it displays the picture in a new page. If you want to..
How do you round a float to 2 decimal places in JRuby(1.6.x)?
number = 1.1164
number.round(2)
# The above shows the following error
# wrong number of arguments (1 for 0)
..
I create new ASP.NET web application that use SMTP to send message. The problem is the smtp was not authenticated from who send the message.
How can I make SMTP authenticated in my program? does C..
I am building an Android Application. I've noticed that I am creating many repetitions of code similar to this in each of my classes:
Button buttonX = (Button)findViewById(R.id.buttonXName);
// Regis..
What are the list of statements that need to be committed before further action on the table in order to avoid a lock? I am not talking about full transactions with multiple statements and transaction..
I have installed Android Studio version 1.0.1. I have imported my projects from eclipse and it works fine.
Then I deleted a module and reimported it into my Android Studio project. The gradle build sa..
I'm new to programming. I have created a basic form inside views/register.blade.php like this
@section('content')
<h1>Registration Form</h1><hr>
<h3>Ple..
I would like to get a list of files with a specific extension in a directory. In the API (Java 6), I see a method File.listFiles(FileFilter) which would do this.
Since I need a specific extension, I ..
I have to set a class name on a (li) element.
This script find all the (a) elements in the list, and creates a click event.
jQuery("#" + ElementID).find(TagName).click(function () {
GetPageByUrl..
When working with PDFs, I've run across the MIME types application/pdf and application/x-pdf among others.
Is there a difference between these two types, and if so what is it? Is one preferred over ..
I am in the process of setting up CruiseControl.NET. The problem I am having is that I am running CC as a console application and when my build completes successfully and executes (using exec) it laun..
The useEffect React hook will run the passed in function on every change. This can be optimized to let it call only when the desired properties change.
What if I want to call an initialization functi..
Javascript 1.9.3 / ECMAScript 5 introduces Object.create, which Douglas Crockford amongst others has been advocating for a long time. How do I replace new in the code below with Object.create?
var Us..
Let's say I receive an object literal with 15+ objects and I need to display them in a nice layout (not all in a row), what is the most efficient method for controlling when the line should break/page..
I have a column in python pandas DataFrame that has boolean True/False values, but for further calculations I need 1/0 representation. Is there a quick pandas/numpy way to do that?..
I am plotting a graph with a categorical variable on the x axis and a numerical variable on the y axis.
For the x axis, given that there are many data points, the default text formatting causes the l..
We use GSLB for geo-distribution and load-balancing. Each service is assigned a fixed domain name. Through some DNS magic, the domain name is resolved into an IP that's closest to the server with leas..
How can I pass a Javascript Array via JQuery Post so that all its contents are accessible via the PHP $_POST array?
Please show an example of code that would do the trick.
Thanks!..
I am finding a textbox by its ID. I need to get the content which is already there inside the text box. For that I am using the gettext() method, but it is returning the ID value.
The content in the t..
As commonly known, any npm module can be installed by running a simple command: npm install <module_name>.
I have installed a few modules that I do not use any more and I just want to get them o..
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..
Using C# I was trying to develop the following two. The way I am doing it may have some problem and need your kind advice. In addition, I dont know whether there is any existing method to do the same...
How can I get the int value from a string such as 423e - i.e. a string that contains a number but also maybe a letter?
Integer.parseInt() fails since the string must be entirely a number...
I need to write a script that starts my program with different arguments, but I'm new to Bash. I start my program with:
./MyProgram.exe Data/data1.txt [Logs/data1_Log.txt].
Here is the pseudocode fo..
As part of a VBA program, I have to set the background colors of certain cells to green, yellow or red, based on their values (basically a health monitor where green is okay, yellow is borderline and ..
When I want to find the last used cell value, I use:
Dim LastRow As Long
LastRow = Range("E4:E48").End(xlDown).Row
Debug.Print LastRow
I'm getting the wrong output when I put a single ele..
I have a link:
<ul id="titleee" class="gallery">
<li>
<a href="#inline" rel="prettyPhoto">Talent</a>
</li>
</ul>
and I am trying to trigger it by using:
..
How do I add a simple check before adding a column to a table for an oracle db? I've included the SQL that I'm using to add the column.
ALTER TABLE db.tablename
ADD columnname NVARCHAR2(30);
..
I am testing a website in IE11. It has mixed content (http and https). In previous versions, there is a prompt which asks which we should allow the content with security certificate error. However no ..
I have developed a User Control in Visual Studio (WinForms C#) and have a question.
I need the user of my User Control to be able to change certain string values and I would like them to be able to a..
Using Eclipse IDE. I need to store my application's name and version as they are used by the app itself. I could hard-code them as static final fields somewhere in the codebase. A better solution I k..
I want to sort a data.frame by multiple columns. For example, with the data.frame below I would like to sort by column z (descending) then by column b (ascending):
dd <- data.frame(b = factor(c("..
I need to take the date value from jquery datepicker turn it into string format "MM/dd/yyyy" so it can do the right ajax post. When the page loads or upon changing the datepicker, a jquery ajax call i..
In a bash script I got from another programmer, some lines exceeded 80 columns in length. What is the character or thing to be added to the line in order to indicate that the line continues on the nex..
I have a mobile website and it has some HTML input elements in it, like this:
<input type="text" name="txtAccessoryCost" size="6" />
I have embedded the site into a WebView for possible Andro..
I want if the input 'Contract type' is empty, the button 'Save' is not clickable
Save button:
<div class="col-md-4">
<cic-textbox [control]="formGroup.get('contractType')"></..
Is it possible, using Python, to merge separate PDF files?
Assuming so, I need to extend this a little further. I am hoping to loop through folders in a directory and repeat this procedure.
And..
When I convert a factor to a numeric or integer, I get the underlying level codes, not the values as numbers.
f <- factor(sample(runif(5), 20, replace = TRUE))
## [1] 0.0248644019011408 0.0248644..
I would like to change this Makefile:
SHELL := /bin/bash
PATH := node_modules/.bin:$(PATH)
boot:
@supervisor \
--harmony \
--watch etc,lib \
--extensions..
I have a class defined as follows:
public class Person {
private String name;
// constructor and getter/setter omitted
}
I tried to print an instance of my class:
System.out.println(myPerson)..
I'm trying to build a new Docker image for our development process, using cpanm to install a bunch of Perl modules as a base image for various projects.
While developing the Dockerfile, cpanm returns..
I'm having the following issue when trying to update my entity:
"A collection with cascade=”all-delete-orphan” was no longer referenced by the owning entity instance".
I have a parent entity an..
I set up and configured a multi-node Hadoop cluster using this tutorial.
When I type in the start-all.sh command, it shows all the processes initializing properly as follows:
starting namenode, logg..
I am trying to create a directory with the following code:
Dir.mkdir("/Users/Luigi/Desktop/Survey_Final/Archived/Survey/test")
unless File.exists?("/Users/Luigi/Desktop/Survey_Final/Archived/Surv..
If I have a list of users say ["Sam", "Bob", "Joe"], I want to do something where I can output in my jinja template file:
{% for user in userlist %}
<a href="/profile/{{ user }}/">{{ user }..
I have tried to write the console output to a txt file using this code suggestion (http://www.daniweb.com/forums/thread23883.html#) however I was not successful. What's wrong?
try {
//create a ..
I have a SQL query like this;
SELECT *
FROM Jira.customfieldvalue
WHERE CUSTOMFIELD = 12534
AND ISSUE = 19602
And that's the results;
What I want is; showing in one row (cell) combined all STRI..
I have table containing one datetime column. I need to return rows for only last 6 months. This can be done by
where datetime_column > DATEADD(m, -6, current_timestamp)
But how to extend this o..
This is pretty basic but I was coding and started wondering if there was a pythonic way to check if something does not exist. Here's how I do it if its true:
var = 1
if var:
print 'it exists'
..
I am wondering when static variables are initialized to their default values.
Is it correct that when a class is loaded, static vars are created (allocated),
then static initializers and initializatio..
How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it...
I would like to send messages in the form of JSON objects to a server and parse the JSON response from the server.
Example of JSON object
{
"post": {
"username": "John Doe",
"message": "te..
I can use this:
String str = "TextX Xto modifyX";
str = str.replace('X','');//that does not work because there is no such character ''
Is there a way to remove all occurrences of character X from a..
I am trying to parse url-encoded strings that are made up of key=value pairs separated by either & or &.
The following will only match the first occurrence, breaking apart the keys and v..
How can I make as "perfect" a subclass of dict as possible? The end goal is to have a simple dict in which the keys are lowercase.
It would seem that there should be some tiny set of primitives I can..
I've seen plenty of info about how to stream video from the server to an android device, but not much about the other way, ala Qik. Could someone point me in the right direction here, or give me some..
How would I make my server run a php script by triggering it manually using php? Basically I have a pretty big cronjob file that is ran every 2 hours, but I want to be able to trigger the file manuall..
I am trying to trigger click event on hyperlink with jQuery like the way below. Hyperlink does not have any id but it does have cssclass
$(document).ready(function () { $('.cssbuttongo').trigger('c..
Is it possible to get multiple inputs of the same name to post and then access them from PHP? The idea is this: I have a form that allows the entry of an indefinite number of physical addresses along..
I've created a JOptionPane and it only has two buttons YES_NO_OPTION .
After JOptionPane.showConfirmDialog pops out , I want to click YES BUTTON to continue opening the JFileChooser and if I clicked ..
I want to convert a .jar to an .exe for microsoft. Is there any program converter for this?
Also if there's one for Mac and Linux I would appreciate suggestions for those too...
I tried to use a make file in code::blocks but I am doing it wrong. I have the version installed with the compilers included. http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/co..
The basic algorithm for BFS:
set start vertex to visited
load it into queue
while queue not empty
for each edge incident to vertex
if its not visited
load into queue
..
When I try setting the color of a UILabel to the color of another UILabel using the code
myLabel.textColor = otherLabel.textColor
It doesn't change the color. When I use this code, however,
myLab..
I am pulling varchar values out of a DB and want to set the string I am assigning them to as "" if they are null. I'm currently doing it like this:
if (string.IsNullOrEmpty(planRec.approved_by) == tr..
If my response has key "error" I need to process error and show warning box.
Is there "haskey" method exists in json.net?
Like:
var x= JObject.Parse(string_my);
if(x.HasKey["error_msg"])
Messag..