how to create clickable elipsis at Windows Mobile Application

October 13, 2010

how do I create a label to be ellipsis that is if the text length is greater than the length of the container label will arise … which if clicked will issue the entire text

at first enter this function in your program:

public static void LabelWrap (LinkLabel LBL)
Graphics g = FindRoot (LBL). CreateGraphics ();
LabelWrap (LBL, g);

public static void LabelWrap (LinkLabel LBL, Graphics g)
string text = lbl.Text;
textWidth int = Convert.ToInt32 (Math.Ceiling (g.MeasureString (text + “”, lbl.Font). Width));
if (textWidth> lbl.Width)
text.Substring lbl.Text = (0, (lbl.Width * text.Length / textWidth) – 3) + “…”;
_fullText [IndexControl (LBL)] = text;
lbl.Click + = new EventHandler (PDALogic.lbl_Click);
else if (_fullText.ContainsKey (IndexControl (LBL)))
_fullText.Remove (IndexControl (LBL));

then each time you fill your linklabel with a text call

LabelWrap (nama_LinkLabel);

to make it into ellipsis

how to install barcode generator in windows

October 13, 2010

at github and googlecode explained how to install barcode generator: it works on linux but failed when the windows and still has not difix:

penyeselesaiannya simple fact you also have to install ghostscript (which unfortunately is not written in his github page)

so how to install barcode generator in windows: make sure you have:

* ImageMagick
* GhostScript
* Gbarcode (ruby gem:: gem install gbarcode)


script / plugin install

rake barcode_setup

then you can use a barcode generator in your view with

<% = Barcode ‘FJJ4JD’%>

how to create custom style on CK Editor (formerly FCK Editor)

September 17, 2010

first create a definition of its own menus and style

CKEDITOR.addStylesSet( ‘my_styles’,
// Block Styles
{ name : ‘Green Title’, element : ‘h2’, styles : { ‘color’ : ‘Green’ } },
{ name : ‘Orange Title’ , element : ‘h3’, styles : { ‘color’ : ‘Orange’ } },

// Inline Styles
{ name : ‘Warning Box’, element : ‘span’, attributes : { ‘class’ : ‘warning-box’ } }

you can add and subtract style that will be displayed by adding a set that contains:
name : title to be displayed in combo-box at the editor
element: tag that will be used to add style to the selected text
attribute: attribute other than style in the tag
styles: inline style on the tag.

then load the style on the configuration of our editors

CKEDITOR.replace( “my_editor”,{

stylesCombo_stylesSet: ‘my_styles’

if you only use inline styles (information about style is defined there in step 1, it does not require external css), then you have completed
but if you like the example use the classes from external css, the view in the editor will not change because active css in the editor is different from outside the editor. (As in style at the bottom of the class)
for that you must add the style definition in the editor:

CKEDITOR.instances.my_editor.addCss (‘. Warning-box (width: 100%; padding: 10px; text-align: center; font-size: 14px; font-weight: bold; border: 2px solid # FF0000; background: # F0FFF0;) ‘);

then view at the editor same with the view that we get (What You See Is What You Get)

FAQ about starting fb apps on rails

August 11, 2010

Q: which plugin/gem that i should used?
A: because of fb itself doesn’t provide an official plugin for rails so we used unofficial plugin. there are some unofficial plugin: RFacebook, facebookers & facebookers 2 (+ Mogli)
RFacebook is not maintenanced, so you should not used that, the remaining options are facebookers & facebookers 2
Facebookers have many obsolete functions (maybe because they still use the old REST APIs),
while facebookers 2 (+ Mogli) despite already using the new Graph API at the time of this writing (10-08-10) still have not completed it can be seen in the mongli readme file stating “

Feel free to add missing Associations if you see Them as well. My goal is to get a Readonly API in place first, and then
move on to the read / write API

so maybe there still Graph APIs features that can not be used in full CMIIW

Temporary conclusion: if your application only use features of FBML without Graph API, facebookers can be used (although you still need to be careful because there are obsolete fbml helpers, so see references in
, But if you need to use Graph API use mogli (+ Facebooker2) but if you need features not available in mogli you should make your own with gem HTTParty and guidance in Graph API

Q: why canvas blank when i choose the FBML option althought it’s okay when using iFrame
A: Maybe you not use the tunnel (see below) or you use tag that should not be used

Q: Why should I use the tunnel? and how?
A-1: if you use the FBML, facebook need to parse your pages before they are displayed on the user. that’s why, if you use relative url (like localhost) or non-public ip facebook can’t access your page so the canvas is empty!

A-2: register at (free for first 90 days)
-When you do ssh (using either the console or via putty) use the username provided by tunnlr (usually tunnlr ) rather than username to log into tunnlr!
-If ssh tunneling is successful, you can enter the url given to you by tunnlr in the Canvas url on facebook (remember the url given for the tunneling (usually ) rather than the url for login (usually

cryptography is mathematics ?

April 18, 2010

about a month ago my friend said that cryptography is mathematics. I immediately re-think cryptography is really mathematics? mathematics is widely used in cryptography (and other subjects) but to assumes that the cryptography is mathematics I think that’s too excessive.

I think cryptography is art and science of to secure the message (more precisely to make the message has a fourth aspect of cryptography: confidentiality, integrity, authentication, and non-repudiation) about how to achieve them you can use math problems, a chemical substance used as an invisible-ink , or with our knowledge of light properties uses light as OTP(One Time Pad) like quantum crypthograpy

so cryptography is the applicative science that uses various other disciplines to achieve these four aspects of cryptography and not only mathematics .

Hello world!

April 18, 2010

Welcome to This is your first post. Edit or delete it and start blogging!