Search Amazon.com:
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 $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
«533 »
  • Post
  • Reply
text editor
Jan 8, 2007



Dr. Honked posted:

drat i never thought about it that way.. all those great programmers who have slipped through my fingers....

if i can typing at 105wpm then any one-liner i write is just letting my typist skills languish

Adbot
ADBOT LOVES YOU

text editor
Jan 8, 2007



the best programming language is all of them, because anyone who has mastered the magic of CORBA can freely write his individual services in whatever language sounds good right now

Carthag
Oct 15, 2005

CRAPPYSNAPS.COM IS A RED HERRING YOU BASTARDS!

objective c best c

Werthog 95
Nov 21, 2006

Where do you want to post today?


i liked objective c in school but i feel like i wouldn't have understood it as well if i didn't already know c

Inverse Icarus
Dec 4, 2003

The only way to go is up.



Werthog posted:

welp have fun working at best buy again

abraham linksys
Sep 6, 2010

ASK ME ABOUT GETTING REAL MAD IN A SECRET SANTA FOR RECEIVING THE EXACT GAG PRESENT I ASKED FOR AND THEN DOING A COMPLETE U-TURN WHEN I REALISED IT WASN'T EVEN THE ENTIRE PRESENT

horns.aiff

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

Anal Tributary posted:

_.each(string.split(""), function(char) { counts[char] = counts[char]+1 || 1 }); is a cool one-liner but it's not like there's anything with just using a for loop

one liners are masturbation

code:
_.chain("abcaddaaaa".split(""))
 .groupBy(_.identity)
 .each(function (v,k) { 
	console.log(k+' = '+v.length); });

NeoHentaiMaster
Jul 13, 2004
More well adjusted then you'd think.

code:
my $string = "sdfk2kfjdsk4jdofidvlb"; my $char_counts = {}; $char_counts->{$_}++ for split("", $string); print Dumper $char_counts
Can I have a programming job now this sysadmin things getting old.

Milkie Galore
Dec 27, 2006





Anal Tributary posted:

_.each(string.split(""), function(char) { counts[char] = counts[char]+1 || 1 }); is a cool one-liner but it's not like there's anything with just using a for loop

stop trying to shoehorn imperative code into fp


_.map(
  _.groupBy(s.split(''), _.identity),
  function(e){
    return {letter:e[0], count:e.length};
  }
)


or u can chain it like what t-rex said yea

TOO SCSI FOR MY CAT
Oct 12, 2008

this is what happens when you take UI design away from engineers and give it to a bunch of hipster art student "designers"


Shaggar posted:

oh yeah? whats the difference?
a map is implemented using trees (typically binary)

a dictionary is implemented using hash tables

both a map and a dictionary are associative containers.

there is no such thing as an "associative array".

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror


Janin posted:

there is no such thing as an "associative array".

there is in php.

That Turkey Story
Mar 30, 2003



I like C++.

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

Janin posted:

a map is implemented using trees (typically binary)

a dictionary is implemented using hash tables

both a map and a dictionary are associative containers.

there is no such thing as an "associative array".

i'm sure you are aware that java has treemap and hashmap for those distinctions

That Turkey Story
Mar 30, 2003



Anal Tributary posted:

i don't get java and c++ folks

i mean if its web stuff just use python or ruby?

if its local stuff that has to go fast use go, or maybe rust?

it boggles teh mind

lol yeah, okay

Sneaking Mission
Nov 11, 2008




That Turkey Story posted:

I like C++.

check his post count guys i think hes trolling

Ronald Raiden
Oct 21, 2010

 


Janin posted:

a map is implemented using trees (typically binary)

a dictionary is implemented using hash tables

both a map and a dictionary are associative containers.

there is no such thing as an "associative array".

Wikipedia says all of them are the same thing owned

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.

The thing that most boggled my mind when i learned basic C++ is what you do if you want to define special behaviour of the postincrement and preincrement operators for your custom datatype.

you can define both, but because just writing "function ++ ()..." or whatever (i cant remember the syntax and dont care) would be ambiguous which one you meant, they are distinguished by the rule that for one of them you pass the method no parameters and for the other one you pass an unused integer parameter.

i want to know who in the gently caress came up with that and was it a joke that got taken seriously.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


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

Carthag
Oct 15, 2005

CRAPPYSNAPS.COM IS A RED HERRING YOU BASTARDS!

