Categories
Support

“getS” Code Snippet

Formatting dates is something everybody likes to do, and everybody has their favorite way of formatting it. ASP has a few built in functions to enable us to output it in almost any format we like. However, something I’ve always wanted from Classic ASP was the ability to get the day suffix. Such as turning ‘January 1, 2012’ to ‘January 1st, 2012’. It’s easier to read and looks a lot nicer. Classic ASP has no support for this so here is a small snippet giving an example of how this can be accomplished and a few examples.

Example (pastebin):

<% currDate = NOW() Response.write("Today is the " & DAY(currDate) & getS(DAY(currDate)) & "<br />") ' Today is the 11th  '  currDate = DateAdd("d", 1, currDate)  Response.write("Tomorrow is the " & DAY(currDate) & getS(DAY(currDate)) & "<br />")  ' Tomorrow is the 12th %>

Source (pastebin):

<% '' ' A basic copy of PHP's version of date('S') ' "English ordinal suffix for the day of the month, 2 characters" ' @param int day The day suffix you are looking for. ' @return st ring This is the suffix you were looking for. '' Function getS(fn_day)  If fn_day = "" Then fn_day = CStr(DAY(NOW()))  Else fn_day = CStr(CInt(fn_day)) End If  fnll = Mid(fn_day, len(fn_day), 1) If len(fn_day) = 1 Then fndl = -1  Else fndl = Mid(fn_day, len(fn_day)-1, 2)  End If  If fndl >= 11 AND fndl <= 13 Then  getS = "th"  Exit Function  ElseIf fnll = 1 Then  getS = "st"  Exit Function  ElseIf fnll = 2 Then  getS = "nd"  Exit Function  ElseIf fnll = 3 Then  getS = "rd"  Exit Function  Else  getS = "th"  Exit Function  End If End Function %>

(Source: Skynet Solutions)

By Blaine Schmeisser

Categories
Support

Estimating I/S Projects

Giving time estimates for programming projects can be a very tricky process. Many times when a project comes in late, it can be traced back to a bad time estimate given up front. For small projects where a task is quickly explained to you, and you are then asked to give a ball-park figure, you might not have time to take into consideration all of the aspects that have to be handled. Although you do know the bigger details involved and can make a reasonable guess. The problem comes in when there are three or four other small items you didn’t think about, and these end up having to be handled in the same time frame.

Another problem can be in the testing. A lot of developers do not realize the amount of time they have to spend testing their programs. Depending upon the project, a developer may need to spend as much time testing a program as they spent writing it. Testing as many scenarios as possible can be very time consuming, but it makes a big difference in your end product.

Generally, on a small task or project I’m doing, I will determine how long I believe it will take me and then multiply that by 2 or 2-½. The 2 or 2-½ depends upon how much testing will be required and how familiar I am with the system. Over the years, experience has convinced me that I’m only about half as quick as I think I am. In order to determine a good ratio for yourself, estimate jobs with how long you think they will take, and then note actual times. You can compare estimates to actual time. Then you will have a good number to adjust your future estimates by.

On larger projects consisting of multiple tasks or developers, it is important to break the project down into individual tasks and attack them separately. You should try and define every possible task, describe it fully, and then determine how long it will take. It can take hours or days to create good estimates on some projects. However, the process of creating an accurate estimate can also produce detailed task lists and program specifications that can be used when the project begins. A good time estimate allows for creating deadlines that are reachable. It also makes for a project that doesn’t have you working nights and weekends under intense pressure to get the job completed on time.

(Source: Skynet Solutions)

By DJ Burrup

Categories
Support

Samsung Galaxy Tab versus iPad 2

Samsung Galaxy Tab 8.9 WiFi versus Apple iPad 2 WiFi

This comparison is not a death match between the two devices. This is simply a list of differences I noticed between them. I hope to help someone decide which device to get.

We already have iPhones and iPads, so I felt it was necessary to have an Android-based device to further round out our website testing.

The Samsung Galaxy Tab has a few things it does better, and a few things it does worse. Overall, as a computer geek, I love it and choose it over the iPad.

I did, however, recently purchase a tablet for a relative, and I simply could not justify getting them anything but an Apple iPad 2. I know without a doubt they will be able to use it and will not be calling me for help with something they can’t figure out.

Until Android devices achieve this type of simplicity, I’ll have to give the Apple product a leg up for novice users.

Samsung Galaxy Tab 8.9 Wifi Pros versus iPad Wifi 2:

Lighter

Battery lasts extremely long with the smaller screen

Much easier to read books with and hold for long duration.

Skyping is better with the smaller device because of how light it is.

Amazon App Store You get 1 free app each day that usually is a paid app. Also shows only apps that WILL work on my tablet.

Widgets on the home screen are useful by making it really easy to glance at important things like weather, news, and stocks.

All apps I use on iPad or iPhone are on the Android Market. Even most games I have are available. There are things that are not, but for me, the transition was seamless in this department.

Integration with Google is very convenient.

The on-screen buttons On the screen at all times, there is a back, home, list of recent apps, screen shot, and settings button. The back button seemed weird at first, but after using it for a month, and then going to an iPad and having to hit the master button to close the app, really highlighted having a back button OR a home button right there on the screen.

The screen shot button makes it WAY easier to take screen shots over using the two external buttons on an iPad. I found myself accidentally hitting it all the time though, so it does have its downfall.

Samsung Galaxy Tab 8.9 WiFi Cons versus iPad 2 Wifi

Crashes randomly. I’ve had it two months, and it’s crashed and rebooted itself 4 times.

Android Market does not tell me if apps are tablet or not, or even if they work with the app on the tablet. If you open the Android market via the web, it tells you if apps will work on your device, but it still does not do a good job.

