Posts

Showing posts from April, 2011

file upload - PHP upload_max_filesize -

i've problem php file upload. in php.ini 'upload_max_filesize' set 4mb. when try upload file bigger never upload_err_ini_size error expected, page show form again without information file ($_files empty). what's problem? doing wrong? check these setting in php.ini also: post_max_size, upload_max_filesize , memory_limit in php.ini. post_max_size should greater upload_max_size. and if these not solve problem check here more details: http://www.satya-weblog.com/2007/05/php-file-upload-and-download-script.html

c# - Programmatically join Windows machine to AD domain -

this similar to, not dupe of, this question - however, sought information on manually joining server domain (and rightly redirected) looking code programmatically joins machine domain. the scenario have launcher service instantiates amazon ec2 server2008r1 vms, optionally passing machine name in through user-data stream. process baked our images checks user-data name on bootup - if none present vm remains outside of our cloud domain, if name present machine renamed specified , auto-joined domain. here's problem - if run process manually time after instance start, works described; machine name changed, , vm joined domain (we force restart make happen). however, when running scheduled task (triggered on startup) machine rename happens expected, subsequent call joindomainorworkgroup (see below) picks-up old randomised machine name given vm ec2 instead of new name has been assigned. this results in wmi return code of 8525 , disconnected misnamed entry in ad repository (of...

vb.net - VB Check if Multiselect in Listbox -

simple thing: how can check if user has selected more 1 item in listbox? tried this: if listbox.selecteditems(1) ... but returned out of range exception... thx help the code have attempting access second item in selecteditems collection, holds of selected items in listbox . because default property of selecteditems item , accepts zero-based index of item parameter. getting "out of range exception" because there less 2 items selected, means there no value return @ index = 1. instead, check if user has selected more 1 item, need use count property of selecteditems collection. example: if listbox.selecteditems.count > 1 ''#your code here end if

SQL Server 2008: Can not save because table must be deleted and newly created to save? -

i'm stuck on little not understanding problem. i'm using ms sql managment studio 2008. have brand new database table x. x has 3 columns: id, uniqueidentifier, not null username, nvarchar 50, not null password, nvarchar50, not null now save. set id primary key - no problem saving. now add column: email, nvarchar 50, not null - when try save, can't it, because tells me saving table must deleted , new created. i don't understand this, in sql server 2005 i'm sure, easy possible add row ?! saving changes after table edit in sql server management studio

NT Hosted WCF Service With MSMQ fails to stop cleanly and Locks Up -

this problem has had me baffled weeks on client's live environment. the wcf service hosted on windows server 2003, , has both http , msmq endpoints. when placing service in test environment, service cleanly starts , stops, , messages passed without problems. on live environment, service starts fine, not exit cleanly. when attempting stop service, machine takes long time respond , displays error saying service not stopped. inspecting error on event log, says unable write msmq queue (access denied), however, service able read , remove messages queue. if 1 refreshes service manager, service in fact stopped. the msmq queue hosted on different physical machine, , have been unable reproduce error on test environment. we not sure if related or not, service stop pulling messages queue. has been solved restarting service. again, have not been able reproduce error. recently experienced error http based client upon midnight 1 night, service started rejecting connections follow...

iphone - How can I set identity to each cell in UITableView? -

i have grouped uitable view custom setting view. each cell view 3 uitextfields , other uiviews. when cell created call function [cell initcell:indexpath.section withrow:indexpath.row]; and cell knows configuration display - works fine. my problem when table scrolled cell looses it's identity causing save wrong settings. saved nsstring* view; nsstring* row; but have last value, of last cell presented (became sidplayed) maybe have missunderstanding global parameters, or maybe cell reuse. please advise, thanks my cellforrowatindexpath: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { if(indexpath.section==0) { static nsstring *cellidentifierdate = @"settingscellpickdate"; settingscellpickdate *cell = (settingscellpickdate *)[tableview dequeuereusablecellwithidentifier:cellidentifierdate]; if (cell == nil) { nsarray *toplevelobjects = [[nsbundle mainbundle] loadnibnamed:celliden...

DateTime's functions in PowerShell -

i write application in powershell, , want convert seconds date. in c# there addseconds function adds seconds date. function in powershell similar performance? well, since .net framework right @ fingertips, can do $d1 = [system.datetime]::now and then $d2 = $d1.addseconds(30) get-date appears wrapper datetime object , following work well: $d3 = get-date 23.10.2010 -format dd.mm.yyyy

jquery - animation not very smooth -

