Who Can Pick Out These Languages?

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 2495 Views - Last Post: 23 February 2012 - 07:40 AM

#1 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 42
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Who Can Pick Out These Languages?

Posted 10 February 2012 - 07:28 AM

I was browsing Facebook today and a few of my peers had shared this

Posted Image

After a little while I noticed the 'import's and some more code hidden in the back.

Now since I program in Java I automatically thought the imports were from there. What code do you think the rest is from?

~Crockeo

P.S. I suppose this is a little challenge (not really), so the first one to get it gets a... um... high five?

This post has been edited by BenignDesign: 10 February 2012 - 07:31 AM
Reason for edit:: Edit: FTFY. :)


Is This A Good Question/Topic? 0
  • +

Replies To: Who Can Pick Out These Languages?

#2 Kilorn  Icon User is offline

  • XNArchitect
  • member icon




Reputation: 1325
  • View blog
  • Posts: 3,504
  • Joined: 03-May 10

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 07:29 AM

EDIT: Nevermind, you fixed it.

This post has been edited by Kilorn: 10 February 2012 - 07:30 AM

Was This Post Helpful? 0
  • +
  • -

#3 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 6430
  • View blog
  • Posts: 23,409
  • Joined: 12-June 08

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 07:35 AM

I'll do the world a favor and find a larger image of this... *cough* like the OP should have done */cough*

Spoiler

Was This Post Helpful? 0
  • +
  • -

#4 Kilorn  Icon User is offline

  • XNArchitect
  • member icon




Reputation: 1325
  • View blog
  • Posts: 3,504
  • Joined: 03-May 10

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 07:40 AM

Looks to me like all of the code in the top is Java, but I can't make out the other stuff in the image.

This post has been edited by Kilorn: 10 February 2012 - 07:40 AM

Was This Post Helpful? 0
  • +
  • -

#5 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2054
  • View blog
  • Posts: 4,049
  • Joined: 24-September 10

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 07:42 AM

Looks like wild card imports in Actionscript 3.

recent AS3 file I wrote last night to test a possible bug in Flash11:
package  
{
    import flash.display.*;
    import flash.events.*;
    import flash.geom.Rectangle;
    import flash.text.TextField;
    
    [SWF(width = "1100", height = "600", frameRate = "30", backgroundColor = "#FFFFFF")]
    public class Main extends Sprite
    {
        private var _tf:TextField;
        private var _spr:Sprite;
        private var _type:int = 0;
        
        public function Main():void {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }
        
        private function init(evento:Event = null):void
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            
            this.stage.align = "TL";
            this.stage.scaleMode = "noScale";
            
            //this blue dot represents the 1000 unit mark
            this.graphics.lineStyle(1, 0xff0000);
            this.graphics.moveTo(1000, 0);
            this.graphics.lineTo(1000, 100);
            this.graphics.beginFill(0x0000FF, 1);
            this.graphics.drawCircle(1000, 100, 6);
            this.graphics.endFill();
            this.graphics.beginFill(0xff0000, 1);
            this.graphics.drawCircle(1000, 100, 1);
            this.graphics.endFill();
            
            _tf = new TextField();
            _tf.x = 100;
            _tf.y = 150;
            _tf.width = 200;
            _tf.height = 50;
            _tf.multiline = true;
            this.addChild(_tf);
            
            
            _spr = new Sprite();
            _spr.graphics.lineStyle(4, 0x000000, 1, false, "none");
            _spr.graphics.beginFill(0xff0000);
            _spr.graphics.drawRect(0,0,100,100);
            _spr.graphics.endFill();
            
            _spr.x = 2;
            _spr.y = 2;
            this.addChild(_spr);
            
            this.stage.addEventListener(MouseEvent.CLICK, onStageClick);
            
            moveWidthTypeToScreen();
        }
        
        private function onStageClick(e:Event):void
        {
            _type += 1;
            if (_type < 0 || _type > 3) _type = 0; // loop type from 0->3
            
            this.moveWidthTypeToScreen();
        }
        
        private function moveWidthTypeToScreen():void
        {
            switch(_type)
            {
                case 0 :
                    _spr.width = 1000;
                    _tf.text = "Width set by 'width' property.\n Click anywhere to change.";
                    break;
                case 1 :
                    _spr.scaleX = 1000 / _spr.getBounds(_spr).width;
                    _tf.text = "Width set by scaling off 'getBounds'.\n Click anywhere to change.";
                    break;
                    
                case 2 :
                    _spr.scaleX = 1000 / _spr.getRect(_spr).width;
                    _tf.text = "Width set by scaling off 'getRect'.\n Click anywhere to change.";
                    break;
                case 3:
                    setActualWidth(_spr, 1000);
                    _tf.text = "Width set by using hack fix.\n Click anywhere to change.";
                    break;
                
            }
        }
        
        
        
        
        private static function setActualWidth(obj:DisplayObject, w:Number):void
        {
            var sx:Number = w / obj.getRect(obj).width; //get what scale we would need to set to
            obj.scaleX = sx; //set scale
            var diff:Number = obj.getBounds(obj.parent).width - obj.getRect(obj.parent).width; //find difference off of stroke
            obj.scaleX -= diff / w; //subtract scale difference that this is of entire width to compensate for the stroke
        }
        
    }

}



Biggest clues to me are the types:

Number
NetConnection

and most notably

MovieClip

This post has been edited by lordofduct: 10 February 2012 - 07:43 AM

Was This Post Helpful? 0
  • +
  • -

#6 Kilorn  Icon User is offline

  • XNArchitect
  • member icon




Reputation: 1325
  • View blog
  • Posts: 3,504
  • Joined: 03-May 10

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 07:47 AM