Interface is not as simple as iPad. It took me a little bit to get my mind around the different sections to find things, instead of it all just being in one place at the same time.

No way to create folders for apps. This is ridiculous!

However, for me, the Samsung is the way to go. For novice users, I’d stick with the Apple product.

(Source: Skynet Solutions)

By Jed Parmenter

Categories
Support

Making the web Bot Friendly

Why should you help out web bots trying to scrape your data? Most users try to make their websites easy for search engines to crawl, but search engines usually only care about words and cache the entire page. There are other bots that look for specific data based on patterns it can find. Most of these bots get a bad reputation since you mainly hear about them when one gets in trouble for stealing email addresses that users leave openly on their website. Some users can get crazy and lock up all sorts of information bots would love, (including Google), such as user pages that hold information like post counts, game scores, or other statistics that can be used.

Making your HTML readable for web bots is generally easy. Most times you already iterate the data and put it in a way web bots can traverse it. We should always use plenty of ID attributes to clearly identify parts of the web page. This is especially important if you are not iterating data, like a user page, where you do a query at the top and place all the data appropriately. If none of the user profile has an id or another distinguishable feature, it might be difficult for web bots to find appropriate data. Also, make sure items are separate from their labels. Putting them next to each other can make it difficult to parse; a separate tag and the same parent is ideal.

Web APIs are also a great way for bots to use your data. Most sites already have RSS feeds for bots and users to use freely. Some sites even allow bots to freely use their site search engine, others ban it due to possible abuse. Since APIs like this are easy for bots to parse and less data is sent out, it can help both the website and the bot. If you make some sort of API, make sure all important information can be obtained from it.

(Source: Skynet Solutions)

By Blaine Schmeisser

Categories
Support

Renaming Picture File Names with Siren

I recently visited my parents. As usual they always have some question regarding some issue they have encountered with their computer. This used to irk me, but anymore, I just bear it and grin as it’s usually something relatively simple (ie can you make that little icon on my desktop that takes me to Gmail again?) This time my mother was looking for a way to organize her pictures based on the date and time they were taken. Windows Explorer sorts alpha/numerically when you sort be name, but the program she used to import the pictures didn’t label them in a fashion that would allow this order to be chronological. Knowing that the file names were arbitrary forced me to rely on the EXIF data stored in the JPEG file. For those of you that don’t know, most all digital cameras these days store date and time information, among other data, inside the jpeg file itself. Assuming the date and time settings on your camera are correct, this information can be used to rename files using certain programs. One program I found online is called Siren.

This program is able to see the EXIF data stored in the photo and uses that to create a new file name based on whatever EXIF data you would like. As I said, I wanted just the date and time. To do this, in Siren, you first browse to the folder that contains the pictures you would like to rename. Next, in the expression box, you enter your file name. This can be anything you want, though to pull the EXIF data you need to use an expression variable. %Xdo%ncs.jpg in the expression box will rename all the pictures in the directory you’ve selected to YYYYMMDD_HHMMSS.jpg. With %Xdo meaning to use the pictures’ date and time stored in EXIF and “%ncs” meaning to give a unique name if two pictures were taken in the same second. You can add whatever you would like before the expression variables to even further classify your pictures (ie. Uncle_Bobs_Colorado_%Xdo%ncs.jpg). This would create file names like this: Uncle_Bobs_Colorado_ YYYYMMDD_HHMMSS.jpg.

As you can see, Siren can be a pretty powerful tool for renaming files. This was just a taste of what it can do. Extensive information can be found in the help section of Siren regarding all the other expressions that can be used. Hopefully this has equipped you with the knowledge to better tackle the endless help desk requests from family and friends.

(Source: Skynet Solutions)

By Dustin Fry

Categories
Support

Editor Comparison

I’ve used a few editors for various tasks, and each has advantages and disadvantages over the others. Personally, I’ve played with Dreamweaver, Notepad++, Sublime Text, and Eclipse. Some of these are a bit more popular than others. For more information, visit Wikipedia Comparison of HTML Editors.

Notepad++

I love how basic this editor is. I’m probably most familiar with this one since I’ve used it the most. I like the default functionality to duplicate entire lines or line segments. Not many others allow this full functionality. Also, if you highlight a variable or full word, it highlights all its other uses on the same document. This feature is great for when you are checking if you spelled the variable right, or when you are trying to follow along with code that has no comments. There is a nice plug-in manager that allows a few plug-ins. One item I really enjoy is being able to have a “project” which I can upload to a remote server. Currently, I have not found a single plug-in that allows both of these.

Dreamweaver

This one is probably one of the most common editors you will encounter when doing web development. It’s adaptable to multiple languages and usually comes with an Adobe package. The built- in project management is nice; it allows you to set them up with more features than you will ever need. I would like to see the projects be manageable in folders, which helps when you manage over 10 projects. The biggest downfall I found with Dreamweaver is that it slows my computer down quite a bit when I bring it back into focus after a few minutes.

Sublime Text

This is one of the newer editors I’ve encountered, and I still wouldn’t consider myself a pro at using it quite yet. When you open it up, it’s a very light-weight editor with the ability to add plug-ins. The plug-ins I found were extremely easy to develop with all sorts of documentation and code examples. There are already tons of plug-ins available. There is a project manager plug-in which I found very useful, but it doesn’t currently have all the features I’d love. However when speaking with the developer of the plug-in, he did mention he would be adding these features.

Eclipse

This was one of the first editors I used that offered syntax highlighting. Before that I was using… Window’s Notepad. Dreadful, I know. There are a few versions for various languages including Java, PHP, and C/C++. The project management was a very nice feature for me, and still is. It’s not a tiny editor, but so far I’ve never had it slow down my computer.

(Source: Skynet Solutions)

By Blaine Schmeisser