Posts

Showing posts from May, 2013

c# - How to log user operations for a asp.net application? -

how can log user operations asp.net application. further approach saving log data ? kindly guide. i recommend use logging framework log4net or nlog. these frameworks allow log many destinations , more importantly allow make decision after finished application i.e. can configure log messages written. personally log database in case of web applications.

c - how does do{} while(0) work in macro? -

though topic has been discussed many times in forum , other forums, still have doubts. please help. how do{} while(0) in macro work in linux kernel? example, #define preempt_disable() { } while (0) how disable preempt? #define might_resched() { } while (0) how reschedule? similarly have seen macros mutex locks , other also. how help? understand following problem not examples above. #define foo(x) { } while(0) edit: what following code rt_mutex_lock ? /** * rt_mutex_lock - lock rt_mutex * * @lock: rt_mutex locked */ void __sched rt_mutex_lock(struct rt_mutex *lock) { might_sleep(); rt_mutex_fastlock(lock, task_uninterruptible, 0, rt_mutex_slowlock); } export_symbol_gpl(rt_mutex_lock); /* * debug aware fast / slowpath lock,trylock,unlock * * atomic acquire/release ops compiled away, when either * architecture not support cmpxchg or when debugging enabled. */ static inline int rt_mutex_fastlock(struct rt_mutex *lock, int s...

iPhone NSURL String/HTML Local App Resource Accessed in Another Application -

using iphone sdk: 3.0 (firmware 3.1.2) i'm new iphone development , researched here , google few hours no luck. here's issue: i have ebook in epub format want sell on app store, app store requirement epub must contained in iphone app. so, decided make app installs ebook stanza or other number of iphone ebook readers. so, first method used using nsurl (with stanza protocol) pointed epub that's hosted on website, e.g. (stanza://www.myebooks.gov/mybook.epub). worked fine , loaded epub stanza. however... to minimize risk of having book pirated, i'd include epub resource in application , pass resource stanza or other ebook reader that's compatible via local url pointed @ filesystem (e.g. stanza://var/mobile/applications/guid/*.app/ebook.epub) or other method. i've tried loading uiwebview, telling load local resource (e.g. stalking.html) , inside html file having *.epub linked , wasn't working either. i've tried "../" without , m...

objective c - Programmatically open PrefPane with section -

i need open network-prefpane in app. works fine with [[nsworkspace sharedworkspace] openfile:@"/path/to/prefpane"]; but how can directly open "proxy-settings", in "network-pref" under "advanced"? you can see in safari-settings under "advanced->proxies" thanks the easiest , cleanest way i've found use applescript. nsapplescript *a = [[nsapplescript alloc] initwithsource:@"tell application \"system preferences\"\nactivate\nset current pane pane \"com.apple.preference.universalaccess\"\nend tell"]; [a executeandreturnerror:nil]; [a release]; replace com.apple.preference.universalaccess name of pane. here full list of preference pane names .

python - 'invalid value encountered in double_scalars' warning, possibly numpy -

as run code these warnings, in groups of four, sporadically. have tried locate source placing debug messages before , after statements pin-point origin. warning: invalid value encountered in double_scalars warning: invalid value encountered in double_scalars warning: invalid value encountered in double_scalars warning: invalid value encountered in double_scalars is numpy warning, , double scalar? from numpy use min(), argmin(), mean() , random.randn() i use matplotlib it looks floating-point calculation error. check numpy.seterr function more information happens.

php - How should I incorporate the salt in my password hash? -

how stronger would return sha1($salt.sha1($passwd)); be compared just: return sha1($salt.$passwd); $salt per-user string of length 12 consisting of strong random ascii. it's twice strong, because attacker needs perform twice many sha1 calculations brute force attack. of course, still not impressive. on other hand, doing sha1 5000 times in loop practical authorization, makes attacks take 5000 times longer - technique known key strengthening . is, however, poor man's substitute adaptible-cost hash algorithms jacco mentions.

