Posts

Showing posts from January, 2010

HTML Section Paging -

how can link header href menu page of section header still on top in inner html. here header , div menu: <img src="img/logo.png" width="65" height="65"> <h1 style="color:#b2bcb1;">bangkit<small>wm</small></h1> <div id="menu"> <a href="#">about</a> <a href="#">portofolio</a> <a href="#">contact</a> </div> </header> and here section class want linked in href of header menu: <div class="main"> <section class="page one"> <div class="page-container"> <h2>about me</h2> <p>fokus untuk mengakhiri karir</p> <p><small><a href="bangkitwira.com"></a><a href="index2.html">that child</a></small></

angularjs - setting a this.value in ng-init and accessing it from ng-class not working -

i'm trying attach distinct value child elements of elements created ng-repeat. div(ng-repeat=" element in array ") div(ng-init=" this.value='zero' " ng-class=" this.value === my.value ? 'match' : 'not' " ) div(ng-init=" this.value='one1' " ng-class=" this.value === my.value ? 'match' : 'not' " ) the $scope.my.value set dynamically, shown above, want test against this.value hard-coded element in ng-init . but isn't giving me results. maybe this.value isn't attaching element. doing wrong (i don't know why thought this work), there alternative want? i guess crux of question is: there this /equivalent each element can pin distinct values to? you can put controller on each element, , initialize value using $index: html: <div ng-repeat="element in array" ng-class=" value === my.value ? 'match' : 'not' "

Javascript variable scope - variable undefined -

