2011-04-20

Az nem úgy van az

Történt egyszer valamikor 2005 tájékán, hogy Budapesten egy XI. kerületi kollégiumban, a 11 emeletes épületben a lift elromlott és egy fiatal srác bennragadt. Nyomta ő a csengőt, mint süket a csengőt, de a portás csak nem hallotta meg és nem intézkedett. Bicskájával hát kibütykölte a lift ajtajának zárószerkezetét, kinyitotta a liftajtót, majd kimászott. Lesétált a földszintre, hogy elmesélje hogyan járt, ha már a csengő nem működött vagy nem hallották. Addigra épp oda is ért a nagyon lassú léptekkel közlekedő mikulásra emlékeztető portásbácsi.

- Jó napot kívánok! A negyedik és az ötödik emelet között elakadt a lift.
- Ezt meg maga honnan tudja?
- Benne utaztam.
- És? - kérdezte a portás nagy kerek szemekkel.
- Kifeszítettem az ajtót és kimásztam.
- Az nem úgy van az hogy csak úgy kimászunk a liftből!*

2011-04-14

Symlinks under Windows, finally. Or not?

Symbolic links were introduced to Windows as of Windows Vista. Yipikaye! Or not?

D:\linktest>mklink fileLink file.txt
You do not have sufficient privilege to perform this operation.

Under Windows 7 you have to have administrator privileges to create one. So if you have a D:\home\yourname\projects\pets\WorldDominator and you want to access it as D:\home\yourname\WorldDominator then your friend is not the symbolic link, but the plain old Windows shortcut.

What about projects that want to be platform independent and wait for Windows to have support for symbolic links, so some routing code could be dropped? Some pain. Windows is the only mainstream operating system that does not have support for user managed symbolic links by default. It can be configured using secpol.msc by the administrator who may or may not care.

I wish I could understand the considerations behind this decision.

And finally, should the multi-platform projects use symbolic links or not?

2011-04-07

Courier New - follow up

Couri
erNew
|⇐⇒|
|||||

Rightwards (and leftwards) double arrow

I wrote to "FontsLive.com by Monotype Imaging" about the problem. They confirmed that the problem is in the font itself (not the softwares), but they cannot change the situation, because of licensing difficulties:

Hi Edvárd,

It appears to a bug (or a feature?) in Courier New and how it is rendered in various environments or applications.

Unfortunately since we distribute this font under license we cannot modify it.

So my suggestion would be to consider a different font, such as Consolas, another monospaced font.

Sincerely,
--- 8< ----

2011-03-18

Courier New - rightwards double arrow


<span style='font-family: courier new; font-size: 1.5em; line-height: 80%;'>
|something|&larr;|&rarr;|&lArr;|&rArr;|something|<br />
||||||||||||||||||||||||||||||||||<br />
</span>

|something|←|→|⇐|⇒|something|
||||||||||||||||||||||||||||||||||

The above example demonstrates that the monospace Courier New font is not monospace. You can use this text for testing Notepad, Mozilla Firefox 3.*, PuTTY. The rightwards double arrow is wider than it should be. Under IE8, and Firefox 4.* both double arrows are wider than they should be. (All tested under Win7)

Here I divide by z[AUTOSAVED]

Follow up

Courier New - follow up

2011-02-07

Dropbox (x)

One of my friends recommended me this simple utility. I like it and I think that the most impressive feature of it is that you can synchronize your documents between your computers. It can be also used for sharing some things with the public or with some other Dropbox users.

The figure

The idea is a basic one. You register at Dropbox.com and download a service application for your operating system (Windows, Linux, Mac and some mobile devices are supported) and select a newly created directory on your local computer.

Everything stored on the Dropbox server will be synchronized down to your computer's selected folder and when you change or add anything to that folder then it will be uploaded automatically and downloaded by your other computers. You can also access your files via the web interface.

You will get 2 GB of space for free and - of course - you can buy more up to 100 GB.

