Posts

Showing posts from March, 2015

visual studio 2008 - Meaning of the line marker with 'blue ball' when stepping through code in VS2008? -

Image
can tell me icon (with blue ball) means, opposed normal step-through marker without ball? do have other software installed (code helpers, etc)? have not seen blue ball, there debugging plug-in or other tool adds blue balls. know not advanced breakpoint (see: http://geekswithblogs.net/sdorman/archive/2009/02/14/visual-studio-2008-debugging-tricks-ndash-advanced-breakpoints.aspx )

javascript - Need advice on designing a system -

i'm trying design page make work fastest while trying avoid duplication. basically, i'm going load 3 sets of user's contacts. business contacts, personal contacts, , special contacts, mixture of both business/personal. in essence i'd doing these 3 queries: select stuff contacts userid = '$userid' , type = 'business' select stuff contacts userid = '$userid' , type = 'personal' select stuff contacts userid = '$userid' , isspecial = 1 these contacts used javascript populate <div>s on page , used in searching contacts on page. would make more sense load business , personal contacts, loop through them via javascript , use javascript build 3rd list of special contacts, isspecial set 1? or better 3 sets seperately using mysql query , pass them on javascript 3 seperate sets go? or should 1 set of contacts mysql long userid = '$currentuser' , sort them seperate lists via javascript when page loads? (i loo...

graphics - Anyone know where i can find a glsl implementation of a bilateral filter (blur)? -

i'm looking "selective blur" or "surface blur" on gpu. i've read research papers on subject, , seen deal of c code, ideally i'd in glsl, hsl, or cg. actually, bilateral blur not different gaussian blur, have multiply value of sample gaussian factor multiplied result of "closeness' function between actual values of centre pixel , sampled pixel. so, in pseude glsl vec3 centrecolour = texture2d(image,texcoord); vec3 result = centrecolour; float normalization = 1; (int = 0; < num_samples; ++1) { vec3 sample = texture2d(image, texcoord + offsets[i]); float gaussiancoeff = computegaussiancoeff(offsets[i]); //depends on implementation, quick float closeness = 1.0f - distance(sample,centrecolour) / length(vec3(1,1,1)); float sampleweight = closeness * gaussian; result += sample * sampleweight; noralization += sampleweight; } vec3 bilateral = result / normalization; you should have better way determine closen...

SQL Server is not showing in Visual Studio -

Image
i installed sql server express on pc , reason not showing in list of available servers connect on visual studio 2010. added pictures explain problem. have no idea how fix because , running, not showing up... if sql server browser service isn't running, won't find (which have disabled). should still able connect though isn't "discoverable". try connecting (local)\sqlexpress .

iphone - message sent to released object (never released manually) -

removed release statements. of them seemed okay, because other things exploding first. - (void)handlenowplayingitemchanged:(id)notification { mpmediaitem *item = self.musicplayer.nowplayingitem; nsstring *title = [item valueforproperty:mpmediaitempropertytitle]; nsnumber *duration = [item valueforproperty:mpmediaitempropertyplaybackduration]; float totaltime = [duration floatvalue]; progressslider.maximumvalue = totaltime; cgsize artworkimageviewsize = self.albumcover.bounds.size; mpmediaitemartwork *artwork = [item valueforproperty: mpmediaitempropertyartwork]; if (artwork) { self.albumcover.image = [artwork imagewithsize:artworkimageviewsize]; } else { self.albumcover.image = nil; } titlelabel.text = title; /*openears stuff*/ } in another question mention sqlite errors concerning artwork. ** deleted error , details concerning nsz...

What is the difference between Calendar.WEEK_OF_MONTH and Calendar.DAY_OF_WEEK_IN_MONTH in Java's Calendar class? -

java's calendar class provides 2 fields: week_of_month , day_of_week_in_month. can explain difference me? seems both return same value when tested using code below: calendar date = calendar.getinstance(); date.set(2011,5,29); int weekno1 = date.get(calendar.week_of_month); int weekno2 = date.get(calendar.day_of_week_in_month); week of month week within current month starting sundays how many weeks have there been. day of week of month day 5 thursday, 1 sunday ect.

android - ImageView won't show image when set by setImageBitmap() -

i having problems getting existing image on sdcard display. imageview _photoview = (imageview)findviewbyid(r.id.img_photo); file photofile = new file(environment.getexternalstoragedirectory(), session.photo_file_name); rawfileinputstream = new fileinputstream(photofile); bitmap origphoto = bitmapfactory.decodestream(rawfileinputstream, null, new bitmapfactory.options()); _photoview.setimagebitmap(origphoto); log.d(tag, origphoto.getwidth() + " - " + origphoto.getheight()); the photo exist , dimensions show displayed, nothing appears within imageview tag <imageview android:id="@+id/img_photo" android:layout_width="fill_parent" android:layout_height="wrap_content" /> i tried set height fixed size, still can't see photo. i've seen few posts on regarding issue, none of them have yet been answered. any ideas? ** update if load file directly, instead of through filestream works bitmap origphoto = bitmapf...

mysql - PHP MySQLi num_rows Always Returns 0 -

i have built class leverages abilities of php's built-in mysqli class, , intended simplify database interaction. however, using oop approach, having difficult time num_rows instance variable returning correct number of rows after query run. take @ snapshot of class... class database { //connect database, goes ... //run basic query on database public function query($query) { //run query on database make sure executed try { //$this->connection->query uses mysqli's built-in query method, not 1 if ($result = $this->connection->query($query, mysqli_use_result)) { return $result; } else { $error = debug_backtrace(); throw new exception(/* long error message thrown here */); } } catch (exception $e) { $this->connection->close(); die($e->getmessage()); } } //more methods, nothing of interest ... } here sample usage: $db = new database(); $result = $db->query("select * ...

c# - Checkbox == true not detected -

i attempting delete row (or rows) listview via checkbox. code have below.. have used same on similar area of site 1 doesn't seem work. check box ticked, delete button pressed , reloads page without deleting. page load protected void page_load(object sender, eventargs e) { dstableadapters.contact_messagestableadapter cmta = new dstableadapters.contact_messagestableadapter(); dstableadapters.messagestableadapter mta = new dstableadapters.messagestableadapter(); dstableadapters.user_messagestableadapter umta = new dstableadapters.user_messagestableadapter(); datatable cmessagetable = cmta.getall(); datatable ownermessagestable = umta.getmessages("owner"); datatable clientmessagestable = umta.getmessages("user"); lvcontact.datasource = cmessagetable; lvcontact.databind(); lvclientmessages.datasource = clientmessagestable; lvclientmessages.databind(); lvownermessages.datasource = ownermessagestable; lvownerm...

Jquery click link send information to php -

i'm creating system using jquery , php pops small div when private message on website. alert have figured out, i'm not sure how gracefully cancel it. i've made clicking link "[x]" hides div, how can make link send enough information php script mark alert "read" in database? all php script need id of alert in database, i've got no idea how make that. there more 1 notice displayed @ time, need way have each link send information necessary php script. here's jquery loads div , php powers it. <script type="text/javascript"> var auto_refresh = setinterval( function () { $('#mc').load('/lib/message_center.php').show("slow"); }, 10000); // refresh every 10000 milliseconds </script> <script type="text/javascript"> $(document).ready(function(){ $('.delete').live('click', function(){ $('#mc').hide('slow'); }); }); </...

How i can render a template and then redirect to particular URL in Django? -

i've problem django views. have url /signup.html have view , display form. action of form points /account/create when it's ok redirect congrats page, when form submitted it's invalid, need last url dictionary of errors when render_to_response url in address bar it's account/create , should /signup.html . here code: def signup(request): return render_to_response('main/signup.html' , {} , context_instance=requestcontext(request)) def create_account(request): if request.method == 'post': form = fastsignupform(request.post) if form.is_valid(): new_user = form.save() return redirect('/account/congratulations' , {} , context_instance=requestcontext(request)) else: form = fastsignupform(); return render_to_response('main/signup.html', {'form':form} , context_instance=requestcontext(request)) def congrats(request): return render_to_response('main/congrat...

c# - Only primitive types ('such as Int32, String, and Guid') are supported in this context -

i'm getting following error: unable create constant value of type 'phoenix.intranet.web.clientsettings.componentrole'. primitive types ('such int32, string, , guid') supported in context. i understand why error occurs. don't understand why code creating error. comparisons against primitive types. comparisons guid guid. error states guids ok. the error occurs on line (towards bottom): var vla = (from cir in phoenixentities.componentinroles code: list<componentrole> roles; using (imsmembershipentities entities = new imsmembershipentities()) { roles = (from role1 in entities.roles select new componentrole{name = role1.rolename, roleid = role1.roleid} ).tolist(); } list<components> componentinroles; using (phoenixentities phoenixentities = new phoenixentities()) { phoenixentities.contextoptions.lazyloadingenabled = false; componentinroles = (from component in phoenixentities.components ...

c - Diffrence between instance variables and attributes in python? -

so, python docs writing extension says this: "we want expose our instance variables attributes. there number of ways that. simplest way define member definitions: static pymemberdef noddy_members[] = { {"first", t_object_ex, offsetof(noddy, first), 0, "first name"}, {"last", t_object_ex, offsetof(noddy, last), 0, "last name"}, {"number", t_int, offsetof(noddy, number), 0, "noddy number"}, {null} /* sentinel */ }; and put definitions in tp_members slot: noddy_members, /* tp_members */" however, have put instance variables in noddy struct: typedef struct { pyobject_head pyobject *first; pyobject *last; int number; } noddy; so question why put them in both places. impression that, because want both type , instance have them preserve types values once instance updated. if thats case, how instance value updated if change clas...

java - NoClassDefFoundError when running app in emulator/phone [Update to previous question] -

this update this question asked earlier today. brief reiteration of problem: have android app requires use of amazon's android sdk aws. add necessary libraries (jar files) eclipse build path. however, when run app, app crashes noclassdeffounderror. after bit of investigation, have isolated code causes error. have made simple dummy android app uses apparently buggy code. source code single activity here . , here logcat output . i noticed couple of odd things this. if library wasn't being added correctly, should fail @ line 34: credentials = new basicawscredentials( accesskeyid, secretkey ); but doesn't. instead, fails @ line 62, chains line 48. line 62: sdb = new amazonsimpledbclient( credentials ); line 48 (with part of 47): list.setadapter(new arrayadapter<string>(this, r.layout.list_item, getinstance().listdomains().getdomainnames())); the funny thing is, sample project provided sdk works perfectly. here code simpledb , 1 of source files. h...

implementing routing into my wcf service -

i have clients upload files server using wcf service streaming. code on client (omitting details): nettcpbinding binding = new nettcpbinding(); endpointaddress address = new endpointaddress("net.tcp://" + ipaddress + ":5000/datauploader"); channelfactory<idatauploader> channel = new channelfactory<idatauploader>(binding, address); idatauploader uploader = channel.createchannel(); try { uploader.upload(msg); consoletext.record("the file sent...\n"); } catch (communicationexception) { consoletext.record("the file not sent...\n" + "interrupted connection...\n"); } { uploadstream.close(); ((iclientchannel)uploader).close(); } i want implement routing service between server , client, routing service this: private static void configurerouterviacode(servicehost servicehost) { string clientaddress = "http://localhost:5000/datauploader"; string routeraddress = "http://localhost:50...

ruby on rails - Save access_token -

i using facebooker2 uses mogli facebook authentication , save created access_token database. saving access_token created cookie save database well. possible? can provide example? thanks. facebooker2 provides method current_facebook_client, can use controller obtain access_token , save database (e.g.: fb_access_token field of user model): at = current_facebook_client.access_token current_user.update_attribute(:fb_access_token, at)

3D visualization software for scientific molecular dynamics model -

i writing program visualize molecular dynamics experiment. input file location of each atom @ each timestep. there ~100k atoms , ~500 timesteps. atoms represented spheres. connections between atoms represented cylinders. here requirements program (in order of importance): ability move, rotate, , zoom change image ability make movie positions @ various timesteps ability select atom mouse ability create gui ease of installation on mac, windows , linux. can recommend language, visualization library or method approach this? other thoughts appreciated. i suggest consider paraview ; need save relevant data in vtk format (the library has functions that) , you're done. has excellent post-processing capabilities (such coloring, transparent particles, animations) , well-tested. if not seem enough flexible you, have experience c++ lib qglviewer (don't confused .com , free , cross-platform). need write opengl code particles yourself, pretty easy. that said, ...

c# - How to check to which DataColumn a DataGridTextColumn is bound to -

i check datacolumn datagridtextcolumn bound to. i trying like: private void kblmeoravprdatagrid_preparingcellforedit(object sender, datagridpreparingcellforediteventargs e) { if ((e.column datagridtextcolumn).binding.path == "dbfieldname") { you should first check value isn't null. var datagridtextcolumn = e.column datagridtextcolumn; if (datagridtextcolumn != null) // if not null column datagridtextcolumn { //working }

Explanation of singleton objects in Scala -

i coding in provide "object someclass" , "class someclass" , companion class class declaration , object singleton . of cannot create instance. so... question purpose of singleton object in particular instance. is way provide class methods in scala? + based methods in objective-c ? i'm reading programming in scala book , chapter 4 talked singleton objects, doesn't lot of detail on why matters. i realize may getting ahead of myself here , might explained in greater detail later. if so, let me know. book reasonably far, has lot of "in java, this", have little java experience sort of miss bit of points fear. don't want 1 of situations. i don't recall reading anywhere on programming in scala website java prerequisite reading book... yes, companion singletons provide equivalent java's (and c++'s, c#'s, etc.) static methods. (indeed, companion object methods exposed via "static forwarders" sake of j...

mysql - Fast MAX, GROUP BY on the concatenation of mulliple columns -

i have table 4 columns: name, date, version,and value. there's composite index on four, in order. has 20m rows: 2.000 names, approx 1.000 dates per name, approx 10 versions per date. i'm trying list give names highest date, highest version on date, , associated value. when do select name, max(date) table group name i performance , database uses composite index however, when join table in order max(version) per name query takes ages. there must way result in same magnitude of time select statement above? can done using index. try this: (i know needs few syntax tweaks mysql... ask them , find them) insert #temptable select name, max(date) date table group name select table.name, table.date, max(table.version) version table inner join #temptable on table.name = #temptable.name , table.date = #temptable.date group table.name, table.date

client side validation - Jquery listener on an element when it display:block/none; property changes -

is possible? want event fire when happens. hmm, why need this? instead, suggest thinking causes element shown/hidden , react that. it's better decouple logic view. but if still really want this, way can think of right have interval keeps polling element's visibility.

.net - protobuf-net WCF Multiple Nested Generic Abstract Objects Serialization v282 -

this first post on here, please bear me... i'm trying nest multiple generic objects, , pass them through wcf using protobuf-net. there many (10+) main objects have implemented, tho code listed show 2. have similar structures, there few use 1 or 2 of generics (hence inheritance structure) after working through tags , protoincludes, i've been able single main object serialize. when started working on next object, getting error: known-type mainbase`2 protoincludeattribute must direct subclass of mainbase`1 after racking brain few hours (and reading on here) got desperate , starting try random stuff. when removed protoinclude original main object , had them second one, worked fine! in code below have tags still implemented can exception, if comment out either amain or bmain in 4 of mainbase classes, program able serialize whichever 1 tagged. (i apologize in advance, code big large, haven't found problem complex mine yet) class program { static voi...

oop - Should a newly created class "start" itself during construction? -

context: .net, c#, question oop in general. when write class should act "service", socket listener, or timer, see 2 approaches when comes coding it: create constructor, , inside constructor, start background task. instance: public class mytimer { private readonly timespan interval; public mytimer(timespan interval) { this.interval = interval; startticking(); } private void startticking() { // ticking logic } } create constructor accepts class' settings, , add explicit method starting up: public class mytimer { private readonly timespan interval; public mytimer(timespan interval) { this.interval = interval; } public void startticking() { // ticking logic } } i tend think second approach better: a. constructor used creating valid instance, keeping minimal , clean. b. developer uses class less astonished. c. hardware resources not overused, since "s...

html - Raleway font adding additional padding to the top of text on Windows only -

Image
i'm using raleway font provided google's web fonts , have found on windows 7 machine (tested ie9, firefox, chrome, safari) addtional padding appears added top of text. when check out on mac (tested firefox, chrome, safari) it's fine. if pick different font google's web fonts, it's fine (at least ones checked out). has else ever come across , know of way can fix it? html <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title><?php bloginfo('name'); ?> - <?php bloginfo('description'); ?></title> <link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" type="text/css" /> <link href="http://fonts.googleapis.com/css?family=raleway:100&v1" rel="stylesheet" type="text/css"> <script src="https://ajax.googleapis.co...

javascript - How to intercept a URL with JQuery -

i importing third party html file page , has following java script method tied form submit. function validateinput(){ //some code if(validationfailed){ alert("validation failed"); return false; }else{ return openwin("url"); } } i don't have control on code. want intercept url mentioned in openwin function , want validation on url before opens. possible jquery? you don't need jquery. you can replace function own , call old 1 if want. var oldopenwin = openwin; openwin = function(url) { // validation // call old 1 oldopenwin(url); }

actionscript 3 - AS3 Scale Text Function Causing Conflict With Textfield HTML Format -

hello guys using below function scale dynamic font size @ run time thus: function scaletexttofitintextfield( txt : textfield ):void{ var f:textformat = txt.gettextformat(); f.size = ( txt.width > txt.height ) ? txt.width : txt.height; txt.settextformat( f ); while ( txt.textwidth > txt.width - 4 || txt.textheight > txt.height - 6 ){ f.size = int( f.size ) - 1; txt.settextformat( f ); } } scaletexttofitintextfield( tf ); // tf dynamic multiline textfield on stage dimension 150x150 the idea when textfield populated external content, reduces font size fit text texfield. work far. my biggest problem function interferes textfield html formatting. instance; load external html: <font size="-2">this text way</font><br><font size="+5">too big</font><br>to fit in box, i'll give try! with scale function applied textfield, html formatting (size variations) not work, if remove scale funct...

refactoring - How can I detect which modules depend on which modules in Ruby? -

what tools can determine modules have methods calling methods other modules in ruby? background: i'm partway through breaking 808 line module smaller modules, having created 12-submodules. however, of methods in 1 of modules calling methods in sub-module. may or may not ok, depending on whether module of called method meant common functionality. module displaystatistics1 def display_statistics_1_foo calculate_statistics_foo # call method that's in calculatestatistics - ok display_statistics_2_bar # call method that's in displaystatistics2 - bad end # other methods omitted end # modules displaystatistics2 , calculatestatistics omitted class exampleclass include displaystatistics1 include displaystatistics2 include calculatestatistics end ideally analysis tool show displaystatistics1 has dependencies on displaystatistics2 on calculatestatistics . update: maybe shouldn't have done way - maybe should have split them classes instead. wa...

binary log - Mysql data recovery using mysqlbinlog -

i accidentally dropped schema without backing up. and want use mysqlbinlog utility perform recovery. (it seems mysqlbinlog tool). , needs binary log files perform recovery. now have following confusions: i can not find binary log files. located? if operations not logged or binary logging not enabled, how enable it. have read mysql documentation, says enabled as default . cannot find files,though... is possible recover data , schema through /var/log/mysqld.log file if have line log = /path/to/mysql.log uncommented in my.cnf , queries in mysql.log . is, answering third question.

ios - Can't compile plcrashreporter in Xcode 4 -

Image
i can use prebuilt framework provided on plcrashreporter project page when compiling device, not simulator. have same problem described here . i assume prebuilt framework not support simulator's architecture, downloaded out plcrashreporter source. opened xcode project , selected crashreporter-ios-simulator > iphone 4.3 simulator target. when try build project, error: libtool: unknown option character `d' in: -d__iphone_os_version_min_required=30000 i same error when try build of other targets (such device). my next step try adding source files project. no longer have aforementioned problem; however, error when try compile: fatal error: 'crash_report.pb-c.h' file not found [2] #import "crash_report.pb-c.h" ^ 1 error generated. command clang failed exit code 1 the crash_report.pb-c.h file mentioned in error message not exist; i've searched plcrashreporter source tree , internet. therefore, have assume file supposed gen...

javascript - What exactly are expressions that produce *side effects*? -

i have trouble understanding paragraph in page https://developer.mozilla.org/en/javascript/reference/operators/special/void : this operator allows inserting expressions produce side effects places expression evaluates undefined desired. what expressions produce side effects ? a function 2 things typically: perform something , return value. functions 1 of things, both. instance function: function square(x) { return x * x; } is side-effect free since return value , invocation can replaced return value. on other hand, alert() called side-effects (alerting user) , never return value. so void operator makes javascript ignore return value , state you're interested function's side-effects.

zeroMQ Message Size Length Limit? -

suppose several machines interacting using python's zeromq client. these messages naturally formatted strings. is there limit length of message (string)? there no limit size of messages being sent small messages handled differently large messages (see here ). the max size of small messages defined in source code @ 30 bytes (see here , zmq_max_vsm_size).

c# - How can I format a datetime into a string in javascript? -

i have c# datetime shows date(1309513219184) when try include in web page javascript. show 07/01/2011 09:30. is there way can format in javascript or should first kind of c# format , print javascript string? how can format it? you can this: var d = new date(milliseconds); // var d = new date(datestring); // var d = new date(year, month, day, hours, minutes, seconds, milliseconds); d.tostring(); // or d.tolocalestring() or can use library datejs

java - subclass inheritance with different packages? -

thanks great answers inheritance. 1 more quick question: a subclass can inherit protected members of superclass. true if not in same package? yes, can inherit protected members of superclass regardless of package in. from jls section 6.6.2 , a protected member or constructor of object may accessed outside package in declared code responsible implementation of object. from java tutorial , the protected modifier specifies member can accessed within own package (as package-private) and, in addition, by subclass of class in package. i think, may required solution

iphone - NSMutableData convert to NSString -

why data not similar objnsdata ? nsstring *strdata = @"bonjour tout le monde, je voudrais vous présenter la société fdfdfdf futur"; nsmutabledata *objnsdata = [nsmutabledata datawithdata:[strdata datausingencoding:nsutf8stringencoding]]; objnsdata = [objnsdata encryptaes:@"samplekey"]; nslog(@"objnsdata%@", objnsdata); nsstring *str=[[nsstring alloc] initwithdata: objnsdata encoding:nsutf8stringencoding]; nslog(@"str%@",str); nsmutabledata *data = [[nsmutabledata alloc] initwithdata:[ str datausingencoding:nsutf8stringencoding]]; nslog(@"data%@",data); you seem storing nsdata representation of string, encrypting , hoping converting give same thing started out with. while i'm not entirely sure why you're trying encrypt nsdata instance, if want convert nsstring want decrypt on way back.

airprint - iOS Air print for UIwebview -

can 1 guide me how print contents of uiwebview, for ex : - print doc,xls,ppt file uiwebview print contents. please links or sample code solve problem thanks in advance uiprintinfo *pi = [uiprintinfo printinfo]; pi.outputtype = uiprintinfooutputgeneral; pi.jobname = webview.request.url.absolutestring; pi.orientation = uiprintinfoorientationportrait; pi.duplex = uiprintinfoduplexlongedge; uiprintinteractioncontroller *pic = [uiprintinteractioncontroller sharedprintcontroller]; pic.printinfo = pi; pic.showspagerange = yes; pic.printformatter = webview.viewprintformatter; [pic presentanimated:yes completionhandler:^(uiprintinteractioncontroller *pic2, bool completed, nserror *error) { // indicate done or error }]; a more extensive sample on apple's dev site.

msbuild - Determine if your build is running as a private build -

as part of build store of output if build successful. id rather not if private build. there build parameter can check can skip this? got answer, :michael @ jet brains "take @ build.is.personal @ predefined build parameters" http://confluence.jetbrains.net/display/tcd65/predefined+build+parameters

java - Stream multiple files from folder using vlcj -

public void stream(string folder_path, int port){ file mydir = new file(folder_path); file[] files = mydir.listfiles(); if( mydir.exists() && mydir.isdirectory()){ { system.out.println(files[i]+" ..."); //file myfile = new file(files[i].getpath()); mediaplayer.playmedia(files[i].getpath(), ":sout=#rtp{dst=127.0.0.1,port="+string.valueof(port) +",mux=ts}", ":no-sout-rtp-sap", ":no-sout-standard-sap", ":sout-all", ":sout-keep" ); i++; }while(i< files.length && mediaplayer.ismediaparsed()); } } how can modify code make vlcj play(stream) next file in folder after current 1 ends? i tried different methods stops after first file. if refer vlc sample uk.co.caprica.vlcj.test.list.t...

php - Configuring Cakephp routes -

i have built simple app. want configure routes this. domain_name.com/@username router::connect('/@*', array('controller' => 'users', 'action' => 'profile')); but not work. gives error page cannot found. there anyway can domain.com/@username work. i appreciate help. thanks. mark story has posted excellent article on how achieve using custom routing classes in cakephp 1.3. don't need use @ symbol achieve if follow guide. hope helps. using custom route classes in cakephp

javascript - Making a JQuery button act as a dropdown -

Image
take jquery ui button sample reference: http://jqueryui.com/demos/button/#splitbutton now, how implement dropdown when click small button? caution transformation .button() actual button messes offset coordenates. to sum it, need opinions on how correctly implement dropdown on click of jquery button integrates current theme. thanks! alex i made , looks picture above. blogged here , i'm posting code bellow. please refer blog post deeper explanation. css <style type="text/css"> .itemactionbuttons{} .itemactionbuttons .saveextraoptions { display: none; list-style-type: none; padding: 5px; margin: 0; border: 1px solid #dcdcdc; background-color: #fff; z-index: 999; position: absolute; } .itemactionbuttons .saveextraoptions li { padding: 5px 3px 5px 3px; margin: 0; width: 150px; border: 1px solid #fff; } .itemactionbuttons .saveextraoptions li:hover { cursor: pointer; backgroun...

Indexing on DateTime and VARCHAR fields in SQL Server 2000, which one is more effectient? -

we have calllog table in microsoft sql server 2000 . table contains callendtime field type datetime , , it's index column. we delete free-charge calls , generate monthly fee statistics report , call detail record report, sqls use callendtime query condition in where clause. due lot of records exist in calllog table, queries slow, want optimize starting indexing. question will more effictient if query upon indexed varchar column callenddate ? such as -- datetime based query select count(*) calllog callendtime between '2011-06-01 00:00:00' , '2011-06-30 23:59:59' -- varchar based queries select count(*) calllog callenddate between '2011-06-01' , '2011-06-30' select count(*) calllog callenddate '2011-06%' select count(*) calllog callendmonth = '2011-06' it has datetime. dates stored number in database relatively quick see if value between 2 numbers. if you, i'd consider splitting data on multiple table...

makefile - How to add different rules for specific files? -

i have problem makefile. with command, can compile *.c files *.o works well: $(obj) : %.o : %.c $(ldscript) makefile $(cc) $(arm9_includes) -c $(cflags) $< -o $@ but i'm wondering, if want run -o3 optimization on 1 particular file, , have -o0 on rest? is there command add different rule specific file? what i'm doing right compiling each c file own rules, annoying because have around 30 files makes makefile huge , , every time change in 1 file compiles again. particular_file.o : cflags+=-o3 (assuming gnu make) see target-specific variable values in gnu make manual (and following pattern-specific variable values, maybe). also note, commands used specific rule given file, can have in case target-specific variable value not sufficient: particular_file.o : particular_file.c completely_special_compiler -o $@ $< %.o : %.c $(cc) $(cflags) -o $@ $<

c# - Create a object hierarchy from a list of folder locations -

i have list of locations strings; loca/locb loca/locb/loch locc/locd/loce locc/locd/loce/lock locf/locg i've been trying create object uses same structure list of locations passed it; e.g. like.. var myhobject=createheirarchicalobjectfromlist(mystringlistoflocations); i'm having problems looping through list without doing manually loads of loops. there easier way, maybe recursion? i want end object this; .loca .locb .loch .locc .locd .loce .lock .locf .locg that can use create visual hierarchy. prob not best knocked in linqpad, reformat in sec.. void main() { var strings = new string[]{"loca/locb","loca/locb/loch", "locc/locd/loce","locc/locd/loce/lock","locf/locg"}; var folders = folder.parse(strings); folders.dump(); } public class folder { public string name { get; set; }...

python - Cython: Dynamically linking with a dll/so -

i'm working api distributed dll/so file need dynamically link python program. accomplish this, want use cython. i have been able to, in past, link dll statically. works well, except api comes in 4 different flavors, theoretically infinitely more come , users should able compile them whatever name want (kinda plugin system). because of that, can't make so/pxd file statically links 1 library, or links selection of them. what need able pass so/dll name cython code , have "import" it. know can done ctypes via ctypes.cdll.loadlibrary, kind of thing possible in cython? going have use ctypes this? i assume talking writing c modules here. if yes can. don't know equivalent on windows is, in linux can use dlopen , friends. there man page it, , several web sites documenting it. try link "http://linux.die.net/man/3/dlopen" provides nice example near bottom of page. doing same thing ctypes does, in fact think might ctypes uses.

if statement - jquery - if href attr == "" -

i trying find out if href attr empty something, code follows... jquery('#sidebar a').click(function() { var bob = jquery(this).attr("href"); if(jquery(bob).attr() == "") { alert('i empty href value'); } }); i not sure going wrong? advice? thanks! you're passing bob jquery selector. test directly: jquery('#sidebar a').click(function() { var bob = jquery(this).attr("href"); if (bob == "") { alert('i empty href value'); } }); or better yet, just: if (!bob) { gratuitous live example

c# - Develop a RSS feed list on Windows forms -

we need build small windows forms app displays latest rss feeds website. must similar visual studio's start page. but, must display images. can achievable in asp.net repeater controls. tried out datarepeater & listview in windows forms. not achieve it. any pointers highly appreciated. :) you can use webbrowser control, in put generated html page or use wpf instead of winforms.

performance - CSS repeating background, sprite or 1px png -

ok want know best practice performance regarding css background images , http requests. 1. use many different 1px png background images resulting in several individual http requests or 2. use 1 large image sprite big gradient block chunks use background image. increase file size save on http requests. love hear opinions... i think better use data:uri technique small images (like 1px-backgrounds). background: url(data:image/png;base64,....) top left repeat-x; it works modern browsers. old ie browsers (like ie6, ie7) can overwrite styles conditional comments. background: url("path/to/background.png") top left repeat-x; of course way have re-encode background, if has changed. saves lot of requests.

Picture automation in excel -

i have 2 sheets in excel. in 1st sheet make 3 pictures i.e (oval or square ) , rename a, b, c , put in different colum a, b, c in different cell. , make list in validation. in 2nd sheet use validation option 1st sheet a, b, c. want if select picture should display name same b , c. how happen, don't know please me because knew basic of excel. [email snipped]. if understand correctly can give want: go tools>macro>macros , create macro named clicka, change macro code this: sub clicka() sheets("sheet2").range("a1").formula = "a" end sub sub clickb() sheets("sheet2").range("a1").formula = "b" end sub sub clickc() sheets("sheet2").range("a1").formula = "c" end sub now close macro editor, rightclick each of ovals or squares had , assign corresponding macros them. luck!

How to set blue phone links/anchors to another color on iPad/Safari? -

i've created site , phone number on top of screen brown through css, when i'm opening in ipad becomes blue, know there functonality call around it, how can change it's behavior (just change color)? add meta head tag: <meta name="format-detection" content="telephone=no"> but, if using objective-c (loading html on uiwebview) , want prevent phone detection on pages can set: _webview.datadetectortypes = uidatadetectortypenone;

java - compiler output (.class files) differs if sources were compiled in different directories -

i have following problem: while compiling set of classes different .class files generated if compilation executed in different directories. diff between generated .class files following: 1) version: 1062: aload_3 1063: invokevirtual <some_method> 1066: goto 1078 1069: astore 15 1071: aload_3 1072: invokevirtual <some_method> 1075: aload 15 1077: athrow 1078: aload_3 1079: areturn 2) version: 1062: jsr 1076 1065: goto 1084 1068: astore 15 1070: jsr 1076 1073: aload 15 1075: athrow 1076: astore 16 1078: aload_3 1079: invokevirtual <some_method> 1082: ret 16 1084: aload_3 1085: areturn above code has same execution logic. unfortunately, have have explanation why compiler behaves way. strange, when compiling in same directory, same sources, difference between consecutive compilations occurs (always same, mentioned above). any idea happens? in advance response! does class use methods or classes have package level scope? account differences.

merge - Merging to a branch in git without switching to it -

i have application running in git repository on branch (say dev ). application modifies content in repository , commits them. have merge these changes branch (say master ) snag don't want git checkout master before doing this. there way "merge current branch master"? the "master" in case appears "fast-forwardable". "push" branch master. cd /path_to_dir_with_no_branch_switch/ git push . appbranch:master

php - Validating Winners -

i`m managing online trading game system. require following fields upon registration: email username password sex phone number name , surname and users ip upon registration. the point imposed written terms , conditions on site: 1 user can have 2 usernames under same ip, finds outside condition disqualified. 2 users having 4 usernames registered under same ip prone fraud. my problem is: how uniquely identify each user. i cannot use ip, because there can multiple users behind router or worse use mobile gprs, etc. i cannot use social identification number, cause might gather of relatives , use social number. emails, can set email pretty easy. i`m running out of ideas. later edit: enforce security key, generate 1 each user subscribed, key, user can later add user, on different ip. i know not secure, make harder you use phone number, , require them receive registration text. still use friend's phone, lot less prone abuse. is the...

java - Android - Make a contact not editable on the phone -

can tell me how make contact on android phone 'non editable', i've seen done facebook contacts dont know how self. there value have put contact when inserting contacts database? or option within accountmanager? thanks in advance... :) [edit] i've found out sync provider has 'read-only'. know how this? in sync adapter's xml file (e.g. syncadapter.xml ), define android:supportsuploading="false" . make sync adapter "read-only" (i.e. phone won't able upload changes), looking for.

iphone - Push notification stopped working when downloaded from App Store -

when test push notification apn_development_cer, works loaded app on iphone device xcode. but, when downloading same application app store or ad hoc distribution on same iphone device xcode, stops sending push notification apn_production_cer. thanks in advance! vivek dandage are using sandbox (development) environment available through gateway.sandbox.push.apple.com, port 2195 ? app store build, need production environment available through gateway.push.apple.com, port 2195;

css menu :after selector? -

Image
hi need this. design calls vertical line separator in between each menu item, when not active. need remove left border #current (already done) next a. thoughts? #topmenu ul {margin: 0 0 7px 0; width: 100%;padding: 0;} #topmenu li {list-style: none;display: inline;margin: 0 0px;padding:15px 10px 15px 0px; line-height:15px;text-align:center;} #topmenu a:link, #topmenu {color: #ffffff;text-decoration: none;margin: 0px 0px 0px 0px; font-weight:normal;padding: 0px 5px 0px 14px; border-left-color:#fff; border-left-style:solid;border-left-width:1px;} #topmenu ul li.item82 a, #topmenu #current {border:none;} #topmenu #current:after {border:none;} #topmenu a:hover{color: #efefef;} #topmenu a:active{color: #efefef;} #topmenu #current{color: #efefef;background-color:#19bcb9;-moz-border-radius-topright:4px; -moz-border-radius-topleft:4px; border-top-left-radius: 4px;border-top-right-radius: 4px; -webkit-border-top-right-radius:4px;-webkit-border-top-left-radius:4px;} <ul class=...

perl - Create scripts that run in different servers -

i have 3 servers used manage bunch of other client servers. 1 of managing servers has nagios, other has web proxy, has ldap , mysql server. whenever need include new client server, have log server a, , create sql entry, go nagios , create entry, go web server , add proxy. picture. able have servers share scripts directory, '/opt/boxes/scripts` , in there have bunch of scripts know can run. i'm in server , run script x, should run on server b, run in server b. is there simple way this? preferably perl bases since know little bit about. one easy way may make directory each script on each of machines. in 1 directory, actual script runs. in other directories, script ssh appropriate server , runs actual script. e.g. script add client ssh servera -c servera-addclient-to-sql ssh serverb -c serverb-addclient-to-nagios ssh serverc -c serverc-addclient-to-webproxy adding scripts know run easy too. in loose form $runwhere = "xxxx" $scriptn...

mysql - Problem with PHP mysql_real_escape_string -

when run mysql_real_escape_string , example this: $test = mysql_real_escape_string($_post['test']); it's not working on local server, gives me error page! my local server " appserv ". my operating systim " windows xp ". is normal ? , have run on hosted site ! you have provide function active database connection. think it's second argument: $test = mysql_real_escape_string($_post['test'], $mysql_database_connection); that might error, because if don't provide active connection explicitly, function looks last 1 created. if run function before connecting database, it'll give error.

ant - conditional property setting -

how can set single property different values based on conditions. scenario follows: 1) loop through different values of messageid 2) give different 'comment' each messageid <for list="12,23,34,45" param="messageid"> <sequential> <condition property="comment" value="wiremsg-inbound"> <equals arg1="messageid" arg2="12"/> </condition> <condition property="comment" value="wiremsg-outbound"> <equals arg1="messageid" arg2="12"/> </condition> <condition property="comment" value="appmsg-inbound"> <equals arg1="messageid" arg2="12"/> </condition> <condition property="comment" value="appmsg-outbound"> <equals arg1="messageid" arg2="12"/> ...

sql server 2008 - How do you send in multiple commands to Sql PowerShell from the Windows Command Line? -

not sure if belongs on serverfault or not... i following instructions on this site adding registered servers sql studio management studio via powershell. works great 1 @ time, need 60 servers. i have batch set code each create need. can't syntax right calling sqlps command line , passing in whole series of commands. batch set so: sqlps -noexit -command { cd 'sqlserver:\sqlregistration\database engine server group\' new-item $(encode-sqlname server1) -itemtype registration -value "server=server1;integrated security=true" ... , on } any appreciated. if have each individual new-item listed on separate line in ps1 file, example assuming have file named register.ps1 following lines.: cd 'sqlserver:\sqlregistration\database engine server group\'; new-item $(encode-sqlname server1) -itemtype registration -value "server=server1;integrated security=true" cd 'sqlserver:\sqlregistration\database engine server group\'; new-it...

How can I post to a company Facebook page from an offline app (using the C# SDK)? -

i'm trying use facebook c# sdk publish posts wall of company page. need batch job, not web app particular user interacting with. have facebook application set under own facebook id, , have granted publish_stream, share_item, offline_access, , manage_pages permissions under account. (i can verify these permissions have been granted app under facebook settings page.) , company page i'm trying post page created myself, should have full access it. i authenticating facebook app id , secret application, getting access token, putting message post, trying post it. following exception: facebook.facebookoauthexception unhandled user code message=(oauthexception) (#200) user hasn't authorized application perform action i've tried few variations on theme, can't seem figure out i'm doing wrong. here's bit of code: var client = new facebookclient("app id", "secret"); _log.debugformat("access token={0}", client.a...

tfs2010 - Collaborative merge conflict resolution in TFS 2010 -

i'm responsible doing significant forward-integration on branch i'm not familiar with. i'm comfortable merging majority of conflicts, there areas done me mitigate risk of merge errors. we're running on tfs 2010: options? our normal workflow communicating changes between developers use shelvesets, tfs disallows shelving of files before merge conflicts resolved...which unfortunate if it's merge conflicts want pass around. know tfs 2010 introduced idea of shared workspace--can feature used multiple people resolve merge conflicts in place? we have geographically distributed team, unfortunately can't walk on each others' desks. if shared workspaces won't me achieve goal, options? our team typically pass off section merge developer worked on assuming self-contained (ie merges here not break code inside sln). then, once complete, rest of merge take place. sure 2 steps; however, ensures merge done correctly. in cases not option, typically ha...