Posts

Showing posts from March, 2015

java - Android Retrofit: missing method body, or declare abstract -

i writing android app use retrofit make api requests. i have helper class this: public class apiservice { public static final string tag = apiservice.class.getsimplename(); public static final string base_url = "https://myapiurl.com"; public static void testapi(){ apiendpointinterface apiservice = prepareservice(); apiservice.ping(new callback<response>() { @override public void success(response apiresponse, retrofit.client.response response) { log.e(tag, apiresponse.tostring()); } @override public void failure(retrofiterror error) { log.e("retrofit:", error.tostring()); } }); } private static apiendpointinterface prepareservice() { restadapter restadapter = new restadapter.builder() .setendpoint(base_url) .build(); apiendpointinterface apiservice = ...

typescript - tsc --out weird behavior when using 'import' in my files -

i have 2 typescript files, app.ts , , `angular2.d.ts' (which contains type definitions angular2) my tsconfig.json file looks so: { "compileroptions": { "module": "commonjs", "out": "public/all.js", "sourcemap": true, "watch": true, "target": "es5" }, "files": [ "typings/angular2/angular2.d.ts", "src/app.ts" ]} expected result - public/all.js contain compiled ts file. actual result - src/app.js file created, contains compiled ts file. public/all.js created, contains following line: //# sourcemappingurl=all.js.map (i.e. source mapping, no actual code) when investigating further, problematic line is: import {component, view, bootstrap} 'angular2/angular2'; in src/app.ts . remove line compiles correctly. put - causes aforementioned problem. what doing wrong? settings "out":"public/all...

java - Spring Multiple Property Placeholder and SPEL order independent -

i have 2 xml config files using property-placeholder . i'm having issue order of import statements these 2 config files effect spel in 1 of config files. config-a.xml <context:property-placeholder location="classpath:dev/food.properties" ignore-unresolvable="true" /> <bean id="foodnames" class="java.util.hashmap"> <constructor-arg> <map key-type="com.my.project.food" value-type="java.lang.string"> <entry key="#{t(com.my.project.food).sushi}" value="${dynamodb.sushi:#{null}}" /> </map> </constructor-arg> </bean> config-b.xml <context:property-placeholder location="classpath:dev/animals.properties" ignore-unresolvable="true" /> if import config-a.xml before config-b.xml , value set in foodnames map. if set...

Inserting a column in the end in excel vba -

Image
my dataset looks category dummy1 dummy2 aan abd bad boy abcd i want insert column names "result" in end, conditions if category starts result="pass" if category starts b result="fail" ie, final output should this how can in excel-vba. please me. i editing existing spreadsheets. dim rngtemp range set rngtemp = cells.find("*", searchorder:=xlbyrows, searchdirection:=xlprevious) each cel in range(cells(1, 1), rngtemp) if cel.value = "i live in" cel.value = "current_domicile" elseif cel.value = "i interested in purchasing" cel.value = "type_of_property" elseif cel.value = "i interested in purchasing" cel.value = "wait_time" elseif cel.value = "the reason not buying house right away because am:" cel.value = "reason_for_wait" end if next cel i want add new column conditions above. i not sure "files" mentioned workbo...

php - Retrieve specific information from a form - Symfony2 -

i want know how obtain specific data form sent user. is, when user submits form, example want save data in table, , other in table. help, sorry inconvenience for data (what think don't need, comprehension): $data = $form->getdata(); for specific fields, e.g. username (what need): $username = $form["username"]->getdata();

html - jQuery Shutter occupying all the document (Camera Effect) -

i using example getting camera shutter effect: click here so, need effect occupying document (width: 100% , height: 100%), but, how i've do? because if set var container = $('body'); effect not occupy window. so, i've do? larger image? because body's height not cover entire page, should add height: 100%; in html tag below: html{ background:url('../img/bg_tile.jpg') repeat; height: 100%; } but here comes issue, plugin draws canvas depends on object's height. can see 2 images( http://i.imgur.com/bycsnse.png , http://i.imgur.com/dmfdanc.png ) tested in browser different width. i think effect not want. , think can re-written css3, canvas plugin may speed down when size large. to solve problem, edited jquery.shutter.js let canvas size equals body size, , resize image(shutter.png) 2x below: line 37: var frames = {num:15, height:element.height(), width:element.width()}, line 128: c.drawimage(img,-slices.width,-(fram...

c++ - Flood Fill recursive stack overflow -

if try fill 100x100 rectangle overflow. 50x50 works fine. is there way fix overflow? i print out stack number , working rectangle stack higher big 1 (it crashes around 7000). void draw(int x, int y) { if ((x >= 0 && x < 100) && (y >= 0 && y < 100)) { canvas.set_pixel(x, y); if (!canvas.get_pixel(x, y + 1))draw(x, y + 1); if (!canvas.get_pixel(x, y-1))draw(x, y - 1); if (!canvas.get_pixel(x - 1, y))draw(x - 1, y); if (!canvas.get_pixel(x+1, y))draw(x + 1, y); } return; } don't use recursion. instead, use stack store coordinates want draw. , iterate until stack empty. void draw(int x, int y) { struct coordinate { int x, y; }; std::stack<coordinate> to_draw; to_draw.push({x, y}); while (!to_draw.empty()) { auto top = to_draw.top(); to_draw.pop(); if ( (top.x >= 0 && top.x < 100) ...

.net - How can a critical section is owned by a dead thread? -

i have .net winform application , ui hung. the ui thread blocked on critsec ntdll!ldrploaderlock+0 @ 774920c0 . 0:010> kb childebp retaddr args child 0fc4e034 773c8df4 000000d4 00000000 00000000 ntdll!ntwaitforsingleobject+0x15 0fc4e098 773c8cd8 00000000 00000000 773bfa84 ntdll!rtlpwaitoncriticalsection+0x13e 0fc4e0c0 773bffd3 774920c0 71e65850 00000001 ntdll!rtlentercriticalsection+0x150 0fc4e230 773bfd2f 00000001 00000001 00000000 ntdll!ldrgetdllhandleex+0x2f7 0fc4e24c 75dd1a43 00000001 00000000 0fc4e2bc ntdll!ldrgetdllhandle+0x18 warning: stack unwind information not available. following frames may wrong. 0fc4e2a0 75dd1c57 0fc4e2bc b7a43509 02baed94 kernelbase!getmodulefilenamew+0x1a9 0fc4e718 75dd1d52 00000001 00000002 02baed94 kernelbase!getmodulefilenamew+0x3bd 0fc4e730 5fc58fc5 02baed94 b108f787 7285ac08 kernelbase!getmodulehandlew+0x29 ... and critical section 774920c0 owned thread 1bd4 . 0:010> !locks critsec ntdll!ldrploaderlock+0 @ 774920c0 ...

javascript - Remove space between posts [bootstrap] -

Image
i need remove space between post without image , post below, here image, if post don't have image, below post should not have space: here code: <div class="container"> <div class="row"> <div class="col-sm-4 col-md-4"> <img src="http://placehold.it/460x250/e67e22/ffffff&text=html5" class="img-responsive" /> <div class="content"> <h4>naslov</h4> <p> lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. </p> </div> </div> <div class=...

xml - Blank line coming when i am using line feed -

my xml show below: <description> <longdescription>a</longdescription> <longdescription>b</longdescription> <longdescription>c</longdescription> </description> and desired output is: <description> <longdescription>a b c</longdescription> </description> i using below code fetch output: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="1.0"> <xsl:output omit-xml-declaration="no" indent="yes" /> <xsl:strip-space elements="*" /> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*" /> </xsl:copy> </xsl:template> <xsl:template match="description"> <xsl:copy> <xsl:apply-templates select="*[not(self::longdescr...

Android MediaPlayer does not loop when its data source is from url -

i using mediaplayer in app. following following tutorial http://blog.lemberg.co.uk/surface-view-playing-video here's part of code surface surface = new surface(surfacetexture); try { mmediaplayer = new mediaplayer(); mmediaplayer.setdatasource(getapplicationcontext(), uri.parse(file_url)); mmediaplayer.setsurface(surface); mmediaplayer.setlooping(true); mmediaplayer.prepareasync(); // play video when media source ready playback. mmediaplayer.setonpreparedlistener(new mediaplayer.onpreparedlistener() { @override public void onprepared(mediaplayer mediaplayer) { mediaplayer.start(); } }); } catch (illegalargumentexception e) { log.d(tag, e.getmessage()); } catch (securityexception e) { log.d(tag, e.getmessage()); } catch (illegalstateexception e) { log.d(tag, e.getmessage()); } catch (ioexception e) { log.d(tag, e.getmessage()); } everything works fine except video not loop. when set d...

Eclipse AVRDude Error - Mac OS X Yosemite -

i'm using eclipse indogo on mac os 10.10 , i'm tryig program avr atmega 16. while setting eclipse installed dependencies elcipse cdt, avr-elcipse plugin , crosspack avr development tools. when try add nex programmer configuration in eclipse->preferences->avrdude error: avrdude executable can not found. cannnot run avrdude executable. why this? seems there problem running avrdude on yosemite? you can change path eclipse ide uses execute avrdude. click on "paths" tab right below "avrdude", click on avrdude path, edit, choose custom. mine in "/usr/local/crosspack-avr/bin" , worked me.

ios - How do you show an UIAlertView above the Apple Pay PKPaymentAuthorizationViewController? -

using standard uialertview code below show alert underneath apple pay pkpaymentauthorizationviewcontroller sheet. [[[uialertview alloc] initwithtitle:@"payment error" message:[error localizeddescription] delegate:nil cancelbuttontitle:@"okay" otherbuttontitles:nil] show]; how can show above payment authorization sheet? or there different way of presenting error messages apple pay? want give specific error messages when user enters invalid shipping address. there's new callback in ios 11 public func paymentauthorizationcontroller(_ controller: pkpaymentauthorizationcontroller, didauthorizepayment payment: pkpayment, handler completion: (pkpaymentauthorizationresult) -> void) as can see, handler changes completion: (pkpaymentauthorizationstatus) -> void) to handler completion: (pkpaymentauthorizationresult) -> void) starting ios 11 stat...

windows - InstallShield Custom Action failing because user installing in 64-bit Program Files directory? -

i have 32-bit legacy application allows users specify install path part of setup (pretty normal stuff...). have custom action defined runs silent background install of required bit of software after initial installation complete. all when users install 32-bit program files (x86) directory. where running problems when users specify 64-bit installation directory, windows automagically changes install path in background use (x86) program files folder, fine, except custom actions use same installdir property after initial install finished still think should 64-bit "program files" path - install fails when custom action can't find exe file it's looking for. my program same 1 described here developer never resolved in forum: http://community.flexerasoftware.com/archive/index.php?t-216268.html does have clue valid workaround is? seems pretty basic installer should not fail because users think should install "c:\program files\appname" instead of "c:...

flash - It is possible to run cmd commands from swf? -

i have got vectorian giotto , flashdevelop , have idea of creating interactive wallpaper (ex., desktop without icons, click on barrel , context menu appears, click on spaceship , "my computer" folder opens). i found out possible make wallpaper windows in swf converted html . however, have no idea how run cmd commands ( after example clicking spaceship :: runs cd "d:\doc\intro.exe" ) events in swf button. i'm new in flash , know java,c#,c++ ... sorry english

rest - Sessions in a RESTful API -

this question has answer here: do sessions violate restfulness? 6 answers i reading on rest, , 1 of specifications of rest should stateless, , every request should contain necessary state in url or body of request. contrasts practice of using sessions, helpful maintaining information whether user logged in or not. so, if 1 wants design restful api, should sessions avoided? well, yes, @ least on server side. that' in fact, kind of point of rest: representational state transfer. making sure needed state information contained in state being transfered on http, , eliminating server-side session state, makes possible build scaleable, expandable ends. back in old days had worry session state, maintaining sessions, keepalive connections, state-sensitive load-balancing, , on , on. rest, that's eliminated. so now, here's pop quiz: how maintain state...

dynamic - Can I access a control by the last portion of its ID in jQuery? -

i have dynamically-created control gave id "ckbxemp" as discovered "viewing source," sharepoint (or chrome, or "somebody") impertinently , presumptuously re-ids (and names it, , "for"s it) control, giving welsh-esque "ctl00_ctl24_g_1caf4ad1_092d_4224_bd10_28ab028aab50_ctl00_ckbxemp" and (i assume reason), attempts manipulate "ckbxemp" via jquery fail - say, when short id gave it, so: $(document).on("change", '#ckbxemp', function () { console.log('function has been reached'); if ($(this).is(":checked")) { alert("checked"); } else { alert("not checked"); } }); so can either change code this: $(document).on("change", '#ctl00_ctl24_g_1caf4ad1_092d_4224_bd10_28ab028aab50_ctl00_ckbxemp', function () { console.log('function has been reached'); if ($(this).is(":checked")) { alert(...

c# - Image doesn't appear when changing its source in Windows Phone -

when want change image's source, image disappears. the code i'm using: tactimg.source=tactimglist[i]; tactimglist = new bitmapimage[32]; tactimglist[0] = new bitmapimage(new uri("ms-appx:///assets/images/1.png", urikind.absolute)); what doing wrong? there need add xaml file or i'm making global array wrong? you don't need use ms-appx in windows phone 8 projects , it's winrt projects. make sure image's build type content , remove ms-appx part , since image has relative uri , set urikind relative.

R, subtract value from previous row, group by -

in r, lets have data. data id date value 2380 10/30/12 21.01 2380 10/31/12 22.04 2380 11/1/12 22.65 2380 11/2/12 23.11 20100 10/30/12 35.21 20100 10/31/12 37.07 20100 11/1/12 38.17 20100 11/2/12 38.97 20103 10/30/12 57.98 20103 10/31/12 60.83 and want subtract previous value of value grouped id (in order date), create this: id date value diff 2380 10/30/12 21.01 0 2380 10/31/12 22.04 1.03 2380 11/1/12 22.65 0.61 2380 11/2/12 23.11 0.46 20100 10/30/12 35.21 0 20100 10/31/12 37.07 1.86 20100 11/1/12 38.17 1.1 20100 11/2/12 38.97 0.8 20103 10/30/12 57.98 0 20103 10/31/12 60.83 2.85 you can ave function: data$diff <- ave(data$value, data$id, fun=function(x) c(0, diff(x))) data # id date value diff # 1 2380 2012-10-30 00:15:51 21.01 0.00 # 2 2380 2012-10-31 00:31:03 22.04 1.03 # 3 ...

powershell - Convert Distinguished Name to SamAccountName without Get-ADUser -

my machines have original build of powershell v2.0, get-aduser not work. trying convert manager property it's distinguishedname it's samaccountname . $searcher = [adsisearcher]"(samaccountname=$env:username)" $searcher.findone().properties.manager this works if had get-aduser : (get-aduser (get-aduser $user -properties manager).manager).samaccountname grabbed get-aduser statement here.. $ads_escapedmode_on = 2 $ads_settype_dn = 4 $ads_format_x500_dn = 7 $pathname = new-object -comobject "pathname" [void] $pathname.gettype().invokemember("escapedmode", "setproperty", $null, $pathname, $ads_escapedmode_on) $searcher = [adsisearcher] "(samaccountname=$env:username)" $managerdn = $searcher.findone().properties["manager"] if ( $managerdn ) { [void] $pathname.gettype().invokemember("set", "invokemethod", $null, $pathname, @($managerdn[0], $ads_settype_dn)) $escapeddn = $pat...

ruby on rails - Form automatically renders create action -

my index page loads fine. have in view: <%= form_tag('tickets') %> <%= select_tag 'filter', options_from_collection_for_select(user.all, 'id', 'full_name'), include_blank: true, class: 'form-control' %> <%= submit_tag 'filter', class: "btn btn-default" %> <% end %> here controller: def index tickets = ticket.all @tickets_by_date = tickets.group_by(&:start_date) @date = params[:date] ? date.parse(params[:date]) : date.today end def create @ticket = ticket.new(ticket_params) if @ticket.save redirect_to tickets_path else render 'tickets/new' end end def ticket_params params.require(:ticket).permit(:name, :summary, :creator_id, :start_date, :end_date, :customer_id, :status_id, :priority_id, :type_id, :assignee_id) end when click on submit of filter form on index field, error: actioncontroller::parametermissing in ticketscontroller#create param missing o...

How do I create a pop-up Android Fragment that takes in a text input before returning to my main activity? -

for app, want user able press "change user" button, have fragment pop-up, take in text input, , save shared preferences upon exit, returning activity called from. i methodology similar timepicker fragment have implemented, post @ end of this. i using tutorial guide: dialog fragment tutorial here dialog fragment class: public class editnamedialog extends dialogfragment { private edittext medittext; public editnamedialog() { // empty constructor required dialogfragment } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.fragment_edit_name, container); getdialog().settitle("hello"); return view; } public boolean oneditoraction(textview v, int actionid, keyevent event) { return true; } } here mainactivity calls it: public class mainactivity extends activity implements ...

R: How do I loop through spatial points with a specific buffer? -

so problem quite difficult describe hope can make question clear possible. use rlidar package load .las file r , afterwards convert spatialpointsdataframe using sp package . spatialpointsdataframe quite dense. now want define buffer of 0.5 meters , loop (iterate) him (the buffer) through points, choosing point highest z value within buffer, next point jump to.this should repeated until there isn't point within buffer higher z value current. all values (or perhaps x , y values) of "found" point should written list/dataframe , process should repeated until such highest points found. thats code got far: >library(rlidar) >library(sp) >rlas<-readlas("test.las",short=false) >pointcloud<- data.frame(rlas) >coordinates(pointcloud) <- c("x", "y") well googled extensively not find clues how proceed further... dont know packages of help, guess perhaps spatstat question go spatial point pattern analysis. have id...

ASP.NET 4 Webforms Bundle error in content pages -

here´s deal. i´m using bundling in webforms site , works charm in master page. when inspect file in browser, shows js , css files minified , bundled. but when other bundling, return entire site inside bundled file? something this. "<%: styles.render("~/bundles-css/master") %>" "<%: styles.render("~/bundles-css/home") %>" the first works , second returns whole html page inside of it. i not post images of code difference :( . help. dammit! dumb thing confusing bundle name. i changed "<%: styles.render("~/bundles-css/home") %>" "<%: styles.render("~/bundles-css/intern") %>" , worked! :/. i believe confusing of aspx files. :/

blade - Extracting content from .txt files in Laravel php framework -

i relatively new laravel , building online taxonomic guide coral species. each of 300 species have separate page in turn show images , have descriptive section (1-2 paragraphs long). in past have handled chunks of text entry in csv file upload phpmyadmin. 1 problem .csv file 300 entries of 1-2 paragraphs each slow scroll through in excel. my question is: in case better have description in separate .txt files, include .txt files in phpmyadmin , write script call each text file? advice on how in laravel appreciated! if you, ditch idea of managing data outside of system. laravel comes enough authentication system, why not create protected page in can update data directly database? take @ simple crud project . crud stands create, replace, update, , delete.

function - jquery how to access / modify a element in object -

i use library (hideshare, https://github.com/arnonate/hideshare ) inserts social sharing links in page. build object, have modify value parameters after creation (so have have access elements , modify them). here code of function: ;(function(window, $) { "use strict"; // hideshare public class definition // ================================= var hideshare = function (elem, options) { this.elem = elem; this.$elem = $(elem); this.options = options; }; hideshare.prototype = { defaults: { link: document.url, title: document.title, description: '', media: null }, init: function() { this.config = $.extend({}, this.defaults, this.options); this.wraphideshare(); return this; }, wraphideshare: function() { var output = output, sharetitle = this.config.title, sharelink = this.config.link, sharemedia = this.config.media, sharedescription = this.config.description; } }; hideshare.defaults = hideshare.prototype.defaults...

sql - Returning highest DATETIME from row with particular column data -

Image
i trying select highest datetime specific request code: this query i'm using: select submittime [qtraxadmin].[qt_request] submittime in (select max(submittime) [qtraxadmin].[qt_request]) , requestcode = 'foreman'; my issue query above returns nothing. think it's doing it's finding highest datetime in submittime column not belong foreman request code. how can return latest submittime specific request code? i think can select this, if of course times don't repeat within requestcode : select max(submittime) [qtraxadmin].[qt_request] requestcode = 'foreman';

php - How to fix JHtmlBehavior::formvalidator not found -

i tried upgrade joomla 3.3.6 joomla 3.4.1. see error when try go admin configuration page "jhtmlbehavior::formvalidator not found". how fix it? try using following replace code shown in question jhtml::_('behavior.formvalidator'); which specified in joomla documentation.

ruby on rails - Overlay not showing -

i trying overlay png of signature(has transparent background) onto png of form. when try composite 2 images , render output form png , annotations shown. can render out of various images changing send_data know images there. def index img = magick::image.read('public/form_template.png').first form = magick::draw.new form.annotate(img,300,400,90,30,"test") self.font = 'helvetica' self.pointsize = 50 self.font_weight = magick::boldweight self.fill = 'black' self.gravity = magick::northwestgravity end form.annotate(img,300,400,2000,30,"1234567890") self.font = 'helvetica' self.pointsize = 50 self.font_weight = magick::boldweight self.fill = 'black' self.gravity = magick::northwestgravity end sig = magick::image.read("public/uploads/signature.png").first sig.trim sig_finished = sig.resize(175,50) finished_form = im...

python - Getting the following error: "EnvironmentError: Unable to find libfuse" -

i'm trying load test mqtt network on centos7 machine using this repositorie on github. executed following commands install python-mosquitto dependency. # yum install python-pip # pip install mosquitto then built , installed setup.py file located in repository file: # python setup.py build # python setup.py install when trying use package, error thrown: # malaria publish -p 2 -n 100 -h localhost -s 10 error: # malaria publish -p 2 -n 100 -h localhost -s 10malaria publish -p 2 -n 100 -h localhost -s 10 traceback (most recent call last): file "/usr/bin/malaria", line 5, in <module> pkg_resources.run_script('mqtt-malaria==0.1-77-g7ae4c97', 'malaria') file "/usr/lib/python2.7/site-packages/pkg_resources.py", line 540, in run_script self.require(requires)[0].run_script(script_name, ns) file "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1455, in run_script execfile(script_filename, namespace,...

javascript - Reduce AJAX request size. Simple chat with Polling system -

notice: replaced polling system websockets i still want know answer questions above. i'm trying reduce ajax request of traditional-polling message system, don't know how it: $chatbox = $("#chatbox"); setinterval(function(){ // send sha1 of chatbox html content verify changes. $.post("post.php", {checksum: hex_sha1($chatbox.html())}, function (data, status) { switch (status) { case "success": // if version of "post.php" checksum different mine (there changes) data isn't empty; assign data new content of chatbox. if(data){ $chatbox.html(data); $chatbox.scrolltop($chatbox[0].scrollheight); } break; default: $chatbox.html('connection error...'); break; } }); }, 1000); we...

android - how to change file encoding correctly -

Image
i opened android studio, 1 file looks this: but yesterday everythings works great , haven't change file encoding. tried convert file other encodings. nothing changes. these settings: here link file: file how fix it? thanks helping filename looks german. try change encoding iso-8859-1. easier if upload file.

r - Different pander performance between .Rmd and .Rnw -

i'm having trouble getting pander work same way in .rnw file in .rmd file. in both, i'm using knitr weave pdf. .rmd file looks --- title: "my title" output: pdf_document --- ```{r} library(pander) panderoptions('big.mark', ',') panderoptions('table.style','rmarkdown') panderoptions('table.alignment.default','right') panderoptions('table.alignment.rownames','left') panderoptions('digits','10') df <- data.frame('a' = 1:3, 'b' = 4:6, 'c' = 7:9) pander(df) ``` the dataframe looks nice in output converts dashed lines solid ones. when try similar in .rnw file, printed if sentence rather table. \documentclass{article} \begin{document} <<model_data>>= library(pander) panderoptions('big.mark', ',') panderoptions('table.style','rmarkdown') panderoptions('table.alignment.default','right') panderoptions...

google now - "Now on Tap" feature test on emulator Android -

since google announces "now on tap" feature contextual search different app, in m developer preview wanted test out feature. have updated emulator (using genymotion) m. not able test this. anyone has idea it? we told in google i|o presentations on tap not part of m developer preview, @ least @ time.

c# - Using A ContextMenuStrip On A ComboBox -

Image
update: it seems works fine in different way imagined would. if create simple project combobox1 , contextmenustrip1 use settings show in image below display context menu created in text area of dropdown fine. expected show dropdown menu in list area (with list items) of dropdown. note: goal here context menu ("remove item") show on top of list item (such "test2"). i don't know why i'm getting hung on trivial has stumped me bit now. i'm doing stupid , can't see i'm doing wrong. goal simple... via design gui, create combobox object , contextmenustrip object. want contextmenustrip object pop when right click on combobox. i thought creating combobox object choosing correct contextmenustrip object on contextmenustrip property work. seems there more it. what doing wrong? this not easy seems. because created dropdownlist native listbox window created dynamically. access listbox have send "cb_getcomboboxinfo"...

javascript - $watch is not being hit in Angular's directive when a checkbox's value is changed -

i have directive setup this. angular.module('app') .directive('bootstrapcheck', function () { return { restrict: 'a', require: '?ngmodel', link: function (scope, element, attrs, ngmodel) { $.getscript("../../scripts/js/checkboxfunctions.js", function () { }); scope.$watch(attrs.ngmodel, function (newvalue, oldvalue) { //debugger; }); } }; }); and it's html looks <section id="dashboard-view" data-ng-controller="dashboard vm"> <input type="checkbox" ng-model="vm.my.bool.prop" ng-checked="vm.my.bool.prop" bootstrap-check> </section> and property setup this var vm = this; vm.my = { bool: { prop: true } }; it seems check-box bound property. whenever click check-box expect hit debugger not working. i think don't have jquery loaded on page $.getscript throwing ex...

matlab - Probabilities of bivariate normally distributed random variable -

i'm trying calculate probability of bivariate normal distribution on specific area using matlab. lets assume random variable follows standard normal distribution , want calculate mass of unit circle. i used following code: fun = @(x,y) exp(-0.5*(x.^2+y.^2))/(2*pi); ymin = @(x) -sqrt(1-(x.^2)); ymax = @(x) sqrt(1-(x.^2)); integral2(fun,-1,1,ymin,ymax) i 0.3935. i'm wondering result correct. can confirm result correct or point on mistake made? i think correct. checks: integrate on large square , see if result 1 : >> integral2(fun,-5,5,-5,5) ans = 0.999998853581851 the 90-percentile of univariate gaussian distribution is >> norminv(.9) ans = 1.281551565544601 so, integral of function on [−∞,∞] × [−∞,1.281] should 0.9 : >> integral2(fun,-10,10,-10,norminv(.9)) ans = 0.900000750806316 the definitive, monte carlo check: >> n = 1e6; x = randn(1,n); y = randn(1,n); mean((x>-1)&(x<1)&(y>-sqrt(1-(x....

java - Trying to add multiple JPanels into one main JPanel and set the border layout -

Image
i working on building atm machine , having trouble setting borderlayout of multiple jpanels. trying make picture along lines of but when run it looks this: here code how trying this. public main() { try { atmpicture = imageio.read(new file("atmpicture.jpg")); welcomescreen = imageio.read(new file("welcome screen.jpg")); enteraccscreen = imageio.read(new file("account number.jpg")); mainbuttons = imageio.read(new file("main screen.jpg")); withdrawscreen = imageio.read(new file("r2 click.jpg")); depositscreen = imageio.read(new file("r3 click.jpg")); transferscreen = imageio.read(new file("r4 click.jpg")); accinfoscreen = imageio.read(new file("l1 click.jpg")); withdrawscreen2 = imageio.read(new file("r2.2 click.jpg")); } catch (ioexception ex) { system.out.println("the file cannot read2...

python - Page not found in Django -

Image
i'm following this tutorial learn django. i'm total starter. urls.py file has following code from django.conf.urls import include, url django.contrib import admin . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^polls/', include('polls.urls')), url(r'^admin/', include(admin.site.urls)), ] my views.py file is from django.shortcuts import render def index(request): return httpresponse("hello, world. you're @ polls index.") when try access th url http://127.0.0.1:8000/polls/ in system gives page not found message. doing wrong? problem version difference? here screenshot of error this error comes if urls.py file in polls directory not have pattern. create file urls.py polls directory , add following url pattern from django.conf.urls import patterns, url polls import views urlpatterns = patterns('', # ex: /polls/ url(r'^$', views.index, name=...

ruby on rails - RSpec: Shared examples for Validators? -

i have several models have start_time , end_time , have custom validator has special rules these fields. testing, feel i've got 3 options: have validator , validator_spec . re-test entire implementation of validators in every model ensure validator working model. have validator , validator_spec . in each model, somehow check already-tested validator being included in model. (maybe means testing 1 condition arise validator being included.) creating shared example validator test, , include in each model's test (although it_behaves_like somevalidator looks kind of weird) any thoughts? validator has several conditions i'd find taxes , not dry implement #1. i propose option: 4.) implement validator_spec , build custom matcher can reused in every model using validator maybe can find inspiration @ https://github.com/thoughtbot/shoulda-matchers

Get Audio Files From Dropbox iOS Core API -

i need list audio files user's dropbox. configured app on developer console have corresponding permissions. authenticated user, can retrieve directories want method goes every folder , list audiofiles can find. method have 3 concerns. the method kind of slow (recursive) i getting 2 random errors (probably due multiple request per second) listing random folder. 2015-06-02 12:44:52.634 podbox[9038:2918749] error loading metadata: error domain=dropbox.com code=503 "the operation couldn’t completed. (dropbox.com error 503.)" userinfo=0x170270780 {path=/ios dev/passbook/signpass/signpass.xcodeproj/xcuserdata/gsteele.xcuserdatad, error=rate limiting oauth_accesses_per_access_token} accessing music 2015-06-02 12:44:32.665 podbox[9038:2918749] error loading metadata: error domain=nsurlerrordomain code=-1001 "the operation couldn’t completed. (nsurlerrordomain error -1001.)" userinfo=0x17047cf00 {path=/music/blink 182/unknown album} i know im ...

php - Symlinking issues leading to file not found -

in home directory have laravel project folder: /home /user /project /public <--------. index.php | /bootstrap | autoload.php | /config | /public | /src | /http | /project (softlink here) in project/public/index.php have this: require __dir__.'/../bootstrap/autoload.php'; i soft-linked apache public folder public folder in user directory: $ ln -s /home/user/project/public /srv/http/project so should able open localhost/project . 500 internal server error. here relevant log apache: $ cat /var/log/httpd/error_log [tue jun 02 2015] [:error] php warning: require(/home/user/project/config/public/../bootstrap/autoload.php): failed open stream: no such file or directory in /home/user/project/config/public/index.php on line 21, referer: http://localhost/project/ [tue jun 02 2015] [:error] php fatal error: require(): f...

node.js - How to check before updating an array element in MongoDB/NodeJS -

in sample document, have campaign document contains _id of document , importdata array. importdata array of objects containing unique date , source value. my goal have object updated unique date/source pair. have new object replace matching object. in example below, fred may have donated tv, want application update object reflect donated both tv , radio. // events (sample document) { "_id" : "junky joe's jubilee", "importdata" : [ { "date": "2015-05-31", "source": "fred", "items": [ {item: "tv", value: 20.00}, {item: "radio", value: 5.34} ] }, { "date": "2015-05-31", "source": "mary", "items": [ {item: "dresser", value: 225.00} ] } ] } my original thought code below, not updating importdata fred's donations, i'm bl...

java - Unable to load bean using Struts convention plugin -

i want use annotation based config instead of xml based. struts has convention plugin kind of thing. so removed struts.xml file in main/resources , added plugin dependency, put annotations on actions , tried run project on server (tomcat 7). when server starts, next stacktrace: unable load configuration. - bean - jar:file:/d:/eclipseworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/shop/web-inf/lib/struts2-convention-plugin-2.3.24.jar!/struts-plugin.xml:32:155 @ com.opensymphony.xwork2.config.configurationmanager.getconfiguration(configurationmanager.java:70) @ org.apache.struts2.dispatcher.dispatcher.getcontainer(dispatcher.java:967) @ org.apache.struts2.dispatcher.dispatcher.init_preloadconfiguration(dispatcher.java:435) @ org.apache.struts2.dispatcher.dispatcher.init(dispatcher.java:479) @ org.apache.struts2.dispatcher.ng.initoperations.initdispatcher(initoperations.java:74) @ org.apache.struts2.dispatcher.ng.filter.strutspr...