Posts

Showing posts from July, 2012

c# - Export / Import Files from umbraco CMS Media -

as need export media files umbraco v 4.5.2 umbraco v 6.0.5 , is there way or such package through can same. you can bulk import content using cmsimport package ( http://our.umbraco.org/projects/developer-tools/cmsimport ). if created file referenced site images import them under content node on new installation. this bit of example razor code run round media images can list them out: @using umbraco.cms.businesslogic.media; @using ucomponents.core; @using ucomponents.core.uqueryextensions; @using system @{ // set default media root node id int rootnodeid = -1; // media node , iterate children var m = new media(rootnodeid); var imagesandfolders = m.getchildmedia(); var sortedlist = m.getchildmedia().orderby(y => y.text).orderby(x => x.contenttype.alias); @{ foreach (var c in sortedlist) { var type = c.contenttype.alias; switch (type) { case "folder": ...

python - PySide: QMetaObject.connectSlotsByName emits warnings "No matching signal..." but still works..? -

in qt designer, created qdialog window , used pysideuic compile base class contains setupui method initialising gui elements , extend implement functionality, so: class mydialog(qtgui.qdialog, ui_file.ui_main_dialog): def __init__(self, parent=none): qtgui.qdialog.__init__(self, parent) ui_file.ui_main_dialog.__init__(self) self.setupui(self) this setupui method has calls qtcore.qobject.connect signal-slot connections created in qt designer, added new slots gui. these slots non-existent in base class generated pysideuic , added them mydialog class, e.g. def on_list_selection_changed(self): self.run_btn.setenabled(len(self.modules_list.selectedindexes()) > 0) for example, slot called on_list_selection_changed() (with empty parameter list) in qt designer. on initialisation, mydialog.__init__ calls ui_main_dialog.setupui , calls qtcore.qmetaobject.connectslotsbyname (the latter 2 mydialog instance's self being create...

ios - When is 'isRunningInStoreDemoMode' true? -

i looking solution present apps on trade shows. i know can install profile device undocumented com.apple.defaults.managed payload disable home button of device. nice way present app on trade shows. however, have features shouldn't activated on such shows or kind of data shouldn't stored on device during demo mode. as key enable through mobileconfig files sbstoredemoapplock thought make private +[uiapplication isrunninginstoredemomode] return yes isn't case. know under circumstances method return yes? i know private api code ment in beta distribution, isn't important. please don't comment , tell rejected apple! any appreciated! thanks! isrunninginstoredemomode i took in uikit. in function is: cfpreferencesgetappbooleanvalue("storedemomode", "com.apple.demo-settings', &value); i grep binaries , saw it's used in quite lot of places. however, didn't find code it's set. (potentially, wrong this, because sp...

Configuring Jenkins with Cloud TFS (Supports GIT) -

we trying configure cloud tfs (project created git support) & jenkins (ubuntu machine). when ever try enter repository url gives following error. failed connect repository : command "git ls-remote -h https://xyz.visualstudio.com/defaultcollection/_git/xyzrepo.git head" returned status code 128: stdout: stderr: fatal: authentication failed i have generated keys using ssh route, unfortunately can't add key @ cloud tfs repo. i have tried format https://username:password@example.visualstudio.com/defaultcollection/_git/repo_name somehow not successful. ps: bare minimum's installed (git & git plugin jenkins) any help/instructions appreciated. you need enable alternate credentials in tfs. have @ howto

internet explorer - jQuery .width() Conditional Always Triggers in IE -

i have client site switches mobile version whenever viewport size falls within specific paramaters: if($(window).width() < 800) { document.location="http://www.website.com/mobile.html"; } in various versions of ie, however, script triggers regardless of viewport width. i've tried number of different variations, , can't seem work. any appreciated. thanks, ty use following code: if($(window).outerwidth() < 800) { window.location.href = "http://www.website.com/mobile.html"; }

RegEx: text that contains any match letter in sequence -

is possible have regex search person's name. if enter 'fb' match word 'foobar'? yes can match letter in sequence using .* before words. so,in case .*f.*b .* cause lot of backtracking in case have more 2 words , if there multiple such words.you can instead use .*? match lazily , avoid backtracking

asp.net - HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] Security -

all,i have stand-alone epayment service implemented asp.net web service order management system , , using cybersource payment service, responsiblity of web service interface intergate cybersource order management system, have poor knowledge in security of payment service. , wasn't aware of important issue should care .so far, did work on .below code looks like, please review , comments. //somsip ip of order management system. string somsip = "xx.xx.xx.xx"; //get client ip string sip=httpcontext.current.request.servervariables["remote_addr"]; //make sure request order management system. otherwise invalid. if (sip.equals(somsip)) { //process payment request } else { //return fail message. } but not sure if there possibility forge ip of client. , appreciated if can give me idea or solution bui...

Is there any way to check if any or all characters are present in a string in C? -

