Posts

Showing posts from April, 2015

In Rails, I'm receiving an error "Model(#-12345) expected, got String(#-12345)" -

i realize there's existing question this, none of answers provided worked me. what's particularly bothersome can tell i'm passing in correct parameters through create method (or update, i'm trying use create now). debugging/error page presented rails 4 built-in server: "url"=>"", "country"=>"1", "charge"=>"0", my models configured model belongs_to country , country has_many models. don't why, if i'm passing in formatted data, , i'm accessing country model (my drop-down populated appropriate names via code below), doesn't work. appreciated. i'm stumped , google has been of minimal help. <%= f.select :country, country.all.collect { |c| [c.id, c.id.to_i] }, class: 'form-control' %> also note i've tried many variations including not limited to: <%= f.select :country, country.all.collect { |c| [c.country_long_name, c.id] }, class: 'form-control...

ruby on rails - Undefined method 'items_loaded' -

missing fundamental here. getting undefined method 'items_loaded' when trying check if rest client done fetching items api. live app can run on fly : http://runnable.com/vw9rqx-kiiffmpii/ajax-affiliates started "/check_items_loaded" @ 2015-06-04 17:03:44 +0000 processing maincontroller#check_items_loaded */* completed 500 internal server error in 2ms (activerecord: 0.0ms) nomethoderror (undefined method `items_loaded' #<class:0x00000004e694a8>): app/controllers/main_controller.rb:12:in `check_items_loaded' main_controller.rb class maincontroller < applicationcontroller def index # delay fetching # @products = affiliate.fetch @products = affiliate.delay.fetch # let know when fetching done affiliate.set_items_loaded end def check_items_loaded @items_status = affiliate.items_loaded respond_to |wants| wants.js end end end affiliate.rb require "rest_client" class affiliate ...

java - Hiibernate: @OrderColumn in @OneToMany causes an UPDATE after INSERT -

