Profile

Cover photo
Simon Lindgren
46 followers|15,898 views
AboutPostsPhotosVideos

Stream

Simon Lindgren

General Discussion  - 
 
Write yourself a Quine for fun (and profit?)!

This is a fairly well known puzzle. The point is to write a program that prints the source code of itself to the terminal when run, without reading and printing the source file itself.

On linux a good way to test the program is this (assuming C code, replace as required for other languages):
$ gcc quine.c
$ ./a.out > quine2.c
$ diff -u quine.c quine2.c

If the last command prints nothing, it works :)

Now, make the program as short as possible. My best for C is a 105 byte source file. Can you do better? No cheating!

A word of advice: This can easily be googled, especielly now that you know it's called a quine. However, doing that will spoil the satisfaction of solving it, because when you read a solution you pretty much can't unlearn it (and the core concept of most solutions is pretty simple).
1
Ginter Dazune's profile photoSimon Lindgren's profile photo
2 comments
 
+Ginter Dazune You are breaking the rules (by reading the source file and printing it) :)
Add a comment...

Simon Lindgren

General Discussion  - 
 
Workplace/Tooling question:

In your experience, do software companies generally buy the best possible tools? That means that if you code in java, do you use IntelliJ or are you stuck with Eclipse (debatable probably, but I consider eclipse inferior). If C#/F#, which edition of visual studio? Do the company shell out for addons and more tools like Resharper, dotTrace, JRebel, JProfiler, etc?

And what are the signs of companies that do/don't invest in good tooling?

I ask from my own perspective as a soon to be CS Masters graduate.

EDIT: I'm not trying to evaluate companies here... I want to get a feel for what is "typical" in the industry.
1
Simon Lindgren's profile photoNathan Wheeler's profile photo
12 comments
 
In my experience with 3 different companies, most will shell out the money for "the best tools required". That is, in a choice between a free "nice-to-have" and a slightly better, but paid "nice-to-have", you'll get the free version. However, with things you actually need, you'll get the best thing available to do your job.

For instance, once it took me about 6 months to get a hard drive approved, but I had an MSDN Ultimate subscription.
Add a comment...

Simon Lindgren

Shared publicly  - 
 
traceroute 216.81.59.173 -m 60

That is all.
1
Add a comment...

Simon Lindgren

Shared publicly  - 
 
It works, bitches.
2
Simon Lindgren's profile photo
 
Kom ihåg att +1:a orginalinlägget, annars blir miljonen svår att nå ;)
 ·  Translate
Add a comment...

Simon Lindgren

Shared publicly  - 
 
... och till slut får vi ett bra DRM-system :)
 
I bought a digital video download today that required a video player from Leaping Brain. As usual, the proprietary player wasn't great and to transfer it to my iPhone I'd need another proprietary player. Ugh. But I browsed around and found that the video had been downloaded into a hidden directory as a bunch of .mov files. Great, except none of the files would play.

It turned out the actual player, launched from their compiled app, was a Python wrapper around some VLC libraries. Nothing funny going on, as far as I could tell, but when I tried to launch the player directly, nothing happened. The compiled app was modifying the .mov files right before they were loaded into the player, and then reverting the file on disk. According to http://leapingbrain.com/mod-machine/faq/:

 "We apply our BrainTrust™ proprietary video encryption to your movies before we upload them to our servers. If someone ever was able to gain access to your content, the files would be useless and unplayable, because they are stored in a scrambled, encrypted format. Once downloaded to the user’s hard drive, the files are still encrypted and only readable via the MOD Machine Player by a legitimate owner. We are not aware of a better DRM scheme than ours. Where Windows Media DRM is easily crackable, and doesn’t run on Macs, BrainTrust™ works great on Windows 8, Vista, Windows XP and Mac, and is virtually uncrackable."

Virtually uncrackable? Well, since they load the file from a Python script, it's easy to make a copy of the "decrypted" file before it's reverted. Having done so, I was curious to see the encryption scheme. By comparing the binary files, I discovered the "proprietary video encryption" algorithm: for the first 15kB, each 1kB block has its initial bytes xor'd with the string "RANDOM_STRING". That's the "scrambled, encrypted format" that leaves these files "useless and unplayable".
1
Add a comment...
Have him in circles
46 people
Urban Sundstrom (Ⓟ)'s profile photo
Noah Benzing's profile photo
Feber's profile photo
Sagar More's profile photo
Simon Milvert's profile photo
Samuel M's profile photo
Cheryl Summitt's profile photo
Martin Nielsen-Lönn's profile photo
Robert Norlander's profile photo

Simon Lindgren

General Discussion  - 
 
Computer Science warning: This would be considered a programming system implementation detail for most real programming tasks. It is likely a little off-topic for this group. Still, I'll give the topic a shot.

