Should I?

Well today i had a thought where i have spent about 3 to 4 years of my life working on my own projects and Open Source trying to learn outside of University. In my Degree path there is no Final Year project or anything, this always annoyed me. I only have 2 exams at the moment which i don’t fee that confident in. And since Gccpy is actually starting to get interesting where its starting to work and i completed my own interpreter to a decent amount crules and i created my own static compiler cmod a modula compiler for i386. I already had a thesis document started along side Gccpy and i am thinking of finishing it up this week to some extend detailing all 3 of these projects focusing on gccpy of course and handing this into my university i feel this must count towards something and i just want this monkey off my back i guess and i feel this might help. You can view the code for any of these projects over at:

code.redbrain.co.uk

Reminder the Gccpy code has been moved to the gccpy repository on that server and stable *ish code is maintined on the gccpy branch of the GCC git repository when i reach more stable code i will push the svn server also.

Gccpy Update!

I have been very quite this last long while. Things are actually finally starting to come together for me now i am about to finish my degree when i got a few job interviews out of the blue and the one i really wanted i have now got the offer for the job and i am taking it. I have 2 exams to finish and i am just studying for them at the moment but not worrying about it that much because i quite frankly just don’t care that much because it wont affect any part of my life any-more. I have dreamed of this day for years and it feels so good. I have a small dilemma in that i went for Google Summer of code again for the 3rd year for Cython my proposal you can see here: gsoc 2012 proposal . Which i don’t feel i can accept if i get accepted but i shall see the start dates for my new job are set yet as i have to wait on the paper work coming though still and i will have to complete a course on financial software. I will give more info on the job because its quite exciting when i get everything set it stone more.

 

What i want to talk about is that my project in creating a Python Front-end to GCC is finally starting to do stuff now its quite exciting as of 1 hour ago you can compile this amount of python and have it work:

 

  1.  
  2. class date:
  3.   day = 0
  4.   month = 0
  5.   year = 0
  6.   print 11
  7.  
  8.   def __init__ (self, x, y, z):
  9.     self.day = x
  10.     self.month = y
  11.     self.year = z
  12.     print 22
  13.  
  14.   def print_date (self):
  15.     print 33
  16.     print self.day, self.month, self.year
  17.     print 34
  18.  
  19. print 0
  20. x = date (1, 2, 3)
  21. print 1
  22. x.print_date ()
  23. print 2
  24. x.day = 10
  25. print 3
  26. x.print_date ()
  27. print 4
  28.  

 

Although this is an extremely basic example this shows a helluva lot in how data is accessed and addressed which is all the core of dynamic typing. Right now i am just flesing things out with conditionals and loops now which will lead me on to creating the yield instruction and returns (which is half implemented) which i plan to use Setjmp.h to implement. Which leads on to exceptions etc. Then we move on to imports and some standard library stuff before i would work on a basic garbage collector.

 

