Aug 30

That was fast!

Just a couple days after the netSpeed was first published, an update was required. Ultimately, it's a handful of small bug fixes. But in the  next version I plan on adding some more functionality.

 

 

New in 1.0.1

  1. The average speed is properly calculated
  2. The timing and speed values are reset correctly when restarting a test
  3. Some more cleanup added after closing the app
Plans for next version:
  1. Graphing of the speed
  2. Saving each test setup (speed, GPS location (if applicable), time and avg. speed)
  3. Showing the high/low speed for the test
  4. Add better handling for failed tests (cancel outstanding download, show a message)
I just submitted the update to Palm now, so it should be up in the next 2-3 days.

As I have mentioned before, please direct support/questions/feedback/suggestions for netSpeed to jordan@futurepr0n.com so I can better help everyone out directly.

 

 

Tags:
Aug 23

So, I decided to finally do something with my laziness and make something productive. I've had the idea of making a simple bandwidth tester for a while since none exist (to my knowledge) so far.

The idea originally came to me when I was trying to test how fast my EV-DO connection was relative to the speed of our southerly neighbours on Sprint. I realized that the best thing to test this was using a mobile version of a site. 

Seriously?!

 

So, here we are, laziness finally confronted, and app finally created in about 8 hours of nonstop work. 

 

netSpeed

 

