Technology Musings

May 12, 2012

General / Why I Won't Be Participating in StackOverflow.com Anymore

JB

I have historically been grateful for stackoverflow.com, but I think that perhaps they may be getting overly full of themselves and self-conscious.

I have long used their site to get answers, especially to iOS questions.  It always seems that someone answers any question I might have.  I've always wanted to give back, but found that nearly every questions someone else has already answered.

So the other day I was trying to figure something out, and the answer on StackOverflow was that it was not possible.  I spent a day messing around, and actually figured out how to do it (read about it here).  So, having spent most of the morning trying to find if anyone had accomplished this, I actually found three different StackOverflow.com questions pertaining to it, as well as several sites on the Internet.  So what did I do?  I decided the best way to let people know about the answer was to write a blog post about it, and then point people to the blog to find the answer in each question.  This was going to be my way of giving back.

So what happened?  Well, two of my comments got deleted from StackOverflow, and one had a comment from a moderator attached accusing me of self-promotion!!!!  Because I solved a problem that had been outstanding for a year, and told people the answer!!!!

So, in the future, I will just post to my blog, and leave StackOverflow out of it.  You can come here for the answers.  I don't have enough brain space to deal with that kind of junk.

May 10, 2012

General / Engineering and Metaphysics 2012 Conference

JB

For those interested in engineering and theology and philosophy, this conference is for you!  I've got two talks slated for the conference - come and listen!  Lots of fascinating stuff from a number of disciplines:

www.eandm2012.com

You can see the abstract list here and the conference flyer here.

December 22, 2011

General / Enjoy Skyrim's Alchemy? Check Out Nature's Own Alchemy System

JB

If you have played The Elder Scrolls V: Skyrim, you have probably made use of their "alchemy" system.  What you may not have known is that this is based, in some degree, on the real-life practices of both ancient and modern herbalists, who combine herbs and herbal actions to produce desired effects on the body and the body's health.  

If you are interested in learning more, you should check out The Herbalist, a new iPhone/iPad/iPod/iOS app which describes a number of herbs and the actions that herbalists use them for.  In addition, you can even search the herbal database by the action you are looking for or by the specific malady for which it is often used.  It also includes information on different ways of preparing herbs for usage in tinctures, oils, infusions, lotions, and other preparations.

Anyway, if you enjoy Skyrim's alchemy, you'll love seeing how practicing herbalists make use of the same basic ideas.

May 25, 2011

General / Ideas 2011-05-25

JB

Had some thoughts today, thought I'd write them down:

Been looking at Google refine.  Some of this is pretty obvious, but I'm thinking it would be pretty awesome to port this to use on a database backend.  Basically, do the transforms on the data in the database, and, if you want, it will serialize it back out to a new table, or replace the existing one.

What would also be cool is a generalized report generator for Rails, possibly using AREL.  You could do security by defining mandatory filters for tables, limiting the tables/columns, and other things.  It could predict the time the report will take to run by using PostgreSQL's "explain" command.

May 02, 2011

General / Readings around the Web

JB

Here's a collection of links that I have open.  Just putting them here so I can close them :)

February 09, 2011

General / Fixing Clicking Hard Drives

An Old School Approach

All right - my wife's computer died today.  It gave the Apple folder-with-a-question-mark sign which says it can't find the system software.  Booting from the install disk - I found out that it couldn't even find the drive.

In addition to that, the hard drive was making clicking sounds when the computer first turned on.

I was certain that the computer was fried.

However, I dug through a bunch of forums.  Most of them agreed - if your hard drive makes a clicking noises, then it is probably dead.  I ran through all of Apple's troubleshooting steps - nothing.  It seemed that it was truly dead.

