Skip to content

Instantly share code, notes, and snippets.

import wx
from wx.lib.floatcanvas.FloatCanvas import FloatCanvas
class FormFiche(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,"Title",size=wx.Size(300,400))
scroll=wx.ScrolledWindow(self)
x = 1000
y = 20000
canvas = FloatCanvas(scroll,size=wx.Size(x,y))
merge( [],X,X).
merge( [H|T],X,[H|T2] ):-
merge( T, X, T2 ).
/* use true, false like that:
true/\false
true/\ ~false
true\/false\/true
...etc
*/
:- op( 350, xfy, /\ ).
:- op( 350, xfy, \/ ).
:- op( 300, fx, ~ ).
:
def GetRect(self, Objects ):
if len(Objects)==0 :
return Rectangle(0,0,0,0)
path = []
for i in Objects:
for point in i.Path.Points:
path.append(point[1])
l,t = path[0]
@emad-elsaid
emad-elsaid / 3D House.cpp
Created October 18, 2010 17:44
3D House example with DirectX
// include the basic windows header files and the Direct3D header file
#include <windows.h>
#include <windowsx.h>
#include <d3d9.h>
#include <d3dx9.h>
// define the screen resolution
#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 600
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 8.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<object classid="clsid:5326AF74-24F1-4BFC-9F20-65C12BC66D6F" width="500" height="100"></object>
</OBJECT>
@emad-elsaid
emad-elsaid / gist:735471
Created December 9, 2010 23:00
Getting latest tweets using php
<?php
// getting the latest tweets
$tweets_json = file_get_contents("http://twitter.com/statuses/user_timeline/blaz_boy.json?callback=t&count=100");
// trimming the retrieved text to be pure json for PHP
$tweets_json = substr($tweets_json, 2, strlen($tweets_json)-4);
// convert to array of objects
$object = json_decode($tweets_json);
// the final desired output
$text = '';
// traverse through all the object array
the getobject algorithm steps :
input: uuid, entityName, offset
1- get file number from uuid file assume the file number to variable [FILE]
2- get from database the [ENTITYID] corresponding to entityname
3- now query lines IDs from database table ifc where table id [FILE] and entityname [ENTITYID]
4- now check the first ID from ID where ID is not in file uuid
5- get object with line id=ID and file=[FILE],
6- get related objects [RELIDs] from the references table
7- get get related object to related object ...(recursive algorithm) to get the full object tree.
8- Now we have all needed IDs in FULLIDs array
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace API1
{
class Program
{
static List<int?> history;
41.178.51.11 : Object moved
41.178.51.12 : Object moved
41.178.51.13 : Object moved
41.178.51.14 : Object moved
41.178.51.16 : Cannot get title
41.178.51.17 : Error
41.178.51.25 : Object moved
41.178.51.26 : العاب - El3ab.com
41.178.51.27 : Error
41.178.51.29 : Cannot get title