The app works by downloading a small (1.2MB~) file from a private server owned by me. It then tracks the progress and calculates the overall KB/s (kiloBYTE). There is an unusual bug with the screen transitions sometimes flickering white, but that seems to be a bug with Ares (the online palm web development tool) and nothing I can circumvent. While on the topic, I think I should spend a moment to really talk about how awesome Ares is. The first thing I did (and the thing I knew I wouldn't have much trouble with) was the backend code. But I really wasn't looking forward to designing something graphically pleasing. Thankfully, I was able to quickly prototype some styles and piece together a nice but simple looking app with almost no effort. If you haven't tried Ares yet, you need to do yourself a favour and give it a shot.

 

The app is pretty straightfoward but it's my first venture into the Paid app scene. Since the homebrew scene was fun if not extremely unprofitable, I decided to wet my feet in the cheap-o paid app business. How well the app does will ultimately decide whether I continue developing for webOS or not.

 

So, hopefully, this time next year I'll be rollin' in the benjamins!

 

...Right?

 

 

Keep an eye out in the app catalog for netSpeed, provided it gets approved.

 

Update: It's approved! Go get'r now!

Tags: | | |
Jun 28

 

This Saturday the unthinkable occurred, Fedor Emelianenko - unbeatable heavyweight Mixed Martial Artist, was toppled by +500 underdog Brazilian Jiu-Jitsu master Fabricio Werdum. The MMA world has been shocked to say the least.

Honestly, I am not surprised as much as I am mad at myself for not putting the bet down on Werdum. It was such a solid underdog play, this should serve as a reminder the next fight I wanna place a bet on. Anyways, so what makes this news interesting as well, is that this guy was billed as the unbeatable, or the most dangerous man on the planet,etc. And now he has lost to a guy that got booted from the UFC after being flat-lined by Junior Dos Santos (on his debut no less).

The reason this is a big deal is that the promotion Strikeforce has now had a few of its biggest stars beaten almost back-to-back. Earlier this year Jake Shields beat recent Strikeforce acquisition (and 4-1 favorite) Dan Henderson. Strikeforce paid Dan allegedly a handsome sum in jumping from UFC. They built an advertising campaign centered around both the former Pride Champions and their arrival to Showtime, and now those guys have lost.

What does this mean when Fedor has 1 more fight left on his contract and the superfight with Strikeforce Champ Allister Overeem out of the picture - who does he fight and will people be interested? If Jake leaves, even if Hendo goes through the gauntlet on his way to becoming the champ - would Sheilds leaving give the title any less credibility? 

Hey, its a tough sport! What can you do.. 

Tags: | | | |
Jun 06

Recently I've taken on a personal project of getting a computer set up all sexy-like for a MAME cabinet. I was lucky enough to have a contact through "someone who knows someone" to build the cabinet for me, but I insisted on doing the software solution myself. The reason for this was because I wanted to set up some fancy software I researched called Hyperspin. It was incredibly polished, and having an app that gave a better illusion of an arcade experience was important because that's the reason why I wanted to do this to begin with.

 

It took some time and about 20GB of video/theme files to get the application up and running like the above video, but it was worth it! The end result is incredible, and although I had to pay (donate) $25 to HyperSpin to get full access to all their themes, it's a cost absolutely worth swallowing.

 

However, one of the issues I ran into was that the ROMs that I acquired had different names than the wheel art associated with the themes. Because HyperSpin associates direct filename links, this meant that all of my ROMs, although definitely there and working, did not have any themes. I tried to find a quick and dirty solution, maybe an existing app to remap the filenames, but I couldn't find any. I was actually quite shocked at this since I have to imagine that I'm not the only one who has run into this.

So, I put on my programmer-gloves and wrote a quick C# app that compares filenames from the ROM directory and the Images (wheel art) directory. If a close match is found, the image filename is renamed to the ROM name. The end result is a way to rename thousands (or tens of thousands in my case) of files automagically.

 

I'm sure there are some bugs, and I'd caution anyone who wants to use it that it may incorrectly rename some files (keep backups before). But, it worked perfectly for me, so I'm going to release it in case anyone else has the same problem as me.

 

The way it works is by doing some brute-force comparisons, checking character by character for matches. If more than half the filename matches, the program considers the name valid and will rename the image. Because it only renames the image, no adverse effects should happen to the HyperSpin database for the game names and descriptions.

 

Requires .NET 3.5 installed

RomRemapper.zip (4.59 kb)

Tags:
May 07

As you may have read before, I've been having a real hard time with spambots picking up and exploiting this site's open comment system. It was getting ridiculous to the tune of over 900 spam comments per week.

 

I finally had enough and decided to put in my "Ghetto Captcha" on the site. 

It was actually very easy to implement, and I'm going to post the code here in hopes of helping other BlogEngine.NET users combat spammers.

Basically what you need to do is change the CommentView.ascx (control) design-view code to bypass the default post validation and insert an intermediate javascript validation.

 

Step 1: Add the new text field:

<input type="checkbox" id="cbNotify" style="width: auto" tabindex="7" />
<label for="cbNotify" style="width:auto;float:none;display:inline"><%=Resources.labels.notifyOnNewComments %></label><br /><br />
What is the name of this blog? <input type="text" id="captchaTest" />  <=== ADD THIS
<input type="button" id="btnSaveAjax" value="<%=Resources.labels.saveComment %>" onclick="return preTest()" tabindex="7" />    <== change onclick
<asp:HiddenField runat="server" ID="hfCaptcha" />

 

 

Step 2: Add the new preTest() javascript

function preTest()
{
    if(document.getElementById("captchaTest").value == "futurepr0n")
    {
        return BlogEngine.validateAndSubmitCommentForm();
    }
    return false;
}

Step 3: There is no step 3

 

SO that's it! Spammers be gone, and very little code change.

 

I realize it's hard to follow code like this out of context, so I've attached the source code for the CommentView.ascx that we're using on this site. Hopefully you can use it to your advantage!

 

CommentView.ascx (6.85 kb)

Tags: | |
Apr 29

So HP just bought Palm. That came out of nowhere.

 

I'm with most of the world out there when I thought that HTC was for sure the frontrunner, if anyone. But, that came with the very serious possibility that it would mean an end to webOS, it would merely be an IP purchase. Being a webOS developer/user/fanatic this was a pretty depressing revelation. But a couple weeks passed and HTC apparently walked away. "Whew" I thought, assuming Palm would now try to stick it out. This came with yet another troubling thought that Palm is bleeding away to death right now. They have a fantastic phone, fantastic platform, they just can't sell a phone no one has heard of! And without money, they weren't going to fix that problem.

 

Enter HP. HP really makes so much sense in hindsight. A company who once was a trailblazer with a mobile form factor (iPaq anyone?), now not even a second thought from most consumers. And in the dust of the latest Dell phone leaks, HP, being far larger and more dominant, had a gaping hole of a product line to fill. It really was a perfect match: Palm, who had a fantastic product line but no money to support it, and HP, who had no mobile product line and too much money to know what to do with it!

Now you have to step back and take a glimpse at the bigger picture. Although Palm is first and foremost a smartphone company, webOS was built from the ground up to be able to run on any device and any form factor. Did you just think that too? That unusually mysterious Windows 7 table, the HP Slate? With webOS? Amazing! Granted, the HP Slate is already very far along in its development so it's unlikely that they will jump ship from Windows 7 for now, but the framework is there from a hardware standpoint. There is a very interesting opportunity here to make the iPad look l<more like> a children's toy.

HP will reportedly "double down" on investing into webOS. Porting it to many form factors to suit its diverse hardware portfolio. At the same time though, HP and Palm have done an incredible thing for people like me: developers. All of a sudden I see this budding platform which has yet to become saturated with apps (like the iPhone or Android variants) with several form factors and possibilities. Double that with the fact that with the PDK, porting apps is now easier than ever. I wouldn't be surprised at all to see a massive influx of apps over the next few months.

One thing you can be sure of is that I will be making some new apps, this time they will go to the app catalog instead of the homebrew gallery. 

 

So with the swift purchase of Palm, the game has changed. There is now a newly confirmed big player in the game. It will be interesting to look back a couple years from now to see how much HTC, Lenovo or RIM missed out by not capitalizing on this brilliant opportunity.

Tags: | |
Apr 27

 

OK.. by now I'm sure you'll have read the news surronding Gizmodo editor Jason Chen and his property seized by California's Rapid Enforcement Allied Computer Team. All I can say about it is that's pretty rediculous if you ask me. I don't understand why, with all the attention surronding the leak of the recent iphone v4, that they would want to associate themselves with something like this. Only thing I can understand about it is regarding the sales of current iphones (which by the way seem to have no problems selling as reported in Apple's most recent earnings statement), however it seems a tad - how do you say - dick-headish? Maybe thats just me.. but for all the positive things going for Apple's finances and all the negative things coming from troubled developers from working within their closed systems or having applications approved - it seems like maybe not the smartest time to bring any more news that makes you guys seem like the most evil fucking corporation that you seem to be.

