Posts

Showing posts from January, 2015

ios - Share text to Facebook Objective-C -

i'm trying share text on facebook via ios application. i've managed working in swift written application this: @ibaction func shareaction(sender: anyobject) { if slcomposeviewcontroller.isavailableforservicetype(slservicetypefacebook){ var facebooksheet:slcomposeviewcontroller = slcomposeviewcontroller(forservicetype: slservicetypefacebook) facebooksheet.setinitialtext("preadded text") self.presentviewcontroller(facebooksheet, animated: true, completion: nil) } else { var alert = uialertcontroller(title: "accounts", message: "please login facebook account share.", preferredstyle: uialertcontrollerstyle.alert) alert.addaction(uialertaction(title: "ok", style: uialertactionstyle.default, handler: nil)) self.presentviewcontroller(alert, animated: true, completion: nil) } } however, code written in objective-c. question is, there similar way of writing in objective-c? you can achieve implementing s...

javascript - GeoIP redirect - loading after DOM ready -

the javascript below redirects based on geoip : <script type="text/javascript"> var script = document.createelement('script'); script.src = "//freegeoip.net/json/?callback=nygeoip"; document.getelementsbytagname('head')[0].appendchild(script); function nygeoip(d) { if (d.country_code === 'xx') { window.location = 'http://www.domain.com'; } } </script> can please let me know how amend code calls freegeoip server after dom ready (after page load). the freegeoip server not respond blocks page rendering , , tools such gtmetrix/webpagetest show loading times of 1-2 minutes when freegeoip server not responding. include jquery library , use document ready function: <script type="text/javascript"> $(document).ready(function(){ var script = document.createelement('script'); script.src = ...

python - re.match takes a long time to finish -

i new python , have written following code runs slow. i have debugged code , found out last re.match() causing code run slow. though previous match same kind of match against same dataframe, comes quickly. here code: my_cells = pd.read_csv('somefile',index_col = 'gene/cell line(row)').t my_cells_others = pd.dataframe(index=my_cells.index,columns=[col col in my_cells if re.match('.*\scn$|.*\smut$|^bladder$|^blood$|^bone$|^breast$|^cns$|^gi tract$|^kidney$|^lung$|^other$|^ovary$|^pancreas$|^skin$|^soft tissue$|^thyroid$|^upper aerodigestive$|^uterus$',col)]) my_cells_genes = pd.dataframe(index=my_cells.index,columns=[col col in my_cells if re.match('.*\scn$|.*\smut$|^bladder$|^blood$|^bone$|^breast$|^cns$|^gi tract$|^kidney$|^lung$|^other$|^ovary$|^pancreas$|^skin$|^soft tissue$|^thyroid$|^upper aerodigestive$|^uterus$',col) none ]) col in my_cells.columns: if re.match('.*\scn$|.*\smut$|^bladder$|^blood$|^bone$|^breast$|^cns$|^gi tract$|...

ios - UIBezierPath path's intersection -

Image
i trying determine if uibezierpath draw intersects one. if path.containspoint(touchpoint){ println("captured \(touchpoint) ") } however, containspoint(cgpoint:) doesn't work me, because returns true if the point considered within path’s enclosed area or false if not . just provide graphical example, returns true (i'm drawing dashed path): so question is: how can check if touchpoint belongs uibezierpath , in sense hits specific point of path? thanks in advance if touch point want determine lies within stroke of bezier path or not can use cgpathcreatecopybystrokingpath create closed path version of original open path trying hit test. newly created closed path can use containspoint method check. the technique described in blog post in detail. http://oleb.net/blog/2012/02/cgpath-hit-testing/ you may need expand width of copied stroke allow fat fingers. in blog post, example, makes hit test path @ least 35 point...

php - Form writing to mysql database -

i'm working on writing form database, still beginner. attempted form show below seems give me errors. if me find out wrong php code great. in advance: my form.php <form method="post" action="db.php" name="overrideform" id="overrideform" autocomplete="on"> <fieldset> <legend>contact details</legend> <div> <label for="name" accesskey="n">first name</label> <input name="name" type="text" id="name" required /> </div> <div> <label for="mname" accesskey="m">middle name</label> <input name="mname" type="text" id="mname" required /> </div> <div> <label for="fname" accesskey="f">last name</label> ...

linq query 'orderby' using multiple fields at SQLite plugin by MvvmCross doesn't work -

the query following: var query = c in _db.table<contact>() c.firstname.contains("alex") orderby c.priority, c.firstname, c.lastname select c; is limitation of sqlite, mvvmcross plugin? should go .syntax result? error cs1936: implementation of `thenby' query expression pattern source type `cirrious.mvvmcross.community.plugins.sqlite.itablequery<contact>' not found (cs1936) i able handle specifying mutiple orderby methods: var res = _db.table<contact>() .where(c=> c.....) .orderby(c => c.priority) .orderby(c => c.firstname) .orderby(c => c.lastname) .select(c=> c) .tolist(); translated sqlite query: select * "contact" ... order "priority", "firstname", "lastname" hope helped

javascript - Change the Arrow buttons in Slick slider -

i want change arrows in slick slider not change. want next , previous button image. have tried putting in <style> still not working. can change arrows setting? slick theme css @charset "utf-8"; // default variables $slick-font-path: "./fonts/" !default; $slick-font-family: "slick" !default; $slick-loader-path: "./" !default; $slick-arrow-color: white !default; $slick-dot-color: black !default; $slick-dot-color-active: $slick-dot-color !default; $slick-prev-character: "←" !default; $slick-next-character: "→" !default; $slick-dot-character: "•" !default; $slick-dot-size: 6px !default; $slick-opacity-default: 0.75 !default; $slick-opacity-on-hover: 1 !default; $slick-opacity-not-active: 0.25 !default; @function slick-image-url($url) { @if function-exists(image-url) { @return image-url($url); } @else { @return url($slick-loader-path + $url); } } @function slick-font-...

javascript - angular-dashboard-framework Sortable.create return undefined -

i'm trying run source code of angular-dashboard-framework demo ( https://github.com/sdorra/angular-dashboard-framework/tree/master/sample ) i'm getting following error: sortable.create function returns undefined.

javascript - How to add WordPress jQuery library to frontend -

i'm using below method inside wordpress admin use jquery library , working fine , don't need add source jquery library method. <script> jquery(document).ready(function(){ // works inside wordpress admin without source }); </script> but same method not work on front end wordpress form , make work i've add source of library? <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> jquery(document).ready(function(){ // need add jquery source }); </script> why need add source of jquery library frontend? how can load wordpress jquery library frontend? it works in admin, because there admin scripts have jquery dependency , wordpress includes jquery in order scripts work. you should use wp_enqueue_script() function when adding scripts (not including them in scripts tags). notice $deps...

asp.net mvc - Model binding doesn't work when multiple instances of the same partial view are called dynamically with ajax.actionlink in MVC 5 -

i'm building restaurant reservations system. when user creates reservation can decided furniture used reservation. created partial view, every time user click on "add furniture" partial view loaded ajax user can specify furniture , how many. can add many types of furniture want, meaning can call partial view many times want. problem comes in model binder, model binder have bind partial view instances list object of type "bistroreservations_reservationsfurniture". please how make model binder work. mainview (please have @ bottom ajax.actionlink call "add furniture" @using (html.beginform()) { @html.antiforgerytoken() <div class="form-horizontal"> <h4>bistroreservations_reservation</h4> <hr /> @html.validationsummary(true, "", new { @class = "text-danger" }) <div class="form-group"> @html.labelfor(model => model.dateofarrival, htmlattributes...

php - Laravel 5 pretty URL not working on wamp -

i new laravel, working on small project, using wamp. facing problem pretty url part, figured out now. but getting weird issue. have created application under directory laravel-first-app . when trying request page (articles) example, http://localhost/laravel-first-app/public/index.php/cv , showing page. but if, request page example, http://localhost/laravel-first-app/public/cv , saying url not found error. below brief description did. in routes.php route::get('/', 'welcomecontroller@index'); route::controllers([ 'auth' => 'auth\authcontroller', 'password' => 'auth\passwordcontroller', ]); route::resource('articles','articlescontroller'); route::get('articles/delete/{article_id}','articlescontroller@destroy'); route::get('cv','cvcontroller@index'); route::get('cv/upload','cvcontroller@upload'); route::post('cv','cvcontroller@store...

java - Reference comparison using == operator -

this question has answer here: using == operator in java compare wrapper objects 7 answers public class autoboxingandunboxing { public static void main(string[] args) { integer x = 127; integer y = 127; system.out.println(x == y);//true integer = 128; integer b = 128; system.out.println(a == b);//false system.out.println(a); // prints 128 } } how come x==y true , a==b false? if based on value( integer -128 127 ) 'a' should print -128 right? when comparing integer objects, == operator might work numbers between [-128,127]. @ jls : if value p being boxed true, false, byte, or char in range \u0000 \u007f, or int or short number between -128 , 127 (inclusive), let r1 , r2 results of 2 boxing conversions of p. case r1 == r2. since values you're comparing not i...

excel - Auto Fill Column -

i have started use vba. wanted know how fill column starting range("k5") , value taken combobox1 . example: if range("k5") = 22 range("k6") = 23 ... final number value of combobox2 . this code now... dim temperature_1 integer 'from temperature_1 dim temperature_2 integer 'to temperature_2 dim k integer dim l integer dim range_degrees integer temperature_1 = sheet1.combobox1 temperature_2 = sheet1.combobox2 range_degrees = temperature_2 - temperature_1 k = range("k5") range_degrees l = temperature_1 temperature_2 ...... next l next k if wish 'auto fill' column, populate start of range , fill series. with activesheet .range("k5") = temperature_1 .range("k5").dataseries rowcol:=xlcolumns, type:=xllinear, step:=1, stop:=temperature_2, trend:=false end if wanted ...

python - How to resolve the following error in Django(1.4.2) -

am getting following error: traceback (most recent call last): file "manage.py", line 11, in <module> execute_manager(settings) file "c:\users\blue\anaconda\lib\site-packages\django\core\management\__init__.py", line 459, in execute_manager utility.execute() file "c:\users\blue\anaconda\lib\site-packages\django\core\management\__init__.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "c:\users\blue\anaconda\lib\site-packages\django\core\management\base.py", line 196, in run_from_argv self.execute(*args, **options.__dict__) file "c:\users\blue\anaconda\lib\site-packages\django\core\management\base.py", line 232, in execute output = self.handle(*args, **options) file "c:\users\blue\anaconda\lib\site-packages\django\core\management\base.py", line 371, in handle return self.handle_noargs(**options) file "c:\users\blue\anaconda\lib\site-packages\django\core\management\commands\...

terminal - python - open file in application -

i using terminal sucsessfully open file in quicktime player 7, can't seem working using python same thing. working terminal: open -a "quicktime player 7" /users/me/movies/test.mov but not working in python 2.7, opens quicktime, not file: command = ('open -a "quicktime player 7"', 'users/me/movies/test.mov') subprocess.popen(command, shell=true) what doing wrong? if pass command list / tuple , have split arguments correctly: command = ('open', '-a', 'quicktime player 7', '/users/me/movies/test.mov') subprocess.popen(command, shell=true) then think should able drop shell=true parameter. further, subprocess.call() or subprocess.check_call() (the former returns return value of program, latter raises exception if return value indicates error): subprocess.check_call(['open', '-a', 'quicktime player 7', '/users/me/movies/test.mov']) nb: coding-style-wise, co...

android notification only sound plays notification is not shown in notification drawer -

i trying fire notification in @ particular time using alarmmanager , notification manager. facing strange problem. when notification fired sound plays notification not shown in notification drawer. got error in log 04-26 11:32:09.217 1222-1222/? e/notificationservice﹕ warning: in future release crash app: com.example.shiv.selftweak my code . the class calls alarmmanager intent intent1 = new intent(this, firenotification.class); pendingintent pendingintent = pendingintent.getservice(this, 1000, intent1, 0); alarmmanager = (alarmmanager)this.getsystemservice(alarm_service); am.set(alarmmanager.rtc_wakeup,system.currenttimemillis(), pendingintent); firenotification class public class firenotification extends service { @override public void oncreate() { intent intent = new intent(this, mainactivity.class); long[] pattern = {0, 300, 0}; pendingintent pi = pendingintent.getactivity(this, 1234, intent, 0); ...

.net - Could not load file or assembly '***.dll' or one of its dependencies -

i have dll created long time ago , use connect db of specific software develop for. have had no issues on 4 years , countless applications dll. trying deploy latest creation, following error: system.io.filenotfoundexception: not load file or assembly '***.dll' or 1 of dependencies. specified module not found. so, every dll ever wrote, made simple forms application test dll itself. running simple app yielded same error. dll doesn't load or use else than: system, system.data, system.xml. far depencies of go, don't see wrong. by way works on dev station. problem limited deployment stations. .net , necessary redistributables, since in c++, deployed , working. running fuslogvw.exe showed working fine. running depends.exe said: warning: @ least 1 module has unresolved import due missing export function in delay-load dependent module. i tried rewriting whole thing. yielded same results. clues anyone? edits here total error message: see end of message ...

javascript - Is there a way to load data into script -

so in angular i'm trying do $scope.data = "<script> alert('hi'); </script>"; but unfortunately doesn't work. tried add ng-bind-html without results. {{data}} also tried load data in script tag seems not work. there way avoid all? example $scope.data = "bob"; - <script> var name = {{data}}; </script> you create directive load script dom dynamically. markup <load-script ng-if="data" data="data"></load-script> directive app.directive('loadscript', function($compile){ return { restrict: 'e', scope: { 'data': '=' }, link: function(scope, element, attrs){ element.append($compile(scope.data)(scope)) } } }) working plunkr

rank - kruskal-wallis contrast test in r -

all, i perform equivalent of tukeyhsd on rank ordering median shift test such kruskal wallis x=matrix(c(1,1,1,1,2,2,2,4,4,4,4,4,1,3,6,9,4,6,8,10,1,2,1,3),ncol=2) anova=aov(x[,2]~factor(x[,1])) tukeyhsd(anova) ## tukey multiple comparisons of means ## 95% family-wise confidence level ## ## fit: aov(formula = x[, 2] ~ factor(x[, 1])) ## ## $`factor(x[, 1])` ## diff lwr upr p adj ## 2-1 1.25 -5.927068 8.427068 0.8794664 ## 4-1 -1.35 -7.653691 4.953691 0.8246844 ## 4-2 -2.60 -9.462589 4.262589 0.5617125 kruskal.test(x[,2]~factor(x[,1])) ## ## kruskal-wallis rank sum test ## ## data: x[, 2] factor(x[, 1]) ## kruskal-wallis chi-squared = 1.7325, df = 2, p-value = 0.4205 i analyze contrasts. please help. thanks. rik if want multiple comparisons after kruskal-wallis test, need kruskalmc function pgirmess package. before can implement function, need transform matrix dataframe. in example: # convert matrix dataframe dfx <- as.data.frame(x) # kruskal-wallis test & o...

javascript - EnumDropDownListFor Change ajax call action and the selected value assign to one field of database -

i want update vazlist in database record it's enumdropdownlistfor item has been changed. want selected value assigned vazlist of record. @using (html.beginform("index", "my", formmethod.post)) { <p> @html.actionlink("create new", "create") </p> <table class="table"> <tr> <th> @html.displaynamefor(model => model.name) </th> <th> @html.displaynamefor(model => model.lastname) </th> <th> @html.displaynamefor(model => model.nationalidnumber) </th> <th> @html.displaynamefor(model => model.cellphonenumber) </th> <th> @html.displaynamefor(model => model.emailaddress) </th> <th> @html.displaynamefor(model => model.vahedlist) </th> <...

osx - How to get the device token of a mac? -

Image
i using pushwoosh solution present , send notifications webpage mac users. i set computer test device check , test notifications. to this, pushwoosh wants me device token of mac. how , can it? here can see screen of pushwoosh: this paragraph in "notification programming guide websites" documentation seems potentially useful: to check permission level user has set website, call window.safari.pushnotification.permission() website push id argument. synchronous call returns permission object given identifier looking in user’s preferences. function not contact server. one of items passed in permission object structure devicetoken , appears looking for.

android - Universal Image Loader - Use same image in multiple views -

i'm using universal image loader load images backend display user images in list; however, if icon shows multiple times, universal image loader doesn't fill out views. [user image 1] - no image [user image 1] - no image [user image 2] - fine [user image 2] - no image [user image 3] - fine [user image 1] - fine and on screen: [user image 1] - fine [user image 1] - no image i'm using cacheinmemory , cacheondisk, seemed improve it. before displaying in 1 of views, instead of most, need of them work. displayimageoptions defaultoptions = new displayimageoptions.builder() .cacheinmemory( true ) .cacheondisk( true ) .build(); imageloaderconfiguration config = new imageloaderconfiguration.builder( ) .threadpoolsize( 3 ) .defaultdisplayimageoptions( defaultoptions ) .build(); imageloader.getinstance().init( config ); i'm not using listview task, i'm using scrollview , inflatin...

jquery - How to respond correctly to an AJAX call in PHP? -

i trying update form fields using ajax , php . my ajax call : var productid = 'productid=' + id; $.ajax({ url: './includes/process_edit_products.php', method: 'post', data: productid }).success(function(response) { // populate form fields data returned server $('#userform') .find('[name="product_id"]').val(response.product_id).end() .find('[name="product_name"]').val(response.product_name).end() .find('[name="product_price"]').val(response.product_price).end() .find('[name="product_des"]').val(response.product_des).end(); // show dialog bootbox .dialog({ title: 'edit products', message: $('#userform'), show: false // show manually later }) .on('shown.bs.modal', function() { $('#userform') .show() // show login form .formvalidation('resetform'); // reset...

ruby - Why is my version of bsearch not working? -

i running bsearch([1,2,3,4,5,6], 6) this version of bsearch: def bsearch(arr, target) return nil if arr.size == 0 half = arr.size / 2 left = arr[0...half] right = arr[half...-1] case target <=> arr[half] when 1 return half + bsearch(right, target) when 0 return half when -1 return bsearch(left, target) end end this error being thrown: recursion.rb:224:in `+': nil can't coerced fixnum (typeerror) recursion.rb:224:in `bsearch' recursion.rb:224:in `bsearch' recursion.rb:249:in `<main>' from ruby docs : .. run beginning end inclusively. created using ... exclude end value your code excluding final array element. left = arr[0...half] right = arr[half...-1] change use range operator .. instead of ... left = arr[0..half] right = arr[half..-1]

How to ssh and then telnet with ruby? -

i need retrieve information networks terminals using telnet. terminals in network, cannot access network. can access server in same network, , telnet there. the case here, i´m doing ruby. can run ruby , program in computer outside network. start coding connect via ssh server, , telnet terminals , information. uses several libraries trying this, net-ssh, net-ssh-bash, , net/ssh/telnet, because think there best. require 'net/ssh/telnet' s = net::ssh::telnet.new( "dump_log" => "/logtelnet", "host" => "9.0.0.2", "username" => "root", "password" => "toor" ) while 1>0 comando = gets.chomp puts s.cmd(comando) end i can connect server, , can run commands, "ls", "cd /" etc. but, when try telnet or ssh network terminals session gets frozen. cannot pipe telnet stream ssh output program. any idea solve this?

c# - binding a control with a observable collection -

in xaml, how display observablecollection in expander control grid when expand it? public class boundpoco ( public string expandertext { set; get; } public observablecollection<displaydetail> { set; get; } ) public class displaydetail { public string firstdisplaycolumn { set; get; } public string seconddisplaycolumn; { set; get; } } you should use items control within expander control achieve this. firstly sort code behind errors out - had stray semicolon on "seconddisplaycolumn": public string seconddisplaycolumn { set; get; } ... , had no name on main observable collection property! public observablecollection<displaydetail> displaydetails { set; get; } then, if you're not using dependency properties or inotifypropertychanged - create xaml display data (with name 'items'): <expander name="myexpander" background="tan" horizontalalignment="left" header="my expande...

linux - Change User ID and Group ID that is used for Writes on Website (WordPress) -

how change user id , group id used writes on given website? for example: when upload image using wordpress creates image in upload directory , resulting ownership apache:apache. there way change , there way change on per site basis? the ironic part running centos 7 server, nginx , mariadb , php setup. don't understand where, how or why choosing user , group apache , love know why , how change it. thanks time guys, appreciate :)

Python 3.3 Inner Nested While Loop Not Outputting -

i'm trying learn python between self thought of projects relevant me , utilizing teamtreehouse though it's slow progress. goal: have inner loop calculate cost of individual class semester in 1 year print out. inner loop run 5 total times. outer loop should run once print out basic prints. instead error though defined i (counter variable) first line of each while loop? error: this program display projected semester tuition amount next 5 years full-time students. calculated $6,000 per semester tuition 2% yearly increase 5 years. traceback (most recent call last): file "main.py", line 26, in <module> ...

ruby - get response of grape endpoint with def after -

i'm using grape. want define method runs after response value has been calculated request, tried following this: http://www.sinatrarb.com/intro.html#filters and ended with: after puts response end however response not defined. apparently within block, self refers grape::endpoint , since after runs after endpoint handler, should able find response value, right? tried self.body returns nothing - does, however, let me change value of response, want retrieve response value generated handler. ahh, solved using rack middleware: class captureresponse < grape::middleware::base def call!(env) @env = env @app_response = @app.call(@env) body = @app_response[2] body = body.body if body.kind_of? rack::bodyproxy puts body @app_response end end use captureresponse i have no idea why slapping in use captureresponse in config.ru works does!

unity3d - How to check where rigid body will land before throwing it? -

i want have cannon , player adjusts force applied fire it, i'd show cannonball land. looks formula want here: http://en.wikipedia.org/wiki/trajectory#uniform_gravity.2c_no_drag_or_wind i'd know if unity can provide me without coding formula (as it's used in unity), 1 reason being don't want make mistake calculation won't correspond unity when cannonball fired. unfortunately, unity's physics isn't deterministic. i've seen few teams trying implement this. takes lot of time, , usually, 1 of following approaches taken in end: using own custom-written deterministic physics — it's time-consuming , requires lot of changes whole project approximating unity's physics special code — it's not precise , can differ end result speeding unity physics, launch invisible clone of object same parameters , display trajectory has taken — still takes time compute. ask game designers if they're ok trajectory appearing "animation" ...

computer vision - camera extrinsic calibration -

i have fisheye camera, have calibrated. need calculate camera pose w.r.t checkerboard using single image of said checkerboard,the intrinsic parameters, , size of squares of checkerboards. unfortunately many calibration libraries first calculate extrinsic parameters set of images , intrinsic parameters, "inverse" procedure of want. of course can put checkerboard image inside set of other images used calibration , run calib procedure again, it's tedious, , moreover, can't use checkerboard of different size ones used instrinsic calibration. can point me in right direction? edit: after reading francesco's answer, realized didn't explain mean calibrating camera. problem begins fact don't have classic intrinsic parameters matrix (so can't use method francesco described).in fact calibrated fisheye camera scaramuzza's procedure ( https://sites.google.com/site/scarabotix/ocamcalib-toolbox ), finds polynom maps 3d world points pixel coordinates( or, al...

jquery - AJAX POST to PHP script -

i'm trying post program separate php file, grab data , store sql database. i've checked code on , on , can't' find i'm doing wrong. appreciated. ajax $(".btn btn-success last").click(function(){ $.post("go2.php", { name: "donald duck", city: "duckburg" }, function(data, status){ alert("data: " + data + "\nstatus: " + status); }); }); php file (go2.php) w/ sql code <?php include 'connection.php'; $x = $_post["name"]; $sql = "insert users (username) values ('$x') "; $query = mysql_query($sql); ?> try long version of ajax request $(document).ready( function () { $(".btn btn-success last").click(function(){ $.ajax({ type: "post", url: "go2.php"...

javascript - Mask is not working? -

Image
i have inputbox mask, inputs not allowed hardware keyboard, instead have touch-screen keyboard() function inserts characters in field. but when keyboard() inserts inputs in input field fails generate mask effects. how make mask work when keyboard() used? <script type="text/javascript" src="http://digitalbush.com/wp-content/uploads/2014/10/jquery.maskedinput.js"></script> <script type="text/javascript"> function keyboard(input) { if (input==='backspace') { tvalue = ''; } else if(input ==='quote') { tvalue = tvalue + "'"; } else if(input ==='space') { tvalue = tvalue + " "; } else { tvalue = tvalue + input; } $('#' + tinput).val(tvalue); console.log(">>> keyboard: ", input); } $(document).ready(function(){ $("#rrn").mask('99.99.99-999.99'); // $(document).bind('contextmenu', fun...

ember.js - Problems with setting up a basic Ember app -

i starting out ember. installed per documentation. when go http://my-app:4200 'my application' show. however, when go http://my-app:4200/boxes view doesn't show contents of boxes.hbs template ("hello there boxes template!") - ideas why not (files below)? app/router.js: import ember 'ember'; import config './config/environment'; var router = ember.router.extend({ location: config.locationtype }); export default ember.router.extend().map(function(){ }); router.map(function() { this.route('boxes', { path: '/boxes' }); }); app/routes/application.js: export default ember.route.extend({ setupcontroller: function(controller) { controller.set('title', "my application"); } }); app/templates/application.hbs : <h2>{{title}}</h2> <div class="main"> {{outlet}} </div> app/templates/boxes.hbs : <p>hello there bo...

c# - Intellisense for model properties not working in View for HtmlHelper -

my question simple , might not important other coders, lot if 1 can explain me why can't intellisense working when using displaynamefor . working on displayfor or other models, not one. while not helping me correct properties, telling me when there no such name of property. error not contain definition "insert variable here" well reassuring, why not tell me available then? @model ienumerable<rmqgrainsbeta.models.expenseindexviewmodel> @{ viewbag.title = "expensesindex"; } <h2>expensesindex</h2> <table class="table table-bordered"> <tr> <th> @html.displaynamefor(model => model.sonumber) </th> <th> @html.displaynamefor(model => model.dateprocessed) </th> <th> @html.displaynamefor(model => model.stats) </th> <th> @html.displaynamefor(model => model.totalexpense) </th> </tr> ...

javascript - Clear form that has been automatically filled in with PHP echo code -

i have created order form , have automatically filled in of fields current users information has been stored in database. however, realise people times want order somewhere new , may change details particular order. @ moment of form field code is: <label>email :</label> <input type="text" value="<?php echo $info[email]?>" name="email" id="email"> is there way me clear value of field when echoing value? i know how clear form using javascript , reset() function on form button, clear values of fields user has entered not ones output php code. nudge in right direction appreciated :). first: that's correct, can't php then: neither pure javascript (except if loop through inputs , change value), javascript reset() 'reset' form values defaults , when define (in html) input tags 'value' string defining default value. lastly, can either use ajax , fill inputs javas...

swift - immutable of type only has mutating members -

following code throwing error "immutable value of type [user] has mutating members named append" please advise. library or framework code (precompiled) class database { var data: any? //can change code has generic placeholder init(data: any?=nil) { self.data = data } } users of library or framework code class user { var first: string var last: string init(first: string, last:string) { self.first = first self.last = last } } class test: database { init() { super.init(data: [user]()) } func additem(item: user) { //edit user type problem persists (self.data as! [user]).append(item) //error } } attempt 1 , seems working still wonder why above code doesn't work. func additem(item: user) { var users = self.data as! [user] users.append(item); self.data = users; } don't re-assignment, how can in place mutability possible i've written (what beli...