w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Passing information to another GSP
Instead of doing a forward from controller, you could use render(view:"confirm") at the same line. Your data in params map will be available in the confirm.gsp page.

Categories : Grails

Chrome extension: can't get message passing to work between background script and content script
From onMessage documentation. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse is called). So your code should look like chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { console.log(sender.tab ? "from a content script:" + sender.tab.url : "from the extension"); if (request.greeting == "hello") { sendResponse({farewell: "goodbye"}); return true; } });

Categories : Javascript

Passing around information via JSF FacesContexts
You could enclose a <f:attribute> tag inside your input component and then retrieve the attribute value inside the validator via FacesContext.getCurrentInstance().getAttributes().get(attrname); Syntax for the tag should be <f:attribute name="attrname" value="#{ELexpr}"> Here's a semi complete example validator: public class NameValidator implements Validator { @Override public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { Object value = (String)component.getAttributes().get("FIELD_NAME"); // validate stuff } } and corresponding jsf <h:inputText id="name" value="#{registrationManager.name}"> <f:validator validatorId="nameValidator" /> <f:attribute name="FIELD_NAME" va

Categories : JSF

Passing in a Parameter in Google Spreadsheet Script from Script Assignment
You could do a couple of things - Ask the user for the input using Browser.inputBox Read cell's value from the script itself (if the cell reference is always constant) using an example like SpreadsheetApp.getActiveSheet().getRange("A1")

Categories : Google Apps Script

Passing argument from batch script to PowerShell script fails
Change this command: C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -command "D: estBluebird_1.2.0_RTMReplaceTagsOnConfigFiles.ps1;REPLACE" > C:Temp.out into this: C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -File "D: estBluebird_1.2.0_RTMReplaceTagsOnConfigFiles.ps1" REPLACE > C:Temp.out Is the first command supposed to change the execution policy? If so, you need to specify an actual policy. Set-ExecutionPolicy without any arguments won't work. Besides, it'd be simpler to just add -ExecutionPolicy Bypass to the second command: C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -ExecutionPolicy Bypass -File "D: estBluebird_1.2.0_RTMReplaceTagsOnConfigFiles.ps1" REPLACE > C:Temp.out

Categories : Powershell

Passing information between multiple activities
Here is roughly what your code is doing: Activity 1: Start with no extras Create and save extra called "name" Activity 2: Read name out of extras create and save extra called "current" save the value of name Activity 3: Read the whole bundle of extras Create and save extra called "goal" //Do nothing with the whole bundle Activity 4: Read the whole bundle of extras Inside of Activity 3 you are pulling the values out of extras but not "re-saving" them so that they get passed along to the final activity. So when you get to activity4 the only extra that you should have is "goal" because that is the only one that you added at the end of Activity3.

Categories : Android

Information Passing between Android Activities
That really depends on your needs and how much information. If there is very little information (maybe 2 or 3 pieces of data) I would say using putExtra() is fine and maybe suggest putting them in a Bundle so you don't have to worry about each extra every Activity. If you are dealing with much more than that then I would suggest adding them to a separate class. IMO, it will be much easier to maintain this way, less chances for syntax errors (such as misspelling a "key" parameter) and more flexible if you decide to use the data in other ways. In my current app, it started out using extras, just a few, then grew into many more. It got unmanageable as the data ended up being passed around and used in so many different classes. I just finished up creating a couple separate classes using stat

Categories : Java

Passing form information in a for-loop
You're using the same parameter name over and over again (name=titel - you had a type and probably meant to write as 'title') so when the form submits - only one value will be passed. You can easily fix that by passing the parameters as: ... echo "<tr><td width='150'> <input type='text' name='titel$i' value='$titel[$i]' /> </td></tr> <tr><td><input type='submit' name='submitreg' value='Toon activiteit'/> </td></tr>"; ... and reading it on the other side as title0, title1 etc.

Categories : PHP

Ruby on rails passing information from session into db
You can have the current_user (for example) method: def current_user @current_user ||= User.find_by_id(session[:user_id]) end If you already have this, you can create post with: @post = current_user.posts.create(params[:post]) You should also check, of course, if any user is signed in before creating post, or you'll have NoMethodError.

Categories : Ruby On Rails

