Friday, December 24, 2010

Time

HAPPY HOLIDAYS!

Sunday, December 19, 2010

me, myself and C

Most beginning programmer get lost with the C programming language specifically the heart and soul which is POINTERS!

Why we need C/C++ POINTERS

1.Data management on the free store
2.Accessing class member data and functions
3.Passing variables by reference to functions

Example:

char m[] = {1,2,3,4,5}
char *p;
p = &m[3];

Pointers on C-POINTERS

1. Variables in C are memory locations
2. If you are going to change the variable you pass the variable by using pointers otherwise pass it by value e.g

changing the variable "s" pass by pointers

char *str( int i, char *s)
{
while(i) {
s++;
i--;
}
return s;
}


void none(int i)
{
i = i + 1;
return 1;
}

3.) C++ Friend function/classes are used for accessing methods + variables between classes of different type its a communication tool

4.) static void () the function is only visible in the file in which it is defined





Friday, December 17, 2010

Mono tips

Finally, after much sought speculation and stuff like that I installed the mono thingy into my
machine with the following configuration:


Configuration summary for mod_mono

* Installation prefix = /usr
* Apache version = 2.2
* Apache modules directory = /usr/libexec/apache2
* apxs = /usr/sbin/apxs
* apr-config = /usr/bin/apr-1-config
* apu-config = /usr/bin/apu-1-config
* CFLAGS = -g -O2 -I/usr/include/apache2 -I/usr/local/include -I/usr/include/apr-1 -I/usr/include/apr-1
* Verbose logging (debug) = no
* GCOV options used = no
* Profiling enabled = no
* mono prefix = /usr
* Default MonoApplicationsConfigDir = /private/etc/apache2/mod-mono-applications

Take note that there's a problem with the pkg-config-0.18.1.tar.gz stuff on Snow Leopard 10.6.5
you will need to download those shitnitz here http://ftp.novell.com/pub/mono/sources-stable/

:)

Thursday, December 16, 2010

XKCD 541 Emoticon Conundrum

Answer to emoticon conundrum http://xkcd.com/541/

When on Mac, press option+command+t and select the happy face character. Unfortunately that don't solve the problem entirely, there's no wink character ;-)

Saturday, December 11, 2010

Run multiple instances of an app on Mac OS X

Click Applications on Dock, select Automator. Choose Application. On searchbox, type: shell. Choose Run Shell Script, double click it. Then on text area, replace it with this text:

if [ -n "$*" ]; then
    open -n "$*"
else
    osascript -e 'tell app "Finder" to display dialog "PLZ DRAG AN APP 2 MULTIPLE INSTANCE" with title "MULTIPLE INSTANCE LAUNCHER" buttons { "OH HAI" } '
fi

On Pass input, change it to as arguments. Press command+S, on Save as type: Multiple Instance, on Where, choose Applications, click Save. Quit Automator.

Click Applications, drag Multiple Instance to Dock, preferably near Applications folder.

Click Applications, drag an app(example: Calculator) to Multiple Instance, repeat to launch multiple instance of that app.

Watch it on YouTube

mysql anyone?

Saying SEQUEL SERVER instead of MSSQL SERVER is a big no-no for me how about you ? What's up with that? What are the problems of the world ? Why are we here? Those questions intrigues me. Lol! To get you going with uninstalling MySQL on Mac OS X Leopard.

To uninstall MySQL and completely remove it (including all databases) from your Mac do the following:

Use mysqldump to backup your databases to text files!
Stop the database server

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*

The last two lines are particularly important as otherwise, you can't install an older version of MySQL even though you think that you've completely deleted the newer version!

Steve Ballmer on Developers

Are you a "Steve Ballmer" today? I mean, is the weather to hot that you sweat a lot? Your car aircon does not work? Is the sun so high you want to go to the beach?

You get my drift? Maybe this video can help.



This video came from this videos:



and



Credit goes to the respective YouTube uploaders.

Love/Hate Objective C

I recently realized that the learning curve of Java on Android compare to Objective C on iOS is a lot better. The documentations are robust anyway let's just cut the chase this post is about the beauty of Objective C .