this question has answer here: global javascript variable scope: why doesn't work? 5 answers i trying understand how following java script code works. have global variable called color stores 'blue'; calling printcolor() simple prints color. don't understand why color undefined when defining new local variable called color in function. if uncomment local color variable declaration below, color undefined. var color = 'blue'; printcolor(); function printcolor(){ document.write(color); //var color = "green"; } you re-declaring variable color inside printcolor() function, since declaration hoisted top overwrites @ start of function, hence see undefined var color = 'blue'; function printcolor(){ document.write(color); //var color = "green"; } printcolor(); but if do: function printcolor(){

Sum column no in excel with condition -

i have excel below b c d e 1 result sub1 sub2 sub3 total 2 ram sub3 sub2 sub3 2 3 hari sub1 sub3 sub2 1 here in above example total = count of correct result ie in b ram sub3 != sub1 not counted total c , d right. trying can not result formula total in excel you can array formula : use following formula in e2, fill down. adjust ranges if have more data example: {=sum(if($b2:$d2=$b$1:$d$1,1,0))} note array formula. enter it, enter formula =sum(if($b2:$d2=$b$1:$d$1,1,0)) , press ctrl + shift + enter . this works doing explain. checks each cell in range if equals value in row 1, either adds 1 or 0 depending on if matches.

Enable featured image in WordPress -

i converting html site wordpress. in new theme have no option featured image. how can enable option? use add_theme_support( 'post-thumbnails' ); in function.php

Fill html dropdown using array from database php -

i'm trying fill dropdown in html code below.i have searched here other questions , tried not working me? can me find mistake? <form id="data" class="form-geofence" role="form" method="post" action="geofencedata.php"> <select name="category_id"> <option value="">--- select ---</option> <?php include_once'./connectionusers.php'; $result=pg_query("select * geofence;"); while ($row = pg_fetch_array($result)) { ?> <option value="" ><?php echo $row["name"];?></option> <?php } ?> </select> i have used same php code seperately , shows names make sure databas

computer vision - Facebook Face recognition Twins -

i talking friend , told me facebook identify him , twin. identify meaning differentiate between them during tagging when present in same photo. how facebook it? face detection need extract features , use/compare them. considering identical twins, won't features same? it possible that, since asked 1 person, might wrong. if so, there research being conducted on same?

javascript - Angular JS : Filter using textbox and Checkbox -

i'm new angularjs , want filter data using textbox checkbox. here data: $scope.array = [ {name: 'tobias', lname: 'tlname', company: 'x'}, {name: 'jeff', lname: 'jlname', company: 'x'}, {name: 'brian', lname: 'blname', company: 'x'}, {name: 'igor', lname: 'ilname', company: 'y'}, {name: 'james', lname: 'jlname', company: 'z'}, {name: 'brad', lname: 'blname', company: 'y'} ]; all want if going choose x checkbox show rows related tobias jeff brian , if i'm going uncheck checkbox , type br , brian , brad show if i'm going check x checkbox bryan should show. thanks in advance. you use filters accomplish this. see fiddle: http://jsfiddle.net/w4xqv/16/ markup: <div ng-app="app" ng-controller="mainctrl"> <div>search name: <input type="

html - Nav dropdown freaks out and shows different tabs -

i'm trying create navbar (already done) dropdown, dropdown keeps spazzing out when hover on :( i made js fiddle of i've accomplished far, , hoping help! http://jsfiddle.net/kkpp6/ i think might due display: none; used in 1 of ul's or possibly due stupid typo can't figure out where! as this, can't figure out how make sub-menu sub-menus exist.. (so desc tab has submenu of swim squad have sub-menu of other things).. how that? can't figure out start! cheers in advance! try this: link css: .nav-wrap { background-color: #125cc1; text-align: center; } ul.navigation-bar li { color: #ffffff; background-color: #125cc1; text-align: center; padding: 6px; font-size: 12px; text-decoration: none; text-transform: uppercase; } ul.navigation-bar li a:hover { background-color: #06398f; } ul.navigation-bar { text-align: left; display: inline; margin: 0; list-style: none; } ul.navigation-bar li {

php - Foursquare - Menus are not displaying in API Explorer for certain venues -

Image
when run following url in browser window: https://foursquare.com/v/mr-teriyaki-burlingame-ca/4b269e61f964a5206f7e24e3/menu result: here menu results displaying, when run following url in browser window using endpoints 'venues/venue_id/menu': https://api.foursquare.com/v2/venues/4b269e61f964a5206f7e24e3/menu?oauth_token=lgy1itar5mbhyzxkrrkvdfxkjaut43atzt1gbcfkb2nlmsyy&v=20140627 result: here menu results not getting venue id correct, so kindly give me solution why menu details not displayed in foursquare api explorer window using endpoinds 'venues/venue_id/menu'. thanks, arularasan d, php programmmer.

android - AppOpsService:what's the difference between startOperation() and noteOperation()? -

since android 4.2 google put appops function settings app ,but after few weeks ,they close entrance of function, , close entrance,the function code can found in frameworks/base/services/java/com/android/server/appopsservice.java 。 but in source code , found there 2 functions check whether operation can permission. 1 startoperation() , noteoperation(), through reading remark , know : startoperation long-term permission check,and must call finishoperation after operation done. noteoperation short-term.though knew can't tell time should use startoperation , time should chose noteoperation . did read soucecode, , plz give me suggesstion. thank in advance. well , after few days late , found answer finally. difference between startop , noteop : startop prepare opereation work long time ,like gps,like vibrator , on , can start monitor permission use startop , end monitor use finishop , remember , finishop must called after end monitor. noteop short term operation , exampl

How operator overloading in c++ works -

i going through of theory of assignment operator of c++. let's say class myclass { private: t1 member1; t2 member2; public: // default copy assignment operator assigns object via memberwise copy myclass & operator=(const myclass & rhs) { member1 = rhs.member1; member2 = rhs.member2; return *this; } ...... } and c7 = c6; //member wise copy assignment. here returning reference object during assignment operation , assigning new object c7 . however if code this: int a=12; int &b=a; int c=&b; //error::invalid conversion ‘int*’ ‘int’ why different above case?? the declaration int& b = a; declares b reference, , makes reference variable a . the declaration int c = &b; declares c normal int variable, , try initialize pointer int . ampersand & different things depending on context. as copy-assignment operator, it's not called when initialize variable in declara

prolog - Initial guess in labeling -

given small example: go:- length( x, 200 ), domain( x, 1, 25), postconstraints( x, y ), labeling( [minimize(y), x ). if assume postconstraints set complex constraints. y returned postconstraints , used cost-function during labeling. we assume have no (or minimal) knowledge constraints set postconstraints . know optimal solution (or solution) x contains more or less uniform distribution of possible domain. i.e. value 1 appear around 8 (200/25) times, 2 appear around 8 times, etc. however don't know @ position each value appear. if start use of default labeling, x first assigned 1, solution, not solution (high y). running search long time, optimal solution found, more or less uniform distribution on possible domain. this mean search use long time go first possible solution optimal (or better) solution. i think if initial 'guess' applied x before labeling, search faster. ex. if x populated random values domain? there way in sicstus? use value(enu

SQL Server Default value for columns -

when use default value column in sql server management studio table designer, ssms change default , stand parenthesis around of (in editions , versions of sql server). example if set 0 default value, default changed (0) . don't know why sql server use parenthesis, , there practical reason. thanks in advance. there types of objects, such default s , check constraints sql server doesn't store original, textual form of - in contrast with, say, stored procedures, can (absent encryption) retrieve in exact form gave server - complete white space, formatting, comments, etc. because sql server doesn't store textual form, has re-generate textual forms show users when ask such objects. when , chooses insert parentheses can bit of mystery (it's not documented) since don't change meaning of expression, shouldn't concern.

How to use combination keys using IN instruction assembly protected mode? -

i'm using code input keyboard can't figure way combination keys "shift + a" = a keypressed: in al,60h test al,80h jnz keypressed , al,7fh mov bx,table dec al xlat cmp al,0 je key call put_char key: in al,60h test al,80h jz key jmp keypressed table db 0x01,"1234567890-=",0x0e,0x0f,'qwertyuiop[]',0x1c,0,"asdfghjkl;'",0,0,0,"zxcvbnm,./",0,0,0," ",0 note - putchar procedure made prints in al. you'll have track shift key-down , key-up events , apply shift state other key events required. or, use bios instead automatically work you.

How can change orientaiton of camera as orientation get changed of device in iPhone/ios/ipad? -

i have tabbar root controller. when choose camera view controller opens in portrait mode, , change orientation still in portrait mode , when pickerview dismissed , again change main view controller landscape mpde 5 tabbar items shown on left side. looks tabbar items icons disturbed. can 1 change camera orientation when phone orientaiton gets changed? if (self.pickerview) { self.pickerview = nil; } self.pickerview = [[uiimagepickercontroller alloc] init]; self.pickerview.delegate = self; self.pickerview.sourcetype = uiimagepickercontrollersourcetypecamera; self.pickerview.showscameracontrols = yes; self.pickerview.wantsfullscreenlayout = yes; self.pickerview.navigationbarhidden = yes; self.pickerview.toolbarhidden = false; self.pickerview.allowsediting=yes; [self presentviewcontroller:self.pickerview animated:yes completion:null];

ios - Delete Provisioning profile from Titanium Studio -

i have more 10 provisioning profiles in titanium studio. whenever add single device in developer apple account have generate new provisioning profile , download on mac. , choose new profile 'titanium'-> 'run'-'run configuration'-> 'titanium ios devices' , have drop down of profiles. how can delete old profiles here there no way sort these profiles date have memorize profiles before downloading new profile , comparison find out newly add select build. in advance. well don't think can using titanium studio ,but there other options. delete provisioning profile xcode 5 how remove old provisioning profile in xcode 5? removing provisioning profile xcode https://developer.apple.com/library/ios/documentation/ides/conceptual/appdistributionguide/maintainingprofiles/maintainingprofiles.html then go in titanium studio "run configurations" -> "titanium ios device" -> "manage settings" (below sdk v

Improve javaFx processing performance -

i'm working on image processing javafx. think code not enouth efficient (with hd images, refresh slow). because for on each pixel of image everytime have refresh it. don't know how differently. so need improve performance of processing. this code : import javafx.application.application; import javafx.beans.invalidationlistener; import javafx.beans.observable; import javafx.beans.property.doubleproperty; import javafx.scene.scene; import javafx.scene.control.scrollpane; import javafx.scene.control.slider; import javafx.scene.image.image; import javafx.scene.image.imageview; import javafx.scene.image.pixelreader; import javafx.scene.image.pixelwriter; import javafx.scene.image.writableimage; import javafx.scene.layout.anchorpane; import javafx.scene.paint.color; import javafx.stage.stage; public class example extends application { private image src; private writableimage dest; private int width; private int height; int value = 0; @override public

string - Variable Substitution in Python -

so i'm working web.py , have following code: check = db.select('querycode', where='id=$id', vars=locals())[0] which works fine, substitutes $id variable. in line not work: web.sendmail('mail@mail.mail', "tomail@tomail.tomail", 'subject', 'hello $name') what wrong , how work. did concept right: $-sign substitutes variable? python not in general php-style variable interpolation. what seeing in first statement special feature of db.select picks variable values out of local variables in context of caller. if want substitute in variable in second line, have manually 1 of ways python provides. here 1 such way. web.sendmail('mail@mail.mail', "tomail@tomail.tomail", 'subject', 'hello %s' % name) here way. web.sendmail('mail@mail.mail', "tomail@tomail.tomail", 'subject', 'hello {0}'.format(name)) the first option documented in string formatt

c# - Cast object to float -

protected void gridview1_rowdeleting(object sender, gridviewdeleteeventargs e) { var fp18var = (float) (int)e.values[0]; } i'm getting invalidcastexception - specified cast not valid why doesn't work? the value of e.values[0] is: 6 666,00 the problem you're running here c# cast operator means different things in different situations. take example gave: object num = 10; float fnum = (float)num; the c# compiler think telling this: "the variable num refers boxed float; please unbox , return boxed value." you're getting error because it's not boxed float, it's boxed int. the problem c# uses identical-looking syntax 2 totally unrelated operations: 'unbox' , 'numeric conversion'. here's example of cast means numeric conversion: int num = 10; float fnum = (float)num; almost same code, , yet won't give error. , that's because c# compiler treats differently - code means: "please perfor

Is it possible to use the truncate tag in django templates without getting the ...? -

if value = "manbearpig" , in templates called {{value|truncate:6}} displayed value along lines of manbe... . how can same result without ... in end? you can use slice filter . works same regular slicing built python. {{ value|slice:":6" }}

r - dplyr: How to use select and filter inside functions; (...) not working for arguments -

i'm trying build functions creating standard tables questionnaire, using dplyr data manipulation. question helpful group_by function, passing arguments (in case, name of variable want use make table) (...) , seems break down when trying pass same arguments other dplyr commands, 'select' , 'filter'. error message '...' used in incorrect context' . does have ideas on this? thank you for sake of completeness (and other hints - i'm new writing functions), here code use: mytable <- function(x, ...) { df <- x %>% group_by(var1, ...) %>% filter(!is.na(...) & ... != '') %>% # remove missing values: not working! summarise(value = n()) %>% group_by(var1) %>% mutate(tot = sum(value)) %>% group_by(var1, ...) %>% summarise(num = sum(value), total = sum(tot), proportion = num/total*100) %>% select(var1, ..., proportion) # select desired columns: not working! tab <- dcast

ruby each_line comparison only returns last string -

code: class comparer words = "asdf-asdf-e-e-a-dsf-bvc-onetwothreefourfive-bob-john" foundwords = [] file.foreach('words.txt') |line| substr = "#{line}" if words.include? substr puts "found " + substr foundwords << substr end end wordlist = foundwords.join("\n").to_s puts "words found: " + wordlist end words.txt: one blah-blah-blah 123-5342-123123 onetwo onetwothree onetwothreefour i'd code return instances of include?, when code run, wordlist contains last line of words.txt ("onetwothreefour".) why don't other lines in words.txt factored? because other lines expect found, have "hidden" newline character @ end. can see yourself. file.foreach('words.txt') |line| puts line.inspect # or p line end you can rid of newlines using chomp! method on line . file.foreach('words.txt') |line| line.ch

android actionbar - How to Disable touch on Action bar -

i want disable touch event on action bar. suggest me how it. note:i dont want remove action bar, needs there, should not touchable. i have tried in activity: actionbar ab = ((myactivity != null)? myactivity.getactionbar() : null); if(ab ! = null) { view v= ab.getcustomview(); } if (v != null) { v.setclickable(false); v.setfocusable(false); } but did not work. please sugges something. in advance.. i managed fix making invisible view on entire activity. , punched hole through portion if touched coud dispatch event main activity behind invisible view activity, getowneractivity().dispatchtouchevent(event);

c++ - Creating vector<thread> -

i trying create std::vector of threads , run them. code: thread t1(calc, 95648, "t1"); thread t2(calc, 54787, "t2"); thread t3(calc, 42018, "t3"); thread t4(calc, 75895, "t4"); thread t5(calc, 81548, "t5"); vector<thread> threads { t1, t2, t3, t4, t5 }; error: "function std::thread::thread(const std::thread &)" (declared @ line 70 of "c:\program files (x86)\microsoft visual studio 12.0\vc\include\thread") cannot referenced -- deleted function thread(const thread&) = delete; what seems problem? since threads aren't copyable, movable, recommend following approach: std::vector<std::thread> threads; threads.emplace_back(calc, 95648, "t1"); threads.emplace_back(calc, 54787, "t2"); threads.emplace_back(calc, 42018, "t3"); threads.emplace_back(calc, 75895, "t4"); threads.emplace_back(calc, 81548, "t5");

java - Play-Framework - Disable public folder modification reload -

how possible disable reload of play-framework server when saving js (or else css, json etc.) file? because i'm using extjs play-framework , development idle every reload of play-framework when modification in ext application , want see result in browser. tanks contribution. you can use externalassets example get /ext-assets/*file controllers.externalassets.at(path="/home/user/myplayapp/external", file) note: externalassets working in dev mode, in prod mode receive notfound response

php - Fetch column with large data from SQL server -

i fetching column mssql table, data-type of ntext. when column null or has less data, script working properly, large data, truncates, without error or exception. i using odbc_fetch_array, data result-set. have tried various solutions, none of them working. $sql = "select top 40 v.vendorid, v.userid, v.companyname, v.contactname, v.email, v.address1, v.address2 ,v.city, v.zip, v.countryid, v.stateorregionid, v.phone, v.fax, v.website, convert(nvarchar(max),v.profile) profile,v.listorder,v.logo, v.logothumb, v.photos custom_vendor v order v.listorder "; $rs = odbc_exec($conn, $sql); if (!$rs) {exit(json_encode(array("error"=>"error in sql")));} while( $row = odbc_fetch_array($rs) ) { ... } thanks

java - How to use constructor in enum? -

i want use enum create singleton class in java. should this: public enum mysingleton implements myinterface { instance; private final myobject mystring; private mysingleton(myobject mystring) { this.mystring= mystring; } } looks cannot use parameters in constructor. there workaround this? in advance yor enum wrong. below correct declaration: public class hello { public enum myenum { one("one value"), two("two value"); //here elements of enum. private string value; private myenum(string value) { this.value = value; system.out.println(this.value); } public string getvalue() { return value; } } public static void main(string[] args) { myenum e = myenum.one; } } output: one value 2 value conctructor invoked each element of enum.

Android listview smothScrollBy with speed? -

is there way similar using smoothscrolltoposition control on speed or time takes scroll smoothly? now using below snippet scrool pos int firstvisible = lv.getfirstvisibleposition(); int lastvisible = lv.getlastvisibleposition(); if (firstvisible > pos) lv.smoothscrolltoposition(pos, pos - firstvisible - 2); if (pos > lastvisible) lv.smoothscrolltoposition(pos, pos + lastvisible + 3); from this modified aabove snippet below int childheight = lv.getchildat(firstvisible).getheight(); if (firstvisible > pos) lv.smoothscrollby(childheight*pos, 800); if (pos > lastvisible) lv.smoothscrollby(childheight*pos, 1200); but, nullpointer exceptions @ int childheight = lv.getchildat(firstvisible).getheight(); edit i in need of scrooling automatically childview button press user,say menu button. not facing problem of list scrolling because of doing

javascript - How to bind change event dynamically in jquery -

i doing username availability check. made jquery ajax call, working fine , if username in use want make label , textbox in red color. purpose adding css class in callback function of $post() method. problem have css not applying. think problem in dynamically binding event please can 1 me in this. here jquery script, $(document).on('change', '#uname', function() { var uname = $(this).val();//get string typed user if (uname!=''){ $.post('<%=request.getcontextpath()%>/controller/usernamecheckcontroller',{'uname':uname}, function(data) { $('.status').html(data); var status = $.trim($("#status").text()); if(status=="username in use try another"){ $('#unameblock').addclass('error'); } }); } else{ $('.status').html('');

ipad - Is there pixel perfect collision detection for Sprite Kit (iOS7)? -

i need spawn 8 random sprite objects on ipad sprite game. objects big, , different sizes. should not overlay. if 1 spawn on scene overlays removed (optional removes underlaying one). have been looking pixel perfect collision detection framework or helper class sprite kit. far haven't found tutorial or alike. people use normal collision detection not of since objects big. tested standard approach creates rectangles make sprite area in case bigger. sprite kit template testing project: #import "wbmmyscene.h" static const uint32_t randomobjectcategory = 0x1 << 0; @interface wbmmyscene () <skphysicscontactdelegate> @end @implementation wbmmyscene -(id)initwithsize:(cgsize)size { if (self = [super initwithsize:size]) { /* setup scene here */ self.backgroundcolor = [skcolor colorwithred:0.15 green:0.15 blue:0.3 alpha:1.0]; self.physicsworld.gravity = cgvectormake(0, 0); self.physicsworld.contactdelegate = self;

c++ - High cpu load when reading from /dev/ttyACM0 -

i'm trying implement program read data tactile sensors, have problems high cpu load. need reduce cpu load. my setup i'm reading data several (up 16) tacilte sensors. sensors connected via usb pc. in linux these devices create virtual serial ports: /dev/ttyacm0, /dev/ttyacm1, /dev/ttyacm2 ... this dmesg tells me, when plug in sensors (output 1 sensor): [ 321.998462] usb 2-2: usb disconnect, device number 3 [ 327.541414] usb 2-2: new full-speed usb device number 5 using ohci_hcd [ 327.998963] usb 2-2: new usb device found, idvendor=0471, idproduct=0889 [ 327.998983] usb 2-2: new usb device strings: mfr=1, product=2, serialnumber=3 [ 327.998997] usb 2-2: product: wts [ 327.999011] usb 2-2: manufacturer: weiss robotics [ 327.999024] usb 2-2: serialnumber: 0001 [ 328.035356] cdc_acm 2-2:1.0: device cannot calls on own. not modem. [ 328.035424] cdc_acm 2-2:1.0: ttyacm0: usb acm device i use termios termios.h open serial de

httpconnection refused on android device when connecting with localhost -

i making app requires connection localhost on pc. working fine emulator when trying out in real device throwing exception: org.apache.http.conn.httphostconnectexception: connection http://192.168.xx.xx:8090 refused, network host unreachable etc etc where 8090 port in apache tomcat running , 192.168.xx.xx pc's ip address. have tried out many things none worked. i'm using usb connection not wifi access localhost device. please help!!!! thanks have looked @ similar questions linked stackoverflow, such cannot access localhost android device or how can access localhost android device? ? this question not have single answer, there can many different problems. not list tried exclude. also, can paste actual error without removing technical details? can omit stack trace. can add line doing connection? as first step, since message says "network host unreachable" should check phone can access computer @ all. try navigating http://192.168.xx.xx:8090 ph

python 3.x - Installing matplotlib for python3 on Ubuntu -

i'm running ubuntu 12.04, , need use matpltlib in python 3.2.3 . installed using sudo apt-get install python-matplotlib but works in python 2.7, seems default version: $ python2 python 2.7.3 (default, feb 27 2014, 20:00:17) [gcc 4.6.3] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import matplotlib >>> but python 3 doesn't work: $ python3 python 3.2.3 (default, feb 27 2014, 21:33:50) [gcc 4.6.3] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import matplotlib traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named matplotlib >>> also, python command seems 'broken': $ python bash: /usr/bin/python: no such file or directory any appreciated!

algorithm - Solving yes-no test -

there test n yes or no questions. can write test , professor tell how many of answers correct. fastest way pass test? i.e. give correct answers questions minimum number of trials. upd solution n+1 trials obvious. on each trial have correct answer single question. 1 bit of information. professor gives number 0 n each time, log 2 (n + 1) bits of information. that's why best solution has o(n / log(n)) complexity. i'm looking solution sub-linear worst time complexity. in article carsten's comment, erdös , rényi show example of how problem can formulated finding smallest number of test sequences can generate unique hash unknown sequence. since example shows sequence 5 digits long solved 4 tests, tried come sub-linear number of tests sequences of length 6 , seven. looking @ erdös , rényi's example , inspired ioannis' mention of "divide , conquer," thought perhaps test sequences kind of divide , subdivide sequence. took few tries working tes

java - Terminate and retrieve solution in ILOG after a certain time limit -

i using ilog cplex java , running integer optimisation problem takes 3 days complete 0.0%. need terminate program after time limit , obtain solution whatever limit left. can let me know how that? thanks in advance. you should run cplex tilim param: cplex.setparam(ilocplex.doubleparam.tilim, your_time_in_seconds)

What is the name of this popup in IntelliJ IDEA? Object tree viewer? -

Image
when debug app , process stops @ breakpoint, can examine details of objects. hover on , small popup appears then can press popup more details object. what name of popup? i trying create shortcut or decrease hover time, don't know name. searching "tree" or "object tree" returned no result in ctrl+shift+a search box. this quick evaluate expression popup. can perform action on variable. search key mapping using term. invoked alt + click on variable name.

c# - How to get file path from OpenFileDialog and FolderBrowserDialog? -

hey there started learning c# few days ago , i'm trying make program copies , pastes files (and replaces if needed) selected directory don't know how directory , file paths openfiledialog , folderbrowserdialog what doing wrong? here's code: namespace filereplacer { public partial class form1 : form { public form1() { initializecomponent(); } private void direc_click(object sender, eventargs e) { string folderpath = ""; folderbrowserdialog directchoosedlg = new folderbrowserdialog(); if (directchoosedlg.showdialog() == dialogresult.ok) { folderpath = directchoosedlg.selectedpath; } } private void choof_click(object sender, eventargs e) { openfiledialog choofdlog = new openfiledialog(); choofdlog.filter = "all files (*.*)|*.*"; choofdlog.filterindex =

Create labels dynamically ASP.NET C# -

i created labels dynamically usgin code label new_lbl = new label(); new_lbl.forecolor = system.drawing.color.red; new_lbl.id = "lab" + i; new_lbl.text = "vous avez atteint le seuil minimal des " + con.datatable.rows[i].itemarray[j - 2].tostring() + " " + con.datatable.rows[i].itemarray[j - 1].tostring(); panel1.controls.add(new_lbl); but them next each other. how can them vertically aligned ??? i appreciate help. you can use below menioend code new_lbl.text = "vous avez atteint le seuil minimal des " + con.datatable.rows[i].itemarray[j - 2].tostring() + " <br/>" + con.datatable.rows[i].itemarray[j - 1].tostring();

html - How to make my blog using multiple languages in Jekyll -

i'm using jekyll blog ruby masteruby . blog written in english , want have blog written in slovak language too. there choice have multiple languages without retyping posts? there many way handle several languages jekyll. you'll have translate every content: posts, menus , dates. this, can read multilingual website jekyll wrote several months ago. 1 way this: once start master liquid, you'll able fit needs. however, don't know mean when "without retyping posts". you'll have translate posts want available in both languages.

itunesconnect - iOS How I can load multiple in-app items -

is there way load multiple items on in-app billing section on itunes connect dashboard (for example .csv file android)? you can use application loader mass import in app purchases: https://itunesconnect.apple.com/docs/usingapplicationloader.pdf read "creating package file" section on page 15: you can create package containing in-app purchase want submit itunes importing details application loader file , adding , editing metadata. when creating package file, sure use application loader template. copy of template, choose file > open app import template in application loader 2.9. application loader creates appfileimporttemplates folder containing appmassimporttemplate.txt template. have original version of template file, sure make copy of template before editing.

Select photo nested form Rails -

i have class house, has_many house_photos. had created bulk of photos ( @mainentrance ), users can select house.photo , using radio button . this, have nested form form_tag . tried followed post ( using form_for each loop ), it's not working because have nested form. here code: <%= form_tag new_house_path |f| %> <div class="col-md-3 detailsnew"> <div class="field"> <%= text_field :title, :autofocus => true, class: 'form-control' %> </div> </div> <div class="col-md-12"> <h3> main entrance </h3> <%= fields_for :house_photos, @houses.house_photos |house_photo| %> <!-- nested form--> <%= house_photo.hidden_field :title, :value => "main entrance" %><br /> <!-- title house_photo --> <% @mainentrance.each |photo| %> <!-- render image users can select --> <a class="fancybox-thumb" rel=

crm - Show all the fields when customizing a layout in SugarCRM 7 -

Image
i have created person module in sugarcrm7, no additional fields. i cannot see module's field, if exist. instance don't see first name field, when try create 1 error saying field exists. those fields shown in field list. happening? the default fields first_name , last_name special person-type modules. automatically concatenated system third field called name you've noticed on other modules (everything has name ). i believe in sugar7, name field (or in person-style module's case, first_name , last_name ) displayed above topmost panel, above "business card" section. there may way of overriding this, may end modifying views pretty heavily. if you, , determined open both name fields, i'd start view metadata and/or vardefs , see if there's flag on first_name field says "studio" or "display" or "default" -- in past flags have told system whether or not should available or show default. sugar7 views

linking an image on page from an array in php -

why isnt working? <?php $computers = array(); $computers[101] = array( "name" => "phantom nxzt", "img" => "img/phantom.jpg", "cpu" => "intel i7 4770k quadcore", "gpu" => "gtx 780 3gb gddr5", "ram" => "16gb corsair 1800mhz", "hdd" => "seagate 2tb hard drive", "ssd" => "sandisk 120gb solid state", "price" => 1200 ); ?> <img src="<?php echo $computers["img"];?>"> its coming broken img link, want display image url image src. dont understand why not working please help? because of [101] :) <img src="<?php echo $computers[101]['img'];?

c++ - Libserial read serial port -

i using libserial library interact modem using c++. c++ code sends @ command: my_serial_stream << "at+csq" << '\r' ; the modem responds response, either error or ok , the c++ code read response: while( serial_port.rdbuf()->in_avail() > 0 ) { char next_byte; serial_port.get(next_byte); std::cerr << std::hex << (int)next_byte << " "; } std::cerr << std::endl; i handle response such if response ok , modem sends command , if response error , modem resends first command.

php - Where should I initialize session library in CodeIgniter? -

first off, i've checked if there similar question , there appears not be. please let me know if i'm re-asking answered question. thanks. i'm new codeigniter , not know initialize session library $this->load->library('session'); . should make controler session in this example? or should put in 1 of existing controlers ? thus far 2 main controlers called pages , user . here part of code each. user: <?php if ( ! defined('basepath')) exit('no direct script access allowed'); //login / inscription handler class user extends ci_controller{ public function __construct(){ parent::__construct(); $this->load->database(); $this->load->library('layout'); //$this->load->library('session'); logically load library $this->layout->set_title('user'); } public function add(){ $this->load->model('/user/add');

c# - BackgroundWorker and CPU usage issues? -

i want iterate through files in computer , save filenames text file. in order avoid ui blocking, i'm using inside background worker. code below works fine. however, cpu usage high. sometime it's above 60% private void filelistmanagementworker_dowork(object sender, doworkeventargs e) { driveinfo[] alldrives = driveinfo.getdrives(); list<string> directorylist = new list<string>(); foreach (driveinfo d in alldrives) { if (d.isready) { applyallfiles(d.name, processfile); } } // iterate on personal folders foreach (environment.specialfolder s in enum.getvalues(typeof(environment.specialfolder))) { string pth = environment.getfolderpath(s); applyallfiles(pth, processfile); } } private void applyallfiles(string folder, action<string> fileaction) { try { foreach (string file in directory.getfiles(folder)) { fileaction(file);

CSS3 box shadows and Bootstrap 3 -

i developing site using bootstrap 3 , seems work except when try use css3 box shadows. what want achieve have box shadows on left , right of whole content div. works fine. want box shadow on of content items such divs in sidebar if have box shadows on main content container, doesn't work others. if remove box shadow class on main content container, rest work. if remove div <div class="box outer"> , other box shadows work if in, don't show. any on identifying why can't use both box shadows @ once appreciated update: got demo on bootply http://www.bootply.com/ulx2katkt8 of looks like, added width .outer given width of 1000px , can see both shadows visible looks .outer shadow overwrites others here template <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <!-- set viewport responsive site displays correctly on mobile devices --> <meta name="viewport"

performance - Console application running from ssh(cygwin) works 10 times slower -

i have windows computer ssh server set up. when run application on computer desktop, takes 30 seconds execute. when run same application ssh session runs 300 seconds. it's not connection speed problem, since have lan connection computer. not x11 issue, since application console. application disk input(about 100 megabytes), cpu processing involved, , in end processing results saved sqlite database (about 50 mb). doesn't print console messages while it's working. feel it's related resource allocation sshd process, because it's running scheduler task. , i've noticed application uses less cpu when it's running in ssh session. can cause slow down? found answer here: is there way win2k8 scheduled task have normal priority io? scheduler task priority. after setting task priority 4. application works @ same speed if running desktop

sql - Remove seconds from datetime -

i have query below: select lower(convert(varchar(10), getdate(), 101) + ' '+ substring(convert(varchar(20), getdate(), 22),9,len(getdate()))) in query getting result as: 06/27/2014 6:23:57 pm i want remove seconds (i.e. 57) above. my intentded result is: 06/27/2014 6:23 pm how can obtain it?? i tried adding length in query as: select lower(convert(varchar(10), getdate(), 101) + ' '+ substring(convert(varchar(20), getdate(), 22),9,len(getdate())+1)) but didnt help. plase me. try below select cast(datepart(dd,getdate()) varchar)+'/' +cast(datepart(mm,getdate()) varchar) +'/'+cast(datepart(yyyy,getdate()) varchar) +' '+cast(datepart(hh,getdate()) varchar) +':'+cast(datepart(mi,getdate()) varchar) also @ custom date/time formatting in sql server

Copy lines by rows in awk -

i have input file contains, per row, value , 2 weights. i generate 2 output files - value in first column repeated once per line, according weights. best explained short example. if input file is: file.in: 35 2 0 37 2 3 38 0 4 then generate 2 output files: file.out1: 35 35 37 37 file.out2: 37 37 37 38 38 38 38 i use these output files calculate average , median of first column according weights in second , third column. i hope question clear. thank help. this pretty easy in awk . awk '{for(i=0;i<$2;i++) print $1;}' file.in > file.out1 generates first file, and awk '{for(i=0;i<$3;i++) print $1;}' file.in > file.out2 generates second it not clear question whether know how compute mean , median these files - seems wanted create these output files. let me know if rest giving trouble, or whether above scripts not clear (i think pretty self-explanatory).

Open form action in another html page iframe -

i'm trying open form action url in iframe witch in html page. opened in iframe witch on same page code: <form class="form" action="myconnexionurl" target="iframe-myaccount" method="post"> <input type="text" id="login" name="login" placeholder="id"> <input type="password" id="pass" name="pass" placeholder="psw"> <input type="submit" value="connexion"> </form> <iframe src="" name="iframe-myaccount"></frame> so, question simple: how can open form action url in iframe in html page? as far know, there no way access iframe directly. think you'll have pass data parent , have adjust url embedded iframe. i'd through server-side scripting, may able through javascript.

regex - Redirect a asp page to php page using htaccess -

i have rebuild website using php. old website made else build in asp. have lot pages need redirecting new pages. know need every individual page i'm not sure how this. have example: http://www.mysite.co.uk/productdetails/617/6/casio%20cdp120%20digital%20piano%20in%20black/ needs redirecting to http://www.mysite.co.uk/casio-cdp120-digital-piano-in-black/302 any welcome you can use rule: rewriterule "^productdetails/617/6/casio cdp120 digital piano in black/?$" /casio-cdp120-digital-piano-in-black/302 [l,nc,r=301]

bash - Looking to convert a Simple SVN tool to Git -

so purpose of tool pull static file use in each release track sox information. here code used use: firstofyear=`date +%y-01-01` today=`date +%y-%m-%d` startdate=${firstofyear} enddate=${today} # change these app (as appears in svn) , code file names app=fooapp code=fa # clean last run rm ${code}_*.txt rm tt${code}_*.txt #setup header last="0.0" echo "${code} releases ${startdate} - ${enddate}" >> tt${code}_release_list.txt release in `svn log -v --revision {${startdate}}:{${enddate}} http://svn.mynet.com/repos/${app}/tags |grep "a /tags" | sed 's/.*gs\/\([0-9|.]*\).*/\1/g'` if [ ${last} != ${release} ]; svn export http://svn.mynet.com/repos/${app}/tags/"$release"/docs/release_notes.txt ${code}_"$release"_release_notes.txt cat ${code}_"$release"_release_notes.txt | ./../gensummary.pl >> ${code}_summary.txt cat ${code}_"$release"_release_notes.txt | ./../ge

java - String to Date conversion is losing time -

does know why date losing time values when converting string ? cannot seem figure 1 out. here type of simpledateformat using: simpledateformat simpledateformat = new simpledateformat("eee mm/dd/yyyy hh:mm a"); the date trying convert string in form : string datestring = "mon 06/23/2014 03:00 pm"; and when following: date convertdatefromstring = null; try{ convertdatefromstring = simpledateformat.parse(datestring); }catch(parseexception ex){ ex.printstacktrace(); } system.out.println(convertdatefromstring.gettime()); my output is: 1403496000000 and expected output is: 1403550000000 can me understand why time not being parsed? update - solved --->> of jon skeet now using simpledateformat simpledateformat simpledateformat = new simpledateformat("eee mm/dd/yyyy hh:mm a", locale.getdefault()); and output correct. you've specified hh in format, 24-hour format. you've

windows - Best way to share a common CSS and Scripts between web applications? -

using: dreamweaver cs6, coldfusion 10, cfbuilder 3 (soon) i'm developing 3 seperate web projects using same set of resources each project: same css reset , initialisation styles e.g grid layouts same jquery initialisation files at moment each web project has copy of same files in web root. i'd have place sites link these common shared resources. can think of 2 ways this, both similar: decide on 'master' site , place css , js files in site only. make new site called 'shared or common' , put common stuff in there. new site still has reside on domain. still need choose 'master' project. both above points difficult because there no 'master' site. none of sites linked in way each other. say i've decided on master site then link files using qualified url. means when in development environment won't able see these files , use kind of ide introspection see whats in files when make changes (e.g. intellisense detects whats in