Posts

Showing posts from February, 2011

Self-referencing class: concrete python class from C interface -

i trying design c interface extended in python (using ctypes ). i've used natural idiom in c: struct format { int (*can_open)(const char *filename); struct format * (*open)(const char *filename); void (*delete)(struct format *self); int (*read)(struct format *self, char *buf, size_t len); }; it works nicely if want extend interface c directly: struct derived /* concrete implementation */ { struct format base; }; but do, implement interface python using ctypes. here have far: canopenfunc = ctypes.cfunctype(ctypes.c_int, ctypes.c_char_p) #openfunc = ctypes.cfunctype(ctypes.c_void_p, ctypes.c_char_p) #openfunc = ctypes.cfunctype(ctypes.pointer( python_format ), ctypes.c_char_p) #deletefunc = ctypes.cfunctype(none, ctypes.c_void_p) #readfunc = ctypes.cfunctype(ctypes.c_int, ctypes.c_void_p) def py_canopen_func( string ): print "py_canopen_func", string return 1 canopen_func = canopenfunc(py_canopen_func) #open_fun...

php - VTiger Scheduled workflow: "is empty" condition doesen't work -

i noticed is empty , is not empty conditions don't work scheduled workflows. they work workflows triggered hand (for example modifying record), scheduled workflows consider not empty fields, empty ones.. the same behavior happens settig is condition , lefting blank value : when workflow triggered hand, recognizes empty values, when scheduled fields detected not empty . i'll more researches on it, i'll apreciate if test , confirm behaviour. i've tested on fresh 6.2 installation: problem remains same. thanks joebordes quick answer on vtiger blog . posted fix github : pratically, find modules/com_vtiger_workflow/workflowscheduler.php file , replace line 136: 'is not empty' => 'n', with 2 lines: 'is empty' => 'y', 'is not empty' => 'ny', thanks again!

html - Rotating images in JavaScript -

should easy question knows js. i have webpage in footer 4 images rotating. <div class="column_w190 fl margin_right_40"> <!-- start: rotating images --> <div id="rotating-item-wrapper"> <img src="images/rotating/greenpeople.jpg" alt="image" class="rotating-item" width="175" height="175" /> <img src="images/rotating/entrance.jpg" alt="image" class="rotating-item" width="175" height="175" /> <img src="images/rotating/bluepeople.jpg" alt="image" class="rotating-item" width="175" height="175" /> <img src="images/rotating/reflection3.jpg" alt="image" class="rotating-item" width="175" height="175" /> <img src="images/rotating/reflection2.jpg" alt="image" cla...

oauth - Google ADX Seller Rest API scopes -

i'm having issues above api can't seem solve , appreciate help: i'm trying build oauth url scope of https://www.googleapis.com/auth/adexchange.seller+https://www.googleapis.com/auth/adexchange.seller.readonly , i'm not prompted permissions when redirecting oauth urls. i've taken developer console uris , changed client_id , redirect_uri , still doesn't work, believe problem google developer console application? e.g. google developer console uri prompts me authorise "view , manage ad exchange data" , "view ad exchange data" is: https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/adexchange.seller+https://www.googleapis.com/auth/adexchange.seller.readonly&response_type=code&access_type=offline&redirect_uri=https://developers.google.com/oauthplayground&approval_prompt=force&client_id=407408718192.apps.googleusercontent.com now if change client_id , redirect_uri use application prompted ...

java - iTextPdf not loading Images correctly -

heyo, have problem piece of code: private void createpdf(string[] url, string name) throws filenotfoundexception, documentexception, ioexception{ com.itextpdf.text.document document = new com.itextpdf.text.document(); fileoutputstream fos = new fileoutputstream(name); pdfwriter writer = pdfwriter.getinstance(document, fos); writer.open(); document.open(); document.setmargins(1, 0, 0, 0); document.addtitle(name); document.addsubject(name); (string url1 : url) { image = image.getinstance(new java.net.url(url1)); i.scaletofit(document.getpagesize()); document.add(i); document.newpage(); writer.flush(); } document.close(); writer.close(); } the images jpeg formatted , on server using itext-pdfa-5.5.5 itext-xtra-5.5.5 via maven. the problem is, pictures not displayed correctly cut in halve. how can prevent happen? what tried until now: what see above preloading image imageio both same result...

