Wednesday, August 19, 2009

Using dates in CAML

Your just need to use this in correct format:yyyy-mm-ddThh:mm:ss
To get this format in c# use:
SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Today).
Now you can use it:
string StartDateForCaml = SPUtility.CreateISO8601DateTimeFromSystemDateTime(StartDate);
spQuery.Query ="<Where><Eq><fieldref name="StartDate"><value type="DateTime">StartDateForCaml </value ></Eq></Where>";

Tuesday, August 18, 2009

Using linq to get all TextBoxes with text in your form

Sometimes I need to check all controls in my WinForm about somewhat value .
Usually I did foreach loop ....
But why don't use the linq ??
So this way you can do it using linq.
You can see in the code how to get TextBoxes with values collection .


IEnumerable query = from p in this.Controls.OfType() where p.Text!=string.Empty select p ;
foreach (TextBox curTextBox in query)
{
//do what you need to do
}

Monday, August 17, 2009

Quick Solutions and Dumb Bosses

In jobs as software developer and etc. you need to found a solutions on problems quickly.
So how to do it??
I really don't know and I really don't care about doing things quickly.
I'm just enjoy thinking . I'm thinking about the problem even if it's take a lot of time. I don't think that my company will fill for bankruptcy if I'll think another day.
So you need just enjoy solving problems and if you don't just change you 'solving problem pattern'!!!
Do it for achieve your goals, it will be best for your company too.
Sometimes I hear that "This proble must be solved in a hour!!".
And my answer is "NO PROBLEM" even in a half hour - and I really have a solution of problem in few minutes . Is it a good solution?? NO !! But Who cares - WE NEED TO SOLVE IT QUICKLY!!!
After a six month when the company waste already 100k dollar on this solution 'THEY GOT IT'!!
But the man that asked for a quick solution he's already a DUMB BIG BOSS and now he requires a new QUICK SOLUTION ....
So I'm giving him another quick solution , because I just enjoy thinking...

Sunday, August 16, 2009

Bluffing in computer industry

Sometimes I attend on deal meetings there marketing people try to steal the project from another companies.
They equipped with best experts in NewTechnologyShit areas. I see these marketing people with their puppy experts say : "We can do it even faster that required "
"We have a lot of specialists that would write a best software for your company" etc.
I am really sure that a most of them didn't do a home work, even they don't know what they need exactly to develop........
It's look me like PREFLOP BLUFFING in poker - you don't know what cards have your opponent, you have just two cards (and I'm sure not a best hand at table) and you are going all in(what the matter with you).
I'm advicing to this manager just relax and 'call' . You can raise just if you have a really good hand or if you have a huge stack(I'm taking about big profitable companies).
So relax, buddy!!

How to win the lottery????


Hi all, it's my first post there(even first post ever) so I want that it would be a litle funny.A few weeks ago I saw behind bulding that I'm working in a big box with advertisement :


Guess what in the box and you can win a dream vacation


As person that never gained any prize in my entire life I was really curious what will be in the box, but how I can to guess???


On the 'Box' I've seen an Url of site that you need to enter for posting the guess. So I entered to the site - it was simple flash application with couple of textboxes and button 'Submit'. As a good programmer, obviously I had fiddler always opens when I'm working. The 'Fiddler' defines in it own site as 'Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet'. Ok let's check how 'Fiddler' can help us to win the lottery :
I filled all textboxes and clicked on submit after it I opened my good friend 'Fiddler'. You can't even to imagine how I was exciting when I saw in Headers section of 'Fiddler' the url that this flash site post al my details to. The url looks like this:'http://HostName/minisite/CarCompanyName/CarModel' (sorry that I can't publish real url ,I don't want to harm guys that developed this site) . So in the 'Url' I could see either car name and car model.

First of all now I'm sure that in the box a car ,I even know the Name of company and a model of the car.So in few second I sent my gues to AnyOneDontKnowExeptMeTheName company. Now you want to know how was my 'Dream Vacation' ??Unfortunately I didn't win the vacation (I'm suspecting 'Fiddler' cheat me with other ToMuchKnown guys), but now you really know why we need to use 'Fiddler'!!