Dropbox vs Google Docs

It is better than Google Docs because you can share ANY KIND OF DOCUMENT that your computer can handle, not only a subset of them. However Google Docs has some advantages like simultaneous editing of texts and spreadsheets.

Dropbox vs revision control systems

It is not for that at all. There are a limited support for undeleting but that's all.

Internet Explorer vs favicons

The usage of favicon.ico in the root directory of the site was introduced by Internet Explorer 4.0. This icon must be a Windows Icon File (MIME: image/vnd.microsoft.icon). It is used to illustrate bookmark entries, desktop shortcuts, tabs (of tabbed browsing). Time is - again - frozen at Microsoft because...

jeffdav blog entry describes that this must be a Windows Icon File, otherwise Internet Explorer will not display this icon.

All other major web browsers support PNG, GIF and JPEG. Firefox and Opera also supports APNG, and Opera alone can use SVG. If an image type can be handled by a browser then there should not be any obstacle to display favicons of that kind.

2011, Internet Explorer: WINDOWS ICON FILE ONLY.

Good news: You can specify different favicon for each page like that:
<html>
	<head>
		<!-- some things -->
		<link rel="shortcut icon" href="path/something.ico" />
	</head>
	<body>
		<!-- some things -->
	</body>
</html>

PS: If you want to generate more anger inside yourself then you should check out http://animatedpng.com/ and follow the case of APNG support in web browsers. According to the 10 year long story of alpha transparency support in Internet Explorer there is no much hope.

2010-11-30

UFO Trick

2010-11-24

Pesti Meló



Bunkos Tesók - Bolyai Club

2010-10-22

2010-10-19

The OMG Cat / Az "Óh, jajj, Istenem!" macska

Original / Eredeti




~ sees car accident / ~ autóbalesetet lát


2010-10-15

Ruby is not good at comments

Problem

Imagine that you are hard-coding some long list into your Ruby code and you need to
  • wrap the long line into multiple lines
  • comment on some items
Let's look at the 1st goal (imagine a lot longer list)!
@@import_fields = [ \
    "Name" \
    , "Organization" \
    , "Role" \
    , "Internal ID" \
];
Pretty ugly, because the statement separator is the newline and you should escape it. But doable. Let's move on!

Completing the second goal is not possible. The only commenting option is the line-commenting which is starts with the # sign and ends when the line ends. If you place the comment before the backslash (\), your interpreter will not detect the newline escaper backslash. If you place the comment after it, then it stops being a newline escaper.

Nonexistent solutions

  • The Ruby guys failed to add statement separators / terminators to the language and that remains this way. I think the intention was to make life easier, but I believe they made it harder. Someone someday may enlighten me.
  • They should introduce block comments. It would be backward compatible and would make the World a better place.
  • Or they should detect the newline escaping after the # sign.

Workaround

@@import_fields = []
@@import_fields << "Name"
@@import_fields << "Organization" # Some clever saying about this field
@@import_fields << "Role"
@@import_fields << "Internal ID" # And some eternal wisdom about this

If you know a better way, don't hesitate to tell me!

2010-10-13

Indent with TABs, format with spaces

TABs vs spaces

1st: Visible with

They say that TABs are rendered differently by different softwares and devices. I cannot accept that. Read on.

UNICODE 2.0 released in year 1996. In around 2001 people wanted to kill me because I used UTF-8 characters on IRC, and they argued that their [not so good] software cannot render them correctly. I ignored them. Their [not so good] software became advanced, their minds became open.

Editors and devices where the visible width of TAB characters cannot be adjusted are not so good. TAB is not a new invention at all.

2nd: Formatting

TABs are not for formatting. They are only for indenting.

int·main()
{
→   printf("Hello·%s!\n",·//·I·like·to·move·it,
→   ·······"World");······//·move·it.
→   return 0;
}

