back soft

مطالب مرتبط با «script» در back soft | نویسنده: استخدام کار

Dependency Injection with Exact Example using Angular Javascript

Vote count: 0 I am New to lea a Angular Javascript. Can anyone gave me the knowledge of Dependency Injection with Its Demo Example. So That I did lea from there. No Good and clear link I have found from Googling. asked 1 min agoSupriya Pandey Let's block ads! بخوانید...

ادامه مطلب

TypeError: 'float' object is not subscriptable (diferential equation)

Vote count: 0 def funk(m,t): retu [m[0], -m[0]+m[1]*np.sin(t)] zac_pogoji = [15, 10, 13] h = 0.1 solver = ode(funk).set_initial_value(zac_pogoji) zac = [zac_pogoji] sprem = [0] while solver.t < 5: solver.integrate(solver.t + h) zac.append(solver.y) sprem.append(solver.t) TypeError: 'float' object is not subscriptable I'm trying to numericly solve differential equation: z(y)*sin(y) = z'''(y)+z'(y) and somehow i just can't get to solve it. Should i use some other way of solving 3rd order diff.eq? asked 4 mins agouser6367216 Let's block ads! بخوانید...

ادامه مطلب

nsupdate in basic CSH script for BIND in unix

Vote count: 0 I have never used C and I'm not writing this for security reasons, i am just writing this script to test an update via nsupdate to my BIND for a specific zone being "zoneA.unix". But i am receiving "option: undefined variable"And I'm not to sure if this is the correct way to do nsupdate via a user's inputs. echo "First of all we need to grab your useame:" set uname = $< if ($uname == "zoneA")then echo "password: " set passwd = $< if ($passwd == "Azone")then echo "you are in" echo "now to do the nsupdate" echo "do you wish to (A)dd or (D)elete a record" set numeric = $< if ($numeric == "A")then $option = "add" $testinga = "add" else if($numeric == "D")then $option = "delete" $te...

ادامه مطلب

JavaScript - create a unsorted array which contains sum of duplicate elements alongwith unique elements

Vote count: 0 I am trying to create a new array from existing array. Condition is that if element is duplicate then sum those elements. Please see below example for details as may be I am not able to explain clearly: Input: var arrayA = ["2", "1", "4", "2", "5", "1", "3", "2"]; Output: var arrayB = ["6", "2", "4", "5", "3"]; here arrayB[0] = sum of 2s (2+2+2), arrayB[1] = sum of 1s (1+1) I tried a lot but not able to figure out how I can achieve this. Please help! asked 41 secs agoVicJordan Let's block ads! بخوانید...

ادامه مطلب

Calling google app script from local javascript?

Vote count: 0 I have a google app script that deploys to a web app and runs how I want it to. I'm trying to call that script on a webpage using javascript. The web app consists of a form (HTML File) that will allow the user to choose a file, and click a button which will then call the google app script to upload the file to a folder in my google drive. What I want is to have that HTML file consisting of the form, have it call a javascript function upon click, and have that javascript function call the google app script, which will upload the file to my google drive. This is the source code for the google web app: Google Script: function doGet(e) { //link the html file retu HtmlService.create...

ادامه مطلب

UIWebView and JavaScriptInterface in Swift

Vote count: 0 How can I to create the JavascriptInterface chael from my web site to my UIWebView? Example in Android: webView.addJavascriptInterface(new WebAppInterface(this), "Android"); And from this JavascriptInterface I would like to draw the methods, as for example: fune webViewDidStartLoad(webView: UIWebView) or myActivityIndicator.startAnimating() How can I do? asked 28 secs agoAlessio Volpe Let's block ads! بخوانید...

ادامه مطلب

How to reference a variable in a wpfbutton description

