Posts

Showing posts from April, 2012

c# - Hint algorithm problems in a Bejeweled clone -

i've got slight issue hint algorithm bejeweled clone. right now, following code produces 'hint' @ top left of board every time hit h key (the key showing hint). public bool aretheremoves(gem[,] gem2) { hintgems.clear(); return (aretheremovesdown(gem2) && aretheremovesright(gem2)); } public bool aretheremovesright(gem[,] gem2) { hintgems.clear(); (int x = 0; x < gem2.getlength(0) - 1; x++) { (int y = 0; y < gem2.getlength(1); y++) { gem[,] gems3 = new gem[gem2.getlength(0), gem2.getlength(1)]; array.copy(gem2, gems3, gem2.length); swapgemscheck(x, y, x + 1, y, ref gems3); if (checkmatches(gems3, 2) || aretherespecialgems(gems3)) { hintgems.add(gems3[x, y]); return true; } } } return false; } public bool aretheremovesdown(gem[,] gem2) { hintgems.clear(); (int y = 0; y < gem2.getlength(1) - 1;

ios - Why are my UITextFields Null after presenting the camera (or image picker) -

i have number of uitext fields returning null after camera or image picker has been presented. how retain text in these text fields? use flow user inputs text text fields --> user chooses picture save along text ---> user taps save button, data saved coredata. when no image added data saves fine, when camera accessed text fields reset null. you can save information of text fields in variables , re-load them text fields upon viewwillappear

python - file not rendering in django template -

i have code supposed render file svn email command = 'svn cat -r {} "{}{}"'.format(svn_revision, svn_repo, filename) file_content = subprocess.popen(command, shell=true, stdout=subprocess.pipe).stdout.read() context = { 'file_content': file_content, } print file_content email = get_template('file_email/file_email.txt').render(context(context)) print email the email template (for now) just: {{file_content|safe}} the first print statement dumps file expected. the second print statement prints nothing. the template rendered, if put words around tag show up. it happens files (others work fine) , seems encoding problem. notepad++ believes offending files encoded "ucs-2 little endian" whereas ones work "utf-8 without bom". how can reliably dump file, regardless of encoding, template?

version control - Untrack files without removing from remote repository -

in our company, started using mercurial , facing following problem: we have files in remote repository changed each developer add local configuration these files must never changed in remote repository. is there way tell mercurial stop tracking files locally without making change file on remote repository? we tried hg forget <file> understand, remove file remote repository. we tried adding files .hgignore file, somehow files not being ignored, guess mercurial because files being tracked. so far, ignoring files when perform commit , use shelve maintain , restore our local changes after update, it's starting tedious task. thanks in advance help. edit: although didn't fix wanted to, accepted answer best approach. our problem result of bad design. if file want unchanged is, example, config.cfg , check in config_template.cfg , forget config.cfg if tracked, , add config.cfg ignore list. then, build rule can create config.cfg template if not ex

ios - How to export certificate from Mac OS X to get pair of .cert and .key files ? -

i have on mac 10.10.1 created certificate , have in keychain access certificate private key. on windows have use , need .cert , .key file. how export certificate 2 files ? can export .pb12 or .cert cannot export pair .cert , .key (private key ) what kind of certificate want export? try save certificate *.p12 file , try 1 of these solutions: https://www.icts.uiowa.edu/confluence/pages/viewpage.action?pageid=32735365 e.g. openssl pkcs12 -nocerts -in yourcert.p12 -out yourkey.key

java - How to load all files of a folder to a list of Resources in Spring? -

i have folder , want load txt files list using spring , wildcards: by annotation following: @value("classpath*:../../dir/*.txt") private resource[] files; but how can achieve same using spring pragmatically? use resourceloader , resourcepatternutils : class foobar { private resourceloader resourceloader; @autowired public foobar(resourceloader resourceloader) { this.resourceloader = resourceloader; } resource[] loadresources(string pattern) throws ioexception { return resourcepatternutils.getresourcepatternresolver(resourceloader).getresources(pattern); } } and use like: resource[] resources = foobar.loadresources("classpath*:../../dir/*.txt");

ios - Model-View-Controller with a Sqlite database -

i have tons of questions regarding ios development. developing application right , using mvc pattern along database.db (sqlite). question simple: database actual model or have create model too?. mean should have model ( person name, last name, age,etc) , database file well. if thats case, how relate model database?. thanks!

java - How to depend on all *compile and *testCompile tasks in Gradle -

i have in animalsniffer plugin 1 task depend on compilation of production classes (java, groovy, scala) in sourcesets , second depend on compilation of test classes in sourcesets (possibly separate test , integrationtest ). i wouldn't depend on *classes tasks *classes tasks should depend animalsniffer tasks (which detects java version api incompatibilities after compilation , can stop build). is there better way in gradle achieve checking if instance of abstractcompile task name starts "compiletest"? you can use tasks.withtype(abstractcompile) returns compile tasks source sets (which includes java, groovy, scala). can filter on eliminating tasks have test in them suggested in other answer. for specific task depend on these, can following: mytask.dependson tasks.withtype(abstractcompile).matching { !it.name.tolowercase().contains("test") }