MovieClip made me think it was AC3 as well, but then I remembered there was a MovieClip class in Java. There's also a NetConnection class that can be used in Java as well.
Was This Post Helpful? 0
  • +
  • -

#7 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2054
  • View blog
  • Posts: 4,049
  • Joined: 24-September 10

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 07:53 AM

Plausible, especially considering that AS3 was designed to look a lot like Java.

I leaned towards AS3 though because it is a graphical design work, and graphic designers are more likely to have experience with Actionscript than with Java.



The stuff towards the bottom though, with the begin end statements. That definitely isn't Java or AS3.

This post has been edited by lordofduct: 10 February 2012 - 07:53 AM

Was This Post Helpful? 0
  • +
  • -

#8 Kilorn  Icon User is offline

  • XNArchitect
  • member icon




Reputation: 1325
  • View blog
  • Posts: 3,504
  • Joined: 03-May 10

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 07:58 AM

The code at the bottom kind of reminds me of Pascal, but I can't be sure as I've never actually used Pascal.
Was This Post Helpful? 0
  • +
  • -

#9 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 42
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 07:59 AM

Thank you modi for finding a larger photo, I hadn't thought of that, haha.

And what made me think it was java was the imports from the left side, which I recognize from java.

import java.awt.event.*;
import java.awt.geom.*;
import java.net.*;



EDIT: Looking back at the image and lordofduct's code again it seems that it is definitely not Java. Probably just some psychological I-program-in-Java-so-everything-is-Java.

The only outlier is the '.media.*;' one.

EDIT2: But that still raises the question as to what the code on the bottom right of the Left Brain is.

EDIT3: @Kilorn: The one thing that sets me off for not-Pascal is the 'end' in there. Although I've never programmed in Pascal either based off of some code snippets it seems that it doesn't have that sort of end function.

This post has been edited by Crockeo: 10 February 2012 - 08:05 AM

Was This Post Helpful? 0
  • +
  • -

#10 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2054
  • View blog
  • Posts: 4,049
  • Joined: 24-September 10

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 08:05 AM

both java and as3 have 'media' packages...

This post has been edited by lordofduct: 10 February 2012 - 08:09 AM

Was This Post Helpful? 0
  • +
  • -

#11 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 42
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 08:06 AM

I guess I've never used it then, haha. *awkwardly shifts eyes*
Was This Post Helpful? 0
  • +
  • -

#12 Kilorn  Icon User is offline

  • XNArchitect
  • member icon




Reputation: 1325
  • View blog
  • Posts: 3,504
  • Joined: 03-May 10

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 08:09 AM

The part that throws me off is the 'sh' package that those namespaces are being imported from... Also, the code on the right at the top is exactly the same as the code that is cut off on the left hand side. Given that I can't seem to find any results from googling for a package that uses 'sh' for Java, I'm starting to think that it isn't Java. Also, the utils.Time namespace import is missing a semicolon, which wouldn't allow the code to compile, so I think that some artist that was putting this together just randomly grabbed pieces of code that they found while googling to piece something together to look like code to people who don't really write code. I guess they missed the semicolon on the copy/paste with that line.
Was This Post Helpful? 0
  • +
  • -

#13 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2054
  • View blog
  • Posts: 4,049
  • Joined: 24-September 10

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 08:09 AM

the other stuff at the bottom looks like assembly of some sort, note the accessing registries and 'load the ALU' comment.



note 'sh' could just be a custom internal namespace. Let's say this graphic designer worked in an office with some coders (AS3 or Java), and they asked from some crap code to stick in the image. 'sh' could maybe be shit code the guy threw at the artist, or maybe an internal namespace of some sort.

This post has been edited by lordofduct: 10 February 2012 - 08:12 AM

Was This Post Helpful? 0
  • +
  • -

#14 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 6430
  • View blog
  • Posts: 23,409
  • Joined: 12-June 08

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 08:13 AM

Bottom right - found the whole code.. it looks like some advertiser just copied this:

           6'b100111: begin // DAA
 
                     // decimal adjust accumulator, or remove by carry any 
                     // results in nybbles greater than 9
 
                     if (regfil[`reg_a][3:0] > 9 || auxcar)
                        { auxcar, regfil[`reg_a] } <= regfil[`reg_a]+8'h06;
                     state <= `cpus_daa; // finish DAA
                     pc <= pc+16'h1; // Next instruction byte
 
                  end
 
                  6'b000100, 6'b001100, 6'b010100, 6'b011100, 6'b100100, 
                  6'b101100, 6'b110100, 6'b111100, 6'b000101, 6'b001101, 
                  6'b010101, 6'b011101, 6'b100101, 6'b101101, 6'b110101, 
                  6'b111101: begin // INR/DCR
 
                     regd <= opcode[5:3]; // get source/destination reg
                     aluopra <= regfil[opcode[5:3]]; // load as alu a
                     aluoprb <= 1; // load 1 as alu b
                     if (opcode[0]) alusel <= `aluop_sub; // set subtract
                     else alusel <= `aluop_add; // set add
                     if (opcode[5:3] == `reg_m) begin
 
                        raddrhold <= regfil[`reg_h]<<8|regfil[`reg_l];
                        statesel <= `mac_indm; // inc/dec m
                        state <= `cpus_read; // read byte
 
                     end else state <= `cpus_indcb; // go inr/dcr cycleback

http://opencores.org...ect%2Fcpu8080.v
Was This Post Helpful? 0
  • +
  • -

#15 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 42
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: Who Can Pick Out These Languages?

Posted 10 February 2012 - 08:15 AM

Well done everyone, it's a shame it wasn't as mysterious as I first thought :/

I guess it's time to discern what exact colors those are on the right?

This post has been edited by Crockeo: 10 February 2012 - 08:17 AM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2