i trying check , see if give array of characters - char array_values[] = { 'a','b','c','d','a','b','c','d' }; and running sort of character matching in multiple strings e.g.- .... str1 = 'aacdbacbaabcacddaaabd' str2 = 'aacbdaabdcaaddcbcaabc' .... and returning count of each char present in strings. i know it's done in python, r, perl, wanted figure out in c. maybe regular expression? ideas? the easiest way in c count each character regardless of presence in array_values , use array_values items indexes array of counts results: int count[256]; (int = 0 ; != 256 ; count[i++] = 0); // example works single string. multiple strings, // iterate on strings source in loop, assigning str // , incrementing counts each of strings. char *str = "aacdbacbaabcacddaaabd"; (char *p = str ; *p ; count[(unsigned char)*p++]++); char array_values[] = { 'a','b','c...

ios - UIView Subclassing and OOP -

i have app model array of menu objects containing information such title, images, method etc. i create scroll view list of menu views, maybe picture, title , short description each menu. to this, subclass uiview , create menuview instance each menu. my question how should communicate model view. far can see can either: alloc , init menu item , layout sub views (means view sees model) alloc , init title, image , description (means view doesn't see model doesn't seem offer advantage) use delegation view asks information data source (seems segregated complicated) any advice? it sounds tableview best choice. subclass uitableviewcell , add objects can take advantage of tableview behavior make life easier. uitableview a quick ios uitableview example

android - multiple markers at this line in Eclipse -