Anyone interested i output gimple code for that example:

 

  1.  
  2. t_date_1.py.__main_start__ ()
  3. {
  4.   struct gpy_object_attrib_t * D.200;
  5.   struct gpy_object_attrib_t * D.201;
  6.   struct gpy_object_attrib_t * D.202;
  7.   struct gpy_object_attrib_t * D.203;
  8.   struct gpy_object_attrib_t * D.204;
  9.   struct gpy_object_attrib_t * D.205;
  10.   struct gpy_object_t * D.206;
  11.   struct gpy_object_t * D.207;
  12.   struct gpy_object_t * * __GPY_GLOBL_RR_STACK_POINTER.37;
  13.   struct gpy_object_t * * __GPY_GLOBL_RR_STACK_POINTER.38;
  14.   struct gpy_object_t * D.210;
  15.   struct gpy_object_t * * __GPY_GLOBL_RR_STACK_POINTER.39;
  16.   struct gpy_object_t * D.212;
  17.   struct gpy_object_t * D.213;
  18.   struct gpy_object_t * * __GPY_GLOBL_RR_STACK_POINTER.40;
  19.   struct gpy_object_t * D.215;
  20.   struct gpy_object_t * * __GPY_GLOBL_RR_STACK_POINTER.41;
  21.   struct gpy_object_t * D.217;
  22.   struct gpy_object_t * * __GPY_GLOBL_RR_STACK_POINTER.42;
  23.   struct gpy_object_t * D.219;
  24.   struct gpy_object_t * D.220;
  25.   void <retval>;
  26.  
  27.   gpy_rr_extend_runtime_stack (3);
  28.   D.200 = gpy_rr_fold_attribute ("month", 0B, 20);
  29.   D.201 = gpy_rr_fold_attribute ("day", 0B, 16);
  30.   D.202 = gpy_rr_fold_attribute ("__field_init__", t_date_1.py.date.__field_init__, 12);
  31.   D.203 = gpy_rr_fold_attribute ("print_date", t_date_1.py.date.print_date, 8);
  32.   D.204 = gpy_rr_fold_attribute ("__init__", t_date_1.py.date.__init__, 4);
  33.   D.205 = gpy_rr_fold_attribute ("year", 0B, 0);
  34.   C.13 = gpy_rr_fold_attrib_list (6, D.205, D.204, D.203, D.202, D.201, D.200);
  35.   A.14 = __GPY_GLOBL_RR_STACK_POINTER;
  36.   D.206 = gpy_rr_fold_class_decl (C.13, 24, "t_date_1.py.date");
  37.   *A.14 = D.206;
  38.   P.15 = gpy_rr_fold_integer (0);
  39.   gpy_rr_eval_print (1, 1, P.15);
  40.   A.16 = __GPY_GLOBL_RR_STACK_POINTER;
  41.   P.17 = gpy_rr_fold_integer (1);
  42.   P.18 = gpy_rr_fold_integer (2);
  43.   P.19 = gpy_rr_fold_integer (3);
  44.   D.207 = *A.16;
  45.   R.20 = gpy_rr_fold_call (D.207, 3, P.17, P.18, P.19);
  46.   __GPY_GLOBL_RR_STACK_POINTER.37 = __GPY_GLOBL_RR_STACK_POINTER;
  47.   A.21 = __GPY_GLOBL_RR_STACK_POINTER.37 + -4;
  48.   *A.21 = R.20;
  49.   P.22 = gpy_rr_fold_integer (1);
  50.   gpy_rr_eval_print (1, 1, P.22);
  51.   __GPY_GLOBL_RR_STACK_POINTER.38 = __GPY_GLOBL_RR_STACK_POINTER;
  52.   A.24 = __GPY_GLOBL_RR_STACK_POINTER.38 + -4;
  53.   D.210 = *A.24;
  54.   T.23 = gpy_rr_eval_attrib_reference (D.210, "print_date");
  55.   __GPY_GLOBL_RR_STACK_POINTER.39 = __GPY_GLOBL_RR_STACK_POINTER;
  56.   A.25 = __GPY_GLOBL_RR_STACK_POINTER.39 + -4;
  57.   D.212 = *A.25;
  58.   D.213 = *T.23;
  59.   R.26 = gpy_rr_fold_call (D.213, 1, D.212);
  60.   P.27 = gpy_rr_fold_integer (2);
  61.   gpy_rr_eval_print (1, 1, P.27);
  62.   P.29 = gpy_rr_fold_integer (10);
  63.   __GPY_GLOBL_RR_STACK_POINTER.40 = __GPY_GLOBL_RR_STACK_POINTER;
  64.   A.30 = __GPY_GLOBL_RR_STACK_POINTER.40 + -4;
  65.   D.215 = *A.30;
  66.   T.28 = gpy_rr_eval_attrib_reference (D.215, "day");
  67.   *T.28 = P.29;
  68.   P.31 = gpy_rr_fold_integer (3);
  69.   gpy_rr_eval_print (1, 1, P.31);
  70.   __GPY_GLOBL_RR_STACK_POINTER.41 = __GPY_GLOBL_RR_STACK_POINTER;
  71.   A.33 = __GPY_GLOBL_RR_STACK_POINTER.41 + -4;
  72.   D.217 = *A.33;
  73.   T.32 = gpy_rr_eval_attrib_reference (D.217, "print_date");
  74.   __GPY_GLOBL_RR_STACK_POINTER.42 = __GPY_GLOBL_RR_STACK_POINTER;
  75.   A.34 = __GPY_GLOBL_RR_STACK_POINTER.42 + -4;
  76.   D.219 = *A.34;
  77.   D.220 = *T.32;
  78.   R.35 = gpy_rr_fold_call (D.220, 1, D.219);
  79.   P.36 = gpy_rr_fold_integer (4);
  80.   gpy_rr_eval_print (1, 1, P.36);
  81. }
  82.  
  83.  
  84. t_date_1.py.date.__field_init__ (struct t_date_1.py.date * __object_state__)
  85. {
  86.   void <retval>;
  87.  
  88.   P.0 = gpy_rr_fold_integer (0);
  89.   __object_state__->day = P.0;
  90.   P.1 = gpy_rr_fold_integer (0);
  91.   __object_state__->month = P.1;
  92.   P.2 = gpy_rr_fold_integer (0);
  93.   __object_state__->year = P.2;
  94.   P.3 = gpy_rr_fold_integer (11);
  95.   gpy_rr_eval_print (1, 1, P.3);
  96. }
  97.  
  98.  
  99. t_date_1.py.date.print_date (struct gpy_object_t * self, struct gpy_object_t * * __arguments__)
  100. {
  101.   struct gpy_object_t * D.116;
  102.   struct gpy_object_t * D.117;
  103.   struct gpy_object_t * D.118;
  104.   void <retval>;
  105.  
  106.   P.8 = gpy_rr_fold_integer (33);
  107.   gpy_rr_eval_print (1, 1, P.8);
  108.   T.9 = gpy_rr_eval_attrib_reference (self, "day");
  109.   T.10 = gpy_rr_eval_attrib_reference (self, "month");
  110.   T.11 = gpy_rr_eval_attrib_reference (self, "year");
  111.   D.116 = *T.11;
  112.   D.117 = *T.10;
  113.   D.118 = *T.9;
  114.   gpy_rr_eval_print (1, 3, D.118, D.117, D.116);
  115.   P.12 = gpy_rr_fold_integer (34);
  116.   gpy_rr_eval_print (1, 1, P.12);
  117. }
  118.  
  119.  
  120. t_date_1.py.date.__init__ (struct gpy_object_t * self, struct gpy_object_t * * __arguments__)
  121. {
  122.   void <retval>;
  123.  
  124.   x = *__arguments__;
  125.   y = MEM[(struct gpy_object_t * *)__arguments__ + 4B];
  126.   z = MEM[(struct gpy_object_t * *)__arguments__ + 8B];
  127.   T.4 = gpy_rr_eval_attrib_reference (self, "day");
  128.   *T.4 = x;
  129.   T.5 = gpy_rr_eval_attrib_reference (self, "month");
  130.   *T.5 = y;
  131.   T.6 = gpy_rr_eval_attrib_reference (self, "year");
  132.   *T.6 = z;
  133.   P.7 = gpy_rr_fold_integer (22);
  134.   gpy_rr_eval_print (1, 1, P.7);
  135. }
  136.  

 

