Has my Linux server been compromised? How do I tell?

Running (X)Ubuntu 10.04.2 LTS behind a router.  I just received an email from my root account on that machine, with the following subject:     *** SECURITY information for <hostname>:   The message body contained this warning:     <hostname> : jun  1 22:15:17 : <username> : 3 incorrect password attempts ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/sh /tmp/tmpPHBmTO   I can see no /tmp/tmpPHBmTO file, though there is a file named /tmp/tmpwoSrWW with a timestamp dating from 2011-06-01 22:14, so just before the mentioned date/time. It's a binary file, and the content doesn't look familiar to me.  Also, that file only has -rw------- permissions.  As I read it, this means that someone (or something) has (had) access to my machine.  Apparently not root access (yet), but still, enough to write files to my /tmp directory at the very least.  Does someone have any pointers as to where I could look for more information: who could have done this, and how they could have done this?  My router is configured to allow access to forward traffic for SSH, HTTP (nginx acting as reverse proxy for one of several other services), SMTP, POP (postfix) and IMAP (dovecot), and also port 51413 (Transmission).


I'm currently trying to unlock my bike that has been sitting on my porch for a while, the key works and turns, and I can hear the lock engaging/disengaging, however I cannot get the shackle to come out. I think their might be dust/sand stuck in the mechanism however I'm not sure how to get it off now to check.


Calendar not working on iPhone 4 updated to iOS 7

I updated my iPhone 4 to iOS 7 and now my calendar is not working. All my entries are gone and it will not allow me to put a new entry in.  My calendar is turned on in Settings → iCloud → Calendar, and it was backed up before I updated.  What do I need to do to get my calendar information back?


I use this for language  \usepackage[T1]{fontenc}   \usepackage[utf8]{inputenc} \usepackage[english]{babel}   Sometimes, i need input some special letter, for example Ö. The language setting worked fine before, but today it report error always when I input some special letter.(I do not remember what i changed to the latex code, seems no changes about language setting).  Below are snapshots for two errors. What is the problem?


The PS/2 keyboard is available in the BIOS. But after the Windows 10 system is booted, keyboard is not detected.


Suppose $K(x,y)$ is a symmetric kernel and $K(x,.), K(.,y)$ are in $L^1(\Omega)$. Let $\phi\in L^{2}(\Omega)$, where $\Omega$ everywhere is a domain in $\mathbb{R}^n$. Can $\int K(x,y)\phi(y)dy$ belong to $L^2$?. In other words can an inequality of the type $||\int K(x,y)\phi(y)dy||_{2}\leq||K||_{L^1{\Omega\times\Omega}}||\phi||_{2}$ exist?.


How does two dimensional induction work for my special case?

In one dimensional induction we show something holds for $n=0$ or $n=1$ and assume it is true at $n=n$ and prove for $n=n+1$.  In two dimensional induction is it something along show it is true for $(n,k)=(0,k)$ or $(n,k)=(1,k)$ at any $k$ and assume it is true at $(n,k)=(n,k)$ and prove for $(n,k)=(n+1,k)$?  In my case $n\leq k$ always.


How do I proceed beyond restarting my pc after Ubuntu 14.04 install?

I have to keep the bootable usb inserted in order to load Ubuntu even after installation in the hard drive, and when it opens up it is the initial try or install menu which existed before installation. While working with partitions, I formatted the windows seven loader partition accidently. Once, after restart, the screen showed 'Missing Operating system' message, though that isn't the case now.


How to fetch openlayers layers from pyqgis?

My objective is to fetch maps provided by openLayers, as in openLayers_plugin, from a stand alone python script. I would like to get it superposed to my shp file.  As can be read on   layer = QgsVectorLayer(data_source, layer_name, provider_name) if not layer.isValid():print "Layer failed to load!"   provide a good way for loading layer in a stand alone python script. And it's possible to do it as well for wfs data source, or other data source types. I do it with shp files, and it works well, but what is the uri related to openLayers datas and maps  ?  I also tried to get openLayers_plugin ...  sys.path.append(r"C:\usr\python\plugins\openlayers_plugin") qgis.utils.loadPlugin('openlayers')      qgis.utils.startPlugin('openlayers') print qgis.utils.isPluginLoaded('openlayers') # return False   Is it possible to use openlayers plugin in stand alone pyqgis script ? cf [  ] which is deprecated now. No it's not ?


How to prove that $\prod_{i=1} ^ \infty x_i^{a_i} \leq \sum_{i=1} ^ \infty a_ix_i$

Let $a_1,a_2,...$ be nonnegative numbers whose sum is $1$ and let $x_1,x_2,...>0$. I want to show that $\prod_{i=1} ^ \infty x_i^{a_i} \leq \sum_{i=1} ^ \infty a_ix_i$.  This looks awfully similar to the $AM \geq GM$ inequality. In fact, the AM-GM inequality is a special case of this.  I was thinking of using Jensen's inequality which states, if a function $\phi$ is convex on all of $\mathbb{R}$ and $f$ is Lebesgue integrable on $[0,1]$ and $\phi \circ f$ is nonnegative on $[0,1]$, then $\phi(\int_0 ^1 f)\leq \int_0 ^1 \phi \circ f$.


Random digits printed when printing more than 6 decimal digits in float datatype in C (GCC compiler)

I was executing following C code-  float a=3.25678932; printf("%0.10f\n",a);   The above printf() statement giving following output:  3.2567892075   I am not able to understand how other four digits('2075') are coming after first six digits('256789') after decimal.


I have both Windows 7 and Ubuntu installed on a shared machine. Because a lot of the non-developers use Windows, I'd like to change the boot order to make it easier for them.  Currently the boot order looks like the following:   Ubuntu 11.10 kernelgeneric *86 Ubuntu 11.10 kernelgeneric *86 (safe boot)  Memory test Memory test Windows 7 on /dev/sda6   How do I change the default order so that Windows 7 is at the top of the list?   Windows 7 on /dev/sda6 Ubuntu 11.10 kernelgeneric *86 Ubuntu 11.10 kernelgeneric *86 (safe boot)  Memory test Memory test


History of the non-rule that proscribes ending a sentence with a preposition

Famously, if not accurately, Winston Churchill is supposed to have responding to an editor who had "fixed" a sentence ending with a preposition by writing, "This is the sort of thing up with which I will not put."  The terminal preposition/adverb construction is often required in German grammar and I am asking if the English "rule" that proscribes the usage arose as an expression of anti-German sentiment around about the time either the two world wars started up.  What is the history of this "rule?"


I want to search for a specific keyword in a pdf file using linux shell. How I will use the grep command to do that?


Recover a deleted files in other users of linux (ubuntu)

I have deleted an user in my linux OS(Ubuntu 19.10) ,But I have to delete the files and also copy some files into my user , But my I can't get access . How could I get access to delete and copy files??? PLEASSSE TELL ME. But files are not deleted....


Does the series $∑\frac {8n}{(\log n)^n}$ converge or diverge?

does the series $\sum \frac{8n}{(\log n)^n}$ converge or diverge? I've 'tried' using the root test but I just can't seem to get my head around the log in the denominator and what rules to apply because of it. Can anyone help me out here please? Thanks.


Python 2 had the builtin function , which was removed in Python 3.0.  discusses alternatives for Python 3.0, but some  have been made .  What is the best alternative to  for Python 3.2, and ?


How do I use MSTest without Visual Studio?

Does MSTest have standalone GUI similar to nUnit that lets me use it and run test without visual studio? What is the official site for MSTest where I can learn more about how to use it?


My brother and I both own a ps4. His account is the primary account on his system, and my account is the primary on my system. If I log into his account on my ps4, can I play his games while I'm on my account WITHOUT making his account the primary on my ps4?


I am trying to get both of my monitors to play audio out of their speakers. They are connected over HDMI.    I can make them play audio one at a time. But how do I get them both to play audio at the same time?


What should we do about Stack Overflow-specific questions on Meta SE?

What should we do with Stack Overflow-specific questions on Meta Stack Exchange?  .  , as long as it meets some (underspecified) conditions.  Whose advice should we follow?  If it's Tim's advice, what exactly are the conditions for flagging (preferably in quantifiable terms - not sure what "undecided" means)?  If we shouldn't flag them, or just some of them, what should we do with them then (or the rest of them)?  Should we close (and eventually delete) them all?  Note - by "flag", I'm exclusively referring to flagging for migration.  My opinions:   In the case of completed requests, isn't it worth keeping them around for the sake of reference? And if we're going to keep them around, shouldn't it be on the correct site? In the case of uncompleted requests, if we close and/or delete these, why do so, just to have them show up on Meta Stack Overflow some point down the line (minus all the discussion and votes should approval / disapproval)? And is there really such a big difference between something posted on 15 April (pre-split) versus something posted on 20 April (post-split)? Why treat them so differently? Isn't that just us being blinded by the rules? Or is migrating them really such a massive deal?


Why are only five different logos available on the '/about/logos' Stack Exchange page?

On , there are download options for only certain logos/icons. Shouldn't this include all the graduated sites logos/icons? I think it should.


Learning figures of speech sometimes can be confusing, and I am trying to figure out the difference between metonymy and synecdoche.   Given the following sentence      ①Grey hairs should be respected (metonymy )      ②More hands are needed in the work(synecdoche )   In Sentence 1, gray hairs is part of human body, so it should be included in synecdoche. So I cannot ensure that I'm right or my book represents a incorrect example.


Attending graduate school at my undergraduate university

I've been told by numerous people that (1) my undergraduate university will be disinclined to bring me on as a graduate student, and that (2) it's a bad idea to attend grad school where you completed your undergraduate degree, anyway.  Is that true? If so, why?


I created a new direct LWC quick action form in the new version for Summer 21 without Aura. I cannot find documentation, how to close the quick action panel. Has anyone already experience with it?


Show that for positive numbers a,b,c,d, $\sum_{cyc} ab \leq \frac{1}{4}\left(\sum_{cyc} a \right)^2$ and ...

Let a,b,c,d be four positive real numbers. Show that  $$\sum_{cyc} ab \leq \frac{1}{4}\left(\sum_{cyc} a \right)^2$$ and  $$\sum_{cyc} abc \leq \frac{1}{16}\left(\sum_{cyc} a \right)^3$$ My textbook said these inequalities can be referred from the AM-GM inequality but didn't say how to derive it. I can find only looser bounds. That is, for each term in the left hand side of the first inequality, by AM-GM inequality, $$ab \leq \left(\frac{a+b}{2}\right)^2 \leq \frac{1}{4} \left(a+b+c+d\right)^2$$ $$\Longrightarrow \sum_{cyc} ab \leq \frac{4}{4} \left(\sum_{cyc} a \right)^2$$ Using the same techniques, we get another loose bound for $\sum_{cyc} abc$. How could I get the bounds in the original inequalities? Please suggest.  PS. It seems like if these inequalities are true, we may get a general relationship for n positive variables as $\sum_{cyc} a_1 ... a_k \leq \frac{1}{n^{k-1}}\left(\sum_{cyc} a_i \right)^k$.  PS2. Sorry for double posting. There was an old thread here:  One answer points to Maclaurin's inequality, but I still cannot figure out how to prove it using AM-GM.


