Posts

Showing posts from April, 2011

bash - Issues with Screen - Running Minecraft in a while loop through a screen session -

so earlier today, changed startup scripts minecraft server. problem is, after 3 hours, screen open vanished , refuses appear when using -ls . server still running , can see below, screen process should still active? serverstart.sh called during init . , contained while loop. serverstart.sh : #/bin/bash #check see if minecraft screen running linecount=`screen -r mc | grep "there no screen resumed matching mc." | wc -l` #start minecraft server in detached screen named "c" if not running #launch command line interface minecraft if arealdy running. if [ $linecount -eq 1 ] echo linecount: $linecount. starting in deteched screen named minecraft. use screen -r minecraft view. screen -dms mc sh serverloop.sh else echo linecount: $linecount. minecraft running. use screen -r minecraft view. running now. screen -r mc fi serverloop.sh : #/bin/bash while true java -server -xms4096m -xmx16384m -xx:permsize=512m -d64 -xx:+useparnewgc -xx:+cmsi...

markdown - Jekyll raw HTML in post -

i have jekyll website, posts written in markdown using kramdown parser. i add raw html within post. when try add html, parses markdown (changing < 's &lt; example). i have tried: adding html in own paragraph. including .html file. adding markdown="0" html tag (also tried 1 ). indenting (and wrapping in triple back-tick) of above. using raw tags example of have: some **markdown** `here` <iframe src="asd"></iframe> more *markdown*. the iframe should output html, not parsed text. i using github pages, jekyll extensions not optional. the html being ignored because tag attr's did not have quotes. example width=500 should have been width="500" nothing else required. html in own paragraphs no indentation , parsed.

android - error show cursor out of bound -

i'm show particular data listview bt doenot show emulator goes blank.... query as.. sqlitedatabase sd = db.getreadabledatabase(); string select = "select * pending_dues_table _pending_dues_id ="+i; cr = sd.rawquery(select, null); if (cr != null) { //cr.movetofirst(); int ii; ii=cr.getcolumnindex("pending_dues_notice"); while (cr.movetolast()){ namelist.add(cr.getstring(ii)); //studentno.add(cursor.getstring(1)); } } arraylist<string>combimelist=new arraylist<string>(); for(int j = 0; j<namelist.size();j++){ combimelist.add(namelist.get(j)); } adapter = new arrayadapter<string>(studentdues.this,r.layout.student_due, combimelist); and locat show error as.. 05-25 03:33:56.225: e/androidruntime(5134...

java - Spring Cloud - Config Client slows down metric /health -

i using configserver within spring boot + spring cloud project. used monitor endpoint /health, since configclient asks configserver within every request, invocation of metric "/health" quite slow. this due fact, every request configserver, 1 calls bitbucket –> entire request chain quite long/slow. is there way disable check configserver being available? monitor 1 separately. best fri not currently. how checking health? can submit issue have property disables health check. you work around extending configserverhealthindicator , overriding dohealthcheck . the like: @bean public configserverhealthindicator configserverhealthindicator( configservicepropertysourcelocator locator) { return new myemptyconfigserverhealthindicator(locator); }

formatting - Python's Multiplication Function -

in python found multiplication solution useful software writing. problem when using software, user asked question (i.e 8x2) prints command-type line (i.e 14). not user friendly , display in simpler form, common writing form (8x2). post pictures integrate question. on right result screen, on left code itself. if have more questions please ask. you can add dictionary operator descriptions: op_symbols = { add: '+', mul: '*', sub: '-', } and instead of str(op) , use op_symbols[op]

Passing map type argument in function in Erlang complains error -

here's code snippet. %% test.erl -export([count_characters/1]). count_characters(str) -> count_characters(str, #{}). count_characters([h|t], #{h := n} = x) -> count_characters(t, x#{h := n+1}); count_characters([h|t], x) -> count_characters(t, x#{h => 1}); count_characters([], x) -> x. %% ershell 1> c(test). test.erl:19: illegal use of variable 'h' in map test.erl:20: illegal use of variable 'h' in map test.erl:20: variable 'n' unbound test.erl:22: illegal use of variable 'h' in map error i don't know why complains such error, since following code worked out fine: %% test2.erl birthday(#{age := n} = person) -> person#{age := n+1}. %% ershell 1> c(test2). 2> test2:birthday(#{age => 333}). #{age => 334} thanks in advance. the reason simple: map hasn't been implemented yet. take at: http://learnyousomeerlang.com/maps also, might think of alternative implementations, using st...

javascript - AngularJS — Passing object/object property to be $watched into $scope.$watch -

deep watching on large objects performance killer—so i'd able pass dynamic object/property watchexpression parameter of $scope.$watch function, whenever invoke action changes particular object or property. i have bunch of different objects , don't want set watches of them. for example: var watchingfunction = function (objecttobewatched) { $scope.$watch(function (objecttobewatched) {return objecttobewatched;}, function(newvalue, oldvalue) { if (newvalue !== oldvalue) {...}; }, true); $scope.object = true; $scope.changemyobject = watchingfunction(object); html <input type="checkbox" ng-model="object" ng-change="changemyobject()"> i believe wouldn't work because invoking function watchingfunction() runs $scope.$watch() once? if define $scope.$watch on $scope (instead of wrapped inside watchingfunction() continually watching $scope.$watch's watchexpression ? if case, there creative things can return v...

Jasper - Oracle - query result table is repeated -

i cannot complex query table in jasper return single table. repeats resultant table same number of times number of rows returned. simple query overcome using where rownum<=1 . with following query, 'where rownum<=1' helps nothing (it gives me 1 row result when there should many , still have multiple repeated tables): select column1, column2, column3, column4, column5 the_table (column1 concat ($p{column1},'%')) , (column2 concat ($p{column2},'%')) , (column3 concat ($p{column3},'%')) , (column4 concat ($p{column4},'%')) , (column5 concat ($p{column5},'%')) , rownum<=1 order column4 desc i'd 1 table returned in jasper report - not many there rows in table. and rownum<=1 correct. must added in main query - not sub-dataset. :)

objective c - Selection in TableViewCell -

Image
on selection of tableviewcell, change color of tableviewcell. when select cell on tableviewcell , scroll other cell selected. after scroll other cell affected this code static nsstring *identifier = @"tbdcreategameplayercell"; tbdcreategameplayercell *playercell = (tbdcreategameplayercell *)[tableview dequeuereusablecellwithidentifier:@"tbdcreategameplayercell"]; if (!playercell) { nslog(@"creating new cell : %d",row); nsarray *nib = [[nsbundle mainbundle] loadnibnamed:@"tbdcreategameplayercell" owner:nil options:nil]; playercell = [nib objectatindex:0]; } you must implement delegate method: - (void)tableview:(uitableview *)tableview willdisplaycell:(uitableviewcell *)cell forrowatindexpath:(nsindexpath *)indexpath inside method change cell background default color. from apple docs : discussion a table view sends message delegate before uses cell draw row, thereby permitting delegate cu...

appcelerator - Image getting stretched when used round shape ImageView -

i want display image in round shape , able display user image in round shape, not able manage image quality.image getting shrinked/stretched.i trying test in android device. titanium studio information titanium studio, build: 3.4.1.201410281727 build: jenkins-titanium-rcp-master-202 device screenshot of stretched image. http://i60.tinypic.com/23hq9lv.png my code follows. view <view id="userpiceview"> <imageview id="userimage" onclick="chooespic"></imageview> </view> tss "#userpiceview":{ left : "10%", width: 84, height: 84, borderradius: 42, bordercolor: '#f05323', borderwidth: 3, } "#userimage":{ autorotate: true, image: "/images/defaultuser.png", defaultimage: "/images/defaultuser.png", } controller function chooespic() { titanium.media.openphotogallery( { mediatypes : [ti.media.media_typ...

php - Uploading csv not working on Server Codeigniter -

this question has answer here: uploading csv codeigniter 5 answers here code function importcsv() { $data['addressbook'] = $this->csv_model->get_addressbook(); $data['error'] = ''; //initialize image upload error array empty $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'csv'; $config['max_size'] = '1000'; $this->load->library('upload', $config); // if upload failed, display error if (!$this->upload->do_upload()) { $data['error'] = $this->upload->display_errors(); $this->load->view('csvindex', $data); } else { $file_data = $this->upload->data(); $file_path = './uploads/' . $file_data['file_name']; if ($this->csvimpor...

bash - What's wrong with this shell tests? -

in script has functions defined: #!/bin/bash -- outtrue (){ printf "%15s t|%s" "$*" "$?"; } outfalse (){ printf "%15s f|%s" "$*" "$?"; } tval1(){ [ "$@" ] && outtrue "$@" || outfalse "$@"; } tval2(){ [ "$*" ] && outtrue "$@" || outfalse "$@"; } tval3(){ [[ "$@" ]] && outtrue "$@" || outfalse "$@"; } tval(){ printf "test %s\t" "$1"; shift case $1 in (1) shift; tval1 "$@" ;; (2) shift; tval2 "$@" ;; (3) shift; tval3 "$@" ;; esac printf "\n" } this tests work (as expected): xyz="str"; tval "-n var" 1 "-n" "$xyz" xyz="str"; tval "-z var" 1 "-z" "$xyz" one=1; tval "1 -eq \$one" 1 "1...

Magento: Cancel non invoiced order item without cancelling order -

we have allowed offline payment method on our store, customer pays item once been shipped , reaches them. the test case scenario facing issues follows: customer orders 3 items 1 quantity each. when process order shipping, find 1st item can shipped right away, 2nd item has cancelled per customer's request , 3rd item might take week procure. with magento, i've noticed if we're sure last 2 items not going shipped, can invoice , ship 1st item , when click on 'cancel order' button, cancels non invoiced items. in case, 2nd item should cancelled right while 3rd item shipped after week. is there way cancel 2nd item without cancelling order?

mysql - sql counting all records belong to parent record with many to may relationship -

i have tables called category , posts . post can belong more one category. category has many posts , relationship many many . created new weak entity cat_post table. in category , record can have many child not child of child. want count posts belongs parent records. category table fields id category_id 1 2 3 4 1 5 1 6 2 7 2 posts table id 1 2 3 cat_post table field tender_id category_id 1 4 2 5 3 3 3 5 4 6 4 4 category: +-----------------+--------------+------+-----+---------+----------------+ | field | type | null | key | default | | +-----------------+--------------+------+-----+---------+----------------+ | id | int(11) | no | pri | null | auto_increment | +-----------------+--------------+------+-----+---------+----------------+ | category_id | int(11) | no | null | nu...

python - How should I group similar exceptions in a docstring? -

i don't see mentioned in style guide. should combine similar exception types or split them separate lines: """ google style docs. ... ... raises: typeerror: foo() missing 1 required positional argument. key must numeric value. keyerror: bar """ or this: """ google style docs. ... ... raises: typeerror: foo() missing 1 required positional argument typeerror: key must numeric value keyerror: bar """ i think go second. """ google style docs. ... ... raises: typeerror: 1. foo() missing 1 required positional argument. 2. key must numeric value. 3. ... keyerror: 1. bar key missing. 2. ... """

javascript - new Mongo.Collection() error Cloud9 -

so i'm learning meteor framework, i'm using windows 7 , followed tutorial create leaderboard app. app works fine when run using terminal (runs on localhost:3000) when try running exact same code on cloud9, error: your code running @ https://leaderboard-sanidhya-singh.c9.io. important: use process.env.port port , process.env.ip host in scripts! debugger listening on port 15454 /home/ubuntu/workspace/leaderboard.js:1 xports, require, module, __filename, __dirname) { playerslist = new mongo.coll ^ referenceerror: mongo not defined @ object.<anonymous> (/home/ubuntu/workspace/leaderboard.js:1:81) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.runmain [as _ontimeout] (module.js:497:10) @ timer.listontimeout [as ontimeout] (timers.js:112:15) code: ...

html - Creating a Masonry Layout using CSS? -

Image
this question has answer here: masonry-style layout css 3 answers i want create layout using css , not jquery or javascript. possible , if so, please direct me right source. :) i tried hand @ didn't come out well: http://codepen.io/anon/pen/gjzwox html: <div class="parent"> <div class="red"> </div> <div class="blue"> </div> <div class="red"> </div> <div class="red"> </div> </div> css: .parent{ width:330px; } .red{ float:left; width:150px; height:150px; margin-bottom:10px; margin-left:10px; background-color:red; } .blue{ float:left; width:150px; height:300px; margin-bottom:10px; margin-left:10px; background-color:blue; } flexbox allows due hability distribute content , gaps. flexbox u...

HTA/VbScript - If statement from Dropdown list choice -

in hta using vbscript trying read choice dropdown list run specific code each choice. i've been poking around looking method use value of dropdown list run specific vbscript subroutine have not found helpful in search. code below work displays message box choice listed. pointers extremely appreciated!! <select name="buildstepchoice" size="1"> <option selected="selected" value=" "></option> <option value="1">1</option> <option value="2">2</option> </select> &nbsp; and vbscript sub copychecklist() dim vmbuildstep vmbuildstep = document.getelementbyid("buildstepchoice").value if vmbuildstep = 1 msgbox "picked #1" else if vmbuildstep = 2 msgbox "picked #2" end if end sub not sure picked up, ended with. sub copychecklist() dim vmbuildstep vmbuildstep = document.getelementbyid("buildstepchoice").value i...

c# - Unity3D SQLite ArgumentException: The Assembly System.Configuration is referenced by System.Data -

i'm using unity3d 5 , mono develop compiler. when clicked build mono compiler, says "build successfully". when run game in editor, works fine , functions expected. but when tried build .exe windows x86_64. shows error... argumentexception: assembly system.configuration referenced system.data ('assets/plugins/system.data.dll'). dll not allowed included or not found. unityeditor.assemblyhelper.addreferencedassembliesrecurse (system.string assemblypath, system.collections.generic.list`1 alreadyfoundassemblies, system.string[] allassemblypaths, system.string[] folderstosearch, system.collections.generic.dictionary`2 cache, buildtarget target) (at c:/buildslave/unity/build/editor/mono/assemblyhelper.cs:154) unityeditor.assemblyhelper.addreferencedassembliesrecurse (system.string assemblypath, system.collections.generic.list`1 alreadyfoundassemblies, system.string[] allassemblypaths, system.string[] folderstosearch, system.collections.generic.dictionary`2 ca...

asp.net mvc - jQuery DateTime picker issue -

i using jquery datetime picker on 1 of view. datetime picker working fine on 1 pc. on pc giving error: microsoft jscript runtime error: object doesn't support property or method 'datepicker' the jquery code , view same on both pcs. jquery versions same. below code: <link href="@url.content("~/content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" /> <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> <script src="~/scripts/jquery-1.10.2.min.js"></script> <script src="~/scripts/jquery.validate.min.js"></script> <script src="https://code.jquery.com/ui/1.10.2/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready (function () { $(".fromdate").datepicker(); }) </script> the difference see in a...

cakephp - Undefined variable in view -

i having issue setting variables in controller , showing @ view. my codes follow: in view (pages/anything.ctp): <?php echo $anything; ?> in controller (pagescontroller.php): public function anything() { $a = "asdasdas"; $this->set('anything', $a); } i new cake, , i've done quite number of search in google , stack. still no luck. i'd grateful if help, or if asked question before please provide link best. first read following article controller actions in cakephp cookbook when use controller methods requestaction(), want return data isn’t string. if have controller methods used normal web requests + requestaction, should check request type before returning: class recipescontroller extends appcontroller { public function popular() { $popular = $this->recipe->popular(); if (!empty($this->request->params['requested'])) { return $popular; } $thi...

java - required: javax.xml.bind.annotation.XmlAccessType -

i trying import svn url on eclipse.when tried run components of project keep having error. buildfile: c:\users\phmasu\workspace\cbasservices\branches\cr-xx-seasonpass\build.xml init: pre.compile.test: [echo] stax availability= true [echo] axis2 availability= true compile.src: [javac] c:\users\phmasu\workspace\cbasservices\branches\cr-xx-seasonpass\build.xml:46: warning: 'includeantruntime' not set, defaulting build.sysclasspath=last; set false repeatable builds [javac] compiling 630 source files c:\users\phmasu\workspace\cbasservices\branches\cr-xx-seasonpass\build\classes [javac] c:\users\phmasu\workspace\cbasservices\branches\cr-xx-seasonpass\src\com\cbas\conversion\rule\conversiontype.java:10: incompatible types [javac] found : javax.xml.bind.annotation.accesstype [javac] required: javax.xml.bind.annotation.xmlaccesstype [javac] @xmlaccessortype(accesstype.field) [javac] ^ [javac] c:\users\phmasu\wo...

Android Studio Gyroscope examples? -

i'm trying build application desired affect when device tilted degree. i've taken at, , enabled, accelerometer, doesn't give me desired affect. said, wish device want to, when device has achieved degree, 90 degrees. i've got following code, works when device tilted fast enough: @override public void onsensorchanged(sensorevent sensorevent) { sensor mysensor = sensorevent.sensor; if (mysensor.gettype() == sensor.type_gyroscope) { float x = sensorevent.values[0]; float y = sensorevent.values[1]; float z = sensorevent.values[2]; long currtime = system.currenttimemillis(); if ((currtime - lastupdate) > 100) { long difftime = (currtime - lastupdate); lastupdate = currtime; float speed = math.abs(x + y + z - last_x - last_y - last_z) / difftime * 10000; if (speed > shake_threshold && !sound.isplaying()) { sound.start(); } ...

c - read signed number from a char vector -

i got problem , need help, i'll thankful: when input negative number using fgets() , try verify string input user in char array read fgets() number isdigit() positive numbers, there way read negative numbers. (i need read numbers can use scanf because when read character makes me mess) here's part of code: char op[30]; int a[30]; int text_ssalto() { size_t len = strlen(op); fgets(op, sizeof(op), stdin); len = strlen(op); if (len > 0) { op[len - 1] = '\0'; } if (isdigit(*op)) { sscanf(op, "%d", &a[x]); } return 0; } i think maybe somewhere else wrong in code, here sample similar yours , working. did include correct headers? #include "ctype.h" #include "stdlib.h" #include "stdio.h" int main () { char op[30]; fgets(op, sizeof(op), stdin); /* input -11 */ printf("%s\n", op); /* output -11 */ if (isdigit(*op)) { ...

php - Clearing logs in Symfony -

is possible clear logs in symfony? mean, there command clear logs using windows? believe there command clear logs since there command in windows clear cache: php app\console cache:clear thanks in advance. in symfony2 standard edition, not found command or function clear logs. but, can create custom command clear logs , functions. command cache:clear clear caches ( app/cache/{environment} or var/cache/{environment} )

graph - Gnuplot Parallel Coordinates/Axes Plot Key Annotation -

Image
i can plot parallel coordinates graphs gnuplot 5.0. example: plot "ranking_top10.dat" using 4:5:6:7:8:2 parallel lt 1 lc variable will plot 5 axes, , lines in different colors. however, want associate keys each of lines. example, want associate key (string) purple line , show on figure. how that?

python - re.sub() not working as I expect -

i have string given below. appcodename: mozilla<br>appversion: 5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) ubuntu chromium/41.0.2272.76 chrome/41.0.2272.76 safari/537.36<br> i want extract mozilla above string. use following python program. import re import json open('data.txt','rb') f: data = json.load(f) message = data['message'] appcodename = re.sub('.+appcodename: ([^<br>])(.*)',r'\1',message,1) print('appcode name {}'.format(appcodename)) the output appcode name m what wrong regex. the problem regex twofold: you using negated class [^<br>] matches character except < , b , r , > (their order irrelevant). not cause problem particular case, not advised use negated class prevent matches spe...

vb.net - Recursive factorial output -

i'm trying write recursive function through vb console application output factorial or number between 1 , 10. system.stackoverflowexception when run it. can explain i've done wrong? module module1 dim number byte sub main() console.writeline("write number 1-10") number = console.readline() factorialcalc() end sub function factorialcalc() dim counter byte dim byte ' dim factorial integer if number < 1 or number > 10 console.writeline("please select number 1-10") end if loop until number >= 1 , number <= 10 = number factorialcalc = number * factorialcalc(number - 1) counter = counter + 1 loop until counter = + 1 console.writeline(factorialcalc.value) console.readline() end function end module a factorial program shouldn't long. need is: module module1 dim number integer sub main() console.w...

javascript - Why wont My Variable Appear In The TextBox Using Jquery? -

i having little trouble here. im building calculator , im working on general idea on , im confused on why variable charlie not appear in output text box. variables correct in end ( checked them alert function) in end seems wont show up! appreciated! <!doctype html> <body> <div id="content"> <form name="calc"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script id="numberbuttons"> $(document).ready(function(){ $('#button1').click(function(){ $('#output').val($(this).val()); }); $('#button2').click(function(){ $('#output').val($(this).val()); }); $('#button3').click(function(){ $('#output').val($(this).val()); }); $('#button4').click(function(){ $('#output').val($(this).val()); }); $('#button5').click(function(){ ...

Parse and Swift: Add comment to post through Array to a Object Using a Relation? -

i new swift , parse... have tried reading through documentation parse on how make comments on post , have seen different ways confused. now, have chosen create array because don't believe there lot of comments(for time being). so way set have class in parse known "posts" in class there column string "post" , column array "comments". i have "posts" being presented in tableview , when user prompted view controller(showing post , time posted) has comment button on bottom prompts comment view controller modally. the postpressed function adding text comment array new row , not adding text comment array in row of original post. @ibaction func postpressed(sender: anyobject) { var object = pfobject(classname: "post") object.addobject(self.commentview?.text, forkey: "comment") object.saveinbackground() like said, tried reading documentation , confused on whether there should pfrelation or pfquery rela...

r - Finding longest repeating element in vector -

i find starting , ending index of consecutive repeating elements equal "1" in following vector. vector has values can equal "1" or na. for example: out2 [1] "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" "1" [21] "1" na na na na na "1" "1" "1" "1" "1" "1" na na na na na na na na the output should following [,1] [,2] [1,] 1 21 [2,] 27 32 try rle : x <- c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, na, na, na, na, na, 1, 1, 1, 1, 1, 1, na, na, na, na, na, na, na, na) with(rle(x), { ok <- !is.na(values) ends <- cumsum(lengths)[ok] starts <- ends - lengths[ok] + 1 cbind(starts, ends) }) gi...

javascript - Functionality Issue using the '.animate()' Function -

i working through jquery curriculum on codecademy , particular assignment involves using switch function in conjunction multiple instances of '.animate()' function. 'img' in question our favorite italian plumber move left. when run code error returned " oops, try again. looks image doesn't move right when press 'right'." $(document).ready(function() { $(document).keydown(function(key) { switch(parseint(key.which,10)) { // left arrow key pressed case 37: $('img').animate({left: "-=10px"}, 'fast'); break; // arrow pressed case 38: $('img').animate({up: "-=10px"}, 'fast'); break; // right arrow pressed case 39: $('img').animate({right: "-=10px"}, 'fast'); break; // down arrow pressed ...

ios - Hide keyboard when UIMenuViewController is shown -

when show uimenuviewcontroller on uitextfiled , keyboard pops up. wondering if there way hide keyboard when uimenuviewcontroller visible. i use below code show menu. nsarray *buttons = items; nsmutablearray *menuitems = [nsmutablearray array]; (nsstring *buttontext in buttons) { nsstring *sel = [nsstring stringwithformat:@"magic_%@", buttontext]; [menuitems addobject:[[uimenuitem alloc] initwithtitle:buttontext action:nsselectorfromstring(sel)]]; } uimenucontroller *menucont = [uimenucontroller sharedmenucontroller]; [menucont settargetrect:view.frame inview:view.superview]; menucont.arrowdirection = uimenucontrollerarrowdown; menucont.menuitems = menuitems; [menucont setmenuvisible:yes animated:yes]; when want hide keyboard (in example menu items visible) hiding keyboard use [textfield resignfirstresponder]; may problem solve

html - Page Won't Overflow -

ok, dumb question, cannot work. want 1 part of page 20%, , other side 100%, total width being 120%. now, i'm doing experiment jquery , navbar, cannot life of me these divs overflow, there scroll bar on bottom. happens 100% div goes below 20% div. have tried floats, aren't working , don't know why. thank help code body, html { margin: 0px; height: 100%; overflow: auto; } #allcontainer { height: 100%; float: left; box-sizing: border-box; } #navbardiv { height: 100%; width: 20%; background-color: red; position: relative; z-index: 50; float: left; box-sizing: border-box; padding: 0; } #mainpagediv { width: 100%; height: 100%; position: relative; box-sizing: border-box; background-color: blue; float: left; } p { padding: 0px; margin: 0px; } <div id="allcontainer"> <div id="navbardiv"> <p> llorem ipsum dolor sit amet, consectetur ad...

c# - LINQ how to use "group by" to simplify lists with duplicate attributes -

i have object "chartobject" , want group fields before can plot whole list. public class chartobject { public string type { get; set; } public int year { get; set; } public long cost { get; set; } } i want group type each year prevent duplicate types each year. each type want summed cost under year. for example list: chartobject(type1, 2015, $10) chartobject(type1, 2015, $20) chartobject(type2, 2016, $10) chartobject(type1, 2016, $10) chartobject(type2, 2017, $10) chartobject(type2, 2017, $10) should combined this: chartobject(type1, 2015, $30) chartobject(type1, 2016, $10) chartobject(type2, 2016, $10) chartobject(type2, 2017, $20) this linq query have far. not correct since doesn't group year: list<chartobject> colist = getitems(); var query = ( l in colist group l l.type x select new chartobject() { cost = x.sum(c => c.cost), type = x.first().type, year = x.first().year, } )....

how can i minimize the stack trace in eclipse java tomcat? -

when debug java app in eclipse during development, problems isolated actual code in whatever app debugging. yet stack trace lists every class in every jar included in buildpath called when error thrown. means takes longer every single time sort through stack trace find lines of code in classes have built myself in app. want stop wasting time. how can set eclipse stack trace includes classes , line numbers in code written in project itself, , not in included jars? i wrote open source library has 1 of utilities solves exact problem. utility allows specify particular package prefix , allows smartly filter out irrelevant lines stack trace. can control boolean flag if want full stacktrace or filtered one. use feature in of projects , happy it. library available maven artifact (source code, javadoc , actual library) , project on github. utility can plugged in spring bean. here article explains in detail how works how use , how both maven artifact , project github: open sour...

c# - How can I change Windows Forms Chart control data? -

Image
this code i'm using now: private void button1_click(object sender, eventargs e) { random rdn = new random(); (int = 116; > 0; i--) { chart1.series["series1"].points.addxy (rdn.next(0, 10), rdn.next(0, 10)); } chart1.series["series1"].charttype = seriescharttype.fastline; chart1.series["series1"].color = color.red; chart1.series["series1"].charttype = seriescharttype.fastline; } what is: but want change it. on left side instead numbers 0 10 see numbers 1 116 , on bottom instead -1 10 see 1 30. and draw line starting @ 116 until 1 according 1 30. example in 1 it's 116 in 2 105 100…it's testing can random or straight line 116 30. but want know how use how draw line starting 116 , moving down according 1 30. it not entirely clear me trying do. how interpreted question: on left side instead numbers 0 10 see numbers 1 116 , on bottom instead -1 10 see 1 30...

c# - How do you sanitize and publish HTML into ASP.Net View? -

my goal save , post html blog post using c# asp.net mvc, using best practices how do this? below source causes following error: error 2 operator '.' cannot applied operand of type 'lambda expression' articlecontent.cs (controller) // post: article/articles/create [httppost] [validateantiforgerytoken] [authorize(roles = "canedit")] public actionresult create([bind(include = "postid,title,publishdate,createdate,modifydate,author,pagebody,feature,published,excerpt,createdateutc,publishdateutc,modifydateutc,canonicalurl,urlslug,category,tag")] articlecontent articles) { if (modelstate.isvalid) { db.articles.add(articles); db.savechanges(); return redirecttoaction("index"); } return view(articles); } article.cs (model) [display(name = "body of article")] public string pagebody { get; set; } index....

android - centerVertical won't work with a fragment -

i made simple fragment 2 edit texts in it. then, tried add image button. want fragment in center of activity , worked fine. however, image button won't in center of fragment below 2 edit texts. why won't centervertical work fragments? here xml code login view xml file: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <edittext android:hint="type username" android:id="@+id/usernametext" android:imeoptions="actiondone" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <edittext android:hint="type password" android:id="@+id/passwordtext" android:layout_below="@id/usernametext" android:imeoptions="actiondone" a...

excel - VBA document.all.item only works on username but not password -

first, here's code: (the code no different standard codes vba-open-website if save time reading, placed <---------here indicate put password) sub login_2wiki() dim ieapp internetexplorer dim iedoc object dim ietable object dim clip dataobject dim iusr object dim ipwd object dim iform object 'create new instance of ie set ieapp = new internetexplorer 'you don’t need this, it’s debugging ieapp.visible = true 'assume we’re not logged in , go directly login page ieapp.navigate "https://xxx.xxxxx.com/login.action?" while ieapp.busy: doevents: loop until ieapp.readystate = readystate_complete: doevents: loop set iedoc = ieapp 'fill in login form – view source browser control names iedoc set iform = .document.getelementbyid("login-container") set iusr = iform.document.getelementbyid("os_username") iusr.value = "guest" set ipwd = iform.document.getelementbyid("os_password") ipwd.value = ...

packet sniffers and kernel bypass -

is packet sniffer software implemented kernel bypass. if so, how (apis) done on linux , windows? or packet sniffer depend on kernel talk nic , put promiscuous mode. if so, again apis lin linux , windows does packet sniffer depend on kernel talk nic , put promiscuous mode at least free-software packet sniffers, yes, does. (some commercial sniffers on windows might supply own drivers, @ least wi-fi adapters, , bypass networking stack adapters.) if so, again apis lin linux , windows linux: pf_packet sockets . windows: there aren't nice apis, so, example, winpcap has provide its own kernel-mode driver uses ndis kernel interface. or use libpcap on un*x (linux, *bsd, os x, aix, solaris, hp-ux, etc.) , winpcap on windows, , let use appropriate capture mechanism , programming interfaces on os you're using (take @ pcap-linux.c in libpcap source - it's bit complicated use of linux apis, example).

c# - Rendering video to file that may have an inconsistent frame rate -

i'm getting raw video frames source (that can considered black box) @ rate can inconsistent. i'm trying record video feed disk. i'm doing aforge's videorecorder , writing mp4 file. however, inconsistent rate @ receive frames causes video appear sped up. seems have ability create video files have fixed frame rate, though source not have fixed frame rate. this isn't issue when rendering screen, can render fast possible. can't when writing file, since playing file play @ fixed frame rate. what solutions there? output not have same video format long there's reasonable way convert later (which wouldn't have real time). video feeds can quite long, can't store in memory , encode later. my code looks along lines of: videofilewriter writer = new videofilewriter(); stopwatch stopwatch = new stopwatch(); public override void start() { writer.open("output.mp4", videowidth, videoheight, framerate, aforge.video.ffmpeg.videocodec.mpeg4...

javascript - Put a slider on each record from a tree panel extjs 5.1 -

i have tree panel data, , want add slider rigthclick event, slider doesn't appear. this code: tree: var tree = ext.create('ext.tree.panel', { title: '', width: 500, height: 400, //renderto: ext.getbody(), reservescrollbar: true, loadmask: true, usearrows: true, rootvisible: false, store: treestore, allowdeselect : true, border : true, animate: true, listeners: { checkchange: function(node, checked, eopts) { console.log('selected node:', node, checked, eopts); }, select: function( record, index, eopts ){ console.log('selected element:', record, index, eopts); }, beforedeselect: function( record, index, eopts ){ console.log("", record); } }); event: tree.on('itemcontextmenu', function(view, re...

javascript - Meteor: JS alertbox 'cancel' is deleting my db entry instead of canceling the requested delete -

i have alert box on delete option, when 'cancel' pressed still deletes data :( here's button in html page. <input type="button" class="remove" value="remove player" onclick="return confirm('are sure?');"> here's delete code in js file: 'click .remove': function(){ var selectedplayer = session.get('selectedplayer'); playerslist.remove(selectedplayer); } what alert box return on false can use in if statement around remove function? - what's variable name of alert? with way have set have 2 click event handlers, button onclick won't prevent template event being triggered. try removing onclick event button , move template event: 'click .remove': function(){ if (confirm('are sure?')) { var selectedplayer = session.get('selectedplayer'); playerslist.remove(selectedplayer); } }

playframework - Typesafe ConfigFactory Load -

i have json in conf directory of play application , want load using configfactory: val cfg = configfactory.load("myjson.json") val jsvalue = json.parse(cfg.root().render(configrenderoptions.concise())) what notice there tons of other stuff akka... , loads more. how should rid of it? i'm using play's json api! the standard behaviour described here: https://github.com/typesafehub/config#standard-behavior since there more configuration values think, can selective in picking required configuration values. or maybe, check against reference.conf , discard values in output.

place javascript variables in html - several ways, which one to choose? -

i'm on html have place variables in depency of language choosen user. several reasons able client-side. i have figured out different ways so, i'm asking myself best way (best way in case means "fastest", "most fail-safe" , on). the variables stored in json-file looking this: lang = { "nav" : { "categories" : { "header" : { "de" : "kategorien", "en" : "categories" }, }, "search" : { "placeholder" : { "de" : "suchen nach...", "en" : "search for..." }, "button" : { "de" : "finden", "en" : "find" }, }, }, "benefits" : { "first" : { "title" : { "de" : "irgendwas", ...

ios - Can I run a KIF test that puts my app in the background? -

i'm working on developing tests using kif project. want know if it's possible have kif simulate tap on home button? possible simulate other actions @ point, such bringing command center or notification center? at least partial answer you, take @ deactivateappforduration in kiftestactor.h : /*! @abstract backgrounds app using uiautomation command, simulating pressing home button @param duration amount of time background event before app becomes active again */ - (void)deactivateappforduration:(nstimeinterval)duration;

c++ - Link List - no operator '<<' matches -

my c++ poor. anyhow code snippet bellow why error on << in while loop when outside of no error. error is: no operator "<<" matches these operands. string w picks word fine. read somewhere may have overload why? , how on load link list. in advance. void print() { hashtable *marker = headone; hashtable *inlist; for( int = 0; < tablesize; i++ ) { cout << << ": " << marker->number << endl; if(marker->child != null) { inlist = marker; { string w = inlist->word; cout << w << endl; inlist = inlist->child; } while(inlist != null); } marker = marker->next; }//end loop } in order able cout std::string have include: #include <string> #include <iostream>

Pulling git submodules using SSH key instead of password -

i have 5 entries in .gitmodules: [submodule "workbench/myuser/my-package"] path = workbench/myuser/my-package url = git@bitbucket.org:myuser/my-package.git everytime git submodule foreach git pull origin master update them all, i'm asked password each one. how make git use ssh key access submodule repos instead of using password? yes, quite simple, while adding submodule have choose ssh key link (means no https) in bitbucket or gitacc there. before link. so once machine ssh key linked in bitbucket/gitacc. thing made correctly ask password each time. have check main project checkout ssh url or not. another possibility individual repo don't have ssh access. all these correct go. should work.

excel - SQL + VBA Populating Data in Cell Range -

i have code connecting sql database in vba. data populating correctly however, wondering if there way condense code below. have 4 different columns , 26 rows , feel if go route, wasting lot of time. want range go c20:c45 , results show cells h20:h45. can 1 help? thanks! ' open connection , execute data wftes. set rs = conn.execute("select sum(hours)/80 payroll2015_rif departmentcode = '" & range("$e$6") & "' , payperiod = '" & range("c20") & "' , paycode in ('reg1', 'reg2');") ' transfer result. sheets(2).range("$h20").copyfromrecordset rs ' close recordset rs.close ' open connection , execute data wftes. set rs = conn.execute("select sum(hours)/80 payroll2015_rif departmentcode = '" & range("$e$6") & "' , payperiod = '" & range("c21") & "...