Posts

Showing posts from April, 2013

Primitive object size in java/scala and 'as<SomePrimitive>Buffer() methods invocation -

my objective generalize shapes creation android opengl es tutorial here: http://developer.android.com/training/graphics/opengl/shapes.html looks right now: val squarecoords = array( -0.5f, 0.5f, 0.0f, // top left -0.5f, -0.5f, 0.0f, // bottom left 0.5f, -0.5f, 0.0f, // bottom right 0.5f, 0.5f, 0.0f ) // top right val vertexbuffer = bytebuffer.allocatedirect( // (# of coordinate values * 4 bytes per float) squarecoords.length * 4) .order(byteorder.nativeorder()) .asfloatbuffer() .put(squarecoords) .position(0) so, float size hardcoded. have short arrays too: val draworder = array[short] ( 0, 1, 2, 0, 2, 3 ) val drawlistbuffer = bytebuffer.allocatedirect( // (# of coordinate values * 2 bytes per short) draworder.length * 2) .order(byteorder.nativeorder()) .asshortbuffer() drawlistbuffer.put(draworder) drawlistbuffer.position(0) code looks similar challenge part choose right method asfloatbuffer()/asshortbuffer() in case , use right primitive v...

javascript - Table borders are not visible inside expandable list content -

i started learning html , copied code create expandable-collapsible list. in list content, have created table, borders of table not visible when open web page. same table displays fine border when run on webpage without list. please me solve problem. code shown below: <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.95.3/js/materialize.min.js"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.95.3/css/materialize.min.css" rel="stylesheet"/> </head> <body> <div> <ul class="collapsible" data-collapsible="accordion"> <li> <div class="collapsible-header"><i class="mdi-navigation-chevron-right...

javascript - Generate JS array that determines sorted rank -

using complex array (for use case of tabular data displayed in columns , rows) lets have values: var values = [ [234, 386, 21, 38], [-23, 58, 106, 0], [45, -48, 506, 23], [109, 168, 42, 111] ]; what best way return matching array rank values against column in correct (maintained) order? ranked order highest lowest in case. for example, end result array of: [ [1, 1, 4, 2], [4, 3, 2, 4], [3, 4, 1, 3], [2, 2, 3, 1] ]; note how result sorted vertically column. i want use large data set, guidance/tips quickest performance aim here. -- for context: first attempt map original array index values, unsure go there: var singlecolumn = [234, -23, 45, 109]; (var = 0; < singlecolumn.length; i++) { singlecolumn[i] = [singlecolumn[i], i]; } essentially trick retaining original indices after sort. i've iterated them data structure first, sorted it, , rebuilt 2-dimensional array structure result. i haven't done checking ens...

Run TFS with Docker -

i've been reading lot docker , uses. using tfs building , deploying our in house app (.net c#). there benefits transitioning docker? meaning having set after tfs runs build, deploy container? currently there no easy way run build ourselves besides doing bunch of manual steps: how to: build team projects on desktop . can run docker on windows server? would able setup our vms docker can deploy/mimic deployment process locally (to our vms)? and have same process set our production environment? yes, can run docker on windows server, cannot run natively on windows now. because docker relies on linux-specific features, can’t run docker natively in windows. instead, must install docker toolbox application. application installs virtualbox virtual machine (vm), docker itself, , docker toolbox management tool. these 3 things allow run docker on windows. for deployment docker, refer link details: http://www.colinsalmcorner.com/post/continuous-deployment-wi...

Issue with displaying vertical and diagonal letters - C Programming -

i'm totally new c programming , i'm trying create word search . i've got list of words , 4 randomly picked. these 4 words printed in grid horizontally, vertically or diagonally, can them print horizontally. must add have no idea on how piece of code works appreciate if kind enough can me. can me in right direction create random words in vertical , diagonal alignment ? http://imgur.com/vsrxf4c void puthorizzontalword(char word[10]) { int rrow, rcol , ok , i; { rrow = rand() % 10; rcol = rand() % 10; ok = 1; if(rcol + strlen(word) < 10) { for(i = 0;i < strlen(word);i++) { if(puzzle[rrow][rcol + i] == ' ' || puzzle[rrow][rcol + i] == word[i]) { puzzle[rrow][rcol + i] = word[i]; } else { ok = 0; } } } ...

