Select rows which are not present in other table

Select rows which are not present in other table

I've got two postgresql tables: table name column names----------- ------------------------login_log ip | etc.ip_location ip | location | hostname | etc.I want to get every IP address from login_log which doesn't have a row

Convert string to title case with JavaScript

Convert string to title case with JavaScript

Is there a simple way to convert a string to title case? E.g. john smith becomes John Smith. I'm not looking for something complicated like John Resig's solution, just (hopefully) some kind of one- or two-liner. 1:Try this:function toTi

Convert one date format into another in PHP

Convert one date format into another in PHP

Is there a simple way to convert one date format into another date format in PHP?I have this:$old_date = date('y-m-d-h-i-s'); // works$middle = strtotime($old_date); // returns bool(false)$new_date = date('Y-m-d H:i:s

What is the explicit promise construction antipattern and how do I avoid it?

What is the explicit promise construction antipattern and how do I avoid it?

I was writing code that does something that looks like:Using the Promise constructor:function getStuffDone(param) { return new Promise(function(resolve, reject) { myPromiseFn(param+1) .then(function(val) { resolve(val);

Log-log lmplot with seaborn

Log-log lmplot with seaborn

Can the function lmplot from Seaborn plot on a log-log scale?This is lmplot on a normal scaleimport numpy as npimport pandas as pdimport seaborn as snsx = 10**arange(1, 10)y = 10** arange(1,10)*2df1 = pd.DataFrame( data=y, index=x )df2 = p

gdb attach to a process without stop

gdb attach to a process without stop

Everytime I attach to a process using gdb, it will stop the target program, and I need to type 'cont' to let it go. Is there a way to attach to a process without stopping it? This makes things easier if the process will behave differently

How do you version your projects?

How do you version your projects?

I understand that Microsoft uses this template when versioning their products: Major.Minor.Build.Revision. Major is changed when the "developers" want to show that there is a big change in the software and backward compatibility cannot be a

How do I create a CSV file using Perl?

How do I create a CSV file using Perl?

I want to create a CSV file using Perl and write some data to it. Is there any way to do that? 1:You could use Class:CSV.use Class::CSV;my $csv = Class::CSV->new( fields => [qw/userid username/]);$csv->add_line([2063, 'testuser'

python pandas flatten a dataframe to a list

python pandas flatten a dataframe to a list

I have a df like so:import pandasa=[['1/2/2014', 'a', '6', 'z1'], ['1/2/2014', 'a', '3', 'z1'], ['1/3/2014', 'c', '1', 'x3'], ]df = pandas.DataFrame.from_records(a[1:],columns=a[0])I want to flatten the df so it is one cont

response.writeHead and response.end in NodeJs

response.writeHead and response.end in NodeJs

var https = require('https');var fs = require('fs');var options = { key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')};https.createServer(options, function (req, res) {

Generic vs not-generic performance in C#

Generic vs not-generic performance in C#

I've written two equivalent methods:static bool F(T a, T b) where T : class{ return a == b;}static bool F2(A a, A b){ return a == b;}Time difference: 00:00:00.0380022 00:00:00.0170009Code for testing:var a = new A();for (int i = 0; i

Creating Python RPM

Creating Python RPM

I have been reading about creating an RPM for Python 2.6.4. In this page: http://docs.python.org/distutils/builtdist.html it says you can create an RPM of the current Python using python setup.py bdist_rpm. The question's I have are:Do you

How to modify Expander button background only? WPF

How to modify Expander button background only? WPF

I have an Expander placed on a window with a blue background and I would like to make the button for the expander another color than the default (blue, which it is receiving from the window). When I modify the background property of the ex

Retrofitting Windows Event Log to a Delphi 5 app

Retrofitting Windows Event Log to a Delphi 5 app

I'm looking for a (fairly pain-free) means of adding some Windows Application Event-Log support to a small legacy Delphi 5 application. We just want it to log when it starts-up, shuts-down, fails to connect to a database etc. Several of the

What is my current desktop environment?

What is my current desktop environment?

How can I get to know what my desktop environment is using Python? I like the result to be gnome or KDE or else. 1:Tested in Ubuntu 9.10:>>> import os>>> os.environ.get('DESKTOP_SESSION')'gnome'Edit: As mentioned in comments below, this

How to set a connection timeout when using JAXRPC-RI web services client?

How to set a connection timeout when using JAXRPC-RI web services client?

I'm working with a bit of a legacy component in which we interact with a SOAP web service (a technology which I absolutely, positively abhor) using some client code built using the JAXRPC-RI (reference implementation) library.I'm interested

How to make a Windows service with parameters?

How to make a Windows service with parameters?

I have written a Windows service, of which I want to have 1 instance running per customer. This is because the customers each have their own DB with identical schemas; the only difference between the Windows services is that they will each

Progress bar primefaces on backend processing

Progress bar primefaces on backend processing

I would appreciate it if someone can give me some hints about progress bar and ajax back-end processing.To clarify what I need following are details:I have a command button to do some processing at the back-end.I would like to show a progre

How to get multiline TODO's in Resharper 8

How to get multiline TODO's in Resharper 8

I have be trying to figure out how to change the regular expression in the Options -> To-Do's in resharper to color code and allow for multiple lines in a todo.Any Ideas? 1:I figured out the answer, easier than I thoughtOrignal regex for

Is it possible to organize c++ header and cpp files?

Is it possible to organize c++ header and cpp files?

I'm not sure if i'm asking a valid question, but here goes.I have c++ solution with a structure of[folder] Header files -... 200 header files ..[folder] Source files -... 200 soure files ..... restIs it possible to organize header and soure

Django - filtering on related objects

Django - filtering on related objects

For my Django app I have Events, Ratings, and Users. Ratings are related to Events and Users through a foreign keys. When displaying a list of Events I want to filter the ratings of the Event by a user_id so I know if an event has been rat

javascript popup alert on link click

javascript popup alert on link click

I need a javascript 'OK'/'Cancel' alert once I click on a link.I have the alert code:But how do I make it so this only runs when clicking a certain link? 1:just make it function,click me 2:You can use the onclick attribute, just retur

Reverse a string in Java, in O(1)?

Reverse a string in Java, in O(1)?

Is there any facility in the standard Java libraries that, given a CharSequence, produces the reverse in O(1) time? I guess this is "easy" to implement, just wondering whether it already exists. (I suspect the reason this is not offered is

How to put unprocessed (escaped) words inside String.Format

How to put unprocessed (escaped) words inside String.Format

I am formatting a date:str = String.Format("{0:MMM d m:mm"+yearStr+"}", dt);I want to put the word "at" after the "d", but I don't want the string to format it. I just want the word "at".How can I achieve this? 1:You can surround literal

Why do we need separate “.swift” files for each class?

Why do we need separate “.swift” files for each class?

Wondering if you might be able to answer a very basic beginner question for me. I’m working through the Cocoa + Swift tutorial on Lynda and I’m a little confused about classes/objects. Basically, I want to know why we have to create a new s