December 4, 2015
With the Microsoft Surface Pro out, I’ve been rethinking a lot of things. I have a long and storied history with both PCs and Macs that I won’t get into right now. Based on my experience with other PCs here’s my breakdown on why I use one over the other. Keep in mind that I’ve yet to use the Surface extensively. I’m willing to update this post if I get a chance to use it for real work.
- Visual Studio
- Microsoft Excel: I can get along without the rest of the Office suite, but I haven’t found an alternative to Excel.
- Amazing performance: I normally have about a dozen desktop apps open and 20 or more Chrome tabs
- Incredible battery life: 6-8 hours typically under heavy use
- Lack of malware issues: Anti-malware programs are resource hogs.
- Excellent memory management: minimal paging (only pages when absolutely necessary)
- Software lifecycle management: zero residue install/uninstall
- Hassle free OS updates: Painless when compared to weekly Windows updates and reboots.
- No vendor advertisements to install stuff: I’ve never gotten a notification from Apple that I didn’t need.
- Thermal management: I only hear the fan when running Windows on Parallels.
- Durability: solid cast aluminum, glass screen, stiff edges with no seems, only the keys are plastic, breakaway charger, well seated ports.
- Longevity: I’ve owned many Macs that have lasted more than 5 years without major issues, reinstalling the OS, or major slow downs. I was a certified Apple technician for a year in college and regularly serviced Macs that were 5+ years old and put them back into service.
Many of these benefits come from a seamless cohesion of Apple OS and hardware. The new surface might have the same thing going for it so maybe it closes the gap? I’m VERY curious.
I recently attended a talk by Scott Hanselman and he was running his presentation on a Surface Pro. I was amazed by how well it performed. I’ve had a few $1,500+ Dells for business and I’ve never seen that kind of performance – even right out of the box. I’ve always had to use $2,500+ desktops to get Windows and Windows based software to run without lagging and that’s only after turning off the Windows animation fluff.
May 14, 2013
The content-type header consists of the MIMI content type of the resource plus an optional character set specification.
I came up with a regular expression to split the content-type header value into the respective fields:
In python you would use it like so. Notice the use of re.IGNORECASE:
contentTypePattern = re.compile(r”(?P<type>.*?)(;|$)(\s?charset=(?P<charset>.*?)(;|$))?”, re.IGNORECASE)
m = contentTypePattern.search(contentTypeHeader)
contentType = m.group(‘type’)
charset = m.group(‘charset’)
This is what I used for my test input:
September 26, 2012
The following are some ways find or at least get an idea of the modification and/or creation date of a given web page:
1.) First and most obvious: look for some dates on the web page.
You can get creative with searching within the page using your browser’s search capabilities to find this. For instance, search for “2012”
2.) Get the date of the last time Google indexed the page.
This date will be between the day of and approximately 3 months of the “last modified” date depending on where the page falls in Google priority for indexing. Google can get to most of the pages it will add to its index every three months at least. The more popular the page is the closer this date will be to the actual “last modified” date. Google doesn’t actually update this date unless the content of the page changed. This is about as good as you can get for dynamically generated web pages if you are looking at the web page as a whole.
The best way to do this is to enter this in your browser’s address bar and look at the date by the result.
3.) Look at the HTTP headers.
For static web pages or static pieces of web pages you can sometimes get the “last modified” and if you are lucky the “creation” dates. If you want this information for the website as a whole you can go to http://www.statscrop.com, enter the url of the page you are intested in, and scroll down to the “HTTP Header Analysis” section. This will show you the header for the main response to the url request.
Sometimes this information isn’t provided in the HTTP response header for that particular request or the page has content that is dynamic enough to make it useless (ie. it always returns today). In that case you can look at other resource requests. The average page now days is actually made up of dozens of resources that are all acquired by the browser with separate request. The web server’s response to each of these requests will contain a response header. You can see these other headers by opening the Chrome developer tools, clicking on the network tab, and putting the page’s URL in the browser’s address bar. Inside the Network tab there is another tab called Headers. You are interested in the Reponse headers. Try to select the resource on the left side that matches the content you are interested in. It may be a picture, CSS file, PHP, HTML file etc, …
Note, not all web servers are configured to send “creation” or “last modified” date in the HTTP response header. Don’t be surpised if you don’t see these fields.
4.) Other services
http://www.cubestat.com provides a service that shows some additional web page indexing information. I’m not entirely sure where it gets its data. I expected the dates to match what Google shows but that isn’t always so. It looks at multiple indexers (Google, Yahoo, Live (Bing)). It could be getting the data from Alexa, Quantcast, or MagesticSEO. Or it could be running its own crawler but that is doubtful.
5.) DNS registration
Another interesting piece of information is when the domain name was registered to a given ip address or owner. http://www.statscrop.com will also give you this information.
September 25, 2012
When you run ‘apt-cache search’ it returns anything that has the search text in either the package title or the description. What if you only want to search within the package name? The following pattern will help you do that:
apt-cache search mysql | grep -P “^[^\s]*server[^\s]*”
In general it can be used to search within the first column of space delimited text.
July 2, 2012
Excel Adjacency List to Dot on CodePlex
I created an open source project for my Excel add-in that converts an adjacency list entered into an Excel worksheet into a GraphViz dot file. Check it out here:
January 31, 2012
I finally got around to making this C# library for programmatically creating Visual Studio client report definition (.rdlc) files opensource. You can download it here. If you have an interest, feel free to improve it.
January 25, 2012
January 25, 2012
I use my Amazon.com wish list a lot. I have hundreds of items in it. I wanted to see if I had any books in my wish list on LaTeX or TeX. So I thought this would be a good use of the Amazon.com API. Unfortunately I found out that they recently removed wish list querying methods from their API. Bummer. Then I came upon this post. http://bililite.nfshost.com/blog/2010/10/31/hacking-my-way-to-an-amazon-wishlist-widget/ . The solution is the layout=compact URL parameter.
First open one of your wish lists on Amazon.com. Add ?layout=compact to the end of the URL in the address bar. This will put all of the wish list items in a single page. Then use the browser’s search feature (ctlr+f) to search the page. If you want to search multiple wish lists, you need to click on each of them and repeat but it sure beats paging through the items.
This is a hidden feature since as far as I can tell there is no way to change the layout through the UI.
January 25, 2012
I did a little research and wasn’t able to find a solution. I played around with tesseract-ocr using VietOCR. It wasn’t great but it is better than nothing. Apparently tesseract is the best library out there for this and I think it is what google uses. I may be able to use tesseract-ocr for my implementation. Check out my StackOverflow question here: