Skip to content

Instantly share code, notes, and snippets.

View archie's full-sized avatar
😃

Marcus Ljungblad archie

😃
View GitHub Profile
@archie
archie / Viewer.java
Last active August 29, 2015 13:57
Exploring wildcard types, or the so called question mark type, in Java.
package wild;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Viewer {
public void process1(List<Object> items) {
for (Object i : items)
public void process3(java.util.List<?>);
Code:
0: aload_1
1: invokeinterface #2, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
6: astore_2
7: aload_2
8: invokeinterface #3, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z
13: ifeq 31
16: aload_2
17: invokeinterface #4, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;

Demokratiappen API

Draft 1

Inspiration gathered from Foursquare and Bit.ly APIs.

Guidelines

Request/Response formats

@archie
archie / gist:11136979
Created April 21, 2014 09:05
curl -I aftonbladet.se
% curl -I www.aftonbladet.se
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=edge,chrome=1
Content-Type: text/html;charset=utf-8
Vary: Accept-Encoding,X-AB-Device-Type
X-Varnish: 1951083729
Via: 1.1 varnish
Cache-Control: private,s-maxage=0
@archie
archie / upptec_pipes.ex
Last active August 29, 2015 14:01
Playing with pipes in Elixir
defmodule Upptec do
def study(topics, match) do
Stream.filter(topics, fn topic -> Regex.match?(match, topic) end)
end
def consider(topics, time_available) do
Stream.map(topics, fn topic ->
duration = :random.uniform(time_available)
{topic, duration}
end)
@archie
archie / notes.txt
Created June 29, 2015 20:06
Notes from More Women in Tech meetup #cphftw
Sponsors
Rainmaking Loft
- how do we look at startups, not only funding and practical stuff
- looking at diversity as a metric when deciding who can stay at the loft
IBM
- contributing in a wide capacity
- Women in Tech 51% overall, 26% in IT
- 3% tech companies are funded by women, 6.5 % have female ceo, venture backed
- 12% of CS degrees, in the 80s same fig was 37%, 2012 18%
do_set_trace_flags(Tracer,Args,How) ->
Fun=fun({Proc,Flags}) ->
case check_traceflag_pidspec(Proc) of
{ok,Proc2} -> % Reg-names converted.
case check_flags(Flags) of
Flags2 when is_list(Flags2) -> % No error!
case (catch
case How of
true ->
erlang:trace(Proc2,
Starting eqc version 1.162 (compiled at {{2009,4,8},{13,40,53}})
prop_client_put: Failed! Reason:
{'EXIT',{badarg,[{lists,member,
[seven,
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]|
8]|
7]|
5]|
4]|
2]|
/* API Mapping ---------------------------------------------------------------*/
#ifndef RTE_CORE
#define Rte_Receive_RXIface1_RxSig001 Rte_Receive_SwcPubSub_RXIface1_RxSig001
#define Rte_Write_TxIface1_TxSig001 Rte_Write_SwcPubSub_TxIface1_TxSig001
#define Rte_Feedback_TxIface1_TxSig001 Rte_Feedback_SwcPubSub_TxIface1_TxSig001
#define Rte_Pim_mem() ((Rte_Inst_SwcPubSub->Pim_mem))
#endif
/* Port handle API Mapping ---------------------------------------------------*/
#ifndef RTE_CORE
import os, glob
import subprocess
path = 'cases/ex/'
if len(sys.argv) > 1:
path = sys.argv[1]
files = glob.glob(os.path.join(path, '*.txt'))
times = []
times_all = {}