Posts

javascript - How to pass parameters to a URL from a select form? -

i want pass values select form url in order connect external website using iframe solutions. i'm new .php & javascript. please me out. this form created data users pass specific url. <form action="selectcourier.php" method="get"> <h1>select courier service</h1> <select> <option value="select">select courier service</option> <option value="1">dtdc</option> <option value="2">afl</option> <option value="3">bluedart</option> </select> consignment number: <input type="text" name="cnum"><br> <center><input type="submit"></center> </form> selectcourier.php <body> <form><center><h3><a href="http://dtdc.com/tracking/tracking_results.asp?action=track&sec=tr&ctlactiveval=1&ttype=awb_no&strcnno=h60874238&ges=n&tr...

How can I add a 2-column legend to a Matlab plot? -

Image
consider following code: t=0:.01:(2*pi); y=[sin(t);sin(t-pi/12);sin(t-pi/6);sin(t-pi/4)]; figure(1) clf subplot(6,1,5) plot(t,y) xlim([0 2*pi]) legend('1','2','3','4') it produces following figure: is there way change legend 2-column lay-out? be --- 1 --- 3 --- 2 --- 4 instead of --- 1 --- 2 --- 3 --- 4 so legend boundary lined not cross graph boundary lines. i found gridlegend script, prefer code directly. you can hack sort of thing making second invisible axis on top of first, this: t=0:.01:(2*pi); y=[sin(t);sin(t-pi/12);sin(t-pi/6);sin(t-pi/4)]; figure subplot(6,1,5) plot(t,y) xlim([0 2*pi]) l1 = legend('1', '2'); pos = l1.position; set(l1, 'position', pos - [pos(3) 0 0 0]); legend boxoff ax2 = copyobj(gca, gcf); set(ax2, 'visible', 'off', 'clipping', 'off') kids = ax2.children; set(kids, 'visible', ...

ruby on rails - Integration Tests: Filling Autocomple Dropdown in Rails_Admin using Capybara for -

in rails app, i'm using rails_admin. want fill relationship. say, post belongs author. want set author. rails_admin uses autocomplete form selection of data, i.e. xhr. how select value , submit data using capybara. normal select doesn't work here. i'm assuming need take following actions click on carrot icon, select first value dropdown or there other approach fill such data, i.e execute script etc. how do that? edit : as of now, i've started using selenium driver , i'm using following solution within '#post_user_id_field' find(".input-group-btn").click end page.execute_script(%q{$("ul#ui-id-3").find("li")[1].click()}) suggest better approach. thanks in advance, i took @ using capybara rspec found helpful information. without seeing of code, can following (taking link above): describe 'some stuff requires js', :js => true 'will use default js driver' 'will switch 1 ...

Cannot read property 'oFeatures' of undefined datatables -

i getting error cannot read property 'ofeatures' of undefined datatables using bubble editing of datatable editor <script type="text/javascript"> var editor; $(document).ready(function(){ // use global submit , return data rendering in examples editor = new $.fn.datatable.editor( { ajax: 'http://52.77.155.163/web/index.php?r=ivision/productprices/datatable', table: '#example', fields: [ { label: "id:", name: "id" }, ], formoptions: { inline: { onblur: 'submit' } } } ); $('#example').on( 'click', 'tbody td', function (e) { var index = $(this).index(); if ( index === 0 ) { editor.bubble( ); } }); var table=$('#example').datatable( { ...

winforms - How to fit C# application in every resolution -

i want know how fit c# application in every resolution c# application open in computer perfect when install application on client machine it's show half application. what have tried: this.windowstate = formwindowstate.maximized; this.location = new point(0, 0); this.size = screen.primaryscreen.workingarea.size; this won't work all, need desing application responsive. need use panels, groupboxes , objects these , need anchor these objects inside form, need user screen resolution , set application. summary: code may works not not perfect resolution. absoluty need anchoring objects. desktop application have pain matter.

d3.js - Angular2 / Typescript + D3v4 - manually include typings? -

i've been trying d3 , running angular2 app. there seems issue new d3v4 , available typings file, i.e. trying use new methods such scalelinear() instead of no longer available scale.linear() result in error property 'scalelinear' not exist on type 'typeof d3'.   since tomwanzek seems on issue , trying create new definitions on @ https://github.com/tomwanzek/d3-v4-definitelytyped wondering if there way manually include available typings files in angular2 project? in reference arlo's answer, let me expand brief history , current answer. created repo https://github.com/tomwanzek/d3-v4-definitelytyped develop new d3 version 4 typescript definitions, when d3 v4 not yet final , typescript 2 on horizon. latter major factor, because changed way definitions written , can acquired, i.e. @types. with few noted nods collaborators listed on repo, finalized definitions , migrated them definitelytyped . actively maintained in types-2.0 branch of defi...

java - For what purpose one would want to create a class's instance inside the same class's main? -

i came across kind of example , had difficulty understand it's actuall purpose: class yielddemo extends thread { static boolean finished = false; static int sum = 0; public static void main (string [] args) { new yielddemo ().start (); (int = 1; <= 50000; i++) { sum++; if (args.length == 0) thread.yield (); } finished = true; } public void run () { while (!finished) system.out.println ("sum = " + sum); } } i've never seen kind of implementation - why initiating new class inside same class object , not outside class? there particular reason? in fact outside of class object itself. main method static method, has no dependency on object instance. you move main method other java file . in general work. however, need put static methods in file. every java file needs class, may put method in class works for. example, class math in java pure ...