This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Volley.newRequestQueue(this).add( | |
| new JsonObjectRequest(Request.Method.GET, "http://your-url.com/file.json", null, | |
| new Response.Listener<JSONObject>() { | |
| @Override | |
| public void onResponse(JSONObject response) {} // what happens on success? | |
| }, new Response.ErrorListener() { | |
| @Override | |
| public void onErrorResponse(VolleyError error) {} // what happens on fail? | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "name": "Raw Vega Diet", | |
| "recent": [ | |
| { | |
| "date": "2013-09-11", | |
| "name": "Potato Soup", | |
| "desc": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", | |
| "pic": "http://img4-1.myrecipes.timeinc.net/i/recipes/ck/03142008/potato-soup-ck-223873-l.jpg" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // dodajesz gdzieś raz do bibliotek | |
| function goforit() { | |
| if( active ) { | |
| var args = Array.prototype.slice.call(arguments, 0); | |
| (args.shift()).apply(null, args); | |
| } | |
| return active; | |
| } | |
| // funkcje do uruchomienia |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function proceed() { | |
| if( active ) { | |
| var args = Array.prototype.slice.call(arguments, 0); | |
| (args.shift()).apply(null, args); | |
| } | |
| return active; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Teleport = function() {}; | |
| Teleport._rixits = "0123456789" | |
| + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
| + "abcdefghijklmnopqrstuvwxyz" | |
| + "-_"; | |
| Teleport.numberToHash = function( n ) { | |
| if( isNaN(Number(n)) || n===null || n===Number.POSITIVE_INFINITY || n<0 ) throw "The input is not valid"; | |
| n = Math.floor( n ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Base64 = function(){}; | |
| Base64._rixits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; | |
| Base64.toHash = function( n ) { | |
| if( isNaN(Number(n)) || n===null || n===Number.POSITIVE_INFINITY || n<0 ) throw "The input is not valid"; | |
| n = Math.floor( n ); | |
| var result = ''; | |
| do result = this._rixits.charAt(n%64) + result; | |
| while( n=Math.floor(n/64) ); | |
| return result; // String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mtgox.api; | |
| import java.net.HttpURLConnection; | |
| import java.net.URL; | |
| import java.net.URLEncoder; | |
| import java.util.HashMap; | |
| import java.util.logging.Level; | |
| import java.util.logging.Logger; | |
| import javax.crypto.Mac; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function f(n){var m=Math,s=m.sqrt(5),g=(1+s)/2,p=m.pow;return m.round((p(g,n)-p(1-g,n))/s);} // accurate version | |
| var m=Math,s=m.sqrt(5),g=(1+s)/2,p=m.pow,f=function(n){return m.round((p(g,n)-p(1-g,n))/s)}; // accurate w/pre-calculating | |
| function f(n){var m=Math,s=m.sqrt(5),g=(1+s)/2,p=m.pow;return((p(g,n)-p(1-g,n))/s);} // inaccurate version | |
| var m=Math,s=m.sqrt(5),g=(1+s)/2,p=m.pow,f=function(n){return((p(g,n)-p(1-g,n))/s)}; // inacurate w/pre-calculating |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| do { | |
| try { | |
| some_new_great_idea(); | |
| great_success = true; | |
| } catch( UtterFailure uf ) { | |
| improve_or_change_idea_based_on( uf, ++experience ); | |
| continue; | |
| } |