Posts

Showing posts from January, 2012

ruby on rails - How to pass query string and POST params in grape -

ruby on rails - How to pass query string and POST params in grape - i using grape restful api . want create post method post parameters , query string parameters. how utilize them? can give me nice example? i know pass query string params(key, sign) follows. how utilize post params. want pass post params (say name,id). how in code. https://www.abc.com/api/v2/list?key=abc&sign=xyz i have code follows post :new_user key = params[:key] sign = params[:sign] httparty.post("https://www.abc.com/api/v2/list?key=abc&sign=xyz") end in add-on want pass post params (say name,id). how that? ruby-on-rails ruby-on-rails-4 grape grape-api

javascript - How to make element not to choose first option as selected by default? -

javascript - How to make <select> element not to choose first option as selected by default? - i'm using jquery interdependencies library building complex form (when show fields depend on values other fields). so, have <select> element <select placeholder="select product id type" id="form_product_id_type" name="form_product_id_type"> <option label="01 - proprietary" value="01">01 - proprietary</option> <option label="02 - isbn-10" value="02">02 - isbn-10</option> <option label="03 - gtin-13" value="03">03 - gtin-13</option> <option label="04 - upc" value="04">04 - upc</option> <option label="05 - ismn-10" value="05">05 - ismn-10</option> ... </select> if user selects alternative "01" should show field "typedescription&

jquery - How to generate Clickable popup box? -

jquery - How to generate Clickable popup box? - hi all, know how generate kind of popup box using jquery or other library. popup box should clickable until mouse on it. you can utilize tooltip widget provided jquery ui library. http://jqueryui.com/tooltip jquery css jquery-ui

c++ - How to catch undefined behaviour without executing it? -

