body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
The book Javascript: The definitive guide states the following in it's 6th edition, in the chapter 4.13.3 The delete Operator var a = [1,2,3]; // Start with an array delete a[2]; // Delete the last element of the array a.length // => 2: array only has two elements now But when i tried the above snippet in Firefox and in chrome, the array's length was still 3. Is this a wrong information from the book or is the implementation of javascript in the browsers differ from a javascript spec? Note: I tried splice and it removed the element. My doubt is that is there a spec in ecmascript specifications that says delete should remove the element and the browsers decided not to implement according to that script. or is the book wrong..? | What is the difference between using on the array element as opposed to using ? For example: myArray = ['a', 'b', 'c', 'd']; delete myArray[1]; // or myArray.splice (1, 1); Why even have the splice method if I can delete array elements like I can with objects? |
I work at a library where we have just recently setup 5 kiosk's based on linuxmint. The hardware is identical. I actually used DD to make an image after I set the first one up. My Problem is, I now need to apply more updates to these machines. I'm making several updates to things like grub, and other system configuration. As well as a specific users .gconf folder. Apply such updates as removing keybinding's. Updating power the power settings. I have ssh access to all of the boxes. What would be the best way to update these? I first apply the changes to our experimental machine. How would you recommend then pushing these updates out to all the other kiosks? Just discovered This looks promising. Any other ideas? Can this be ran as a daemon or will I have to goto each kiosk, login as root, and run puppet? Running scp and rsync to transfer .gconf and other changes has failed for me. I have no root user, obviously because of the way ubuntu runs. So no way to get it to escalate to root for the transfer of modified files. At least that I know of. | Beside our internal IT infrastructure, we've got around 500 Linux machines hosting our services for the on-line world. They are grouped in a bunch of clusters like Database A-n, Product A-n, NFS, Backoffice and so on. Furthermore, they are administered by an external provider, according to our specifications and requirements. However, we face a lot of trouble during (web-) software development, roll-out and deploy - especially because the dev- and staging-environments have almost nothing in common with the live systems (I spare out the nasty details..). Thus, I've tried to create virtual machines, copied the various live-systems as exactly as possible and prepared them to connect to e.g. the development-databases instead of the "real" ones transparently for developers (they aren't root). This works pretty well, but... I was wondering how one could administer those systems remotely and in bulk? Is there some software family I'm not aware of? Or, at least, some techniques or principles one should be familiar with? We would provide every developer with a bunch of images to be run locally (VirtualBox). The QA dept. would get virtual clusters (XEN or Hyper-V). If I need to provide an additional server-module, re-route a new database connection or just want to update everything provided by the package manager... how could I possibly do that without being forced to log on to every system and/or ask my colleagues to download and run some fixture-script? I believe there are plenty of solutions. Well, somehow I'm too stupid to enter the correct keywords into the search engines... Or isn't this issue as trivial as it sounds? For the record: Almost all systems are running Debian GNU/Linux 6.x "squeeze" No developer is forced to use a particular OS at his/her workstation The budget is limited, of course, but not too small to buy proprietary software A solution that would involve our aforementioned provider is preferred |
I try to smooth my model. I have tried with Surb surf and Smooth in Modifier but nothing. Thank you so much The ears are completed circle in Edit mode. When I redered the ears are.... Why? Many thanks | Is there a way that when something is subdivided, it can be constrained from making the zig-zag flower petal pointed edges? |
When I launch Steam through Wine, no text is shown, just buttons. I am running Wine version 1.6. How do I fix this? | Hello fellow dwellers of askubuntu, as the title says I'm having difficulties with getting Steam to run properly. I think I have the solution but I am pretty incompetent with Ubuntu (just started using it the other day) so a step by step process would be unbelievably appreciated! Here are the links to what I think possible solutions are: [1] [2] I've tried googling how to preform the solutions such as changing the alias/script for steam (no idea what that is) to -no-dwrite or launching with wine Steam.exe -no-dwrite. The dwrite seems to be the issue in all this but I can't for the life of me figure out how to do anything about it. Any useful input is what I'm hoping for but for the brave soul who feels like typing a bit more, perhaps a step-by-step list of instructions starting from downloading Steam off the official website, would be my saving grace. If there is any more info you guys need let me know and I'll of course be happy to oblige! |
How can I set Hibernation in Ubuntu 18.04 LTS (laptop)? When I open the Power option > When the Power Button is pressed, I just see the following options: Suspend Power OFF Nothing But does not show Hibernate. | How should I successfully hibernate Ubuntu 16.04? I've tried almost every solution on the web but non of them was actually helpful. I found my problem almost completely similar to |
I have changed my Ubuntu One password and now my Ubuntu One windows client fails to sync. Is there any way to get the windows client to work again? | Recently I started getting a File sync error on all 3 of my PCs running Ubuntu One. One is running Ubuntu, the other 2 are running Windows 8. Looking at the list of clients on the web, none of them were there anymore. I found this article: On how to fix the issue for my Ubuntu PC and it worked perfectly. Now I am looking for a similar fix for Windows but haven't found one yet. I've tried un-installing Ubuntu One and re-installing it, but it must still be holding the keys somewhere because it never asked me to login again. Does anyone know where I can clear these keys to get my files syncing on Windows again? |
If $0 < a \le b \le c \le d$ and $abcd = 1$ prove that $$a+b^2+c^3+d^4 \ge \frac{1}{a}+\frac{1}{b^2}+\frac{1}{c^3}+\frac{1}{d^4}$$ I first thought of multiplying both sides with $\big(\frac{1}{a}+\frac{1}{b^2}+\frac{1}{c^3}+\frac{1}{d^4}\big)$ Then by applying C-S inequality in the LHS the inequality would be $$16 \ge \Big(\frac{1}{a}+\frac{1}{b^2}+\frac{1}{c^3}+\frac{1}{d^4}\Big)^2$$ But if $(a,b,c,d)=(\frac14,1,1,4)$ the inequality does not hold true. | let $0<a\le b\le c\le d$, and such $abcd=1$,show that $$a+b^2+c^3+d^4\ge \dfrac{1}{a}+\dfrac{1}{b^2}+\dfrac{1}{c^3}+\dfrac{1}{d^4}$$ it seems harder than |
I want to install Ubuntu 14.04.4 in UEFI mode alongside windows 8, which is already in UEFI mode. My partition scheme is GPT. Ubuntu is on /dev/sda5. Legacy bootloader on /dev/sda. Windows on /dev/sda4. UEFI bootloader in EFI partition How would I go about doing this? | I recently have upgraded my PC, my new Motherboard (ASUS M5A99X EVO) uses UEFi instead of the regular MBR option. I have a Ubuntu 11.10 installation that I did when I had my previous hardware (MSI MS 7267) , Ubuntu alone boots fine, and so does Windows 7, however Windows 7 is using UEFI (GPT) boot whereas Ubuntu is using MBR. I have my OSs in separate drives, so that GRUB2 wont' get replaced by the Windows Bootloader and viceversa, as I said both OSs boot fine on their own, but to do that I have to disconnect one drive in this case the Ubuntu drive as it prevents Windows from loading. Now my question is, How can I change/convert Ubuntu's drive so that instead of using MBR it uses GPT and allow Windows to boot?. Preferably without reinstalling the whole system or lose any data. And if I were to wipe the drive, How can I install Ubuntu in GPT, UEFI, whatever it is mode?. I have used gdisk to convert from MBR to GPT, but now Ubuntu can't boot seems like grub just doesn't start. I have re installed the OS, and the drive is GPT now by default however grup-pc is still being used instead of grub-efi. How can i make Ubuntu boot from EFI?. |
I need to add these modules because my usb keyboard is not working when I try to type my encrypted password. usbcore uhci_hcd ehci_hcd usbhid I guess I need to add these to /etc/initramfs-tools/modules, but where exactly do i add them. Here is the modules file: # List of modules that you want to include in your initramfs. # They will be loaded at boot time in the order below. # # Syntax: module_name [args ...] # # You must run update-initramfs(8) to effect this change. # # Examples: # # raid1 # sd_mod Where am I supposed to add it here, and am I doing the right thing (is it safe)? | is anything else supposed to be here? I am using Ubuntu gnome and my keyboard is unresponsive for encryption password. Do I need any more modules, and if so where do I add them. # List of modules that you want to include in your initramfs. # They will be loaded at boot time in the order below. # # Syntax: module_name [args ...] # # You must run update-initramfs(8) to effect this change. # # Examples: # # raid1 # sd_mod |
Find conditions on positive integers $a, b, c$ so that $\sqrt{a}+\sqrt{b}+\sqrt{c}$ is irrational. My solution: if $ab$ is not the square of an integer, then the expression is irrational. I find it interesting that $c$ does not come into this at all. My solution is modeled (i.e., copied with modifications) from dexter04's solution to . Suppose $\sqrt{a}+\sqrt{b}+\sqrt{c} = r$ where $r$ is rational. Then, $(\sqrt{a}+\sqrt{b})^2 = (r-\sqrt{c})^2 \implies a+b+2\sqrt{ab} = c+r^2-2r\sqrt{c}$. So, $a+b-c-r^2+2\sqrt{ab} =-2r\sqrt{c}$. Let $a+b-c-r^2 = k$, which will be a rational number. So, $(k+2\sqrt{ab})^2 = k^2+ 4ab+4k\sqrt{ab} = 4cr^2$ or $4k\sqrt{ab} = 4cr^2-k^2- 4ab$. If $ab$ is not a square of an integer, then the LHS is irrational while the RHS is rational. Hence, we have a contradiction. | How do I prove that $1$,$\sqrt{2},\sqrt{3}$ and $\sqrt{6}$ are linearly independent over $\mathbb{Q}$? $\mathbb{Q}$ is the rational field. I want to know the detail about the proof. Thanks in advance. Actually I know any two of them and three of them are linearly independent. |
Have a business card file created in AI. Printer is asking for crop marks and we are looking to have 1/4" rounded corners for the cards. How do I create crop marks or setup bleed for this? or is the setup for the 1/4" rounded corners the printers responsibility and I simply supply standard crop marks? Thanks! | So basically, I've made a set of playing cards for a client and he said the printer wants to add 3mm bleed lines to the cards like .. However these don't look like bleed lines to me?(the pink line) Aren't bleeds on the outside of the image not inner? I'm guessing they're trim lines.. I've been looking for tutorials everywhere on how to add them with no luck. |
I am struggling to find a correct way to query the following scenario. Consider the below table as example, where I want the row with index_no 124 for that dvpc and pid value of the columns. Please suggest. Index_No dvpc pid rate 123 123 30 0.01 124 123 30 0.02 | Table: UserId, Value, Date. I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle) Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date. |
I made this plane 17in x 6in but when I measure it blender says its length is 1in and when I try to extrude/scale it to a certain length it uses a ratio of it's current size instead of length in inches, does anyone know how I can fix this? Thanks | I just found out about the Mesh Display : Length feature in the "N" panel (thanks to ) that allows one to measure the length of a face or vertice. But my first encounter with this tool gives me complex feelings of love and hate, see how, as I was trying to measure the aspect ratio of this TV screen, I am getting WIDTH = 20.33 and HEIGHT = 37.57. These values seem awfully wrong, since my betrusted eyes tell me the height should be shorter than the width. I have tried measuring the single vertices as well, to identical results. |
I'm trying to create a simple 'double click' executable to open a large number of specific folders and applications for a user uncomfortable with using the terminal. The script is simple enough and works as expected when running through the terminal with the following command: python3 /home/xxxx/Desktop/setup.py When I double click the file, it opens in the text editor. I have added executable permission with: sudo chmod +x /home/xxxx/Desktop/setup.py ...and I've given ample permission with: sudo chmod 755 /home/xxxx/Desktop/setup.py ...and it has what I think is the appropriate shebang at the top of the file: #!/usr/bin/env python3 I would expect to see a pop up which asks something like "Do you want to run this as an executable?" but this pop up doesn't appear. I tried "open with another application" but I found no way to actually open with the terminal or python directly from there. Getting desperate, I tried to just create a desktop short cut: lxshortcut -o /home/xxxx/Desktop/setup.py ...but even this didn't work. The .Desktop file created would only open as a text file. I'm using Ubuntu 18.04 LTS. Thanks in advance for any help/ideas. Extra Info: the script doesn't need to be executable from another computer python3 is installed | 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? |
I am trying to calculate $R^2$ (variance explained) for a set of data using GLMM's, and . Here's some dummy data. set.seed(7127) # Number sampled n = 10000 # Average height m = 180 leg = rnorm(n, 75, 5) torso = rnorm(n, 75, 5) head = rnorm(n, 30, 1) df = data.frame(1:n, sample(leg, n, replace = T), sample(torso, n, replace = T), sample(head, n, replace = T)) df$height = rowSums(df[,2:4]) colnames(df) = c("person", "leg", "torso", "head", "height") This is height data for 1000 people, measured as three components of height (leg, torso, and head) which sum to give total height. I want to have an $R^2$ value for each of the three components, where $R^2$ is how much of the variance in height is explained by leg length, torso length, and head length individually. To do this I have made 3 models where each component is modelled as a fixed effect, with a random effect (randomly assigned the group 1 or 2, these could be analogous to sex [male or female]), as well as a random effects only model (order in code is null, leg, torso, head). mod0 = lmer(df$height ~ 1 + (1|df$random)) mod0 modL = lmer(df$height ~ df$leg + (1|df$random)) modL modT = lmer(df$height ~ df$torso + (1|df$random)) modT modH = lmer(df$height ~ df$head + (1|df$random)) modH Following the protocol of I have tried to calculate Marginal and Conditional $R^2$ values for each component of height (order in code is leg, torso, head). # Marginal R squares VarFixedL = var(fixef(modL)[2]*getME(modL,"X")[,2]) R2M_L = VarFixedL / (VarFixedL + VarCorr(modL)$df[1] + attr(VarCorr(modL),"sc")^2) R2M_L VarFixedT = var(fixef(modT)[2]*getME(modT,"X")[,2]) R2M_T = VarFixedT / (VarFixedT + VarCorr(modT)$df[1] + attr(VarCorr(modT),"sc")^2) R2M_T VarFixedH = var(fixef(modH)[2]*getME(modH,"X")[,2]) R2M_H = VarFixedH / (VarFixedH + VarCorr(modH)$df[1] + attr(VarCorr(modH),"sc")^2) R2M_H # Conditional R squares R2C_L = (VarFixedL + VarCorr(modL)$df[1]) / (VarFixedL + VarCorr(modL)$df[1] + attr(VarCorr(modL),"sc")^2) R2C_L R2C_T = (VarFixedT + VarCorr(modT)$df[1]) / (VarFixedT + VarCorr(modT)$df[1] + attr(VarCorr(modT),"sc")^2) R2C_T R2C_H = (VarFixedH + VarCorr(modH)$df[1]) / (VarFixedH + VarCorr(modH)$df[1] + attr(VarCorr(modH),"sc")^2) R2C_H The results suggest that the variance in height is largely explained by leg and torso length (~49% each). (Edit: I have tested this on the sample data provided by the Nakagawa & Schielzeth paper and reproduced their results, but would appreciate feedback on whether this is correct). > R2M_L [1] 0.4869814 > R2M_T [1] 0.4909379 > R2M_H [1] 0.02097508 > R2C_L [1] 0.4871594 > R2C_T [1] 0.4909379 > R2C_H [1] 0.02097508 Here the two types of $R^2$ are (virtually) identical. If I introduce variance as a result of the random group (e.g. df$height = ifelse(df$random == "2", df$height, df$height+rnorm(n, 10, 1))) I get differences between the two types, could someone explain the difference between the Marginal and Conditional $R^2$. Why would one be better or, when would one be more appropriate, than the other? Why do they react differently to the addition of random or unmeasured variance components? | I have a mixed model with three random effects and many fixed effects. I set aside some of my data to validate my final model and now I would like to compute the $R^2$ on the validation set, in R. I found some code for a mixed model with one random effect but not for a model with more than one random. Does anyone know a package or some code to compute $R^2$ for mixed models with more than one random effect? If this isn't possible, does anyone have a good suggestion for comparing model fits? |
In The Force Awakens we see that stormtroopers are given designations, and that Finn's is FN-2187. I'm not so interested in the numbers given, as I assume they are just to distinguish between troopers (although Finn's numerical designation had an ). Why are they prefixed with FN specifically? Out of universe, I can understand it means we can rename FN-2187 as Finn. But what does it mean in in-universe ? Nb. I understand you'll need some other designation so as not to be limited to 9,999 troops. I'm more interested in specifically why the letters FN. | There are several Stormtroopers with designations in the form "FN-####" in The Force Awakens, including FN-2187, AKA Finn and FN-2003, the Stormtrooper who put his bloody hand on Finn's helmet. There are also other First Order Stormtroopers whose designations start with "FN" appearing in various canon books. Has it been clarified in canon what "FN" means or stands for? |
I'm building a java service that modifies the "Last Modified" field of some of the files it works with. The service keeps copies of files in a folder, it periodically checks a database for changes, if it finds a file whose "last modified" timestamp in the database is newer than the one on the file system then it deletes the file from the file system, downloads a fresh copy and sets the "last modified" field on the file to match the one from the database. This all works as expected. In the code I query an SQL timestamp from the database, get the time as a Long and pass that into the file.setLastModified() method of the file object. This works as expected, and when running comparisons both timestamps match as expected. However, when I access the server via ssh and run ls -l in the folder containing the files the last modified timestamp just says "2019"; BUT, if I run the ls --full-time command then the full timestamp is displayed and is correct. Why is this? Is there some other flag I need to set when setting the timestamp on the file? This is only an annoyance right now, I'm just curious as to why it looks this way. Here's a screenshot of what it looks like: | If you issue ls -all command some files or directories have the year and some have the time? Why do some show the year while others show the time? Is the time representative of the time the file was created? |
I did the following: Let $W=X+Y-3Z,$ then we have that $$W\sim N(1+1-3,1+1+9)=N(-1,11).$$ so $$P(X+Y\ge3Z)=P(W\ge 0)=1-P(W\le 0)=1-F_W(0)=1-\Phi\left(\frac{1}{\sqrt{11}}\right)\approx \\ \approx 1-0.618 = 0.382.$$ However, I'm in the chapter treating convolution. How can I solve this problem using this approach instead? | I'm stuck on this problem, and I dont know how to continue from here. It would be great if someone could just give me a hint of how to proceed from here. The problem is, "Let $X,Y,Z$ be independent and $N(1,1)$. Find $P(X+Y \geqq 3Z)$." Now, the way I see it there are two obvious ways to proceed. First off, one can simply condition on the different variables and because of their independence obtain $P(X+Y \geqq 3Z) = \displaystyle \int_{-\infty}^{\infty}P(X+Y \geqq 3Z | Z=z)f_Z(z)dz = \int_{-\infty}^{\infty}P(X+Y \geqq 3z)f_Z(z)dz $ $ (1)$ and by doing the exact same reasoning we get $P(X+Y \geqq 3z) = \int_{-\infty}^{\infty}F_X(3z-y)f_Y(y)dy$ and thus (with (1)) $P(X+Y \geqq 3Z) = \int_{-\infty}^{\infty}f_Z(z)\int_{-\infty}^{\infty}F_X(3z-y)f_Y(y)dydz$. This is problematic however, since $X\sim N(1,1)$ means that we cannot express $F_X(3z-y)$ explicitly. If the variables would have had some other distribution with known cdf, the calculation could continue in a straight forward way from here. This is not the case right now, however. I did, however, try to use the fact that $F_X(3z-y) = \int_{0}^{3z-y}f_X(t)dt$. But then I couldnt make sense of the integration limits. So I doubt that this is the right way to go in solving this particular problem. I was also thinking about using the fact that $X+Y =: W$ then $W\sim N(1+1,1+1)$ and would simplify the calculation above but yield the same problem. Maybe there is a nice trick one can use in calculating the integral above. Either way, I would really appreciate if someone could give me some hints as to how to continue from here. Thanks! |
I need to call a function just after some elements are loaded on the page(result of a ajax call) after the page loads, I cannot use the success callback function. Is there a way to do this? | 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. |
Reopen note: There is a quite finite and modest amount of evidence in the literature about this issue, which members can record here as they see fit. Less than there is for example about what a noun is or what a verb is, or how to tell what the Subject of a sentence is. It's a simple question, that people need to be able to get answered on a site such as this. It is of continuing interest as more recent questions such as attest to. The fact that people disagree about the outcome of the evidence does not mean that there is too much evidence to be documented. Quite the reverse. They disagree because there is relatively little evidence altogether. However, it is seriously interesting evidence. The question What part of speech is to as in: I need to know. To err is human, to forgive divine. What am I to do? This question is not really about the difference in meaning between the examples. It is a question about what grammatical or syntactic reasons we have to classify this item as a particular part of speech. If arguing that it is 'its own part of speech', I'd like to know what grammatical - but not historical - reasons you have for your claim. Just to clarify, I'm not asking about what assignment any particular authority or publication gives it. I'm interested to know the reasons why. Your own personal insights are also very welcome. If you're a grammar anorak - like me - then you may want a list of the contenders out there from other grammarians. In no particular order: preposition subordinator non-finite auxiliary verb modal verb inflectional element Can you help? | Consider this: I like to eat here. vs I would eat here. It appears to me that "to" has nothing to do with the infinitive form of the verb that follows. It is, in this example, an integral part of like to, not of to eat. Is my thinking flawed? If you think it is, could you please explain which form of the verb "eat" is used in the second example, if not the infinitive? |
I logged into Stack Overflow and saw that I had three notifications; turns out those notifications were meant for another user: I've gone in and checked the chat message where I was apparently mentioned; none of them were edited: and this: and also this: Why was I 'pinged' when another user was mentioned? Was this supposed to happen, or is this a bug of some kind? | For some or other reason, typing @ᔕᖺᘎᕊ in a chat room pings everyone who's been in that chat room for the last 7 days... Seems to work in all chat rooms (I only tested 2 as I don't want to upset too many people...) How should we proceed? |
all php functions need () in the end. However, exit doesnt need that. Can I create a function manually, which I can later execute without () ? Even more, If I have full access to php installation? p.s. please dont tell me answers "exit is not function" or etc (My question is not if "exit" is function or not). I want to know HOW TO ACHIEVE like that. | I have a function that is effectively a replacement for print, and I want to call it without parentheses, just like calling print. # Replace print $foo, $bar, "\n"; # with myprint $foo, $bar, "\n"; In Perl, you can create subroutines with parameter templates and it allows exactly this behavior if you define a subroutine as sub myprint(@) { ... } Anything similar in PHP? |
I have a doubt regarding the meaning of LastAccessDate in the StackExchange database under the User table. Is it the last date on which the user have performed some activity on the site(like asking questions, commenting etc.) or is it last date when user opened the site? | Stack Exchange releases "data dumps" of all its publicly available content roughly every three months , and also makes that information queryable over the Internet at the (SEDE) (updated weekly, on Sunday). Over time, as new features and other bits of data are introduced to Stack Exchange sites, the "anatomy" of the data dump is likely to change. |
How to build linear order on $\mathcal P({\bf N})$? Had idea about inclusion relation, but it does not satisfy linearity. | Let's say I take a set $S$, where $S$ can be well ordered. From what I understand, one can use that well ordering to totally order $\mathscr{P}(S)$. How does a body actually use the well ordering of $S$ to construct a total ordering of $\mathscr{P}(S)$? Perhaps construct is too strong a word. Is there a way to prove that a total ordering of $\mathscr{P}(S)$ just exists, no need to explicitly state what it is, since that might be very difficult. |
Claim : If $H \le G$ and $H$ has index 2 in $G$ then $a^2 \in H, \forall a\in G$ My attempt : There will be exactly two cosets lets call $H$ and $aH$ respectively. If $a\in H$ then $a^2\in H$ because of closure property of $H$. Second case when $a\in aH$ then $aHaH = a^2H$ so now how to prove that $a^2 \in H$ Please Help. | I have the following question: Let $G$ be a group and let $H$ be a subgroup of finite index of $G$. Let $|G:H|=n$ Then it holds: $g^{n!}\in H$ for all $g\in G$. Why is this true? I think, that's not very difficult, but I have no idea at the moment. Thanks! |
I want to know if I can check every id in my array to check if the id is already in the array. In my case: I have a array called "idsVoting", which is empty when the bot starts. (its a discord bot) Now the user is using a command and his user id will be save in the array. What i tried to check was : if(idsVoting !== message.author.id) I was thinking this will check every id in the array, but it won't. Can someone give me an idea to use? Or would a for-loop be better / easier here? | 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? |
I wanted to write to a specific sheet of an excel file having multiple sheets. How can I do so using C#. This is the method that I have: public void WriteCSV<T>(IEnumerable<T> items, string path, StringBuilder stringBuilder) { var csvFileLength = new System.IO.FileInfo(path).Length; var csv = stringBuilder; Type itemType = typeof(T); var props = itemType.GetProperties(BindingFlags.Public | BindingFlags.Instance); // using (StreamWriter sw = new StreamWriter(path, true)) { if (csvFileLength <= 2) { sw.WriteLine(string.Join(", ", props.Select(p => p.Name))); } foreach (var item in items) { sw.WriteLine(string.Join(", ", props.Select(p => p.GetValue(item, null)))); //var newLine = string.Format(write, Environment.NewLine); //csv.Append(newLine); //File.WriteAllText(path, csv.ToString()); } } | How can I create an Excel spreadsheet with C# without requiring Excel to be installed on the machine that's running the code? |
These sites ask for a professional level of research both in questions and answers. They are for-profit sites, but people are not paid for questions or answers. So, is this a form of exploitation? If, for whatever reason, somebody wants to spend time helping others to learn for free, why don't they do that for a non-profit site, for example improving articles in Wikipedia? The question is about ethics, not law. The answer should address the fact that some people are making a huge amount of money while the work is been doing for free by other people. I also wonder if all of the site is purposefully designed for this to happen (the "rewards" system, the rules for a question to not be deleted...) which would make this site even more unethical. Of course anybody is free to contribute or not and of course I won't contribute. | Is Stack Exchange in violation of New York labor law, in using volunteer moderators? I found a document, which states: Q: Can for-profit and non-profitmaking institutions have unpaid volunteers? A: By definition, the term volunteer means a person who works for a non-profitmaking institution under no contract of hire…and with no promise of compensation, other than reimbursement for expenses as part of the conditions of work. A person may do volunteer work in a non-profit organization, if that organization is set up and operates strictly for charitable, educational or religious purposes. For-profit organizations may not use unpaid volunteers (who meet certain criteria) except for a short term recreational or amusement event run by that organization. Am I drawing the correct conclusion, that actually a for-profit organization, such as Stack Exchange, is not permitted, under New York State labor law, to use volunteer labor for moderation tasks? Related: |
I'm trying to get a Staggered Grid layout using a RecyclerView in one of my ViewPagers fragments. When I start the app, it immediately crashes and throws this error: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setAdapter(android.support.v7.widget.RecyclerView$Adapter)' on a null object reference at xxx.HomeActivity.onCreate(HomeActivity.java:39) at android.app.Activity.performCreate(Activity.java:5990) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) My first thought is that this might be caused by the order in which the views are loaded but i'm not sure. I have a ViewPager with 2 fragments. I have the RecyclerView declared in the first fragments xml, like so: res/layout/fragment_home.xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v7.widget.RecyclerView android:id="@+id/home_grid" android:layout_width="match_parent" android:layout_height="match_parent" /> </RelativeLayout> Heres the relative parts of my Activity: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); ButterKnife.bind(this); setupToolbar(); setupTabs(); HomeGridAdapter adapter = new HomeGridAdapter(Contacts.createFakeContacts(20)); RecyclerView recyclerView = (RecyclerView) findViewById(R.id.home_grid); recyclerView.setAdapter(adapter); recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)); } Here is the first fragments Java file: public class HomeFragment extends Fragment { public static final String ARG_PAGE = "ARG_PAGE"; private int mPage; public static HomeFragment newInstance(int page) { Bundle args = new Bundle(); args.putInt(ARG_PAGE, page); HomeFragment fragment = new HomeFragment(); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPage = getArguments().getInt(ARG_PAGE); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_home, container, false); } } I dont think i need to post the RecyclerViews adapter code as I dont think that is part of the issue, but if its needed I can. Any input on this issue is appreciated! EDIT: As requested, heres my activitys xml file: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".HomeActivity"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:minHeight="?attr/actionBarSize" android:layout_width="match_parent" android:layout_height="75dp" style="@style/ToolbarStyle" > <android.support.design.widget.TabLayout android:id="@+id/tab_layout" android:layout_width="match_parent" android:layout_height="match_parent" app:tabMode="scrollable"/> </android.support.v7.widget.Toolbar> <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"/> </LinearLayout> | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
I started writing a primitive ssh-like program for practice's sake. I was starting to check if the commands would be delivered properly before implementing any further functionality, so i just wrote a server which receives messages from the client and prints them in it's own console window, but before it receives a message, it sends a prefix to the client, which the client prints so it's right before ( to the left of) the user input. For the prefix to be to the left of the input i tried to use print( ... , end=''), but that seems to break the whole thing, and the prefix then does not print at all, as opposed to the solution where the prefix is printed the line before, where the program works perfectly fine besides that little problem. TL;DR : this (where s is the socket) for n, line in enumerate(sys.stdin): prefix = s.recv(16) print(prefix.decode('utf-8'), end='') s.send(line.encode('utf-8')) code does not print the received prefix at all, only after closing the program with CTRL + D or CTRL + C as shown below: czyngis@czyngis-mint:[directory censored]$ python3 cmd_client.py -t fc70:6872:4c6:10ae:71c::1 -p 9999 target: fc70:6872:4c6:10ae:71c::1 | port: 9999 connection established with: fc70:6872:4c6:10ae:71c::1 on port: 9999 first code sample //< user input does not work :( //< user input ^C<#CMD:><#CMD:><#CMD:>Traceback (most recent call last): File "cmd_client.py", line 26, in <module> for n, line in enumerate(sys.stdin): KeyboardInterrupt and this ( where s is also the socket ) for n, line in enumerate(sys.stdin): prefix = s.recv(16) print(prefix.decode('utf-8')) s.send(line.encode('utf-8')) code does print the prefix, but in the previous line, as shown below: czyngis@czyngis-mint:[directory censored]$ python3 cmd_client.py -t fc70:6872:4c6:10ae:71c::1 -p 9999 target: fc70:6872:4c6:10ae:71c::1 | port: 9999 connection established with: fc70:6872:4c6:10ae:71c::1 on port: 9999 <#CMD:> second code sample <#CMD:> works, but not quite :(^CTraceback (most recent call last): File "cmd_client.py", line 26, in <module> for n, line in enumerate(sys.stdin): KeyboardInterrupt Thank You for any help in advance. | Is output buffering enabled by default in Python's interpreter for sys.stdout? If the answer is positive, what are all the ways to disable it? Suggestions so far: Use the -u command line switch Wrap sys.stdout in an object that flushes after every write Set PYTHONUNBUFFERED env var sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) Is there any other way to set some global flag in sys/sys.stdout programmatically during execution? |
I always try to avoid inserting some function name (or class, method, etc.) in the title of the question, but sometimes I just can't. In those cases, how should I format the function name? For example, should it be or just Difference between mod and rem in Haskell? There are some scenarios where it is obvious you're including some function name in your question (like Problems with print() Python, etc.), but in my example, it isn't. | I see more and more titles with backticks in the title (like mine here)... For example: Is this a good practice? I guess not because I find this ugly, so there are three suggestions possible for me: Avoid them in titles, and put a warning if the user try to use it (not an error, some user could need it some day) Format titles to set a monospace font for words surronded by backticks (without changing the background-color) Edit manually posts and remove backticks (see current accepted answer) ... or any other ideas if someone has a better one :) |
I'm not very familiar with number theory so forgive me if this is a basic question. Consider the equation: $$\alpha \ n + \beta \ m = 0,$$ with $n,m$ being integers. One can easily see that the above equation can only have a solution when $\alpha/\beta \in \mathbb{Q}$. My question is: Is there a general solution $(n,m)\in \mathbb{Z}^2$ for the above equation in terms of an arbitrary $\alpha,\beta$ satisfying $\alpha/\beta \in \mathbb{Q}$? | Let $\dfrac{a}{b}=\dfrac{a'}{b'}$ , $a,b,a',b' \in \mathbb{N}$ s.t. $a$ and $b$ have no common factors. How can we show that the only solution to this equality is $a'=na$ and $b'=nb$, $n$ is a natural number. I know that $a'=na$ and $b'=nb$ is a valid solution of equation-1, because $(an)b=(bn)a$. But how can we prove that this is the only solution? What I have tried is this: Version 1. We know the two fractions $\dfrac{a}{b},\dfrac{a'}{b'}$ are equal iff $ab'=a'b\tag{1}.$ Let $ab'=a'b=c$. Now, $a$ and $b$ have no common factors means that they are coprime, so we have, $a=p_1p_2\cdots p_m$ and $b=q_1q_2\cdots q_n$. $p's$ and $q's$ are prime numbers and no $p$ is equal to any $q$. Equation 1 becomes $$(p_1p_2\cdots p_m)b'=(b_1b_2\cdots b_n)a'$$ By the Fundamental theorem of Arithmetic, both the sides should have same prime numbers, so $b'$ should contain $(b_1b_2\cdots b_n)$ and $a'$ should contain $(p_1p_2\cdots p_m)$, i.e. $b'=r(b_1b_2\cdots b_n)=rb$ and $a'=(p_1p_2\cdots p_n)s=sa$, where $r,s \in \mathbb{N}$. Now equation 1 becomes, $a(rb)=(sa)b$. This leaves the only possibility, $r=s$. Version 2. The idea is basically the same as of version 1, but now I use Euclid's lemma in place of FTA. We know the two fractions $\dfrac{a}{b},\dfrac{a'}{b'}$ are equal iff $ab'=a'b\tag{1}.$ Let $ab'=a'b=c$. $a$ and $b'$ are the factors of $c$, so both of them divide $c$, i.e. $a|c$ and $b'|c$. Now $a|c \implies a|{(a'b)}$, by Euclid's lemma, $a$ divides at least one of $a'$ and $b$, but we know that $a$ doesn't divide $b$, so $a$ has to divide $a'$. Similarly we can show that $b$ divides $b'$. So we have $a'=\alpha a$ and $b' = \beta b$, where $\alpha, \beta \in \mathbb{N}$. Substituting these in equation 1 gives $\alpha = \beta$. Question Is my method correct? Is there any other method to prove that $a'=na$ and $b'=nb$ is the only solution of $\dfrac{a}{b}=\dfrac{a'}{b'}$; If yes then please explain. Also if $a$ and $b$ have common factor then for what condition there does not exist any $n$ s.t. $a'=na$ and $b'=nb$ where $n$ is a natural number. E.g. $\dfrac 39 = \dfrac 26$ P.S: I've just improved my question. Barry's comment points a crucial error in my previous proof. I needed to justify $a|a'$ and $b|b'$. In previous proof I proceeded with proof by contradiction. The proof by contradiction was ok, but unnecessary, so I've replaced it with a direct proof. At the time of asking the question I lacked the knowledge of some introductory number theory concepts. Now I've learned them and soon I will ask in comments for further clarifications. Thank you. |
The installation process pass normal, and after restarting the graphic doesn't start. It appears message "The system is running in low-graphics mode" maybe is something connected with the chipset on the laptop VIA Chrome9 HC IGP. Does someone know fix for this problem with VIA chips, or exact procedure to solve the problem. Thanks in advance! | Note: This is an attempt to create a canonical question that covers all instances of "low-graphics mode" error that occurs to a user, including but not limited to installation of wrong drivers, incorrect or invalid lightdm greeters, low disk space, incorrect installation of graphics card like ATI and Nvidia, incorrect configuration of xorg.conf file while setting up multiple monitors among others. If you are experiencing the "low-graphics mode" error when trying to login but none of the following answers work for you, please do ask a new question and then update the answers of this canonical question as and when your new question gets answered. When I try to boot into my computer, I am getting this error: The system is running in low-graphics mode Your screen, graphics cards, and input device settings could not be detected correctly. You will need to configure these yourself. How do I fix the failsafe X mode and login into my computer? Answer index: |
I'm writing a research paper in finance. I'm taking help of Wikipedia definitions for the introduction part. Do I have to mention it in the Appendix part? | For example, suppose you're writing an article about triangles, and you want to include a short proof of Pythagoras' theorem, but you can't quite remember how to derive it, so you pop over to: and check the proof there. It works mathematically, makes sense and is as far as you can tell, correct, so you include it. Now the proof on Wikipedia doesn't have a citation because probably someone has been taught it and copied it over to Wikipedia, but it's still correct. The only thing you could cite for the proof would be Wikipedia, would a citation be ok or should it just be copied down without a citation? Edit: Ok, there have been many responses. Most with a firm "no", but some giving the reason: "Just get the proof from a book" since it's so common, but suppose then it wasn't a common proof of something. Maybe it's not very well known or something but suppose there is a small Wikipedia page with the correct mathematical proof. How much effort are people going to go to to find a proof in a book when there's a (correct (which we know, becuase it's maths and we can check it)) proof on Wikipedia? Why is it so bad to say: "I found this proof on Wikipedia, and the maths checks out so it doesn't matter who wrote it, it is correct, but that's where I found it." Or if you do find it somewhere else why not say: "Proof taken from Wikipedia and verified by the proof shown in "Triangles and their properties, Nature, 2014, p113 etc..." |
i can't remplace a column in table with JProgressBar I apply the cell renderer to a specific column in the table: table.getColumn("PROGRES").setCellRenderer(new ProgressCellRenderer()); but it just delete the column . public class ProgressCellRenderer extends JProgressBar implements TableCellRenderer { /** * Creates a JProgressBar with the range 0,100. */ public ProgressCellRenderer(){ super(0, 100); setValue(0); setString("0%"); setStringPainted(true); } public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { //value is a percentage e.g. 95% final String sValue = value.toString(); int index = sValue.indexOf('%'); if (index != -1) { int p = 0; try{ p = Integer.parseInt(sValue.substring(0, index)); } catch(NumberFormatException e){ } setValue(p); setString(sValue); } return this; } | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
I am trying to show $$\int_{0}^{\infty}\frac{\sin^{3}(x)}{x^{3}}\mathrm dx = \frac{3\pi}{8}.$$ I believe the contour I should use is a semicircle in the upper half plane with a slight bump at the origin, so I miss the singularity. Lastly I have the hint to consider $$\int_{0}^{\infty}\frac{e^{3iz}-3e^{iz}+2}{z^{3}}\mathrm dz$$ around the contour I mentioned. Thanks for any help or hints! | show that $$\int_{0}^{\infty} \frac {\sin^3(x)}{x^3}dx=\frac{3\pi}{8}$$ using different ways thanks for all |
How do I copy a card? I keep reading that I have to tap the side bar on the back of the card. I'm assuming the side bar is those little grey lines... But they don't respond to tapping. I know I am the administrator because I'm the only on on the board. | Is there a way to copy a Card (project) in Trello including the checklist that it includes? |
Suppose 1: I am a 25 year old just about to finishing my PhD in pure mathematics, and have saved about $100 K USD so far in my life. I have saved all $100 K USD in an American Bank (actually Bank of America). Actually all $100 K USD can be used for investment, because I have additional saving (like extra $50K USD for backup). Suppose 2: You are senior and more intelligent in finance and investment issue. You wanted to give me some serious advices. What would you recommend me to do with this $100 K USD in the upcoming years? Say the next 10 or 20 years, and I am staying in USA. i.e., Best secnario for a 25 yo finshing a PhD, focus a career in Academia but invest her $100 K USD at hand Suppose 3: I would still focus most of my time doing research as I am applying my postdoc in pure mathematics. But I like to make the best enhancement for this $100 K USD. Are there some good ways to invest this money, while put my minimal attention on this investment, however I can still gain the most of profits/increase-ment out of it? (Much better than putting in a Bank.) Note: I am currently living in US in the east coast near NYC, but I am not a US citizen (yet). I would be having about a $70K USD salary per year for upcoming years. Thank you for the precious advices! Edit: My question is different from , because I am working in Academia, so I wish to focus on my academic research/teaching, and have least distractions while stably investing. Also my starting background is different from the other post. | I am young, just started my career, and looking to begin investing so I can make my money work for me. I'm still living like I did in college (occasional purchase on myself, but most of it goes into savings) and I would like to take the extra money and invest it. What would you suggest are the best options for me to begin? I was considering getting a personal investor [a financial advisor] for perhaps a year or so, but I've heard that they really are not worth the money. I wanted to get the input of the great minds here. |
I am an Irish citizen, along with my whole family. My in-laws are non-EU citizens. They travelled to the UK on a visit visa while they applied for an Irish visit visa in their home country. During their stay in the UK, their Irish visa was approved. After facilitation through the Department of Justice visa section, they got their visa at the Irish Embassy London. Two days later, they came to Ireland via cheap budget flight, landing at Belfast airport because they wanted to see Belfast, as well. Then, we travelled via road in my Irish registered car to Dublin. They stayed two weeks and flew back to the UK via Ryan. In this whole process their passports were never stamped. In fact, apart from their airline tickets, there is no evidence they had travelled to Ireland. They applied for another Irish visit visa. They wrote in their visa application that they did travel to Ireland, but the visa section is asking for proof of the stamp for that visit. How can we explain that there is no border control so no stamp was put in? Was their entry illegal even though they had valid visas for both the UK and Ireland? Should we have done something differently? | With the Common Travel Area forming a partially open-border zone, what should a non-EU/Schengen citizen travelling within it keep in mind? For example, do passports get checked, and perhaps stamped, at internal CTA borders? |
I am trying to install latest ubuntu 20.04 base with openbox and lightdm. I did 14.04 which worked perfectly. But on 20.04 everytime apt automatically installs ubuntu desktop environment and both gdm3 and lightdm. Why is that happending and is there any way to turn this off? These are what i did: prep base rootfs and chroot cp resolv.conf apt install linux-headers-generic linux-image-generic lightdm openbox obconf xterm backport-iwlwifi-dkms git nano | I use to set up my Ubuntu desktop from scratch, (Ubuntu server + Xorg + Openbox etc...). But I found out that in the 20.04 lts version, Xorg comes with Gnome out of the box. I tried sudo apt install xorg-server but I get an error: E: Unable to locate package xorg-server Is it still possible to install Xorg without installing Gnome ? |
I wish to have the following: However when I use \sum_{j=1}^k S(n,j), it gives me: How do I get the first rendering? Thanks!!! | I'm very familiar with how symbols display differently in inline mode (with $ ... $) vs. how display math shows them (with \[ ... \] or $$ ... $$). Two examples would be with limits $\lim_{n\rightarrow \infty}f(x)$ vs. \[ \lim_{n\rightarrow \infty}f(x) \] and with sums $\sum_{n=1}^{x} n^2$ vs. \[ \sum_{n=1}^{x} n^2 \] My Question is: How do you display these things in inline mode (with all the nice inline formatting) as if they were in display mode ? The inverse -- how to display things in display mode as if they were in inline mode -- is also of interest. |
Im confused, when i use getClass( ) from a superclass reference variable that's pointing to a subclass object, the result is the subclass. Heres a simple example: public `class` TestGetClass { public static void main(String[] args) { Object obj = new Integer(20); System.out.println("obj class: " + obj.getClass()); } } The output gives me the Integer class instead of the Object class. obj class: class java.lang.Integer Can someone explain please | Are dynamic dispatch and dynamic binding the same thing? Thanks Maciej |
It's giving me following error mentioned below after trying to install wine v1.7 on ubuntu 14.04.2: libgbm1 : Depends: libgl1-mesa-dri libudev1 : Depends: libcgmanager0 but it is not going to be installed wine1.7 : Depends: wine1.7-amd64 (= 1:1.7.44-0ubuntu1) but it is not going to be installed Depends: binfmt-support (>= 1.1.2) Depends: wine1.7-i386 (= 1:1.7.44-0ubuntu1) Recommends: cups-bsd Recommends: gnome-exe-thumbnailer but it is not going to be installed or kde-runtime but it is not going to be installed Recommends: ttf-mscorefonts-installer but it is not going to be installed Recommends: winetricks but it is not going to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. | I am not sure what caused this error, but here is what the whole error says, and also this is sitting as a notification, and preventing me from updating any software using Update Manager - Please provide some assistance or tell me how to figure out what to do to fix it. Could not calculate the upgrade An unresolvable problem occurred while calculating the upgrade. Please report this bug against the 'update-manager' package and include the following error message: 'E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' |
We've been . Some of us were getting frustrated that some users were smashing through 20 reviews in a minute so I decided to lay down the law. Aaaanyway, as part of this brought up the problem that if they take too long being diligent (looking into duplicates properly, checking rules, etc) there's a very good chance that somebody else will have reviewed that post and their decision (and the time that went into it) is wasted. That doesn't seem like a fair reward for what is an otherwise thankless task. So I'm suggesting the a review "reservation" system so only one person can review something at once: Once something is opened in review, it becomes unavailable to other users to review. That includes other queues. A reservation or lock should be against a post, not a post in a queue. The reviewer should get, for example, two minutes of alone-time with a post. If they review before their time is up, the lock goes away. If they're still reviewing when their time runs out, a notification should pop up (audio too?) and allow them to request an extension... Perhaps with 10 seconds grace to stop somebody else being allocated something. Questions are simply allocated on a first-unlocked-post basis. There should be a safety-limit on the number of times something can be review-locked or extended so that somebody can't wrongfully extend the life of a bad post (offensive/spam/etc) by gumming up review. It sounds messy (and there's certainly some concurrency issues if you've split the servers out horizontally) but data-wise, it's actually not too hard to implement (speaking as somebody who has implemented an edit-lock system before). Above all else, it shows reviewers the respect they deserve for a job that few of us really want to do. | More and more frequently in the review queues, I am spending time either fixing a post or considering whether an edit is valid, etc, only to make changes and have them denied/not count because someone else has blindly hit the approve button in the meantime. My proposal is for the system to "lock" a post in the review queue once it has been presented to someone for review. Do not let anyone else (in the review queue) do anything with it until it is released by the last user it was presented to (or a certain amount of time has elapsed). By "lock" I mean that it won't show up in anyone elses list until released. I did NOT mean that it would be in multiple queues and be unactionable in some of them. This would fit well as the queues only present one at a time anyway. This will allow people trying to make good decisions the time to do it and prevent someone else from making that effort a waste of time. As support, look to some of the published reasoning behind the auto-question ban. A large portion of it is that bad questions waste the time of the community. Taking the time to ensure you are making a good decision in the /review queue only to have it not count because someone was badge-whoring and clicking the approve button as fast as they could also wastes the users time... arguably the more (for lack of a better way to put it) valuable user who is willing to invest some time and thought into making the site better. |
As a thought experiment, I was trying to find a way to constantly dilate time while keeping an object effectively in place. I quickly decided that moving forwards and backwards wouldn't work—the speed would be zero at the turning points. My next idea was to use circular motion—an object could move at a great speed in circles while staying in the same location. Would time still dilate for such an object? EDIT: One of my problems with this concept is that a rotating radius would have different speeds along its length, possibly therefore leading to different degrees of time dilation along its length. | With today's ultracentrifuge technology, they can spin so fast that the sample can be subjected to accelerations of up to 2 millions Gs. That is equivalent to two solar masses. Has someone tried to measure the time dilation in a radioactive sample? How calculate that time dilation respect to the time outside the ultracentrifuge, for example one week. I think that that time dilation will be significant enough to be measured. |
The quaternion group has the following presentation: \begin{eqnarray} Q=\langle i,j,k|ijk^{-1},ik^{-1}j^{-1},ij^{-1}k\rangle. \end{eqnarray} I have derived down $i^2=j^2=k^2$ by a proper multiplication of the words in the relation. My question is how to get $i^4=j^4=k^4=1$. | If we are handed the group presentation $\langle i,j,k \mid i^2=j^2=k^2=ijk \rangle$ and nothing more, can we deduce that this is the quaternion group? Nothing in this presentation tells us that $i^2=j^2=k^2=ijk=-1$ and that $i^4=j^4=k^4=(ijk)^2=1$. Can we conclude these relations from the relation given in the presentation? |
I am trying to write a program in Java that compares to times and displays them in order. Everything works, except for the fact that if someone entered for example a 10 for the hour, and a 9 for the minute, it prints as "10:9". I would like for each single digit to have a 0 in front of it when it prints. The h variable stands for hour and the m variable stands for minute System.out.printf("First time: %02d" , h1 , ":%02d" , m1 , "\nSecond time: %02d" , h2 , ":%02d" , m2); | Is there a better way of getting this result? This function fails if num has more digits than digits, and I feel like it should be in the library somewhere (like Integer.toString(x,"%3d") or something) static String intToString(int num, int digits) { StringBuffer s = new StringBuffer(digits); int zeroes = digits - (int) (Math.log(num) / Math.log(10)) - 1; for (int i = 0; i < zeroes; i++) { s.append(0); } return s.append(num).toString(); } |
I am building a terminal simulator in Python, and i have the commands stored in arguments, like: def ls(a): for item in os.listdir(): print item a = input('Command: ') a = a.split() The terminal works like this: Ask user for input Splits the input Uses the first part of input to search a function in locals If there is one, uses the rest part of input as argument Calls the function And i have a problem with cd command. def cd(a): if a == None: print('cd') print('Change directories') else: os.chdir(os.getcwd() + '/' + a()) It works when you make it enter a folder without spaces, like when you type cd Windows in the prompt, it works. But the problems start when you try to enter a folder that has spaces in it. When i type, for example, cd Documents Copy, it either enters the folder Documents if there is one, or crashes. How i can fix it? I had a thought about turning all called function arguments into one, but i dont know how to do that, and there might be other ways. | I have a string which is like this: this is "a test" I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is: ['this','is','a test'] PS. I know you are going to ask "what happens if there are quotes within the quotes, well, in my application, that will never happen. |
I am writing a German text with some Scandinavian names which include characters like ø. In one case the ø is at the end of the word and the following whitespace is ignored. MWE: \documentclass{article} \begin{document} Near the town of Errits\o is Fredericia. \end{document} appears as The word separation between "Erritsø" and "is" is missing. What is causing this problem and how can I solve it? (How) Is it affected by inputenc and/or fontenc? | With a macro such as: \def\naive{na\"{\i}ve} I find that the space which I would hope to follow it, is absent. So, with the \naive approach I get the naïveapproach in the output. How do I bring back the space? |
I have already sent the visa application off the the hub in NYC for a visa to the UK and didn't realize I had to put a rush on it when I originally applied. I leave for Australia shortly and want to know is there anyway to contact anyone to speed up the process, I am happy to go in person to NYC but it seems that is not doable, and I can not find any phone number to call either? I am a US citizen and applied that way, but also an Australian citizen.. | I have applied for visa to UK on 28th June, 2016. I have to travel on 17th July, 2016. But still my visa request is pending. Who can be requested to expedite my application? What can someone do in situations like these? |
I have a pair of Bose QC2 headphones and the volume is WAY too loud in windows on all jacks: I have tried the following jacks: speaker out on back of motherboard headphone out external USB sound card (Sabrent Aluminum USB External Stereo Sound Adapter) In each case, even a windows volume setting of 1/100 is too loud. Using the same headphones on my macbook pro the lowest volume is MUCH lower. Is there any way to reduce the volume levels? I'm debating purchasing a more expensive external sound card that has a volume knob that is independent of the windows system volume. | In Windows 7 (64-bit, Ultimate) the default audio output is extremely high. This has been an issue for a while but I was able to get around it as my previous headphones took more power to drive so it actually worked in my benefit. However, now I have a set of really sensitive headphones and they're being over-powered. So much so that if I put it down at around 5% of total output it's bearable. Is there a way I can sort of limit the system's volume so that it's incapable of going extremely loud and then have the rest of it just behave as normal? Things I've tried: Uninstalling and re-installing the audio device and drivers. Limiting each application individually. Searching for third-party software (so far nothing looks promising). The first has no effect. The second works find but I have to do it for every application individually (which can be a pain) and many of them reset their volume every time they're launched, which makes it almost useless. Some even reset the volume while I'm playing a game! So does anyone have any suggestions on how to make my volume reasonable? The device is, apparently, a Cirrus Logic CS4206A (AB 24). The computer is an 2010 iMac. |
I am going to integrate BLOG to my website. Which is best SEO friendly URL for blog from below : 1 - blog.mysite.com 2 - mysite.com/blog Please advice me so I can do as per that. I am SEO beginner and want to make everything perfect because My blog will have fresh posts daily , weekly and want to generate traffic by blog. | I recently moved from having a main site like www.example.com with a subdomain associated site yyy.example.com, to moving everything off the subdomain to a subdirectory like www.example.com/yyy/, with the same hierarchy underneath the subdirectory, and now yyy.example.com is just a redirect page to the subdirectory, so yyy.example.com/abc/page-x is redirected to www.example.com/yyy/abc/page-x and so on. The effect has been that the traffic increased by several times (the total page views are more than ten times at the present rate) what it was to the yyy subdomain. Previously almost all of the traffic to the yyy subdomain was from the www site. This is from monitoring the old yyy site for a year or more. I'm curious to know if there's any research or results which would indicate whether this is universal (subdirectories beat subdomains) or "just me". |
Please anybody help me! I am building kernel from source code downloaded from . I successfully built it and installed modules. Now i want that my kernel option should come at the boot time and i want to select it. After doing some search on google i copyed bzImage in /boot folder. i copyed System.map file in /boot folder Now i want to make a entry for kernel at boot time. I know that i have to make changes in "/etc/grub.d/" and "/etc/default/grub" after that i will have to run "update-grub" but problem is that how i will set fields. set root='(hd0,msdos6)' search --no-floppy --fs-uuid --set=root c291827c-6678-4067-ad09-01481681a9f9 echo 'Loading Linux 3.5.0-45-generic ...' linux /boot/vmlinuz-3.5.0-45-generic root=UUID=c291827c-6678-4067-ad09-01481681a9f9 ro recovery nomodeset echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-3.5.0-45-generic These are some of the fields but i do not know how to get value of uuid, what to set in root (like hd0,msdos6), what is its meaning , how to get initial ramdisk image? Please do not say that this question is similar to this or that question. I have searched it already at google and stack overflow but nothing solved my problem , all i got is 100s of tab opened in my browser. My Requirements :- How to get uuid for new kernel image? what is (hd0,msdos6)? how to get this value for new kernel image? Plesae help me! | How can we add a kernel to grub2? i knew the stuff we could do with the former versions, but it seems to have changed. What files should we edit? |
I am trying to load in a blender file and export it as an OBJ file with with materials. The approach I am trying to use is to bake all of the materials (using cycles) into a diffuse and specular (glossy) map. This seems to work well for simple objects, however once I am using an object with textures, I am running into problems. First I combine all of the objects together into a single mesh (ctrl J) so I can have a single map for all of them. In order to bake the materials, I have to unwrap the mesh, create an image texture in each material, assign it to the target image I create, then bake the diffuse and specular individually. When I try to use textures for my materials, I run into problems. I am unable to unwrap the mesh for baking because this will mess up the original UVs for displaying the object. Is there any way I can keep the starting UVs, then create a new set of UVs for baking? Or is there a better approach for solving this problem? EDIT: I believe this is duplicate. Sorry. Just found: | The title says it all but i'll give further details. I have a 3D mesh on which I have already applied some textures, but i didn't care about uv mapping it the proper way. The problem is I figured out I must care about that now but I don't wanna retexture it from scratch. Is there a way to remap the UV while keeping the texture intact in its place? |
How to extract root domain in C#? www.google.co.in => google.co.in google.co.in => google.co.in coo.coo.coo.coo.com => coo.com www.google.com => google.com Do I have to hardcode all the top-level domains into my application? The code I have is found on every topic concerning this problem: string domainName = host.Split('.')[host.Split('.').Count() - 2] + "." + host.Split('.')[host.Split('.').Count() - 1]; But it doesn't work for domains like google.co.uk (as it returns co.uk) Edit: What I have found working so far is doing a HTTP request to "" which returns a 301 response code with a url containing the root domain. This is the most reliable solution for me at the moment. Maybe there is another free API for doing this? | Getting the subdomain from a URL sounds easy at first. http://www.domain.example Scan for the first period then return whatever came after the "http://" ... Then you remember http://super.duper.domain.example Oh. So then you think, okay, find the last period, go back a word and get everything before! Then you remember http://super.duper.domain.co.uk And you're back to square one. Anyone have any great ideas besides storing a list of all TLDs? |
how do I flip image left to right(mirror) on a secondary display with windows XP professional? Want to Show my desktop using a teleprompter. | How can I invert the screen on Windows XP? Not rotate, but flip/invert horizontally? I want the text, and everything else on the screen, to go from right to left. |
Let $T:c_0 \to c_0$ defined by $T(\{s_j\}_j)=\{s_{j+1}-s_j\}_j$. Prove that $T''$ is not injective. I tried even knowing that $(c_0)' \sim l^1$,in fact if $F\in (c_0)'$ then there exist $s=(s_j)\in l^1$ such that $F=F_s$ and $F_s(t_j)=\sum s_jt_j$ , and similar for $(l^1)' \sim l^{\infty}$. It's easy to prove that $T''$ is injective if and only iff the image of $T'$ is dense on $X'$. Maybe this is easy to prove. | Prove that if $T''$ is injective then $T$ it's injective, but the converse it's not true. I proved the first part " $T''$ injective implies $T$ injective". It's easy to prove that $T''$ is injective if and only if the image of $T'$ is dense on $X'$. So If I prove that the $cl({Ran(T')})$ it's a proper subset of $X'$ then I'm done. But even this it's difficult. |
I am running a game of D&D 5e. I am using an app to determine how a bandit does his attack against our group of players. The app says this in the bandit's statblock: Scimitar. Melee Weapon Attack: +3 to hit, reach 5 feet., one target. Hit: 5 (1d8+1) piercing damage." What I'm confused about is how much damage the bandit does on his d8 roll (assuming he beats my group's AC on his d20 roll). Do I add the +3 to hit, d8+1, and the 5 sitting outside the () or what...? | My friends and I are very new to D&D, played like 3 times. In a monster's stats next to weapon damage it says stuff like "+11 to hit" and "Hit: 5 (1d8+1)". For the premade characters it just says things like "+4, 2d6 + 2 slashing", though. Why are there two "hit" numbers for monsters? Which do I use for the d20 roll to hit against a target's AC? I mean for example like in the Ogre entry in the "" article on monsters. |
I am using an iPhone 4 running ios 7.1.1. Recently, I've had a very frustrating problem, and it is not being able to listen to music with speaker. I'm pretty sure the speaker isn't broken because I can use it for alarms. Also, in my voice memos, the sound works although I have to click that speaker button on the top right corner so that the sound would come out of the speaker instead of the earpiece (top speaker). When listening to music, there is completely no sound, and I can't adjust the volumes. Here's a screenshot of my music. I think the problem first occurred after recording with my voice memos and syncing my phone to iTunes to transfer my recording from my phone to PC. After that, there's just no sound coming out of my phone speaker. The music works when i'm using earphones. It's still frustrating though. Any suggestions? | I have an iPhone 4S and the speakers are not working for applications. The speaker works when doing voice calls on speaker phone, adjusting the ringer, and other default things. However, when trying to have audio for YouTube and other applications it does not work. It wasn't working for IOS 6.1.3 and I have now upgraded it to 7.0.4 with no luck. I then restored again with no luck. I believe the fact that it works for the speaker phone and ringtone would suggest it is not a hardware problem but a software problem. Any suggestions? |
Assuming an illusion spell can create a working mirror: If I use an illusionary mirror to look around a corner, a corner that neither I nor the caster of the illusion can see, what do I see in the mirror? OR to phrase it another way, how do illusions deal with incomplete caster knowledge? Inspired by the comments on the question . | Can you use Minor Illusion to create an illusion of a working mirror, i.e. with a working reflection? |
I am building a todo app. When I add a todo and then click on the todo item below, its text should be crossed (line-through) but its not happening. HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link href="style.css" type="text/css" rel="stylesheet"> <title>Todo</title> </head> <body> <div class="container"> <div class="header"> <h1>Todo</h1> <div class="add"> <div class="text"> <input class="data" placeholder="Enter data"> </input> </div> <div class="submit"> <div class="submit-text"> Add </div> </div> </div> </div> </div> <script src="http://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script> <script src="script.js" ></script> </body> </html> CSS: body{ margin:0; padding:0; } .container{ width:600px; margin:0 auto; color:#000; } .header{ background:#dddddd; height:200px; } .header h1{ color:#FFF; font-size:50px; text-align: center; margin-top:0px; } .add{ height:50px; background:#FFF; border-left:1px solid #dddddd; } .text,.submit{ display:inline-block; float:left; } .text{ width:70%; height:100%; } .submit{ width:30%; background:green; height:100%; font-size: 30px; } .data{ font-size: 30px; /* margin-top: 10px; */ /* padding: 10px 0; */ padding-left: 10px; width:100%; border: none; padding-top: 8px; padding-bottom: 8px; } .submit-text{ /* margin-top: 10px; */ padding: 10px 0; text-align: center; color:#FFF; } .todorow{ width:100%; height:50px; font-size: 30px; padding-top:10px; background:#000000; color:#FFF; } .todoitem{ width:95%; float:left; display:inline-block; } .todoremove{ width:5%; float:left; display:inline-block; } .strike{ text-decoration: line-through; } JS: console.log("loads"); $(document).ready(function(){ $(".submit").click(function(){ // if (document.getElementsByClassName("data")[0].innerHTML >0) //{ var value = "<div class='todorow'><div class='todoitem'>"+$('.data').val()+"</div><div class='todoremove'>X</div></div>"; $(".container").append(value); //} }); $(".todoitem").on("click", "#__internal", function(){ $(".todoitem").addClass("strike"); alert("done"); console.log("done"); }); console.log("loads"); }); | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
I was checking direct comparison between strings using == operator. When both string is character pointer that it compare correctly. Sooner I realize it happen compiler by default assign same address to both char pointer variable as they hold the same value. #include<stdio.h> void update(char *str2){ *(str2+2)='O'; } int main(){ char *str1="Sudhanshu"; char *str2="Sudhanshu"; printf(" %s , %s ",str1,str2); update(str2); printf(" %s , %s ",str1,str2); if(str1==str2){ printf("True\n"); }else printf("False\n"); return 0; } The address of str1 and str2 is the same. So I want to check whether updating one pointer actually affect other. However, I'm getting a segmentation fault. Why am I getting a seg fault? | The following code receives seg fault on line 2: char *str = "string"; str[0] = 'z'; // could be also written as *str = 'z' printf("%s\n", str); While this works perfectly well: char str[] = "string"; str[0] = 'z'; printf("%s\n", str); Tested with MSVC and GCC. |
My question looks quite obvious, but I'm looking for a strict proof for this: Why can't the sum of two square roots of non-perfect squares be an integer? For example: $\sqrt8+\sqrt{15}$ isn't an integer. Well, I know this looks obvious, but I can't prove it... | Can the expression $\sqrt{n} + \sqrt{m}$ be rational if neither $n,m \in \mathbb{N}$ are perfect squares? It doesn't seem likely, the only way that could happen is if for example $\sqrt{m} = a-\sqrt{n}, \ \ a \in \mathbb{Q}$, which I don't think is possible, but how to show it? |
I installed ubuntu automatically using a jump flash, however it cannot boot without usb. I tried the way of typing "sudo grub-install/dev/sda", and it just doesn't work! Also I am still confused where I install the grub2. Hope someone can help me. The terminal screen is showed as followed: ubuntu@ubuntu:~$ sudo fdisk -l WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xa62b4079 Device Boot Start End Blocks Id System /dev/sda1 1 1953525167 976762583+ ee GPT Partition 1 does not start on physical sector boundary. Disk /dev/sdb: 7858 MB, 7858028544 bytes 90 heads, 30 sectors/track, 5684 cylinders, total 15347712 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xc3072e18 Device Boot Start End Blocks Id System /dev/sdb1 * 24 15347711 7673844 c W95 FAT32 (LBA) ubuntu@ubuntu:~$ sudo grub-install/dev/sda sudo: grub-install/dev/sda: command not found | I had Ubuntu 12.04 Beta installed on my computer. When 12.04 was finally released, I made a bootable USB Flash Drive using Startup Disk Creator. Then I decided to check if this drive works properly and to reinstall the system on my desktop. I must add, my desktop behaves a bit strange when it comes to bootable USB's, it recognizes them as HDD. In BIOS I changed priority of boot so USB Flash Drive (recognized as HDD) was first. Successfully booted, I installed Ubuntu. Everything worked fine, but... Now I cannot boot from my real HDD. Every time I want to boot, I put the USB Flash Drive into my computer, boot, safely remove it and everything works. What do I need to do to repair boot? |
You are given a number, $A$, and you have to determine a number, $B$, such that $B>A$ and the number of $1's$ in the binary representation of $A =$ number of $1's$ in the binary representation of $B$. What is the smallest $B$? | I've seen post about the $n^{\textrm{th}}$ permutation of a set but that is not what I need. If you have a bit string (ones and zeros only) there are to quickly permute the NEXT lexicographically ordered bit permutation. For example take $$000111 \rightarrow 001011 \rightarrow 001101\rightarrow\cdots$$ etc. If the string is long then there are going to be approximately one Bajillion of these things. And I want to know how to compute the $n^{\textrm{th}}$ guy without doing the exhaust. Backgound: This is for a parallel computing job where I need to farm out the search space of elements of a set. Foreground: I own a copy of Knuth's 4th volume of "The Art of Computer Programming" and I think the answer is in there but I can't seem to find it. (It's like 900 pages). I'm posting here in the hopes that someone has knowledge of this (obviously). Even if you can point me to a source, say the part in Knuth's book where he describes this problem I would be most grateful. |
I know calculus (ODEs, PDEs, integration over 3 dimensions, limits, W, Zeta functions, series etc) and am working on linear algebra. What it the best book to learn quantum mechanics from with mathematical derviations? | I'm really interested in quantum theory and would like to learn all that I can about it. I've followed a few tutorials and read a few books but none satisfied me completely. I'm looking for introductions for beginners which do not depend heavily on linear algebra or calculus, or which provide a soft introduction for the requisite mathematics as they go along. What are good introductory guides to QM along these lines? |
I was defragmenting my external hard drive which hardly had 3% free space. In the midway of defragmenting it, I stopped the process and tried ejecting the device but there was an error saying that the device is in use. But there was no window open using the drive. After 5-10 mins, I removed it from the USB slot without safely ejecting it as repeating the same error kept popping up. Upon reinserting the device the very next time, the files in it are inaccessible. What do I do other than data recovery and formatting to get the files back and access the hard disk drive. Is there any software that can repair the drive in a short time? Recovery is a very long, time-consuming process. Is at all recovery is the only option, which is the best data recovery software that can recover in the shortest possible time. | What steps can I take to try to recover lost or inaccessible data from any storage device? Answers: This applies to any computer storage device, e.g. internal/external hard drives, USB sticks, flash memory. The most important thing is to STOP using it, any type of I/O can ruin your chances of a recovery. We have separate questions covering common problems with USB flash drives in greater detail: |
For the first few months after I got my Dell Latitude D820, it worked perfectly fine. I noticed a small problem after a while. The mouse would randomly and suddenly whoosh to the lower left corner of my screen, and occasionally the upper right. This may have stemmed from an incident where I dropped a book on the lower left quadrant of my keyboard (so to the right of the trackpad). A slight impact there (like if you slap it) will cause the mouse to do this again. If it is moving slowly, my trackpad can still control it to a point, but if it's moving quickly, only my trackball can gain back some control. After I got a mouse the problem seemed to stop being so weird, but has slowly returned. It rarely moves quickly, but my mouse can sometimes gain control back. Lately, however, it's been moving softly and slowly to the upper right or lower left. It's never clicked a thing and it's the only part not working properly, so I don't think it's a virus or a hacker. Please help me, as this is doing horrible things to FPS games and Minecraft. | I have noticed for a few months that my mouse will randomly jerk across the screen. I'm super paranoid about security. But this is just silly! Has anyone else experienced this, and found out what causes it? It happens to me every couple of days. The cursor will jump across the screen about 1000+ pixels. I thought it was my mousepad - changed it, and that's not it. I imagine it's just a hardware issue. This is on a PC with a Razer Naga, wired mouse. The mouse worked for about a year before I started noticing these issues. They have persisted even after a reformat / reinstall. |
I do not know what am I doing wrong. java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference at si.skorajporocena.skorajporocena.PrvaPrijavaActivity$1.onClick(PrvaPrijavaActivity.java:51) Here is the code: EditText pass; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_prva_prijava); pass = (EditText) findViewById(R.id.etPassword); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.floatingActionButton); viewPager = (ViewPager) this.findViewById(R.id.pager); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(i==0){ if (pass.getText().toString().isEmpty()) { // <-- this is the 51 line Snackbar.make(view, "Niste vnesli aktivacijske kode.", Snackbar.LENGTH_SHORT). setAction("Action", null).show(); } else { i=1; viewPager.setCurrentItem(i); } } else if(i>0) { i++; viewPager.setCurrentItem(i); if(i==3){ Intent intent; intent = new Intent(getApplicationContext(),MainActivity.class); startActivity(intent); finish(); } //Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) // .setAction("Action", null).show(); } } }); | 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? |
For $n\in\mathbb{N}^*$, define $a_n=\left(1+\frac{1}{2}+\frac{1}{3}+\cdots+\frac{1}{n}\right)/n$. Does the sequence $(a_n)$ converge and how to prove it? | $$S_n =\frac1n \left(1 + \frac{1}{2} + \frac{1}{3} + \cdots+ \frac{1}{n}\right)$$ Show the convergence of $S_n$ (the method of difference more preferably) I just began treating sequences in school, and our teacher taught that monotone increasing sequence, bounded above and monotone decreasing sequences, bounded below converge. and so using that theorem here.. I found the $$(n+1)_{th} term$$, $$S_{n+1} = \frac1{n+1} \left(1 + \frac{1}{2} + \frac{1}{3} + \cdots+ \frac{1}{n+1}\right)$$ and then subtracted the (n)th term from it What I was able to get was... $$S_{n+1}-S_n = \frac1{(n+1)^2} - \frac{\left(1+\frac12+\dots+\frac1n\right)}{n(n+1)}.$$ ...but then this is where I get stucked, but i'm trying to prove that the sequence > 0(i.e Converges) or < 0 (i.e diverges). |
I'm getting working experience as hardware tech guy meaning I have to repair and fix used computers daily. One of those tasks is formatting all the hard disks and we use Killdisk active@, at Work for erasing all the data. I'm interested in security related things appealing for used computers, which ones someone else is gonna buy as "used", how safe is Killdisk @ Active Free version? With fast Google search, I didn't find any method to recover data erased by Killdisk. Is there any? | I had 500GB portable hard drive. it fell from the table and when i joined it was not showing any data and asked me to format it. i did format. Then again it was not functioning properly so i had to quick format it again. Now i had lots of data in it. Is there any software which can recover my files and folders with same structure as original |
This is the opposite of . Instead of asking why Time-Turners weren't used to destroy Voldemort, I want to know ... Why didn't Voldemort try to get a Time-Turner? He and his Death Eaters could have gotten one from the in many ways, (e.g. - Confundus, Imperius Curse, Polyjuice Potion, etc...) but they didn't. They clearly infiltrated the Ministry of Magic's Department of Mysteries to attack Harry. Why would Voldemort bother setting up an elaborate plan to get Harry to get a prophecy when you can sidestep all of that, grab a , and make a timeline where he takes over the world? provides an insightful out-of-universe explanation, but I prefer an in-universe explanation. | With the use of a time turner, that opens a whole "Pandora's Box" of possibilities. While the use of one can be problematical, when the Ministry of Magic found out how dangerous Voldemort was, why didn't they simply use a time turner to go back and stop him before he became dangerous? (I know this does open a lot of plot holes, but witches and wizards don't seem to worry about laws of science, so it would seem strange that magic that seems to easily supersede laws of physics (like brooms that fly without propulsion) would worry about the problematical issues of time travel.) |
I am trying to have multiple buttons on my camera preview. The app has worked with a record button and a drop-down menu button. However, once I tried to add zoom buttons for the reticle, the app crashes. The code compiles but the app won't work. Can't seem to find a helpful answer anywhere else. I have been maneuvering lines of code between onViewCreated(), onClick(), and onCreate() but I can't get the app to run. @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_camera); if (null == savedInstanceState) { getFragmentManager().beginTransaction() .replace(R.id.container,Camera2VideoFragment.newInstance()) .commit(); } getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); } @Override public void onViewCreated(final View view, Bundle savedInstanceState) { mTextureView = view.findViewById(R.id.texture); mButtonVideo = view.findViewById(R.id.video); mZoomIn = view.findViewById(R.id.imageButton1); mZoomOut = view.findViewById(R.id.imageButton2); mButtonVideo.setOnClickListener(this); mZoomIn.setOnClickListener(this); mZoomOut.setOnClickListener(this); view.findViewById(R.id.info).setOnClickListener(this); view.findViewById(R.id.imageView1).setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.video: { if (mIsRecordingVideo) { stopRecordingVideo(); } else { startRecordingVideo(); } break; } case R.id.info: { Activity activity = getActivity(); if (null != activity) { new AlertDialog.Builder(activity) .setMessage(R.string.intro_message) .setPositiveButton(android.R.string.ok, null) .show(); } break; } case R.id.imageButton1: { Activity activity = getActivity(); if (null != activity) { ImageView img = view.findViewById(R.id.imageView1); float x = img.getScaleX(); float y = img.getScaleY(); img.setScaleX(x + 2); img.setScaleY(y + 2); } } } } The code compiles but the app crashes. Logcat tells me the error is in the onViewCreated() with the setOnClickListeners(). The findViewById() is assigning null to the buttons but I can't figure out why. I eventually want to make the zoom in/out buttons to zoom the video preview instead of the reticle. Any help with that would be great too. I also plan to make an adjustable brightness seekbar so help with that would be good too. | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
I have 2 gb DDR3 1333mhz laptop ram and i want to buy another 4 gb ram DDR3 of 1333mhz but of differnt brand . so is it ok if only frequencies of 2 rams are matching or do i need to look into another parameters of RAM? I mean matching frequencies is suffice, even though brands are differnt? Thanks in advance | If I want to add more RAM to my computer, how can I buy something compatible? What kinds are there? How do I determine which kind my computer will accept and how much I can add? |
I've been trying to make a command using JSON for a map, obviously i'm testing commands in case they try and break on me. I tried making a multi-colored tellraw command and it either does one part, or the other here's the command /tellraw @a {"text":"(YOU!)","color":"blue","Bold":"true","text":"Rawr.","color":"red","bold":"true"} I've tried making it to were its like /tellraw @a {"text":"(YOU!)","color":"blue","Bold":"true"},{"text":"Rawr.","color":"red","bold":"true"} but it still doesn't work, anyone can pick up and show my mistakes i've made? | I've been at this for almost two hours and no one seems to have the same problem as I and I doubt this will be solved but I'll try anyway. this is the code /tellraw @p ["Would you like to teleport?",{"text":"Yes","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/tp @p ~ ~4 ~ "},"hoverEvent":{"action":"show_text","value":{"text":"Confirm"}},{"text":"No","color":"red","bold":"true","clickEvent":{"action":"run_command","value":"/tellraw @p{"text":"Come back when you want to teleport"}"}}}] this part is fine /tellraw @p ["Would you like to teleport?",{"text":"Yes","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/tp @p ~ ~4 ~ "},"hoverEvent":{"action":"show_text","value":{"text":"Confirm"}} it's just when I add this ,{"text":"No","color":"red","bold":"true","clickEvent":{"action":"run_command","value":"/tellraw @p{"text":"Come back when you want to teleport"}"}}}] Minecraft gives me the error: Invalid JSON at line 1 column 203 I've tried to space it out and figure out what column 203 is but I can't, I don't know what I did. Anyone got any ideas? |
The iOS beta app instantly crashes when starting it. I am running iOS 9.1 with version 1.4.0.247 of the app. It might be related to since that issue happens around the same time. Can this be fixed please? | This is the current status of the beta app: I received a notification of mine seconds ago, but cannot go to the app. After I read it on the web, the notification disappeared. I think this is a bug. I send this bug on the official app on Apple Store. App Version: 1.4.0 Device: iPad2,2 OS Version: Version 9.1 (Build 13B143) |
I try to set a hotkey for change language, but when I press buttons nothing happens. I tried to use gnome-tweaks, and this solved problem, but into my text editor stop working multiple hotkeys(Three and more keys). | When I try to set the default combo for switching to different language layouts in my keyboard from Shift+Super+Space to Alt+Shift I can't. I used to have this combo since Ubuntu 14 and even before that when I used to have Windows. Now for some stupid reason it does not allow (actually nothing happens its not like I get an error or the combo is used elsewhere). How could I bypass this bug? |
I've recently come across a few really well written and researched answers contributed by low rep users. I feel like my solitary upvote isn't sufficient reward for their efforts. (Yes, I know that truly good answers will attract votes from other users, but in less active tags this can take a while.) Is it 'wrong' to go to the user's page and go through other answers and questions they have worked on to give them 'bonus' rep? I wouldn't upvote obviously bad answers, but if the answer is at least ok - or if the answer is an area I don't have experience in - is this 'reverse-gaming' or a legitimate technique to help great new SO-ers? Edit: thanks for the feedback. It's a good thing I asked first... Might have to ask a new question about how to help people 'level up' in quieter areas of SO. | I just noticed that I lost a bunch of points from my reputation score, and I used the "reputation" tab on my user profile page to try and track down the cause. During my investigation, I noticed there was an unusual event of type "reversal". In the normal place of a question title, it says "voting corrected". What does this mean, and what caused it? Did I do something wrong? Why did I lose all of that reputation? Is the system punishing me for leaving too many good answers? Is there any way to earn it back? |
I have cube mesh pole going to the bottom of a icosphere at the moment, but I also want a mesh spiral going down it too. I don't want some single vertex line since that wont show up for rendering. Black line shows what I want, but thicker | I need to model a simple spiral shape. I imagine the best way to do this is with curves, but I am unsure how to create a perfect spiral shape with curves. What's the best/easiest way to make a spiral tube? |
I want to share my internet connection(ethernet) to my iPhone, but the network is protected by 802.1x so that I cannot do so. I have already know that I can share the internet connection with my phone using a VPN, but unfortunately the ISP blocks all VPN connections. Is there another way to achieve my target? OS X 10.10 with iOS 8.4 Thank you! | I've been struggling for a while on this, strange set of circumstances. I have a Amazon FireTV box that I cannot connect as university wireless does not support it. I'm looking for a way to set up Internet from my MacBook pro (the uni WiFi won't allow Internet sharing however - and no Ethernet in my room!). The only way i've found is to share my iPhone's 4G but I don't want to do that because of data usage. Any way I can fix this? I have an iPhone, iPad, Macbook Pro, HDMI cables, USB cables but not WiFi that I'm allowed to share! Anything I can buy to make this work? |
In French Voldemort means "flight from death". Was Voldemort aware of that fact when he created it? | Why did Tom Riddle change his name to Voldemort? What was the point of Lord Voldemort, specifically, not Lord Tom or, Lord Riddle? Tom Riddle was his officially documented name, after all... |
In Dead 7, Carrie and other movies, there have been some scenes where an artery has been severed and an open wound is visible causing an artierial spray coming from inside the wound. I am sure this may be CGI or whatever, and for the wound, I have no idea, but there doesn't seem to be any fake blood tubes coming from the area of the spray. The blood just squirts and squirts. In Dead y, Apocalypta slits a mans throat when he wants to join her and it results in arterial spray. Also in an episode of The walking dead where the cannibals have got hold of some survivors, they slit the survivors throats over a trough, resulting in arterial spray. How is this filmed? | I have seen in American Sniper, Dead-7 and Carrie that when someone is killed, they are laying on the ground with blood leaking out of their back or somewhere else on the body. The puddle continuously grows with few signs of slowing down. This is obviously not CGI because it is a real liquid (may not be real blood as that would spark an emergency in real life). I have seen in American Sniper that when the protagonist kills yet another enemy, they are filmed hitting the ground and blood starts pooling around their body. In Carrie: In the dance room where Carrie sets her powers loose and kills a lot of teenagers in the process, there are a few that hit the ground with blood pooling under their bodies. Sometimes they would be on their side with blood coming out. In Dead 7: Kimono and the other six killed lots of zombies. Some of the six were killed in the process as well before they came to Apocalypta to kill her. They were filmed hitting the ground dead with blood pooling around them. I am not sure how they film this as they are wearing thin shirts for these scenes, and not only that, but the characters also have blood (obviously fake) only just dripping out of the side of their mouths (an indicator they have a ruptured and wounded stomach or lung (in this case the blood would be pink and frothy). What is the film technique that allows this to happen? |
I don’t understand how to fix this or what this error means. | This question was recently split into different questions for each workaround. See meta posts for more information. Can you use NBT tags in commands? I’ve tried commands that normally work in Java Edition like: give @s minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}} give @s stone_pickaxe{Unbreakable:1b} give @s item_frame{EntityTag:{Invisible:1b}} summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"emerald",Count:5b},sell:{id:"diamond_sword"}}]}} summon tnt ~ ~ ~ {Fuse:20s} |
Here is my implementation of == and != operators in the class. public class MyClass { public int FirstField { get; set; } public int SecondField { get; set; } public static bool operator ==(MyClass first, MyClass second) { if (first == null && second == null) return true; else if (first == null || second == null) return false; else { if (first.FirstField == second.FirstField && first.SecondField == second.SecondField) return true; else return false; } } public static bool operator !=(MyClass first, MyClass second) { return !(first == second); } } Else where in code I have following two instances that are used for == and != comparisons. MyClass class1; MyClass class2; if (class1 == null || (class1 != null && class1 != class2) ) Problem is that when line above is called I get a stackoverflow exception at following line. if (first == null && second == null) What am I doing wrong here? | The following will cause infinite recursion on the == operator overload method Foo foo1 = null; Foo foo2 = new Foo(); Assert.IsFalse(foo1 == foo2); public static bool operator ==(Foo foo1, Foo foo2) { if (foo1 == null) return foo2 == null; return foo1.Equals(foo2); } How do I check for nulls? |
Is there any function to calculate statistical NDVI in landsat8 package | I am using MOD09Q1 now and I would like to calculating NDVI whole year data. One year, I have 46 band 1 images and 46 band 2 images. list.files I creating list of band 1 and list of band 2. Band1list <- list.files(path = ".", pattern = "*.b01.tif", all.files = FALSE, full.names = FALSE, recursive = FALSE, ignore.case = FALSE) Band2list <- list.files(path = ".", pattern = "*.b02.tif", all.files = FALSE, full.names = FALSE, recursive = FALSE, ignore.case = FALSE) raster::stack Stacking all 46 band 1 (band 2) images to 'StackBand1' ('StackBand2') StackBand1 <- stack(Band1list) StackBand2 <- stack(Band2list) NDVI calculation via for loop I try to stack images of same date (e.g. "2012.01.01.Smb01.tif" and "2012.01.01.Smb02.tif") and calculate NDVI for (i in 1:length(Band1list)) { StackBand1[[i]] == i StackBand2[[i]] == i Stack <- brick(StackBand1[[i]],StackBand2[[i]]) } In here, I could not execute loop for all 46 images. It can be run all and result is showed for the last couple only. |
I have about a hundred fonts that I need to install. Manually right clicking every font file and clicking install, then selecting "personal" vs "system" in a dialog that appears, and then closing it is tedious. Is there a command that will let me achieve the same effect in one shot? (I am using KDE.) | Question says it all. I need them to be available in gimp. |
I would like to force the justification (after a \raggedright command) of a paragraph while also having it indented. I tried the following commands but this doesn't seem to work (only the first line of the paragraph is indented, and not even at the right distance) : \usepackage{ragged2e} \usepackage{lipsum} ... \raggedright \lipsum[1] \setlength{\leftskip}{22pt} {\justifying \lipsum[2] \par} \setlength{\leftskip}{0pt} \lipsum[3] Would anyone know how to do this ? | Sometimes the margins need to be changed for a particular page, paragraph, or other section of text. For example, if I'm writing a letter and want the left margin to be almost at the right side of the page for the four lines of my address, or if I am combining prose with poetry and want the poems to be indented relative to the rest of the work. What is the best way to change both left and right margins on the fly? |
The story is about a girl who was able to see ghosts(?) (not sure which term was used) and had been captured by government and was given to aliens lived in an underground city near London(?) (also not sure) to become a slave. She was claimed by a male alien and became mystically connected with him. In the end (as I recall) she was able to escape with some slaves. I read it in English somewhere around 2010. Does anyone recognize the book I'm referring to? | A female character with supernatural powers starts off working for a criminal gang with other powers. She is captured and sent to work for supernatural creatures who have blackmailed the government to give them human slaves. Her master is involved in a power struggle between the supernatural beings. There are some other supernatural things that everyone is scared of. I think it's a series. |
I want to install Ubuntu 18.04 in my laptop. I found Ubuntu 18.04 requires Choose this if you have a computer based on the AMD64 or EM64T architecture (e.g., Athlon64, Opteron, EM64T Xeon, Core 2). Choose this if you are at all unsure. configurations. I have 64bit o.s X64 based Intel core i3 processor. Is ubantu 18.02 compatible with my computer? | My processor is an Intel Core 2 Duo P8600 (2.40GHz). As far as I know that's a 64-bit processor - I'm a bit confused as the architecture is called AMD 64, is this a generic name given to 64-bit architectures? I've heard of x64 but can't see a release labelled with this. |
I have a friend communicating with an American living in Ghana. She says she needs $6000 to pay off debts before she could move to Spain. Is this true? | On Travel.SE we often see questions about a person (usually a love interest) asking for money to pay for airfare, visas, permits and other expenses. For example What general advice can be given in such situations to the person asking the question? Is it all a scam or can there be legitimate situations in which an online friend could be asking for money? |
I am completely new to Ubuntu OS and I am just getting familiar with the process of installing new apps. I have recently installed Skype through Ubuntu Software center but I cannot run it. The Skype icon is visible in Unity yet, when I click on it, the icon bleeps for a few seconds, then nothing happens. I then tried running Skype directly from Terminal, getting the following error: cannot locate the base snap: ubuntu-core: No such file or directory In the software center it still states that Skype is not installed, however when I try to install it again, I obtain the following error: Installation of Skype failed. Detailed errors from the package manager follow: snapd returned status code 400: Bad Request I have performed the following set of commands in hope of clearing any possible remaining set of corrupted files: sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get autoremove sudo apt-get autoclean I also need to point out, that right upon starting my new Ubuntu OS I tried to install Bitdefender for Ubuntu (from the official site), yet some errors occured and installation failed. I suspect some corrupt files may have remained, but I do not have error messages anymore. Additionally I have also looked through other similar threads regarding Skype problems on Ubuntu and found no apparent fixes. Is there a way to completely clean your OS of any corrupt or damaged files, that might be causing this problem (apart from outright reinstalling Ubuntu)? All the help is much appreciated! Nejc | I am use Ubuntu 16.04. I see on snap's home page that it installed as default on Ubuntu 16.04. But when I run any command with snap, I can't take any result includes : snap --version Please help me. |
I have the following modal: <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 id="mt" class="modal-title" id="myModalLabel"></h4> </div> <div id="mb" class="modal-body"> </div> <div id="mf" class="modal-footer"> </div> </div> </div> I have a button in a table, which kicks off a jquery ajax call and pulls in the title, body, and footer of the modal. You can see that script below. <script> $(document).ready(function(){ $('a.btn').click(function(){ var org_id = $(this).attr('org_id'); $.ajax({ type: 'post', url: '/groups/' + org_id + '/leave', success: function(data){ var data = $('<div>').html(data); var msg1 = data.find('#msg1'); var msg2 = data.find('#msg2'); var msg3 = data.find('#msg3'); $('#mf').html(msg3); $('#mt').html(msg2); $('#mb').html(msg1); } }); }); $('#killgroup').click(function(){ alert('made it'); }); }); </script> Once the modal is fully populated with data, the footer section looks like this: <div id="mf" class="modal-footer"><div id="msg3"><a id="killgroup" class="btn btn-danger">I'm Positive. Kill Group Forever.</a><a data-dismiss="modal" class="btn btn-success">Wait! Let me re-think this.</a></div></div> The problem that i'm having is that when I click the button with the id, "killgroup", it does nothing. If you look above at my jquery code, the second section tries to react to that button click: $('#killgroup').click(function(){ alert('made it'); }); }); I cannot get that to work. It seems as though there might be a chicken before the egg issue going on here but I am very new to jquery / javascript so I am not sure. Basically, I want to be able to click that dynamically created button and kick off another jquery script. | 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. |
Why geom_density is showing me values higher than 1 in the density plot? How to change it into fraction? And my code used to generate the plot ggplot(data = input2, aes(x = r.close)) + geom_density(aes(y = ..density.., fill = `Próba`), alpha = 0.3, stat = "density", position = "identity") + xlab("y") + ylab("density") + theme_bw() + theme(plot.title=element_text(size = rel(1.6), face = "bold"), legend.position = "bottom", legend.background = element_rect(colour = "gray"), legend.key = element_rect(fill = "gray90"), axis.title = element_text(face = "bold", size = 13)) | On the , there is this line: $p(\mathrm{height}|\mathrm{male}) = 1.5789$ (A probability distribution over 1 is OK. It is the area under the bell curve that is equal to 1.) How can a value $>1$ be OK? I thought all probability values were expressed in the range $0 \leq p \leq 1$. Furthermore, given that it is possible to have such a value, how is that value obtained in the example shown on the page? |
This is only since the new update 0.37.0 I have been playing since the game came out in the UK and have got a Moto G phone I log on using google accounts. I dont really want to start again as I have 104 different pokemon. I can play fine on wifi, but can not connect on my mobile data. I have uninstalled the app and then reinstalled it, it didn't work, I logged in and out a few times to test it, and then I restarted my phone and the same thing again, the bar loads 1 bar and then comes up saying sign out. | It connects to Pokemon Go via wi-fi perfectly fine, but when I try and connect to Pokemon Go via 3G it just gets stuck at the first bar on the loading screen with the eventual pop up saying "Failed to get player information from the server." My 3G connection works perfectly fine with every other app I have, and has been easily able to stream HD videos so I can't see connectivity with 3G being an issue. It makes even less sense as once connected via wi-fi, the game easily continues to operate via mobile data once I leave the house. However once the app crashes (which it usually does after 15-30 minutes) I try to reload it on mobile data and it gets stuck on the loading screen. If I can find a local free wi-fi spot nearby I can re-connect easily, and then move back onto mobile data. I've tried removing and reinstalling Pokemon Go and that didn't work. I also reset all my app preferences on my phone and that didn't work. Not sure if this helps, my phone is a Huawei P8, Android version 5.0.1. I signed up to Pokemon Go using my Google account. |
I have recently bought an a4 tech wireless mouse + keyboard. Everything was working fine, but when i started cmd as admin, i started getting the run command automatically and it executes www.win32.cn/g9 which opens my browser to get me on a4 tech web page. Can you please suggest how can i stop this. | 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 am trying to change directories to the directory a shortcut leads to. The code I'm running uses fnmatch to look for a shortcut that matches the name given: for f in file: if fnmatch.fnmatch(f,propname): os.chdir(os.getcwd() + "\\" + f) #checks if there's a read folder file = os.listdir(os.getcwd()) However I get this error: NotADirectoryError: [WinError 267] The directory name is invalid: '\\\\100.100.1.100\\Share1\\CompanyU\\ClientFiles\\clientinfo.lnk' Is there a way to get the directory address if it is linked in a shortcut? | I'm trying to read the target file/directory of a shortcut (.lnk) file from Python. Is there a headache-free way to do it? The is way over my head. I don't mind using Windows-only APIs. My ultimate goal is to find the "(My) Videos" folder on Windows XP and Vista. On XP, by default, it's at %HOMEPATH%\My Documents\My Videos, and on Vista it's %HOMEPATH%\Videos. However, the user can relocate this folder. In the case, the %HOMEPATH%\Videos folder ceases to exists and is replaced by %HOMEPATH%\Videos.lnk which points to the new "My Videos" folder. And I want its absolute location. |
I want to mesure how much instruction are executed in method example. int a=0; functionTest(); a=getCountInstruction() // return the number of instruction executed until now. Their any way to do it using Profiler or some Classes ? | I want to do some benchmarking of a C# process, but I don't want to use time as my vector - I want to count the number of IL instructions that get executed in a particular method call. Is this possible? Edit I don't mean static analysis of a method body - I'm referring to the actual number of instructions that are executed - so if, for example, the method body includes a loop, the count would be increased by however many instructions make up the loop * the number of times the loop is iterated. |
I just ran the wubi installer under windows 8. After reboot, I got the dual boot option. Windows is still working, but Ubuntu only makes the computer restart. I had no errors during the installation. Any idea ? Ty | I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS. Should I do it with Wubi, or through the Live USB/DVD? What steps do I need to take to correctly install Ubuntu? |
I am trying to call an uncertain named function from another class. I mean, external input or a variable in a loop as a function name. For example; class options(object): def functionOne(): # or function1 pass def functionTwo(): # or function2 pass def functionThree(): # or function3 pass in a options.py file and either: class main(object): def runSomething(): options=options() while counter<=3: options.function**"a"**() counter = counter+1 or: class main(object): def runSomething(): options=options() num=raw_input("number: ") options.function**"num"**() in the main.py. What should I put at the bold places? Is there any way to combine function name and number in order to call function. I have been looking for a solution to this problem for days, but I cannot find any relevant solution. | What is the best way to go about calling a function given a string with the function's name in a Python program. For example, let's say that I have a module foo, and I have a string whose content is "bar". What is the best way to call foo.bar()? I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this. |
I have heard that the main reason to use out-of-bag sample(OBB) over CV is that OOB is faster to implement and usually gets the same results(for tuning the hyper-parameters) as implementing CV when the Random forest model is used. If this isn't true, in which cases using CV gives better results? | I am fairly new to random forests. In the past, I have always compared the accuracy of fit vs test against fit vs train to detect any overfitting. But I just read that: "In random forests, there is no need for cross-validation or a separate test set to get an unbiased estimate of the test set error. It is estimated internally , during the run..." The small paragraph above can be found under the The out-of-bag (oob) error estimate Section. This Out of Bag Error concept is completely new to me and what's a little confusing is how the OOB error in my model is 35% (or 65% accuracy), but yet, if I apply cross validation to my data (just a simple holdout method) and compare both fit vs test against fit vs train I get a 65% accuracy and a 96% accuracy respectively. In my experience, this is considered overfitting but the OOB holds a 35% error just like my fit vs test error. Am I overfitting? Should I even be using cross validation to check for overfitting in random forests? In short, I am not sure whether I should trust the OOB to get an unbiased error of the test set error when my fit vs train indicates that I am overfitting! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.