Posts

Showing posts from May, 2015

iphone - Pop a UIViewController containing a UITabBarController off of a UINavigationController -

i have uinavigationcontroller(a) pushes uiviewcontroller(b) onto stack. (b) contains uitabbarcontroller(c). (c) has 5 tabs , of these viewcontrollers(d,e,f,g,h) needs able pop (b) off stack. i've tried [[self.parentviewcontroller navigationcontroller] popviewcontrolleranimated:yes]; among many other things, none of seem work. ideas? edit: .h file: @interface matabviewcontroller : uiviewcontroller<uitabbarcontrollerdelegate> { uiviewcontroller *ref; } @property (nonatomic, retain) iboutlet uitabbarcontroller *tabbarcontroller; @property (nonatomic, retain) iboutlet uiimageview *imgviewfooter; @end .m: #import "matabviewcontroller.h" @implementation matabviewcontroller @synthesize tabbarcontroller = _tabbarcontroller; @synthesize imgviewfooter; - (void)viewdidload { [super viewdidload]; self.view = self.tabbarcontroller.view; self.tabbarcontroller.delegate = self; self.imgviewfooter.frame = cgrectmake(0.0f, 395.0f, 320.0f, 64.0f); [self.tabbarcon

encoding - python BeautifulSoup find span id name without using string\re methods -

i'm trying id name of span tags. <td valign="top" colspan="2"><img height="25" src="images/spacer.gif" width="1"><br> <!--start table details--> <table cellspacing="1" cellpadding="5" width="100%" bgcolor="#a18c42" border="0" id="compdetails"> <tr bgcolor="white"> <td class="rowname" nowrap>מספר תאגיד:</td> <td width="100%" colspan="3"><span id="lblcompanynumber">520000472</span></td> </tr> <tr bgcolor="white"> <td class="rowname" nowrap>שם תאגיד (עברית):</td> <td width="50%"><span id="lblcompanynameheb">חברת החשמל לישראל בעמ</span></td> <td class="rowname"

html and css - different height of div-containers -

in template have 1 big div container 2 smaller in it. have different contents in it, if don´t specify pixel, containers conform different contents. i them dynamic, wish be, container less content gets big 1 more content. how can write in stylesheet? it's possible , there multiple approaches. take @ website detailed explanation: http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks

php - Jquery Countdown Server sync issue -

i'm trying create countdown event. i'm using jquery countdown i have code: $(function () { var fecha = new date("july 30, 2011 00:00:00"); $('#defaultcountdown').countdown({ until: fecha, format: 'dhms', expiryurl: "http://www.google.com", serversync: servertime, timezone: -4 }); }); function servertime() { var time = null; $.ajax({ url: 'servertime.php', async: false, datatype: 'text', success: function (text) { time = new date(text); }, error: function (http, message, exc) { time = new date(); } }); return time; } the script working fine, when try change clock date, countdown changes. idea why? i imagine created servertime.php file on server? http://keith-wood.name/countdown.html tab timezones has php code you'll need add servertime.php script use tha

php - Send email array (foreach) -

i need send array of products email php i'm getting trouble " foreach ". this code: //form <form action="" method="post"> <select name="product[]" class="product" > <option value="product1">product1</option> <option value="product2">product2</option> <option value="product3">product3</option> </select> <input type="text" name="boxes[]" value="boxes:" class="boxesinput" size="20"> </form> this jquery code grab data (i'm working on wordpress , couldn't find way $_server['php_self']‎... //jquery var productval = jquery(".product").val(); var boxesval = jquery(".boxesinput").val(); jquery.post("sendemail.php", { boxes: boxesval, product: productval } ); this sendemail.php file //sendemail.p

MySQL: Finding duplicates across multiple fields -

background: employer has database powered old version of mysql (3.23). have been asked find duplicate serial numbers , mac addresses in database. i able find duplicate serial numbers, since version of mysql doesn't support subqueries, had resort using temporary table. these 2 sql statements ended using: create temporary table if not exists inventory_duplicate_serials select serial inventory serial not null group serial having count(serial) > 1 select devicename, model, inventory.serial inventory inner join inventory_duplicate_serials on inventory.serial = inventory_duplicate_serials.serial order serial now need find duplicate mac addresses. problem "inventory" table has 3 mac address fields (mac, mac2, , mac3). so, example, if value of item's "mac" field same value of item's "mac2" field, need know it. how go doing this? thank time. update: solved. ended creating 2 temporary tables (inventory_all_macs , inventory_duplicate_ma