c++ - How to catch undefined behaviour without executing it? - in software using input values user @ run time , performing mathematical operations. consider simplicity below example: int multiply(const int a, const int b) { if(a >= int_max || b >= int_max) homecoming 0; else homecoming a*b; } i can check if input values greater limits, how check if result out of limits? quite possible a = int_max - 1 , b = 2 . since inputs valid, execute undefined code makes programme meaningless. means code executed after random , may result in crash. how protect programme in such cases? this comes downwards want in case. for machine long or long long (or int64_t ) 64-bit value, , int 32-bit value, (i'm assuming long 64 bit here): long x = static_cast<long>(a) * b; if (x > max_int || x < min_int) homecoming 0; else homecoming static_cast<int>(x); by casting 1 value long , other have converted well. can cast

jquery - Javascript onkeyup too "slow"? .hide() works only with onkeydown -

jquery - Javascript onkeyup too "slow"? .hide() works only with onkeydown - i using function show div: function showcmd() { $("#cmd").show("fast"); $('#cmdtext').focus(); } this happens, if user typing "cmd" on keyboard. main code: document.onkeyup = function(event) { //save lastly 3 keys 1 = two; 2 = three; 3 = event.keycode; if (one == 67 && 2 == 77 && 3 == 68 && cmdopen == false) { showcmd(); } //if pressed key come in , textarea focused if (event.keycode == 13 && $("#cmdtext").is(":focus") == true) { //passing code function execcmd(document.getelementbyid("cmdtext").value); //empty textarea - works great document.getelementbyid("cmdtext").value = ""; homecoming false;

c# - ASP.NET MVC Page-URL and Controller/Action Routing -

c# - ASP.NET MVC Page-URL and Controller/Action Routing - i have problems building asp.net mvc page allows 2 sorts of routing. i have database pages stored url-path like: /site1/site2/site3 tried utilize irouteconstraint in first route, check wether requested site site database (permalink). in sec case, want utilize default asp.net mvc {controller}/{action} functionality, providing simple acces *.cshtml. now don't know if best way. furthermore have problem, how root iroutecontraint. does have experiance this? i'm using asp.net mvc 5. problem solved, final solution: adding 2 routes: routes.maproute( "friendlyurlroute", "{*friendlyurl}" ).routehandler = new friendlyurlroutehandler(); routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "page", action = "load", id = urlparameter.optional }, namespaces: controllernamespaces.toar

excel - Make string comparison case insensitive -

excel - Make string comparison case insensitive - i've searched didn't find explained vba. how create string comparison, such this, case insensitive: if ubound(arr) > 0 each word in wordsarr each element in arr if word = element counter = counter + 1 next next else ' cell search empty counter = 0 end if like this: lcase(word) = lcase(element) or ucase(), if words in wordsarr lowercase (uppercase) can utilize lcase(ucase) on left side of comparison. excel vba excel-vba

eclipse - Android - Google Maps Grey Screen on Signed APK -

eclipse - Android - Google Maps Grey Screen on Signed APK - i have pretty simple android app uses google maps api display map few pins. when run project on device through eclipse, working fine. however, when export signed apk , install on device through google play store, grayness screen in place of map. i'm not getting errors in logcat, don't know begin debugging. have ideas? check if date , time in smartphone correct. android eclipse google-maps

Android App Signature Key -

Android App Signature Key - i want key-hash signed signature of android app can integrate facebook login in android app. have created signed signature using androidtools-->export signed application package. how can read key generated in signature file. solution 1: try link: http://www.helloandroid.com/tutorials/using-facebook-sdk-android-development-part-1. found using facebook method of getting hash key did not work advertised. link however, has different method of getting hash key , has pretty much worked. solution 2: that beingness said, found simplest thing was, allow facebook sdk tell hash key is. far more simpler , shouldn't take more couple of minutes. step 1: in facebook sdk, locate util.java class. in that, alter this: private static boolean enable_log = false; to: private static boolean enable_log = true; step 2: create new signed apk, transfer device , install. if installed, naturally, prompt. step 3: ddms (logcat) running , device connect

java - Supporting special characters in printing -

java - Supporting special characters in printing - a more accurate question here i have dbf database file containing several names , info of employees... , java application reads rows database , prepare papers (like work certificate...). , utilize special characters in names since it's francophone country. illustration "hédia" or "fayçal".. problem here database contains names special characters mentioned, , when printing papers in question, characters not supported , empty white space shown instead. hope making myself clear. so there way programmatically create printing back upwards these characters? i know there's locale class in java don't know if possible utilize printing purposes. i hope problem gets solved , give thanks in advance help. edit: create table way i'm using normal table constructor , add together info i'm using class fetches info database , returns object [], , method class since it's more 1 row.

flash - Action script 2.0 money system -

flash - Action script 2.0 money system - i'm looking little coding help. i have 3 dynamic textlabels. first called "money", sec called "bet" , 3rd called "win". the "money" textlabel money player has. , want textlabel "bet" 20 percent of "money" text. lets has 100$. want "bet" 20$. if money 200$ want "bet" 40$ etc. how code this? want "win" 150 % of "bet" label. sorry if bit messy, if understood , know happy :) thanks flash actionscript actionscript-2 flash-cs5

osx - DBPedia Live mirror setup on Mac OS X -

osx - DBPedia Live mirror setup on Mac OS X - i trying set dbpedia live mirror on personal mac machine. here technical host info setup: operating system: os x 10.9.3 processor 2.6 ghz intel core i7 memory 16 gb 1600 mhz ddr3 database server used hosting info dbpedia live mirror: openlink virtuoso (open-source edition) here's summary of steps followed far: downloaded initial info seed dbpedia live as: dbpedia_2013_07_18.nt.bz2 downloaded synchronization tool http://sourceforge.net/projects/dbpintegrator/files/. executed virtload.sh script. had tweak commands in here compatible os x. adapted synchronization tools configuration files according readme.txt file follows: a) set start date in file "lastdownloaddate.dat" date of dump (2013-07-18-00-000000). b) set configuration info in file "dbpedia_updates_downloader.ini", such login credentials virtuoso, , graphuri. executed "java -jar dbpintegrator-1.1.jar" on command line. script re

ios - how to determine what pan view is in what index -

ios - how to determine what pan view is in what index - i have app 3 uiimageviews on screen. each 1 has uipangesture connected it. having problem determining pan view goes box. (see image below.) white boxes determine if pan view in them cgrectcontainspoint(). main problem getting text out of labels in image views. since different, how can know 1, 2, 3 kind of indexing pan's view in box? here code. if (pan.state == uigesturerecognizerstateended) { ++_countsofar; // _countsofar ivar if (cgrectcontainspoint(self.view1.frame, pan.view.center)) { pan.view.tag = 1; } else if(cgrectcontainspoint(self.view2.frame, pan.view.center)) { pan.view.tag = 2; } else pan.view.tag = 3; nslog(@"counts = %d", _countsofar); } if (_countsofar == carlevels) { nsstring *s1 = [[self.view viewwithtag:pan.view.tag].subviews[0] text]; _countsofar = 0; //reset count

Python comparing two files partially -

Python comparing two files partially - i have 2 input file: input 1: okay sentence 2 runway 3 runway right runway 1 pathway four pathway 0 pathway input 2 : okay sentence 2 runway 3 runway right runway 0 pathway one pathway 4 pathway i have used next code: def diff(a, b): y = [] x in a: if x not in b: y.append(x) else: b.remove(x) homecoming y open('output_ref.txt', 'r') file1: open('output_ref1.txt', 'r') file2: same = diff(list(file1), list(file2)) print same print "\n" if '\n' in same: same.remove('\n') open('some_output_file.txt', 'w') fo: line in same: fo.write(line) and expected output : one pathway zero pathway but output getting empty output this. problem don't know how store content files list partially ,then compare , read there. can help me in regard ?? it seems if want have mutua

Android: why use intent.putExtra() method? -

Android: why use intent.putExtra() method? - this real noob question i'm sure, finding quite perplexing. why earth want ever utilize intent.putextra method share info between classes in android? let me explain. making first android app next instructions developers guide (i @ moderate level java) , using code looks this: //class field //key holds string????? not understanding this... public static final string extra_message = "self.anon.myfirstapp.message"; //this method activated button beingness pressed public void sendmessage(view view) { intent intent = new intent(this,displaymessageactivity.class); edittext edittext = (edittext) findviewbyid(r.id.edit_message); string message = edittext.gettext().tostring(); //puts string message within string extra_message - why???? intent.putextra(extra_message, message); startactivity(intent); } ok firstly want point out see happening , part how works (am confused field declarati

node.js - Socket IO cant connect to server when running express -

node.js - Socket IO cant connect to server when running express - i trying write little app using node.js express.js , scoket.io. the server runs fine , can serve html , other static content. im having hell of time getting clients connect via socket.io server. when don't utilize express express works fine, express can't seem cooperate. not sure if there special considerations when using express , socket.io in conjunction. part of me things route issue? it looks when socket tries connect 404'ing get http://localhost:3000/socket.io/1/?t=1403186531515 400 bad request 1ms server code: var express = require('express') , app = express() , http = require('http') , server = http.createserver(app).listen(3000) , io = require('socket.io').listen(server) , favicon = require('static-favicon') , logger = require('morgan') , cookieparser = require('cookie-parser') , session = require('express-sessi

excel - Moving cursor by one character instead of one cell -

excel - Moving cursor by one character instead of one cell - title says all. if edit cell in excel , press left/right arrow cell selection jumps corresponding cell instead of moving 1 character left/right you'd expect in edition mode. i tried shortcuts, alt + arrow , ctrl + arrow , shift + arrow , don't know how google because can't find helpful... i'm aware that's totally basic problem create life much easier! while in cell, can nail f2 key , allow move around within cell. excel excel-2010

Compress/uncompress LZMA strings in Java -

Compress/uncompress LZMA strings in Java - on client side, have lzma-js compressing plain text , sending server string. far, lzma java implementations i've found takes file or inputstream argument. there implementation uses string straight input or should write inputstream string wrapper around info goten client? just wrap string in inputstream: inputstream stream = new bytearrayinputstream( lzmastring.getbytes(standardcharsets.utf_8) ); now can utilize string source inputstream library wants consume. java string lzma

chutzpah - PhantomJS being invoked while discovering unit tests. Why? -

chutzpah - PhantomJS being invoked while discovering unit tests. Why? - running chutzpah 3.2.2.0 command line tests discovered , executed in 40 seconds, think speed more 100 unit tests split several files: chutzpah.console.exe path\to\myprojectrootfolder\chutzpah.json however, in visual studio, takes 9-10 minutes list of tests loaded in test explorer. monitoring vs process explorer, noticed process "vstest.discoveryengine.x86.exe" calling phantomjs.exe several times during discovering process. my understanding chutzpah require phantomjs execute tests in browser context, , tests execution. maybe misunderstanding process here. my chutzpah.json file: { "framework":"qunit", "typescriptcodegentarget":"es5", "testfiletimeout":"60000", "compile": { "extensions": [ ".ts" ], "extensionswithnooutput": [ &

ios - How to timeout or detect slow response in AFHTTPSessionManager in AFNetworking? -

ios - How to timeout or detect slow response in AFHTTPSessionManager in AFNetworking? - with code below, failure block fires if there no net connection - , good. if there connection, no internet? i've read question: how set timeout afnetworking suggests utilize reachabilitymanager , illustration in reply shows utilize - afnetworking 2.0 queue request when device offline setreachabilitystatuschangeblock nothing. but, if simulator or phone connected wifi network not have net access (dns, dhcp, or modem issues), code @ nowadays continues seek reach api long time. i'm not downloading , know script , server should respond in seconds know after 5 seconds of inactivity, wrong. so can safely timeout, or can utilize reachabilitymanager in current script observe if script (not internet) not reachable , if so, how? - (void)apicall:(nsmutabledictionary*)params { nsurl *baseurl = [nsurl urlwithstring:baseurlstring]; nsdictionary *parametersgetauthcode = @{@&

d3.js - combining force and pack layouts in d3 -

d3.js - combining force and pack layouts in d3 - i have graph represented standard forcefulness layout. nodes can clustered attributes. can represent these clusters pack layout? how 2 layouts coexist , how x , y coordinates of nodes calculated? edit i'm thinking might have process info turn node clusters individual nodes containing cluster hierarchy attribute. still welcome alternative way doesn't forcefulness me reshape info if possible. here illustration dataset transformed fit multi layout approach. issue here cannot link of nodes inside cluster. { "directed": true, "graph": [], "nodes": [ { "id": "node0" }, { "id": "node1" }, { "id": "node2", "tree": { "name": "cluster", "children": [

c++ - How to make QFileDialog not modal in Qt5? -

c++ - How to make QFileDialog not modal in Qt5? - in previous versions of qt able utilize next constructor of file dialog: qfiledialog(qwidget * parent = 0, const char * name = 0, bool modal = false) so, looks possible create non-modal file dialog. (in qt5) haven't such parameters in constructor. qfiledialog ignores setwindowmodality(qt::nonmodal); , setmodal(false); (i've checked, if windowmodality() == qt::nonmodal && ismodal() == false , file dialog window still modal). do have ideas, how create file dialog non-modal? details: file dialog inherited qfiledialog. works absolutely expected. thing need create non-modal, can't find solution on , on qt-project. give thanks in advance. the "problem" open file dialog modal window calling qdialog::open() function. according qt docs qdialog::open() : shows dialog window modal dialog, returning immediately. to create file dialog non modal open qdialog::show() . c++ qt

Joomla 3.3 - where to find html source editor and edit it -

Joomla 3.3 - where to find html source editor and edit it - i have installed joomla 3.3 , couldn't find html source editor embed html code in website. i'm not sure if you're referring joomla's text editor or editing template html markup i've added screenshots both: text editor: template editing: if go template files, open see (on left hand side) index.php file contains html markup template. recommend using module rather editing templates core files html joomla website

c# - Making a colorable image - changing the image's source in code behind messes up events -

c# - Making a colorable image - changing the image's source in code behind messes up events - i'm trying create colorableimage custom control, not sure if trying possible. class rather straightforward: public class colorableimage : image { private bool changedbycolor { get; set; } public static readonly dependencyproperty colorproperty; public static readonly dependencyproperty uncoloredsourceproperty; static colorableimage() { defaultstylekeyproperty.overridemetadata(typeof(colorableimage), new frameworkpropertymetadata(typeof(colorableimage))); sourceproperty.overridemetadata(typeof(colorableimage), new frameworkpropertymetadata(new propertychangedcallback(sourcechanged))); colorproperty = dependencyproperty.register("color", typeof(color), typeof(colorableimage), new frameworkpropertymetadata(new propertychangedcallback(colorchanged))); uncoloredsourceproperty = dependencyproperty.register("uncol

ios - Xcode logging only previously selected table view cell once a new cell is selected -

ios - Xcode logging only previously selected table view cell once a new cell is selected - i've got table view , each time select new select, logs stats of cell selected before it. so let's select cell b, won't log if that's first cell i've selected since opening table view. if select cell a, log stats of cell b.. if select cell c log cell a's stats, etc. any thought why? code below: - (void) tableview:(uitableview *)tableview diddeselectrowatindexpath:(nsindexpath *)indexpath { feeditem *feeditem = [[feeditem alloc] init]; feeditem = [self.feeditemlist objectatindex:indexpath.row]; nslog(@"%@ username", feeditem.username); } wrong method. want didselectrowatindexpath . yours deselect instead of select ios objective-c uitableview

winapi - Log OutputDebugString to a file (without DebugView) -

winapi - Log OutputDebugString to a file (without DebugView) - my wpf app consumes third-party win32 dll logs messages via outputdebugstring. i can see outputdebugstring messages in visual studio or via debugview, don't want inquire client run debugview. i'd capture messages outputdebugstring , automatically log them file, if client has problem, can inquire send me log file. is possible? or user have start debugview, reproduce error, , send me log way? @cody gray's suggestion "write own debug listener, , you've written inferior clone of debugview" sounds might reply question. here's a c# implementation of basic outputdebugstring capture tool. i'd seen in googling couple of times, eyes glazed on it, assuming, "that can't perchance want, can it?" turns out, might reply question. winapi

Kendo foreign key column filter not working for the category name -

Kendo foreign key column filter not working for the category name - http://jsbin.com/cadevaha/1/edit?html,js,output click above link have reproduced situation. have foreign key column category returns category name based upon product name value. want filter based upon foreign key value category name.in simple terms, filtering not happening category column. this because have not specified type of column. this done through datasource.schema.model.fields configuration. <head> <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.416/styles/kendo.common.min.css"> <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.416/styles/kendo.rtl.min.css"> <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.416/styles/kendo.default.min.css"> <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.1.416/styles/kendo.dataviz.min.cs

indexoutofboundsexception - Java- adding a new row to a JTable in GUI -

indexoutofboundsexception - Java- adding a new row to a JTable in GUI - i have simple java gui displaying empty table , few buttons. trying add together listener 1 of buttons add together new empty row (with editable cells) table in gui. i using next code seek , this: jbutton addbtn = new jbutton("add"); addbtn.addactionlistener(new actionlistener(){ public void actionperformed(actionevent e){ system.out.println("'add' button pressed. "); defaulttablemodel model = (defaulttablemodel)jentityfiltertable.getmodel(); model.addrow(new object[]{"site", "application", "entity"}); system.out.println("--- actionlistener added 'addbtn' ---"); } }); however, when click button, getting java.lang.arrayindexoutofboundsexception . says occurring on next line: model.addrow(new object[]{"site", "application", "entity"}); i not sure why

css - How to change the bottom border radius? -

css - How to change the bottom border radius? - so, checked on googlehow it, people tell me code is: border-bottom-radius: value; on chrome* of course. tried , seems doesnt work. if guys help me, i'm here, waiting help! :d use border-bottom-left-radius , border-bottom-right-radius use border-top-left-radius , border-top-right-radius or utilize shorthand notation, describe @ css3 border radius shorthand solution, instance: border-radius: 0 0 25px 25px; css

mysql - Error: column is invalid because it is not contained in either an aggregate function or the GROUP BY -

mysql - Error: column is invalid because it is not contained in either an aggregate function or the GROUP BY - i have such code, works fine: select count (cast(faculty nvarchar(max))) num pupil grouping cast(faculty nvarchar(max)) faculty text. need count number of faculty in column, tried code, give error: column 'student.faculty' invalid in select list because not contained in either aggregate function or grouping clause. select faculty, count (cast(faculty nvarchar(max))) num pupil grouping cast(faculty nvarchar(max)) i cant understand, problem, because same method works fine numbers. illustration one: select id, count(id) pupil grouping id what doing wrong? you error because don't grouping same select. cast(faculty nvarchar(max)) not equal faculty . why not use: select faculty, count (*) num pupil grouping faculty mysql sql oracle tsql group-by

ember.js - how make if statement emberjs with a true or false in a json file -

ember.js - how make if statement emberjs with a true or false in a json file - i want create if statement in ember template checks if user logged_in or not the server returns following: {"status":"ok","logged_in":false} or {"status":"ok","logged_in":true} if user logged in show form else show content how check what's "logged_in" status with? can utilize in ember template: {{#if logged_in}} show form {{else}} show content {{/if}} that's how it! problem have how appropriately set context. simplicity, let's homecoming model hook, set context of related template. in case below, i've associated index route, , nail index route/template when nail root of our app. app.indexroute = ember.route.extend({ model: function() { homecoming {"status":"ok","logged_in":false}; } }); http://emberjs.jsbin.com/zohabeti/1/edit json ember

javascript - AngularJS directive only called once? -

javascript - AngularJS directive only called once? - i'm trying shove mixitup within angular page , in order made directive module it angular.module('mainctrl', []) .controller('maincontroller', function($scope) { $scope.tagline = 'to moon , back!'; }) .directive('mixitcontainer', function() { homecoming { restrict: 'a', link: function(scope, element, attrs) { $(element).mixitup(scope.$eval(attrs.mixitcontainer)); } }; }); don't worry simplicity of main controller, test. now, issue directive get's called once! if go page , inquire angular load controller , go home page , inquire angular load mainctrl again, directive isn't loaded! heres directive: <div id="container" class="mixit-container" mixit-container="{load: {sort: 'order:asc'}, controls: {togglefilterbuttons: true, toggle

json - CouchDB filtered replication with params -

json - CouchDB filtered replication with params - i'm trying setup filtered replication in couchdb: the filter utilize following: function(doc, req){ if(doc._id == req.query.myid){ homecoming true; } homecoming false; } to test filter create call: get /people/_changes?filter=data/mobile&query_params={"myid": "1"} the name of database "people" the design document filter "_design/data" and name of filter "mobile" and result: {"results":[ ], "last_seq":126} when had document id equals "1". can tell me i'm wrong? i think problem asking filtered list of changes. since there none result set empty. replication accepts post requests only. check out example in couch db wiki. {"source":"http://example.org/example-database","target":"http://admin:password@127.0.0.1:5984/example-database", "filter&

asp.net mvc - What would cause attribute routing to not work when adding it to an existing MVC 5 web app? -

asp.net mvc - What would cause attribute routing to not work when adding it to an existing MVC 5 web app? - i added web api nuget , startup webapiconfig code calls maphttpattributeroutes via global.asax, none of attribute routes working. protected void application_start() { sqlservertypes.utilities.loadnativeassemblies(server.mappath("~/bin")); mvchandler.disablemvcresponseheader = true; arearegistration.registerallareas(); globalconfiguration.configure(webapiconfig.register); filterconfig.registerglobalfilters(globalfilters.filters); routeconfig.registerroutes(routetable.routes); } here packages installed. <packages> <package id="entityframework" version="6.1.1" targetframework="net451" /> <package id="microsoft.aspnet.identity.core" version="2.0.1" targetframework="net451" /> <package id="microsoft.aspnet.identity.entityframework" version=

yeoman - How to include ui.router in AngularJS project? -

yeoman - How to include ui.router in AngularJS project? - i maintain getting error: `error: [$injector:nomod] module 'ui.router' not available! either misspelled module name or forgot load it. but pretty sure have configured correctly the project created yeoman , uses bower manage dependencies, grunt build everything. the yeoman angular generator created boilerplate basic ngrouter, installed ui.router with bower install angular-ui-router --save angular version 1.2.16 bower file the above line updated bower.json file line in dependencies list: "angular-ui-router": "~0.2.10" app module set up i updated app.js file adding dependency on ui.route (in add-on various other dependencies) angular.module('app', ['ngroute', ... 'ui.router']) index.html <!-- build:js(.) scripts/vendor.js --> <!-- bower:js --> ... <script src="bower_components/angular-ui-router/release/angular-ui-ro

java - JUnit - Looping test cases and comparing the results -

java - JUnit - Looping test cases and comparing the results - i learning junit , have test method multiple times. have test method based on 2 parameters (environment , case#). working on 2 environments have check if same case# yields same results between different environments. test case: public class appstarttest { /** * test method {@link archive.appstart#beginoper(java.lang.string)}. */ list<string> actualsections = new arraylist<string>(); list<string> environments = new arraylist<string>(); list<string> cases = new arraylist<string>(); @before public void preparetest() { environments.add("env1"); environments.add("env2"); cases.add("case1"); //cases.add("case2"); cases.add("case3"); cases.add("case32"); cases.add("case4"); cases.add("emp3"); } @test public void testbeginoper() { (string casestr : cases) {

c++ - How to rotate pixels of contour or approximate polygon of contour in OpenCV? -

c++ - How to rotate pixels of contour or approximate polygon of contour in OpenCV? - after finding contours in image, consider have contours pixels , approximate polygon of it. i want rotate contours pixels or approximate polygon of contour given angle. possible in opencv? this how can rotate object within image this input image known object/contour position (the colored thing there) int main() { cv::mat input = cv::imread("rotateobjects_input.png"); std::vector<cv::point> mycontour; mycontour.push_back(cv::point(100,100)); mycontour.push_back(cv::point(150,100)); mycontour.push_back(cv::point(150,300)); mycontour.push_back(cv::point(100,300)); cv::point2f cog(0,0); for(unsigned int i=0; i<mycontour.size(); ++i) { cog = cog + cv::point2f(mycontour[i].x, mycontour[i].y); } cog = 1.0f/(float)mycontour.size()*cog; std::cout << "center of gravity: " << cog << std::

javascript - How can I manipulate css into a SVG -

javascript - How can I manipulate css into a SVG - i'm trying improve code assigning css properly: ischecked = jqelement.is(':checked'); type = jqelement.attr('tag'); var start = new date().gettime(); elements = document.getelementsbyclassname(type); console.log('layer ' + type + ': ' + elements.length); (j=0; j<elements.length; j++){ element = elements[j]; if (ischecked) element.classlist.remove('hide-layer'); else element.classlist.add('hide-layer'); //element.classname += ' hide-layer'; //element.classname = type; //element.setattribute('visibility', (ischecked)? '' : 'hidden'); } using element.classname += ' hide-layer' doesn't work using element.classname += ' hide-layer' takes while (8 secons 1996 path elements same class) the css class like: .hide-layer{ visibility:hidden; } hope can help me. in advance! if set class on elements wa

android - Xperia Z2 Tablet ACTION_IMAGE_CAPTURE -

android - Xperia Z2 Tablet ACTION_IMAGE_CAPTURE - i android developer trying our app working on xperia z2 tablet. our app has functionality allow user take pictures using 'camera' app comes default on android device. functionality works fine, except after take picture, ‘camera’ app not allow user preview image before returning our app. it goes our app after take picture. we noticed there setting on sony xperia z2 'camera' app set ‘preview’ time either ‘unlimited’, ‘5 seconds’, ‘3 seconds’, ‘edit’, or ‘off’. setting doesn’t seem accessible when ‘camera’ app opened our app. is there way allow user access preview setting, or @ to the lowest degree programmatically set preview time on ‘camera’ app our app? below codes using open 'camera' app. // camera. final list<intent> cameraintents = new arraylist<intent>(); final intent captureintent = new intent(mediastore.action_image_capture); final packagemanager packagemanager

html - How to navigate to a dynamic appearing url in javascript -

This summary is not available. Please click here to view the post.

android - Unexpected gl_stack_underflow error -

android - Unexpected gl_stack_underflow error - i working on little game uses opengl. i getting gl_stack_underflow error. have gone through code, , there 1 glpushmatrix each glpopmatrix. ideas else causing error? did maybe a glmatrixmode(gl_modelview); /* ... */ glpushmatrix(); "balanced" glmatrixmode(gl_projection); /* ... */ glpopmatrix(); it matters matrix active @ time of push/pop operation. anyway, shouldn't utilize opengl built-in matrix operations @ all. utilize glm, eigen or linmath.h build matrices part of programs info structures , load matrices require glloadmatrix or, when go shaders, gluniform . no, opengl built-in matrix operations not gpu accelerated, there's no benefit @ in using them. android opengl-es

ssis - SQL Import and Export Wizard map nvarchar(max) to its equivalent data type in csv -

ssis - SQL Import and Export Wizard map nvarchar(max) to its equivalent data type in csv - using sql import , export wizard importing info csv file sql tables, in sql table having column info type nvarchar(max) , have convert info type equivalent nvarchar(max), tried dt_str , dt_wstr,. , according r&d got link want share => http://msdn.microsoft.com/en-us/library/ms141036.aspx =>mapping of integration services info types database info types so there no such kind of conversion nvarchar(max). if knows needful. in advance. you can utilize text stream [dt_text] or unicode text stream [dt_ntext]. resource: the sql server integration services info type map ssis sql server info type translations ssis sql-import-wizard

Can ASP.NET MVC generate elements with lower case name and id attributes -

Can ASP.NET MVC generate elements with lower case name and id attributes - i hate asp.net html helpers generates name , id attributes in same case poco properties. most developers typically utilize lower case values name , id cannot seem find way accomplish in asp.net mvc. a through source shows there no way override functionality, wrong. is @ possible? edit: i'll more specific, examples of talking since there seems confusion. my model looks this: public class client { public string firstname { get; set; } public string lastname { get; set; } } in view utilize html herlpers so: @html.inputfor(m => m.firstname) this generates markup looks this: <input type="text" name="firstname" id="firstname" value="" /> i hate firstname property capitalized. in perfect world, way override generation of attribute value such can create "firstname" instead. i not want alter poco property names

How to create a tool bar using jquery mobile in android phonegap? -

How to create a tool bar using jquery mobile in android phonegap? - i using cardova 2.9.0, how can create fixed toolbar below header. is similar facebook application highlighted in below image, i need fixed toolbar, how can create that? suggest me plugins or other efficient way fixed tool bar. for fixed toolbar seek following: <div data-role="header" data-position="fixed"> <h1>header</h1> <div data-role="navbar"> <ul> <li><a href="#">one</a></li> <li><a href="#">two</a></li> <li><a href="#">three</a></li> </ul> </div><!-- /navbar --> </div> refer fixed header , footer fiddle demo android jquery jquery-ui jquery-mobile cordova

How to return nothing in an Oracle procedure -

How to return nothing in an Oracle procedure - i oracle novice , started utilize few days ago. i want convert procedure sql server oracle. essensially want phone call procedure returns nothing... hence no alter application. create procedure [dbo].[lc_unbooktrade] @exeid varchar(50), select '' go first, procedure in oracle not , cannot homecoming anything. function returns something. procedure can have out parameter. second, unless you're using 12.1, procedures in oracle can't implicitly homecoming cursor executing select statement can in sql server. much more mutual in oracle utilize view sort of thing. third, in oracle, empty string null if have code expects non-null empty string returned, you're going have alter that. potentially, closest equivalent code create or replace procedure lc_unbooktrade( p_exeid in varchar2, p_rc out sys_refcursor ) begin open p_rc select null dual; end; dependin

javascript - Can i specify my own hangout ID to the new Google Hangout Buttons functionality? -

javascript - Can i specify my own hangout ID to the new Google Hangout Buttons functionality? - is possible utilize own hangout id (which create using calendar) new google hangout buttons functionality? render buttons using javascript: <div id="placeholder-div"></div> and: <script> gapi.hangout.render('placeholder-div', { 'render': 'createhangout' }); </script> javascript jquery button

osx - How to get the correct callback value for NSUndoManager in Swift? -

osx - How to get the correct callback value for NSUndoManager in Swift? - i have nsdocument subclass, hooked nsarraycontroller . reference, i'm trying translate illustration chapter 9 of cocoa programming mac os x 4th edition. it seems this question asked before, need utilize object-based undo nsundomanager . in order pass 2 values method beingness invoked, i'm packaging them nsobject subclass 2 instance variables. when kvo methods inserting , deleting employees array called clicking on buttons in application, work expected. however, when removeobjectfromemployeesatindex called during undo operation, index passed in wildly out of bounds (for first row, seems 55 , after index increases thousands next few rows). how can right index perform undo action? class document: nsdocument { var employee_list: array<person> = [] var employees: array<person> { { homecoming self.employee_list } set { if newvalue == self.employee_lis

java - Where did I make a mistake in the Mergesort algorithm -

java - Where did I make a mistake in the Mergesort algorithm - i'm learning algorithm , @ moment seek implement mergesort java. code: public class mergesort { /** * @param args */ public static void main(string[] args) { int []a = {12,34,6543,3,6,45,23,677,56,67,3,4,54,5}; sort(a); for(int i:a) { system.out.println(i); } } private static void merge(int[]a,int[]b,int[]c) { int = 0, j = 0, k = 0; while((i < b.length) && (j < c.length)) { if(b[i] < c[j]) { a[k++] = b[i++]; } else { a[k++] = c[j++]; } while( < b.length) { a[k++] = b[i++]; } while( j < c.length) { a[k++] = c[j++]; } } } public static void sort (int[]a) { if(a.length > 1) { int m = a.length / 2; int[]b = new int[m]; int[]c = new int[a.length-m]; for(int = 0; &l

c# - How to determine if a user belongs to a certain group using ASP.Net Identity Framework 2.0 -

c# - How to determine if a user belongs to a certain group using ASP.Net Identity Framework 2.0 - using new asp.net identity framework 2.0, trying determine list of users belong group. the usermanager , rolemanager instantiated , right infos while debugging don't understand how utilize user.roles.contains. var _listallusers = usermanager.users.tolistasync().result; //var _allusers = usermanager.users; var roletomatch = rolemanager.findbynameasync("myusermanager").result; foreach (var user in _listallusers){ var _listgroupadmincat = user.roles.contains((identityuserrole)roletomatch); } there's missing in syntax. first identityrole object: var role = rolemanager.findbyname("myusermanager"); then users in role: var usersinrole = role.users; your question title asking different question though, how determine user in role. this, utilize usermanager this: int userid = 5; string roletocheck = "myrole"; bool userisinr

Frontend App android with jquery mobile and backend with android -

Frontend App android with jquery mobile and backend with android - i want create app android design of app jquery mobile , backend android. can work? please describe reply example. thanks help. yes possible, need install android sdk developer tools on machine , create webview app. you creating web browser app can link jquery mobile app on normal browser. 1 time finish making webwvew app , tests ok can install/distribute app on android phones , google play normal app. here links you android sdk developer tools http://developer.android.com/sdk/index.html android webview information http://developer.android.com/reference/android/webkit/webview.html a video tutorial on how create webview app. https://www.youtube.com/watch?v=qra4ymjoi7c you can find more turorials on how install , utilize android sdk , on how create webview app if search internet android jquery-mobile

javascript - Regular Expression to match first and last character -

javascript - Regular Expression to match first and last character - i'm new using regular expressions , trying utilize regex check first , lastly characters in string alpha characters between a-z. i know matches first character: /^[a-z]/i but how check lastly character well? this: /^[a-z][a-z]$/i does not work. , suspect there should in between 2 clauses don't know what! any help much appreciated. the below regex match strings starts , ends alpha character. /^[a-z].*[a-z]$/igm demo explanation: ^ # represents begining of line. [a-z] # alphabatic character. .* # character 0 or more times. [a-z] # alphabatic character. $ # end of line. # case-insensitive match. g # global. m # multiline javascript regex expression

c++ - implementing a generic binary function with a class and functor as template parameters -

c++ - implementing a generic binary function with a class and functor as template parameters - i trying wrap templated functions binary functors below. when seek compile code have error error: no match phone call ‘(qtyasc) (myobj&, myobj&) i thought beingness operator() in qtyasc function in class, template deduction mechanism have worked seems compiler doesn't take myobj classes valid types it. is maybe because of phone call boost::bind ? trying provide default implementation sec templated argument (unfortunately cannot utilize c++11 default templated arguments). class myobj { public: myobj(int val) : qty_(val) {} int qty() { homecoming qty_;} private: int qty_; }; template<class t> int get_quantity(const t& o) { throw runtime_error("get_quantity<t> not implemented"); } template<> int get_quantity(const myobj& o) { homecoming o.qty(); } struct qtyasc { templa

c - Is there a BLAS or LAPACK subroutine for symmetric matrix multiplication that takes advantage of symmetry? -

c - Is there a BLAS or LAPACK subroutine for symmetric matrix multiplication that takes advantage of symmetry? - i'm hoping can help me out. looking blas or lapack subroutine matrix multiplication of 2 big , identical symmetric matrices. so far, have tested dysrk , dgemm routines, , both extremely slow. wondering if there routine specific squaring symmetric matrix... any help appreciated! c matrix lapack blas

C++ dynamic array, increasing capacity -

C++ dynamic array, increasing capacity - i'm trying implement dynamic array , here function increasing capacity int* changecapacity(int *arr, int length, int newcapacity) { int *newarr = new int[newcapacity]; if(length > newcapacity){ homecoming 0; } else { for(int = 0; < length; i++){ newarr[i] = arr[i]; } delete[] arr; arr = newarr; homecoming arr; } } this error get: speicher(2465,0x7fff7cfc2310) malloc: * error object 0x7f9742403910: pointer beingness freed not allocated * set breakpoint in malloc_error_break debug i'm calling this: int* addelement(int *arr, int& length, int& capacity, int val){ if(length >= capacity){ capacity = capacity * 2; changecapacity(arr, length, capacity); arr[length] = val; length += 1; homecoming arr; }else{ arr[length] = val; length += 1; homecoming arr; } } here improve way of do

javascript - jQuery Select2 - Select ajax-submitted value -

javascript - jQuery Select2 - Select ajax-submitted value - i have form submits new entry via ajax , returns entry data. i'm trying returned info automatically selected in select2 field. can id entered input value, i'm not sure how text displayed in span. here's js have far: function clientformatresult(client){ var markup = client.first_name + ' ' + client.last_name + ' (' + client.username + ')'; homecoming markup; } function clientformatselection(client) { $('#client-input').empty(); $('#client-input').append('<input type="hidden" name="client" value="' + client.id + '" />'); homecoming client.first_name + ' ' + client.last_name + ' (' + client.username + ')'; } $('#client-selection').select2({ placeholder: 'select client', allowclear: true, minimuminputlength: 1, ajax: { type: '