How can I install Ubuntu without removing Windows?

I need my pre-installed version of Windows 7 (or any other version of Windows), how could I install Ubuntu without erasing it?


"That's a sick set of wheels!"   I've heard it from someone and I'm wondering what the exact meaning is.  I googled the phrase and all I found was a .  I know that one of the meanings of  as an adjective is:     very good, excellent   I also found  for "set of wheels":     a car   So does "That's a sick set of wheels!" mean "That's a very excellent car"?


Why didn't the Death Eaters capture Harry Potter at the end of the Half-Blood Prince?

I was watching the Harry Potter and The Half-Blood Prince movie recently and when Harry tries to take down Snape at the end      (after Snape kills Dumbledore)    it was a perfect opportunity for the Death Eaters to take Harry to Voldemort.   Why didn't the fleeing Death Eaters take Harry right then? Was it too much of a risk for them to take him?


Does Stack Overflow have a special Google integration?

Does Stack Overflow have a new special kind of Google integration?  How does this work? It looks great!


How to know which apps are in User folder and which are in Public folder?

I installed some apps like D-Link Connection Manager, Adobe Reader X, VLC Media Player and Lava 144G on my Windows laptop. I could find all these apps inside C:\Users\Public\Desktop, but they were not mentioned in C:\Users\User\Desktop. On the other hand I downloaded an app called "7capture" and it was mentioned only in C:\Users\User\Desktop and it was not mentioned in C:\Users\Public\Desktop. Why is it so? I mean how do I know which apps are in User folder and which are in Public folder? Why were the first 4 visible only in Public folder (why not in User?)  and why "7capture" was mentioned only in User folder?


Can the graph of a continuous real function be a totally disconnected subset of $\mathbb{R}^2$?

Can the graph of a continuous real function $f:\mathbb{R}\to\mathbb{R}$ be a totally disconnected subset of $\mathbb{R}^2$? Certainly there can be many disconnected points (in $\mathbb{R}^2$), like the point $(0,0)$ in the graph of: $ f(x)= \begin{cases}  x\sin\frac{1}{x}&\text{if}\, x\neq 0\\  0&\text{if}\, x=0\\ \end{cases} $ And perhaps it isn't necessary for the graph of $f$ to be connected either side of these "disconnected points". Whether or not there is a real function $f$ and dense subset $X$ of $\mathbb{R}$ so that $\{\ (x,f(x)): x\in X\}$ is a totally disconnected subset of $\mathbb{R}^2,\ $ I am not sure. Perhaps this is not possible?


When I try to use write to talk to users logged into an X session results vary depending on which terminal they are using. Gnome terminal can pick up writes, but neither lxterminal nor terminator can. The reason is that lxterminal and terminator don't have associated pts devices:  With lxterminal(s) running:  $ who tshaw    tty7         2013-01-27 21:34   With Gnome terminal running:  $ who tshaw    tty7         2013-01-27 21:34 tshaw    pts/1        2013-01-27 22:25 (:0)   (the tty7 entry in the above is the X session)  Is there a way to configure other terminals to take pts devices or would that have to be done in source code?


Problems that become easier in a more general form

When solving a problem, we often look at some special cases first, then try to work our way up to the general case.  It would be interesting to see some counterexamples to this mental process, i.e. problems that become easier when you formulate them in a more general (or ambitious) form.    Motivation/Example  Recently  for the solution of $a,b,c$ such that $\frac{a}{b+c} = \frac{b}{a+c} = \frac{c}{a+b} (=t).$  Someone suggested writing this down as a system of linear equations in terms of $t$ and solving for $a,b,c$. It turns out that either (i) $a=b=c$ or (ii) $a+b+c=0$.  Solution (i) is obvious from looking at the problem, but (ii) was not apparent to me until I solved the system of equations.  Then I wondered how this would generalize to more variables, and wrote the problem as: $$ \frac{x_i}{\sum x - x_i} = \frac{x_j}{\sum x - x_j} \quad \forall i,j\in1,2,\dots,n $$  Looking at this formulation, both solutions became immediately evident without the need for linear algebra (for (ii), set $\sum x=0$ so that each denominator cancels out with its numerator).


PCA when the dimensionality is greater than the number of samples

I've come across a scenario where I have 10 signals/person for 10 people (so 100 samples) containing 14000 data points (dimensions) that I need to pass to a classifier. I would like to reduce the dimensionality of this data and PCA seems to be the way to do so. However, I've only been able to find examples of PCA where the number of samples is greater than the number of dimensions. I'm using a PCA application that finds the PCs using SVD. When I pass it my 100x14000 dataset there are 101 PCs returned so the vast majority of dimensions are obviously ignored. The program indicates the first 6 PCs contain 90% of the variance.   Is it a reasonable assumption that these 101 PCs contain essentially all the variance and the remaining dimensions are neglectable?  One of the papers I've read claims that, using a similar (though slightly lower quality) dataset than my own, they were able to reduce 4500 dimensions down to 80 retaining 96% of the original information. The paper hand-waves over the details of the PCA technique used, only 3100 samples were available, and I have reason to believe less samples than that were used to actually perform PCA (to remove bias from the classification phase).   Am I missing something or is this really the way that PCA is used with high dimensionality-low sample size dataset? Any feedback would be greatly appreciated.


accessing stdin/stdout of a process started in another tty

I logged in to my linux physically(say tty1) and started a process that watches stdin for commands and has some stdout-put. How can I access/use this process from a SSH session?


I cannot see AV-Sync, No Sync and Follow Playhead in Blender 2.93


L293, L298 and SN754410 H-bridge drivers on low voltage power supply

This question is about the following three integrated H-bridge drivers: -    or L293D (D = protection diodes added)  (protection diodes included)  (no protection diodes)   Time after time the same question keeps coming up - someone is using one of these devices (on a low voltage, usually around 6V or less) and they are just not performing adequately. The reasons are listed further below but my question is this: -  What H-bridge drivers are preferred when controlling a low-voltage motor?   Information  The L293 and the SN754410 are nearly identical and crucially, if you try and control a 1 amp load, you are faced with dismal performance: -    The tables tell you (typical conditions) that the upper transistor drops (loses) about 1.4 volts when driving a 1A load and, the lower transistor drops (loses) about 1.2 volts when driving a 1A load. The upshot is that if you have a 6V, 1A motor and 6V battery, don't expect to see more than 3.4 volts across the motor: -  \$V_{OUT} = 6V - (1.4V + 1.2V) = 3.4V\$  Worst case scenario is you might only see 2.4 volts across it.  What about the L298? It's got a nice big heat-sink whereas the L293 and SN754410 are regular-looking chips. Here's what the volt drop (losses) look like: -    It's the same story - for a 1A load, you can expect to lose up to 3.2 volts and, what you thought might be 6V across your motor, is at best 4.2 volts and at worst only 2.8 volts.  Clearly none of the devices listed are suitable for low voltage applications where the motor might be expected to draw in excess of 0.5 amps.


How to measure the curvature of the space-time?

I know G.R. change our vision of space and time as a unique surface than can bend. We can associate the curvature of the space-time as the gravity created by the mass of planets, stars... But how can we measure the  of the space-time for calculate, as an example, the position of a star?


What's a solution for having a group of people meet each other exactly once, even if there is an odd number of people?

The problem is this: I would like in a group of people to easily arrange and move them around such that every pair comes together exactly once, without any repetitions. I'm looking for all combinations, not all permutations. This should work for both even and odd numbers of people.  I'm looking for a solution that works physically for a group, such that people can be moved around in a consistent way - not a way to generate a list of all combinations.  I have read the solution in the below linked thread, but having experimented with this in a spreadsheet, I can only make it work for an even number of people.  I didn't comment on that thread because I'm new here and I'm not allowed to yet. I would deeply appreciate any help.


I am receiving an error when manually running this function: function updateCells() {   var ss = SpreadsheetApp.getActiveSpreadsheet();   var spreadsheetSummary = ss.getSheetByName('Summary');   const columnsWithData = () => {     const range = spreadsheetSummary.getDataRange()     const values = range.getDisplayValues()     const transposeCheck = values[0].map((_, iCol) => values.map(row => row[iCol]).some(cell => cell))     const countBoolean = transposeCheck.filter(Boolean).length        return countBoolean     }   var spreadsheetCommunityGroups = ss.getSheetByName('Community Groups');   var cellValueCommunityGroups = spreadsheetCommunityGroups.getRange('A12').getValue();   var summaryCommunityGroups = CONCATENATE('B', countBoolean++);   spreadsheetSummary.getRange(summaryCommunityGroups).setValues(cellValueCommunityGroups); }   Error: ReferenceError: CONCATENATE is not defined  I've turned on "API GOOGLE APP SCRIPT" for my account: . Is countBoolean not being output in the CONCATENATE function?


Real examples of Correlation confused with Causation

I'm looking for specific, real cases in which a causal relationship was inappropriately inferred from evidence of a correlation.   Specifically, I'm interested in examples that meet the following criteria:   Existence of the causal relationship was accepted as fact widely enough to have notable effects (on public policy, discourse, individual decisions, etc.). The link was inferred solely on the basis of correlative evidence (perhaps along with the existence of a coherent but unproven causal mechanism).  Causality has been objectively falsified or at least called into serious doubt.   The two examples that came to mind for me aren't quite ideal:   Sodium intake and blood pressure: As I understand it, it has since been determined that salt intake only increases blood pressure in sodium-sensitive individuals. The existence of a valid causal relationship (although not quite the one that was originally accepted) make this example less compelling. Vaccines and autism: I may have the background wrong, but I believe this link was surmised on the basis of both correlations and (fraudulent) experimental evidence. This example is weakened by the fact that (fake) direct evidence existed.   Note: I've seen this similar question:    My question differs primarily in that it focuses on notable, real-world examples and not on examples in which a causal link is clearly absent (e.g., weight and musical skill).


I'm looking for a way to monitor my current internet connection quality by showing the ping-response to a website like google in the taskbar on the right side. I'm using Windows 8.1. Kind of like , but for the ping. Any suggestions?  I want to stop using the command line to ping Google.


Red Suffers More Artifacts Than Other Colours. Why?

