body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
In a default Ubuntu 19.04 - how often is computer time synchronized with time servers? Once every hour? Once every day? Something else entirely? | I'm running the latest ntpd. When I start ntpd my system time synchronizes with ntp server's ntp. After synchronizing I changed my system time manually using date command date -s '1997-02-22 12:00:00' My system time got changed as per the date command. NTPD is still running, I want to know at what time interval my system time will sync with the internet via ntp. |
Assignment two arrays in a method receiving an array but contents of not changed,why public class Sol { public static void main(String[] args) { int[] list = {1, 2, 3, 4, 5}; reverse(list); for (int i = 0; i < list.length; i++) System.out.print(list[i] + " ");// here it prints after reversing 1 2 3 4 5 why? } public static void reverse(int[] list) { int[] array = new int[list.length]; for (int i = 0; i < list.length; i++) array[i] = list[list.length - 1 - i]; list = array; here is the problem // is it call by value //here assignment why does not change the contents after exit from the method i do not ask about call by reference and i do not need answers for the code i need to understand this statement (list = array; why is it call by value when exiting from the method reversing disappeared) } } | I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation? |
I'm trying to vertically align an inline element in a div tag. Here is my HTML: <div class="foo"> <div id="bar"> <a href="#">Link 1</a> </div> </div> And here's my CSS: .foo{ width:200px; height:60px; background-color:red; } .foo #bar{ text-align:center; vertical-align:middle; } How do I vertically align this anchor tag? Have I set the HTML/CSS up the right way to effectively do this? What are the best practices for vertically aligning inline and block elements? Thanks | how could i vertically center a <div> within a <div> ? my code so far: <div style="height:322px;overflow:auto;"> <div style="border: Solid 1px #999999;padding:5px;"> </div> </div> i have tried "top:50%;" and "vertical-align:middle;" without success EDIT: okay so it's been discussed a lot. and i've maybe started another mini flame war. but for argument sake, how would i do it with a table then? i've used css for everything else so far so it's not like i'm not trying to employ "good practices". EDIT: the inner div does not have a fixed height |
Tough to come up with the title for this question. More for proof of concept, I'm wondering why this doesn't work. What I'm attempting to do is use a jquery event to change the ID attribute, then use another jquery event bound to this newly changed ID. For example: <?php echo <<<END <html> <head> <style> #before { color:maroon; } #after { color:blue; } </style> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script> <title>Test</title> <script type="text/javascript"> $(document).ready(function(){ $("#before").hover(function() { $(this).attr("id","after"); }); $( "#after" ).click(function() { alert( "Handler for .click() called." ); }); }); </script> </head> <body> <p id="before">TEST TEXT</p> </body> </html> END; ?> On hover over my test text, the color changes from maroon to blue, as expected. It is my understanding that the text would now have an ID of "after" and the click event handler function would apply when clicked. However that is not the case the quick event handler and its associated alert does not appear to trigger. I am new to jquery is there perhaps an update handlers function I'm overlooking? | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
The function i have created thus far: def CameraLock(self): bpy.ops.object.select_pattern(pattern="Camera") bpy.ops.object.constraint_add(type='TRACK_TO') #c = bpy.data.objects["Camera"].constraints["Track to"] #c.target = bpy.data.objects["Cube"] #c.track_axis = "-Z" The code firstly selects the camera to be the active object which allows me to add a constraint.However when i uncomment the next two lines to track the cube the code fails and blender closes. i have been trying to read up other ways of adding the constraint but thus far have failed to find another solution. | I'm writing a python script that creates a large number of objects and I'd like them all to point at a certain point in 3d space. (left is what I've got, right is what I want) Pretty much exactly like the 'Track-to' constraint, but I don't need it to update interactively or be animated, I just need to rotate each object when they are created. I also don't care about the up-direction at all, since the objects are cylindrically symmetrical. I know how to create the objects, but I don't know how to aim them. I'm not good at maths, so I don't even know where to begin with this other than that it'll probably involve vectors and matrices (which I don't really understand). The reason I don't want to use the existing constraint system is because it's a bit slow when dealing with a lot of objects, and I'd like to learn a bit about this sort of maths. |
I'm trying this for the first time, so my code comes entirely from tutorials but it just doesn't work. I run PHP 7 with JSON 1.4.0 enabled. I can print the resulting rows if I don't use json_encode, so my connection and the query are OK. Error reporting is active but doesn't output anything either. If I run the php file on my server, I just get a blank page. Here's my code: error_reporting(-1); try { $conn=new PDO("mysql:host=server.com;dbname=theDB",username,password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $conn->prepare('SELECT * FROM table'); $stmt->execute(); header('Content-type: application/json'); echo json_encode($stmt->fetchAll(PDO::FETCH_ASSOC)); } catch(PDOException $e) { echo 'ERROR: ' . $e->getMessage(); } | I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur? This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2. |
The function $f(x)=\tan^{-1}\left(\frac{1}{x^2+x+1}\right)$ and the sum $$A = \sum_{k=1}^{17}f(k)$$ is given. Evaluate $\tan(A)$. I tried to expand the expression using trigonometric addition formula but i couldn't find any pattern or it doesn't become simple. Thanks in advance! | This is from a GRE prep book, so I know the solution and process but I thought it was an interesting question: Explicitly evaluate $$\sum_{n=1}^{m}\arctan\left({\frac{1}{{n^2+n+1}}}\right).$$ |
I'd like to find $\lim_{n \to \infty} \frac{1}{n}\int_{0}^{n}\frac{x\ln(1+\frac{x}{n})}{1+x}dx$ I am wondering if it is true that it converges to $\ln2$? thanks in advance | fine the limit : $$\lim_{ n \to \infty }\frac{1}{n}\int_{0}^{n}{ \frac{x\ln(1+\frac{x}{n})}{1+x}}=?$$ My Try: in the $$I=\int_{}^{}{ \frac{x\ln(1+\frac{x}{n})}{1+x}}=\left(x+n\right)\ln\left(\left|x+n\right|\right)+\left(\ln\left(n\right)-\ln\left(n-1\right)\right)\ln\left(\left|x+1\right|\right)+\operatorname{Li}_2\left(-\dfrac{x+1}{n-1}\right)+\left(-\ln\left(n\right)-1\right)+c$$ now? |
I tried to insert the "is incomparable to" (or "equal and parallel to") symbol to my equation. So, I tried the solution supplied by Wikipedia (). But I got a compiler error (missing $ inserted) Any comment, suggestion is welcome Thanks in advance | I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out? |
How to write a cycle pro all files *.py except a.py? for i in *.py && !(a.py); do python3 $i done | I have ubuntu file system directories in the root directory and I accidentally copied hundreds of files into root directory. I intuitively tried to remove copied files by excluding file system like rm -rf !{bin,sbin,usr,opt,lib,var,etc,srv,libx32,lib64,run,boot,proc,sys,dev} ./. bu it doesn't work. What's the proper way to exclude some directories while deleting the whole? EDIT: Never try any of the commands here without knowing what to do! |
I have to show that $$ \int_{0}^{\pi}\log(\sin(\theta))d\theta = -\pi \log(2) $$ This is a problem from the complex & real analysis qualifying exam. This problem is maybe solvable by usual integration techniques but I strongly believe that they want us to prove it using complex analysis methods. Any approach will be appreciated. I already tried with no luck: $u = \sin(\theta)$ $u = \theta - \frac{\pi}{2}$ $\sin(\theta) = \frac{e^{i\theta} - e^{-i\theta}}{2i}$ and define a semi-circle that avoids $\{0\}$ and define a branch outsite that region (for example in the III or IV quadrants). | How to compute the following integral? $$\int\log(\sin x)\,dx$$ Motivation: Since $\log(\sin x)'=\cot x$, the antiderivative $\int\log(\sin x)\,dx$ has the nice property $F''(x)=\cot x$. Can we find $F$ explicitly? Failing that, can we find the definite integral over one of intervals where $\log (\sin x)$ is defined? |
Let $n \in \mathbb{Z}$. Then is $x^3+nx+1$ irreducible over $\mathbb{Z}$ for infinitely many $n$? | For what values of $n$, where $n$ is an integer, the polynomial $x^3+nx+1$ is reducible over $\Bbb Z$. My attempt: When $n= 0,-2 $, the given polynomial is reducible over $\Bbb Z$ as $x=-1$ and $x=1$ are zeros of the polynomial. But I couldn't find whether there exists any integer $n$ for which the polynomial $x^3+nx+1$ is reducible over $\Bbb Z$. How can we proceed from here? Is the polynomial irreducible over $\Bbb Z$ if $n$ is not in $\{0,-2\}$? |
I modelled this little wall in Blender and I dont know how to get the curve straight. Can somebody help? I changed a few things with my model and Im not sure how to get the x-scale of the selceted faces of the UV exactly like the x-scale of the faces underneath... Does somebody know how to fix this? | Showing the actual 3D model of a curving ramp. Shows the UVs of that model that blender did automatically. Shows the UV image that I need. I am going put a road texture on it., but round faces are not helping me at all. All I need is straight belt kind of UV. |
I want to highlight an image when a user hovers over it. To do that, I'd like to put an overlay over everything else (or honestly, I'd be happy putting an overlay over everything including the image, and then putting something to brighten the image as well). Is there anyway to do this without JS? I'm happy to use a JS solution if that's all that's available, but I was wondering if there was any CSS-only trickery that could manage to do this. Example HTML would be like this: <body> <div> <Other Elements /> <img src="...." /> </div> </body> Preferably everything would be darkened except the <img> tag. | I want to overlay one image with another using CSS. An example of this is the first image (the background if you like) will be a thumbnail link of a product, with the link opening a lightbox / popup showing a larger version of the image. On top of this linked image I would like an image of a magnifying glass, to show people that the image can be clicked to enlarge it (apparently this isn't obvious without the magnifying glass). |
Given an array of numbers, how can I select the number in the array that's has been repeated the most times? arr = [4,3, 3, 2, 1, 3, 3, 3, 4, 4, 4, 4, 0, 0, 0, 1, 3, 4, 0] | How do I find an item in array which has the most occurrences? [1, 1, 1, 2, 3].mode => 1 ['cat', 'dog', 'snake', 'dog'].mode => dog |
I'm working on simple asp.net mvc website, that shows user's post. I'm saving the post details in the DB including uploaded date. DateTime dateTimeNow = DateTime.Now; newPost.Feed_Upload_Date = dateTimeNow; DB.Post.Add(newPost); DB.SaveChanges(); Now in my View when I'm showing the date, it shows me something like this "1/21/2019 4:29:58 PM" What I want to achieve is to convert this time in my Database into something like "1 day ago". Thanks. | Given a specific DateTime value, how do I display relative time, like: 2 hours ago 3 days ago a month ago |
I'm copying a BASIC program from a book written in 1984 and want a compiler to run it on in Ubuntu. I'm not a coder so I don't have the skills to modify the code to a different version of BASIC than the version used in the book. | Was asked by a new Ubuntu user - who also wants to learn about programming - what he could use to run BASIC code. He was working through a BASIC book before trying out Ubuntu, and he'd like to continue without having to switch back to Windows. It looks like there are a few BASIC packages in the standard repositories, as well as projects like Mono which may include some kind of BASIC support. What would be a good recommendation from the standard repositories - or from a deb package - for someone learning the basics of BASIC and new to Ubuntu? |
what does this command do if it was executed in my current working directory that has files in it? ls 2> result I think whatever ls writes will be redirected to the result file? Is that correct and will it redirect everything for stderr and stdout? Or only stderr? | Just looking for the difference between 2>&- 2>/dev/null |& &>/dev/null >/dev/null 2>&1 and their portability with non-Bourne shells like tcsh, mksh, etc. |
Construct uncountably infinite many infinite sets, whose pair wise intersection is finite, and union of all of them is the set of natural numbers. I have been trying to find a bijection between $N$ and all rational numbers in $[0,1]$.But I am not getting the rigor. | Can a countable set contain uncountably many infinite subsets such that the intersection of any two such distinct subsets is finite? |
how can I prove the following: Prove that $$ \lim_{x \to y} \frac{x^k-y^k}{x-y} = ky^{k-1} $$ for a fixed $y\in\mathbb R$ and $k\in\mathbb N$. I already tried a lot but somehow I don't come to the correct conclusion | Please note that this question was asked by one of my students who doesn't know differentiation yet nor Lhopital nor mean value theorems. We teach limits before all these topics like differentiation , MVT , Lhopital , etc $$\lim_{ x \to a} \frac{x^n-a^n}{x-a}=n\cdot a^{n-1}$$ I can prove this result for $n \in \mathbb Z$ And for $n \in \mathbb Q $ , that is when $n =\frac{p}{q}$ , I can prove the result using the result for $n \in\mathbb Z$. But my question is this : Since $\mathbb Z \subset \mathbb Q$ , why can't we prove this result only for $n \in \mathbb Q$ ? Is there a method to prove $$\lim_{ x \to a} \frac{x^\frac{p}{q}-a^\frac{p}{q}}{x-a}=\frac{p}{q}\cdot a^{\frac{p}{q}-1}$$ without the result for $n \in \mathbb Z $ ? |
here is the code a1.cpp #include <stdio.h> void func(void) { printf("hello world\n"); } int main() { func(); return 0; } here is the code a2.cpp #include <stdio.h> inline void func(void) { printf("hello world\n"); } int main() { func(); return 0; } they are only different with the key word 'inline' then I compile them into assemble g++ -S a1.cpp g++ -S a2.cpp the result is: inline does not work. function call remained in main. then I compile them with optimizer g++ -O2 -S a1.cpp g++ -O2 -S a2.cpp the result is : inline works in a2.s, but a1.s also replace the function call. it seems inline was added automatically. so when inline is necessary when coding. | What is the advantages/disadvantages of using inline functions in C++? I see that it only increases performance for the code that the compiler outputs, but with today's optimized compilers, fast CPUs, huge memory etc. (not like in the 1980< where memory was scarce and everything had to fit in 100KB of memory) what advantages do they really have today? |
I have a web page where after connecting to and selecting courses from the database, the courses are displayed with a link to view each course as below: <div class="col-md-4"> //query db action and assign the query to $result $result = $dbcon->query($query); if($result -> num_rows > 0){ //If courses are available(rows > 0), fetch and display them while($row = $result->fetch_object()){ echo '<h2>'.$row->course_title.'</h2'; echo '<p>'.$row->course_description.'</p>'; echo '<a href="view.php?action=view&t='. $row->course_id.'">View Course</a>'; } } </div> And this is the code for view.php page: if(isset($_GET['action']) && $_GET['action'] == "view"){ //Assign var $id to the id from the _GET array $id = $_GET['t']; //Use the $id to fetch course details from the database $query = ("SELECT * FROM courses WHERE course_id = '$id'"); //Query the db action $result = $db_connect->query($query); $rows = mysqli_num_rows($result); if($result && $rows > 0){ while($row = $result->fetch_object()){ echo '<div class="col-md-10">'; echo '<h1>'.$row->course_title.'</h1>'; echo '<p>'.$row->course_description.'</p>'; echo '<div class="col-md-6"><span class="inline-elm">'.$row->course_subject.'</div>'; echo '<div class="col-md-6"><span>'.$row->course_level.'</p></div>'</div>'; } } } My problem is that I'm not sure whether this is proper and of course, safe to do or there is a safer/proper way to do it. Will really appreciate your answers. Thanks | 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? |
Why does fMRI start with a lowercase f? As it stands for functional in functional magnetic resonance imaging. The has a history section, but it does not explain why a lowercase f was used, nor when the term was first used. Is there any other example? | In the beginning of a sentence, should I capitalize abbreviations such as the following: hPSC (human pluripotent stem cell) mESC (mouse embryonic stem cell) rDNA (recombinant deoxyribonucleic acid) I have seen both lower and upper case for the two first, while rDNA always seems to be in lower case. I'm curious which is the linguistically correct form. |
Today was rewatching the movie The Hobbit: An Unexpected Journey and got very curious about a scene after the riddle game between Gollum and Bilbo where Bilbo gets stuck between the cave walls / rocks while running away. In that particular moment, we see the buttons from Bilbo's coat breaking and Bilbo falling into the floor on his back while holding the "sword"... then the ring gets into his finger and we see that Gollum doesn't see both Bilbo or the "sword". Had to rewatch that scene to see if Bilbo was really holding the "sword" and he was... If that wasn't the case, would the "sword" be visible to Gollum? | The One Ring turns invisible the person wearing it. Is there an explanation for how it does this? It seems that direct contact with the skin activates the Ring's invisibility effects; why would it also affect the person's clothing, weapons, etc, as well? The Invisible Man's clothing is visible, so why aren't Frodo's clothes visible? The Hobbit makes it clear that Bilbo's clothing is invisible, since Smaug doesn't see it. Is there any possiblity that this varies from character to character? |
As most probably know, in terraria, it is possible to replicate certain spawn conditions artificially in controlled conditions. One example is the meteorite in which having x amount of meteorite ore, meteor heads will spawn. Similarly in minecraft, Iron Golems can be farmed for iron if one were to artifically create a village large enough for them to spawn. That said, in minecraft, it is stated in the wiki that wither skeletons spawn in nether fortresses. Is it possible to replicate the condition for wither skeletons to spawn just like one would do in terraria or perhaps like the Village Iron Golem farm? | What conditions are necessary for a Wither Skeleton to spawn naturally, and can I manipulate those conditions to increase the chance of them spawning? I want to make a Wither Skeleton spawning pad in the Nether but I'm having trouble finding Wither Skeletons. I've only heard that they spawn in Nether Fortresses. |
I work in a field (Philosophy) where co-authorship is uncommon and advisors and grad students very seldomly co-author a paper. I've seen a lot of posts on Academia.se though about the ethics of co-authoring papers with mentors, such My sense is that it must be somewhat common in the natural sciences for the head of the lab/dissertation advisor to be automatically added as a co-author to every paper that his or her graduate students produce. My questions are: Is this really common, and if so, in which fields? Is this really ethical? My view is that adding your name to something that you had no part in creating is just plagiarism: it's taking credit for the work of others. The opposite argument, that the work wouldn't have been possible without the PI's grant funding also cuts no ice. I wouldn't have been able to write my dissertation if my parents hadn't had sex, but that doesn't mean they should get credit as coauthoring my work. That's the way it seems to me, but maybe somebody from these fields can give us a better rationale for (what seems to be) the widespread practice. Edit: Another argument against the practice. Suppose I'm a billionaire who knows nothing about science, but I take it into my head that I want to be (regarded as) a famous scientist. Suppose I just spend billions of dollars to fund other people to do research. But, I ask each of those people to come and report to me for fifteen minutes ever week about what they've worked on, or discovered that week. Then, every time one of them finds a result, I demand that my name be added to the paper as a co-author, since we have "discussed" the work in progress and it is, after all, by my grace that the funds for the work have been provided. Suppose I just have hundreds of these postdocs, producing thousands of papers a year, all of which I am a coauthor for. Now ask yourself if I really deserve to be regarded as a famous scientist at all? It seems to me that I don't, because I haven't done any of the science--I haven't suggested any research methods, I haven't designed any experiments, I haven't collected any data, I haven't even helped junior researchers know the shape of the existing literature. You might regard my existence as good for science in some sense--you might think of me as a beneficial patron of the sciences. But you wouldn't think of me as a scientist, right? And you wouldn't think I deserved to be considered for a Nobel Prize, or membership in the American Academy of the Arts and Sciences, or whatever. If I demanded that I be given those awards because of the thousands and thousands of papers that I have coauthored, which have been cited tens of thousands of times, you would call me an idiot, right? We give those prizes for discovery, not for being rich. The same thing is true of tenure too. You shouldn't be able to buy your role as a tenured professor. You should have to prove that you, personally, are capable of making a serious contribution to your field. And of course you demonstrate that capability by publishing papers. So when a prof is automatically added as a coauthor to a paper that he or she did not contribute to in any way except financially, then she is trying to buy a reputation as a scholar, or the other perks like tenure or membership in the AAAS that come with that reputation in just the same kind of way that the absurd billionaire is doing. | In this it is claimed that authorship is given away for "free" in some fields (e.g., obtaining the funding). The comments to the answer suggest that this is field dependent. I am looking for documentation from a field that suggests that authorship can be given away for "free". For example, the ICMJE has authorship that put a pretty high bar on authorship. Is there any documentation that suggests that supervising a student or getting funding is enough to warrant authorship? |
I have a list with a shed load of data points and a lot of them are the same as each other. Is there a convenient command to sort the list to see what occurs the most? I'm writing the results to a text file, so I can actually see the results of the list? | Is there a quick and nice way using linq? |
So, safe to say, I am fairly addicted to the hats. They are a lot of fun and their silliness is addictive. In the spirit of the winterbash, I am hoping we can be allowed to have more control of hat positioning. After asking for a downvote in chat so I could get that babe mullet, I wondered if I could give myself a mullet-beard but it won't allow 360 degree rotation. Just think of all the absurd things we are missing out on! Sweet ass soccer necklace Mulletbeard™ Crab face googly eyes iPhone Plus Plus Now sure, some nay sayers will say "but they're hats!"... If you're concerned with keeping them as hats, it's too late! I am already it up. Furthermore, when I get tired of my stache, I switch out to crab eyes so, resistance is futile! | I want to wear my hat upside down but the rotate control seems to be fixed so I can't. Please remove this terrible restriction so that I can use hats as they weren't intended! :-) See also the excellent examples in this duplicate question: |
Yesterday Software Updater reported that there were a few updates to install (64Mb worth) which I set running. However, after a reboot, I'd lost my CUPS drivers + Software Manager. The first was easy to sort out - I went to the HP site, downloaded and ran the HPLIP installer to install new drivers. However, the second I have no idea about. Software Manager was on my taskbar but disappeared and is no longer shown in the list of available app's. Any ideas anyone please ? | I updated Ubuntu last night (sudo apt get update && sudo apt get upgrade) and to my surprise this morning I didn't find the 'Ubuntu Software' app and there's a new entry called 'Snap Store' which when opened looks just like the old 'Ubuntu Software' app. So has 'Ubunu Software' been renamed to 'Snap Store'? And if yes, why? |
In Episodes VII and VIII we see BB-8, Poe Dameron's droid, be quite active, , , etc, but as far as I remember we never see it (?) actually recharge. So my question is: What is BB-8's power source? | A friend posed this question a while back and despite searching the internet and our collective Star Wars books, we were unable to come up with an answer. I even made , but with no real luck. I understand that droids are machines and that they need to "rest" every 100 hours or so to recharge themselves, but what are they recharging? Do they use some kind of batteries? Do they create their own energy somehow? In Episode IV, we see Threepio "switch off", presumably to store power, and in Episode V, Luke plugs Artoo into some sort of power inverter to power his camp. Does anyone have any documentation on what exactly keeps a droid running? |
I have seen the classical twin paradox before. It uses a twin stationary on Earth and the other traveling away and back. I have seen many contradictory solutions for it, some use general relativity, others use special relativity, either way, I have never been satisfied with what I've read. They always try to break the symmetry through the traveling twin's acceleration and deceleration, but never quite succeed. So, let's do away with the classical twin paradox and let's explain a much simpler, perfectly symmetrical version of it where both twins are moving towards each other. So imagine we have Twin A in a spaceship, and Twin B in another. They are both traveling at the same speed towards each other. If I understand relativity properly: From Twin A's frame of reference, he's stationary and Twin B is moving at a constant speed towards him, therefore, Twin B is aging slower. From Twin B's frame of reference, he's stationary and Twin A is moving at a constant speed towards him, therefore, Twin A is aging slower. When they both finally meet, they both think that the other is younger. Which one of them is right? | I read a lot about the classical twin paradox recently. What confuses me is that some authors claim that it can be resolved within , others say that you need . Now, what is true (and why)? |
How to choose between normal web hosting and cloud hosting, what are the key points that can make this decision easier. Does everything I can do in the normal web hosting is possible in cloud one? In Brief, when to choose which? | This is a "catch-all" question designed to serve as an answer for all questions about choosing web hosting. Pro Webmasters no longer accepts new questions about how to choose hosting. All future questions pertaining to finding web hosting should be closed as a duplicate of this question. For more information about this policy please see . How to find web hosting that meets my requirements? What we're looking for in answers to this question are the basics about web hosting: What is web hosting? What is the difference between shared, VPS, and dedicated hosting? How does a content delivery network relate to web hosting? Anything else you feel is helpful in finding a web host. What we do not want is: Endorsements or recommendations for specific web hosts We do not want your experience or other subjective information (just the facts please) |
I currently have a Gmail account with a really long email address. I want to change the primary email to a more professional one. Is that at all possible? And what do I do about all of the Google apps that I use? Will I have to start a new photo cloud and a new Google Wallet? | I have a stupidly long email address on Gmail and would like to get it changed, or even just get a new one, but I can't see how. As soon as I log in on Google it knows who I am and signing up for a new email doesn't work. Is there a way to get my email address changed or get a new one that I can then switch to? Edit 2 July 2010: I need to clarify the question because I haven't had an answer to what I want to achieve. I want to change the primary address on my Google account (). When I click the link to edit "Email addresses", the primary email is shown without an option to switch/change it. When I try add a new Gmail email address, it says "You cannot associate a Gmail address with your Google Account." I want the primary email address on my Google account to be a shorter Gmail email address so that I can eventually retire the existing email address. |
I am trying to find the given sum modulo prime Given n integers and a number $D$ you have to calculate $(a_1 + a_2 + \cdots + a_n)^D$ but the twist here is that there coefficient should not be considered in sum ; e.g $(a+b)^2 = a^2 + b^2 + 2ab$; But , required sum is $a^2 + b^2 + ab$; e.g $(2+6+7)^2=15^2=225$ But , required sum is : $2^2 + 6^2 + 7^2 + 6\cdot7 + 2\cdot7 + 2\cdot6 = 157$ Constraints : $N\le5000$ (elements where each element $\le10^5$) $D\le10^{18}$; (Power) Any hint will be helpful :) | I'm looking for a formula to calculate the sum of $(a+b+c+d+...)^n$ but with coefficients equal to 1. For example in $(a+b+c)^2$. I want the sum of $a^2 + b^2 + c^2 + ab + bc + ca$. And for $(a+b+c+d)^3$, I want the sum of $a^3 + b^3 + c^3 + a^2b + a^2c + b^2a + b^2c + c^2a + c^2b + abc$. Similarly, I want the sum of expansion of $(a+b+c+d+e+....)^n$ with coefficient equal to 1. I tried to find the pattern by expanding the $(a+b+c)^2$. And I found that its formula is $a^2 + b^2 + c^2$ + $\frac{((a+b+c)^2 - a^2-b^2-c^2)}{2}$. This works for the power of 2. But fails on other powers. Any help will be really appreciated. |
I'm tring to print all the elements in the Car array. But the console shows it has null pointer problem. Assume I have a class named Car, and there is nothing wrong in Car class. CarLeadership class manipulates group of Car objects. I put them in an array called carArr(one attribute in CarLeadership class). public class CarLeadership { private Car[] carArr; private int position; //point to the current element of carDatabase //pass length of array public CarLeadership(int maxCar) { Car[] carArr = new Car[maxCar]; position=0; } //parameterized constructor public CarLeadership(Car[] carDatabase,int position) { carArr = carDatabase; this.position = position; } //copy constructor public CarLeadership(CarLeadership c) { this.carArr = c.getCarArr(); this.position = c.position; } public void setCarArr(Car[] carArr) { this.carArr = carArr; } public void setCarArrElements(int index,Car carObj) { if(index >= carArr.length) { System.out.println("Index out of bounds"); System.exit(0); } carArr[index] = carObj; } public Car[] getCarArr() { //deep copy Car[] anotherCarArr = new Car[this.carArr.length]; for(int i=0; i<anotherCarArr.length;i++) anotherCarArr[i] = this.carArr[i]; return anotherCarArr; } public void setPosition(int position) { this.position = position; } public int getPosition() { return position; } public String toString() { //instance has carArr String s=""; for(int i=0;i<carArr.length;i++) if(carArr[i]!= null) s += ("Car: # "+ i + "\nMake: " +this.carArr[i].getMake() +"\nModel: "+this.carArr[i].getModel() +"\nYear: "+this.carArr[i].getYear() +"\nPrice: "+this.carArr[i].getPrice()+"\n"); return s; } } //driver class public class CarLeadershipDriver { public static void main(String[] args) { // TODO Auto-generated method stub CarLeadership cc = new CarLeadership(5); cc.setCarArrElements(0,new Car("aa","cc",2018,242)); cc.setCarArrElements(1,new Car("aa","aa",2018,242)); cc.setCarArrElements(2,new Car("aa","cc",2018,242)); System.out.println(cc); } } The error message: Exception in thread "main" java.lang.NullPointerException at CarLeadership.setCarArrElements(CarLeadership.java:31) at CarLeadershipDriver.main(CarLeadershipDriver.java:7) | 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 have an application which is supposed to email error codes or confirmation emails to our support email. Using google apps From: [email protected] to: [email protected] This software is located on each clients server (and the software does not support smtp authentication). I'm having issues setting up the spf record to allow these emails to come through. This is what I have so far: "v=spf1 include:mydomain.com -all" Any help would be appreciated. | This is a about setting up . I have an office with many computers that share a single external ip (I'm unsure if the address is static or dynamic). Each computer connects to our mail server via IMAP using outlook. Email is sent and received by those computers, and some users send and receive email on their mobile phones as well. I am using to generate an SPF record and I'm unsure about some of the fields in the wizard, specifically: Enter any other domains who may send or relay mail for this domain Enter any IP addresses in CIDR format for netblocks that originate or relay mail for this domain Enter any other hosts which can send or relay mail for this domain How stringent should SPF-aware MTA's treat this? the first few questions i'm fairly certain about... hope i have given enough info. |
I noticed that in chat, I get random POST requests, to SE sites that I'm on. For example, as I type this question, it sends a POST request to http://meta.stackexchange.com/gps/event If I'm flagging spam on drupal.SE I get this http://drupal.stackexchange.com/gps/event What's this for? Is it just here to eat up my internet? | While visiting Super User, I get this error in the error console on Firefox: Timestamp: 5/15/2013 10:10:28 AM Error: no element found Source File: Line: 1 Attempting to visit /gps or /gps/event directly results in a 404 ("page not found"). What is the function of the /gps page, and are there any other "hidden" subpages of this kind? |
after the updating of texlive it doesn't compile \documentclass[10pt,a4paper]{book} \usepackage{graphicx} \usepackage{xcolor} %\definecolor{light-blue}{rgb}{0.8,0.85,1} \begin{document} \pagecolor{black} ciao \newpage \pagecolor{white} ciao \end{document} | I am using the suggestion from to change the background color of a page using the MWE example from frabjous. This works in Texlive 2016, but it gives an error in Texlive 2017: ! Undefined control sequence. \set@color ...e@color \current@color \ifundefined {GPT@outputbox}{\csname ne... l.7 \pagecolor{yellow} \afterpage{\nopagecolor} Does anyone else get this error and is there a fix? Thank you. |
When I start Skype, the Startup sound sounds like that my speakers is going to break any time (kind of like nails scratching a blackboard). But when I go to /usr/share/skype/sounds to find the startup sound, I opened it and the file doesn't sound anything wrong. How do I fix this? It sounds bad no matter how I start it. | I have the same problem as described in the questions and . But it is not only the login, notification, but also when talking to somebody. I tried the solution to remove/re-install skype and most of the solutions in this questions, e.g. checking mixer, sound settings and installing alsa-hda-dkms (incl. system restart). After installing skype (and even after upgrade to skype 4.0) in Ubuntu 12.04 (AMD 64) there was no sound at all. I followed the first step of the and at least there is now sound: sudo add-apt-repository ppa:ubuntu-audio-dev/ppa; sudo apt-get update;sudo apt-get dist-upgrade; sudo apt-get install linux-sound-base alsa-base alsa-utils gdm ubuntu-desktop linux-image-`uname -r` libasound2; sudo apt-get -y --reinstall install linux-sound-base alsa-base alsa-utils gdm ubuntu-desktop linux-image-`uname -r` libasound2; killall pulseaudio; rm -r ~/.pulse*; sudo usermod -aG `cat /etc/group | grep -e '^pulse:' -e '^audio:' -e '^pulse-access:' -e '^pulse-rt:' -e '^video:' | awk -F: '{print $1}' | tr '\n' ',' | sed 's:,$::g'` `whoami` The jittering sound would sometimes disappear, e.g. on the Echo-Testcall after replaying the recorded part. And I noticed that if I let music play in the rhythmbox and then start skype, the sound is fine. So I have a weak solution, but I would be glad it would work without this detour. In VLC when I play, restart after pause I have to same jittering sound. As requested: My sound card is a an "AMD High Definition Audio Device" called Advanced Micro Devices (AMD) Hudson Azalia controller (rev01), subsystem Lenovo Device 21ea (according to sysinfo) on a Lenovo Thinkpad Edge 525. |
E.g. page on ruSO. When not logged (just open on private mode): All is good when logged: All localized SO are affected. Related report on ruSO.Meta: | I can't see the complete 'en español' underneath the Spanish Stack Overflow logo on user profile pages. Nothing changes when I scroll, but when I go to the , the logo gets shifted up a bit and it looks fine. The same thing happens on the site. You can tell that the logo is the correct image but shifted downwards because the top of the 'in [language]' text is visible: I'm on Vivaldi 2.0 for Windows 10 and on Chrome 69.0.3497.100 for Windows 10. It happens only when you don't have an account for that site, both when you're anonymous and when you have connected accounts on other sites. |
The on each Stack Exchange site links to Facebook, Yahoo, and Google: I am puzzled. If I have an issue for which I need to contact Stack Exchange, why would I find links to Facebook, Yahoo, and Google helpful? | I see that the contain some usful links: But it seems that it's kinda weird and out of context. When exactly would a user that want to contact Stackexchange will find these links useful? What is so special about those links as opposed to a link to for example? |
I'm not talking about religion. Imagine certain Ancient Egyptian writing or old Chinese poem or phrase by Shakespeare, comment on life being very short or we being puppets in the theater of life. Some people seem to think that just because this is very old, than mere repetition of the phrase has a certain authority or importance or power above and beyond what some brilliant philosopher at present might say. There is a kind of glorification of it beyond the thought expressed, mere reason that it's old or very old. So these people constantly quote this or that ancient writing as if it's proof of veracity of certain view. Is there a word for these people or this act? Any idea? Edit: thank you, it's similar to the other question, consider this solved. | I am looking for a word to contrast with . Just as a neophile loves novelty for the sake of it, I want to describe a person who loves old or ancient things (may include the abstract, e.g. tradition or bygone mannerisms). A neophobe is ruled out, since that is merely a rejection of newness. Antiquarian comes to mind, but that seems to be specifically for human history (its objects and trivia). The word I'm after could refer to someone who loves fossils or ancient rocks (of which there are many. . .). So, what word describes a person who loves an object or concept on account of its age? Perhaps archaeophile or paleophile? |
Supposed to use induction, not really sure how to do this. | Given: $f_1 = f_2 = 1$ and for $n \in\mathbb{N}$, $f_{n+2} =f_{n+1} + f_n$. Prove that $f_2 + f_4 + \dots + f_{2n} = f_{2n+1}- 1$. Would you start with setting $f_2 + f_4 + \dots + f_{2n}= a_n$? Then for the base case let $a_1=1$ LHS$=1$ and RHS$=2-1=1$ so base case holds. Then the inductive hypothesis: Assume $f_2 + f_4 + \dots + f_{2n} = f_{2n+1}- 1$ $\textbf{NTS}$: $f_2 + f_4 + \dots + f_{2n} +f_{2n+2} = f_{2n+3}- 1$ Inductive step: By inductive hypothesis $f_2 + f_4 + \dots + f_{2n}=f_{2n+1}- 1$ So $f_{2n+1}- 1+f_{2n+1}$=$f_{2n+2}- 1$. As was to be shown. Is this correct or did I need to show more algebra in my inductive step ? |
I'd like to stream a map with collection using Java 8 streams. For example, having the following data: Map<String, Collection<Integer>> data; I'd like to go over the elements handling each integer value with the corresponding key strings. For example: data.keyValueStream((k,v)-> ...) Any idea how to achieve this? Thanks. * Regarding the question "Why do you need it?", it could be a bunch of reasons and I'm not sure it's important. Anyhow, I'll "flow" with you... My specific scenario is to batch insert into a DB all the values, under their specific key. Let's keep it a general Java 8 stream question... | If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained within it, what is the most efficient way of going through the map? Will the ordering of elements depend on the specific map implementation that I have for the interface? |
I have seen in linux the option "open in terminal" when you do right click. If shell itself is command line interface then it can by its own take input from keyboard and display it in console. Then why we need terminal or terminal emulator. I know there is a similar question but the answer is not clear from the explanation provided here: | I think these terms almost refer to the same thing, when used loosely: terminal shell tty console What exactly does each of these terms refer to? |
I have a String response_content of length=1 in a java project and I know that it equals to 1 (ASCII 49). I know this, because the following lines (in Eclipse with android ADT+SDK) Log.i("GET RESPONSE", response_content); Log.i("GET RESPONSE", response_content.length()); Log.i("GET RESPONSE", response_content.codePointAt(0)); produce this output: 1 1 49 But why do these lines always return false? if (response_content.equals(1)) {...} if (response_content == "1") {...} I know equals() is the adequate way, == is just for testing purposes. Is there another way of telling me, what the string really contains or is there a mistake I don't see? | 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? |
I was trying to see why a comment looked like this when writing a comment with <br>: Any news on my answer? <br> I hope it is helpful Yep, when typing in the raw data for the comment: Any news on my answer? <br> I hope it is ***helpful*** That comes the first comment shown. Strangely, using ***helpful*** will have the natural result of : helpful while the <br> will not be working. So instead of this: Any news on my answer? I hope it is helpful It shows: Any news on my answer? <br> I hope it is helpful Instead. Why is <br> not working when used in a comment? Is this intentional or a bug? | I am aware that comments have only a simple field, with no formatting possible and that is fine (if formatting is needed, your comment should actually be an answer!) But I find some comments hard to read because they are mainly one giant line (of up to 600 characters!). Any newlines entered during the redaction of the message is stripped from the published comment. Would it be possible to preserve those newlines? (but may be deleting empty lines, to prevent abuses like a comment taking 600 lines because a prankster could find amusing to post a 600 newlines comment!) Let's recap: what we need (and can actually preview while typing a comment, making it more readable, both for the writer -- and the reader, should newlines being kept): declined for newlines (why? no reason given at this time.) what we don't need but is "nice to have" (even though we cannot preview those): granted for bold and italic text. what we really don't need (and cannot not preview): granted for... __code sample__!? Code sample? Seriously? In a comment? In short: What was an incentive to post a new answer (because of the lack of formatting) is now further diminished. But the comments remain published as one long-hard-to-read-gigantic line. |
OK, I admit it; downloaded raunchy pictures and now want to ensure they're deleted from a MacBook Pro bought in 2018 whenever I decide to gift it to someone. Admittedly, the pictures are nothing illegal; just pictures of Holly McGuire, Jakki Degg, Samira Mighty and Georgia Toffolo. I want to make sure they're erased and unrecoverable, in addition to ensuring sensitive files are deleted too (the files are nothing more than 2004 tax data which is backed up on a Mac mini, anyway). In general, I've used Edenwaith permanent eraser to do the job, set it to Gutmann 35-pass. I'm not an expert in data recovery or erasure, but will this sort of tool make sure they're unrecoverable, even after I reinstall the Macbook when giving it away as a gift? Sure, Christmas is a long time away... but I want to do this right. | I deleted lots of files & folders on my laptop and then I put a new files in the same folders. I need to recover the deleted files. I tried a lot of recovery software and I couldn't recover my old files. I read that if you refill the folders with new files after deleting old ones then I can't recover them again. Is that true? What should I do? |
After watching Star Wars: The Force Awakens I heard people claiming that Lando Calrissian is Finn's father. Is there any evidence that he actually is or counter-evidence that he's not? | Finn knows nothing about his family because he was taken while he was very little. But a black main character makes me think (not being racist guys). And when he used the lightsaber I thought that he had a Jedi parent. Master Windu is the only black Jedi we know so is there any canon explanation to that? Is it right? |
I can not change this value, I establish zero but when you start your pc grub menu appears for 15 seconds until it self-select. GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="splash intel_pstate=disable quiet" GRUB_CMDLINE_LINUX="" I do wrong? $ lsb_release -r Release: 14.10 | In Ubuntu 12.04 (or above), how do I set the GRUB time and the default OS (that I see at boot time) as I'm dual-booting Windows (7/8) and Ubuntu (12.04 or above)? |
My daughter is in Puerto Rico, she wants to stay for 90 days and then travel to Costa Rica, and then return to Puerto Rico/the US, she was told at the airport that some countries don't count as having left, apparently Jamaica, Cuba, and other islands close by, can she go to Costa Rica and then return to the US ( and will probably fly home from the US, she has an Irish passport. | I've read a few questions/responses on this but seem to be reading conflicting information I've tried to find a number for immigration at Fort Lauderdale but don't appear to be able to call My status is this I am a British citizen here on an esta which expires 1st April I have a friend arriving for 2weeks 31 March and I would like to stay and spend time with her for 2 weeks My intention was to fly to the abaco islands of the Bahamas for 3/4 nights then return to Florida and fly back to England with them on the 12th April Hoping that my visit to the Bahamas would reset my 90 days even though il only be staying another week in the states before returning to my place of residence in the UK Is this false hope/information tahrs going to get me in bother ? Would really appreciate some advice ? Melanie |
I have been following this thread(Forgive me, I am new here and do not know how to reply to the existing thread): I have a MacBook Pro (Retina, Mid 2012) 2.6Ghz Intel Core i7, 16GB DDR3 with the GeForce GT 650M 1GB and it has the Apple SSD SM512E. I am running macOS High Sierra 10.13.3 and I want to put a Samsung EVO 960 NVMe 2TB in it. Can I do that. All the data in the thread I linked to is 2013 Macbooks or newer. | My question: Can anyone confirm or disprove the support of NVMe drives (like the Samsung 960) by the Sintech M.2 PCIe SSD MacBook adapters for macOS Sierra and High Sierra, or would you have any information that could help me confirm or disprove this support? Below are the results of my research so far. SSDs comparison "Official" MacBook SSDs Officially supported MacBook SSDs are really expensive. For example, with the Macbook Air/Pro 2013, 2014 and 2015 models: : $299 for , $399 for , $649 for : $524 for 256GB, $649 for 512GB, $949 for 1TB. Equivalent PC SSDs Globally, an officially supported MacBook SSD (PCIe M.2 AHCI with a proprietary 12+16pin connector) cost from about $1 to $2 per GB, while equivalent PC SSD (PCIe M.2 AHCI and NVMe with a key M connector) cost from about $0.4 to $1 per GB. NVMe: : $196 for 512GB (low quality) : $219 for 500GB : $316 for 480GB AHCI: : $300 for 480GB : $450 for 512GB So standard PCIe M.2 devices seems to be up to 3x cheaper than the MacBook PCIe M.2 SSD. Plus, NVMe SSD are globally way faster. NVMe SSD compatibility? Connector adapter At first for the connector, I often seen the recommended to use the AHCI SSD above in a MacBook Air/Pro. The product page clearly stipules only compatible with a limited set of AHCI SSDs, but I do not see any reason for these "incompatibilities", as there is no other software/hardware standards for the PCIe M.2 AHCI models. It seems they simply give as compatible the list of the AHCI SSDs they've tested, and as incompatible the most known NVMe SSD models. Interface compatibility Then for the interface, what I understand from AHCI/NVMe is that it is only a controller interface, depending on the system drivers on the MacBook and not on the hardware itself. Which seems to be consistant with: I emailed the store which sell that adapter and problem is that macOS doesn't support 3rd party NVMe SSDs, but Windows 10 and Linux do. -- From a on a upgrade video with a AHCI SSD and the Sintech adapter. So Sintech may have given these NVMe SSD as incompatible not because of the adapter incompatibility, but because of the destination OS incompatibility. System support Finally for the system, macOS now support NVMe SSDs, from unofficially OSX El Capitan (with a to boot) and natively macOS High Sierra (even as boot, see an article about the and a confirmation from the ). I sent an email to Sintech to get more informations on their adapter. I got a reply with some references (added to this post), but no answer since. Edit (23/06): Unfortunately, we are busy in other projects, and still can't get new system to test it. Similar researches After I created this post, I seen there is some people with the same question in other communities, waiting at the same step. I share the links there in case of some of them got a return from a test with the Sintech adapter or an other one. On Por Chumjan (02/27/2016): I think about to upgrade. Samsung 950 pro is interesting. But i'm not sure it can use for this model. trumanhw (12/21/2016): You can buy an adapter from M.2 to MBPr or Air for about $20... (...) The REAL question is if the NVMe protocol will be a hiccup (as in, I don't personally know that answer) ... and if it'll get the full speed of the 950. In principle, I don't see why it wouldn't. And I WILL be testing this out. Fabio (06/10/2017): [ About the patch ]. It is meant to be used on hackintosh but I think it might work on a macbook pro from 2015 with the adapter and a nvme ssd like the samsung 960/950 evo/pro. If someone tries or has tried it please let me know. |
What is meant by the term "meta-parameter"? Can a definition, informal and/or formal, be provided? For example, in reduced-rank regression, the rank ($r$) can be referred to as a meta-parameter of the method. For instance, see these , which I quote below. The optimal choice of the rank $r$ will usually be unknown, and is considered as a meta-parameter of the method. Reference: Reduced-rank regression, by Magne Aldrin (2002) in Encyclopaedia of Environmetrics. | So in a normal distribution, we have two parameters: mean $\mu$ and variance $\sigma^2$. In the book Pattern Recognition and Machine Learning, there suddenly appears a hyperparameter $\lambda$ in the regularization terms of the error function. What are hyperparameters? Why are they named as such? And how are they intuitively different from parameters in general? |
$$\sqrt{-5}*\sqrt{-3}=\sqrt{-1*5}*\sqrt{-1*3}$$ $$\sqrt{-1*-1}*\sqrt{5*3}=\sqrt{5*3}$$ $$=\sqrt{15}$$ But we all know that this below is right, $$\sqrt{5}i*\sqrt{3}i=-\sqrt{15}$$ So, please explain the formal result. And any confusion that have been arisen in my mind. This was shown to me by my teacher, and he wanted explanation, and I'm kind of stuck with it. What's true and what's not? | I know there must be something unmathematical in the following but I don't know where it is: \begin{align} \sqrt{-1} &= i \\\\\ \frac1{\sqrt{-1}} &= \frac1i \\\\ \frac{\sqrt1}{\sqrt{-1}} &= \frac1i \\\\ \sqrt{\frac1{-1}} &= \frac1i \\\\ \sqrt{\frac{-1}1} &= \frac1i \\\\ \sqrt{-1} &= \frac1i \\\\ i &= \frac1i \\\\ i^2 &= 1 \\\\ -1 &= 1 \quad !!? \end{align} |
I have a static table view that will act as a adder/editor of information in Core Data. Some of the information has multiple strings (like fields in iOS contacts). I want to change some of the delete button circles(-) with (+) buttons. How can I do this? I am going for something similar to contacts. Thanks in advance for any help! | I'm trying to set the editing style property of a UITableViewCell in a Cocoa Touch (iPhone) app. For an example of what this looks like, check out the Contacts app, where you can see the little green plus sign to the left of some of the cells. The UITableViewCell inspector in Interface Builder has an editing style drop down, but it doesn't seem to do anything. Likewise there is a CodeSense completion of an undocumented method called -setEditingStyle: for a UITableViewCell that doesn't seem to work either. Is this a setting in the table view data source? Has anyone outside of Apple gotten this to work? |
I want the sun to glow and cast sunshine at the earth. I have set the surface of the sun to emission and 1000 in strength, but the earth is still in the dark when in rendered mode. Does anyone have a suggestion? I am using Blender 2.8 and Cycles. | The closest I can get to making mesh lights affect their environment in Blender Eevee is giving them an Emission material and turning on "Bloom". But this isn't emitting proper light, it just looks like it is, but it doesn't light the surroundings whatsoever. I would like to be able to light a scene with meshes without having to put point lamps everywhere just to make them emit light. |
I was wondering if there is any way to present the CNOT matrix as we usually present single qubit operations $$... 1 \otimes NOT \otimes 1 ...$$ I know that for adjacent qubits in a circuit we can present it identically $$... 1 \otimes CNOT \otimes 1 ...$$ But is there a way to present the operation mathematically if there are several CNOTs acting on not neighboring wires? | In a three-qubit system, it's easy to derive the CNOT operator when the control & target qubits are adjacent in significance - you just tensor the 2-bit CNOT operator with the identity matrix in the untouched qubit's position of significance: $$C_{10}|\phi_2\phi_1\phi_0\rangle = (\mathbb{I}_2 \otimes C_{10})|\phi_2\phi_1\phi_0\rangle.$$ However, it isn't obvious how to derive the CNOT operator when the control & target qubits are not adjacent in significance: $C_{20}|\phi_2\phi_1\phi_0\rangle.$ How is this done? |
I have an array of events and their polling time like this. [{"A":5,"B":7,"C":9}] So event A (some function) needs to be called every x seconds, in the above example A function needs to be called every 5th second from now (not just once, but keep on repeating) and B function needs to be called every 7th second from now and so on. At 35th second Both A and B would be called(considering function A and B returns almost instantaneously assume printf() ) Is there a standard algorithm for this?if not any pointers on how to achieve this? something on this line,(doesnt work though) import threading class A(): def A(): printf "A" def B(): printf "B" def __init__(self, *args, **kwargs): self.iteration = 1 def execute(self,arr): for key in arr[0]: print key, arr[key] t1 = threading.Timer(arr[key], key).start() t2 = threading.Timer(arr[key], key).start() A().execute([{"A":5,"B",7}]) | I want to repeatedly execute a function in Python every 60 seconds forever (just like an in Objective C). This code will run as a daemon and is effectively like calling the python script every minute using a cron, but without requiring that to be set up by the user. In , the solution appears to effectively just for x seconds. I don't need such advanced functionality so perhaps something like this would work while True: # Code executed here time.sleep(60) Are there any foreseeable problems with this code? |
Trying to install the in the hope that it will solve , I get errors about missing libraries: warning: Missing REQUIRED dependency: libusb (libusb - USB library) warning: This installer cannot install 'libusb' for your distro/OS and/or version. How can I install all the missing dependencies in their right versions? Alternatively, would you recommend any other model/manufacturer for a low-cost printer that simply works with Ubuntu 18.04? | Let's assume that one has some modern HP printer and/or scanner which is not supported by HPLIP package from official repository. Currently Ubuntu versions have : trusty (14.04LTS): 3.14.3-0ubuntu3.4 xenial (16.04LTS): 3.16.3+repack0-1 bionic (18.04LTS): 3.17.10+repack0-5 focal (20.04LTS): 3.20.3+dfsg0-2 groovy (20.10): 3.20.5+dfsg0-3build1 hirsute (21.04): 3.21.2+dfsg1-2 What can one do if printer is supported in newer version of HPLIP (checked this in )? |
When I log in to an SE site, that login generally persists (across days, and even across browser restarts). When I log in to ANOTHER SE site, that site will automatically log me in, based on my cross-se login. But when I go to , where I logged in last time... only to discover I was logged out and have to MANUALLY re-login, once every couple of days or anytime I restart the browser. Is there anyway I can get that site to have automated/preserved login the way normal SE sites do? | I know that we don't have automatic login for the Data Explorer, but what's with the automatic timeout/logout? There have been times that I am logged into the site, maybe I walk away for a little bit, and I come back to being logged out. Is there a reason for logging us out of Data Explorer? If so, is it possible to either remove the timeout or extend the period of time before timeout? |
Package oracle-java8-installer is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'oracle-java8-installer' has no installation candidate this is error I am getting while installing java. I tried various command like apt-get update and apt-get upgrade and other stuff also, but still not getting any positive result. | I tried to install OracleJDK 8 using sudo add-apt-repository ppa:webupd8team/java But it's not working. I searched the problem and found that "The Oracle JDK License has changed for releases starting April 16, 2019." And "Oracle Java (JDK) 8 Installer PPA (DISCONTINUED)" So I installed the OpenJDK8 . But why oracle cancelled the license of oracle 8 installer? |
string mystring = "bbbccc "; How to check if my string contains more than one consecutive whitespace? | How can I replace multiple spaces in a string with only one space in C#? Example: 1 2 3 4 5 would be: 1 2 3 4 5 |
I am SO user. I just saw that if I delete an answer more then 3 upvotes then i got displined badge after geting this badge if i undelete my answer then i got my bounty & badge remains the same. i have search on meta & i found but I think this kind of badge must be revert back. otherwise no use of this. I got this badge in 2 account me & my friend same. so I know its reproducable bug & not any caching issue. | I was looking for badges I didn't have yet, and I saw the Disciplined badge. So I deleted an answer of mine with 3+ votes, and waited. Five minutes later, sweet, a new badge! Then I went to my answer again, and undeleted it. No problem at all, and I keep the badge! What will happen? Will my badge stay here or not? More generally, what happens when the conditions to get a badge are valid at one time, and then not valid? Other badge in this case: Unsung hero - "Zero score accepted answers: more than 10 and 25% of total" What happens if answers get a vote after getting the badge? Are the badge frequently recalculated? |
My computer is freezing from time to time. It's because I make few mistakes and I ruined my system. I don't have any time to reinstall the system now. While my PC is frozen, it still works when I press Ctrl+Alt+F1. Is there any way to reboot system using it? | How can I shut down or reboot Ubuntu using terminal commands? |
Im trying to prove that, given $a,b$ with at least one of $a,b \neq 0$, $$ \gcd\left(\frac{a}{\gcd(a,b)},\frac{b}{\gcd(a,b)}\right)=1 $$ I have tried to prove the identity $$ \gcd(c\cdot a, c\cdot b) = c\cdot \gcd(a,b) $$ with $c = \dfrac{1}{\gcd(a,b)}$ However I'm having trouble understanding the proof. Thank you for your time. | I'm trying to prove that $(ma, mb) = $|$m$|$(a, b)$ , where $(ma, mb)$ is the greatest common divisor between $ma$ and $mb$. My thoughts: If $(ma, mb) = d$ , then $d$|$ma$ and $d$|$mb$ → $d$|$max + mby$ → $d$|$m(ax+by)$. This implies that $d$|$m$ or $d$|$(ax+by)$. This is the same as $d$|$m$ or $d$|$a$ and $d$|$b$, so $d$|$m$ or $d$|$(a,b)$. This is the same as $d$|$m|$ or $d|(a,b)$, so $d$|$|m|(a,b)$. I don't know what to do. |
the wrong messsage is " Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference". what I am trying to do is clicking one item on recycleView and jump to another page. the code is below: public contactHolder(View itemView, Activity context) { super(itemView); this.context = context; Fname = itemView.findViewById(R.id.getFname); Lname = itemView.findViewById(R.id.getLname); itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startAnew(contactID); } }); } private void startAnew(String currentcontactID) { Intent intent = new Intent(context, personActivity.class); intent.putExtra(CONTACT_ID,currentcontactID); context.startActivity(intent); } | 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 understand that the rules are very strict, and should be as such, so how can I start off successfully and become a useful member of the community? The advice of experienced members would be welcome. Note: I do not just need faster ways to get reputation points, I want to be a useful community member. | From "6 Simple Tips to Get Stackoverflow Reputation Fast" at codexon.com: Be the First to Answer. Even at the cost of quality. Use Downvotes and Comments Strategically Use obnoxious in-your-face formatting and lists. Be Aware of the 200 rep/day Limit Edit, But Don’t Edit Too Much Associate your other accounts Courtesy of . Agree? Disagree? Walnuts? Cantaloupe? |
I bought Lenovo Y510P and I want to use Ubuntu. When I try install or try Ubuntu the screen shuts down and nothing appears. When I selected to try Ubuntu. I hear the sound of Ubuntu start yet, the screen still turned off. I now installed Ubuntu on the hard driver, the screen still turns off when I start Ubuntu. However, I tired to make the laptop sleep by clicking fn+f1 then when I press any key to wake it up the screen turns on ! Does anyone have an explanation, if so how to fix it ? Note: I have two video cards Nvidia GForce 750M 2GB and Intell video card. | 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: |
I built a runnable JAR from an Eclipse project that processes a given XML file and extracts the plain text. However, this version requires that the file be hard-coded in the code. Is there a way to do something like this java -jar wiki2txt enwiki-20111007-pages-articles.xml and have the jar execute on the xml file? I've done some looking around, and all the examples given have to do with compiling the JAR on the command line, and none deal with passing in arguments. | How do I pass parameters to a JAR file at the time of execution? |
I'm trying to install a package, but the package manager (apt-get, software center, etc.) refuses to install it due unmet dependencies. Are my attempts to install the package causing the dependencies issue? How can I tell what the issue is? | Occasionally, when I'm installing stuff, I get an error like the following: Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages. How can I resolve this? |
I was wondering how you can create a list of values of the same index from another list, when the amount of values is not known beforehand. for example I have the list list = [[25,75,94,63],[55,13,0,99],[41,63,93,25]] I want a second list that would be [[25,55,41],[75,13,63],[94,0,93],[63,99,25]] If possible I would like the answer to only use simple python functions and without the use of importing a module. And if possible how to do so using a loop (probably nested?) Thanks | I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item. For example: original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)] # and I want to become... result = (['a', 'b', 'c', 'd'], [1, 2, 3, 4]) Is there a builtin function that does that? |
where can I find a list with the included software for ubuntu 16.04. I mean the software that I installed, when I install a brand new 16.04 and not the available software in the repository. I can't find a list over google ... Thanks. | I am developing an offline installer for all versions of Ubuntu, and I need Ubuntu's default installed packages list. Is there a way to get this information from any server (web server)? Any script to fetch any Ubuntu version's default installed packages list. I will give the Ubuntu version, and the script will fetch the packages list. Note: I need at least a server address. I can write a script for this. |
My girlfriend and I have recently discovered the Big Money strategy in Dominion, and it's killing the game for us. We're not very competitive, so we don't want to spend a lot of time and effort trying to play even better than Big Money (as the answers to propose). But Big Money is so easy that it's hard to not just play it, and then we lose all the fun of the kingdom cards. Are there any house rules we could add to simply keep us from being able to play Big Money, so that we can go back to casual games with plenty of kingdom card excitement? I know that if we really wanted to we could learn to play better than Big Money, but the games wouldn't be as fun and easygoing. We also have almost all the Dominion expansions so we can use them. | Our group has determined that buying (almost exclusively) money and points is the way to go. Most kingdom cards are ignored, or are bought very sparingly. This has lead to games feeling 'samey' and has taken a lot of the fun out for us. What strategies should we use to counter ""? Or are house rules needed here? |
Imagine a hollow 100 metre diameter (for example) sphere made of incredible dense material (ie neutron star dust etc) but is self supporting (ie the central cavity). Assuming that the sphere skin is reletively thick so that the whole object is exceptionally heavy (eg the mass of planet earth. What would someone who was stationed dead center of the sphere feel? IE would they be crushed by the potential gravity or ripped apart and smeared on the inside other sphere cavity (due to the gravity of the surrounding material? | In a perfectly symmetrical spherical hollow shell, there is a null net gravitational force according to Newton, since in his theory the force is exactly inversely proportional to the square of the distance. What is the result of general theory of relativity? Is the spacetime flat inside (given the fact that orbit of Mercury rotates I don't think so)? How is signal from the cavity redshifted to an observer at infinity? |
Suppose that I'm trying to raise money for a fancy black tie gala, and I want to let the guests know how far we still are from the goal. Should I say One million dollars is still needed to reach our goal. or One million dollars are still needed to reach our goal. I've heard people say it both ways and neither of them sound outright wrong. | I've always said "$100 were taken" not "$100 was taken" because I thought $100 is plural. Could you explain why "was" not "were"? Any other helpful notes about the issue would be appreciated. Nearly £20 was taken from my bank account |
In a text it mentions about a power supply that the filter cap will act as a short at initial turn-on. Below I showed these points as A and B: In this case, the diode will have a surge current Is. And the text says this Is current should be limited by a resistor between the transformer and each diode. But in practice isn't transform's winding enough to limit this current? What is the typical value for this resistor lets say for a 24V power supply? Im asking because I dont see any such series resistors in examples. Im wondering is it fine to neglect it. | For conversion of AC into pulsating DC we used Rectifiers circuits. But I read somewhere (from a well-known site) that the circuit does not work in ideal condition if I used my first circuit. The second circuit is the correct circuit as per their view ideally in ideal condition. As I used the first circuit many times but on breadboard only so it adds the resistance of wires so might be it works.But I do not understand the reason behind for that extra resistance actually. Please share your knowledge regarding this. It will be a great help in clearing my concepts on this topic. |
I have some questions about a suspended user's earning and activity. Can suspended users get reputation back after the suspension period? If a user is suspended for 7 days and he/she earns reputation during this period. Then will it be calculated after completing suspension period? If a suspended user has awarded a bounty to other user and the awarded bounty marked as illegal. Then will that bounty rolled back to their account? Can suspended users get any alert from comments or chat room using @username method? Can suspended users post comments on his/her question/answer? If another user replies or ask a question on suspended user's post. Then, can a suspended user give response back? | My account has been , besides the following restrictions: an account will be locked at 1 reputation the user page will have a visual indication that the account is in timed suspension, and for how long the account holder will be unable to vote, ask, answer or comment What else does timed suspension prevent me doing? For example, can I still edit my own posts or delete content? And what is a network-wide suspension? |
I find myself frequently writing code like this: k = 0 for i in mylist: # y[k] = some function of i k += 1 Instead, I could do for k in range(K): # y[k] = some function of mylist[k] but that doesn't seem "pythonic". (You know... indexing. Ick!) Is there some syntax that allows me to extract both the index (k) and the element (i) simultaneously using either a loop, list comprehension, or generator? The task is in scientific computing, so there is a lot of stuff in the loop body, making a list comprehension probably not powerful enough on its own, I think. I welcome tips on related concepts, too, that I might not have even though of. Thank you. | How do I access the index in a for loop like the following? ints = [8, 23, 45, 12, 78] for i in ints: print('item #{} = {}'.format(???, i)) I want to get this output: item #1 = 8 item #2 = 23 item #3 = 45 item #4 = 12 item #5 = 78 When I loop through it using a for loop, how do I access the loop index, from 1 to 5 in this case? |
This is probably a noob question: I want to block all the outbound external traffic (public internet) but still allow all the internal traffic (from the local net). What I tried is: Allow outbound connections that do not match a rule. Added a new rule that matches all programs, services, protocols, remote IP addresses and the local IP address 1.1.1.1 (since I have to enter at least one). If instead of matching that IP address I match any address, then the rule effectively blocks everything (including local traffic). But with my approach, the rule stops working and all traffic (including external one) is allowed. I don't understand why making the rule to match a subset of local IP addresses causes the rule to stop working. Thanks! | I'm looking for a command (or command line program) to toggle (disable/enable) internet access to the outside world in Windows XP machines. It should temporarily block internet access but leave the LAN working. I looked for ways to change the DNS, but browsers like Chrome keep their own cache. The machines are configured via DHCP. |
I would like to set an environment variable (that we'll call "TEST") to store the path to a sub-directory of my home directory : something like /home/myself/dir/. I would like to use the $HOME variable so that the system can get a path that is valid for any user on the system (provided they have a directory called "dir" in their home folder). I tried several possibilities, but could not get it working. Here is one of my tries: export TEST='$HOME/dir' We can check that the variable has indeed been created : env | grep TEST Which returns: TEST=$HOME/bin So far so good. However this is where things get tough : cd $TEST Returns: bash: cd: $HOME/bin: No such file or directory However following variant works: eval cd $TEST Is there any way to obtain the same result, but without invoking eval? | I was wanting to initialize some strings at the top of my script with variables that have no yet been set, such as: str1='I went to ${PLACE} and saw ${EVENT}' str2='If you do ${ACTION} you will ${RESULT}' and then later on PLACE, EVENT, ACTION, and RESULT will be set. I want to then be able to print my strings out with the variables expanded. Is my only option eval? This seems to work: eval "echo ${str1}" is this standard? is there a better way to do this? It would be nice to not run eval considering the variables could be anything. |
I'm struggling to understand the core reason to invest in stocks as a minority shareholder. Majority shareholding makes more sense as you effectively control the company, so you can pay yourself dividends or even sell the entire company at will. You can guarantee your own payback. However, as a minority shareholder, you don't get to make any of these decisions. You're basically just hoping to eventually, some day get paid, if the majority holders decide so. Why do so many investors agree to pay now huge sums of money (trillions in total) for something that may eventually pay dividends, and even in the best case, these dividends are only a fraction of the price you paid to acquire these stocks? The average annual dividend rate for the US stock market is 2%. That means if you bought 100 million worth of shares, you'd have to wait 50 years to recover your investment. Of course, the most probable way you'd eventually get liquidity for these shares is by selling them to some other starry-eyed investor - which makes the whole thing seem like a giant Ponzi scheme. Given all that, it's unclear to me why the public is willing to spend so much money to acquire minority shares in companies. | I read somewhere that companies are not required to pay dividends to shareholders (this is correct, yes?). If so, then if company A never pays dividends to its shareholders, then what is the point of owning company A's stock? Surely the right to one vote for company A's Board can't be that valuable. What is it that I'm missing? |
Examples of linear maps from $\phi : \mathbb R^2 \to \mathbb R$ that has homogeneity degree $1$ but is not linear. Example of a function $\phi : \mathbb C \to \mathbb C$ that is additive but is not linear. All the examples I have found for these have gone over my head, can someone help me find a simple example for these? Progress I figured out a solution for the second part, can anyone help some more with the first part? | I need to find a nonlinear function $f:\mathbb{R}^2\rightarrow\mathbb{R}^2$ such that $f(\alpha (a,b))=\alpha f(a,b)$ for all $(a,b)\in\mathbb{R}^2$ and $\alpha\in\mathbb{R}$. I can't find anything. Context The requirement $f(\alpha (a,b))=\alpha f(a,b)$ says that $f$ respects the scalar multiplication, just as linear maps do. In particular, $f$ is homogeneous of degree $1$. To make it nonlinear, one has to somehow destroy the additive property $f(a+c,b+d)=f(a,b)+f(c,d)$. |
How to use groupby() function which is present in itertools. for example : sample input : 1222311 sample output : (1,1),(3,2),(1,3),(2,1) | I haven't been able to find an understandable explanation of how to actually use Python's itertools.groupby() function. What I'm trying to do is this: Take a list - in this case, the children of an objectified lxml element Divide it into groups based on some criteria Then later iterate over each of these groups separately. I've reviewed , but I've had trouble trying to apply them beyond a simple list of numbers. So, how do I use of itertools.groupby()? Is there another technique I should be using? Pointers to good "prerequisite" reading would also be appreciated. |
Is putting the { next to the variable declaration required by syntax (for a dict variable) or is there a way to put it on the next line because if I do it like this I have to go through each item and check them until I find the item I want to change: var = {thingy1: 1, thingy2: 2, thingy3: 3, thingy4: 4, thingy5: 5} I would like to do it like this: var = { thingy1: 1, thingy2: 2 } I have seen some people doing it like this but I just want to know if putting the { next to the variable declaration is required by syntax or not: var = { thingy1: 1, thingy2: 2 } (sorry if its a stupid question im a bad programmer and ive just started learning python lol) | I have a long line of code that I want to break up among multiple lines. What do I use and what is the syntax? For example, adding a bunch of strings, e = 'a' + 'b' + 'c' + 'd' and have it in two lines like this: e = 'a' + 'b' + 'c' + 'd' |
If heard two explanations for this. One explanation is that the gravity is so strong that space is being stretched inward faster than the speed of light and thus no photons could possibly escape. The other explanation I have heard is that photons can escape but that they become "red shifted into oblivion". Can someone explain this to me? Are these actually the same explanation? | In (ignoring Hawking radiation), why is a black? Why nothing, not even light, can escape from inside a black hole? To make the question simpler, say, why is a black hole black? |
I need to use a map to show a cartographic output based on raster elaborations. Specifically, I want to use this map as background to overlay over it some cells of my rasters layers. The type of map is not mandatory, it can get from satellites or any other source that give back a nice graphich representation of my study area. For example, I found this one attached in the post, but it does not include a portion of my interest. This happens for all other maps I found. Any suggestion for finding online a map complete of East and West Oceania? | I wish to display a map in QGIS (world country shapefiles) showing all countries but centered on the Pacific area. I am not familiar with Proj4, so is there any way this can be done in QGIS? |
I tried to look for an answer for this specific situation, but couldn't find one. Here's the MWE: \documentclass[11pt,a4paper,italian]{article} \usepackage{babel} \usepackage{listings} \usepackage{hyperref} \usepackage{cleveref} \begin{document} \lstinputlisting[ caption=test, label=lst:test ]{test.c} \begin{lstlisting}[caption=test2,label=lst:test2] #include<stdio.h> int main() { printf("Hello World\n"); return 0; } \end{lstlisting} Testo di esempio con riferimento a \Cref{lst:test} e \Cref{lst:test2} \end{document} The code in test.c is the same as in the lstlisting environment. The output I get is: As you can see, the Cref commands are translated correctly in "Elenco", but the caption still says "Listing". I tried adding \crefname{listing}{codice}{codici} \crefname{listing}{Codice}{Codici} explicitly, to see what the result would be; it changes the \Crefs but not the caption. What's going on? Am I tackling the problem from the wrong perspective? | I am using babel package for Turkish language and I also use listings package. A code sample for one of my listings is as follows: \begin{lstlisting}[label=some-code,caption=Poo Class] public class Person { public int ID { get; set; } public string Name { get; set; } public string Surname { get; set; } } \end{lstlisting} As header, what I am getting is this: Listing 7.1: Poo Class I would like it to be like this: Kod Örneği 7.1: Poo Class Am I asking too much? |
Is it true that you can upgrade from Windows 7 to Windows 10 for free? If so, how can you upgrade from windows 7 to windows 10? | Microsoft is giving Windows 10 away for free to Windows 7/8/8.1 users. If one reserves Windows 10 with the new notification in the tray area, what will happen to their Windows 7/8/8.1 license? Are you really getting Windows 10 for free, as in you upgrade from 7/8/8.1 but you still own the previous version of Windows and Windows 10, or are you really trading your old Windows license for a new one? Basically, after upgrading to Windows 10 for free from Windows 7, will I still own Windows 7? (Will the product key for 7 still work?) |
And that's a good idea! We have a lot of high quality content here, certainly enough for a small book. I'm not saying that it necessarily has to be integrated into the main site, but this is just a suggestion if anyone wants to implement it. Stack Exchange probably could make money selling the physical books though. CC-BY-SA allows selling, as long as you allow others to make copies of your book, and credit the author. What Wikipedia does is you can custom order any set of articles as a book (it even has a nice set of authors at the end, to satisfy the BY part of CC-BY-SA). This could even tie into the docs feature. | Stack Overflow is great resource to learn. For both someone asking a question and answering a question. Posing a question let you reflect on your problem. A lot of the questions started are never submitted because the act of posing a question helps solving it. Answering a question helps to stretch your knowledge bit by bit. You may answer questions directly but sometimes you know only 75% of the answer. Now you have to stretch your knowledge a bit to be able to answer it and you'll learn something on the way. This is the positive side of Stack Overflow; on the other hand Stack Overflow is not good enough for systematic learning: I want to learn more about X!. You'll find something about everything, but it's not efficient. The knowledge that is in Stack Overflow is not refined in a way to allow this. This is unavoidable for a site that wants to help users with immediate answers to their problems. The knowledge amassed is only a by-product of this process. Nonetheless it can be put to another use with some extra effort. This is the basic idea: Select and revise Stack Overflow questions and answers to allow efficient learning. Stack Overflow question and answers cannot replace text books, articles or blogs, but can provide exercises for a given topic. We learn by application of the ideas presented in these other formats. If you dust off your there are always exercises after all the theory. The exercise part is where the learning starts by reflections. Before that it's just following a beaten path: "Oh yes it's this and that and O(n)". Given some effort it is possible extract high quality exercises from Stack Overflow: Select good questions (probably < 20% for this purpose) Select the best answers Assign some grade of difficulty (to create some order) Add additional tags (when the tags are missing or to not fit into the structure of the anthology) Optional - Revise the question and answer Optional - Add missing questions and answers The biggest advantage is that the posed questions are real world problems. This is a big factor to motivate learning. There could be some feedback into Stack Overflow in later steps. Stack Overflow is really complicated enough but some form of quality improvements may be desirable. Wikipedia added some quality improvement measures later in the project after it gained a critical mass. It may be nice to see high quality content highlighted in Stack Overflow, but it is not essential to the anthology idea. The best way to start and see if this idea works is to take a tag with few questions (less than 1000) and categorise all of these questions. The target would be to extract ~100 questions. Some software is needed to support this. Development could start with a limited set of edit tools to select questions, answers and add tags. For learners a page to browse the anthology with direct links to Stack Overflow is enough to get started. Is this a bad idea or would you like to work on this project? |
I have a roundutrip planned from Sydney to Los Angeles. I think the easiest would be to get an ESTA on my Australian passport and just travel on that passport alone. But I'm looking to avoid this if possible as I would rather use my Canadian passport to enter the US (no fingerprint… eye scan; may get preferred line at immigration; no ESTA fee or application). I have valid passports for both countries (identical personal information, name, dob). Australia rules suggest that I must leave/enter Sydney with my Australian passport. From reading dual citizenship posts on this website, it seems an ESTA may not be needed on for an Australian passport. Departure flight: I can check in with the airline (Delta) in Sydney with my Canadian passport, then proceed to immigration and leave with my Australian passport. I enter the US at LAX with my Canadian passport. For the return flight: at LAX, I should check in with the airline with my Australian passport (even though I don't have an ESTA) to show I have status to return to Australia, exit at US customs on my Canadian passport (because I entered the US on that passport). Is it ok to travel without an ESTA on an AU passport even though I will need the AU passport at LAX to fly back to Australia? Will the new smart gates used at airport security/immigration allow passage if the airline ticket and country of passport do not match (ie in Sydney having checked in with the airline with my Canadian passport but use the Australian passport at smart gates or vice versa at LAX)? | I am a citizen of two different countries, and have two passports. How should I use my passports when traveling? |
If i am running this for loop: Method[] methods = someClass.getDeclaredMethods(); for(Method method: methods){ /*code*/ } Is there a way for me to know at what iteration im currently on. I need to know if a certain method is found and then save the position in the array for that method. Thanks | Is there a way in Java's for-each loop for(String s : stringArray) { doSomethingWith(s); } to find out how often the loop has already been processed? Aside from using the old and well-known for(int i=0; i < boundary; i++) - loop, is the construct int i = 0; for(String s : stringArray) { doSomethingWith(s); i++; } the only way to have such a counter available in a for-each loop? |
In I can see maybe it is possible, although I think it could be an over-use of the SE team. I think, they are for exceptional technical problems over the influence of the mods. Maybe an automated solution could be developed for this? If somebody asks for an irreversible, temporary suspension (if he has account on multiple SE sites, then network-wide), how is it handled? Is it even possible? What is the best way to ask for this, if it is possible? Also I think a suspension at one's own request shouldn't be counted as if it had been a punishment. In these cases, the punishment had been if the user hadn't been suspended. | On requested a self-suspension to take some time off. Now his profile boldly reads: This account is temporarily suspended for rule violations. This is not right. Anyone viewing this profile without knowing the back-story may reasonably assume that he has in fact committed rule violations severe enough to warrant a suspension. I don't know how frequent self-requested suspensions are, but even for one case it is a shame to possibly degrade the community's opinion of this fine individual. Could we please have a "needed time off" reason for suspension, or some other non-derogatory wording? |
I'm working with a client that has their own VM images of RHEL 7 that they want to use for a project. Unfortunately, all of / is only 50GB. I asked for /var to be 300GB but all they did was mount a raw 300GB Disk onto the VM. How can I safely move everything in /var to this new 300GB disk? I initially attempted to follow which seemed sensible but after a reboot broke just about everything. Polkit wouldn't start, which meant I couldn't control systemd, and I couldn't reboot. So I'm very wary of trying that way again. | I am attempting to move some folders (such as /var and /home) to a separate partition after reading this guide: I was able to move one folder successfully following guide. However, it doesn't seem to work for multiple folders, and all my folders are dumped into the partition without proper folders. I would like to mount /var, /home, and /tmp onto the separate partition; can someone guide me on this? |
There was a broken link on the selected answer to this question:- However, when I made the edit to update the link it would not let me submit unless I changed 6 characters. Should the 6 characters not include the links? I would argue that fixing a broken link in a "link only" answer that only really provides any value through said link, is a substantial improvement from almost zero value to some value, and should be allowed | I recently came across an by which contained a link to a specification that has since been moved. When attempting to edit the link, a change which involved the subtraction of only 4 characters, I ran up against the 6 character minimum requirement. Ordinarily this would not be an issue. A less experienced poster would likely have other things within the answer that could be changed (). In fact, this seems to be the answer on every meta post relating to this topic (, , etc...). The problem here, since I don't have 2k reputation, is that BalusC writes excellent answers... with the reputation to back them up. I don't feel there is anything in the post (besides the link) that would benefit from me editing. What is the standard practice here? Flag the post and explain my situation in the notes (for someone with higher reputation)? Comment on the post and hope that a) visitors read the comments or b) the OP gets notified and updates their post? Make edits, for the sole purpose of increasing characters, providing no benefit and possibly hurting the quality of the post? For reference, the EL Specification in the post should be changed to , if someone wants to go ahead and take care of this. |
I wanted a frame with an example composed by a description and an image but the result is not what I want and I don't know where the problem is... \begin{frame}[allowframebreaks] \frametitle{Classical Definition} \begin{example} \begin{columns}[t] \begin{column}{5cm} Description \end{column} \begin{column}{5cm} \includegraphics[width=4cm]{fig/nrpexample.png} \end{column} \end{columns} \end{example} \end{frame} Thanks for your help | I am trying to place two images in top of two columns in a columns environment, in a beamer presentation. The first column consists of one image on top and a enumeration list bellow the image. The thing is that I want the column to start at the top of the frame, which isn't happening in my case. My code is \documentclass[slidestop,compress,mathserif,11pt,xcolor=dvipsnames]{beamer} \usepackage{beamerthemebars} \usepackage[bars]{beamerthemetree} \usepackage{multicol} \setbeamercovered{higly dynamic} \usetheme{Ilmenau} % Beamer theme v 3.0 \useoutertheme[subsection=true]{smoothbars}%Beamer Outer Theme-circles on top \usefonttheme{serif} \useinnertheme{circles} \begin{document} \section{Εισαγωγή} \begin{frame} \frametitle{Nuclear Propulsion} \begin{columns} \begin{column}{0.48\textwidth} \begin{figure}[t] \includegraphics[width=\textwidth]{AtomicSubmarine}%\vspace{0.5cm} \end{figure} \tiny{\begin{enumerate} \item Item1$\rightarrow$ Conclusdion \item Item2$\rightarrow$ Conclusdion \item Item3$\rightarrow$ Conclusdion \item Item4$\rightarrow$ Conclusdion \item Item5$\rightarrow$ Conclusdion \item Item6$\rightarrow$ Conclusdion \end{enumerate}} %\begin{minipage}[t]{0.99\textwidth} %\includegraphics[width=\textwidth]{AtomicSubmarine} %\end{minipage} \end{column}\hfill \begin{column}{0.48\textwidth} %\begin{minipage}[b]{0.99\textwidth} \begin{figure}[t] \includegraphics[width=0.9\textwidth]{SubmarineSnorkel} \end{figure} %\end{minipage} \end{column} \end{columns} %\begin{minipage}[b]{0.5\textwidth} %\includegraphics[width=\textwidth]{SubmarineSnorkel} %\end{minipage} \end{frame} \end{document} The output of this code is It is clear that a few lines upper would be ideal, as the real presentation frame, states! I've tried to remove the figure environment, to use minipage but the right image is aligned with the list, resulting in a very bad format. One solution is to remove the frametitle but I'm afraid I need it... Another idea is to use \vspace{-1cm} but I am not sure if this is the optimum solution... Any ideas on that? |
I am currently in the writing phase of my thesis. Factors related to and unrelated to academia are putting me under "nice" amount of pressure. it became much harder for me to concentrate on reading or writing and always end up procrastinating much of the time. What are good strategies to get back on track in regards to managing my thesis work? When should one consider psychiatric counseling? | Background - I am doing my PhD in atmospheric physics/photobiology. Here is a scenario: The experiments are complete - the results are far better than expected Successfully got the computer program to work properly and have developed another Papers are published Much of the thesis is drafted The light at the end of the tunnel is most definitely no longer an oncoming train. But, at this stage, you just don't feel like working on the thesis, you do other things like cleaning, reading, watching movies - procrastination gets worse, and worse despite the submission deadline coming closer. The procrastination resulting in more apathy towards the project, despite being fully aware of how much work has been put into the project, how much has been achieved and how little, comparatively, needs to be done. What strategies are there to overcome this academic-apathy, particularly in this late stage of the thesis? |
I have tried to read data from Oracle database using mybatis. I have written below query in db.xml : <select id="selectItemPartNumberWithEco" resultType="String"> SELECT ITEM_PART_NUMBER from CIS_ITEM_AGILE_ECO_DATA_TBL WHERE ECO_NUMBER IS NOT NULL </select> <select id="selectItemPartNumberWithoutEco" resultType="String"> SELECT ITEM_PART_NUMBER from CIS_ITEM_AGILE_ECO_DATA_TBL WHERE ECO_NUMBER IS NULL </select> my db.java(interface) file has following declaration : public List<String> selectItemPartNumberWithEco() throws DAOException; public List<String> selectItemPartNumberWithoutEco() throws DAOException; My implementation class has following code : public List<String> selectItemPartNumberWithEco() throws DAOException { return repoItemDAO.selectItemPartNumberWithEco(); } public List<String> selectItemPartNumberWithoutEco() throws DAOException { return repoItemDAO.selectItemPartNumberWithoutEco(); } I have called the above class as follows : RepoServiceImpl repoServiceObj = new RepoServiceImpl(); List<String> existingDbAgileItemList = repoServiceObj.selectItemPartNumberWithEco(); List<String> newDbAgileItemList = repoServiceObj.selectItemPartNumberWithoutEco(); While executing my code i am getting null pointer exception. How to select a column from DB using mybatis? | 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 always had a hard time getting reviewers to approve my edits pending peer review. It's very often either "too trivial" or "too much change", with "should be a comment" thrown about here and there. How do I hit the silver lining? Just today, in this post, I thought I would improve the accepted answer by adding some useful information that would help the next person. In the process, I also decided to improve the formatting a little bit: I suggested first with the following comment: improved formatting, add footnote about errors that can be ignored Within seconds it was rejected 3:1, so I thought I'll , this time with this comment: (why reject? I'm trying to add some useful information here so that the answer is more clear to someone who would encounter the same problem again. how is this edit "minor" or "trivial" or "not substantial"?) improved formatting, add footnote about errors that can be ignored Again it was rejected 3:1, with one of the rejects explicitly saying "Should be a comment instead.". I would argue against this saying that making the extra information a comment would defeat the purpose of a website like StackOverflow, where seekers of answers should be given correct and complete answers. In this specific case, the phrase "Make sure you don't have any errors" is misleading, because in the Eclipse IDE, even after other errors have been fixed, the error which I was talking about will still remain, which can only be fixed by doing the step that follows it ("Fix Project Properties") or the instructions in the second paragraph (modify XML file and save). This is what led me to suggest the edit to make the answer more complete and comprehensive, so the next person does not have to sift through the comments for such a valuable piece of information. I think very often, peer reviewers at SO are rejecting suggested edits too harshly, too quickly and without fully understanding the original problem and the context in which the edits have been suggested. They seem quite often to follow a gut feeling when making decisions (how can you reject an edit so quick within mere seconds of posting it?) rather than analyzing the question/answer properly, understanding the context and thinking about whether the suggested edit is actually something worth keeping. Suggestion: I hope the SO/SU community can improve on the peer reviewing process so that actual useful edits are not lost in your battle against useless ones. Perhaps reviewers should be forced to spend some time reading the original question and the original answer, and deciding whether the edit adds valuable piece of information that could be helpful to the next person who has the same question. (This would mean edits can't be approved or rejected within seconds of viewing them, but the reviewer could be delayed by a minute or two* - I believe this will reduce the chance of impulse reviewing as the wait will encourage the reviewer to use the time productively. * The time to wait could be tied to the caliber of the reviewer: a new reviewer could be given 3 minutes of wait; a learning reviewer 2.5 minutes; a graduated reviewer 2 minutes; a seasoned reviewer 1.5 minutes and a veteran reviewer 1 minute (the minimum wait for any reviewer). Alternative Suggestion (courtesy CodyGray and Mr.Wizard): The edit queue could be filtered based on tags of questions on which the edits were made, meshed with the top five? tags the user had been most active on (their past questions and answers combined, with answers bearing more weight and high-voted/accepted answers bearing even more weight). Those edits which had lapsed a couple of hours or a day without review could be placed in the unfiltered queue for anyone with enough reputation points to review them even if their top tags do not match the tags in the question. Both the filtered and unfiltered queues should be made available to the users with enough rep to see the review queues, without any specific restriction towards one or the other. | Possible Duplicate: I see a lot of edits in queue where some well-meaning user attempts to fix OP's code. They range from minor syntax corrections, to near total rewrites. When is it appropriate to accept or reject these edits? Here are my thoughts: On questions: Never edit OP's code no matter how wrong it is, unless it is strictly to increase readability, and doesn't change how the code actually works. The very question itself might be solved by pointing out the error that you are fixing, no matter how small, so don't remove or correct it in the original post. On answers: Only edit code for obvious typos or mistakes by the author, do not attempt to "improve" the author's code. Even if the author is suggesting something stupid or dangerous, like forgetting to escape data for a database INSERT, it's better to leave a comment and let the author correct it. Downvote if applicable. Editing the non-code parts of a post for grammar and the like are usually not going to change what the author intended to say very much, but code is taken literally, even a very minor edit will make a huge difference. Am I close to the mark, or way off? Is there anything else to take into consideration? What are the exceptions, if any? I'm seeing a ton of these in the suggested edit queue. When is it appropriate to edit someone else's code, and how should we deal with these suggestions from other users? In addition (maybe a separate question), what can I do to help educate users who suggest unwelcome edits in general? Is there any way to leave them a comment so they can understand why the edit was rejected, so they don't continue to suggest more edits of a similar nature?* * An @ comment will notify the editor, this is clearly documented here: * * However, it's not clear if @ replies ping the author of a rejected edit... |
(Blender 2.70a, Cycles render engine) Any thoughts on how to get back my smooth glossy surface? I've been working on cleaning up the overlaps caused by adding a bevel to some tight text and have encountered a problem I can't figure out how to fix. When you add a bevel to text, Blender actually creates vertices in three additional planes (as near as I can figure): There is the front plane of your text, the back plane and in the middle are two planes of the bevel edge which would usually get separated by adding depth to the text -- I'm not adding depth, so the two middle plane are right atop one another. When you use the "remove doubles" option (on the two planes that make up the knife edge) something is happening to the faces such that a glossy material reflects light differently than when the two planes exist. Here are pictures to illustrate the problem: In this first picture I have added text, added a bevel of 0.015 to the text object, then converted it to a mesh. Using the face selection mode, and being in top view, I box-selected all the faces behind the front-most plane and assigned them a material consisting of a Mix Shader with a Glossy shader (defaults) and a Diffuse shader (defaults). Then I created a blue diffuse material and assigned it to the frontmost faces. I dropped in a few spotlights to light the scene and give something for the glossy material to reflect. I have done nothing to remove doubles yet. Now, using the lasso selection tool with "Limit selection to visible" turned off, I have selected the knife-edge vertices on our right side of the "x": With that selection made, I hit the "Remove Doubles" button in the Mesh Tools pane and observe the effect on the render: Thinking visually, it's almost as if the faces of the bevel are now curved rather than flat, but why removing doubles would alter the faces that way escapes me. And it's not the look I'm after! One thing I thought to try was alter the world surface to be some bright color, but the dark shadowing appearance remains unchanged if not tinted slightly: I had thought that perhaps the normals were oriented differently, but displaying them and rotating the view to present an unaltered portion of the "x" close to inline with the altered portion shows the normals to look, well, normal: Any thoughts on how to get back my smooth glossy surface? Not removing doubles is the easy answer, but it's a double hassle when the font you're using wraps over itself on serif extensions when beveling. | I frequently come to the problem of having a mesh with parts I would like to render smooth and "hard" edges connecting them. How can I set the mesh to show the sharp edges but render everything else smooth? In the example I would like the sides of the individual cylinders render smooth but the intersection between bottom and top to be sharp/flat |
I noticed a weird problem every time I save maps with either Bing or Google Imageries from QGIS Cloud. The vector features all align perfectly well on the map canvas and even on print composer. But after saving the map as either .jpg or .pdf, the vector layer on the saved map file would have shifted by a huge margin. Please see picture attached. Does anyone have a solution? | I'm having trouble with the OpenLayers Plugin of Qgis and the map composer: If I create an OSM-background layer and if I want to export this, the OSM-Layer looks perfectly all right in the normal qgis program window. But in the map composer and after export the layer has shifted relatively to my other shape layers (EPSG:32633 - WGS 84 / UTM zone 33N). The second thing is that the output resolution of the exported osm-layer is very, very poor. A really bad way of getting around this whole trouble would be to increase the screen resolution and make a screenshot of the map composition window of qgis. But I don't think this would be very professional. It also would cause a lot of pain :) I'm using Qgis 1.8.0-Lisboa under Linux. The openlayers plugin is version 0.92. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.