This gist is an updated version of https://github.com/ariya/phantomjs/blob/master/examples/technews.js
To run, just type (in a command line)
phantomjs news.js
#include <iostream> | |
#define _WIN32_WINNT 0x0500 | |
#include <windows.h> | |
#include <commctrl.h> | |
#include <winuser.h> | |
#include <tchar.h> | |
HWND GetDesktopListViewHWND() | |
{ |
function Sine(ctx) { | |
this.sampleRate = ctx.sampleRate; | |
this.processor = ctx.createScriptProcessor(512,0,1) | |
this.processor.connect(ctx.destination); | |
this.offset = 0; | |
} | |
Sine.prototype.play = function(freq) { | |
this.processor.onaudioprocess = function(e) { | |
var out = e.outputBuffer.getChannelData(0); |
String fileType = StringUtils.substringAfterLast(file.getOriginalFilename(), "."); | |
ImageWriter writer = ImageIO.getImageWritersByFormatName("jpeg").next(); | |
ImageWriteParam param = writer.getDefaultWriteParam(); | |
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); | |
param.setCompressionQuality(0.70f); | |
ByteArrayOutputStream os = new ByteArrayOutputStream(); | |
writer.setOutput(os); | |
This gist is an updated version of https://github.com/ariya/phantomjs/blob/master/examples/technews.js
To run, just type (in a command line)
phantomjs news.js
import java.util.Map; | |
import java.util.HashMap; | |
public class TestShallowCopy { | |
public static void main(String[] args) { | |
Map<String, Integer> a = new HashMap<String, Integer>(); | |
a.put("TEST", 1); | |
Map<String, Integer> b = new HashMap<String, Integer>(a); | |
Based on the Orthographic Projection Example. This will eventually create a map with real-time data pushed to it hopefully.
#How to load a CSV into MySQL
This example uses the assumption that I have a table called verse
whose schema is
describe verse;
+------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------+------+-----+---------+-------+
| book_id | int(11) | NO | PRI | NULL | |
| chapter | int(11) | NO | PRI | NULL | |
<link rel="import" href="../topeka-elements/category-images.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../core-icons/av-icons.html"> | |
<link rel="import" href="../paper-fab/paper-fab.html"> | |
<link rel="import" href="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<link rel="import" href="../paper-calculator/paper-calculator.html"> | |
<polymer-element name="my-element"> |
MySQL query that creates the data for a heatmap that takes in timezone. This will form the data necessary to produce a map like the Trulia Trends graph.
Initially I wrote a query that did not account for timezones
SELECT WEEKDAY(date_created)+1 as weekday, HOUR(date_created)+1 as hour, SUM(sub_total) as value FROM transaction WHERE voided = 0 GROUP BY weekday, hour;
This works great, if all of our customers lived in the Greenwhich Royal Observatory and shared that timezone. But as soon as we move outside that timezone, things get more complicated.
The second solution I came up with was to set an offset. And it looked like the following