LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

Old

C++ had lambda functions!

Posted 01-31-2013 at 01:21 AM by hydraMax (Bits and Pixels)

I'm doing a CS class which forces me to use C++. I was not very excited about this. However, I have recently be greatly encouraged by the discovery that C++ does, in fact, have lambda functions (or, more properly, anonymous functions) at least in the C++11 standard:

https://en.wikipedia.org/wiki/Anonym...ctions#C.2B.2B

Basically, the big deal here is that I can construct new functions /inside/ of other functions, and even capture variables from the context. This,...
Member
Posted in Uncategorized
Views 387 Comments 0 hydraMax is offline
Old

Too cool: Haskell Source Analysis

Posted 09-21-2012 at 08:46 PM by hydraMax (Bits and Pixels)
Updated 09-21-2012 at 08:54 PM by hydraMax

I tried out Haskell's SourceGraph program on the project I'm currently working on. It produces tons of cool dependency / analysis graphs. I saved a summary graph in SVG format at the following location:

https://frigidcode.com/ftprepo/edge/...aph-0.1.15.svg

Warning: It is only 374K in size, but it is over 22,000 pixels wide at the default size!

The project in its present form uses an event-based model with an oop-like component structure....
Member
Posted in Uncategorized
Views 548 Comments 0 hydraMax is offline
Old

gtsh: how to use Google Translate without touching a web browser

Posted 08-09-2011 at 05:49 PM by MrCode
Updated 08-09-2011 at 05:49 PM by MrCode ("Transhlate"? WTF? :p)

I present "gtsh" (Google Translate for the SHell), a tiny(!) shell script that acts as a frontend to Google Translate:

Code:
#!/bin/bash
if test -z $3; then
	echo "Usage: $0 \"<str>\" <lang1> <lang2>"
	echo "Translates string \"<str>\" from <lang1> to <lang2>"
	echo "(CLI frontend to Google Translate)"
else
	wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-$3}"
...
Member
Views 3941 Comments 1 MrCode is offline
Old

A little "fractal" I discovered…

Posted 07-20-2011 at 02:45 PM by MrCode
Updated 07-25-2011 at 03:56 AM by MrCode (tinypic dumped one of my images; replaced :D)

…while I was still learning the Windows API.

I was experimenting with (very slow) procedural image generation with SetPixel(), when I did something like this for each pixel in the image:

Code:
SetPixel(x,y,RGB((x ^ y) * (cr.right - cr.left) * 0.025,
                 (x ^ y) * (cr.right - cr.left) * 0.025,
                 (x & y) * (cr.right - cr.left) * 0.025));
…or something like that (I don't remember all the arguments...
Member
Views 3023 Comments 2 MrCode is offline
Old

My first (real) experimentation with SDL

Posted 04-20-2011 at 10:55 AM by MrCode
Updated 04-20-2011 at 02:00 PM by MrCode (stdlib.h include was unnecessary)

It's been a while since I've done any serious programming (if little demo/learning programs can be considered serious ), but I finally got around to doing some little SDL apps.

The code here is basically for learning purposes; it's not like I'm keeping hold of it with an iron grip…IOW, go ahead and use parts of it (or the whole of it) to learn from/use in your own programs/whatever. It's not like there's much here anyway.

The one whose source I'll...
Member
Views 2300 Comments 1 MrCode is offline

  



All times are GMT -5. The time now is 10:17 AM.

Main Menu

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration