Posts

How to convert decimal to hex in JavaScript? -

how convert decimal values hex equivalent in javascript? convert number hexadecimal string with: hexstring = yournumber.tostring(16); and reverse process with: yournumber = parseint(hexstring, 16);

.net - Open a URL from Windows Forms -

i'm trying provide link company's website windows form. want behaved , launch using user's preferred browser. what best way open url in user's default browser windows forms application? this article walk through it. short answer: processstartinfo sinfo = new processstartinfo("http://mysite.com/"); process.start(sinfo);

iphone - Upgrading to a universal app and sdk problem -

i have iphone app. i decided upgrade ipad , installed xcode_3.2.3_and_iphone_sdk_4__final.dmg i upgraded app universal app. before installation of new sdk, compile iphone app 3.0 sdk. however, after installation, can see iphone device 3.2 adn 4.0 sdks on xcode. i wonder, if compiled universal app 3.2 sdk can iphones 3.0-1-2 os versions run new universal app? if can not, there way that? you can set in project iphone os deployment target fit app. you find in project > edit project settings > build tab > deployment according apple ipad programming guide : when running on ios 3.1.3 or earlier, application must not use symbols introduced in ios 3.2. example, application trying use uisplitviewcontroller class while running in ios 3.1 crash because symbol not available. avoid problem, code must perform runtime checks see if particular symbol available before using it. information how perform needed runtime checks, see “adding runtime checks newer symb...

How to make audio sound better? (C + FFMpeg audio generation example) -

so found great c ffmpeg official example simplified: #include <stdlib.h> #include <stdio.h> #include <string.h> #ifdef have_av_config_h #undef have_av_config_h #endif #include "libavcodec/avcodec.h" #include "libavutil/mathematics.h" #define inbuf_size 4096 #define audio_inbuf_size 20480 #define audio_refill_thresh 4096 /* * audio encoding example */ static void audio_encode_example(const char *filename) { avcodec *codec; avcodeccontext *c= null; int frame_size, i, j, out_size, outbuf_size; file *f; short *samples; float t, tincr; uint8_t *outbuf; printf("audio encoding\n"); /* find mp2 encoder */ codec = avcodec_find_encoder(codec_id_mp2); if (!codec) { fprintf(stderr, "codec not found\n"); exit(1); } c= avcodec_alloc_context(); /* put sample parameters */ c->bit_rate = 64000; c->sample_rate = 44100; c->channels = 2; ...

c# - Telerik RadGrid - How do I set the MaxLength for the Insert Textbox -

i have radgrid on page "add new record" button. when click "add new record" button, textbox appears above each column allows me enter values. want limit number of characters can entered in textbox. how set maxlength of textboxes? you're not telling me problem don't think. very-well try use maxlength property (if it's not multiline textbox). problem? or know how can accomplish this, you're having trouble getting control via server-side or client-side code can set maxlength property?? if provide code snippet or 2 , more details regarding problem, i'd better-able you.

java - Hibernate - maxElementsOnDisk from EHCache to TreeCache -

i'm migrating hibernate application's cache ehcache jboss treecache. i'm trying find how configure equivalent maxelementsondisk limit cache size on disk, couldn't find similar configure in filecacheloader passivation activated. thanks this page seems imply correct configuration element is: <attribute name="maxcapacity">20000</attribute> however, i've ever used ehcache myself.

c - Confused by gdb print ptr vs print "%s" -

1167 ptr = (void*)getcwd(cwd, max_path_length-1); (gdb) n 1168 if (!ptr) { (gdb) print ptr $1 = 0xbff2d96c "/media/mmc-sd/partition1/aaaaaaaaaaa" (gdb) print &cwd $2 = (char (*)[3500]) 0xbff2d96c (gdb) print strlen(cwd) $3 = 36 (gdb) print "%s",cwd $4 = "/media/mmc-sd/partition1/aaaaaaaaaaa", '\0' <repeats 912 times>, "��o�001\000\000\000\000��027\000\000\000�3����el鷠3�000��027\000\000\000\000\000\000\000\027\000\000\000\000��/�027\000\000\000�3����n����\230���鷠3�000��027\000\000\000\000\000\000\000��000\000\000\000\001\000\000\000��m鷠3����\000\000\000\000.\231�027��w\005\b\001\000"... (gdb) print "%s", ptr $5 = 0xbff2d96c "/media/mmc-sd/partition1/aaaaaaaaaaa" (gdb) quit why ptr printing string correctly cwd not; affects program , crashes if try use cwd... [edit: turns out crash caused stupid buffer overflow on var... grr...not gdb, print question still valid] the reason cwd print...