visual c++ - Do I have .NET dependencies? -

the following headers i'm including when pick , create empty project , add c++ file: stdio.h windows.h tlhelp32.h the program stable when there .net 4.0 installation on system. don't know use .net in program. there resource file, doesn't use .net related stuff. also, can't migrate framework 3.5 without building new project (it's 4.0 now), , seems switch 4.0 after compiling, though checked 2.0. one win32 c++ empty project ( /clr ) , 1 empty project c windows api. if you're compiling /clr, believe have .net dependency - switch affects type of binary produced compiler. regardless of whether use .net types or features, if compile /clr you'll .net assembly.

ios - backBarButtonItem in navigation controller not showing up -

i started xcode project navigationviewcontroller template. , now, when push view, view comes edit button default , no bar button. have commented out editbutton code , corresponding setediting delegate method. can not button show up. doing wrong? pushing new view: playlistviewcontroller *playlistviewcontroller = [[playlistviewcontroller alloc] init]; playlistviewcontroller.managedobjectcontext = self.managedobjectcontext; [self.navigationcontroller pushviewcontroller:playlistviewcontroller animated:yes]; [playlistviewcontroller release]; in playlistviewcontroller: - (void)viewdidload { [super viewdidload]; self.title = @""; // self.navigationitem.leftbarbuttonitem = self.editbuttonitem; // doesn't matter if here or not self.navigationitem.hidesbackbutton = false; uibarbuttonitem *addbutton = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemadd target:self action:@selector(insertnewobject)]; self.navigati

javascript - How to execute a command in a Firefox Add-On? -

i quite new writing firefox add-ons, still, got point patched working extension, except core of it. at point in code, need execute system-command on file. i've found snipped on web , tried adapt it, without luck. xpi/components/script.js : var cmd = '/usr/bin/somecommand' var args = ['-option', 'value', f.path ]; var execfile = components.classes["@mozilla.org/file/local;1"].createinstance(components.interfaces.nsilocalfile); var process = components.classes["@mozilla.org/process/util;1"].createinstance(components.interfaces.nsiprocess); execfile.initwithpath(cmd); if (execfile.exists()) { process.init(execfile); process.run(false, args, args.length); } can tell me what's wrong here? i've assembled command , i've got filename can't firefox execute code snippet. is execfile , initwithpath , createinstance , etc. stuff needed?? want execute command in cli: $ somecommand -option value filename

java - Android crash when starting activity? -

i have new intent activity want open when double click registered, know double click working properly, every time try start new activity stops working ? (force quits) code : imview.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { long thistime = system.currenttimemillis(); if (thistime - lasttouchtime < 250) { // double click //toast toast = toast.maketext(getapplicationcontext(), "double tap worked!", 10); //toast.show(); lasttouchtime = -1; intent myintent = new intent(v.getcontext(), zoom.class); startactivityforresult(myintent, 0); } else { // slow lasttouchtime = thistime; } } }); you may not have put second activity in manifiest f

css - Make header and side divs to stick while center one scrolls -

Image
i have layout i need header, col2(left) , col3(right) stick in position while center 1 scrolls (col1). position: fixed want this. body { padding-top: 100px; } #header { width: 100%; height: 100px; position: fixed; top: 0; left: 0; } jsfiddle . update you should give internal element explicit height , add overflow-y: auto .

screen scraping - Web API for pulling text from article url? -

i products provided read later, instapaper, readability, etc. strip out core of article , display formatted nicely: text , images article. looking api this. i discovered accident instapaper can me: http://www.instapaper.com/text?u=http%3a%2f%2fwww.bbc.co.uk%2fnews%2f14185334 however, cannot rely on this, isn't documented on api. does know of online api can use? thanks! there's http://www.alchemyapi.com/api/text/ , pretty sure i've seen other services well

ruby on rails - Rendering nested form partials in other controllers -

i have 3 resources: jobs, questions , answers. relationships are: job has many questions; question has many answers; job has many answers. i have nested of forms on jobs/new view. now goal of app admins (us) create jobs , questions behind admin wall. once we want list out questions created each specific job , have users answer questions. requires putting answers form on view (same or different controller) not behind admin wall. since forms nested on jobs/new view, created partial answers form: <%= form_for(@job) |f| %> <%= f.label :name %><br /> <%= f.text_field :name %> <%= f.fields_for :questions |builder| %> <%= render 'question_fields', :f => builder %> <% end %> <%= f.submit %> <% end %> with question partial being: <%= f.label :question, "question" %> <%= f.text_area :question, :rows => 10 %> <%= f.check_box :_destroy %> <%= f.label :_destroy, "rem

concurrency - PostgreSQL - Duplicate Unique Key -

on table have secondary unique key labeled md5. before inserting, check see if md5 exists, , if not, insert it, shown below: -- attempt find item select oresults (select domain_id db.domains "md5"=omd5); if (oresults null) -- attempt find domain insert db.domains ("md5", "domain", "inserted") values (omd5, odomain, now()); return currval('db.domains_seq'); end if; this works great single threaded inserts, problem when have 2 external applications calling function concurrently happen have same md5. end situation where: app 1: sees md5 not exist app 2: inserts md5 table app 1: goes insert md5 table since thinks doesnt exist, gets error because right after seen not, app 2 inserted it. is there more effective way of doing this? can catch error on insert , if so, select domain_id? thanks in advance! this seems covered @ insert, on duplicate update in postgresql? you go ahead , try i

ef code first - Define association using database column and not entity type property -

public class order { public int orderid {get; set;} public datetime dateordered { get; set; } public icollection<orderline> orderlines { get; set; } } public class orderline{ public int orderlineid { get; set; } public int orderid {get; set; } // want remove public string itemname { get; set;} public int qty { get; set; } } how map these using fluent api? using these in repository pattern order root of aggregate. such not want orderline have reference order or have orderid . since orderline makes sense because child of order . currently using this: hasmany<orderline>(x => x.orderlines).withrequired().hasforeignkey(x => x.orderid); i using existing database structure here , ideally map using database column name. somehow tell use tblorderline.colorderid rather orderline.orderid . you can use map() method map fk hasmany<orderline>(x => x.orderlines) .withrequired() .map(m => m.mapkey("colorderid"

ios - When should we release an object if we are returning it? -

check following method: -(nsmutablearray*)providerequestarray{ nsmutablearray* requestarray=[[nsmutablearray alloc] initwithobjects:@"mystring",nil]; return requestarray; } now when should requestarray released doesn't produce consequences. return object sending autorelease message. // initwithformat: ?? nsmutablearray* requestarray=[[nsmutablearray alloc] initwithformat:@"mystring"]; return [requestarray autorelease]; or autoreleased 1 (for instance array class method) : nsmutablearray* requestarray= [nsmutablearray array]; return requestarray; check out doc here .

c++ - TinyXPath not filtering the required dom element according to the given attribute query? -

example xml is: <dgn> <sg> <nodes> <node name="sphere 1" clsid="{cf21f965-203a-456a-83fe-a5f62d6d8e50}" type="mesh" id="{418acdd5-65d2-410f-b43b-0b48e4010b75}" subtype="" version="2.0" cloneparentkey="" nextcloneparentkey=""> <object id="{ac685ad2-3411-43b0-a29b-3b22086baef6}">sphere 1</object> <material id="{d2029f35-4a85-4669-bbf3-e754568ed88c}">standard 1</material> <controllers> <controller id="{989803fd-b575-45e4-b8a0-b5e69008145b}" weight="100" name="default" inherit="-1"> <tracks> <track name="radius" type="parametric" numkey="0" pathfollow="0"> <interpolator clsid="{ecc9c2c7-5175-4784-9108

oracle - Difference between SELECT DISTINCT and SELECT UNIQUE -

possible duplicate: unique vs distinct multi-column in oracle 9i proper difference between select distinct , select unique points , examples. select distinct , select unique behave same way in oracle. while distinct ansi sql standard, unique oracle specific statement. look here: http://psoug.org/definition/distinct.htm

javascript - jquery offclick? -

i have 'li' pops down when click on 'link' via jquery's 'click'. does know of clean way along lines of 'offclick'? in, when click off of element, hide pop down? thanks! matt you want assign click listener window , assign click listener link. inside link click listener, you'll want stop event propagation doesn't travel dom tree , fire window's click listener. something should trick: $(window).click(function(){ $('li#my_li').slideup(); }); $('a#my_link').click(function(event){ try { event.stoppropagation(); } catch(err) { // ie way window.event.cancelbubble=true; } $('li#my_li').slidedown(); });

perl - Can anyone tell me where the bug is? -

use strict; use warnings; open(file4,"cool.txt"); open(file6,">./mool.txt"); $line = <file4>; while ($line ne "") { @array = split(/,/,$line); $line = <file4> ; print file6 ($array[0]); print file6 ("\t"); print file6 ($array[1]); print file6 ("\t"); print file6 ($array[2]); } these code have written in perl. code not working fine. giving tab space every nextline. dont need tab space every new line.let me show how output is. name contact email samy 32344245 hyte@some.com alex 231414124 coool@some.com this how see mool.txt file.the first line working fine.but nextline i'm facing t

Can we use our own map in android? -

can use our own map(like our house map) , use gps show in map? if possible how it? you can want, if asking if there easy way this, no. you have produce scale drawing, map pixel space scale of image, know geopoints represented corners of map, project onto scaled display image. some open source products use tiled images similar google maps, use osm data, suppose if dedicated use , turn map tiles think purposes easier self. you might check google code repository etc. , other open source venues , see if has done similar this. also best accuracy going 2m, , not indoors (if got signal @ all)

java Get the list or name of all attributes in a XML element -

i have xml element <base baseatt1="aaa" baseatt2="tt"> <innerelement att1="one" att2="two" att3="bazinga"/> </base> and list of attributes. both base element , inner element. i dont know name of innerelement can have many different names. nodelist baseelmntlst_gold = goldanalysis.getelementsbytagname("base"); element baseelmnt_gold = (element) baseelmntlst_gold.item(0); the goal kind of dictionary output, for example xml above output dictionary valuse. baseatt1 = "aaa" baseatt2 = "tt" att1 = "one" att2 = "two" att3 = "bazinga" i using jre 1.5 here plain dom based solution (however there nothing wrong combine xpath dom in java): nodelist baseelmntlst_gold = goldanalysis.getelementsbytagname("base"); element baseelmnt_gold = (element) baseelmntlst_gold.item(0); namednodemap baseelmnt_gold_attr = base

javascript - Learn about regular expressions? -

in answer 1 of questions, had posted: // replace easier work delimiter str.replace(/(;)(?![";"])/g, '|') // or split it, skip on results ; var strarr = str.split(/(;)(?![";"])/); (s in strarr) { if (strarr[s] !== ";") { // strarr[s] console.log(strarr[s]); } } i'm lost @ /(;)(?![";"])/ . looks bunch of random symbols me :( . where can learn more regular expression syntax? there various resources: mdc the specification (but that's going hard going) javascript kit's intro , reference evolt's regular expressions in javascript regarding actual expression, / characters mark beginning , end of regular expression literal (like quotes string, although ending / may followed flags), , then: +------------- 1 |+------------ 2 ||+----------- 3 ||| +--------- 4 ||| | ||| | ||| | +------- 5 ||| | | +----- 6 ||| | | | +--- 7 ||| |

c# - Do variables need to be referenced for them to be included in a closure? -

when creating closure (in javascript or c#), variables in scope @ time of closure's creation "enclosed" in it? or variables referenced in newly created method? example c# code: private void main() { var referenced = 1; var notreferenced = 2; // enclosed? new int[1].select(x => referenced); } example javascript code: var referenced = 1; var notreferenced = 2; // enclosed? var func = function () { alert(referenced); } (question came me when reading memory leaks in ie creating circular references javascript closures. http://jibbering.com/faq/notes/closures/#clmem ) note: word "enclosed", mean msdn call "captured". ( http://msdn.microsoft.com/en-us/library/bb397687.aspx ) you have 2 questions here. in future might consider posting 2 separate questions when have 2 questions. when creating closure in javascript, variables in scope @ time of closure's creation "enclosed" in it

Jquery Droppable Items from Explorer -

does droppable ui in jquery support dropping items explorer? drag picture drive div element.. :) those both ui parts don't support dragging , dropping desktop. however, quite trivial add support dropping images on website. can follow article on mdn: https://developer.mozilla.org/en/dragdrop/drag_and_drop#drag_and_drop_basics , use getdataurl on file instance receive :-)

multithreading - Multicasting UDP in C -

i programming multicast environment scenario. source sending content multicast address 239.0.1.1. on other end client wants join multicast address. actual working of multicast client wants join multicast group sends join request router has connected. have program router operation receives multicast join request client, fetch data multicast address , give content customer. not able figure out how this. single user fine. when there multiple clients technique using not correct... please me out.. code join particular address , send data single client shown below: #include <sys/types.h> /* type definitions */ #include <sys/socket.h> /* socket api calls */ #include <netinet/in.h> /* address structs */ #include <arpa/inet.h> /* sockaddr_in */ #include <stdio.h> /* printf() , fprintf() */ #include <stdlib.h> /* atoi() */ #include <string.h> /* strlen() */ #include <unistd.h> /* close() */ #define max_len 4074 /* maxim

sql - MYSQL CSV Import - Cannot get geometry object from data you send to the GEOMETRY field -

i have csv file on server in data looks follows; 16777216,17039359,"apnic debogon project" 17367040,17432575,"tmnet, telekom malaysia bhd." 17435136,17435391,"apnic debogon project" 17498112,17563647,"cj-hellovision" 17563648,17825791,"beijing founder broadband network technology co.,l" 17825792,18087935,"allocated krnic member." 18153984,18154239,"double cast" 18157056,18163711,"family net japan incorporated" i'm trying insert table structured follows; ipoid integer 11 not null primary key beginip integer 14 not null unsigned endip integer 14 not null unsigned org varchar 255 ip_poly polygon i have spatial index created on ip_poly field i'm trying insert csv data following code load data infile "/home/geoiporg.csv" table crm_geo_org fields terminated "," enclosed "\"" lines terminated "\n" (@beginip,@endip,@org) set ipoi

Filter Facebook Checkins by Date - Graph API -

does know if there way filter out checkins returned /me/checkins call selects places checked current day? you can use until , since graph queries, try this: https://graph.facebook.com/me/checkins?since=yesterday the value pass can either unix timestamp or valid strtotime value.

iphone - Geolocation Simulation Debug Dropdown in Xcode 4 -

Image
there supposedly dropdown lets simulate several different geolocational coordinates in xcode4 @ runtime, feeding straight simulator... menu / how access it? you find menu under debug in ios simulator.

GWT RPC Service not found -

i have searched web hours, didn't find answer. problem want test gwt rpc. generate eclipse plugin gwt remote service. everytime following failure: "[warn] no file found for: /kuss_projekt/speicherservice" i have tryed lot, dont knwo problem. thats code: web.xml: <web-app> <servlet> <servlet-name>speicherservice</servlet-name> <servlet-class>de.fhdo.kuss.server.speicherserviceimpl</servlet-class> </servlet> <servlet-mapping> <servlet-name>speicherservice</servlet-name> <url-pattern>/kuss_projekt/speicherservice</url-pattern> </servlet-mapping> <!-- default page serve --> <welcome-file-list> <welcome-file>kuss_projekt.html</welcome-file> </welcome-file-list> </web-app> - speicherservice: @remoteservicerelativepath("speicherservice") public interface speicherservice extends remoteservice { string getname(string name

javascript - Problem with a jQuery script that sets an active element on hover and animation callbacks -

i working on site in there series of elements, , 1 of them must active @ time. when element active, 'details' div shown. these elements become active when hover on them, said, 1 of them can active @ same time. setting active element active class. in current code, happens when user hovers on of elements: the previous active element gets class 'active' removed , , fadeout on fadeout callback, hovered element becomes active (gets class 'active'), , fadein if there no current active element, hovered element becomes active (class 'active') , fadein this works out ok, when hover between elements, there brief moment no element active, more element gets active class , shown. how approach problem? here code: function setactive(selected) { //stores active element in variable active = selected; //checks if there elements 'active' class in dom if ( $('#info article.active').length > 0) { //if there

java - ArrayList custom class as HashMap key -

i want store data in hashmap<point[], double> . used iteration assign data, when checked @ end, number of elements 1. have implemented hashcode() , equals() in custom class point. hashmap<point[], double> hmdistord = new hashmap<point[], double>(); point[] keypts = new point[2]; (int i=0; i<intersectionpts.size(); i++) { p1 = intersectionpts.get(i); (int j=0; j<intersectionpts.size(); j++) { p2 = intersectionpts.get(j); if (!p1.equals(p2)) { keypts[0] = p1; keypts[1] = p2; d = p1.distance(p2); hmdistord.put(keypts, d); } } } any hints? in advance! you can't use array key, array has default implementation of hashcode , equals objects , doesn't consider it's elements. to make work had override hashcode , equals of array, can't it. you can use arraylist instead, implements hashcode end equals comparing elements.

Does PHP offer Lucene Client API like it offer Spinx client API? -

does php offer lucene cient api way offers sphinx client api ? considering want use native php, not framework. not know of, except there pecl extension may use query solr.. however, need install solr (which offers lucene indexes/searches webservice through tomcat app server): http://us3.php.net/solr other that, started using zend_lucene (i know dont want use framework, -and i'm not fan of zf either-, seems work ok)

CSS seems to be not working in a subdomain? -

i developed website using code igniter, styled css, locally works fine online looks css not loaded picks old css style. checked link it's correct. gives? without more information (such seeing site in question), can't give direct answer, can give pointers. my suggestion use tool firebug (in firefox) or chrome's developer tools, etc. these tools allow see full details of requests being made browser. (the exact instructions differ according tool you're using, i'll assume firebug simplicity). open page in browser, firebug open, , @ firebug's "net" tab (and make sure option below tab set "all"). list requests made browser. the key thing 404 errors. since css isn't working, it's pretty bet stylesheets failing load. 404 errors listed in firebug show why they're failing load. if hover on filenames, firebug expand show full url attempted load. show you've got wrong in configuration, , it's trying load stylesh

c# - DrawImage fails to position sliced images correctly -

for couple of days i've tried figure out why nine-slice code not work expected. far can see, there seems issue graphics.drawimage method handles 9 slice images incorrectly. problem how compensate incorrect scaling performed when running code on compact framework. might add code of course works when running in full framework environment. problem occurs when scaling image larger image not other way around. here snippet: public class nineslicebitmapsnippet { private bitmap m_originalbitmap; public int cornerlength { get; set; } /// <summary> /// initializes new instance of nineslicebitmapsnippet class. /// </summary> public nineslicebitmapsnippet(bitmap bitmap) { cornerlength = 5; m_originalbitmap = bitmap; } public bitmap scalesinglebitmap(size size) { bitmap scaledbitmap = new bitmap(size.width, size.height); int[] horizontaltargetslices = slice(size.width); int[] verticaltargetslice

javascript - Hard refresh and XMLHttpRequest caching in Internet Explorer/Firefox -

i make ajax request in set response cacheability , last modified headers: if (!string.isnullorempty(httpcontext.current.request.headers["if-modified-since"])) { httpcontext.current.response.statuscode = 304; httpcontext.current.response.statusdescription = "not modified"; return null; } httpcontext.current.response.cache.setcacheability(httpcacheability.public); httpcontext.current.response.cache.setlastmodified(datetime.utcnow); this works expected. first time make ajax request, 200 ok . second time 304 not modified . when hard refresh in chrome (ctrl+f5), 200 ok - fantastic! when hard refresh in internet explorer/firefox, 304 not modified . however, every other resource (js/css/html/png) returns 200 ok . the reason because "if-not-modified" header sent xmlhttprequest's regardless of hard refresh in browsers. believe steve souders documents here . i have tried setting etag , conditioning on "if-none-match" no ava

ruby - (a && b) versus (a and b) -

given : a=true b=false why can : puts [a && b, || b] #[false, true] but not puts [a , b, or b] syntax error, unexpected keyword_and, expecting ']' puts [a , b, or b] apparently, operator precedence comma higher "and" lower &&. putting parenthesis around elements works: [(a , b), (a or b)]

nlp - How to use Mallet for NER -

i'm new subject of nlp , requested perform -named entity recognition- (ner) using mallet. have text, , give feature vector each word in it. train model later on can test on fresh text file. question how create such model, input model. use code examples :) ! fei xia @ uw wrote pretty mallet guide . you can find example of programmatic (java) interaction mallet @ bottom of this page .

objective c - With ARC, what's better: alloc or autorelease initializers? -

is better (faster & more efficient) use alloc or autorelease initializers. e.g.: - (nsstring *)hello:(nsstring *)name { return [[nsstring alloc] initwithformat:@"hello, %@", name]; } or - (nsstring *)hello:(nsstring *)name { return [nsstring stringwithformat:@"hello, %@", name]; // return [@"hello, " stringbyappendingstring:name]; // simpler } i know in cases, performance here shouldn't matter. but, i'd still in habit of doing better way. if same thing, prefer latter option because it's shorter type , more readable. in xcode 4.2, there way see arc compiles to, i.e., puts retain , release , autorelease , etc? feature useful while switching on arc. know shouldn't have think stuff, it'd me figure out answer questions these. the difference subtle, should opt autorelease versions. firstly, code more readable. secondly, on inspection of optimized assembly output, autorelease version more optimal.

c# - ASP.NET: How can I create a Login System using aspnet_regsql.exe? -

i want create login system using aspnet_regsql.exe after aspnet_regsql.exe installiation in sql server , should next? can explain me step step after aspnet_regsql.exe installiation ? well, bit write here, find excellent series of articles here http://www.4guysfromrolla.com/articles/120705-1.aspx

asp.net mvc 3 - URL Routing: How do I have a string as my id? -

i receive string id in url. here example: http://www.example.com/home/portal/fishing i have fishing in id. cannot achieve following code: code controller: public actionresult portal(string name) { // code viewdata["portal name"] = name; } code global.asax.cs: routes.maproute( "default", // route name "{controller}/{action}/{id}", // url parameters new { controller = "home", action = "index", id = urlparameter.optional } // parameter defaults ); just change argument id : public actionresult portal(string id) { // code viewdata["portal name"] = id; } the argument bound if has same name route value token. alternate approach keep argument named name , change route: public actionresult portal(string name) { // code viewdata["portal name"] = name; } routes.maproute( "default", // route name "{controller}/{action}/{name}", // url

java - How to execute jar with command line arguments -

possible duplicate: passing arguments jar required java interpreter how provide command line input file in jar have jar file hello.jar execute.java file want execute command line 2 arguments;how can achive have mentioned executable.java main class in manifest file , using ant have run file ant run command line arguments thanks , regards samarth try in command shell: java -cp your-classpath-dependencies-here -jar hello.jar "arg1" "arg2" do in ant <java> built-in task: http://ant.apache.org/manual/tasks/java.html

How can i rename / delete files in git repository? -

i created git repository projecteuler-solutions , wanted remove word euler file names renamed files numbers , added renamed files using add command , commited , pushed changes , though in status file names euler prefix marked d didn't deleted , how can delete files , usual flow rename files ? removal: git rm renaming: git mv

help with oracle sql case statement using count criteria -

so far, query works using exists: select case when exists ( select * test1 timestamp = to_char(sysdate-1, 'yyyymmdd') || '0000' ) 0 else 1 end flg dual now, need add criteria. since data has these consistent count values of 100 example: sql> select count(*), timestamp test1 group timestamp order 2 desc; count(*) timestamp ---------- ---------- 100 2.0111e+11 100 2.0111e+11 i need alter query have count(*) of 100 , if set flag = 0 , if not set flag =1. i'm not sure add count criteria value of 100. can still use case this? you try looking having -statement: select count(*), timestamp test1 group timestamp having count(*) = 100 basically it's same where , aggregates.

c# - Sharing an Oracle connection across multiple data handlers -

i have solution in updatecontroller class manages logic updating data. controller calls various classes managing data (claimdata, statementdata, etc.). what's best way share connection across these data handlers--use singleton, or create class managing connection , passing each data handler? if application multithreaded? thanks in advance. you use dependency injection provide each of these connection... another way use oracle provider internal connection pooling (for example devart dotconnect, customer)... share connection string via dependency injection or configuration file... every class instantiates/releases connection on own... central connection pooling takes care of rest (reusing connections etc)... way don't have worry threading issues regarding connections...

html5 - Swap flash experience with HTML 5 experience if HTML 5 capable browser is detected -

we have interface flash video experience on our website , when user clicks on video testimonial, flash experience reveal video them watch/listen, in flash. the goal when reaches our website using ios device or html 5 capable browser, example, flash experience swapped out reveal new html 5 experience. we're not ready remove flash since have users don't have modern browsers yet. my question there "check" can add our site should user have html 5 browser when visit it, website swap flash experience our html 5 experience? for example: should user have javascript disabled, have setup swap flash experience simple image in place. we're hoping similar exsit detecting html 5 capable browsers. html5 collection of loosely-related features in html, javascript , css. different browsers , versions support different subsets of features. you can use modernizr library check specific features need.

opengl - Do VBOs boost performance even when all data changes frequently -

i'm doing 2d turn based rts game 32x32 tiles (400-500 tiles per frame). use vbo this, may have change vbo data each frame, background scrolling 1 , visible tiles change every time map scrolls. using vbos rather client side vertex arrays still yield performance benefit here? if using vbos data format efficient (float, or int16, or ...)? if scrolling, can use vertex shader manipulate position rather update vertices themselves. pass in 'scroll' value uniform background , add value x (or y , or whatever applies case) value of each vertex. update: if intend modify vbo often, can tell driver using usage param of glbufferdata . page has description of how works: http://www.opengl.org/wiki/vertex_buffer_object , under accessing vbos. in case, looks should specify gl_dynamic_draw glbufferdata driver puts vbo in best place in memory application.

ASP.NET MVC Adding a Web Service Layer -

i wanted peoples opinions on adding web serivce layer. @ work, want start using web services handle of our operations. our current project structure follow our asp.net mvc apps: mvc app (view/controller/viewmodel/service layer) --> bal (business access layer) --> dal (data access layer) the mvc app, bal, , dal separate assemblies. there domain (model) assembly shared among mvc/bal/dal layers. the plan create web service handle security functions. web service used multiple web applications. when make changes security web service want modify code in 1 place , not every web app. i'd prefer if mvc project has nothing in tied web service. so thinking of adding web service layer between bal , dal layers. so this: mvc project (view/controller/view model/service layer) calls bal layer (handles caching / db transactions) calls web service layer calls dal layer what opinions? a couple thoughts. you putting web service layer between ba

clojure - How to use ClojureScript practically? -

i not getting idea of clojurescript. example, writing web application, , need write javascript. should use clojurescript generate javascript me? looking guidance. thanks use if you want write desktop applications in clojure you want write entire webapp in clojure, front , end you want write js based mobile platform palm etc. you die hard clojure fan... ;) you have algorithm implemented in clojure you'd leverage on js platform. (from stand)

iis 7.5 - IIS 7.5 Virtual Directory getting Unauthorized: Access is denied due to invalid credentials -

i have web application trying access images shared folder on different server. in web app, created new virtual directory. alias qcphotos , path \alta\qcphotos. alta different server web server, brighton. i getting error: 401 - unauthorized: access denied due invalid credentials. not have permission view directory or page using credentials supplied. in trying debug, on alta server, have given user full access folder. gave {domain}\brighton$ full access folder. i turned on directory browsing, , seems work fine. can list contents of folder, click on jpg image, error comes up. well, i'm still not sure why wasn't letting me access, created domain user acct named qcphotos. gave user read permissions on folder, , set virtual directory use user in iis. fixed problem.

objective c - iPhone Dev - Trying to access every row of a sqlite3 table sequentially -

this first time using sql @ all, might sound basic. i'm making iphone app creates , uses sqlite3 database (i'm using libsqlite3.dylib database importing "sqlite3.h"). i've been able correctly created database , table in it, need know best way stuff it. how go retrieving information in table? it's important able access each row in order in table. want (if helps) info various fields in single row, put 1 object, , store object in array, , same next row, , next, etc. @ end, should have array same number of elements have rows in sql table. thank you. my sql rusty, think can use select * mytable , iterate through results. can use limit / offset (1) structure if not want retrieve elements @ 1 table (for example due memory concerns). (1) note can perform unexpectedly bad, depending on use case. here more info...