FINALLY! SOME UPDATES! This website is being reconstructed. Some content will go away soon. If you want to see my new stuff, visit my github: https://github.com/jrcharney/.

March 12, 2013

Bianca's Project Page is up and running

Bianca's Project Page is up and running. I have some big plans for this script. Most of them I've already described on the project page and in the past couple of posts. I'm just excited to make them happen. Stay tuned to more cool stuff in the near future.

March 11, 2013

Bianca makes LaTeX SeXy

No, not the gal from the previous post, but she can do that too.

For the past week, I've been working to redevelop Scarfboy's PHPLaTeX which used dvi2ps and ImageMagick's convert. Bianca works much simpler. It uses dvipng. Both my program and his use tex which generates the .dvi file.

I still need to set up a project page for Bianca. For the moment, I am content that this project is finally complete with exception for a few tweaks I still need to make, both to Bianca and this website. I nearly broke this website to get the demo page to work, and I still want to use small file names that sites like Imgur use to post images. I also wish that I didn't need to double backslash all my backslashes. At any rate, processing this code:

\\iiint\\limits_A \\, f\\left( x,y,z \\right) \\mathrm{d} x\\,\\mathrm{d} y\\,\\mathrm{d} z = 
\\iiint\\limits_B \\, f\\left(p\\left(u,v,w\\right),q\\left(u,v,w\\right),r\\left(u,v,w\\right)\\right) \\,
\\left
\\begin{vmatrix}
\\dfrac{\\partial x}{\\partial u} &\\dfrac{\\partial x}{\\partial v} & \\dfrac{\\partial x}{\\partial w} \\\\
\\dfrac{\\partial y}{\\partial u} & \\dfrac{\\partial y}{\\partial v} & \\dfrac{\\partial y}{\\partial w} \\\\
\\dfrac{\\partial z}{\\partial u} & \\dfrac{\\partial z}{\\partial v} & \\dfrac{\\partial z}{\\partial w} \\\\
\\end{vmatrix}
\\right \\, \\mathrm{d} u\\,\\mathrm{d} v\\,\\mathrm{d} w
TeX code

Into this beautiful image:

It's all about the Jacobians, baby!

So while have the audience is now reaching for the Excedrin, the other half that is still here should be elated to know that more examples like this will be made in the future as part my my series on mathematics. A full TeX file will be shared tomorrow...wait, Daylight Savings Time! OK. Maybe later today. Good night!

March 3, 2013

Let's Talk about LaTeX!

Today we are going to talk about LaTeX!

Bianca Beauchamp
Latex? Hey! Isn't this site supposed to Safe For Work?!

NO! NOT THAT KIND OF LATEX! LaTeX!

While your browser might be foolish enough to pull up sexy pictures of Bianca Beauchamp, the LaTeX we are looking for has nothing to do with girls in PVC cat suits. In fact, the LaTeX we are talking about is not pronounced "LAY-TEKS", it's pronounced "LAY-TECH" and most often will be TyPeD LiKe ThIs when you search for it in your favorite search engine.

LaTeX is a typesetting system, and one I've been eager to implement on this site for almost a couple years now. But today we start with the Hello World part of it.

Let's start out by typing vim hello.tex in a console, then write this simple document.

\documentclass{article}
% File: hello.tex
% Info: A simple Hello World example for LaTeX

\begin{document}

\end{document}
hello.tex

Next comes the typsetting, or compiling, part of creating a LaTeX document. This is done in the bash shell.

$ latex hello.tex 
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)
 restricted \write18 enabled.
entering extended mode
(./hello.tex
LaTeX2e <2011/06/27>
Babel  and hyphenation patterns for english, dumylang, nohyphenation, loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
No file hello.aux.
[1] (./hello.aux) )
Output written on hello.dvi (1 page, 232 bytes).
Transcript written on hello.log.
$
Typesetting a simple .tex file.

So what just happened? LaTeX generated three files. hello.aux, hello.log, and hello.dvi. But what the heck is the .aux file for? And why does a .log file generate? And why does the file you wanted to display output as a .dvi file instead of a .pdf...or some image you can post to a web page? Let's answer these questions.

First, what is the .aux file? In this example we saw it generate this file.

\relax
...don't do it...when you want to go through it...

This strange one lined file only says \relax. So what is its purpose? This is a LaTeX auxiliary file. Supposedly, this file transports information from one compiler run to the next like information associated with cross-references. If it doesn't exist, it generated automatically. Again, I just want to show what LaTeX does.

As for getting rid of the file, the only solution is to just delete them afterword. (rm hello.aux).

Then there is the .log file. This will generate no matter what either, and like any .log file, will provide a log of what happened to produce the .dvi file. This file is quite long, and I have not interest in copying it verbatum to this article.

Personally, I would suggest not deleting this file (using rm hello.log) until you are satisfied with the output as the .log file may contain some important information like why some errors occurred.

Finally, there is the .dvi file. .dvi files are Device Independent Files, they are like the open source version of a PDF file, but it it isn't. That title belongs to DjVU files. (another subject for another day.)