Highcharts: passing additional information to a tooltip
I can see it here: tooltip: { formatter: function() { var s = ""; console.log(this.points[0].point.nameList); // ["name1", "name2"] $.each(this.points, function(i, point) { s += point.point.nameList; }); return s; }, shared: true }

Categories : Javascript

Django - passing user related information to many views
You can use a context processor to add data to the template context in a DRY way. In a nutshell, a context processor is simply a function that accepts a request as its first argument, does some additional processing that you add and augments the context with whatever values you want. You can query an objects models, add the current datetime...pretty much anything you can do with Python or Django can go into a context processor.

Categories : Python

Backbone.js destroy not passing model information to server?
The id of your model will be appended to the url when making requests to the server. So the Gets and Puts that are working should be going to: /backbone/notes/4685293923860480 Delete should be going to the same URL, but should not include no information beyond that. You should have enough information on what to delete by the URL that was hit and the method that was used.

Categories : Backbone Js

Passing information from a widget module to the main window
The question is a little bit nebulous, if only because you will have to make some design decisions about how the user will interact with the GUI. A first attempt might involve some of these things: 1) Add a signal to your widget, have it set its own name. When it changes its name, also emit a signal of the new name. class testWidget(QtGui.QLabel): textChanged = QtCore.pyqtSignal(object) def open(self): fileName = QtGui.QFileDialog.getOpenFileName(self, "Open File", QtCore.QDir.currentPath()) if fileName.isNull(): QtGui.QMessageBox.information(self, "test project", "Cannot load %s." % fileName) self.setText(fileName) self.textChanged.emit(fileName

Categories : Python

Passing Map Location information from PHP to javascript for use with Google maps v3 api
Get the values from DB, by using PHP while loop and store the values in a variable as below $location .= '['. $row['latitude'] . ',' . $row['longitude'] . ',"' . $row['city'] . '","' . $row['state'] . '"],' ; In Javascript, assign the PHP variable to a Javascript variable as below. var locations = [<?php echo isset($location)?$location:''; ?>]; var len = locations.length; for (i = 0; i < len; i++) { var image = 'GIVE HERE THE PATH OF IMAGE'; marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: image }); google.maps.event.addListener(marker, 'mouseover', (function(marker, i) { return function() { infowindow.setContent(content); infowindow.open(map, marker);

Categories : PHP

A reliable way of sorting an array and passing that information to a view
Your double-loop preserves the order of paintingJobs in customerRecords, though unless you have duplicate customerList ID's, looks somewhat inefficient (why no break?). This means changes to the order of paintingJobs before your double loop will be reflected in customerRecords. Changes after will not. paintingJobs.sort(however); for(var i=0; i<paintingJobs.length; i++) { for(j=0; j<customerList.length; j++) { if (customerList[j].ID == paintingJobs[i].CustomerID) { customerRecords.push(customerList[j]); break; // next paintingJob } } } It looks like the items in customerList are Objects, so if you make a change to an Object in customerList, this change will also appear in customerRecords even after your double loop.

Categories : Javascript

Passing information between HTML 5 Video and form textarea
This fiddle should get you headed in the right direction. http://jsfiddle.net/3n1gm4/kLWL4/ JS: (function() { var theText = document.getElementById('text1'); var theVideo = document.getElementById('video1'); theText.addEventListener('focus', function(e) { curTime = theVideo.currentTime; curSecs = Math.floor((curTime % 60)); curTimeText = " " + Math.floor( curTime / 60 ) + ":" + ((curSecs < 10)?'0'+curSecs:curSecs); theText.value = theText.value + curTimeText; }); })(); HTML: <video width="100%" controls id="video1"> <source type="video/mp4" src=""> </video> <textarea id="text1" cols="20" rows="10"></textarea>

Categories : Javascript

Range constraint and variable management when passing information from macro to userform to worksheet
I am concerned that the focus might in some (unknown) circumstance shift to another open worksheet and the text will be pasted where it does not belong. Not really sure what you are asking. But you can further define your range variable by using: Workbooks("Book1.xlsm").Worksheets("Sheet1").Range("B7").Value = strValue or Workbooks(wkbSaba).Worksheets(shtCourse).Range("B7").Value = strValue That will ensure it goes to the right workbook and worksheet. I'm not sure why you think you need public variables? EDIT: UserForm Code: Private wsSheet As Worksheet Property Let SetWorksheet(wsSheetPass As Worksheet) Set wsSheet = wsSheetPass End Property Private Sub cmdOK_Click() Dim strValue As String strValue = CourseDescription.Value If strValue <> ""

Categories : Excel

Unity3D Passing Value Script to Other Script
As you said that Hero is attached to another game object, you need to get the reference from this other object. Assuming GameObject hero is the one the containing Hero component, than you need: Hero obj = hero.GetComponent<Hero>(); Assure that you have dragged the game object of hero to the member hero of the ball controlling game object. Anyway life would be easier if you declare public Hero hero instead of public GameObject hero and drag the game object of hero to it. Than you don't need to call GetComponent but can use it directly.

Categories : C#

Grab information from a php script and display on a winform
try WebClient using(var client = new WebClient()) { String result = client.DownloadString("www.foosite.com/page.php"); }

Categories : C#

MongoDB execute script returns _mongo and _db information
It appears that some objects can't be returned "as is" using JS. In this case Mongo return the Cursor Try: var indexes = db.organisation_booking_indexes.find(query).toArray(); This will convert the result in a "compatible" object. Take a look at this post to get more details: MongoDB: Error executing stored JavaScript function

Categories : Mongodb

How do I create a Google Script to move information from one sheet to another?
I would start by working through the spreadsheet tutorial for reading/writing. It should walk you through creating the script and the code to access your spreadsheets. From there you might figure out what more specific questions you have: https://developers.google.com/apps-script/guides/sheets

Categories : Google Apps Script

Retrieving information with the ProfilesApp Library in Apps Script
So I think you want to handle the case where there's no data held. Here's a one liner example for a work phone number that you can apply to any similar scenarios. It works like this: if getPhones(...) returns one or more PhoneFields then assign the first phone number to the variable workPhoneNumber otherwise assign an empty string. //gets first work phone number from a ProfilesApp Profile var workPhoneNumber = profile.getPhones(ContactsApp.Field.WORK_PHONE).length > 0 ? profile.getPhones(ContactsApp.Field.WORK_PHONE)[0].getPhoneNumber() : '';

Categories : Google Apps Script

Accessing product and category information from a custom PHP script in Magento
You are most likely looking for a product collection, which is a Magento data structure that contains a grouping of products: $collection = Mage::getModel('catalog/product')->getCollection(); $collection->addAttributeToSelect('*'); $collection->addStoreFilter(8); foreach ($collection as $product) { Zend_Debug::dump($product->getData()); } $categories = Mage::getModel('catalog/category')->getCollection(); foreach ($categories as $category) { Zend_Debug::dump($category) } The product object in Magento is fairly complex, given Magento's EAV data structure.

Categories : PHP

How can I pull information from spreadsheets in multiple folders in google script?
I am quite newbye in this, but I think you'll have to do an iteration throught the subfolders: var folder = DocsList.getFolders(masterfolder) Here you dont't get one single folder; you get a set of them and you have to iterate trhout it with a for bucle. Something like: for f in folders { f.getfiles...... ... } SURE you will get more precise answer. Enrique

Categories : Google Apps Script

Get client information from a Greasemonkey script (local machine name, Firefox profile)
No. You cannot read the local machine name, nor Firefox profile name, nor Firefox profile directory using javascript or Greasemonkey. If you could access this information, it would be at least a "sec-moderate" security breach. So, if you figure out a hack for this, let us know immediately, so we can shut you down. ;)

Categories : Javascript

Powersehll script to execute an exe with multiple arguments and gets the argument information from excel
Sounds too simple, but did u try this? $path = C:pathexecuter.exe &$path --ApplicationName='Application1' --Version='20.2.1 -Env="" --filpath="C:path" -reportname="Report.pdf" If that works you could substitute single parameters with variables from the excelsheet.

Categories : Powershell

Invoke one PowerShell script from Another PowerShell script with passing arguments
PS C:> gc . est2.ps1 . est1.ps1 'foo' Write-Host 'bar' PS C:> gc . est1.ps1 $a = $ARGS[0] -split '' [array]::Reverse($a) Write-Host ($a -join '') PS C:> . est2.ps1 oof bar

Categories : Powershell

Passing a value to a php script
<form action="delete_item.php"> <input type="hidden" value="$row['id']" name="uid" > <input type="image" src="images/delete.png"> </form> The unique id is placed in a hidden input. You can get this value using $_POST['uid'] But you need to submit the form <input type="submit" name="submit" value="delete" ">

Categories : PHP

Passing a var from script in classic asp?
The reason that this fails is because the second script, the one between <% and %>, is a server-side script that executes on the server. It's executed as the page is emitted from the server. The value you're trying to grab exists only in the browser, so therefore this fails. Rather than doing this in a server-side script, you need to call a method on the server, or call the page a second time, passing the value you want to insert.

Categories : SQL

Passing Nil Arguments to Lua Script on Redis?
No, command line arguments will always be a string, even if you pass arguments like this: lua script.lua "test argument" "" "end" You will still get argv[1] = "test argument" argv[2] = "" --empty string argv[3] = "end" In this case, argv[4] = nil, but I don't think this is what you want, as the program expects a non-nil argument at the end. So why not set some flag strings to stand for nil in your script, e.g, use the string "nil" as a flag, so you can test in your script: if argv[1] ~= "nil" then return argv[1] end

Categories : Lua

Java script Passing a variable
Add your class in the clicked element and check its state. $('#c1').click(function(e) { var that = $(this); if( that.hasClass('active_circle') ) { that.removeClass('active_circle'); // Reset circle to normal state } else { that.addClass('active_circle'); // Resize circle } });

Categories : Javascript

Passing extra arguments to Waf script
I figure out how to do this. In the wscript, create a function for options. In most cases this function should already exist. def options(opt): opt.add_option('-f', '--flag', dest='custom_flag', default=False, action='store_true', help='a boolean option') Now in the configure function, you could simply check for 'custom_flag' to be true if this argument was passed. def configure(conf) if (conf.options.custom_flag): #do something else: #do something else Now './waf configure --flag' will set the custom_flag to True. It is also possible to pass other non-boolean type arguments

Categories : Misc

Passing an id to a PHP script using jQuery/Ajax
That isnt an error, but a notice, which is lowlevel It simple means $_GET['id'] doesnt hav a value echo $example['something']; // will give undefined index notice $example['something'] = 'abc'; echo $example['something']; // No notices Your website should be domain.ext/?id=123, if not, this notice will show.

Categories : Javascript

Passing a 2D array from one Perl script to another
Method 1: Have a look at the standard module Data::Dumper, it's ideal for what you want. Save your data structure in a temporary file using Data::Dumper and then read it in your second script. Method 2: Using Storable to store array in first script and retrieve it from other. Edit (after you provided your code): See you can access the array like this master.pl #!/usr/local/bin/perl use strict; use warnings; use Storable; my @inputarray = ([1, 2, 3], [4, 5, 6], [7, 8, 9]); store (@inputarray, "/home/chankey/child.$$") or die "could not store"; system("perl", "child.pl", $$) == 0 or die "error"; child.pl #/usr/local/bin/perl use strict; use warnings; use Storable; use Data::Dumper; my $parentpid = shift; my $ref = retrieve("/home/chankey/child.$parentpid") or die "coudn't retrieve

Categories : Perl

Passing a value of to a java script function
You have to understand that while some XSLT processors like Microsoft's MSXML support the use of extension function implemented in JScript inside of XSLT you simply have access to the objects and methods the JScript engine implements. alert is not a JScript function, it is a function exposed to JScript inside of the browser. So there is no alert available in JScript extension functions to XSLT, you have the objects, functions and methods documented in http://msdn.microsoft.com/en-us/library/hbxc2t98%28v=vs.84%29.aspx. To give you an example, http://home.arcor.de/martin.honnen/xslt/test2013072701.xml is an XML document referencing an XSLT 1.0 stylesheet that with Mozilla uses some EXSLT extension function and that with IE uses an extension function implemented in JScript. The stylesheet

Categories : Javascript

Passing date to shell script from crontab
I tried it and it worked fine for me, on Fedora 18. You could try a couple of alternatives: date=$(date --date="next day" +"%Y-%m-%d") 40 12 * * * ~/test.sh 1 $date Or 40 12 * * * ~/test.sh 1 `date --date="next day" +"%Y-%m-%d"` Or 40 12 * * * ~/test.sh 1 $(date --date="next day" +"%Y-%m-%d")

Categories : Shell

Passing values of checkboxes to Perl Script
Change self.location='/cgi-bin/hw.pl?tcs=tclist'; to self.location='/cgi-bin/hw.pl?tcs=' + tclist; But please take a look at the other comments. First off, you should be using a form. Second, why use JavaScript at all? If you stuff your checkboxes in a form, their values will be submitted without any client side scripting.

Categories : Javascript

Passing an environment-variable into a php commandline script
Don't use $ in the export command, it should be: export APP_ENV You can combine this with the assignment: export APP_ENV="development" With the $, you were effectively doing: export development

Categories : PHP

Passing arguments to Python script in Java
Last argument in your below call is for command line arguments: PythonInterpreter.initialize(System.getProperties(), System.getProperties(), new String[0]); From PythronInterpreter javadocs: initialize public static void initialize(Properties preProperties, Properties postProperties, String[] argv) Initializes the Jython runtime. This should only be called once, before any other Python objects (including PythonInterpreter) are created. Parameters: preProperties - A set of properties. Typically System.getProperties() is used. preProperties override properties from the registry file. postProperties - Another set of properties. Values like python.home, python.path and all other values from the registry

Categories : Java

Passing an array to a slave python script
The only reason to use a separate process is if you need parallel processing. If you do need that, then if you're managing lots of workers, use something like celery. If you do find it appropriate to roll your own, you need to reduce what you want to send to a textual representation. I suggest using the json module. If you don't need a separate process, just import the other python module, and access its functionality directly in code (it should already by wrapped up in functions).

Categories : Python



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.