The Red Compression Issue  Red is one of the colours I use most often in my graphic design for marketing. However, despite it being a good colour to use in marketing advertisements, it also suffers the most when compressed via social media platforms. Yes. They all suffer but red more than others. Why?  The red issue was such a problem for one client, that they ended up changing the colour of their logo so that it would do better on social media, their number one place for generating business. So I do think it's an issue that could do with some attention.   These examples below are maybe not the best example, but you can still clearly see that the red version of the same image looks more distorted than the blue variant.  I have tried different variations of red to try and find a solution and found some work better than others, but they still never look as good as non- red spectrum images.  Red vs Blue  These images are identical. The only difference is one is red and one is blue. They both don't look as good as each other. The red suffers more distortion than the blue version. This is the same when compared to other colours, not just blue. Red always loses.    The Question  Is there a reason for this and is there an official red spectrum sweet-spot that vastly reduces the compression artefacts to make it on par with other colours with the same compression?     Note: This question is not about compression as such. It's about why   red suffers more than other colours and how to solve this.   Twitter Compressed Images  These are the images that have been compressed by Twitter in this case. It's similar for other social media platforms. All struggle with red colours.     Note: These aren't the exact images use by Twitter, they are a screenshots,   but they look almost identical.   Please be friendly and helpful if you can :)


Previous website does not work with paginated content on reputation tab

I was browsing my reputation history (), went to the second page and then clicked "back" button to go to previous URI (i.e.first page).  URL changes from  to  but the content of the second page is shown. Also "active page" indicator (orange color) in CSS is on the second page.  Edit:  I've included video showing this bug


Journey SMS Fails - Object reference not set?

I have a Journey which sends the Subscriber SMS messages, 2/4 journey entries (all unique subscribers) don't receive the SMS.  The error displayed in the SMS activity in my Journey History is the following:      Failed - Object reference not set to an instance of an object.   Can anyone advise what this means? If it was configuration surely all subscribers wouldn't receive the message? I can confirm all subscribers have a mobile number and they use the same format and country code. Not sure if it helps but the entry source is Salesforce Data Entry.  Edit:  There can be entries where the Subscriber record does not exist in the AllSubscribers list as they do not have email addresses attached (only mobile numbers) but my journey only contains SMS message activities, no email. I have checked and even on some Subscribers that do have AllSubscribers records suffer the same activity error.


Accorging to GNU documentation:  ‘\<’ Match the empty string at the beginning of word. ‘\>’ Match the empty string at the end of word.   My /etc/fstab looks like this:  /dev/sdb1       /media/fresh      ext2   defaults     0 0   I want grep to return TRUE/FALSE for the existence of /media/fresh. I tried to use \< and \> but it didn't work. Why?  egrep '\</media/fresh\>' /etc/fstab   Workaround:  egrep '[[:blank:]]/media/fresh[[:blank:]]' /etc/fstab   But it looks uglier.  My grep is 2.5.1


First Iteration in Gradient Boosting Algorithm

For the input training set ${ \{ ({ x }_{ i }{ y }_{ i })\}  }_{ i=1 }^{ n }$  if the loss function is L(y, f(x)), then we initialize the model $M_0$ by finding the $\gamma$ which minimizes: $$ F_0(x) = \sum _{ i=1 }^{ n }{ L{ (y }_{ i, } } \gamma ) $$  which means, for every 'x' we define a model which always gives a constant value $\gamma$  So, now, in the 1st iteration, how come we are able to calculate the derivate of Loss function with respect to the previous model's function, (which is a constant $\gamma$), as derivates with respect to constant are not defined.  Can anyone explain what I'm understanding wrong over here ?


New vote orderings- default vote order is wrong

I've just noticed that the ordering of answers on questions has changed. Apparently you can now order answers by various criteria, which is fine.  But who the hell set "Active" as the default? It should clearly be votes. If voting people doesn't make their answer bubble to the top by default, this defeats the point of voting.


Why my code not filling my list with data Python

I upload some csv file and try to printing two columns. There's a problem. In this case my program printing correctly "typ" column, but "data" field is empty.   header = [row for row in i]                     #header  indexoftype = header.index('type')              #type column index typ = [row[indexoftype] for row in reader]      #type column list print typ #printing my field correctly  indexofdata = header.index('data')              #data column index data = [row[indexofdata] for row in reader]     #data column list print data  # printing empty field   If I change their place, the same thing happens, but in different roles:  header = [row for row in i]                     #header  indexofdata = header.index('data')              #data column index data = [row[indexofdata] for row in reader]     #data column list print data          #printing my field correctly  indexoftype = header.index('type')              #type column index typ = [row[indexoftype] for row in reader]      #type column list print typ # printing empty field


Is there a quick way to find every match of a regular expression in Ruby? I've looked through the Regex object in the Ruby STL and searched on Google to no avail.


Is there a good way by specifying it in the preamble, to underline my section titles (not chapter titles), instead of having to do \chapter{\underline{Section Title}} for all chapter titles in the body?  I would like it as something like in this picture below:    Thanks!


How to install Feynmf or Feynmp on Mac OS X?

I really need your help, several times I have tried to install Feynmf or Feynmp on my mac but I failed, my main problem is working with the terminal which I think one needs to install these two packages. I have used the guides from CTAN. Is there anyway to tell me step by step how to use the terminal and install Feynmf or Feynmp? many thanks.


Determine convergence or divergence $\sum_1^\infty \sin \frac{1}{n}$

$$\sum_1^\infty \sin \frac{1}{n}$$  So now I konw that to evaluate this I can just look at the limit as it reaches infinity. I see that it would result in 1 over 0, but it approaches 0 so I could that that it approaches sin0 which is 0 so doesn't this converge?


Can i remove OS X completely and install Windows?

Can I completely remove Mac OS X from my system and install Windows 7 or 8 on it?  I do not want to use Bootcamp or create VM's. Is there any way at all?   The problem here is that i want to ditch OSX and install Windows on my mac machine forever.    Will I have to buy a Windows PC?


Why are two ^D presses necessary to exit `cat`?

Let's run cat and then type a then ^D - you will see that cat did not exit.  Compare it with cat + a + Enter + ^D - now cat did exit.  So, why two ^D presses are necessary to exit cat in the first case and only one ^D in second case?


Is there an uncountable family of infinite parts of $\mathbb N$ with   two to two intersection finite?   If the two to two intersections are empty, it is false; if not $\mathbb N$ would be uncountable.   What about this case?


Passing length in form of a string instead of measure

I'd like to pass a measure of length in form of a string, i.e.  \setlength{string}   or   \setlength{'string'}   instead of  \setlength{2.5cm}   I seem to remember seeing something like that somewhere in LaTeX, but can't find it. Appreciate your input!


General place to see required rep for privileges

Is there a standard for where each SE site should link to its required reputation for privileges? I was searching for that for a particular SE, and only found it by doing a web search for privileges stack exchange and finding Stack Overflow's, then guessing that the URL structure would be consistent.  That's a pretty weird user experience. Is there a better way to find it?


Shall it be possible to comment on answers to questions I have bounty for even if I don't have 50 reputation?

I understand that this is a rather corner case situation, but I managed to end up in it, and it is very frustrating.   I found a question I need an answer for in a community I am not part of. The question is not answered. I joined the community and got 100 bonus reputation, since I was a member of other communities I offered a bounty to that question, spending all the reputation I have. People provide answers.   Now, offering a bounty, I would like to be able to discuss those answers (in particular, to point out that they do not work), but I can't do it, since I just spent all my reputation.  Would it be reasonable to allow people who started a bounty to comment on the answers?


Prove that the area of a quadrilateral is one half the product of the lengths of its diagonals and the sine of the angle between the diagonals.


Using a single-level domain for Active Directory

It's common convention to name a domain something like companyname.local for internal Active Directory with integrated DNS.  I'm in a situation where the company name has changed and I would like to rename the domian. I'm aware of the difficulty and implications. I would like to rename it from 'abccorporate.local' to just 'xyz'. I can't think of any reason to keep the '.local', is there one?


Why are you required to pay or have a university relation to access most research journals?

High school student here...  I came here to ask this question since it seems geared more towards academia and I normally spend my time on Math.SE. Anyway...  I have a huge passion for math, I read about it and work on problems every day. At this point in time I'm even considering going into academia for math research (although it seems incredibly difficult to land professorship based on the things I've read here.) In my ongoing research, I've noticed that there are very few places to freely read mathematical papers. I tend to turn to the arXiv so this isn't so much a problem - except for the times I come across a paper with a particularly interesting abstract, only to find its host site asking for one of two things:   An association with an institution or research group Monthly payment   So my question is do any of the academics here have any insight as to why that is? Are the authors of the papers compensated with part of the payment received by the journal?    (Sorry if this question comes across as very naive but, admittedly, I am.)


How to explain income from an unregistered business when applying for UK Visitor visa?

I’m a student, my parents and other relatives send me money, but I also have an online clothing store I started this year. Because it’s online and upcoming I haven’t registered it. Should I explain this in my cover letter, incase they notice a deposit that is not in my parents name?


1) I had a dataset with missing data for baseline variables and outcome variables. Through multiple imputation in SPSS (10 imputations, 50 iterations, PMM for scale variables) I imputed the missing data for the baseline variables. When I analyse the data (i.e. only the 10 imputation data sets) and use the independent sample t-test for a continuous variable results are pooled. This includes mean and p-value, but not standard deviation. Is it correct that I can take the average of the 10 standard deviations calculated for the imputed data sets to calculate the pooled standard deviation?  2) The pooled p-value from the independent t-test on 10 imputation data sets in SPSS is not the average of the 10 p-values that are calculated: am I correct? As I believe a correction is made for the fact that the p-value is based on imputed data?  3) I want to impute the missing data for the outcome variables as well. I did not include those variables in the first imputation process since one of the outcome variables is affected by the value of one of the baseline variables for which data was missing. So I figured that I would first impute the baseline variable, create a 'complete' data set for it and than impute the outcome variables using that data and the other baseline variables. Is it actually possible to impute a second time? And how would I do that? Now (after the first imputation process) I have a dataset which is 11 times as large as originally (original data set + 10 x imputed data set). Do I use all 10 imputation data sets to run the imputation process again which would result in another tenfold of that data set (so 100 fold of my original data set size)? And is it true this would lead to a larger standard deviation for scale variables?


Shouldn't there be some sort of grace period before questions can be closed?