i have created small slide show. however, doesn't smooth. how can make transitions smoother? here's relevant code. wod variable in case 350px . transpeed 1000 , time animation occur. have tried setting different values, , still same jagged appearence. $('#slideshowinner').stop(true,true).animate({'left':'-=' + wod}, transpeed, function (){ autoslide = settimeout(fred, slidetime) }); you can see mean @ http://www.en2krew.com/clothing.html thanks here html code used: <div id="slideshowwindow"> <div id="slideshowinner"> <img src="images/clothingphotos/sonnytshirt.jpg" alt="" width="350" height="350" /> <img src="images/clothingphotos/bethtshirt.jpg" alt="" width="350" height="350" /> <img src="images/clothingphotos/mayaelliejesstshirt.jpg" alt="" width="350" height="350" /...

asp.net - Complex items in WebForms ListView -

i'm using listview in webformsapplication. listview generates table (currently) 3 columns. "username", "organization" , "locked". these represented string, string , checkbox respectively. checkbox should postback on change, (possibly) question... should use <%# eval("username") %> or <asp:literal blablah> inject data? more relevant checkbox... seems "dirty" write <input type="checkbox" id="something" <%# if ((bool)eval("locked") == true) /* unknown code outputting "checked" */ ;%> /> or should use container alltogether? for checkbox, why not asp checkbox control like: <asp:checkbox id="c" runat="server" checked='<%# eval("locked") %>' /> to handle checkbox checking little more cleanly? think control support auto postback on check change. for other question, wouldn't worry literals unless nee...

flex3 - Handle concurrent file download with flex/blazeDs/Spring -

i'm working on flex3/blazeds/spring/mysql project. in this, users needs download import logs. problem given singleton concept around spring, if 2 users ask download @ same time, servlet responsible export file creation may cross content between 2 asked files. i'm not familiar spring i've been reading around seems solution lies in saying servlet in "request" scope there new 1 created each download request instead of having singleton. have ever done before? every tutorials i've seen far explains how handle file download request never talks fact 2 users asking download may have issues... thanks leads on how fix this. each user receive own thread, , should not have problems unless using member variables (which bad practice anyway). if not, not see problem, if can post code.

c# - WPF BubbleSeries, iterate over the bubbles and set the style -

Image
i have bubbleseries within chart. bind data bubbleseries , set specific color bubbles. what want iterate on bubbles , set each bubble's color specific color depending on value. my bubbles, 2 series: the gray bubbles should gray, blue bubbles should have different colors depending on sizevalue. any clues how iterate on bubbles , set specific color? possible? i found solution: i didn't need iterate on bubbles, instead solved problem valueconverter. i have valueconverter takes value , return color depending on value. i bind response valueconverter datapointstyle: <charting:bubbleseries.datapointstyle> <style targettype="charting:bubbledatapoint"> <setter property="background"> <setter.value> <solidcolorbrush c...

java - Is there a way of having something like jUnit Assert message argument in Mockito's verify method? -