android - Zooming for the markers near the top of the map -

i have implemented below code zooming on location markers when user click on them. works fine markers except marker near top or bottom of map. zooming markers near top , bottom of map not @ exact place.as map first animate camera marker comes @ center of screen , zoom @ center of screen, markers near top not able come @ center , that's why zoom not @ exact location.is there way can resolve this? googlemap.setonmarkerclicklistener(new googlemap.onmarkerclicklistener() { @override public boolean onmarkerclick(final marker marker) { cameraupdate center= cameraupdatefactory.newlatlng(marker.getposition()); cameraupdate zoom=cameraupdatefactory.zoomto(6); }); i tried below code same issue- googlemap.animatecamera(cameraupdatefactory.newlatlng(marker.getposition())); googlemap.animatecamera(cameraupdatefactory.zoomby(2)); try following method, have tried , works, can not tell if meets ...

mysql - Yahoo-Finance Query Speed -

i'm working on project involves querying yahoo-finance many different ticker symbols. bottleneck acquiring data yahoo, wondering if there way might go speeding up. if used multiple machines query , aggregated data, help? have 1 physical machine; how might go doing that? thanks! edit: currently, i'm using node.js, yahoo-finance, , q.deferred ask yahoo historical data. then, once promises fulfilled (for each ticker), i'm doing q.all() persist data. var data = []; tickers = ["goog", "aapl", ...]; ... q.all(_.map(tickers, function(symbol) { return getyahoopromise(symbol); })) .done( function() { persistdata(data) }); getyahoopromise retrieves data ticker symbol , pushes data array. once promises resolved, data persisted in mysql database. second edit: more code: var sequentialcalls = []; ( var = 0; < tickers.length / chunksize; i++ ) { sequentialcalls.push( persistyahoochunk ); } sequentialcall...

ms access - Update Query to update backend Tables -

i have split database. in front end have update query used update tables data. split database front end, end, table doesn't updated when run query. there way can query work again? here sql using: update cwrrr set cwrrr.status = "unprocessed", cwrrr.type = "cw rrr" (((isnull([status]))<>false) , ((isnull([type]))<>false)); there no error message when run query. doesn't work properly. says updating 0 records, wrong.

php - Integration DoctrineExtensions-Taggable into Zend Framework 2 -

how can integrate doctrineextensions-taggable zend framework2 ? i added composer file. "fpn/doctrine-extensions-taggable": "dev-master", then added listener eventmanager 'eventmanager' => array( 'orm_default' => array( 'subscribers' => array( 'doctrineextensions\taggable\taglistener', ), ), ), now have error fatal error: maximum function nesting level of '100' reached, aborting! in /var/www/html/fryday/vendor/zendframework/zendframework/library/zend/loader/classmapautoloader.php on line 135

c++ - QProcess not starting -

i have following code: proc = new qprocess(); proc->startdetached("c:\\ffmpeg.exe", qstringlist() <<"-i"<< "c:\\pics\\frame%d.png"<< "-r"<< "30" << "-vcodec"<< "ffv1" << "c:\\test.avi" ); connect(proc,signal(finished(int)),this,slot(finishedffmpeg(int))); for reason signal finished() , started() never gets called. test.avi file being created correctly. what missing here? it should or use @: proc = new qprocess(); proc->startdetached("c:\\ffmpeg.exe", qstringlist() <<"-i"<< "c:\\pics\\frame%d.png "<< "-r"<< "30" << "-vcodec"<< "ffv1" << "c:\\test.avi" ); connect(proc,signal(finished(int)),this,slot(finishedffmpeg(int)));

vsts - How can I get the list of Work Items (Tasks) using Visual Studio Team Services (API) Service -

i getting started visual studio team services, , trying list of work items, searching in documentation cant possible solution. following services have tested: https://sami1212.visualstudio.com/defaultcollection/myfirst/_apis/wit/workitems/ $task?api-version=1.0 i can single work item using id cant work items https://sami1212.visualstudio.com/defaultcollection/_apis/wit/workitems?ids=4&api-version=1.0 any appreciable. in advance :) to list of work items need run query. https://www.visualstudio.com/integrate/api/wit/wiql you can create own or use 1 of exciting ones. tend write them in visual studio editor , save desktop , open in notepad.