Its very exciting because its taken almost 3 years of my life in my spare time and 2 Google summer of Code to get this far but finally the huge task of getting the core working its nerly there. I will need to write up alot more about this project from now because its at a state where its much easier to work with people because creating a code base from scratch which can change alot with new ideas its hard untill your sure how each part will work but when its such a big project it can be difficult unless your working together fulltime almost.

Detective Story

So the other day, was exciting something i will always remember; becoming a detective. What you say, yes well i will try to keep this mostly anonymous as i think that’s more appropriate due to the circumstances. Well a close friend of mine created a website for buying and selling cars in a foreign country which his brother lives in. So all going well website is fine bla bla, I just helped my friend system admin for the server maintaining apache, mysql, postfix etc.. the website was fairly busy.

But there was fake accounts created over time posting fake ads selling cars but most of which in-fact all were very obvious scams but one of which ads was created 5 times on this website from 5 different users with 5 different emails but each listing was exactly the same. Long and short of it one person fell for this listing and ended up wiring ~£8000 to this scammer. So the victim contacted the local police which contacted us to try and find as much details as possible on the scammer like emails ip’s etc.

As the scammer was trying to get more money out of the victim the police suggested to play along with the scammer so we can catch him in the act. But my job was to find out as much information as you can. And by god the amount of information you can figure out about someone based of server logs is scary if your clever.

So we cross referenced the times which the scammer signed up to the website each time, to get his ip and his email and checking the post data to be 100% sure we had the right ip. There were 5 instances we had to go through. 3 of which ips would origionate from exactly the same place which was a major city and isp the other 2 were in a more local rural town. And if you take more attention to the dates the first 2 sign-ups by this scammer originated from this city and occurred around June then nothing until October or so where the next 3 sign-ups occurred so this could give rise to the idea that this person moved house. We know its the same scammer each time when the listing is exactly the same each time and the trace on the ip go to the same places each time.

So yes this was an interesting day but very very interesting what you can figure out about people from their IP.