So I had  closed within eight minutes of asking.  Is this a little fast? Not only do I object to the reason it was closed (not a real question, come on I'm asking for decent books!), but it was closed insanely fast. Should there be a grace period for questions (diamond mods exempt if so) before they can be voted on to be closed?


Importing shapefile into PostgreSQL failing

I have installed PostgreSQL 12 on my Windows 10 OS. I installed the PostGIS extension as well. I would like to import a shapefile and am using shp2pgsql-gui to do so. The import is failing and there is no explanation why. Any ideas?    I should also add that my bigger objective is simply to load US census block shapefile data into a PostgreSQL database that is hosted by AWS RDS. I figured the easiest way to do this is to download shapefile data to a db instance on my computer and then dump this database into the RDS database. If there is an easier way, I'd accept that as well.


How to get rid of sharp edges\artifacts in Cycles?

So I imported a model of my sim into blender to mess around with renders and maybe try and make some CC, but (as usually the case with game extracted models) the model has these 'artifacts':  How do I get rid of them? I removed doubles, reset vectors and recalculated normals, cleared sharps, have 2 light sources with a plane underneath to bounce light off of, idk what else to do... Edit: Subdivision surface doesn't fix it, and on the other model I imported smooth shading doesn't work at all Sims likes to use overlapping geometry for things like beards and hair and upon removing doubles the polygons still look messed up. I remember there might be double polygons sometimes but I don't remember how to clean them. This one shows only with subsurf  And random walk subsurf for some reason looks like this (after removing doubles) Ok, I see why the second model is messed up now  The first one looks alright though, must be something else... The proposed answer was wrong, I mentioned I checked the normals and then someone proposes to check the normals and closes the question.


Windows 10: too much data on system disk

I have windows 10 (updated from windows 8.1). Yesterday I found out that there is no enough space on system disk. I deleted all restore points and unused files using windows utils. It didn't help. Then I turned on setting to show all hidden files and folders to check entire size of all folders on disk C.  It looks fine but it's not:  Could anyone give me advise how to fix it?   UPDATE: Using  tool I found out that there is a folder C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Redis with size 112Gb! As quick fix I just deleted it using command line. Thanks guys from . I wrote my question there when this post was closed.


Getting 2.2204460492503E-16 in php Subtraction

$diff = $choice->GetAmount() - $choice->GetPrice();  If the input for both is equal i.e 1.25 and 1.25 it shows 2.2204460492503E-16 instead of 0


Interval of convergence of this particular series: $\sum_{n=1}^{\infty} a^{\ln n}$

This question was asked in my real analysis quiz and I couldn't solve it.  For a>0 , the series$\sum_{n=1}^{\infty} a^{\ln n}$ is convergent in which largest interval?  The problem is that I am unable to manipulate the $\ln n$ in exponent of a to use ratio test ? Can you please help me with that ? OR any alternative way to solve it.


Differential equations - Hypergeometric function

I would like to solve the equation $(x^2-x-6)y''+(5+3x)y'+y=0$ at $x=3$. I think we have to solve this problem in considering the Gauss's hypergeometric equation on the form (*) $$x(1-x)y''+[c-(a+b+1)x]y'-aby=0.$$  Does someone could solve the problem or just tell me how I can bring the original equation as (*)?  The general case is $$(x-A)(x-B)y''+(C+Dx)y'+Ey=0.$$   This equation can be transformed into hypergeometric equation through the change of variables: $t=\frac{x-A}{B-A}$ and obtain that : $t(t − 1)y'' + (F + Gt)y' + Hy = 0$...But how could solve this equation?


$f \in \mathbb{C}[x_1,\ldots,x_n]$ and its zeroes

Given a polynomial $f \in \mathbb{C}[x_1,\ldots,x_n]$, then how can I prove that  $f(a_1,\ldots,a_n) = 0$ implies $f$ is a summation of factors of $x_i - a_i$ for $i \in \{1,\ldots, n\}?$  This is not at all obvious to me. Any help would be much appreciated!


Every now and then an answer is (fully or partially) based on a myth.  Myth, as in: there is literally zero evidence that supports it, yet many swear it is true  This of course leads to a certain amount of agreement and upvotes. Depending on the popularity of the myth and the amount of good counter-evidence, the amount of upvotes can be much higher than downvotes.  What can we do in such cases when the "myth believers" are in majority?   Write a comment that there is no evidence for the claim? Edit the answer? (remove the false claim? or maybe leave it and note that it is a common misconception?) Ask for supporting evidence? (this is basically same as 1) Something else? (give up and let the myth grow, as SE is a quite popular source of information?)   An example of a myth, for the sake of argument:     pigs can fly   Zero evidence for it (also, I hope, nobody really believes this).  I'm not giving an actual example for the reason to avoid responses like "hey, but that is actually true!"  I am referring to technical discussions, like on Super User, Server Fault and Stack Overflow.


Can't Remember the Book - special mathematical conclave

I am trying to remember a book I read a while ago.  It is about a boy who lives in some sort of special mathematical conclave that only opens its doors to the outside world every few years.  An alien spaceship is discovered orbiting earth and the boy, along with a few others, travel to space to take over the ship.


"Cast" a String Attribute to String Java

I have a little problem with Attributes. I am currently working on a project that parses emails from an LDAP server into the Java application that will be doing some interesting stuff with emails in the future.  I am currently having this code that takes emails from users on LDAP and it needs to put emails in the User class as seen in my code:       [some code here, TRY CATCH is also included]           LdapContext ctx = new InitialLdapContext(env, null);                 ctx.setRequestControls(null);        NamingEnumeration<?> namingEnum2 = ctx.search("[path to the server]", "(objectClass=user)", getSimpleSearchControls());       System.out.println("Test: print emails from whole DIRECOTRY: \n");       while (namingEnum2.hasMore()) {          SearchResult result = (SearchResult) namingEnum2.next();         Attributes attrs = result.getAttributes();           System.out.println(attrs.get("mail"));          /** This line above works fine, but every time there is no email              in User info, it prints "null" in some cases when there is              no email, which is not perfect. But this is just here to see              if everything works and indeed it does.**/           /**User Class accepts a String parameter, checks if it's empty             and all that, does some checking and etc... BUT! attrs.get("mail")             is an Attribute, NOT a String. And I need to somehow "cast" this             attribute to a String, so I can work with it.**/         User user = new User(attrs.get("mail")); //error yet,because the parameter is not a String.          User user = new User(attrs.get("mail").toString());//gives an expeption.          /** And I know that there is a toString() method in Attribute Class,             but it doesn't work, it gives an "java.lang.NullPointerException"             exception when I use it as attrs.get("mail").toString() **/     }   Here is User class's constructor:  public User(String mail){         eMail = "NO EMAIL!";         if (mail != null && !mail.isEmpty()){               eMail = mail;         }         else         {              eMail = "NO EMAIL!";         }       }


clean string from 'unit separator' (0x1f) character for xml

Ran into the following exception parsing XML generated from inputs: org.xml.sax.SAXParseException: Zeichenreferenz "&# at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)  I traced the problem down to an input string containing the character 0x1f, an invisible "UNIT SEPARATOR" character:  I had to copy the input into a text file to make it visible:  Tested the input-string in other places and also ran into problems like: Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: XML parsing: line 1, character 149, illegal xml character at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1632) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:602) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:524) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7418)  What would be the best way to strip such characters from an input string, are there other problematic characters for XML which should be removed?


I would like to create a five level deep list using the enumitem package. I found this suggestion on  and implemented it as follows  \documentclass[twoside,a4paper,12pt]{report} \usepackage{enumitem} \setlistdepth{9}  \begin{document} \begin{enumerate} \item 1st level     \begin{enumerate}     \item 2nd level         \begin{enumerate}         \item 3rd level             \begin{enumerate}             \item 4th level                 \begin{enumerate}                 \item 5th level                 \end{enumerate}             \end{enumerate}         \end{enumerate}     \end{enumerate} \end{enumerate} \end{document}   But still get the error too deeply nested. Using itemize environments is unfortunately not an option.   In the link provided it is mentioned that the \setlistdepth{} only works from a certain version on, how do I find out which version I am using?


Show Title/Date/Excerpt of first post & only Title for rest in Query

I need to show 7 posts of a certain category.  The first needs to appear as Title / Date / Excerpt.  While the others can just be Titles of the posts.  Right now I am having trouble with getting the first post to appear different with my specific code.  Any help would be appreciated, thanks.  <?php $the_query = new WP_Query( 'showposts=7&cat=113' ); ?> <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> <a href="<?php the_permalink() ?>"><?php the_title(); ?>
 <?php endwhile;?>


How to obtain running user's username/password/token for a POST callout

I have a Django application which connects to Salesforce using some user informed credentials and an user informed Salesforce record ID. But I don't want my users accessing an external system anymore, so I need to make Salesforce connect to this external system and give this record ID and credentials instead. But I can't modify the existing system, so I need to put user's username, password and token as POST parameters when making the callout.  I couldn't find any UserInfo.getPassword() or similar functions to get running user's credentials to add in the body for the callout. How is that possible?   EDIT: By using Named Credentials, I can access {!$Credentials.UserName} and {!$Credentials.Password} and insert them in the POST body, but I couldn't find any way to get the API Token. Is there any way? My external system needs these 3 credentials to be able to do his thing. I know it would be best to have a different endpoint which does not require this information, but right now I don't have the option to create another service.


What are those characteristics by which every sound can be identified uniquely?

What are those characteristics by which every sound can identified uniquely?  For example, pitch is one of the characteristics of sound, but let’s say a note C# can also be played on a guitar and piano with same pitch but the resulting sound that we hear is different so what are those characteristics which defines every sound.


How to get all permutations of letters as well as case for a string in python?

How to get all possible combination of cases as well as letters for a string in python?  Example   input:'ab'   output:aB', 'Ba', 'BA', 'Ab', 'AB', 'bA'  input : 'dan'    output:aND', 'ANd', 'Dna', 'naD', 'DaN', 'aDn', 'Adn', 'dnA', 'NdA', 'anD', 'DnA', 'NAD', 'nAD', 'Dan', 'NDA', 'nAd', 'AdN', 'DAn', 'AnD', 'And', 'DNA', 'daN', 'adN', 'nDa', 'dAN', 'dNa', 'aDN', 'ADN', 'dNA', 'Nda', 'AND', 'DNa', 'NaD', 'Nad', 'aNd', 'nDA', 'dAn', 'NAd', 'ndA', 'NDa', 'ADn', 'DAN'


Is this php code sanitization redundant or incorrect?

Let's say  this code is executed after press the submit button in a form with purposes of sanitization:   <?php $yourname = check_input(filter_input(INPUT_POST, 'yourname', FILTER_SANITIZE_STRING)); $email = check_input(filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL)); $likeit = check_input(filter_input(INPUT_POST, 'likeit', FILTER_SANITIZE_STRING)); $comments = check_input(filter_input(INPUT_POST, 'comments', FILTER_SANITIZE_STRING));  function check_input($data) {     $data = trim($data) . stripslashes($data) . htmlspecialchars($data);     return $data; } ?>   Taking in account that the filter_input function is being applied, is the check_input($data) function redundant in this case?


I'm trying to extend the birthday problem to detect collision probability in a hashing scheme. Here is my problem. I use the letters and numbers [A-Z][a-z][0-9] to make a set of keys by randomly choosing from that set 10 times and concatenating them all together. So A24cv30kf2 could be one key for example. This implies that the base set has $62^{10}$ possible keys. Next, I want to compute the probability that I would see a collision if I picked a key from that set and issued it to $n$ users. If $M$ represents the size of the set (= $62^{10}$) and $P(M,n)$ the probability then  $$P(M,n) = \frac{M!}{M^{n}(M-n)!}$$  This follows by replacing 365 in the well known birthday problem shown   What I want to understand is the following: I want to check and see if my choice of concatenating 10 is right, when I know that my $n$ is of the order of a few millions and my $1 - P(M,n)$ needs to be less than 0.0001 or some small number. The large values of M & n make the above intractable to compute. Is there an easier way to compute this?


Resize image after retrieve it from data base

hey there i want to resize image after retriving from database here is my code          try{         String sql ="SELECT Image from piece where Code_Piece =          "+jTextField1.getText()+"";         stmt=maconnexion.Obtenirconnexion().createStatement();         ResultSet Rs=stmt.executeQuery(sql);          if(Rs.next()){             byte[]imagedata= Rs.getBytes("Image");             format = new ImageIcon(imagedata);              lbl_image.setIcon(ResizeImage(format, null));         }          }catch(Exception e) {         System.out.println("No Fille");        }   i got this error "java.lang.NullPointerException" and i use this method to resize my image          String imgPath = null;            public ImageIcon ResizeImage(String imagePath, byte[] pic){         ImageIcon myImage = null;        if(imagePath != null){        myImage = new ImageIcon(imagePath);       }else{       myImage = new ImageIcon(pic);       }        Image img = myImage.getImage();         Image img2 = img.getScaledInstance(lbl_image.getWidth(),       lbl_image.getHeight(), Image.SCALE_SMOOTH);        ImageIcon image = new ImageIcon(img2);          return image;           }


Getting a java.lang.NoClassDefFoundError error even when .class file exists

This is my file structure:  T1 -> T1sample -> src -> t1sample -> T1.java T1 -> T1sample -> src -> t1sample -> T1.class   I created these folders and files myself (except for T1.class, I got that by running 'javac T1.java' from the shell).  This is T1.java:  package t1sample;  public class T1 {     public static void main(String []args) {         System.out.println('Test');     } }   Now when I try to run java T1 it returns an error saying:  java.lang.NoClassDefFoundError:  T1 (wrong name: t1sample/T1)   Any idea why?


What is the word for always YES (100%) or always NO (0%), never in-between

For example:     1) In statistics, this attribute will always either be 0% or 100%, never in-between.      2) The boundary is either safe or destroyed, because there is never a state where it is only 'slightly leaking'.      3) The rash either itches or does not. It can't itch a little. That would still be an itch.   What word can we use to describe this attribute?


