January 20, 2012
Jonathan Schroeder
Consumer Lookout, General Discussion, Life, Movies, Music, News, Video
censorship, internet, lamar smith, legislation, PIPA, piracy, SOPA
So a great thing has happened, SOPA has been stopped dead in it’s tracks for the time being due to unprecedented amount of on-line protests (way to go team!) In any case, you’ve undoubtedly heard a lot about SOPA in the past few weeks / months, the bill that was passing through legislation which completely undermined the architecture of the internet, or as I call it “the last tool of the people”. Read more about SOPA and it’s hated pioneer Lamar Smith in these articles:
http://latimesblogs.latimes.com/technology/2012/01/sopa-bill-sent-back-to-the-drawing-board-in-wake-of-internet-protests.html
http://www.siliconrepublic.com/new-media/item/25434-lamar-smith-decides-to/
I’m glad people actually took a stand and spoke out, we as an internet community refuse to be steam rolled by congress and have our rights violated. We must speak out, before it’s too late… First they came…
”First they came for the communists,
and I didn’t speak out because I wasn’t a communist.
Then they came for the trade unionists,
and I didn’t speak out because I wasn’t a trade unionist.
Then they came for the Jews,
and I didn’t speak out because I wasn’t a Jew.
Then they came for the Catholics,
and I didn’t speak out because I was Protestant.
Then they came for me
and there was no one left to speak out for me.”
Credited to “first they came…” on wikipedia, link here:
http://en.wikipedia.org/wiki/First_they_came…
January 19, 2012
Jonathan Schroeder
.NET, Database, General Discussion, Programming, Web 2.X
C#, dev, guid, id, programming, short id, unique id, utc timestamp
Today I wanted to generate short unique IDs in C#. I stumbled upon an article here that helps you shorten GUID’s, here is the link: http://www.singular.co.nz/blog/archive/2007/12/20/shortguid-a-shorter-and-url-friendly-guid-in-c-sharp.aspx. I still thought that the IDs this generated were a bit lengthy and ugly for what I was looking for. What I decided to use instead was the number of server ticks to generate a URL friendly code / key that isn’t as long as a GUID or as obvious as a database auto-incremented record ID. In any case, here’s the approach that I took.
static string uniqueCode()
{
string characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#";
string ticks = DateTime.UtcNow.Ticks.ToString();
var code = "";
for (var i = 0; i < characters.Length; i += 2)
{
if ((i + 2) <= ticks.Length)
{
var number = int.Parse(ticks.Substring(i, 2));
if (number > characters.Length - 1)
{
var one = double.Parse(number.ToString().Substring(0, 1));
var two = double.Parse(number.ToString().Substring(1, 1));
code += characters[Convert.ToInt32(one)];
code += characters[Convert.ToInt32(two)];
}
else
code += characters[number];
}
}
return code;
}
This code will generate a unique code / key based on universal time stamp ticks. Thanks to Chris Newman for pointing out the DateTime.UtcNow. Originally I had used DateTime.Now to generate the ticks which in a clustered infrastructure could’ve caused problems. This code can be cleaned up or implemented in any way that you want, feel free to use and edit it. This code was created because I wanted something simpler than a GUID and something that was still URL friendly for my applications, I’m sure there are other countless methods available, I just hope this one helps some of you.
November 22, 2011
Jonathan Schroeder
.NET, Dev, Programming
automate, browser, browser automation, internet explorer, selenium, watin, webbrowser, website testing
Want to automate your browser to test your newly developed web system? Want to go beyond that? Check out these cool tools: http://seleniumhq.org/ and http://watin.org/
September 20, 2011
Jonathan Schroeder
.NET, General Discussion, Programming, Troubleshooting
ASP.NET, asp.net forms, forms validation, page.isvalid, recaptcha.isvalid, recpatcha, validation group
Recently while working with the asp.net recaptcha control (recpatcha control can be downloaded and read about here: http://code.google.com/apis/recaptcha/docs/aspnet.html) I realized that there is no validation group, now however simple it might be to roll your own in addition here is a quick way to get it working and playing nice in the sandbox with your other asp.net controls.
In the code behind simply fire the Recaptcha.Validate() command and then verify your page using the following:
if (!Page.IsValid || !Recaptcha.IsValid) { /* do something */ }
Mind you that the solution is not perfect but to get back up and running quickly, this works. Hope it helps some of you out there that are having issues getting recaptcha to work with you asp.net forms.
September 12, 2011
Jonathan Schroeder
.NET, Dev, General Discussion, Troubleshooting, Web 2.X
absolute path, ASP.NET, image tags, relative path, script tags, stylesheet tags, visual studio, website properties
So recently while working on a project (currently the one in front of me) I had an issue with absolute relative paths in an ASP.net website solution. First off, a thanks to Chris Newman for his setting me straight as I was already frustrated and had overlooked the solution. When you want to use the absolute relative path “/styles/something.css” or “/scripts/myscript.js” and you don’t want to have to use the tilde (~) operator in the path then click on the website project in solution explorer (visual studio), then click on the properties of the solution (like you would a control) and reset the virtual to root “/” instead “/your-project”. That should help you out whether or not you using URLRewriter at that point is irrelevant.
August 25, 2011
Jonathan Schroeder
Apple, General Discussion, News
apple, apple computers, ceo.resignation, mac, pixar, steve jobs, stock
As Steve Jobs was diagnosed with pancreatic cancer and has effectively had it in check for the last 7 years it appears that now (by his recent actions) it is getting worse and suggests Mr. Jobs’ performance is effected by said illness. Steve Jobs has led not only apple but pixar into great directions and has left his mark he continues to serve as chairman of the Apple board of directors, and resigning as Apples CEO (Chief Executive Officer). Today I watched apples stock drop from the news and is now back up again two points from the drop (recovering slowly). Good luck with your endeavors Mr. Jobs and everyone I’m sure wishes you the very best. If you have thoughts or comments about the Steve Jobs resignation feel free to share them.
August 20, 2011
Jonathan Schroeder
.NET, Apple, Hardware, Music, Programming
.NET 2.0, C#, iPod, iPod Touch, Music to iPod with C#, SharePod, VB.NET
Recently when not wanting to use iTunes to sync my music because of the overhead the application offers I decided to go with a more subtle approach. My searching brought me to a small application called SharePod. What’s great about SharePod is that it comes with a .NET 2.0 assembly that you can utilize in your project if you’re working with iPods or iPhones / iPod touches.
Here’s the link, have fun:
http://www.getsharepod.com/fordevelopers/
July 26, 2011
Jonathan Schroeder
Uncategorized
Recently I decided to install Ubuntu 11 on my laptop. At first glance Ubuntu 11 is not only fast but aesthetically pleasing as well. Ubuntu offers a software store that offers free and licensed software much like an mobile application center or iTunes store. They also support a variety of desktops as before including ubuntu classic and their new mac style interface.
It’s been a few days and I have to say that I am overall pleased with the operating system, not only is it fun to use but it’s obviously (and as expected) highly responsive and overall offers great functionality. The package manager is nice and if anything you can always use apt-get which is both reliable, fast and easy to execute.
I’ll dive further into the tech specs in a later post but I felt the need to share my initial enjoyment with the online community. Thanks for reading.
July 26, 2011
Jonathan Schroeder
Uncategorized
cmd, command prompt, running task from task manager, task manager, techtip, windows, Windows 7, Windows Vista, windows xp
Sometimes when you meet a nasty little worm or virus they will disarray your system and it’s known file type associations. A good way to get to the command prompt is to launch the task manager by using control + alt + delete on your keyboard and then holding the control key and click on the task managers file menu -> New Task Run.
If you hold the control key while clicking this option a command prompt window will open, if you do not then the standard run dialog will be displayed (not recommended if your file type associations are not correctly functioning).
July 24, 2011
Jonathan Schroeder
General Discussion, Web 2.X
address bar search, bing, chromium, google, search engine, yahoo
So recently while browsing with Chromium I stumbled upon something that I’m sure would’ve been available if only I had RTFM
when using Google’s Chromium browser you can specify one of the three major search engines and type in your search criteria (Bing, Yahoo, Google). To initialize this task simply enter the address bar in Chromium, enter your search engine (e.g. yahoo.com) and then hit your space key…you’ll notice that Chromium immediately turns your address into a search tab specifying the search engine that it’s using….excellent. You can do the same thing for Bing, Yahoo, and Google.
Hope you all found this post helpful =)
Older Entries