Then, at the bottom of a forum post, a poster named "deepika" gave an amazing piece of advice.  I thought it was a joke when I first read it.  But, since the hard drive was probably dead anyway, I felt it couldn't hurt.  The advice?  It seems that the drive is having trouble spinning up.  Therefore, you have to "convince" it to spin up.  How?

  1. Turn off the computer
  2. Put the computer on a flat surface
  3. Close the computer (it's a laptop)
  4. Bang on it a few times

Seriously.

And guess what?  When I turned on my wife's computer again - it worked!

June 08, 2010

General / An Index to My Old IBM DeveloperWorks Papers

JB

I often have to refer people to my old IBM DeveloperWorks papers, but it always takes so long to find them.  Therefore, I am going to post links to them all here to make them easier for me (and you) to find.  The dates were pulled from the IBM site, and some of them seem incoherent.  If I find the true release dates of the papers I'll put them in later.

Series 1: Theoretical Computer Science for Practical Computer Programmers

In this series, I introduced a lot of material that is usually only studied in theoretical computer science, and showed how it could be useful for practical programming:

 

  • Inside Memory Management (2004/11/16) - a look at a variety of ways that memory is managed in different systems.  Includes a functional memory manager (malloc/free implementation) written in C.  Covers manual memory management, reference counting systems, pooled allocation systems, and garbage collection.  Sadly, I was not aware of Apple's combination of reference counting and autorelease pools at the time I wrote this.
  • Better Programming Through Effective List Handling (2005/01/05) - this is an introduction to how linked lists work, why they are so useful for a variety of tasks, and how languages such as Scheme take advantage of them in interesting ways.  Starts in C, and includes a simple introduction to Scheme.
  • Higher Order Functions (2005/03/31) - Discusses how higher-order functions (functions that take a function as a parameter and/or functions that return a new function as a result) work and how they can be used to good benefit in programming.  Also discusses the relative equivalence of closures and objects, and when to use each one.  It begins using scheme, and then shows how to use everything in C.
  • Mastering Recursive Programming (2005/6/16) - this is an introduction to all of the fun associated with recursive programming.  It starts with a simple introduction to recursion, and moves on to how recursion can be used to write programs that are provably correct, how (and why) to convert loops to recursion, how tail-calls work, and how tail-calls are implemented in assembly language.
  • Continuations and Advanced Flow Control (2006/05/24) - continuations are an amazing, generalized flow-control construct from which you can implement just about any other flow control you want (threading, throw/catch, generators, and prolog-style backtracking computations).  The paper gives an introduction to a variety of flow-control structures (with various examples in Python, Prolog, and Java), and then shows how each one can be implemented using Scheme's continuation constructs.  Probably needed more explanation on the backtrack stuff - it's pretty amazing, but quite a bit different from the way we normally think about computation.
  • Lazy Programming and Lazy Evaluation (2006/12/18) - this is an introduction to delayed evaluation, how it is implemented, and how it can be used practically.  Shows how to use lazy evaluation to make use of infinite lists.  Examples are in Scheme and Java.

Series 2: Metaprogramming

Metaprogramming is one of my favorite subjects.  In this series I give an introduction to several kinds of metaprogramming and how they are done.  I wish I knew ruby when I wrote these, as Ruby's metaprogramming system is just awesome!

  1. Introduction to Metaprogramming (2005/10/20) - describes several metaprogramming systems, including CPP, M4, and Embedded SQL.  Then shows how and why you might want to build your own metaprogramming system.  Then I introduce Scheme's macro system, and how to do many of the same things that were in the other metaprogramming systems.
  2. Metaprogramming Using Scheme (2006/05/02) - goes in-depth on how to write metaprogramming systems with Scheme, and then shows how this creates a super-easy way to make domain-specific languages.  (Most DSLs are better done as metaprogramming systems for more general-purpose languages IMHO).  Compares the flexibility of a Scheme-based DSL to XML-based configuration languages.
  3. Enterprise Metaprogramming (2006/02/28) - describes the computational equivalence between graphical and textual metaprogramming systems, and why each one would be useful in different circumstances.  It also shows how that even with the advance in ease of use of computer programming languages, there will always be a split between the roles of a domain expert and a programmer - no tool can bridge the gap.  It then describes the Model-Driven Architecture (MDA), and how it can be used to extend the concept of metaprogramming further.  An example MDA application is given in Scheme, which produces both a set of C++ structs and corresponding SQL data definition statements from a single diagram built by the Dia program.

Assembly Language for the Power Architecture Series

When I got a PowerPC Mac I wanted to learn PowerPC assembly language, but didn't have time.  I thought, "hey, if I can convince IBM to pay me to write about it, that would give me a good excuse to learn it".  That birthed this article series:

  1. Programming Concepts and Beginning PowerPC Instructions
  2. The Art of Loading and Storing on PowerPC
  3. Programming with the PowerPC Branch Processor
  4. Function Calls and the PowerPC 64-bit ABI

PlayStation 3 Programming with the Cell Broadband Engine

IBM's Cell processor (called the Cell Broadband Engine) was the driving force behind the PS3.  It had a main processor and eight vector processors (each vector processor was a full-blown processor, though very limited).  Given the right workload, and the processor would scream.  However, if it wasn't programmed carefully, it would actually be slower than most other processors.  This is especially difficult because the vector processors actually used a different assembly language with a different memory model than the main processor.  This series walks a programmer through everything they need to know, from installing Linux on their PS3 to writing, complling, and linking their code.

  1. An Introduction to Linux on the PS3
  2. Programming the Synergistic Processing Elements of the PS3
  3. Meet the Synergistic Processing Element
  4. Program the SPU for Performance
  5. Programming the SPU in C/C++
  6. How to Make SPE and Existing Code Work Together
  7. Removing Obstacles to Speedy Performance

There was supposed to be a final paper where I applied everything to a scientific application, but I got worn out by the end and just had to stop.

October 06, 2009

General / Laps for Little Ones

JB

Support the Little Light House by sponsoring us in Laps for Little Ones

The Little Light House is one of the best ministries I've ever been involved with.  They are a Christian, private, tuition-free school for special-needs kids.  That's right, the kids who go there don't have to pay anything at all.

This isn't day-care - it's an intensive, customized program for each child.  The school day lets out at 1PM, and the staff spends the rest of the day planning each child's next day.  When a child gets to school, they have a card of things that they are going to work on that day.  It's both extremely fun and extremely helpful for the children -- and the parents.

While our oldest son, Danny, was alive, he attended the Little Light House.  His world expanded so much while he was there.  His ability to play with others and interact and do new things hinged upon the teachers at the Little Light House and their love and their help.  Danny had to be fed through a tube, received many, many, many medications at specially-timed intervals, and, if everyone was lucky, he only threw up three times a day.  Yet the Little Light House had no problems seeing to his every need while he was there, and providing every manner of therapy.  At the Little Light House, they have physical therapy, speech therapy, occupational therapy, and probably a lot of other therapies I'm not so familiar with.  And everything is done in a specifically Christian way.

Isaac had the same genetic defect that Danny had, and, had he lived long enough, would have enjoyed the services of the Little Light House as well.  As soon as we discovered his condition, we reserved him a spot there, because we knew that their help was the difference between night and day for us.

Below are pictures of Danny learning at the Little Light House.  Also, for those of you who didn't get to know Danny or Isaac, I pasted their memorial videos below.  In any case, please consider helping out the Little Light House - they have been a huge blessing to us, and to many, many, many other children.

You can donate now by going here.

Here is Danny's Memorial Video:

Isaac's Memorial Video:

A few pictures of Danny at the Little Light House if you don't have time for the video:

The picture below might look like playtime to you, but this was actually crucial for Danny.  He had problems touching a variety of surfaces - many different textures made him cry and gag and puke (yes, really).  The Little Light House worked with him to help him adjust his senses to be able to touch and play with a huge variety of textures.

May 18, 2009

General / FTP Problems with Extended Passive Mode (EPSV)

JB

I just went through many hours of trying to figure out wierd FTP problems.  It looks like Peer1 has a weird firewall which gets confused on EPSV FTP connections.  The way that the problem presented was that after login, when the FTP client attempted a directory listing (or any other command), after giving the EPSV command it would just hang.

For those who don't know, EPSV is "extended passive mode", and is a newer extension to FTP's historical passive mode (PASV), which is used to make FTP work in firewalled environments.  I really don't know much about EPSV beyond that, although I think it was developed for enhanced future compatibility with IPv6.  

Anyway, the problem is that most recent FTP clients attempt EPSV first, and then only use the traditional PASV if it fails.  Also, most recent FTP servers support EPSV.  Therefore, even if the firewall is blocking EPSV, the client will think that the command is successful, because the server is trying to do it, not knowing that it is being blocked.

I use vsftpd.  The only way I found to prevent EPSV mode is to use their command whitelisting feature, and whitelist everything except EPSV and EPRT (the extended version of the FTP PORT command).  So, here's what I added to my vsftpd.conf file, and it seems to work so far:

cmds_allowed=ABOR,CWD,DELE,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,RETR,RMD,RNFR,RNTO,SITE,SIZE,STOR,TYPE,USER,CDUP,HELP,MODE,NOOP,STAT,STOU,STRU

So now when a client attempts an EPSV command, it will respond with "550 Permission denied." and the client will usually fall back to regular PASV mode.  I wish I could have blacklisted the command rather than whitelisting all other commands, but oh well.

If you have access to the client side of the connection, and don't/can't mess with the server side, you can usually turn off extended passive mode there as well.  With curl, you need to add --disable-epsv.  With regular ftp, you need to issue the command "epsv4" after connecting.

 

 

August 27, 2008

General / Stuff you can do with Google Earth

JB