iphone - Points of Interest API / Webservice -

i have requirement show points of interest on map within iphone app working on. i'm using mapkit display maps , users location. i've been unable find suitable webservice retrieve places or points of interest (restaurants, shops, hotels, etc) display on map. i know can done, because many apps it. how it, i'm trying find out. things i've tried cloudmade - not solution iphone sdk requires use maps instead of google ones in mapkit. google places api - (confusing me) places api homepage says service launched july 2010. watch may wrong, isn't september 2010 right now? applied api key week ago haven't gotten response far. google map api webservices - seems provide geocoding , reverse geocoding, etc, no relevant points of interest google maps javascript api - i'm able json response invoking 1 of javascript apis returns list of places based on query , given location, but json invalid - key names not contained in quotes, , such no parser (web or...

c++ - Character sets - Not clear -

the standard defines basic source character set basic execution character set , wide char counterpart it defines 'execution character set' , wide char counterpart follows $2.2/3- "the execution character set , execution wide-character set supersets of basic execution character set , basic execution wide-character set, respectively. values of members of execution character sets implementation-defined, , additional members locale-specific." q1. don't think understand completely, particularly last statement. pointers on aspect? further, $3.9.1 - "objects declared characters (char) shall large enough store member of implementation’s basic character set." q2. in 3.9.1 phrase 'basic character set' means 'basic execution character set'? you need distinguish between source character set, execution character set, wire execution character set , it's basic versions: the basic source...

visual studio 2005 - Detect Autoscrollposition value change in panel -

how detect if autoscrollposition value changes in panel1? for example, textbox1 , textbox2. which added in panel1. autoscroll property set true. i interested in detecting when value of panel autoscrollposition changes. the above dynamic textboxes incremented. software in use: c#, visual studio 2005. the component required it. is: listbox1 listbox2 panel button. the namespace class: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.text; using system.windows.forms; using system.collections; here complete solution code: namespace detectpanelvalue { public partial class form1 : form { private point tbpoint = new point(10, 14); private point tbbpoint = new point(300, 14); private arraylist arylst; private arraylist arylst1; public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) ...

user controls - Sharepoint-customizing usercontrol property in smartpart -

if having idea how customize properties in smartpart. have created usercontrol , m wrappin in smartpart.i want upload xml document library. private string feedxml; [browsable(true), personalizable(true) ] public string feedxml { { return feedxml; } set { feedxml = value; } } and using // feedxml="\customxml.xml"; xpathdocument doc = new xpathdocument(server.mappath(feedxml)); but thing not working . when clicking on modify shared webpart of sharepoint page not rendering. clue m getting wrong. you might want verify result of server.mappath statement. c:\inetpub... code trying retrieve file filesystem lives in sharepoint because have uploaded document library. if want file you'll have retrieve using sharepoint object model, have @ getfileasstring method . i agree denni.. seems smartpart making more difficult? advantages have? i make own webpart c...

google app engine - keys and unique rows in appengine datastore -