let's assume snippet of testing code: observable model = class.forname(fullyqualifiedmethodname).newinstance(); observer view = mockito.mock(observer.class); model.addobserver(view); (method method : class.forname(fullyqualifiedmethodname).getdeclaredmethods()) { method.invoke(model, composeparams(method)); model.notifyobservers(); mockito.verify( view, mockito.atleastonce() ).update(mockito.<observable>any(), mockito.<object>any()); } mockito.verify method throws exception if method in model hasn't invoked observable.setchanged() method. problem: without adding loggers/system.print.out can't realize what's current method has failed test. there way of having similar junit assert methods: assert.assertequals( string.format("instances %s, %s should equal", inst1, inst2), inst1.getparam(), inst2.getparam() ); solution: verify(observer, new verificationmode() { @override public void verify(verificationdata d...

wpf - How to retrieve a specific dataBinding from MultiBindingExpression? -

in application retrieve binding 1 object , assign another. , objects has multibinding instead. , want retrieve specific binding. how do that? for non multi-bindings use following code: label lbl = (label)sender; bindingexpression bindingexpression = lbl.getbindingexpression.(label.contentproperty); binding parentbinding = bindingexpression.parentbinding; path = parentbinding.xpath.tostring(); label.setbinding(label.contentproperty, parentbinding); i have figured out. couldn't binding directly label, able use bindingoperations.getmultibindingexpression static method retrieve multibindingexpression , getting right binding. here code that: multibindingexpression multibindingexpression = bindingoperations.getmultibindingexpression(lbl, label.contentproperty); binding parentbinding = ((bindingexpression)multibindingexpression.bindingexpressions[1]).parentbinding;

help with simple SQL update + join -

i think should pretty simple, i'm sql newb. i have 2 tables. 1 list of items ids , descriptions, other map of corresponding old , new ids. this: id_map old_id new_id --------------- 1 101 2 102 items id description -------------------- 1 "itema" 2 "itemb" ... 101 <null> 102 <null> i need copy old item descriptions new items according map. think need use inner join inside of update , it's not working , i'm not sure that's right way go. i'm trying statements like update items set (select items.description items join id_map on items.id = id_map.new_id) = (select items.description items join id_map on items.id = id_map.old_id) but of course it's not working. should doing? update new_item set description = old_item.description items old_item inner join id_map im on old_item.id = im.old_id ...

iphone - Removing iOS SDKs from OSX -

this isn't programming question it's sdks , ide. i've accumulated ton of different xcode installs on past couple of years , hard drive full. each sdk clocking in @ around 5 gigs, , storage space getting low, have couple of questions 3 questions: can remove old ones? where stored? does newest sdk overwrite base classes previous sdks? (does nsstring.h reside in 2 different sdks or newest 1 take precedence? what beta 1, beta 2, beta 3 sdk versions? installing gm/official eliminate beta version mac? most importantly, can still target 3.0 if install 4.2 sdk? (i understand difference between base sdk , target sdk) i want clean hard drive , have 18 gb remaining on 160 gb drive. i'd start on , reinstall osx, download fresh sdk, still have apps targeted 3.1.2 , don't want forced support 4.0. thank you can remove old ones? sure. where stored? /developer/platforms/iphone*/developer/sdks/ usually. does newest sdk overwrite base...

servlets - How do i display database results in a JSP? -

i have control servlet forward request model servlet.the model servlet retrieves results database , forward display jsp.how display result set in jsp?do need write sql statement again in jsp? no, use request attributes map pass data controlling servlet jsp page. example. controller side: void doget(httpservletrequest request, httpservletresponse response) { list<string> names = model.getnamesfromdb(); request.setattribute("names", names); // forward jsp follows ... } example. jsp page: <% list<string> names = (list<string>)request.getattribute("names"); // whatever want names %>

css - Setting the width of HTML div's with %'s -

Image
here relevant html: <div class="row"> <div class="arrow box">&#9668;</div>month year<div class="daymonth box"></div>&#9658;<div class="arrow box"></div> </div> here css .html file above html in links to: * { margin: 0; padding: 0; } body { font-family: "times new roman"; font-size: 12pt; } .daymonth { width: 80%; } .arrow { width: 10%; } .row { width: 58em; background-color: gray; margin-right: auto; margin-left: auto; } .box { float: left; text-align: center; } this output: the "row" centering in browser right stuff inside (the 2 arrows , month year) aren't doing want. what think should doing is, because there 2 arrows , both of widths sent 10% , daymonth width 80% divs should take entire "row" (because sum 100%) , text "month year" should center...

css - CSS3 selectors - select very first item or item after -

let's have following code: <nav id="main-navigation"> <ul> <li><a href="#">link 1 level 1</a></li> <li><a href="#">link 1 level 1</a></li> <ul> <li><a href="#">link 1 level 2</a> </ul> </ul> </nav> and want to set first ul 's height 100px , second ul should 300px. when try nav ul { height: 100px } second ul inherits value. i trying "~", "+", ">", first-childs etc. don't know how that, documentation. is there explained (preferably demos/screens) guide new css3 selectors? w3 table nerdy me. thanks!!! just select ul descendant of ul , give style, if have 2 layers of <ul> s. no need special css2/css3 combinators since <ul> cannot directly contain <ul> , plus don't have worry ie either. nav ul...

php - How do I build multiple CodeIgniter image galleries that have the same setup and different content? -

i'm new codeigniter, mvc, , oop. i'm trying make 2 image galleries rely on different content, same setup , functionality. what's best way set up? should create library containing functionality , call in controllers? in mvc, want make sure data gathering (model), logic (controller), , display (view) logically separated. in order this, you'll need have common method of putting image gallery data create in model , pass view through controller. let's consider hyper-simplistic model function this: function getimages($param) { if ($param) { return array( array('id'=>1, 'caption'=>'image 1', 'url'=>'/images/image1.jpg'), array('id'=>2, 'caption'=>'image 2', 'url'=>'/images/image2.jpg') ) } else { return array( array('id'=>3, 'caption'=>'image 3...

Changing User Environment with ProcessBuilder + java -

i'm trying change user of child process user minor privileges when execute start method of processbuilder subprocess exec same user of parent linkedlist<string> commands = new linkedlist<string>(); commands.add("vlc"); processbuilder builder = new processbuilder(commands); map<string,string> enviroment = builder.environment(); enviroment.clear(); enviroment.put("user", "otheruser"); enviroment.put("logname", "otheruser"); enviroment.put("pwd", "/home/otheruser"); enviroment.put("home", "/home/otheruser"); enviroment.put("username", "otheruser"); enviroment.put("shell", "/bin/false"); builder.directory(new file("/home/otheruser")); process process = builder.start(); process.waitfor(); ...

Google Earth API for Flex/Flash -

are there flash/flex api google earth map api? haven't seen api in google earth api official page. or there way use features of javascript api actionscript/flex thanks ! no flash api google earth yet, gmaps api. have earth api javascript.

c++ - 'Field Scraping' in Windows -

i want develop auditing application windows applications. want grab text messageboxes, windows, forms, selections etc , ideally program in c++. i've looked windows ui automation possible solution, put off says need know parts of underlying data structures can't at. alternatively, i've looked around , neo's safekeys says protects against 'field scraping', upon searching can't find information on how done. experience please enlighten me? i'm aware can scrape websites , like, wish scrape applications instead. any appreciated. look using accessibility layer, msaa

Excel PivotTable from Cube: How to get a flat table? -

i'm importing data sql cube , have several row labels i'd show. there way not have hierarchical view? (aka no plus signs first row values, , instead show second row label's value next first row labels, etc.) i'd see data without being hidden or aggregated together. figured out... it's under pivottable tools > design > report layout > show in tabular form

design - Tools to produce & manage specifications/requirements (not ticket trackers) -

i'm interested if there websites or software out there aid in initial project design, , management of project's design on time features implmented, bugs found, etc... design include requirements (functional & non-functional), use cases, , basic database schema design. most sought-after feature: being able define requirements , track changes on time (i.e. how version 1.5 different 1.0?) nice-to-haves: being able collaborate other project managers , team when putting specifications what i'm not looking for: ticket trackers (jira, fogbugz, etc...) software version control systems wikis (unless built requirements management in mind) thanks. [edit : based on revised question] requirement management tools most requirement management tools work on textual , diagrammatic end artifacts. version control, prefer use dvcs mercurial. how ever tool must provide traceability. i have used rational tools , many others , personal experience ...

javascript - swf file to html-css-js -

i don't know if stackoverflow correct place question. if not, feel free move in correct site. i have 2 swf files: http://www.austintxgaragedoor.com/special-mail.swf http://www.austintxgaragedoor.com/special.swf my client wants convert them text in html code. thought use 2 gif files. when user hover specific div second gif replace first , gives effect. text positioned css. not sure if proper way it, or there better way. what opinion? yes, using 3 gif files: 1 static image, 1 animated gif in-sweep, , 1 animated gif out-sweep... , use javascript/jquery switch between these images based on hover state. static @ first, sweep-in on mouse-over, , sweep-out on mouse-out. this may unwanted advice if possible, recommend urge client allow use simple css hover , changing either basic styling or swapping background image - can in couple of minutes. client may not understanding having specific effect won't cause more people click on it.

Ruby on Rails 3, incompatible character encodings: UTF-8 and ASCII-8BIT with i18n -

i've got troubles couple rails 3.0.1, ruby 1.9.2 , website localization. the problem quite simple, i've got in view : f.input :zip_code, :label => i18n.t('labels.zip_code') and es.yml file : es: labels: zip_code: "este código postal no es valido." there no troubles en.yml file (it's pure ascii) when website set i18n.locale == 'es' error : incompatible character encodings: utf-8 , ascii-8bit i have been looking around quite while didn't found way use utf-8 translation files. did knows how make works ? thanks help. ok problem solved after hours of googling... there 2 bugs in code. first 1 file encoding error , second problem mysql data base configuration. first, solve error caused mysql used 2 articles : http://www.dotkam.com/2008/09/14/configure-rails-and-mysql-to-support-utf-8/ http://www.rorra.com.ar/2010/07/30/rails-3-mysql-and-utf-8/ second, solve file encoding problem added these 2 lines in...

tsql - SQL server 2008 management studio syntax error -

i'm very new programming. i'm having hardest time seemingly simple insert statement i'm using query run. following putting in: insert [employee table] (list of column names surrounded '' , separated ,.) values (list of data want in each column) i can't rid of syntax complaints @ bracketed employee table. i've tried multiple combinations. i'm trying first column generate automatic number. when it's time input in column, should inserting there? should blank? i'm guessing syntax highlighter highlighting wrong portion of statement. square brackets around table name fine. don't need '' 's surrounding column names: insert [employee table] (firstname, lastname, isactive) values ('justin', 'niessner', 1)

c# - Determine Click Once Publish Directory -

how reference clickonce directory application published? i've tried applicationdeployment.currentdeployement.datadirectory , assembly.getexecutingassembly().location point application installed. is activationuri looking for: applicationdeployment.currentdeployment.activationuri

drop down menu - ASP.NET DropDownList not retaining selected item on postback -

i have asp dropdownlist gets populated on page_load event, after select item , hit button selected item gets cleared , first item in dropdownlist gets selected. (the dropdownlist populated when page not postback) help please if (!ispostback) { list<country> lcountries = new list<country>(); list<companyschedule> lcompanyschedules = new list<companyschedule>(); this.load_countries(lcountries); this.load_schedules(lcompanyschedules); if (personnelrec == null) { personnelrec = new personnel(); } if (request.querystring["ua"] != null && convert.toint32(request.querystring["ua"].tostring()) > 0) { useraccount.id = convert.toint32(request.querystring["ua"].tostring()); app_database.snapshift_select_helper.snapshift_select_personnel_app_account(ref useraccount); } this.imgemployeepict...

Apple Developer Program -

i've been working @ learning programming while , feel benefit becoming paid member, , able test on device, £59 year little steep test on device, before think of going app store. possible student in high school discount (even £3) (i know companies offer software students free, thought may apply apple , ios developer program) apple has university developer program . it's explicitly higher education institutions, representative of school district might able convince apple let them join. else, price i've seen $99/year.

entity framework - What's the best POCO status tracking strategy? (EF) -

so reading entity framework , based on agile development scenario decided go poco objects. but i'm having problems don't know how away with. i'm working ria services , silverlight when i'm going save object of server side have attach object objectcontext . thing must change objectstate added or modified. so question what's best approach know state change to. saw in julia lerman 's book uses state attribute in poco objects , takes care managing state on client side before sending object server. state used change real entitysate once attached. i've seen other samples insert implementation checks on key of entity (object) know whether new or not. example, if projectid in project entity 0 (zero) know has new object. to honest don't of approaches because in both cases developers have extra-work save object. i'd know pros , cons of both solutions , new (better) solution i'm still not seing. you can still have self tracking ...

nosql - Using a Relational Database for Schemaless Data - Best Practices -

after reading shocking article written bret taylor (co-creator of friendfeed; current cto of facebook), how friendfeed uses mysql store schema-less data , began wonder if there best practices using rdbms such oracle, mysql, or postgresql storing , querying schemaless data? few people admit they're using relational database when nosql new hotness, makes difficult find articles on topic. how implement schemaless (or "document-oriented") database layer on top of relational database? thats classic article in topic: http://yoshinorimatsunobu.blogspot.com/2010/10/using-mysql-as-nosql-story-for.html (using mysql nosql - story exceeding 750,000 qps on commodity server)

asp.net mvc 2 - Get object out of List< Tuple < object1, object2 > > and store in ViewModel -

[suggestion: want read answers in logical manner ?? >> choose tab [oldest] goal: presentation of books related inventorydetails on homepage such book.title, inventorydetail.quantity etc. (join|book.bookid <=< inventorydetail.bookid) problem 1: how join problem 2: how use tuple (list of tuples) problem 3: how store separated objects (from list of tuples) typed viewmodel answer 1: possible approach using mike brind's guidance answer 2: problem 1 , 2 tackled !! answer 3: problem 3 tackled !! have fun it. i'm happy share!!! public actionresult index() { // return list of tuples {(webshopdb.models.book, webshopdb.models.inventorydetail)} // each tuple containing 2 items: // > item1 {webshopdb.models.book} // > item2 {webshopdb.models.inventorydetail} var tuple_booksinventorydetails = listoftuples_bookinventorydetail(5); // begin under construction setting viewmodel // see below code viewmodel var view...

ruby on rails - undefined method current_user: Cancan and Active Scaffold -

i'm trying add action link active scaffold controller using if current_user.can? :update, post config.action_links.add 'export', :label => 'export', :page => true end but whatever controller try use, undefined method current_user so, how can check if logged user can/cannot something? i've tried def ability @ability ||= ability.new(self) end delegate :can?, :cannot?, :to => :ability as suggested here , without success. what's wrong this? current_user typically defined method, 1 must add. not supplied rails. so, need current_user method in applicationcontroller. there tons of examples @ authlogic example app on github

c# - problems with data contexts and disposing -

i have c# code looks like using (datacontext db = new datacontext(program.config.dbcontextstr)) { foo.bar(db); } so bar static method of class foo, , bar uses db object passed in. passes db object other methods calls. the problem i'm getting exception: system.objectdisposedexception: cannot access disposed object. object name: 'datacontext accessed after dispose.'. i've looked around solutions , people have suggested forget using declaration , write: datacontext db = new datacontext(blah); foo.bar(db); // let garbage collector go merry business. and disable deferred loading: db.deferredloadingenabled = false; foo.bar(db); i've tried both of these solutions, still exception. there other things should try? you disposing data context. firstly, way using data context correct, wrapping in using . this means somewhere inside foo.bar , disposing data context; there no other alternative. this means have search code either 1 of fol...

winapi - Pthread win32 libraray, PTHREAD_PROCESS_SHARED not supported -

i using pthread win32 library implement mqueue. when runs following code, throw #40 error should enosys, means system not supported. pthread_mutexattr_setpshared(&mattr, pthread_process_shared); = pthread_mutex_init(&mqhdr->mqh_lock, &mattr); pthread_mutexattr_destroy(&mattr); /* sure destroy */ i 40 after goes wrong. body has idea this? or have other alternative solution, use kind of win32 thread function replace it. note: if implement mqueue in win32? thanks you want read on windows interprocess synchronization functions . for inter-process mutex in windows, choices implement own using shared memory , interlockedcompareexchange (spin sleep or watch event ). or easier program not performant use os provided named mutex object. these perform 10 times worse using criticalsection within threads of process. in own production code porting linux pthreads, played first solution, ended releasing code using mutex solution. more reliable , sur...

jQuery eq() loop -

can me this? $(document).ready(function(){ $("ul.fam:eq(0) li:eq(2)").addclass("redbold"); }); in code, there way loop or increment '0' value in -> $("ul.fam:eq(0) ? making 0,1,2,3,4,5 , on... , stop loop example when reaches '3' thank you. you can use :lt() (less index) selector, this: $(document).ready(function(){ $("ul.fam:lt(4) > li:nth-child(3)").addclass("redbold"); }); you can test out here . this same selecting :eq(0) through :eq(3) . there's :gt() selector other way around...you can combine both or .slice() range.

windows phone 7 - OnBackKeyPress going to another instance of a page -

is there way handle onbackkeypress in such way returns actual page in back-stack instead of going instance of same page? code have: protected override void onbackkeypress(system.componentmodel.canceleventargs e) { e.cancel = true; base.onbackkeypress(e); this.navigationservice.navigate(new uri("/mainpage.xaml", urikind.relative)); } but doesn't want. there way without using navigationservice , getting actual page in back-stack instead? thanks. the short answer no can't that. other using navigationservice move backwards page page there no way manipulate stack. rightly or wrongly design. , kind of makes sense need sure operation of button consistent. what trying change behavior of button. not onbackkeypress intended for. wp7 design guide says following button: the button can close on-screen keyboard, menus, dialogs, navigate previous page, exit search operation or switch between applications. principal usage move cur...

jquery - Change the height of fullcalendar display? -

how change height of main fullcalendar , have else fit calendar? you can set @ initialization of calendar or modify dynamically using setter. from documentation $('#calendar').fullcalendar({ height: 650 }); or using setter: $('#calendar').fullcalendar('option', 'height', 700);

Converting URL to HTTPS via Javascript -

i want convert current url https version javascript. how can done ? ex: http://www.abc.com --> https://www.abc.com window.location = window.location.href.replace(/^http:/, 'https:');

ruby - Callback for classes defined inside a Module -

ruby has several built-in callbacks . there callback such case? kinda method_added, classes (or constants) inside module, instead of instance methods inside class. as far know, there nothing you're describing. however, here's how create own, using class::inherited . module mymodule def self.class_added(klass) # ... handle end class ::class alias_method :old_inherited, :inherited def inherited(subclass) mymodule.class_added(subclass) if /^mymodule::\w+/.match subclass.name old_inherited(subclass) end end end module mymodule # add classes end

ruby on rails - ActiveRecord: Order by firstcolumn, (secondcolumn='foobar'), thirdcolumn...possible? -

i have activerecord query works follows: a user searches zipcode - let's 90210. query identifies state (california), , returns results have match either in 'zipcode' field, or in 'state' field. what i'd order results satisfy exact zipcode first. results precise zipcode '90210' ranked higher results satisfy 'california' state...keeping in mind results 90210 zipcode may have 'california' state. any suggestions? you don't dmbs use - in msysql can conditional order :order => "if(zipcode = '#{params[:zipcode]}', 0, 1)" other dbms's might differently, think above standard though. alternative way :order => "(zipcode = '#{params[:zipcode]}') desc)" the desc necessary because if test implicit in above returns 1 true , 0 false, , 1 comes after 0 true results come after false results. hence desc shove true ones top. i'm bit confused want though. if want find resul...

opengl es - What does GL_UNSIGNED_BYTE mean for glTexImage2D? -

i want load byte array containing texture in rgba 8888 format. the opengl es docs offer 4 constants use: gl_unsigned_byte, gl_unsigned_short_5_6_5, gl_unsigned_short_4_4_4_4, , gl_unsigned_short_5_5_5_1. on regular opengl , there value gl_unsigned_int_8_8_8_8 meets needs -- , numbers interpreted thus: example, if internalformat gl_r3_g3_b2, asking texels 3 bits of red, 3 bits of green, , 2 bits of blue. so gl_unsigned_int_8_8_8_8 must 8 bits of r, 8 bits of g , 8 bits of b , 8 bits of a. but gl_unsigned_byte mean on es platform , how interpretted? (how many bits r, g, b , a?) gl_unsigned_byte should work format gl_rgba, giving 8 bits per component.

java - XPath getting text from an element after a certain element -

so right if have this: //div[@class='artist']/p[x]/text() x can either 3 or 4, or maybe different number. luckily, if looking not in 3, can check null , go on until find text. issue rather know i'm going right element every time. tried this: div[@class='people']/h3[text()='h3 text']/p/text() since there <p> right after <h3>h3 text</h3> . never returns anything, , results in error. if remove /p 'h3 text' returned. anyway, how <p> directly after <h3> ? btw, i'm using htmlcleaner in java this. by default when don't specify axis child:: axis, why / operator seems descend dom tree child child. there implied child:: after each slash. in case don't want find child of <div> , want find sibling of it. sibling element @ same nesting level. specifically, should use following-sibling:: axis. div[@class='people']/h3[text()='h3 text']/following-sibling::p/text() ...

.htaccess - htaccess block everything but 1 file and 1 folder -

i have seen number of posts similar wasn't able achieve actual desired feel. so have. need have past urls forward index.php file. fine , have far, need add exception of specific folder 'images' folder images show up, b/c since i'm forwarding index it's not grabbing right images because blocking them. currently have this options +followsymlinks rewriteengine on rewritecond %{request_uri} !images/$ rewritecond %{request_uri} !index.php$ rewriterule ^(.*)$ "http://www.exmample.com" [r=301,l] currently images won't load unless specific call image ie: rewritecond %{request_uri} !images/single/picture.jpg$ any thoughts or suggestions appreciated. cheers yeah, "!images/$" means you're rewriting except specific request uri "http://www.example.com/images/". use regular expression in rewritecond: rewritecond %{request_uri} !images/(.*)$ this means no uri starting "images/" rewritten. guess it'd s...

javascript - Drop down menu does not work properly on Chrome -

i have triple drop down menu , when select option first drop down, based on values populated in second drop down these values in second drop down not clear though change change option of first drop down. facing problem chrome. in firefox works fine. 1 tell me how clear previous selection contents. have pasted code in pastebin http://paste.flingbits.com/m05ef5d2 could 1 please me this. @cutekate: try changing onclick in <select> 's onchange . update: javascript (save xhr.js ): var xhr; function countyselect(q) { if (q != "select state") { xhr = getxmlhttpobject(); if (xhr == null) { document.write("there problem while using xmlhttp"); return; } var strurl = "findcounty.php?state=" + q + "&sid=" + math.random(); xhr.onreadystatechange = countystatechanged; xhr.open("get", strurl, true); xhr.send(null); } els...

scipy - Analyzing time complexity of a function written in C -

i implementing longest common subsequence problem in c. wish compare time taken execution of recursive version of solution , dynamic programming version. how can find time taken running lcs function in both versions various inputs? can use scipy plot these values on graph , infer time complexity? thanks in advance, razor for second part of question: short answer yes, can. need 2 data sets (one each solution) in format convenient parse python. like: x y z on each line, x sequence length, y time taken dynamic solution, z time taken recursive solution then, in python: # load these data sets. sequence_lengths = ... recursive_times = ... dynamic_times = ... import matplotlib.pyplot plt fig = plt.figure() ax = fig.add_subplot(111) p1 = ax.plot(sequence_lengths, recursive_times, 'r', linewidth=2) p2 = ax.plot(sequence_lengths, dynamic_times, 'b', linewidth=2) plt.xlabel('sequence length') plt.ylabel('time') plt.title('lcs ...

jquery json doesn't return any value /repsonse -

i'm using getjson json value returned page, there no response function.. <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> alert ("dfdfad"); function sam() { alert("entere"); $.getjson( 'https://test.httpapi.com/api/domains/available.json?', { 'auth-userid':'234343', 'auth-password':'xxxxxxxx', 'domain-name':'yyyyy', 'tlds':'com', 'tlds':'info', 'suggest-alternative':'true' }, function(json,textstatus,xhr) { alert ("inside fun"); alert("json data: "...

how to break a large image into 8 equal parts in android -

want break large image equal parts 4, 6 or 8. can it? want store every parts of image separate image in drawable folder future use. can 1 me? thanks in advance sunit you should bitmap definition with [this][1] should able public static bitmap createbitmap (bitmap source, int x, int y, int width, int height, matrix m, boolean filter) [1]: http://developer.android.com/reference/android/graphics/bitmap.html#createbitmap(android.graphics.bitmap , int, int, int, int, android.graphics.matrix, boolean) edit: maybe 1 simpler public static bitmap createbitmap (bitmap source, int x, int y, int width, int height) should (divided in 4, you'll have work out loops make work on 4,6,8 ... bitmap source = ...; int halfwidth = source.getwidth()/2; int halfheight = source.getheight()/2; bitmap topleft, topright, bottomleft, bottomright; topleft = createbitmap(source,0,0,halfwidth ,halfheight); topright= createbitmap(source,halfwidth ,0,halfwidth ,halfheight)...

oracle - Tricky use of substring -

my question field called contract_nm varchar2(14). need 3 different values use field filter clause. here sample data , how long data might be, either 9 or 10 or 11, no more can be. contract_nm length(contract_nm) f.us.wz10 9 f.us.wz11 9 f.us.wz12 9 f.us.rbz10 10 f.us.rbz11 10 f.us.rbz12 10 f.us.zwaz10 11 f.us.zwaz11 11 f.us.zwaz12 11 etc 1) need display last 3 characters of contract_nm. 2) check last 3 characters of contract_nm see if first letter 1 of below, month , year next 2 letters , day defaulted first day of month. need display date because going date field. trade months (terms): f january g february h march j ...

GIT diff giving me different feedback than git merge -

when run git diff fetch_head it lists load of expected changes, since fetched updated version remote. but.... when run git merge fetch_head it tells me date!! where going wrong? why fetch_head different head , after merge? a merge creates new commit, containing changes original head , orig_head , fetch_head . means if original head contained changes not contained in fetch_head , new (merged) head different fetch_head since contains commits well. thing check it's possible current branch up-to-date fetch_head previous fetch, above reason, or reason. to check this, sha (hex number) fetch head follows: git log -1 fetch_head commit bec5aadef68a5d29c9d523358a0189b86cad4c82 author: alex brown <alex@xxx> date: tue nov 16 10:05:19 2010 +0000 weather report and copy first 6 digits of fetch_head : bec5aa next, search sha in ancestry of head git log head | grep "commit bec5aa" -a 5 commit bec5aadef68a5d29c9d523358a0189...

Hash navigation problem while using jquery mobile with asp.net mvc2 -

i looking standardize processing of ajax #anchors @ server side, using mvc. before controller action invoked want convert every request ajax anchors request without ajax anchors, controller code not know there anchors in request: for example: 1) /user/profile#user/photos should treated /user/photos 2) /main/index#user/profile/33 should treated /user/profile/33 what best technique in mvc accomplish that? this should done on client side, using jquery follows # sign never sent server.

jquery - making first tab active using jscrollpane -

hi there got jscrollpane can't figure out how make first tab active , not show information until clicked. know code have put dont know or have take out make work $(function() { // create "tabs" $('.tabs').each( function() { var currenttab, ul = $(this); $(this).find('a').each( function(i) { var = $(this).bind( 'click', function() { $("ul.tabs li:first").addclass('active').show(); if (currenttab) { ul.find('a.active').removeclass('active'); $(currenttab).hide(); } currenttab = $(this).addclass('active') .attr('href'); $(currenttab).show().jscrollpane(); return false; } ); $(a.attr('href')).hide(); } ); } ); }); $('.tabs').each( function() { var currenttab, ul = $(this); $(this).find('a').each( ...

In PowerShell, how do I convert DateTime to UNIX time? -

in powershell, how can convert string of datetime sum of seconds? ps h:\> (new-timespan -start $date1 -end $date2).totalseconds 1289923177.87462 new-timespan can used that. example, $date1 = get-date -date "01/01/1970" $date2 = get-date (new-timespan -start $date1 -end $date2).totalseconds

floating point - Can equivalent expressions yield different float results? -

the discussion this answer got me thinking equality , equivalence of floating point numbers. aware floating point numbers can not represented accurately. question is, there mathematically equivalent expressions yield different results when using floating point arithmetic? can provide example? edit: let me more clear. aware same code different compilers or different machines can return different results. looking 2 mathematically equivalent expressions can compare in python interpreter/c++ program/whatever , unexpected result. are there mathematically equivalent expressions yield different results when using floating point arithmetic? absolutely. in fact, should expect happen more not. even same code can yield different results on different machines or compilers. can provide example? sure. java code should repeatably yield 2 different results: public strictfp class test { public static void main(string[] args) throws exception { float...