TinyMCE in Ruby Application File Manager needed -

i have ruby on rails application integrated tinymce (js not gem used) now want integrate filemanager, 1 can use this? upload not required, want browse trough picture galary. written own file manager. to access filemanager tinymce need set button correctly in tinymce options have add this: file_browser_callback: function (field_name, url, type, win) { tinymce.activeeditor.windowmanager.open({ title: "my file browser", url: "/uploads/filechooser/", width: 850, height: 600 }, { oninsert: function (url) { win.document.getelementbyid(field_name).value = url; } }); } in url have specify path own filechooser. and in filechooser need this: $(".filechooser").click(function () { top.tinymce.activeeditor.windowmanager.getparams().oninsert($(this).parent().prev().val()); top.tinymce.activeeditor.windowmanager.close(); }); to return selected image or file tinymce

linux - Adding a file in a quilt/dquilt patch: patch applies correctly by hand, but breaks debuild -

i trying add patch debian package (on amd64 machine running ubuntu 14.10 "trusty"). while troubleshooting issue, i've reduced patch 1 adds single file. (for sake of context, file modifies fluxbox package creates fluxbox-dbg file debugging symbols.) i created patch following these steps: (made sure had existing patches applied.) quilt new add-dbg-package.patch quilt add debian/rules.d/70-debug-symbols.mk (created file contents wanted.) quilt refresh the patch seems fine: with patches applied, file exists , has correct contents. the patch contains delta adds complete contents of file, , nothing else. no other patch references file. when pop new patch, file removed; when push again, recreated. however, when try rebuild package debuild , this: the next patch create file debian/rules.d/70-debug-symbols.mk, exists! skipping patch. 1 out of 1 hunk ignored dpkg-source: info: patch has fuzz not allowed, or malformed dpkg-source: info: if patch ...

How to process all named ranges in a Google Sheet? -

is there way process of named ranges in google sheet? google documents has .getnamedranges() , can't find similar sheets. want read , print each range parameter. my end goal fix lot of named ranges en masse. there more 200 in document in question. there's bug in sheets ( documented here ) , since default ranges in named ranges have entire span of merged cells (ie: a1:j1 ), named ranges work in formulas if specify first cell, thought save lot of time accepting default named range ( a1:j1 example) , script can strip off of end, leaving a1 . in order this, need able list of named ranges in sheet. is possible? short answer no, unfortunately. there enhancement request at: https://code.google.com/p/google-apps-script-issues/issues/detail?id=917 you can star vote , receive updates.

ios - Alamofire Get Request and JSON Response -

i'm trying use yoda api , send request using alamofire swift framework. know api correctly working, have tested endpoint mashape api key multiple times. can see requests being sent (homepage of mashape under application). json response nil . func handlerequest(words:string){ var saying = words.stringbyreplacingoccurrencesofstring(" ", withstring: "+"); saying = "?sentence=" + saying; let url = nsurl(string: (baseurl+saying)); println(url); var response:string; alamofire.manager.sharedinstance.session.configuration.httpadditionalheaders = additionalheaders; alamofire.request(.get, url!).responsejson { (_, _, json, _) in println(json); } } the words string can "this first sentence" , automatically replace spaces "+" per api spec. please ignore multiple println statements, debugging. this proof of concept code, purposely not doing error chec...

java - IO error accessing file in WS02 API manager on Amazon Linuc with Oracle JDK 1.8 -

i getting few io errors when trying add items on api manager console. seems can not find file /idpmgt/idp-mgt-edit.jsp error on file /generic/add_edit.jsp. running application root should have access files needs. anyone know how fix this? 2015-04-14 18:52:36,351 [-] [http-nio-9443-exec-44] error rolesecuritytagsupport io error executing tag: jspexception while including path '/idpmgt/idp-mgt-edit.jsp'. servletexception while including page. java.io.ioexception: jspexception while including path '/idpmgt/idp-mgt-edit.jsp'. servletexception while including page. @ org.apache.tiles.jsp.context.jsptilesrequestcontext.include(jsptilesrequestcontext.java:91) @ org.apache.tiles.jsp.context.jsptilesrequestcontext.dispatch(jsptilesrequestcontext.java:82) @ org.apache.tiles.impl.basictilescontainer.render(basictilescontainer.java:465) @ org.apache.tiles.jsp.taglib.insertattributetag.render(insertattributetag.java:140) @ org.apache...

