Posts

Showing posts from July, 2014

html - Center input field in bootstrap -

this code show input left of div <div class="col-sm-8 col-md-7" style="min-width: 270px;"> <input type="text" name="address" class="form-control" value="<?php echo$data["address"]; ?>"> </div> i intent center , align div , show same. sorry english. much. regards if understand correctly want, following should center input field: <div class="col-sm-8 col-md-7" style="min-width: 270px;"> <input type="text" name="address" class="form-control" value="<?php echo$data["address"]; ?>" style="margin: auto;"> </div> by default though, bootstrap's .form-control fields set 100% width won't notice difference. add width: 50% example , see appear in center. updated answer: it looks need center container div rather input field. can use col-md-offset-* that: <div clas...

ios - Is it ok to use UIPasteboard in a background thread? -

is uipasteboard thread safe ? i trying this dispatch_async(dispatch_get_global_queue(0, 0), ^{ uipasteboard *generalpasteboard = [uipasteboard generalpasteboard]; nsdata *settingsdata = [generalpasteboard dataforpasteboardtype:@"sometype"]; if (settingsdata == nil) { uipasteboard *pasteboard = [uipasteboard pasteboardwithname:@"somename" create:yes]; settingsdata = [pasteboard dataforpasteboardtype:@"sometype"]; } // settingsdata }); is safe or should use uipasteboard on main thread ? i'm using on background thread on ios 9 , 10 no issues. pasteboard accesses global, shared system resources, assume thread safe, though in uikit framework. there no documentation me up, own experience. example code, using category created mbprogresshud: typedef void (^imageblock)(uiimage* image); #define dispatch_async_global(code) dispatch_async(dispatch_get_global_queue(0, 0), ^{ code }); #define dispatch...

android - how to make activity output string to be another activity input string -

i created 2 activity first 1 toast string after function , second activity must take string first activity making input in textview this first activity package com.example.project; import android.app.activity; import android.content.intent; import android.graphics.color; import android.os.bundle; import android.view.view; import android.widget.toast; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.googlemap.onmapclicklistener; import com.google.android.gms.maps.googlemap.onmaplongclicklistener; import com.google.android.gms.maps.googlemap.onmarkerclicklistener; import com.google.android.gms.maps.mapfragment; import com.google.android.gms.maps.model.bitmapdescriptorfactory; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.marker; import com.google.android.gms.maps.model.markeroptions; import com.google.android.gms.maps.model.polyline; import com.google.android.gms.maps.model.polylineoptions; import ja...

Android Studio 1.3 Preview NDK support -

yesterday google announced native code debugging possible version of android studio. https://plus.google.com/+androiddevelopers/posts/2gk6yrzkv4x i've updated newest build version "ai-141.1962279" , can't see possibility of debugging native code. i've switched build-tools 23.0-rc1, used gradle plugin 1.3.0-beta1 cannot set breakpoints in native code or step jni calls. is working? july 10th update android studio preview ndk support available : https://sites.google.com/a/android.com/tools/tech-docs/android-ndk-preview android studio 1.3.0-preview indeed available through android studio "check updates" menu. unfortunately, c++ features aren't available yet in preview. available in 2 weeks. source : google io dev tools keynote @ 35:38

php - Google chart showing blank using JSON -

i've been trying google charts working data on local db. think have got json coming out now. { "cols": [ { "id": "", "label": "inits", "pattern": "", "type": "string" }, { "id": "", "label": "salesval", "pattern": "", "type": "number" } ], "rows": [ { "c": [ { "v": "is", "f": null }, { "v": "1708.6000", "f": null } ] }, { "c": [ { "v": ...

curl won't download empty file -

curl -o foo.txt http://test.barrycarter.info/emptyfile.txt curl -o http://test.barrycarter.info/emptyfile.txt i tried both above, , neither foo.txt nor emptyfile.txt created. how can make curl create them? knowing file (url) exists , empty can useful. in particular, i'm trying mirror geonames daily updates, , happens today's " http://download.geonames.org/export/dump/alternatenamesdeletes-2015-05-28.txt " file empty. useful know instead of not downloading it. (note: created emptyfile above testing, since geonames' file disappear within day) curl didn't use store on 0 byte downloads, since version 7.42.0 .

javascript - Marimekko chart cell titles not updating -

i'm making visualization titanic data set https://www.kaggle.com/c/titanic/data , , after search found marimekko chart best visualization data set. i looked @ http://www.jasondavies.com/mekko/ , began tweak code bit fit needs. problem cell titles (those appear after mouse - hover @ cell) not update values. first call function chart draws titles correctly, when try change cell values using transition function, charts animates values in cell titles not change, still have old values when hover @ them. the last line in transition function is: cellenter.append("title") .text(function(d) { return d.children ? null : title(d); }); which seems work first time chart drawn, doesn't update titles when cell data changes. any ideas how fix ? if you're curious see changes made, have @ working example http://codepen.io/hshihab/pen/pqwjmo i made couple of small changes jason's original code show point. as @lars kotthoff pointed out in ...

C++ operator overloading return pointer -

i'm new programming in c++ , wondering something: whenever see operator overloading in c++ it's done this: #ifndef stone_h #define stone_h class stone { private: int weight; public: ....... stone operator+(const stone& s) { stone stone; stone.weight = this->weight + s.weight; return stone; } ....... } #endif but when "+" operator called, creates object "stone", , returns copy of this. can't performance when dealing huge objects? wouldn't better use dynamic memory in example below: stone * operator+(const stone& s) { stone * stone = new stone; stone->weight = this->weight + s.weight; return stone; } or seeing wrong? thanks in advance trying reason things out not particularly accurate way of estimating performance: need write program measure whether or not 1 implementation better another. there number of ways in no copy happen @ all; nam...

How to add php in WordPress Menu -

i'd add php code links of wordpress menu. use dashboard > appearance > menus to make menu. if add php code there, doesn't work. i need menu links like: <a href="http://mcadrives.com/?ref=<?php code goes here?>"> if want querystring present on every menu item have based through custom walker, should add code? the php coding have been using on every hyperlink , image this: <a href="http://mcadrives.com/?ref= <?php if (!empty ( $_server['query_string'])){ echo substr($_server['query_string'],4); } else{ echo 'mhammonds'; } ?>> i know add functions.php file , call walker in wp_nav_menu, , how add coding? class query_nav extends walker_nav_menu { function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $cla...

javascript - protractor debug mode gives "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory" -

i'm running script automate login web page using nodejs 0.12.4, protractor 2.1.0., system win 8.1, i7 2.5 ghz, 16 gb ram, think it's unlikely ran out of memory!. fyi, when comment statements in code browser.get(), , execute them 1 one in interactive mode using browser.pause() @ beginning, code works. code spec.js file: describe('web page login', function() { it('should login', function() { browser.get('http://url_here'); // opens page //browser.pause(); element(by.css('[ng-click="showlogin(true);"]')).click();// clicks login link open login dialog var user = element(by.model('user.login.username'));// input user name user.sendkeys('user'); var pass = element(by.model('user.login.password')); // input password pass.sendkeys('pass'); element(by.css('[ng-click="login();...

javascript - Is it possible to use HttpRequest to upload files contained in a <div> tag -

would possible upload files (contained in ) client end server end using asp file uploader control. example div looks like: * <input type='file'/> <div parent> <div child>file 1</div> <div child>file 2</div> <div child>file 3</div> </div> * , files have been uploaded through asp file uploader control. when post html page request.files contains current page understandable. what can upload these files/images when post page. not allowed use ajax control, fyi. using bootstrap , jquery use feature on mobile devices. there feature available in bootstrap similar these can take advantage of. or suggestion appreciated. thank you html5 allows upload multiple files.

math - javascript equation resulting in -0 -

this question has answer here: is floating point math broken? 20 answers i have javascript equation: var sbal=pfweight-gweight-adjm; $("#result").html(sbal.tofixed(5)); if result 0, assign result css color green. if not 0, assign result css color red. my problem math comes out -0 , displays red. i tried if(sbal===0){sbal=parseint(0);} sbal===0 returns true. how can work around this? jsfiddle i know are +0 , -0 same? addresses why -0 = +0 not supply , answer on how fix problem. if issue returns -0, can calculate absolute value of return value math.abs(-0); // 0 edit: javascript has strange rounding of floating point numbers: if roundup result works fine, don't need math.abs(-0). pointed out -0 , 0 should same value. this worked me: var sbal = math.ceil(pfweight - gweight - adjm);

Using two different templates for search results - Haystack -

i totally confused how can use 2 different template files search results. suppose have 2 different pages searching , want have different decorations each page search results. this search bar in 1 page: <div class="main-header_search"> <form method="get" action="/search1" id="header_find_form" class="main-search yform" role="search" data-component-bound="true"> <div class="arrange arrange--middle arrange--6"> <div class="arrange_unit" style="width: 100%;"> <div class="main-search_suggestions-field search-field-container find-decorator"> <label class="main-search_pseudo-input pseudo-input"> <span class="pseudo-input_text">find</span...

php - im trying to remove the double post image -

when go to: http://dageniusmarketer.com/ you see posts have 2 images. im trying remove 1 on bottom. i initally added <?php the_post_thumbnail( $size, $attr ); ?> for main post image, wasn't getting placement wanted, above post statistics. have above statistics, still have original image, , want remove it. im trying play class .wp-image , but isn't giving me sort of luck. want remove 2nd duplicate image underneath statistics, , keep whatever other images may wish write post body in future. how do this? edit: here php code: <?php get_header(); ?> <div id="main"> <div id="content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <!-- item --> <div class="item entry" id="post-<?php the_id(); ?>"> <div class="itemhead"> <h1><a href="<?php the_permalink() ?>" rel="bookmark...

javascript - Add another condition to Show/Hide Divs -

i have follow script on form. jquery(document).ready(function($) { $('#bizloctype').on('change',function() { $('#packages div').show().not(".package-" + this.value).hide(); }); }); </script> basically, depending on value of select box #bizloctype (value="1","2","3" or "4") corresponding div shows , rest hidden (div class="package-1","package-2","package-3", or "package-4"). works perfectly. but, need add additional condition. need text box #annualsales condition determining div shows (if value less 35000 should show package-1 only, , no other packages. i think below script works fine when independent of other script need find out how marry them. <script> $("#annualsales").change(function(){ $(".package-1,.package-2,.package-3,.package-4").hide(); var myvalue = $(this).val(); if(myval...

go - Golang, cors and angularjs - header missing -

i'm using rs/cors in go api allow angularjs app make direct requests. i've added following code configure cors: crs := cors.new(cors.options{allowcredentials: true}) n.use(crs) //negroni include but i'm getting no 'access-control-allow-origin' header present on requested resource message in browser when make request. my request looks this: var req = { method: 'post', url: endpoint + version + method, headers: { 'authorization': 'basic ' + btoa(':' + appid) }, data: params } $http(req). success(function(data, status, headers, config) { callback(null, data); }). error(function(data, status, headers, config) { callback(data); }); how can round this? fixed it! noticed few different headers being sent request , had explicitly allow of them. allowedheaders: []string{"accept", "authorization", "content-type"} i hope helps s...

Django one to many field dont render duplicates -

lets suppose have model: | name | email | level john x 1 martin y 2 jorge c 1 level 1 many field, , when render levels , render 1 , 2 , 1 again, there way not render duplicate ones, in template ? need coding in template , not views. idea ? your object should have property named level. should able iterate object's/entity's level property because list. can iterate level collection the django template. hope helps.

javascript - Internet explorer re-sizing elements as page is updated -

my problem internet explorer issue. have element, block, css: md-card{ min-width: 80%; background-color: #fff; } and element full of data elements consisting of icon , text. each 1 either file or folder, , clicking folder navigates folder's contents. these elements using data binding , dynamically updated when click folder (so removes current contents , replaces data opened folders new contents) , reason causes problem in ie the md-card element despite having min-width set 80% sometimes squash down inch big on screen when folder opened. happens instant, , resizes, , sticks. resizing page cause resize intentded width. i thinking weird interaction between angularjs , ie i'm wondering if issue has encountered or , ideas on why happening. edit: on further inspection seems involve min-width: 80% attribute. changing min-width: 600px eliminates problem. the problem internet explorer bugging figured out solution please add line md-card c...

angularjs - $scope.$on is undefined in unit test -

i'm unit testing initialization part of controller , can't seem on $scope.$on undefined error. know how write unit test in case or how test $scope.$on(). have failed find official angular documentation testing this. var sidebarcontroller = function ($rootscope, $scope, $window, $location, personservice, searchservice) { $scope.navname = 'filters' $scope.currentfilter = null; $scope.filterresult = null; $scope.showfilters = true; $rootscope.subtabs = null; $scope.$on('userdataloaded', function () { //doing stuff here }); //... more stuff here } sidebarcontroller.$inject = ['$rootscope', '$scope', '$window', '$location', 'personservice', 'searchservice']; and test is: beforeeach(inject(function (_$controller_, _$rootscope_, _$window_, _$location_, _$httpbackend_, _personservice_, _searchservice_) { $controller = _$controller_; scope = _$rootscope_.$new()...

Php mysql login form $row not working -

i created login form php or mysql has problem. when log in , press submit there see blank site. form handling page: <?php define('db_host', 'localhost'); define('db_name', 'loginform'); define('db_user','user'); define('db_password','pass'); $con=mysql_connect(db_host,db_user,db_password) or die("failed connect mysql: " . mysql_error()); $db=mysql_select_db(db_name,$con) or die("failed connect mysql: " . mysql_error()); /* $id = $_post['user']; $password = $_post['pass']; */ function signin() { session_start(); //starting session user profile page if(!empty($_post['user'])) //checking 'user' name index.html, empty or have text { $query = mysql_query("select * username username = ".$_post['user']." , pass = ".$_post['pass'].") or die(mysql_error()); $row = mysql_fetch_array($query) or die(my...

python - Images into a template in Django 1.8 -

im using python 3.4, , django 1.8 im trying display image in django template! im using next code: in settings: static_url = '/static/' staticfiles_dir = (r'c:\users\cesaralfonso\desktop\docbook\cuenta\static') in template: {% load staticfiles %} <img src="{% static "cuenta/celeste.jpg" %}" alt="my image"/> but doesn't work! image celeste.jpg saved in static files specified direction! help! your staticfiles_dir should this: staticfiles_dir = ('c:/users/cesaralfonso/desktop/docbook/cuenta/static',) note slashes switched \ / , r' removed , added comma @ end. r'text' means raw string: such strings called raw strings , use different rules interpreting backslash escape sequences and comma @ end makes tuple. update: note these paths should use unix-style forward slashes, on windows (e.g. "c:/users/user/mysite/extra_static_content"). from django docs

Unity3D VSCode debugging on Windows -

it seems unity3d vscode debugging works on osx? debugging in unity (c#) + visual studio code work on os x? but not on windows yet because no mono support windows? https://code.visualstudio.com/docs/faq has found way unity3d vscode debugging working on windows? thanks. currently .net debugging based on mono - available linux , mac os x. result debugging on windows it's better use visual studio community. sean mcbreen vs code team member

c# - MVC Linq query with both group by columns and Max table column -

i'm trying create query gets me unique records of 4 columns plus id column same table. var newtsonly = newexport.groupby(g => new { g.trainingattended, g.traininglocation, g.trainer, g.dateoftrainingsession }).tolist(); the above gets me unique records want can't find way "newexports" "id" field. my aim create record in different table each unique record require id field other things afterwards. i've tested in sql query , found work adding max(id) select value still trying work in linq. select [trainingattended],[trainlocation],[trainer],[dateoftrain], max([id]) id [trainingexport].[dbo].[masterregisterexport] group [trainingattended],[trainlocation],[trainer],[dateoftrain] i can't seem find linq equivalent if can give me pointer thanks? if trying id understood should add new id value: var newtsonly = newexport.groupby(g => new { g.trainingattended, g.traininglocation, g.trainer, g.dateoftrainingsession, g.id }).tolis...

swing - Java - JSplitPane size of weight listener -

i have problem value of resizing weight of jsplitpane mouse. here code : splitpane.setresizeweight(0.1); splitpane.addpropertychangelistener(jsplitpane.divider_location_property, new propertychangelistener() { public void propertychange(propertychangeevent pce) { system.out.println (splitpane.getresizeweight()); } }); but it's printed 0.1 . and have try using jsplitpane.resize_weight_property splitpane.addpropertychangelistener(jsplitpane.resize_weight_property, new propertychangelistener() { public void propertychange(propertychangeevent pce) { system.out.println (splitpane.getresizeweight()); } }); but doesn't not print anything. but it's printed 0.1. yes, because set value 0.1. property tells split pane how allocate space 2 components when size of split pane changes. when drag divided mouse changing divider location. not affecting resize proper...

java - NullPointerException when making Volley-okhttp request -

i'm trying use google volley okhttp. following tutorial http://www.androidhive.info/2014/05/android-working-with-volley-library-1/ set up. set volley singleton , lrubitmapcache. used string request, everytime make request nullpointerexception. 7717-8280/com.admin.zipline e/androidruntime﹕ fatal exception: pool-9-thread-1 process: com.admin.zipline, pid: 7717 java.lang.nullpointerexception @ com.admin.zipline.activities.accountverification.gettransactionsdetails(accountverification.java:295) @ com.admin.zipline.activities.accountverification_.access$701(accountverification_.java:25) @ com.admin.zipline.activities.accountverification_$8.execute(accountverification_.java:203) @ org.androidannotations.api.backgroundexecutor$task.run(backgroundexecutor.java:302) @ java.util.concurrent.executors$runnableadapter.call(executors.java:422) @ java.util.concurrent.futuretask.run(futuretask.java:237) @ java.util.concurrent.scheduled...

java - Initialize Arraylist in method -

this question has answer here: is java “pass-by-reference” or “pass-by-value”? 73 answers following question. have big amount of arraylist attributes (basically same kreuzlagerort20kg etc). instead of initializing them in constructor (the part commented out) i'd love initialize them inside filllager() method, making possible call method inside constructor , have them initialized , filled then. if in code, nullpointerexception. is possible and/or sensible initialize arraylist inside method, without getting said nullpointer? import java.util.arraylist; public class lager { private arraylist<screws> kreuzlagerort20kg,kreuzlagerort50kg; public lager(){ //kreuzlagerort20kg = new arraylist<screws>(); //kreuzlagerort50kg = new arraylist<screws>(); filllager(1,kreuzlagerort20kg,20); filllager(1...

javascript - Including HTML page within HTML Page using jQuery -

i including html page, named test.html in webpage. below: <head> <meta charset="utf-8"> <title>load demo</title> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <b>content want include here: </b> <div id="success"></div> <script> $( "#success" ).load( "test.html", function( response, status, xhr ) { if ( status == "error" ) { var msg = "sorry there error: "; $( "#success" ).html( msg + xhr.status + " " + xhr.statustext ); } }); </script> </body> </html> i error reading: sorry there error: 0 networkerror: failed execute 'send' on 'xmlhttprequest': failed load 'file://machd/.../html/test.html'. what error mean? , how best solve it? you can make use of angular js including html file read docs here https...

javascript - HTML to grab new data on refresh -

i have html page javascript reads json file , renders data on screen based on json file. need refresh page periodically (every 10 seconds) captures changes json file. doing following : <meta http-equiv="refresh" content="2" /> i tried doing following code within java script: <script type="text/javascript"> settimeout("location.reload(true);",2000); both versions work , refresh page periodically. however, whenever refresh happens, not read new data json file. reads data when manually refresh page using "refresh" button. there way can force read new data when refreshes? if ok using jquery create second page html, , set url var page hitting. if hit new page should refresh data every 10 seconds. <div id="div1"> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> $(document).ready(function() { var url ...

java - Apache POI set Excel chart title -

i'm creating excel workbook scratch. 1 of sheets contains chart, , want set chart title. apache poi has setcharttitle method on hssfchart, neither xssfchart nor format-agnostic chart have methods set chart title. since need create .xlsx files problem me. after poking around in poi code , ooxml specifications managed come code setting title on newly created chart: if (chart instanceof xssfchart) { xssfchart xchart = (xssfchart) chart; ctchart ctchart = xchart.getctchart(); cttitle title = ctchart.addnewtitle(); cttx tx = title.addnewtx(); cttextbody rich = tx.addnewrich(); rich.addnewbodypr(); // body properties must exist, can empty cttextparagraph para = rich.addnewp(); ctregulartextrun r = para.addnewr(); r.sett("my chart title"); } this seems work - can load resulting file in excel 2013 , chart there correct title. is there easier way this? gotchas need out when changing char...

android - bug: Splash and Icon generator not working (Ionic and Cordova) -

type: bug platform: mobile webview i tried use ionic splash , icon generator blog/website tutorial. not read png files, though placed them in root. converted them ai files , return error saying files not read (although open in preview , in adobe illustrator). then used cordova generator instructions , got error: { [error: command failed: convert: unable open image platforms/ios/splash/resources/icons/icon-72@2x.png': no such file or directory @ error/blob.c/openblob/2675. convert: writeblob failedplatforms/ios/splash/resources/icons/icon-72@2x.png' @ error/png.c/magickpngerrorhandler/1630. ] timedout: false, killed: false, code: 1, signal: null } if you're using 1 of latest version of ionic-cli things should work properly. npm update -g ionic to update cli . once have created project have add platform: ionic platform add android ionic platform add ios in root of project should find folder called resources . place icon file , splash...

javascript - Correct Way to Dynamically Add Semantic UI Controls? -

i'm trying wrap head around semantic ui , understand how controlled class give dom element, can't work when adding new dom elements dynamically. seems semantic ui javascript getting run on first page load , not on new elements when add them. currently, done via: $("#target").html("<new elements here>") is there correct way this? cannot find documentation on semantic ui site. update: give better example... say have layout: <div class="right menu" id="rightmenu"> <div class="ui dropdown link item"> courses <i class="dropdown icon"></i> <div class="menu"> <a class="item">petting</a> <a class="item">feeding</a> <a class="item">mind reading</a> </div> </div> <a class="item">library</a> <a class=...

EasyMock : static method and 'missing behavior definition for the preceding method call'? -

i have following core class messagesutil, returns message string specific bundle based on locale - getmessage() methods static public class messagesutil { .. public static string getmessage(httpservletrequest request, string key, string bundle) { messageresources resources = (messageresources)request.getattribute(bundle); string message = resources.getmessage((locale)request.getsession().getattribute("org.apache.struts.action.locale"), key); return message; } } i'm trying write unit test coverage business class calls messageutils object. same test code below shows how i'm mocking request , session, return messageresources , specific message keys import com.infonova.easymock.annotation.mock; import org.apache.struts.util.messageresources; import org.junit.assert; import org.junit.test; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpsession; import java.util.locale; import static org.easymock.easy...

python 3.x - PyQt: QDataWidgetMapper doesn't show any data in widgets -

i have abstractitemmodel want map widgets. in constructor of window have: print("creating model") self.model = model(self.cluster) print("creating mapper") self.mapper = qtgui.qdatawidgetmapper() print("setting model") self.mapper.setmodel(self.model) print("setting root index") self.mapper.setrootindex(self.model.root_index()) print("setting index") self.mapper.setcurrentindex(0) print("mapping widgets") self.mapper.addmapping(self.realnamelineedit, 1) self.mapper.addmapping(self.emaillineedit, 2) self.mapper.addmapping(self.infoplaintextedit, 3) print("done") this results in following output: creating model model.__init__() model.rowcount(<pyside.qtcore.qmodelindex(0,0,0x7faa2ff446a0,model(0x17c6f50) ) @ 0x7faa2d9ea4c8>) = 0 model.rowcount(<pyside.qtcore.qmodelindex(0,0,0x7faa2ff446a0,model(0x17c6f50) ) @ 0x7faa2d9d2888>) = 1 crea...

javascript - Navigation bar idea -

i wanted create navigation bar this, " artist news hh blog contact " hh being title of page. want navigation alongside heading. attempted isn't right , untidy. <div id="heading"> <header> <section class="main-nav index-nav"> <nav> <ul> <li><a href="artists.html">artists</a></li> <li><a href="#">news</a></li> <h1>hh</h1> <li><a href="about.html">about</a></li> <li><a href="contact.html">contact</a></li> </ul> </nav> </section> <!--section--> </header> </div> heres code i not use h1 @ all. use <li id=hs>hh </li> in css use...

javascript - Hide/Show div based on datePicker & current date -

i'd change text of div based on date in date picker following scenarios if datepicker date today, want msg1, elseif datepicker date tomorrow , current time >= 3pm, want msg2, elseif datepicker date tomorrow, want msg3, elseif datepicker date +2days of current date, want msg4, else, no msg. datepicker field... <input type="text" name="ordertime" class="" id="ordertime" value="" autocomplete="off" /><br><br> <script type="text/javascript"> jquery("#ordertime").datepicker({ changemonth: true, changeyear: false, dateformat: 'dd/mm/yy', firstday: 1, duration: 'fast', maxdate: '+2m', mindate: '-0d', numberofmonths: 1 }); </script> use onselect option of datepicker script <script type=...

java - cross-platform apps with c#Is -

this question isn't asking whether is't possible (because i've checked that) way it's frowned upon. my background in programming c , c# , i've been more interested in app development since announcement of windows 10. have been interested in android development don't have time dwell java. know c# can used write applications windows , android sticking wit c# seems more compelling. looking @ new visual studio rc, notice saying you'll able run native android apps using c#. however, of forum it's apparent people don't idea of using language other java so. there such performance drop when many android devices have quad-core soc's 2-3gb ram? i'm intrigued in using c# cross-platform development windows platform interesting me more. as should state, i'm aware of xamarin cross-platform development. question on performance difference , mute enthusiasm many android devs when suggesting so. c# , java pretty close langues why convers...

vector - swapping user defined consecutive values in R -

given vector, wanted swap values when particular elements consecutive. x <- c("a", "b", "c") i want make rule, if "b" comes before "c", swap values. x <- c("a", "b", "c") res [1] "a" "c" "b" if "t" comes before "u", y <- c("t", "u", "x", "a", "u") res2 [1] "u" "t" "x" "a" "u" more broadly multiple matches also. here if "d" directly before "b", z <- c("a", "d", "b", "x", "d", "b") res3 [1] "a" "b" "d" "x" "b" "d" a function isn't elegant, should work swap<-function(x, pair) { stopifnot(length(pair)==2) a1 <- which(x==pair[1]) a2 <- which(x==pair[2]) if (l...

javascript - Missing values when serializing form -

i'm trying serialize form via jquery("#feedback-form").serialize(); it returns "z_name=&z_requester=&z_description=" no matter in input-fields , textarea. <form id="feedback-form" method="post" name="former"> <div id="box-form"> <p><input type="text" placeholder="name" name="z_name"></p> <p><input type="text" placeholder="e-mail" name="z_requester"></p> <p><textarea cols="40" rows="10" placeholder="message" name="z_description"></textarea></p> <p><input type="submit" value="abschicken" id="submitter"></p> </div> </form> maybe want change <p><input type="submit" value="abschicken" id="submitter...

Print a Google Charts [map module] with no data / pinpoint -

i use google charts print map pinpoints. happens have no data show up, want print maps, no data / no pinpoints. if use: google.load('visualization', '1.0', {'packages':['corechart', 'map']}); google.setonloadcallback(drawchart); function drawchart() { var data = google.visualization.arraytodatatable([[]]); var options = { zoomlevel: 2, showtip: true, streetviewcontrol: false } var map = new google.visualization.map(document.getelementbyid('map_container')); map.draw(data, options); } it returns error: the columns type not match supported data format. see documentation supported formats. if set var data = google.visualization.arraytodatatable([['lat', 'long'], [null, null]]); it draws gray box error: no data points show on map how can draw map using google charts no pinpoint?

javascript - Creating a filterable list with RxJS -

Image
i'm trying reactive programming. use array-functions map, filter , reduce time , love can array manipulation without creating state. as exercise, i'm trying create filterable list rxjs without introducing state variables. in end should work similar this: i know how accomplish naive javascript or angularjs/reactjs i'm trying nothing rxjs , without creating state variables: var list = [ 'john', 'marie', 'max', 'eduard', 'collin' ]; rx.observable.fromevent(document.queryselector('#filter'), 'keyup') .map(function(e) { return e.target.value; }); // need search value in here somehow: rx.observable.from(list).filter(function() {}); now how search value filter function on observable created list? thanks lot help! you'll need wrap from(list) need restart list observable again every time filter changed. since happen lot, you'll want prevent filtering when filter short, or if th...