OBJECTIVE C for starter

1.) NSLog is a function that
-- Can take one or more parameters. The first parameter is generally the string that is to be printed to the console. The @ symbol in front of the string tells the compiler that this is an Objective-C type string and not a C++ string. The @ symbol is typically used in front of all your strings for iPhone apps. If you do not use the @ symbol, you will probably get a compiler error.
2.) % is called the modulus operator.
This operator returns the remainder of its two operands.

3.) @ tells the O/S that is an objective C file

Classes Terminologies

4.) Pointers are like business card you don't see the real person yet you have the idea that you can reach him anytime.

5.) Two types of class methods
a.) class-method this are static function that uses the + sign (synonymous to public static function myMethod() in php )
+ used for messages that can be used before the object is created. (pseudo static )
b.) instance-method this are the default function of a class denoted by the - sign ( synonymous to private function myMethod() in php)
-(float) Power:(float)width:(float)height; in C/C++ you would write it like this float Power( float width , float height)

- (id)initWithName:(NSString *)newName atFrequency:(double)newFreq {
public function WithNameatFreq(new Name , new Freq)
char getName(char name)
{
}
@interface classname : superclassname {
// instance variables
}
+classMethod1;
+(return_type)classMethod2;
+(return_type)classMethod3:(param1_type)param1_varName;
-(return_type)instanceMethod1:(param1_type)param1_varName :(param2_type)param2_varName;
-(return_type)instanceMethod2WithParameter:(param1_type)param1_varName andOtherParameter:(param2_type)param2_varName;
@end

Note:
Class members declared PUBLIC can be accessed everywhere.
Members declared PROTECTED can be accessed only within the class itself and by inherited and parent classes.
Members declared as PRIVATE may only be accessed by the class that defines the member.
A private method is a method which is not inherited by subclasses. A private variable cannot be used outside the class
A public method is a method which can be called by any object of the class
A protected method can be called by any subclass within its class, but not by unreleated classes.

How to create a new Objective C class project

1.Choose MACOSX application
2.Select Command Line Tool ,ensure that Foundation is chosen for the type
3.If you want to add new objects Add New File
then choose Objective-C class from the MACOSX group make sure the Subclass
of dropdown is set to NSObject
4.How to initialize a class

myObject = [[MyClass alloc] init];
--
HelloWorld* myObject = [[HelloWorld alloc] init];
[myObject printGreeting];
[myObject release]; return 0;

self = meaning successful
nil = meaning failure

Happy coding! :)

nostalgia

Back in college my first assembly language machine problem is reading character input. I found the following old snippets from the nostalgia of my college days.

;======================
.model small
.stack 64
.data
pass db 'wade','$'
ass db '*','$'
input db 'Enter Password: ','$'
invalid db 'Sorry, Invalid Password',13,10,'$'
valid db 'Access Granted',13,10,'$'

.code
main proc near
begin:

add bx,1
mov ah,06
mov al,00
mov bh,07
mov cx,00
mov dx,184fh
int 10h
mov ax,@data
mov ds,ax
mov cx,4
lea SI,pass
mov ah,02
mov bh,00
mov dh,09
mov dl,30
int 10h
mov ah,09
mov dx,offset input
int 21h
compare:
mov dl,[SI]
mov ah,07
int 21h
cmp al,dl
JE right
jmp wrong
right: inc SI
mov ah,09
mov dx,offset ass
int 21h

loop compare
mov ah,07
int 21h
mov ah,02
mov bh,00
mov dh,13
mov dl,34
int 10h
mov ah,09
mov dx,offset valid
int 21h
mov ah,07
int 10h
mov ah,4ch
int 21h
start: JE begin
wrong: inc SI
mov ah,09
mov dx,offset ass
int 21h
mov dl,[SI]
mov ah,07
int 21h
cmp al,dl
loop wrong
mov ah,02
mov bh,00
mov dh,13
mov dl,29
int 10h

mov ah,09
mov dx,offset invalid
int 21h
mov ah,07
int 21h
cmp bx,1
JE start
cmp bx,2
JE start
jmp exit
exit:
int 18h
main endp
End main

That is all folks.

