Posts

Showing posts from June, 2013

css - Foundation big spaces on columns if the side column height is long -

good day guys. i've been trying hours regarding problem. wanted achieve large column position stated below i'm getting else. medium large [ ] | [ ][ ] | [ ][ ] --------- | --------- [ b ] | [ b ] [ b ] | [ ][ ] | [ ] --------- | [ c ] --------- | --------- --------- [ c ] | [ ][ d ] | [ ][ d ] --------- | [ ] | [ c ] [ d ] | | [ ] | | [ ] as can see there large gap between , c in large screen. wanted c go , take blank spaces without using hacks as possible. here code have tried. <div class="row profile align-top"> <div id="a" class="column small-12 large-8"> ..... </div> <div id=...

java - How to remove all views and add again? -

i creating views show events. retrieving records database , showing events based on records. events getting created now. now want remove views when records deleted. if delete record view getting created in fragment. i have add event activity in add , delete record. record gets deleted in database still can see view after finish(); activity. creating views: private void createevent(layoutinflater inflater, viewgroup dayplanview, int fromminutes, int tominutes, string title,string location,final int id) { final view eventview = inflater.inflate(r.layout.event_view, dayplanview, false); relativelayout.layoutparams layoutparams = (relativelayout.layoutparams) eventview.getlayoutparams(); container = (relativelayout) eventview.findviewbyid(r.id.container); textview tvtitle = (textview) eventview.findviewbyid(r.id.textviewtitle); if (tvtitle.getparent() != null) ((viewgroup) tvtitle.getparent()).removeview(tvtitle); if(location.equals("...

mysql - SQL find rows where column is LIKE -

i want find rows have particular name on it. problem of rows have prefix: "(obsolete)" or "(obsolete) " so name john, have 3 rows: john (obsolete)john (obsolete) john how write query can find rows match name knowing prefix there, , want those? would able use sql wildcards in statement? select * customers name '%john';

ios - How to delete multiple images from photos app selected by ELCImagePickerController? -

i use elcimagepickercontroller select multiple images photos app in application. want delete images photos app selected elcimagepickercontroller . please me solve this. elcimagepickercontroller allowed 2 methods. - (void)elcimagepickercontroller:(elcimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsarray *)info; - (void)elcimagepickercontrollerdidcancel:(elcimagepickercontroller *)picker; you need use phphotolibrary . using phassetchangerequest for project used this, , in swift, hope give right idea. works me: phphotolibrary.sharedphotolibrary().performchanges({ phassetchangerequest.deleteassets(photoassets) }, completionhandler: { success, error in nslog("completed deletion of asset. %@", (success ? "success" : error!)) }) you want implement in didfinishpickingmediawithinfo hopefully helps.

sweet.js: transforming occurrences of a repeated token -

i want define sweet macro transforms { a, b } # o into { o.a, o.b } my current attempt is macro (#) { case infix { { $prop:ident (,) ... } | _ $o } => { return #{ { $prop: $o.$prop (,) ... } } } } however, give me syntaxerror: [patterns] ellipses level not match in template i suspect don't understand how ... works, , may need somehow loop on values of $prop , build syntax objects each , somehow concatenate them, i'm @ loss how that. the problem syntax expander thinks you're trying expand $o.$prop instead of $prop: $o.$prop . here's solution: macro (#) { rule infix { { $prop:ident (,) ... } | $o:ident } => { { $($prop: $o.$prop) (,) ... } } } notice placed unit of code in $() block of own disambiguate ellipse expansion. example: var x = { a, b } # o; becomes var x = { a: o.a, b: o.b }; .

android - Null pointer excpetion on intent creation -

i've got error i've never had before : when i'm using following intent intent = new intent().setclass(this, research.class); i've got nullpointerexception... research.class not null , "this" neighter... research class in different package, problematic ? different package same projet. my stack trace : java.lang.nullpointerexception @ android.content.contextwrapper.getpackagename(contextwrapper.java:135) @ android.content.componentname.<init>(componentname.java:75) @ android.content.intent.<init>(intent.java:3491) @ mypackage.connect.disconnect(connect.java:92), , line 92 1 posted. i've imported class needed intent , it's declared in manifest.xml. try this: intent intent = new intent(this, research.class);

What happens to root view controller in ios / swift -

say switching viewcontrollers manually how transition new view controller code using swift what happens (root) controller when viewcontroller brought front. can reinstantiate or should keep reference pu front? no don't have re-instantiate it. can access current uiviewcontrollers uinavigationcontroller this self.navigationcontroller?.viewcontrollers this return [uiviewcontroller] . if want viewcontroller @ index = 0 . if want root can call self.navigationcontroller?.poptorootviewcontrolleranimated(true)

database migration - Change foreign key column name in rails -

i have migration class project this class createprojects < activerecord::migration def change create_table :projects |t| t.string :title t.text :description t.boolean :public t.references :user, index: true, foreign_key: true t.timestamps null: false end end end it creates column name user_id in projects table want name column owner_id can use project.owner instead of project.user. you can 2 ways: #app/models/project.rb class project < activerecord::base belongs_to :owner, class_name: "user", foreign_key: :user_id end -- $ rails g migration change foreignkeyforprojects # db/migrate/change_foreign_key_for_projects.rb class changeforeignkeyforprojects < activerecord::migration def change rename_column :projects, :user_id, :owner_id end end $ rake db:migrate

PHP upload csv file into array to server -

i trying upload csv file php script, seems first row sent server. tried severals solutions putting q loop while don't while(! feof($handle)){ $data=fgetcsv($handle, 1000, ","); ...} crashes. if else me. thanks. here php script : <?php $url = 'https://mutalyzer.nl/services/?wsdl'; ?><!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>mutalyzer soap client</title> </head> <body> <h1>mutalyzer soap client</h1> <?php if (isset($_get['data']) && $_get['data']) { echo $_get['data']; $variant = $_get['data']; echo $variant; //$filename = basename($_files['data']['name']); $_files['data']['name']=$_get['data']; $filename = basename( $_files['data']['name']); $handle = fopen($filename, "r"); $data = fgetcsv($handle,...

python - Django can't find my custom template filter -

i'm trying create custom template filter in django app. i've created templatetags folder under app, added __init__.py file , filters.py file filters, so: import os django import template django.template.defaultfilters import stringfilter register = template.library() @register.filter @stringfilter def filename(pathname): """ returns file's name, without folder """ return os.path.basename(pathname) when try access filter template, error "invalid filter 'filename'" this question has been asked lot, checked following: __init__.py named after opening shell manage.py shell can import filter so: import app.templatetags i can use filter django shell i have restarted django development server. i have placed breakpoint on call template.library() - debugger doesn't stop there. here template (i've removed parts of it, error persists in small version, well) <form enctype="multipart/form-...

ios - Need assistance setting UIButton in centre using Autolayouts -

i trying programmatically set uibutton vertically , horizontally in centre using autolayouts here code: - (void)awakefromnib { uiview *av = [[uiview alloc]initwithframe:cgrectmake(0, 0, self.bounds.size.width, 35.0)]; uibutton *donebutton = [[uibutton alloc]initwithframe:cgrectmake(0, 0, 37, 30)]; //uibutton title, color, backgroung color, targer action ... nslayoutconstraint* cn3 = [nslayoutconstraint constraintwithitem:donebutton attribute:nslayoutattributecenterx relatedby:nslayoutrelationequal toitem:av attribute:nslayoutattributecenterx multiplier:1.0 constant:0]; [av addconstraint:cn3]; nslayoutconstraint* cn4 = [ns...

php - Wordpress custom leftjoin on two tables -

i'm new idea of left-joining. i have created 2 custom tables within wordpress database. 1 detail (containing leads) , 1 storing car dealers. when send lead cardealer, store id of cardealer column "sent_to" in detail table. want show car dealers have received each lead. and here comes leftjoin: global $wpdb; $cardealers = $wpdb->get_results( "select detail.name, cardealers.user_id detail left join cardealers on cardealers.user_id = detail.sent_to" ); and how try input results: foreach($cardealers $cardealer) { $name = $row->name; echo $name; } but can guess, nothing happens. hope can help.

How to get next date from selected date in Bootstrap Datepicker -

i have used bootstrap datepicker plugin click here check plugin i wanted know how next date selected date in date picker. you need use .setdate() function in javascript set next day's date once have extracted selected date using getdate datepicker. check working fiddle here : fiddle javascript/jquery : $('.datepicker').datepicker().on('changedate', function() { var temp = $(this).datepicker('getdate'); var d = new date(temp); $('#currentdate').html("the selected date :" + d); d.setdate(d.getdate() + 1); $('#tomorrowdate').html("the next date :" + d); }); html: <div class="input-group date datepicker" data-provide="datepicker"> <input type="text" class="form-control"> <div class="input-group-addon"> <span class="glyphicon glyphicon-th"></span> </div> </div> <div id=...

sql - Disable Query in Access with VBA -

a coworker in accounting complaining how ran query twice , doubled values , got confused. im junior person has little vba experience. trying add code make queries in our databases can't run more once unless restart database. thinking of doing boolean check see if query has been run , if has don't allow run again. or maybe simple if statement. please let me know if have input on issue. i couldn't find on googs either. i think on date , session id default values in each table, code addition of both etc. these populated, date =date() default value , sessionid dmax sessionid table, column in said query. this sessionid table incemented startup popup form, running macro. the primary key of each table being operated on date , sessionid not allowing dupes. dont need date, sessionid in pk.

Laravel subdomains routing and session management -

i trying set isolated backend , frontend environments in same laravel5 application. my ideal purpose such isolation thru subdomains different guards(tables) users @ front , users @ backend up i've defined guard/providers @ config/auth.php , done : routing route::group(['domain' => 'front.mydomain.com'], function () { route::get('/', 'welcomecontroller@index'); route::group(['middleware' => ['web']], function () { route::auth(); }); route::group(['middleware' => ['web','auth']], function () { route::get('/home', 'homecontroller@index'); route::group(['prefix' => 'record'], function () { route::get('all','recordcontroller@all'); }); }); }); route::group(['domain' => 'admin.mydom...

ios - Implement a Swift protocol by automatically mapping method calls to keys in a dictionary -

in objective c have been able implement automatic mechanism allow object private nsdictionary property implement simple protocol automatically converting method invocations dictionary 'valueforkey' requests, , passing these dictionary has appropriate key:value. for example, have object 'abcartist', implement artistprotocol. protocol has method -(nsstring*)artistname; , 'abcartist' object implement method returning [self.privatedictionary valueforkey:artistname]; this process relied on overriding nsobject methods: - (void)forwardinvocation:(nsinvocation *)invocation; - (nsmethodsignature *)methodsignatureforselector:(sel)selector; - (id)forwardingtargetforselector:(sel)aselector; i have tried apply same process in swift, unable use compiler error: 'nsinvocation' unavailable in swift: nsinvocation , related apis not available is there way has found implement protocol automatically querying dictionary value same name protocol method? ...

Remove remote commit in git -

i can't find working solution problem: how remove commit in local , in remote repository. here 1 solution . when try can go reset command in local repository. can't push it. error message says: remote: error: denying non-fast-forward refs/heads/master (you should pull first) after pull master points again commit want remove. can help? edit - try: $ git reset --hard head^1 head @ 1c50f9c commit $ git push -f total 0 (delta 0), reused 0 (delta 0) remote: error: denying non-fast-forward refs/heads/master (you should pull first) e:/reps/gf.git ! [remote rejected] master -> master (non-fast-forward) error: failed push refs 'e:/reps/gf.git' your remote repository has setup disallows non-fast-forward pushes on server side. have 2 options: contact server administrators, explain case, , ask them (temporarily) rescind no-fast-forward-push policy, git config receive.denynonfastforwards . (you still need -f flag push.) use git revert instead of gi...

android - Robotium Drag does not work -

i have written game using andengine want test using robotium. problem robotium's drag function not work. have robotum 4.0 jar added build path , exported, , manifest file seems correct. second test(joystick) fails movement never takes place. test class: package cs428.uiuc.robotswarms.test; import junit.framework.assert; import org.andengine.entity.sprite.animatedsprite; import com.jayway.android.robotium.solo.solo; import cs428.uiuc.robotswarms.robotswarms; import android.test.activityinstrumentationtestcase2; public class testmotion extends activityinstrumentationtestcase2<robotswarms> { public testmotion() { super(robotswarms.class); } private solo solo; protected void setup() throws exception { super.setup(); setactivityinitialtouchmode(true); solo = new solo(getinstrumentation(), getactivity()); } protected void teardown() throws exception { solo.finishopenedactivities(); super.teardown(); } private void...

Instagram API Authentication - Do user have to login using their own accounts? -

am getting right? https://www.instagram.com/developer/authentication/ a visitor of website calls instagram api must login own account in order application fetch data instagram api? certainly it's best way it. until june 2016 it's possible use client-id make requests despite of access token . deprecated, don't use it. from instagram: the instagram api requires access_token authenticated users each endpoint. no longer support making requests using client_id. to avoid users must login, can authorize your user create access_token , make requests token. it's not idea because of rate limits on api. from instagram: all rate limits on instagram platform controlled separately each access token , , on sliding 1-hour window. and global rate limits: sandbox mode - 500 requests/hour live mode - 5000 requests/hour so if use 1 access_token limiting 5000 requests per hour (live mode) users of site , app access easier blocked instagra...

vsts - Files on Visual Studio Team Services out of sync (Git repo) -

Image
probably missing trivial here struggling figure way out.. we have git repository setup on visual studio team services. since 1st february, several files seem have gone out-of-sync history of commits. history contains loads of recent changes, when pulling latest version, old copies. it not clear if in team might have accidentally issued weird commands on remote repository. what quite clear though, "current" remote versions visible via vsts web portal seem older should according history (so not issue local repos). below 1 example: current version changes history latest commit even though last commit shows few new lines added, 'current version' of file doesn't contain them.. , there no further commits in history! any suggestions on how verify happening remote repo , fix it, or whether known issue on vsts (they have been having problems , service down yesterday..) this due botched merge. happened did pull, got conflicts, resolved ...

javascript - Chrome Developer Tools : How to know the event triggered when click a element? -

when i'm in website, how can use chrome developer tools find out js function called when click on element ? for instance, i'm on website has div element. when click on div, actions. want know js function these actions, able call js function programatically in console, without need manually click on div. thanks ! all event listeners element shown in event listeners panel. if expand 'click' event section you'll see scripts @ play. once you've found script, expand object see function names (except, of course, anonymous functions) , other properties.

google app engine - Complicated, costly many-to-many entity references -

i have 4 main kinds: account, company, service , address. address entities shared between company , service entities. account: user account (email, password) company: business provide services (ancestor: account) service: service rendered company (ancestor: company) address: address (group of fields: street, city, country) of company or service (ancestor: account) the challenge: company , service entities may have different addresses; after all, company's address not services acquired. services may have many addresses, since company may set different franchises/outlets services may acquired. i model data in such way addresses can referenced either company or service entities, or both. have tried these 2 approaches: let's assume address model: class address(ndb.model): street = ndb.stringproperty(required=true) city = ndb.stringproperty(required=true) country = ndb.stringproperty(required=true) approach 1 : store list of address keys inside ser...

asp.net - Omnisharp server is not running Windows 10 -

i'm using vs code try out asp.net little bit, when try do: dnu restore fails. if try within vs code error message: omnisharp server not running. i don't know :( i'm running windows 10 x64 check vs code omnisharp log, ctrl + shift + u . the omnisharp server not running error can result problem in project.json causing issues dnu restore . e.g. issues resolving packages 1 of target frameworks? it not but, can try restarting omnisharp : f1 "omni restart" c# support not bundled sound have installed it. otherwise add c# f1 "ext install", enter , "c#" you right there little documentation https://code.visualstudio.com/docs/languages/csharp - introduction project types , omnisharp https://docs.asp.net/en/latest/tutorials/your-first-mac-aspnet.html - yes osx because windows instructions visual studio https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/10/experimental-net-core-debugging-in-vs-code/ - ex...

javascript - rxjs does a cold obs store all messages -

when reading an intro rxjs came read following , bit concerned the second subscription restart sequence first value. how start first value? store values in memory? real problem me using in worker/service stay running. if it's holding on them i'm headed massive blow up. thanks, r standard subscriptions not buffer values. operators (and subjects) need buffer values implement behaviour (and buffer can unbounded) problem distinct hot vs. cold dichotomy. the short explanation (cold) source observable (the upstream observable) knows how generate values when has subscriber. , generates same values subscribers. there no buffering, more regeneration of values. instance, rx.observable.range(1,10) knows values has generate, , generate them anytime there subscriber. not keep buffer 1,2,3...10 in memory, 1 , 10 , iterates in between generate values. same goes of cold observables, have value generating function associated them, , function reexecuted anew each su...

Scanning CSV with text fields into Array Swift -

i have csv scanning method found here . answer led me there here . my issue is : csv data trying scan contains commas (in field called "notes" others). presents problem when scan csv, because interprets notes field having seperated values in it. can me edit method handle commas inside of text field? unsure of how save csv delimit field. not sure exact changes need made in method , in save options csv. here function straight app: func scancsv () -> array<dictionary<string,string>> { var mycsvcontents = array<dictionary<string, string>>() //rawdata global string variable gets set csv string on object init. let allrows = rawdata.componentsseparatedbystring("\n") let headers = allrows[0].componentsseparatedbystring(",") runfunctiononrowsfromfile(headers, withfunction: { (arow: dictionary<string, string>) in mycsvcontents.append(arow) }) return mycsvcontents } func run...

Aggregate and update MongoDB -

i have 2 collections: clients (6 000 000 documents) orders (50 000 000 documents) once day, calculate number of orders in past year, past month , past week, , such, client. i tried this: db.orders.aggregate( {$match: { date_order: { $gt: v_date1year } } }, {$group : { _id : "$id_client", count : {$sum : 1} }} , { "$out": "tmp_indicators" } ) db.tmp_indicators.find({}).foreach(function (my_client) { db.clients.update ( {"id_client": my_client._id}, {"$set": { "nb_orders_1year" : my_client.count } } ) }) i have 3 times, 1 past year aggregation, 1 past month , 1 past week. treatement slow, have idea of how perform in better way? for improved performance when dealing large collections, take advantage of using bulk() api bulk updates sending operations server in batches (for example, batch size of 100...

php - How to POST PDF content as application/pdf using cURL -

i'm new curl , use .net or jquery posting web apis, have requirement use existing php implementation post pdf content-type: application/pdf web api. the existing implementation posts , receives json data, it's pretty straight forward. when try change code post application/pdf content endpoint, keep getting following error: file of wrong type. acceptable content types application/pdf, text/richtext, text/plain, image/jpeg. here code using: $curl = curl_init($url); curl_setopt($curl, curlopt_returntransfer, true); curl_setopt($curl, curlopt_failonerror, false); curl_setopt($curl, curlopt_ssl_verifypeer, false); curl_setopt($curl, curlopt_header, true); curl_setopt($curl, curlopt_httpheader, array('content-type: application/pdf'), $auth_header)); curl_setopt($curl, curlopt_post, 1); curl_setopt($curl, curlopt_postfields, file_get_contents('c:\myfile.pdf'))...

3g - Can we make 2 or more USB Internet Modems to work on one PC? -

i'm working on project require working similar connecting 2 or multiple usb internet modems 1 pc , make them work @ same time, , want know if can use 2 usb internet modems in 1 pc , make them work simultaneously. thank you. combing multiple internet or wan connection possible, although there lots of caveats. google '3g multihoming' see more background. there relatively cheap ($50 approx) routers support load balancing on multiple wan ports - dual wan or multi-homming in tech specs. you can 'trick' windows using more 1 internet connection - see links below. however, unless use service on server side split loads, need aware of limitations: if use case has lots of requests can run in parallel, many web page downloads do, technique should work well. if downloading single large file in 1 request not make difference, although if smart enough move other request connection may little. some links windows dual connection use (note have not tested the...

javascript - scrollTop() and slide-like animation -

i'm trying make page act slideshow, each section appearing slide. html 4 section elements, each ided about, about2, etc. i'm using jquery make them take window height when loading. on scroll down, activated function, goes 1 slide other. it works on first slide, stuck on it. if reload page , reloads @ position, works until next slide, gets stuck again. looking @ value, can see conditions there activate next animation (for example, animate #about3), refuses move (always animate #about2 when scrolling). am doing wrong here? function scrolldown(){ $height = window.innerheight; $scroll = $(window).scrolltop(); console.log($scroll+' , '+$height); if ( $scroll > 0 && $scroll < $height) { $('html, body').animate({scrolltop: $("#about2").offset().top}, 1000); } else if ($scroll > $height && $scroll < 2*$height) { $('html, body').animate({scrolltop: $("#about3").off...

php - WordPress User System -

i'm developing plugin creates specific system specific functionality users, can register through system. first thought of creating separate users table , login/register system apart wp built in users , login/register. looked @ woocommerce plugin (just example) , found out using wp built in user management shopping accounts, thought more flexible there abstraction , management easy. note, users registered through plugin have nothing wp admin dashboard, , system have own pages administrating stuff related plugin. worth of creating own user management system, separate wp built in, or after use latter? you can use quite safely if restrict user's capabilities. more convenience redirect them admin panel home page (in case try go admin panel). can use code purposes: add_action( 'admin_init', 'bs_restrict_admin_with_redirect', 1 ); function bs_restrict_admin_with_redirect() { if ( ! current_user_can( 'manage_options' ) && ( ! defined(...

python - xmltodict throwing errors when used in a .py file -

i want xmltodict in python2.7 , running project have, started copy-pasting example able find import xmltodict open ('test.xml') fd: doc = xmltodict.parse(fd.read()) print doc trying run results in error: attributeerror: 'module' object has no attribute 'parse' same thing when trying convert dict xml using xmltodict.unparse function. however, works if line line in idle... idea why fails when trying run in .py file, works when use interpreter line line? just don't name script xmltodict.py . getting imported instead of installed python environment xmltodict package.

matlab - Finding elements in an array other than given indices -

i want find elements in array not given index elements. example, given array a = [1 5 7 8] , , index ind = [2 3] , operation should return elements [1 8] . use direct index vector: b = a(setdiff(1:numel(a),ind)); or throw away unneeded elements: b = a; b(ind) = []; or use logical indexing: % either b = a(~any(bsxfun(@eq,ind(:),1:numel(a)),1)); % or b = a(all(bsxfun(@ne,ind(:),1:numel(a)),1));

c++ - What's a good way to capture member variable by value in c++11? -

this question has answer here: c++11 lambdas: member variable capture gotcha 1 answer struct myclass { myclass(){} myclass(int qx):z(qx){ } std::function<void()> create() { auto px = [z](){ std::cout << z << std::endl; }; return px; } int z; }; myclass my; my.z = 2; auto func = my.create(); func(); my.z = 3; func(); this code compile in 4.6.3, correct thing make copy of member variable z, , both print 2. in 4.8.2 doesn't compile anymore.. error: ‘this’ not captured lambda function i wonder why functionality removed quite useful. i don't think can directly in c++11 (see @nawaz's comment workaround). however, c++14 helps in instance, via generalized lambda captures : auto px = [v = this->z]() // capture value 1 member variable { std::cout << v << std::endl; }; example: ...

css - How can I make Bootstrap display content properly on mobile devices? -

just experience, i'm trying re-create amazon.com bootstrap 3. i've gotten lot of down, 1 thing can't seem mobile display. how can keep image inline text, not stack text when screen goes portrait mobile display? i've got viewport set, i've tried responsive images, issue seems how text stacks. can disable that? heres simple example of i've got: <div class="container"> <div class="row"> <div class="col-xs-4"> <a href="#"><img src="image.jpg"></a> </div> <div class="col-xs-8"> <ul class="list-unstyled"> <li><h4>product title</h4></li> <li>price</li> <li>*review stars*</li> </ul> </div> </div> </div> when open page iphone 6, text titles stack terrible (unless there short title). thanks! as far ...

python 3.x - How to ask password for sudo using pyqt? -

cmd = subprocess.run(["sudo", "ovs-vsctl", "list-br"], stdout=subprocess.pipe, universal_newlines=true) this error message gets shown when try run it. sudo: no tty present , no askpass program specified this pyqt5 application trying out. want know how can ask administrator password in gui app? this code: #!/usr/bin/python3 # -*- coding: utf-8 -*- import os, sys, design, subprocess pyqt5 import qtcore, qtgui, qtwidgets class exampleapp(qtwidgets.qmainwindow, design.ui_mainwindow): def __init__(self): super(self.__class__, self).__init__() self.setupui(self) self.button1.clicked.connect(self.browse_folder) def browse_folder(self): self.listwidget.clear() cmd = subprocess.run(["sudo", "ovs-vsctl", "list-br"], stdout=subprocess.pipe, universal_newlines=true) bridges = cmd.stdout.split('\n') if bridges: bridge in bridges: ...

visual studio - Simple calculation in VB.Net -

i want calculate reynolds number using vb.net this code: public class form1 dim vis integer dim den integer dim hd integer dim vl integer dim re integer private sub button1_click(sender object, e eventargs) handles button1.click vis = int(textbox1.text) den = int(textbox2.text) hd = int(textbox4.text) vl = int(textbox5.text) re = (den * vl * hd) / vl textbox3.show(re) end sub end class see ui here . why still getting error message "too many arguments" ? there few things wrong in code posted, firstly calculation wrong reynolds number. second, please turn on option strict current code not compile. third please use conventional naming conventions makes difficult in long run... there's more not point... suggested solution variable declaration meaning: d = diameter of pipe v = velocity of liquid u = viscoscity of liquid p = density of liquid tot = reynolds number private sub button1_click(sender object, e eventargs...

javascript - Get sibling div id generated by PHP -

i have html code kind of blog page. below - code of 1 post , height cuts css. many posts on blog page. want see content of particular page clicking "read more" button. div blog content has dynamic id gets database php. how can change height of div class "blog_article" clicking "read more" button? i thought of using js/jquery cannot id of "blog_article" div. or maybe there better way this? <div class="blog_article_wrapper"> <div class="blog_article" id="<?php echo $id; ?>"> <!--some content--> </div> <div class="blog_article_read_more"> <button onclick="blogreadmore()">read more</button> </div> </div> but cannot id of "blog_article" div why can't you?: <button onclick="blogreadmore(<?php echo $id; ?>)">read more</button> or, if it's...

python - Color Vertices in nltk.Tree -

so drawing parse tree in nltk pretty easy. not easy trying read through vague docs , lack of examples figure out how color vertices in tree. surely feature , should easy do? here example of parse tree. i'd able specify nodes colored, example, red. how might this? from nltk.draw.util import * nltk.draw.tree import * tree_string = "(root (s (np (dt the) (nn cat)) (vp (vbd ate) (np (dt the) (nn mouse))) (. .)))" t = tree.fromstring(tree_string) draw_trees(t)

javascript - Show pop-ups the most elegant way -

i have angularjs app. works fine. now need show different pop-ups when specific conditions become true, , wondering best way proceed. currently i’m evaluating 2 options, i’m absolutely open other options. option 1 i create new html element pop-up, , append dom directly controller. this break mvc design pattern. i’m not happy solution. option 2 i insert code pop-ups in static html file. then, using ngshow , can hide / show correct pop-up. this option not scalable. so i’m pretty sure there has better way achieve want. based on experience angularjs modals far believe elegant approach dedicated service can provide partial (html) template displayed in modal. when think modals kind of angularjs routes displayed in modal popup. the angularui bootstrap project ( http://angular-ui.github.com/bootstrap/ ) has excellent $modal service (used called $dialog prior version 0.6.0) implementation of service display partial's content modal popup.

javascript - How can I run two of the same syndication scripts on the same page? -

i have script obtained our sharp dealership display machines on our website. when add twice different model (data-name) runs first , drops off image after flashes on page. did try changing div id of second did not work. sample 1: <script src='http://siica.sharpusa.com/desktopmodules/x3.sharp.productcatalog/js/getproduct.js' type='text/javascript' data-type='mfps' data-name='mx-3050n'></script> <div id='sharp-widget'></div> sample 2: <script src='http://siica.sharpusa.com/desktopmodules/x3.sharp.productcatalog/js/getproduct.js' type='text/javascript' data-type='mfps' data-name='mx-3070n'></script> <div id='sharp-widget'></div> based on source code used above, can't, @ least not without kind of workaround. the javascript used expect explicitly item id "sharp-widget", html doesn't validate repeated ids, jquery wont rende...

c# - Expression Tree Errors as IQueryable but works as IEnumerable -

my first foray expression trees linq query has got me stuck. here query works without expression tree: iqueryable<sampleresult> samples = samples.select(a => new { = a, innerquery = _dc.requestedtests .selectmany( b => _dc.resultdata.where(x => (x.testnum == b.testnum && b.sampleid == a.sampleid)) .defaultifempty(), (b, c) => new requestedtestsjoinedresultdata { requestedtests = b, resultdata = c }).where(joinedtable => ((joinedtable.resultdata.resultid == 1) && (joinedtable.requestedtests.testid == 38) && (joinedtable.resultdata.intvalue >= (int32?) 90)) ).select(joinedtable => joinedtable.requestedtests.sampleid) }).where(temp0 => temp0.innerquery.contains(temp0.a.sampleid)).select(temp0 => temp0.a); my next move construct expression tree send the middle where() call. expression tree...