I'm trying to export a PostgreSQL table with headings to a CSV file via command line, however I get it to export to CSV file, but without headings.
My code looks as follows:
COPY products_273 to '/..
I want to display an arrow at my location on a google map view that displays my direction relative to a destination location (instead of north).
a) I have calculated north using the sensor values fro..
I'd like to know if the POST method on HTTP sends data as a QueryString, or if it use a special structure to pass the data to the server.
In fact, when I analyze the communication with POST method f..
Question: Because of python's use of "GIL" is python capable running its separate threads simultaneously?
Info:
After reading this I came away rather uncertain on whether or not python is capable ..
I read "https://stackoverflow.com/questions/826734/when-do-ruby-instance-variables-get-set" but I'm of two minds when to use class instance variables.
Class variables are shared by all objec..
Is it possible to change a div's width live with jQuery? And if it is, how?
What I want is to change its width depending on the browser's window width in real time, so if/when the user changes the br..
Is there a way to make this method generic so I can return a string, bool, int, or double? Right now, it's returning a string, but if it's able find "true" or "false" as the configuration value, I'd ..
I want to display, above any other views, even the navigation bar, a kind of "pop-up" view that looks like this:
full screen black background with a 0.5 alpha to see the other UIViewController under..
I have a table where each ID is repeated 3 times. there is a date in front of each id in each row.
I want to select entire row for each ID where date is latest.
There are total 370 columns in this ta..
I've got several elements on a HTML page which have the same class - but they're different element types. I want to find out the tag name of the element as I loop over them - but .attr doesn't take "..
I am trying to do a basic string replace using a regex expression, but the answers I have found do not seem to help - they are directly answering each persons unique requirement with little or no expl..
Is there any regular expression library written in T-SQL (no CLR, no extended SP, pure T-SQL) for SQL Server, and that should work with shared hosting?
Edit:
Thanks, I know about PATINDEX, LIKE, xp..
In an android application I'm loading data from a Db into a TableView inside a Fragment. But when I reload the Fragment it displays the previous data. Can I repopulate the Fragment with current data i..
I have a text file on my local machine that is generated by a daily Python script run in cron.
I would like to add a bit of code to have that file sent securely to my server over SSH...
I have a compact JSON string, and I want to format it nicely in Java without having to deserialize it first -- e.g. just like jsonlint.org does it. Are there any libraries out there that provides thi..
I have a currently fairly dysfunctional Javascript program that's been causing me problems. However, it throws one error that I just don't understand:
TypeError: 'undefined' is not an object (evaluat..
Is it possible to add elements to a collection while iterating over it?
More specifically, I would like to iterate over a collection, and if an element satisfies a certain condition I want to add som..
I'm trying to open all appropriate PDFs found in the same directory as my Excel workbook using VBA. I've added the Adobe Acrobat xx.x Type Library reference to the project. But when I try to create ..
Here is my JavaScript code so far:
var linkElement = document.getElementById("BackButton");
var loc_array = document.location.href.split('/');
var newT = document.createTextNode(unescape(capWords(loc..
I want to add a blank space after some content, however the content: " "; doesn't seem to work.
This is my code:
h2:after {
content: " ";
}
... which doesn't work, however this does:
h2:after..
I've recently encountered an error trying to host my asp.net site with IIS. I have found a solution that many swear by.
Solution:
Add IIS_IUSRS with Read permission on files in the folder
Change II..
I have a single worksheet with sheets Sheet1 and Sheet2 and I am trying to reference a range of cells from Sheet2 to Sheet1
I know how to reference worksheet cells such as =Sheet2!A1 but how can I d..
I have the following line in my header:
import config.logging_settings
This actually changes my Python logging settings, but Pylint thinks it is an unused import. I do not want to remove unused-impor..
My Spring Boot webapp is running just fine, and I'd like to debug it through Eclipse.
So when launching my Remote Java Application debugger, which port should I listen to? And is there a setting on m..
I have setup gunicorn with 3 workers 30 worker connections and using eventlet worker class. It is setup behind Nginx. After every few requests, I see this in the logs.
[ERROR] gunicorn.error: WORKER ..
I am creating a backup application where c# scans a directory. Before I use to have something like this in order to get all the files and subfiles in a directory:
DirectoryInfo di = new DirectoryInfo..
What is the best way to implement a timer? A code sample would be great! For this question, "best" is defined as most reliable (least number of misfires) and precise. If I specify an interval of 15 se..
My login view has a subview which has a UIActivityView and a UILabel saying "Signing In…". This subview has corners which aren't rounded. How can I make them round?
Is there any way to do it inside..
Is there an easier way to specify multiple System Properties on the command line to a Java program rather than having multiple -D statements?
Trying to avoid this:
java -jar -DNAME="myName" -DVERSI..
I'm running a simple ng-repeat over a JSON file and want to get category names. There are about 100 objects, each belonging to a category - but there are only about 6 categories.
My current code is ..
How do you return 1 value per row of the max of several columns:
TableName
[Number, Date1, Date2, Date3, Cost]
I need to return something like this:
[Number, Most_Recent_Date, Cost]
Query?..
When is it important to pass props to super(), and why?
class MyComponent extends React.Component {
constructor(props) {
super(); // or super(props) ?
}
}
..
I am quite new to React and after going through some tutorials, I was trying the below code of mine.
I made one component, passed props to it from a store, on componentWillMount I make a new state for..
Is it possible to directly convert canvas to pdf using JavaScript (pdf.js or something like that)?
Is there another possible way like canvas to img and then img to pdf?
Can you give me an example?..
a can only be final here. Why? How can I reassign a in onClick() method without keeping it as private member?
private void f(Button b, final int a){
b.addClickHandler(new ClickHandler() {
..
I am using Jackson and I'm having problems, when I try to deserialize an Object I get the following error:
com.fasterxml.jackson.databind.JsonMappingException:
Can not construct instance of net...
I want to Change the background colour on click . This is my code work that i tried.pls help me out :)
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
$(docu..
My question is, does anyone know how to set google maps up, to open up both my location and in a zoomed-in view?
Currently, the main view opens up to Africa, all the way zoomed out.
And so I have be..
I want to play .mov video like as this, but video doesn't play in any browser.
<video width="400" controls Autoplay=autoplay>
<source src="D:/mov1.mov" type="video/mov">
</video>
..
Possible Duplicates:
Statistics: combinations in Python
counting combinations and permutations efficiently
Project euler problem in python (problem 53)
I'm looking to see if built in wi..
I have a server with Rackspace. I want to access the database from my local machine command line.
I tried like:
mysql -u username -h my.application.com -ppassword
But it gives an error:
ERROR 2003 (..
I am new to ASP.NET MVC. I have used PHP before and it was easy to create a session and select user records based on the current session variables.
I have looked everywhere on the Internet for a sim..
Is it possible to select from show tables in MySQL?
SELECT * FROM (SHOW TABLES) AS `my_tables`
Something along these lines, though the above does not work (on 5.0.51a, at least)...
In my iPhone app, I have a UIButton which I have created in Interface Builder. I can successfully enable and disable it like this in my code ...
sendButton.enabled = YES;
or
sendButton.enabled = N..
I know I can use cd command to change my working directory in bash.
But if I do this command:
cd SOME_PATH && run_some_command
Then the working directory will be changed permanently. Is ..
I have a string in activity2
String message = String.format(
"Current Location \n Longitude: %1$s \n Latitude: %2$s", lat, lng);
I want to insert this string into text field in activity1. How can ..
Is there a way to load external CSS files, like we load JS file by using .getScript method and also use the callback function like in .getScript
$("<link/>", {
rel: "stylesheet",
type: "t..
I have a hidden contact form which is deployed clicking on a button. Its fields are set as CSS background images, and they always appears a bit later than the div that have been toggled.
I was using ..
Suppose I have the following two objects:
first_name_relation = User.where(:first_name => 'Tobias') # ActiveRecord::Relation
last_name_relation = User.where(:last_name => 'Fünke') # ActiveRe..
That's kind of a general question (but I'm using C#), what's the best way (best practice), do you return null or empty collection for a method that has a collection as a return type ?..
Has anyone here added tooltips to font-awesome icons?
I have the following jsfiddle, but cannot seem to find a guide to add tooltips to the icons.
<header>
<!-- icons for settings, change..
I am getting images from url and showing it on the imageView. This functionality is working properly. But I want that when I click on that image, then it must be full screen. So how to achieve this fu..
I'm trying to run over the parameters space of a 6 parameter function to study its numerical behavior before trying to do anything complex with it, so I'm searching for an efficient way to do this.
My..
After some android apps installed, I found that it will change to odex file (not apk) in smartphone.
How does it happens? Who can teach me, I am very interested about it...
I was wondering how to save PHP variables to a txt file and then
retrieve them again.
Example:
There is an input box, after submitted the stuff that was written in
the input box will be saved to a t..
Can this attribute be changed dynamically in Java code?
android:layout_marginRight
I have a TextView, that has to change its position some pixels to the left dynamically.
How to do it programmati..
I'm looking for an equivalent in python of dictionary.get(key, default) for lists. Is there any one liner idiom to get the nth element of a list or a default value if not available?
For example, give..
I am uploading a file to S3 using Java - this is what I got so far:
AmazonS3 s3 = new AmazonS3Client(new BasicAWSCredentials("XX","YY"));
List<Bucket> buckets = s3.listBuckets();
s3.putObject..
NOTE: The libraries MCrypt support depend on have not been updated in years and MCrypt should no longer be considered a viable or secure method of encrypting data. What's more, MCrypt has been deprec..
Here is my situation.
I have a file called iframe.html, which contains the code to for a image slideshow.
The code is somewhat like
<html>
<head>
<!-- Have added title and js fi..
When using the Xcode 8+ and creating a new blank project, the following logs appear when running the application:
2016-06-13 16:33:34.406093 TestiOS10[8209:100611] bundleid: com.appc.TestiOS10, enabl..
What is the best practice when returning data from functions. Is it better to return a Null or an empty object? And why should one do one over the other?
Consider this:
public UserEntity GetUserBy..
I have a python web form with two options - File upload and textarea. I need to take the values from each and pass them to another command-line program. I can easily pass the file name with file uploa..
I'm trying to work with the new RecyclerView, but I could not find an example of a RecyclerView with different types of rows/cardviews getting inflated.
With ListView I override the getViewTypeCount ..
Seems as though an update on Windows 10 overnight broke Python. Just trying to run python --version returned a "Permission Denied" error. None of the three updates; KB4507453, KB4506991, or KB4509096..
What is your favorite method to handle errors in Bash?
The best example of handling errors I have found on the web was written by William Shotts, Jr at http://www.linuxcommand.org.
He suggests usin..
The Android SDK offers the standard menu icons via android.R.drawable.X. However, some standard icons, such as ic_menu_refresh (the refresh icon), are missing from android.R.
Is there any way to get ..
hi i'm actually sending a base64 image string trough ajax to a php script which just decodes string and save content as .jpg file.
But the result is an empty image.
How can this be possible?
php sc..
I have a functioning Rails 3 app that uses has_many :through associations which is not, as I remake it as a Rails 4 app, letting me save ids from the associated model in the Rails 4 version.
These a..
Is it possible to display an image returned by jQuery AJAX call, in the main stream of your HTML?
I have a script that draws an image with a header (image/PNG).
When I simply call it in the browser, ..
How can I add an attribute into specific HTML tags in jQuery?
For example, like this simple HTML:
<input id="someid" />
Then adding an attribute disabled="true" like this:
<input id="som..
Note: When originally posted I was trying to install maven2. Since the main answer is for maven3 I have updated the title. The rest of the question remains as it was originally posted.
I'm trying to ..
I was in one of the angular presentation and one of the person in the meeting mentioned ng-bind is better than {{}} binding.
One of the reason, ng-bind put the variable in the watch list and only wh..
I am using telnet to port 8089 on remote server.
Can any tell me which of the following commands are true.
telnet 74.255.12.25 8089
or
telnet 74.255.12.25 89
Thanks in Advance...
I am using PostgreSQL via the Ruby gem 'sequel'.
I'm trying to round to two decimal places.
Here's my code:
SELECT ROUND(AVG(some_column),2)
FROM table
I get the following error:
PG::Error:..
I am trying to learn hooks and the useState method has made me confused. I am assigning an initial value to a state in the form of an array. The set method in useState is not working for me even with ..
I have a Unicode string in Python, and I would like to remove all the accents (diacritics).
I found on the web an elegant way to do this (in Java):
convert the Unicode string to its long normalized f..
I am currently failing to write a good makefile and don't know the reason why.. -.-
This is my main.c:
#include <windows.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
pr..
I Found some codes for quit an Android application programatically. By calling any one of the following code in onDestroy() will it quit application entirely?
System.runFinalizersOnExit(true)
..
I know how to make a new branch that tracks remote branches, but how do I make an existing branch track a remote branch?
I know I can just edit the .git/config file, but it seems there should be an e..
I am working with jQuery UI Accordion and it works great, but I would like to have the accordion stay closed unless it I click on it.
I am using this code right now, which allows be to toggle it clos..
I'm currently working on a project in which I have to use purely native ndk. It worked when I try running an helloworld example from Irrlicht engine source. Then I try using it in my project following..
I am trying to get the value of the selected item in the listbox using the code below, but it is always returning null string.
DataSet ds = searchforPrice(Convert.ToString(listBox1.SelectedItem));
..
I'm able to update pip-managed packages, but how do I update pip itself? According to pip --version, I currently have pip 1.1 installed in my virtualenv and I want to update to the latest version.
W..
I really dont know if this is possible or not.
But I am strucking in a place where I want to check an int value is null or not, to call different methods.
Is there any way to do it?
Actually, variab..
What is the difference between the dot (.) and the dollar sign ($)?
As I understand it, they are both syntactic sugar for not needing to use parentheses...
I'm developing a game using Cocos2d-x to Android and iPhone. At the beggining, I had a lot of problems to start using this library, so, in this question, I want to collect all basic, medium and expert..
I have a branch 'firstproject' with 2 commits. I want to get rid of these commits and make them appear as a single commit.
The command git merge --squash sounds promising, but when I run git merge -..
I'm looking for a way to convert hex(hexadecimal) to dec(decimal) easily. I found an easy way to do this like :
int k = 0x265;
cout << k << endl;
But with that I can't input 265. Is the..
I'm trying to install apps from Google Play. I can understand that on opening the Google Play store URL, it opens the Google Play and when I press the back button, the activity resumes.
Intent market..
I am trying to refactor the following code from my render view:
<Button href="#" active={!this.state.singleJourney} onClick={this.handleButtonChange.bind(this,false)} >Retour</Button>
t..
I'm trying to align an HTML button exactly at the centre of the page irrespective of the browser used. It is either floating to the left while still being at the vertical centre or being somewhere on ..
I'm trying to get access token from user
string response_script = "<script>top.location.href='https://www.facebook.com/v2.4/dialog/oauth?response_type=token&client_id=[APPLICATION ID]&r..
I'm currently trying to set all borders for my spreadsheet, also formatting such as autosize.
My code below is working, for sheet 1. All other sheets inside the spreadsheet are completely untouched. ..
When writing Perl scripts I frequently find the need to obtain the current time represented as a string formatted as YYYY-mm-dd HH:MM:SS (say 2009-11-29 14:28:29).
In doing this I find myself taking ..
This fabulous answer suggests there’s no way to run multiple versions of Google Chrome on one machine.
Every now and then you’ll get a website user stuck on an old version of Chrome (no idea how,..
I have a <SELECT multiple> field with multiple options and I want to allow it to have only one option selected at the same time but user can hold CTRL key and select more items at once.
Is ther..
I have this really big table with some millions of records every day and in the end of every day I am extracting all the records of the previous day. I am doing this like:
String SQL = "select col1,..
I need to get all controls on a form that are of type x. I'm pretty sure I saw that code once in the past that used something like this:
dim ctrls() as Control
ctrls = Me.Controls(GetType(TextBox))
..
I don't understand the following from pep-0404
In Python 3, implicit relative imports within packages are no longer
available - only absolute imports and explicit relative imports are
supporte..
I am trying to write a query that will check if a specific table in MySQL has a specific column, and if not — create it. Otherwise do nothing. This is really an easy procedure in any enterprise-cla..
Is there a PHP function that returns the date and time in the same format as the MySQL function NOW()?
I know how to do it using date(), but I am asking if there is a function only for this.
For e..
When searching for number of occurrences of a string in a file, I generally use:
grep pattern file | wc -l
However, this only finds one occurrence per line, because of the way grep works. How can I..
So I am not sure exactly what I would have to show you guys, how ever if you need more code please do not hesitate to ask:
So this method will set up the initMailer for Zend with in our application:
..
Does someone know how do I get the path of my application directory? (e.g. /data/data/my.app.lication/)
Currently I'm using this method: myActivity.getFilesDir().getParent(); but it seems to me like ..
I made a website where if the user clicks, it plays a sound. To prevent the sound from overlapping, I had to add the code:
n.pause();
n.currentTime = 0;
n.play();
But that causes the error:
The pl..
How do you schedule a task in Windows XP to run when you shutdown windows. Such that I want to run a simple command line program I wrote in c# everytime I shut down windows. There doesn't seem to be a..
I want to copy text from a JTable's cell to the clipboard, making it available to be pasted into other programs such as Microsoft Word. I have the text from the JTable, but I am unsure how to copy it ..
I wrote a simple test application to log something in a log file. I am using linux mint and after the application executes I try to view the log using this command:
tail -n 100 /var/log/messages
b..
My table has several columns.
Each column should have dynamic width that depends on the browser window size. On the other hand, each column must not be too tiny. So I tried to set min-width for thos..
I need to create a NumPy array of length n, each element of which is v.
Is there anything better than:
a = empty(n)
for i in range(n):
a[i] = v
I know zeros and ones would work for v = 0, 1. I..
What explains the difference in behavior of boolean and bitwise operations on lists vs NumPy arrays?
I'm confused about the appropriate use of & vs and in Python, illustrated in the following ex..
My current project had been building with Gradle just fine, since
I created it (about a month ago), after acquiring Android-Studio.
[I installed some earlier updates to Android-Studio, and had no
prob..
There have been some middleware changes on the new version of express and I have made some changes in my code around some of the other posts on this issue but I can't get anything to stick.
We had it..
I've written a PHP function that can accepts 10 parameters, but only 2 are required. Sometimes, I want to define the eighth parameter, but I don't want to type in empty strings for each of the paramet..
I would like to know how to delete a commit.
By delete, I mean it is as if I didn't make that commit, and when I do a push in the future, my changes will not push to the remote branch.
I read git he..
I am learning C++ on my own. I have the following code but it gives error.
#include <iostream>
#include <string>
using namespace std;
int setvalue(const char * value)
{
string mVal..
I am using curl to download data from a https site using public certificate files.
System information:
OS: fedora 14
curl: curl 7.30.0
openssl: OpenSSL 1.0.0a-fips
The command is,
curl -v "https..
I want to create a table from select query result in SQL Server, I tried
create table temp AS select.....
but I got an error
Incorrect syntax near the keyword 'AS'
..
I want to do something like:
foo = {
'foo': 1,
'zip': 2,
'zam': 3,
'bar': 4
}
if ("foo", "bar") in foo:
#do stuff
How do I check whether both foo and bar are ..
I'm trying to do a function if enter is pressed while on specific input.
What I'm I doing wrong?
$(document).keyup(function (e) {
if ($(".input1").is(":focus") && (e.keyCode == 13)) {
..
I have generated an image using PIL. How can I save it to a string in memory?
The Image.save() method requires a file.
I'd like to have several such images stored in dictionary...
This is a simple question I think.
I am trying to search for the occurrence of a string in another string using regex in JavaScript like so:
var content ="Hi, I like your Apartment. Could we schedu..
A simple comparison of two double values in Java creates some problems. Let's consider the following simple code snippet in Java.
package doublecomparision;
final public class DoubleComparision
{
..
Suppose we have an application that acts as a middleman, allowing Company A to send reports to their customers.
Company A --> Company B (me)--> Company A's customers
After getting the report we ..
I've searched around this site for an answer but couldnt find any.
I have a form and I'd like to get the contents of the input written into a txt file. To make it simple I just wrote a simple form an..
I have a database that has a 28gig transaction log file. Recovery mode is simple. I just took a full backup of the database, and then ran both:
backup log dbmcms with truncate_only
DBCC SHRINKFIL..
I use codes below to send POST request to a server:
string url = "http://myserver/method?param1=1¶m2=2"
HttpClientHandler handler = new HttpClientHandler();
HttpClient httpClient = new Ht..
I'd like to remove the status bar at the top of the screen.
This does not work:
func application
(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: NSDictionary?)
-> Bool
{..
I am trying to come up with a function that does a good job of sanitizing certain strings so that they are safe to use in the URL (like a post slug) and also safe to use as file names. For example, wh..
I'm currently developing a responsive site using Twitter Bootstrap.
The site has a full screen background image across mobile/tablet/desktop. These images rotate and fade through each, using two divs..
Does Bootstrap support fixed width buttons? Currently if I have 2 buttons, "Save" and "Download", the button size changes based on content.
Also what is the right way of extending Bootstrap?..
This question is basically an extension of my previous question . I asked the previous question to be sure that the Enum constants are populated when the class loads . Here's is my class again with th..
On the most recent versions of Notepad++, when the application is closed, unsaved files are maintained when the application is restarted.
I presume that those files are cached on a temporary files. W..
Say I have something like the following to trap the click event of a button:
$("#button_id").click(function() {
//disable click event
//do something
//re-enable click event
}
How do I tempora..
I have the need to set a binding in code.
I can't seem to get it right tho.
This is what i have tried:
XAML:
<TextBox Name="txtText"></TextBox>
Code behind:
Binding myBinding = new ..
what is fastest way to remove duplicate values from a list.
Assume List<long> longs = new List<long> { 1, 2, 3, 4, 3, 2, 5 }; So I am interesting in use lambda to remove duplicate and retu..
I make an outer join and executed successfully in the informix database but I get the following exception in my code:
DataTable dt = TeachingLoadDAL.GetCoursesWithEvalState(i, bat);
Failed to en..
How can I terminate process using vbscript. PLEASE NOTE, I need to terminate process that runs under windows 64-bit environment as native 64 (not using select * from win_32_Process)
Thanks,..
I'm trying to write code to read a binary file into a buffer, then write the buffer to another file. I have the following code, but the buffer only stores a couple of ASCII characters from the first ..
I have a dictionary that I declared in a particular order and want to keep it in that order all the time. The keys/values can't really be kept in order based on their value, I just want it in the orde..
I need to find all image files from directory (gif, png, jpg, jpeg).
find /path/to/ -name "*.jpg" > log
How to modify this string to find not only .jpg files?..
I have some web services that uses WSDL/SOAP for communication. Specifically, I am using PHP and Nusoap to make them. How can I use these web services on Android? I am going to get a new Android phone..
why doesn't this display ibm.com into a 400x500px modal? The section appears to be correct, but it doesn't cause the popup modal to appear.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN..
I recently changed my password and have to change my maven settings.xml file to reflect that. However, no matter what I do in the settings.xml file, the changed password just won't get picked up. Out ..
I have a dataframe of
date, string, string
I want to select dates before a certain period. I have tried the following with no luck
data.filter(data("date") < new java.sql.Date(format.parse("2..
How can Jackson be configured to ignore a field value during serialization if that field's value is null.
For example:
public class SomeClass {
// what jackson annotation causes jackson to skip ..
When I try to include any C++ class like vector in my Android NDK project (using NDK r5b, the latest), I get an error like the following...
Compile++ thumb : test-libstl <= test-libstl.cpp
/Users..
Lately I decided to learn how to use the log4j2 logger. I downloaded required jar files, created library, xml comfiguration file and tried to use it. Unfortunately i get this statement in console (Ecl..
I have noticed this in a couple of scripting languages, but in this example, I am using python. In many tutorials, they would start with #!/usr/bin/python3 on the first line. I don't understand why we..
Since I believe this should be a basic question I know this question has probably been asked, but I am unable to find it. I'm probably about to earn my Peer Pressure badge, but I'll ask anyway:
Is th..
I don't know if it's just too late or what, but I don't see how to do this...
What I'm expecting to do, and what the object browser says is there, is this:
var oc = new ObservableCollection<T>..
I am using CentOS minimal version and I am trying to locate a file, but I have no idea how to search all of the server for the file.
I am sure there is a command out there to do it, can anyone help me..
Could someone tell me the differences between Ant and Maven? I have never used either. I understand that they are used to automate the building of Java projects, but I do not know where to start from...
I need to get the system date, and Java provides the new Date().getTime().
But I need to avoid new object allocation (I'm working on a embedded system). How can I get the system time without allocati..
Due to weird domain/subdomain cookie issues that I'm getting, I'd like to know how browsers handle cookies. If they do it in different ways, it would also be nice to know the differences.
In other wo..
I have a datagridview in my C# application and the user should only be able to click on full rows. So I set the SelectionMode to FullRowSelect.
But now I want to have an Event which is fired when the..
I want to play my song (mp3) from python, can you give me a simplest command to do that?
This is not correct:
import wave
w = wave.open("e:/LOCAL/Betrayer/Metalik Klinik1-Anak Sekolah.mp3","r")
..
I am trying to create a directive that would create an input field with the same ng-model as the element that creates the directive.
Here's what I came up with so far:
HTML
<!doctype html>
&l..
Find the object matching with a Property value from a Collection using Java 8 Stream.
List<Person> objects = new ArrayList<>();
Person attributes -> Name, Phone, Email.
Iterate throu..
I'm relatively new to coding and am having trouble.
I have this code to send data to firebase
app.userid = app.user.uid
var userRef = app.dataInfo.child(app.users);
var useridRef = userRef.child(a..
I currently have a Python set of n size where n >= 0. Is there a quick 1 or 2 lines Python solution to do it? For example, the set will look like:
fruits = set(['apple', 'orange', 'watermelon', 'gr..
In my ~/.gitconfig, I list my personal email address under [user], since that's what I want to use for Github repos.
But, I've recently started using git for work, too. My company's git repo allows m..
I need help with the split() method.
I have the followingString:
String values = "0|0|0|1|||0|1|0|||";
I need to put the values into an array. There are 3 possible strings: "0", "1", and ""
My p..
Is there a built-in IsNullOrEmpty-like function in order to check if a string is null or empty, in PowerShell?
I could not find it so far and if there is a built-in way, I do not want to write a func..
I have been working on a project using Symfony 2.1 on my local machine. I have uploaded it to my server but when I try and install the vendor bundles using Composer, I'm getting a lot of dependency e..
How to reload current page in ReactJS? in case of javascript we can wrote window.location.reload();
How to do the same in reactjs? I'm able to add new data by UI. But without refresh I'm not able to s..
I need a SQL query which add a new column after an existing column, so the column will be added in a specific order.
Please suggest me if any ALTER query which do that...
It's impossible to use placeholder on date fields but I really need it.
I want two date inputs with texts "From" and "To" on each one as placeholders...
What is the difference between the Builder design pattern and the Factory design pattern?
Which one is more advantageous and why ?
How do I represent my findings as a graph if I want to test and c..
I have a stack of divs inside of each other, all of which have an ID which specifies CSS only.
But for some reason the surrounding DIV tag only expands to it's anointed height value, and not it's def..
Is it possible to make an ajax request inside another ajax request?
because I need some data from first ajax request to make the next ajax request.
First I'm using Google Maps API to get LAT & LN..
Can anyone please tell me how I can go back to the previous page rather than a specific route?
When using this code:
var BackButton = React.createClass({
mixins: [Router.Navigation],
render: fun..
I want to customize my app's look by using a logo image as the navigation bar's title, instead of plain text. When I use this code
let logo = UIImage(named: "logo.png")
self.navigationItem.titleView ..
Say I have an HTML form like this to collect an email from a website visitor:
<form name="input" action="handle_email.php" method="post">
Email: <input type="text" name="email" />
<inp..