When is SQLiteOpenHelper onCreate() / onUpgrade() run?

When is SQLiteOpenHelper onCreate() / onUpgrade() run?

I create my tables in my SQLiteOpenHelper onCreate() but receiveSQLiteException: no such tableorSQLiteException: no such columnerrors. Why? NOTE: (This is the amalgamated summary of tens of similar questions every week. Attempting to pr

How to Export JSON to CSV or Excel - Angular 2

How to Export JSON to CSV or Excel - Angular 2

Say my json is like this: var readyToExport = [ {id: 1, name: 'a'}, {id: 2, name: 'b'}, {id: 3, name: 'c'}];How can I export this JSON into CSV or Excel file in Angular2?The browser that I'm using is Chrome. Maybe Angular2 is not rele

What does “three dots” in Python mean when indexing what looks like a number?

What does “three dots” in Python mean when indexing what looks like a number?

What is the meaning of x[...] below?a = np.arange(6).reshape(2,3)for x in np.nditer(a, op_flags=['readwrite']): x[...] = 2 * x 1:While the proposed duplicate What does the Python Ellipsis object do? answers the question in a general p

fb:like-box, custom css?

fb:like-box, custom css?

Is it possible to add a custom css file to a fb:like-box? For example, I would like to remove the borders around the iframe. Thanks 1:The new like-box does not accept the "css" attribute. You have to use the old fb:fan plugin to achieve

Perfect Forwarding in C++03

Perfect Forwarding in C++03

If you have this functiontemplate f(T&);And then try to call it with, let's say an rvalue likef(1);Why isn't T just be deduced to be const int, making the argument a const int& and thus bindable to an rvalue? 1:This is mentioned as a pot

What is the signal for when a widget loses focus?

What is the signal for when a widget loses focus?

In a dialog, when the tab key is pressed, the focus changes to another widget. In Qt, is there any signal for when a widget loses its focus? Can I use it to check if the input is valid or not? If not, can I set the focus back and ask the us

Run a NodeJS app with Apache

Run a NodeJS app with Apache

I have a ubuntu server running a few apache websites. I want to run a nodejs app on the same server. I have the app running on the server now out of port 3000 (www.example.com:3000) no problems there.I now want to direct a new domain to the

PDF editing with iPhone sdk

PDF editing with iPhone sdk

I want add some images on existing pdf. After clicking on those images I should able to show some animation or able to play music. Is it possible to do that. I am showing pdf page by page using pageCurlUp Animation but I don't know how to s

Git branching model strategy

Git branching model strategy

We are trying to follow the gitflow branching model, but with a twist.We have have four servers environments where the product can be deployed to, each server serves a purpose : development, internal testing, external testing, and productio

d3 pattern to add an element if missing

d3 pattern to add an element if missing

With D3, I'm finding myself doing this a lot:selectAll('foo').data(['foo']).enter().append('foo')I'd like to simply add a node if it doesn't already exist, because I need to do updates at different places in the DOM tree, and the data I hav

How can I show a UIDatePicker inside a Popover on iPad using StoryBoard?

How can I show a UIDatePicker inside a Popover on iPad using StoryBoard?

I have achieved to show the datepicker inside the popover, doing it programmatically as it is shown in UIDatePicker in UIPopover.But I have been trying to do it in interface Builder, I already made a View Controller named DatePickerViewCont

Getting more info from Rprof()

Getting more info from Rprof()

I've been trying to dig into what the time-hogs are in some R code I've written, so I'm using Rprof. The output isn't yet very helpful though:> summaryRprof()$by.self self.time self.pct total.time total.pct"$Is there s

Membership.ValidateUser always returns false after upgrade to VS 2010 / .NET 4.0

Membership.ValidateUser always returns false after upgrade to VS 2010 / .NET 4.0

Not sure whether this pertains to VS 2010 or to the upgraded framework, but... we are using the Oracle membership provider to authenticate users. Prior to the upgrade everything worked fine, but now Membership.ValidateUser(user, password) r

Randomize matrix in perl, keeping row and column totals the same

Randomize matrix in perl, keeping row and column totals the same

I have a matrix that I want to randomize a couple of thousand times, while keeping the row and column totals the same: 1 2 3 A 0 0 1 B 1 1 0 C 1 0 0 An example of a valid random matrix would be: 1 2 3 A 1 0 0 B 1 1

Python + Django on Android

Python + Django on Android

I am a Django developer and wanted to know if anyone has any idea of the possibilities of installing and developing on Django using an Android tablet such as the nexus 7. This seems like a reasonably powerful device, can be hooked up with a

Getting the date from a ResultSet for use with java.time classes

Getting the date from a ResultSet for use with java.time classes

Is there anyway to get a java.time (new in Java 8) compatible time class out of a ResultSet? I am aware you can use ResultSet's getDate or getTimestamp but these method return java.sql.Date / java.sql.Timestamp objects which are now depreca

Can I change an an existing virtualenv to ignore global site packages? (like --no-site-package on a

Can I change an an existing virtualenv to ignore global site packages? (like --no-site-package on a

I can create a new virtualenv that ignores global site-packages with "--no-site-package". Is it possible to change an existing virtualenv (which was created without "--no-site-package") to also ignore the global site-packages? (So that it w

How do I define a data type that only accepts numbers?

How do I define a data type that only accepts numbers?

I am attempting to create a data type, Point, that takes three numbers for its constructor. Initially, I had writtendata Point = Point Double Double Doublebut I ran into some issues when certain pieces of code expected Ints.So I changed it

Create new cores in SOLR via HTTP?

Create new cores in SOLR via HTTP?

Is it possible to create new cores in SOLR via HTTP? I can't seem to find a definitive answer to what seems like a very simple question...Each core I want to create will have the same schema/configuration (multi-tenant SaaS architecture). I

What's the difference between queryAll and querySelectorAll

What's the difference between queryAll and querySelectorAll

The definitions from the DOM Standard seems almost exactly the same, and I don't understand the difference.What is the difference between queryAll and querySelectorAll.The evaluation logic from DOM standard is below, but I am not smart enou

Python Pandas - Deleting multiple series from a data frame in one command

Python Pandas - Deleting multiple series from a data frame in one command

In short ... I have a Python Pandas data frame that is read in from an Excel file using 'read_table'. I would like to keep a handful of the series from the data, and purge the rest. I know that I can just delete what I don't want one-by-o

How to include clean target in Makefile?

How to include clean target in Makefile?

I have a Makefile that looks like thisCXX = g++ -O2 -Wallall: code1 code2code1: code1.cc utilities.cc $(CXX) $^ -o [email protected]: code2.cc utilities.cc $(CXX) $^ -o [email protected] I want to do next is to include clean target so that every timeI run m

How to read log4j output to a web page?

How to read log4j output to a web page?

I have a web page, used for admin purposes, which runs a task (image fetching from a remote site).In order to be able to debug the task using the browser only, no ssh etc, I'd like to be able to read all log output from the executing thread

MongoDB - $week function and first day of week in aggregation

MongoDB - $week function and first day of week in aggregation

I use $project operator to extract week part from Date, then do grouping by weeks in aggregation pipeline.{ $project: { year: { $year: [ "$datetime" ] }, week: { $week: [ "$datetime" ] }, .... }},....{ $group: { _id: {

Upgrade a connection to TLS in Go

Upgrade a connection to TLS in Go

I have an open TCP connection and read from it with a for loop like sofor { // tx.Text is of type textproto.Conn // the underlying connection is stored in tx.Conn l, err := tx.Text.Reader.ReadLine() // do stuff with the text line ...}No