Tuesday, December 7, 2010

Fluent NHibernate: cannot convert lambda expression error

If you received this kind of error...

Cannot convert 'lambda expression' to non-delegate type Options

...just add System.Core in your References

Monday, December 6, 2010

Performing ORDER BY on DISTINCT on Linq to NHibernate(version 3)

You will received errors when doing OrderBy on Distinct result on Linq to NHibernate (NHibernate 3) at the time of this writing:

var cat = session.Query<Product>().Select(x => x.Category).Distinct().OrderBy(s => s);


Convert it to:

var cat = session.Query<Product>().Select(x => x.Category).OrderBy(s => s).Distinct();

Alternatively you can do this, which is quite neat:

var cat = 
        (from c in session.Query<Product>()
        orderby c.Category 
        select c.Category).Distinct();


Note the last two codes produces this(which is performant, heaven thanks):

select distinct category 
 from product 
 order by category asc

Not this:

select distinct category
 from 
 (select category from product
 order by category)


Be aware that if you are using Linq to SQL, the 3rd code construct cannot construct proper query (ORDER BY is omitted on generated query, silent error). Documented here: http://programminglinq.com/blogs/marcorusso/archive/2008/07/20/use-of-distinct-and-orderby-in-linq.aspx

He advises to move the orderby out of query to .Distinct() extension method.

var cat = (from c in session.Query<Product>()    
    select c.Category).Distinct().OrderBy(s => s);

Which leads to attaching two extension methods on the query just to make Linq to SQL emit the correct SQL. Which IMHO, renders the whole point of making Linq as query-like as possible lame.


I prefer the Linq to NHibernate approach than Linq to SQL. Not because NHibernate is database-agnostic(but it certainly adds appeal), but for the reason that it correctly informs the programmer that it cannot do something by not performing silent errors; it fail fast.

Here's the error emitted when performing OrderBy on Distinct expression:

Unhandled Exception: System.NotSupportedException: Operation is not supported.

Friday, December 3, 2010

Unix transport error when unit testing NHibernate for Postgresql under Mono

If you happen to encounter the following error while doing unit testing for NHibernate for Postgresql under Mono...

Internal error
        RemotingException: Unix transport error.

...Change your Npgsql version to a Mono one, then that error won't happen.