NSString *bah = @"figvdfivdafvdafv fd gvdair fgeifv sivfs fuwf FUAS ";
NSMutableDictionary *counts = [NSMutableDictionary dictionary];

[bah enumerateSubstringsInRange:NSMakeRange(0, [bah length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
NSUInteger val = ([counts objectForKey:substring] != nil ? [[counts objectForKey:substring] intValue] : 0) + 1;
[counts setObject:[NSNumber numberWithInt:val] forKey:substring];
}];

NSLog(@"counts: %@", counts);

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror


php:
<?
foreach (str_split($thestring) as $letter$pieces[$letter]++;
var_dump($pieces);?>

That Turkey Story
Mar 30, 2003



It's amazing how many bad programmers get upset you break it to them that C++ is actually a great language.

Sweevo
Nov 8, 2007



every criticism of c++ is literally "bloo bloo syntax"

Ronald Raiden
Oct 21, 2010

 


Carthag posted:

NSString *bah = @"figvdfivdafvdafv fd gvdair fgeifv sivfs fuwf FUAS ";
NSMutableDictionary *counts = [NSMutableDictionary dictionary];

[bah enumerateSubstringsInRange:NSMakeRange(0, [bah length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
NSUInteger val = ([counts objectForKey:substring] != nil ? [[counts objectForKey:substring] intValue] : 0) + 1;
[counts setObject:[NSNumber numberWithInt:val] forKey:substring];
}];

NSLog(@"counts: %@", counts);

hahaha



I was gonna try to do it in prolog for shits and giggles but then I decided I didn't really want to remember how to do prolog.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.

Sweevo posted:

every criticism of c++ is literally "bloo bloo syntax"

its a legitimate complaint in cases where the syntax literally makes no goddamn sense at all

Ronald Raiden
Oct 21, 2010

 


yea I don't know C++ very well but if a language has lovely syntax thats a pretty good reason not to like it, just in general.

Ronald Raiden
Oct 21, 2010

 


like php, it has confusing and inconsistent syntax

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!



Sweevo posted:

every criticism of c++ is literally "bloo bloo syntax"
same as perl

it turns out that some syntaxes are bad and c++ and perl have bad syntaxes

ppp
Feb 13, 2012

by angerbot


perl has good syntax

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


c++ is great it makes tts write effort posts apologising for the state of generic programming

i barely GNU her!
Apr 28, 2009

The machine is a piece of shit!


did u know: template metaprogramming is turing-complete

code:
#include <iostream>

template <int N> struct Factorial
{
    enum { val = Factorial<N-1>::val * N };
};

template<>
struct Factorial<0>
{
    enum { val = 1 };
};

int main()
{
    // Note this value is generated at compile time.
    // Also note that most compilers have a limit on the depth of the recursion available.
    std::cout << Factorial<4>::val << "\n";
}

my bitter bi rival
Mar 21, 2011


Ronald Raiden posted:

Wikipedia says

Dr. Honked
Jan 9, 2011

All that is visible must grow beyond itself and extend into the realm of the invisible.

html is the best programming language. whenever i get a resume with "Programming languages known: HTML" written on it i just get my cock out then and there and jizz all over the place and hire the person

my bitter bi rival
Mar 21, 2011


HTML5.....the future is now....

Ronald Raiden
Oct 21, 2010

 


nightwheat stalker posted:



u got teh joek

my bitter bi rival
Mar 21, 2011


Ronald Raiden posted:

u got teh joek

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

i barely GNU her! posted:

did u know: template metaprogramming is turing-complete


so is the haskell type inference algorithm, but i don't have a cool proof program to show off

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror


Dr. Honked posted:

html is the best programming language. whenever i get a resume with "Programming languages known: HTML" written on it i just get my cock out then and there and jizz all over the place and hire the person

html is a programming language

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

Tiny Bug Child posted:

html is a programming language

holy poo poo

ppp
Feb 13, 2012

by angerbot


nice i figured out how to make synergy work on debian so i can log in "remotely"

Adbot
ADBOT LOVES YOU

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!



i barely GNU her! posted:

did u know: template metaprogramming is turing-complete

man if only i could do that with other languages

code:
class Integer
  def factorial
    (1..self).inject(:*)
  end
end

cprog = <<EOF
#include "stdio.h"
int main() {
  puts("#{4.factorial}");
  return 0;
}
EOF

File.open('/tmp/prog.c', 'w'){|f| f.write cprog}
`cc -o /tmp/prog /tmp/prog.c`
File.delete '/tmp/prog.c'

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply
«533 »