java - How can i set an alarm with AlarmManager set() -

i have tried set alarm in android app. failed. have read tutorials don't work me, don't see mistake. here code: manifest : <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.byethost6.jessy_barthelemy.planificate"> <uses-permission android:name="com.android.alarm.permission.set_alarm"/> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/apptheme"> <activity android:name=".createtask"></activity> <receiver android:name="com.byethost6.jessy_barthelemy.planificate.hourreceiver" android:process=":remote"/> </application> </manifest> i set ...

C++ delete[] calls destructor -

edited : added constructor , destructor. edit : leak : c:\users\sijaan\desktop\1\starray.cpp(61) : {148} normal block @ 0x007c0910, 40 bytes long. data: < h | > c8 00 00 00 02 00 00 00 68 09 7c 00 cd cd cd cd c:\users\sijaan\desktop\1\starray.cpp(43) : {145} normal block @ 0x007c04b0, 40 bytes long. data: <d { > 64 00 00 00 01 00 00 00 a8 e2 7b 00 cd cd cd cd c:\users\sijaan\desktop\1\starray.cpp(24) : {143} normal block @ 0x007c0150, 816 bytes long. data: < x { > 80 00 00 00 58 e1 7b 00 ce cd cd cd ce cd cd cd object dump complete. i'm trying create new object after every call function : bool starray::addcs_course(int studentid, int courseid, char * coursename, int hwnum, double hwweigh, int flag, char * bookname) { (int = 0; < max_student_num; i++) { if (starray_[i] == null) continue; if (starray_[i]->getid() == studentid) { cs_course* new_cs = new cs_course(courseid, ...

How to clean up an interrupted Homebrew install? -

i decided brew install stack, haskell package manager, changed mind midway , interrupted ctrl+c. looks reasonable amount of storage has been taken on computer install, however, think downloaded files installation remain. how can clean them out? i've tried brew cleanup cleared few things, maybe 20 mb in total. there way remove remains of interrupted homebrew install? if not, tips going it? thanks! have tired brew doctor ? gives idea of might going wrong. suggest looking cellar folder , search leftovers.

JQuery Ui Effects not working -

when use hide() or show() work - when use effect() , don't, here little peace of code: <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> and script is: <script type="text/javascript"> $(document).ready(function() { $(".palas").fadein(2000); /*$(".palas").click(function () { $(this).hide( "fold", {horizfirst: true }, 2000 ); });*/ $(".palas").click(function () { $(this).hide(); }); }); </script> uncommented part working well, commented part not, tried more options this. change jquery ui link version 1.5 version 1....

php - readfile function for PDF download issues -

i know question has been asked, solutions offered not working me. able download pdfs, adobe reader telling me it's either corrupt or decoded improperly. have alternative solution, or possible fix? $path = "http://www.laerdalmail.com/discoversimulation/downloads/needs_assessment_form.pdf"; header('content-type: application/pdf'); header("content-transfer-encoding: binary"); header("content-disposition: attachment; filename=needs_assessment_form.pdf"); readfile($path); exit; readfile should given filesystem path, not url. this: $path = '/websitefolder/discoversimulation/downloads/needs_assessment_form.pdff'; // or $parh = 'c:\something\needs_assessment_form.pdff'; try adding in content length too: header('content-transfer-encoding: binary'); header('content-length: ' . filesize($path));

laravel - How not to show on a page of chunk of layout? -

i have common layout pages in it, include "form search" (search in header). on page "global search" not display search. how nicely? check title or route, thing came mind layout -> include (search.form) -> page i think best option here utilise route::is($name) in view. allows check if route being accessed, require use of named route, however. routes.php route::get('/search', ['uses' => 'searchcontroller@search', 'as' => 'global-search']); view @if ( ! route::is('global-search')) @include('search.form') @endif

performance - OpenMP with "collapse()" for nested for-loops performs worse when without -

this code: double res1[nnn]; #pragma omp parallel collapse(3) schedule(dynamic) (int i=0; i<nnn; i++) { (int j=0;j<nnn;j++) { (int k=0;k<nnn;k++) { res1[i] = log(fabs(i*j*k)); } } } std::cout<< res1[10] << std::endl; when use collapse(3) takes ~50 sec; without collapse(3) ~6-7 seconds. puzzled behavior, since have expected better performance "collapse" without. am missing something? i did experiments , played different configs: (nnn = 2500 , 24 cores) schedule(static) && collapse(3) -> ~54 sec schedule(static) && collapse(2) -> ~8 sec schedule(static) && collapse(1) -> ~8 sec i tried dynamic schedule, takes enormous time (several minutes). in original problem, have 4 dim "for-loops" (4d array): 51x23x51x23. what best way use openmp/mpi minimize running time? have in total ~300 cpu cores. best way spread array on these core...

ruby on rails - wrapping non-ActiveRecord actions in an ActiveRecord transaction, will this work? -

i have piece of code creates db records, processes dwolla transaction. want or nothing. if of lines inside transaction block throw exception, first 2 lines (the active record lines) roll back? note, whole thing wrapped in begin/rescue/end i'm concerned 1 point. user.transaction user.save! record.save! transactionid = dwolla::transactions.send({:destinationid => user.dwolla_id, :amount => amount, :pin => dwollatransaction.get_dwolla_pin}) transac = dwollatransaction.create(user_id: user.id, transaction_id: transactionid, amount: amount) end thanks insight. basically, want make sure our internal records never saved if external api call fails. yes, long they're raising exceptions when fail, db transaction rolled back, , save! s not committed db.

node.js - Can Amazon's Kinesis Client Library consume multiple streams? -

i have quick question. kcl able consume multiple streams? should ever set multiple streams application, or individual stream supposed tied individual application? particular use case need consume data being produced backend , frontend. 1 of these produces data @ greater rates other, , reason think should produce separate streams processing. there way consume both streams same kcl process or need set two? help! kcl open source project can modify consume events multiple streams, not recommended. better keep things simpler. if have 2 different event streams, better have 2 different kinesis streams, 1 each. allows scale each stream independently each has different rate , possibly different peaks. if need share information between streams, can use share state variables between them, using db such dynamodb or redis. please note if have set of servers sending out these events, should expect of events of end, might processed before events front end. kcl (or lambda) code have...

javascript - Split utils.js into multiple files for intl-tel-input -

i've been using plugin crossrider extension. problem utils script 200kb+ , there's limitation in crossrider. my question, there way split utils.js seperate files? i've checked code enclose in (function() {....}) can't break them in half without messing up. anyone tried this? thanks, kevin use minified version of library 23kb. [ disclosure: crossrider employee]

c# - HttpClient Post deserialize error on SalesForce RestApi -

i'm trying use httpclient post new account via salesforce restapi, i'm receiving following error: message: "can not deserialize sobject out of value_string token @ [line:1, column:1]". errorcode: "json_parse_error". i'm using same json webrequest , httpclient tests. webrequest, works well. here code httpclient: var uri = "https://na15.salesforce.com/services/data/v27.0/sobjects/account"; var acc = new account(); acc.name = "restapihttpclient"; var ser = new javascriptserializer(); var json = ser.serialize(acc); httpclient client = new httpclient(); client.defaultrequestheaders.add("authorization", "bearer " + binding.sessionheadervalue.sessionid); var response = await client.postasjsonasync(uri, json); var stringresponse = await response.content.readasstringasync(); console.writeline(stringresponse); the accou...

delphi - KeyDown KeyPress Conundrum - How to cancel the Space in Ctrl + Space -

if understand correctly, keydown event cannot stop character key (space) being passed control. but keypress event doesn't tell me whether ctrl down. but need cancel space if ctrl down. how can prevent edit control receiving space keypress if ctrl down? purpose: have text box, making search suggestions. want pop suggestions using short cut ctrl+space. in case, don't want add space edit text. the keypress event doesn't tell me whether ctrl down. no, can use win32 getkeystate() function instead. how can prevent edit control receiving space keypress if ctrl down? like this: procedure tform58.edit1keypress(sender: tobject; var key: char); begin if (key = ' ') , (getkeystate(vk_control) < 0) begin key := #0; // something... end; end;

transform a dataframe to and make it similar to an R frequency table -

i have data frame has frequency counts. created data frame using dplyr's group by a beta 2 gamma 2 b alpha 3 b beta 5 b gamma 9 c beta 3 c gamma 10 d beta 8 i trying create frequency table aggregates counts frequency table using r's table function b c d alpha 0 3 0 0 beta 2 5 3 8 gamma 2 9 10 4 you can try this: df <- data.frame(v1 = c('a', 'a', 'b', 'b', 'b', 'c', 'c', 'd'), v2 = c('beta', 'gamma', 'alpha', 'beta', 'gamma', 'beta', 'gamma', 'beta'), v3 = c(2, 2, 3, 5, 9, 3, 10, 8)) xtabs(v3 ~ v2 + v1, data = df)

html - PHP passing variable through a form -

hey have been learning php last few days , have decided make test using form , radio buttons. using submit button have managed pass variables process test page, works out calculations , send original page. though have having problems using request receive , display data. apologise ignorance of question. processtest.php <?php session_start(); $totalscore = 0; if($_post['q1'] == "a"){$totalscore += 20;} if($_post['q2'] == "c"){$totalscore += 20;} if($_post['q3'] == "b"){$totalscore += 20;} if($_post['q4'] == "a"){$totalscore += 20;} if($_post['q5'] == "c"){$totalscore += 20;} header("location: c1l4.php?totalscore = $totalscore"); exit(); ?> c1l4.php (where test originates) <? $totalscore=$_get['totalscore']; echo $totalscore; ?> if possible give me brief description have done wrong request , why variable not defined appreciated. try changing ...

c# - Regex back references in Regex.Replace() -

i'm using regex replace values within html code. correctly matches instances within html code when using regex.replace() references doesn't replace references. for example html = "<td>[element]elementreference='oldvalue';[/element]</td>"; html = regex.replace(html, @"(['""#(=])" + elementreference.key + @"(['""#)];|&)", "$1" + elementreference.value + "$2", regexoptions.ignorecase); results in: "<td>[element]elementreference=$1newvalue'[/element]</td>" but if use html = "<td>[element]elementreference='oldvalue';[/element]</td>"; var regex = new regex(@"(['""#(=])" + elementreference.key + @"(['""#)];|&)", regexoptions.ignorecase); foreach (match match in regex.matches(html)) { html = html.replace(match.value, match.groups[1] + elementreference.val...

javascript - Parsing JSON with jquery to get some value -

this json { "rajaongkir": { "query": { "origin": "23", "destination": "152", "weight": 1500, "courier": "all" }, "status": { "code": 200, "description": "ok" }, "origin_details": { "city_id": "23", "province_id": "9", "province": "jawa barat", "type": "kota", "city_name": "bandung", "postal_code": "40000" }, "destination_details": { "city_id": "152", "province_id": "6", "province": "dki jakarta", "type": "kota", "city_name": "jakarta pusat", "postal_code": "10000...

android - Geopoint at parse.com -

im trying add marker retrieving data have saved user, have saved geoping dont know how put values separated,because latitud , longitud database , need vaules separated can following: double lat = <geopoint parse.com>; double lon = <geopoint parse.com>; latlng ubicacion = new latlng(lat, lon); googlemap.addmarker(new markeroptions().position(ubicacion).title("marker in sydney")); could helpme these? try on way. it's getting using parse query loc.getlatitude(); loc.getlongitude(); @suppresswarnings("null") public static void showmap(double lati, double longi, googlemap googlemap) { mmarker = googlemap.addmarker(new markeroptions().position(new latlng(lati, longi))); drawmarkerwithcircle(1000, new latlng(lati, longi), googlemap); } public static void drawmarkerwithcircle(double rad, latlng position, googlemap googlemap) { double radiusinmeters = rad; int strokecolor = 0x0000ff; int shadecolor = 0x44ff0000; ...

box api - Codecademy tutorial Creating a folder -

working through codecademy tutorial uploading , downloading files. stuck on first step. require "rest-client" require "json" body = { "name" => "tigerden27", "parent" => { "id" => "0" } } response = restclient.post( "https://api.box.com/2.0/folders", json.generate(body), {:authorization => "access_token"} ) puts "copy number down: " + json.parse(response.body)['id'] the response get... 400 bad request that's correct! next exercise: adding description folder i don't folder id can't progress next step. i've completed the prior tutorials without issue. appears others having same issue.

cryptography - Using toString()'s argument to output letters in javascript -

this question has answer here: what mean when there number parameter passed tostring? 3 answers i don't understand what's happening here: var x = 14; alert(x.tostring(36)); //alerts 'e' alert(x.tostring(16)); //also alerts 'e' x = 20; alert(x.tostring(16)); //alerts '14' alert(x.tostring(36)); //alerts 'k' i think first parameter determines numerical system of number converted, not sure. can explain in detail going on? you changing bases passing number parameter. second example easiest explain . . . 14 in base16 'e'. base16 'digits' 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, (10), b (11), c (12), d (13), e (14), , f (15). for number system of 15 or above, actually, 14 = 'e'. in case of 20, base16 gives 14, cause have 1 sixteen, plus 4 ones (16 + 4 = 20). to level set, in decimal (base10 . . . ...

android - IllegalStateException when adding & replacing Fragments; commit vs commitAllowingStateLoss -

it rare happens, app crash due illegalstateexception when adding , replacing fragments. here how doing it, animation. private void addfragmentreplace(int containerid, fragment fragment) { // check if fragment has been added fragment temp = mfragmentmanager.findfragmentbytag(fragment.gettag()); if (!utils.checkifnull(temp) && temp.isadded()) { return; } // replace fragment , transition animation mfragmentmanager.begintransaction().setcustomanimations(r.anim.ui_slide_in_from_bottom_frag, r.anim.ui_slide_out_to_bottom_frag).replace(containerid, fragment).addtobackstack(null) .commit(); } i have researched changing "commit()" "commitallowingstateloss()" solution? prevent crashes, however, won't cause other conflicts such fragment not displaying @ times or other? following odd improvement above code snippet? private void addfragmentreplace(int containerid, fragment fragment) { // check if ...

umbraco - How to use Archetype with Razor? -

Image
i can't believe couldn't find examples online. this simple archetype. this tried: <img src="@currentpage.ctatopleft.image" alt="@currentpage.ctatopleft.text"> but gives error: 'archetype.models.archetypemodel' not contain definition 'image' edit: works: <img src="@currentpage.getpropertyvalue("ctatopleft").fieldsets[0].getvalue("image")" alt="@currentpage.getpropertyvalue("ctatopleft").fieldsets[0].getvalue("text")"> wondering if there shorter way of writing it? well, no - archetype property can have complex, nested set of data quite in collections may nested. in fact, it's quite common use corresponding nested set of partial views render out correctly if have example nested archetype properties (it happens). there tutorials/samples available sort of thing: http://imulus.github.io/archetype/ - archetype home on github https://...

postgresql - Cloud Foundry bosh Error 100: Can't find network -

Image
i'm attempting setup service broker add postgres our cloud foundry installation. we're running our system on vmware. i'm using release in order that: cf-services-contrib-release i need setup networks: section in manifest, , i'm setting there isn't working. this networks in vmware vcenter ui: and clusters , resource pools in vcenter ui: i tried both , without quotes, around 'name' of network. i'm getting error saying bosh can't find network: failed compiling packages > rootfs_lucid64/9b3f611b46e076b94b37645c98f9100e7bcef5dd: can't find network: vlan1130_lb_100.114.130.0 (00:00:01) failed compiling packages > postgresql93/06163819b694f8d9836586d024f64c11efe30180: can't find network: vlan1130_lb_100.114.130.0 (00:00:01) failed compiling packages > postgresql92/2867893e714aae6e6b76bd06e7aa30d47023c46e: can't find network: vlan1130_lb_100.114.130.0 (00:00:01) error 100: can't find network: vlan1130_lb_1...

c# - MVC 5 Can an EditorTemplate call another EditorTemplate -

i need following: asp.net mvc3 razor - child items list not posting editor the difference parent-child relationship one-to-many , child-subchild relationship one-to-many (as opposed one-to-one , one-to-many respectively in above example). not have viewmodel @ point. i have set view uses , editortemplate, in turn uses editortemplate. works except on httppost changes subchild (i don't need allow child edited) not propagated database. my main questions are: can have editortemplate call editortemplate? need have viewmodel? i think in controller need save changes db... i'm not sure how pass subchild information controller. know these questions kinda basic , general... if had example of httppost controller action method this.

swift - Extra argument 'Error' in call with Json -

i'm trying data themoviedb api error json code. error " argument 'error' in call" code var err: nserror? private func reload() { let requesturl = "https://www.themoviedb.org/search/remote/multi?query=exterminador%20do%20futuro&language=en" let config = nsurlsessionconfiguration.defaultsessionconfiguration() let session = nsurlsession(configuration: config) let request = nsurlrequest(url: nsurl(string: requesturl)!) let task = session.datataskwithrequest(request, completionhandler: { (data, response, error) -> void in if let error = error { print("###### error ######") } else { if let json = nsjsonserialization.jsonobjectwithdata(data, options: .allowfragments, error: nil) as? [nsdictionary] { movie in json { let name = movie["name"] as! string let post...

java - How to Display a Random Word out of a Set? -

i'm extremely new java, decided create simple game. when press button, program "flips coin" , displays either "true" or "false" . the idea based on random generated number, either display "true" or "false" . this current code: package com.me.koteg.dmaker; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.textview; import java.util.random; public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } public void generate(view view) { final textview textone = (textview) findviewbyid(r.id.txtdisplay); button pushme = (button) findviewbyid(r.id.button); final string[] mycoin= {"heads", "tails"}; random rand = new random(); int number = r...

java - Bamboo Deployment with generated Jenkins artifacts -

i doing analysis of bamboo jenkins migration. have jenkins build ready, , artifacts staged @ specified server location. my question is, can use bamboo deploy plan generated jenkins artifacts, specifying artifacts location? i tried explore @ bamboo side using different plugins deployment plan tasks, cannot see option giving source path of artifacts needs deployed. any appreciated we not going ahead approach, after lot of analysis, found below solution = create ssh task in bamboo deployment plan in ssh task, copy artifacts generated through jenkins staging area of bamboo for eg - scp -1 -o user@source_host:/jenkins-artifacts-path user@destination_host:/bamboo-staging-path

php - How to call another DetailView::widget from another model in one view YII2? -

i new in yii2 . have display data table in detailview::widget . i want call detailview::widget table , display in same view. you can use 2 detailview widgets in same view, there no problem. in controller: use yii\web\notfoundhttpexception; ... public function actionview($id) { $model1 = $this->findmodel($id); $model2 = modelname::find()->where(['id' => ...])->one(); if (!$model2) { throw new notfoundhttpexception('second model not found'); } return $this->render('view', [ 'model1' => $model1, 'model2' => $model2, ]); } in view: <div class="col-md-6"> <?= detailview::widget([ 'model' => $model1, 'attributes' => [ 'name', ], ]) ?> </div> <div class="col-md-6"> <?= detailview::widget([ 'model' => $model2, ...

Idiomatic go way to compare 2 slices to see which element has been removed -

i using rethinkdb in application , have lobby has users. rethinkdb has ability watch changes table , when changes happen automagically emits changes can whatever want data, right i'm trying make when user leaves lobby can send websocket out remove user. thing i'm trying find out difference in before / after data slice of members , data: type change struct { newval *fields `gorethink:"new_val,omitempty"` oldval *fields `gorethink:"old_val,omitempty"` } type fields struct { id string `gorethink:"id"` owner string `gorethink:"owner"` inqueue bool `gorethink:"inqueue"` members []struct { steamid string `gorethink:"steamid"` username string `gorethink:"username"` } `gorethink:"members"` messages []struct { username string `gorethink:"username"` message string `gorethink:"message"` crea...

javascript - Font-Size Change Problems -

i have header changes size on scroll within website coding. need change font size of text within header. able go smaller following code. below have relvant css. $(document).on('scroll', function(e) { var value = $(this).scrolltop(); if ( value < 100 ) $("header").css("height", "100px"); else $("header").css("height", "55px"); $('h1').css({'font-size' : '30px'}); }); makes go smaller until refresh h1 { font-size: 75px; width: 100vw; color: #212121; padding-top: 2vh; font-family: 'raleway', sans-serif; padding-left: 1vw; font-weight: 300; z-index: 30; } though if try make resets it's original fontsize (code below) when scroll messes js , none of js on page works. $(document).on('scroll', function(e) { var value = $(this).scrolltop(); if ( value ...

How to provide parameter to docker run with "oc new-app" in OpenShift? -

when run docker containers, need provide parameters on command line ( docker run image some-parameters ). how can provide same parameters when using oc new-app in openshift origin? the oc new-app example includes: # create application based on template file, explicitly setting parameter value $ oc new-app --file=./example/myapp/template.json --param=mysql_user=admin the --param option can useful here. note: oc run example include: # start single instance of nginx, overload spec of replication # controller partial set of values parsed json. $ oc run nginx --image=nginx --overrides='{ "apiversion": "v1", "spec": { ... } }' that json can include parameter section, this one used sti_incremental.go#l39 .

gradle - Could not find property 'keyStorePath' on project ':app' in Android Studio -

i have task in app module build.gradle task testkeystorepath << { println "what, " + keystorepath file file = file(keystorepath) println file.isfile() } in ~/.bash_profile #key store path export org_gradle_project_keystorepath=/users/marshall/documents/eclipse.keystore i'm sure correctly set in android studio, gradle sync fail error:(16, 0) not find property 'keystorepath' on project ':app'. but, in terminal ./gradlew testkeystorepath -q what, /users/marshall/documents/eclipse.keystore true why? after call export org_gradle_project_keystorepath=/users/marshall/documents/eclipse.keystore you should call source ~/.bash_profile make setting works @ once,or work util open command line again.

jquery - Shopify filtering with multiple tags -

i've been following doc filtering multiple tags select elements wondering if there way modify javascript work other ui elements such buttons or text links: https://docs.shopify.com/support/your-store/collections/filtering-a-collection-with-multiple-tag-drop-down i've attached suggest code below reference: <ul class="clearfix filters"> <li class="clearfix filter"> {% assign tags = 'red, green, blue' | split: ',' %} <label>shop color</label> <select class="coll-filter"> <option value="">all</option> {% t in tags %} {% assign tag = t | strip %} {% if current_tags contains tag %} <option value="{{ tag | handle }}" selected>{{ tag }}</option> {% elsif collection.all_tags contains tag %} <option value="{{ tag | handle }}">{{ tag }}</option> {% endif %} {% endfor %} ...

Batch move with exceptions? Or using xcopy and deleting original after? -

i have script extracts files sub-directories , deletes empty sub-directories afterwards, part extracts reads: for /r %%a in (*.*) move "%%a" "%~dp0" is there way exception of sub-directories named "_unsorted"? know xcopy has /exclude option, for /r %%a in (*.*) xcopy "%%a" "%~dp0" /exclude "\_unsorted\" would work, i'm not sure how delete original after it's copied have same result move some batch-only options: add filter loop body: for /r %%a in (*.*) ( (echo %%~dpa | find /i "\_unsorted\" 1>nul) || move "%%a" "%~dp0" ) alternatively: for /r %%a in (*.*) ( (echo %%~dpa | find /i /v "\_unsorted\" 1>nul) && move "%%a" "%~dp0" ) in both versions, find command used match file's path against substring \_unsorted\ . in first version, find returns success if there match , fail otherwise. move command calle...

wordpress - WooCommerce product attributes gone -

i've been working on wordpress/woocommerce site morning. now, of sudden, product attributes have no values. if add new product attribute value (via product attribute page), new value not show. if in database, values there , data looks fine, references , all. i've done nothing taxonomy terms (except read them in little theme code i'm writing). i've looked @ git , nothing has changed has impact on product attributes. i stumped nothing making sense. i'm starting wonder if it's bad mojo, site of mine has decided magically stop working without reason. any ideas anyone? i'm tick away going nutts. okay, seems have been full hdd on vm machine wordpress running on. once freed space started working.

arrays - Passing by reference to n-th element in C# -

in c, if have array, can pass reference function. can use simple addition of (n-1) pass reference starting n -th element of array this: char *strarr[5]; char *str1 = "i want that!\n"; char *str2 = "i want this!\n"; char *str3 = "i want those!\n"; char *str4 = "i want these!\n"; char *str5 = "i want them!\n"; strarr[0] = str1; strarr[1] = str2; strarr[2] = str3; strarr[3] = str4; strarr[4] = str5; printpartially(strarr + 1, 4); //we can pass start printing 2nd element .... void printpartially(char** strarrpart, char size){ int i; (i = 0; < size; ++i) printf(strarrpart[i]); } resulting in these: i want this! want those! want these! want them! process returned 0 (0x0) execution time : 0.006 s press key continue. in c#, can pass reference object ref (or, out ). object includes array, whole array (or @ least, how suppose works). how pass reference n -th element of array such internal function, there string[] elem...

angularjs - Two search views accessing same controller -

i'm making hotel website , have search destination,arrive,depart etc on home page. i have search integrated on different pages within site. used include template , have used ng-show hide on home page want use full page jumbotron search fields on home page. therefore views different functionality same. my home view looking home controller , search view looking search controller. i have set global controller (i added functionality such page titles , active nav states css) me place both search forms can access , pass required data. my global controller added body tag , can access onload console.log. i thought access ng-submit="globalcontroller.setdestination()" on both forms nothing happens. how can access global controller usng ng-submit? need these both go relative controllers route on somehow? there better way 2 views access/pass same data? i know can make service have quite few $scope elements thought passing 2 views 1 controller might keep dry. ...

java - How do I iterate all the rows in a spreadsheet (including null) -

Image
i using apache poi parse excel spreadsheet. according poi iterator guide , row iterator skip rows null. wanted iterate rows, null or not. used loop instead. row row0 = sheet.getrow(0); (row row : sheet) { rowindex ++; cell cell = row.getcell(0); if (cell != null) { system.out.println(rowindex); } } when debugged in eclipse, following spreadsheet, row0 null, row in first iteration of loop not null. output (row index of first not null cell) supposed 2, prints 1. why first null row skipped loop? for loop (in case for-each loop) uses iterator (see iterable interface https://docs.oracle.com/javase/8/docs/api/java/lang/iterable.html ) iterate through rows, have written skip null values. the way include null values in iteration use traditional loop (see iterate on cells, control of missing / blank cells section in http://poi.apache.org/...

python - Pyscopg DB - Error Adding Persistence to code -

i working on online project udacity . using vagrant configured them, run server containing database. unfortunately when tried give code persistence, server returns error everytime. new python please forgive obvious mistakes. here error : serving http on port 8000... traceback (most recent call last): file "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run self.result = application(self.environ, self.start_response) file "forum.py", line 95, in dispatcher return dispatch[page](env, resp) file "forum.py", line 68, in post length = int(env.get('content_length', 0)) valueerror: invalid literal int() base 10: '' 10.0.2.2 - - [06/jan/2016 04:44:16] "get /post http/1.1" 500 59 10.0.2.2 - - [06/jan/2016 04:44:16] "get /favicon.ico http/1.1" 404 22 and code have changed in forumdb.py : # # database access functions web forum. # import psycopg2 ## database connection def getallposts(): ...