Vote count: 0 I have a wpf application that can have multiple devices added to it on the home screen of the app. In UFT, I want to be able to loop through and gather all the child objects' names, and then click on the last button by referencing it by it's index value. The following code gathers all the names, prints them, and assigns to numDevices the index that I want to reference on the last line. I just caot get the last line to click on the correct button. If I directly reference the value as a number into the index, it correctly clicks the last button. I just caot seem to get the syntax correct to use the numDevices variable for the index reference on the last line. Dim oDesc Dim numDev...

ادامه مطلب

Hide Div after showing 5sec JavaScript

Vote count: 0 What I want to achieve: Hide Form Area after button click (DONE) Show submit confirmation message on button click (DONE) Hide Show submit confirmation message after showing it for 5 seconds Show form area again I'm stuck on point 3 & 4 and would appreciate any hints. I have tried the set time out function but without luck.I must be doing something wrong. function hideDiv() { document.getElementById('FormArea').style.display = "none"; } function showDiv() { document.getElementById('submitarea').style.display = "block"; } setTimeout(function() { $('#submitarea').fadeOut('fast'); }, 1000); //...

ادامه مطلب

TypeScript: compiler ignores alternative function signature

Vote count: 0 I'm using lodash with TypeScript 1.8. At one point in the code I want to reduce from an array like this: export interface IPackage { [...] dependencies?: IPackageReference[]; [...] } [...] // pkg implements IPackageReference lodash.reduce(pkg.dependencies, function(ref: IPackageReference, state: boolean) { retu true; }, true); However, the compiler exits with a type mismatch: package.ts(43,39): error TS2345: Argument of type 'IPackageReference[]' is not assignable to parameter of type 'Dictionary'. Index signature is missing in type 'IPackageReference[]'. The typings I use however should support Arrays however: /** * @see _.reduce **/ reduce( collection: Array, callback: MemoIt...

ادامه مطلب

Working javascript without browser