gnupg - using kbpgp • how do I specify which key-pair to encrypt_with when calling kbpgp.box(params,cb) -

var params = { msg: "if see me, working.", encrypt_for: bob, sign_with: alice }; // bob , alice keymanager objects public , unlocked private keys kbpgp.box(params, function(err, result_string, result_buffer) { console.log('\nencrypted message\n===========') console.log(result_string) }) in snippet can specify keypair using sign. how specify keymanager object want encrypt message with, not sign? is there encrypt_with option missing? that's encrypt_for parameter, expects keymanager wrapping recipient's public key. the correct comment above kbpgp.box() call be: // bob , alice keymanager objects public , unlocked private keys, respectively in order sign, need unlocked private key. in order encrypt, need public key.

database - How to install TPC-E EGen using gcc 4.8 (or above)? -

i stuck installation of tpc-e egen on mac os x (or linux). have downloaded workload generator tpc website : www.tpc.org/tpce/egen-download-request.asp failed build it. when using following command building utilities: cd utilities/prj/gnumake/ make i receive following error: ../../prj/gnumake/makefile.egenutilities:136: ../../obj/datetime.d: no such file or directory ../../prj/gnumake/makefile.egenutilities:136: ../../obj/egenversion.d: no such file or directory ../../prj/gnumake/makefile.egenutilities:136: ../../obj/error.d: no such file or directory ../../obj/locking.d:3: *** missing separator. stop. which not meaningful error , not in how resolve issue. any or hint appreciated. i found problems: 1- in egenstandardtypes.h, had replace \#if defined (__unix) || (_aix) by \#if defined(unix) || defined(\__unix__) || defined(\__unix) || defined(\__apple__) && defined(\__mach__) || (_aix) in order make part of code work mac os x well. 2- in dat...

jquery - Crop image to correct size by tweaking the image url -

i trying crop lazyload image correct size. have simple jquery plugin given below can resize , crop image correct size tweaking image url. jquery code automatically crop image correct size. when use lazyload plugin load image script not able crop image. js: var w = 200; var h = 150; $('#crop').find('img').each(function(n, image){ var image = $(image); image.attr({src : image.attr('src').replace(/s\b\d{2,4}/,'s' + w + '-h' + h +'-c')}); image.attr('width',w); image.attr('height',h); }); html: fiddle: http://jsfiddle.net/kh5btqyu/3/ (with out lazyload) <div id="crop"> <img src=""/> </div> lazyload html: fiddle: http://jsfiddle.net/v2fud3a4/4/ (unable crop) <div id="crop"> <img data-src=""/> </div> actually lazyload plugin works when change image src <img src=""/> data-src <img data-src=""...

objective c - iOS ReactiveCocoa RACObserve UITextView NSAttributedString -