If you want to graphically align something then you should use SPACES. If you are expressing the depth of control, then you should use TAB. The above code will maintain it's visual, see:

int·main()
{
→   {·//·Ad-hoc·block·begin
→   →   printf("Hello·%s!\n",·//·I·like·to·move·it,
→   →   ·······"World");······//·move·it.
→   →   return·0;
→   }·//·Ad-hoc·block·end
}

3rd: Freedom

See what happens when visible with of TAB is set to 8, because someone may like it that way:

int·main()
{
→       {·//·Ad-hoc·block·begin
→       →       printf("Hello·%s!\n",·//·I·like·to·move·it,
→       →       ·······"World");······//·move·it.
→       →       return·0;
→       }·//·Ad-hoc·block·end
}

The hairdo is still tight.

What if someone's favorite visual TAB size is 2?

int·main()
{
→ {·//·Ad-hoc·block·begin
→ → printf("Hello·%s!\n",·//·I·like·to·move·it,
→ → ·······"World");······//·move·it.
→ → return·0;
→ }·//·Ad-hoc·block·end
}

The hairdo is still tight.

4th: Symbolism

From my heart: http://www.mail-archive.com/vim_use@googlegroups.com/msg18895.html

Favorite part: ... tabs for leading indent, spaces everywhere else. I prefer this strategy for the same reason I prefer to use symbolic names for constants, rather than embedding numeric literals throughout my source code ...

2010-09-09

2010-08-23

Stephen Fry & Hugh Laurie

Régi cucc, ami csak nekem új. Dr House egy másik élete.



Old stuff which is new for me. Another life of Doctor House.

2010-08-16

Villamosos üldözés / Tram pushuit

Have a good evening!

In current days, while the criminal acts are spreading, the daredevils of the gangland invent newer and newer ways to deliver their deeds.

The following police recording proofs that criminals are not picky about the vehicles they use during robbery.

2010-08-15

Happy debugging

#define TRUE FALSE /* Happy debugging, suckers! */

2010-08-12

Editing JPEG DPI without resampling

The title is the naive search term for a problem. The good search term - or Google power phrase - is Exif editor. The best of the results which simply solves the problem is the Exif Pilot on an Exif editors page. Enjoy!

P.S.: I decided to publicate the fruit of every hard and exhausting search on this blog. Maybe it is not good for the regular visitor, but I'm sure it helps the Universe in general. :-)

--- Hungarian version

JPEG DPI szerkesztés: Ez a jó neked: Exif Pilot az Exif editors oldalról.

2010-08-11

Welcome to Ruby

myString = "Welcome to JavaScript!"
=> "Welcome to JavaScript!"

myString[8..20]= "Ruby"
=> "Ruby"

puts myString
=> "Welcome Ruby!"

2010-07-22

Monorail cat / Mágnesvasút macska*



Catmas blog

*Korrekció: Egysínű macska. Könszönet Anonymousnak! :-)

LOLCODE

~ is an esoteric programming language inspired by the language expressed in examples of the lolcat Internet meme. The language was created in 2007 by Adam Lindsay, researcher at the Computing Department of Lancaster University.

The language is not clearly defined in terms of operator priorities and correct syntax, but several functioning interpreters and compilers already exist. The language has been proven Turing-complete.

-- Wikipedia

Examples

  • Hello World!
    HAI
    CAN HAS STDIO?
    VISIBLE "HAI WORLD!"
    KTHXBYE
    
  • Print numbers from 1 to ROOF.
    HAI
    CAN HAS STDIO?
    I HAS A ROOF, I HAS A VAR ITZ 0
    GIMMEH ROOF BTW U R IN CONTROL
    IM IN YR LOOP
            UP VAR!!1
            IZ VAR BIGGER THAN ROOF? KTHXBYE
            VISIBLE SMOOSH VAR AN ":)" MKAY
    IM OUTTA YR LOOP
    KTHXBYE
    

lolcode.com