I need rules to drop some malicious Apache connections

I drop all traffic on ports except on 80 for my web server.  I have some rules like this on iptables:  iptables -A INPUT -p tcp -m tcp --dport 80 -m string --string "cgi" --algo bm --to 1000 -j DROP   Someone who have more can share? I know always the bad hackers still updating, but some of them always begin with the same code. I need to Drop the connection based on some criteria. Here are some Apache log (I remove ips but each atack come from the same):  Attack 1: This I don't know what are trying to do, but make it 50 times from the same ip  GET / HTTP/1.1  301 224 -   Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22 GET / HTTP/1.1  302 3387    -   Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22   Attack 2: this try to get information about server only.  GET / HTTP/1.1  301 224 http://myip:80/ Go-http-client/1.1 GET / HTTP/1.1  302 3228    http mywebsite  Go-http-client/1.1 GET /es/ HTTP/1.1   200 40947   https mywebsite Go-http-client/1.1   Attack 3: they try get access to a login page vulnerability  GET /userlogin/login.aspx HTTP/1.1  302 186 -   -   Attack 4: this try to access a cgi at first request, (see my first iptables rule to drop this)  GET /hndUnblock.cgi HTTP/1.0    302 186 -   Wget(linux) GET /tmUnblock.cgi HTTP/1.0 302 186 -   Wget(linux)   I'm very new with server this 4 attacks are from only last 12 hours... Have thousands per week.


Problem understanding a question concerning the following function: $z=a+bi \mapsto f(z)=a+i(a+b)$

I'm preparing for an exam, and I have come over the following problem: I have the function f, where C is a complex number $$f: C \to C,$$  $$z=a+bi \mapsto f(z)=a+i(a+b)$$  Is the function of the form $f(z) = z·w$, where $w$ does not depend on $z$?  I have written $w=c+di$, which gives $z·w=(ac-bd)+ (bc+ad)i$. This gives us two equations, namely: $$ac-bd=a$$ and $$bc+ad=a+b$$  I tried solving this system of linear equations for $c$ and $d$, and ended up with $c=d=1$. Seeing as this does not hold for any z, I concluded with the answer 'no', to the question asked in this task. My teacher, however, concludes with the opposite, using the following logic:  In his solution, my teacher ends up with the same system of linear equations as I did in my post. From there he says that the system has a unique solution if and only if the determinant of the matrix $$ \begin{matrix}a&-b\\b&a\end{matrix}$$ is non-zero. That is $a^2+b^2 \neq 0$.Then he says: But if $a^2+b^2=0 \Rightarrow a=b=0 \Rightarrow f(z) = 0 = 0 · w$ Hence the answer to the question must be 'yes'. If anyone could help me understand what is meant, I would greatly appreciate it.  Please let me know if something was unclear, or if I should explain more clearly what I have done. Thank you in advance!


Finding formula for sum $S_n = \sum_{i=1}^n i(i-1)$

How do I find the formula for this sum  $S_n = \sum_{i=1}^n i(i-1)$  Wolfram alpha gives me the correct formula which is $ \frac{1}{3} (n-1)n(n+1)$, but I'm interested in how I get to that and how I can approach this kind of problem in general.


A commutator in a group $G$ is an element of the form $ghg^{-1}h^{-1}$ for some $g,h\in G$. Let $G$ be a group and $H\leq G$ a subgroup that contains every commutator.  $(a)$ Prove that $H$ is a normal subgroup of $G$.  $(b)$ Prove that the factor group $G/H$ is abelian.  I'm not sure what to do, any proofs or hnts are greatly appreciated. Thank you.


Young adult story with celtic mythological creatures, and people who acted as mediums for them

I only remember reading it as a child, so not sure if it was published in 90's or 2000's. In it, a girl is aware of mythological creatures and people who feel an affinity to them, such as banshees, unicorns, harpies or kraken. Each kind of creature is assigned an element, so kraken is water, harpies are air, dragons are fire etc. The girl thinks she discovers her creature and the medium society leaves it at that, but then she discovers she has affinity to another creature, then another, then she finds out she's this universal medium for all kinds of mythological creatures.  There's a big baddy who wants her for her powers, but I can't remember his ultimate goal.  Anyone remember reading anything similar? Cheers.


How to prevent wp-login brute force attack from thousand of different IP?

Investigating a problem. I found out that I had so many calls to wp-login, but from many different ip's. Any idea on how to handle it?


Can a Rogue (D&D 3.5) use sneak attack on both the first and second attack?

I know this seems like a question you can simply Google but the answers vary and my clan is under the impression that I can only use it on my first attack (once per round) and not on my second attack.  From Googling, I've understood that as long as the monster / enemy is flat-footed, flanked or caught off-guard, I can apply sneak attack on both my first and second attack in a round.  Is this correct?  Is it normal if the clan simply decides that that gives me an unfair advantage in combat and gives me only one sneak attack per round?


For playing the videos with .mkv extension, I installed vlc player in ubuntu 14.04.   Now, while installing the vlc plugins, it is giving the following error:  Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package vlc-plugin-libde265


dateline issue: wrapDateLine with MapFile

I am using wrapDateLine properties for OpenLayers.Layer.WMS for handling dateline issues. The problem with wrapDateLine is that I am getting the same polygon repetitively around the wrapped map as a user selects a desired polygon around dateline. Is there any way to select the polygon around dateline in a single wrapped map and avoiding repetitions? My OpenLayers.Layer.WMS constructor is as:  var I = new OpenLayers.Layer.MapServer("region", "http://localhost/cgi-bin/mapserv?map=/home/public_html/test1.map",{poly='Bermuda', layers: 'myregion', format:'image/png'},      {wrapDateLine: true}     );   e.g. Bermuda in my example is in dateline and if I use wrapDateLine:true, I get complete polygon of Bermuda but it is repeated (wrapped). I want complete polygon of Bermuda but no repetition. Is there any other way for it?  I see that there are options like OpenLayers.Bounds() and layer.adjustBounds(). I am not sure if it works in my problem.


My visa was refused because I stated I am a student but the information provided does not demonstrate I am a student or currently enrolled in an academic institution. And it is also unclear in the information provided how I am financially supported to meet the cost of living in my country. I want to know what the refusal means and my next step I can take in applying for my visitors visa.


History command showing the directory and the date

Is there a way to have in the .bash_history file, listed: the directory where the command has been typed, the date, and the command ?


Can Colossus Slayer kick in more than once per round?

We have a Ranger and a Battlemaster in the party, and the Ranger thinks that he can benefit from the Colossus Slayer bonus to damage both during his Action and again later in that same round if the Battlemaster gives him an extra attack using Commander's Strike (which uses the Ranger's Reaction)...because Colossus Slayer only states "You can deal this extra damage only once per turn" and doesn't specify it has to be only on the Ranger's turn.   Since the Reaction is happening on the Battlemaster's turn, he reasons that Colossus Slayer is still only "once per turn" (it just happens to be on two different people's turns).


Use a rectangular contour to evaluate the integral

$$\int_{-\infty}^{\infty} \frac{\cos(mx) dx}{e^{-x}+e^x} = \frac{\pi}{e^{m\pi /2}+e^{-m\pi /2}}$$  I need to evaluate the above integral specifically using a rectangluar contour and at some point applying the residue theorem. I should be ok with the residue part, but I'm confused at to how to get this into the example form shown in the book:  $$I =\int_{-\infty}^{\infty} \frac{e^{ax}dx}{1+e^x}=\frac{\pi}{\sin(a\pi)} $$  I tried using the identity $\cos (mx) = \frac{e^{ix}+e^{-ix}}{2}$ but I end up with $\frac{1}{2} \int_{-\infty}^{\infty}\frac{e^{ix}(e^{imx}+e^{-imx})dx}{1+e^{2ix}}$, which almost resembles the example but not quite...


Im learning python but I dont understand what this line does? or how many options there is?


How can I create a valid object in a recursively generic class?

