LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Blogs > MrCode
User Name
Password

Notices

This is the first "blog" of any kind I've ever had, so it's probably not the greatest...

Just a little snippet about me:

I'd like to consider myself relatively tech-savvy; obviously I use Linux (Arch to be precise; K.I.S.S. FTW), and I enjoy learning new things about computers in general (both software and hardware-related).

This blog is mostly just for whenever I feel like telling the world about my experiences with computers/Linux (or just life in general), or just posting for the hell of it.
Tech/Linux-related Stuff Mostly just random blurbs about my experiences with Linux and computers in general.
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 4228 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 3050 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 2371 Comments 1 MrCode is offline
Old

no

Posted 03-14-2011 at 10:52 PM by MrCode
Updated 04-02-2011 at 03:28 PM by MrCode (Major program revision)

Code:
#include <stdio.h>
#include <string.h>
#include <malloc.h>

int main(int argc,char** argv)
{
    char* str = malloc(1);
	
    if(argc >= 2)
    {
        int i;
        for(i = 1; i < argc; i++)
        {
            strcat(str," ");
            strcat(str,argv[i]);
        }
        
        int len = strlen(str);
...
Member
Views 716 Comments 0 MrCode is offline
Old

Power usage: it just keeps going up and up and up...

Posted 02-20-2011 at 10:39 AM by MrCode
Updated 02-20-2011 at 10:42 AM by MrCode
Tags linux

...with each new kernel, it seems.

A while back, when I was still running with kernel 2.6.34/35 (and earlier) on my lappy, PowerTOP would show idle power usage anywhere from 10.x W to the occasional dip into the single-digits. Now on kernel 2.6.37, it never goes below 11 W, and sometimes hovers around 12...this annoys me, because it does take a hit on my lappy's battery life (what once was 4+ hours is now 3- ).

The backlight is always at the lowest level when...
Member
Views 2299 Comments 3 MrCode is offline

  



All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement

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