Posts

Showing posts from May, 2011

OpenCv Python frame empty in mjpeg stream from webcam -

i'm creating program displays 4 mjpg cameras in grid, problem happens frame empty , stream freeze, capture error checking size of each frame, , if equal 1 continue cycle, problem remain in control loop, seems stream flow not able obtain valid frame, suggestion? import socket import numpy np import cv2 cap = cv2.videocapture("http://85.90.40.19/mjpg/video.mjpg") cap2 = cv2.videocapture("http://85.90.40.19/mjpg/video.mjpg") cap3 = cv2.videocapture("http://85.90.40.19/mjpg/video.mjpg") cap4 = cv2.videocapture("http://85.90.40.19/mjpg/video.mjpg") cv2.namedwindow('frame', cv2.wnd_prop_fullscreen) cv2.setwindowproperty('frame', cv2.wnd_prop_fullscreen, cv2.window_fullscreen) while true: try: ret, frame = cap.read() ret2, frame2 = cap2.read() ret3, frame3 = cap2.read() ret4, frame4 = cap2.read() except: print("try catch") continue size = np...

php - laravel 5 rawurlencode not encoding slashes -

i have laravel 5 project filters products category names , displays them. category names contain slashes(/) , dots(.) , when use rawurlencode() encode names retrieved database in order generate urls, slashes , dots not encoded rawurlencode() , leads 404 , internal errors when try click generated links. code in view: @foreach($info['categories'] $cat) <a href="{{ route('listbycategory', rawurldecode($cat->description)) }}" class="list-group-item sidebar-menuitem">{{ $cat->description }}</a> @endforeach here routes file: route::get('/cat/{cat}', ['as' => 'listbycategory', 'uses' => 'productscontroller@display']); and here's controller: class productscontroller extends controller { public function display($category) { $info = []; $info['title'] = $category; $info['products'] = db::select('....); return view('myview); } ...

javascript - How do I prevent duplicate Angular keys in ng-repeat? -

having trouble duplicate keys in ng-grid. search tim click on ng grid column in gridoptions1 see duplicates in gridoptions2. ideas? here's plnkr $scope.gridcolumndefs2 = [ {displayname:'phone', celltemplate: '<div data-ng-repeat="(key, ngclickresult) in ngclickresults track $index">{{ngclickresult.phone}}</div>'}, i use track by solve this, unless there reason should not, try track $index - trick! <div data-ng-repeat="(key, ngclickresult) in ngclickresults track $index"> or if you're trying remove items data can filter , answer here - angularjs remove duplicate elements in ng-repeat although if use second method, unless stuck recommend trying modify data coming in before hits repeat - maybe on server if have access that.

osx - Xcode-beta and updated/new frameworks -

i run xcode-beta 7 on 10.10.3. has new gameplaykit framework , updated scenekit framework. can use them (or new features) in current project, or must have 10.11 beta? you can write code on os x 10.10.3 using xcode 7β. can compile , export app since xcode can build against included 10.11 sdks. you can not , however, run app on mac under 10.10.3. app run need update 10.11β. make sure always use the same beta version xcode , os x always use latest beta if try run app links against sdk not available app crash before started error similar to dyld: library not loaded: /system/library/frameworks/metal.framework/versions/a/metal that because app configured tell dyld search in system's frameworks directory framework , directory not contain framework on version of os x. for unknown symbols in existing (updated) frameworks there 2 options depending on language: swift: swift 2.0 compiler automatically warns api want use not available , makes guard st...

java - Custom DaoAuthenticationProvider doesn't send correct exception to custom AuthenticationFailureHandler -

in application, use spring security, , try customize it... i have custum daoauthenticationprovider : @component("authenticationprovider") public class limitloginauthenticationprovider extends daoauthenticationprovider { ... @override public authentication authenticate(authentication pauthentication) throws authenticationexception { if (stringutils.isblank(pauthentication.getname())) { throw new usernamenotfoundexception("login required"); } if (stringutils.isblank(pauthentication.getcredentials().tostring())) { throw new authenticationcredentialsnotfoundexception( "password required"); } ... } } and custum authenticationfailurehandler : @component("authenticationfailurehandler") public class myauthenticationfailurehandler implements authenticationfailurehandler { @override public void onauthenticationfailur...

python - Why is Button parameter "command" executed when declared? -

this question has answer here: why button parameter “command” executed when declared? 4 answers i'm new python , trying write program tkinter. why hello-function below executed? understand it, callback executed when button pressed? confused... >>> def hello(): print("hi there!") >>> hi=button(frame,text="hello",command=hello()) hi there! >>> it called while parameters button being assigned: command=hello() if want pass function (not it's returned value) should instead: command=hello in general function_name function object, function_name() whatever function returns. see if helps further: >>> def func(): ... return 'hello' ... >>> type(func) <type 'function'> >>> type(func()) <type 'str'> if want pass argument...

lua - Error: attempt to index global 'playerBul' (a nil value) -

the error saying: game.lua:171: attempt index global 'playerbul' (a nil value) sorry if put unnecessary code, not know causing error. here files game: menu.lua: local menu = {} local bannermenu; local selection; menu.name = 'menu' local function play() mode = require('game') mode.load() end local options = { {['text'] = 'play', ['action'] = play}, {['text'] = 'exit', ['action'] = love.event.quit} } function menu.load() bannermenu = love.graphics.newimage(banner) selection = 1 pointer = love.graphics.newimage(pointer) mode = menu end function menu.update() return mode end function menu.draw() love.graphics.draw(bannermenu, 200,10) = 1,#options if == selection love.graphics.draw(pointer, 300, 200 + *20) end love.graphics.printf(options[i].text,0,200 + * 20, love.graphics.getwidth(), 'center') end end function menu.keypressed(key) if key == "u...

java - Pass own made Windows Credentials to SQL Server using JDBC -

i'm trying write program connects sql server @ work, have done , works perfectly. however, program works on desktop @ workplace because connected sql server wanted connect local. means if work on program @ home, won't able can't connect it. what i've found out server uses windows auth authenticate users connects sql server. found out windows authentication on sql server gets credentials security. wondering there way can credentials using java, pass sql server using jdbc login database?? or not realistic do? if so, there way around this? thanks when install ms sql server asked type of authentication want. i cannot think of scenario pure "windows authentication" makes sense. choose "mixed mode" pure windows authentication can go wrong. (server-admin gets fired, company merges ad-domain, spontaneous sid-corruptions etc...) that said, you'll need change authentication mode mixed mode .

meteor - Publishing different data for different users -

i'm trying publish users admins ommitting data (in case api key supposed "private" each user, realize admin can check database let's ignore security implications now). so basic idea user can see own profile , no 1 else. admin can see own complete profile , censored version of other user's profiles. have following publish code: meteor.publish('currentuser', function() { return meteor.users.find({_id: this.userid}, {fields: {'profile.apikey': true}}); }); meteor.publish('allusers', function() { var currentuser = meteor.users.findone(this.userid); return currentuser && currentuser.profile.admin ? meteor.users.find({}, {sort: ['username', 'asc'], fields: {'profile.apikey': false}}) : null; }); the problem apikey field doesn't published after logging in. ie. if login admin admin's apikey won't available until page reloaded. removing restriction 'allusers' publish funct...