Question:  I'm implementing a recursive add() method on a tree type datastructure, implemented with a generic class representing tree nodes.  How can I create a sub-tree in that recursion, if the sub-tree is a generic type - thus has no constructor I can call?  Details of Situation:   I have a generic class set (which underneath is a map) that is designed to implement maps of maps of maps of ... of objects (basically, N level tree).  public interface NodeInterface<KeyType, ValueType> {     public void add(List<KeyType>, ValueType);     public ValueType getSubTree(KeyType); // Get subtree map }  // Generic map class.  // Leaf level nodes are maps too, just not maps containing other maps public abstract class NodeMap <KeyType, ValueType> implements NodeInterface<> {     protected Map<KeyType, ValueType> map; // actual map     ...  }  // Leaf level objects - map NOT containing other maps public class LeafNode extends NodeMap <String, MyDataType> {     public void add(List<KeyType>, ValueType) {} // implementation for leaf add     ... }  // Tree nodes (non-leaf) public class ParentNodeMap <ValueType extends NodeMap <?,?>>     extends NodeMap <String, ValueType> {      // This class is needed because there are methods that must be       // implemented on a map that can't be implemented on leaf level nodes.      ... }  // Actual tree node classes (needed as syntactic sugar, to avoid end users  // having to deal with HashMap<String, Hashmap<String, HashMap<String, ...MyDataType>>>>> public class Level2Node extends ParentNodeMap <LeafNode> { } public class Level1Node extends ParentNodeMap <Level2Node > { }   What needs to be done:  I'm trying to implement a method which will recursively insert the leaf level object into this map of map of maps (described in the interface).  E.g., the desired behavior is:  tree = new Level1Node(); List<String> keys = Arrays.asList("key1", "key2"); // I think I need 3 here? irrelevant. MyDataType data = new MyDataType(); tree.add(keys, data);   Problem:  I can't seem to implement creation and insertion of the subtree map in the add() method for ParentNode  This is what I tried in ParentNodeMap class:  public void add(List<KeyType> keys, ValueType value);     KeyType key = getFirstKey(keys);     createMapIfNull(); // creates "map" as new HashMap<KeyType, ValueType>()     ValueType subTree = getSubTree(key); // Gets me child subtree from map     // PROBLEM! that subtree is now "null" since we just created an new Map      // which has no key "hey"      // Now here's where we should create a new subtree and add it:     if (subTree == null) {         subTree = new ValueType<>(); // THIS IS WHAT FAILS!!!!         map.put(key, subTree);         subTree.add(keys.removeFirstKey(), value); // recursively add to subtree     }   Now, what I'm specifically stuck on is: How can I create an subTree object (of NodeMap type); where its type is generic ValueType extends NodeMap <?,?> and that's all I know of it?   Calling new ValueType() gives "Cannot instantiate the type ValueType" error.


I have Ubuntu 18.04.2 LTS on my laptop. Got a new USB Stick (Samsung) for storing extra files and I am unable to access it.  When I insert it, the folder shows up but when I click on it, it says:  Unable to access Samsung USB  - Error mounting ... Samsung USB: Unknown file system Type 'Exfat'   What do I need to do to be able to access it? Please give advice that an absolute IT beginner can handle :)


My issue is as follows: This is the content of variable res: % echo $res large__noninteractive($|[[:blank:]])" | grep -E "(^|[[:blank:]])RAM.3000000($|[[:blank:]])" | grep -E "(^|[[:blank:]])CORES.1  And when I do as follows it gives me results (everything after grep -E "(^|[[:blank:]]) and before ($|[[:blank:]])" is the identical to the content of $res) : cat queuedjobs | grep -E "(^|[[:blank:]])large__noninteractive($|[[:blank:]])" | grep -E "(^|[[:blank:]])RAM.3000000($|[[:blank:]])" | grep -E "(^|[[:blank:]])CORES.1($|[[:blank:]])"  but when I do: cat queuedjobs | grep -E "(^|[[:blank:]])$res($|[[:blank:]])"   There are no results even though it is supposedly identical. I would appreciate any ideas for solving this issue.  I'm testing it in the command line but it will enter into a script. I made the res as follows: resource="large__noninteractive RAM.2500000 CORES.4"` res=`echo $resource | sed "s/${queue}//g" | awk '{$1=$1};1' | sed 's/ /($|[[:blank:]])" \| grep -E "(^|[[:blank:]])/g'`


Many people have asked questions on this site regarding the rules for layovers, with no definitive answers. The rules are constantly in flux and it is very difficult to get a clear answer from government websites. I would like to buy a plane ticket for my mother-in-law (who has a visa) from Ukraine to the US. Most available flights have at least one layover in Europe. My understanding is that EU countries (minus some special cases and US citizens) are currently banned from travel to the US. If we buy a ticket with a layover in, say, Switzerland, can there be a problem? Is this allowed under current rules?


Could someone please give me a NON MATHEMATICAL (put the answer in words rather than formulas) of what exactly the difference between Big O, Big Omega, and Big Theta are? I have looked at many resources but its still very confusing. I know Big O is the upper bound, Omega is the lower bound, and Theta is within the upper and lower bounds. But what exactly does that mean?


I have Canon lenses and would like to purchase an adapter to use them on the D3200? Is there one available? If so name and model would be appericated. I understand that I will have to shoot on manual mode.


Fatal Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32 bytes)

I have the following PHP script used to retrieve data from a table called Equipment. I seem to get the error that I've run out of memory.  I am assuming it is because I have a looping part in the script where it looks at each line of the table.  Code:  <?php  // Create connection $con=mysqli_connect("localhost","portaltest","password123>!s","portaltest_test");  // Check connection if (mysqli_connect_errno()) {   echo "Failed to connect to MySQL: " . mysqli_connect_error(); }  // This SQL statement selects ALL from the table 'Equipment' $sql = "SELECT * FROM Equipment";  // Check if there are results if ($result = mysqli_query($con, $sql)) {     // Create temporary connection     $resultArray = array();     $tempArray = array();      // Look through each row     while($row = $result->fetch_object())     {         // Add each row into our results array         $tempArray = $row;         array_push($resultArray, $tempArray);     }      // Finally, encode the array to JSON and output the results     echo json_encode($resultArray); }  mysqli_close($con); ?>   What can I modify to make the script less of a memory hog?  MORE DETAILS: I have already tried adding different set amounts of memory:  None of the following worked:   ini_set('memory_limit', '800M');  ini_set('memory_limit', '-1');


All rogues know thieves cant. If one rogue in the party is talking to an enemy in a language that an ally rogue in the party does not understand, would the speaking rogue be able to use thieves cant to convey a message to the other rogue who does not know the language being spoken to the enemy? Would this realistically be possible without raising suspicion from the enemy? How would you as a Dungeon Master handle this situation? The key thing to note here is that RAW says that thieves cant:  allows you to hide messages in seemingly normal conversation.  So what happens if said conversation is being spoken in a language that only one of the two rogues understands?


Dungeons & Dragons Attack hit probability success percentage

In D&D players roll a 20 sided die trying to beat a set number to determine if an attack hits the target. Players often can add modifiers to this roll to help the odds in reaching this target number. If the target number (enemy armor level) is passed by the attack roll, damage is done to the target which requires a different roll depending on the power of the attack. If the armor level is matched for that attack roll, damage is calculated like normal (rolling dice, adding modifiers) and then halved, rounding down to the nearest integer.  One of my spells allows me to do three attacks at once on one creature, and on a hit deals 2 6-sided dice +2 damage.  It so happened I used this spell on my "Ally" and I'm trying to figure out what my chances of actually killing him were.  I roll a 1d20 (1 20-sided die) and add +4 to the roll and if that result is greater than or equal to 16 (my 'Allies' Armor level), I roll damage which is 2d6+2 (halfing then rounding down the damage if the attack equaled Armor level). That damage result is then subtracted from my 'Allies' starting Health which is 20.  I repeat this 2 more times, adding damage on each hit. If his health reduces to 0 then he is dead. If his health is 1 or more by the end of this attack he lives and gets to attack me.  I want to know, statistically what percentage of time will my Ally be reduced to 0 health after doing this spell?


Algorithms for Physically based shading models

For real time interactive graphics, it seems to be practical now to use physically based shading models. I want to write some shaders to incorporate into an openGL based game engine that I'm writing and I wasn't sure of what algorithms to read up on. What algorithms and models seems to be practical and useful for real time graphics as of 2014?


Windows 7 shows a drive as full in summary but i can't see what's taking up all the space

Sorry i'm not too computer savy and i'm looking for some help, if someone would be so kind. My D drive is saying i only have 166mb free of 703GB. I have pretty much cleared off all my files from there but the space keeps getting lower and lower, the total file usage on the drive is 11.7GB, i have no idea what could be taking up all that space. Any ideas on how to fix this would be great!


Can my 13 year old sister travel back to her country (India) unaccompanied?

Me and my sister (13 years old), are traveling to the UK and my sister has an accompanied visa. Is it possible for my sister to travel back to her country (India) unaccompanied with airlines escort services, as I wish to stay longer but she can't due to academic reason.


I found this symbol in a document (written with Latex) and I wish to know how to write it myself:


Bibtex: cite-key instead of question mark if not found

Iintensive search has not yield any answer, but I still suspect this might be a double-post:  Instead of a question mark, I want to have the cite-key if the reference was not found in the bib file. Is there an easy package  / command for this?  So far, I'm using natbib and my bibliography style is chicago (if it matters).  /edit In my header, I have  \usepackage[round]{natbib}  \bibliographystyle{chicago}


Is there a old-school retro style Ubuntu theme or DE?

just wonder if there is such theme or DE which seems like retro-style. Such as a mono-tone GUI. Actually, an old Mac style would be best.


This is not so much a question but a request for a change to the defaults.  Though it is quite possible my issue is related to something that I'm doing this issue has been around for many years (and across many different machines, in my case).  With that, why is the default color scheme for Ubuntu server such that the directory color is dark blue on a black background?  This makes reading the name of the folder almost impossible, in my case.  Is there a way I can change the color scheme during the installation process or do I have to modify my .bashrc on each new installation manually?


Automatically transform curves to polygons in AI CC

I have a script that reads SVG  coordinates and creates a dot on each anchor point. The problem is that it does not work with curves so I need to transform the curves of any shape into straight lines - example:    A basic object like that is somewhat easy, but I actually need it on a larger scale. The simplest would look like this:    Is there any way to achieve that automatically with Illustrator CC?   I could adjust the script to read another file extension as long as it only outputs X and Y coordinates (no curves). Ex:  -20.8,262.5 -4.3,263.6 4,264.9 13.4,267.2 23.5,270.6 34.5,275.4


About an inequality in inner product space with the best approximation property

I tried to prove an inequality in an inner product space $X$ which is as follows,  Let $M$ be a linear set in an inner product space $X$, and $x$$∈$$X$ such that $ρ$ = $inf$$_y$$_∈$$_M$ $\|$$x$$-$$y$$\|$. Prove that for any $y$$_1$, $y$$_2$ $∈$ $M$, $\|$$y$$_1$$-$$y$$_2$$\|$ $\leq$ $($$\|$x$-$$y$$_1$$\|$$^2$$-$$ρ$$^2$$)$$^1$$^/$$^2$ $+$$($$\|$x$-$$y$$_2$$\|$$^2$$-$$ρ$$^2$$)$$^1$$^/$$^2$. I tried to use the property of inner product and best approximation but somewhere lost in the middle and couldn't get the desired result. How should I proceed?