I want to discuss garbage collectors :)
There are a couple of classes of collectors that I find relevant for the discussion/that I know of:
1. Mark and Sweep. Simple, stops all threads and looks at all the memory each time collection is necessary. For instance the Boehm GC.
2. Generational GC. Stops all threads in the program, splits the memory into generations to optimize according to the hypothesis that most objects die young. Examples: The JVM CMS collector, Mono SGen, V8 (I think), future version of Firefox.
3. Concurrent GC. Allows the program to run concurrently with the garbage collector. Many collectors are a little concurrent, but the only example I know of a completely concurrent GC is Azul Systems C4.

Some potential discussion directions:
 * What are current research directions for GCs?
 * What type of GC do you think will be common in the future?'
   * My opinion is that concurrent GC will be the future. Do you agree, and when will we get there?
 * Will we get production GCs that integrate with the OS (for instance to minimize the impact of swapping, I've seen a paper about this before)?

Just chat away about how different VMs/runtime solves these things and other interesting observations you may have made :)
1
Edgar Brown's profile photoSimon Lindgren's profile photo
11 comments
 
+Erik Poupaert Vala can probably not add a real gc, because it would break compatibility with C libraries (and also leave cruft in the language, since weak pointers have a special keyword).

I also think that the C-and-scripting approach is more a special case of a DSL, and that can be implemented in other languages too (although C has the advantage that special purpose api can be added easily to some scripting languages simply because everything interoperates with C) 
Add a comment...

Simon Lindgren

Discussion  - 
 
First comment is negative, and then the rest of the thread keeps backing systemd as a great piece of software, calling the first comment baseless. You must be doing something right! :)
Phoronix: Systemd 198 Brings "Many Big Changes" Lennart Poettering has announced the release of systemd 198, which he describes as bringing "many big changes" to this common Linux system service an...
11
2
Koen Kooi's profile photoCristian Rodriguez's profile photoBård Aase's profile photo
Koen Kooi
+
1
1
2
1
 
I especially like this one:

  This is SANE software, developed in the OPEN, by a DIVERSE group of TALENTED hackers, supported by HEALTY COMPANIES, working on EQUAL AND FAIR TERMS without contributor licenses derailing freedom. Why wait for a space cowboy to deorbit and serve you crappy CLAed skunkwork?
Add a comment...

Simon Lindgren

Shared publicly  - 
 
Laglig censur?
 
Press Release #PPUK BPI Legal action - BPI Legal action The proxy server the Pirate Party UK initially provided in solidarity with other parties in Europe, but later as an anti-censorship resource for UK users, has now been been removed. Loz Kaye made the following statement: Elected members of the party's National Executive Committee, along with the head of IT, received letters from lawyers acting for British Phonographic Industry (BPI), threatening them personally wit... http://ow.ly/2tPUR8
1
Add a comment...
 
Vad tycker vi om detta då?

Jag är personligen inte så glad över att kanske få se patentkrig av amerikanska proportioner på hemmaplan. Jag undrar: är det för sent att stoppa detta?

http://www.bbc.co.uk/news/technology-20679665
 ·  Translate
2
Johan Öbrell's profile photoTobias Harms's profile photoEinar Emilsson's profile photoSimon Lindgren's profile photo
15 comments
 
+Einar Emilsson Fast enligt artikeln lämnar man nu över kontrollen över patentsystemet till en organisation som i nuläget är för mjukvarupatent, trots att det inte finns i den europeiska patentlagen.

Dessutom: Förra året jobbade jag på ett litet nystartat företag, som hade en patentansökan på gång. Jag frågade varför och fick inte svaret "För att det är en uppfinning värd att patentera" utan "För att när vår produkt kommer ut på marknaden kommer de etablerade spelarna att lägga ut ett gigantiskt minfält av patent runt vår produkt".

Jag ser inte heller hur ett litet företag ska ha råd att processa mot ens en lite större konkurrent.
 ·  Translate
Add a comment...

Simon Lindgren

Shared publicly  - 
 
 
Ska det gå till på det här viset? Sprid. If the retailer, in this case Amazon, thinks you’re a crook, they will throw you out and take away everything that you bought.

edit: Tips om hur man tar bort DRM från Amazon Kindle-böcker: http://www.ismoothblog.com/2012/07/calibre-free-drm-removal-for-amazon.html
Bekkelund.net er en blogg av Martin Bekkelund om IT, politikk og friluftsliv
1
Add a comment...
People
Have him in circles
46 people
Urban Sundstrom (Ⓟ)'s profile photo
Noah Benzing's profile photo
Feber's profile photo
Sagar More's profile photo
Simon Milvert's profile photo
Samuel M's profile photo
Cheryl Summitt's profile photo
Martin Nielsen-Lönn's profile photo
Robert Norlander's profile photo
Links
Basic Information
Gender
Male