That error will appear on unit testing if you are using MS .NET version of Npgsql (example: http://pgfoundry.org/frs/download.php/2868/Npgsql2.0.11-bin-ms.net4.0.zip) under Mono. When unit testing under Mono, you must use Mono version of Npgsql (example: http://pgfoundry.org/frs/download.php/2860/Npgsql2.0.11-bin-mono2.0.zip)

Weird problem, the error only appear when the code is run under Unit Testing(built-in in MonoDevelop). But when run independently, MS .NET version of Npgsql will run just fine under Mono. Anyway, to make matters simple, use Mono version of the component if you are building Mono stuff



SMARTBROADBAND FAIL!

Saturday, November 27, 2010

For Your Dreams To Become Real: Try Unreal

Unreal. The engine that powers most of your favorite games. Epic Games, the creators of Unreal Engine, releases the latest beta version of Unreal Development Kit (UDK). Here's a sample video of what it can do.



UDK is free of charge. Isn't that nice?

Since many game developers use it, why not give it a try? Download it now at udk.com.

Sources:
UDK.com
Joystiq.com

Friday, November 26, 2010

When Cars and Technology Collide: Gran Turismo 5 Launch Trailer

Never in our wildest dreams can we collect and drive 1031 cars on 26 race tracks all in the comfort of our couches. Does the names Ferrari, Lamborghini, and Pagani ring a bell?

It's been ages since we've heard of the name Gran Turismo 5, a video game for the PlayStation 3. Having the tag line "The Real Driving Simulator", playing it gives you the feeling of driving the real thing as every car in the game is an accurate representation of the actual car, including the handling, the spins, the dents, the dusts, and scratches.

To give you an idea of what I'm talking about, here's a trailer:



Other features include course maker, online racing, photo mode, and car modification. And since it's on PlayStation 3, you can find it on our local stores here in the Philippines.

Source: [url=http://gran-turismo.com]Gran-Turismo.com[/url]

Wednesday, November 24, 2010

lol on android

its a love/hate relationship between writing for iOS versus Android platform
what the fuck is that ?

i've got tons of stuff todo i'll get back on this post again as fast as the speed of light and more
shit like that :p


paid software is great software ?

Saturday, November 20, 2010

Boom!

We'll, if you have a booming business, you'll appreciate the word "boom" more and more.

Check out this video of Steve Jobs saying that word again and again.



And while I'm posting this, I hear boom sounds outside the house. What a coincidence. hehehe

Credit goes to the YouTube poster.

HR Dilemma

Fake-project-managers,wannabe-programmers etc. blah-blah-blah they’re called
HR Dilemma.

In the murky past (college-days) one of my first-machine-problems (programming-lessons) was to program the fibonacci number sequence, which was quite mind-boggling. For me personally tests kill me, whether it is an IQ test or a ‘programming-exam’ (you can imagine how my college experience must have been).

I’m not an expert, but i wouldn’t call myself a total newbie. I’ve learned a lot and I have to agree with Jett Atwood who said:

“I am disturbed and appalled that any so-called
programmer would apply for a job without being able to
write the simplest of programs “.

I do not patronize certification (like java certification, zend etc).
I prefer the real-stuff I think to solve the issue of prankster-applicants (con-artists) even those who are applying for top level positions should take practical
exams to spare the HR-Dilemma . =P padded resumes — they all suck!

To end this rants, here’s a quote from john kegel:


“A surprisingly large fraction of applicants, even those with masters’
degrees and PhDs in computer science, fail during interviews when asked to
carry out basic programming tasks”

There’s just too many con-artists in this planet. tsk tsk.


Work and Management Douche style

There’s absolutely nothing wrong with having a retarded co-worker, We need them and they need us,and we can’t have the best of both worlds theyre always & will always be in existent for the rest of our fucking lives.commensalism or parasitism ? I dont know . I have been working for about 4+ yrs now and these horrible people should die,you get the idea? When you start working somewhere for awhile you start to notice there are people that piss the hell out of you and what could go wrong?

Fucking hell…

Tell tale signs that you have a douchetarded co-worker

1. Backstabber

The backstabber had to bite someone once and be damned if he wasn’t hungry an hour later for talking bullshit.And the award for the best traitor goes to the Backstabber. (applause-emoticon-goes-here)

2. Storyteller
It appears that he always had a similar experience or story to tell.Stupid!

3. Leech AKA Mr-I-know-everything

All merit goes to the leech or you will die. Even If you work harder like all night long with buggy eyes
you get paid less because the leech gets it. capische ? The sad part is he always win because hes allied with the Backstabber.

The list is not complete and you haven’t seen the worst of worst co-worker yet,
trust me. :-)

No actual a-hole employee was harmed in the making of this rantarded post Which is actually a real shame because let’s face it; They’re mostly all a bunch of asswipes with no hope for the future.

Which glory hole do you work at?

Note:

With Carbon Dating, you can figure out how old something is really accurately like how long have you been burnout with work. ROFL

Annoying Boss

One of the things I find most annoying beside littering, second-hand-smoke & programmer-wannabe
are the people known as “know-it-all-project-manager” .

My Top Four Most Annoying Project Managers

1.Mr.ColorCoding
->The fact that his resume is 5 pages long,he’s full of sh!t.
->He doesnt know the contrasting stuff between “.ini” and “.exe” file
->He always have a lifestory to tell from non-fiction to fiction blah-blah
->Syntax Highlighting are used by real-programmers
the term colorcoding is exclusive for Mr.ColorCoding.

*Syntax highlighting is a feature of some text editors that displays
text—especially source code—in different colors and fonts according to the category of terms.(excerpt from wiki)

2.Ms.Colspan
->She doesn’t know what a loop construct is(for and while)

3.Mr.Html
->He doesn’t know how to code. enough said.

4.Mr.Shrek
->He is a good programmer but then his managing style is equivalent to zero less than the planck length (Lol) therefore this guy is a total-douchebag .
->He smellslikeshit!Lol
->A very nasty and barbaric boss, tend to shouts at people.

5.Mr.Shout
->Talk shit lame-ass-wipe-boss
->He is the tarzan to luciano pavarroti , need I say more?
->very close to Mr.Colorcoding


The Leadership Test: Are You a Bad Boss?
By Jessica Groach
Learning & Life Columnist
A 2001 Gallup poll says the #1 reason people leave their jobs is bad
bosses.
Are you one of them?

Leadership Test
Test your leadership style by answering these questions as honestly as
possible:
1.. Have you ever criticized an employee in public?
2.. Do you ever take credit for employees’ work?
3.. Do you subconsciously reward your favorite employees, or punish your least favorites?
4.. Are you hesitant to relinquish projects to your employees?
5.. Do you constantly check their work for quality?
6.. Do you expect your employees to do what they’re asked, without question?
7.. Are your employees afraid of you?
8.. Do you communicate with your staff through e-mail?
9.. Do you avoid knowing your employees personally?
10.. Are you hesitant to ask for feedback from your staff?
If you’ve answered “yes” to any of these questions, we hate to break it to you, but you might be a bad boss.Become a Better Leader As Theodore Roosevelt once said of leadership, “The leader works in theopen, and the boss in covert. The leader leads, and the boss drives.” Your leadership style may need some work, but leadership isn’t born, it’s made. Today, many management programs and professional associations offer leadership courses that help managers become good leaders, and good coaches.

Leadership courses help managers to develop good communication skills, so that they can effectively communicate their vision, mission, and expectations to their staffs. Programs like these instruct participants in improving listening skills, resolving disciplinary and performance issues, accepting criticism, public speaking, acknowledging and rewarding good work, delegating tasks, and building successful teams.So step out of the driver’s seat and start leading. Your team just might follow you.

http://www.learningandlife.com/career-tips/the-leadership-test-are-you-
a-bad-boss.php

Programming

Programming

with 5 comments

Ten Commandments for Stress Free Programming:
1) Thou shalt not worry about bugs – bugs in your software are actually special features.
2) Thou shalt not fix abort conditions – your user has a better chance of winning state lottery than getting the same abort again.
3) Thou shalt not handle errors – error handing was meant for error prone people, neither you or your users are error prone.
4) Thou shalt not restrict users – don’t do any editing, let the user input anything, anywhere, anytime. That is being very user friendly.
5) Thou shalt not optimize – your users are very thankful to get the information, they don’t worry about speed and efficiency.
6) Thou shalt not provide help – if your users can not figure out themselves how to use your software than they are too dumb to deserve the benefits of your software anyway.
7) Thou shalt not document – documentation only comes in handy for making future modifications. You made the software perfect the first time, it will never need modifications. 8) Thou shalt not hurry – only the cute and the mighty should get the program by deadline.
9) Thou shalt not revise – your interpretation of specs was right, you know the users’ requirements better than them.
10) Thou shalt not share – if other programmers needed some of your code, they should have written it themselves.