Vote count: 0 Can i make working javascript without open browser or still working after close browser ? Example : setTimeout(function(){ test(); },86400000; setTimeout still working after close browser asked 1 min agoKamil Kmita 2 Answers Vote count: 0 JavaScript only run in the browser. answered 20 secs agoemil rowland Vote count: 0 You shouldn't be using a browser JavaScript application if you want it to run outside of the browser. answered 5 secs agojoe Let's block ads! بخوانید...

ادامه مطلب

Javascript Array ,pushing elements and displaying

Vote count: -1 I have an array object , where there is a condition :if two object have same name, need to display them under the same header using angular. Can you guys please help . Ex : A[{a:'a',b:'c'},{a:'a',b:'c'},{a:'c',b:'e'},{a:'p',b:'f'}]; Result : Header 1: a,b hedaer 2 : c header 3 : C enter code here asked 2 mins agoFrontDev Let's block ads! بخوانید...

ادامه مطلب

Javascript change image src with fade out and in

Vote count: -2 I'm new to js and i'd like to change automatically src of an dynamically in a loop of couple images like 4 of them with use of fade in and fade out. This tag has css class so it will be easy to select it wit js. Thanks in advance asked 6 mins agoM.Stark Let's block ads! بخوانید...

ادامه مطلب

Optimize- Get Third Largest Num in Array ~ Javascript

Vote count: 0 So, I was working on this challenge to retu the third largest number in an array. I had got it worked out until I realized that I must account for repeat numbers. I handled this by adding 3 layers of for loops with variables i, j, and k. You'll see what I mean in the code. This is not terribly efficient or scalable. My question is, how can I optimize this code? What other methods should I be using? function thirdGreatest (arr) { arr.sort(function(a, b) { if (a < b) { retu 1; } else if (a > b) { retu -1; } else { retu 0; } }); for ( var i = 0; i < arr.length; i++) { for (var j = 1; j < arr.length; j++) { for (var k = 2; k < arr.length; k++) { if (arr[i] > arr[j]) { if (arr[j] > ...

ادامه مطلب

Google App Script Form not working

Vote count: 0 I am using google app script to create a form for uploading file. This is my Code.gs file: var SPREADSHEET_FILE_ID = '1oQn6OLMzys8tVk1FLriOAmpzFJNazLRP-SwM7--eA58'; var folderId = "0B9TN_-yt-h0WZ0dnWndGWkw3UkE"; function doGet() { var template = HtmlService.createTemplateFromFile('index'); // Build and retu HTML in IFRAME sandbox mode. retu template.evaluate() .setTitle('Web App Window Title') .setSandboxMode(HtmlService.SandboxMode.IFRAME); }; And I am using all other codes almost similar to the url https://script.google.com/d/125dG42eB9lM4SPq64p0dpR2CBH4ohfHiqu9TvFNM8s4Ra7pt-7kHXoTM/edit?usp=sharing. I am getting the following error. 3402363213-mae_html_user_bin_i18n_mae_html...

ادامه مطلب

problems with form and innerHTML on javascript

Vote count: 0 Yesterday i was making a code that shows in a text content what you write in the form input. I wrote this: Show code Try it // the problem with this code is that when you click the button it substitute the text for a few time and then it refresh the page. How can i fix this? asked 31 secs agostep Let's block ads! بخوانید...

ادامه مطلب

Javascript/CSS: Change button to a text field on click?

Vote count: 0 I have a button that I need to change into a text field (Ideally expand into it using an animation) when clicked. Right now I have my button and text field beside each other on the page: echo ''; echo 'Change Password'; echo ''; echo ''; echo ''; I can set the password to hidden at start but I need to know how to make the changePass button "become" or expand into the password text field either using CSS or javascript. I'm new to javascript and am unsure how to accomplish this on button click. How can I change a button to a text field on click? I need to be able to change back to the button afterwards asked 5 mins agoskyguy Let's block ads! بخوانید...

ادامه مطلب

Retrieve text from a file in ps script

Vote count: 0 I have a text file containing some data as follows: test|wdthe$muce check|muce6um#% How can I check for a particular string like "test" and retrieve the text after the "|" symbol to a variable in powershell script? asked 3 mins agoCooluser Let's block ads! بخوانید...

ادامه مطلب

How to use the native java client in order to restore the _source if script_fields is used in elasticsearch query

Vote count: 0 I am looking for a way to use the native elasticsearch client in order to retrieve the source when script fields are used. Here is a way to do it using JSON/http: http://stackoverflow.com/a/11856215/536299 I have not been able to find a way to achieve this through the native java client. Can anyone please help? asked 5 mins agobalteo Let's block ads! بخوانید...

ادامه مطلب

Javascript - Cubic bezier to control points

Vote count: 0 I trying to optimize "SnapSVG path2curve" function with calculate control points. I have alteative way, but it's very slow: '#Demo1': http://bl.ocks.org/mbostock/3916621 So, question is: Path have like "M50,50 C50,10,35,90,55,15" I converted it, but it looks like "[50, 50], [50, 10], [35, 90], [55, 15]". I want control points like '#Demo1'. (It's uses getPointAtLength) Why? For shifting bezier Change bezier points order to more good looking Please help to make this, credits goes to that user. Requirement: JavaScript, Simple (if possible). Alteative search: Convert path to polygon asked 2 mins agoDavlat Shavkatoff Let's block ads! بخوانید...

ادامه مطلب

How to get 10 milisecond older mouse position with pure javascript?

Vote count: 0 I am making a slider that, moves to left when it is swiped to left, and, moves to right when swiped to right. Her is what I've acheived till now https://jsfiddle.net/6ze720f7/ . Although I can now just set position left: 0 when left is displayed and position left: 446 px when Right is displayed. The code that takes care of the direction is: center.onmousemove = function(Dmove) { if (Dmove.pageX < oldx) { direction = "left" } else if (Dmove.pageX > oldx) { direction = "right" } oldx = Dmove.pageX; } What I am worried about is that the difference between oldx and Dmove.pageX is very very small, more precisely the amount of time taken in the execution of a few lines of javscript c...

ادامه مطلب