Posts

Showing posts from April, 2010

javascript - animation pattern not working properly -

i trying animation pattern.all paterns except last 6 working properly. want last 6 pattern happen after other patternshave happened.but using code oscillates in different manner. last6 pattern doesn't happen together. plz me code $j(document).ready(function () { $j("#circle").show().animate({ top: '260px' }, 1000, function () { $j("#v_logo").animate({ opacity: '1' }, 400, function () { $j("#v_logo").animate({ height: '150px', width: '100px', top: '260px', left: '450px' }, 2000, function () { $j("#s_logo").animate({ opacity: '1' }, 400, function () { $j("#s_logo").animate({ height: '150px', width: '100px', top: '260px', left: '4...

php - Woocommerce if bought more than different one product -

in final step of checkout, show button if there 2 or more differente products, trying figure way count if there indeed 2 or more, tried this: if (sizeof(wc()->cart->get_cart()) != 1) { echo '<a class="button emptycart" href="example-link">sample-text</a>'; } obviously no luck. tried doing different cases when knowing product id, when have 5, there 25 if statements accomplish task, like: if ( woocommerce_customer_bought_product( $email, $current_user->id, '5898' )) && ( woocommerce_customer_bought_product( $email, $current_user->id, '5936' )){ echo '<a style="float: right; position: relative;margin-top: -35px;" class="button emptycart" href="sample">buy</a>'; }elseif ( woocommerce_customer_bought_product( $email, $current_user->id, '5935' )) && ( woocommerce_customer_bought_product( $email, $current_user->id, '5937' )){ ech...

string - Haskell take and drop at the same time -

i wondering how can achieve: taking first n characters of string ++ (concatenating them with) drop these first n , take next n , on (without cutting words). have tried function composition , $ thing get, errors. edit i trying align text left given column width (n), that's why try not cut words, if there word @ number n , take chars before , use \n start again next line. main problems far checking cut-words condition(i can use !! should use in guards map(-1) or how else) , implementing recursion because base got take n s ++ "\n" ++ take n (drop n s) and case n smaller longest word: leftalign n str = if n < ((maximum . map length . words) str) "" else leftalign n str data.list.split.chunksof this.

Push value into array of arrays in JavaScript -

i have , array of arrays looks this: var arr = [[1,2,3],[4,5,6],[7,8,9]]; after have list of numbers , loop var list = [15,10,11,14,13,12] (i=0; i<list.length; i++) { var val = list[i]; if (val >= 10 && val < 13) { arr[arr.length].push(val); } else if (val >= 13 && val < 16) { arr[arr.length+1].push(val); } } so have output this: arr = [[1,2,3],[4,5,6],[7,8,9],[10,11,12],[13,14,15]]; with code i'm getting error "cannot read property 'push' of undefined" also important can't use arr[3].push or arr[4].push because case more complicated , need push values new array appear on over of array. no matter how many objects have inside. if looking sort array element code not work. refer below code sort element , solve undefined issue. <script> var arr = [[1,2,3],[4,5,6],[7,8,9]]; var list = [15,10,11,14,13,12]; var arr1=[]; var arr2=[]; (i=0; i<list.length; i++) ...

python - Gettin alpha channel data from an image in Pyglet quickly -

i'm trying array alpha channel value of sprite image, using pyglet library. wrote code works: mask = [] x in range(image.width): mask.append([]) y in range(image.height): mask[x].append(ord(image.get_region(x, y, 1, 1).get_image_data().get_data("rgba", 4)[3])) return mask the problem it's really slow, guess i'm using wrong function retrieve alpha channel. can make faster? update i find solution following code faster: rawimage = image.get_image_data() format = 'rgba' pitch = rawimage.width * len(format) pixels = rawimage.get_data(format, pitch) data = unpack("%ib" % (4 * image.width * image.height), pixels) mask = data[3::4] return mask i don't know pyglet, i'm guessing performance issue related many queries single pixel. instead want entire image gpu in 1 call, including colour , alpha values, , extract alpha. i'd use struct.unpack instead of ord() . note: code untested , purely based on exam...

javascript - AngularJS - Trouble setting default drop down menu option -

i new angularjs. right have following 2 filters applied on e-commerce site: <div ng-show="user.shipmethod != null && shippers && ordershipaddress.addressname != 'big'" " ng-class="{'view-form-select': !currentorder.lineitems[0].shippername, '': currentorder.lineitems[0].shippername }"> <label ng-class="{required: !currentorder.ismultipleship() && user.shipmethod != null}" ng-show="currentorder.lineitems[0].shippername || !currentorder.ismultipleship() && user.shipmethod != null">{{('shipping' | r) + ' method' | xlat}}</label> <select class="form-control" ng-change="updateshipper()" name="shipmethod" ng-model="currentorder.lineitems[0].shippername" ...

Elasticsearch order by type -

i'm searching index multiple types using ' http://es:9200/products/_search?q=sony '. return lot of hits many different types. hits array contains results not in order want to; want 'television' type show before rest. possible @ order type? you can achieve sorting on pre-defined field _type . query below sorts results in ascending order of document types. post <indexname>/_search { "sort": [ { "_type": { "order": "asc" } } ], "query": { <query goes here> } }

apache - Deny access to all content except content from one folder -

i want allow access 1 folder of site in given subdomain, , have subdomain pointing same documentroot full access. want avoid duplicated urls (for seo purposes). in restricted virtualhost have configuration ... <directory /var/www/secundary.mysite.com/web> options -includes +execcgi allowoverride rewriteengine on rewritecond %{query_string} !/bundles.*$ [nc] rewriterule ^.*$ - [f] </directory> so expect navigation mysite.com give forbidden response, www.mysite.com/bundles/js/script.js returns normal response. the result every request secundary.mysite.com returns normal response. missing something, or ...? i have been using wrong variable. wrote %{query_string} instead %{request_uri} variable wanted match again regular expression. correct syntax purpose was: <directory /var/www/secundary.mysite.com/web> options -includes +execcgi allowoverride rewriteengine on rewritecond %{request_uri} !^/bundles(.*)$ [nc] rewriterule ...

How to use Logical AND operation between two sets in agda? -

i wanted proof if there m less 10 , there n less 15 there exist z less 25. thm : ((∃ λ m → (m < 10)) , (∃ λ n → (n < 15))) -> (∃ λ z → (z < 25)) thm = ? how define , here?? please me. , how proof this?? and corresponds product in agda. here is corresponding construct in standard library. in case, may want use the non-dependent version _×_ .

kill process/ end process of bluestacks -

i'm trying make program open , close bluestacks application. close means totally exiting application. since if exit bluestacks app process restart. processes i'm trying kill is: "hd-blockdevice.exe" "hd-agent.exe" "hd-logrotatorservice.exe" "hd-updaterservice.exe" when manually kill first process, other process close except 2~3 ones. it's kinda pain kill 4 processes every time close application creating one. here code public class form1 dim p() process private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load timer_processcheck.start() end sub private sub timer_processcheck_tick(byval sender system.object, byval e system.eventargs) handles timer_processcheck.tick p = process.getprocessesbyname("hd-blockdevice.exe") if p.count > 0 ' process running 'button_close.enabled = true else ' process not running ...

postgresql - Django migration having no effect, on postgres table -

when laying out tables ever reason used positiveintegerfield price. i've changed decimalfield makes more sense. the migration worked locally (sqlite) , appears have succeeded on dev server. however, migration had no effect on postgres dev server. here's output migration command. djanog_settings_module=runner.dev_settings ./manage.py migrate operations perform: apply migrations: userprofiles, sessions, admin, sites, auth, contenttypes, inventory running migrations: applying inventory.0004_auto_20150613_1446... ok after migration here's schema in pgsql. table "public.inventory_baseitem" column | type | modifiers -----------------+------------------------+----------------------------------------------------------------- id | integer | not null default nextval('inventory_baseitem_id_seq'::regclas...

Can I edit the source code of a wordpress plugin? -

i'm new wordpress (just opened test site few hours ago). part of proof of concept i'm conducting, i've been looking plugins. able find plugin 95% of need accomplish. my question - can edit source code? if that's matters, i'm talking plugin i'm buying. i'll appreciate answers. thanks, nadav

android - Column not found in SQLite databse -

i reated column name called _id, when run , view database in listview using getallrows() method, shows error saying (no such column: _id (code 1): , while compiling: select distinct _id, eventtitle, date, destination, durationtime, alarmtime event.) . below code , error message. please me , teach happen code. public class dbhandler{ private static final string tag = "dbhandler"; //field names public static final string column_id = "_id"; public static final string column_eventtitle = "eventtitle"; public static final string column_date = "date"; public static final string column_destination = "destination"; public static final string column_duration = "durationtime"; public static final string column_alarmtime = "alarmtime"; public static final string[] all_keys = new string[]{column_id, column_eventtitle, column_date, column_destination, column_duration,column_alarmtime}; //column number each field name...

php - WordPress Text Editor Buttons not showing -

so, have here custom post type in wordpress , working except when tried add new item , switch visual editor text editor , found out there no buttons available. in text editor have these buttons "b", "i", "link", "ins", "img", "ul" , etc.. it's kind of weird, since pages , posts had buttons. below code tried add custom post type function. add_action( 'init', '___regposttype' ) ; function ___regposttype() { $labels = array( 'name' => _x('custom post type', 'post type general name'), 'singular_name' => _x('test post', 'post type singular name'), 'add_new' => _x('add new item', 'test item'), 'add_new_item' => __('add new item'), 'edit_item' => __('edit item'), 'new_item' => __('new item'), 'view_item' => __('view item page...

(C# Selenium) How to wait until an element is present? -

i new selenium, started using yesterday , pretty done first part of project , love way going. altho having 1 problem, using thread.sleep pauses until elements present. there animations going on or slow loading @ times, how can make wait until element present , interact it? for example: loginpageelements loginpage = new loginpageelements(); loginpage.continuelink.click(); thread.sleep(5000); //here has wait until next page loads clickdailybonuspopup(); driver.driver.navigate().gotourl(.....); thread.sleep(2000); //here has wait until login form pops loginformelements loginform = new loginformelements(); loginform.userpasswordlogin.click(); thread.sleep(2000); //here has wait until different login form pops you need use webdriverwait class. here solution problem.

wordpress - WP_UnitTestCase - how to configure the include_path correctly with phpunit PHAR -

i'm trying write php unit test wordpress plugin , have been following writing-wordpress-plugin-unit-tests tutorial. i've cloned ' core.trac.wordpress.org/browser/tests/trunk/includes ' locally i have installed phpunit via phar mechanism described here : https://phpunit.de/manual/current/en/installation.html#installation.requirements . have composer.json configuration [14:11:04@~]$ phpunit --version phpunit 4.7.3 sebastian bergmann , contributors. in /etc/php.ini file have include_path="." when run phpunit error [14:18:07@bhaawp]$ phpunit php fatal error: require_once(): failed opening required 'phpunit/autoload.php' (include_path='.') in /users/pauloconnell/projects/bhaawp/wp-phpunit/bootstrap.php on line 7 the bootstrap.php file has include <?php /** * installs wordpress running tests , loads wordpress , test libraries */ require_once 'phpunit/autoload.php'; i think need add phpunit folder path, having men...

c++ - Travis: CMake seems to loose (can not find) compiler version -

have problem testing ubuntu cmake g++ build on travis. what important have upgrade gcc/g++ @ least 4.7 version first. sudo apt-get install gcc-4.8 g++-4.8 (4.8 well) i tried lot of configs , found travis version of cmake not see compiler version. cmake_c_compiler: /usr/bin/gcc-4.8 cmake_cxx_compiler: /usr/bin/g++-4.8 cmake_cxx_compiler_version: <<<<<<<<<empty! so tests compiler version fail ... cmake error @ cmakelists.txt:22 (message): gcc version must @ least 4.8! here build log: https://travis-ci.org/paku-/travistest/builds/66662613 any ideas ? ps. tested using alternatives, same. tested on local ubuntu virtual machine - working should. it's solved ... did not know cmake_cxx_compiler_version supported v.2.8.9. while travis cmake v.2.8.7

php - PayPal Express Checkout won't redirect to Paypal.com -

this website: http://boostingfactory.com/heroes-of-the-storm/rank-boost/ test random checkout , you'll see won't redirect paypal.com i talked technical support told me module requests token doesn't redirect payment on paypal.com reason. this module: http://pastebin.com/wbgts35b what think causing this? this line particularly: function redirecttopaypal ( $token ) { global $paypal_url; $paypalurl = $paypal_url . $token; header("location: ".$paypalurl); }

php - Server modifications happen after restart, why? -

why whenever make changes files within server, change after giving restart php? i using amazon server nginx php-fpm . the command updates happen is: php-fpm service restart edit: the problem occurring cache. when restart php service, modifications entered i suppose changing configuration files , come affect after restart service. this because in linux whenever service start read configuration parameters configuration files , starts run per configurations. ex if service logging /var/log/abc start logging there. , no matter how many times change conf file after service write logs file only. when change configuration files service need restarted read changed parameters , start running according parameters. although services allow runtime paramter changes. not in number. some applications allow reload them instead restart read configuration parameters on runtime , change according them. can way service <name_of_service> reload

Message gurantees on rapidly updated entities in Firebase -

i'd understand how firebase , listening clients behave in situation large number of updates made entity in short amount of time, , client listening 'value' changes on entity. say have entity in firebase simple data. { "entity": 1 } and value of "entity" updated rapidly. below code writes 1000 integers. //pseudo-code making 1000 writes possible for(var = 0; < 1000; i++) { ref.child('entity').set(i) } ignoring transient issues, listening client using 'on' api in browser receive 1000 notifications containing 0-999, or firebase have throttles in place? first off, it's important note firebase realtime database state synchronization service, , not pub/sub service. if have location updating rapidly, service guarantees state consistent across clients, not intermittent states surfaced. @ 1 event fire every update, server free 'squash' successive updates same location one. on client making updates, th...

objective c - How to merge multiple signal and stop on first next but not to stop on first error? -

i have number of network requests , 1 or more of them return valid data , possible return error. how can combine request stop once first valid returned data not stop in case of error. i have try this: [[racsignal merge:@[sigone, sigtwo, sigthree]] subscribenext:^(ractuple *mydata){ nslog(@"data received"); } error:^(nserror *error) { nslog(@"e %@", error); } completed:^{ nslog(@"they're done!"); } ]; my problems: if 1 of signals returns first error no next send. not desired because 1 of other signals return valid data. if 3 return valid data subscribenext called 3 times stop got valid data (to reduce network traffic) try this: [[[[racsignal merge:@[[sigone catchto:[racsignal empty]], [sigtwo catchto:[racsignal empty]], [sigthree catchto:[racsignal empty]]]] repeat] take:1] ...

python - Take input without changing the line -

print("please enter:") x = input() print(x) in console after "please enter:" printed line changes. want should able provide input in same line of "please enter:". there method prevent change of line? instead of print() , use input() produce prompt: x = input("please enter: ") from input() function documentation : input([prompt]) if prompt argument present, written standard output without trailing newline.

Is the storage location "storage" for all Android devices and versions fixed? -

i want know : /storage/sdcard0/ , /storage/sdcard1/ directory location android devices , versions available , unchanged? namely, can use /storage/... in code? i want sure root of versions available or not. ! for example : file root = new file("/storage/sdcard1"); // or file root = new file("/storage/sdcard0"); // if unmounted , know .. //file[] files = root.listfiles(); //for(file singlfile: files){ // ... //} is code correct? android mobile devices? help. /storage/sdcard0/ , /storage/sdcard1/ directory location android devices , versions available , unchanged? absolutely not. not same different users on same device. never hardcode root paths . use methods on context , environment , etc., @ root paths.

html - Center align a table vertically and horizontally -

.cls_forgotpwd_container { font-family: sans-serif; font-size: 13px; width: 350px; /*margin: auto;*/ width: 350px; display: table-cell; vertical-align: middle; } .cls_forgotpwd_table label { margin-right: 10px; } .cls_forgotpwd_table input[type="password"] { width: 200px; height: 20px; border: 1px solid #555; } body { display: table; } <div class="cls_forgotpwd_container"> <form class="cls_forgotpwd_form" id="forgotpwd_form"> <table class="cls_forgotpwd_table"> <tbody> <tr> <td><label>password</label></td> <td><input type="password" name="password"></input></td> </tr> <td><label>confirm password</label></td> ...

iOS Cocoapods -pod(MBProgressHUD) installed give error stuck at "Analyzing dependencies" and "Header file missing" -

Image
i have installed 2 pods mbprogesshud , pephotocropeditor it's working correctly till got error mbprogresshud.h file not available. , tried pod update , again pod install command still not able solve problem. when fier both command terminal stucked @ analysing dependencies. and pods looking in red color. my problem solved following procedure. 1) take backup of project other place. 2) open terminal , , go project directory cd command. 3) first type command setup pod: $ pod repo remove master $ pod setup $ pod install note takes time. so, don't panic wait few minuts. edit :- after completing if find error mbprogresshud.h file not found ( of pod related header file) you need follow procedure also. you need check if pod header files correctly symlinked in pods/headers. (all imagae give correct setting) wiki or cocoapods troubleshooting gives explaination in brief. 1) if doesn’t seem work, first of ensure not ...

ruby on rails 4 - How to configure doorkeeper without oauth -

i learning how develop api rails app. trying develop use mobile app. far developed small api of controller. having problem login. using devise user management , rails 4.1. i watched railscast video doorkeeper implementation . in video used doorkeeper oauth gem. want implement without oauth. how can that? so far added doorkeeper gem , in initialize folder added doorkeeper.rb following code doorkeeper.configure resource_owner_authenticator user.find_by_id(session[:current_user_id]) || redirect_to(login_url) end end and added before_action :doorkeeper_authorize! in controller module api module v1 class coursescontroller < applicationcontroller #before_action :doorkeeper_authorize! before_action :set_course, only: [:show, :edit, :update, :destroy] respond_to :json # /courses/1 # /courses/1.json def show @course = course.find(params[:id]) @assignment = @course.assignments respond_with @assignm...

php - calling codeigniter controller through cron job -

i building job portal using codeignitor , want send daily job postings users , command attempting run in cron job /usr/bin/php5 /home/sites/domain_name/public_html/beta/index.php cron index where beta sub folder in main public directory, cron controller name , index in main method want call didnt work , getting email (whole page html code in email sample below) x-powered-by: php/5.2.17 set-cookie:ci_session=a%3a5%3a%7bs%3a10%3a%22session_id%22%3bs%3a32%3a%221ef765385e51654bcea0099cd2850232%22%3bs%3a10%3a%22ip_address%22%3bs%3a7%3a%220.0.0.0%22%3bs%3a10%3a%22user_agent%22%3bb%3a0%3bs%3a13%3a%22last_activity%22%3bi%3a1434193382%3bs%3a9%3a%22user_data%22%3bs%3bba0%3a%22%22%3b%7da8dfb8966c09414dc15b5160a7d7e65fc7ccebb0; path=/ set-cookie: phpsessid=gv78hetjs54rnjnhelb7rqeuklln6; path=/ expires: thu, 19 nov 1981 08:52:00 gmt cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 pragma: no-cache content-type: text/html <html> <head></head>...

jquery - Get return from javascript anonymous funcion in each loop(s) -

i've never worked js before , faced problem, how can next? function test() { $(xml).find("strengths").each(function() { $(this).each(function() { (if condition) { //i want break out both each loops @ same time here. // , main function too! } }); }); } i understand stop 1 loop need return false . if have nested? , how return main function? thanks all! you use 2 variables: function test() { var tocontinue = true, toreturn; $(xml).find("strengths").each(function() { $(this).each(function() { if("some condition") { toreturn = {something: "sexy there!"}; return tocontinue = false; } }); return tocontinue; }); if(toreturn) return toreturn; //else stuff; }

c# - transfer login information to different pages using Session asp.net -

i'm working in visual studios 2013 , making simple website project in school. i'm using c# asp.net. have sign form works , login bootstrap modal. want when user logs in username written on navbar, in form of "hello, 'username' ". i wrote in masterpage: <div id="sessionuser" runat="server" style="color:black; font-size: 25px; position: fixed; right: 350px; top: 15px;"></div> the login modal in masterpage , c# code: //login if (request.form["submitlogin"] != null) { string usernamel = request.form["usernamelogin"]; string passwordl = request.form["passwordlogin"]; string sqll; sqll = "select * users username='" + usernamel + "' , password='" + passwordl + "'"; if (eitan.isexist(filename, sqll)) { session["user"] = usernamel; if (session["user...

how to restrict the number of tweets returned from twitter api in backbone.js -

i'm trying build simple backbone twitter-based application show overview of recent tweets in user’s timeline of authenticated user’s account, each time run app there 20 tweets returned twitter api , vertical scrolling appeared on browser window dont prefer. how restrict number of tweets appers on page , instead of 20 tweets how load 6 tweets example , make link in bottom of page load rest of tweets. code follows: my collection: define(['backbone', 'app/model/tweet'], function(backbone, tweet) { var com = com || {}; com.apress = com.apress || {}; com.apress.collection = com.apress.collection || {}; com.apress.collection.timeline = backbone.collection.extend({ //the model collection uses model: tweet, //the server side url connect collection url: 'http://localhost:8080/timeline', initialize: function(options){ //anything defined on construction goes here }, }); return com.apress.collection.timeline; }); my view define(['jquery...

Query Google Bigquery Through Python In Google App Engine -

i trying query bigquery table , display results webpage using google apps engine(biling enabled project). using python(3.4.3) development. here code found , trying work thru it, main.py file: import httplib2 apiclient.discovery import build oauth2client.client import signedjwtassertioncredentials # replace project id project_id = "725429xxxxxx" # replace service account email google dev console service_account_email = '725429xxxxxx-si4unlakcnr3mxxxxxxxxxx@developer.gserviceaccount.com' f = file('key.p12', 'rb') key = f.read() f.close() credentials = signedjwtassertioncredentials( service_account_email, key, scope='https://www.googleapis.com/auth/bigquery') http = httplib2.http() http = credentials.authorize(http) service = build('bigquery', 'v2', http=http) datasets = service.datasets() response = datasets.list(projectid=project_id).execute() print('dataset list:\n')...

tsql - organize sql heirarchy -

i have following table: id son roworder technology 1 8 null fa 8 0 null fa 9 15 null gr 15 0 null gr i create sql query "order by" following order: technology, "father" (a record has son), son (the direct son of previous father" , update roworder column next time order these records sole based on roworder. ideas? thanks if not want data change instead of storing data in row number use select id, son, technology, isnull((select id table t2 t2.id = t1.son), 0) father, row_number() on (order technology, father, son) rownumber table t1 order rownumber asc the functions isnull() , row_number() may change name depending on database using rough idea of should go for.

php - mail function return false when add html content type -

function sendemail($to,$subject,$message,$headers=false){ $from = "app@boutiqueplatter.com"; $headers = "from: " . strip_tags($from ) . "\r\n"; $headers .= "mime-version: 1.0\r\n"; $headers .= "content-type: text/html; charset=iso-8859-1\r\n"; try { if(mail($to,$subject, $message, $headers)) { $sentemail = true; } else { $sentemail = false; } var_dump($headers ); } catch(exception $ex) { throw new exception($message, $code, $previous); $sentemail = false; } return $sentemail; } this function when remove header $headers .= "content-type: text/html; charset=iso-8859-1\r\n"; email send properly, when add line mail function return false. in local machine working fine please help. thank you. i got solution, add 'from' in end of header working. function sendemail(...

javascript - Where does user registration data get stored with node.js -

i have started explore node.js , wondering user data stored if wanted create registration form/login , logout functionality website. i know php form data written , stored sql database on server. what happens when start use node.js authentification packages. still need set sql database on server? or work in different way? usernames, passwords , reg e-mails stored? rather confused eager learn node.js , make simple working registration form. thanks guys! form data isn't stored (not unless you've handled stored). when submit form, you're creating http request, , http request, server can designed handle data send said http request... so, lets made form this: <form method="post" action="/register"> <input type="text" name="email"> <input type="submit"> </form> through magic in browser, when click submit, creates http request where-ever action parameter pointing to. so, ca...

javascript - Sub navigation disappears when I click on it in responsive view -

i've created sub navigation , when click on (using jquery code), scrolls down , can hover on links dont appear @ all. i tried looking causing problem such color or background can't find out went wrong. messing around visibility , display of element don't think theres problem there, although i'm unsure. to isolate problem of code may lie, here sub navigation code: ul { padding: 0; position: absolute; top: 33px; right: 16px; width: 150px; display: none; opacity: 0; visibility: hidden; @include transition('all .2s ease-in-out'); li { display: block; width: 100%; { width: 100%; display: block; background: lighten(#27344c, 10); color: #fff; padding: 0; padding-right: 14px; @include transition('all .2s ease-in-out'); } } li:hover { { background: lighten(#27344c, 5); } } } ...

node.js - bluemix docker container bind to mongodb ('MongoError', message: 'connect ENETUNREACH') -

have been trying connect docker node.js app mongodb service no avail. i've created liberty bridging application ($bridge_app) no war or code bound mongodb service. running status. have same code running correctly in local docker container. using mongoose connect mongo.the difference in code way of resolving mongo connection string: var db_connect_string = 'mongodb://app:password@127.0.0.1:27017/appname'; if(custom.areweonbluemix() && custom.dowehaveservices()) db_connect_string = custom.getmongoconnectstring(); ... console.log('going connect mongo@: ' + db_connect_string); var db = mongoose.createconnection(db_connect_string); db.on('error', console.error.bind(console, 'connection error:')); db.once('open', function (callback) { console.log('... db open !!!'); }); i push image bluemix no issues: ice --local push $registry/$org/$container_name i check env vars: cf env $bridge_app system-...

ios - PARSE - how to save a large table with 800 records to Parse class in one-go, instead of using For-Loop to save each array of one record at one time -

if have table 800 student records. each student record has several fields , e.g student id, student name, contact no. how can save these records in one-go, using for-loop loop each record in array 1 one. as takes quite long time save 800 records if did so. kindly please share advices , experience how can shorten time required.

HTML/CSS Stay in header -

Image
hey guys possible make navigation bar stay in header no matter padding? coz want make site title , menu in 1 line , thought padding that... #banner { background-color: #d3135a; height: 120px; margin-bottom: 4%; } h1 { float: left; padding-bottom: 6%; } #pav { font: trebuchet ms; float: left; padding-left: 4%; margin-top: 4%; } #menu_virsut li { display: inline; } #menu_virsut { float: right; margin-top: 5%; padding-right: 4%; padding-bottom: 2%; padding-top: 1%; } <header id="banner"> <h1>the site</h1> <nav id="menu_virsut"> <ul> <li><a href>menu link</a> </li> <li><a href>menu link</a> </li> <li><a href>menu link</a> </li> </ul> </nav> </header> a simple way alignment set same line-height h1 tag , co...

.NET Web service called from android,gives java.net.SocketException: recvfrom failed:ECONNRESET (Connection reset by peer) -

i make 1 c# web service data sql database , call webservice in android app got error "java.net.socketexception: recvfrom failed: econnreset (connection reset peer)" please give suggestion. try out solution given before on stack overflow my code below: soapobject request = new soapobject(wsdl_target_namespace, operation_name); // headerproperty hp=new headerproperty("connection", // "keep-alive"); // hp.setvalue("close"); propertyinfo propertyinfo1; propertyinfo1 = new propertyinfo(); propertyinfo1.settype(string.class); propertyinfo1.setname("paycode"); propertyinfo1.setvalue(paycode); request.addproperty(propertyinfo1); envelope = new soapserializationenvelope(soapenvelope.ver12); envelope.dotnet = false; envelope.implicittypes = true; envelope.bodyout = request; envelope.setoutputsoapobject(request); new httptransportse(soap_address).getserviceconnection().setrequestproperty("connection...

javascript - How to check if username exists without refreshing page using wordpress -

i want check text field in form if username exists in database or not.i want without refreshing page , using wordpress.i know possible through ajax have tried ajax in wordpress , ajax code didn't run on it. kindly provide piece of code or helpful link. last time have tried didn't work: <?php if(!empty($user_name)){ $usernamecheck = $wpdb->get_results("select id wp_teacher_info user_name='$user_name'"); if(!empty($usernamecheck)){ echo'username not available'; } else { } }?> <label for="user_name" id="user_name">username: </label> <input type="text" name="user_name" id="user_name" required/> <span id="user-result" ></span> <script type="text/javascript"> jquery("#user_name").keyup(function (e) { //user types username on inputfiled var user_name = jquery(this).val(); //get string typed user jquery.post('tea...

javascript - How to store records entered in windows.prompt in mysql database -

i using window.prompt enter data (email address) in field. now want store value entered in field in mysql database... using php server-side language. function onplayerstatechange(event) { var time, rate, remainingtime; cleartimeout(stopplaytimer); if (event.data == yt.playerstate.playing) { time = player.getcurrenttime(); // add .4 of second time in case it's close current time // (the api kept returning ~9.7 when hitting play after stopping @ 10s) if (time + .4 < stopplayat) { rate = player.getplaybackrate(); remainingtime = (stopplayat - time) / rate; stopplaytimer = settimeout(pausevideo, remainingtime * 1000); var pvalue=window.prompt("enter email"); document.getelementbyid("abc").value=pvalue; } } }

paypal - Issue integrating shopify store with 2checkout in case of non standard currency -

i have shopify store default currency pkr. want integrate 2checkout payment method credit card transaction. problem 2checkout's standard currency not pkr. unless change store's default currency usd integration not work. can there work around shopify checkout remains pkr when client selects credit card , proceeds payment, money converted usd , passed 2checkout. this not posible shopify checkout works default store's currency. why don't try payment gateway paypal?

javascript - Have an button reset and start a countdown timer -

i trying begin countdown timer when button clicked. have searched , found few different items, nothing seems function. i have different buttons throughout domain set different times (ie: 120 seconds, 60 seconds, etc). display in same spot on every page ( div in top right of loaded page ) wanting use external js scripts/timer.js i can use <div id="timer"></div> place timer. my questions: how call function start timer. suggested script said timer when amount of time can change , has carry on pages (i've been using $_session['x'] to pass information between .php <div class="headertopgab"> <div style="float: left; margin-left: 20px"> galactic credits: <?php echo "&ccedil;".$_session['galacticcredits']; ?> </div> <div style="margin-left: 50px; float: left"> <?php echo "".$_session['currentlocation']; ?>...