body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
I want to rename a file dynamically based on data which contains spaces Name="Abc DEF" Name1="GHI JKL" mv /sample/pdf/noriginalName.pdf /sample/outputPdf/${NAME}${Name1}".pdf" But it gives me an error because it encounters space in between. How can I do this? | Or, an introductory guide to robust filename handling and other string passing in shell scripts. I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names). I encountered a problem such as the following: I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators). What is going on and how do I fix it? |
Suppose that $f : [a,b] \rightarrow \mathbb R$ is continuous on $[a,b]$, differentiable on $(a,b)$, and that $\lim_{x\rightarrow a^+}f'(x)=L$. Show that $f$ is differentiable at $a$, and that $f'(a) = L$. I have tried starting with the continuity of the function, but I'm still not sure how to even begin or where to go from there. | Suppose $f(x)$ is continuous on $[a,b)$ and differentiable on $(a,b)$ and that $f '(x)$ tends to a finite limit $L$ as $x \to a^+$. Then $f(x)$ is right-differentiable at $x=a$ and $f '(a)=L$. (epsilon-delta proof not needed). This is a practice exam question. I am having trouble translating this into a 'mathematical' statement. The MVT states that there exists $c$, $a\leq c\leq b$, such that: $f'(c) = (f(b)-f(a))/(b-a)$ I suppose to prove that $f(x)$ is right differentiable at $x=a$, using the MVT, I need to somehow show that as $x \to a^+$, $f'(c)=f'(a)=L$ ??? Am I on the right track here? Can someone help me get started? |
This was a post apocalyptic movie in which the character is a disabled teacher in a wheelchair. He loves one woman, so he goes to test therapy which is supposed to make him fully functional. Then company that is providing therapy puts him in a sort of coffin with green goo in it. In order to walk he gets armour but he cannot breathe outside of it. At the end he kills himself. | I'm trying to find the name of a lower-budget science fiction film that was available for viewing on demands on MIT student cable in the late 1990s. I suspect the film was made earlier in that decade, and it definitely seemed to have been influenced by RoboCop. The plot involves characters is a somewhat dystopian near future. One of the characters (named Hawkins, I think) is initially in a wheelchair, and that is interfering with his relationship with the woman he loves. (He watches virtual reality simulations of himself having sex with her when he's alone at home.) Maybe halfway through the movie, he decides there's no hope for their relationship, so he lets the bad guys turn him into a RoboCop-like cyborg. I think he ends up fighting the other main characters, but I don't remember how the movie ends. The film was clearly shot cheaply but competently. The color palette was rather drab, I think, and there were few indoor sets. It's possible that the film never got a normal release of any kind, since I don't know where the students at MIT cable got ahold of it. So does anybody know what this film was? |
I am upgrading my home PC. On my current PC, all my VirtualBox VMs reside on a data drive separate from the primary OS drive. The current PC uses Windows 10 and the new PC will also be using Windows 10. I have about 30 VirtualBox VMs on that data drive. My question is if I can do the transition using the method listed below. Move data drive to the new PC Assign the data drive with the same drive name (e.g. D:) Install the same version of VirtualBox I have right now onto the new computer Move my .VirtualBox directory from C:\Users\foo\.VirtualBox to my new PC | I use VirtualBox 4.1.x on my Ubuntu machine and I’ve set up several virtual machines. Since there are several ways one can move a virtual machine in VirtualBox to another computer, I was wondering which one is the recommended way: Use the “Import/Export utility.” Copy the entire virtual machine folder, containing the .vdi and .vbox files. Clone the VDI using “Virtual Media Manager” and then recreate a VM on the target machine but using the cloned VDI as the hard disk. I have successfully used the 1st method several times and it has always worked. The problem is that after exporting and importing, the disk image is transformed into VMDK and not VDI anymore! The 2nd method is probably the easiest but I’m not sure that simply copying the files will work or not on the target machine. When searching about this method, I found some people had problems in which they had to edit the VirtualBox.xml file to solve it! At last, there’s the 3rd method, but it requires the extra work of creating a VM similar to the original VM configuration, which is not desirable. It’s clear from the above explanation that my desired method is the 2nd one, but I need expert advice on this if it works or not. I don't want any XML editing getting in my way! What’s the best method of safely transferring my VM’s to another computer with VirtualBox? |
In general, if a bad question has already been closed (not necessarily for , but, e.g., for being off-topic), and it already has a negative vote score, is it meaningful to further add your downvote? I see no benefit to this, I only see that you lose 1 rep for adding your downvote. Can anyone explain if there’s a point to doing so? I don’t believe this question is a perfect duplicate of “,” because that question (which is itself a duplicate of , which does not answer my question) requests making it impossible to do so whereas my question is meant to spark discussion only, leaving users with the freedom to downvote. | That question of mine was closed a long time ago (relatively, to me at least). However, from time to time I still get downvotes for it. That got me thinking: is there any reason to still downvote closed questions? |
I am Relatively inexperienced in regex. I am playing around with various java classes that are used for regex. Below is an example I am trying out - import java.util.regex.*; public class Regex { public static void main(String[] args){ Pattern p = Pattern.compile("\\d*"); Matcher m = p.matcher("ab34ef"); while(m.find()){ System.out.println(m.start() + m.group()); } } } When I run this I get - 0 1 234 4 5 6 The m.start() function returns the position of the character the match was found on. The pattern follows a 0 based index. So here is my interpretation of the output - 0 (index = 0 , no matching group) 1 (index = 1 , no matching group) 234 (index = 2 , matching group = 34) 4 (index = 4 , no matching group) 5 (index = 5 , no matching group) 6 (Why does this happen?) Why would m.start() return 6 ? The string is 6 characters long so the last index should be 5. I think I am missing something very basic here. Any pointers or suggestions are welcome. | I don't really understand regular expressions. Can you explain them to me in an easy-to-follow manner? If there are any online tools or books, could you also link to them? |
Is it possible to have a desktop login password that's different from the password used for super user permissions, like for example when you are installing software or running a command with sudo or something that needs super user access? | How can I give a user one password for normal usage when logging in, and another password for system administration and sudo access? I want one user to have two passwords. |
Are there any proofs of this equality online? I'm just looking for something very simply that I can self-verify. My textbook uses the result without a proof, and I want to see what a proof would look like here. | Multiple Angle Identities: How to expand $\cos nx$ with $\cos x$, such as $$\cos10x=512(\cos x)^{10}-1280(\cos x)^8+1120(\cos x)^6-400(\cos x)^4+50(\cos x)^2-1$$ See a list of trigonometric identities in / |
I use "Texmaker-3.5.2" with "basic-miktex-2.9.4757" on Windows 8.1 on my personal laptop (LenovoZ5070). I checked Options\Configure Texmaker\Commands. It includes: LATEX: latex -interaction=nonstopmode %.tex PDFLATEX: pdflatex -synctex=1 -interaction=nonstopmode %.tex XLATEX: xelatex -synctex=1 -interaction=nonstopmode %.tex You can see that my system contains "-synctex=1". However “click to jump to the line” is not working! Please help me. | I am compiling LaTeX files with Texmaker on Ubuntu 12.04 system. When I run pdflatex and then view the pdf file (internal), it does not show me the exact place where I am editing on Texmaker i.e. the generated pdf file does not show me the position of the cursor. But some days before it was working fine. I don't know what causes this problem. I already tried uninstalling and then reinstalling, I did update and upgrade too. But the problem still persists. |
I need to use a variable from the main script of a game which is the score variable public int scoreCount; I need it in the main script because it will be needed to update the score when they get past a certain point. I need to be able to access this variable.. so add or subtract from it i.e. scoreCount++; however I am not sure how to do this, I have looked at tutorials and they make no sense for me.. could someone please explain it in more detail. I also need to be able to use the public void UpdateScore() function from the mainscript too, do I just do it the same way as the variable or is there a different method. Thank you. | I am working on a simple game project, and have a problem. The problem is accessing the variable from one script to another. For example :- I have 2 Scenes (Game Scene and Game Over Scene), Game Scene has a Player Game Object , who has a int Variable Score. using UnityEngine; using System.Collections; public class Game_Scene_Script : MonoBehaviour { private int Score ; // Use this for initialization void Start () { Score = 0 ; } // Update is called once per frame void Update () { // Let us assume some one played the game // And Now the Score is 207 Score = 207 ; } } Now I want to access that int Variable Score in Game Over Scene which a Game Object. So how can I access that int Variable from that script? I searched for, but couldn't find any proper answer I wanted. Even-though some answers are in JavaScript , some are in Unity 4.x etc. |
I first read this book around 1983-1985 (no actual idea of when it was first printed), and, while I can't remember all that much from the book itself (other than enjoyable), I do remember the cover of the book. The cover prominently featured and depicted a robot, silver in color, sitting down (maybe in a field of some sort?), drinking a cup of tea in a very posh 'pinky extended' fashion. I've brought this fact up to friends, who have also read the book (and who are also trying to remember the book), and they always come back with 'Douglas Adam's: The Long Dark Teatime of the Soul.' I am pretty sure this is not correct, for a quick GIS of that book, shows no covers bearing what I remember. A small, small part of me, thinks it was a Heinlein book, but, none of the covers look familiar, I imagine it's possible the changed cover on a re-print, but, none of the titles stick out to me either. Any help, and all the internets to you, if you find this book! | I can't stop thinking about this book but my memory won't come up with a title, author, or even character names. Help? :) The cover had a large seamless cube sitting in a circle of sand on an alien planet. The plot involved several humanoids (maybe 5?) including a male and female from Earth and an android. There was also a military commander from a planet of war. They all just appear with no explanation of how they got there. Over the course of the book they are killed off one by one until only the male and female remain. (I was most sad to see the android go) The couple finds their way back to the cube and they solve the riddle of how to get across the sand. They are transported inside and are told that they have been chosen to travel to a new world and repopulate. Sorry I don't remember much more than that. Thank you for any help you can give. |
I am on Linux/Centos7. I have multiple csv files I want to merge, I am using this command to merge. cat *csv > all.csv But the first column contain a sequential number that needs to be merged and renumbered in sequential order. ==> 1.csv <== 1,bob,date,body 2,joe,date,body 3,ann,date,body ==> 2.csv <== 1,lisa,date,body 2,paul,date,body 3,mike,date,body I would like the result to renumber the first column to be like this ==> output.csv <== 1,bob,date,body 2,joe,date,body 3,ann,date,body 4,lisa,date,body 5,paul,date,body 6,mike,date,body When I do a regular merge I have this, And if I can renumber this merged file that would work too. 1,bob,date,body 2,joe,date,body 3,ann,date,body 1,lisa,date,body 2,paul,date,body 3,mike,date,body | I have a text file of numbered entries: 1. foo 2. bar 100% 3. kittens 4. eat cake 5. unicorns 6. rainbows and so on up to some large number. Then after an empty line, a new block starts from 1. I insert a new entry, replacing, say, 4. and I need to renumber all the subsequent entries in the block: 1. foo 2. bar 100% 3. kittens 4. sunshine < 5. eat cake 6. unicorns 7. rainbows |
Can anyone advise on the status of the recent mesa issue after an update January 4th or 5th, 2018? If it was update related what is a normal time frame for resolution? Noob getting his feet wet with Ubuntu! Thanks for your time. GordK follow up...I followed the suggestions in that answer prior to placing my question. I jumped ahead to the 17.3 ppa as per that answer. Things are OK for now. I see there will be a fix released for this issue. I will watch for that fix and get back on track with regular sourced updates. Thanks for your time! GordK 190118 Thanks for the follow up on this issue. I have been checking on progress and just saw that the issue has been resolved. I have updated to remove the 17.3 work around and rebooted and did the suggested update. Things look solid. Thanks again for your time and expertise! GordK | The latest updates (4/1/2018) make my laptop constantly crash the GUI/Unity: (Intel Pentium su4100 processor) syslog: Jan 5 11:38:53 1810 kernel: [ 1850.327738] compiz[11911]: segfault at 0 ip 00007f6c7baf0c16 sp 00007ffd5ec71c60 error 4 in i965_dri.so[7f6c7b513000+82d000] After login I end up with an empty desktop, just a wallpaper, GUI/Unity are in a crash loop: No panel. No dash. Can't start a program. Launcher disappears. Sidebar disappears. System crash. Windows key not working. The key combination Alt+Tab not working. Simply, the computer is not usable. Same for guest login. The only thing working: open up a terminal CTRL+ALT+T to examine log files. I somehow forced to let me log in and file the bug, but still lots of problems: Dash not working Alt+Tab not working Sometimes windows all disappear for a few seconds Any ideas for a solution or workaround? UPDATE If you have the same/ very similar problems, follow the link to my report and mark there that you're affected too. Or file your own. Please leave a comment if you wish, or upvote - this is a nasty problem - but an answer should offer a fix or a workaround so users can use their computer again. Without , Ubuntu can't fix issues. |
This document sets out the rights and responsibilities of [you || yours], the Company, and the concerned third parties. If "the Client's rights" can be rephrased to "the rights of Client", then, I suppose, "your rights" can be rephrased to "the rights of you", but "the rights of yours" sounds greater. So, is either variant appropriate and which should one better use? | As shows, we nearly always use the possessive form of personal pronouns for friend of mine/his/ours/etc. But when it comes to actual names, we prefer without the possessive apostrophe. That preference is even more marked with, say, . Not that I think the usage itself is particularly American - it's much the same with . Personally, I find friend of him grates. In general I've no strong feelings either way as to whether it's friend of Peter or friend of Peter's (though I deplore the possessive in ), but in line with many others, I really don't like the possessive in relation to things like countries. Why is this? Edit: Noting an apparent "progression" (pronoun -> person -> nation) marked by reduction in use of the possessive, I checked at a finer "granularity". NGram shows that although it does occur, virtually "flatlines" against friend of mine. But the bias reduces through of you, of us, and by the time I get to it's much less extreme. There seems to be something "egocentric" about the double possessive. Presumably when babies learn to speak, they soon notice that possessive pronouns, possessive apostrophes, and the word "of", all do the same job. Parents would correct a child who says "of mine's", but probably wouldn't even notice the same "redundancy" in "of Peter's". Younger speakers are unlikely to even be talking about something "of America's". Perhaps as we mature we tend to discard the "double possessive" for the more "distant" things that only adults are likely talk about, but we keep it for "closer" people because that's how we spoke when we were younger. EDIT2 I note that I'm a great fan of him is vanishingly rare compared to ...fan of his, but with ...fan (of John) the double possessive occurs far less often than ...friend (of John's). Usage seems to be affected by the noun before "of" as well as the one after it. This is getting complicated... |
I am implementing a String matching algorithm for a username database. My method takes an existing Username database and a new username that the person wants and it checks to see if the username is taken. if it is taken the method is supposed to return the username with a number that isn't taken in the database. Example: "Justin","Justin1", "Justin2", "Justin3" Enter "Justin" return: "Justin4" since Justin and Justin with the numbers 1 thru 3 are already taken. In my code sample below, newMember returns Justin1 even though it already exists--where is the mistake? public class UserName { static int j = 0; static String newMember(String[] existingNames, String newName){ boolean match = false; for(int i = 0; i < existingNames.length; i++){ if(existingNames[i] == (newName)){ match = true; } } if(match){ j++; return newMember(existingNames, newName + j); } else{ return newName; } } public static void main(String[] args){ String[] userNames = new String[9]; userNames[0] = "Justin1"; userNames[1] = "Justin2"; userNames[2] = "Justin3"; userNames[3] = "Justin"; System.out.println(newMember(userNames, "Justin")); // I don't understand why it returns Justin1 when the name is already taken // in the array. } } | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
What is the real number called to which the sequence $$\gamma_n =1+\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\cdots+\frac{1}{n} - \log _e n$$ converges and what is the radius of convergence? | How to show that $$\lim_{n\to\infty}\left[\sum^n_{k=1}\frac{1}{k}-\ln(n)\right]=0.5772\ldots$$ No clue at all. Need help! Appreciated! |
I am very familiar with cycles and its material nodes. Now I want to use luxrender, because it has a nice net rendering system. Is there any way to convert the cycles materials to luxrender materials? | I'm doing a project in cycles and I want to render it but its too slow on my CPU. So I want to render the scene in luxrender but without starting the project all over again. |
I have created a content type and take field collection for some field. Within field collection I have taken 4 select box. Now I need to get these select box value in content type tpl file. For this I am using this code : $wrapper = entity_metadata_wrapper('node', $node_data); but its not giving me select box option value. | I have a node that has a few field collections on it. When I look at node_load() output, I see: [field_rich_text_group] => Array ( [und] => Array ( [0] => Array ( [value] => 6 ) [1] => Array ( [value] => 7 ) [2] => Array ( [value] => 8 ) ) ) What API function can I use to actually load the field data contained in the collection that has an entity_id of 6, 7, 8, etc? |
Is is possible to use only equation or align environments without the * and then automatically suppress the equation number if there is nothing refering to that equation? It would make the LaTeX-life much easier I think. | I have a paper where all equations are numbered, but I want to number equations only if they are actually referred to in the .tex file using \ref{}. How can I make that happen? Alternatively, how can I make all equations that have no \label next to them (because then I know I don't refer to them) not have a number? Do I have to use \nonumber separately for each such equation? |
... at which point they had no choice but to fire upon the enemy. They opened fire. They returned fire. Aim! Fire! Fragments of reports from the battlefield. The first hand-held firearms appeared in Europe in the middle of the 15th century. Well. At least that's what people better acquainted with such matters than myself keep telling me. Before muskets, there were crossbows, and before the crossbows archers had to make do with the bow and arrow. Suppose you were a reporter, or an officer in charge of the archers, at, say, the Battle of Hastings (1066 A.D.). Did the above phrases have equivalents in those times? | Did the verb “fire a weapon” exist before the actual introduction of firearms on battlefields? More specifically, does it make sense for a creative work to have archers (or whatever ranged weaponry) be told to “fire!”, when the world they live in has not yet seen firearms? It seems some kind of an anachronism to me, since before firearms, “fire” would never propel any projectile... I've seen several movies do it; I can't remember them all, but for instance I verified it in The Lord of the Rings trilogy (left), Kingdom of Heaven (top right), and more recently Frozen (bottom right): The first two do it several times (with Kingdom of Heaven also using it on ballistae, and The Return of the King even having Aragorn ask Legolas to ), whereas firearms never appear on the battlefields they feature (Kingdom of Heaven is set in the 12th century; as for The Lord of the Rings, apart from one occurrence of a witchcraft-ish bomb, it's archery and medieval siege engines all the way). Frozen may be debatable, happening probably somewhere in the 18th or 19th century, but since we only see swords, spears and the like, it made me flinch to hear crossbowmen use “fire!”. I've also noticed other movies avoiding this, using “loose!” instead, such as Troy (left) and Gladiator (right): This makes me think it would be the right thing to say instead... although I'm still wondering why not use “shoot”, which seems simpler to me. |
I have a text file,of 100 lines,i need to move line 40 to line 39(refer to position) How to do this with sed? I tried sed '40 m 39' file and sed '40,39m' file but give me error. Thanks | I have some text files, and I'd like to be able to move an arbitrary line in any of the files up or down one line (lines at the beginning or end of the file would stay where they are). I have some working code but it seems kludgy and I'm not convinced I have all the edge cases covered, so I'm wondering if there's some tool or paradigm that does this better (e.g. easier to understand the code (for other readers or me in 6 months), easier to debug, and easier to maintain; "more efficient" isn't very important). move_up() { # fetch line with head -<line number> | tail -1 # insert that one line higher # delete the old line sed -i -e "$((line_number-1))i$(head -$line_number $file | tail -1)" -e "${line_number}d" "$file" } move_down() { file_length=$(wc -l < "$file") if [[ "$line_number" -ge $((file_length - 1)) ]]; then # sed can't insert past the end of the file, so append the line # then delete the old line echo $(head -$line_number "$file" | tail -1) >> "$file" sed -i "${line_number}d" "$file" else # get the line, and insert it after the next line, and delete the original sed -i -e "$((line_number+2))i$(head -$line_number $file | tail -1)" -e "${line_number}d" "$file" fi } I can do error checking of inputs inside or outside these functions, but bonus points if bad input (like non-integers, non-existent files, or line numbers greater than the length of the file) are handled sanely. I want it to run in a Bash script on modern Debian/Ubuntu systems. I don't always have root access but can expect "standard" tools to be installed (think a shared web server), and may be able to request installation of other tools if I can justify the request (though fewer external dependencies is always better). Example: $ cat b 1 2 3 4 $ file=b line_number=3 move_up $ cat b 1 3 2 4 $ file=b line_number=3 move_down $ cat b 1 3 4 2 $ |
Let $f$ and $g$ be continuous mapping of $S \subseteq \mathbb{R}^n$ into $\mathbb{R}^m$. Show that the inner product $h(x) = \langle f(x),g(x)\rangle$ is continuous. | Let f,g be continuous maps of S in $\mathbb{R}^n$, to $\mathbb{R}^m$. Show the inner product h(x) = $\langle f(x), g(x)\rangle$ is continuous. My attempt: Since f,g are continuous, their product is a continuous mapping, so for $\epsilon \gt 0\: t.e\: \delta \gt 0$ such that $\parallel x - a\parallel \lt \delta $ implies $\parallel \langle f(x),g(x)\rangle - \langle f(a)g(a)\rangle \parallel \le\parallel f(x)g(x) - f(a)g(a)\parallel \lt \epsilon$ by schwartz inequality. |
I just found a file at the /tmp/ directory named .<?php passthru($_GET['cmd']);echo 'm3rg3';?> Owner and GroupOwner are "proftpd" and "nogroup", respectively, as follows: -rw-r--r-- 1 proftpd nogroup 89 Apr 9 01:15 .<?php passthru($_GET['cmd']);echo 'm3rg3';?> FILE CONTENT proftpd: 45.33.17.183:39686: SITE cpto /tmp/.<?php passthru($_GET['cmd']);echo 'm3rg3';?> QUESTIONS How could one break into my server through ProFTPD? What can I do to fix this issue? What else should I look for after this finding? Is there a default password for the user "proftpd"? Can I find the "proftpd" password? At the "/tmp/" directory* I see this file .<?php passthru($_GET['cmd']);echo 'm3rg3';?> which is owned by "proftpd". Does is imply that someone successfully logged through FTP and uploaded that file there? Is there another way that it happened? How can I find the hole that allowed this happening? MEASURES TAKEN SO FAR Changed ProFTPD port from 21 to something else; Commented mod_copy.c as suggested on this russian site: Moved the injected file from /tmp/ to another directory, eg.: /tmp/injected_file/ Didn't change ANY password (note: ftp is not used on this server). Searched for all files from user proftpd using find / -user proftpd. Nothing was found, besides the one file mentioned in the beginning. | This is a about Server Security - Responding to Breach Events (Hacking) See Also: Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism: What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning? Original Version 2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a attack on our provider. The servers access to the Internet has been shut down which means over 5-600 of our clients sites are now down. Now this could be an FTP hack, or some weakness in code somewhere. I'm not sure till I get there. How can I track this down quickly? We're in for a whole lot of litigation if I don't get the server back up ASAP. Any help is appreciated. We are running Open SUSE 11.0. 2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed to resolve this problem, although it may not apply to many others in a different situation. I'll detail what we did. We unplugged the server from the net. It was performing (attempting to perform) a Denial Of Service attack on another server in Indonesia, and the guilty party was also based there. We firstly tried to identify where on the server this was coming from, considering we have over 500 sites on the server, we expected to be moonlighting for some time. However, with SSH access still, we ran a command to find all files edited or created in the time the attacks started. Luckily, the offending file was created over the winter holidays which meant that not many other files were created on the server at that time. We were then able to identify the offending file which was inside the uploaded images folder within a website. After a short cigarette break we concluded that, due to the files location, it must have been uploaded via a file upload facility that was inadequetly secured. After some googling, we found that there was a security vulnerability that allowed files to be uploaded, within the ZenCart admin panel, for a picture for a record company. (The section that it never really even used), posting this form just uploaded any file, it did not check the extension of the file, and didn't even check to see if the user was logged in. This meant that any files could be uploaded, including a PHP file for the attack. We secured the vulnerability with ZenCart on the infected site, and removed the offending files. The job was done, and I was home for 2 a.m. The Moral - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole world is made aware of the vulnerability. - Always do backups, and backup your backups. - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server Fault. |
I created a simple crontab job. It should execute every 15 minutes to alert me that I need to take a short break. However, it does not work. I don't know why. Please help me if you have experience with crontab. I used the command crontab -e to create this file and save it. # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use '*' in these fields (for 'any').# # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example, you can run a backup of all your user accounts # at 5 a.m every week with: # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ # # For more information see the manual pages of crontab(5) and cron(8) # */15 * * * * /home/galaxy/Documents/projects/Bash/cron_job.sh This file is supposed to execute the script cron_job.sh every 15 minutes. This is a Bash shell script that has a chmod value of 500. It contains one command to create a new gnome-terminal and immediately run a command inside that new terminal to cat the file take_a_break. That is a text file with a simple message telling me to take a break. Running from the terminal directly either the shell script or just running the command contained inside of it works flawlessly, but the crontab job does not work at all. Maybe I formatted something incorrectly. Here is the contents of the file cron_job.sh: #!/bin/bash gnome-terminal -e "bash -c \"cat /home/galaxy/Documents/ascii/take_a_break; exec bash\"" The reason I put the command inside a shell script is because cron did not run it previously, but cron also does not run the shell script. I checked and it seems to me that I have the correct syntax. Also if it is relevant, trying to run the crond command gives an error: $ crond No command 'crond' found, did you mean: Command 'cron' from package 'cron' (main) crond: command not found | Once upon a time, DISPLAY=:0.0 totem /path/to/movie.avi after ssh 'ing into my desktop from my laptop would cause totem to play movie.avi on my desktop. Now it gives the error: No protocol specified Cannot open display: I reinstalled Debian squeeze when it went stable on both computers, and I guess I broke the config. I've googled on this, and cannot for the life of me figure out what I'm supposed to be doing. (VLC has an HTTP interface that works, but it isn't as convenient as ssh.) The same problem arises when I try to run this from a cron job. |
using TeXShop in OS X Maverick, a simple subfigure script is returning "undefined control sequence". Although I can bypass it and still generate the image-included pdf by typing "s" to "ignore all" (of the warnings), I would still like to know the cause and fix for this. Thanks! The sample script is: \documentclass[a4paper,12pt]{article} \usepackage{graphicx} \begin{document} \begin{figure}[htdp] \begin{center} \subfigure{\includegraphics[width=0.3\textwidth]{fig1}} \subfigure{\includegraphics[width=0.3\textwidth]{fig2}} \end{center} \end{figure} \end{document} | I want to place 2 images side by side in LaTeX. I have 2 .png files and I don't understand how to do it in LaTeX. I have tried many ways but could not get a good result. |
I am using mysql - 10.1.39-MariaDB - mariadb.org binary distribution - and phpmyadmin for managing my db: I have the following table: | ID | NAME | AMOUNT | CREATED_AT | UPDATED_AT | |-----|------------|--------|---------------------|---------------------| | 1 | Product 1 | 4 | 2019-08-30 19:03:16 | 2019-08-30 19:03:16 | | 5 | Product 1 | 3 | 2019-08-29 20:03:16 | 2019-08-29 20:03:16 | | 2 | Product 2 | 4 | 2019-08-30 19:03:16 | 2019-08-30 19:03:16 | | 3 | Product 33 | 3 | 2019-08-30 19:03:16 | 2019-08-30 19:03:16 | | 4 | Product 4 | 2 | 2019-08-30 19:03:16 | 2019-08-30 19:03:16 | | ... | ... | ... | ... | ... | I would like to have all rows that have been updated last. I tried the following: SELECT `name`, `updatedAt` FROM issuers ORDER BY updatedAt However, I still get all rows in my result data. Any suggestions what I am doing wrong? I appreciate your replies! | My table is: id home datetime player resource 1 10 04/03/2009 john 399 2 11 04/03/2009 juliet 244 5 12 04/03/2009 borat 555 3 10 03/03/2009 john 300 4 11 03/03/2009 juliet 200 6 12 03/03/2009 borat 500 7 13 24/12/2008 borat 600 8 13 01/01/2009 borat 700 I need to select each distinct home holding the maximum value of datetime. Result would be: id home datetime player resource 1 10 04/03/2009 john 399 2 11 04/03/2009 juliet 244 5 12 04/03/2009 borat 555 8 13 01/01/2009 borat 700 I have tried: -- 1 ..by the MySQL manual: SELECT DISTINCT home, id, datetime AS dt, player, resource FROM topten t1 WHERE datetime = (SELECT MAX(t2.datetime) FROM topten t2 GROUP BY home) GROUP BY datetime ORDER BY datetime DESC Doesn't work. Result-set has 130 rows although database holds 187. Result includes some duplicates of home. -- 2 ..join SELECT s1.id, s1.home, s1.datetime, s1.player, s1.resource FROM topten s1 JOIN (SELECT id, MAX(datetime) AS dt FROM topten GROUP BY id) AS s2 ON s1.id = s2.id ORDER BY datetime Nope. Gives all the records. -- 3 ..something exotic: With various results. |
How can i use the mysql_real_escape_string() function in my MySQL queries for $_SESSION variables? This is my code at this moment. Hope that someone can help me. Thanks :-) <input value='<?php echo $_SESSION['reg']['data']['password1']; ?>' | If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the user can input something like value'); DROP TABLE table;--, and the query becomes: INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--') What can be done to prevent this from happening? |
Recently I installed Ubuntu 14.04, now I am unable to play/listen to any music or video. I am a new user. | I'm new to Ubuntu. I tried installing it with Windows 8.1, but failed I lost all my files. I have successfully formatted my PC and installed Ubuntu, but how do I install codecs to play audio and videos files ? |
If Mad-eye Moody's only purpose was to get Harry to Lord Voldemort then why did he have to wait until the very end of the Tri-wizard tournament? Being a teacher he had Harry at his mercy anytime so should he take the pain of getting Harry into the tournament, risk helping him with the tasks, and so on? He could have easily done it any time during the entire year with any other object as the port key. Why was the Triwizard cup chosen? Is there anything that I'm missing? | In Harry Potter and the Goblet of Fire the Triwizard Cup was used as the portkey to send Harry and Cedric to the graveyard in Little Hangleton to face Voldemort. Why was the Triwizard Cup chosen? Couldn't Crouch Jr. have used anything as a portkey; which would have been much easier and without as much risk (after all of their planning Cedric almost ended up getting the cup first). |
How can we automate developer tools - console section using Selenium? how to get data from the console for a particular service call. ex: as per the screenshot attached I what to know a.fn.init[div#804] call data using Java and Selenium in eclipse Is it possible? If so, how do I achieve this? | How can we automate developer tools particularly the networks section using Selenium? I need the preview section data of a service call to be logged while using automation. Is it possible? If so, how do I achieve this? |
I am looking for a word ( a compound word or phrase would be acceptable) that describes a negative event that may take place in the future. However, I was unable to find such a word in the prominent online thesaurus or dictionary. For instance, this year a number of countries the world over were forced to impose lock downs to stop the spread of the ongoing corona virus pandemic. What word can be used to describe a negative event like the corona virus pandemic that may occur in the future? Sample Sentence: A _ like the 2020 corona virus pandemic might occur in the future. So I can fill that blank with the words negative event. A negative event like the 2020 corona virus pandemic might occur in the future. In place of the words negative event I am looking for a word that describes such an event that might occur in the future. | I have the feeling I'm forgetting a very simple word. But anyway, is there a word for that? Example: The [...] that haven't occurred yet are the most scary ones. |
Is Ubuntu Touch support available for porting to latest devices that runs Android L or Android M? To run Ubuntu touch on Android devices, some of the components from Android are required (E.g, Modified kernel to support Ubuntu Touch, Android HAL, drivers etc.) The initial Ubuntu Touch port for the list of compatible devices were based on Kitkat. Is there a working Ubuntu Touch port available for the latest Android devices that runs Android L or Android M? What level of support available from Ubuntu Touch for porting the components (modified kernel, HAL, drivers based on Android L or M) to these devices? | With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time. Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions |
This may be a simple question, but I was unable to find anything resembling the topic: I have a program that needs to be run in Linux, and Windows. As you know, Windows new line character is \r\n, and in Linux/Unix it is \n (Mac is \r). When I need to print anything to a file or to the command line, I can use println() function to create a new line. This works fine, but I need to return many new line characters as Strings so that I can for example use them more than once, modify them, etc. (I can also use find-replace to replace all my \r\n at the same time.) The windows character \r\n I am using currently prints ^M in Linux. Is there a character, or method I can use to return new lines in Strings? | How do I get a platform-dependent newline in Java? I can’t use "\n" everywhere. |
I want to have continuous numbering for all my theorem, lemma, etc environments, which wan be achieved with using a shared counter. However this seems to break cleveref's capability of referencing them by distinct names: \documentclass{book} \usepackage{amsmath, amsthm, mathtools} \theoremstyle{definition} \newtheorem{definition}{Definition} \newtheorem{example}[definition]{Example} \usepackage[capitalise,nameinlink]{cleveref} \crefname{example}{Example}{Examples} \begin{document} \begin{definition}\label{def} Definition \end{definition} \begin{example}\label{ex} Example \end{example} \cref{def} \cref{ex} \end{document} This does produce the references Definition 1 and Definition 2, instead of Definition 1 and Example 2. How can this be circumvented? | I am trying to use the package. I have the following counters defined (hopefully this is the right way to do it!) \newtheorem{thm}{Theorem}[section] \newtheorem{lemma}[thm]{Lemma} \newtheorem{cor}[thm]{Corollary} This works as I would like (i.e. Theorem 1.1, Corollary 1.2, Lemma 1.3, etc.) My problem is \cref always returns Theorem 1.2, Theorem 1.3. I Perhaps this is not right? (In my preamble) \crefname{thm}{theorem}{theorem's} \crefname{lemma}{lemma}{lemma's} |
I keep getting this error: The value of the p3_lkid parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information. We are using Lighting. My intent is when someone clicks on the button on the opportunity layout, it sends an email to two individuals and uses the classic HTML email template. Please note that my logic had the real email addresses. Any help would be greatly appreciated! Thank you! /_ui/core/email/author/EmailAuthor?p3_lkid={!Opportunity.Id}&retURL=%2F{!Opportunity.Id}&p6="Special Offer: "&{!Opportunity.Special_Offer__c}&"-Account: "&{!Opportunity.Account}& "- License Seats: "&{!Opportunity.Licensed_Seats__c}&[email protected];[email protected]&template_id=00X1P000000Z2Hp | I am trying to make a share on linkedin link on my lightning component of community like this : <a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=my_url_here;&amp;title="+{!v.SingleBlog.Title__c}+"&amp;summary=sdfsjf" target="_new" > Linkedin </a> But When I am saving this its giving me an error : Getting Field Integrity Exception : Failed to save undefined: markup://c:BlogDetail:70,162: ParseError at [row,col]:[71,162] Message: Element type "a" must be followed by either attribute specifications, ">" or "/>".: I know its because of the variable {!v.SingleBlog.Title__c} whose value I want to append in share url at runtime. How to put this variable's value in url? |
I wonder if someone could recommend me some textbook (or recourse in general) on machine learning, suitable for mathematics students. I am a student in pure math, specialized in real and functional analysis, I am also familiar with basic probability theories based on measure theory. I have no knowledge of computation theories however. I want to find a text that focuses on ML theory that uses precise and rigorous mathematical statements in terms of axioms, definitions, theorems, and proofs, as opposed to a more applicational manner focusing on specific codes. In particular, I do not want text that spends half its length talking about basic definitions such as vector space or continuity/differentiability, rather some text that assumes reader's familiarity with mathematics. Any suggestions? | I am a math master student and have done fundamental math courses like probability theory, measure theory, linear algebra and know a little bit about functional analysis. What is good way for me to learn machine learning in depth? I have read the classical text last summer; my impression was that it was very ineffective to read the book chapter by chapter like a mathematical text. The book does not go deep enough for many algorithms and skip too many steps considered too technical by engineers. Is there a machine learning book that maybe does not cover too many topics, but treat each one in depth and takes advantage of math when necessary? It will be great to be able connect fundamental mathematical objects with machine learning (I am thinking about Lp spaces, hilbert space etc). |
It's my first time in coding in Python, I have created a code that bubbles sort a given list. This is my code: def bubbleSort(alist): for passnum in range(len(alist)-1,0,-1): for i in range(passnum): if alist[i]>alist[i+1]: temp = alist[i] alist[i] = alist[i+1] alist[i+1] = temp alist = ["hi",50,93,"/",77,31," ",55,20] bubbleSort(alist) print(alist) I am trying to ask the user for the list instead of storing the list in the code, but I have no idea of how to do that in Python. Would someone help me out with it. | How do I have a Python script that a) can accept user input and how do I make it b) read in arguments if run from the command line? |
If $1+ab$ divides $a^2+b^2$ , prove that the quotient is a perfect square. Tried to use the fact that $\displaystyle\frac{a^2+b^2}{1+ab}$ is an integer but I am stuck. | Let $a,b$ be positive integers. When $$k = \frac{a^2 + b^2}{ab+1}$$ is an integer, it is a square. Proof 1: (Ngô Bảo Châu): Rearrange to get $a^2-akb+b^2-k=0$, as a quadratic in $a$ this has two values: $a$ and $kb - a = (b^2-k)/a$. (The second root is determined in two different ways from the expansion $(x-r_1)(x-r_2) = x^2 - (r_1 + r_2)x + r_1 r_2$.) Now suppose we have $a,b$ such that $k$ is an integer but not a square, by the investigation about roots we have that the second root is a nonzero integer since $k,b,a$ are integers and $k \not = b^2$, futhermore it is positive which is easily seen from its defining equation. WLOG assume $a \ge b$ so that the second root is strictly smaller than $a$. This leads to a decent, replacing $a$ with the second root. Proof 2 (Don Zagier): Apply reduction theory (specifically, Sätze 1 and 2 of Section 13 of my book on quadratic fields) to the quadratic form $x^2 + kxy + y^2$, which is the unique reduced quadratic form in its equivalence class. Note that Proof 2 is pretty much the same as Proof 1 when written out in explicit detail, but I could not read Zagier's book because I cannot read German. I would like to know more approaches to this and other alternative proofs of this result if possible! Thanks in advance. I would also be interested in related problems (especially easier ones of a similar nature) and texts which cover the reduction theory in English. |
when I play minecraft it runs super well no lag at all, but when I use ubuntu with minecraft on it seems to be that ubuntu gets super slow it takes 5 seconds to get to my home folder it has never done that before I also try to run a bukkit server it works well but the I use a plugin and I get a timeout error ever since ubuntu got slow bukkit always crashed. can anyone help? i have 2.9 GB RAM. Thank You | How to correctly install Minecraft, including setting any needed packages or apps to install it and to troubleshoot the most common problems that Ubuntu users face when trying to use Minecraft. I am trying to install and run Minecraft without first having to install the Oracle version of Java. I want to use the OpenJDK version that comes with Ubuntu and as a last resort, use the Oracle one. I also want to know a list of problems related to Minecraft in Ubuntu and the possible solutions to them. A step by step guide on how to install Minecraft would also help. |
We are implementing a toggle to switch between two different ways of showing data in a table. I created a mockup for the toggle but shortly afterward realized that people are very divided in how they interpret toggle buttons. There seem to be two camps: Toggle as depressed button. The darker side in this case indicates the current selection as it replicates the model of a pushed button or side of a switch. For example: (source: ) Toggle as a slider. The lighter side in this case indicates the current selection as it replicates the model of a slider being moved to one side to indicate preference. For example, Obviously, these two methods contradict one another. Currently we are using method 1 but before we get any further along in development I wanted to confirm with a larger audience, which of these do you think is a more universal way of understanding/interpreting a toggle button's state? Or is this just a nebulous issue and it might be better to avoid toggles for this altogether? | I have a quick question about buttons that toggle between two states. (Think Play/Pause, or Shuffle/Regular Play.) As the title says, should the toggle show it's current state or the state to which it will transition? I think people are used to the Play/Pause convention. But the Shuffle/Regular play might be more confusing if you show the transition state instead of current. For example, the built-in music player on the Xbox 360 does it this way: when it's in shuffle mode, it shows the icon for direct play and vice versa and it always confuses me (am I in shuffle mode or straight play). I see it this way: Play/Pause is more like action as in begin playing or pause playing. Yes behind the scenes it is a state transition but to the user, there is an action. Whereas Shuffle/Straight Play is an option and it's best to show the current state (and possibly have only one icon and change button to show that the option is enabled/disabled). Thoughts? |
I bought this with cash I bought this by cash The first one sounds idiomatic. But second one doesn't sound bad though | Which one of the following is correct? You can pay by credit card or by cash. You can pay by credit card or cash. |
I'm dreaming of a Bash script that opens applications and places them in certain workspaces. For example, I'd like to run a script that: In Workspace 1 opens firefox WS2 - opens term and maximizes it WS3 - opens Sublime Text2 and maximizes it WS4 - opens Pidgin, gpodder, and banshee Is such a script possible in Ubuntu 13.04 running Cinnamon? | How do tell an application to open in a specific workspace? More info: I like to have my C++ IDE in workspace 2, my Java IDE in workspace 3, and my email, browser and miscellaneous in workspace four. I also use a shell script that executes upon log in: #!/bin/bash gnome-terminal & # WS 1 netbeans-6-9-1 & # WS2 qtcreator-2-0-1 & # WS 3 firefox & # WS 4 thunderbird & # WS 4 Of course currently it all opens in the current workspace... Is there a way for me to specify which workspace each command should start in? Thanks in advance! |
When people say how does it look, I want to answer "with its eyes." I prefer a perfectly good "What does it look like?"though I hear and read the other version all the time! Which is correct?....I have even seen and heard "How does it look like? | Formally, in my English education, I have learned to ask for the outward appearance of something using the expression: "What does it look like?" Since my mother tongue is German and we say "Wie sieht es aus?", I frequently catch myself saying: "How does it look?" which would be the direct translation from German. Since I think the translation does not sound wrong (I am certainly biased though) I would like to ask you if this is correct English in at least some cases or just a mistake of mine? Thanks! |
In a game of heads and tails with a fair coin - you win $\$1$ if heads; lose $\$1$ if tails - what is the probability of being $\$5$ up after $25$ tosses? | Suppose that $X_1,X_2,\ldots,X_n$ is a random sample from a distribution with probability function: $$p_X(x)=\begin{cases} 1/2 &x=-1,1 \\ 0 & \text{otherwise} \end{cases}$$ Now if we define the average $\bar{X}= \frac{1}{n} \sum X_i$, I need to show that that for an odd $n$ the probability function for $\bar{X}$ is: $$p_{\bar{X}} (x)= \frac{\binom{n}{\frac{n}{2} (x+1)}}{2^n}$$ for $x=\pm 1/n,\pm 3/n,\ldots,\pm 1$, $0$ otherwise. Since $P[\sum X_i=k] =P [\bar{X}=k/n ]$, I thought it would be easier to first derive the probability function for the sum. Since they are still $2^n$ n-tuples and each one is equilikely, I need to count the ones whose sum is $k$ for: $k=\pm 1,\pm 3,\ldots \pm n-2,\pm n$ (since even numbers are not a feasible combination) The problem here though is that I do not immediately recognize how I could count all these tuples. Could you please help me with this? If it is easier to proceed another way, I am of course all ears. |
I have been working with Professor 1 for a semester. He has been very helpful and we have spent some time together this semester discussing problems. I enjoyed working with him and also find his research interesting. However, there is also this other Professor 2, whose work I find interesting and he works in related areas. So, I want to work with Professor 2 for a semester before deciding whom to stick with. Meanwhile, I want to continue the work that I have initiated with Professor 1. I want to convey this message to Professor 1 in a manner that will leave the possibility of working with him after next semester open. So, how should I tell Professor 1 that I want to do a small project with Professor 2 to try out things, without sounding rude? | When needing to ask a professor about something important and potentially delicate, what is an appropriate way to phrase the question or write the email? Examples include: Requesting a recommendation letter Asking for exceptions to policy (e.g., ignoring a course prerequisite, rescheduling an exam) Asking if you can do research with them, join a group, get into a program Scheduling a meeting, exam, or defense Letting them know about a change of plans Letting them know about a life event affecting your work or studies (e.g., wedding, funeral, sickness, vacation) |
I'm trying to write a backup script that can be deployed on many different linux servers, some of which mount network drives as described in /etc/fstab. I want my script to be able to see if any network drives have come unmounted before a backup to ensure that they don't go unsaved. Is there any way to reliably check for this in a bash script? | Running Cronjob @reboot returns that file on nfs share does not exist. Example @reboot python /abs/path/to/script.py mail from crontab on startup reads "more or less" /usr/bin/python can't open file "/abs/path/to/script.py": [Error No. 2] No such file or folder. Script can be run from the command line with no trouble.. Theory is that the cronjob is running before mount has been run. The questions. Is this theory correct? Is there a way to force the job to wail until the drive has been mounted? .... Other than just putting in a sleep 60 into the command. ;) I tried that already, but it's hit and miss and I need the script to run 100% of the time quickly. |
I have no difficulty in normal cases knowing whether to say "you and I"or "You and me." But this situation confuses me. On one hand, I can justify I by saying there is an implied "are" at the end: He is no different than you and I are On the other hand, this is a comparative, and if I were to change the sentence up just a bit, it feels like it would be correct to say "me": He is the same as me | In high school we learned to say "than I" and "as I" because you could potentially add an "am" to the end of the sentence. Examples: "She is smarter than I." (Think: "...than I am.") "He is as tall as I." (Think "...as I am.") So analogously, shouldn't it be "like I" as well: "He is sincere, just like I." (Think: "... like I am.") But universally, it seems that we use "like me". Where does this reasoning break down? Is there history here? |
I'm new to Tkinter and I'm working on a text editor. I want to implement a find text feature in my code and I recently came across a line of code that I don't quite understand. I would like to understand what that line of code does. This is the line of code: '{}+{}c'.format(start_pos, len(needle)) | I want to do something like String.Format("[{0}, {1}, {2}]", 1, 2, 3) which returns: [1, 2, 3] How do I do this in Python? |
Right now I have a .blend file for a little interface project I am working on in the game engine and also a .exe Is there a way I can play my project in a web browser so I can show it to some friends? | The diagram is of a river bank with a formula that can be adjusted with sliders to calculate the river's area, steepness, vegetation population, etc. The question is, is it possible to do this in blender somehow, either with the game engine or drivers, so that sliders could change not only numerals but also the look of the river diagram? I have pretty much zero experience with the game engine (but years with anything else to do with Blender) and before trying anything out I wanted to know if it was possible to do something like this. I have also seen this recent link to the game engine working on browsers and was wondering if this could work for this too? |
Trying to run a simple javascript to parse single digit ints in a string as follows: var s = "22123222222213123212322123213222"; var a = s.split(""); var b = a.map(parseInt); console.log(b); [2, NaN, 1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 1, 3, 1, 2, 3, 2, 1, 2, 3, 2, 2, 1, 2, 3, 2, 1, 3, 2, 2, 2] Why is there a NaN for element with index 1? Fiddle in the console here: EDIT After getting the correct answer below I felt I had to lookup this "map(Number)" business. Turns out Mozilla has a "gotcha" clause concerning this specific case. | From the : [1,4,9].map(Math.sqrt) will yield: [1,2,3] Why then does this: ['1','2','3'].map(parseInt) yield this: [1, NaN, NaN] I have tested in Firefox 3.0.1 and Chrome 0.3 and just as a disclaimer, I know this is not cross-browser functionality (no IE). I found out that the following will accomplish the desired effect. However, it still doesn’t explain the errant behavior of parseInt. ['1','2','3'].map(function(i){return +i;}) // returns [1,2,3] |
I need to upgrade my skype version using terminal. Right now I have the Skype version 8.11.0.4 and the notification icon I am getting the text, i.e. A new update is available. Install latest version via your package manager, then restart skype. So I need to upgrade the latest version using terminal. I need the steps to upgrade this. | I want to install Skype, but I can't locate it in Software Center or by using Synaptic Package Manager. Can anyone help me? |
I am using an Ubuntu 13.10 image on my android and I cant seem to install the Ubuntu gnome desktop. Device information: - Sony Xperia S (LT26I - Arm-V7 - Snapdragon S3 1.83ghz - Adreno 220 GPU - four Armhf cpus Ubuntu Information: - Linux 3.40 Kernel - version 13.10 envi@ubuntu:~$ adb shell * daemon not running. starting it now on port 5037 * * daemon started successfully * shell@android:/ $ su root@android:/ # linux shell Starting Shell as root@localhost root@localhost:/# sudo apt-get install gnome-shell ubuntu-gnome-desktop Reading package lists... Done Building dependency tree Reading state information... Done gnome-shell is already the newesshell startingt version. ubuntu-gnome-desktop is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 2 not fully installed or removed. Need to get 0 B/300 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? y dpkg: error processing modemmanager (--configure): Package is in a very bad inconsistent state - you should reinstall it before attempting configuration. Setting up whoopsie (0.2.24.1) ... invoke-rc.d: unknown initscript, /etc/init.d/whoopsie not found. dpkg: error processing whoopsie (--configure): subprocess installed post-installation script returned error exit status 100 Errors were encountered while processing: modemmanager whoopsie E: Sub-process /usr/bin/dpkg returned an error code (1) | I can't update my system because it freezes while installing a third-party update (zramswap-enabler)! Sometimes I get the following message in Update manager: Could not initialize the package information An unresolvable problem occurred while initializing the package information. Please report this bug against the 'update-manager' package and include the following error message: E:The package zramswap-enabler needs to be reinstalled, but I can't find an archive for it. I tried to remove the zramswap-enabler, but it's impossible because I get the following message: dpkg: error processing zramswap-enabler (--remove): Package is in a very bad inconsistent state - you should reinstall it before attempting a removal. Errors were encountered while processing: zramswap-enabler E: Sub-process /usr/bin/dpkg returned an error code (1) Actually I would really reinstall that package, but it is unable to do it! If I remove this third-party PPA then the system is warning me about a very very serious problem. So why can I not install/reinstall/remove/update this package and why freezes the updater if I try to update? |
Can a creature (a PC or an NPC) attack another creature's shield or weapon? | I want to hit enemy's axe to break it. How this is properly played in D&D 5e? And what about shield or armor? Can I attack these items to break it? |
How do you install mods for 1.5.2 since you don't have a bin folder. I've tried duplicating the 1.5.2.jar and all that, but it still doesn't work. The mod that I want to install is the "Fossils and Archaeology Revival Mod". I have a Macbook by the way. | I've recently changed to the new Minecraft launcher, and I have noticed a change in the .minecraft folder layout. I can no longer install mods just by copying it over into the versions/1.6.1 jar file, as this file refreshes every time it is launched. For those who don't know what I am talking about, here is the new layout: I am specifically trying to install Optifine, which does work with 1.6.1. Where do I drag in the mod files now? I can't seem to find a jar file that is suited to it, except in the version folder, but as I stated above, this refreshes every time. After copying a recent version and renaming it in the version folder, I get this error in the development console: Unexpected exception refreshing version list java.lang.IllegalArgumentException: Version '1.6.1' is already tracked at net.minecraft.launcher.updater.VersionList.addVersion(VersionList.java:91) at net.minecraft.launcher.updater.LocalVersionList.refreshVersions(LocalVersionList.java:44) at net.minecraft.launcher.updater.VersionManager.refreshVersions(VersionManager.java:47) at net.minecraft.launcher.Launcher$2.run(Launcher.java:164) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) |
Currently, I am a graduate student specializing in algebraic geometry. On the other hand, I have also become extremely interested in the mathematical physics. However, I am not sure what steps I should take to get to the modern frontiers of mathematical physics research. My mathematical knowledge covers basic graduate analysis, algebra and topology with an emphasis in algebraic geometry, and as for physics, I know up to basic quantum field theory at the level of P&S and basic general relativity at the level of Wald. However, unlike those fields that I have studied so far, I am not sure what to learn in order to learn the basics to get to the research level, i.e., able to fully comprehend and dissect research papers in the mathematical physics journals. Most mathematical physics books that I have seen so far are only mathematical methods used in physics. To re-emphasize, I don't simply want references of mathematics used in physics, I wish to know the fundamentals that mathematical physics have to master and concrete examples of modern topics in the field. However, if it is essential, I would like to know what the main relevant mathematical topics are. I suppose one of the main things I'm confused about is, before one does any actual research, what exactly is the difference between the training/preparation for a mathematical physicist and a pure mathematician? It seems that mathematical physicists basically just learns mathematics, except it's not focused in a particular field and has some physical applications.Do mathematical physicists often get insights behind the way a physicist thinks about problems as well? Thus, for my main question: What specific books/papers should I start reading to understand the fundamentals of mathematical physics at this point and in what order should I read/study them? As for side questions: I do not really understand the basic knowledge that a mathematical physicist should have. Do they specialize in a particular area of mathematics or is it mostly topology and geometry or must they know other applicable areas such as functional analysis as well and to what depth? Would me continuing to self-study algebraic geometry be compatible with learning mathematical physics at the same time? What main fields are there now and what advanced books/papers could I read regarding them after learning the fundamentals as addressed in my previous question? What are the most relevant mathematical topics? Off the top of my head, I can think of mostly functional analysis and topology and geometry. | What are the best textbooks to read for the mathematical background you need for modern physics, such as, string theory? Some subjects off the top of my head that probably need covering: Differential geometry, Manifolds, etc. Lie groups, Lie algebras and their representation theory. Algebraic topology. |
We have a famous partiton identity which states "the number of partitions of $n$ into odd parts equals the number of partitions of $n$ into distinct parts". This is a famous result of Euler on partitions.. I know the proof using generating functions. But how can we prove the number of partitions of $n$ into odd parts equals the number of partitions of $n$ into distinct parts using Ferrers graph | This seems to be a common result. I've been trying to follow the bijective proof of it, which can be found easily online, but the explanations go over my head. It would be wonderful if you could give me an understandable explanation of the proof and let me know how I'd go about finding such a bijection. |
As a citizen of Argentina, I, in principle, need a visa to go to Canada, but not to most countries in Europe. I am offered a ticket to Europe with a short layover in Canada (e.g. Vancouver). Do I need a Canadian visa to be able to use that ticket? I live in the US and have a greencard. Does it make any difference? | I am a US Green Card holder. Do I need a visa to travel to and from Canada? Also, my friends are US citizens. Can they use birth certificates to enter and depart from Canada? |
Why P value of a 2 tailed test is multiplied by 2 [=2 X P(Z>tcal)? I am looking for a answer which may explain the underlying reason except the answer 'because it is a two tailed test'. Why we also consider the opposite signed value of test statistic in two tailed test to calculate P value? | I am looking for various ways of explaining to my students (in an elementary statistics course) what is a two tailed test, and how its P value is calculated. How do you explain to your students the two- vs one- tailed test? |
Let $R$ a left artinian ring. Show that if $a \in R$ is not a right zero divisor, then $a$ is a unit in $R$. Comments: I am tryed to do so: See the R-module $_{R}R$ and consider the function $f: _{R}R \longrightarrow _{R}R$ defined by $f(r)= ra$. As $R$ is artinian then $_{R}R$ has a composition series. I do not know if it's out there the way. | How to prove the following? $R$ is an associative ring with identity. $R$ contains element $r$. The element is not invertible on the right and is not a left divisor of zero. Then the ring $R$ cannot be Artinian on the right. |
I was reading through the key derivation for RSA. Here are the steps per wiki - Select strong primes $p$ and $q$ such that $pq = n$ $\phi(n)$ = $(p-1)(q-1)$ select $e$ such that $e$ and $\phi(n)$ are coprime. Select $d$ such that $ed mod(\phi(n)) = 1$ I do not understand why the $\phi(n)$ is even needed. Why can't we just skip the step and say -- select $e$ such that $e$ and $n$ are coprime. Would it not work? Is the math somehow dependent on that? If so what is it? Also why should $e$ be coprime to $\phi(n)$? To clarify my main question was about why e needs to be relatively prime to phi(n). Would it not work if its relatively prime to n? After following poncho's answer -- Lets say I want to pick e relatively prime to n. In his example N = 77. Lets say e = 4 then d = 19. So $edmod(N) = 1$. Of course e is not a prime number here, but the spec does not say e should be prime. It would appear that the $\phi(n)$ is chosen so that its smaller than N giving an opportunity to find the $e$ and $d$. So why choose $(p-1)(q-1)$? Why can't it be some other operation to make the result smaller than n? I know I am missing something here and its not clicking. Hope some one explains it. | While calculating RSA encryption key we take modulo $\varphi(n)$ rather than modulo $n$. I can’t understand why it’s done this way. |
which one of the following sentences is correct and why? Her face was intentionally blurred in the photo to not to reveal her identity? Her face was intentionally blurred in the photo not to reveal her identity? Thanks in advance! | This is one thing that keeps bugging me, and maybe there's a direct answer. Grammatically, which one is more correct of these two? Does it make a difference? I tried not to do that. I tried to not do that. |
Let $f\colon[0,1]\to\mathbb{R}$ be continuously differentiable on $[0,1]$ and satisfy $f(1)=0$. Show that $$\int_0^1|f(x)|^2dx\leq4\int_0^1 x^2|f'(x)|^2dx.$$ Since $f$ is differentiable on $[0,1]$, I can use mean value theorem -- there exists $\xi$ such that $$f'(\xi)=\frac{f(1)-f(0)}{1-0} = -f(0).$$ Unfortunately, I can't proceed further with the solution and have no clue how to use continuity of derivative. Any hints? | let $f:[0,1]\longrightarrow R$ be a differentiable function with continuous derivative such that $f(1)=0$,show that: $$4\int_{0}^{1}x^2|f'(x)|^2dx\ge\int_{0}^{1}|f(x)|^2+\left(\int_{0}^{1}|f(x)|dx\right)^2$$ I think it can be use Cauchy-schwarz inequality $$\int_{a}^{b}f^2(x)dx\int_{a}^{b}g^2(x)dx\ge\int_{a}^{b}(f(x)g(x))^2dx$$ |
I can ssh to multiple servers but once I've reached one of them, I can't ssh to the next I have to go back to my local machine and then ssh to the next server. I would like to set up a script that lives on each these servers that can exit and then ssh to the next arbitrary server. I've tried setting up an alias for this. like so: alias host2="exit; ssh host2;" that didn't get me anywhere, Then I spent a long time looking into the localcommand config for ssh and I don't think that can help me either. Most recently I've been looking into writing a script that suspends the ssh instance and drops you local again, but I can't seem to get the formatting right for echoing ~ ^Z. Even if I could I'm not sure it would help. Now my only thought is that maybe the remote server could scp the host name to a shared location and once back I could check that file if it has anything I use that as my next server. But I'm guessing there is a way easier way. Anyways any ideas or insights would be much appreciated thank you! | I have a network topology like this: Laptop -> Bastion -> Destination Bastion and Destination are EC2 instances using the same SSH key for SSH access. However, Destination cannot be accessed from the Internet. Its IP address is visible only to Bastion. I am able to connect to the Bastion and use agent forwarding to pass the SSH key over and then connect separately from the Bastion to the Destination server. However, I'd like to configure my .ssh/config file in such a way that I can SSH to the Destination server using one command from the laptop. My current .ssh/config file looks like this: Host Bastion Hostname <redacted> IdentityFile ~/.ssh/mykey.pem Host Destination Hostname <redacted> User ubuntu ProxyCommand ssh -A bastion-dev -W %h:%p But when I run ssh -A ubuntu@Destination SSH responds with: Permission denied (publickey). ssh_exchange_identification: Connection closed by remote host How do I correctly pass the SSH key from my local to the Bastion server without having to store it on the server? Can I configure all this via .ssh/config file so that I can log into the Destination server with a single command? |
I want to backup all 200+ databases on a MySQL server to all-dbs.sql. I want to exclude the mysql schema. How can I do that? | We have 40 databases in our server. We want to take 36 databases backup using mysqldump. How can i ignore remaining 4 databases in mysqldump command? Is there any option for mysqldump to ignore databases for backup in MySQL? I know the general mysqldump command but it is very lengthy. I want to ignore only 4 databases and need to take remaining dbs backup. |
exception 2020-06-06 16:59:42.186 21574-21574/elit.express.elit E/AndroidRuntime: FATAL EXCEPTION: main Process: elit.express.elit, PID: 21574 java.lang.RuntimeException: Unable to start activity ComponentInfo{elit.express.elit/elit.express.elit.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference MainActivity.java package elit.express.elit; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; public class MainActivity extends AppCompatActivity { private Toolbar toolbar; private View toEditName; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setReservationActivity(); //setIconsVisibility(true); toEditName= findViewById(R.id.toEditName); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_reservation, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.toEditName: setRegistrationActivity(); break; case R.id.toHistory: break; default: break; } return super.onOptionsItemSelected(item); } ////////////////////Set activities private void setActivityToolbar() { toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); } protected void setRegistrationActivity() { setContentView(R.layout.activity_registration);// set layout setActivityToolbar(); getSupportActionBar().setTitle(R.string.toolbar_name); } protected void setReservationActivity() { setContentView(R.layout.activity_reservation); setActivityToolbar(); getSupportActionBar().setTitle(R.string.reservation); toEditName.setVisibility(View.VISIBLE); } void setIconsVisibility(boolean visibility){ if(visibility){ findViewById(R.id.toEditName).setVisibility(View.VISIBLE); findViewById(R.id.toHistory).setVisibility(View.VISIBLE); } else{ findViewById(R.id.toEditName).setVisibility(View.GONE); findViewById(R.id.toHistory).setVisibility(View.GONE); } } ////////////////Buttons public void onClickRegistration(View view) { setReservationActivity(); } } menu_reservation.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/toEditName" android:title="@string/buttonEditName" app:showAsAction="ifRoom" android:icon="@drawable/ic_edit_name" android:visible="false"/> <item android:id="@+id/toHistory" android:title="@string/buttonHistory" app:showAsAction="ifRoom" android:icon="@drawable/ic_history" android:visible="false"/> </menu> | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
I've got a Node<T> with an equals() method: public boolean equals(Node<T> other) { if (this == other) return true; if (other == null) return false; if (!obj.getClass().equals(other.getObject().getClass())) return false; return obj.equals(other.getObject()); } I only care if the object held in my node is equal to the object held in the other node (because two equal objects can be held in different positions in my list). The object I'm holding is a Token. The Token.equals() method works while my Node.equals() method does not: public class TokenEqualityTest { public static void main(String[] args) { Token t = new Token(0); Token q = new Token(0); System.out.println("t.equals(q): " + t.equals(q)); Node<Token> tnode = new Node<Token>(null, null, t); Node<Token> qnode = new Node<Token>(null, null, q); System.out.println("tnode.equals(qnode): " + tnode.equals(qnode)); } } which prints: t.equals(q): true tnode.equals(qnode): false If I put a breakpoint at Token.equals() and run the eclipse debugger, my code stops once (at t.equals(q)). This indicates that Node<Token>.equals() does not call Token.equals, and I have verified that the debugger does step through the line return obj.equals(other.getObject());. Why doesn't my Node.equals ever call Token.equals when I've declared a Node<Token>? | I ran into an interesting (and very frustrating) issue with the equals() method today which caused what I thought to be a well tested class to crash and cause a bug that took me a very long time to track down. Just for completeness, I wasn't using an IDE or debugger - just good old fashioned text editor and System.out's. Time was very limited and it was a school project. Anyhow - I was developing a basic shopping cart which could contain an ArrayList of Book objects. In order to implement the addBook(), removeBook(), and hasBook() methods of the Cart, I wanted to check if the Book already existed in the Cart. So off I go - public boolean equals(Book b) { ... // More code here - null checks if (b.getID() == this.getID()) return true; else return false; } All works fine in testing. I create 6 objects and fill them with data. Do many adds, removes, has() operations on the Cart and everything works fine. I read that you can either have equals(TYPE var) or equals(Object o) { (CAST) var } but assumed that since it was working, it didn't matter too much. Then I ran into a problem - I needed to create a Book object with only the ID in it from within the Book class. No other data would be entered into it. Basically the following: public boolean hasBook(int i) { Book b = new Book(i); return hasBook(b); } public boolean hasBook(Book b) { // .. more code here return this.books.contains(b); } All of a sudden, the equals(Book b) method no longer works. This took a VERY long time to track down without a good debugger and assuming the Cart class was properly tested and correct. After swaapping the equals() method to the following: public boolean equals(Object o) { Book b = (Book) o; ... // The rest goes here } Everything began to work again. Is there a reason the method decided not to take the Book parameter even though it clearly was a Book object? The only difference seemed to be it was instantiated from within the same class, and only filled with one data member. I'm very very confused. Please, shed some light? |
I have a code segment that looks like this: 53 Debug.Log("Palette Count: " + palette.Count); 54 Debug.Log("Selection: " + selection); 55 palette[selection].isOn = false; For reference: palette is a List<Toggle> selection is an int The code works perfectly, except when I add the following to the Start function: 20 for (int i = 0; i < palette.Count; i++) { 21 palette[i].onValueChanged.AddListener(delegate { setSelect(i); }); 22 } For reference: 194 private void setSelect(int index) { 195 Toggle toggle = palette[index]; 196 if (toggle.isOn) { 197 selection = index; 198 } 199 } Once these segments are included, I receive the two Debug.Log() outputs and a runtime error: Palette Count: 9 UnityEngine.Debug:Log(Object) UIManagerW:Update() (at Assets/Scripts/World/UIManagerW.cs:53) Selection: 0 UnityEngine.Debug:Log(Object) UIManagerW:Update() (at Assets/Scripts/World/UIManagerW.cs:54) ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <437ba245d8404784b9fbab9b439ac908>:0) System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <437ba245d8404784b9fbab9b439ac908>:0) System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <437ba245d8404784b9fbab9b439ac908>:0) UIManagerW.setSelect (System.Int32 index) (at Assets/Scripts/World/UIManagerW.cs:195) UIManagerW+<>c__DisplayClass11_0.<Start>b__0 (System.Boolean <p0>) (at Assets/Scripts/World/UIManagerW.cs:21) UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <d815b7efac424eeb8e053965cccb1f98>:0) UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <d815b7efac424eeb8e053965cccb1f98>:0) UnityEngine.UI.Toggle.Set (System.Boolean value, System.Boolean sendCallback) (at C:/Program Files/2019.3.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:280) UnityEngine.UI.Toggle.set_isOn (System.Boolean value) (at C:/Program Files/2019.3.6f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:243) UIManagerW.Update () (at Assets/Scripts/World/UIManagerW.cs:55) I'm not really sure how this is possible. I can restore the functionality by commenting out the lines within setSelect, so it would seem that Line 195 is the culprit. I just haven't a clue what to go off of here. Thanks in advance for any help you can provide! | I met an interesting issue about C#. I have code like below. List<Func<int>> actions = new List<Func<int>>(); int variable = 0; while (variable < 5) { actions.Add(() => 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? |
Is it possible to block/eliminate particular noise sounds with artificially generated sound waves or any other ways? | I saw youtube videos that claimed to do this, although I'm quite certain the videos just excluded sound and lied. However, I am wondering if the physics of this is actually possible - to create a completely negative sound wave that cancels the sound out to a flat line i.e. complete silence. p.s. I am not referring to white noise, which prevents the sound from being heard by overriding it with a different sound (white noise). Rather, I am referring to making a sound be completely silent by generating the inverse, opposite, or "negative" sound wave. |
I am trying to place an object to coordinates on textfile using blender python. How do I do this? | I would like to know how I can save selected object names, location and rotation using Python in Blender 2.8 in a CSV. And then using the same CSV apply this information to another blend file with the same objects in different locations in a new frame. (it's not about bones it's about normal meshes). Beeing new to Blender Python scripting, I hope for some coding hints here. so far i got this (works in console but not in script file) import bpy import os ob_active = bpy.context.selected_objects for obj in ob_active: print(obj.name,obj.location,obj.rotation_euler) |
So this is killing me... I read the book some years ago. My premise was that I do not read enough different authors, so I started picking books at random going down the alphabet. This book was pretty far down the shelf of my library at the time, close to "Zhan". The premise of the book was that medicine is bad, in prolonging life unnecessarily. So all medicine was banned. Our young protagonist finds a medic bag in an old ambulance, and starts saving people. Leading to some unfortunate consequences. It was called Dark Wing, or Night Wing, or some such. Please help. | Set in the future, when all medicine is illegal, but technology has advanced to star-trek levels - most people live in free government provided acconmodations, and eat free food from public replicators, although it is only free as long as they agree to not have children. A kid finds a crashed ambulance containing a laptop with a medical library and AI diagnostic software, so he starts teaching himself medicine, and then runs around curing people. Literally runs, in a few scenes. His interest in ill people is noticed, and he gets recruited to some sort of government team, whose purpose is to bring people comfort as they are dying and incidentally enforce the ban on medicine. Eventually I think it ends badly - I vaguely remember him being executed at the end, although I might be mixing that up with another story. There is an additional sub-plot about another kid whose parents were martian diplomats, who came to earth to negotiate something, but were killed in an "accident". He's trying to save enough money to pay for a flight back to mars. I remember a scene, of him selling some rare martian things at the side of the road, which is where the protagonist found him. I also sort of remember the book having a green/blue cover, and the title "dark wings", but that is probably totally off as I've tried googling for variations on the name, and nothing came up, so it's probably called something completely different. Any idea what book this was? |
Which one is correct and why? I can speak (a language). I know to speak (a language). | I was reading a website where common English sentence errors are written - INCORRECT - He doesn't know to swim. CORRECT - He doesn't know how to swim. I know He doesn't know how to swim is a correct sentence. But why is the other one wrong, is my question? I know that know is a transitive verb. So, the following are correct - i) He knows swimming. Swimming is a gerund. We can also use the infinitive form here - to swim ii) He knows to swim. |
What is the difference between the 2 calls: Set<Record> instances = new HashSet<Record>(); - on one hand HashSet<Record> instances = new HashSet<Record>(); - on other hand | I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this? I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly. Is it just so if you were to do: IInterface classRef = new ObjectWhatever() You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that. Also, how could you write a method that takes in an object that implements an interface? Is that possible? |
I'm currently facing a problem when trying to edit the text of a TextView in the OnCreate method of an Activity. As I understand, setContentView must be called before trying to change the text, however I am still having trouble with this. Here is the code in question : @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dash_board); DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.addDrawerListener(toggle); toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); userEmailtext = (TextView) findViewById(R.id.emailText); mAuth = FirebaseAuth.getInstance(); mUser = mAuth.getCurrentUser(); userEmailtext.setText("This Does Not Work"); } This Activity includes the Android Studio default sliding menu. The aim of this setText is to change the email address text of the sliding menu. I believe the problem may lie in the fact that the sliding menu is part of a different layout file, meaning there is no "emailText" textview leading to the null pointer exception, however I am still not sure how this would be rectified. Any help is appreciated. | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
Prove that any finite group of order $n$ is isomorphic to a subgroup of $\mathbb{O}(n)$, the group of $n\times n$ orthogonal real matrices. Attempt: Let $G$ be a group of order $n$. Then $G$ is isomorphic to a subgroup of the symmetric group $S_n$. But how to go further? | For every finite group $G$ , does there exist $n \in \mathbb Z^+$ such that $G$ can be embedded in $SO_n(\mathbb R)$ ? Can every finite group be embedded in $SL_n(\mathbb R)$ for some $n$ ? |
I'm sitting with the proof in front of me, but I do not understand it. $$A = \{n \in Z^{++} \mid (1^3 + 2^3 + 3^3+\cdots+n^3) = (1 + 2 + \cdots + n)^2\}$$ The first step of proof by induction is simple enough,to prove that $1 \in A$ $1^3 = 1^2$ The next step is where I get tripped up. So I add $n + 1$ to the right hand side $$(1 + 2 + \cdots + n + (n + 1))^2 = (1 + 2 + \cdots + n)^2 + 2(1 + 2 + \cdots + n)(n + 1) + (n + 1)^2$$ My algebra is failing me here, because I do not understand how the equation was expanded. | How can I prove that $$1^3+ 2^3 + \cdots + n^3 = \left(\frac{n(n+1)}{2}\right)^2$$ for all $n \in \mathbb{N}$? I am looking for a proof using mathematical induction. Thanks |
I recently came across a question on Quora: What are future plans for Gtk? Is there plan for smartphone or tablet? Gnome focus on touch devices but Gtk software can not run on it? On Quora, why Gtk topic only have 538 follower (Qt have 4k)? I really worry about it :( This is an interesting question, and I considered answering it. Unfortunately I have no idea why this is so... So: Why did Canonical choose to use the Qt toolkit for Ubuntu Touch and not Gtk? And why is it much less popular as a GUI toolkit? | So much has been written that I'm kind of confused, but if I'm not mistaken Canonical is building the next generation of Unity for mobile devices with Qt, and in the near future the desktop will also be migrated to qt. I just wanted to know the technical and/or political reasons driving this decision, and what consequences could it mean for the currently existing Ubuntu desktop applications. |
I saw someone said "Had you anyone specific in mind" in an old English drama. How am I supposed to understand this sentence? | Is the following sentence correct English? Have you the address? The address in question is obvious to the person being asked. It's normal to ask such a question as "Do you have the address?" or even "Have you got the address?" But is it acceptable to use just the verb have without do or got? |
Quite often, comments on a question ask for the original poster to add details. For example: What architecture are you compiling for? What version of XYZ are you using? I think it would be helpful for these comments to be visible while editing the original question. That way, we won't have to keep going back and forth or open a new tab. | We have inline comment editing, inline editing of questions on Area 51, and inline re-tagging. Can we please have inline Question and Answer editing on the Stack Exchange sites? This has been implemented using a GreaseMonkey Script. Try it out yourself. It's old, so I'm not sure if it will still work: |
I am digitizing my video collection and want to put it on an external hard drive. It is a 1TB Western Digital HD. The files are all over 5GB as I am ripping the files with Handbrake and at a very high quality. I use the copy/paste method of transferring them to the HD and when it hits a certain size, it errors and stops the transfer telling me that the file is too big. There is plenty of space on the HD. Any suggestions would be appreciated! Thanks. I am running Ubuntu 12.04 on a Dell Latitude E6400 32bit. | I am trying to copy a 6GB file to a USB flash drive but it won't copy. |
I want that when i change the window size, that my content in it will be places as in the default size only should it resize itself <Window =Height="500" Width="800" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="consoleOutput" Margin="170,10,10,140" Background="Aqua"/> <TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="menuOutput" Margin="10,10,630,245" Background="Gray"/> <TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="menuOutput2" Margin="10,245,630,10" Background="Green"/> <TextBox HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="consoleInput" Margin="170,340,10,10" Background="Red" AcceptsReturn="True"/> </Grid> </Window> | Some WPF controls (like the Button) seem to happily consume all the available space in its' container if you don't specify the height it is to have. And some, like the ones I need to use right now, the (multiline) TextBox and the ListBox seem more worried about just taking the space necessary to fit their contents, and no more. If you put these guys in a cell in a UniformGrid, they will expand to fit the available space. However, UniformGrid instances are not right for all situations. What if you have a grid with some rows set to a * height to divide the height between itself and other * rows? What if you have a StackPanel and you have a Label, a List and a Button, how can you get the list to take up all the space not eaten by the label and the button? I would think this would really be a basic layout requirement, but I can't figure out how to get them to fill the space that they could (putting them in a DockPanel and setting it to fill also doesn't work, it seems, since the DockPanel only takes up the space needed by its' subcontrols). A resizable GUI would be quite horrible if you had to play with Height, Width, MinHeight, MinWidth etc. Can you bind your Height and Width properties to the grid cell you occupy? Or is there another way to do this? |
This was a short story I read sometime before 2000, most likely sometime between 1981 and 1995. It was collected in a paperback with other stories, which I believe (but am not sure) were by separate authors. I also believe (but am not sure) that the cover of the paperback was pink. I may have checked out the book from the public library, which means the book itself could have been arbitrarily old. On a planet with a hostile atmosphere, there are humans living within a dome or some other artificial environment. Each generation genetically engineers the next generation to be closer to being able to live outside the dome. At the end of the story (and perhaps also the beginning of the story—I'm not sure how much time elapses during the narrative) the final generation is almost ready to be released into the wild, but they are strong (with a low, dense, non-humanoid body shape) and out of control, and they risk damaging (or actually do damage) the dome and therefore the lives of the older generations. The young ones will survive and thrive on the planet, the older ones think to themselves with pride, even if the rest of us must parish. The subtext of the story is that while the youngsters may technically be human (in the sense of DNA), they are no longer human from any meaningful point of view. The reader is left questioning the wisdom of their plan. Maybe the first generation engineers all the subsequent generations, instead of each engineering the next. That's not how I remember it, but if each generation engineered the next, then the penultimate generation would be not human enough to convey the subtext. Also, the final generation is wild, presumably lacking any kind of education or technical know-how, so presumably the penultimate generation would be close enough to wild that they wouldn't be able to genetically engineer anything. This IMHO would make it hard for the author to pull off each-generation-engineers-the-next, but maybe she or he was able to. | I am looking for a short story and anthology / anthologies containing it: A multi generation ship has landed on a planet with very hostile inhabitants on it. The aliens are chipping away at the hull of the ship with primitive instruments. The leaders of the space ship decide to breed aggressive children to counter the aliens. They know that this is suicidal as the children will be so aggressive that they will kill the parental generation. I think I read this in an anthology in early 80's / late 70's. Most likely published in 70's. |
I just upgraded my Ubuntu to 14.04, after I got a notification about it. All the installation went well but after restart now, when I go to the Ubuntu option from grub, it shows only a purple screen and nothing happens after that. I also have Windows 8 installed in my laptop, but hope that should not be a problem, as it worked well with ubuntu 13.10. Please help me to fix this problem, or at least to get back to my previous ubuntu I had. Thanks. | I am trying to boot Ubuntu on my computer. When I boot Ubuntu, it boots to a black screen. How can I fix this? Table of Contents: |
Wolfram Alpha says: $$\lim_{x\to0}\left(\frac{\tan x}{x}\right)^{1/x^2} = e^{1/3}$$ What are the steps leading to this result? Only with the Hospital rule, I have as a result infinity. | Can someone help me with this limit? I'm working on it for hours and cant figure it out. $$ \lim_{x\to 0} \left(\frac {\tan x }{x} \right)^{\frac{1}{x^2}}$$ I started transforming to the form $ \lim_{x\to 0} e^{ {\frac{\ln \left(\frac {\tan x}{x} \right)}{x^2}} }$ and applied the l'Hopital rule (since indeterminated $\frac00$), getting: $$ \lim_{x\to 0} \left( \frac{2x-\sin 2x }{2x^2\sin 2x} \right)$$ From here, I try continue with various forms of trigonometric substitutions, appling the l'Hopital rule again and again, but no luck for me. Can someone help me? |
Does the baking/cooking process change the nutritional value of food? I don't know the science behind that. I want to calculate more than just calories -fat, carbs, sugars, protein, etc... Is it just as simple (albeit, time consuming) as adding up those values on the ingredients? Or is there more to it than that? | I like to cook from scratch, and I'm currently trying to loose a few pounds. I know that cooked food is generally more calorific than raw food, so if I add up the calories of the ingredients I know it won't give an accurate result. So my questions are two-fold: How much difference is there between a raw food item and a cooked food item? Is there a method to deduce the calorie content of cooked food (given the know values of its raw form) ? |
I've been so curious about whether the adverb 'quickly' can be inserted between the verb 'turn out' and its direct object 'the light'. For example, is it grammatically correct? He turns out quickly the light I have been learning that in terms of syntax an adverb cannot interrupt the close bond between the head and its complement. | I've come across the phrase "Listen carefully to what I say" and I'm really not sure why carefully has gone in between listen and to. It doesn't happen with other verbs; you don't "switch carefully on the light", for example. When can an adverb follow a verb, and when can it not? |
How do I find out if a PHP array was built like this: array('First', 'Second', 'Third'); Or like this: array('first' => 'First', 'second' => 'Second', 'third' => 'Third'); ??? | PHP treats all arrays as associative, so there aren't any built in functions. Can anyone recommend a fairly efficient way to check if an array contains only numeric keys? Basically, I want to be able to differentiate between this: $sequentialArray = [ 'apple', 'orange', 'tomato', 'carrot' ]; and this: $assocArray = [ 'fruit1' => 'apple', 'fruit2' => 'orange', 'veg1' => 'tomato', 'veg2' => 'carrot' ]; |
i bought an expensive desk lamp from the US called , i lost the power adapter, so my questions are as you are electrical engineers: 1) can i use it in israel ? does it lose its peak because the countries difference? 2) what power adapter should i seek for when buying? | Power supplies are available in a wide range of voltage and current ratings. If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify? What if I don't know the device's specs, but am replacing a previous power supply with particular ratings? Is it OK to go lower voltage, or should it always be higher? What about current? I don't want a 10 A supply to damage my 1 A device. |
Recently, I finished gravitation. I wonder why the shapes of planets or any body revolving around any star are not cubical or ellipsoidal. In our solar system all the planets are spherical in shape. Why isn't a body of any other shape found revolving around the gravitational field of any star? | Why are stars, planets and larger moons (approximately) spherical in shape (like, the Sun, the Moon, the Earth, and other planets)? |
I'm trying to figure out how to prove that if $p$ and $p^2+2$ are prime numbers then $p^3+2$ is a prime number too. Can someone help me please? | Suppose $p$ and $p^2+2$ are prime numbers, prove that $p^3+2$ is also a prime number. Actually I do not know what is the relationship among square numbers, cube numbers and prime numbers |
(I also asked this on Blender Artists) I’m trying to run: bpy.ops.poselib.apply_pose(pose_index=index) For some reason I can’t seem to be able to find way to set active pose action to be able to run this. I’ve found how to get access to current action (I think): context.object.animation_data.action = bpy.data.actions.get(sel) But it isn’t the same thing. Doing this does work for selecting action, it sets current action in Dope sheet BUT it doesn’t set it in Properties window’s Pose panel… rendering it useless. I would need to be able to set the actual Properties window Pose Library panel selection. If I run ops code with incorrect Pose Window selection, it just fails …but if I change target pose library manually, it works. One would think that if ops exists, there has to be a way to also select which one of Pose Libraries to target. Any help appreciated! | I want to make a button that changes the active poselib to another one from the list, a specific one. I look in the console and can't see any operator. any ideas? |
Which one would be correct? I wish it weren't raining today. I wish it wasn't raining today. I wish it were raining today. I wish it was raining today. | If I was... If I were... When is it correct to use "If I was" vs. "If I were" in standard English? |
I did something and now the mouse pointer moves when I press the arrow keys. This is very inconvenient, for example, when editing text. In the operating system settings, keyboard pointer management is disabled. Perhaps this is due to the laptop model. How to disable it? OS: Windows 10. Notebook: MSI GL72M 7REX | I'm encountering a strange problem on my W10 computer, for a few days my arrow keys have been "driving" my mouse pointer. Pressing the left arrow key will move the pointer a few pixels left, etc. The first thing that came to my mind was "oh well, I must have enabled Mouse Keys inadvertently". But Mouse Keys use the numpad and even then, it's not enabled. Rebooting doesn't help, but I've noticed it doesn't happen if the current window is ran as another user (Administrator) or if it's the Task Manager, which suggests the event filter that's catching the key press events is only active on my UID. I've tried killing various processes but I'm running out of ideas. I'm fairly sure it's a dumb issue but it's been driving me nuts. |
I'm trying to do some Minecraft animation, so I get some textures and rigs and did this. But when I import that object I´ve got this I'm little bit newbie and I want to join to Blender community. | I used node textures in a mesh I exported to .FBX. I then imported it into Unreal Engine 4 and it didn't import any textures; I clicked the Upload Textures option in Unreal Engine. Is there something I'm doing wrong or is it Blender? |
I use Ubuntu 14.04 Desktop Edition. Now I see Software Updater's message that it must be updated. Then I get a message requires installation of untrusted packages from unauthenticated sources What's going on here? How can I solve it? | Any install that I'm trying through the Software Center is telling me: Requires installation of untrusted packages: The action would require the installation of packages from not authenticated sources. I did an apt-get update from the command line, then removed the software sources that the keys were bad from (PPAs I added myself), and unchecked them in the software sources for software center, but to no avail. I can't install anything from software center anymore - only> from the command line with apt-get. Is uninstalling/installing the only option? I don't want to break other PPAs that I have. Additional information: Here's a paste from apt-get update: Reading package lists... Done W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B725097B3ACC3965 W: GPG error: http://us.archive.ubuntu.com oneiric Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]> I've tried apt-key update, and there was no effect (two keys unchanged). The output of apt-get update and apt-get upgrade, and the contents of /etc/apt/sources.list, can be found in . |
i installed nginx server in ubuntu instance. then i copy my data into /var/www/html folder. then i access site through public ip. its working fine. Then i create A record with public ip address. so i can access with domain name. After few hours i am not accessing the site. I checked in server nginx service is running. but i can't access the website. ports are open in security group for that instances. curl localhost curl privateip curl publicdns are working. but curl with public ip is not working. could you please help me this issue. | I am new to AWS and I have a question. I want to host a website on two EC2 instances. From what I read, if I stop the EC2 instance the public IP will change. In my case, Route 53 should route traffic to load balancer. How can I configure my load balancer to route the traffic to EC2 instances without changing the IP if I change one of them? In other words, is there a way to have a fixed public IP to my two EC2 instances when they are switched off such that my load balancer routes the traffic to them? Thanks. |
I want to implement day/night functionality on world map i.e there will be dark layer showing countires having night now. This world map could be creaeted through ESRI or SVG map.I want to understand what is the logic of showing behind implementing this.Any known algorithms/formulas. I have posted this question in stackoverlfow (). But thought this is better forum. | I have a daytime raster of my study area. I have 20+ counters in the study area that count "stuff" with a timestamp. Using I determined the type of ambient light for each collected data point. What I'd like to do: Add a grey/semi transparent overlay to reflect the ambient light (Dusk, Sunrise, day, sunset, and dark). The end goal: produce a time-based visualization of the data collection that highlights the time of the day. Or be able to produce a snapshot at a certain time with the proper shaded overlay. Think of this as this the image: |
I am new to photography any i am not sure what is the correct settings when shooting long distance landscapes. The photo that I took is pretty blurry/hazy. Is there any specific settings or equipment to reduce this blur/haze when shooting long-distance landscapes? Here is an example of a photo that I took. | Distant landscapes often appear hazy, washed-out and blue due to . What can be done to maximise the contrast range of the exposure when photographing such scenes? For example: Would any sort of hardware, camera settings, or type of "film" (including digital) produce better results? Are there reliable ways to predict when haze will be lowest? |
When I try to install Chrome through the Ubuntu Software Center, I get the message Dependency Is not satisfiable : libstdc++6 (>=4.8.0) How can I fix this? I am running Ubuntu 12.04. | I am trying to install google-chrome-stable on a fresh ubuntu 12.04 installation. I run the following commands wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo dpkg -i google-chrome*.deb I get the following errors dpkg: dependency problems prevent configuration of google-chrome-stable: google-chrome-stable depends on libstdc++6 (>= 4.8.0); however: Version of libstdc++6 on system is 4.6.3-1ubuntu5. google-chrome-stable depends on lsb-base (>= 4.1); however: Version of lsb-base on system is 4.0-0ubuntu20.3. dpkg: error processing google-chrome-stable (--install): dependency problems - leaving unconfigured Processing triggers for man-db ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for desktop-file-utils ... Processing triggers for gnome-menus ... Errors were encountered while processing: google-chrome-stable When I run sudo apt-get install -f I just have google-chrome-stable removed: The following packages will be REMOVED google-chrome-stable If I look for the required versions, e.g. I try sudo apt-get install libstdc++6=4.8.0 I cannot find the version: E: Version ‘4.8.0’ for ‘libstdc++6’ was not found How do I fix that? I know there is no longer support for 32bit version of Ubuntu 12.04. I am running 64bit Ubuntu version. |
How to put a number greater than 9 to regexp character set? For example, I can do ^[01236]$, but what if I want to put 100 as an option to the set? How do I solve this problem? | I don't really understand regular expressions. Can you explain them to me in an easy-to-follow manner? If there are any online tools or books, could you also link to them? |
I have received so many different answers and I'm hoping to get one from someone who knows about this specific issue. My MacBook Pro was stolen last week, but it is still showing on my devices on find my iPhone as "offline." If the thief wiped the laptop, would it still show as offline or would it be completely removed? I read something about it being possibly stored in the NVRAM so it could still show up like it is but I want to be certain. Thank you so much for your answers | Possible Duplicate: My MacBook was stolen last week, and I have just realized that I had set up iCloud and "find my iPhone". It is currently showing up as off-line. I do not know whether it will connect if the thief has already wiped the system. I've set up to get an email alert if it connects. If my MacBook has been wiped by a thief will the "find my iPhone" app still work to locate that hardware? |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.