Posts

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 ...