body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
This might be silly and non technical. This website name is "stack"overflow and there is "stack"exchange. In one of the job portals I saw a new term "Full Stack Developer". In one of the presentations of an IT giant, there were talking about the stacks like "Server", "Storage" , "Applications". Stack is just one word and it is being used differently in different situations. All I know is that it is a LIFO data structure and plays a vital role in many system operations. Can someone throw some light on this ?? Thanks in Advance
Programming language books explain that value types are created on the stack, and reference types are created on the heap, without explaining what these two things are. I haven't read a clear explanation of this. I understand what a stack is. But, Where and what are they (physically in a real computer's memory)? To what extent are they controlled by the OS or language run-time? What is their scope? What determines the size of each of them? What makes one faster?
I'm using Ubuntu 18.04 but my .sh files will not execute they just open up in gedit. I have tried changing what the file opens with but Idk which application to choose from the list.
How can I make a bash script executable by double clicking just like .exe files in Windows? I tried , but there are two consequences: the terminal twinkles, disappears, and nothing is done. you must specify to run in terminal in order to work. I have a script that installs tomcat on an offline PC, including all dependencies of tomcat in the script. I need to make the script work on double clicking like windows since most who use the script will not be familiar with Ubuntu. Forget the above explanation. I want to make a script that can be run by double-clicking on it, without using the terminal. Anybody knows how?
Eclipse gives me this error message: The literal [number] of type int is out of range. I know that's impossible to define an int with a number which is higher than 2147483647 or lower than -2147483647. The numbers which I want to set as an int are mobile phone numbers (in Switzerland they can have maximum the value of 0999999999 - Isn't this already enough low to define it as an int??). I changed the variable type of the attributes date and number in the class Person to long. Now I receive the error message which I mentionned above. Why? How can I fix this? Thank you. Here is my code: public class PhoneBook { public static void main(String[] args) { Person sister = new Person (); Person brother = new Person(); Person mother = new Person(); Person father = new Person(); mother.name = "Gertrud"; mother.date = 12041969; mother.number = 0792467286; sister.name = "Theresa"; sister.date = 02112002; sister.number = 0794567843; brother.name = "Megnitz"; brother.date = 01041999; brother.number = 0775685421; father.name = "Randolph"; father.date = 21071966; father.number = 0764532178; } } ___________________________________________________________________________________________________ public class Person { String name; long date; long number; public void print() { System.out.println(name + ", " + "born on " + date + " / " + number); } }
This prints 83 System.out.println(0123) However this prints 123 System.out.println(123) Why does it work that way?
I am working on a code with relatively few iterations (like, less than 100) and the total time is still several minutes. This means complexity is of no help and I don't really know what operations take most of the cpu time. This is annoying as i want to repeat that operation thousands of times. I want to reduce that time. I know how to use time.clock() and return the difference but i am looking for a way to know the time spent on each line to know where and if an improvement can be made. Is there a mode already built for that on python? (3.4, windows)
and other coding contests often have a maximum time to run or people boast of how fast their particular solution runs. With Python, sometimes the approaches are somewhat kludgey - i.e., adding timing code to __main__. What is a good way to profile how long a Python program takes to run?
My PS3 Skyrim is starting to have the dreaded lag problem. I've tested Skyrim on my PC and it works perfectly on medium settings with 60FPS@720p (and better graphics than the PS3). It is also beautiful on my 55'' plasma and the PS3 controller works once I downloaded "MotionInJoy", so I would like to continue my adventure on PC. It is possible to migrate my PS3 save game to PC? I've invested a lot of hours on this character and I'm not really in the mood to replay lots of quests.
Is there a way of easily transferring a saved game from one machine to another? PC to PC XBox to XBox PS3 to PS3 Cross platform transfers
How does drift velocity vary with temperature? Does it increase or decrease?
How does the drift velocity of electrons in a conductor depend on the temperature? I have two contradicting views for this. First, we can say that increasing the temperature of the conductor will increase the kinetic energy of the electrons. Hence, their drift velocity should increase with increase in temperature. Or, from the relation $v_d = \frac{eE}{m}T$ ($T$ is the relaxation time) we can say that the drift velocity is directly proportional to the relaxation time. Increasing the temperature will obviously decrease the relaxation time - as collisions will become more frequent - and thus decrease the drift velocity. Hence, an increase in the temperature will cause a decrease in the drift velocity. So which view is correct?
I have a Dell OPTIPLEX 380 CPU. It keeps on hanging only after running any 2-3 programmes simultaneously. Here is the configuration RAM - 2GB Processor- core 2 duo Hard Drive - 128 GB(HDD) OS - ubuntu 14.04 LTS How can I fix it? We have work for at least 10 hours a day on this system. Is increasing the RAM is the only option to fix it?
For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and such as: with a lighter desktop than the usual Gnome and Unity with the even lighter LXDE desktop Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?
Let $\{a_n\}$ be a sequence of positive real numbers such that $a_1=1,a_{n+1}^2-2a_na_{n+1}-a_n=0\,\,\forall n\ge 1$. Then show that $$1<\sum_{n=1}^\infty {a_n\over 3^n}<2$$. I got this problem from a question paper. Though it didn't asked for exact sum of the series , if you also manage to find that then please post it.
Let $\{a_n\}$ be a sequence of positive real numbers such that $a_1 =1,\ \ a_{n+1}^2-2a_na_{n+1}-a_n=0, \ \ \forall n\geq 1$. Then the sum of the series $\sum_1^{\infty}\frac{a_n}{3^n}$ lies in... (A) $(1,2]$, (B) $(2,3]$, (C) $(3,4]$, (D)$(4,5]$. Solution attempt: Firstly, we figure out what $\frac{a_{n+1}}{a_n}$ is going to look like. We get, from the recursive formula, $\frac{a_{n+1}}{a_n}=1+\sqrt{1+\frac{1}{a_n^2}}$ (remembering the fact that $a_n>0$, the other root is rejected). We know that, if $\lim_{n \to \infty}\frac{a_{n+1}}{a_n}>1$, then $\lim a_n \to \infty$. Further, $(a_{n+1}-a_n)= \sqrt{a_n(a_n+1)}>0$. (Again, the other root is rejected due to the same reason). Hence, $(a_n)$ increases monotonically. Therefore, the largest value of $\frac{a_{n+1}}{a_n}$ is approximately $1+\sqrt{1+\frac{1}{1}} \approx 2.15$ Now, the sum can be approximated as $\displaystyle\frac{\frac{1}{3}}{1-\frac{2.15}{3}} \approx 1.3$ (In actuality, $\mathbb{sum}< 1.3$). So, option $(A)$ is the correct answer. Is the procedure correct? I have been noticing a handful of this type of questions (based on approximations) lately, and the goal is to find out where the sum / the limit of the sequence might lie. Is there any "definitive" approach that exploits the recursive formula and gives us the value, or does the approach varies from problem to problem?
I am trying to implement online examination system. There are two types of question, either fill in the blanks, or multiple choice questions (MCQs). Right now, I modeled tables as: questions ( qid INT AUTO_INCREMENT PRIMARY KEY, question TEXT, answer VARCHAR(20), mcq TINYINT(1) ); options ( qid INT, options VARCHAR(20) ); Options will be stored as: { (1,option1), (1,option2), (1,option3), (1,option4) } MCQ is a 1-bit flag to flag whether it is MCQ or not, if yes, then it fetches options from options table. For different courses in any institute, should I maintain different table for different courses, or add course field in question table itself? Is it okay to store answer in questions table, or should I maintain a separate answers table ? answers ( qid INT, course VARCHAR(10), answer );
I am putting together a quiz application. (I'm calling each quiz a "challenge") I have a "challenge" table and a "challenge_question" table which is pretty straightforward. challenge table: id name num_questions (I want to randomize and only display a certain number of Qs per each challenge) challenge_question table: id challenge_id question (text of the question) required (some questions will be required to be displayed per each challenge) question_type (here I indicate what type of question: Mult. choice, T/F, Ordering, or Fill-in-the-blank) Where I'm having trouble in normalization is with the types of question options: Multiple choice, true/false, ordering, and fill-in-the-blank. I wonder, should I have a separate table for each type of challenge-question-option? Or is it possible to combine these into one somehow.. If I combined all possible options into a single table, it might look be something like this challenge_options table: id challenge_question_id option (text field, can be used for both multiple choice and for fill-in-the-blank style questions) is_true (boolean field for true/false questions) is_correct (boolean, used to determine multiple choice answer) ordering_option_1 ordering_option_2 ordering_option_3 ordering_option_4 (these ordering fields would store the correct sequence of an ordering style of question) This really strikes me as less than ideal. Actually, I don't see how the ordering_options would work out correctly at all. Wouldn't I need to have each of those be a separate option? Surely there must be a better way. Any suggestions/criticisms or alternate approaches?
I am currently doing MPhil degree in Electrical Engineering (Sensors & Robotics). I did my bachelor degree in Electrical Engineering as well. I have real motivation and love to do research on Theoretical Physics as well. The more I learn physics more I need to do a research on physics. My initial thought was to get an M.Phil on the current University in EE and get my Ph.D. in Electrical Engineering from some other more reputed university. But since now I have an idea of doing Ph.D. in physics, now I am thinking of extending my M.Phil to a Ph.D. and finish it and do another Ph.D. on physics in a foreign University (Australia). I have two questions, 1)what is your opinion on this path? I appreciate answers, especially by PhD supervisors. 2) Does getting a Ph.D. in electrical engineering minimize my chances of getting selected for a PhD( funded Ph.D.) in theoretical physics? (I mean is it better to apply for Ph.D. in theoretical physics after completion of just M.Phil). Note: It takes only one extra year for Ph.D. if I extend my M.Phil.
I currently work as an Aerospace Engineer for the Department of Defense for nearly 6 years now, and I have a PhD in Aerospace Engineering from a top-10 university in the United States. I am seriously thinking of doing a 2nd PhD in Computer Science, because I want to eventually own an Algorithmic Energy Trading Firm and need to become an expert in Machine Learning algorithms. As of now, I am working on a few journal papers to publish and I am not going to have any problems getting strong letters of recommendation from my employer and professors on campus. I ought to be able to get a letter from the Dean of my college as well. So, I am thinking of a second PhD in Computer Science because I really want to immerse myself in Machine Learning and figured a PhD was the way to go. Question for everyone: Would it be a challenge for me to acquire entrance into a top 5 school in Computer Science for a PhD? I ought to mention that my PhD research was in Computational Fluid Dynamics, Turbulent Flow and I had to develop my numerical solver and turbulence models in Object-Oriented C++.
I have tried some of the solutions to similar questions, but none of them included minipages, which seems to be the problem (I`m fairly new to LaTeX) So, here's the coding: % Definition of circles \def\firstcircle{(0,0) circle (1.5cm)} \def\secondcircle{(0:2cm) circle (1.5cm)} \colorlet{circle edge}{black!50} \colorlet{circle area}{grey!20} \tikzset{filled/.style={fill=circle area, draw=circle edge, thick}, outline/.style={draw=circle edge, thick}} \setlength{\parskip}{5mm} % Set A or B \begin{tikzpicture} \begin{minipage}[t][2cm][t]{.48\textwidth} \draw[filled] \firstcircle node {$A$} \secondcircle node {$B$}; \node[anchor=south] at (current bounding box.north) {$M$}; \end{minipage} \end{tikzpicture} % Set A and B \begin{tikzpicture} \begin{minipage}[t][2cm][t]{.48\textwidth} \begin{scope} \clip \firstcircle; \fill[filled] \secondcircle; \end{scope} \draw[outline] \firstcircle node {$A$}; \draw[outline] \secondcircle node {$B$}; \node[anchor=south] at (current bounding box.north) {$M$}; \node[anchor=west] at (current bounding box.east) {$A \cap B$} \end{minipage} \end{tikzpicture} Also, if you know how to put the "B" in the center of the circle on the right I`d appreciate your help! Thank you.
How can I add a centered caption to the venn-diagram below the rectangle? \documentclass{article} \usepackage{tikz} \begin{document} \begin{center} \begin{tikzpicture} \draw (-2,-1.5) rectangle (3.5,1.5) node[below left]{$U$}; \fill[gray] (0,0) circle (1cm); \fill[gray] (1.5,0) circle (1cm); \draw (0,0) circle (1cm) node {$A$}; \draw (1.5,0) circle (1cm) node {$B$}; \end{tikzpicture} \end{center} \end{document}
Prove that $\sum_{k=0}^{n} k \binom{n}{k} \binom{m}{k}=n\binom{m+n-1}{n}$ I have tried induction by $n$ and by $m$ with Pascal's Identity, but that always seems to drop $k$ to $k-1$ and I am not sure what to do with that afterwards. I have also tried rewriting the $\binom{m+n-1}{n}$ part to $\sum_{i=o}^{n} \binom{m-2+i}{i}$, but that did not work as well. I know that $\sum_{k=0}^{n} k \binom{n}{k}$ can be obtained from first derivative of $(1+x)^n$ multiplied by $x$ and setting $x=1$ but I don't see how to multiply it then by $\binom{m}{k}$, if this approach is even usable here. I am not really sure what to do with this problem.
I believe the following is an identity (I've tested with a few random $m$ and $n$ values, could be wrong though): $$\sum_{k= 0}^{\infty}{m \choose k}{n \choose k}k=n\binom{m+n-1}{m-1}$$ but I'm not sure how to prove it. Initially I thought of considering the right side combinatorially: pick $m-1$ things from a bucket of $m+n-1$ things and repeat this $n$ times. But how do I think of the left side combinatorially, since there is an infinite sum? Or maybe this is the incorrect approach?
I have created the below-pasted formula to SUM the numeric picklist values and the compiled size is 6,217 characters to a maximum of 5000. How can I rectify? IF(ISPICKVAL(CR_Form__c, ""), 0, VALUE(TEXT(CR_Form__c)))+ IF(ISPICKVAL(CR_Contract_Language__c, ""), 0, VALUE(TEXT(CR_Contract_Language__c)))+ IF(ISPICKVAL(CR_License_Grant__c, ""), 0, VALUE(TEXT(CR_License_Grant__c)))+ IF(ISPICKVAL(CR_Content_Options__c, ""), 0, VALUE(TEXT(CR_Content_Options__c)))+ IF(ISPICKVAL(CR_Exclusivity__c, ""), 0, VALUE(TEXT(CR_Exclusivity__c)))+ IF(ISPICKVAL(CR_Term__c, ""), 0, VALUE(TEXT(CR_Term__c)))+ IF(ISPICKVAL(CR_Termination__c, ""), 0, VALUE(TEXT(CR_Termination__c)))+ IF(ISPICKVAL(CR_Pricing_for_Multiyear__c, ""), 0, VALUE(TEXT(CR_Pricing_for_Multiyear__c)))+ IF(ISPICKVAL(CR_Payment_Terms__c, ""), 0, VALUE(TEXT(CR_Payment_Terms__c)))+ IF(ISPICKVAL(CR_Invoicing__c, ""), 0, VALUE(TEXT(CR_Invoicing__c)))+ IF(ISPICKVAL(CR_Service_Level_Agreement__c, ""), 0, VALUE(TEXT(CR_Service_Level_Agreement__c)))+ IF(ISPICKVAL(CR_Rep_Warranty__c, ""), 0, VALUE(TEXT(CR_Rep_Warranty__c)))+ IF(ISPICKVAL(CR_Limitation_of_Liability__c, ""), 0, VALUE(TEXT(CR_Limitation_of_Liability__c)))+ IF(ISPICKVAL(CR_Indemnity_Hold_Harmless__c, ""), 0, VALUE(TEXT(CR_Indemnity_Hold_Harmless__c)))+ IF(ISPICKVAL(CR_Assignment__c, ""), 0, VALUE(TEXT(CR_Assignment__c)))+ IF(ISPICKVAL(CR_Code_App_Ownership__c, ""), 0, VALUE(TEXT(CR_Code_App_Ownership__c)))+ IF(ISPICKVAL(CR_Data_Ownership_if_SVU__c, ""), 0, VALUE(TEXT(CR_Data_Ownership_if_SVU__c)))+ IF(ISPICKVAL(CR_Change_of_Control__c, ""), 0, VALUE(TEXT(CR_Change_of_Control__c)))+ IF(ISPICKVAL(CR_Choice_of_Law_Venue__c, ""), 0, VALUE(TEXT(CR_Choice_of_Law_Venue__c)))+ IF(ISPICKVAL(CR_Insurance_Obligations__c, ""), 0, VALUE(TEXT(CR_Insurance_Obligations__c)))
I have created the above formula to accomplish a sum of 20 number value picklists and it came out to 6,233 characters. As you all know, the compile limit is 5000. What can I do to circumvent this? IF(ISPICKVAL(Contract_Rating_Form__c, ""), 0, VALUE(TEXT(Contract_Rating_Form__c)))+ IF(ISPICKVAL(Contract_Rating_Contract_Language__c, ""), 0, VALUE(TEXT(Contract_Rating_Contract_Language__c)))+ IF(ISPICKVAL(Contract_Rating_License_Grant__c, ""), 0, VALUE(TEXT(Contract_Rating_License_Grant__c)))+ IF(ISPICKVAL(Contract_Rating_Content_Options__c, ""), 0, VALUE(TEXT(Contract_Rating_Content_Options__c)))+ IF(ISPICKVAL(Contract_Rating_Exclusivity__c, ""), 0, VALUE(TEXT(Contract_Rating_Exclusivity__c)))+ IF(ISPICKVAL(Contract_Rating_Term__c, ""), 0, VALUE(TEXT(Contract_Rating_Term__c)))+ IF(ISPICKVAL(Contract_Rating_Termination__c, ""), 0, VALUE(TEXT(Contract_Rating_Termination__c)))+ IF(ISPICKVAL(Contract_Rating_Pricing_for_Multiyear__c, ""), 0, VALUE(TEXT(Contract_Rating_Pricing_for_Multiyear__c)))+ IF(ISPICKVAL(Contract_Rating_Payment_Terms__c, ""), 0, VALUE(TEXT(Contract_Rating_Payment_Terms__c)))+ IF(ISPICKVAL(Contract_Rating_Invoicing__c, ""), 0, VALUE(TEXT(Contract_Rating_Invoicing__c)))+ IF(ISPICKVAL(Contract_Rating_Service_Level_Agreement__c, ""), 0, VALUE(TEXT(Contract_Rating_Service_Level_Agreement__c)))+ IF(ISPICKVAL(Contract_Rating_Rep_Warranty__c, ""), 0, VALUE(TEXT(Contract_Rating_Rep_Warranty__c)))+ IF(ISPICKVAL(Contract_Rating_Limitation_of_Liability__c, ""), 0, VALUE(TEXT(Contract_Rating_Limitation_of_Liability__c)))+ IF(ISPICKVAL(Contract_Rating_Indemnity_Hold_Harmless__c, ""), 0, VALUE(TEXT(Contract_Rating_Indemnity_Hold_Harmless__c)))+ IF(ISPICKVAL(Contract_Rating_Assignment__c, ""), 0, VALUE(TEXT(Contract_Rating_Assignment__c)))+ IF(ISPICKVAL(Contract_Rating_Code_App_Ownership__c, ""), 0, VALUE(TEXT(Contract_Rating_Code_App_Ownership__c)))+ IF(ISPICKVAL(Contract_Rating_Data_Ownership_if_SVU__c, ""), 0, VALUE(TEXT(Contract_Rating_Data_Ownership_if_SVU__c)))+ IF(ISPICKVAL(Contract_Rating_Change_of_Control__c, ""), 0, VALUE(TEXT(Contract_Rating_Change_of_Control__c)))+ IF(ISPICKVAL(Contract_Rating_Choice_of_Law_Venue__c, ""), 0, VALUE(TEXT(Contract_Rating_Choice_of_Law_Venue__c)))+ IF(ISPICKVAL(Contract_Rating_Insurance_Obligations__c, ""), 0, VALUE(TEXT(Contract_Rating_Insurance_Obligations__c))) Thank you.
As a foreword I would like to say that I am asking this question as part of a computer science course assignment, and any responses here might be referenced in my report. I am ideally looking for hints and tips to get me on the right track rather than straight up solutions. What I am trying to get my head around is a 2 bit magnitude comparator circuit that takes in 2 sets of inputs. For example set A would contain a0 and a1, and set B would contain b0 and b1. The only output I am interested in is A > B which means the sum of all inputs in set A is bigger than set B so a0 = 1 , a1 = 1, b0 = 1, b1 = 0 would overall output a 0 and so on. I understand how a 1 bit comparator works : this is the most basic circuit I came up with that takes in 2 inputs and gives out an output if A > B. However, I have been stuck for several hours trying to increase the number of inputs. My initial plan was to somehow reuse the 1 bit comparator and reuse it 3 times but every time I end up with something that ends up with an overly complicated version of the initial 1 bit circuit where the 3 inputs actually only give out 1 output and so in the end you are going in a circle and comparing 2 numbers rather than 4. Any advice an tips on this would be very appreciated.
I have been attempting to make a digital comparator but I am struggling to get in more than one input. The idea is that I have 2 sets of 2 numbers (4 inputs total) and I want to have the output take all 4 numbers into account rather than just 2. Here is what I roughly have so far: What I want the circuit to do is have the two inputs in the two sets treated as separately. Any ideas on how to achieve this would be very welcome.
When people used early ultrawide angle lenses that had visible distortion, did they simply accept the fact and print it too ... or were there mitigations for things like critical architecture photography? Were contraptions like non-planar paper/film holders, and/or specialized optics in the enlarger light path, used?
Were there ever any tools to correct for lens distortion in the film-only era? I'm thinking a device that contained a lens system that you could alter, or a soft workable lens that you could fine tune, to transform the distorted image back again. Or maybe even something as easy as not resting the photo paper on a flat surface during development. I haven't heard of anything like this but I'm sure that it was something photographers in certain situations wanted to do.
I just noticed that trying to visit one of the per-site metas using HTTPS will (after confirming the security exception due to the ) give a 403 error: Yes, I know that . But the per-site metas used to work over HTTPS, so this is a regression. I did some extra testing, and it appears that this error shows up only for the per-site metas with a four-part hostname of the form meta.sitename.stackexchange.com. That is, the following meta sites with custom domains work fine over HTTPS: but any other per-site metas, (like, say, ) are broken. From the error message, I suspect this regression has something to do with the use of the CloudFlare CDN. Perhaps something needs to be (re)configured in SE's CloudFlare settings to make this work again?
Clicking on doesn't connect me with the meta S.Ex.SE site. EDIT: For some entry points, . Observation courtesy Gilles. I consider it a pity that the devs have not paid attention to this issue nor have indicated that they noted the problem. While HTTPS is not yet official on this network, I refrain from using unencrypted connections. I can't participate in metas, oh well. EDIT #2 (2015-11-07) - with the switch to CloudFlare SSL the problem looks finally resolved. EDIT #3 (2015-11-17) - still getting 403 Forbidden from CloudFlare. D'rats!.. EDIT #4 (2016-01-11) - We're still there. It's 2016 already... Starting a bounty.
I’m dealing with a highly unbalanced dataset where 20% of data belongs to class A and 80% belongs to class B. It’s very hard for us to produce synthetic class A data. Just wondering if the below approach is a sensible thing to do: Total data points: 100 Class A : 20 Class B : 80 How about splitting the dataset into 4 separate samples consisting of 20 A’s and 20 B’s. In other words, I’m mixing the 20 A’s with different samples of 20 B’s. We’d have 4 models (say random forest or so) and finally the decision is taken from what the majority of these 4 models predict?
We already had multiple questions about unbalanced data when using , , , and a number of other similar questions, what makes it a very popular topic! Unfortunately, each of the questions seems to be algorithm-specific and I didn't find any general guidelines for dealing with unbalanced data. Quoting , dealing with unbalanced data (...) heavily depends on the learning method. Most general purpose approaches have one (or several) ways to deal with this. But when exactly should we worry about unbalanced data? Which algorithms are mostly affected by it and which are able to deal with it? Which algorithms would need us to balance the data? I am aware that discussing each of the algorithms would be impossible on Q&A site like this, I am rather looking for a general guidelines on when it could be a problem.
I want ubuntu 16 merged top/title and menu bar, back. what should I do?
Just moved from Unity to GNOME with the update to Ubuntu 17.10. There is a HUGE amount of wasted space at the top of the screen, when an application is open. Evolution and Firefox both have four "bars" with 90% of each empty. Unity, to its credit was able to blend / mix these horizontal bars so there was only one / two. Four is way too much. If this is GNOME I may carry on with Unity for the next six months. Can anybody suggest a tweak/change/fix for this?
After using the solution of another problem (see ), my tabularx table is too wide now. Please see the MWE and its output below. Adding \noindent before the first table doesn't help (as suggested in one of the comments ). Setting the table width to \dimexpr\linewidth-\parindent does help a bit, but still the table is slightly too wide (.92703pt). When I don't use my \task command the table is just fine. As far as I can see this issue is caused by the definition of \task. Can anyone tell me how to fix this? \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[a6paper, showframe=true]{geometry} \usepackage{etoolbox} \usepackage{booktabs} \usepackage{ltablex} \usepackage{xifthen} \def\credits{} \newcounter{subtask} \setcounter{subtask}{1} \renewcommand{\thesubtask}{\alph{subtask})} \makeatletter \newcommand{\task}[1][]{% \ifx\hfuzz\@tempdima% % % tabularx trial do nothing \else% \ifthenelse{\isempty{#1}}{% \thesubtask% \stepcounter{subtask}% }{% \thesubtask% \gappto\credits{(#1 BE)\\}% \stepcounter{subtask}% }% \fi } \makeatother \begin{document} \noindent\begin{tabularx}{\linewidth}[l]{>{\bfseries}l@{\hspace*{1ex}}X@{}} \task[1] & Some longer text that exceedes the line width. Some longer text that exceedes the line width. Some longer text that exceedes the line width.\\ \task[3] & TEXT2 \end{tabularx} \credits \begin{tabularx}{\dimexpr\linewidth-\parindent}[l]{>{\bfseries}l@{\hspace*{1ex}}X@{}} \task[1] & Some longer text that exceedes the line width. Some longer text that exceedes the line width. Some longer text that exceedes the line width.\\ \task[3] & TEXT2 \end{tabularx} \begin{tabularx}{\linewidth}[l]{>{\bfseries}l@{\hspace*{1ex}}X@{}} a) & Some longer text that exceedes the line width. Some longer text that exceedes the line width. Some longer text that exceedes the line width.\\ b) & TEXT2 \end{tabularx} \end{document}
I'm trying to print worksheets. I have already implemented an automatic numbering for subtasks. I use tabularx for my subtasks (see the MWE below). Yesterday, I tried to define a new macro called \task that has one optional argument which is the amount of points you can obtain for this particular question. I would like these optional arguments to be gathered with etoolbox's \appto command so that I can print them with my \credits command. So far, this seems to be ind of struggling as tabularx is working on the tables several times. Every time tabularx calculates the width of X columns the points are appended to \credits which leads to an incorrect list of points. Is there any way I can solve this problem? I'm currently stucked with this issue. Plus, I don't know why my \task command does work. Why is the counter subtask not affected by tabularx's several trials? \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{etoolbox} \usepackage{booktabs} \usepackage{ltablex} \usepackage{xifthen} \def\credits{} \newcounter{subtask} \setcounter{subtask}{1} \renewcommand{\thesubtask}{\alph{subtask})} \newcommand{\task}[1][]{% \ifthenelse{\isempty{#1}}{% \thesubtask% \stepcounter{subtask}% }{% \thesubtask% \gappto\credits{(#1)}% \stepcounter{subtask}% }% } \begin{document} \begin{tabularx}{\linewidth}[l]{l@{\hspace*{1ex}}X} \task[1] & TEXT1\\ \task & TEXT2\\ \task[3] & TEXT3 \end{tabularx} \credits \end{document} The solution given by David Carlisle below causes a table that is too wide. How can this be undone? \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[a6paper, showframe=true]{geometry} \usepackage{etoolbox} \usepackage{booktabs} \usepackage{ltablex} \usepackage{xifthen} \def\credits{} \newcounter{subtask} \setcounter{subtask}{1} \renewcommand{\thesubtask}{\alph{subtask})} \makeatletter \newcommand{\task}[1][]{% \ifx\hfuzz\@tempdima% % % tabularx trial do nothing \else% \ifthenelse{\isempty{#1}}{% \thesubtask% \stepcounter{subtask}% }{% \thesubtask% \gappto\credits{(#1 BE)\\}% \stepcounter{subtask}% }% \fi } \makeatother \begin{document} \begin{tabularx}{\linewidth}[l]{l@{\hspace*{1ex}}X} \task[1] & Some longer text that exceedes the line width.\\ \task[4] & TEXT2\\ \task[3] & TEXT3 \end{tabularx} \credits \end{document}
I Have the following code in Student.h #ifndef _student_h_ #define _student_h_ template <class T> class Student { public: Student(); ~Student(); void setWage(float hourlyWage); void addHours(float hoursWorked); bool pay(); bool writeCheck(float value); float getTotalEarnings(); float getStudentCut(); float getSwauCut(); float getWage(); private: float wage; float hours; float swauCut; float studentCut; float totalEarnings; }; #include "student.tpp" //Works with .tpp, errors with .cpp #endif As im trying to separate my code I attempted to place the following code into both a .cpp and a .tpp for testing. #pragma once #include "stdafx.h" #include "Student.h" template <class T> Student<T>::Student() { wage = 0.0f; hours = 0.0f; swauCut = 0.0f; studentCut = 0.0f; totalEarnings = 0.0f; } template <class T> Student<T>::~Student() { } template <class T> void Student<T>::setWage(float hourlyWage) { wage = hourlyWage; } template <class T> void Student<T>::addHours(float hoursWorked) { hours += hoursWorked; } template <class T> bool Student<T>::pay() { if (hours == 0 || wage == 0) return false; studentCut += .25*(hours * wage); swauCut += .75*(hours * wage); totalEarnings += hours * wage; hours = 0.0f; return true; } template <class T> bool Student<T>::writeCheck(float value) { if (value < studentCut){ studentCut -= value; return true; } return false; } template <class T> float Student<T>::getTotalEarnings() { return totalEarnings; } template <class T> float Student<T>::getStudentCut() { return studentCut; } template <class T> float Student<T>::getSwauCut() { return swauCut; } template <class T> float Student<T>::getWage() { return wage; } My issue is that if I use the .cpp file and comment out the tpp file I get all sorts of errors. However if I just #include Student.tpp the files compile fine and work. I was under the impression that cpp and tpp were relatively the same? The errors im getting are: Error1 error C2995: 'Student<T>::Student(void)' : function template has already been defined c:\users\aurelib.cs\desktop\studentproject\studentproject\student.cpp 13 1 StudentProject Error2 error C2995: 'Student<T>::~Student(void)' : function template has already been defined c:\users\aurelib.cs\desktop\studentproject\studentproject\student.cpp 18 1 StudentProject .... for all the functions. If I remove the #include "Student.h" from the .cpp file I get Syntax errors. I am using Visual Studios. And like I said I have no problem when I #include "Student.tpp" at the bottom of the template. But when I use the same code and #include "Student.cpp" instead. Thanks so much in advance!
Quote from : The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this? (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
What is the difference in the usage of "whom" and "who"? please also tell me the rules behind their usage and some examples to clarify their difference.
I can never figure out whether I should use who and whom. Most people use who for both colloquially, but some people say this is not correct. What’s the rule for using who and whom correctly?
How can I enter my nickname in Pokemon Go? I entered my nickname but it is telling me that it's not valid.
The app keeps asking for a nickname, and I have entered dozens of names, but it keeps saying that the names aren't available. How can I find an available name?
I've created a custom object for Leaves which allows the users under my org to apply for leaves. I've added three types of leaves such as Casual Leave, Sick Leave & Leave without Pay. I've used an Apex Trigger to check and limit the creation of only one record by one user per day but this Apex is creating a problem in org because it isn't allowing the users to apply for pre-planned leaves, i.e. if a user is applying for Sick Leave for the day he/she should also be allowed to apply for other leaves like Casual & Unpaid for different dates on the same day. Fields I've used: Start_Date__c (Date type) End_Date__c (Date type) Leave_Type__c (Picklist type) I want to use a trigger dependent on the Start_Date__c & Leave_Type__c The Apex Currently in use: trigger LeaveRecordDuplicateTrigger on New_Casual_Leave__c (before insert) { for(New_Casual_Leave__c a:Trigger.new) { string uid = userinfo.getName(); List<New_Casual_Leave__c> acc=[select Id, CreatedDate, Contact__r.Account.Name, Start_Date__c, Leave_Type__c from New_Casual_Leave__c where (Contact__r.Account.Name = :uid AND CreatedDate = TODAY) and Leave_Type__c =a.Leave_Type__c]; if(acc.size()>0) { a.adderror('One leave is already applied for the Day For ' + uid); } } } //Getting error while using the above code: Error: Compile Error: Unexpected token 'a.Leave_Type__c'. at line 5 column 229 What changes to be made to avoid errors? Where am I going wrong?
I've created a custom object for Leaves which allows the users under my org to apply for leaves. I've added three types of leaves such as Casual Leave, Sick Leave & Leave without Pay. I've used an Apex Trigger to check and limit the creation of only one record by one user per day but this Apex is creating a problem in org because it isn't allowing the users to apply for pre-planned leaves, i.e. if a user is applying for Sick Leave for the day he/she should also be allowed to apply for other leaves like Casual & Unpaid for different dates on the same day. Fields I've used: Start_Date__c (Date type) End_Date__c (Date type) Leave_Type__c (Picklist type) I want to use a trigger dependent on the Start_Date__c & Leave_Type__c The Apex Currently in use: trigger LeaveRecordDuplicateTrigger on New_Casual_Leave__c (before insert) { for(New_Casual_Leave__c a:Trigger.new) { string uid = userinfo.getName(); List<New_Casual_Leave__c> acc=[select Id, CreatedDate, Contact__r.Account.Name, Start_Date__c, Leave_Type__c from New_Casual_Leave__c where (Contact__r.Account.Name = :uid AND CreatedDate = TODAY)]; if(acc.size()>0) { a.adderror('One leave is already applied for the Day For ' + uid); } } } Please help me out with this.
Developing a plugin with Qt Designer for QGIS 2.14.1-Essen on Windows 7 and having trouble inserting the QgsCollapsibleGroupBox widget. I receive the following error: ImportError: No module named qgscollapsiblegroupbox I put from qgis.gui import QgsCollapsibleGroupBox into my main.py file but it still doesn't recognise it. Only post I found which mentioned this error is but not exactly sure how to install this qgis_customwidgets.py file. I would like this plugin to be transferred to other computers but would like to avoid having to install this file each time (if it is indeed required). Is there another way to use this type of widget or perhaps a method to save the qgis_customwidgets.py into my plugin directory and just call the module?
My works on Ubuntu (at least for me, and all fatal bugs reported so far are solved), but when I run it on QGIS installed from the official 2.10.1 64-bit installer for Windows (on Windows 7 64-bit), I can't install it due to following error: This plugin is broken No module named qgsprojectionselectionwidget Another user reported it this problem as well. but with another error message (I don't know which operation system and architecture does he have, but I'd guess Windows and 64-bit EDIT: I guessed wrong, he has Mac OS X): This plugin is broken No module named qgsmaplayercombobox Both refer to widgets in the GUI form, which I built through Qt Designer in Ubuntu. Qt Designer is packed with QGIS installer for Windows as well and claims to contain the same QGIS custom widgets, so the problem shouldn't be in those widgets missing, and QGIS should recognize them - but it doesn't. So how to fix it? My plugin is still experimental, so I can just add "sorry, doesn't work under Windows" to the metadata, but it's not a real solution. EDIT: the same behavior confirmed on 32-bit version too. Now I found a good hint in comment to : use os.path.join to make the paths cross-platform. This is easy for the few hardcoded paths I have, but the errors seems to suggest the problem is deeper, perhaps even in Qt. How can I handle this problem in my plugin without tweaking anything else?
I'm trying to follow the scripts from the book The Blender Python API by Chris Conlan, and I've been unable to import modules in Python from Blender (2.81) on osx 10.15.2. What file structure / linking is needed to import modules in Blender 2.8? The closest question I've seen here is , which seems to be close, but the single answer there doesn't work for me. (I don't currently have enough reputation to comment over on that question.) Specifically, I'm trying to run from . The problem is that I don't know how the file should be handled. Where should it be placed? Does it need to be linked into the blender file somehow? I've so far been unable to set up a minimal example to get anything to import from another module source file, either using the code from the book or with a . The source code from the book needs minimal refactoring to work with 2.8, but otherwise seems functional.
I'm currently developing a script for Blender to handle Mesh Frequency Decomposition. The script is nearly complete, but i need one more thing: The SciPy library to compute eigenvalues and eigenvectors. Following the installation instructions on , I'm able to install it as well as Numpy. Numpy works fine, but I can't even import SciPy: Traceback (most recent call last): File "/CAF_FD.py", line 4, in <module> ImportError: No module named 'scipy' Error: Python script fail, look in the console for now... By the way, I'm working on Linux 64 bit and I've installed SciPy and Numpy with my package manager. Edit: When I try to use SciPy with a terminal prompt, it works.
I have finally managed to get iReports working under Ubuntu 18.04. To start it I need to go to a command window, cd to /opt/iReports5.6.0/bin, and then type ./ireports. Why, I have no idea? If I type ireportes.exe in the bin directory it doesn't start. Regardless it took countless hours to get the correct version of java (1.7) to run instead of 1.8, which was a sticking issue. In Windows I would just create a shortcut to a batch file that would change the directory to /opt/iReports5.6.0/bin/ and then execute ./ireports. And I would then drop the shortcut onto the desktop. Is there anything analagous in Ubuntu 18 world?
In older versions it was easy to create a launcher on my desktop. All I had to do is right click on my desktop and select the "create launcher" option. How can I create such launchers now?
Pardon me if this question does not fit this site (or SE engine in general) but I do not know where to post it. Suppose that you have unknown data set which you want to explore. What functions/methods/techniques should I use to get birds eye of the data? I guess it depends on the data. I'm particularly interests in the ordered integers (but feel free to post other types also). Few examples that comes to my mind are: histograms, barplots, (moving) mean (aka average) median mode variance standard-deviation. What else? Thank you.
I've been reading Tukey's book "Exploratory Data Analysis". Being written in 1977, the book emphasizes paper/pencil methods. Is there a more 'modern' successor which takes into account that we can now instantaneosly plot large data sets?
Does there exists a function $f:\Bbb R\to \Bbb R$ such that $f(f(x))=x^2-2$ I don't know where to start?
Find all $f(x)$ satisfying $f(f(x)) = x^2 - 2$. Presumably $f(x)$ is supposed to be a function from $\mathbb R$ to $\mathbb R$ with no further restrictions (we don't assume continuity, etc), but the text of the problem does not specify further. Possibly Helpful Links: Information on similar problems can be found and . Source: It is about to be closed for containing too many problems in one question. I'm posting each problem separately.
I'd like to setup my own statistics site for my own released apps. I'm just wondering, if it's possible to have an iTunes Connect API where I can fetch all statistics from the iTunes Analytics area like downloads, crashes, paid applications, active users, in app purchases, etc. This kind of question was already asked a couple of years ago (around 2015) but without any appropriate answers. Just to be clear: I'd like to build my own dashboard and I'm not asking for an export functionality (e.g. xls, csv, etc.) or where I can find some other tools.
What I am actually looking for is to get the app download statistics from iTunes connect. Ideally a dashboard would be possible with a full API. There was this idea where some coding could be done in the iphone app section so as to determine if the app is being launched for the first time and so fire a url with the flag. Rather than intercepting or proxying the the communications from the iOS iTunes connect app, I would like to retrieve an app's download statistics from iTunes connect itself. Is there a public API or private framework to reverse engineer this?
I would like to draw the following table with itemize feature inside the cells In order to do that I thought that if I added this code it's gonna work but it doesn't \setlist[itemize]{nosep, topsep= 0pt, partopsep=0pt, leftmargin= *, label=\textendash, before=\vspace{-0.6\baselineskip}, after=\vspace{-\baselineskip} } Here is the code to draw a table that I want to add to it itemize enviroment inside his cells \begin{center} \bfseries \settowidth\rotheadsize{Title 1} \begin{tabularx}{\linewidth}{|c|>{\centering\arraybackslash}X|} %\hline %\multicolumn{3}{|>{\centering\arraybackslash}% %p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth\relax}|}{\cellcolor{gray!30} %Title 2} \\ \hline \cellcolor{gray!30} Cell 1 & \cellcolor{gray!30} Cell 2 \\ \hline \multirow[b]{3}{*}{Info 2} & very long text but centered \rule[-1em]{0pt}{2.5em} \\ \cline{2-2} & very long text but centered \rule[-1em]{0pt}{2.5em} \\ \cline{2-2} & very long text but centered \rule[-1em]{0pt}{2.5em} \\ \hline \multirow[b]{3}{*}{Info 2} & very long text but centered \rule[-1em]{0pt}{2.5em} \\ \cline{2-2} & \begin{itemize} - \item very long text \item very long text \end{itemize} \rule[-1em]{0pt}{2.5em} \\ \cline{2-2} & \rule[-1em]{0pt}{2.5em} \\ \hline \end{tabularx} \end{center}
I'm interested of th Following Question I would like to know how can I use itemize inside 'itemize' inside table I tried code of @Zarko but with no luck besides I wonder why I can't get all 4 borders around the gray title section \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[table]{xcolor} \usepackage{tabularx} \usepackage{enumitem} \begin{document} \begin{center} \setlist[itemize]{nosep, topsep= 0pt, partopsep=0pt, leftmargin= *, label=\textendash, before=\vspace{-0.6\baselineskip}, after=\vspace{-\baselineskip} } \bfseries \begin{tabularx}{\linewidth}{ | l | X | } \hline \multicolumn{2}{|>{\centering\arraybackslash}p{\dimexpr\linewidth-2\tabcolsep}|}{\cellcolor{gray!30} Very long text here and centered Very long text here and centered Very long text here and centered} \\ \hline \multicolumn{2}{c}{} \\ \hline Description & \begin{itemize} \item long text bla bla bla bla \item long text bla bla bla bla \item long text bla bla bla bla \item long text bla bla bla bla \end{itemize} \\ \hline Addition & long text bla bla bla bla long text bla bla bla bla\\ \hline \end{tabularx} \end{center} \end{document}
def worker(queue): while True: if not queue.empty(): words = 'BananA' words1 = 'nut' words2 = 'KreMA' words3 = 'KIVI' words4 = 'TesT' process(data, words, words1, words2, words3, words4) def process(data, words, words1, words2, words3, words4): if (search != words): print("Words Not Found") if (words in search or words1 in search or words2 in search or words3 in search or words4 in search): print("Words Found : " + str(Words) + "\n") file = open("finded.txt","a") file.write("Words Founds "+ str(words) file.close() but, if change the line if "banana" to "Banana" the code not work, I need Banana or BANANA or BaNaNa get equal, and get true,
How can I do case insensitive string comparison in Python? I would like to encapsulate comparison of a regular strings to a repository string using in a very simple and Pythonic way. I also would like to have ability to look up values in a dict hashed by strings using regular python strings.
So there's general relativity and Einstein's field equations that tell us "mass(or equivalently energy) warps space-time, and the warping tells mass how to move", but I'm still having trouble understanding how space (a thing I conceive to be 'empty' or nothingness) can be 'warped'. After researching books, on-line articles, and this stack exchange itself I can't seem to find any descriptions or discussions that don't immediately resort to jumping into GR and its mathematics to provide a more physical intuitive understanding of what it means to for space to be warped. Is it space, this empty thing, that's getting warped. Or rather is it some field (Higgs field?) that exists around matter that's getting warped? Although this question appears similar to , it's asking if it's empty space that's being warped by matter or rather a field in space that's being warped (the Higgs Field?). The other question and all 10 answers addressing it do not address fields vs. empty space - What's really getting warped?
I understand that people explain (in layman's terms at least) that the presence of mass "warps" space-time geometry, and this causes gravity. I have also of course heard the analogy of a blanket or trampoline bending under an object, which causes other objects to come together, but I always thought this was a hopelessly circular explanation because the blanket only bends because of "real" gravity pulling the object down and then pulling the other objects down the sloped blanket. In other words, to me, it seems that curved space wouldn't have any actual effect on objects unless there's already another force present. So how is curved space-time itself actually capable of exerting a force (without some source of a fourth-dimensional force)? I apologize for my ignorance in advance, and a purely mathematical explanation will probably go over my head, but if it's required I'll do my best to understand.
I have an Acer V17 Nitro with Windows 8. The temperatures get way too hot on this laptop, even when using very non-demanding applications. How do I lower the throttling temperature so that it begins throttling CPU down at say 80 deg C instead of 96 deg C? I don't care if performance is impacted, I don't want to burn a hole in the laptop. Thanks,
I've seen a lot of posts about disabling the throttling temperatures but none regarding setting them. I have an Acer V17 Nitro, i7 laptop and it's CPU temperature reaches 95°C before throttling. It's a very powerful laptop, crippled by a bad cooling system. I already undervolted by 70mV and disabled hyper boost. Currently, I have to go into Power Options and adjust Maximum CPU Frequency between 40% and 80% to keep the temperatures under 80°C. But this depends on the application. And I have to do this manually for each application I'm using. Ironically, some applications (especially Fortnite) will run just fine with the CPU frequency set to 30-40% with the temperatures only rising to 80°C, while others will run at the same temperatures with the maximum frequency set to 80%. It just depends on how the code was written and how many cores are being used. I know the throttling temperature is set to 95°C for the CPU, but even if it doesn't melt the CPU, it can cause a lot of other issues, like melting the case. I would prefer to lower the throttling temperature to something like 80°C. This way I don't have to adjust the maximum CPU frequency by hand every time. Is there a way to do this from the BIOS? From Windows? Via a third party app?
If not, what’s an easy way to model more intricate designs anyway, here is a crudely drawn example of what i want
I need to make a part of a texture glow slightly. Like Killer Crocs eyes (see image below) How do I do this? I added a black and white texture (white for the glow. But then this happened. There are strange colors around the eyes. Also how do I change the white glow to red?
We know, for example, the constant $\pi$ is the perimeter of a circle with diameter $1$ unit. In the similar manner how would we explain the constant $e$. I have searched a lot for it. But I couldn't comprehend it in a practical way. Can anybody help me to understand the constant $e$?
Potentially related-questions, shown before posting, didn't have anything like this, so I apologize in advance if this is a duplicate. I know there are many ways of calculating (or should I say "ending up at") the constant e. How would you explain e concisely? It's a rather beautiful number, but when friends have asked me "what is e?" I'm usually at a loss for words -- I always figured the math explains it, but I would really like to know how others conceptualize it, especially in common-language (say, "English"). related but not the same:
Yesterday I tried to update windows the thing failed repeatedly, now I can not open anything that require administrator command. I am looking at two programs installed yesterday in the "Program" section of the control panel, and I cannot uninstall them. Suspecting that these are the virus. I am literally sitting here waiting for advice. Symptoms summary: In a nutshell this is what happens: -All administrator command in opening things tells me that it can not find the file to be opened, because the path is wrong. -Can not delete using control panel, the "preparing to uninstall" is stuck forever -Can not update windows, update always fails with internet interruptions -Can not finish any anti-virus scans. Also, the virus, I believe (because it was installed yesterday) is disguised as "Microsoft Silverlight" and when I tried to uninstall it, it asked me "do you want the following program to make changes to your computer?: silverlight_base.msi"
What should I do if my Windows computer seems to be infected with a virus or malware? What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware? This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.
I've searched for an attempted fix for this problem but it seems that people haven't had this problem. When I try to compile a C program with gcc (Ubuntu 18.04, GCC 7.5.0) I get the error as said in the title but if I use g++ it works just fine. What could be the reason for this? (Also fairly new to Linux)
One of my Ubuntu 10.04 servers is giving me trouble. When I run fsck.ext4 -n /dev/sda5 it tells me there are errors in the free inode count, free block count, and more. I have tried: touch /forcefsck Also tried: shutdown -rF now and still, after reboot, I see errors. I also just checked on my eeePC netbook, Ubuntu 10.10, and have the same issue! How can I force a really "forced" "forceful" "seriously fix my filesystem" fsck of the "/" filesystem on reboot? Clarification: I run fsck.ext4 -n because it's a mounted filesystem, to check if there are errors. This tells me that there are. I thought that the automatic fsck every 30 mounts during the boot-up process is precisely to take care of errors in the root filesystem. But it doesn't do it in my case. I could reboot with a LiveCD and fix the errors, and then reboot again, but that's some serious downtime for a live server. A reboot, auto fsck, then continue booting is much more sustainable on a live server, and I believe should be the right behaviour. Additional info: Here is the output. It looks like something that the autofsck would fix, doesn't it? root@server:~# fsck.ext4 -n /dev/sda5 e2fsck 1.41.11 (14-Mar-2010) Warning! /dev/sda5 is mounted. Warning: skipping journal recovery because doing a read-only filesystem check. /dev/sda5 contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information Free blocks count wrong (1849368, counted=1948909). Fix? no Free inodes count wrong (545504, counted=552134). Fix? no /dev/sda5: ********** WARNING: Filesystem still has errors ********** /dev/sda5: 116752/662256 files (0.2% non-contiguous), 795324/2644692 blocks
Considering the movie Interstellar, I just did not understand how solving the equation saved the earth from the Blight. As I understood, the equation had to do with gravity. What was the relation of gravity with a massive infestation of a microorganism?
In Interstellar, there is a Blight destroying all the world's crops. If Plan A involves launching a space colony, presumably full of crops, etc., how could they avoid bringing the Blight with them? At the end of the film we see that they've actually created space colonies. How did they manage to launch and populate them without bringing the Blight with them?
In an application I am building, so far I have three classes for the user interface. I have a FrameGUI class which extends JFrame and acts as a container for two other classes I have created: StartScreenGUI and MainGameGUI - both of which extend JPanel and hold different buttons depending on the job of the interface. FrameGUI (very simplified version): class FrameGUI extends JFrame { private Container contentPane; private StartScreenGUI screenFirst; private MainGameGUI gameScreen; public FrameGUI() { gameScreen = new MainGameGUI(); screenFirst = new StartScreenGUI(); contentPane.add(screenFirst); } public void swapScreen(MainGameGUI gameScreen) { contentPane.remove(screenFirst); contentPane.add(gameScreen); } } The problem is, in the StartScreenGUI class there is a button Continue that when clicked I want to call the swapScreen method so the user can progress to the next screen. However it cannot access the method as it isn't "aware" of the instance of the FrameGUI class defined in the main method. Is there a way around this or an entirely different approach I could take that is much better? If possible I would like to avoid having multiple frames and just closing the top most frame when it is finished with.
To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action. So, what's the correct way of doing such a thing? I've tried panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack(); but this won't work. What would you suggest?
I have two columns in my table, and I am trying to update the second column with the result of first col like this. SET @pg = (SELECT ID FROM wp_posts WHERE post_name = 'y' AND post_status = 'x' LIMIT 1) Now the above query works the (SELECT ...) as in it returns an ID from the query, so I am trying to use that ID to update another column like this. UPDATE wp_posts SET post_type = 'foo' WHERE ID = @pg; But for some reason the above does not work. and I get the following error. 1 queries executed, 0 success, 1 errors, 0 warnings Query: set @pg = (SELECT ID FROM wp_posts WHERE post_name = 'y' AND post_status = 'x' LIMIT 1) SELECT * ... Error Code: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT * FROM wp_posts WHERE id = @pg' at line 3 Execution Time : 0 sec Transfer Time : 0 sec Total Time : 0 sec EDIT/UPDATE: I am also trying to execute this staetment, which is simpler and does the same thing UPDATE wp_posts SET post_type = 'x' WHERE ID = (SELECT ID FROM wp_posts WHERE post_name = 'y' AND post_status = 'z' LIMIT 1) but for some reason, it doesn't work.
I have a table story_category in my database with corrupt entries. The next query returns the corrupt entries: SELECT * FROM story_category WHERE category_id NOT IN ( SELECT DISTINCT category.id FROM category INNER JOIN story_category ON category_id=category.id); I tried to delete them executing: DELETE FROM story_category WHERE category_id NOT IN ( SELECT DISTINCT category.id FROM category INNER JOIN story_category ON category_id=category.id); But I get the next error: #1093 - You can't specify target table 'story_category' for update in FROM clause How can I overcome this?
I have had a single Ubuntu virtual machine that I have upgrade over the years. It literally has nothing on it except a couple files. I recently decide to upgrade it from I believe 13.04 but I could be mistaken. A picture is worth a thousand words. How do I reinstall launchpad ( is that what its called ) so regain some sort of control over my virtual machine? I was forced to uninstall Nvidia's drivers because it was booting and my mouse was a X icon. Before I "installed" 13.10 the virtual machine was working. I have pressed the "Windows Key" and it does nothing. The host machine is Windows x64. The virtual machine itself is a VMWare virtual machine. If somebody has a better name for the title of this question I am open to suggestions. Update: In an attempt to "reset" Unity I was able to determine that compiz ( no idea what this is ) was unable to find the opengl plugin
When I login, nothing happens. I am presented with my desktop wallpaper. No Dash, no Launcher, nothing.
I am in the process of programming a simple program that deals with object recognition. What causes problem is that I am considering and making a gui, but the problem here is that it won't let me call a method. I've looked around the site, but got no luck. Tried different suggestions from others, still nothing. I just don't know how I should call a method with different parameters. Here's what I've tried.. public class Main { private static ImageProcessor ip; public static void main(String[] args) { Main_ m = new Main_(); m.main(ip); } } Here's the desired method that I am trying to call.. public class Main_ implements PlugInFilter{ ...... public static String launch(ImageProcessor ip){ ip = FiltreGaussien_.apply(ip, 3); ImageProcessor result = Otsu_.apply(ip); Canny_ cannyFilter = new Canny_(result); result = cannyFilter.apply(5); Hough_ houghFilter = new Hough_(result); List<Line> lines = houghFilter.apply(); try{ Card card = new Card(lines); ip = card.extractCorner(ip); ImagePlus imp = new ImagePlus("...", ip); new ImageWindow(imp); } catch(RuntimeException e){ } ip = Otsu_.apply(ip); TemplateMatching_ matcher = new TemplateMatching_(); return matcher.launch(ip); } } And my console gives me this.. Exception in thread "main" java.lang.NullPointerException at ij.process.ByteProcessor.<init>(ByteProcessor.java:96) at main.mean.FiltreGaussien_.apply(FiltreGaussien_.java:69) at main.card_detection.Main_.launch(Main_.java:30) at main.card_detection.Main_.main(Main_.java:22) at main.Main.main(Main.java:11) Process finished with exit code 1 What am I doing wrong?
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?
Find the last two digits of $3^{3^{2014}}$. Attempt: First I try to work with $3^{2014}$. So we can work on $\text{mod 10}$. Then, $$\begin{align}&3^1 \equiv 3\pmod{10}\\ &3^2 \equiv 9 \pmod{10}\\ &3^3 \equiv 27 \equiv 7\pmod{10}\\ &3^4 \equiv 81 \equiv 1\pmod{10}\end{align}$$ So $3^{2014} = 3^{(4\cdot503) + 2} \equiv 3^0 \cdot 3^2 \equiv 9 \pmod{10}$. So the last digit is 9. However I am ask to find the last two digit. Can anyone please help me? I would really appreciate all the help.
Can anyone please help me? 1) Find the last digit of $7^{12345}$ 2) Find the last 2 digits of $3^{3^{2014}}$. Attempt: 1) By just setting the powers of $7$ we have $7^1 = 7$, $7^2=49$, $7^3=343$, $7^4 = 2401$, $7^5 = 16807$, $7^6 = 117649$, $\dots$ After the power of $4$, the last digits will repeat. Then by noticing the pattern the digits will end in $7,9,3$ and $1$. Then we can divide the exponent $(12345)$ by $4$ since this is the cycle that makes it repeat. Then $12345 : 4$ has remainder $1$. So $7^1 = 7$ is the unit digit to $7^{12345}$. So the last digit is $7$. I know how to do it like this, the problem does not state how to find the last digit, but I know it has something do do with Euler's theorem. for part $2$) I don't know how to start. Can anyone please help me? Thank you for the help.
I have a folder on my desktop called con. 15/02/2016 11:29 <DIR> con I cannot open it I have tried the following run cmd as administrator kill explorer.exe rmdir con C:\Users\sean\Desktop>rmdir con /s con, Are you sure (Y/N)? Y Access is denied. Set the security settings The only option remaining that I have seen is to use a gparted on a linux distribution. However, there must be a way to do it in windows? Does anyone know why this is happening and how to delete an unopenable and undeletable folder in Winodws 10?
I have a movie named Con Man. Apparently, in Windows, you cannot have a file name with the name CON in it. Can anyone please help me delete it? It is stored in F:\Movies\Con Man The name of the file that I want to delete is Con.Man.2018.720p.WEBRip.x264-[YTS.AM] I know there are a lot of similar issues but I am not able to apply them that is why posting here. Thankyou PS :: I am a noob! Edit: Found this on the internet but cant work it out
W: Failed to fetch http://ppa.launchpad.net/docky-core/stable/ubuntu/dists/raring/main/source/Sources 404 Not Found W: Failed to fetch http://ppa.launchpad.net/docky-core/stable/ubuntu/dists/raring/main/binary-i386/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.
PPA seems to be constantly offline. Whenever I use sudo apt-get update, this error is shown: W: Failed to fetch http://ppa.launchpad.net/ 404 Not Found How do I fix these errors?
Can you give an example of a field of characteristic zero (other than the complex numbers, real numbers and rational numbers)?
I was preparing for an area exam in analysis and came across a problem in the book Real Analysis by Haaser & Sullivan. From p.34 Q 2.4.3, If the field F is isomorphic to the subset S' of F', show that S' is a subfield of F'. I would appreciate any hints on how to solve this problem as I'm stuck, but that's not my actual question. I understand that for finite fields this implies that two sets of the same cardinality must have the same field structure, if any exists. The classification of finite fields answers the above question in a constructive manner. What got me curious is the infinite case. Even in the finite case it's surprising to me that the field axioms are so "restrictive", in a sense, that alternate field structures are simply not possible on sets of equal cardinality. I then started looking for examples of fields with characteristic zero while thinking about this problem. I didn't find many. So far, I listed the rationals, algebraic numbers, real numbers, complex numbers and the p-adic fields. What are other examples? Is there an analogous classification for fields of characteristic zero?
I am a US asylee, and I have green card and USA travel document. I want to travel to UAE , and since UAE doesn't accept travel document can I use my national passport?
I am an asylee in the United States. I have a Green Card, and my primary passport which was issued by my country of origin. I am not allowed to go back to my home city and then return to the United States. But, due to an emergency, I have to go there. So, I decided to use a third country to go to from the US, stay there for a while, and then go to my home city then. Can I use the re-entry permit that gets stamped while departing the US, have my passport stamped in the third country instead of the re-entry permit? I would enter my home country with the passport, and return to the US by the same route, only by showing my re-entry permit and not the passport as if I have never been to my home country?
According to "on hold" questions will not accept answers. But was placed on hold at: 2013-07-05 07:58:51Z but accepted a new answer at: 2013-07-05 08:09:38Z Is this expected behavior? Note, for clarity, that the above meta question/answer reference also states "on hold" questions will behave identically to closed questions. From what I can tell, closed questions cannot have new answers posted to them after they are closed. (I'm trying to avoid the use of the word "accept" here because I think it is an overloaded term.) However the example SO question I linked allowed a new answer to be posted to the question after it was closed (more than 10 minutes after it was closed, from what I can tell.)
Question: Answer: The question was closed at 11:57:57 (according to the hover-over-"x-mins-ago" bar) and the answer was posted at 12:16:35. It's a fairly lengthy answer, so it's possible that it was started to be written before it was closed but I swear I've started to answer a question then I got a banner along the top saying "this question has been closed" and the answer was no longer post-able.
I'd like to prove that the hyperbolic plane is complete in a short, nice way. Here's my proof, but I'm not convinced of its correctness yet. Let $\mathbb{H}=\left\{(x,y)\in\mathbb{R}^2\big\vert y>0\right\}$. Since this is a connected, Riemannian manifold with infinitesimal metric $dh^2=ds^2/y^2)$ (where $ds$ is the usual Euclidean metric) we can use the Hopf-Rinow theorem and say that completeness is equivalent to having geodesics defined from the whole real line. Hence, it suffices to show that every point $p\in\mathbb{H}$ is at infinite distance from the boundary. Take $q\in\partial\mathbb{H}$. By moving the points via isometries, we can assume that $p$ lies in the positive, pure imaginary, open semi-line and have coordinates $p=(0,\bar{y})$ and that $q$ is the point $\infty$. Then we may finish the proof just computing the integral $$\int_{\bar{y}}^\infty \sqrt{\frac{dy^2}{y^2}}=log(|y|)\Big\vert_{\bar{y}}^\infty=\infty.$$ Is there any wrong step? Do you know any other concise proof of the completeness of the hyperbolic plane?
Consider the upper half plane model of the hyperbolic space ($\mathbb{H}$ with the riemannian metric $g=\frac{dx^2+dy^2}{y^2}$). It is known that $(\mathbb{H},g)$ is geodesically complete, which means that no geodesic can reach the border $\partial \mathbb{H}$ in a finite time. Why is that? Of course if I consider particular geodesics such as $t\mapsto (0,e^{-t})$ this is true, but I can't figure out a general proof for this fact which doesn't rely on the particular form of the geodesic considered. My intuition is that it must depend on the fact that, as a geodesic approaches the border, the denominator of $g$ goes to $0$. Can you point me out an explanatory proof which shows that the length of a hyperbolic geodesic which goes to the border can't be finite? EDIT: Thank you so much for the answers, I realized I didn't make myself clear. What I mean is: is there a way to prove directly for any hyperbolic geodesic (using the fact that $g$ has $y^2$ at the denominator) that its length is infinite?
I have a line of code that is supposed to act as a check for if the user inputs a value that isn't within my array. I made an array with all valid inputs and then made and if statement that checks this. var productCode = ["LT","ST","DC","LC","PR","SP"]; var productChosen = prompt("Choose a product code, LT, ST, DC, LC, PR, or SP"); if ( productChosen === productCode) { etc.. } else { alert("Please input a valid product code"); } It always goes to the else statement.
What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: function contains(a, obj) { for (var i = 0; i < a.length; i++) { if (a[i] === obj) { return true; } } return false; } Is there a better and more concise way to accomplish this?
Is it true that $ \displaystyle \int_{10}^\infty \cfrac{e^x}{x^{1 + \frac{1}{x}} (e^x -1)}dx$ diverge since $ \displaystyle \int_{10}^\infty \cfrac{e^x}{x^{1 + \frac{1}{x}} (e^x -1)}dx > \displaystyle \int_{10}^\infty \cfrac{e^x}{x^{1 + \frac{1}{x}}e^x }dx=\displaystyle \int_{10}^\infty \cfrac{1}{x^{1 + \frac{1}{x}} }dx$ and $\displaystyle \int_{10}^\infty \cfrac{1}{x^{1 + \frac{1}{x}} }dx$ diverges by $p$-test?
I want to calculate $ \displaystyle \int_{10}^\infty \cfrac{e^x}{x^{1 + \frac{1}{x}} (e^x -1)}dx = \lim_{R \to \infty}\int_{10}^R \cfrac{e^x}{x^{1 + \frac{1}{x}} (e^x -1)} \, dx $. I think that it will diverge by bounding it below with $\frac{1}{x}$. So how do we calculate this integral?
In the story of Star Wars there have been instances where the specific Sith female was considered a "Sith Witch." However there have also been instances where the Sith female was just a Sith. Now my question is... is "Sith Witch" an actual title bestowed upon certain Sith females that have completed some achievement, or is "Sith Witch" a general term for all Sith females? Also any other terms and info about the title would be most helpful.
Would a female Jedi be referred to as Jedi Mistress instead of Jedi Master? Likewise would a Sith female be referred to as a Sith Lady instead of a Sith Lord?
When mounting a partition into my CWD (mount /path/do/devxy $(pwd)), the current shell session does not recognize it, e.g. find does not show any contents of the partition and umount $(pwd) succeeds despite me being in the directory (keeping it busy). Only after explicitly entering into the directory via cd . I can browse the files and unmounting fails. So obviously the information on the changes in my CWD is not passed on. This behaviour is very different from e.g. entering a directory in one session and creating a file into that directory from another one. In this case find's results are up to date. So how does the shell determine where it is and why is the mounting not visible immediately? Using GNU bash, version 5.0.3(1) on debian 10. Considered solved: please check comments.
Say I log into a shell on a unix system and begin tapping away commands. I initially begin in my user's home directory ~. I might from there cd down to the directory Documents. The command to change working directory here is very simple intuitively to understand: the parent node has a list of child nodes that it can access, and presumably it uses an (optimised) variant of a search to locate the existence of a child node with the name the user entered, and the working directory is then "altered" to match this — correct me if I'm wrong there. It may even be simpler that the shell simply "naively" tries to attempt to access the directory exactly as per the user's wishes and when the file system returns some type of error, the shell displays a response accordingly. What I am interested in however, is how the same process works when I navigate up a directory, i.e. to a parent, or a parent's parent. Given my unknown, presumably "blind" location of Documents, one of possibly many directories in the entire file system tree with that name, how does Unix determine where I should be placed next? Does it make a reference to pwd and examine that? If yes, how does pwd track the current navigational state?
How would you do an Epsilon-Delta proof for this theorem? IF $\lim \limits_{x \to a^+}$ $f(x)$ = $\lim \limits_{x \to a^-}$ $f(x) = L$ THEN $\lim \limits_{x \to a}$ $f(x)$ = L
My teacher proposed this question as a challenge proof to do on our own and I can't seem to get it. Was Wondering if anyone could give me a hint or help me on the process to completing it. Let $a \in \mathbb{R}$. Let $f$ be a function defined, at least, on an interval centred at $a$, except possibly at $a$. Let $L \in \mathbb{R}$. If $\lim\limits_{ x→a-} f(x) = \lim\limits_{ x→a+} f(x) = L$ then $\lim\limits_{ x→a} f(x) $ = $L$. We are supposed to prove this using the "delta-epsilon" proof style. Thanks in advance!!
I learned about Titanium Backup but I don't have a rooted device yet. I'd still like to backup all my installed apps and their settings - will the default Google backup: What does this backup exactly? Sorry if this has been answered before but I really couldn't find it on quick search. So maybe it won't hurt to have my post here. I see that my best option is adb () though... but I still don't know what the default Google backup does then... and why it's not enough...
Does anyone know what exactly does Google backup (and restore) when you enable that option? Also, are we able to see this list somewhere? (Maybe hidden n-levels deep in Google Account information?) Reason I ask is I've had the unfortunate experience of my SD Card dying on me, put in a temporary SD Card and allowed Google to do the auto-restore. Some things that were restored: Saved wireless networks Background Some apps - strangely enough only a subset of my apps were restored (some with data, some without). All previous apps were installed via Android Market. Then finally got my new SD Card, put that in and the following were restored Saved wireless networks Some apps - again, same problem... only a subset (different subset, even fewer apps). This time no data seemed to have been restored either. I think it would be very helpful to be able to view/manage a list of what is backed up, and thus would be restored (but I have yet to find this list... if it even exists).
The user starts an action, and, afterwards, the system determines that some special condition is present which warrants further confirmation from the user: – Wireframes created with In the example above, "No" would do exactly the same as "Cancel". Should the "Cancel" button still be present? My reason not to include it: It would be redundant and users would wonder about the difference between "No" and "Cancel". My reason to include it: It allows an "easy way out" for the user: "I don't want to read, think about, and understand the evil scary message box; please just pretend I didn't start the action at all." Note: I do appreciate alternative suggestions (such as a completely different message box design), but I would also appreciate feedback on which one of those two options is preferred (for example, in situations where the UI library offers limited options).
I remember once reading an article that said whenever you present a messagebox with a Yes/No choice, you should always also provide a Cancel button, even if it does the same as No. The rationale was that if the users know that Cancel is always the "safe" button to click if they don't understand why the message box was displayed, or are confused by the question. – Wireframes created with I've followed this advice for years (even though I can no longer remember where I originally heard it), but a number of people have complained about it, saying that they would prefer a simple Yes/No. So now I am wondering whether it is (or ever was) in fact best practice. If a message box presents a Yes/No choice, should it also offer Cancel (in the case where Cancel and No have the same effect)?
I'm trying to learn python and I've tried really hard but for some reason I can't figure this out. This is the module, named user_profile, where the function that I want to import comes from: def build_profile(first, last, **user_info): profile = {} profile['first name'] = first profile['last name'] = last for key, value in user_info.items(): profile[key] = value return profile user_profile = build_profile('john', 'smith', city = 'new york', occupation = 'banker', girlfriend = 'janice') for key, value in user_profile.items(): print(key.title() + ": " + value.title()) Now I want to import build_profile into another module like so: from user_profile import build_profile I just want build_profile to be imported, but for some reason it runs user_profile entirely. What's going on?
Given the following code, what does the if __name__ == "__main__": do? # Threading example import time, thread def myfunction(string, sleeptime, lock, *args): while True: lock.acquire() time.sleep(sleeptime) lock.release() time.sleep(sleeptime) if __name__ == "__main__": lock = thread.allocate_lock() thread.start_new_thread(myfunction, ("Thread #: 1", 2, lock)) thread.start_new_thread(myfunction, ("Thread #: 2", 2, lock))
A warning: This is feedback. My question is mostly rhetorical. I would like to state that I feel insulted and demeaned when another user edits my lovingly-crafted question or answer, removing elements of tone they judge to be superfluous. (Such as politeness, courtesy, or words intended to make new users feel welcome to the community.) I can understand why we might want to give ourselves the ability to remove bad advice, spelling and grammar errors, or content intended to abuse others. But when another user feels it is their duty to make a value judgement about my tone - removing anything welcoming or conversational about it - five seconds after I post an answer... then what kind of a world have we created for ourselves? Is this what we want? To encourage our users not to contribute to these communities, but to attack the contributions of others?
I edit a lot of posts every day. I often run across posts with 'Hi' and 'Thanks' on the top and the bottom of the post respectively. I also run across things like: --User Should these items be removed during the editing of the post by an editor?
I had a requirement in one of my codes to access values from a list of dictionaries that I initialized with default values. My object looked like this: >>> lengths = [{"max_len":0,"eq_len":True}] * 7 >>> print(lengths) [{'max_len': 0, 'eq_len': True}, {'max_len': 0, 'eq_len': True}, {'max_len': 0, 'eq_len': True}, {'max_len': 0, 'eq_len': True}, {'max_len': 0, 'eq_len': True}, {'max_len': 0, 'eq_len': True}, {'max_len': 0, 'eq_len': True}] Surprisingly, when I'm trying to update any one of the values in this lengths object directly, all the other objects are also getting updated. For ex: >>> col_lengths[0]["max_len"] = 10 >>> print(col_lengths) [{'max_len': 10, 'eq_len': True}, {'max_len': 10, 'eq_len': True}, {'max_len': 10, 'eq_len': True}, {'max_len': 10, 'eq_len': True}, {'max_len': 10, 'eq_len': True}, {'max_len': 10, 'eq_len': True}, {'max_len': 10, 'eq_len': True}] >>> col_lengths[4]["eq_len"] = False >>> print(col_lengths) [{'max_len': 10, 'eq_len': False}, {'max_len': 10, 'eq_len': False}, {'max_len': 10, 'eq_len': False}, {'max_len': 10, 'eq_len': False}, {'max_len': 10, 'eq_len': False}, {'max_len': 10, 'eq_len': False}, {'max_len': 10, 'eq_len': False}] Looks like this behavior is unexpected. Or am I doing something wrong? Can someone please help me with this?
I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?
While installing Ubuntu 14.04 on a machine with windows 8.1 already installed I lost my D and E drives with the important personal Data. Is there any way that I can recover my data now that Ubuntu is running in my machine?
I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions (C:) Vista (D:) Entertainment (E:) Work (F:) Sources and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB. I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse? I need these data badly as I don't have a backup for them.
I ran a chmod 777 command on my instance and after that I closed my terminal. Since then I haven't been able to connect putty or WinScp. What could be the problem and how can I fix it?
I accidently ran sudo chmod 755 -R / instead of sudo chmod 755 -R ./ I stopped it after few seconds, but now there is some problems such as sudo: must be setuid root How can I revert permissions back?
Let $\{T_\alpha\}$ be a family of topologies on $X$. Show that there is a unique smallest topology on $X$ containing all the collections $T_\alpha$, and a unique largest topology contained in all $T_\alpha$. We can check that $\bigcap T_\alpha$ is a topology on $X$, so it is the unique largest topology contained in all $T_\alpha$. Now, a topology containing all $T_\alpha$ must contain $\bigcup T_\alpha$. It must also contain arbitrary unions and finite intersections of sets in $\bigcup T_\alpha$. Since the union of the sets in $T_\alpha$ is $X$, this is the topology generated by the subbasis $\bigcup T_\alpha$. How can we prove that it is the unique smallest one containing all the collections $T_\alpha$?
I'm doing this exercise: Let $\{T_\alpha\}$ be a family of topologies on $X$. Show that there is a unique smallest topology on $X$ containing all the collections $T_\alpha$, and a unique largest topology contained in all $T_\alpha$. I have proved everything except the unique part.. I just can't get my head around what is meant with unique here. Which may sounds silly. I have proved that the intersection is a topology. And if you are a topology that is also contained in every $T_\alpha$, than you surely are contained in the intersection, so you are not larger. But I don't see from what it follows that this intersection is the unique largest topology contained in all $T_\alpha$. One part of my head say it is trivial, the other part gets confused. Like it is redundant to talk about unique in this context. The same for proving the uniqueness of the smallest topology. Edit Should I read topology $A$ larger than topology $B$ as, $A$ has more elements than $B$ ? I thought that, because the author uses the word finer for $A \supset B$.
Ive got an error on a windows 10 HP laptop with the OS and i need to do a clean install of the W10. Ive never done a windows clean install (done plenty of Mac ones) so im trying to figure out everything i need in advance. So far my plan is to : backup all data download W10 from microsoft , install it onto a USB drive, boot into the drive and run the installer Once the clean install of W10 is complete as i understand i need to install drivers for various bits of hardware, for this HP have a driver page for my laptop . Where i currently cant make my mind up is wether i should download the individual drivers from that page and install them (the issue with this is im a bit confused on some of them as there seem to be 2 bluetooth drivers, and other options on a couple of other drivers, due to what hardware the specific laptop has). I was also told to check out the HP Setup Assistant software which apperently functions like a driver install wizard, by scanning your hardware and then downloading the required drivers. What is preferable to download the individual drivers or the use the HP setup assistant ? Is there also a test / tool i can run at the end of the processes after the new OS and drivers have been installed, to check nothing is missing ? Will i need to enable security features etc, or does a clean copy of W10 default to a locked down mode ?
I want to reinstall Windows on a machine which has some very obscure drivers. I don't much fancy having to hunt round for them (that's if I'm able to locate them at all). Is it possible to save or backup already installed drivers? If so, how do I do this? How do I then go about installing these 'saved' drivers?
Currently, I'm studying a little about geometry and I was trying to find out some good book about it on internet, however I didn't find anything that I thought nice to me or what I really expected to which would be nice. What I'm looking for is a book with good proofs, in which show strategies to you reach the solution. and interesting exercises. For instance : , , ... Something about mostly elementary geometry, proprieties of triangles, parallels lines, circles, triangle inscribed in a circle, so on.
I consider myself relatively good at math, though I don't know it at a high level (yet). One of my problems is that I'm not very comfortable with geometry, unlike algebra, or to restate, I'm much more comfortable with algebra than geometry. I think that's mainly because my geometry education was sparse through the years, lacking in consistency etc. So I'd like to revise (and learn more) all at once, catching the basic axioms, understanding why such is such, etc. Essentially, a moderately rigorous textbook in plain Euclidean geometry (nothing fancy). Please don't say "The Elements" - I have browsed it at the bookstore, it is quite good, but not really what I'm looking for right now.
I want to launch an EC2 instance on AWS. I want to install Ubuntu Xenial distribution. How do I know which one of these is Xenial? I see a lot of options like: Ubuntu Server 18.04 LTS (HVM), SSD Volume Type - ami-0b76c3b150c6b1423 Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-001dae151248753a2 Deep Learning AMI (Ubuntu) Version 23.0 - ami-0726ab58f406b644f Deep Learning Base AMI (Ubuntu) Version 18.0 - ami-00c2ec90e50ed2f33 Ubuntu Server 16.04 LTS (HVM) with SQL Server 2017 Standard - ami-f13ff693 Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-0d21bd76bdbb39f53 Update The reason I want Xenial is that Galera cluster is already built for xenial:
Is there a list of Ubuntu versions with default corresponding Linux kernel versions somewhere? I would specifically like to know the most recent version of Ubuntu that still used Linux Kernel 2.x.
Here is my code: public class MyClass<A, B> { ArrayList<A> arrayA; ArrayList<B[]> arrayB; ...// other methods public void put(A a, B b) { //in case 'a' does not exist in arrayA, I want to create new array in arrayB (generic array) B[] temp = new B[](); //add some item here arrayB.add(temp) } } This doesn't work and I don't know why. Initialization of new array B[] gives compile error. What's the way I could fix this? Or how could I go around this?
Due to the implementation of Java generics, you can't have code like this: public class GenSet<E> { private E a[]; public GenSet() { a = new E[INITIAL_ARRAY_LENGTH]; // error: generic array creation } } How can I implement this while maintaining type safety? I saw a solution on the Java forums that goes like this: import java.lang.reflect.Array; class Stack<T> { public Stack(Class<T> clazz, int capacity) { array = (T[])Array.newInstance(clazz, capacity); } private final T[] array; } But I really don't get what's going on.
How can I use the output of one command - line-by-line - into another command? I know how to do this with the | pipe symbol, but this uses the entire output in one command. I would like to go line by line... I think I need to combine the | and xargs but not sure. redis-cli keys \* | redis-cli get [key would go here]
Say I have this file: hello world hello world This program #!/bin/bash for i in $(cat $1); do echo "tester: $i" done outputs tester: hello tester: world tester: hello tester: world I'd like to have the for iterate over each line individually ignoring whitespaces though, i.e. the last two lines should be replaced by tester: hello world Using quotes for i in "$(cat $1)"; results in i being assigned the whole file at once. What should I change?
Let $A$ be the set of subsets of $[n]$ that have even size, and let $B$ be the set of subsets of $[n]$ that have odd size. Establish a bijection from $A$ to $B$. The following bijection is suggested for $n=3$: $$\matrix{A: & \{1,2\} & \{1,3\} & \{2,3\} & \varnothing\\ B: & \{1,2,3\} & \{1\} & \{2\} & \{3\}}$$ I know that first we have to establish a function that is both surjective and injective so that it is bijective. I don't know where to take a step from here in the right direction. So I need a bit of guidance. Something suggested is let f be the piecewise function: $$f(x) = x \setminus \{n\}\text{ if }n \in x\text{ and }f(x) = x\cup\{n\}\text{ if }n \notin x$$
Let $A$ be a non-empty set and $n$ be the number of elements in $A$, i.e. $n:=|A|$. I know that the number of elements of the power set of $A$ is $2^n$, i.e. $|\mathcal{P}(A)|=2^n$. I came across the fact that exactly half of the elements of $\mathcal{P}(A)$ contain an odd number of elements, and half of them an even number of elements. Can someone prove this? Or hint at a proof?
i want to swap the values of 'a' and 'b' and to return their values. I tried void type but it didnt swap the values. Now im trying this but eclipse saying that i didnt use 'return'. public class swap { public static int swap(int a, int b) { int temp = a; a = b; b = temp; int[] array = { a, b }; for (int i = 0; i < array.length; i++) { return array[i]; } } public static void main(String[] args) { System.out.println(swap(10, 5)); } }
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?
Bought chicken breast on Sunday and put in marinade. It is now Thursday. Chicken has turned a bit white . . . is it safe to cook and eat at 5 days in marinade?
How do I know if a given food or ingredient I have is still good, or if I should discard it? How can I best preserve a food or ingredient? This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.
Related: In the question linked to above, Affable Geek asked : Why was this changed and was it intentional. I don't know if what I'm asking here is implied on those questions, but just to be sure, I'd like to officially put in a feature request to have this ability restored. I spend most of my time on various S.E. sites reviewing instead of asking and answering. I'm not sure what was behind the decision to remove this functionality, but as someone who spends most of my time trying to help new users, offer constructive guidance, and , the inability to leave comments seems extremely counter-productive. For new users, the most helpful thing we can do to help them improve their posts is to provide polite, helpful, constructive comments in the spirit of the . (Which, IMO is or should be an endless summer...) The inability do do this gains us nothing, and severely hampers our ability to help. This new restriction also seems a bit odd to me in light of all the Meta posts asking about how we can encourage (or force)people to comment when down-voting. I realize it's a bad idea to force people to comment when down-voting, and I wouldn't suggest that, but the point is, all of these people recognize that simply voting down a question without leaving a constructive comment does absolutely nothing to help the person whose post is being down-voted. I may be wrong, but I thought that the purpose for having the community moderate is to Help your fellow members learn to use the site and raise the quality of Q&A by: Evaluating new posts Voting to close or reopen questions Reviewing suggested edits It's awful hard to be helpful when you have to . I ask the StackExchange team to please consider restoring our ability to comment while reviewing.
Today, on C.SE, I reviewed some 'Late Answers' and First Posts. I was not even near my daily vote limit. And yet, I was given a message that said comments disabled on deleted / locked posts / reviews It seems I was not the only one either: The workaround, of course, was simply to go back and provide the guidance - but was this a design or a bug? If it is design, why would you want to discourage the feedback? Especially with first posts, there is often a high percentage of 'didn't read the FAQ' usage, which can best be addressed by gently providing guidance. (e.g. "Unfortunately, this doesn't answer the question" or "This reads like a comment" or "This really isn't on-topic here - can I suggest you checkout our [faq]" etc...) Timely first post guidance goes a long way towards making good users. If it was a bug, was other functionality silently rolled out?
I know it's a stupid question and I really am quite the amateur when it comes to cooking, but this problem occurred rather very frequently to me. The egg moves in the boiling water and often it hits the wall of the pot and cracks, making a mess. No matter how little water I use, I can't avoid it. Any way out?
Sometimes when I cook hard boiled eggs they will crack in the saucepan, and some of the egg will seep out into the water. Am I boiling the water too vigorously, or can I add something to the water to prevent it?
After my MBP has been asleep (lid closed), when woken, it seems to reconnect to wifi for a few seconds (30 or so) and then becomes unresponsive. All indications are that everything is OK, but web browsing etc fails. By "switching wifi on and off" on the task bar, it then works fine until the next time it's woken from sleep. I have changed wifi router, and this issue has been evident for a year or so (so was on Mavericks and is now on Yosemite). It has the latest released version of Yosemite (10.10.3)
I have a Mid-2011 13" Macbook Air running OS X 10.9.2 (the latest version). When I wake my Mac from sleep, sometimes, the Wifi will fail to find my network. The network icon will display the connecting symbol. The only way to stop that is to turn off wifi and turn it back on, where it will reconnect almost instantly. A video I made showing my problem:
If $M$ is finitely generated left module over a left noetherian ring $R$, then $M$ is a noetherian module. I need to show that an arbitrary ascending chain of submodules of $M$ must satisfy ACC, or equivalently, every submodule of $M$ is finitely generated. Since $R$ is a left noetherian ring, every left ideal in $R$ is finitely generated. I am trying to find a 1-1 correspondence between left ideals of $R$ and submodules of $M$. Is it a correct way, or how can I show the assertion by a different way? Thanks.
I'm trying to prove that if the ring $R$ is Noetherian then every finitely generated $R$-module is Noetherian. First of all, it is known that every module is a homomorphic image of a free module, so we can take $R$ as a module over itself, and then we will have a homomorphism $f:R \rightarrow M$, where $M$ is some arbitrary module. Next, according to the well-known theorem, $$\operatorname{Im}(f) \cong \frac{R}{\ker(f)},$$ and $\frac{R}{\ker(f)}$ is Noetherian because $R$ is Noetherian (we can take finite set of generators for some submodule in $R$ and then its canonical image in $\frac{R}{\ker(f)}$ generates submodule there). Thus, $\operatorname{Im}(f)$ is Noetherian as well, but $\operatorname{Im}(f) \subseteq M$. How then one could say the same about the whole module $M$?
So I notice that some questions simply go unanswered. Due to the volume of questions asked, sometimes these questions go away from the front page fairly quickly, and then they are never seen or heard from again. If such an event occurs, can one re-ask the question?
Suppose you had a question, and you really want a good answer that would solve your problem, but noticed it was already asked by someone else. However, no one has posted any answers. The question is technically considered "unanswered", but a lot of users who would otherwise bother to give a correct answer probably skip the question completely for some reason. What should I do in this case? One idea is to ask a new, completely identical question, in the hope users will notice the new question and post an answer there. But would that go against SE policy? Note: This is adapted from , but that doesn't cover the case where the original question is unanswered. Also, it is not a duplicate of , as that question asks about getting attention for one's own questions, while this one and the one linked above ask about getting an answer if someone else has already posted the same thing.
This question is not a duplicated of . It is a follow-on, asking about the distinction between the subject of that post, and the subject of this post. In The Number System by Thurston the author introduces an algebraic structure he calls a . The laws of a hemigroup are: (i) $\left(x\odot y\right)\odot z=x\odot \left(y\odot z\right),$ (ii) $\left(x\odot y\right)=\left(y\odot x\right),$ (iii) $\left(x\odot y\right)=\left(x\odot z\right)\implies{y=z},$ (iv) $\exists_e e\odot e=e.$ I have been told this defines a . I will retain the uncommon designation hemigroup for now. Thurston then introduces entities he calls dyads which are sets of ordered pairs formed of elements of the hemigroup constituting equivalence classes of the ordered pairs. I write this as $$\left[\![a,b\right]\!]\equiv\{ \left<x,y\right>\backepsilon{x\odot b=y\odot a}\}.$$ The algebra of these dyads satisfies the laws of a commtative group. One such commutative group is what call the module of integers. In that source, however, this module is constructed of residue classes of ordered pairs from an algebraic structure which amounts to Thurston's hemigroup without the existence of an identity element. That is (i) $\left(x\odot y\right)\odot z=x\odot \left(y\odot z\right),$ (ii) $\left(x\odot y\right)=\left(y\odot x\right),$ (iii) $\left(x\odot y\right)=\left(x\odot z\right)\implies{y=z}.$ But those authors do not formally nominate this structure. It is the additive algebraic structure of the natural numbers, which by traditional American definition are $\mathbb{N}\equiv\{1,2,3,\dots\}$. Thurston's hemigroup is the additive structure of the whole numbers, which by traditional American definition are $\mathbb{N}_0\equiv \mathbb{N}\cup\{0\}.$ Both developments produce the same integral domain, but from different underlying algebraic structures. I am asking if the algebraic structure consisting of a hemigroup sans identity has a common mathematical name. If so, what is that name?
In The Number System by Thurston the author introduces an algebraic structure he calls a "hemigroup". It doesn't appear to be a very common usage. The laws of a hemigroup are: (i) $\left(x*y\right)*z=x*\left(y*z\right)$ (ii) $\left(x*y\right)=\left(y*x\right)$ (iii) $\left(x*y\right)=\left(x*z\right)\implies{y=z}$ (iv) $\exists_e e*e=e$ Apparently there are other definitions for the same term. Is there a more common term than "hemigroup" for this kind of structure?
What are the disadvantages of using AES-256 with 240-byte key (which scrypt/bcrypt/argon2/pbkdf2 can easily output) instead of an expanded 256-bit key? The only disadvantage I can think of is "no more hardware acceleration". This is not important for a fair comparison, are there other disadvantages? EDIT: This is about replacing round keys.
So for each round in AES a different key is used, and as I saw the keys are created form a master key. My question is how these round keys are generated. Are they created via a Key Derivation Function as the session keys, or its something else ?
I started a process from the command line, but the window server died. However I see the process I started is still running. Is it possible to connect a terminal to the process to see its output? This is the process: ps -A | grep foo 73186 ?? 4011:34.91 ./foo
I know how to redirect output and how to in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application. To be more specific as asked by in his comment, I would like to fiddle with it in these scenarios in specific: wrong output file forgot to redirect stderr to stdout or a combination of both E.g. I have Apache running and I can see the file descriptors: /proc/8019/fd/0 -> /dev/null /proc/8019/fd/1 -> /dev/null /proc/8019/fd/2 -> /var/log/apache2/error.log
Instead of "Would you mind if I ask you something?" Why past tense, I don't get it?
We use simple past to state a hypothetical present situation that we would like to speculate about (If they were here, I would be happy), past perfect for a hypothetical past (had they been here, I would have been happy), and simple present to a hypothetical future. Any explanation why this makes sense, as opposed to past for past, present for present, and future for future?
I have two questions related to VAR and AR. First question: What exactly is the difference between a VAR and AR? Second question: Is the application of a two-variable VAR not the same as an AR with two variables?
What is the exact difference between an autoregressive (AR) and vector autoregressive model (VAR)? I always thought that VAR would just be for more than two variables, until I learned that AR can also have more than two variables. I.e. I had a misunderstanding(?) that AR models are not always bivariate. Before I write too much potentially false assumptions about the difference between AR and VAR, it would rather be interested to see if anyone can make provide a quick and good summary.
Summary: My question is not about why I have not got the badge, but rather the misleading progress display. There are quite some posts about this topic. Most of them are marked either duplicate or closed. This topic is slightly different here is why, To get curious badge a user must Ask a well-received question on 5 separate days, and maintain a positive question record. Agreed! The formula to calculate if I am eligible for this badge is total questions - negative questions - closed - deleted)/total questions >= 0.5. Totally fine! The best example what I can give why I think the count is shown wrong is I can't have 7 apples out of 5! How can I have 29/5 on the badge? I think the way the numbers are displaying is misleading. Here are the few questions which talk about this issue but they are answered with you don't have +ve track. This answer doesn't really help. Again, how can I have 29 apples out of 5?
As you can see in the picture, I have 13 out of 5. But it's been like this for about two months! What's the reason for that?
I'm brazilian, living in Germany with a type D visa (for internship) that expires on 31.07.2018. If I go to London(UK) and come back on 01.08.2018, can I stay here for 90 more days? I entered in Germany on 30.01.2018. So 01.08 will be more than 180 days.
I have a 1-year residence permit from one Schengen country that is now expiring. Upon its expiration, I would like to get my 90/180 days validity as a tourist to stay, or return here as soon as possible. I understand that the tourist short-stay scheme is based on the 90/180 days "counter". But what happens if my previous stay was not tourism but residence (as searching year). Wouldn't that mean that I can quickly exit and re-enter the Schengen area to activate my tourist stay? Also, is there a way to change this purpose of stay without exiting the Schengen area?
I'm doing some development for some pages on our internal network. I want to know if there's an open source tool or FF plugin which can identify unused css within a project. I've looked at using this, but when I try to install the Add-on Installer says "Not compatible with Firefox 3.6" Please note, this is for an intranet - not a www visible website - so I can't use the online sites which offer such services.
A bunch of CSS files were pulled in and now I'm trying to clean things up a bit. How can I efficiently identify unused CSS definitions in a whole project?
I understand why this is the case comparatively , if a set is looked at as being a 'box', then the empty set is considered to be an empty box. So the set $\{1,2,3\}=A$ is considered to be a 'box' containing elements $1,2,3$, and $\{1,2,3,\emptyset \}=B$ is the set containing the elements $1,2,3$ and an 'empty box'? What I struggle with is how this intuition would make sense given the empty set is a subset of every other set. Also, I know that $\{\emptyset \} \neq \emptyset$, so would it be the case that for the given set $A$, $\emptyset \subset A$, but that $\emptyset \notin A$, as the set containing no elements is not in the set $A$, but $\emptyset \in B$ is true, right? In the midst of forming this question I thought of a way of looking at this question, but I am not sure whether it is correct: So continuing with the comparison of looking at a set being a 'box', $\emptyset \subset A$ simply means that the the set $A$ has some 'free space' in the box, and so the set could be visualised by $A=\{1,2,3,\qquad\}$?, and every set\'box' has some 'empty space', whereby the 'empty box' represents simply the collection of that void. Does this analogy capture the true picture of Why $\{1,2,3\} \neq \{1,2,3,\emptyset \}$ and $\emptyset \subset A$? Just a very quick question, Is the power set of $C=\{1,\emptyset\}$, $$\mathcal{P}(C)=\{\{1\},\{ \emptyset \},\{1, \emptyset \},\emptyset \}?$$
If the empty set is a subset of every set, why it isn't written with the elements of a set? like so $\{1,2,3,\emptyset\}$ Or why isn't $\{\emptyset,\{a\}\}=\{\{a\}\}$? I know one has two elements and the other has 1 but since the empty set is a subset of both, then why it isn't being mentioned explicitly in the definition of the set?
I am getting Exception in thread "main" java.lang.NullPointerException at deneme2.MainFrame.(MainFrame.java:43) at deneme2.deneme2.main(deneme2.java:88) C:\Users\Melih\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 1 second) I have two classes one for the frame and the other one is for the code, i have done most part of it so far but however i am getting this error. however on my deneme2 class if i remove the MainFrame frame = new MainFrame(); it seems to work. This is my denem2 class public class deneme2 extends JFrame { public static interface MessageOutput { void appendMessage(String message); } private MessageOutput msgOutput = new MessageOutput() { @Override public void appendMessage(String message) { System.out.println(message); } }; public void setMessageOutput(MessageOutput value) { msgOutput = value; } private Node front, rear; private int currentSize; private class Node { int data; Node next; } public deneme2() { front = null; rear = null; currentSize = 0; } public boolean isEmpty() { return (currentSize == 0); } public int dequeue() { int data = front.data; front = front.next; if (isEmpty()) { rear = null; } currentSize--; msgOutput.appendMessage(data + " removed from the queue"); return data; } public void enqueue(int data) { Node oldRear = rear; rear = new Node(); rear.data = data; rear.next = null; if (isEmpty()) { front = rear; } else { oldRear.next = rear; } currentSize++; System.out.println(data + " added to the queue"); } public static void main(String a[]) throws FileNotFoundException { MainFrame frame = new MainFrame(); queue.setMessageOutput(frame); Scanner s = new Scanner(new File("list.txt")); deneme2 queue = new deneme2(); while (s.hasNext()) { queue.enqueue(s.nextInt()); } s.close(); queue.dequeue(); }} And this is my MainFrame class public class MainFrame extends JFrame implements deneme2.MessageOutput { private JTextArea txt1; @Override public void appendMessage(String message) { txt1.append(message); } public MainFrame() { JFrame frame = new JFrame(); JButton b1 = new JButton("Load Up the Que"); JButton b2 = new JButton("Add to the Que"); JTextArea txt2 = new JTextArea(); txt1.setEditable(false); b1.setBounds(50, 100, 180, 100); b2.setBounds(50, 300, 180, 100); txt1.setBounds(600, 100, 300, 600); txt2.setBounds(300, 300, 180, 100); frame.add(b1); frame.add(b2); frame.add(txt1); frame.add(txt2); frame.setLayout(null); frame.setSize(1000, 1500); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }}
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?
this is something that came up when working with one of my students today and it has been bothering me since. It is more of a maths question than a pedagogical question so i figured i would ask here instead of MESE. Why is $\sqrt{-1} = i$ and not $\sqrt{-1}=\pm i$? With positive numbers the square root function always returns both a positive and negative number, is it different for negative numbers?
What's the thing with $\sqrt{-1} = i$? Do they really teach this in the US? It makes very little sense, because $-i$ is also a square root of $-1$, and the choice of which root to label as $i$ is arbitrary. So saying $\sqrt{-1} = i$ is plainly false! So why do people say $\sqrt{-1} = i$? Is this how it's taught in the US?
I just noticed on that the user wears the 'Ooh, Shiny!' secret hat on Meta Stack Exchange. This is not the case on other sites, like and a handful of others I checked. It probably earned this hat due to the script, or when an OP confirmed a duplicate but why does it wear a hat, and only here?
Why does ? And more importantly: why does she not wear them? Please, show some goddamn holiday spirit! Can we get Community to wear her hats, either randomly or through popular vote?
What is more, partitions of the number $N$ into at most $k$ terms, or partitions of the number $N + k$ into exactly $k$ terms? We consider partitions that differ only in order to be the same. Looks like pretty easy combinatorial problem, but I have no idea that should work here. I tried draw , and build some bijections. As I know, there no any formula for finding number of partitions, so I need some more ideas/hints for this problem
How do I see that the number of partitions of the integer $n$ into at most $r$ positive integers is equal to the number of partitions of $n + r$ into exactly $r$ positive integers?
I'm taking a euclidean and plane geometry course and the bibliography given to us is scarce. The course covers the next topics: Trigonometry Coordinate systems Inversion in a circle Poles and polars Extension of the plane Transformations of the plane Would you recommend me books that covers such topics? It's important to mention that the course is mostly proof-based
I consider myself relatively good at math, though I don't know it at a high level (yet). One of my problems is that I'm not very comfortable with geometry, unlike algebra, or to restate, I'm much more comfortable with algebra than geometry. I think that's mainly because my geometry education was sparse through the years, lacking in consistency etc. So I'd like to revise (and learn more) all at once, catching the basic axioms, understanding why such is such, etc. Essentially, a moderately rigorous textbook in plain Euclidean geometry (nothing fancy). Please don't say "The Elements" - I have browsed it at the bookstore, it is quite good, but not really what I'm looking for right now.
My application includes creating POCO classes at runtime using the CodeDOM. I am looking for a way to allow my end user to specify a limitation on the value of some properties he creates (e.g. if he adds a property Email than he would probably like to validate the content to an email address. It is obvious that the end user might have more custom restrictions). My intention is to offer a PropertyValidation field where the end user can provide a regular expression which serve as a validator for the content of created instances of that property. Is there any way I can make sure the string provided in the PropertyValidation field is an actual Regex before allowing it?
I allow users to enter a regular expression to match IP addresses, for doing an IP filtration in a related system. I would like to validate if the entered regular expressions are valid as a lot of userse will mess op, with good intentions though. I can of course do a Regex.IsMatch() inside a try/catch and see if it blows up that way, but are there any smarter ways of doing it? Speed is not an issue as such, I just prefer to avoid throwing exceptions for no reason.
I've just installed Ubuntu on my Dell laptop, and the wireless is not working. How could I fix it ? Is there any driver I should install? Note: I'm also running windows 7 on the same laptop and the wireless connection works just fine. Any suggestion would be helpful. Thanks! EDIT : Wifi card model description : vendor : broadcom corporation product : BCM4312 802.11b/g LP -PHY version : 01 configuration : driver = b43 -pci-bridge latency=0
I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible. What are the steps to install Broadcom wireless drivers for a BCM43xx card? I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc. lspci -vnn | grep Network showed: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b] iwconfig showed: lo no wireless extensions. eth0 no wireless extensions. NOTE: Answer below is updated every time new information is added and confirmed working.
What the LaTeX code is for this fancy 0? I have been looking for the LaTeX code for this zero-like symbol and I can't seem to find it anywhere.
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?
I recently asked a question on Stack Overflow which was primarily about UICollectionViewController, a frequently used class in UIKit on iOS 7. I wanted to tag the post with the tag , but could not do this because it exceeded the limit of 25 characters. Please will you raise the limit on tag length? We frequently deal with long/descriptive class names in iOS and this hard and seemingly arbitrary limit reduces the usefulness of the tagging system.
Possible Duplicate: Is there a maximum limit on the length of tags? I noticed that the tag for SQL Server Management Studio is truncated to sql-server-management-stu. It seems like this should be an easy thing to correct, if not to allow the creation of new longer tags, but to correct existing tags that have been truncated.
I have a Samsung Galaxy S II but my Ubuntu 10.04 laptop, although it recognizes the phone when I connect it with a USB. won't allow me to get into the phone. Do I need special drivers?
I'm using the US Model 16GB version of the Samsung Galaxy S3 (I747), however, I cannot mount it to my laptop from some reason. I have tried using both FTP and MTP connections, but neither work. What should I do?
As the title says, does anyone know what this icon means? Just upgraded to a Samsung galaxy s10, but it's not an icon I've seen before. It sits between the wifi and cell signal strength icons. Edit/Answer: To summarise the answer found in the above link, this icon indicates that "wifi calling" is enabled. I've noticed that the icon will appear and disappear depending on how close you are to your router, presumably because the wifi calling feature requires a good signal.
What does the following icon in my status bar indicate? And how do I remove it? As far as I know I didn't turn any setting on that triggered it. I can't find the icon online. My first guess was that it was either VoLTE or VoIP or WiFi calling, but I do not have any of these as options on my phone. EDIT 1: The icon does not go away, unless I turn off WiFi. Below are screenshots of my full home screen and of the open notification panel. EDIT 2: The screenshot below is of my phone's "Call Settings". I have no 'Wi-Fi Calling' option. According to guides online, it should come after the 'Vibrate' option. The screenshot below is the results when searching 'Wi-Fi' in settings. No call options come up. EDIT 3: It definitely is the Wi-Fi Calling icon (even though I do not have it as an option on my phone) -- I tested it now and I can phone my contacts when in flight mode.
I have an out of the box theme that works fine using jquery events to trigger certain effects in both the header and the sidebar parts of the page. Since there are many pages, I've tried to take those header, sidebar and footer sections, and move the code into external files, which are included with the following javascript strategy: <html> <head> <script src="jquery.js"></script> <script> $(function{ $("#includedContent").load("b.html"); }); </script> </head> <body> <div id="includedContent"></div> </body> </html> The problem is that when the header and sidebar codes are included using the javascript the jquery events stop working. Is there either a better way to include an external file so that javascripts called in the parent file will affect all elements in the child files? Or, is the something else that I can do?
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.
sudo apt install --install-recommends winehq-stable Reading package lists... Done Building dependency tree Reading state information... Done 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: winehq-stable : Depends: wine-stable (= 5.0.3~groovy) E: Unable to correct problems, you have held broken packages.
I have followed all the instructions on . In particular, I have run the following commands: sudo dpkg --add-architecture i386 wget -nc https://dl.winehq.org/wine-builds/winehq.key sudo apt-key add winehq.key sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' The first three of the above seemed to work fine. However, the last command gives me the following error: 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: winehq-stable : Depends: wine-stable (= 5.0.0~bionic) E: Unable to correct problems, you have held broken packages. I'm running Lubuntu 18.04.3 on a USB live stick. (However, if I remember correctly, a couple days ago I got the exact same error on a normal hard disk Lubuntu 18.04.3 installation.) I've read that a lot of people get similar errors. Unfortunately I haven't found any solutions online that worked. Any help would be much appreciated. Thanks! EDIT: Thanks for the comments and suggestions everyone. I'll try them out later today. In the mean time, here's something I don't understand. Ubuntu 18.04 has been around for almost two years now. In all that time, surely somebody has successfully installed wine, right? What did they do to get it working?
I want to create a zip archive from all files which are in "my_folder". Here is how I do it: zip -9 -y -r -q name.zip /home/user/Stack_Exchange/my_folder/ The problem is that right now when I unpack the archive, the hierarchy of folders is fixed, so the result of unpacking is the home folder and inside is the user folder, etc. How can I create a zip archive which has only "my_folder" in the directory? I mean I want to see the folder "my_folder" after unpacking the archive.
I have a directory called folder that looks like this: folder -> root_folder -> some files I want to zip this directory into zipped_dir, I tried: zip -r zipped_dir.zip folder/* But this generates a ZIP that looks like this: zipped_dir -> folder -> root_folder -> some files in other words, it's including the directory whose contents I want to zip. How can I exclude this parent directory from the ZIP, without moving anything? IE I would like this end result: zipped_dir -> root_folder -> some files
I'm currently working on a website which mail user attachments to the owner of the website. However I used a form to submit image files to mail PHP file and then it send the email. It worked perfectly until I override form submit function with Javascript and use ajax to submit it and get the output from mail PHP file to add some additional functionalities. <form id="contactForm" action="php/sendcontactusmail.php" method="post" enctype="multipart/form-data"> <div class="row"> <div class="col-md-6"> <!-- Additional Codes for email input and subject inputs --> <div class="form-group"> <label for="subject" id="uploadImageLabelId">Upload Pictures of the Job</label> <form enctype="multipart/form-data" > <input type="file" name="fileToUpload" id="imageUploadInputId" accept="image/*" id="fileToUpload" multiple> </form> </div> <!-- Additional Codes for Message inputs and others --> <div class="col-md-12"> <button type="submit"class="btn btn-primary pull-right" id="btnContactUs">Send Message</button> </div> </div> </div> </form> Javascript code: $("#contactForm").submit(function(){ $.ajax({ type:"POST", url : "php/sendcontactusmail.php", dataType:"json", data: $("#contactForm").serialize(), success: function (data) { alert(data); } }); return false; }); **My Problem ** PHP code: if(filter_var($_POST["subject"], FILTER_SANITIZE_STRING)=="estimate") { if($_POST && isset($_FILES['fileToUpload'])) { // Some Codes to send email } else echo json_encode(isset($_FILES['fileToUpload'])); } else { // Some codes for send separate email. } when I run my program, alert box shows false. Which clearly means that isset($_FILES['fileToUpload']) function returns false. I tried every way to fix that. But couldn't find the problem. Any guesses? Note When I run the website on my local server I selected a compatible jpg file. But it says file is not set. Update I went through lots of stackoverflow questions and none of their solutions gave me a true return statement. Hope this wouldn't be a duplicated question.
I would like to upload a file asynchronously with jQuery. $(document).ready(function () { $("#uploadbutton").click(function () { var filename = $("#file").val(); $.ajax({ type: "POST", url: "addFile.do", enctype: 'multipart/form-data', data: { file: filename }, success: function () { alert("Data Uploaded: "); } }); }); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <span>File</span> <input type="file" id="file" name="file" size="10"/> <input id="uploadbutton" type="button" value="Upload"/> Instead of the file being uploaded, I am only getting the filename. What can I do to fix this problem?
I have a fragment in MainActivity and try to setText in fragment, but when I try to do it I get Null Pointer Exception. I checked spelling but it seems okay. I debug app and check these variables but it doesnt seem they are null. The exception appear in first line of clearText() method. @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { v = inflater.inflate(R.layout.fragment_sun, container, false); sunRiseTime = v.findViewById(R.id.sunRiseTime); sunRiseAzimuth = v.findViewById(R.id.sunRiseAzimuth); sunSetTime = v.findViewById(R.id.sunSetTime); sunSetAzimuth = v.findViewById(R.id.sunSetAzimuth); duskTime = v.findViewById(R.id.duskTime); dawnTime = v.findViewById(R.id.dawnTime); return v; } private void clearText(){ sunSetTime.setText(""); sunSetAzimuth.setText(""); sunRiseTime.setText(""); sunRiseAzimuth.setText(""); duskTime.setText(""); dawnTime.setText(""); } The error Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference at com.example.mariusz.astroweather.SunFragment.clearText(SunFragment.java:99)
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?