Software Development Cycle:
1) Programmer produces code he believes is bug-free.
2) Product is tested, 20 bugs are found.
3) Programmer fixes 10 of the bugs and explains to the testing department that the other 10 aren’t really bugs.
4) Testing department finds that five of the fixes didn’t work and discovers 15 new bugs.
5) Repeat three times steps 3 and 4.
6) Due to marketing pressure and an extremely premature product announcement based on overly-optimistic programming schedule, the product is released.
7) Users find 137 new bugs. 8) Original programmer, having cashed his royalty check, is nowhere to be found. Newly-assembled programming team fixes almost all of the 137 bugs, but introduce 456 new ones.
Original programmer sends underpaid testing department a postcard from Fiji. Entire testing department quits.
9) Company is bought in a hostile takeover by competitor using profits from their latest release, which had 783 bugs.
10) New CEO is brought in by board of directors. He hires a programmer to redo program from scratch.
11) Programmer produces code he believes is bug-free…

This post is an excerpt :D

porting software


OK, I have to admit I am not well experience with porting software applications from one language to another ,and to be honest inspite of my lack of jittery-skills I’m very much thrilled to see projects ported from one machine to another. (The impressive MONO port of .NET and stuff.)

Maybe it is nostalgic memories (college days) ,writing mini application of foxpro
programs and porting it to cobol and vice versa etc. =p