i have following pojos db schema. @entity @table(name = "quotes") public class quoterequest { public quoterequest(){} @id @column(name = "quote_request_id") @generatedvalue(strategy = generationtype.identity) private long quoterequestid; @onetomany(mappedby = "quoterequest", cascade = cascadetype.all) @ordercolumn(name = "accidents_id") private accidents[] accidents; // getters , setters } @entity @table(name = "accidents") public class accidents { public accidents() { } @id @generatedvalue(strategy = generationtype.identity) @column(name = "accidents_id") private long accidentid; @column(name = "amount", nullable = false) private float amount; @manytoone(optional = false, cascade = cascadetype.all) @joincolumn(name = "quote_request_id", nullable = false) private quoterequest quoterequest; // getters , se...

android - New dev team, existing app, can't view data -

i've been tasked creating new version of existing app. previous development team (external contractors) have disappeared having trouble @ moment.. the existing app stores user data locally. new version of app have develop needs keep existing user data. wondering if possible app access it? i have looked in following folders: /data/data/theapp/databases /data/data/theapp/files only data added app in directories. have been unable at /data/data please note: after installing existing app , recording data, installing app via android studio, existing app disappears. due build string both apps being same? the client has given me task may able obtain information if there's need, point out please? thanks lot i wondering if possible app access it? only if same app, defined as: having same application id (or package name if not changing application id in gradle build files, if any) signed same signing key after installing existing app , reco...

apache - ZendFramework 2 - 500 Internal Server Error -

today create first project zend framework2 , when using internal php cli-server in root directory works. but when try configure virtual host in apache2 see "500 internal server error" zendframework-2.4.2 php version 5.5.9 apache/2.4.7 /etc/apache2/sites-available/zend-default.conf <virtualhost *:80> servername zend.local documentroot /var/www/html/zendframework/zendskeletonapplication/public <directory /var/www/html/zendframework/zendskeletonapplication/public> directoryindex index.php allowoverride require granted </directory> </virtualhost> /etc/hosts 127.0.0.1 zend.local 127.0.0.1 localhost if remember correctly have enable mod_rewrite in apache2.

prototype - JavaScript Protoype confusion -

i new javascript , experimenting these days. came know javascript prototype based. tried executing below code: var person = function(name) { this.name = name; } alert(person.prototype); var ram = new person("ram"); alert(ram.prototype); as expected, first alert prints [object, object] , expect second alert prints same, doesn't, why? can please explain clearly? because prototype property on functions isn't function's prototype, it's property used set prototype of objects created via new operator function. you can access object's prototype using es5's object.getprototypeof : var person = function(name) { this.name = name; }; alert(person.prototype); var ram = new person("ram"); alert(object.getprototypeof(ram)); on firefox , several other browsers, can use upcoming es6 feature (for javascript in browsers): __proto__ accessor property: var person = function(name) { this.name = name; }; alert...

java - System.currentTimeMillis() keeps resetting -

i'm trying make cooldown utility in spigot plugin: package net.gettrillium.trillium.api.cooldown; import com.google.common.collect.hashbasedtable; import com.google.common.collect.table; import net.gettrillium.trillium.utils; import org.bukkit.bukkit; import org.bukkit.entity.player; import java.util.uuid; public class cooldown { private static table<uuid, cooldowntype, long> cooldown = hashbasedtable.create(); public static void setcooldown(player p, cooldowntype type) { cooldown.put(p.getuniqueid(), type, system.currenttimemillis()); } public static boolean hascooldown(player p, cooldowntype type) { if (cooldown.contains(p.getuniqueid(), type)) { bukkit.broadcastmessage("get: " + cooldown.get(p.getuniqueid(), type)); bukkit.broadcastmessage("current millis: " + system.currenttimemillis()); bukkit.broadcastmessage("subtracted: " + (system.currenttimemillis() - cooldown.get(p.getuniqueid(), type))); ...

Yii2 Home Breadcrumbs incorrect -

for reason home url breadcrumbs in website incorrect : e.g. breadcrumbs home / biometries when click on home - (with 404 error) basic/web/index.phpindex.php how can correct home url leave off index.php? i've searched app , yii2 site no thanks i found error, on main layout page <?= breadcrumbs::widget([ 'homelink' => ['label' => 'home', 'url' => yii::$app->gethomeurl() . 'index.php?r=dashboard/index'], 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], ]); ?> just dropped index.php there , works fine - happens when spend hours looking bit of code making me more precise..

report - How to debug Error Messsage in Odoo -

i have created own custom report in when print report @ time below error message created 500: internal server error i don't know should start problem solution. log file in /var/log/odoo/ says: , log file /var/log/odoo/ "missingerror: ('missingerror', u'one of documents trying access has been deleted, please try again after refreshing.')" do have solution resolve problem ?. try running odoo.py when such error occur. show error occurred. after fix issues under odoo.py. go.

ruby on rails - Assets 404 error with dokku -

i deployed rails application dokku. went fine except assets including images returns 404 error. i don't know how debug this. finally added : config.serve_static_files = true in environements/production.rb

php - Fetch Tables with Only One Record and One Table with Several Records -

i have prepared statement inner joins 7 tables , sends email of information gathered. each table can have 1 record per person except uploaded_files table can have many records 1 person. everything works great except when there multiple records in uploaded_files table receive empty array error , email doesn't send. assuming need loop through loop find multiple records in uploaded_field table can't seem figure out. so there can 1 of every variable except $file_id, $file_name, $file_type, $file_size, , $file_path i have simplified code below every variable in every table doesn't overshadow actual issue. can provide. if(!mysqli_connect_errno()) { if($stmt = $db_connect->prepare("select s.student_id, s.student_first_name, s.student_last_name, y.agency_id, y.user_email, y.agency_name, y.agency_rep_name, y.agency_phone, p.personal_id, p.english_name, p.gender, p.date_of_birth, p.fathers_name, p.fathers_email, p.fathers_date_of_birth, p.fat...

VirtualBox and Google Compute Engine -

can run virtualbox , active vm on server hosted in google cloud engine? if yes, steps? install , build vm through vnc? so far have found similar solution digitalocean install virtualbox, xfce, vnc, etc. , runs. yes, same approach work on gce vm. you can use vagrant google compute engine plugin automate creation of virtual machines , gce vms.

Implementing Polymorphism in Javascript - how would this look? -

i'm trying make jump more oop style javascript approach, have not gotten right in javascript. take following function example. function positionalcss(array, cs, lcs){ /* define css circle based on number of circles */ //count array var arrcount = array.length; var t = []; var l = []; if(arrcount == 3){ t[0] ='15px'; l[0] = '240px'; t[1] = '345px'; l[1] = '440px'; t[2] = '345px'; l[2] = '40px'; } if(arrcount == 4){ t[0] ='-135px'; l[0] = '90px'; t[1] = '-10px'; l[1] = '290px'; t[2] = '220px'; l[2] = '270px'; t[3] = '315px'; l[3] = '90px'; } if(arrcount == 6){ t[0] ='-135px'; l[0] = '90px'; t[1] = '-10px'; l[1] = '290px'; t[2] = '220px'; l[2] = '270px'; t[3] = '315px'; l[3] = '90px'; t[4] = '210px'; l...

Camel requestBodyAndHeaders() doesn't return the route result -

i have camel route split/aggregate: from("seda:start") .routeid("camelroute") .log("request: ${body}") .split() .method(splitservice.class, "splitrequest") .parallelprocessing() .bean(sendtoworker.class, "sendtoq1(${body}, ${headers})") .aggregate(header("corrid"), new customaggregationstrategy()).completionsize(5) .log("aggregated ${body}") .bean(sendtoworker.class, "sendtoq2(${body}, ${headers})") .log("response: ${body}"); the last log displays result correctly. when call as @autowired private producertemplate producertemplate; [...] object o = producertemplate.requestbodyandheaders("seda:start", request, headers) i'm not able result camel route. the returned o instance request object itself . does have idea can wrong here? thanks help. you should use splitter a...

stack over flow when compiling scala code in maven due to duplicate names -

i need make changes class in package did not want loose initial class. copy class , paste in same project , changes name of functions , classes when try compile package new class in maven, stack on flow exception. here error message: [info] [info] last tree typer: typetree(class customermiddlecombo) [info] symbol: class customermiddlecombo in package churnstory (fl ags: ) [info] symbol definition: class customermiddlecombo extends serializable [info] tpe: com.cloudera.sa.bell.churnstory.customermiddlecombo [info] symbol owners: class customermiddlecombo -> package churnstory [info] context owners: method apply -> anonymous class $anonfun -> method generatedcombocountmore -> object combocounterjobm5 -> package churnstory [info] [info] == enclosing template or block == [info] [info] apply( // val custid(): string in class userandsingleseqcounts [info] "r"."custid" // val custid()...

ruby - Boolean values not being "read" in Rails -

i imported values excel using roo boolean fields in rails app. in rails console looks working fine, in rails app boolean values don't seem read rails. i have datapoint model. 1 attribute of datapoint boolean field currently_employed. in rails console works (seems fine): 003:0 > x.currently_employed => true 004:0 > z.currently_employed => false 005:0 > x.currently_employed == false => false 006:0 > x.currently_employed == "true" => false 007:0 > x.currently_employed == true => true 008:0 > z.currently_employed == false => true 009:0 > z.currently_employed == "false" => false 010:0 > z.currently_employed == true => false given seems in console, i'd have thought formula in data_point.rb model work fine: def self.pct_true(data_points) true_count = 0 data_points.each |x| if x.currently_employed true_count += 1 else end end return true_count / da...

matplotlib - Python - Label size of colorbar -

Image
i reduce size of labels of different colorbars. got picture can see below. try "labelsize" in plt.colorbar doesnt work my code : plt.close() fig, axes = plt.subplots(nrows=1, ncols=3) plt.tight_layout(pad=0.05, w_pad=0.001, h_pad=2.0) ax1 = plt.subplot(131) # creates first axis ax1.set_xticks([0,2000,500,1000,1500]) ax1.set_yticks([0,2000,500,1000,1500]) ax1.tick_params(labelsize=8) i1 = ax1.imshow(u,cmap='hot',extent=(x.min(),2000,y.min(),2000)) plt.colorbar(i1,ax=ax1,ticks=[u.min(),(u.min()+u.max())/2., u.max()],fraction=0.046, pad=0.04,format='%.2f') ax1.set_title("$ \mathrm{ux_{mes} \/ (pix)}$", y=1.05, fontsize=12) ax2 = plt.subplot(132) # creates second axis ax2.set_xticks([0,2000,500,1000,1500]) ax2.set_yticks([0,2000,500,1000,1500]) i2=ax2.imshow(uu,cmap='hot',extent=(x.min(),2000,y.min(),2000)) ax2.set_title("$\mathrm{ux_{cal} \/ (pix)}$", y=1.05, fontsize=12) ax2.set_xticklabels([]) ax2.set_yticklabels([]) ...

internet explorer - IE : Check document mode and actual browser version without user agent -

i have issue our website support internet explorer version 9 , above. had checked user agent string obtain browser , version , redirect have found unusable solution. our network automatically changes user agent string ie 7 compatibility mode if using ie 11. i have found using java script can check document mode, returning correct mode requested compatibility mode enabled. rather redirecting based on document mode there way can actual browser version if compatibility mode on redirect may not required if browser ie 9 or above in compatibility mode. the idea check if browser supports edge , change response edge , should still rendered redirect if not possible ? i want avoid redirecting user on ie 11 compatibility mode enabled may not know how change setting. any appreciated. thanks the way have gone in past, if couldn't use user agent reason, feature detection. https://msdn.microsoft.com/en-us/library/hh273397(v=vs.85).aspx it's important decide why ne...

javascript - "No 'Access-Control-Allow-Origin' header is present on the requested resource" -

i trying authorization using javascript connecting restful api built in flask . however, when make request, following error: xmlhttprequest cannot load http://myapiurl/login . no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access. i know api or remote resource must set header, why did work when made request via chrome extension postman ? this request code: $.ajax({ type: "post", datatype: 'text', url: api, username: 'user', password: 'pass', crossdomain : true, xhrfields: { withcredentials: true } }) .done(function( data ) { console.log("done"); }) .fail( function(xhr, textstatus, errorthrown) { alert(xhr.responsetext); alert(textstatus); }); if understood right doing xmlhttprequest different domain page on. browser blocking allows request in same origin securi...

c# - manual mvc4 data annotation model validation -

i need validate viewmodel manually.but getting null result after calling validate method on modelvalidator object. var temp = validators.first().validate(basicdetails); is there work around validate manually created viewmodel? public static modelstatedictionary validatedatalead(leadviewmodel newlead, controllercontext context) { var basicdetails = new basicdetailsviewmodel(); basicdetails.name = new fullnameviewmodel(); var modelstate = new modelstatedictionary(); var types = basicdetails.gettype().getproperties(); foreach (propertyinfo property in types) { var propertymetadata = modelmetadataproviders.current.getmetadataforproperty(() => basicdetails, basicdetails.gettype(), property.name); var validationprovider = modelvalidatorproviders.providers[0]; var validators = validationprovider.getvalidators(propertymetadata, context); } return modelstate; } any appr...

how to dismiss already opened keyboard when popover appears ios -

in ios project, have form contains various text fields. text fields edited keyboard , picker view placed on popover. when go on filling text fields, without dismissing , if click on popover text field keyboard remains open. it appears both keyboard , popover present on screen @ same time, don't want. i able whether keyboard opened or not setting flag in keyboard notification methods , last text filed edited through text filed delegates. , have tried [self endediting:yes]; (as in table cell) [lasteditedtextfield resignfirstresponder]; even try pass keyboard dismiss notification self (without knowing whether possible or not) [[nsnotificationcenter defaultcenter] postnotificationname:uikeyboardwillhidenotification object:nil]; but nothing working. how can dismiss keyboard (if open) whenever popover appears. thanks in advance. try implement textfieldshouldbeginediting: , inside check text field this. if 1 of fields should display popover, first call...

oauth 2.0 - Prompt for AD credentials on every OAuth2 authorize request -

we have application own authentication, added oauth2 support. corporate customer can specify data adfs or google domain, , use automatically sign , log in users. now, problem switching credentials. when log out our application, clicking login button (which redirects configured adfs oauth2 authorize endpoint) validate user , send him our app, valid code current credentials. the google endpoint has special parameter, approval_prompt , can use force intermediate step, @ user can switch credentials. don't think adfs has that. what other solutions have? possible configure on adfs server prompt user enter credentials every authorize request? here's how url parameters work, best understand them: wa operation we're requesting. far, i've seen 2 values: wsignin1.0 , wsignout1.0 wfresh has max age of cached credentials, don't entirely understand it. 0 means don't use cached credentials. wtrealm appid configured in adfs. tells adfs server app trying ...

html - Custom CSS Checkbox with caption inside -

i'm trying create custom css checkboxes following designer's specs. checkboxes have circle 60px radius, , checkbox label must places @ center of circle. moreover, when checkbox "checked" background must becomes red. here achieve create far : http://codepen.io/anon/pen/qdrqbv here code : html <div class="mybox"> <input type="checkbox" value="none" id="sth" name="check" checked /> <label for="sth"> <span> test </span> </label> </div> css .mybox { width: 120px; position: relative; margin: 0; padding:0; label { color: #000; width: 120px; height: 120px; padding:0; cursor: pointer; position: absolute; top: 0; left: 0; text-align: center; line-height: 120px; border-radius: 50%; border: 2px solid black; &:after { box-sizing: border-box; content: ''; ...

c# - Show/hide Mahapps Flyout control -

how can show/hide mahapps flyout control? have: <controls:flyoutscontrol> <controls:flyout header="flyout" position="right" width="200" isopen="true"> <textblock fontsize="24">hello world</textblock> </controls:flyout> </controls:flyoutscontrol> and it's open, when click button arrow can't show again. you can use this: yourmahappflyout.isopen = true; also can bind flyout visibility windowcommand ( leftwindowcommand / rightwindowcommand ) whenever close flyout can reopen using togglebutton (for example) top of window. <controls:metrowindow.flyouts> <controls:flyoutscontrol> <controls:flyout x:name="yourmahappflyout"/> <controls:flyoutscontrol> <controls:metrowindow.flyouts> <controls:metrowindow.rightwindowcommands> <controls:windowcommands> <togglebutton content="l...

Handling datalist with angularjs (1.3) -

(i angularjs/js noob) trying create auto complete drop down html input data list. list should hold json objects , want show user 1 attribute of them. data list part of form. on submit want "know"/sent selected object json. here have far (actual have 2 drop downs , want sent object nesting 2 selected objects): html: <form ng-controller="registerusertoprojectcontroller" ng-submit="submit()"> <div class="form-group"> <label for="user">user</label> <input type="text" list="users" class="form-control" ng-model="fields.user" /> <datalist id="users"> <option ng-repeat="user in userslist" value="{{user}}">{{user.name}} ({{user.role}})</option> </datalist> </div> <div class="for...

java - Spring jpa no transaction in progress exception -

i'm new spring , don't understand why i'm facing issue. want save account object postgres database, connection ok flush() method invocation causes exception. this issue looks situation don't use lots of xml configure app, i'm confused , don't do. here's code : initializer.java public class initializer implements webapplicationinitializer { private static final string dispatcher_servlet_name = "dispatcher"; @override public void onstartup(servletcontext servletcontext) throws servletexception { annotationconfigwebapplicationcontext ctx = new annotationconfigwebapplicationcontext(); ctx.register(webappconfig.class); ctx.register(securityconfig.class); ctx.register(jpaconfig.class); servletcontext.addlistener(new contextloaderlistener(ctx)); ctx.setservletcontext(servletcontext); dynamic servlet = servletcontext.addservlet(dispatcher_servlet_name, new dispatcherservlet(c...

Creating Custom Date Function in Excel -

i trying code date function in excel using month , last 2 digits of year. example have numbers 1-12 in column. want code them follows. 1 jan-15, 2 feb-15,..june-15. 7 july-14, 8 aug-14. whenever try type in codes them respective month, day , year 2015. know have create custom format date function, how go doing in case. have seen things, many of times unclear. me out. this link can out. create custom date format if want use format isn’t in type box, can create own. easiest way start format close want. select cells want format. press ctrl+1. in format cells box, click number tab. in category list, click date, , under type, pick date format close format want. go category list, , pick custom. under type, you’ll see format code date format picked in step 4. built-in date format can’t changed, don’t worry messing up. changes make apply custom format you’re creating. in type box, make changes want using code table below. accordin...

c# - Do these two functions both create collections of Classes? -

i've written piece of code in c# can create collection of classes , stores them in array. know code works , job fine , i've been using store results database display. now need replicate same behaviour using vb.net , after google-ing appears i've found closest solution. i've run c#code through translator (c# vb.net) did not give me correct result , produced error when placed inside collection class. here's code:- c# using system; using system.collections.generic; using system.collections.objectmodel; using system.linq; using system.text; using system.threading.tasks; namespace knightowl_businesslogic.dataobjects.animal_module { public class animalcollection : collection<animal> { public animal[] toarray() { animal[] array = new animal[this.count]; this.copyto(array, 0); return array; } } } vb.net: imports system.collections.generic imports system.collections imports system...

Android: Service stops and restarts after Activity crash -

i have activity launches service startservice , binds service communication between two. in onstart of service return start_sticky because want service keep running no matter what. service contains logic , activity responsible ui. the problem is: if close app (swiping away recent apps) service keeps running without problem. if activity crashes (for unhandled exception) service stops working without calling ondestroy , restarts oncreate , onstart . how can keep service running if app crashes? edit: if system reaches low memory app force-closed , service stops , restarts. problem not on crashes therefor solution can't put codes in try-catch blocks. thanks you should use remote service in different process adding android:process=":whatever" and binding serviceconnection .

javascript - Account onLogin hook Meteor loop -

i building application using meteor. want create new cart id (to act cart can store items) each time user logs application. however, every time open new page in application, new cart id created. mean application "logs in" every single time click on new page in app? here's code: accounts.onlogin(function(user){ var newcartid = uuid.new() meteor.users.update({_id: user.user._id}, {$set: {'profile.cartid': newcartid}}) console.log('just created new cart id @ ' + date()); }); yes, true. every time open new page not logged in. when localstorage token authenticates you, similar how cookie does, logged in automatically. hook run when logged in automatically. its difficult define how user logs in. meteor's onlogin hook fires on type of login method. you can customise when want hook run, though: accounts.onlogin(function(info) { if(info.methodname == "createuser") { conso...

c++ - Unknown module(s) in QT: core -

i'm having lot of trouble qt. when try build project (imported pc) error: unknown module(s) in qt: core moreover, have no such file or directory error whenever make #include <q*> (* meaning string, or widget...) if has had problem, appreciated.

sql - Using a dummy variable to keep a count -

i have user (x) has been sent 15 emails. there field called opened 1 or 0 depending if opened emails. want work down list (ordered date) , start count each time 0 i.e. count each time gets email until opens it. want average out counts. have tried partitioning , various things nothing works. sorry if putting in wrong place. final code, should want similar. declare @usercount int declare @counter int declare @startend varchar(10) set @counter=1 set @usercount=1 --step through table user while @usercount < (select count(userid) #stage2) begin --userprocessorder row number - update dummy parameter @startend set @startend = (select top(1) startend #stage2 userprocessorder=@usercount) --update table counter value update #stage2 set maxbeforeopen=@counter userprocessorder=@usercount --add 1 counter every time see start add 1 set @counter = @counter+1 --if @ end of group re-set counter if @startend='end' set @counter = 1 --go...

ruby - Sending smtp in rails using gmail -

i trying send activation email in development mode, using application.yml enter smtp credentials not sure missing reason i'm not able send activation email. here application.yml smtp_port: 587 smtp_domain: localhost:3000 smtp_address: smtp.gmail.com smtp_username: myemail@gmail.com smtp_password: myemailpassword smtp_authentication: 'plain' enable_starttls_auto: true development.rb config.action_mailer.raise_delivery_errors = false config.action_mailer.delivery_method = :file config.action_mailer.file_settings = { location: 'tmp/mails' } config.action_mailer.default_url_options = { :host => env["url_host"] } token_mailer.rb def activation(email, token) @token_url = edit_activation_url token mail to: email end use in development.rb config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :use...

linux - Save Directory Specific history for zshell -

i trying save directory specific command line history. aka, when in directory called happy, , arrow up, don't want see of past command line history, want see history done in specific happy directory. i want of saved file can access later. perhaps save files organized directory, or date, don't know best. have set up? thank you! it sounds use script on github. excerpt readme: per-directory-history per directory history zsh, global history, , ability toggle between them ^g. this implementation of per directory history zsh, implementations of exist in bash. implements per-directory-history-toggle-history function change using directory history using global history. in both cases history saved both global history , directory history, toggle state not effect saved histories. being able switch between global , directory histories on fly novel feature far aware. this standalone repository script, included in oh-my-zsh ...

vba - Access SysCmd function not working as expected for some action values -

i've read relevant historical material , not same issue others have had. adding doevents has no effect. first problem retval = syscmd(4, "here's update!") clears status bar text , meter, instead of updating text. have tested in sub , in immediate window using ?syscmd(4, "some text") . second problem more confusing syscmd(3) , syscmd(5) both entirely remove status bar, text , meter. syscmd(3) described in documentation : when argument 3, progress meter removed status bar. for syscmd(5) on another page : when action argument 5, status bar text set previous syscmd() function removed. contrary these descriptions, entire status bar removed. i tried testing the suggested sub microsoft : function statusbar () dim retval variant retval = syscmd(4, "the rain in spain falls ...") msgbox "press ok when ready finish!" retval = syscmd(5) end function testing resulted in message box. ev...

android - appcompat v7 overflow icon color different in V-21 -

Image
i have imagebutton src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha" using appcompat-v7 21.0.3. <imagebutton android:layout_width="@dimen/abc_action_button_min_height_material" android:layout_height="@dimen/abc_action_button_min_height_material" android:layout_alignparentright="true" android:background="?attr/selectableitembackground" android:src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha" /> it's showing me black overflow button until api 20. in api >=21 shows white icon not visible correctly in layout. see images. in kitkat in lollipop as seen, it's white in >=21 . i have single styles.xml file versions follows. <style name="appbasetheme" parent="theme.appcompat.light.noactionbar"> <item name="colorprimary">@color/colorprimary</item> <item name="colorprimarydark">@color/blue</item...

c# - MVC5 repository and unitofwork pattern -

i trying implement search method: getcompte using account number , parametre could'nt response view!! don't know error form: @using (html.beginform("searchcompte", "compte", formmethod.post, new { @class = "form-horizontal", role = "form" })) { @html.antiforgerytoken() @html.validationsummary(true, "", new { @class = "text-danger" }) <div class="form-group"> @html.label("numcompte", new { @class = "col-md-2 control-label" }) <div class="col-md-3"> @html.textbox("numcompte","", new { @class = "form-control", @placeholder = "n° compte" }) @html.validationmessage("numcompte", "", new { @class = "text-danger" }) </div> @html.label("clérib", n...

c++ - Accessing a Combobox inside a dataGridView Column? -

i'm working on scheduling program, , inside datagridview, have few combobox columns populated 3 entries upon creation, wanted able add more user creates them, have no idea how access combobox data. appreciated! // initialized in separate part. /* system::windows::forms::datagridview^ datagridview;*/ system::windows::forms::datagridviewcomboboxcolumn^ newcol = (gcnew system::windows::forms::datagridviewcomboboxcolumn()); datagridview->columns->addrange(gcnew cli::array< system::windows::forms::datagridviewcomboboxcolumn^ >(1) {newcol}); // add choices boxes. newcol->items->addrange("user inputted stuff", "more stuff", "add new..."); solution if have access data user entry , know column index datagridviewcomboboxcolumn , should able following wherever needed: datagridviewcomboboxcolumn^ comboboxcolumn = datagridview->columns[the_combobox_column_index]; if (comboboxcolumn != nullptr) { comboboxcolum...

build - Compile a directory tree of separate apps (one entry point each), using CommonJS modules and ES6 modules -

i writing couch app . output of build process must directory tree of self contained js files, so: dist ├── _attachments │ ├── logo.jpg │ └── splash.jpg ├── lists │ └── sitemap.js ├── shows │   ├── article.js │ ├── home.js │ └── dashboard.js ├── views │   ├── recent │   │ └── map.js │ ├── featured │ │ └── map.js │ └── stats │ └── map.js │ └── reduce.js each output js file complete app, imported modules inlined. each input file separate entry point, require / import modules top level lib directory (and node_modules or course). resulting dist directory deployed couch erica (alternatives suggestions welcome). so far, have tried following: compile babel (es7 yay!), using broccoli. produces es5 modules commonjs require statements; further build step necessary inline imported modules. browserify , uglify command line. looks designed produce single output file. in makefile, uglify each input separately , send output matching directory path un...

jetty - Atmosphere.js 501 Websocket protocol not supported -

on atmosphere 2.2.0 running on jetty python websocket-client-0.20.0 client, sometimes, although rarely, situation our logs fill following: 12:18:01.105 warn org.atmosphere.websocket.websocket: unable write 501 websocket protocol not supported 12:18:01.106 warn o.a.w.protocol.simplehttpprotocol: status code higher or equal 400. unable deliver websocket messages installed component. status 501 message websocket protocol not supported this spamming happens fast, @ 5ms intervals, , if occurs in production there no other way take system down. need avoid this. it may issue in our client, i'm wondering if there way recognize these kinds of errors @ server back-end , close connection, if can't come fix root cause? ... edit, 6 months later: issue seems arise earlier jetty exception: 11:05:54.363 error o.a.container.jetty9websockethandler: {} org.eclipse.jetty.websocket.api.websockettimeoutexception: timeout on read @ org.eclipse.jetty.websocket.common.io.abstractwebsock...

swing - JAVA read text files, count numbers and write it to Jtable -

i still learning java , have been trying find solution program few days, haven't gotten fixed yet. i have many text files (my program saves). files this: text (tab) number (tab) number (tab)... text (tab) number (tab) number (tab)... (tab) means there tabulation mark, text means text (string), number means there number (integer). number of files can 1 32 , file names like: january1; january2; january3... i need read of files (ignore strings) , sum numbers so: while ((line = br.readline()) != null) { counter=counter+1; string[] info = line.split("\\s+"); for(int j = 2; j < 8; j++) { int num = integer.parseint(info[j]); data[j][counter]=data[j][counter]+num; } }; simply want sum "tables" array of arrays (or similar kind of variable) , display table. if knows solution or can link similar calculation, awesome! so, see it, have 4 questions need answered, goes against site etiquette of asking question,...

reporting services - SSRS Get first Item LookUpSet -

so have dataset contains list of dates , foreign keys. need first date foreign key. have tried expression below: =first(lookupset(fields!title.value, fields!linked_study.value, fields!subject_enrollment_date.value, "fpi")) but returns #error . does know why expression doesn't work and/or how able first item out of lookupset. if still unclear please don't hesitate ask. lookupset() returns array - can demand 0th item array adding suffix (0) lookupset(): lookupset(fields!title.value, fields!linked_study.value, fields!subject_enrollment_date.value, "fpi")(0) edit: credit @gravinco pointing out - using lookup() instead of lookupset() have same effect, since return first matching value. think that's better way of doing original answer.

mount - How to list docker mounted volumes from within the container -

want list container directories mounted volumes. i.e. able similar info from docker inspect --format "{{ .volumes }}" <self> but within container , without having docker installed in there. i tried cat /proc/mounts can't find proper filter it. as can read many of comments had, container nothing restricted, reserved part of resources totally cut away rest of machine. not aware of being docker, , inside container behaves if separate machine. sort of matrix, guess ;) access host machine's kernel , resources, yet again restricted filtered out set. done awesome "cgroups" functionality comes unix/linux kernels. now news: there multiple ways provide information docker, going have provide , build yourself. the easiest ad powerful way mount unix socket located on host @ /var/run/docker.sock inside of container @ same location. way, when use docker client inside container directly talking docker engine on host. however, great power com...