Story or Novella about Remote Controlling/Possession Human Beings

The setting of the story is about that any human being might be controlled/possessed at any time by unknown forces. Society as a whole seems to have adapted, there are even laws governing such incidents. Nevertheless, life is quite gruesome. I remember one scene in which it is described that people are killed by jumping to their deaths (into oversized meat grinders? I am not quite sure) while possessed.  The protagonist is a man who raped or molested a woman while possessed. Nobody believes him though, since such a thing never happened before. Although innocent, he is found guilty and becomes a "Liar" mark, maybe as tattoo or branding.   After some adventures he discovers that the possessions are in fact a technical feat by some group (or whatever).


Not able to see Hello World Lightning Web Component on salesforce

After push we have  sfdx force:source:push but not able to see helloWorld component on Salesforce  custom tab is empty.


Wifi doesn't work in Ubuntu 15.10 - Realtek RTL8723BE/RTL8188EE 802.11b/g/n Wireless LAN Drivers

My laptop is a HP Notebook - 15-ac173tx having Realtek RTL8723BE/RTL8188EE 802.11b/g/n Wireless LAN Drivers.  I can not work with my wifi properly as it drops once in a while, and also I can't log into a wifi network if the wifi router is in another room even if I connect to a wifi network really close to my lap the signal strength of the wifi is really low.  Please help me to fix this issue asap.


How do we find the length of an object in Javascript?

I dont see how we can find the length of an object. For arrays i can your array.length but it doesnt work for objects, any suggestions?  Thanks!


What's missing from the Xbox 360 version of Minecraft?

I recently purchased Minecraft for my Xbox and I have been playing through it.  I've started looking through the Minecraft wiki and have noticed that some things aren't in the Xbox version. However, I haven't been able to find a comprehensive list of everything that's not in the Xbox version. What elements of Minecraft Java Edition are not in the Xbox 360 version?


how to make python manage.py runserver still running if terminal close?

python manage.py runserver 0.0.0.0:8000  how to make this command running if terminal close  for now i use screen and it works any other way to do that? i mean for production how to link it to ngix or apahce in ubuntu server?


How to find the period of the sum of two trigonometric functions

I want to know if there exists a general method to find the period of the sum of two periodic trigonometric function. Example:     $$f(x)=\cos(x/3)+\cos(x/4).$$


I just picked up Dark Souls and it looks like I can either stay in "hollow" form or become "human" by using a special item that I gained after defeating a boss. But from googling a bit and finding only ways to obtain it, I couldn't find any clear information on what it actually does. I also found that bonfires have an option to "kindle" them, but that requires humanity.  What effects does "humanity" have on me? And what about kindling bonfires with it?


Finding the limit $\lim_{x\rightarrow \infty} \sqrt[3]{x+1}-\sqrt[3]{x}$

I am trying to  find this limit  $$\lim_{x\rightarrow \infty} \sqrt[3]{x+1}-\sqrt[3]{x}$$  My so far method is this   $f(x)>0.$ $f^{\prime}(x)=\frac{1}{3\sqrt[3]{(x+1)^2}}-\frac{1}{3\sqrt[3]{x^2}}<0.$ For every $0<y<1$ the equation $f(x)=y$ has a unique solution(found in maple):   $$x=\frac{1}{3}\cdot \frac{\frac{1}{3}y^2(3y^2+\sqrt{-3y^4+12y})+\frac{1}{6}\frac{3y^2+\sqrt{-3y^4+12y}}{y}-y^4-2y}{y}$$  The previous facts implies that the limit is $0$.  I am wondering if there is any way easier than this to find the limite.  thanks in advance.


Show that $n = 3^{100} + 2$ is not a prime number.

So I have to prove that $n = 3^{100} + 2$ is not a prime number while we assume that $X^2 - 53$ has no zeroes in $\mathbb{Z}/n\mathbb{Z}$.   Because we are working with quadratic reciprocity in this chapter, I assumed that $\big(\frac{53}{n}\big) = -1$ and by the law of quadratic reciprocity, we know that $\big(\frac{n}{53}\big) = -1$. However, I have no clue how I could use this to prove that $n$ is not prime.


How to create new font which is thicker version of Computer Modern

I'm trying to find a good way to have the LaTex default font "Computer Modern" (CM) a bit thicker (also called "blacker"). I really like this font, especially when it comes to math mode, so answers like "Change the font." don't qualify, sorry. :) The only problem is that CM has very thin lines, so the font looks very light. There are several methods to make CM "thicker" (I'm not talking about the bold series of the font! This one looks different and is not what I am looking for.) which can be found elsewhere on tex.stackexchange:  1) Use FakeBold in XeLaTex:   2) Use pdfliteral as suggested here:   3) Use pdfrender as suggested here:   However, the answers given there don't suit here: 1) Needs XeLaTex (I only have PDFLaTex and I cannot install additional software, as I'm not a system administrator.) Results produced with 2) + 3) look very good. Actually it looks exactly like I intend it to be. However, it only looks good with certain Reader software (Evince and certail versions of Okular). With other Reader software (like other versions of Okular or even the Adobe Reader) the base line of characters is not quite the same or there are white artefacts inside the letters.  I think, the only option to resolve the problems is to create a proper font. (The solutions in 2) and 3) don't create a new font, they are hacks that manipulate the way the original CM font is displayed.) And here is my question: How do I create a "vectorbased" (not pixelbased) proper font from Computer Modern which has the same "thickness" attributes like the results obtained with pdfrender/pdfliteral in 2) and 3) ? I don't really know anything about fonts. The basic idea should be to take the original CM font and to do some adjustments to its geometry. There is a German post:    There they talk about a "blacker" parameter in a "metafont source file" of CM. However they produce a pixel-based font and I'm not exactly sure what they are actually doing there.  Upshot: I'd like to have a thick (not bold) CM-like font which looks good with any reader software and it should be usable with PDFLaTex. Thanks for your help.    To give you an impression what I have in mind: Here's a (famous) article whose "oldschool" look I try to resemble with a modified CM font:    I've magnified it and compared it with my own "pdfliteral" results and my conclusion is that it is indeed a thicker CM (probably due to the fact that it was printed and scanned afterwards as is indicated by the not quite horizontal text lines on some pages).  I now get an idea of how to clearify my question: Using METAFONT, how do I create a new font from the original CM metafont source files () but with a higher blackness parameter?


Answering a negative question with one word