Porting applications is a big challenge for every software developer and to share my
indebted experience my most recent side project was porting a point of sale application
written in foxpro to php and mysql . I tell you , it is terrible & nice thing I have some friends to back me up LOL .

And for those developers who are very much new to this software-porting-arena

Here is my scratch-your-left-pinky-to-your-right-toe-kind-of-tips:

1.If you are porting a very large rdbms type of application learn design patterns

2.remember realistic timeline slash timeframe =p

3.create test cases

4.use versioning software for a team of 2 to 3 developers

5.do it once and do it well

6.productive-wise.use managed-programming-language

That’s it fellow geektards LOLROFL

Frigtards

With the coming of the Internet comes two breed of software programmers the real one and the fakesters.

Majority of this fakesters belongs to (sad to say) the Open source demography which is basically a breeding ground for an army of wannabe and con artists programmers most especially in the web development arena.

I decided to write a wake up call for those frigtard con artists and to help you determine quickly whether someone you’re talking to is actually a developer or not, read the following tell tale signs. lol :-D

1. padded resumes.
claims to be proficient in different types of programming languages or after completing 3 weeks of training and obtaining a certification proclaimed himself to be a master of a new language. i've got something for you yes you conman! shame on you :p . I mean don’t bite more than you can chew.

2.script kiddies

3.can’t write a batch file/shell script on their primary OS , dont know what a batch file is.

4.attitude. have to feign interests and opinions, and then be smugly confident that your “choices” are superior to the mainstream’s AKA I-want-to-change-his-attitude-because-I’m-far-better-than-him.

5.the knowledge of the vocabulary of technical jargon is a big hollaballo lol

well that's all folks.

tech tips for your grandma


It is always better to practice good computing habit the following are my suggestions. LOL :D
Computing tips 101 ( MICROSOFT WINDOWS )
1.For security protection against malware,spyware and viruses use the following
a. AVG 9.0
b. SUPERAntiSpyware
c. Malwarebytes Anti-Malware
d. CCleaner
e. CleanMyPC Registry Cleaner
2.For video playback use VLC Media Player and the following codecs should be installed.
a. AVI Codec Pack +
b. DivX
c. XviD
** You can use Moyea FLV Player for flv file formats for 3GP try Media Player Classic
3.For Monitoring your system resources you can install the ff:
a. MemTest
b. cpuz
c. Process Explorer
4.For web design try Macromedia Dreamweaver or Microsoft Frontpage.
5.Instead of using limewire , shareaza or kazaa using torrent is a lot healthy.
6.For programming geeks I suggest using Bloodshed C++ instead of the bloated Microsoft Visual Studio.
7. I prefer Firefox 2.0.0.16 or Internet Explorer 6.0.2900.2180.spsp_Sp2_rtm or better yet Google Chrome.
8. For advanced customization of your programs click on START menu -> select RUN -> type MSCONFIG ( i don't know about WINDOWS 7 support on MSCONFIG )
9. For Text editor I used TEXTPAD.
whoa , does this post look infected? :-)
Hasta Luego!
Trivia:
VIRUS is actually an acronym for Vital Information Resources Under Siege

Welcome to Webdunnit!

Hello fans! You've just landed on one of the web's well known blog sites. We're glad you've given us some of your spare time to visit our little space.

First, let me introduce ourselves. My name's Bobo Bambano and I'm here with undextrois. We are tech enthusiasts. We love technology. We admire these man-made and computer-made inventions. We love to explore these stuff.

We'll be talking about the web (woosh!), the desktop (drrr!), Windows (mrr!), Linux (wooz!), Apple (boom!), and maybe throw in some iOS (mrrr!) or Android (bfft!). Hopefully you'll learn something from us. You'll also see some other people's words, with credit of course.

Whether you're a n0ob (newbie) or l33t (elite), we hope you'll have fun reading our thoughts. The Internet is a fun place after all.