web services - Android webservice call with server authetication -

i need call 1 webservice (https) server authetication android. please me how it. if try url in browser, asking enter user name , password. how give user name , password while consuming https webservice autheticate? thanks. you can use asytask class call webservices,in asyntask class have 4 methods 1.onpreexcute:used show data loading. 2.doinbackground:used sending , loading data , server. 3.onpostexcute:used after data loaded server , here ui realted task have done. class myasyntask extends asynctask<string, void, string> { string responsestring; @override protected void onpreexecute() { // todo auto-generated method stub super.onpreexecute(); progress = new progressdialog(getactivity()); progress.setmessage("please wait data loading..."); progress.show(); } @override protected string doinbackground(string... params) { string json = null; string url = "your url...

compression - c# sevenzipsharp- adding folder to new/existing archive -

i have code compressing folders/files: sevenzipcompressor compressor = new sevenzipcompressor(); foreach (string listboxitem in listboxtocompress.items) { string choosenpath = listboxitem; int filecount = directory.getfiles(listboxitem).length; int foldercount = directory.getdirectories(listboxitem).length; if (filecount == 0 && foldercount == 0) { messagebox.show("folder " + listboxitem + " empty"); } else { listbox1.items.add("========================================"); listbox1.items.add("compressing. "+listboxitem+" wait..."); listbox1.refresh(); if (file.exists(zipfile) == true) ...

CSRF Referer checking failed Django 1.8 -

i have searched not find workable solution. i have website www.example.com , subdomains a.example.com , b.example.com. when try post request a.example.com b.example.com error of referer checking failed. i have following settings in a.example.com , b.example.com: csrf_cookie_domain = ".example.com" but not able make use of csrf_cookie_domain correctly. django 1.8 has strict referer checking https. cannot post a.example.com b.example.com csrf protection enabled in django 1.8. with django 1.9 added csrf trusted origins .

How to store BMP image (which is in base64 string format) into oracle 11g database using spring's jdbctemplate class? -

i want store base64 string (bmp image) oracle 11g database. few links have gone through- http://forums.asp.net/t/1061466.aspx?how+to+save+image+in+oracle+blob+field+ http://www.dba-oracle.com/t_storing_insert_photo_pictures_tables.htm but not getting how this? have written code using link - http://www.technicalkeeda.com/spring-tutorials/insert-image-using-spring-jdbctemplate my table: create table profile_image (img_title varchar2(20) not null, img_data blob,); my code db query: file file = new file("picture.bmp"); if (file.exists()) { file.delete(); } outputstream stream; try (stream = new fileoutputstream(file)) { stream.write(data);//data byte array converted base64 string } catch (ioexception e) { e.printstacktrace(); } final string update_user_profile_picture = "update profile_image set img_data = ? img_title = ?"; final object[] replacementobjectlist = new object[] { new sqllobvalue(stream, (int) f...

c++ - Compile Lua 5.3 Mingw64 MSys2 -

i have installed mingw64 , msys2 official site ( http://mingw-w64.org/doku.php ) following instructions. added bin folders win7 path var. seems work. run command msys2 : gcc --version and works. now i´m trying install lua 5.3 (lua-5.3.1.tar.gz lua.org). decompressed file using winrar. msys2, go lua directory cd /e/programming/libs/lua-5.3.1/ then run make command mingw32-make mingw but doesn´t work. got message... cd src && e:/programming/mingw64/mingw64/bin/mingw32-make mingw mingw32-make[1]: entering directory 'e:/programming/libs/lua-5.3.1/src' e:/programming/mingw64/mingw64/bin/mingw32-make "lua_a=lua53.dll" "lua_t=lua.exe" \ "ar=gcc -std=gnu99 -shared -o" "ranlib=strip --strip-unneeded" \ "syscflags=-dlua_build_as_dll" "syslibs=" "sysldflags=-s" lua.exe e:\programming\mingw64\mingw64\bin\mingw32-make: invalid option -- = e:\programming\mingw64\mingw64\bin\mingw32-make: inv...

PEP 0492 - Python 3.5 async keyword -

pep 0492 adds async keyword python 3.5. how python benefit use of operator? example given coroutine async def read_data(db): data = await db.fetch('select ...') according docs achieves suspend[ing] execution of read_data coroutine until db.fetch awaitable completes , returns result data. does async keyword involve creation of new threads or perhaps use of existing reserved async thread? in event async use reserved thread, single shared thread each in own? no, co-routines not involve kind of threads. co-routines allow cooperative multi-tasking in each co-routine yields control voluntarily. threads on other hand switch between units @ arbitrary points. up python 3.4, possible write co-routines using generators ; using yield or yield from expressions in function body create generator object instead, code executed when iterate on generator. additional event loop libraries (such asyncio ) write co-routines signal event loop going busy (waiti...

standards - Why was automatic semi-colon insertion (ASI) added to javascript? -

because of "religious war" @ current work place have decided research history of asi feature of javascript. but having trouble finding out why , when asi introduced javascript. it seems has been feature forever, there specific reason there 2 ways terminate statement in javascript? some sources describe asi error-correction feature, imply omitting semi-colons bad practice. is there performance impacts on relying on asi? personally prefer semicolons because makes intentions more explicit, personal preference isn't viable argument in serious discussion. great question! brenden eich designed javascript programming language originally, , think fair agree automatic semicolon insertion design flaw in language. we shouldn't blame him. designed language in period of 10 days in 1995, having no idea 20 years later become (probably) important computer language on planet. in following post says "i wish had made newlines more significant in js in t...

objective c - Expand parameter list in C -

i using c library in objective c project. c library offers following function void processdata(...); which can used 1, 2 or 3 parameters, first parameter mandatory , can have different types int , double , long , float , other 2 arguments optional , have int , long values , can in whatever order. examples of use of function are: int myint = 2; double mydouble = 1.23; int dataquality = 1; long datatimestamp= get_now(); processdata(myint); processdata(myint, dataquality); processdata(mydouble, dataquality, datatimestamp); processdata(mydouble, datatimestamp); i need make objetive c wrapper uses datatype class call processdata with correct parameters. data class has getters allows data type (first argument), value , whether second , third arguments have value , value. the problem how make expansion ? think must done @ compile time, , think mechanism available in c macros. have never used them. implementation should (the following pseudocode, arguments list evaluated ...

mysql - SSDT Stored procedures automatically divided into sub folders -

i have imported large data base having 2000 stored procedures in ssdt create dacpac. suprised see stored procedures automatically divided sub folder, like: 1) procs1 2) procs2 3) procs3 i don't know reason. please me out in this. when import database asked how may want in each folder, think defaults 1000 if want have them in 1 folder can move them via solution explorer.

html - How to Change a Picture inside of a Table using jQuery -

Image
when press plus button, change picture minus when have toggled out, can see minus picture , click on picture, changed plus picture. questions: not know how create based on description above using jquery. thanks! $(function () { $('tr.parent td') .on("click", "span.btnn", function () { var idofparent = $(this).parents('tr').attr('id'); $('tr.child-' + idofparent).toggle('slow'); }); }); $('tr.child').hide(); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <table> <tr> <th>a</th> <th>b</th> <th>c</th> <th>d</th> <th></th> </tr> <tr class="parent" id=1048> <td><span class="btnn">2015 july </span></td...

c++ - Pass custom data to attributes of MPxLocator (Maya API) -

in cpp class using maya api, initiate custom mpxlocator instance called mylocatornode , pass attributes variables: mdagmodifier dagmod; mdgmodifier mdgmod; myobj=dagmod.createnode("mylocatornode", <existing transform mobject>); dagmod.doit(); mfndagnode mydagnode(myobj); mydagnode.findplug("attributeone").setvalue(1.5); mydagnode.findplug("attributetwo").setvalue(2.0); mydagnode.findplug("attributethree").setvalue(3.1); mydagnode.findplug("classattrib").setvalue(classpointer); // <- type should use ? custom locator class: mstatus mylocatornode::initialize() { mfnnumericattribute nattr; mfn???attribute customattr; <-- can use here ? attr1= nattr.create( "attributeone", "ao", mfnnumericdata::kfloat,1.0 ); attr2= nattr.create( "attributetwo", "ao", mfnnumericdata::kfloat,1.0 ); attr3= nattr.create( "attributethree", ...

Use VBA with Powerpoint to Search titles in a Word Doc and Copy Text into another Word Document -

i'm working on powerpoint slide, few texts listed. have search these texts in word document has lot of headings , texts. after find title text, need copy text under heading , paste in new document. basically, vba coding has done in powerpoint vba, 2 documents in background searching text , pasting in another. i've opened word doc. searching text in , selecting copying document i've not been able do. kindly me. i see. following not elegant since uses selection try avoid way know achieve such thing. disclaimer 1: made in word vba, need slight adaption, set reference word , use wrdapp = new word.application object , declare doc , newdoc explicitely word.document . disclaimer 2: since search text instead of respective heading, beware find first occurence of text better not have same text in several chapters. ;-) disclaimer 3: cannot paste anymore! :-( clipboard set, pastes elsewhere cannot paste in here. code follows first edit, in minute... edit: ye...

javascript - Replacing an Observable Array with AJAX -

in our application have series of select filters must populated dynamically based on context of situation. on first load, default options inserted array via ajax , appears on ui expected. however, when select list refreshes, ui not reflect changes though if inspect code array appears contain new values. i have written same code 2 filters strange reason works in 1 of situations, have tried following resolve no avail: populating array manually using arbitrary data forcing knockout update array.valuehasmutated() using 2 different types of array clearing functions array.removeall , array([]) using push.apply , push saving result variable , assigning array making values inside array observable this first instance of code works expected when options change: success: function (data) { self.filtersmodel.values2.removeall(); var serverdata = $.map(data, function (value, i) { return new selectbox...

c# - Run a R Script from asp.net application and get the output from r -

Image
i need run r script stored in folder asp.net application , show output of r script in web page. below code of default.aspx.cs file using rdotnet; using system; using system.collections.generic; using system.io; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; public partial class _default : system.web.ui.page { protected void page_load(object sender, eventargs e) { } private static double evaluateexpression(rengine engine, string expression) { var expressionvector = engine.createcharactervector(new[] { expression }); engine.setsymbol("expr", expressionvector); // wrong -- need parse expression before evaluation //var result = engine.evaluate("eval(expr)"); // right way this!!! var result = engine.evaluate("eval(parse(text=expr))"); var ret = result.asnumeric().first(); return ret; } public static void setu...

encoding - Need to find the requests equivalent of openurl() from urllib2 -

i trying modify script use requests library instead of urllib2 library. haven't used before , looking equivalent of urlopen("http://www.example.org").read() , tried requests.get("http://www.example.org").text function. this works fine normal everyday html, when fetch url ( https://gtfsrt.api.translink.com.au/feed/seq ) doesn't seem work. so wrote below code print out responses same url using both requests , urllib2 libraries. import urllib2 import requests #urllib2 request request = urllib2.request("https://gtfsrt.api.translink.com.au/feed/seq") result = urllib2.urlopen(request) #requests request result2 = requests.get("https://gtfsrt.api.translink.com.au/feed/seq") print result2.encoding #urllib2 write text open("output.txt", 'w').close() text_file = open("output.txt", "w") text_file.write(result.read()) text_file.close() open("output2.txt", 'w').close() text_file = o...

c# - Fire routed event when tooltip is changed -

i trying add routed event existed tooltip in control - bound simple get/set property. binding in xaml: <style x:key="style" targettype="{x:type mycontrol}"> <setter property="tooltip" value="{binding name}" /> prop in mycontrol: public string name { get; set; } routed event in control class contains list of mycontrols (i suppose have wrote in right way) public static readonly routedevent tooltipchangedevent = eventmanager.registerroutedevent("tooltipchanged", routingstrategy.bubble, typeof(routedpropertychangedeventhandler<string>), typeof(control)); public event routedpropertychangedeventhandler<string> tooltipchanged { add { addhandler(tooltipchangedevent, value); } remove { removehandler(tooltipchangedevent, value); } } the question how fire event when tooltip changed? clas...

ember.js - IE8 not starting app after upgrade from Ember 1.10 to 1.13.2 -

after upgrading 1.10 1.13.2 application stopped working on ie8 - doesn't load main route , doesn't start application correctly. there no exceptions thrown. below log ie8: debug: ------------------------------- debug: ember : 1.13.2+616f7a7e debug: jquery : 1.11.1 debug: ------------------------------- processing last blocks: 0ms timer "processing last blocks" not exist. attempting url transition / generated -> route:application, [object object] generated -> route:index, [object object] preparing transition '' ' index' transition #0: application: calling beforemodel hook transition #0: application: calling deserialize hook transition #0: application: calling aftermodel hook transition #0: index: calling beforemodel hook transition #0: index: calling deserialize hook transition #0: index: calling aftermodel hook transition #0: resolved models on destination route; finalizing transition. generated -> controller:application, [object object...

python - Pass std::string into PyObject_CallFunction -

when run presult = pyobject_callfunction(pfunc, "s", &"string") , python script returns correct string. but, if try run this: std::string passedstring = "string"; presult = pyobject_callfunction(pfunc, "s", &passedstring) then convert presult std::string , <null> when print it. here (probably) complete code returns <null> : c++ code: #include <python.h> #include <string> #include <iostream> int main() { pyobject *pname, *pmodule, *pdict, *pfunc; // set pythonpath working directory setenv("pythonpath",".",1); //this doesn't setenv("pythondontwritebytecode", " ", 1); // initialize python interpreter py_initialize(); // build name object pname = pyunicode_fromstring((char*)"string"); // load module object pmodule = pyimport_import(pname); // pdict borrowed reference pdict = pymodule_getdict(pmod...

java - Dropwizard Shutdown Hook -

the problem is, stop dropwizard application (via ctrl + c) , have inserted shutdown hook in main class stuff before shutdown. serverconnector application closed before can want do. there polling service (polls 1 of resources) , need tell them, application go down prevent problems. need @ least 15 seconds before ressource goes down. some idea how solve problem? add dropwizard task change state of static field (or want pass data) polling resource using respond. public class shutdowntask extends task { private int timeoutseconds; public shutdowntask (int timeoutseconds) { super("shutdown"); this.timeoutseconds = timeoutseconds; } @override public void execute(immutablemultimap<string, string> parameters, printwriter output) throws exception { // can take timeout parameter request via 'parameters' instead of constructor. pollingresource.shuttingdownin = timeoutseconds; } } environment....

ruby - How to completely stop the rails action from responding any kind of HTTP status? -

rails 3.2.13. jruby 1.7.15. ruby 1.9.3 interpreter is there way kill rails action responding @ all? want avoid kind of response being sent anonymous hacker. there constraint check before index , if constraint check fails, index method ideally should stop responding. small part on rest api in effort kill action sending http status back. any constructive suggestion welcomed. i.e. def index # kill method, not send response @ all. not 500 error end thank help. although rest api should send valid http response, can suppress output closing underlying output stream. exposed via rack's hijacking api (assuming server supports it): def index if env['rack.hijack?'] env['rack.hijack'].call io = env['rack.hijack_io'] io.close end end this results in empty reply, i.e. server closes connection without sending data: $ curl -v http://localhost:3000/ * connected localhost port 3000 > / http/1.1 > user-agent: curl/7.37.1 ...

javascript - How to show json response values in Angular JS using ng-repeat -

i'm trying show values of specific json in right order. json looks : { "a":[{"id":"21","name":"andrea"},{"id":"22","name":"apple"}], "b":[{"id":"21","name":"baby"},{"id":"22","name":"bali"}], "c":[{"id":"21","name":"candle"},{"id":"22","name":"canada"}], } how show values ng-repeat : <div ng-repeat="item in items"> </div> like : a andrea apple b baby bali c candle canada please check working example: http://plnkr.co/edit/lqoqvmxnimwyzqvu0wkg?p=preview html <div ng-repeat="(key, values) in items"> {{key}} <div ng-repeat="item in values"> {{item.name}} </div> </div>

android - Can i make Json Volley request in main thread? -

i need make json request , set ui depending on response, nice make in in oncreate in same thread. speaking requestfuture, can't rely use this, or dont know how. requestfuture<jsonobject> future = requestfuture.newfuture(); jsonobjectrequest request = new jsonobjectrequest(url, null, future, future); requestqueue.add(request); try { jsonobject response = future.get(); count = response.getin("int"); } catch (interruptedexception e) { } catch (executionexception e) { }catch (jsonexception e) { toast.maketext(getactivity(), e.tostring(), toast.length_long).show(); } i tried this, dont work. if know pls show example how data jsonobject , dont nothing befor data goten , use values set views. as there getactivity() in code, bet in fragment. on ui thread call this getactivity().runonuithread(new runnable() { @override public void run() { // ui-related code goes here } });

c# - Using R in asp.net web application -

i trying use r script in asp.net c# web application. trying use simple r script concatenate 2 strings single one. below cs code using rdotnet; using system; using system.collections.generic; using system.io; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; public partial class _default : system.web.ui.page { protected void page_load(object sender, eventargs e) { } private static double evaluateexpression(rengine engine, string expression) { var expressionvector = engine.createcharactervector(new[] { expression }); engine.setsymbol("expr", expressionvector); // wrong -- need parse expression before evaluation //var result = engine.evaluate("eval(expr)"); // right way this!!! var result = engine.evaluate("eval(parse(text=expr))"); var ret = result.asnumeric().first(); return ret; } public static void setuppath...

xml - How to get a XMLText Value returned by Ezpublish Rest API converted to HTML5 in advance? -

i xmltext field values returned ezpublish rest api in html5 format instead of internal xml format which simple way ? kind regards unfortunately, isn't implemented, , might not be. xmltext being replaced richtext. given focus on platform, not planned improve xmltext support, though active demand users can difference. in meantime, easiest thing write own custom rest api endpoint, either using repository's api framework, or using own controllers. use same code used internally conversion, meaning wouldn't work.

ios - Make UIModalTransitionStyle Look like push in swift -

i know if there way make uimodaltransitionstyle have "push" style ? because have : let storyboard : uistoryboard = uistoryboard(name: "main", bundle:nil) let secondviewcontroller = storyboard.instantiateviewcontrollerwithidentifier("secondviewcontroller") as! secondviewcontroller secondviewcontroller.modaltransitionstyle = uimodaltransitionstyle.fliphorizontal self.presentviewcontroller(secondviewcontroller, animated:true, completion:nil) but have simple "push" effect when move viewcontroller. regards ! edit (thanks logocse) still not solved now have let storyboard : uistoryboard = uistoryboard(name: "main", bundle:nil) let secondviewcontroller = storyboard.instantiateviewcontrollerwithidentifier("secondviewcontroller") as! secondviewcontroller secondviewcontroller.modaltransitionstyle = uimodaltransitionstyle.fliphorizontal let transition: catransition = catransition() transition.duration = 0.25 transitio...

sql server - SQL query database on column data type with a condition -

for example, in sql server(10.0.5520. sql server 2008 sp3), have table 3 columns of type datetime . our goal data has 1 of 3 columns > specificeddate don't want list out specified columns 1 one. please view example below: table (id int, name varchar, createdate datetime, modifydate datetime, voiddate datetime) normally be: select * createdate > 'x' or modifydate > 'x' or voiddate > 'x' it should turn to select * (if column datetime , column.data > 'x') can query in way? if yes, how can that? you can use sys.columns columns given table datetime . select c.name sys.columns c c.object_id = object_id('a') , c.system_type_id = type_id('datetime') then can use build , execute query using sp_executesql . declare @sql nvarchar(max) set @sql = ' select * dbo.a '+stuff(( select 'or '+quotename(c.name) + ' > @va...

php - Eloquent ORM dynamic relation properties vs method for eager loading -

i'm using eloquent in slim framework. take advantage of eager loading. wonder there difference between using property , method. the reason i'm asking because i'm using twig template engine , can call method. will able take advantage of eager loading using property or not? $obj = new book(); $books = $books->with('author')->get(); // using property foreach ($books $book) { echo $book->author->name; } // using method foreach ($books $book) { echo $book->author()->get()->name; } there huge difference. in second line populated $books authors. , when iterating through them in first foreach have data, don't perform additional sql queries. eager loading made for. but in second foreach calling get() method on every iteration , laravel starts repopulating authors making queries on , on every book.

javascript - Google maps is not 100% Loaded when you start Android . (not always) -

i have problem map contains geo-location, directions , markers. map start screen directly shown after app launches. want map show geolocation (position) , markers, have reload (ripple emulator), see want. after app launches, map clear , no geolocation or markers shown. i think script may not load 100%, works without giving me problem. i use cordova, initialize map in classic way bottom script: google.maps.event.adddomlistener(window, 'load', initialize); and call : <div id="map-canvas"></div> api , script , put code on top of page. apparently not work @ all, in device map not load function or disappear when "zoom " , runs slowly

c# - DataMatrix Wpf KeyValuePairMapping -

i trying build datamatrix in wpf needs have row , column headers, dynamically generated rows , columns , commands linked each cell. due this, unable use datagrid. there few solutions josh smith's data matrix , this . leaning towards former feel might able achieve want more elegantly that. unlike example(demo1), don't know names or number of rows/columns before hand , stuck in generating keyvaluepair dictionary. below pseudocode comparing implementation mine. appreciate if pointed me in right direction. his code class dataclass: { string columnname; int row1data; int row2data; } class matrixclass: matrixbase<string dataclass> { dictionary<string callback> rowvaluemap; delegate object callback(dataclass data); addmappings() { rowvaluemap.add("row1name", data=>data.row1data.tostring); } } my implementation ??(code) indicates part i'm unsure about class mydataclass: { string columnname; string[] rownames; int[] rowdata; ...

javascript - How to search content from an array of objects -

how can search content data using pure javascript? search done using button click. <html><head> <meta charset="utf-8"> <title>search</title> </head> <body> <div id="lidynamic"><ul><li id="first">undefined</li><li id="second">firefox 1.0</li><li id="third">win 98+ / osx.2+</li><li id="fourth">1.7</li></ul><ul><li id="first">tatsman</li><li id="second">firefox 1.5</li><li id="third">win 98+ / osx.2+</li><li id="fourth">1.8</li></ul></div> <input name="search" type="text" maxlength="512" id="search" class="searchfield" autocomplete="off" title=""> <input type="submit" id="btnsearch"> <script> var a...

Image quality control using racket plot/no-gui -

i using rakcet language's plot/no-gui library render functions , increase dpi of images created plot-file call. (also style comments appreciated) an example function plotting: #lang racket (require math) (require plot/no-gui) (plot-file (list (axes) (inverse-interval (λ (x) 1) (λ (x) -1) -3.00000 3.000000) (function (lambda (x) (* (expt 3 x) (sin (* 20 x)))) -1 1)) "images/plot_000000.jpg" #:y-min -4 #:y-max 4) the size of plot controlled parameters plot-width , plot-height . image doesn't have dpi - dpi describes screen. try this: #lang racket (require math) (require plot/no-gui) (define scale 4) (plot-width (* scale (plot-width)) (plot-height (* scale (plot-height)) (plot-file (list (axes) (inverse-interval (λ (x) 1) (λ (x) -1) -3.00000 3.000000) (function (...

.htaccess - Redirect Sub Directory Index File -

basically redirecting old category page new category page. issue old category found @ both www.domain.com/category/ , www.domain.com/category/index.shtml . any links on site point www.domain.com/category/index.shtml that's url have redirect in .htaccess . but there rare cases www.domain.com/category/ being found , not redirecting because doesn't match redirect rule. how can redirect both these urls in 1 .htaccess line? essentially i'm trying this: redirect 301 /category/ http://www.domain.com/new-category/ redirect 301 /category/index.shtml http://www.domain.com/new-category/ the issue being, first rule encapsulate inside of /category/, don't want. and ideally want in 1 line, there quite number need redirected , unfortunately can't redirectmatch them. is possible? to match if there's nothing after /category/ or index.shtml , can use redirectmatch directive: redirectmatch 301 ^/category/(index.shtml)?$ http://www.domain.com/new...

image processing - How does separating frequencies by Gaussian Filter work? -

i want understand meaning of separating frequencies using gaussian filter. give me meaningful example? gaussian kernel low pass filter (lpf). means every time applied on image removes high frequency data. now think following process, apply lpf on image, resulted image called lpf_k. take image_k (original image @ k-th step) , hpf_k = image_k - lpf_k. why hpf (high pass filter)? because took image contains frequencies , remove lpf part of leaves hpf. it means seprated lpf data of image , hpf. if insert downsampling , upsampling process in between can split frequencies want (filter banks). this how equalizer work example. you can read more in filter banks . this lies behind wavelets, multi scale analysis , pyramid decomposition in image processing.

java - How do I get the numerical value/position of a character in the alphabet (1-26) in constant time (O(1)) without using any built in method or function? -

how numerical value/position of character in alphabet (1-26) in constant time (o(1)) without using built in method or function , without caring case of character? if compiler supports binary literals can use int value = 0b00011111 & character; if not, can use 31 instead of 0b00011111 since equivalent. int value = 31 & character; or if want use hex int value = 0x1f & character; or in octal int value = 037 & character; you can use way represent value 31. this works because in ascii, undercase values prefixed 011, , uppercase 010 , binary equivalent of 1-26. using bitmask of 00011111 , and operand, covert 3 significant bits zeros. leaves 00001 11010, 1 26.

java - JPA Query from 3 column join table -

i have following entities. means user can belong many businesses , each business user can has separate permissions. existing user can assigned business. business_user table looks this: user_id business_id authority_name 6 1 role_analytics 6 1 role_self_analytics 7 1 role_reviews 8 1 role_analytics 8 1 role_self_analytics 8 1 role_reviews 6 2 role_reviews 6 2 role_self_analytics question: querying users 1 business trying build list of user dto objects, dto exposes list<authority> , problem can't figure how should these authorities each user business_user table. been trying fancy stuff lambdas have no luck. using spring data queries, maybe can solve in repository. thanks in advance. edit : if go route adding new join table business_user_authority , how have describe in userbusiness class? primary key...

php - Fatal error: Class 'HttpRequest' not found in C:\xampp\htdocs\test -

in website using infobip 2-factor authentication security purpose. got code in website showing error fatal error: class 'httprequest' not found in c:\xampp\htdocs\test\otp\send.php on line 2 code following: send.php <?php $request = new httprequest(); $request->seturl('https://oneapi.infobip.com/2fa/1/pin'); $request->setmethod(http_meth_post); $request->setheaders(array ('accept' => 'application/json' ,'content-type' => 'application/json' ,'authorization' => 'app secret_key')); $request->setbody('{ "applicationid": "your_application_id", "messageid": "your_message_id", "to": "phone_number" }'); try { $response = $request->send(); echo $response->getbody(); } catch (httpexception $ex) { echo $ex; } ?> this following code request , showing fatal er...