javascript - how to use ng-repeat in partial html files using angular routes -

the following code used part of main html file decided split app, partials , render stuck , don't know how repeat render code more. <div class="col-md-12" ng-controller="timeslotcontroller calendar" > <div class="col-md-5 col-md-offset-1 timeblock" ng-repeat="slots in calendar.timeslot" ng-click="calendar.selecttimeslot(slots.time)"> <h3 class="event-type-name">[[ slots.time]] hour appointment</h3> <div class="description mts">[[slots.description]]</div> <div class="cost"><i class="fa fa-euro"></i> [[slots.cost ]]</div> </div> this how controller looks right now app.config(function($interpolateprovider, $routeprovider, $locationprovider) { $interpolateprovider.startsymbol('[['); $interpolateprovider.endsymbol(']]'); $routeprovider .when('/timeslot',

bash - how to center script output in the middle of the screen? -

here have binary clock outputs binary clock in 16 different colors , trying make appear in center of screen cant it. if have suggestions how please let me know. thanks color=("0;30" "0;31" "0;32" "0;33" "0;34" "0;35" "0;36" "0;37" "1;30" "1;31" "1;32" "1;33" "1;34" "1;35" "1;36" "1;37") color2=${#color[*]} while true; clear echo -ne '\e['${color[$((random%color2))]}m hour=$(date +%h) minute=$(date +%m) second=$(date +%s) hour_binary=$(echo "ibase=10;obase=2;$hour" | bc) minute_binary=$(echo "ibase=10;obase=2;$minute" | bc) second_binary=$(echo "ibase=10;obase=2;$second" | bc) printf "%06d\n" "$hour_binary" printf "%06d\n" "$minute_binary" printf "%06d" "$second_binary" sleep 1 done if referring center of terminal wind

mysql - Using Subquery to update total column -

here query: update student_tests, (select sum(olc_sta_i_points_earned) total, olc_sta_i_stt_num student_answers join student_tests on olc_sta_i_stt_num = olc_stt_i_num ) set student_tests.olc_stt_i_score = a.total a.olc_sta_i_stt_num = student_tests.olc_stt_i_num there no errors says 0 rows affected. basically have 2 tables: student_tests , student_answers test id mapped student_answers tables. want subquery can sum student answers specific test id , update score column in student_tests table in tests table. am doing wrong clause here? or else? you should phrase update / join explicitly, rather having join condition in where clause. your problem have no group by in subquery. join student_tests seems unnecessary, try this: update student_tests s join (select sum(a.olc_sta_i_points_earned) total, a.olc_sta_i_stt_num student_answers group a.olc_sta_i_stt_num ) on a.olc_sta_i_stt_num = t.o

c# - How do I make mshtml load CustomMarshalers? -

i'm working on legacy c# application uses .net framework 4. app uses webbrowser control , references "microsoft html object library" (mshtml). current version deployed server 2003 , run if .net framework 2 sdk installed. the push deploy app server 2008 without framework sdk. of course, app won't run. error generated "unable cast com object of type 'system.__comobject' class type 'mshtml.htmlformelementclass'." realize particular error resolved casting interface. in fact, made change , app ran until next mshtml casting error. there on 200 lines of similar code spread throughout application , no way test changes made. i've used fusion log viewer sense of dependencies being loaded , have found custommarshalers being loaded mshtml when app started visual studio 2010 or if, sys admin discovered, visual studio 2010 installed on server 2008 prior launching app. gut feeling need mshtml load custommarshalers regardless of presence of visua

java - Error when calling remote method -

i'm trying call fibonacci method on remote server using rmi when try invoke method on client side giving method integer value, these errors: java.rmi.serverexception: remoteexception occurred in server thread; nested exception is: java.rmi.unmarshalexception: unrecognized method hash: method not supported remote object @ sun.rmi.server.unicastserverref.dispatch(unknown source) @ sun.rmi.transport.transport$1.run(unknown source) @ sun.rmi.transport.transport$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ sun.rmi.transport.transport.servicecall(unknown source) @ sun.rmi.transport.tcp.tcptransport.handlemessages(unknown source) @ sun.rmi.transport.tcp.tcptransport$connectionhandler.run0(unknown source) @ sun.rmi.transport.tcp.tcptransport$connectionhandler.run(unknown source) @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) @ java.util.concurrent.threadpoolexecutor$worker.run(unk

java - NullPointerException Libgdx -

i've seen questions similar this, none match i'm experiencing libgdx project (desktop only). i've made .tmx map using tiled , copied assets folder, has 2 subpackages: gamescreens (with maps) , tiles. if open .tmx map eclipse using tiled works fine. here's .tmx: <?xml version="1.0" encoding="utf-8"?> <map version="1.0" orientation="orthogonal" renderorder="right-down" width="8" height="8" tilewidth="32" tileheight="32"> <tileset firstgid="1" name="default" tilewidth="32" tileheight="32"> <tile id="0"> <image width="32" height="32" source="../tiles/rock.png"/> </tile> <tile id="1"> <image width="32" height="32" source="../tiles/tile_default_1.jpg"/> </tile> <tile id="2">

3dsmax - Issue trying to use a .babylon file on html -

i'm trying import 3d scene 3ds max html page, came up: 1) imported obj scene 3ds max. 2) exported scene .babylon file (with 1 of github exporters). 3) opened file in sandbox of babylonjs.com. 4) saved html page. 5) made changes ("loading .babylon inside page / app") listed in: http://blogs.msdn.com/b/eternalcoding/archive/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender.aspx?commentposted=true&pageindex=3#comments . , import 3d scene babylonjs but when want open through web server (xampp) blank screen appears, , if not make changes of point 5 gets stuck in "loading" message. what doing wrong? sorry if question obvious, i'm new babylonjs. here images: https://mega.co.nz/#!6vudsiql!arncghjputachkwlwy0vtui74anr3ltsin2pgd3nig8 this because apache server not serving .babylon mimes types. if looking @ network tab in f12 tools see .babylon file request returns 403

python - Installing wxpython on ubuntu 14.04 -

when try open playonlinux commandline, error: looking python... 2.7.8 - selected traceback (most recent call last): file "mainwindow.py", line 31, in <module> import wxversion importerror: no module named wxversion nearly every forum post have found has suggested install wxpython, links here or other wxpython wiki page. unfortunately, entire wxpython wiki website says "wxpywiki down troubleshooting" right now. i found this stackoverflow question, same mine. tried lower-voted comments, , appear work, import wx still fails. when tried top-rated comment in thread, got step 7 successfully, says in file included scr/helpers.cpp:16:0: include/wx/wxpython/wxpython_int.h:19:19: fatal error: wx/wx.h: no such file or directory #include <wx/wx.h> compilation terminated if has suggestions how can install wxpython on ubuntu, appreciated. edit: sudo pip install wxpython tells me it's installed ("requirement satisfied") , sugges

php - JOIN multiple MySQL tables in query -

i'm not sure if possible, or if join-fu isn't strong enough(it's pretty wimpy tell truth). have 3 tables tied uid. i'm trying information result of them 1 query, except i'm having trouble making sure result want. users ========= users ========== | uid | nickname | -------------------------- | testusr1 | test user 1 | | testusr2 | test user 2 | | testusr3 | test user 3 | | testusr4 | test user 4 | ============= gallery =========== | id | uid | ext | profile | --------------------------------- | 1 | testusr1 | png | 1 | | 2 | testusr2 | jpg | 1 | | 3 | testusr3 | png | 1 | | 4 | testusr4 | png | 1 | | 5 | testusr4 | jpg | 0 | ============= friends ============= | sender | reciever | status | ----------------------------------- | testusr1 | testusr3 | 0 | | testusr2 | testusr3 | 1 | | testusr2 | testusr1 | 1 | | testusr3 | testusr4 | 1 | what i'm trying of user's

How do you compile Halide for iOS? -

the readme claims can compile armv7, cannot find magic incantation make work. i started down rabbit hole of changing makefile set arch=armv7, fixing resulting compilation errors, etc, doesn't seem right way go it. there recommended cmake flags are: cmake -dllvm_targets_to_build="x86;arm;nvptx" -dllvm_enable_assertions=on -dcmake_build_type=release .. but alas, bin directory contains .a , .so, both of compiled x86_64. there no dylibs. i can run test ios app in simulator, linking x86 libraries, cannot build on device since there no arm binaries. here link halide test app i'm trying build: https://github.com/halide/halide/tree/master/apps/helloios you should use aot compilation ios. jit in principle works on arm (the architecture), not on ios (the os).

javascript - image pop up on a steady position -

what right syntax make pop image show on left side of screen? jquery $("#qm3").mouseover(function(){ $("#osf").show(); }); $("#qm3").mouseout(function(){ $("#osf").hide(); }); html <span><input type="text" id="tb1"><img id="qm3" src="images/webresource.png"></img></span><span><img id="osf" src="images/osf.jpg" style="position: right; display:none;"></img></span> as of now, whenever i'm pointing mouse qm3 , pop shows, affects positioning of page. http://codepen.io/anon/pen/venzek this simplified, if rid of spans , wrap div around it: http://codepen.io/anon/pen/opygog js $(".show").hover(function(){ $(this).next('img.hide').fadetoggle(); }); html <div> <input type="text" id="tb1"> <img class='show' src="http://

Bootstrap collapsing sidebar not hiding to the side -

i've got issue bootstrap code. i'm trying make sidebar come in right side on mobile device, pretty here: http://getbootstrap.com/examples/offcanvas/ can't seem work. i'm trying make chevron icon change between left , right facing arrows, not work though i've gotten work before left sidebar. project located here, appreciated piston.serverpit.com/bootstrap/main edit: i've managed button , action working right, problem seems sidebar places under content of page instead of side of it. how fix this? fiddle: http://jsfiddle.net/zaulh39y/ edit2: got working example starting scratch offcanvas example, when try put article code body still breaks... ideas? seems main problem setting minimum width of sidebar in css. http://jsfiddle.net/xyd6ttbe/ according external example, update this #sidebar{ position: absolute; /* no float, no left or right */ } .row-offcanvas-right { left: 100%; /*instead of right xx...*/ } .row-offcanvas-right.active {

Partition Key in Cassandra -

if in cassandra cf, rowkey (a, b, c) , data highly skewed cardinality of being let's one. entire data reside on single node of cassandra cluster if replication factor 1? also, if node down, exception get? if have 1 partition key , rf 1 not able access data if node row hashes down. unavailable exception. http://www.datastax.com/drivers/java/2.1/com/datastax/driver/core/exceptions/unavailableexception.html primary key ((a),b,c) or primary key (a,b,c) means a decides node data resides on. primary key ((a,b),c) mean using composite key , combination of a , b deterimines node is. primary key ((a,b,c)) means full combination of a , b , , c used decide correct node. all of variables not in first set of inner parenthesis act clustering keys , determine sorted order of data within row not node row placed on.

Python Simulation Patient-Doctor Link (Simpy, Emergency Department) -

i'm working on project describe patient flow in emergency department using simpy 2.6. suppose there 3 doctors in intake area. process is, after seeing 1 specific doctor (say, doctor x), patient (with 80% chance) go lab. after lab test, patient return original doctor x rejoining queue. but how can create link between patient-docotr? right patients in code "memoryless" - see random doctor after lab test. there 20 beds in total in intake area. please me! thank in advance!! class intake(process): queue = [] #patient queue idle = [] #idle pas list busy = [] #busy pas list waits=[] #list of wait times, d2d time #wholetime=[] #list of whole time spent in ed iq = [] #amount in queue when customer leaves ndone = 0 #total number of customers have been services = 0 #new; counter of bed occupation def __init__(self): process.__init__(self) intake.idle.append(self) #initially idle def run(self): while intak

javascript - Reuse AngularJS controller logic -

this code of 1 controller application, in user page. app.controller('userctrl', ['$scope', '$http', function ($scope, $http) { $http.get('/users/getusers').success(function (data) { $scope.data = data; }); this.search = function () { $http.post('/users/searchuser', $scope.search).success(function (data) { $scope.data = data; }); } this.delete = function() {....} }]); on page, permission page, create controller same logic app.controller('perctrl', ['$scope', '$http', function ($scope, $http) { $http.get('/permission/getpermissions').success(function (data) { $scope.data= data; }); this.search = function () { $http.post('/permission/searchpermission', $scope.search).success(function (data) { $scope.data = data; }); } this.delete = function() {....} }]); as can see, different url. how can reuse logic controller another? that services for. so

java ee - Abort application loading when exception in ServletContextListener -

is there container independent way abort application loading process when fail in servletcontextlistener#contextinitialized if there more 1 application deployed on server, other applications should not affected. why java ee not specify standard way that? you can throw unchecked exception in listener. spec: some exceptions not occur under call stack of component in application. example of sessionlistener receives notification session has timed out , throws unhandled exception, or of servletcontextlistener throws unhandled exception during notification of servlet context initialization, or of servletrequestlistener throws unhandled exception during notification of initialization or destruction of request object. in case, developer has no opportunity handle exception . the container may respond subsequent requests web application http status code 500 indicate application error. developers wishing normal processing occur after listener generates except

How do I SET DATEFIRST 1 with PetaPoco in a Query or manage pooled connections -

i have query groups results week. in order ensure consistent week start trying add first line peta poco db.query(sql) method. set datefirst 1 select count(logdate) value, dateadd(week, datediff(week,0, logdate),0) [date] ... etc ... without set datefirst 1 petapoco generates like... exec sp_executesql n' select count(logdate) value, dateadd(week, datediff(week,0, logdate),0) [date] ... etc ... with set datefirst 1 petapoco generates like... exec sp_executesql n'select [datapoint].[date], [datapoint].[value] [datapoint] set datefirst 1 select count(logdate) value, dateadd(week, datediff(week,0, logdate),0) [date] ... etc ... how around generating incorrect sql? docs looks can use db.execute("set datefirst 1"); long executes on same conne

javascript - JS vote system {{bindings}} gives null on click? -

the error not show in developer tool guess got data , how read. both {{upvote}} , {{downvote}} starts no value , show null on click. somehow buttons linked? setting each vote each item. background voting system, separate , down scores (not netted single vote score). scores persist in database. i have not thought limiting votes per user if have thoughts there, feel free include in reply. thanks! the js files $scope.upvote = function () { if ($scope.votetype == "down") { $scope.upvote++; } $scope.upvote++; $scope.votetype = "up"; }; $scope.downvote = function () { if ($scope.votetype == "up") { $scope.downvote++; } $scope.downvote++; $scope.votetype = "down"; }; post saved in $scope.post as: $scope.post = { title: '', upvote: 0, downvote: 0 }; the button in html such: <i ng-click="downvote()" class="

ios - Apple Mach-O Linker Error (Xcode 6) -

i have error : ld /users/user/library/developer/xcode/deriveddata/pams_v-1.1-cmybounmouobwianhdnootdokdam/build/products/debug-iphonesimulator/pams.app/pams normal x86_64 cd "/users/user/desktop/ios maul testing/pams v-1.1" export iphoneos_deployment_target=8.0 export path="/applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/usr/bin:/applications/xcode.app/contents/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator8.1.sdk -l/users/user/library/developer/xcode/deriveddata/pams_v-1.1-cmybounmouobwianhdnootdokdam/build/products/debug-iphonesimulator -f/users/user/library/developer/xcode/deriveddata/pams_v-1.1-cmybounmouobwianhdnootdokdam/build/products/debug-iphonesimulator -filelist /users/user/library/devel

What is the advantage and disadvantage of developing Hybrid App using Apache Cordova in Visual Studio Community -

we going develop mobile application platform, mobile application includes main concept messaging,notes,reading book,blogs,sharing on facebook, tweet. advantages : easy write code in visual studio due context aware help code completion javascript, css, html easy debug in browsers chrome best check on simulators (on windows windows mobile, blackberry, , can check on android) disadvantages : can not test devices or simulators ios limited command line support options little support visually designing page ui few simulators use on vs. http://www.asp.net/mobile/device-simulators also have look :

java - Intellij perforce plugin issue - com/intellij/openapi/vcs/FileRenameProvider [Plugin: Perforce] -

i tried using perforce plugin in intellij. after restarted intellij, doesn't open , throws below exception cannot load project: com.intellij.ide.plugins.pluginmanager$startupabortedexception: com.intellij.diagnostic.pluginexception: com/intellij/openapi/vcs/filerenameprovider [plugin: perforce] could 1 in fixing this. thanks in advance. you need delete "c:\users\.intelliji\config\plugins" path. hope you!

javascript - can i add indendented code in a js file? -

this question has answer here: creating multiline strings in javascript 34 answers below link js code non indented : http://jsfiddle.net/bsr1/ucg6v1v0/ var dataabc = '<div class="message7">focus shifted here</div>'; alert("*"); indented http://jsfiddle.net/bsr1/1dtrz0au/ var dataabc = '<div class="message7"> focus shifted here </div>'; alert("*"); i know 2nd 1 results in js error.is there nay way can indent js code without erorr a string cannot declared across multiple lines. option 1 - concatenate: var dataabc = '<div class="message7">' + 'focus shifted here' + '</div>'; option 2 - escape newline backslash: var dataabc = '<div class="message7">\

c# - Comparing datetime values in SQL server 2008 -

i'm facing challenge in comparing datetime values in sql server 2008. i want select rows table 'plane_allocation_table' column 'to_date' of type datetime less today's date , time (which obtained using getdate()). , update 2 tables depending on values above query returns. however, queries tried don't return rows. the last stored procedure worte looks : -- procedure update total_allocation in hanger_details , validity of booking in plane_allocation_details : create procedure [dbo].[update_total_allocation_apms] declare @now datetime select @now = getdate() update hanger_details set total_allocation = total_allocation - 1 hanger_number in ( select hanger_number plane_allocation_details to_date <= @now , validity = 'valid' ) update plane_allocation_details set validity = 'not valid' to_date <= @now the comparison of 'to_date' , '@now' isn't working. there solution comparing datetime values tab

r - Add margins not working -

this code: x=c(10,20,30,40,50) y=c(17,30,37,50,56) my.tbl=cbind(x,y,x-mean(x),y-mean(y),(x-mean(x))*(y-mean(y)), (x-mean(x))^2,(y-mean(y))^2) colnames(my.tbl)=c("x","y","x-xbar","y-ybar", "(x-xbar)(y-ybar)","(x-xbar)^2","(y-ybar)^2") my.tbl addmargins(my.tbl) gives error: error in array(values, dim = newdim, dimnames = newdimnames) : length of 'dimnames' [1] not equal array extent can't figure out doing wrong. using r version 3.1.1 (2014-07-10), rstudio version 0.98.1091 according r help, "table or array. function uses presence of "dim" , "dimnames" attributes of a.". given both rstudent , spotted need dimnames. see below, my.tbl not have rownames . want add rownames following. then, have right outcome. dimnames(my.tbl)[[1]] <- c("a", "b", "c", "d", "e") addmargins(my.t

apache redirect to redirectUrl in query string -

i have request like: http://www.example.com/test?redirecturl=http://www.test.com i want apache use redirecturl param , redirect http://www.test.com the redirecturl may valid url. like: http://www.test.com/a/b?x=1&y=2&url=some_encoded_url how should config apache? i have got answer myself: rewritemap unescape int:unescape rewritecond %{query_string} url=(https?[^&\ ]+) rewriterule ^/share ${unescape:%1} [r,l] rewritecond %{query_string} url=((https?){0}[^&\ ]+) rewriterule ^/share http://${unescape:%1} [r,l]

OpenCL kernels for building OpenCV incorrectly generated -

i'm using cmake-gui in os x yosemite 10.10.1 build opencv 3.0-beta when generate files in binaries folder, notice opencl kernels every moduel should autogenerated incomplete. opencl kernels each module (opencl_kernels_modulename.cpp , opencl_kernels_modulename.hpp) predominantly empty. 1 of them looks when open kernels - this file auto-generated. not edit! #include "precomp.hpp" #include "opencl_kernels_core.hpp" namespace cv { namespace ocl { namespace core { } } } this quite every kernel (cpp , hpp) looks (for corresponding module) can me out here please? honestly, makes no sense me. note: tried building ubuntu, , of these correctly generated. i'm near uselessly late in answering question. issue main folder contained binaries, had space in name (for example : "ocv bin" ) interestingly enough, when removed space got build smoothly. sadly, never looked why happened, hence cannot give real reason why. if reading can

ios - add constraint to view in Xcode 6 -

i wanted add image stack overflow doesn't allow me upload photo because of reputation issue. leave link it. https://www.evernote.com/l/abqezcbsud1gwbdiiighjtpkomncudzglqi anyway, i have ios project xcode 6 . i made view controller , added table view. view controller - top layout guide - bottom layout guide - view +- table view after that, i added view , table view cell view controller - top layout guide - bottom layout guide - view +- table view ++- view ++- table view cell my problem height of view of table view 30 on story board. while running simulator, table view cell @ bottom. but cannot add constraint set height of view of table view. thank in advance! in case, firstly, should move second view out of table view . right layout should like: view controller - top layout guide - bottom layout guide - view +- view +- table view ++- table view cell then, should set proper constraints between second view (the user name in case) , table view .

javascript - Avoid reopen datepicker after date selection in internet explorer -

when select date, datepicker reopen because added $(this).focus(); in onselect. how can resolve issue? (example) $('#datepicker').datepicker({ onselect : function(x, u){ $(this).focus(); } }); i want focus must. cannot remove focus. please tell me solution without removing focus. please note after jquery ui datepicker selection, blur , change events fire before focus returned input field, there problem focus event on ie. the fix given below //example using triggerhandler $(function () { "use strict"; $('#datepicker').datepicker({ onselect : function(x, u){ format: "dd/mm/yyyy" }, onclose: function(datetext) { $(this).triggerhandler("focus"); $(this).triggerhandler("blur"); } }); }); this work me, refer //example using triggerhandler http://jsfiddle.net/shaikhimran786/w6fvul18/ use triggerhandler solve

php - forced zip file for download is corruption on unzip -

Image
i have zip file. have made script force getting download but issue that, when unzip saved zipped file, error stating :either file corrupt or here's script $itsfile = $folder.'.zip'; $file_name = basename($itsfile); header("content-type: application/octet-stream"); header("content-disposition: attachment; filename=$file_name"); header("content-length: " . filesize($itsfile)); readfile($itsfile); exit; but still, when unziping saved file, getting error. ! d:\documents , settings\administrator\desktop\file.zip: archive either in unknown format or damaged =========================================== edit: =========================================== the zip file contains foldr called image images inside it, , csv file havig data: information anyway?

c# - Dynamic Logon parameters in Crystal report 9 with 2 different database -

Image
i have problem having 2 database in 1 crystal report. i found article , use one: http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-dynamic-login.htm is working if using 1 database need connect other database information , found out not working.. i have modification code , goes this: reportdocument crreportdocument = new reportdocument(); sections crsections; reportdocument crsubreportdocument; subreportobject crsubreportobject; reportobjects crreportobjects; connectioninfo crconnectioninfo; //connectioninfo crconnectioninfo1; database crdatabase; tables crtables; tablelogoninfo crtablelogoninfo; crreportdocument.load(httpcontext.current.server.mappath("~/reports/" + filename)); crdatabase = crreportdocument.database; crtables = crdatabase.tables; string connectstring = conf

gruntjs - How can I use two "replace" tasks from "grunt-replace" and "grunt-text-replace" in same gruntfile.js -

in gruntfile use grunt-replace replace tags starting @@. want find custom strings , replace them too. found grunt-text-replace suitable that. tested demo project. in case grunt-replace , grunt-text-replace has same task name "replace". possible use 2 in same gruntfile? if yes, how? grunt-text-replace code: replace: { bust: { src: ['dist/*.html'], overwrite: true, // overwrite matched source files replacements: [ { from: '.js', to: function () { timestamp = '.

java - Why is my QueryParam returning null -

disclaimer : not j2ee developer. code works elsewhere, 1 api going crazy. code @get @path("getcloseby") @consumes({ mediatype.text_plain }) @produces({ mediatype.application_json }) public cservicecenters getlist(@queryparam("latitude") double latitude, @queryparam("longitude") double longitude) { log.info("getcloseby searching lat " + latitude + " lng " + longitude); getcloseby searching lat 17.63 lng null calling client curl http://:8080/mywar/myapi/getcloseby?latitude=17.63&longitude=73.9 disclaimer: not big curl user, don't know nuances, , why works. may shell problem. to work had add quotes " around url curl "http://:8080/mywar/myapi/getcloseby?latitude=17.63&longitude=73.9" note: tried escape & (without quotes) urisyntaxexeption server.

indexing - Mongodb - increasing performance using compound index when pagination -

i'm newbie mongodb , need increasing performance queries using compound indexes. i using pagination using "_id" field. query: db.data.find( {"$or": [ { "cat": "5" }, {"cat": "6" } ] }, {"style": "3"}, {"area": "london"}, {"_id": {"$lt": 103}).sort( { "_id": 1 } ).limit(30) style , area can optional these possible. db.data.find( {"$or": [ { "cat": "5" }, {"cat": "6" } ] }, {"area": "london"}, {"_id": {"$lt": 103}).sort( { "_id": 1 } ).limit(30) db.data.find( {"$or": [ { "cat": "5" }, {"cat": "6" } ] }, {"style": "3"}, {"_id": {"$lt": 103}).sort( { "_id": 1 } ).limit(30) db.data.find( {"$or&quo

bash - How to complete filenames relative to another directory? -

this follow-up question discussion in: https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1394920 suppose have folder ~/tmp files , directories: $ mkdir a; touch file1.txt; mkdir a/b; mkdir a/c; touch a/d; mkdir a/b/c i try make completion script complete filenames in ~/tmp , complete -o filenames option working correctly if current directory ~/tmp . see above link more background information. far got: $ cat setup _comptest() { local cur basefolder cur="${comp_words[$comp_cword]}" basefolder=~/tmp compopt -o nospace compreply=( $( cd "$basefolder" if [[ ${cur: -1} != "/" && -d $cur ]] ; echo "$cur/" else compgen -f "$cur" fi ) ) } complete -f _comptest aaa then source it: $ . setup and can $ aaa <tab><tab> problem 1 : slashes not added @ end of directory names in completion list ( desired easy separa

c - How do I print time in a file at different point of execution by opening the file only at the end? -

i trying print time twice in file. code shown below. the output not coming correct, printing values not current time is. the issue have call fprintf only once , @ last . in fact @ last when writing buffer (containing time several getlocaltime calls) file can call fprintf several times, not issue. i call getlocaltime twice on buffer , seems buffer being overwritten. can suggest me more elegant way printing time in file @ different points in execution, , opening file once ? (if open file after each getlocaltime function call, adding overhead of file open , write etc. ) latest update: based on suggestion modified code this, , worked #include "stdafx.h" #include <stdio.h> #include <time.h> #include <windows.h> #include <string.h> int main() { systemtime st; char *buffer; buffer= (char *)malloc(sizeof(char) * 10000); getlocaltime(&st); int offset=0; offset += sprintf(buffer+offset, "ti

generics - Merge two HashMaps in Rust -

so i'm bit stuck, trying merge 2 hashmaps. it's easy inline: fn inline() { let mut first_context = hashmap::new(); first_context.insert("hello", "world"); let mut second_context = hashmap::new(); second_context.insert("hey", "there"); let mut new_context = hashmap::new(); (key, value) in first_context.iter() { new_context.insert(*key, *value); } (key, value) in second_context.iter() { new_context.insert(*key, *value); } println!("inline:\t\t{}", new_context); println!("inline:\t\t{}\t{} [initial maps still usable]", first_context, second_context); } it's easy enough make function: fn abstracted() { fn merge<'a>(first_context: &hashmap<&'a str, &'a str>, second_context: &hashmap<&'a str, &'a str>) -> hashmap<&'a str, &'a str> { let mut new_context

codeigniter - PHP elapsed execution time on different server -

i using codeigniter benchmarking use $this->output->enable_profiler(true) . on development server, got ~0.17 second, on production server extremely slow, got ~6 second. same code, same php version, same apache , mysql version. whet else need check ? what things needs checked if php execution time slow ? . thanks.

php mysql ajax register form with image upload -

hello brothers ask how can make registration form image upload(base64) usign php mysql ajax , part of code didn't work. wish if tell me type of table row , give me righ code this. $("#dsubmit").click(function(){ var formdata = new formdata(this); demail=$("#demail").val(); dpassword=$("#dpassword").val(); dfirstname=$("#dfirstname").val(); dlastname=$("#dlastname").val(); dtel=$("#dtel").val(); dadr=$("#dadr").val(); dspeciality=$("#dspeciality").val(); dcodepost=$("#dcodepost").val(); $.ajax({ type: "post", url: "inc/regdoc.php", data: formdata,"&demail="+demail+"&dpassword="+dpassword+"&dfirstname="+dfirstname+"&dlastname="+dlastname+"&dtel="+dtel+"&dadr="+dadr+"&dspeciality="+dspeciality+"&dcodep

c# - Merge column header in gridview -

Image
i've been try merge header column 2 1, example , tried gridview.controls[0].controls.addat(0, ogridviewrow); question , example floating around adding 1 column, , add in top of old column, not merging it. want merging 1 column , rest of column still same. here picture of gridview column want merge : i want merge "action" column header 2 1. below action column, there edit , delete. oh forgot, here gridview code handle action column : <asp:commandfield showeditbutton="true" headertext="action"/> <asp:templatefield> <itemtemplate> <asp:linkbutton id="linkdelete" runat="server" commandargument = '<%# eval("xxx")%>' onclientclick = "return confirm('do want delete?')" text = "delete" onclick = "deletedetail"></asp:linkbutton> &

jquery - Error in firefox with dates -

can me why script fails in firefox, works in other browsers? i have function date before today, run something. return values: seldate : mon dec 01 2014 00:00:00 gmt+0100 (cet) today: tue dec 02 2014 09:15:06 gmt+0100 (cet) works fine in browsers, not in firefox. var dayid = $(this).attr('id'); var seldate = new date(dayid + "dec 2014"); var today = new date(); if ((seldate < today) || (seldate == today)) { //yes seldate before today. }else{ //no } i think problem there no space between date part , month var seldate = new date(dayid + " dec 2014"); also there problem value today, have time part also. var today = new date(); today.sethours(0,0,0,0)

php - CodeIgniter Where_In select from different table? -

i trying covert query in active record select crm_clients.id, crm_clients.`moved_date`, crm_clients.`contractor_id` dev_pfands.`crm_clients` crm_clients.`contractor_id` = 11 , ( crm_clients.`status` = 9 or crm_clients.`status` = 8 or crm_clients.`status` = 7 ) , crm_clients.id in (select crm_client_cheques.`client_id` dev_pfands.`crm_client_cheques`) , crm_clients.`moved_date` between '2014-08-01' , '2014-11-29 ' , crm_clients.`contractor_id`<>'' group crm_clients.`id the section i'm having issue and crm_clients.id in (select crm_client_cheques.client_id dev_pfands.crm_client_cheques) ` i've tried where_in method overtime try include attempt of $this ->db_pfands -> where('crm_client_cheques.client id' ,'id'); hit errors , have no idea how past this. the original query should return 703 rows , when i've removed part i'm stuck increase 3045 need included. appreciated.

How to initialize Bluetooth in a startup script with Yocto Poky Linux -

i have script initializes bluetooth setup on intel edison. allows pairing , connecting headless machine running yocto poky linux. suggested put startup script in /etc/init.d , run update-rc.d myscript.sh defaults. script ran didn't work (generated boot errors saying bluetooth device not found) because bluetooth had not started yet. did reasearch , after removing links did update-rc.d myscript.sh defaults 99 claimed run script last did't make differrence -- still ran in same place in boot sequence. verified links had s99 on them seemed set correctly. there post on asking similar question ubuntu system mine poky linux. solution suggested putting startup script in directory not exist on system. there other suggestions, putting in rc.local, did , got same result, runs before bluetooth initialized. here script. program called nmea_thread , run last. else initializing bluetooth. #!/bin/sh /usr/sbin/rfkill unblock bluetooth /usr/bin/hciconfig hci0 /usr/bin/hciconfig hc

java - Android method annotation for preventing call from being made on GUI thread -

in project i'm working on there plenty of caching done on main thread makes app laggy. plan make asynchronous variants of these, still keeping synchronous calls easier chaining when combined in asynctasks. problem have want prevent usage of caching functions in gui thread in intuitive way. ideas? possible? possible mark method annotation prevents being called on gui thread? http://androidannotations.org/ provides library leverages use of annotations deal this. have annotations such @uithread , @background replace need use runonuithread() , asynctask respectively. if you're interested, here's paper discussing similar system dealing blocking of ui thread operations non-ui threads.

uitableview - iOS Swift dequeueReusableCellWithIdentifier causing overlap -

this has been driving me mad, have @ every post on around in regard this. i using custom tableview cell classes , xib files. works fine, until scroll table view off screen (that old chestnut). know has dequeuereusablecellwithidentifier method , not clearing old data. have no idea how implement this. once cell scrolls off screen., causes overlap , continues add images cell. let cell: detailheadertableviewcell = tableview.dequeuereusablecellwithidentifier("detailheadertableviewcell") detailheadertableviewcell from have found, need implement this: uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:nil]; uiimageview *defaultimageview; uilabel *customlabel; if (cell == nil) { // create cell , empty views ready take content. cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:cellidentifier]; } else { ... } however cannot work out how achieve in swift. many in advance. what you're loo