Posts

More SVG questions (and Javascript) - Interactivity [moving a rectangle] -

The following code should be rectangularized while pressing WASD keys on the keyboard. This does not work, the rectangle is not transferred, but no error occurs. How can I do this work? & lt ;? Xml version = "1.0" encoding = "UTF-8" standalone = "no"? & Gt; & Lt ;! DOCTYPE svg PUBLIC "- // W3C / DTD SVG 1.1 / n" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> & Lt; Svg width = "90%" height = "90%" version = "1.1" xmlns = "http://www.w3.org/2000/svg" & gt; & Lt; Script type = "text / javascript" & gt; & Lt ;! [CDATA [var x; Var y; Function moves () {x = new number (document.getElementById ("player").); Y = new number (document.getElementById ("player"). Y); Switch (event.keyCode) {Case 119: y--; Document.getElementById ("player") y = y break; Case 115: y ++; Document.getElementById ("player") y = y break...

Perl: Store column from Mysql-table in Perl-Hash -

I have problems with MySQL and Perl. I am coding a web crawler and I want to save the Tudo-list in the MySQL table. Now, at the beginning of the script, I want to load mySQL from MySQL in Pearl hash, so that I do not filter the URL again. The following is the structure: The table "todo" - unique ID "todoid" - TODO-urls "todourl" ToDo hash in Pearl is like this: My% todo = (); $ VAR1 = 'http://www.example.com/661/'; How can I load all mysql-table URLs in my own hash? You can use DBI, like Allen has suggested, but with less code: $ todo = $ dbh- & gt; Select all_hashref ('select todoid, todoourl fROM todo', 'todoid'); As you can see, I did not use DBI's preparation, execution, fetch and finish because the selectall_hashref method does all this for us. View online documentation:

javascript - Check what item is next to be deleted with delete key press -

I am working with a content editable area (especially in chrome) If I capture the deleted key press, is it possible to know what the next element or text is to be removed? What I really want to test is to remove the next item & lt; Div class = "clearfix" & gt; & Lt; / Div & gt; Then I do not want to delete it. I was looking at Tracy selection here: but it was not really clear how to implement it, what should I also see. Do not ignore friends. It was a dumb question. It is just so necessary that if I am the current node I am finally, so I can not do anything Sometimes I make things more complicated that are actually in reality. Something worked for me: if (event.keyCode == 46) {var s = document.getSelection (); If (S. Charoffset == s.anchorNode.length) {return false; }}

c# - WPF comparing strings in separate files -

I have 2 files with a CSV file and the other is a text file. I need to know that I want to know whether the contained strings contained in the CSV file are present in the text file or not. After doing this check, I want to add those CSV strings which are present in the INMemable collection in the text file which I will use for binding. For example, if CSV Connets "AA", "BB", "CC" and "BB", "EE", "FF", "CC", "BB" in my text "BB", "CC" Should be "bb" I have made a start by reading the CSV file using code below. Can any solution provide PLS? Thanks - Ben public class VM {public VM} {words = load word (file path); } Public IEnumerable & lt; String & gt; Word (get; private set;) string filePath = @ "Z: \ My document \ Words.csv"; Private static IEnumerable & lt; string & gt; load word (string filespath) {list & lt; string & gt; Word = new lis...

Java DataInputStream methods in C# BinaryReader -

Is Java DataInputStream Reading Completely equivalent to the C #BinReader? What is Java DataInputStream icon and C # BinaryReader or Reset the same methods in the stream? see there is no such object Whatever this behavior is in .net, you should implement it by itself.

authentication - PHP authenticating with LDAP -

I am relatively new to PHP and there is even more for LDAP and one page is accessible only to certified users Need to create. / P> All I'm working on is the following command on the console: $ ldapsearch -b 'dc = ut, dc = ee' -D 'uid = USER, or = People, Dc = ut, dc = ee '-x -w' password '' UID = User '' 'Details' So far I've successfully used and set ldap_connect That is using this protocol version 3. I've played with ldap_search and ldap_bind, but all attempts are unsuccessful. I think it's starting to be due to the -x and -w option, or LDAP is still really confusing me. Any sign will be deeper than that! $ username = 'user'; $ Password = 'passwd'; $ Account_suffix = '@ example.com'; $ Hostname = 'ldap.example.com'; $ Con = ldap_connect (hostname); If (! Is_resource ($ con)) trigger_error ("Unable to connect to $ hostname", E_USER_WARNING); Ldap_set_option ($ co...

inheritance and polymorphism java -

I have my base class, the customer's address, in it there are 3 sub-sections account 1, account 2 and acount3. When I go through a loop, to check everybody's every type and then properly assigning it, I finally get empty data fields. Is such a thing possible? public static and readFile (string filename, customer [] review) throws IOException {scanner scan = new scanner (new file (filename)); * * * Read separate records separately * / Customer first = new customer (); Account 1 first 1 = new account 1 (); Account 2 First 2 = New Account 2 (); Account 3 First 3 = New Account 3 (); String [] a = scan NXTIN () Partition ("="); First.set_account_id (Integer.parseInt (a [1] .trim ())); A = Scan. NXTIN (). Partition ("="); First.set_name (a [1] .toUpperCase () trim ().); A = Scan. NXTIN (). Partition ("="); First.set_address (a [1] .trim ()); A = Scan. NXTIN (). Partition ("="); First.set_accType (a [1] .trim ()); If (first .get_accType...