There has been talk of how to answer a negative question without ambiguity, most often with a qualifying phrase needed for clarification. (For example, "yes, I do"/"no, I don't.)  I've noticed that other languages have a single word to address a negative question on the contrary. In German, ja means yes and nein means no. Alternatively, doch is used to respond in the positive to a negative question, in essence meaning "No, I intend to do the opposite of what your question presumes."  Take for example the question, "You don't want to go to the movie then?" German speakers could simply reply, "nein" if they don't want to go or they would say "doch" if they did want to go; an unambiguously positive response to a negatively phrased question. No need for, "no, I actually would like to go" or "yes, I'll come actually". In French, the respective equivalents of ja, nein, and doch are oui, non, and si. I imagine many other languages contain this set as well.  I am wondering whether there was at one time an equivalent word in the English language that has since (unfortunately) disappeared. Any ideas?


How are the weather and vegetation in Kyoto in November-December?

I am deciding if I will travel to Kyoto in late November, early December.    How cold is the weather? Is there still a chance to appreciate the fall's splendid colors or will trees have lost all their leaves by then?


Proving $\dim(R(A)\cap R(B)) \ge \dim(R(AB))$

$A$ and $B$ are square matrices of order $n$.  Given $AB=BA$, prove that $\dim(R(A)\cap R(B)) \ge \text{rank}(AB)$.  Can I say that:  $\text{rank}(AB) \le \text{rank}(A) = \text{rank}(B)$  and  $\dim(R(A)\cap R(B)) \ge \dim(R(A)) = \text{rank}(A)$  Thus, $\dim(R(A)\cap R(B)) \ge \text{rank}(AB)$?  I think there's a lot of flawed reasonings. Would appreciate it if someone can enlighten me. Thanks!


First of all, I should say that I think that this question does not belong on Meta.    StackOverflow URLs are inspirational to me, the way they are designed is very clever and they work really well but I can't seem to understand the logic being the IDs, here are some examples:  stackoverflow.com/questions/2121720/   If you change the ID to ID++ (2121721) one could think it would fetch the next question. Wrong, instead you're redirect to another question whose ID seems to be totally unrelated (2121212):  stackoverflow.com/questions/2121212/   Why does this happen? Is there some checksum algorithm on the IDs? Here is a sample trace:  2121720 -> exists 2121721 -> 2121212 2121213 -> exists 2121214 -> 2121155 2121156 -> exists 2121157 -> 2120884 2120885 -> exists 2120886 -> 2115014 2115015 -> 2114896 (what happened here?) 2114897 -> 2114799 2114800 -> 2114670 (what happened here?) 2114671 -> exists 2114672 -> 2110215 2110216 -> exists 2110217 -> 2106982 2106983 -> 2106955 (what happened here?)   The IDs seem to decrease. Can someone bring some light on this strange redirect behavior?


Cross-thread operation not valid on using Parallel.Invoke

I have read many explanations on Threading but it is still quite hard for me to grasp. I tried it in my code and I get an error like so: "Additional information: Cross-thread operation not valid: Control 'dgvLocDatabase' accessed from a thread other than the thread it was created on". Below is the code I have created. It must add data which comes from different sources to 2 different datagridview.   private void btnCountRecord_Click(object sender, EventArgs e) {     CountRecord();      Parallel.Invoke(         GetDevData,         GetPcData         ); }    private void GetDevData() {      if (bIsConnected == false)     {         MessageBox.Show(@"Please connect the device first", @"Error");         return;     }      var sdwEnrollNumber = "";     var idwTMachineNumber = 0;     var idwEMachineNumber = 0;     var idwVerifyMode = 0;     var idwInOutMode = 0;     var idwYear = 0;     var idwMonth = 0;     var idwDay = 0;     var idwHour = 0;     var idwMinute = 0;     var idwSecond = 0;     var idwWorkcode = 0;      var idwErrorCode = 0;     var iGlCount = 0;     var iIndex = 0;      dgvDevDatabase.Rows.Clear();       axCZKEM1.EnableDevice(iMachineNumber, false); //disable the device     if (axCZKEM1.ReadGeneralLogData(iMachineNumber)) //read all the attendance records to the memory     {         lblProgressBar.Text = @"Loading data. Please wait...";         progBar.Visible = true;         progBar.Maximum = _gRecCount;         progBar.Minimum = 1;         progBar.Value = 1;         progBar.Step = 1;          while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, out sdwEnrollNumber, out idwVerifyMode,                    out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkcode))//get records from the memory         {             iGlCount++;             var bioId = sdwEnrollNumber;             var timeLog = idwYear + "-" + idwMonth + "-" + idwDay + " " + idwHour + ":"                  + idwMinute + ":" + idwSecond;             dgvDevDatabase.Rows.Add(bioId, timeLog);             progBar.PerformStep();         }         if (progBar.Value == _gRecCount) lblProgressBar.Text = @"";     }     else     {         Cursor = Cursors.Default;         axCZKEM1.GetLastError(ref idwErrorCode);          if (idwErrorCode != 0)         {             MessageBox.Show(@"Reading data from device failed. ErrorCode: " + idwErrorCode, @"Error");         }         else         {             MessageBox.Show(@"No data from terminal to return", @"Error");         }     }     axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device }  private void GetPcData()         {             var tda = new TimeLogDataAccess();             _rdr = tda.GetAllLogs();             while (_rdr.HasRows && _rdr.Read())             {                 dgvLocDatabase.Rows.Add(_rdr["bio_id"].ToString(), _rdr["time_log"].ToString());             }         }   If I remove the "GetPcData" from the Parallel.Invoke and substitute it with a Messagebox.Show("Call me too");, I don't get errors and if I just run the "GetPcData" on it's own, I don't get errors too.  So I think it's the "GetPcData" in the Parallel.Invoke that is causing the issue.   Can you please tell me what I'm doing wrong and if you can explain more to me this parallel.invoke or threading. Thank you.


evaluation of an integral involving algebraic numbers

Define $A\colon[0,1]\to \mathbb R$ by   $A(x) =\begin{cases}   1,  &\text{if }x \text{ is algebraic}\\ 0, &\text{otherwise}         \end{cases}$   Evaluate : $\int_{0}^{1}A(x)dx$  Is it riemann Integrable in the first place?? Intuitively it looks like $0$ which is also the answer. But I can't justify.


Let $\triangle ABC$ be a acute triangle. Prove that: $$(\frac{1}{cosA}-1)(\frac{1}{cosB}-1)(\frac{1}{cosC}-1) \ge 1 $$ My attempt: $$\Leftrightarrow (1-cosA)(1-cosB)(1-cosC)\ge cosA.cosB.cosC$$ $$\Leftrightarrow 1-2cosA.cosB.cosC + cosA.cosB + cosB.cosC+cosA.cosC \ge cosA+cosB+cosC $$ $$\Leftrightarrow cos^2A+cos^2B+cos^2C + cosA.cosB + cosB.cosC+cosA.cosC \ge cosA+cosB+cosC $$ $$ 0<cos A,cos B,cosC<1$$ $$cos^2A+cos^2B+cos^2C=1-2cosA.cosB.cosC\ge 3\sqrt[3]{cosA.cosB.cosC}$$ $$\Rightarrow cosA.cosB.cosC \le \frac{1}{8}$$ And I was stuck here. Could you help me ?


I have a year's worth of inventory data, and I want to extract the first and last day of each month's data. What is the best way to do this? Thanks


I've read in couple of articles that clustered index is as the same as table, or if you read using clustered index, you have the whole record. Some say, clustered index stores the whole records in deepest leaf of index.  It is foggy for me, does clustered index has a copy of data?!!  for sure not, but I don't why people say that.  I read couple of articles but still it is not clear to me. Is clustered index is something virtual? Does it use B-Tree structure (like non-clustered index)?   Is there any schematic or model that describes how SQL Server stores/manages clustered index?


Can I visit the UK with an EU permanent residence card?

I am non EU national, living in a Schengen country for past 5 years. I hold Indian passport and EU permanent residence card valid for 5 years.   Can i go to UK for few days to visit friends without a visa?  I am aware that UK is not in Schengen, and Schengen visas and residence permits issued by Schengen country is not valid for United Kingdom? But what about the PR card issued by a Schengen country?  I am also aware that EU citizens carrying EU passport have no restrictions to visit UK.


if statement always returning false on string comparison

I have used this code to try and confirm that the user input   passwords are the same and there is no mismatch, before proceeding to   the next activity. But the if statement always returns a false. It works fine for hardcoded text, but always returns a false for if. Am I missing something?   private void validate(EditText userPassword, EditText userConfirmPassword){    String userPasswordtext = userPassword.getEditableText().toString();   String userConfirmPasswordtext = userConfirmPassword.getEditableText().toString();      if(userPasswordtext == userConfirmPasswordtext){         Intent intent = new Intent(this, MainActivity.class);         startActivity(intent);     }else{         Toast a=Toast.makeText(this, "Passwords do not match", Toast.LENGTH_SHORT);         a.show();     } }


Did Leggett and Caldeira solve the measurement problem?

In 1983 Leggett and Caldeira published a  (see also ) that shows the evolution of the density matrix in a dissipative system. Follow-up work by Zurek and others shows the relevance to resolving the measurement problem.  Nevertheless my quantum information lecturer and the science community seem to think that the measurement problem is an unsolved mystery. Other people deny that the problem existed in the first place.  With this in mind: Why is it not widely accepted that Leggett and Caldeira solved the measurement problem?  For clarification: by measurement problem I mean the issue that there are two evolutions of of the wavefunction: a continuous one (Schrödinger equation) and a discontinuous one (measurement). Standard decoherence only says that we have to work in the measurement basis and thus gets around the problem of how the measurement actually occurs by ignoring it. In the Leggett-Caldeira-Zurek framework the discontinuous change simply disappears. Or does it?


How to return JSON from a 2.0 asmx web service

I am using .Net framework 2.0 / jQuery to make an Ajax call to a 2.0 web service. No matter what I set the contentType to in the ajax call, the service always returns XML. I want it to return Json!  Here is the call:        $(document).ready(function() {          $.ajax({             type: "POST",             url: "DonationsService.asmx/GetDate",             data: "{}",             contentType: "application/json; charset=utf-8",             dataType: "json",             success: function(msg) {               // Hide the fake progress indicator graphic.               $('#RSSContent').removeClass('loading');                // Insert the returned HTML into the <div>.               $('#RSSContent').html(msg.d);             }           });         });       Here is what the request header looks like in Fiddler:  POST /DonationsService.asmx/GetDate HTTP/1.1 x-requested-with: XMLHttpRequest Accept-Language: en-us Referer: http://localhost:1238/text.htm Accept: application/json, text/javascript, */* Content-Type: application/json; charset=utf-8 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; eMusic DLM/4; .NET CLR 2.0.50727) Host: localhost:1238 Content-Length: 2 Connection: Keep-Alive Pragma: no-cache   I have tried setting the contentType to 'text/json' and get the same results.  Here is the web service method:  <WebMethod()> _ Public Function GetDate() As String      'just playing around with Newtonsoft.Json     Dim sb As New StringBuilder     Dim sw As New IO.StringWriter(sb)     Dim strOut As String = String.Empty      Using jw As New JsonTextWriter(sw)         With jw             .WriteStartObject()             .WritePropertyName("DateTime")             .WriteValue(DateTime.Now.ToString)             .WriteEndObject()         End With         strOut = sw.ToString     End Using      Return strOut  End Function   and here is what it returns:  <?xml version="1.0" encoding="utf-8"?> <string xmlns="http://DMS.Webservices.org/">{"DateTime":"11/13/2008 6:04:22 PM"}</string>   Does anyone know how to force the web service to return Json when I ask for Json?  Please don't tell me to upgrade to .Net Framework 3.5 or anything like that (I'm not that stupid). I need a 2.0 solution.


Let $D=\{Z\in\mathbb{C}:|z|<1\}$. Suppose $f:\overline D\to\mathbb{C}$ is continuous, holomorphic in $D$, and $f(\partial D)\subset \mathbb{R}$. Define $h:\mathbb{C}\to\mathbb{C}$ by  $$   h(z)=\begin{cases}                f(z) &\text{if}\ z\in \overline D\\                \overline{f(1/\overline z)} &\text{if}\ z\in\mathbb{C}\setminus \overline{D}             \end{cases}$$ Show that $h$ is entire and $f$ is a constant function.  My work: I can show that $h$ is holomorphic in $\mathbb{C}\setminus \overline{D}$.   To show $h$ is entire, by using Morera's theorem, considering arbitrary triangular path, the integral of $h$ is zero if it does not cross the boundary of the unit disc, however, what if the triangular path cross the unit disc? How to show in this case the integral is also zero.  Could anyone kindly help? Thanks!


The classification of finite simple group is a theorem describing all possible finite simple groups. The importance of simple groups is that they are, in a way, "irreducible" - they cannot be quotiented by any of their subgroup. They also come up in the composition series of a group, and hence it is sometimes said that every finite group is "made up" of finite simple groups. However, . I was therefore wondering whether some kind of classification of all finite groups is possible, which would give us means of constructing all groups? I know this is a rather vague question, but to give everyone some idea, here is the classification of finite abelian groups in the spirit of what I want:  Definition: Call a finite abelian group $G$ irreducible if it's not isomorphic to a direct product of two nontrivial groups.  Classification of finite irreducible groups: The finite irreducible groups are precisely the cyclic groups of prime power order.  Classification of finite abelian groups: Every finite abelian group can be written (uniquely) as a direct product of irreducible groups.  Long time ago I had a  that every finite group can be written as a direct product of simple groups, and together with CFSG this would provide a dream classification of all finite groups, but sadly this isn't true. Replacing this with a semidirect products doesn't give us a true statement either, and at this point I am out of ideas.  I realize that there might not be such a classification, and the difficulty in describing a groups of a given order (like $p^k$ with $p$ prime) only supports this. Nevertheless there still might be hope for a partial classification, like we have for simple groups or abelian groups, or maybe there is some description which is rather computationally infeasible.


When I went to edit a question here on meta I saw that the box to add Tags was to small (or the tags are just to low), here are some screens from different browsers:  Google Chrome version:34.0.1847.116 m Opera version:20.0.1387.91   FireFox version:28.0   Internet Explorer version:11.0.9600.16659   Not running any user scripts, only extensions are Adblock (2.6.29) and FireBug Lite (1.4.0.11967) but those don't seem to effect it when turned off.


I am new to design patterns. I want to use the singleton design pattern for this database class. Can anyone help me with this?  Here is my complete code:  public interface ResourceConnection {     public Connection getConnection(); }  public class ResourceConnectionFactory {     public ResourceConnection getConnection() {         return new MysqlResourceConnectionImpl();     } }   public class MysqlResourceConnectionImpl implements ResourceConnection {      Connection con = null;      @Override     public Connection getConnection() {         try {             Class.forName("com.mysql.jdbc.Driver");             con = DriverManager.getConnection("jdbc:mysql://localhost:3306/library", "root", "root");         }          catch (ClassNotFoundException ex) {             Logger.getLogger(MysqlResourceConnectionImpl.class.getName()).log(Level.SEVERE, null, ex);         } catch (SQLException ex) {             Logger.getLogger(MysqlResourceConnectionImpl.class.getName()).log(Level.SEVERE, null, ex);         }         return con;     } }