I have a jquery code that gets json data and list them in a ul list. I want to populate this Items on click.  $('#places) is a ul list.   $.each(data, function (id, item) {                      $('#places').append('&lt;a href="#" class="list-group-item" data-lat=' + item.lat + ' data-lng=' + item.lng + '&gt;' + item.name + '&lt;/a&gt;');       });    Ul list items are links that included latitude and longitute values. I want to add click event to that links. Which I click link zoom to that location. How can add event?
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
I would like to install Office 2015/365 on Ubuntu 15.04. I tried to install Office using Wine, but that did not work. Please note that I do not want virtualisation unless it has a -like behaviour, where application windows are treated like regular Ubuntu application windows by the system. Captured variable in a loop in C# I met an interesting issue about C#. I have code like below.  List&lt;Func&lt;int&gt;&gt; actions = new List&lt;Func&lt;int&gt;&gt;();  int variable = 0; while (variable &lt; 5) {     actions.Add(() =&gt; variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable? What is the difference between sourcing ('.' or 'source') and executing a file in bash? What is the role of NS records at the apex of a DNS domain? $ORIGIN example.com. ; not necessary, using this to self-document  $TTL 3600 @        IN     SOA   ns1.example.com. admin.example.com. (                       1970010100 7200 1800 1209600 300)  @        IN     NS   ns1.example.com. @        IN     NS   ns2.example.com.  @        IN     A    198.51.100.1 ns1      IN     A    198.51.100.2 ns2      IN     A    198.51.100.3  sub1     IN     NS   ns1.example.edu.  sub2     IN     NS   ns1.sub2 ns1.sub2 IN     A    203.0.113.1 ; inline glue record   The role of a NS record beneath the apex of a domain is well-understood; they exist to delegate authority for a subdomain to another nameserver. Examples of this above would include the NS records for sub1 and sub2. These allow the nameserver to hand out referrals for portions of the domain that it does not consider itself authoritative for.  The purpose of the NS records at the apex of a domain, ns1 and ns2 in this case, seem to be less understood by the internet at large. My understanding (which may not be holistic) is as follows:   They are not used by caching DNS servers in order to determine the authoritative servers for the domain. This is handled by , which is defined at the registrar level. The registrar never uses this information to generate the glue records. They  used to delegate authority for the entire domain to other nameservers. Trying to do so with software such as ISC BIND will not result in the "expected" referral behavior at all, as the nameserver will continue to consider itself authoritative for the zone. They are not used by the nameserver to determine whether it should return authoritative responses (AA flag set) or not; that behavior is defined by whether the software is told to be a master or a slave for the zone. Most nameserver software will quite happily serve apex NS records that disagree with the information contained by the upstream glue records, which will in turn cause well-known DNS validation websites to generate warnings for the domain.   With this being the case, what are we left with? Why are we defining this information if it doesn't appear to be consumed by caching DNS servers on the internet at large? Problem to launch java at Debian: "error while loading shared libraries: libjli.so" As every American teenager "knows" there is no speed limit on the Autobahn. My understanding, however, is that there is still such a thing as excessive speed even on this free-for-all.   So, ignoring the practical "don't be an idiot" and "don't drive faster than you can handle," at what speeds would die Polizei be pulling you over?  Bonus points for translating km/hr into miles/hr. A single row background colour I have an instance of an application running in the cloud on Amazon EC2 instance, and I need to connect it from my local Ubuntu. It works fine on one of local ubuntu and also laptop. I got message "Permission denied (publickey)" when trying to access SSH to EC2 on another local Ubuntu. It's so strange to me.  I'm thinking some sort of problems with security settings on the Amazon EC2 which has limited IPs access to one instance or certificate may need to regenerate.  Does anyone know a solution? Continuous v. per-chapter/section numbering of figures, tables, and other document elements Some document elements (e.g., figures in the book class) are numbered per chapter (figure 1.1, 1.2, 2.1, ...). How can I achieve continuous numbering (figure 1, 2, 3, ...)?  And vice versa: Some document elements (e.g., figures in the article class) are numbered continuously. How can I achieve per-section numbering?  \documentclass{book}% for "vice versa" variant, replace `book` with `article`  \begin{document}  \chapter{foo}% for "vice versa" variant, replace `\chapter` with `\section`  \begin{figure} \centering \rule{1cm}{1cm}% placeholder for graphic \caption{A figure} \end{figure}  \end{document}   Bonus question: Is it possible to adjust the numbering of the sectioning headings themselves? Can I, e.g., switch from per-chapter to continuous numbering of sections in the book class? I have just had my broadband upgraded to  which means my router has had to change. Previously I was using a Thomson TG585v7 ADSL thingy provided by my ISP. One nice thing about that router was that it would act as a local DNS and allow me to find my other machines on the network by using &lt;hostname&gt;.lan instead of IP addresses.  I've now switched to a Linksys WRT320N ethernet router which connects to my fibre modem, and which I've updated to the latest firmware (1.0.04). I have 2 machines on the network which I regularly want to connect to each other; one is running Windows 7 and the other is running OS X Lion.  The problem I'm having is that I'm unable to connect to my Win7 machine from the OS X machine using the Win7 machine's name. However, I'm able to ping the OS X machine from my Win7 machine using the hostname. How does lookup in $PATH work under the hood? There're way too many articles/resources on the web that teaches people HOW to set the environment variable PATH so that they can use the short hand of java or python etc instead of the absolute path in command line interface.  What I'm interested to know is that what's behind the scene when we type in the command and hit enter (similar to ).  Here is my guess:   read the command (parse/preprocess stdin to get the right arguments $@) command lookup command execution (program started, consume memory, stdout/stderr to shell) re-render the emulator by relevant environment variables (e.g. $PS#, $PROMPT, etc)   The part I want to figure out most is the command lookup. Obviously, the $PATH is consumed by some background function and separated by : / ;as delimiters, then what happened? Do we use a hash table (key: basename of the file, value: absolute dirname of the file) to store the binary files under those PATHs, or some other hooks?   NOTE: I originally thought it was hash table as I can use [ -z hash [command] ] to check if a command is available in current env, but when I use hash | grep python I get nothing from the output while which python works as anticipated. (I think the mechanism might be shell specific, but I want to get more insights into it.) Where was this picture taken (screensaver on LG Oled TV)? Can someone please tell me where this picture was taken? Add a Texture to an Object using Python and Blender 2.8 i have trouble to get a script working within Blender 2.8. The following function work perfectly for me in Blender 2.79, but not in 2.8.  def CreateMaterialFromImage(matName, imgPath):     '''Creates and returns a material from an Image'''     realpath = os.path.expanduser(imgPath)     try:         img = bpy.data.images.load(realpath)     except:         raise NameError("Cannot load image %s" % realpath)      # Create image texture from image     cTex = bpy.data.textures.new(matName, type='IMAGE')     cTex.image = img      # Create material     mat = bpy.data.materials.new(matName)      # Add texture slot for color texture     mtex = mat.texture_slots.add()     mtex.texture = cTex     mtex.texture_coords = 'UV'     mtex.use_map_color_diffuse = True     mtex.use_map_color_emission = True     mtex.emission_color_factor = 0.5     mtex.use_map_density = True     mtex.mapping = 'FLAT'     return mat   It seems to be that the material.texture_slots were removed.  Under following Link  i found the note:        Texture slots for materials, lamps and world were removed. They remain   for brushes, particles and freestyle linestyles.      So my question is where do i find this property now or how could i change my code to get things done?  Thanks for your help!  EDIT:  This seems to be an interesting link for people run in to issues by updating their scripts to 2.8. Unfortunately there is no solution for my problem listed, yet. Pullback of locally free sheaves is locally free states that if $f:X \rightarrow Y$ is a morphism of ringed space, $G$ is a locally free $O_Y$-module, then $f^*G$ is a locally free $O_X$ module.     Suppose that $G$ is a locally free $O_Y$ module, hence it is a free $O_Y|_U=O_U$ module. We have an induced map  $$f^{-1}(U) \rightarrow U$$ given by restriction of morphism of ringed spaces.   Hence, as $\bigoplus O_U \simeq G|_U$, $f^*:Mod(O_U) \rightarrow Mod(O_{f^{-1}(U)})$ is functorial, $f^*(G|_U) = (f^*G)|_{f^{-1}(U)}$, we have isomoprhism,  $$ \bigoplus O_{f^{-1}(U)} \simeq (f^*G)|_{f^{-1}(U)} $$ Normally to remove files with spaces in their filename you would have to run:  $ rm "file name"   but if I want to remove multiple files, e.g.:  $ find . -name "*.txt" | xargs rm   This will not delete files with spaces in them. I'm a student who uses the laptop all the time and I have a problem with Wifi on the laptop. I don't really know what it is. I can describe the problem tho. For example, i closed my laptop last night, so it goes in suspend mode. I turn it on this morning and my wifi doesn't want to connect until I restart the laptop. It says that it's connecting and in Wifi settings the circle animation is spinning, turning Wifi off and on doesn't do anything. Here's what happens when I check to see my network info: sudo lshw -C network   *-network                         description: Wireless interface        product: Wireless 3160        vendor: Intel Corporation        physical id: 0        bus info: pci@0000:02:00.0        logical name: wlp2s0        version: 83        serial: 00:1e:64:e6:1c:93        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless        configuration: broadcast=yes driver=iwlwifi driverversion=5.4.0-52-generic firmware=17.3216344376.0 ip=192.168.0.14 latency=0 link=yes multicast=yes wireless=IEEE 802.11        resources: irq:129 memory:df100000-df101fff   *-network        description: Ethernet interface        product: RTL810xE PCI Express Fast Ethernet controller        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:03:00.0        logical name: enp3s0        version: 07        serial: f8:ca:b8:52:72:49        capacity: 100Mbit/s        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=r8169 firmware=rtl8106e-1_0.0.1 06/29/12 latency=0 link=no multicast=yes port=MII        resources: irq:17 ioport:d000(size=256) memory:df000000-df000fff memory:d0000000-d0003fff  Also I have to mention that my Linux is doublebooted alongside Windows 10, but I don't think that makes any difference. Help would be much appreciated, I wouldn't want to miss my classes because of this hahah Thanks! How can I install the Social-Engineering Toolkit (SET)? There is this software (SET) from Backtack 5 source that I found out about. But I don't know how to install this thing. Could somebody help me?  Here the link: One problem I have found when learning calculus is that there are many different ways to denote the derivative. If $y=f(x)=x^2$, then we could write \begin{align} f'(x)&amp;=2x \\ y'&amp;=2x \\ \frac{df}{dx}(x)&amp;=2x \\ \frac{df(x)}{dx}&amp;=2x \\ \frac{d}{dx}f(x)&amp;=2x \\ \frac{dy}{dx}&amp;=2x \end{align} And this is just Lagrange and Leibniz's notations alone. What I find troubling is that they all seem to be suggesting subtly different things about what the derivative actually is. Is it a function, a limit of a quotient, or both? In the interests of keeping my post brief, I'll focus my attention on $f'(x)=2x$ and $\frac{dy}{dx}=2x$, as these seem to be the most common notations.  $$ f'(x)=2x $$  It does make sense to think of the derivative as the gradient function: $$ f'\colon x\mapsto\lim_{\Delta x \to 0}\frac{f(x+\Delta x)-f(x)}{\Delta x} $$ In this case the limit expression is equal to $2x$, and so we can write $$ f' \colon x \mapsto 2x $$ However, this notation seems a little counter-intuitive when we consider what it means to differentiate a function with respect to a variable other than $x$. If I ask what is the derivative of $f(x)$ with respect to $\frac{x}{2}$, does this question make sense? Is it simply $f'(\frac{x}{2})$? Or do we have to express $x^2$ in terms of $\frac{x}{2}$? And how can we can express this derivative using Lagrange's notation?  $$ \frac{dy}{dx}=2x $$  There are many things which are nice about Leibniz's notation, including the fact that it is explicit which variable you are differentiating with respect to. However, in this case, it is unclear whether we are talking about a function, or something else entirely. There are other issues. Some people say they dislike the Leibniz formulation of the chain rule $$ \frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx} $$ saying that they find it to be inaccurate. I don't really understand why this is the case. Could someone please elaborate? Is SHA-256 secure as a CTR block cipher? Generate a 256-bit random nonce. XOR it with a 256-bit reusable symmetric key. This is x.  We represent numbers in simple binary instead of a counting function. 0 in dec = [256 zeros] in binary, 1 = [255 zeros]1, 23092348 = [241 zeros]1011000000101110001111100, etc.  For each nth block needed for the length of the plaintext, XOR x with n and hash it with SHA-256 to form b[n].  Let p[n] be the nth 256-bit block in the plaintext and c[n] be the nth block in the ciphertext. Then c[n] := b[n] XOR p[n].  Send the unencrypted nonce along with the ciphertext.  To decrypt c[n], XOR it with b[n] to retrieve p[n].  Is this secure? If so, then why do we need AES-256?  If this is not secure, then is there any mode of operation for which SHA-256 is secure as a block cipher? Specifically, it would need to be used in cipher feedback, output feedback, or any other mode that only uses the cipher in the encryption direction. Very large log files, what should I do? ( deals with a similar issue, but it talks about a rotated log file.)  Today I got a system message regarding very low /var space.   As usual I executed the commands in the line of sudo apt-get clean which improved the scenario only slightly. Then I deleted the rotated log files which again provided very little improvement.  Upon examination I find that some log files in the /var/log has grown up to be very huge ones. To be specific, ls -lSh /var/log gives,   total 28G -rw-r----- 1 syslog            adm      14G Aug 23 21:56 kern.log -rw-r----- 1 syslog            adm      14G Aug 23 21:56 syslog -rw-rw-r-- 1 root              utmp    390K Aug 23 21:47 wtmp -rw-r--r-- 1 root              root    287K Aug 23 21:42 dpkg.log -rw-rw-r-- 1 root              utmp    287K Aug 23 20:43 lastlog    As we can see, the first two are the offending ones. I am mildly surprised why such large files have not been rotated.  So, what should I do? Simply delete these files and then reboot? Or go for some more prudent steps?  I am using Ubuntu 14.04.  UPDATE 1  To begin with, the system is only several months old. I had to install the system from scratch couple of months back after a hard disk crash.  Now, as advised in ,  I first checked the offending log files using tail, no surprise there. Then, for deeper inspection, I executed this script from the .  for log in /var/log/{syslog,kern.log}; do    echo "${log} :"   sed -e 's/\[[^]]\+\]//' -e 's/.*[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}//' ${log} \   | sort | uniq -c | sort -hr | head -10 done   The process took several hours.  The output was in the line of,   /var/log/syslog : 71209229  Rafid-Hamiz-Dell kernel:  sda3: rw=1, want=7638104968240336200, limit=1681522688 53929977  Rafid-Hamiz-Dell kernel:  attempt to access beyond end of device 17280298  Rafid-Hamiz-Dell kernel:  attempt to access beyond end of device    1639  Rafid-Hamiz-Dell kernel:  EXT4-fs warning (device sda3): ext4_end_bio:317: I/O error -5 writing to inode 6819258 (offset 0 size 4096 starting block 54763121030042024)        &lt;snipped&gt;  /var/log/kern.log.1 : 71210257  Rafid-Hamiz-Dell kernel:  attempt to access beyond end of device 71209212  Rafid-Hamiz-Dell kernel:  sda3: rw=1, want=7638104968240336200, limit=1681522688    1639  Rafid-Hamiz-Dell kernel:  EXT4-fs warning (device sda3): ext4_end_bio:317: I/O error -5 writing to inode 6819258 (offset 0 size 4096 starting block 954763121030042024)    (/dev/sda3 is  my home directory. As we can find,   lsblk /dev/sda NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0 931.5G  0 disk  ├─sda1   8:1    0 122.1G  0 part / ├─sda2   8:2    0   7.6G  0 part [SWAP] └─sda3   8:3    0 801.8G  0 part /home    Why a process will want to write beyond the limit is actually outside the scope of my comprehension. Perhaps I will want to ask a different question in this forum if this continues even after a system update.)  Then, from  (you may want to check  for a deeper understanding), I executed,   sudo su - &gt; kern.log &gt; syslog   Now, these files have zero sizes. The system is running fine before and after a reboot.   I will watch these files (along with others) in the next few days and report back should they behave out-of-line.  As a final note, both  the offending files (kern.log and syslog), are set to be rotated, as inspection of the files (grep helped) inside  /etc/logrotate.d/ shows.  UPDATE 2  The log files are actually rotated. Looks like the large sizes were attained on a single day.