Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

trex eaterofcadrs posted:

holy poo poo

it is a language that lets you tell a computer how to do things

it is a programming language

Adbot
ADBOT LOVES YOU

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Tiny Bug Child posted:

it is a language that lets you tell a computer how to do things

it is a programming language

and since it's not implemented by incompetents, it's not nearly as problematic as php

CaptainMeatpants
Jun 1, 2010

i didnt actually think all yall would try to solve that thing over and over

coaxmetal
Oct 21, 2010

I flamed me own dad
so is

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

CaptainMeatpants posted:

i didnt actually think all yall would try to solve that thing over and over

you should know better

coaxmetal
Oct 21, 2010

I flamed me own dad

CaptainMeatpants posted:

i didnt actually think all yall would try to solve that thing over and over

lets do another one

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Ronald Raiden posted:

so is

do your resume in latex and make sure that's typeset

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

CaptainMeatpants posted:

i didnt actually think all yall would try to solve that thing over and over

"fizzbuzz is the programmer's stairway to heaven" - Jeffreys Atwood

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Ronald Raiden posted:

lets do another one

Write a program that reads positive integers from STDIN. For each integer, print the number of times the digit '1' occurs when counting from zero to that integer.

code:
in.txt:
1
2
5
20
30
40
82
10568

out.txt:
1
1
1
12
13
14
19
4786

That Turkey Story
Mar 30, 2003

BonzoESC posted:

man if only i could do that with other languages

... i think you're missing the point, bro

CaptainMeatpants
Jun 1, 2010

just go do project euler if you want a bunch of these, it owns

Shaggar
Apr 26, 2006
html is trash

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

That Turkey Story posted:

... i think you're missing the point, bro

- somebody who wants their compiler to implement factorials

ppp
Feb 13, 2012

by angerbot
i was going to read a book about c++ but i saw the c++ primer for c++11 comes out in like a month

tef
May 30, 2004

-> some l-system crap ->
http://jsil.org/try/ :toot:

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

code:
// Generated by JSIL v0.5.0 build 22067. See [url]http://jsil.org/[/url] for more information. 