eclipse shows me: multiple markers @ line line: public void sendconnection(view view) if can me, thank much btr = (button)findviewbyid(r.id.connection); btr.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { edittext text = (edittext)findviewbyid(r.id.passwordedit); string str = text.gettext().tostring(); if(str.equals("1234")) { public void sendconnection(view view) { intent intent = new intent(this, addmasternumber.class); startactivity(intent); } } else { alertdialog alertdialog = new alertdialog.builder(mainactivity.this).create(); alertdialog.settitle("wrong password"); alertdialog.seticon(r.drawable.wrongpassword); ...

c++ - Static code generation using the LLVM API -

starting llvm module *mod containing ir: how use specific back-end generate target-specific assembler it? unfortunately kaleidoscope tutorial not detail on this. uses execution engine jit compile program (on build, target architecture), not select specific back-end generate target-specific assembler. neither llvm tutorials, not detailing on building static compiler, assume. thus, question can provide missing piece of information. since want build static compiler, don't want use command line tools llc , etc. accomplish job. want use llvm api. to make more concrete, let's start code: llvmcontext &context = getglobalcontext(); smdiagnostic err; module *mod = parseirfile(argv[1], err, context); the filename (given 1st argument) parsed ir. let's skip optimization passes , create assembler specific back-end, e.g. ptx backend (available since version 3.2). just in source code of tools/llc/llc.cpp . that, , it's pretty short , not hard understand. if h...

I need to fetch the co-ordinates of word from a multiline textbox in silverlight -

i have spent entire day implementent functionality getrectfromcharacterindex() no success. microsoft has not implemented silveright 4. i need fetch co-ordinates (start & end) of word of multiline text box in silverlight 4. should noted textbox wrappable. not able find since new line , wrapped lines 2 different thing. unable to find end of line wrapped line. is possible fetch exact co-ordinates (it not index of char in string/textbox) of word in multiline textbox? thanks in advance. regards sudhir kumar turns out getrectfromcharacterindex wasn't implemented in sl5 either. the way can implement manually. see example how can done, can @ this answer . careful, though, since calculating such thing performance killer.

ruby - If...Then... syntax issues -

i'm trying write app calculates sick/vacation days , how employee has available in either category. in employee model, vacation_days value determined hire-on date, , sick_days same employees, , separate "pools." latest roadblock trying determine how have time-off being subtracted appropriate pool. here's employee model: class employee < activerecord::base def remaining_vacation_days vacation_days - vacation_days_used end def remaining_sick_days sick_days - sick_days_used end def vacation_days_used if furlough.description == "vacation" furlough.duration end end def sick_days_used if furlough.description == "sick" furlough.duration end end there's string column named :description in model handles date ranges (named furlough ), , form radio-button 2 options 'sick' , 'vacation' . however, i'm having issues getting syntax right in employee model: syntaxer...

sql server - Audit table woes -

i trying make audit table records pretty in system. going use triggers, want record things searches, etc , want record action-er (the user performed action). so, because there many different objects in application need recording (profiles, companies, pages, etc) needed create table hold information different objects. i using mssql perhaps should have looked @ document database not sure whether using sql database data , document database audits idea....maybe has experience this? anyway, table looks this: create table [dbo].[cg_audittrail]( [id] [int] identity(1,1) not null, [companyid] [uniqueidentifier] not null, [userid] [uniqueidentifier] not null, [username] [nvarchar](255) not null, [objectname] [nvarchar](100) not null, [eventid] [int] not null, [data] [xml] not null, [date] [datetime] not null, constraint [pk_cg_audittrail] primary key clustered ( [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = of...

vb.net - Access single file in multiple threads -

i trying write trace(text file) application having multiple threads. want know whether possible or not. application written in vb.net. any appreciated! tia! you can't write same file @ same time file locked, encounter version problems anyway. what better doing creating single sub deals update of file , queue tasks update it. although without more information on wanting accomplish difficult tell. why wanting use approach? there may better way of going it.

Explain the concept of event handlers in relation to JavaScript and discuss how the use of the onload event can allow them to be used effectively -

well folks , i have question , answer // event handlers ways of recording events , acting accordingly. event in context occurrance on webpage. ie. user clicks , page loads, mouse moves on part of page. if of these events happen , code in page interpret , 'do something' event triggered. javascript interpreter language 'decides' if event triggered. onload event occurs when page loads. can put onload() in opening body tag , run javascripts when page loads. examples include working google maps. when page loads can specify run js code such show markers. function can triggered page loads. // is there add or take away answer , respond question correctly. past exam paper ....

c# - Why doesn't this thread ever end? -

i'm trying control piece of test equipment , need sequencing correct of how communicate it. first call startgettingtracedata() . time in future call stopgettingtracedata() attempt end gettracedata() function instead of re-launching itself. never happens. in fact, never line donetraces.set() on line bool timedout = !donetraces.waitone(10000) , timedout true; private static autoresetevent donetraces = new autoresetevent(false); private void gettracedata() { byte[] receivedbytes = new byte[1]; if (connection.readdata(receivedbytes) && receivedbytes[0] == 192) processincomingtrace(); thread.sleep(100); if (runtracequeryworker) new thread(gettracedata).start(); else { thread.sleep(200); donetraces.set(); } } private void startgettingtracedata() { runtracequeryworker = true; new thread(gettracedata).start(); } private bool stopgettingtracedata() { runtracequeryworker = false; bool timedou...

sql server - SQL Update subquery returns no results run different sub query -

i trying update , i'm having problems (using microsoft sql server) update mytable set myvalue= ( (select myvalue someothertable someothertable.id=mytable.id) ) table mytable mytable.custname='test' basically subquery return no results if happen want call different subquery: (select myvalue oldtable oldtable.id=mytable.id) well, run second query first, , then, first query. in way, override values when first query can bring them, , when (original) first query won't bring result, have result of first query. also, think have typo in second query table name. update mytable set myvalue= ( select myvalue oldtable oldtable.id=mytable.id ) table mytable mytable.custname='test' , exists (select 1 oldtable oldtable.id=mytable.id) update mytable set myvalue= ( select myvalue someothertable someothertable.id=mytable.id ) table mytable mytable.custname...

javascript - Pulling value from rows, using Ajax and PHP -

i created small script, have learned ajax + javascript far. running in chrome btw, xmlhttprequest(); should working php, $conn = new pdo('mysql:host=localhost; dbname=test', 'root', '') $stmt = $conn->query("select text ajax"); foreach($stmt $each){ ?> ajax, <script type='text/javascript'> var request = new xmlhttprequest(); request.open('get', <?php echo $each['text']; ?>, false); request.send(); console.log(request); </script> <?php } ?> now, in database test tbl name ajax have rows id & text , in text has 3 filled-in rows, ajax code not showing me anything. not echoing @ all, let alone update instantly, when adding texts in rows. doing wrong? out.php <?php $conn = new pdo('mysql:host=localhost; dbname=test', 'root', '') $stmt = $conn->query("select text ajax"); echo json_...

H2 Database Cluster Recovery -

i have got springmvc application runs on apache tomcat , uses h2 database. infrastructure contains 2 application servers (lets name them & b) running own tomcat servers. have h2 database clustering in place. on 1 system (a) ran following command java org.h2.tools.server -tcp -tcpport 9101 -tcpallowothers -basedir server1 on other (b) ran java org.h2.tools.server -tcp -tcpport 9101 -tcpallowothers -basedir server2 i started cluster in machine a java org.h2.tools.createcluster -urlsource jdbc:h2:tcp://ipaddrofa:9101/~/test -urltarget jdbc:h2:tcp://ipaddrofb:9101/~/test -user sa -serverlist ipaddrofa:9101,ipaddrofb:9101 when 1 of server down, has been mentioned that, 1 has delete database failed, restart server , rerun createcluster. i have following questions ? if both servers down, how can ascertain, database delete can restart server , rerun cluster ? createcluster contains urlsource , urltarget. need specific give them same value given or can interchange th...

How to generate a compounded view of data over time in Oracle SQL -

say have base number 10 , table has value of 20 associated november 2013, , value of 10 associated march 2014. want populate list of months, , compounded value. may-november 2013, value should 10, between nov , mar, value should 10+20 , afterwards should 10+20+10. so in table have following month value nov-2013 20 mar-2014 10 i'd have select statement somehow returns. there's initial value of 10, hard-coded base. month value may-2013 10 jun-2013 10 jul-2013 10 aug-2013 10 sep-2013 10 oct-2013 10 nov-2013 30 dec-2013 30 jan-2014 30 feb-2014 30 mar-2014 40 is doable? in case understand requirements correctly, sql fiddle oracle 11g r2 schema setup : create table months ("mon" date, "value" int) ; insert months ("mon", "value") values (date '2013-11-01', 20) months ("mon", "value") values (date '2014-03-01', 10) select * dual ...

javascript - Dirty checking with shared service between controllers, One way works the other does not? -

while attempting answer question regarding sharing data between 2 separate controllers ran question . i use services for task , began create jsfiddle, not work. after bit of debugging if created properties dynamically in setactivepersonworks(person) dirty checking worked , second controller showed correct value. if assigned value in setactivepersondoesnotwork() did not. if used $timeout() able verify dataservice.badperson did indeed contain correct data. am doing wrong? guess if $apply() work correctly, why creating values dynamically cause things work? working example: var mytest = angular.module("mytest", []); mytest.factory("dataservice", function () { var people = { goodperson: {}, badperson: {}, setactivepersonworks: function (person) { people.goodperson.name = person.name; people.goodperson.id = person.id; }, setactivepersondoesnotwork: function (person) { ...

php - Sorting MySQL query by Latitude/Longitude -

every user in database has latitude , longitude stored in 2 fields (lat, lon) the format of each field is: lon | -1.403976 lat | 53.428691 if user searches other users within, 100 miles, perform following in order calculate appropriate lat/lon range ($lat , $lon current users values) $r = 3960; // earth's mean radius $rad = '100'; // first-cut bounding box (in degrees) $maxlat = $lat + rad2deg($rad/$r); $minlat = $lat - rad2deg($rad/$r); // compensate degrees longitude getting smaller increasing latitude $maxlon = $lon + rad2deg($rad/$r/cos(deg2rad($lat))); $minlon = $lon - rad2deg($rad/$r/cos(deg2rad($lat))); $maxlat=number_format((float)$maxlat, 6, '.', ''); $minlat=number_format((float)$minlat, 6, '.', ''); $maxlon=number_format((float)$maxlon, 6, '.', ''); $minlon=number_format((float)$minlon, 6, '.', ''); i can perform query such as: $query = "select * table lon between '$minlon...

java - extract *HQL* in Hibernate -

is there way extract hql hibernate criteria or get or load query? have seen ways extrac sql query such objects not hql. criteria goes directly sql, there no direct public api programmatically in hql.

jquery dynamic validation rule ignoring message -

using jquery validation plugin, have composed following, find default validation message displayed rather custom message (i have used constant in other validations, know works!). missing? $("#pageform").validate(); $("input[id^=displayname]").each(function() { $(this).rules("add", { maxlength: aghostmobileadmin_validation.constants.displaynamemaxlength, messages: { maxlength: aghostmobileadmin_validation.format.displayname } }); }); $("input[id^=navigationlabel]").each(function() { $(this).rules("add", { maxlength: aghostmobileadmin_validation.constants.navigationlabelmaxlength, messages: { maxlength: aghostmobileadmin_validation.format.navigationlabel } }); }); try this.. messages: { maxlength: aghostmobileadmin_validation.format.navigationlabel } to messages: { maxlength: aghostmobileadmin_valida...

java - AWT Robot not able to drag a window -

i'm trying move windows explorer window using awt robot. robot running in java 7, , os windows 7. i'm able move mouse , click on things, when try click-and-drag, doesn't seem pressing button @ all. can't see what's wrong, or think of how figure out what's happening. i started out using sikuli: mouse.mousedown(inputevent.button1_mask); mouse.drop(targetlocation); when didn't work, tried lower-level implementation, working robot directly: robot robot = new robot(); robot.mousepress(inputevent.button1_mask); robot.mousemove(targetlocation.getx(), targetlocation.gety()); robot.mouserelease(inputevent.button1_mask); the mouse starts in correct place , moves correct destination, doesn't seem press button. in sikuli use mouse.drag() mouse.drop(). example: screenregion fullscreenregion=new screenregion(); imagetarget dragimagetarget=new imagetarget("dragtargetfile"); screenregion dragtargetregion=fullscreenregion.find(dragi...

CUDA - can't compile .cu files because of "gcc: error trying to exec 'cc1plus': execvp" error -

i'm trying compile simple .cu file cuda 5 , gcc 4.7.3 on ubuntu 13.0 i'm getting gcc: error trying exec 'cc1plus': execvp: no such file or directory how can fix this? you not have valid c++ compiler installed. install g++ , problem go away - nvcc requires working, supported c++ host compiler compile both device , host code.

java - How to exclude test dependencies from a shaded maven jar? -

i'm using maven-shade-plugin , i'd exclude not test code, test dependencies in shaded jar. realize can exclude artifacts (like junit), that's bit of work , prone error likely. i'm setting minimizejar true, still see junit , mockito dependencies showing up. there no way exclude test scoped dependencies via configuration? make sure test dependencies in test scope: <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.11</version> <scope>test</scope> </dependency> ... to check if dependency setup use mvn dependency:tree

php - Making multiple selections and storing them -

since explaining problem/question pretty difficult, explain steps user have take in order more clear. 1) user shown list songs/movies/. information gathered means of api key. 2) out of list, user can select multiple items. 3) every item has unique "cdbid" needs stored in database user id. i have tried lot of things have gotten nowhere, php code i'm using ul: <?php if($events) { echo "<form class='eventlist' data-role='listview'>"; foreach ($events $eventkey => $event) { echo "<input class='evenementen' type='checkbox' value='".$event->cdbid."' style='background-image:url(".$event->thumbnail.")'>".$event->title."</input>"; } echo "</form>"; } ?> i have been racking brain on issue days now. welcome!

android - ListView pinch-to-zoom possible? -

i'm trying implement pinch-to-zoom on listview contains small pieces of code. however, can't seem work. suspect may not possible implement multitouch zoom on listview. have used implementation: http://www.allappsdevelopers.com/topicdetail.aspx?topicid=c16ed3b4-b422-43ba-b595-ee8e21dd1854 my target android 2.2+. have example of pinch-to-zoom zoom in , out on text? or not possible on listview? i include code, it's similar in above example. thanks. use this code implementing pinch-to-zoom on custom view. and make sure listview responds events , not pinch gesture, override ontouchevent() in following way let scalegesturedetector detect/handle events. @override public boolean ontouchevent(motionevent e) { myscaledetector.ontouchevent(e); return super.ontouchevent(e); }

linux - Spoofing a TCP Server handshake failing -

i looking build simple server proxy tcp connections @ gateway of network (none malicious intent) tcp handshake failing. using netfilter, have managed change ip , port of incoming tcp packets diverted application , change them original on way out updating checksums. my server sending syn-ack, gets intended host ack never generated. according wireshark packet formed no problems checksum, syn , ack values seem match up. here tcp dump output successful handshake without proxy 16:21:08.887938 ip 192.168.1.1.37513 > 192.168.2.56.12105: flags [s], seq 4201716329, win 14000, options [mss 1400,sackok,ts val 727682 ecr 0,nop,wscale 2], length 0 16:21:08.889870 ip 192.168.2.56.12105 > 192.168.1.1.37513: flags [s.], seq 34328406, ack 4201716330, win 14480, options [mss 1460,sackok,ts val 1879286956 ecr 727682,nop,wscale 5], length 0 16:21:08.891751 ip 192.168.1.1.37513 > 192.168.2.56.12105: flags [.], ack 1, win 3500, options [nop,nop,ts val 727683 ecr 1879286956], leng...

jquery - Font size based on device width -

how should set font size based on device width mobile site renders fine on width devices. using jquery mobile. take care of this. viewport. writeup david storey: https://css-tricks.com/viewport-sized-typography/ ex: #box{ background-color:black; width: 100vh; } h1.rad { text-align: center; vertical-align: middle; color: #999; font-family: "helvetica neue"; font-size: 3.14159vw; line-height: 6.66vh; font-weight: 100; text-transform: uppercase; } <div id="box"> <h1 class="rad"> viewport sizing.<br>so rad. </h1> </div>

SAS - Execute Find and Replace in an Excel File via DDE -

i trying write sas program find , replace in excel file via dde. specifically, trying search header row spaces between strings (i.e., " ") , replace them no spaces (i.e., ""). for example, if have cell contains "test name" want find , replace make "testname". this have: options noxwait noxsync; /* open excel */ x '"c:\program files (x86)\microsoft office\office14\excel.exe"'; filename cmds dde 'excel|system'; data _null_; x=sleep(5); run; /* open file , manipulate*/ data _null_; file cmds; put '[open("c:\filename.xls")]'; put '[select("r1")]'; put '[formula.replace(" ","",1,,false,false)]'; run; /*close file*/ data _null_; file cmds; put '[file-close("c:\filename.xls")]'; put '[quit()]'; run; the find , replace function not working. following in log after reads statement: note: fi...

jquery - s6 slideshow internal links not working -

internal links not working in s6 slideshow i'm trying add navigational links - ie links between slideshow pages. works fine in eric meyer's s5 doesn't work in jquery supported s6 format. correct href appears in browser address box after clicking link. make work have click refresh. link example: <a href="#5">click here slide 5</a> something (some jquery?) stopping default behaviour of link. have searched scripts (mainly jquery.slideshow.js) "return false" , found 1 - add behaviour of clicking on titles of slides advance slide. tried changing "return false" "return true" (a guess) didn't work. searched "preventdefault" there weren't any. does know links being disabled in s6 scripts? i sure add script refresh whole thing. tried location.reload(false) insists on reloading server defies point of having pages locally cached. , anyway, trying know jquery , getting me can't find out why these...

Perl Autovivication Use case -

i came across piece of code (modified excerpt): $respmap; $respidarray; foreach $respid (@$somelist) { push(@$respidarray, $respid); } $respmap->{'ids'} = $respidarray; return $respmap; is there reason use autovivication in case? why not do $respmap; @respidarray; foreach $respid (@$somelist) { push(@respidarray, $respid); } $respmap->{'ids'} = \@respidarray; return $respmap; follow up: give me use case of autovivication? either way correct; first 1 using array reference $respidarray , , second plain array @respidarray . you'll need array references when building complex data structures (check perldoc perlreftut ), other it's 1 you'll choose. note in both cases you're assigning array reference $respmap->{'ids'} , examples pretty similar. and btw, autovivification thing , has dynamic creation of data structures.

iOS. Cannot run a project after updating cocos2d library inside this project -

it cannot compile sources , writes: undefined symbols architecture i386: "_ctfontmanagerregisterfontsforurl", referenced from: -[cclabelttf getfontname:] in cclabelttf.o ld: symbol(s) not found architecture i386 clang: error: linker command failed exit code 1 (use -v see invocation) but when replace code in following function in cclabelttf "return nil": - (nsstring*) getfontname:(nsstring*)fontname { // custom .ttf file ? if ([[fontname lowercasestring] hassuffix:@".ttf"]) { // file, register font font manager nsstring* fontfile = [[ccfileutils sharedfileutils] fullpathforfilename:fontname]; nsurl* fonturl = [nsurl fileurlwithpath:fontfile]; ctfontmanagerregisterfontsforurl((cfurlref)fonturl, kctfontmanagerscopeprocess, null); return [[fontfile lastpathcomponent] stringbydeletingpathextension]; } return fontname; } then can compile code cannot use labels. so how so...

github - Can you determine the git version of a file copied from a repo? -

i inherited xcode project uses code cocoaasyncsocket project (available on github). files (asyncsocket.m/h) copied xcode project have no git history. i need find version of files have. there way can compare files (assuming haven't been edited) repo's history see commit have? first compute hash of file using git hash-object . can use git ls-tree list hashes of each commit in question. i use this: file=asyncsocket.m hash=$(git hash-object $file) in $(git rev-list head -- $file); git ls-tree $i|grep -q $hash && echo $i done|xargs -l git log -1 --oneline --decorate

excel - CountIf and Subtotal -

i have series of data columnar wanting use countif visible cells have value 1. can either formula no problem, countif, or subtotal visible cells, when try combin them lost. here example of formula segments. =countif(i5:i6500,1) =subtotal(3,i5:i6000) how combine 2 formulas have single formula counts instances of number 1 in column while not counting hidden cells due filtering??? desert spider, worked me: =sumproduct(--(i5:i6000=(c12)),subtotal(3,offset(i5,row(i5:i6000)-row(i5),0))) or (the above uses cell value determine query, below uses user input (x)) =sumproduct(--(i5:i6000="x"),subtotal(3,offset(i5,row(i5:i6000)-row(i5),0))) credit to: pgc01 http://www.mrexcel.com/forum/excel-questions/600223-subtotal-countif.html#post2971937

c++ - How to cast QTableWidgetItem to custom child class -

i'm trying cast qtablewidgetitem child class. have class hierarchy this: (parent -> child) qtablewidgetitem -> sortabletablewidgetitem -> enhancedtablewidgetitem or class sortabletablewidgetitem : public qtablewidgetitem class enhancedtablewidgetitem : public sortabletablewidgetitem for part, use items qtablewidgetitem s because code written , shouldn't change. in instances need access data in enhancedtablewidgetitem after being given pointer qtablewidgetitem (which know enhancedtablewidgetitem because constructed object , passed calling code initially). have tried casting this: qtablewidgetitem item = getitem(); // fails compile saying "error: no matching function call ‘qobject_cast(qtablewidgetitem*)’" enhancedtablewidgetitem *eitem = qobject_cast<enhancedtablewidgetitem*>( item ); // fails compile , says: "error: invalid conversion ‘qtablewidgetitem*’ ‘enhancedtablewidgetitem*’" enhancedtablewidgetitem *eitem = dyna...

sql - LDAP SQLite communication or link -

i have openldap server , running locally, have c api connects , queries it, have sqlite database setup using odb orm unlike hibernate in java. now, supposed pull data ldap server, , insert sqlite server. have tried stuff found online, nothing worked. totally new this. appreciated this code using query ldap server. need put data here sqlite database through object. dont have idea how that. rc = ldap_search_ext_s( ld, basedn, scope, filter, null, 0,null, null, null, 0, &result ); if ( rc != ldap_success ) { fprintf(stderr, "ldap_search_ext_s: %s\n", ldap_err2string(rc)); return -1; } (e=ldap_first_entry(ld, result); e!=null; e=ldap_next_entry(ld, e)){ if ((dn=ldap_get_dn( ld, e )) != null){ printf("dn: %s\n", dn); ldap_memfree(dn); } } ldap_msgfree(result);

python - SIGSEGV: Segmentation Fault in JCC Library Code -

i'm using jcc python-java bridge , part works. however, i'm getting following error: jre version: 7.0_17-b02 java vm: java hotspot(tm) client vm (23.7-b01 mixed mode linux-x86 ) problematic frame: c [_ciasliveschema.so+0x21e75c] boxjobject(_typeobject*, _object*, java::lang::object*)+0x22c the stack dump follows: stack: [0xbfbe5000,0xbfc35000], sp=0xbfc33820, free space=314k native frames: (j=compiled java code, j=interpreted, vv=vm code, c=native code) c [_ciasliveschema.so+0x21e75c] boxjobject(_typeobject*, _object*, java::lang::object*)+0x22c c [_ciasliveschema.so+0x221977] boxobject(_typeobject*, _object*, java::lang::object*)+0x27 c [_ciasliveschema.so+0x225149] _parseargs(_object* , unsigned int, char , ...)+0x2f69 c [_ciasliveschema.so+0x17e21c] schema::util::t_individualcaster_asmessage (schema::util::t_individualcaster*, _object*)+0xac c [python+0x8bda4] pyeval_evalframeex+0x6494 ...

PHP/CSS button style with post queries -

i newbie php/css. have coded default.css button style , php page many processing buttons. button style looks great on button url link. see code snippet below: <form name="form" method="post"> <p class="button-style"><a href="importcsv.php">import sightings csv</a></p> &nbsp;&nbsp; <p class="button-style"><a href="logbookentry.html">enter new sightings</a></p> <br> <p class="button-style"><a href="logbookentry.php">view pre-logged sightings</a></p> <br> however, when use same button style run sql query button, style not uniform. see link http://conchslist.com/ziktest/logprocess.php <p class="button-style"><input type="submit" name="button5" value="run makes 1" /></p> &nbsp;&nbsp; <p class="button-style"><input type=...

list - infix notation sometimes doesn't work in scala, why is that? -

alright, making tests familiar scala, , wanted see if make lists java style rather fancy way you'd in scala... i know can this: val lst = list.range(0, 100, 1) wanted see java style in scala alright here's did: var lst = list[int]() for(i <- 0 until 100) { lst = lst :: // here's complains } for reason scala, or @ least scala ide eclipse doesn't append using infix notation, a-la lst :: i wants me this: lst.::(i) otherwise says :: isn't defined or something, it's not first time it's happened either... so can here explain why that, or case of bad implementation in eclipse , have live with in scala, list of immutable length. can work lifo (last in, first out) structure, cannot behave java arraylist . you doing this: val lst = list[int]() which gives lst size of 0 . means can't it. for mutable collection, use listbuffer . also, :: operator right associative, means called on object found on right side of operato...

serialization - Clojure: Store and Compile Large Derived Data Structure -

i have large data structure, tree, takes 2gb in ram. includes clojure sets in leaves, , refs branches. tree built reading , parsing large flat file , inserting rows tree. takes 30 seconds. there way can build tree once, emit clj file, , compile tree standalone jar can lookup values in tree without re-reading large text file? think trim out 30 second tree build, me deploy standalone jar without needing text file come along ride. my first swing @ failed: (def x (ref {:zebra (ref #{1 2 3 4})})) #<ref@6781a7dc: {:zebra #<ref@709c4f85: #{1 2 3 4}>}> (def y #<ref@6781a7dc: {:zebra #<ref@709c4f85: #{1 2 3 4}>}>) runtimeexception unreadable form clojure.lang.util.runtimeexception (util.java:219) embedding data big in compiled code may not possible because of size limits imposed upon jvm. in particular, no single method may exceed 64 kib in length. embedding data in way describe further below necessitates including tons of stuff in class file it...

javascript - ng-repeat bind collection filtered by a boolean using tabs, when I update the collection the filter doesn't re-apply -

i have ng-repeat displays collection filtered boolean using tabs (favourite item), when update collection filter doesn't re-apply. have: all items | favourites item 1 item 2 item 3 when first load (using json) collection server, tabs work fine , filters collection. when click in item, update favourite property of item, filter doesn't updates , if click in tabs seems data doesn't updated. code: html: <button class="btn" ng-model="section" value="all-items" ng-click="filtercriteria={}; activate('all-items')" ng-class="{disabled: products.length == 0, active: section == 'all-items'}">all items ({{products.length}})</button> <button class="btn" ng-model="section" value="favourites" ng-click="activate('favourites'); filtercriteria.favourite = true;" ng-class="{disabled: (products | filter: {favourite:true}).length < 0, ac...

android - How to retrieve references of views which are defined programatically -

ideally 1 can retrieve view reference(in xml file) through findviewbyid method. have class have instantiated views public view initialise(context context){ private button mboardbuttons[][] = new button[gridsize][gridsize]; private tablerow rowarr[] = new tablerow[gridsize]; private textview minfotextview; private textview mplayer; private textview mplayercount; tablelayout tablelayout1 = new tablelayout(context); tablelayout.layoutparams tableparams1 = new tablelayout.layoutparams(layoutparams.wrap_content, layoutparams.wrap_content); tableparams1.topmargin = 0; tablelayout1.setlayoutparams(tableparams1); ( int =0 ; < gridsize ; i++){ rowarr[i] = new tablerow(context); tablerow.layoutparams rowparams = new tablerow.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content); rowparams.gravity=gravity.center_horizontal; rowarr[i].setlayoutparams(ro...

Android how to open image and display it in second activity -

i working on app editing photos i have button in first activity , imageview in second activity. when click button open gallery , able select image. selected image needs appear in imageview in second activity doesn't. down below code not working,have idea wrong? first activity: package com.example.odabirslike; import android.net.uri; import android.os.bundle; import android.provider.mediastore; import android.app.activity; import android.content.intent; import android.database.cursor; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.view.menu; import android.view.view; import android.widget.button; import android.widget.imageview; public class pocetni extends activity { private button buttonloadimage; private static final int select_picture = 1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_pocetni); ...

javascript - jQuery ajax doesn't send array -

i'm trying send data in array via ajax save database, build array way: $( "#saveordering" ).button().click(function( event ) { event.preventdefault(); var data = document.getelementbyid('tabs'); var categories = data.getelementsbytagname("div"); var categoryarray = new array(); (var i=0; < categories.length; i++) { //loop door de categoriëen var category = categories[i]; var categoryid = category.getattribute('id'); categoryarray[i] = new array(); categoryarray[i]['id'] = categoryid; categoryarray[i]['forums'] = new array(); var forums = category.getelementsbytagname("li"); (var j=0; j < forums.length; j++) { //loop door de forums var forum = forums[j]; var forumid = forum.getattribute('id...

Automate refresh of large MySQL table on shared hosting (avoid max_allowed_packet error) -

i need regularly replace large mysql table on website. wrote php script this.... export table local server .sql file (contains create table , inserts) zip ftp remote host and on remote host run script .... unzip it import table mysql database i.e. import table run ... . . . $querystg = file_get_contents($sqlfilename); $sqlquery = mysqli_multi_query($mysqlilink, $querystg); . . . but error message ... got packet bigger 'max_allowed_packet' bytes i'm on shared hosting (godaddy) cant fiddle things my.cfg or run mysql commands ssh is there way round this. e.g. there command splits import smaller batches or there better way this?

jsf 2 - After showing / hiding a JSF element with AJAX how to hide the triggering element? -

i followed intructions given balusc in [this answer][1] [1]: jsf , f:ajax hiding/showing div , worked. want hide element when command button pressed , element id="incorrectquestion" shown. did in example. have tried lot of combinations couldn't hide command button. <h:panelgroup rendered="#{not answerresultbean.showincorrectquestions}"> <div id="logindiv" style="width: 400px; text-align: left;"> <center> <f:ajax render="incorrectquestions"> <br /> <h:commandbutton value="#{strings.failedquestions}" action="#{answerresultbean.setshowincorrectquestions(true)}" /> <br /> <br /> </f:ajax> </center...

java - ClassNotFoundException: com.google.gwt.junit.server.JUnitHostImpl -

how rid of error: java.lang.classnotfoundexception: com.google.gwt.junit.server.junithostimpl [error] @ java.net.urlclassloader$1.run(urlclassloader.java:359) [error] @ java.net.urlclassloader$1.run(urlclassloader.java:348) [error] @ java.security.accesscontroller.doprivileged(native method) [error] @ java.net.urlclassloader.findclass(urlclassloader.java:347) [error] @ java.lang.classloader.loadclass(classloader.java:423) [error] @ com.google.appengine.tools.development.isolatedappclassloader.loadclass(isolatedappclassloader.java:213) i've tried: mvn clean eclipse project clean but still error there. i removed: <inherits name='com.google.gwt.junit.junit'/> from *.gwt.xml and <servlet> <servlet-name>junithostimpl</servlet-name> <servlet-class>com.google.gwt.junit.server.junithostimpl</servlet-class> </servlet> <servlet-mapping> <servlet-name>junithostimpl...

jQuery ajax() URL is required? -

the ajax function's header is: jquery.ajax( url [, settings ] ) with documentation saying url required, why in examples 'settings' supplied? $.ajax({ type: "get", url: "test.js", datatype: "script" }); right below that, you'll see other syntax $.ajax , settings object passed, including url.

asp.net mvc 4 - Shows only the last marker info window even though there are 154 others -

so managed markers , info windows workin using razor , google maps api doing following: @{ ienumerable<ufa.location.core.location> location = ufalocation___front.helpers.queryhelper.queryhelper.getalllocations(); foreach(var loc in location){ <text> var contentstring_@loc.id = "@loc.name"; mapmarker_@loc.id = new google.maps.marker({ position: new google.maps.latlng(@loc.latitude, @loc.longitude), map: map, title: "hello world!" }); var infowindow = new google.maps.infowindow({ content: contentstring_@loc.id }); google.maps.event.addlistener(mapmarker_@loc.id, 'click', function() { infowindow.open(map, mapmarker_@loc.id); }); ...

asp.net - How to serialize complex objects and put them in a ViewState? -

i have object of type list<spsection> , spsection custom class contains string , list<splistitem> , splistitem sharepoint object representing item. i want store in viewstate , don't know how this. there way serialize or convert binary string, put in viewstate . when getting value viewstate , how can convert list<spsection> . thanks don't this. splistitem instances cannot retained between requests . depend on respective splist instance, in turn depends on spweb + spsite , both instantiated automatically , provided through spcontext . what can retain item id s between requests. custom classes need binary serializable, i.e. marked [serializable] interface. store object under given key view state: viewstate["myobjects"] = myobjects; .