If you want a .pdf instead of a .dvi, you will more than likely want to use pdflatex instead of latex. You use it just like latex and it produces practically the same output as latex.

So why does latex produce a .dvi instead of .pdf? When you produce you .dvi file with latex, the produced .dvi file is narrow. (See hello.dvi) When you use pdflatex, the produced .pdf file is wide. (See hello.pdf).

Lastly, what if you wanted to produce the .dvi output into an image format for the web? These are pretty popular lately. There are a few options. You could use ImageMagick to covert the .dvi into a .png or You could use dvipng which MediaWiki uses and is way better. Note, that when you use this, you will need to change the \documentclass in the .tex file from article to minimal. It turns out if you use article as you \documentclass, it will add a page number and you will get these long, narrow images. \documentclass{minimal} does not add page numbers.

\documentclass{minimal}
% File: hello.tex
% Info: A simple Hello World example for LaTeX

\begin{document}

\end{document}
hello.tex the right way this time.

I suggest using dvipng as it does not output a transparent .png file like ImageMagick which has been the biggest turnoff about using ImageMagick to do anything in general.

$ dvipng -T tight hello.dvi -o hello.png
Adding -T tight makes the image look more inline.

As an added bonus, here's what happens when you use or don't the image tightening and the color settings. (Note: using the color settings different causes a segmentation fault. You can't use -bg 'red' you need to use -bg 'rgb 1.0 0.0 0.0' for background color.)

(default)-T tight
(default)
-bg 'rgb 0.0 0.0 0.0'
-fg 'rgb 1.0 1.0 1.0'
-T: Image tightening, -bg: set the background color, -fg: set the foreground (text) color

As you can see, now that I understand this, I can now use this information to produce a script to make inline math codes! I'll work on that later. For now I want to show a more complex example. For that I need to do a few things. I first need to use the AMS Math package so that I can use equation* to omit numbering my equations. Otherwise, the equations will be automatically numbers and mess up writing a nice equation.

Ever since I saw the Householder's Method root-finding algorithm on Wikipedia a couple of weeks ago, I've been intrigued with out it can be simplified to derive Newton's Method and Halley's Method and then show the through my own interpretation on this website. The information that I have accrued the past few days has helped me to write this equation Householder's equation using this code by just doing the following steps.

$ vim householders.tex
$ latex householders.tex
$ dvipng -T tight householders.dvi -o householders.png
The typesetting process in a nutshell.

Now that is some sexy coding!

February 17, 2013

Thermos.sh v3.1a

Just a quick update before I head to bed. Thermos.sh v3.1a is available for download. With my new computer now up and running (of which there will be pictures of that soon), some improvements were made to the gawk code. So if your sensors program returns two virtual devices and four core temperatures, script now supports multi-core devices. I forgot to include the Physical ID device temperature in v3.0a, so I uploaded v3.1a.

I've got quite a bit of stuff to do including some volunteering with a couple of local organziations. Rest asure, I'll be doing a lot of stuff this year.

In the meantime, if you use Last.FM and are using Ubuntu or Debian, why not check out Last.FM's new scrobbler software for Linux. I've been using it for the past week and it is fantastic! It's got a couple of bugs going on with it like you can't open it using any of the GUI icons, but if you type into the console lastfm-scrobler & (include the ampersand so that it runs in the background), it works great. The other bug it has is that it doesn't seem to recognize my paid subscription, so if you skip ten songs on a station, you won't be able to skip anymore songs for another ten minutes. Fortunately, all you need to do is change stations to get a new set of ten skips immediately and change back to the other station. This is great, because for some reason, if you listen to just a couple of comedy albums on your personal station, Last.FM will pick out nothing but comedy tracks, most from a lot of comedians that aren't as funny.

As much as I like the late Mitch Hedberg, Last.FM can't seem to find Richard Jeni, Chris Rock, George Carlin, Richard Pryor, or a young Eddie Murphy. But it will find all sorts of other crappy comedians to play so that it doesn't play any of the industrial music that I tend to like way more than comedy tracks.

I'd move towards Spotify if it didn't try to coherse you into listening to mainstream music and if it didn't cost $9.99/month compared to the $9 I spend every three months for Last.FM. But it is good to see the Last.FM folks engage in software development. Perhaps when they are done with this project they can improve upon the random track finder. I think the problem with the one they have is that they don't use a seeded random number generator. C++ programmers should know what I'm talking about.

That's all the news there is to fit for the moment. More later.

February 8, 2013

Operation Rebuid

Today begins the official first day of a massive project I call Operation Rebuild. Parts of it were initiated last night.

Operation Rebuild is the nickname I've given to the reconstruction of my desktop, my soft skills, and a rededication to completing several projects on this site that haven't come to fruition yet due to the current hardware I have.

I may have mentioned this several times already, but this site is made possible via a netbook computer I have. Imagine the things I can do with a desktop.

The desktop will run Ubuntu 12.10, and in a couple of months 13.04. I'm not at all happy with using 12.04 LTE because for some reason it doesn't want to update the Linux Kernel like it should. I really wanted to use Linux Mint, but even with Mint's pledge support of Steam for Linux, using Ubuntu will assure quick support should anything go wrong.

But games are not the primary reason for Operation Rebuild. No really, it isn't.

Mathematica is the reason for this build. I consider myself a computer scientist. I might not work anywhere at the moment, and a lot of people mistake computer science as a field where we fix computers. If you want someone to fix your computer, go to the IT Department of your local four year university. If you want someone to break it, go to the CS Department of your local four year university. (Ha ha ha!)

Computer Science is the study of data structures and how to make programs run faster. We spend more time tinkering with the mathematics of computers than we do with the circuitry (like Electrical Engineering) or the repair (like Information Technology). A perfect example of how Computer Science is still very much a mathematical field of study is the issue we have yet to resolve on how to make a computer process matrix structures. Typically, we use a single array, just as row of data values. It wasn't until sometime in the earily 2000s most computers started supporting matrices, which in math-speak is a table of values made of rows and columns, but in CS-speak is an array of arrays. In computer science, one of the unsolved algorithm problems is looking for the fasted algorithm for multiplying two matrices. Other important, yet unresolved issues include completing integer factorization and calculating discrete logarithms in polynomial time. Thus, the deep parts of Computer Science that involve time complexity and Big O notation. It's these issues that we use mathematics to resolve.

Another thing that will more than likely not be installed on the new machine is Provoxy...at least not initially. There is something about Privoxy, which I may have mentioned before, that really gunks up installing new software. Methinks Privoxy was not intended to to be installed on workstations but routers. Of which, I got a spare Linksys Router that I've been eagerly wanted to hack and try things like DD-WRT on, but haven't got the gist of getting into the hardware part yet and applying such tweaks.

Software Defined Radio (SDR) is another project I've been anxious to get my hands on. I'd like to thank the folks at Reddit's /r/RTLSDR for enlightening me of such an affordable project that I've had my eye on for almost a decade. I'm thinking of attending a local HAM Radio organization and sitting through a meeting to learn more about how I can use this technology.

Getting a TV Card to work sounds of interest. I was at Micro Center yesterday and saw a Hauppauge WinTV-HVR-1250 that is supported by Linux with exception for the remote that comes with it. For about $70, it sounds interesting.

It should be noted that the motherboard I chose for the new computer comes with a WIFI PCIE daughterboard, which made paying extra for it so alluring especially with the antennas that came with it.

I'd really like to get my hands on a shortwave SDR and a long cable I can thread outside my window and along the backyard fence to use ans an antenna. It's a shame I can't repurpose the old DirecTV dish on my roof for radio reception and eventually transmission. I need to make friends with an electrical engineer or DXer and see what their thoughts would be on such a subject.

I'm hoping that in the next few months to buy my first HD monitor. My current setup where I hacked together converting the HDMI port to VGA for my current monitor along with Digital Amplifier is alright, but it would be nice to clear up some of the wires on my desk and have my digital amp devoted solely to streaming audio...assuming Last.FM or Android can fix the problem where my phone crashes when I hook up my phone to my Bluetooth Audio receiver. It's funny how this problem never seems to happen when I use my Bluetooth headphones.

Speaking of Last.FM, having this newer machine will allow for more program development including Saigo.FM which I've been dying to get started. Again, Netbooks and software IDEs do not mix.

I'm not really sure I want to continue Java Development with the drama Oracle has presented us. Within a week of the discovery of the major security flaw that Oracle can't seem to fix (because they aren't SUN Microsystems), The Hacker News reported that Java exploits were already being sold on the black market. I'm also glad that Fedora has decided not use MySQL anymore and instead use MariaDB. I've said it before, and I'll say it again: The only reason Oracle got stuck with Java is because they wanted to buy MySQL which SUN bought months earlier. I hope Minecraft ditches Java completely and can rewrite their regular software in C like their Pocket Edition. It would be great if it was written in Python.

But out of all the important things OpRebuild will restore is my confidence in my coding ability. You can't code on a netbook very well. You can do it on a laptop, a desktop, even a tablet with the right peripherals. But from these past couple of years, using a netbook to write code or browse the net with about 100 or so tabs open (yeah, I have a habit of doing that), is about as enjoyable as a root canal. As this netbook will be retired, it will be repurposed for media services like Plex on my Roku. I wish I could afford another netbook at least now that I understand how remote computing works with VNC. Netbooks can handle that. But the primary data processing that a desktop can do is extremely slow. I mean, it shouldn't take five minutes to copy and paste a URL into a blog post like this or all day to write one of these posts. So thank goodness this era of programming recession is over!

It's time for reconstruction! It's time for Operation Rebuild!

One more thing, this site now has a Twitter Feed! @JRCharney. Links and perhaps a widget will be added to this site very soon!

Tags

Under Construction