Posts

Showing posts from June, 2013

ios - UITableview Insert/Delete -

i having 1 number of section base tableview in plus button add new item in tableview. while try add or delete section tableview , reload tableview blink old record many times , add or delete section. here code. -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { symboltableviewcell *cell = [tableview cellforrowatindexpath:indexpath]; if ([selectindexpath containsobject:[nsnumber numberwithint:(int)indexpath.section]]) { [selectsymbol removeobject:cell.lblsymbol.text]; [selectindexpath removeobject:[nsnumber numberwithint:(int)indexpath.section]]; } else { nsstring *strr = cell.lblsymbol.text; [selectsymbol addobject:strr]; [selectindexpath addobject:[nsnumber numberwithint:(int)indexpath.section]]; } [tbldetail reloaddata]; } what issue? try following code may helps you -(void)tableview:(uitableview *)tableview didselectrowatindexpath: (nsindexpath *)i

html - Javascript- Onclick function not working -

i have code changing class of element onclick using pure javascript. pretty confused when code did not work have used same code many times before , worked perfectly. here relevant part of code - html- <div id="div" class="blue">.</div> css- .blue{ width: 500px; height: 500px; z-index: 9876543210; position: absolute; margin-top: 20%; margin-left: 20%; -webkit-transition: 0.5s ease-in-out; background-color: #24e; } .red{ width: 300px; height: 300px; position: absolute; margin-top: 20%; margin-left: 20%; -webkit-transition: 0.5s ease-in-out; z-index: 9876543210; background-color: #e69; } javascript- function a(){ this.classlist.toggle('blue'); this.classlist.toggle('red'); } document.queryselector('#div').addeventlistener('click', a); i have linked page online jquery ( if makes difference ). when click on "div" nothing happens. p

javascript - Make html preview of blog post in Angular.js using ng-bind-html -

i have list of posts loads perfect, entire content of each post. html post content string in database column. want create read more link @ position desire , show post preview in list (a part of html content). accomplish write comment inside posts it´s point cut content in order preview. how can manipulate content before ng-bind-html loads it? need detect first comment , clean content html document. i´m making tests in jquery know how on angular way. i think filter inside ng-bind-html expression can work. don´t how manipulate html string inside filter. manipulate jquery syntax because need remove lot of tags , stuff. <script> $(function() { var com = $("*") .contents() .filter(function(){ return this.nodetype == 8;}) .first(); com.nextall().remove(); }); </script> thanks you can add function executed during ng-bind-html , access string using sanitise service $sce . see details on $

Not able to give inputs to a function java. -

in example, want add contents of 2 arrays, not able how should input given. example, in case, "invalid assignment operator" error showing up, line int[] = new int[1,2]. want know how call function addarr, using arrays , b. public class arradd { public static void main(string[] args) { // todo auto-generated method stub int[] = new int[1,2]; int[] b = new int[3,4]; new arradd.addarr(a,b); } public void addarr(int[] arr1, int[] arr2){ int total = 0; for(int = 0; < arr1.length; i++){ total += arr1[i]; } for(int = 0; < arr2.length; i++){ total += arr2[i]; } system.out.println(total); } } one of problems why "invalid assignment operator" error showing because can't in java int[] =new int[1,2]; // give compiler error. the parameter inside square bracket means size of array. int[] a=new int[2]; here 2 means size of array 'a'. if want declare contents array, this in

How can I add a progress bar in powerpoint that excludes the last slides -

basically want add progress bar powerpoint not cover entire presentation. have additional slides might not need when presenting , therefore want exclude progress bar. sub addprogressbar() on error resume next activepresentation sheight = .pagesetup.slideheight - 12 n = 0 j = 0 = 1 .slides.count if .slides(i).slideshowtransition.hidden j = j + 1 next i: = 2 .slides.count .slides(i).shapes("progressbar").delete if .slides(i).slideshowtransition.hidden = msofalse set slider = .slides(i).shapes.addshape(msoshaperectangle, 0, sheight, (i - n) * .pagesetup.slidewidth / (.slides.count - j), 12) slider .fill.forecolor.rgb = activepresentation.slidemaster.colorscheme.colors(ppfill).rgb .name = "progressbar" end else

blockchain - Ethereum: low tx nonce or out of funds -

i started private network issuing command: geth --datadir="~/datastore/ethereum" --port 30303 --rpc --rpcport 8545 --rpcaddr localhost --networkid 554433 --rpccorsdomain="*" --minerthreads "4" --mine --rpcapi "db,eth,net,web3" --maxpeers 0 --nodiscover --unlock=0 --verbosity 4 --gasprice 100 --gpomin 0 --gpomax 0 then called smartcontract. saw smartcontract never anything. i looked @ log information, message. removed tx ( tx(b1a52b1414eb7b957ce4688a5aad07745f3055b3d415ca55d94afa45549c5dac) contract: false from: af8f853382b3b6db6ab7fa4f7df6f5329976988d to: c51b59d444993f6d613b023bf8598b781752fc54 nonce: 14 gasprice: 0 gaslimit 90000 value: 0 data: 0xb0c8f9dc0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002e516d54704b727248594459794567466d6373434654647a4b6f3154575346595046594239334d696d38456d467764000000000000000000000000000000000000 v: 0x1b r: 0x97acff26b4ac5

Caching Image Uploads Across Page Loads with Rails -

Image
caching image uploads across page loads rails problem let’s imagine have form create blogpost title, body, , thumbnail image, , validate attributes present. this: <% if @post.errors.any? %> <div> <h2><%= pluralize(@post.errors.count, "error") %> prohibited post being saved:</h2> <ul> <% @post.errors.full_messages.each |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div> <%= f.label :title %> <%= f.text_field :title %> </div> <div> <%= f.label :body %> <%= f.text_area :body %> </div> <div> <%= f.label :thumbnail %> <%= f.file_field :thumbnail %> </div> <div> <%= f.submit %> </div> <% end %> consider following sequence of events: user fills in body field, selects thumbnail upload,

'Reusing' Controllers in JavaFX -

first off, new world of javafx, might lack basic knowledge, sorry that. also, first time ask question, don't know how formulate it. what want quite basic: have multiple pages user can switch between pressing next/back. best way code changes made user there when returns page? not want textfields have same contents attributes. note: every page has own controller implements common interface. i have tried setting pages via loader , using loader.setcontroller() method , handing on controller object got loader.getcontroller() when first creating it, doesn't seem have effect. sorry if answered somewhere, couldn't find it. in advance takes time me! edit: code change pages in controllerholder class resourcebundle bundle = fxmlutil.getresourcebundle(); fxmlloader loader = new fxmlloader(); loader.setlocation(main.class.getresource( fxmlutil.getfxmlpagebyindex(pagenumber) )); loader.setresources(bundle); initwizardholder.getchildren().setall( (node) loader.load());

c# - Integration testing ASP.NET WebAPI controllers that use bearer authentication with identityserver3 -

i'm trying integration test web api controllers. application uses jwts authenticate users against resource server. to spool application, i'm using testserver found in microsoft.owin.testing. i can obtain valid jwt performing login browser do. proceed add jwt request follows: request.addheader("authorization", "bearer " + accesstoken.rawdata); that header arrives in owin pipeline. however, controllers protected [authorize] -attribute return 401 unauthorized when invoked. the api protected using identityserver3 thinktecture, relevant section looks this: var authority = "http://localhost:8080/idsrv/"; var parameters = new tokenvalidationparameters() { validaudiences = new[] { "implicitclient" } }; var options = new identityserverbearertokenauthenticationoptions { authority = authority, tokenvalidationparameters = parameters }; app.usei

c# - CollectionViewSource.SortDescriptions not work when binding items are created using Parallel -

i'm using vs2013, .net4.5, wpf desktop application. xaml: <collectionviewsource x:key="cvs" source="{binding obspasses, mode=oneway}"> <collectionviewsource.sortdescriptions> <scm:sortdescription propertyname="startdate"/> </collectionviewsource.sortdescriptions> </collectionviewsource> cs: this.obspasses = new observablecollection<passviewmodel>( passes.asparallel().select(x => new passviewmodel(x))); if remove .asparallel() , items sorted, if added, items in disorder. feel little strange. doesn't sortdescription guarantee ui items sorted no matter in order items added in background? in code demo didn't bind collectionviewsource, collection itself. try replacing <itemscontrol itemssource="{binding obsfoos, mode=oneway}" > with <itemscontrol itemssource="{binding source={staticresource cvs}}&qu

Instagram comment breaking Community Guidelines -

i'm trying post comment via instagram api on specific picture, , following error: apiinvalidparameterserror comment goes against our community guidelines. i have tried following: posting comment using same account, users picture. works fine. posting exact same comment using account, users picture. works fine!! so seems comment or posting account isn't problem lies, account receiving comment. the rules comment following according the developer documentation (and not break of them): the total length of comment cannot exceed 300 characters. the comment cannot contain more 4 hashtags. the comment cannot contain more 1 url. the comment cannot consist of capital letters. i have no idea in particular case goes against community guidelines, , have no idea on how find out is. has experienced similar , knows solution? unfortunately can't show actual comment since client trying post it, , might contain sensitive information.

Android Storing Socket.io object for multiple activities -

i making first socket.io based android application. socket sends , receives data web service. there number of screens in application different features. how use same socket connection in these different activities. i have tried setting , storing socket object in application class , appears work when application goes background , left there time application killed , socket object null causing aoo crash null pointer exception. public class myapplication extends application { private socket msocket; private final string tag = "application class"; public socket getsocket() { return msocket; } public socket createsocket() { try { manager manager = new manager(new uri("http://0.0.0.0")); } catch (urisyntaxexception urise) { urise.printstacktrace(); } return msocket; } } access socket in activities myapplication app; app = (myapplication ) getapplication(); app.getsocket; you ca

c++ - static 2d array initialisation -

how initialize static 2d array i trying initialize static 2d array statment 'static int b[n][m]={}' , showing error, while on giving const parameters, it's working 'static int b[2][10]={}' #include<iostream> using namespace std; void a(int c, int n, int m){ static int b[n][m]={}; // static int b[2][10]={}; , here working fine for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ b[i][j] = i+j; cout<<b[i][j]<<" "; } } } int main(){ int c; cin>>c; a(c,2,10); cout<<endl; return 0; } you initialized array 0. if whant initialize else try this static int ar[2][3]={{1,2,3},{4,5,6}};

junit - Fails to load Spring application context in tests with SpringJUnit4ClassRunner -

i can't figure out why spring can't load application context in test class defined follows: @runwith(springjunit4classrunner.class) @contextconfiguration(locations={"/springmvc-config/maincontroller-servlet.xml"}) public class diagnosticscontrollertest { @mock diagnosticsservice diagnosticsservice; private diagnosticscontroller diagnosticscontroller; private mockmvc mockmvc; @before public void setup() { mockitoannotations.initmocks(this); diagnosticscontroller = new diagnosticscontroller(); diagnosticscontroller.setservice(diagnosticsservice); this.mockmvc = mockmvcbuilders.standalonesetup(diagnosticscontroller).build(); } @test public void shouldrun() { asserttrue(1 == 1); } } the file 'maincontroller-servlet.xml' in "myproject\src\main\webapp\web-inf\springmvc-config\maincontroller-servlet.xml" the error is: java.lang.illegalstateexception:

html - Left and right arrow icons centered in a div -

i want place 2 icons navigation backward , forward in footer @ bottom of page space of 10px between them. the 2 icons must @ same vertical level , centered horizontally. how can that? <div id="footer"> <i id="left" class="fa fa-caret-left fa-5x"></i> <i id="right" class="fa fa-caret-right fa-5x"></i> </div> create container them centered horizontally , put them in there. long 2 icons aren't bigger screen shown side side. create space of 10px between them can add margin right of first element this: <!-- website --> <div style="text-align: center"> <span style="margin-right: 10px">icon</span><span>icon</span> </div> <!-- website --> replace span tags icons. edit: see edited question, code provided should sufficient add "text-align: center" css footer , "margin-right: 10px" css

javascript - how to change animate width property to transform scale -

i made progress bar loading images, bar's width animate 0 100%, how can make same function transform scale property? this actual code: https://jsfiddle.net/tibuakaw/db6d3o6h/ updateprogressbar: function() { $('#progress-bar').stop().animate({ 'width': (progressbar.loadedelmt / progressbar.countelmt) * 100 + '%' }); something this? $('#progress-bar').stop().animate({ 'transform': 'scalex(' + (progressbar.loadedelmt / progressbar.countelmt) + ')' }); of cause, should progress bar 100% width in css then

vue.js - Toggle class in Vue JS -

i'm looking toggle class using vue js. i've read through the class , style bindings documentation i'm still struggling figure out correct way toggle class. i've simplified code brevity, have list of 4 'plans', each 1 button allows user select plan want purchase. current code active class added when click button plan class remains on non-active plan. here html. <div id="app"> <ul class="plans"> <plan-component : name="basic" ></plan-component> <plan-component : name="recreational" ></plan-component> <plan-component : name="team" ></plan-component> <plan-component : name="club" ></plan-component> </ul> <template id="plan-component">

javascript - style "scoped" <style scoped> attribute not supported in chrome 36+. Any alternative or substitute for that? -

i using scoped attribute in style tag. not supported chrome browser. alternative or substitute achieving functionality work chrome browser. the way can achieve you're after use unique classname (or id) each 'section' , use inheritance sort-of namespace css. if want target 1 specific section of page, give it's parents classname (eg: class="testone") , make sure styles want apply section appended classname: .testone .title{...} .testone h1{...} .testone a{... etc. failing that, there jquery-based scope polyfill should give more browser-independent way of working scoped css. isn't i've worked don't have experience offer, looks promising few moments i've spent it! do remember javascript-based solution one, loads page without javascript enabled isn't going little niceties it's important ensure page still behaves in acceptable manner when js disabled. source : scoped style sheets without html5

wpf - I've created a ellipse in c#...bt i want to move ellipse around the canvas using mouse.....can anyone help? And i'm new to c# -

i've created ellipse in c#, want move ellipse around canvas using mouse. can help? i'm new c#. here's code. private ellipse drawellipse(canvas acanvas) { ellipse newellipse = new ellipse(); newellipse.width = 10; newellipse.height = 10; newellipse.fill = new solidcolorbrush(colors.royalblue); acanvas.children.add(newellipse); newellipse.setvalue(canvas.leftproperty, acanvas.actualwidth / 2.0); newellipse.setvalue(canvas.topproperty, acanvas.actualheight / 2.0); return newellipse; } i'm new wpf i'll explain understood far , how ellipse. since i'm wpf beginner too, explanation may approximatation please don't burn me alive. post may long wpf , mvvm first, have "view", xaml code (a description language xml-like syntax. each tag correspond class in .net framework) , design you'll see. when using wpf, should try implement mvvm pattern. in pattern, design

Python: installation error -

i'm trying install python 3.5.2 on windows vista home premium x32 . while installing windows pops window saying "python stops working" . installation continues, ends , says successfull. of course wasn't because when want run python error occurs saying can't find api-ms-win-crt-runtime-|1-1-0.dll suggestions? the python 3.5.2 can't install because api-ms-win-crt-runtime-|1-1-0.dll missing computer.you have install windows updates: go start - control panel - windows update check updates install available updates. after updates installed, restart computer, , try install python 3.5.2

textview - Is it possible to getText() and setTextColor() at the same time in android? -

i want ask, there textview api can use gettext() , settextcolor() @ same time? mean, if in code, should below: textview.gettext().equals("hehe").settextcolor(r.color.red); i appreciate answer or suggestion here. lot! no not possible. function equals returns boolean not textview . you should try: if (textview.gettext().equals("hehe")) { textview.settextcolor(r.color.red); }

c# - Error accessing ThreadStart object inside a function -

i stuck @ peculiar issue , want in resolving this. i have following code below public partial class frmsoftjobprocess : form { private bool instancefieldsinitialized = false; public frmsoftjobprocess() { initializecomponent(); load += frmjobprocess_load; formclosing += frmjobprocess_formclosing; if (!instancefieldsinitialized) { initializeinstancefields(); instancefieldsinitialized = true; } } private void initializeinstancefields() { plotlensprofilethreaddelegate = new threadstart(plotlensprofilethreadfunction); plotlensprofilethread = new thread(plotlensprofilethreaddelegate); plotlensplanthreaddelegate = new threadstart(plotlensplanthreadfunction); plotlensplanthread = new thread(plotlensplanthr

javascript - Simple JS function in order to set a list of checked boxes in a form does not work -

Image
so i'm i'm using basic js , php write form. in form have several checkboxes in user can click add object. <div class="input-group input-group-sm"> <span class="input-group-addon">tube(s) : </span> <input id="tube" name="tube" type="text" class="form-control" placeholder="ex :th2132a" style="display:none" required> </div> <div style="max-height:150px;overflow:auto;margin:5px;border: 1px solid;"> <table class="table table-striped" > '.$this->tabtubemodif().' </table> </div> as u see i'm calling function in order build table contains checkboxes. function checks related object attributes in order render correct information in form. public function tabtubemodif($outil){ $tubes=type::findall(); $res=''; foreach ($tubes $tube){ if (in_array(str_replace(&q

java - extract from a multiple json -

i have json this: [{"id":"****","value":"*****","date":"****"}, {"id":"****","value":"*****","date":"****"}, {"id":"****","value":"*****","date":"****"}, {"id":"****","value":"*****","date":"****"}] every "sub-json" want convert model object.(an object contains attributes id value , date). how can it? thank you. you got array of objects. jsonarray jsonarray = new jsonarray(jsonstr); (int = 0; < jsonarray.length(); i++) { jsonobject jsonobject = jsonarray.getjsonobject(i); string id = jsonobject.getstring("id"); string value = jsonobject.getstring("value"); }

swift2 - Passing arguments to #selector method in swift -

this question has answer here: pass argument uitapgesturerecognizer selector 3 answers i want pass multiple argument function while click image. here code var param1 = 120 var param2 = "hello" var param3 = "world" let image: uiimage = uiimage(named: "imagename")! bgimage = uiimageview(image: image) let singletap = uitapgesturerecognizer(target: self, action:#selector(welcomeviewcontroller.tapdetected(_:secondparam:thirdparam:))) singletap.numberoftapsrequired = 1 bgimage!.userinteractionenabled = true bgimage!.addgesturerecognizer(singletap) calling function func tapdetected(firstparam: int, secondparam: string, thirdparam: string) { print("single tap on imageview") print(firstparam) //print 120 print(secondparam) // print hello print(thirdparam) /print world } how can pa

javascript - Google Tag Manager for 2 separate webapps on same host -

i have 2 web apps work (seamlessly users' perspective), deployed same tomcat instance. have added google tag manager code both respective index.html files. 1 of them works , other not (by mean console not appear doing gtm activity when hit url) i'm new tagmanager maybe being naive. need separate tag manager registration each app? <noscript><iframe src="//www.googletagmanager.com/ns.html?id=gtm-my-code" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new date().gettime(),event:'gtm.js'});var f=d.getelementsbytagname(s)[0], j=d.createelement(s),dl=l!='datalayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentnode.insertbefore(j,f); })(window,document,'script','datalayer&#

Add custom metadata to items in A360 using Autodesk Forge -

i looking way tag item in a360 metadata using autodesk forge. example: have revit file stored in a360 , want put metadata on object such author, department, duedate etc. supported in api? unfortunately, far can see in data management api reference , there no such feature exposed yet. i'm checking development team , log wish it. suggested workarounds be: 1/ store data in revit file properties extracted, able access them model derivative api 2/ use custom side database store item urn mapped third party metadata 3/ add file dm contains metadata attributes

php - exploding textarea values into multiple array -

exploding textarea value this: explode("\n", $input); would result in 1 array. currently, storing $input in textarea this: a1 a2 a3 b1 b2 b3 c1 c2 c3 but want multiple array result this: $test[0][0] = 'a1'; $test[0][1] = 'a2'; $test[0][2] = 'a3'; $test[1][0] = 'b1'; $test[1][1] = 'b2'; $test[1][2] = 'b3'; $test[2][0] = 'c1'; $test[2][1] = 'c2'; $test[2][2] = 'c3'; any idea, how can implement? explode two newlines separate groups, explode each group single newline: $result = array_map( function ($group) { return explode("\n", $group); }, explode("\n\n", $input) );

android - DexIndexOverflowException when running androidTests -

when running ./gradlew clean connectedwithanalyticswithclouddebugandroidtest getting error: * went wrong: execution failed task ':android:transformclasseswithdexforwithanalyticswithclouddebug'. > com.android.build.api.transform.transformexception: com.android.ide.common.process.processexception: java.util.concurrent.executionexception: com.android.dex.dexindexoverflowexception: method id not in [0, 0xffff]: 65536 but on app-side safe: ./gradlew clean assemblewithanalyticswithcloudrelease ends in: total methods in gobandroid-2.4.1-withanalytics-withcloud-release-unsigned.apk: 31976 (48.79% used) total fields in gobandroid-2.4.1-withanalytics-withcloud-release-unsigned.apk: 14955 (22.82% used) methods remaining in gobandroid-2.4.1-withanalytics-withcloud-release-unsigned.apk: 33559 fields remaining in gobandroid-2.4.1-withanalytics-withcloud-release-unsigned.apk: 50580 build successful i not want activate multidex not needed app - run tests. there way enable mul

python - Flask SQLalchemy order_by value joined from two Tables -

currently cant figure out how perform proper join in sqlalchemy, have 2 tables user , room each room submited user , why each room has users_id foreign key . user has attribute has_payed . what want query rooms in city (works fine) , order these results user.has_payed value. shall show first rooms belong users have has_payed == true . what doing: room.query.join(room.users_id).order_by(user.has_payed) that tables: class user(usermixin, base): __tablename__ = 'users' id = column(integer, primary_key=true) username = column(text, nullable=false, unique=true) password = column(text, nullable=false) has_payed = column(boolean, default=false) vorname = column(text, nullable=true) nachname = column(text, nullable=true) email_verified = column(boolean, default=false) handynummer = column(text, nullable=true) email = column(text, unique=true) # foreign key addresses = relationship('room', back_populates="us

orm - Changing the structure of results object in CakePHP 3 -

i have query in cakephp returns data object in following structure: [ { "join_id": 1, "contract_id": 1, "title": "title", "sales": 500, "earnings": 50, "publisher": "publisher", "end_date": "2016-11-15" }, { "join_id": 2, "contract_id": 1, "title": "title", "sales": 500, "earnings": 50, "publisher": "publisher", "end_date": "2016-01-15" }, { "join_id": 3, "contract_id": 2, "title": "title", "sales": 500, "earnings": 50, "publisher": "publisher", "end_date": "2016-05-15" } ] what want change structure split contract_id , , fields relating children calculated, this: [ { "cont

azure mobile services - Can the .NET client send updates in batches during a PushAsync instead of one row at a time? -

we have azure mobile app application using .net client library of azure mobile apps. whenever pullasync, client pulls down data in batches of 50 records per http request/response. pushasync sends one patch http request per modified row . our use case involves update of potentially hundreds of rows, slow. is possible tell azure mobile apps batch several updates 1 http request during push? another (related) issue push sends entire row modified, not modified fields. increases json size unnecessarily. possible tell azure mobile apps include modified columns in json? no, "batch update" functionality not directly available. can simulate custom api, have careful on sequencing. the push needs send fields - pretty requirement of wire protocol.

node.js - Using npm 'request' to scrape data from a stock website -

i have searched around , can't find impossible or doing wrong. http://www.investing.com/commodities/ has list of numbers want at. when run var request = require('request'); var url = 'http://www.investing.com/commodities/'; request(url, function(error, response, body){ console.log(response.statuscode) //403 }) im getting 403 statuscode response. free website can go to, why can't node server response it? thanks response (that's not 403...!)

android implement dropdown with SearchView in activity -

in activity use searchview , want implement dropdown when result occurred possible ?? in adavance. searchactivity.java code protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.search_activity); issearchvisible = false; ishomevisible = true; mactivity = this; mcontext = getapplicationcontext(); msearchview = (searchview) findviewbyid(r.id.m_searchview); edtfromdate = (edittext) findviewbyid(r.id.edt_from_date); edtenddate = (edittext) findviewbyid(r.id.edt_end_date); btnsearchnow = (button) findviewbyid(r.id.btn_search_now); int searchplateid = msearchview.getcontext().getresources() .getidentifier("android:id/search_plate", null, null); view searchplateview = msearchview.findviewbyid(searchplateid); if (searchplateview != null) { searchplateview.setbackgroundcolor(color.white); } } search_activity.xml code <?xml versi

opengl - How to flip only one axis of transformation matrix? -

Image
i have 4x4 transformation matrix. however, after trying out transformation noticed movement and rotation of y axis going opposite way. rest correct. i got matrix other api difference of coordinate system. so, how can flip axis of transformation matrix? if translation can add minus sign on y translation, have no idea opposite rotation of 1 axis since rotation being represented in same 3x3 area. thought there might way affect both translation , rotation @ same time. (truly flipping axis) edit: i'm pretty sure operation you're looking changing coordinate systems while maintaining z-up or y-up. in case, try setting elements of second column (or row) of matrix inverse. this question better math stackexchange. first, a helpful read on rotation matrices . the first problem matter of rotation order. assuming xyz rotation order. know rotation matrices each axis follows: given matrix derived same rotation order, resulting matrix follows, alpha x angle, beta y

c# - Using Session is giving error -

i have aspx page calling function below public static string funfillemp(object[] args) { string strprireturn = ""; dataaccesslayer objpridt = new dataaccesslayer(); datatable dt = new datatable(); dt = objpridt.executedatatable("select mkey,emp_name,emp_card_no emp_mst "+ "department_mkey='" + args[0].tostring() + "' , status in ('a','s') , hub_mkey in " + "(select hub_mkey emp_mst e,user_mst u e.mkey=u.employee_mkey , e.status in ('a','s') "+ "and u.mkey='" + session["userid"].tostring().trim() + "') " + "order 2"); if (dt.rows.count > 0) { (int intprii = 0; intprii

networking - Freeradius server authentication issue -

i'm thinking of using radius in open network allow navigation in local pages, , require authentication internet access. there way configure freeradius in way? example, have nodejs app , freeraduis running in ubuntu server, when user connects network, redirect page let's him use nodejs app, or sign in internet use no. need use captive portal server coova in order provide walled garden functionality. freeradius implements network policies.

android - Implententing a swipe view using a Fragment -

Image
i designing constitution app , want use tabbed layout swipe view. tabs data database using custom adapter. since data size (no of fragment) unknown, want every swipe generate new view different chapter content constitution. i want looks dictionary app below, swipe labels on both sides. familiar tabs love resource me achieve this, since documentation have seen doesn't explain this. thanks modify desired output oncreate arraylist<mcqquestionbean> mcqquestionbeans= new arraylist<mcqquestionbean>(); adapter = new newsfragmentpageradapter(getsupportfragmentmanager(), mcqquestionbeans, mcqtestactivity.this); pager.setadapter(adapter); base adapter public class newsfragmentpageradapter extends fragmentstatepageradapter { private arraylist<mcqquestionbean> mcqquestionbeans; private mcqquestionfragment fragment; private activity context; public newsfragmentpageradapter(fragmentmanager fm, arraylist<mcqquestion

qt - Qt5 / PyQt5 : Custom QML components with QML frontend and Python backend -

i want create qml module python "backend" if makes sense. basically, want use qml define how component looks, , implement specific behavior in python class, should extend qml-type , - in imagination - somehow must linkable qml component. i understand how create custom class in python , making available qml via qmlregistertype. works far, drawing has implemented in class - no qml (basically, want simliar way done in kivy kv-language) a small example: i implemented simple colorpicker widget this: class colorwheel(qlabel): radius = 0 color_changed = pyqtsignal(float, float) def __init__(self, width, height): super().__init__() pixmap = qpixmap("colorwheel.png").scaled(width, height) self.setfixedsize(width, height) self.setpixmap(pixmap) self.radius = width / 2 def mousereleaseevent(self, event): # {...} mouse position, calc polar corrdinates (omitted) # emit signal: new color se

Python pymssql error "TypeError: argument of type 'NoneType' is not iterable" when connecting to SQL server -

i getting error "typeerror: argument of type 'nonetype' not iterable" when attempting connect sql server. believe error being generated on line connect sql server itself, second print statement never used, though wrong. i using pymysql-2.1.3, , python 3.5.1 server = getenv("####") user = getenv("####") password = getenv("####") database = getenv("####") print("hi") conn = pymssql.connect(server, user, password, database) print("hi2") cursor = conn.cursor() cursor.execute("####" "select name, sourcetable, sourcetableid dbo.attachment name '%icad%'") conn.close() print("connect sql complete") this results in error: traceback (most recent call last): hi file "c:/convert.py", line 62, in <module> connect_to_sql() file "c:convert.py", line 15, in connect_to_sql conn = pymssql.connect(server, user, password, d

web applications - hosting webapplication on wordpress website -

i have wordpress installed in root http://ibdaa.info need make sub-directory likee: http://ibdaa.info/app , upload website sub-directory contain (html,css,js) make try upload site previous link seem doesn't work you have upload files present in root folder of http://ibdaa.info http://ibdaa.info/app , change site_url , wordpress_url backend new url in case http://ibdaa.info/app , have change new url point /app directory in .htaccess file also. a similar way define constants in wp-config.php file new url's define('wp_home','http://ibdaa.info/app'); define('wp_siteurl','http://ibdaa.info/app');

c - finding a pair with given sum in BST -

struct node { int val; struct node *left, *right; }; // stack type struct stack { int size; int top; struct node* *array; }; struct stack* createstack(int size) { struct stack* stack = (struct stack*) malloc(sizeof(struct stack)); stack->size = size; stack->top = -1; stack->array = (struct node**) malloc(stack->size * sizeof(struct node*)); return stack; } what statement do? stack->array = (struct node**) malloc(stack->size * sizeof(struct node*)); what memory representation of it? stack->array = (struct node**) malloc(stack->size * sizeof(struct node*)); struct node** returns pointer pointer (to stack) stack->size amount of items of stack sizeof(struct node*) size of pointer node. so creates array of pointers, each pointer points 1 element within stack.