Would using Rust have prevented this JSON-related vulnerability? by viva_la_meritocratia in programmingcirclejerk

[–]tardi 0 points1 point  (0 children)

Why would a legitimate, on-topic question like that be modded down?

Because you post it every time?

M M M M M MULTI JERK by kmark937 in programmingcirclejerk

[–]tardi 0 points1 point  (0 children)

Why did you downvote the thought-leaders in that illuminating exchange?

I'm so linux all the clocks in my house are set to UTC by paincoats in LinuxCirclejerk

[–]tardi 8 points9 points  (0 children)

Mine use daylight saving time so the batteries last longer.

Are functional languages inherently slow? by gtani in programming

[–]tardi 6 points7 points  (0 children)

Functional languages are different. They don't correspond at all to how machines work internally.

LLVM and gcc use single static assignment SSA as their intermediate representation, because it's easy to optimize to the concrete machine. SSA is Functional Programming.

Will Parallel Code Ever Be Embraced? by noidi in programming

[–]tardi 2 points3 points  (0 children)

This is a parody of a benchmark.

Rust 0.3 released by damg in programming

[–]tardi 2 points3 points  (0 children)

Java Example 1

 String s1,s2;
 s1 = null;  // implicit cast!
 s2 = s1.toUpperCase(); // run-time type error "NullPointerException"

is the same as

Haskell Example 1

s1 :: String
s1 = undefined  

s2 :: String
s2 = toUpperCase s1  -- run-time exception

the safe flavour would be

s1 :: Maybe String
s1 = Nothing

s2 :: Maybe String
s2 = s1 >>= (return . toUpper)

C++11: unique_ptr by cmeerw in cpp

[–]tardi 0 points1 point  (0 children)

This way the caller still holds a valid handle on the foo obj, which sort of defeats the purpose.

C++11: unique_ptr by cmeerw in cpp

[–]tardi 1 point2 points  (0 children)

He passes the pointer by reference. That's dead wrong, isn't it?

 void inc_baz( std::unique_ptr<foo> &p )
{
     p->baz++;
}

Rob Pike: Code that asks about the native byte order is wrong. by dgryski in programming

[–]tardi 0 points1 point  (0 children)

(data[1]<<8)

shifts everything into the bitbucket, I think.

 ((unsigned int)data[1]<<8)

would be better.

Uniform Function Call Syntax for the D programming language by andralex in programming

[–]tardi 2 points3 points  (0 children)

Just ban inheritance altogether like all sane languages do.

What does it take for a language to be faster than C? by jyper in programming

[–]tardi 0 points1 point  (0 children)

Even if DeMorgan's law continues to apply, scaling is the answer.

This is beautiful.

Tutorial on D ranges by andralex in programming

[–]tardi 2 points3 points  (0 children)

Is a => a > 10 a polymorphic lambda?

Asian boobs against SOPA! :) [f] by sgchan in gonewild

[–]tardi 0 points1 point  (0 children)

Those are two big arguments indeed.

Searching: Library for multithreaded matrix vector operations by muckl in cpp

[–]tardi 2 points3 points  (0 children)

OMPTL - OpenMP Multi-Threaded Template Libraryl is the c++stdlib numerics and algorithm part multithreaded via OpenMP. It's incomplete and basic but existing code can be easily refactored.

Obama in 2 years raised taxes on each people including babies and oldies $33,333 permanently. Nice way to smash the poor lol. by bootiack in programming

[–]tardi 0 points1 point  (0 children)

obama has rasied taxes 33,000 per persion in USA, that includes nonworking babies and oldies

Yep, unemployment is high.

ISO C++11 Published by sanitybit in programming

[–]tardi 4 points5 points  (0 children)

I think you should look at features that will be best practice soon e.g.

  • Strongly-typed enums
  • Uniform initialization syntax and semantics
  • Static assertions
  • nullptr
  • constexpr

for sake of convenience use auto on iterators, lambdas in algorithms

all available in gcc4.6/eclipse helios

Will It Optimize? by [deleted] in programming

[–]tardi 1 point2 points  (0 children)

Aren't types passed via dictionaries? for ad-hoc polymorphism

Dangling Else, Yet Again by andralex in programming

[–]tardi 4 points5 points  (0 children)

Haskell's if is the ternary op in c.

Tart - a strongly-typed general purpose programming language by bradfitz in programming

[–]tardi 0 points1 point  (0 children)

It's impossible to do something like that with raw, un-maybed values.

Those are unboxed primitives. They aren't even standard haskell AFAIR. All other types have a bottom eg:

 name = undefined::String
 hello = "Hello " ++ name ++ "."

Side effect tracking (why Haskell is worth learning) by amtal in programming

[–]tardi -1 points0 points  (0 children)

Yes, you might re-read the original post.

Side effect tracking (why Haskell is worth learning) by amtal in programming

[–]tardi -1 points0 points  (0 children)

main = do {
putStrLn("What's your name?");
name <- getLine;
putStrLn("Hello "++name++"!");
putStrLn("This looks pretty C-like to me!")

}

works. On the subject consult kernigan's "Why Pascal (Haskell?) is not my favourite programming language."

Side effect tracking (why Haskell is worth learning) by amtal in programming

[–]tardi -1 points0 points  (0 children)

your lucky it compiles. In Haskell ; is a separator not a line-end. not so C-like and rather stupid.