Posts

Showing posts from April, 2012

performance while doing string concatenation - algorithm string strings c# -

i using following code append strings string res = string.empty; int ite = 100000; for(int i= 0; < ite; i++) { res += "5"; } it taking lot of time, later changed code string res = string.empty; int ite = 100000; res = getstr(ite / 2) + getstr(ite - (ite / 2)); //body of getstr method private static string getstr(int p) { if (p == 1) return "5"; else if (p == 0) return string.empty; string r1 = getstr(p / 2); //recursive string r2 = getstr(p - (p / 2)); //recursive return (r1 + r2); } which in opinion nothing number of times strings concatenated approximately same in previous approach. but using approach there significant improvement in performance code taking around 2500 ms (on machine) taking 10 ms. i ran profiler on cpu time , couldn't arrive @ understanding why there improvement in performance. can please explain this. note: intentionally not using stringbuilder, in order understand above.

Batch file syntax for multiple criteria? -

is possible have if statement check 2 criteria? or have 2 if statements? i want "if user name 'owen' or 'oiverson' goto this..." no! there many different ways work around. try this: set username=owen set found=no if [%username%]==[owen] set found=yes if [%username%]==[oiverson] set found=yes if %found%==yes goto :yes goto :no :yes @echo found user :no

android - $_FILES array empty via Java upload -

i'm trying upload file via android php $_files array comes empty: array() . i'm using httpurlconnection. i've substituted ip address of server , client , other personal information "<>". i verified file being uploaded (wireshark dump): no. time source destination protocol length info 16 2.493417 <ip_addr> <ip_addr> http 877 post /test.php http/1.1 frame 16: 877 bytes on wire (7016 bits), 877 bytes captured (7016 bits) ethernet ii, src: cisco_5a:0b:41 (<mac_address>), dst: <mac_address> (<mac_address>) internet protocol version 4, src: <ip_addr> (<ip_addr>), dst: <ip_addr> (<ip_addr>) transmission control protocol, src port: 52506 (52506), dst port: http (80), seq: 1958, ack: 461, len: 811 [3 reassembled tcp segments (2485 bytes): #13(306), #14(1368), #16(811)] hypertext transfer protocol post /test.php http/1.1\r\n

javascript - jquery function not calling on button click -

below code, want alert "hi" , "hello" can put actual codes there. <html> <head> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> if (typeof jquery == 'undefined') { document.write(unescape("%3cscript src='jquery-1.11.1.min.js' type='text/javascript'%3e%3c/script%3e")); } </script> <script src="jquery-ui.js"></script> <link rel="stylesheet" href="jquery-ui.css"> </head> <script> $(document).ready(function(){ alert("hi"); $('form[name="lgform"]').submit(function(evnt){ evnt.preventdefault(); }); $("#btn_login").click(function(){ alert("hello"); }); }); </script> <body> <form name="lgform

html - Use jquery to crop a list and hide and show random list elements with a set maxium? -

i have <ul> on 6 <li> elements. want show 6 @ time. trick need randomly select elements hide, , stagger hide/show. for example current markup : <ul> <li>1<li> <li>2<li> <li>3<li> <li>4<li> <li>5<li> <li>6<li> <li>7<li> <li>8<li> <li>9<li> </ul> is possible use jquery hide/show elements provide random this: <ul> <li style="display:none">1<li> <li>2<li> <li style="display:none">3<li> <li>4<li> <li>5<li> <li>6<li> <li>7<li> <li style="display:none">8<li> <li>9<li> </ul> you should try things before posting questions here, include code have tried show have tried. however, simple, i'll answer question. expanding on this answer question generatin

javascript - calling addEventListener without a DOM element -

