I am sure anyone who has to do a secure copying (scp) from windows to linux machines are mostly using an excellent tool called WinSCP. Well I had been using it for over 3 years and only recently discovered that it has an awesome console mode! To start it in the console mode, in the command prompt run:
winscp /console

In the console mode use your basic ftp commands to operate (open, put, cd, lcd, pwd, lpwd, etc). You can even feed commands to the winscp in a separate file and it runs them upon startup. Very sweet indeed.

9/24/2008 11:13:37 AM
Comments (0)
Tags: winscp, ssh client
 


Check this piece of code:
public enum TestEnum
{
    One = 1,
    Two = 2
}

static TestEnum testMe;

What's the value of the testMe enum? Is it (TestEnum.One, value of 1)? No, it is zero. I just saw this somewhere being declared and thought I should mention it here. The above behavior is why sometimes I like to put a value of 0 in the enum, like this: Undefined = 0.

9/16/2008 2:46:48 PM
Comments (0)
 


Well was I happy when I accidentally shut down Firefox the other day. On the restart I was notified of a new Firebug version (still 1.2, but I believe it was b15 revision or something like that). One of the biggest reasons why I kept FX2 on my windows instance was that Firebug for FX3 was pretty much unusable and incredibly buggy. Especially when it came to Javascript debugging side of things (would hang trying to debug javascript, could not locate source lines properly from the command-line, etc.). It is looking real good now at least.

8/28/2008 10:25:41 AM
Comments (0)
Tags: Firebug
 


'watch' linux utility is so simple yet has been so useful to me lately. I am monitoring several linux machines and this tool has come in very handy. Basically it "Executes a program periodically, showing output full screen".

One of the ways I use it is to monitor the log file and make sure that the 'PING' is written to it every x amount of time. 'watch -n 5 tail file.log' will output the last lines of the file.log every 5 seconds.

7/12/2008 7:42:34 PM
Comments (0)
 


The Yahoo Sports site was in bad shape (tabs not working, bunch of javascript errors, UI quite messed up) when viewed with Firefox 3.0 for about a week. I was keeping a close eye on the situation simple because of amusement and trying to guess when they gonna fix it. I mean you would think they would run and view their site with beta releases of the browser so that there are no surprises, after all Yahoo Sports is a big site. But I guess they didn't.

I wish I knew what exactly changed that caused the site to be so crippled. And that's another good thing for open source software: they are free to innovate and change things without worrying much about breaking older stuff if the change is really worth it. I guess in short term the devs might suffer (as I am sure yahoo sports had to change their code), but probably all will benefit in the long run with taking advantage of a great browser like firefox.

6/24/2008 11:52:29 PM
Comments (0)
Tags: firefox
 


I decided to blog today about one of my favorite (and least talked about) Firebug feature: Javascript Profiling. This could be become very relevant with web apps increasing in client side complexity and functionality. Also browsers are starting to support various advanced concepts and controls that will invite even more javascript development. I personally don't do javascript profiling often. More likely I will use it to make sure that the rough numbers I see after profiling don't look anything out of ordinary. For instance, one of the web apps I was prototyping, I was using jquery to select various html dom elements in a very inefficient way. Since it was a prototype, I really didn't care as long as I got the functionality in and could see how things worked. Once time came for cleanup, I used profiling to see what places I am making incredible amount of calls needlessly. So to get started, with Firebug up and visible (F12), click on "Profile" tab.

start

Click on "Profile" again to stop it. If you were running this on an empty page, you will see "No activity to profile." text. But if there was some javascript running (something running periodically for instance), you would see some timing data coming in. This is a great way to see what the site is running on a periodic bases by the way. To illustrate time measurement I will use a silly example. Let me create a simple page that when clicked on a button will find all the spans with-in divs with attribute "doHide" set to true and hide them. To do this, I will use jquery for selecting:

  function hideThem() {
    $("div > span[@doHide=true]").hide();
  }
  

I will start profiler running, click on the Hide them button and click on "Profile" again to get the results. Here is how they look:


So, 216 calls to hide some spans. That won't do. How about we just assing a special class to the spans and use that in selecting the spans to hide:

    $(".hideSpan").hide();
  

Results:


Kind of better since total time now is really negligible (unless the number of spans being hidden increases a lot). 168 calls, less, but still a lot. Again, you do this only if you notice something is working slower than it should. Don't get bothered much with optimizing simple javascript, make it readable and cross-browser usable your first priority. But from time to time check your work if you feel that javascript is awefully slow and you are looking to speed it up. By using the profiler you will know where to speed it up.


6/18/2008 1:10:45 AM
Comments (0)
 


This is very simple trick and I am posting this solely for the purpose that it might help a beginner developer.

While in a process of learning asp.net mvc I am building a sample website where I needed to store user selected days. Imagine input area that looks like this:

Mon Tue Wed Thu Fri Sat Sun

A good way to store this in your model and storage (DB, files, etc) is in a Flags Enum:

[Flags]
public enum Days
{
    None = 0,
    Mon = 1,
    Tue = 2,
    Wed = 4,
    Thu = 8,
    Fri = 16,
    Sat = 32,
    Sun = 64
}

Only one field required and no need to do string manipulations, just OR or ANDs to get the value selections. Again, very simple stuff, but might be not so obvious to some.

5/21/2008 12:43:01 AM
Comments (0)
Tags: Programming
 


PostgreSQL database has this very neat free text search engine called tsearch2 that used to come as add-on, but now is part of the installation. When emitting a tsearch2 query you can specify which configuration to use (english, german, or something other special) which dictates how the words are parsed etc. Since the 8.3 release of postgresql which includes tsearch2 the 'default' configuration is gone and the existing code can break. I found a quick way to create a default one by duplicating any of the existing configurations (in my case english) by executing this:

CREATE TEXT SEARCH CONFIGURATION public.default (
    COPY = pg_catalog.english
);

5/12/2008 11:27:16 PM
Comments (0)
Tags: tsearch2, postgresql, database, Databases
 


So over the course of the last year I really got into podcasting. I recently reviewed my podcast subscriptions and was amazed to find out that I am subscribed to a total of 33 music podcasts! With the help of Mediafly I organized the subscriptions so that my music channel at all times has about 10-14 different episodes. Depending on what I feel like listening I can choose to go with a bit of rock, maybe sometimes with ambient, eclectic, of course Trance (dominating my subscription list), even classical music. I am almost reaching a point where I am thinking to do a review of the best of trance podcasts available with ratings in different areas. Let's see if I ever get around doing that. But I think it would be useful as right now if you are a new podcast listener you might choose shows that are not as well produced or get released very rarely.

Besides music the other big channel I have is Sports and then Comedy.

5/5/2008 10:59:02 PM
Comments (0)
Tags: General, Podcasting
 


Reading is one of my hobbies, but I couldn't remember the last time I went to the bookstore before I did so last weekend. I needed to do a more in-depth check on the book I was considering buying and it being a nice day and all I decided to go to the closest Borders. Well let me tell you, I was amazed at how much the computer book area had changed. That particular borders some years ago had one of the best Software book section volume and quality wise. Now it is much smaller but most importantly the selection is miserable. Nothing beyond basic fluff.
Oh well, it didn't upset me at all. On contrary it was good to see a business enterprise adjust to the market conditions and repositioning their business to the changing customer needs (I saw much more open space, more inviting seating areas, cafe, etc that all the bookstore customers now look for).

5/2/2008 12:41:35 AM
Comments (0)
Tags: General
 
<October>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

RSS
ATOM

Search