parameter-passing

How to pass KeyCode via TextBox.OnKeyUp property in MS-Access VBA

戏子无情 提交于 2019-12-02 02:53:57
问题 In MS Access, I use VBA to set an event handler function for multiple TextBoxes: txtMyTextBox.OnKeyUp = "=myEventHandlerFunction()" So far, this works fine. However I want to pass the KeyCode of the key that has been pressed. When I create "usual" KeyUp events manually for a TextBox, it automatically provides KeyCode As Integer and Shift As Integer . I was expecting that these could be used with the OnKeyUp property as well, like this: txtMyTextBox.OnKeyUp = "=myEventHandlerFunction(KeyCode)"

How to check if a linked list is a palindrome or not in Java?

老子叫甜甜 提交于 2019-12-02 02:26:16
I wrote a code to check if a singly linked list is a palindrome. And I made two steps: 1st. reverse the original linked list. 2nd. Check if the original and reversed linked list have the same element. public static Boolean isPalindrome(Node input){ Node reversed= reverse(input); while (input!=null){ if(input.item!=reversed.item) return false; input=input.next; reversed=reversed.next; } return true; } static Node head; public static Node reverse(Node input){ if(input==null || input.next==null){ head=input; return input; } else{ reverse(input.next); input.next.next=input; input.next=null; return

JSP: Make a reusable code (tag, macro) and use it on the same page

南笙酒味 提交于 2019-12-02 02:23:40
问题 Is there any way to make some sort of parametrized macro on one JSP page and reuse it few times on the same page. JSP tags could be used but I would have to make one file per tag. 回答1: I've been wanting this functionality for years, and after googling yet again, I wrote my own. I think tag / jsp files & custom tag classes are great, but are often overkill for simple one-offs like you describe. This is how my new "macro" tag now works (here used for simple html rendering of sortable table

Using Globals instead of passing large arrays in Matlab

こ雲淡風輕ζ 提交于 2019-12-02 01:54:06
问题 I am using large arrays (about 70 MB each) and am worried about passing them to functions. My understanding is Matlab uses pass-by-value function arguments, making local copies for the called function. As a dirty workaround, I've been declaring the large arrays as global, and manually de-allocating them when computations are completed. My question: Is there a way to use pointers in Matlab? This is how I would do it in C/C++. If not, are there other more memory efficient methods? I've read

Push doesn't modify the list being a function argument

无人久伴 提交于 2019-12-02 01:21:53
I'm new to common lisp, so hope someone would clarify this to me: say we have a list and want to add an item with push to modify it: CL-USER> (defparameter xx '(1 2 3)) XX CL-USER> xx (1 2 3) CL-USER> (push 100 xx) (100 1 2 3) CL-USER> xx (100 1 2 3) as expected. But when i try to do the same with the function, it doesn't modify a list: CL-USER> (defun push-200 (my-list) (push 200 my-list)) PUSH-200 CL-USER> (push-200 xx) (200 100 1 2 3) CL-USER> xx (100 1 2 3) so i tried to compare argument and my list like this: CL-USER> (defun push-200 (my-list) (format t "~a" (eq my-list xx)) (push 200 my

Pass parameter to BLOB object URL

一笑奈何 提交于 2019-12-01 21:58:03
Say I've got a reference to a html file as a Blob b and I create a URL for it, url = URL.createObjectURL(b); . This gives me something that looks like blob:http%3A//example.com/a0440b61-4850-4568-b6d1-329bae4a3276 I then tried opening this in an <iframe> with a GET parameter ?foo=bar , but it didn't work. How can I pass the parameter? var html ='<html><head><title>Foo</title></head><body><script>document.body.textContent = window.location.search<\/script></body></html>', b = new Blob([html], {type: 'text/html'}), url = URL.createObjectURL(b), ifrm = document.createElement('iframe'); ifrm.src =

How to use HTML forms without a server

跟風遠走 提交于 2019-12-01 21:35:57
I am not a web-developer and want to understand the better way to pass variables. In the past I have used various ways to pass things to java script functions. I have never used forms as I always associated them with server and databases. I have a website in which user selections change the contents of the website. I am wondering if you can use forms without any server just as a way to pass a few things to a javascript function where they are used to change the page content. For basic example, if someone selects male the page background becomes blue, if they choose female the background

MySQL load data: This command is not supported in the prepared statement protocol yet

怎甘沉沦 提交于 2019-12-01 21:34:51
I'm trying to write a MySQL script to import data into a table for my Linux server. Here is the script named update.sql : SET @query = CONCAT("LOAD DATA LOCAL INFILE '", @spaceName, "' INTO TABLE tmp FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';"); PREPARE stmt FROM @query; EXECUTE stmt; DEALLOCATE PREPARE stmt; And also, I write a bash script named main.sh : mysql -h "localhost" -u "root" "-pmypassword" "mydb" -e "set @spaceName=\"$1\";source update.sql;" Then I execute ./main.sh France.list . The France.list is the data file that I'm trying to import into my database. However I get an

Can I pass Promises to jQuery.when(), or only Deferreds?

家住魔仙堡 提交于 2019-12-01 21:05:31
The documentation for jQuery.when() says that this function takes Deferreds. However, it also says later on that: If a single argument is passed to jQuery.when() and it is not a Deferred or a Promise... which seems to imply that it can take Promises as well. But Promises are not Deferreds - they have a subset of the Deferred's methods. I guess you could say that a Deferred is a Promise, but a Promise is not a Deferred. Questions: Can $.when() take either Promises or Deferreds? This seems to work in my testing. Is there a bug in the doc? I think it should say that $.when() takes Promises, not

Using Globals instead of passing large arrays in Matlab

隐身守侯 提交于 2019-12-01 20:52:38
I am using large arrays (about 70 MB each) and am worried about passing them to functions. My understanding is Matlab uses pass-by-value function arguments, making local copies for the called function. As a dirty workaround, I've been declaring the large arrays as global, and manually de-allocating them when computations are completed. My question: Is there a way to use pointers in Matlab? This is how I would do it in C/C++. If not, are there other more memory efficient methods? I've read that globals are generally a bad idea. @mutzmatron answered my question in a comment, so this is a repost: