Skip to content

Instantly share code, notes, and snippets.

@willyum
willyum / part2.md
Created January 7, 2012 22:45
Demystifying the Fourier Analysis

The Fourier transform is a powerful tool often used in digital signal processing to convert signals from the time domain into the frequency domain and vice versa. Though the math complete this conversion is some complicated calculus, the basic concept of Fourier analysis is actually quite simple with the help of some examples.

A simple alternating current, such as one from a electric outlet in the US, typically runs 120 volts at 60 hertz. On a time domain graph, with time on the x-axis and voltage on the y-axis, this current would look like a sine wave with its magnitude alternating between -120 and +120 volts, hence an alternating current. If this current was analyzed after a Fourier transform, the signal can be graphed in the frequency domain, with frequency on the x-axis and voltage on the y-axis. The results are what is called the frequency components of the wave. Using the example of the alternating electrical current, there is

@willyum
willyum / gist:1888260
Created February 22, 2012 23:12
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+X delete line
Ctrl+↩ insert line after
Ctrl+⇧+↩ insert line before
Ctrl+⇧+↑ move line (or selection) up
@willyum
willyum / gist:3006279
Created June 27, 2012 19:32
android crash
D/AndroidRuntime(23094): Shutting down VM
W/dalvikvm(23094): threadid=1: thread exiting with uncaught exception (group=0x4001e568)
E/TiApplication(23094): (main) [4662,6642] Sending event: exception on thread: main msg:java.lang.IllegalStateException: Ambiguous Z-Order; Titanium 2.0.2,2012/05/30 10:2
1,2ff31a3
E/TiApplication(23094): java.lang.IllegalStateException: Ambiguous Z-Order
E/TiApplication(23094): at org.appcelerator.titanium.view.TiCompositeLayout$1.compare(TiCompositeLayout.java:149)
E/TiApplication(23094): at org.appcelerator.titanium.view.TiCompositeLayout$1.compare(TiCompositeLayout.java:112)
E/TiApplication(23094): at java.util.TreeMap.find(TreeMap.java:277)
E/TiApplication(23094): at java.util.TreeMap.putInternal(TreeMap.java:240)
>> api = o.website.connect
=> #<BigCommerce::Api:0x7f0a6b7b8078 @connection=#<BigCommerce::Connection:0x7f0a6b7b7fd8 @configuration={:username=>"admin", :store_url=>"https://store-q1sd.mybigcommerce.com", :api_key=>"d896ca78aa59ba5ff298a08919ff31f765d72ef2"}>>
>> bo = api.get_order o.store_id
=> {"staff_notes"=>"", "ip_address"=>"108.162.13.146", "refunded_amount"=>"0.0000", "wrapping_cost_tax_class_id"=>3, "wrapping_cost_inc_tax"=>"0.0000", "handling_cost_inc_tax"=>"3.0000", "subtotal_inc_tax"=>"1951.7100", "date_created"=>"Thu, 21 Nov 2013 14:53:32 +0000", "coupon_discount"=>"0.0000", "currency_code"=>"USD", "geoip_country_iso2"=>"US", "payment_provider_id"=>"5709131489", "items_shipped"=>0, "total_ex_tax"=>"1966.2700", "wrapping_cost_tax"=>"0.0000", "shipping_cost_tax"=>"0.0000", "date_shipped"=>"", "customer_id"=>50, "products"=>{"url"=>"https://www.sportsmanslogistics.com/api/v2/orders/13221/products.json", "resource"=>"/orders/13221/products"}, "shipping_address_count"=>1, "currency_exchange_rate"=>"1.0
@willyum
willyum / gist:8391426
Created January 12, 2014 22:17
Ready Force Ambassador program
The idea:
Campus Ambassadors will significantly contribute to the growth and use of Readyforce at their university through on-campus events and initiatives throughout the semester.
Ambassadors will be directly responsible for:
growth--increasing the number of new student and company users on Readyforce by representing and pitching Readyforce at events, such as technical career fairs and hackathons.
research--identifying Readyforce’s target student engineering population on your campus and providing robust information about the program (important dates, locations, events, stats, etc.)
education--evangelizing Readyforce on campus by marketing to engineering student groups and student leaders through presentations, social media and email marketing.
More details
> 1..count.step(100).each {|p| to = [p + api_limit - 1, count].min; Order.threed_cart_orders_by_chunk(http://website.id, p, to, count, api_limit, start_time, false)}
{"level":"INFO","body":{"details":"Fetched 1 orders from http://www.laprimawholesale.com, using startNum 9 and dateFrom 2014-03-27 19:11:05 UTC. Took 0.401901960372925 seconds to fetch, and 0.00239109992980957 seconds for post-processing."},"context":{},"fullname":"rails::ThreedCart::Api"}
{"level":"INFO","body":{"details":"9 orders processed for Website ID: 2960. Calling import_modified_threed_cart_orders"},"context":{},"fullname":"rails::models::Order"}
{"level":"INFO","body":{"details":"Updating orders_imported_at for website: 2960 with timestamp: 2014-03-27 19:08:53 UTC. Previous value was 2014-03-27 19:11:05 UTC"},"context":{},"fullname":"rails::models::Order"}
{"level":"INFO","body":{"details":"Fetched 0 orders from http://www.laprimawholesale.com, using startNum 10 and dateFrom 2014-03-27 19:03:53 UTC. Took 0.339008092880249 seconds to fet
321-209-5464
<?xml version="1.0" encoding="utf-8" ?>
<order>
<!--customer id - this will be provided to you, and you will always use the same one -->
<ctid>5B15B4E19BAD45B7920ACB4A4064F234</ctid>
<!--the delivery address to ship this order to; this allows "drop-ship" orders as needed -->
<shpaddr>
<name>Ship to Customer Name Here</name>
<street1>123 any street</street1>
<street2>2nd line of street</street2>
<city>ship city</city>
<?xml version=“1.0” encoding=“utf-8”?>
<Order>
<ctid>B4A1A51DCBCE48AF8EC648D28E922873</ctid>
<itemlist>
<item prodid="PA6695" quantity="1">
</item>
</itemlist>
<shpaddr>
<city>Vienna</city>
<name>Robert P. Simons</name>
@willyum
willyum / gist:65e7622a6e7402bcdb3f
Last active March 23, 2023 12:22
Education is Our Generation's Big Problem. Let's Fix it.

#Education is Our Generation's Big Problem

Education in Crisis

Education in the United States is nearing crisis. According to a recently released government report, total student loan debt in the United States is estimated at more than 1 trillion dollars, surpassing total credit card debt and putting it at more than 40% of all consumer debt in the United States.

Student default rates tell the most chilling story. In 2009, the Department of Education reported that 8.8% of students who graduated in 2009 defaulted on their loans within 2 years of graduation.

The 8.8% figure only shows part of the story. The DoE's 2 year default tracking window hardly captures the problem , given that the first payment can be [deferred up to 420 days] (h