Posts

Showing posts from February, 2014

c++ - convert structure to char pointer in c# -

below piece of code written in c++, how can convert in c#. if check pams_get_msgw function , first param of (char*), how can pass same in c# . struct { short m_nstatus; short m_nreg_id; short m_nnumber_reg; } oregreply; short nbufsize = sizeof(oregreply); q_address osenderqueue; nmsgtype = msg_type_sbs_reg_reply; cpriority = 0; ltimeout = 300; // 30 seconds //wait reply telegram sbs server lstatus = pams_get_msgw((char *) &oregreply, &cpriority, &osenderqueue, &nmsgclass, &nmsgtype, &nbufsize, &nmsglen, &ltimeout, null, null, null, null, null, null, null); my c# declaration pams_get_msgw function this

spring - is this ajax call for below rest Service is correct or not? -

sample rest service below: @requestmapping(value = "/image/upload", method = requestmethod.post) public void uploadimage(@requestparam("image") multipartfile fileobj) throws exception { system.out.print("file name:"+fileobj.getoriginalfilename()); } and wrote ajax code : , accept application format json when call 400 error $('#user_click').click(function(){ var data = { image:$("#file_1").val }; $.ajax({ url : "http://localhost:8080/myproject/image/upload", type : "post", contenttype : false, crossdomain : true, data : json.stringify(data), datatype : 'json', async : true, success : function(result) { alert('the selected items uploaded'); }, error: function(message){ alert("error:"+json.stringify(message)); }

javascript - auto-shuffle divs every n seconds -

i have here code random divs same class name. need keep randomizing them every n seconds (15 seconds instance) without need refresh page. http://jsfiddle.net/yxbhh/ js code: var parent = $("#shuffle"); var divs = parent.children(); while (divs.length) { parent.append(divs.splice(math.floor(math.random() * divs.length), 1)[0]); } does have ideas how it? i'm still not used javascript yet appreciated. you can use setinterval function: var $parent = $("#shuffle"); var $divs = $parent.children(); setinterval(function() { var $clone = $divs.slice(); while ($clone.length) { $parent.append($clone.splice(math.floor(math.random() * $clone.length), 1)); } }, 2000); .hue { background: #ddd; } .hue:nth-child(2n) { background: yellow; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="shuffle"> <div class="hue"

c# - Parsing Mixedt CSV-File with TextFieldParser -

hello have problem parse csv-file. csv-file delimited | character . far good. 1 field enclosed " char. example field1|field2|"field3"|field4 when set hasfieldsenclosedinquotes to true become exception otherwise parsing of csv-file goes wrong. can me here. i haven't seen culture, '|' csv separator... all in all, var line = "field1|field2|\"field3\"|field4"; var pattern = string.format("{0}(?=([^\"]*\"[^\"]*\")*[^\"]*$)", regex.escape("|")); //{0} in pattern csv separator. current use system.globalization.cultureinfo.currentculture.textinfo.listseparator var splitted = regex.split(line, pattern, regexoptions.compiled | regexoptions.explicitcapture); foreach (var s in splitted) console.writeline(s); output: field1 field2 "field3" field4 pattern designed split single line csv file using specified separator characters. includes handling of quotes, et

php - COOKIES headers already sent -

this question has answer here: how fix “headers sent” error in php 11 answers i have probelm cookie. error: cannot modify header information - headers sent (output started @ /data/web/virtuals/9784/virtual/www/subdom/roids/_libs/_lib.php:1) in /data/web/virtuals/9784/virtual/www/subdom/roids/_libs/_lib.php on line 43 index: <?php session_start(); error_reporting(e_all); require_once('_libs/_console.php'); require_once('_libs/class.phpmailer.php'); require_once('_libs/_lib.php'); //require_once('_libs/passwordlib.phar'); $db = new database(); $func = new functions($db); $cms = new cms_system($func, $db); $func->setlang(); the file _lib.php starts <?php , there no whitespace @ start. file contains classes , functions. function setlang: public function setlang() { setcookie("lang", "s

Excel VBA Search for Value in Column A Select Row Value is Found and Column F as Active Cell -

i vba newbie... i looking value "a" in column a. use row number value "a" located at, , copy existing function in column f column e. this tried , not work... dim a_row long a_row = application.worksheetfunction.match("a", range("a:a"), 0) range("e" & a_row).select activecell.select activecell.offset(0, 5).select selection.copy activecell.offset(0, -1).select activesheet.paste thank in advance help! in opinion, if going use vba avoid using worksheet functions unless totally necessary. sub caroll() dim ws worksheet dim a_row long dim rng range set ws = activesheet 'loop through column each rng in ws.range(ws.cells(1, 1), ws.cells(ws.rows.count, 1).end(xlup)) 'test whether cell = "a","b", or "z" if vartype(rng) <> vberror if rng.value = "a" or rng.value = "b" or rng.value = "z"

How to change font size in plot of cross-validation result from cvTools package in R? -

i try manipulate size of fonts (title , axis labels, especially) in plot of cross-validation result cvtools package in r . afraid not work: library(cvtools) data(coleman) set.seed(1234) # split n observations k groups used (repeated) k-fold cross-validation folds <- cvfolds(nrow(coleman), k = 5, r = 50) # perform cross-validation ls regression model fitlm <- lm(y ~ ., data = coleman) cvfitlm <- cvlm(fitlm, cost = rtmspe, folds = folds, trim = 0.1) # perform cross-validation mm regression model fitlmrob <- lmrob(y ~ ., data = coleman, k.max = 500) cvfitlmrob <- cvlmrob(fitlmrob, cost = rtmspe, folds = folds, trim = 0.1) # combine results 1 object cvfits <- cvselect(ls = cvfitlm, mm = cvfitlmrob) the 2 lines below differ in plot points size, there no change in title font size / labels font size. # plot combined results plot(cvfits, main = "foo_title") plot(cvfits, main = "foo_title", cex = 0.5, cex.main = 0.5, cex.lab = 0.5) what mi

java - JNDI configuration with jboss using oracle 11G -

i using jboss server using jdbc connection,but want use jndi data source. comletly new it. please tell me step step how can achive that. please tell me if can deploy ear(including xml file.) have @ this . you set jndi data source on app server itself. of course can deploy application uses ear.

php - Display href from a table based on checkbox values -

i new php. aware using mysql*functions, continue use them project. looking guidance on how display videos based on checkbox values inserted database. have 14 checkboxes, named 1, 2, 3, 4, 5 etc...(which insert enisatid column). name of each checkbox inserts 'enisatid' (from enisatanswer) column (1-14), value of 1 or 0 'enisat_watch' depending if checkbox has been selected or not. my first piece of code works fine , inserts database. follows: <?php session_start(); include_once 'dbconnect.php'; if(!isset($_session['user'])) { header("location: index.php"); } $res=mysql_query("select * users user_id=".$_session['user']); $userrow=mysql_fetch_array($res); if(isset($_post['submit'])) { header("location: enisatvids.php"); $userid=$_session['user']; $cb_names = array('1', '2', '3', '4', '5', '6', '7', '8', '9'

Remove the first git commit from the history -

this question has answer here: change first commit of project git? [duplicate] 4 answers edit root commit in git? 5 answers how can remove first git commit history? want tree start second commit. know git rebase -i <sha1_of_commit> doesn't work first commit. repository not shared anyone. if still didn't published repo, can use git filter-branch . bear in mind technically create new repository, unconnected old 1 (hence "if didn't published yet" rule). git filter-branch --commit-filter ' if [ "$git_commit" = "full id/sha of commit want skip here" ]; skip_commit "$@"; else git commit-tree "$@"; fi' head

angularjs - Javascript validation in rows of table -

i working on ag-grid validating row. column name index , here validation function using. function numbervalidate(params) { var new_number = parsefloat(params.newvalue); if (isnan(new_number)) { window.alert("invalid value " + params.newvalue + ", must number"); } else { params.data.index= new_number; params.api.onnewrows(); } } if edit row , type value, variable 'new_number value. check if numerical. if not, give window.alert. if number, update row value. my problem this--> if mention '56sfdfd', takes 56 , updates in row. however, should display window.alert stating '56sfdfd' not number. any idea how correct in javascript function above. inputs appreciated. try way: var new_number = number(params.newvalue); find more topic here .

java - Maven unable to resolve Vaadin addon dependency -

i have following entry repositories in maven.... <repositories> <repository> <id>vaadin-addons</id> <url>http://maven.vaadin.com/vaadin-addons</url> </repository> with following dependency... <dependency> <groupid>org.vaadin.addon</groupid> <artifactid>confirmdialog</artifactid> <version>2.1.3</version> </dependency> but when go build app see this... [warning] pom org.vaadin.addon:confirmdialog:jar:2.1.3 missing, no dependency information available according vaadin directory should able add dependency 2 entries... have used in previous projects. perhaps vaadin addons repo down? https://vaadin.com/directory#!addon/confirmdialog the file available in vaadin repo @ specificed coordinates. http://maven.vaadin.com/vaadin-addons/org/vaadin/addon/confirmdialog/2.1.3/confirmdialog-2.1.3.jar before nuking .m2 repo may

html - How can I define a jquery var to a php variable? -

i have simple question i've been looking , workin on awhile , can't seem it. heres code. <script> function calculate() { var total = (parseint($('#studenttut option:selected').val()) + parseint($('#campusrb>option:selected').val())) * parseint($('#yearsatten>option:selected').val()); $("#total").html("<table width='100%'><tr><td>your calculated cost is: $" + total +"</td>" + "<td align='right'>" + "<?php $calculatedcost = " + total + ";" + " ?>"); } </script> any suggestion on how can define jquery var php variable? you cannot set jquery variable php .. since php server side code , javascript client side.... can use ajax send var server side.. or use form post var server... can use val() place value form.. $('#inputid').val(total); and post form

git - how to update my feature/release/hotfix/support branch with new content? -

for example, i'm dealing feature branch, developer pushed right origin/develop latest fix, , have use (add) fix in feature branch. how should ? git checkout -b my-feature-branch ... dealing issue ... ... alarm! developer released fix, need here in feature branch ... git stash git checkout develop git pull origin develop git rebase my-feature-branch develop git checkout my-feature-branch git merge develop git stash apply ... dealing issue ... git commit git checkout develop git merge my-feature-develop git push origin develop is correct behaviour ? in case hard figure out branch started , finished. , second point i'm doing rebase public branch (develop) , it's not good, right ? what proper way update (refresh) working branch new info ? this seems wrong: git rebase my-feature-branch develop it should be: git rebase develop my-feature-branch` what need rebase done in my-feature-branch on top of updated develop branch. no need merge develop in

javascript - Setting the module path for gulp-jasmine -

i'm trying unit test javascript code jasmine uses peg parser. peg parser built @ build time. unfortunately haven't found out how tell jasmine dynamically built parser is. so far i've got: gulp.task('parser', () => { return gulp.src("src/parser.peg") .pipe(peg()) .pipe(gulp.dest(".obj")) }); gulp.task('test', ["parser"], () => { return gulp.src(["tests/**/*.js", "src/**/*.js", ".obj/parser.js"]) .pipe(jasmine()) }); now, time tests run, parser correctly built , put in .obj ; it's not on module path, test loads real code, real code tries import parser "parser" , , test fails. i change real code import ../obj/parser instead of parser , fail in production, of course. need somehow tell jasmine find modules in .obj . how?

Ionic / Cordova won't deploy to Windows 10 phone -

i have existing ionic app trying test on windows 10 mobile phone, cannot ionic (or cordova) deploy phone. have added windows platform using ionic platform add windows , tried deploy using ionic run windows --device -- --phone --archs="x86" results in: deploying app package... unexpected error installation: error: not implemented may have installed app earlier version of cordova-windows. ensure app uninstalled phone , try run again. error: error: not implemented if ionic run windows --list list of detected devices this: available windows devices: 0. device (device) available windows virtual devices: no devices found matching specified criteria. if try deploy directly 0. device (device) app launches on desktop computer. windows can "see" windows 10 phone , can browse contents of in windows explorer. i have enabled developer mode on phone load apps anywhere , have purchased windows developer license see if help, didn't. finally, tried installi

javascript - How to check if object contains an item using Jasmine -

i using karma , jasmine testing framework. code: it('add() should add x reply object', function() { spyon(ctrl, 'addxreply'); ctrl.reply = {}; ctrl.reply.post = 'test post'; ctrl.add(); expect(ctrl.addxreply).tohavebeencalled(); console.log(ctrl.reply); expect(ctrl.reply).tocontain('x'); }); this ctrl.add(): self.add = function() { self.reply['x'] = self.posts[0].id; self.addxreply(); }; the problem is, when run code, returns: log: object{post: 'test post', x: undefined} chromium 48.0.2564 (ubuntu 0.0.0) controller: mainctrl add() should add x reply object failed expected object({ post: 'test post', x: undefined }) contain 'x'. as can see, reply object contain x line expect(ctrl.reply).tocontain('x'); still failing. idea how can verify object contains x ? you have bug in created vs what's expected. notice line: self.reply['x'] = self.p

php - ZF2 - subqueries -

subquery in zend framework 2 my required query: select `comment`.`id` `commentid`, `comment`.`comment` `comment`, (select count(`comment_vote`.`id`) `negativevote` `comment_vote` vote = -1 , `comment_vote`.`commentid` = `comment`.`id`) `nagetivevotecount` `comment` please help. thanks, anjith my required query: select `comment`.`id` `commentid`, `comment`.`comment` `comment`, (select count(comment_vote.id) `negativevote` `comment_vote` vote = -1 , comment_vote.commentid = comment.id) `nagetivevotecount` `comment` how created using zend framework 2: $sql = new sql($this->_adapter); $mainselect = $sql->select()->from('comment'); $selectpost = $sql->select() ->from('comment_vote') ->columns(array('negativevote' => new \zend\db\sql\expression('count(comment_vote.id)'))) ->where('v

ibm mobilefirst - Customization Failed In Eclipse -

i trying build , deploy android environment worklight project in eclipse. on deploy giving me these errors in console: e: ====== worklight project final-project-customization failed start: user lacks privilege or object not found: cluster_sync {select t0.hostvmid, t0.id, t0.updatetimestamp, t0.version cluster_sync t0 t0.id = ?} [code=-5501, state=42501] activation failed. bundle didn't start:c:\users\workspace\final\bin\final-customization.jar i find on net lot solutions did not work. appreciated. full info: activating worklight project: final... [2013-04-01 16:09:27] worklight server stopped on localhost:8080 [2013-04-01 16:09:29] worklight server started on localhost:8080 [2013-04-01 16:09:34] fwlst0011e: ====== worklight project final-project-customization failed start: user lacks privilege or object not found: cluster_sync {select t0.hostvmid, t0.id, t0.updatetimestamp, t0.version cluster_sync t0 t0.id = ?} [code=-5501, st

vb.net - How to read multiple xml elements from a file? -

hi have xml document , want extract either first or second applications file path , file name etc. ive tried documentelement.selectsinglenode("/installerlist/installer/file_path").innertext but ever first applications info , never second, ive tried playing around documentelement.selectnodes("//installer") and adding integer end of cycle through doesnt seem that. thoughts? <?xml version="1.0" encoding="utf-8"?> <installerlist> <installer name="first application"> <filepath>c:\</filepath> <third_parameter>etc</third_parameter> <forth_parameter>etc</forth_parameter> </installer> <installer name="second application"> <filepath>etc</filepath> <third_parameter>etc</third_parameter> <forth_parameter>etc</forth_parameter> </installer> </installerlist> if want select single filep

imagebutton - Individual buttons in cocos2d -

most talk buttons cocos2d seems directed ccmenu, ccmenu afaik meant having row or column in center of screen. need place buttons randomly on screen , have yet find simple out of box solution this. did try cccontrolbutton didn't work (ccscale9sprite spritewithspriteframename loads incorrectly sprite atlas). for try use this. uses 1 button in each ccmenu. screen have lots of ccmenu instances, 1 each button. +(ccmenu*)button:(nsstring*)spriteframename at:(const cgpoint)point block:(void(^)(id sender))block { ccsprite* sprite1 = [ccsprite spritewithspriteframename:spriteframename]; ccsprite* sprite2 = [ccsprite spritewithspriteframename:spriteframename]; ccmenuitem* menuitem = [ccmenuitemimage itemwithnormalsprite:sprite1 selectedsprite:sprite2 block:block]; ccmenu* menu = [ccmenu menuwithitems:menuitem, nil]; menu.contentsize = sprite1.contentsize; menu.position = point; return menu; }

ios - pdf kit like fastpdfkit for android -

i have created iphone app displaying pdf , playing audio , video files using fastpdfkit. now want make same app android also. there kit android can have same functionalities? itext dedicated java library create , manipulate pdf documents. has android version named itextg . itext tutorials more available itextg . suggest use itext tutorials. itextg pdf manipulation. can rely on android multimedia api audio , video support.

Java UDP Optimizing -

i've been having trouble udp. massive delay between host , client when server stations close client. works fine when local host. here video of issue server error . here game server code / client code. if need packets i'm happy supply. apologize if did wrong first time using stackoverflow. package com.holdout.game.net; import java.io.ioexception; import java.net.datagrampacket; import java.net.datagramsocket; import java.net.inetaddress; import java.net.socketexception; import java.net.unknownhostexception; import com.holdout.game.game; import com.holdout.game.entities.playermp; import com.holdout.game.net.packets.packet; import com.holdout.game.net.packets.packet00login; import com.holdout.game.net.packets.packet01disconnect; import com.holdout.game.net.packets.packet02move; import com.holdout.game.net.packets.packet.packettypes; public class gameclient extends thread { private inetaddress ipaddress;

osx - Redrawing NSButton when mouseDown and mouseUp -

i subclassing nsbutton , perform custom drawing. imlement methods -mousedown , -mouseup . when perform short(fast) click, code work perfect, if hold down left mouse button time release it, method -mouseup didn't work. perhaps don't understand how buttons work... want buttons change appearance when mouse down, , return previous when goes up. wrong? the reason getting behavior there 2 different ways handle mouse dragging in cocoa. both discussed here: http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/eventoverview/handlingmouseevents/handlingmouseevents.html%23//apple_ref/doc/uid/10000060i-ch6-sw18 nsbutton using "the mouse-tracking loop approach", (including mouse-up event) done within mousedown: method. in case wondering about, how things in nsbutton subclass: - (void)mousedown:(nsevent *)event { someivar = no; [super mousedown:event]; //sometimes, when here, have had "mouse up" //because super's

How to compare images using opencv in iOS (iPhone) -

i want compare 2 images taken iphone camera in project. using opencv doing that. there other better way that? if got % similarity, great. i using opencv following code image comparison: -(void)opencvimagecompare{ nsmutablearray *valuesarray=[[nsmutablearray alloc]init]; iplimage *img = [self createiplimagefromuiimage:imageview.image]; // check camera image if(img == 0) { printf("cannot load camera img"); } iplimage *res; cvpoint minloc, maxloc; double minval, maxval; double values; uiimage *imagetocompare = [uiimage imagenamed:@"myimagename"]; iplimage *imagetocompareipl = [self createiplimagefromuiimage:imagetocompare]; // check server image if(imagetocompareipl == 0) { printf("cannot load serveriplimagearray image"); } if(img->width-imagetocompareipl->width<=0 && img->height-imagetocompareipl->height<=0){ int balwidth=imagetocompareipl->width-img->width; int balheight=imagetocompareipl

reactjs - React Javascript displaying/decoding unicode characters -

i have string in unicode need convert. need render string \u00f3 ó. example, should happen other types of characters, á, í, ú... i have following basic code: https://jsfiddle.net/dddf7o70/ i need convert <hello name="informaci\u00f3n" /> into información if have work strings have, whatever reason, \u.... codes in them instead of being real letters, convert them numbers, , use string.fromcharcode() turn numbers real letters. can use regexp replace handler function this: function convertunicode(input) { return input.replace(/\\u(\w\w\w\w)/g,function(a,b) { var charcode = parseint(b,16); return string.fromcharcode(charcode); }); } var hello = react.createclass({ getinitialstate: function() { return { name: convertunicode(this.props.name) }; }, render: function() { return <div>hello {this.state.name}</div>; } }); react.render( <hello name="informaci\u00f3n" />, document.getel

php - List matching records in PostregSQL -

i working on search section comparing input values stored records. database having value ab 09 c d 1234. have explode (with space) input string match stored value when given input ab09 cd 1234, not result above record. select * some_vehicle vehicle_number ilike e\'%ab09 cd 1234%' vehicle_number in db: ab 09 c d 1234 input string: ab09 cd 1234 i want result having every possible scenario combination of input string. there way in postgresql? "replace" function able eliminate blank space string. there way in postgresql eliminate special characters along blank space. trying different regular expressions regexp_replace(vehicle_number,'[^a-z0-9\s]', '') , regexp_replace(vehicle_number,'[(|-|)|\:|\@|#|\$|*|.|!|\,]', '') not working. thanks figured out after few attempts! close it. "[^a-za-z0-9]" pattern eliminate special characters including space 'g' option fourth parameter of regexp_replace in postgres

groovy - Gradle How to Set Output Root Path -

my sources in folder structure like: mygitroot/myproj/module1/src/main/groovy/com/mypak/module1 mygitroot/myproj/module2/src/main/groovy/com/mypak/module2 mygitroot/myproj/module3/src/main/groovy/com/mypak/module3 gradle builds jars in folder structure like: mygitroot/myproj/build/libs/module1.jar mygitroot/myproj/build/libs/module2.jar mygitroot/myproj/build/libs/module3.jar i want output default dynamic folder structure, rooted different "nongitroot" folder: mybuildroot/myproj/build/libs/module1.jar mybuildroot/myproj/build/libs/module2.jar mybuildroot/myproj/build/libs/module3.jar my task says this: task sourcesjar(type: jar) { group 'build' description 'an archive of source code' classifier 'sources' sourcesets.main.allsource } is there elegant way change root? using answer tim_yates - turns out not configurable option in gradle, , not natively possible. going create move task instead.

How to read characters from a string inside a for loop in a batch file -

am trying read characters string inside loop, not getting result. code this @echo off setlocal enableextensions enabledelayedexpansion set str="abcdefgh" /l %%x in (1,1,5) ( set fstr=!str:~1,%%x! echo %fstr% ) all time getting result "echo off". kindly how solve this change echo %fstr% to echo !fstr! %fstr% shows value of fstr existed when line parsed, is, not set, so echo %fstr% is interpreted as echo hence echo reports echo status - echo off echo !fstr! show value of fstr changed within loop (the run-time value).

python - printing decision boundary with pyplot -

using pandas , sklearn create decision tree learn on data pruning method tree retry different max depths. believe have working cannot seem output via pyplot. can me import numpy np import pandas pd sklearn import tree sklearn import cross_validation sklearn.cross_validation import kfold import matplotlib.pyplot plt features = ['birad','age','shape','margin','density','severity'] df = pd.read_csv('mammographic_masses.data',header=none,names=features) df= df[df.birad != '?'] df= df[df.age != '?'] df= df[df.shape != '?'] df= df[df.margin != '?'] df= df[df.density != '?'] #df= df[df.severity != '?'] x = df[features[:-1]] y = df['severity'] x_train,x_test,y_train,y_test = cross_validation.train_test_split(x,y,test_size=0.4,random_state=0) depth = [] best_depth = 3 best_score = 0 best_clf = [] in range(1,20): clf = tree.decisiontreeclassifier(max_depth=i) c

Java ArrayList Out of Bounds Exeption -

i making blackjack game (non gui) , write algorithms decide whether receive card, how bet, etc. receiving out of bounds error on arraylist when adding values. thank help. package idk; import java.util.arraylist; import java.util.collections; import java.util.random; public class { public static void main(string[] args) { something = new something(); arraylist<integer> place=new arraylist<integer>(); int i; for(i=0; i<4; i++) { place.add(2); } for(i=4; i<8; i++) { place.add(3); } for(i=8; i<12; i++) { place.add(4); } for(i=12; i<16; i++) { place.add(5); } for(i=16; i<20; i++) { place.add(6); } for(i=20; i<24; i++) { place.add(7); } for(i=24; i<28; i++) { place.add(8); } for(i=28; i<32; i++) { place.add(9); } for(i=32; i<48; i++) { p

android - unable to get webview to show video fullscreen -

i have created android application preview website has mp4 video player, works fine im unable preview on full screen when click on video enlarge icon. please note im new , been learning 3 days code mainactivity.java: import android.app.activity; import android.content.intent; import android.net.uri; import android.os.build; import android.os.environment; import android.os.parcelable; import android.provider.mediastore; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.util.log; import android.webkit.valuecallback; import android.webkit.webchromeclient; import android.webkit.webview; import android.widget.progressbar; import android.widget.toast; import java.io.file; import java.io.ioexception; public class mainactivity extends appcompatactivity { private webview webview; private progressbar progressbar; // variables camera , choosing files methods private static final int filechooser_resultcode = 1; private valuecallback<uri&g

Beginner c++ programmer: Stuck writing a class -

i have write program exercise in classes, i'm lost. have bit of experience programming in java, switch c++ syntax confusing me quite bit. the prompt is: write definition of class , swimmingpool , implement proper-ties of swimming pool. class should have instance variables store length (in feet), width (in feet), depth (in feet), rate (in gallons per minute) @ water filling pool, , rate (in gallons per minute) @ water draining pool. add appropriate constructors initialize instance variables. add member functions following: determine amount of water needed fill empty or partially filled pool, determine time needed or partially fill or empty pool, , add or drain water specific amount of time. i getting several build errors. understand have right not complete. here progress far. #include <iostream> using namespace std; int main() { swimmingpool myswimmingpool; int length, width, depth, ratetofill, ratetodrain; cout << "pool data: " &l

c++11 - c++ custom container pass {} list -

i remaking set container , wondering how pass brace-enclosed initializer list container. myset<int> myset = {"test", "test 2"}; i tried overload operator= take list parameter. despite presence of = here, constructing set, need constructor (that takes std::initializer_list parameter). template<class t> class myset { public: // ... myset(std::initializer_list<t> init) { (t const &t : init) insert(t); } };

javascript - Custom XML in tree view -

i'm triying show specific xml in tree view. ask xml file server (so xml change same structure) , looks this: <node label="root1" description="this root" id="12345"> <node label="folder1" description="this folder" id="f12345"> <node label="folder1-2" description="this folder" id="f123456"> <node label="service1" description="this service" id="s12345" /> </node> </node> </node> the idea show like: root folder 1 folder 1-2 service 1 i have looked jstree can't change xml structure , have looked option: http://uimonster.com/wiki/index.php?title=jstree_and_custom_xml , doesn't work me because need 'label' attribute name of node , store description somewhere work later. i'm new in js wonderful. thanks.

html - Black space between 2 of my divs. I dont know how to remove them. Have tried a couple of things -

this screenshot of it. want label , image both fit inside blue div i want both of them fit inside blue div. nothing did worked. read should have them float left/right stills have blank space. set margin on 0. still blank space. thing removed blank space line height on 0px. messed label placement. kinda lost on one html : <div class="playerinfo"> <div class="playerchamp"> <img src="profileicon10.jpg" width="100" height="100" > <div class="playername"> <label for="male">male</label> </div> </div> </div> css .playerinfo { height:120px; width:130px; background:blue; border:solid 1px black; } .playerchamp { width:100px; height:100px; background :red; } .playername { width:100px; height:20px; background :red; } add margin-top: -4px; .playername pull , won't have s

iphone - How to capture the screen shot for transition -

i want capture screenshot transition between images. - (uiimage *)captureview:(uiview *)view { cgrect screenrect = [[uiscreen mainscreen] bounds]; uigraphicsbeginimagecontext(screenrect.size); cgcontextref ctx = uigraphicsgetcurrentcontext(); [[uicolor blackcolor] set]; cgcontextfillrect(ctx, screenrect); [view.layer.presentationlayer renderincontext:ctx]; uiimage *newimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return newimage; } i call method during uiimageview playing transition of images, however, got still image in uiimageview cannot capture transition between images. can me out? in simulator can hit shift 3 times slow animation down, might able catch transition then.

javascript - Calling function inside another function - uncaught error -

i don't know if 'parameter' right term, i'm trying call function inside function , i'm getting following error: uncaught referenceerror: successmsg not defined i'm looping through trello board through api looks this var sportsuccess = function(successmsg) { console.log("sport"); looptrellocards(); }; trello.get('/lists/boardid/cards', sportsuccess, error); and looptrellocards function looks like function looptrellocards() { for(i = 0; < successmsg.length; i++) { var name = successmsg[i].name; var desc = successmsg[i].desc; var due = successmsg[i].due; var date = new date(due); var day = addzerotodate(date.getdate()); var month = addzerotodate(date.getmonth() + 1); var year = string(date.getfullyear()); var eventdateshort = year + month + day; if (today < eventdateshort) { var year = year.substr(2); var eventdate = day + '.' + month + '.' + year;

c - Setup MinGW for creating OpenGL context in WINAPI? -

i've been trying setup mingw work c , winapi create opengl projects. how download, or otherwise get, opengl headers , libraries? i've read can use #include <gl/glu.h> . tried , got errors "include glu.h" not found , , on. tried downloading these .h files , putting them inside include/gl folder, errors undefined reference to... bla bla when link, when add linker options -lopengl32 -lglu32 , etc. how can start c, winapi , opengl environment? what need get, download or set create opengl projects c , winapi? my os windows 10 64 bit. mingw version 4.9.2-tdm64-3/4.9.2-tdm3 what need get, download or set create opengl projects c , winapi? in theory: nothing! opengl-1.1 part of win32 abi, i.e. contract between os , compilers how things work , must supported @ minimum development environment suitable platform sdk. mingw brings necessary development resources (headers, libraries, linker definition files) default. i'd start double checki

c# - Changing the FormView record while in insert mode -

i have 2 objectdatasource's - 1 gridview , 1 formview. i enabled selection on gridview , well; page loads, select record, , formview populates record. however, once formview in insert mode, when select record on gridview, not changing display record selected. where handle in code, don't see how access "enable selection" on gridview in code behind? what have tried protected void grdsearchgroup_selectedindexchanged(object sender, eventargs e) { formgroupinput.defaultmode = formviewmode.readonly; formgroupinput.databind(); } protected void grdsearchgroup_selectedindexchanging(object sender, gridviewselecteventargs e) { formgroupinput.defaultmode = formviewmode.readonly; formgroupinput.databind(); } i think simplest way solve problem handle gridview's selectedindexchanging method, , set formview read-only mode (that way can see records details in formview want). protected void yourgridview_selectedindexchanging(object sender,

linux - regex serde reading log files in hive -

i'm trying create regex serde in hive read log files having issue getting work... the log file looks this... 14.196.202.16:9123 11329 2016-01-27 17:50:26.965 -5 thread-14960 ccs 6104 1 audit.rds.ccs reportdataservice failure <messages><message><messagestring>rds-err-1047 unable process xml output stream. xml invalid.</messagestring></message> <trace>clientabortexception: java.net.socketexception: broken pipe @ org.apache.catalina.connector.outputbuffer.realwritebytes(outputbuffer.java:369) @ org.apache.tomcat.util.buf.bytechunk.append(bytechunk.java:339) @ org.apache.catalina.connector.outputbuffer.writebytes(outputbuffer.java:392) @ org.apache.catalina.connector.outputbuffer.write(outputbuffer.java:381) @ org.apache.catalina.connector.coyoteoutputstream.write(coyoteoutputstream.java:89) @ java.io.bufferedoutputstream.write(unknown source) @ java.io.bufferedoutputstream.write(un

symfony - Twig Form Theming - form_label class attribute -

i've been trying override form_row twig extension can render twitter bootstrap style row. twitter boostrap form row should this: <div class="control-group"> <label class="control-label" for="idofmaininput">label name:</label> <div class="controls"> <input type="text" id="idofmaininput" name="somedumbname"> </div> </div> the base twig div style form_row block defined in this link below: {% block form_row %} {% spaceless %} <div> {{ form_label(form) }} {{ form_errors(form) }} {{ form_widget(form) }} </div> {% endspaceless %} {% endblock form_row %} so, thoughts put necessary divs in, , hard code necessary class entries (i.e. in main div) pass 'attr' value form_label, form_errors , form_widget sections. i've taken out form_errors now, don't deep it. here's tried: {% form_theme