i'm still new working java , google appengine datastore. i can put data in , out of datastore, , trying make user cannot entered twice. there no unique index on datastore, i'm setting hash of users email address primarykey. strangely, when enter same data multiple times, being entered datastore (which thought have returned error, or done nothing). so when set emailhash '2' testing, , run insert script bunch of times, , query _emailhash='2', 3 results. here class defining user. @entity public class user { @id @generatedvalue(strategy = generationtype.identity) private long _uid; @primarykey private string _emailhash; private string _firstname; private string _lastname; private string _email; private string _password; public long getuid() { return _uid; } public string getemailhash(){ return _emailhash; } public void setemailhash(string emailhash) { _emailhash = emailhash; } public string getfirstname() { return _...

java - compare ByteBuffer contents? -

what's easiest way in java compare contents of 2 bytebuffers check equality? you check equals() method too. tells whether or not buffer equal object. two byte buffers equal if, , if, they have same element type, they have same number of remaining elements, , the 2 sequences of remaining elements, considered independently of starting positions, pointwise equal. a byte buffer not equal other type of object.

Force an application to run under specific .NET runtime version? -

i have .net 2.0 runtime installed, installed .net 4.0 runtime, have both. when run .net app, there way force runtime used? edit/clarification: meant w/o regards how application built. under assumption .net 4.0 runtime can run .net program compiled 5 years ago targeted 2.0 runtime (oldprogram.exe). on machine both runtimes, either of could handle oldprogram.exe. runtime chosen? can influence runtime chosen? yes, use <supportedruntime> element in .exe.config file. example: <configuration> <startup> <supportedruntime version="v2.0.50727"/> </startup> </configuration>

php - MySQL: Is it better to have an index and a small filesort or no index and no filesort? -

i have large database (180k+ rows , growing fast) of location data , plotting them on google map. given view port, want serve sample of 100 applicable points. database therefore queried lat/lng, if put index on these rows problem sample of 100 points either @ bottom or top of view port (depending on how index used). if no index used, points pretty randomly scattered across view port, more desirable. can create same effect on indexed results doing filesort third, pretty random field. so, issue seems be, better: unindexed query on 180k+ rows, or indexed query @ 4k rows & filesort? thanks! you'll find many arguments against using "order rand()", although may useful in situation if do index field , find profiling results acceptable: mysql> select id table id > 10000 , id < 20000 order rand() limit 0,10; +-------+ | id | +-------+ | 18560 | | 18408 | | 14058 | | 19090 | | 11100 | | 18945 | | 12656 | | 16549 | | 19321 | | 12003 | ...

String Class Methods Most Commonly Used -

any programming language. i'm interested in knowing top 5 methods in string class used on data manipulations. or top 5 methods 1 need know able handle data manipulation. know methods should used, i'm interested see 5 common methods people use. thanks time. i'd say string.format() string.split() string.indexof() string.substring() string.toupper()

android - Improving upload speed by sending chunk of bytes -

i'm developing android video uploading app , uploading large amounts of video problem, different type of exception (host not resolved, pipe broken), multipart post have feeling if upload chunk of bytes 1 @ at time that'll increase upload speed solve connection timeout , these type of problems. if have control of server, think using raw tcp/ip via sockets instead of http: http adds considerable overhead. in circumstances, going down udp layer instead can improve performance further: aware of complexity of ensuring delivery , sequencing yourself.

visual studio - VS2010 extension, lost it and can't remember name -

Image
does use or rememebr name of vs2010 extension add little faded context sensitive icon next class/ method (indiciating if it's class etc in class view) , adds little faded clickable link @ end of class/method block etc it's name? it looked someting like: [icon] methodname1(params) { lines of code more lines line } >> methodname1 (faded clickable link) lost , can't find , it's driving me nuts (too tired?) thanks in advance! well found (not sure how escaped me seeing how it's author of excellent codemap / axtools) vs10x editor view enhancer http://visualstudiogallery.msdn.microsoft.com/34eee02b-f1f6-433a-b210-62e94c0bcb87?src=vside

php - DomXML xpath what do I do next? -

i have code: $reader = new domdocument(); $reader->loadhtml($shell); $xpath = new domxpath($reader); $xpath->registernamespace('html','http://www.w3.org/1999/xhtml'); $res = $xpath->query('descendant-or-self::*[contains(@class,"content")]'); print_r($res); $shell variable containing following html code: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="en-us" /> <title>hello world</title> </head> <body> <div class="content"> hello world!! </div> </body> </html> if correct xpath query: descendant-or-self::*[contains(@class,"content")] is supposed div class "c...

property injection - How can StructureMap be used to create setter dependencies of objects that have primitive constructor argumeents? -

i have object "testproperty" implements "itestproperty". "testproperty" takes string constructor argument. configured in structuremap using along lines ctordependency or withctorarg. i want inject instance of "itestproperty" (implemented "testproperty") class property. when try run code exception (structuremap error code 205, "missing requested instance property"). here's simplified version recreates problem: test: [test] public void can_resolve_the_correct_property() { objectfactory.initialize( x => x.addregistry( new testregistry() ) ); var instance = objectfactory.getinstance<testcontroller>(); } registry setup: public class testregistry : registry { public testregistry() { forrequestedtype<itestproperty>().addinstances( => i.ofconcretetype<testproperty>().withname( "test" ) .ctordependency<string>( "arg...

ajax call handling on asp.net serverside -

i'm working on asp.net project based on asp.net ajax more , more client side calls using jquery ($.ajax) , json or html return. i'm wondering best way handle these calls on server side, in same webform, or use specific http handler, or web service? can share experience or best practice? thanks. i'd recommend http handler. it's best , simplest option. there no problem on managing ajax call using page method (marked webmethod , static), drawback can called page. http handler independent , can called page. the web service suitable calling third party api, don't see need create 1 ajax calls on own web site.

How to delete element from list in Python? -

i new python. have created list a = [[3,4],[5],[6,7,8]] i want delete 3 list. command this? easy, can try this del a[0][0]

perl - How can I replace the <opt> tag in XML::Simple with the original tag name? -

i'm using xml::simple edit xml file. after updated data sent new xml file. procedure produces <opt></opt> tag added , original parent tag lost. want replace <opt> original tag name. how do that? you're stretching limits of xml::simple . when point don't does, it's time else. else depends on problem, xml::twig .

Visual Studio 2008 and JavaScript brackets formatting -

as know ms added javascript formatting vs 2008 sp1. unfortunately fails on code: var viewport = new ext.viewport({ layout: "border", items: [{ region: "center", contentel: "center" }, { region: "south", contentel: "south" }, { region: "west", contentel: "west" }] // bracket misplaced }); viewport.render(); is there way fix it? fixed in vs 2010? couldn't find way fix it, fixed in vs 2010.

c# - Copy a class to another? -

i have class { public int a; public string b; } how can copy a? in c++ know *a1 = *a2; . there similar in c#? know write generic solution using reflection hope exist already. i'm considering changing a nullable struct. step 2 i'll need do class b : {} class c : {} and copy base data b c. i have used binary serialization. basically, serialize instance memory stream. then, deserialize out of memory stream. have exact binary copy. deep copy, rather shallow copy. class = new classa(); class b = myserializationmethod(a); for shallow copy can use object.memberwiseclone

c++ - How to get a "bus error"? -

i trying hard bus error. one way misaligned access , have tried examples given here , here , no error me - programs execute fine. is there situation sure produce bus error? bus errors can invoked on hardware platforms that: require aligned access, and don't compensate unaligned access performing 2 aligned accesses , combining results. you not have access such system.

.net - QR Code generation in ASP.NET MVC -

Image
is there .net api generates qr codes such one? i'd display these on pages expect users print out. i wrote basic html helper method emit correct <img> tag take advantage of google's api. so, on page (assuming aspx view engine) use this: <%: html.qrcodeimage(request.url.absolutepath) %> <%: html.qrcodeimage("meagre human needs phone read qr codes. ha ha ha.") %> or if want specify size in pixels (the image square): <%: html.qrcodeimage(request.url.absolutepath, size: 92) %> here code: public static class qrcodehtmlhelper { /// <summary> /// produces markup image element displays qr code image, provided google's chart api. /// </summary> /// <param name="htmlhelper"></param> /// <param name="data">the data encoded, string.</param> /// <param name="size">the square length of resulting image, in pixels.</param> ...

html - Meta tags; Some short questions -

i writing meta tags website. meta, mean seo, keywords , description. i have questions though: does doctype matter when writing meta tags? is meta case sensitive or not? should use comma between keywords or space? if keyword of choice consists of 2 words, "new ad"? what else important think in terms of seo , meta tags? thanks does doctype matter when writing meta tags? only in far decides if need / @ end, , if tag , attribute names case sensitive. is meta case sensitive or not? the tag , attribute names in xhtml. rest, depends on specific meta data expressing. should use comma between keywords or space? if keyword of choice consists of 2 words, "new ad"? meta keywords comma separated (and worthless unless run own parser on them, search engines ignore them rife spam). what else important think in terms of seo , meta tags? only description matters, , key provide useful information display summary of page (and not u...

java - hibernate lazy init not lazy at all! -

i have entity has collection 1 of attributes. collection mapped @manytomany annotation fetch type lazy. target entity has collections attributes, @onetomany , @manytomany. when fetching first entity (via entitymanager.find(id)) collection attribute populated , furthermore elements of collection populated (i.e. collections filled) many canonicalized objects. understand describing attribute lazy fetched should prevent collection being filled. wrong or doing wrong? thank you. the entities (only 2 here example): @entity @table(name="buys") @xstreamalias("buy") public class buy implements serializable { /** * */ private static final long serialversionuid = 1l; public enum automode {auto, manual}; public enum bool {false,true}; public enum frequency {freq1, freq2}; public enum status {status1, status2}; @id @generatedvalue(strategy = generationtype.auto) @xstreamasattribute @column(name = "id") ...

java - Using PrintWriter and OutputStream -

i creating project struts , have problem using jasper ireports. want export info pdf file , keep getting java.lang.illegalstateexception: getoutputstream() has been call... exception due openning servletoutputstream in code when page opens printwriter. the code in model (so not in jsp, it's in java file), follows: public void handle(httpservletresponse res, connection connection, string path)throws exception{ servletoutputstream out = null; try { jasperdesign jasperdesign = jrxmlloader.load(path); jasperreport jasperreport = jaspercompilemanager.compilereport(jasperdesign); byte[] bytes = jasperrunmanager.runreporttopdf(jasperreport, null, connection); res.setcontenttype("application/pdf"); res.setcontentlength(bytes.length); out = res.getoutputstream(); out.write(bytes, 0, bytes.length); } catch (exception e) { e.printstacktrace(); } { out.flush(); out.close(); ...

JQuery ul li select list -

trying use jquery scroll through ul li list using class next , class prev e.g. <ul class="selectoption"> <li> item 1</li> <li> item 2</li> <li> item 3</li> <li> ... </li> </ul> <a href="" class="next">next</a> <a href="" class="prev">back</a> only thing want selected li visible. somehow need index li's? appreciated - in advance this should it: // hide first $('.selectoption li').not(':first').hide(); // handle click of prev , next links $('.prev, .next').click(function() { // determine direction, -1 prev, 1 next var dir = $(this).hasclass('prev') ? -1 : 1; // li visible var current = $('.selectoption li:visible'); // element should shown next according direction var new_el = dir < 0 ? current.prev('li') : current.next('li'...

Display PHP Progress Live [Server Setting?] -

well have script , it's doing loop of stuff, when running same script on friends server display progress live, display text doing loop. but reason on server, it's waiting until scripts done executing before displaying data ever. you guys got ideas? thanks! add ob_flush(); flush(); after each system out (echo / print) etc ..

Updating a select option using jQuery -

i have form when updated, need change name of item in select input. i'm using loop through options, i'm having trouble figuring out how change text value. here tried $('#groupid option').each(function () { if ($(this).val() == currently_editing_group_id) $(this).attr('text', $('#newgroupname').val()); }); here select input <select id="practicegroupid" name="groupid"> <option value="5">test group 1</option> <option value="6">test group 2</option> you can use base dom properties .text , .value of <option> element , this: $('#practicegroupid option').each(function () { if (this.value == currently_editing_group_id) this.text = $('#newgroupname').val(); }); or in selector: $("#practicegroupid option[value='"+currently_editing_group_id+"']...

database design - best practices of separating two dependent sets of data in mysql -

my application needs 2 sets of data, , want separate logically on 2 parts. it's ideal have namespaces tables in 1 instance of mysql database, can't find clues feature exists. so, decided split data onto 2 schemas (static & dynamic) in 1 instance of mysql. though, dynamic data depends on static part, , of stored procedures in dynamic selects data static database. what best practices avoid hardcoding schema names in stored procedures, or splitting data in similar way want? this done synonyms, mysql not support that. didn't why wanted 'logically separate' data; done prefixing table names sort of identifier. avoid hassle of hard-coding schema names suggest rethinking separating tables.

.net - WPF - C#: This element is not currently associated with any context -

i have wpf usercontrol, use in winforms control within elementhostcontrol. start wpf window, while windows form still open. if close wpf window, , try add child element wpf usercontrol, crashes @ "initializecomponent()" (of child element) exception: "a first chance exception of type 'system.configuration.configurationerrorsexception' occurred in system.configuration.dll. additional information: element not associated context" i found out why happens, don't know how solve problem. if leave out code: public static void ensureapplicationresources() { if (application.current == null) { // create application object new application(); string assemblyname = system.io.path.getfilenamewithoutextension( assembly.getexecutingassembly().manifestmodule.name); // merge in application resources application.current.resources.mergeddictionaries.add( ...

flex - Wny Linux sends unicode keyboard events while Windows sends ANSI -

unde linux, foreign keys such ü Ü not seem work code: string.fromcharcode(e.charcode).tolowercase(); the output wrong under linux, windows ok. here sample page debug this: output of foreign keys such ü linux looks same here, totally broken, 2 chars appear: http://www.bgxcomponents.com/flashvalidateregexp.htm could this flash player bug.

php - Not finding elements using getElementsByTagName() using DomDocument -

i'm trying loop through multiple <lineiteminfo> products contained within <lineitems> within xml i'm parsing pull product ids out , send emails , other actions each product. the problem it's not returning anything. i've verified xml data valid , contain necessary components. $itemlistobject = $orderxml->getelementsbytagname('lineiteminfo'); var_dump($itemlistobject->length); var_dump($itemlistobject); the output of var_dump is: int(0) object(domnodelist)#22 (0) { } this first time messing , it's taken me couple of hours can't figure out. advice awesome. edit: my xml looks this... except lot more tags productid <lineitems> <lineiteminfo> <productid href='[url_to_product_xml]'>149593</productid> </lineiteminfo> <lineiteminfo> <productid href='[url_to_product_xml]'>149593</productid> </lineiteminfo> </line...

c# - MVVM WPF save and load user settings design pattern -

i looking tutorial / explanation shows , how implement settings in mvvm wpf application. understand .net has built-in support settings typically used medium larger size applications? alternatives? i thinking of storing many user settings such window size, grid column size, font size, font, etc... thank help! the built-in settings file place store common things window size, theme, etc... (stuff user not enter themselves... ambient state) more advanced settings user can customize, rather build own... gives me better control on how , gets stored! check out this article example of medium sized mvvm app using settings file!

C# Generic List of Generic List of Multiple Types -

here abstraction , simplification of issue: i have set of toys , corresponding box these toys. want user able specify largest type of toy box can hold: public class box<t> {} then within box class want have generic list of toys, each toy contained within box have generic type: public class box<t> { public list<toy> = new list<toy>(); public bool whatever; [member functions, constructors...] [the member functions depend on t] } the toys class this: public class toy<t> t : struct //t type { public list<t> = new list<t>(); public string name; public string color; [member functions, constructors...] } i want able create toys many different types , insert them box specified type. i'd able add boxes returning box largest type. i don't know how begin. list of generic class multiple types throwing me loop. read various articles using abstract class or interface, haven't found example or ...

database - historical data modelling literature, methods and techniques -

last year launched http://tweetmp.org.au - site dedicated australian politics , twitter. late last year our politician schema needed adjusted because politicians retired , new politicians came in. changing our db required manual (sql) change, considering implementing cms our admins make these changes in future. there's many other sites government/politics sites out there australia manage own politician data. i'd come centralized way of doing this. after thinking while, maybe best approach not model current view of politician data , how relate political system, model transactions instead. such current view projection of transactions/changes happen in past. using approach, other sites "subscribe" changes (a la` pubsubhub) , submit changes , integrate these change items schemas. without approach, sites have tear down entire db, , repopulate it, associated records need reassociated. managing data way pretty annoying, , severely impedes mashups of data ...

ibm midrange - Fetching data from excel sheet in AS/400 -

i using as/400 reflections ibm. here question: how can data excel sheet transfered as/400 session. there should ble create macros add info ever needs inserted. depends on requirements, multiple methods available, transport, ftp saved as400 odbc excel iseries save file in ifs (e.g. /home/data). brings sheet in scope of as400 start client access emulator (tn5250), , use transport in program. can use external file describes format start client access file transfer, , use external file descriptions format, save flat file, , use cpyf (*map, *drop) db2 table as flat file db2 table 1 field (e.g. crtpf). table can processed iseries program, query/400 or sql save csv , use command "copy import file (cpyfrmimpf)" or "copy stream file (not sure top of head, cpyfrmstrf) save csv , use descriptor file import db2 table setup, directly excel (e.g. odbc) with file transfer (e.g. save in excel, ftp, cpyfrmimpf) script (e.g. use com functions in perl...

dom - JavaScript "null or not an object" error -

i'm running javascript below place horizontal scrolling text on banner of website. works in 1 server not another. following error: error: 'this.mqo' null or not object javascript: function start() { new mq('m1'); /* new mq('m2'); */ mqrotate(mqr); // must come last } window.onload = start; // continuous text marquee // permission use javascript on web page granted // provided of code below in script (including these // comments) used without alteration function objwidth(obj) { if (obj.offsetwidth) return obj.offsetwidth; if (obj.clip) return obj.clip.width; return 0; } var mqr = []; function mq(id) { this.mqo = document.getelementbyid(id); var wid = objwidth(this.mqo.getelementsbytagname('span')[0]) + 5; var fulwid = objwidth(this.mqo); var txt = this.mqo.getelementsbytagname('span')[0].innerhtml; this.mqo.innerhtml = ''; var heit = this.mqo.style.height; this.mqo....

javascript - jQuery 1.3 vs 1.4 (Performance) -

jquery 1.4 released , new website shows performance charts 1.4 better, has done analysis of overall performance improvement of 1.4 vs 1.3? if not, how profile both on sites/pages, there tools? can't wait find out how fast 1.4 compared previous version. edit : blogger did tests , found 30% faster in ff slower (compared 1.3) in safari. hmm... their diagrams show 1 side of story. i've been working on script involves iterating on thousands of input elements throughout dom tree , traversing parent elements. according firebug, jquery 1.4 runs 30% slower 1.3.2 on exact js , dom structure. that's not 1.4 isn't "faster" in general though, , in 1 browser i've profiled in. think time efforts more focused on speeding areas related dynamic content creation rather dealing existing static elements. just thought should point charts list number of function calls, not execution time. fewer function calls doesn't translate lower execution time. ...

php - How to use images as nav buttons in Wordpress? -

here navbar in header.php <!-- nav --> <div id="nav"> <ul> <li><a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/navbar/home.png" alt="ad image" /></a></li> <li><a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/navbar/nav2.png" alt="ad image" /></a></li> <li><a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/navbar/nav3.png" alt="ad image" /></a></li> <li><a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?...