i see salesforce lightning code calling addeventlistener without dom element , couldn't figure out doing. 1) why there not dom element before addeventlistener ? 2) purpose of '({' , '})' here ? ({ doinit: function(component, event, helper) { //listen iframe's message addeventlistener("message", function(event) { if(event.data.type === 'ready' && component.find("vfiframe")) {//iframe loaded component.iframeready = true; } else if(event.data.type === 'response') {//send response var cmpevt = component.getevent("response"); cmpevt.setparams({ "data" : event.data.response}); cmpevt.fire(); } }, false); }, makerequest : function(component, event, helper) { helper.makerequest(component, event); } })

linux - Python: Cannot import name/IndexError: List index out of range -

i'm still pretty new python, , didn't write of code, i'm trying work. have following 2 .py files: this 1 called fnsim.py- import numpy,sys, os import math def intfn(kvars,params): # not change name of function sinth = kvars['y']/(numpy.sqrt(kvars['y']**2+(1000.)**2)) = 4*((numpy.sin((numpy.pi*.7*sinth)/.0006)/((.7*sinth)/.0006))**2)*numpy.cos((numpy.pi*1.2*sinth)/.0006)**2 if not math.isnan(i): return else: print 'hello' return 0.0 ''' sinth = kvars['y']/(numpy.sqrt(kvars['y']**2+(params['r0'])**2)) a1 = numpy.complex(params['a1r'],params['a1i'])*numpy.e**(((-numpy.pi*params['p']*sinth)/.0006)*1j) a2 = numpy.complex(params['a2r'],params['a2i'])*numpy.e**(((numpy.pi*params['p']*sinth)/.0006)*1j) return (a1+a2)*numpy.conjugate(a1+a2) ''' def simfn(): """ function actual simulating. fill out filepaths below. "&q

php - Why does SQL Server select query truncate varchar string? -

setup i using several memory tables cache data website. local web host on mac , dev server on linux using mssql php library on php 5.5 a simplified table looks like: cacheid int not null cachedata varchar(max) i insert several large values. 10,000+ characters. insert works fine. simple query tells me data in field: select cacheid, len(cachedata) caches problem however, when select data cache column truncated 8192 characters causing problems. simple select: select cachedata caches cacheid = 10 i checked varchar(max) character limit. , beyond 8192. 2^32 - 1 the question why data being truncated? the question in form. ran agian , forgot solution. took me bit remember forgot root cause. here searched thinking sql server culprit. what sql servers varchar(max) maximum length? - if values being truncated caused php non sql server. if want know max is, question answered here: maximum size of varchar(max) variable disclosure answering own questio

Working with javascript in a view in ruby on rails -

alright guys, ruby noobie here, , find myself in unfortunate situation moving project on django ruby on rails. first things first, setting application.html.erb file, , cannot seem javascript working. images , css coming through, not javascript. there javascript files within assets directory , within application.html.erb file. neither coming through. all of images, css, , javascripts located within respective directories in app/assets/. my application.html.erb file head tag: <!doctype html> <html> <head> <!--[if lt ie 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <title>the atmosphere</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="shortcut icon" type="image/x-icon" href="/assets/atmosphere_favicon.png"> <link rel="stylesheet" type="text/css" hre

javascript - how to highlight markers on click in mapbox -

i'm doing mapbox project, have list of projects on right side of screen. each time click on list of project name, map zoom location of project. i imported markers mapbox , used mapid show them on map. now want highlight marker each project click on. mapbox highlight examples based on geojson or csv, imported markers mapbox editor. can show me how highlight? the code same: see l.mapbox.featurelayer documentation: instead of using setgeojson or loadurl examples do, initialize l.mapbox.featurelayer('mapid') , replacing 'mapid' mapid.

caching - React Native - Fetch call cached -

i building app in react native makes fetch calls rely on date information server. have noticed seems cache response , if run fetch call again returns cached response rather new information server. my function follows: gotoall() { asyncstorage.getitem('fbid') .then((value) => { api.loadcurrentuser(value) .then((res) => { api.loadcontent(res['registereduser']['id']) .then((res2) => { console.log(res2); this.props.navigator.push({ component: contentlist, title: 'all', passprops: { content: res2, user: res['registereduser']['id'] } }) }); }); }) .catch((error) => {console.log(error);}) .done(); } and function api.js im calling follows: loadcontent(userid){ let url = `http://####.com/api/loadcontent?user_id=${userid}`; return fetch(url).then

javascript - Adding "literal HTML" to an HTML widget with data from a datasource? -

when creating html widget in freeboard, following text displayed: can literal html, or javascript outputs html. i know can following return html data, if want more complex i'd prefer use literal html return html data return "<div style='color: red'>this red timestamp: " + datasources["ds"]["timestamp"] + "</div>" literal html no data <div style='color: red'> red text. </div> <div style='color: blue'> blue text. </div> both of work. question is, how can insert data datasource literal html example? for more context, here @ top of editor: this javascript re-evaluated time datasource referenced here updated, , value return displayed in widget. can assume javascript wrapped in function of form function(datasources) datasources collection of javascript objects (keyed name) corresponding current data in datasource. and here default text: // example:

java - Javadrone - Unable to get image from Parrot AR.Drone 2.0 -

i working on app control parrot ar.drone 2.0 using javadrone api , library. i able connect drone , make take off/land successfully. there 2 java files : dronetestvideo.java , videopanel.java . the dronetestvideo.java file responsible connecting drone , data, while videopanel.java file serves set images. javadrone api can download here . however, have no idea why i'failing live images drone. show me black screen words: "no video connection" here code: dronetestvideo.java package dronetest; import com.codeminders.ardrone.ardrone; import com.codeminders.ardrone.ardrone.videochannel; import com.codeminders.ardrone.dronestatuschangelistener; import com.codeminders.ardrone.navdata; import com.codeminders.ardrone.navdatalistener; import java.io.ioexception; import java.net.unknownhostexception; import java.util.logging.level; import java.util.logging.logger; public class dronetestvideo extends javax.swing.jframe implements dronestatuschangelistener

python - Add to Values in An Array in a CSV File -

i imported csv file , made data array. wondering, can i'm able print specific value in array? instance if wanted value in 2nd row, 2nd column. how go adding 2 values together? thanks. import csv import numpy np f = open("test.csv") csv_f = csv.reader(f) row in csv_f: print(np.array(row)) f.close() there no need use csv module. this code reads csv file , prints value of cell in second row , second column. assuming fields separated commas. with open("test.csv") fo: table = [row.split(",") row in fo.read().replace("\r", "").split("\n")] print table[1][1]

uitableview - Reloading parse data after dismissing modal view controller -

i stuck on trying figure how reload objects parse after dismiss modal view. typically can call [self loadobjects] dont know how call after model view dismissed. modal view used post data parse, want data loaded in tableview once modal view dismissed. thanks in advance. if want reload after modal dismissed, recommend moving using dismissviewcontrolleranimated:completion dismiss modal , calling [self loadobjects] inside completion block

android - Google Play Films: Transparent play image -

where can find transparent play button image in play films' store on trailer? please check out link image. google play films' store image this image seems simple can draw using inkscape , save .svg file. after you're done can export semi-transparent .png in desired resolution can imported android project.

php - how to filter object with foreach -

i delete informations in object key. is possible likes that: foreach ( $object $key => $value ) { if ( $key == "abc" ) { unset( $object{ $key } ); } } when try have: cannot use object of type stdclass array thx foreach ($object $key => $value) { if ($key === "abc") { unset($object->key); } } although seeing know key (based on "if") this: unset($object->abc);

Could not autowire field is Spring MVC + Hibernate -

Image
i've started trying head around spring mvc framework yesterday, , have encountered problem. error: error creating bean name 'usercontroller': injection of autowired dependencies failed; not autowire field: com.springapp.mvc.service.userservice com.springapp.mvc.controller.usercontroller.userservice; nested exception java.lang.noclassdeffounderror: [lorg/hibernate/engine/filterdefinition; i've checked other solutions , of them have people providing incorrect contexts. i've provided base context, , not .controller directory. intellij auto-generated me mvc-dispatcher-servlet.xml , assume application context. mean need create servlet context? project structure: i've ommited imports little more conciseness. mvc-dispacher-servlet.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"

css - how to force user to scroll to view content in html -

sorry new html , css i making website in html , css , want user scroll down view content below. there logo , tagline on screen. if try add image shows below logo, don't want that. there way force user scroll view content further? thanks , once again, sorry. edit: here code: <!doctype html> <html> <head> <title>msn</title> <meta charset="utf-8" /> <link type="text/css" rel="stylesheet" href="styles.css" /> </head> <body class="body" style="overflow-y:hidden"> <center> <div class="main"><br><br><br><br><br><br><br> <img class="logo" src="logo.png"> <div class="tiles"> <button class="t1"></button> <button class="t2"></button> <button class="t3"></button> <button class="t4"><

php - Argument 1 passed to __construct must be an instance of Services\ProductManager, none given -

in service.yml test_product.controller: class: mybundle\controller\test\productcontroller arguments: ["@product_manager.service"] in controller class productcontroller extends controller { /** * @var productmanager */ private $productmanager; public function __construct(productmanager $productmanager){ $this->productmanager = $productmanager; } } in routing.yml test_product_addnew: path: /test/product/addnew defaults: { _controller:test_product.controller:addnewaction } i want use productmanger in contructor stuff gives me error catchable fatal error: argument 1 passed mybundle\controller\test\productcontroller::__construct() must instance of mybundle\services\productmanager, instance of symfony\bundle\twigbundle\debug\timedtwigengine given, called in ..../app/cache/dev/appdevdebugprojectcontainer.php on line 1202 , defined i new symfony, appreciated you have inverted l

java - Android: align_left aligns to the center -

i have fragment contains google map: <com.google.android.gms.maps.mapview android:id="@+id/mapview" android:layout_width="match_parent" android:layout_height="match_parent" map:camerazoom="13" map:maptype="normal" map:uizoomcontrols="false" map:uirotategestures="true" map:uiscrollgestures="true" map:uizoomgestures="true" map:uitiltgestures="false" /> the map takes entire screen , has mylocation enabled: map.setmylocationenabled(true); the following code should align mylocation button top-left of screen: // mylocation button view view locationbutton = ((view) mapview.findviewbyid(integer.parseint("1")).getparent()).findviewbyid(integer.parseint("2")); relativelayout.layoutparams rlp = (relativelayout.layoutparams) locationbutton.getlayoutparams(); rlp.addrul

SSRS URL acces pass DDMMYY dateformat -

how can pass date/time parameter report via url. have access ddmmyy format of date. know should tell ssrs language use the rs:parameterlanguage=de-de but dont know language ddmmyy is. http://<>/reportserver/pages/reportviewer.aspx?/<>/<>/report&para1=801&para2=1000011&date=070415&rs:parameterlanguage=??? oké, guess not possible, added hidden text parameter report convert custom vbscript. , let query decide use date parameter.

javascript - JQuery dataTable remove id and class result row need to search in values -

i using datatable , search below code $(document).ready(function () { var usertable = $('#result').datatable({ "aasorting": [], "binfo": true, "osearch": {"ssearch": ""}, "bautowidth": false, "blengthchange": false, "bpaginate": false, "scrollx": true, "aocolumns": [ null, null, null, null, null, ] }); $('#user-search').keyup(usertable, function(){ console.log($(this).val()); }); usertable.fnfilter($(this).val()); $(".datatables_filter").hide(); }); but search gives result id , class example if search 28, gives result id=28 or if search "green" gives row class=green. in order remove id, class, commented code etc ? i didn't understand question, if want exclude table c

Changing azure webjob occurence -

i published azure webjob , working fine, want change scheduled time minutes. can't find option change onto minutes in portal. is there way change this? you can set schedule via visual studio. open project in visual studio. in solution explorer, expand project properties, delete webjob-publish-settings.json , confirm when prompted. (you'll re-create shortly) right-click project in solution explorer, publish azure webjob select "run on schedule" in "webjob run mode" list. set recurrence, start date/time , (optionally) end date/time , recurrence pattern. click ok. (this should re-create .json settings file new config info) click publish in dialog box publish webjob new schedule. source: azure 70-532 study guide

Can't add an iOS certificate to CodenameOne -

Image
being on windows, have generated ios certificate app following these steps: https://www.youtube.com/watch?v=mpzsxaw0qui it generates file called ios-development.cer when try browse , find file add "certificate" in debug section in relevant netbeans window (see pic below), file not displayed in file finder (because wizzard expects file different extension guess). moreover, never had add password in certificate generation process, don't password asked me @ password field? any appreciated. the ideal way use wizard http://www.codenameone.com/blog/ios-certificate-wizard.html the certificate needs converted p12 file using mac. bit of rough process described here: http://www.codenameone.com/how-do-i---create-an-ios-provisioning-profile.html and here: http://codenameone.com/signing.html then pitfalls here: http://www.codenameone.com/blog/ios-code-signing-fail-checklist.html encryption requires 2 keys: public , private , cer file contains 1 of

json - Create a schema to check a column isn't null -

if have json table-like structure looks this: { "table": { "rows": [ [ 0, null, 1, 2, null ], [ null, 1, 2, 3, null ], [ 1, 2, 3, null, null ], [ null, null, 1, 2, 1 ] ] } i can validate schema (note, i'm using draft 3 because that's library validating schema using, draft 4 might possible if go find different library): { "$schema": "http://json-schema.org/draft-03/schema#", "title": "table data", "description": "a table @ least 1 row of data 5 columns per row", "type": "object", "properties": { "table" : { "description" : "a table", "type": "object", "properties": { "rows": { "required" : true, "description": "

java - Posting JSON data from txt file to URL -

i need post json data text file url.i have not come across such scenario. i came across posting json data using httpurlconnection. my json data : { "request": { "header": { "signature": "bhnums", "details": { "productcategorycode": "01", "specversion": "04" } }, "transaction": { "primaryaccountnumber": "8961060000402122658", "processingcode": "725400", "transactionamount": "000000000200", "transmissiondatetime": "150505141718", "systemtraceauditnumber": "035689", "localtransactiontime": "141718", "localtransactiondate": "150505", "merchantcategorycode": "0443", "pointofserviceentrymode": "021", "pointofserviceconditioncode":"00", "transactionfeeamount":"000000000200&qu

javascript - AngularJS : $httpBackend mock only some requests -

i use ngmock module mock several requests so: $httpbackend.whenget("/accounts").respond([obj]); however, seems loading module expects mock requests. if other request other mocked, "unexpected request" error. how can configure intercepts requests mock explicitly, , passes else through? you can use regex , passthrough() function built $httpbackend. beforeeach(inject(function($httpbackend){ $httpbackend.whenget("/accounts").respond([obj]); //pass else through $httpbackend.whenget(/^\w+.*/).passthrough(); }));

jQuery slider carousel stop at end -

all right. building custom carousel simple javascript , css3. working okay far. however. when continue clicking next button(when slider @ end), continues without stop function (so become out of focus , messy). i have created small fiddle the code minified down following: function nextslide(){ counter++; var slidewidth = articlewidth*counter; var articles = $('#slider article.boxed').length; //magic css3 $('.carousel>div').css('-webkit-transform', 'translate3d('+-slidewidth+'px, 0px, 0px)'); $('.carousel>div').css('-ms-transform', 'translate3d('+-slidewidth+'px, 0px, 0px)'); $('.carousel>div').css('transform', 'translate3d('+-slidewidth+'px, 0px, 0px)'); } i have tried calculating stop pos in terms of width/number of slides(articles), buggy, guess, , looking fluid work css responsive (shown in fiddle). suggestions? :) hope below

javascript - Flex layout - cell partially collapses in chrome -

so i've got bit of weird issue happening in chrome (latest version on mac). here fiddle replicates it: http://jsfiddle.net/mwznjnoc/1/ you'll see search bar has set height of 40px. however, right side red cell has content makes scroll, squishes search bar. moving search bar outside of div in , under header div fixes issue, cannot fix way (the search bar part of view content, gets rendered in div in). removing height: 100%; html , body stops happening, not fix need viewport height 100%. layout works fine in other browsers i've tested with, have idea why happening or way adjust layout prevent it? time in advance! you forgot flex rule on .search box. because being part of flex , should remove style height:40px .search box. then provide flex-grow , flex-shrink 0 , , flex-basis 40px . you may combine 3 1 flex: 0 0 40px . force layout contain .search box within 40px , let other blocks grow or shrink in available space. changes in html markup : &

javascript - Sending AJAX requests to PHP files on server -

ok set new server (droplet on digitalocean). say url 55.55.555.555 , file file5.php added folder /home/user5 using winscp what url in ajax request like, letter letter? right now, testing on local easyphp server, looks this: request.open( "post" , "file5.php" , true );

Delete session data after 2 min in php -

i'm newbie in php , have question. example have in session array variable call game_url : $_session['game_url'] = $_server['http_referer']; is possible make $_session['game_url'] = ''; after 2 min after has set? appreciated. if (!isset($_session['game_url'])) { $_session['last_activity'] = time(); $_session['game_url'] = $_server['http_referer']; } if (isset($_session['last_activity']) && (time() - $_session['last_activity'] > 120)) { unset($_session['game_url']); unset($_session['last_activity']); }

javascript - Define ng-model by name -

i have complex model, example: model = { "data_level1": { "data_level2": { "data_level3": { "data_level4": "myvalue"... how can avoid writing: <input type="text" ng-model="model.data_level1.data_level2.data_level3.data_level4" /> and write instead like: <input type="text" ng-model="data_level4" /> thanks. do in controller: $scope.submodel = $scope.model.data_level1.data_level2.data_level3; and then: <input type="text" ng-model="submodel.data_level4" /> note: can't set submodel data_level4 because string, setting data_level3 have submodel referencing same object within original model . edit: added pnlkr done @ryanyuyu

java - Apache POI initial calculation of formula after download -

i use apache poi creating excel file. there 2 diffrent sheets. sheet 1 template formulars. in sheet 2 want the value of 1 cell in sheet 1. excel-formula value sheet 1: =if(sheet1!d7="";"";sheet1!d7) but when put text in d7 with cell = worksheet1.getrow(6).getcell(3); cell.setcellvalue("sometext"); it wont take on value sheet 2. if click d7 , use enter, sheet2 take value, want, apache poi this. how can handle this? you have evaluate formula before final output. use in order evaluate formulas. formulaevaluator formulaevaluator = workbook.getcreationhelper().createformulaevaluator(); formulaevaluator.evaluateall(); use in order evaluate formula of specific cell formulaevaluator evaluator = wb.getcreationhelper().createformulaevaluator(); evaluator.evaluateformulacell(cell); and write file in stream

php - Behat can't find PhpExecutableFinder -

i following error when executing behat: php fatal error: class 'symfony\component\process\phpexecutablefinder' not found i don't know if normal, phpexecutablefinder located within composer.phar after php composer.phar update called. { "require": { "php": ">=5.4", "ext-mcrypt": "*", "slim/slim": "~2.0", "slim/views": "0.1.*", "twig/twig": "1.18.*", "propel/propel": "~2.0@dev", "zeflasher/propel2-geocodable-behavior": "dev-master", "behat/behat": "3.0.*@stable", "behat/mink": "1.6.*@stable", "behat/mink-extension": "@stable", "behat/mink-goutte-driver": "@stable", "behat/mink-selenium2-driver": "@stable", &qu

c# - Handler (MIME) for multimedia content not working -

i working handler presents multimedia content in page. the idea handler access file , determine type using extension, , presenting it, problem of times handler gets downloaded , multimedia not presented. here code: fileinfo file = new fileinfo(filepath); byte[] bytes = new byte[file.length]; using (filestream fs = file.openread()) { fs.read(bytes, 0, bytes.length); } string extension = path.getextension(filepath); string mimedeclaration; if (".tif" == extension) mimedeclaration = "tiff"; string[] imagenes = new string[] {".jpg", ".jpeg", ".bmp", ".gif", ".png"}; if (imagenes.any(x => x.contains(extension))) mimedeclaration = extension.substring(1); else mimedeclaration = string.empty; context.response.clearcontent(); context.response.clearheaders(); context.response.contenttype = "image/" + mimedeclaration; context.response.binarywrite(bytes); the filepath variable valid.

javascript - Moment.js and ion rangeSlider: Date not formatted -

i'm using ion slider ( http://ionden.com/a/plugins/ion.rangeslider/en.html ) , moment.js handle dates. problem date not formatted way should on slider. var beginmoment = moment("2015-04-20"); var endmoment = moment("2015-08-20"); console.log("begin"); console.log(beginmoment); $("#chord_range").ionrangeslider({ type: "double", min: +moment(beginmoment).format("x"), max: +moment(endmoment).format("x"), from: +moment(beginmoment).format("x"), to: +moment(endmoment).format("x"), prettify: function (num) { return moment(num, "x").format("dddd, mmm yyyy"); }}); the log give correct format however. suggestions appreciated.

javascript - Calendar follow scroll but it should remain attached to the field -

i have 2 divs scroll separately. http://jsfiddle.net/kv8ggqm7/1/ if open calendar (field date) , scroll, calendar follow scroll should remain attached field. if uncomment line $('#ui-datepicker-div').css('position','fixed'); it seems work if scroll bottom, open calendar , scroll top calendar disappear , if click on data field doesn't appear. the calendar datepicker of jqueryui ( https://jqueryui.com/datepicker/ ) using css #ui-datepicker-div { position : fixed !important; } i don't expected result. any approciated what have define css in css folder this: media screens can usefull in making responsive design. more information @ link: http://www.w3schools.com/cssref/css3_pr_mediaquery.asp @media screen , (min-width: 480px) { #seconddiv{ position: fixed; top: 0px; right: 0px; } } remove jquery part: $(document).ready(function () { $('#calendar').datepicker(); /* remove part */ /* $(win

C# Input string was not in correct format for MySQL DateTime -

i looking through various pieces of information this, , couldn't find after hour of searching, i've been forced ask specifically. in mysql database, have series of tables created_dt column, datetime(6) field. example of data be: 2015-06-19 11:52:07.000000 i can pull column table in database except one, reason. whenever make connection string, , fill datatable adapter, error in title. code: mysqlcommand cmd = new mysqlcommand("select created_dt comptran_bulk", connection); mysqldataadapter da = new mysqldataadapter(cmd mysqlcommand); datatable dt = new datatable(); da.fill(dt); // exception thrown, when data loaded table. this command replaced "select * view_sales" , , solutions cast differently don't think work. also, none of values created_dt null, allow 0 datetime=true didn't work. what suggest? the answer going in old error ticket in 2012. "[1 jun 2012 13:39] dan berger not seem fixed in 6.4.5 - still formatexc

python - plt.figure() with title gives error: invalid literal for int() with base 10 -

i have problem when running following simple example code on python 2.6.5. have looked other solutions invalid literal problems , seems me occurs when python assumes data plotting integers , tries iterate on data. error seems reached before point, when figure object created. may wrong , appreciate pointing me in right direction. import matplotlib.pyplot plt import numpy np x=np.array([1,2,3,4,5,6,7]) y=np.sin(x) fig = plt.figure('test figure') sub1=fig.add_subplot(1,1,1) sub1.plot(x,y) generates following error traceback (most recent call last): file "c:\users\u999999\desktop\code\simple_example.py", line 7, in <module> fig = plt.figure('test figure') file "c:\python\lib\site-packages\matplotlib\pyplot.py", line 241, in figure num = int(num) # crude validation of num argument valueerror: invalid literal int() base 10: 'test figure' added comments i'm using matplotlib version 0.99.3rc1 the functionality tr

php - Foreach cycle return randly changed values -

i have .ini file can't change. looks like: 01code6=77 01name6=g 650 xcountry/xmoto/xchallenge (k15) [v] [77] 01type6=bike 01code7=e3 01name7=i3 od 07/13 (i01) [v] [s] [3d] [ire] [e3] 01type7=car 01code8=e8 01name8=i8 kupé od 03/14 (i12) [v] [3d] [e8] 01type8=car 01code9=80 01name9=k 100 - k 1200 rs / k1 od 04/84 [v] [80] 01type9=bike and code parse looks like: public function pasrsestring($path) { $ini = parse_ini_file($path, false, ini_scanner_raw); foreach(array_chunk($ini, 3, true) $data) { // $data array of 3 related $mcode = substr(array_keys($data)[0], 0, 2); $nameline = array_values($data)[1]; $typeline = array_values($data)[2]; $vehicle = array_values($data)[0]; echo $vehicle; echo "<br>"; echo $typeline; echo "<br>"; echo $nameline; echo &