i'm trying use reactivecocoa bindings bind uitextview's attributedtext model. however, attributedstring value not saved expected. wrong binding? - (void)viewdidload { [super viewdidload]; nserror *error; nsattributedstring *attributedtext = [[nsattributedstring alloc] initwithdata:self.note.attributedtext options:@{nsdocumenttypedocumentattribute: nsrtfdtextdocumenttype, nscharacterencodingdocumentattribute: [nsnumber numberwithint:nsutf8stringencoding]} documentattributes:nil error:&error]; self.texttextview.attributedtext = attributedtext; rac(self.note, attributedtext) = [racobserve(self.texttextview, attributedtext) map:^id(nsattributedstring *attributedtext) { return [attributedtext datafromrange:nsmakerange(0, attributedtext.le...

mysql - SQL Select Query Tree -

i have table called admin following columns: admin_id, admin_table, unit_id, unit_table i beginning search see if admin on unit directly or further down tree. starting off admin_id, admin_table, unit_id , unit_table. because admin may control unit on unknown level of descendants. i need change admin_id , admin_table if unit controlled admin not searched unit , admin on unit. how using mysql database? guys because not understand doesn't mean vote down. imagine if php. answered myself below: select @uid:=unit_id 'unit_id', @utb:=unit_table 'unit_table' admin inner join (select @uid:='".$id."', @utb:='".$table."') tmp admin_id=@uid , admin_table=@utb')

html - JavaScript keeps throwing "Uncaught TypeError" on addition to a select form -

i keep getting error "uncaught typeerror: cannot read property 'add' of null" , happens on line select.add("hi!", 0); . thought because of name mismatch, why list exists, did not solve problem. guidance awesome! <script type="text/javascript"> for(i = 0; < 10; i++){ var names = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] //window.alert(names[i]) document.write('<tr>'); document.write('<td>'); document.write('<select id=names[i]></select>'); var select = document.getelementbyid(names[i]); select.add("hi!", 0); document.write('</td>'); document.write('</tr>'); } </script> thank you yo...

javascript - Why do I get a line break after a <span> element -

why line-break? use following: white-space: nowrap; when fill in span line-break appears. causing this? function insertlinkhoverimage(datei,datei2,verlinkung) { var doc = document.getelementbyid("frame").contentwindow.document; var range = doc.getselection().getrangeat(0); var nnode = doc.createelement("span"); var width = 0; var height = 0; var image = doc.createelement("img"); image.src = "http://www.galliano.cc/test_seite/cms/uploads/"+datei; //wenn bild hochgeladen wurde image.onload = function() { document.getelementbyid("imgwidth").value = image.width; document.getelementbyid("imgheight").value = image.height; var alink = doc.createelement("a"); var classdatei2 = ""; alink.href = verlinku...

python - psychopy ratingScale with numeric keypad -

in task, i've been allowing responses using numeric keypad (e.g 'num_1') regular numbers @ top of keyboard (e.g. '1'). when later ask ratings using ratingscale , i'd both options available well, don't know how achieve this. as is, ratingscale not accept responses numeric keypad. can change respkeys , have provide "a list of keys use selecting choices, in desired order". means can't allow both '1' , 'num_1' select first rating (e.g. respkeys = ['1','num_1, '2', 'num_2', ...] '1' select first rating, 'num_1' second, etc.). am stuck either respkeys = ['1','2','3','4','5'] or respkeys = ['num_1','num_2','num_3','num_4','num_5'] ? thanks help! i don't think there's built-in ways visual.ratingscale take multiple keyboard keys same scale location. if you're using coder, hack ...

regex help splitting string on the hyphen and space characters in R -

i have string follows: "ipf-plasma 1" i'd split on "-" , "\\s". tried following: strsplit(cleandata[[1]][1,1], "-|s") however, gives, > strsplit(cleandata[[1]][1,1], "-|s") [[1]] [1] "ipf" "pla" "ma 1" why there split on "plasma"? , how fix it? you had it... forgot slashes... a <- "ipf-plasma 1" > strsplit(a, "-|s") [[1]] [1] "ipf" "pla" "ma 1" > strsplit(a, "-|\\s") [[1]] [1] "ipf" "plasma" "1"

Custom Folder Structure in ASP.NET MVC 5 -

i'm trying determine if possible (or practical) implement uncle bob's screaming architecture in asp.net mvc 5 rather using default folder structure. here's link description of screaming architecture: http://blog.8thlight.com/uncle-bob/2011/09/30/screaming-architecture.html a hypothetical folder structure this: root customers controllers customercontroller.cs models customer.cs views index.cshtml details.cshtml update.cshtml employees controllers employeescontroller.cs models employee.cs views index.cshtml details.cshtml update.cshtml shared views _layout.cshtml error.cshtml _viewstart.cshtml web.config the corresponding url routes this: http://www.example.com/customers/ => customer index http://www.example.com/customers/details/1 => customer details http://www.example.com/customers/update/1 => customer update http://www.example.com/employees/ => employee index http://www.example.com/employees/...

javascript - Adding a plus "+" symbol to positive numbers in a JQuery output -

i have modified jquery ui slider bar (-100 +100). when user moves slider , down scale receive visual feedback via <div id="slider-result"></div> currently slider-result displays - symbol when number negative e.g. -47 , not display + symbol when number positive e.g. 61 how can make slider-result display + symbol before number when positive? i have looked @ question when try integrate solution displays + when number positive, stops displaying number... my attempt slide: function(event, ui) { $("#slider-result").html(ui.value>0?'+':'') + ui.value; any helps always, appriciated. thanks edit - complete code $('#submit').click(function() { var username = $('#hidden').val(); if (username == "") username = 0; //should still 0? $.post('comment.php', { hidden: username }, function(return_data) { alert(return_data); }); }); $(".slider...

javascript - PHP adding unwanted line break to ajax result -

why php adding line break simple ajax result? couldn't easier. missing something? here js: $(document).ready(function() { $('#inputemail').change(function(){ // check see if email exists var email = $('#inputemail').val(); //alert(email); $.ajax({ url : "php/checkuseremail.php", type: "post", datatype: "text", data: {email: email}, success: function(data){ alert(data); if(data === "exists"){ alert(data); } }, error: function (jqxhr, textstatus, errorthrown) { alert("ajax error"); } }); }); }); here php: <?php include_once("db_connect.php"); // catch results sent via $.post , ass...

amazon web services - How to run a Spark jar file from AWS Console without Spark-Shell -

i'm trying run spark application on aws emr console (amazon web services). scala script compiled in jar takes sparkconf settings parameters or strings: val sparkconf = new sparkconf() .setappname("wikipediagraphxpagerank") .setmaster(args(1)) .set("spark.executor.memory","1g") .registerkryoclasses(array(classof[prvertex], classof[prmessage])) however, don't know how pass master-url parameter , other parameters jar when it's uploaded , set-up cluster. clear, i'm aware if running spark-shell way, i'm windows user , current set-up , work i've done, useful have way pass master url emr cluster in 'steps'. i don't want use spark-shell, have close deadline , have set-up way , feels small issue of passing master url parameter should possible, considering aws have guide running stand-alone spark applications on emr. help appreciated! here instructions on using spark-submit via emr step: https://github...

c++ - How to AES CBC encryption Using cryptoAPI -

i want encrypt file aes cbc mode encryption, using cryptoapi functions , set own key command-line (it change in code) i imagine key (after change) 1a1dc91c907325c6 , tried in form: hcryptprov hprov = null; hcryptkey hkey = null; dword dwbloblen; pbyte pbkeyblob = null; pbkeyblob = (pbyte)"1a1dc91c907325c6"; if(!cryptacquirecontext(&hprov, null,null, prov_rsa_aes,crypt_verifycontext)) { printf(" error in acquirecontext 0x%08x \n",getlasterror()); } if (!cryptimportkey(hprov,pbkeyblob,sizeof(pbkeyblob),0,crypt_exportable,&hkey )) { printf("error 0x%08x in importing des key \n",getlasterror()); } but cryptimportkey failed i don't know how use cryptoapi functions , it's parameters i tested other codes , change parameters or function's call's order 2 weeks wasn't able this please me [a big :)] thank you you should this: if( ::cryptacquirecontext( &m_hcryptoprovider, null, null/*d...

function - Powershell implicitly converting arrays preventing use with Select -Property in v2 -

i struggling powershell implicitly modifying structure of data in powershell 2 exclusively . same logic works fine in powershell 4. i've created helper function given field, alias and/or block expression can feed second function builds name/expression array can passed select -property request. worked fine in powershell 4 i'm working in mixed environment , when tried use on powershell 2 server script failed returning datatype conversion error. cannot convert system.management.automation.psobject 1 of following types {system.string, system.management.automation.scriptblock}. + categoryinfo : invalidargument: (:) [select-object], notsupportedexception + fullyqualifiederrorid : dictionarykeyunknowntype,microsoft.powershell.commands.selectobjectco mmand + pscomputername : #### i have rebuild array in calling function because explicit conversion array raises same exception. if ($psversiontable["psversion"].major -eq 2) { #write-host "...

php - Laravel delete original image and retina version -

i'm trying make retina ready design, when upload image it's uploading 1 original name , low quality , 1 high quality added @2x end of name. question how delete both of them have original name extension? here tried: $destination_path = public_path() . 'storage/cover_photos/'; $old_cover = $destination_path . $this->cover_name; $old_cover_retina = $destination_path . $old_cover->getclientoriginalname() . '@2x' . $this->old_cover->getclientoriginalextension(); $this->cover_name returns name of image in string "name.jpg". i'm getting error: call member function getclientoriginalname() on non-object am need convert $old_cover object or there way? you can use pathinfo() details particular file, including filename , extension. should able this: $fileinfo = pathinfo($destination_path . $this->cover_name); $old_cover_retina = $destination_path . $fileinfo['filename'] . '@2x' . $fileinfo['ext...

opengl - Underlying implementation of normalize() and length() in GLSL -

what underlying implementation of normalize() , length() in glsl? trying gauge performance of code , know instructions being executed built in functions in glsl. can more information on underlying implementation of other built in functions? the opengl shading language spec doesn't require particular implementation of functions, long give results specifies. in glsl 4.5, example, see correctness requirements on page 84, , functions length() , normalize() on page 150. moreover, glsl doesn't define binary format compiled shader code; format accordingly implementation dependent. however, in general, presume length function implemented using dot product , square root, , normalize function implemented calling length function , doing 3 divisions, or 1 division , vector multiplication.

spring-cloud random port not registered to Eureka -

i'm trying microservices come on random ports. if specify server.port: 0 in service bootstrap.yml suggested in spring cloud app doesn't register correct port eureka following npe: 2015-04-14 16:24:34,357 info com.fisc.restmocker.application: 47 - starting application on jsr-iaas-20 pid 4820 (c:\iaas2.0\git\fii-restmocker\build\classes\main started jsr in c:\iaas2.0\git\fii-restmocker) 2015-04-14 16:24:34,482 info ation.annotationconfigapplicationcontext: 510 - refreshing org.springframework.context.annotation.annotationconfigapplicationcontext@4fb61f4a: startup date [tue apr 14 16:24:34 edt 2015]; root of context hierarchy 2015-04-14 16:24:34,748 info ion.autowiredannotationbeanpostprocessor: 153 - jsr-330 'javax.inject.inject' annotation found , supported autowiring 2015-04-14 16:24:35,217 warn ix.config.sources.urlconfigurationsource: 120 - no urls polled dynamic configuration sources. 2015-04-14 16:24:35,560 info ontext.supp...

xcode - Is there an equivalent concept in iOS development to an Android product flavor? -

we utilize product flavors in android keep same code under source control, conditionally target endpoints dev/qa/production servers based on flavor selected. reference: http://tools.android.com/tech-docs/new-build-system/build-system-concepts for example, when want test new endpoint in "dev" environment can have file in src/dev/res/values/endpoints.xml has entry that's xml equivalent of urlbase = https://dev-endpoint.ourserver.com/v3/ , , build using "dev" product flavor build apk pointed our dev environment. is there equivalent concept ios development? yes. if select project in left bar, select project under project in inner left bar, , select info on inner top bar, see section labeled configurations. can configurations here. then select target on inner left bar , select build settings on inner top bar. search "preproc" in search box. under apple llvm - preprocessing section, can add custom preprocessor macros. configuration...

listview - Strange behaviour of observable lists -

i bound observablelist listview perform tasks on listview. type of listview , observablelist model defined in model layer.so use cell factory render graphical node model objects. should add item observablelist user enter text in textfield. problem when user enter new text , add items observablelist additional unexpectec items apear @ listview. if add items observable list manualy out of event handler, list view works correctly. think because of threading issues cant solve it. here simple example produce problem: fxmldocumentcontroller.java: public class fxmldocumentcontroller implements initializable { @fxml listview<string> list; observablelist<string> ol; @fxml textfield text; @override public void initialize(url url, resourcebundle rb) { ol = fxcollections.observablearraylist(); list.setitems(ol); list.setcellfactory((listview<string> param) -> { listcell<string> lc = new listcell<string>(){ @override ...

android - The method setActionBar(Toolbar) in the type Activity is not applicable for the arguments (Toolbar) -

this xml toolbar layout... <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mtoolbar" android:layout_width="match_parent" android:layout_height="match_parent"> </android.support.v7.widget.toolbar> i'm using support library use toolbar actionbar. did in oncreate... toolbar mtoolbar = (toolbar)getlayoutinflater().inflate(r.layout.toolbar, null); setactionbar(mtoolbar); but if gives me red squigglies , tells me message in title. i'm like, lulwut?! you need setsupportactionbar instead. using toolbar means should using appcompatactivity , , stuff lives in appcompat (~support) library. edit: answer still applies if using now-deprecated actionbaractivity , since actionbaractivity inherits setsupportactionbar method appcompactactivity .

javascript - Create Website that behaves more like a desktop application with windows and dragging of assets between the windows -

i create website front page behaves more actual desktop application windows , ability drag , drop assets 1 window next (and untop of other items on windows). this done in desktop application. how can replicate using on website? i know can jquery such this: http:// jsfiddle.net/4vfm5/1095/ resize , move image. what want make website behave more application windows. not concerned mobile applications website viewed via desktop computer. are there frameworks process? i have seen site behave way (using "div"s each window) - gather used lot of custom code make that. trying see if there packages process along? this how want webpage https://drive.google.com/file/d/0b_fn5ulpyrbovu9wzzfrdgl6tle/view?usp=sharing thank much. jack one can try ext js: http://www.sencha.com/products/extjs depending on use case may need pay them (i think if use commercial purpose). supports layout , controls similar type of design expect desktop ui framework. has drag , drop ...

Unknown SecurityExcetion from java webstart app -

we saw exception 3 different customer installs today (4/14/2015) in span of 30 minutes. java.lang.securityexception: can not verify security pack jar com.sun.deploy.util.securitybaseline.verifyjar(unknown source) com.sun.deploy.util.securitybaseline.access$200(unknown source) com.sun.deploy.util.securitybaseline$1.run(unknown source) java.lang.thread.run(unknown source) i don't think it's causing problem it's in background thread started deploy.jar (securitybaseline.java) trying verify something?? odd thing happened @ multiple customers @ same time. reason know install default uncaught exception handler log , report unhandled exceptions in app. has else seen or know means? tried reading decompiled version of source, , wasn't clear failure be. got line of exception, come 2 different paths, both of non trivial outsider. i'm inclined ignore now, i'm worried foreshadowing larger problem. i'm 100% sure it's caused https://bugs.openjd...

c - How can we shift ob_item pointer in Python tuple if it is static array? -

i reading python 2.7 source code , got stuck following piece of code, in tupleobject.h : pyobject *ob_item[1]; and in tupleobject.c ( pytuple_setitem ) : p = ((pytupleobject *)op)->ob_item + i; how can shift pointer i if ob_item array of 1 pyobject ? it's how arrays , pointers can used interchangeable. it's equivalent to p = &((pytupleobject *)op)->ob_item[i]; is array name pointer? goes little more detail.

sql server - Conversion failed when converting date and/or time from character string. UNION CTE -

i've been given view troubleshoot. begins cte gets values of surrogate key used in several tables unions between each query. uses cte inner join select data surrogate keys. query following code: with emp ( select distinct employeesk view1 union select distinct employeesk table1 union --then there 2 views if include both, overall query fails select distinct employeesk view2 union select distinct employeesk view3 ) select col1, col2, col3 table2 t2 inner join emp on t2.employeesk = emp.employeesk whenever use cte, users error: msg 241, level 16, state 1, line 22 conversion failed when converting date and/or time character string. if select each query separately returning ints. in fact, double checked each query running following query against each source: select distinct sql_variant_property(<tablesk>, 'basetype') <source table or view> all queries report columns returned int. i have created #temptable: cr...

npm browserify version of jquery-select2 version 4.x -

i wondering if : there browserif'ied version of jquery-select2 4.x plugin available via npm? if not, need in order jquery-select2 4.x work npm/browserify based project? i looking @ source on github , seems there require/almond.js version available. can same version used browserify without changes? i'm confused required if want use jquery-select2 plugin project uses npm , browserify? thanks in advance. there seems issue in select2-4.0.0 when used in node/browserify environment. until issue resolved can depend on issue creator's fork seems solved pulling in {"select2": "leftmostcat/select2"} (instead of select2/select2 ) dependency within package.json .