Tags: |
Apr 13

So, I decided to get off my ass and do something with the site and spruce it up a bit. Seeing how BlogEngine.NET recently released 1.6 with new spam blocking filters (thank god), I decided now was as good of a time as ever.

 

So we are now running under the latest engine and will hopefully be able to moderate comments better.

Oh, and do yourself a favour and buy a Palm Pre :)

Tags:
Mar 24

Recently I was presenting with an interesting problem: I needed to execute code under the User security context as a System account. Typically, you can execute code as a windows service under the system account without issue. Apparently, though, there may issues when trying to access WaitHandles across security contexts. 

To elaborate, when you create an EventWaitHandle in C# as the current user, it will, unless specifically specified, create it with the default security privileges. To prevent malicious programs from fooling around with your global handles, Windows separates these into "security contexts." You would see this as a .NET UnauthorizedAccessException.

Moving along, if you are unable to execute both programs under the same security context (same user), there is still hope! I was able to overcome this by using Windows Impersonation. The premise for the code is that it will execute any code within the application as a different user. As a caveat, this appears to only work when executing the code as the SYSTEM account (i.e. a windows service). If you try to impersonate a user as the admin, or the other way around, it will NOT work. 

Without further adieu, the code:

    //Tokens required to call OpenProcessToken. All three are required to impersonate a user context
    public const UInt32 TOKEN_DUPLICATE = 0x0002;
    public const UInt32 TOKEN_IMPERSONATE = 0x0004;
    public const UInt32 TOKEN_QUERY = 0x0008;


    //OpenProcessToken will open a process via its handle and attempt to retrieve the user token for that process.
    //We need this to grab the user token from a known shared program in order to run as the same user context. This prevents permission

   
    //This function will only succeed if executed under the SYSTEM account for security reasons
    [DllImport("advapi32.dll", SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
    static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle);

    --------------------------------------------------------------------------------
        Process[] p = Process.GetProcessesByName("KnownUserProgram");
        if (p.Length > 0)
        {
          IntPtr pHandle = p[0].Handle;
          IntPtr currentHandle = WindowsIdentity.GetCurrent().Token;
          //In order to impersonate, duplicate, impersonate and query access must be requested.
          //OpenProcessToken attempts to steal a user token from a known application. This will only work under the SYSTEM account
          bool success = OpenProcessToken(pHandle, TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY, out currentHandle);

          if (success)
          {
            Console.Writeline("Successfully captured user token");
            WindowsIdentity id = new WindowsIdentity(currentHandle);
            //Impersonate will cause the program to begin executing as if it were the current user         

            WindowsImpersonationContext context = id.Impersonate();
            Console.Writeline("Impersonation complete");
          }
          else
          {
            Console.Writeline("Failed to get user token.");
          }
        }
        else
        {
          Console.Writeline("Mainline is not running, cannot grab user token");
        }
      }
      catch (Exception ex)
      {
        Console.Writeline(ex.ToString());
        Console.Writeline("Impersonation failed");
      }
      Console.Writeline( String.Format("Continuing under the {0} context", WindowsIdentity.GetCurrent().Name));

Tags: | | |
Feb 24

I've decided to release an interim version of TGH to help those in desperate need to switch phone audio modes in addition to media audio modes. For those who haven't kept up, the previous version was only able to toggle the media audio output.

You can only toggle between headset (non-bluetooth) and front speaker at the moment. Also, note that after one phone call, the audio mode will RESET to whatever mode it was at before. I'm still trying to work out why this is happening and to see if there's anything non-intrusive that I can do to prevent this.

com.palm.futurepr0n.theghastlyheadset_0.0.2_all.ipk (32.87 kb)

Tags: