This file contains 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
public Post GetMostRecentPost() | |
{ | |
Post mostRecentPost; | |
using(var db = Mongo.Create("mongodb://localhost/BlogApp")) | |
{ | |
var posts = db.GetCollection<Post>(); | |
//create a LINQ queryable to search the DB. | |
var q = posts.AsQueryable(); |
This file contains 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 mono.samples.googlemaps; | |
import android.os.Bundle; | |
import com.google.android.maps.GeoPoint; | |
import com.google.android.maps.MapActivity; | |
import com.google.android.maps.MapController; | |
import com.google.android.maps.MapView; | |
import com.google.android.maps.Overlay; | |
import java.util.List; | |
import android.graphics.Bitmap; |
This file contains 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
using System; | |
using Android.App; | |
using Android.Content; | |
using Android.Runtime; | |
using Android.Views; | |
using Android.Widget; | |
using Android.OS; | |
namespace GoogleMaps |
This file contains 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 mono.samples.googlemaps; | |
import java.util.List; | |
public class MapReceiver{ | |
static List<Object> Coords; | |
public static void setCoordinates(List<Object> coords){ | |
Coords = coords; |
This file contains 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
[TestMethod] | |
public void RecordDispatchTest() | |
{ | |
var ads = new FlushingQueue<RecordModel> {Threshold = 2000}; | |
var noAds = new FlushingQueue<RecordModel> {Threshold = 2000}; | |
var rootDir = Directory.GetCurrentDirectory(); | |
ads.FilenameProvider = () => rootDir + "/ads_" + Guid.NewGuid() + "_ads.txt"; |
This file contains 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
import requests | |
import re | |
import os | |
import sys | |
def getFile( id ): | |
url = 'http://dl.free.fr/%s' % id | |
# get initial link |
This file contains 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
Boxes = compute_box_set(Lat,Lon,Res,Slice), | |
Results = [ GetFun(Box) || Box <- Boxes], | |
ResAcc = lists:foldl(fun(ElemDict,Acc)-> | |
dict:merge(fun(_,V1,V2)-> lists:append(V1,V2) end,ElemDict,Acc) | |
end, | |
dict:new(),Results), |
This file contains 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
void Main() | |
{ | |
var res = (from taz in new[]{0,1,2} | |
from pieds in Enumerable.Range(1,10 - taz) | |
from gifles in Enumerable.Range(1,10 - pieds - taz) | |
let productivite = gifles * 50 + pieds * 100 + taz * 200 | |
let bugs = gifles * 2 + pieds * 5 + taz * 11 | |
where bugs <= 50 | |
select new []{taz,pieds,gifles,bugs,productivite}) | |
.MaxOf(o => o[4]); |
This file contains 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
void Main() | |
{ | |
var chrono = new Stopwatch(); | |
chrono.Start(); | |
Syntouze res = null; | |
for (var i=0; i < 1000; i++) | |
res = (from taz in new[]{0,1,2} | |
from pieds in Enumerable.Range(1,10 - taz) | |
from gifles in Enumerable.Range(1,10 - pieds - taz) | |
let touze = new Syntouze{Taz=taz,Pieds=pieds,Gifles=gifles} |
This file contains 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
4> A = integer_to_list(42). | |
"42" | |
5> [C+1 || C <- A]. | |
"53" | |
6> [C+1000 || C <- A]. | |
[1052,1050] | |
OlderNewer