var $asm00 = JSIL.GetAssembly("8dabd52, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");
var $asm01 = JSIL.GetAssembly("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
var $sig = new JSIL.MethodSignatureCache();

/* Generated by JSIL v0.5.0 build 22067. See [url]http://jsil.org/[/url] for more information. */ 
var $asm00 = JSIL.DeclareAssembly("8dabd52, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");

JSIL.MakeStaticClass("Program", true, [], function ($) {

  $.Method({Static:true , Public:true }, "Main", 
    $sig.get(17348, null, [], []), 
    function Main () {
      $asm01.System.Console.WriteLine("Hello JSIL World!");
    }
  );

});

double sulk
Jul 2, 2010


clicked link, safari died

Catalyst-proof
May 11, 2011

better waste some time with you

lol

Sweevo
Nov 8, 2007

i sometimes throw cables away

i mean straight into the bin without spending 10+ years in the box of might-come-in-handy-someday first

im a fucking monster

code:
static unsigned char far asmcode[3] = {0xcd,0,0xcb};

void selfmodify(unsigned char i)
{
    mycode[1] = i;
    __emit__(0x9a,(void far *)asmcode);
}

JawnV6
Jul 4, 2004

So hot ...

tef posted:

code:

$ echo -n 'lolbtuts' | sed -e 's/\(.\)/\1\
/g'| grep -v '^$' | sort | uniq -c
   1 b
   2 l
   1 o
   1 s
   2 t
   1 u
uniiiiiiixixixixixiixix
lol let's load an entire shell just to run 5 lil instructions
code:
top: cmpb $0x0, (%eax)
je exit
inc 0x40(%eax)
inc eax
jmp top
exit:

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

JawnV6 posted:

lol let's load an entire shell just to run 5 lil instructions
code:
top: cmpb $0x0, (%eax)
je exit
inc 0x40(%eax)
inc eax
jmp top
exit:

now print the result in the same format

JawnV6
Jul 4, 2004

So hot ...
mmio

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

JawnV6 posted:

lol let's load an entire shell just to run 5 lil instructions
code:
top: cmpb $0x0, (%eax)
je exit
inc 0x40(%eax)
inc eax
jmp top
exit:

at&t noooooo

<-masm babby

Shaggar
Apr 26, 2006

lol

post hole digger
Mar 21, 2011

CaptainMeatpants posted:

just go do project euler if you want a bunch of these, it owns

Could not connect to MySQL :eng99:

JawnV6
Jul 4, 2004

So hot ...

trex eaterofcadrs posted:

at&t noooooo

yah im not the biggest fan

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

JawnV6 posted:

yah im not the biggest fan

that's how intel rolls too isn't it?

newreply.php
Dec 24, 2009

Pillbug
anyone else sorta getting rid of delegation between views and using NSNotifications wherever possible? i like it for when you have lots of levels of subviews and one of them needs to tell the VC something

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



newreply.php posted:

anyone else sorta getting rid of delegation between views and using NSNotifications wherever possible? i like it for when you have lots of levels of subviews and one of them needs to tell the VC something

depends

sometimes a delegate is the easy way to go, sometimes a notification is easier

not really any reason to go 100% one or the other

JawnV6
Jul 4, 2004

So hot ...

trex eaterofcadrs posted:

that's how intel rolls too isn't it?

if there's an encoding of x86 asm, someone here is using it

i normally deal w/ something pretty close to PRM syntax

ppp
Feb 13, 2012

by angerbot
should i just write a pusha/popa macro for 64 bit x86

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

ppp posted:

should i just write a pusha/popa macro for 64 bit x86
don't write asm, that's what compilers are for

ppp
Feb 13, 2012

by angerbot
welcome to my ignore list

tef
May 30, 2004

-> some l-system crap ->

ppp posted:

welcome to my ignore list

dawwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
i learned yesterday that the game logic in grim fandango and the later monkey island games was written in lua

skeevy achievements
Feb 25, 2008

by merry exmarx

trex eaterofcadrs posted:

you can do this with clojure and actually use a lisp for real programs, it's pretty cool i highly recommend it

I've always wanted to learn a lisp and clojure seemed like a good one

any benefits other than the java integration? I dunno lisp dialects

Sulk posted:

is there a book on algorithms/data structures which is actually comprehensible without needing to know a shitload of math

cormen

Anal Tributary posted:

ok obviously that third line is ironic but the second one is real; i don't know why you'd use java for web stuff, from my limited exposure to it

shut up and listen to your elders, learn C before you learn any more toy languages du jour including obj-c which is a C bolt-on

Sulk posted:

i could, but when every time you read something/someone saying that java is miserable it becomes more and more of a turnoff to ever learn.

the only people who say that are hipsters/kids or people with some snowflake solution to sell

java the language is very small and simple, you don't need to use 15 design patterns to do simple poo poo if you don't want to and people who argue that you do are loving idiots

seriously for what 90% of all development being done anywhere? C, C++, Java and bash scripts are all you'll ever need in terms of languages, this was true 10 years ago and it's still true today

the world needs more expert C developers who know how the linux kernel works in detail, not more hipster dilettantes who've sampled every language and paradigm on earth and can only make lovely crud web apps in all of them

THE PLATFORM MASTER
Jun 3, 2008

tef how do you feel re: type erasure in java

double sulk
Jul 2, 2010

Internaut! posted:

the only people who say that are hipsters/kids or people with some snowflake solution to sell

java the language is very small and simple, you don't need to use 15 design patterns to do simple poo poo if you don't want to and people who argue that you do are loving idiots

seriously for what 90% of all development being done anywhere? C, C++, Java and bash scripts are all you'll ever need in terms of languages, this was true 10 years ago and it's still true today

the world needs more expert C developers who know how the linux kernel works in detail, not more hipster dilettantes who've sampled every language and paradigm on earth and can only make lovely crud web apps in all of them

yeah i'm starting to learn C. i've hosed around with Obj-C but i don't really feel entirely comfortable with it because i don't know C itself, and it'll make me a better programmer for learning it i think.

Toad King
Apr 23, 2008

Yeah, I'm the best

BonzoESC posted:

Write a program that reads positive integers from STDIN. For each integer, print the number of times the digit '1' occurs when counting from zero to that integer.

code:
in.txt:
1
2
5
20
30
40
82
10568

out.txt:
1
1
1
12
13
14
19
4786

code:
function countOnes(num)
{
	num = num.toString();
	var ones = 0;
	for (var i = 0, j = num.length - 1; i < num.length; i++, j--)
	{
		var power = Math.pow(10, j - 1);
		ones += power * j * num[i];
		if (num[i] > 1) ones += power * 10;
		if (num[i] == 1) ones += +num.substring(i + 1) + 1;
	}
	return ones;
}
that one actually took a while of thinking and trail/error to figure out

Adbot
ADBOT LOVES YOU

Luigi Thirty
Apr 30, 2006

Emergency confection port.

fasm

code:
ORG 7C00h

PUSH    CS
POP     DS

lea SI, data3
mov ah, 0eh

go:
    MOV AL, [SI]
    CMP AL, 0
    JZ go2
    INT 10h
    INC SI
    JMP go

go2:       
    mov ah, 02h
    mov AL, 10
    mov ch, 0
    mov cl, 1
    mov dx, 0
    mov bx, 1000h
    mov es, bx
    mov bx, 0000h
    int 13h

LEA SI, data1
MOV AH, 0Eh

a: 
    MOV AL, [SI] ;load
    CMP AL, 0
    JZ b
    INT 10h
    INC SI
    JMP a

     
b:
    MOV AH, 0
    INT 16h
           
    MOV AH, 0Eh
    INT 10h
        
    cmp AL,'y'
    je d

c:  
    MOV     AX, 0040h
    MOV     DS, AX
    MOV     w.[0072h], 0000h
    
    JMP	0FFFFh:0000h 
            
d:
    mov al,10
    mov ah,0eh
    int 10h            
            
e:
    lea si, data2
    mov ah,0eh    
    
f:
    mov al,[si]
    cmp al,0
    jz e
    int 10h
    inc si
    jmp f

data1 db 0x59,0x4F,0x53,0x50,0x4F,0x53,0x20,0x59,0x2F,0x4E,0x3F,0x0D,0x0A,0x3E,0x00   
    
data2 db 0x50,0x65,0x6e,0x75,0x73,0x20,0x00

data3 db 0x4c,0x6f,0x61,0x64,0x69,0x6e,0x67,0x20,0x59,0x4f,0x53,0x50,0x4f,0x53,0x20,0x4f,0x53,0x2e,0x2e,0x2e,0x0d,0x0a,0x00

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply