I searched for solutions on here but didn't find one for my use case. I have a big array which is built like this example: Array (     [0] => Array         (             [Template] => page.html5         )      [1] => Array         (             [Template] => page2.html5         )      [2] => Array         (             [Template] => page.html5         )      [3] => Array         (             [Template] => page2.html5         )      [4] => Array         (             [Template] => page.html5         )      [5] => Array         (             [Template] => page2.html5         )      [6] => Array         (             [id] => 27             [table] => tl_custom             [type] => text             [data] => Array                 (                     [fragment] => example                     [previewId] => 1                     [isActive] => 1                 )          )  )  I would like to remove all duplicate values for the array key "Template", but besides that I want the array to stay the way it is. So afterwards my Array should look like: Array (     [0] => Array         (             [Template] => page.html5         )      [1] => Array         (             [Template] => page2.html5         )     [6] => Array         (             [id] => 27             [table] => tl_custom             [type] => text             [data] => Array                 (                     [fragment] => example                     [previewId] => 1                     [isActive] => 1                 )          )  )  Is there a way to achieve this without using lots of memory? Thanks for your answers :)

How can I remove duplicate values from a multi-dimensional array in PHP?  Example array:  Array (     [0] => Array     (         [0] => abc         [1] => def     )      [1] => Array     (         [0] => ghi         [1] => jkl     )      [2] => Array     (         [0] => mno         [1] => pql     )      [3] => Array     (         [0] => abc         [1] => def     )      [4] => Array     (         [0] => ghi         [1] => jkl     )      [5] => Array     (         [0] => mno         [1] => pql     )  )


I don't have a great deal of info on what I'm looking for. I read a book when I was younger, probably written in the 80’s or early 90’s.  It was about these 2 people (male I think) that were traveling across a land to get somewhere, they would have to become the creatures that inhabited that area to get across it. They were deer once, beaver, one was a pixie once, there were other creatures.

I read this book at least ten years ago.  Any help identifying it would be appreciated.  Characters are teleported to an artificial world where each take over the mind of a different species.  I remember a moving sentient plant, a faun-like character, and a wasp-like character.  The planet is subdivided into different zones designed for each species.  One of the characters had long sharp fingernails with poison in them.  Thanks for any help, steve


Given a linear model $y=\mathbf{w^T}\mathbf{\phi(x)}+ \epsilon$ Where $\phi_0(\mathbf{x})=1 $(as is common), is the least squares estimator of $w_0$ always the mean of the observed y-values(i.e. the sample mean of the response)?

How do you show that the point of averages (x,y) lies on the estimated regression line?


One of my friend connected me to the wifi in our area . Now my computer automatically connects to that wifi. I don't need to enter the password. I wanted to browse internet using my android phone. Since i don't know the password i can't connect to the wifi network. Is there any file/folder where the password for the wifi is saved on windows-7 pc ?

I'm trying to connect to my friends wireless network, but we don't know the password (ie. network/WEP/WPA key). The WLAN is secured by WPA2.  My friend's laptop with Windows 7 connects automatically to the WLAN. Is there a way to get the password from his laptop?


Using VoiceOver (iPhone 4s, iOS 7.1.2) in the StackExchange app, it works fairly well, except the content of comments (when viewing an answer or question) is not announced. It will just say the number of votes that comment has.

I am blind and use voice-over for navigation.  Majority of the app works very well with voice-over, however, some text is not spoken. What I have noticed is that it is usually the comments that are not spoken.  This is a real shame, because this one little defect renders this app useless for a blind or visually impaired person.  I would be grateful if you could give it your utmost attention and resolve this issue.   App Version: 1.4.0 Device: iPhone6,2 OS Version: Version 9.0.1 (Build 13A404)


I know the  is uncountable, but I just came with an argument that shows it is countable. Obviously my argument is wrong, but I just don't know where is the mistake. Here it is.  Let $C$ be the Cantor set, we know $C$ is closed, so $A = [0,1]\setminus C$ is open. As $A$ is open, we know there is a collection of open disjoint intervals $(a_n,b_n)_{n=1}^\infty$ such that $A=\bigcup_{n=1}^\infty(a_n,b_n)$.  Given any intervals $(a_n,b_n)$ and $(a_m,b_m)$ (suppose $b_n\leq a_m$), we may have or not points of $C$ in $[b_n, a_m]$.   If $b_n<a_m$, is not possible that $[b_n, a_m]\subset C$, for $C$ is nowhere dense. In this case, there is more open intervals inside $[b_n, a_m]$. So we get more intervals and to the same reasoning.  If $b_n=a_m$, it is possible that this point is in $C$.  My problem is how to manage the first case. Looks like doesn't matter if there is more open intervals inside this 'gaps', in the final I will have only the cases where $b_n=a_m$. In other words, these are the only possible points in $C$, therefore $C$ is countable.

The Cantor set is closed, so its complement is open.  So the complement can be written as a countable union of disjoint open intervals.  Why can we not just enumerate all endpoints of the countably many intervals, and conclude the Cantor set is countable?


On an Ubuntu 12.04 server I have a bunch of certificates listed in my /etc/ssl directory...where could these have come from? I don't remember adding them myself, do they get generated when aptitude updates its repos or is it from something else?

Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is.  Bonus question: what if it's a file that isn't installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it?


We are using geoserver (2.3) to serve WMS map tiles generated from mapping data we licenced. We use leaflet on the client side to show the map (part of a ruby on rails site running on heroku). Because of the licence of the mapping data, we should not allow anybody to use these map tiles, it should be only accessible by our users when they are using the map on our website.  Is there any way to avoid somebody just taking the WMS URL from our javascript code and using it on another site? Or bulk downloading all the map tiles?  We can configure the geoserver to require username/password or certificate, but then we would need to expose it to the client side.  Thanks!

In a project the customer wants the images of the WMS to be secured against unauthorized access.   What are the common solutions to realize that?   Are they compatible with the OGC-standards?


As many of you may know,  (among other brokerages) shut down trading of several stocks, including Gamestop (GME) and AMC Entertainment (AMC). Recently, Justin Kan on Twitter posted the following , implying that Robinhood may have been working behind the scenes with Citadel to manipulate the market.  Just got a tip that Citadel reloaded their shorts before they told Robinhood to stop trading $GME.   If this is true, Ken Griffin and the Robinhood founders should be in jail.  If a brokerage were to shut down due, what happens to the users who have accounts with them?  Do their shares get liquidated and the money sent back to them?  Does the account get moved to another brokerage?  Do the users just lose their account and assets held within?

I'm trying to understand how secure it is to own mutual funds/ETFs, not in terms of market volatility etc., but in terms of judicial security (i.e. what happens to your holdings if the firm goes bankrupt). To understand it, I have read this article about the bankruptcy of Lehman Brothers:  Note: From now on, I'm always referring to investors who own funds/ETFs managed by Lehman Brothers, not by investors who invested in Lehman Brothers or subprime mortgages (e.g. S&P 500 ETF investors). From the above article, what I have understood is that the funds/ETFs managed by Lehman Bros. were shifted to other brokerage firms to be managed by them. Is this what actually happened? Still, what happens with the investors if, hypothetically, no brokerage firm in the world wants to manage these financial products?


I understand that a general interpretation of the $1/r^2$ interactions is that virtual particles are exchanged, and to conserve their flux through spheres of different radii, one must assume the inverse-square law. This fundamentally relies on the 3D nature of space.  General relativity does not suppose that zero-mass particles exchanged. What is the interpretation, in GR, of the $1/r^2$ law for gravity? Is it come sort of flux that is conserved as well? Is it a postulate?  Note that I am not really interested in a complete derivation (I don't know GR enough). A physical interpretation would be better.  Related question:

The Newtonian description of gravity can be formulated in terms of a potential function $\phi$ whose partial derivatives give the acceleration:  $$\frac{d^2\vec{x}}{dt^2}=\vec{g}=-\vec{\nabla}\phi(x)=\left(\frac{\partial\phi}{\partial x}\hat{x}+\frac{\partial\phi}{\partial y}\hat{y}+\frac{\partial\phi}{\partial z}\hat{z}\right)$$  However, in general relativity, we describe gravity by means of the metric. This description is radically different from the Newtonian one, and I don't see how we can recover the latter from the former. Could someone explain how we can obtain the Newtonian potential from general relativity, starting from the metric $g_{\mu\nu}$?


$$m\frac{d^2r}{dt^2}=-G\frac{Mm}{r^2},  \qquad r(0)=R ,\qquad \dot{r}=v_0>0$$  describes the free fall of an object of mass $m$. $r(t)$ is the distance of m to the center of the earth which is $R$ at $t=0$. $G$ is the gravitational constant.   I don't even know how to start with it. I thought about integrating it twice, but it was apparently wrong.  And once I get $r(t)$ I am supposed to find the velocity a rocket should have to escape the gravitational area of the earth, and  to do that I'm supposed to assume that the velocity of the rocket at $r(t)=\infty$ is zero.

The common understanding is that, setting air resistance aside, all objects dropped to Earth fall at the same rate. This is often demonstrated through the thought experiment of cutting a large object in half. The halves clearly can't then fall more slowly just by being sliced in two.  However, I believe the answer is that when two objects fall together, attached or not, they do "fall" faster than an object of less mass alone does. This is because not only does the Earth accelerate the objects toward itself but the objects also accelerate the Earth toward themselves. Considering the formula: $$ F_{\text{g}} = \frac{G m_1 m_2}{d^2} $$  Given $F = ma$ thus $a = F/m$, we note that the mass of the small object doesn't seem to matter as when calculating acceleration the force is divided by the $m$ term, its mass. However, this overlooks that the force is actually applied to both objects, not just to the smaller one. The acceleration on the second, larger object is found by dividing $F$, in turn, by the larger object's mass. The two objects' acceleration vectors are exactly opposite, so closing acceleration is the sum of the two:  $$ a_{\text{closing}} = \frac{F}{m_1} + \frac{F}{m_2} $$  Since the Earth is extremely massive compared to everyday objects, the acceleration imparted on the object by the Earth will radically dominate the equation. As the Earth is $\sim 5.972 \times {10}^{24} \, \mathrm{kg} ,$ a falling object of $5.972 \, \mathrm{kg}$ (just over 13 pounds) would accelerate the Earth about $\frac{1}{{10}^{24}}$ as much, which is one part in a trillion trillion.  Of course in everyday situations, we can for all practical purposes treat objects as falling at the same rate because of this negligible difference—which our instruments probably couldn't even detect. But I'm hoping not for a discussion of practicality or what's measurable or observable, but what we think is actually happening.  Am I right or wrong?  What really clinched this for me was considering dropping a small Moon-massed object close to the Earth and a small Earth-massed object close to the Moon. This made me realize that falling isn't one object moving toward some fixed frame of reference, but that the Earth is just another object, and thus "falling" consists of multiple objects mutually attracting in space.


I understand the algorithm of linear regression, how it works and what it accomplishes, and how to apply it in ML  but what is the meaning of the word "regression" itself in that context? what's the history or etymology in using that word?  or put slightly differently, how did the word 'regression' came to mean learn a formula from independent variables to an outcome variable? the word itself seems to describe the concept rather poorly

I was just wondering why regression problems are called "regression" problems. What is the story behind the name?      One definition for regression:   "Relapse to a less perfect or   developed state."


i am having a weird problem with opengl in visualstudio where every opengl function points to NULL if i build the program in release mode.  i have tried glew and gl3w none of them work  glew/gl3w is initialized after the context is created and in debug mode it runs fine  the project settings are default i only included the include folders and the respective lib folders  did anybody have a similiar issue?  #include<SDL.h> #include<GL\glew.h> #include<assert.h>  int main(int argc, char* args[]) {     SDL_Init(SDL_INIT_VIDEO);      SDL_Window *window;     SDL_GLContext context;      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);     SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);     SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);     SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);      window = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN);     context = SDL_GL_CreateContext(window);     SDL_GL_MakeCurrent(window, context);     glewExperimental = GL_TRUE;     assert(!glewInit());      GLuint id;     glGenVertexArrays(1, &id);      SDL_Quit();     return 0; }

I am using VC++. Is assert(false) ignored in release mode?


I want to know if there's word of god to be had here. What I did find is close, but not quite definitive:  Animals can eat zombies  Animals can drink zombie-contaminated water  Kirkman says people can safely eat other humans who have been bitten, but haven't turned yet (but doesn't say you can eat actual zombie flesh)  Kirkman says that drinking a bit of zombie blood isn't the end of the world (no pun intended)   So I'm looking for the missing piece of the puzzle: Has Robert Kirkman himself ever commented on what would happen if a human ate zombie meat? Note: I'm not interested in eating bitten people, or drinking a little zombie blood, because I have already read his comments on those subjects; I'm also not interested in what anyone other than Kirkman himself has said.

I don't remember what actually happends when people eat infected flesh. I have in mind :  Gareth and the cannibals eating bitten Bob's leg in . It seems that the cannibals survive for a while after eating Bob's flesh and they seem OK.  The Saviors eating pigs that ate walkers in . We don't know for how long this process has been on, but  has his routine and looks used to doing that. Can we assume that Saviors are eating infected pig flesh for a while now ?  Does it have negative effect in long term ?


Paper reflects all the lights of the spectrum so it looks white. But mirror also does that then why is not white?

I was taught that something which reflects all the colors of light is white. The function of a mirror is the same, it also reflects all light. What's the difference?  Update: But what if the white object is purely plain and does not scatter light? Will it be a mirror?


The answer should be 'This is the 7th train to Delhi'. How can I properly ask this question ? The keyword in the answer is '7th'.

I am the third daughter (or son) of my parents.   OR      How should a question that is answered with the above sentences be framed?


My son is a US Citizen and he will be entering into College on coming September 2019. We (parents)are green card holder & lives in US. We have a house here in India. We want to sell it and bring the money to USA for our Son college education expenses.  We have NRI and NRO Bank accounts in India. We (parents) are an Income Tax payer. Now your advises are required as under:    What are the routes to take money from India to US and our tax liabilities   Can we gift this whole amount to my US Citizen son or what is the maximum limit of Gift amount.   What will be the tax liability on us and on my son in case of Gift   Whether we have to show it in our USA Income Tax Return or in my son Tax Return when he start to file on 2019?. What US Income Tax Laws says.   What will be the procedure to send money as Gift to my son.   Will the money will go directly from our india  Bank Act.to our USA Bank Account (or) to my son bank account.   Will there will be wire transfer from bank to bank.   Can we send money through other money sender Certified Companies also. Please advise. If there is something more on the subject to make us understand, please advise. Thanks,

My daughter is a US Citizen. We (parents)are also planning to permanently settle in US. We will go their as Permanent Resident,as per US Law. We have a house here in India worth Rs.2 Crores.  We want to sell it and take money with us. We have ordinary savings Bank account here in India.  My US Citizen Daughter is a Income Tax payer.  Now your advises are required as under:   What are the routes to take money from India to US and our tax liabilities Can I gift this whole amount to my US Citizen Daughter or what is the maximum limit of Gift amount.  What will be the tax liability on me and on my Daughter in case of Gift   Whether I have to show it in my Income Tax Return or in my Daughter's Tax Return. What US Income Tax Laws says. What will be the procedure to send money as Gift to my Daughter. Will the money will go directly from my Bank Act.to my Daughter's Bank Account. Will there will be wire transfer from bank to bank Can I send money through other money sender Certified Companies also.    Please advise. If there is something more on the subject to make me understand, please advise. Thanks,


mkdir /home   then we mount something on /home.  Say /home already contains files.  What happen to the old files after a new drive is mounted to that directory?

I just accidentally mounted a new drive to a folder that already contained files.  I don't care about them and have them somewhere else, but that folder appears empty now.  I'm curious what happened to the files.  Are they simply deleted by Linux?


When I superpose two \path [fill=...] that should match exactly, I get an outer lining from the first fill.   It doesn't appear to be a shortcoming of the pdf viewer, as it also shows once converted to png.    How to get around this ?  MWE  \documentclass[tikz,border=10pt]{standalone} \begin{document} \begin{tikzpicture}   \path [fill=black] (0,0) rectangle (1,1) ;   \path [fill=white] (0,0) rectangle (1,1) ; \end{tikzpicture} \end{document}

Consider the snippet below (compiled with PDFLatex TexLive 2015).  Why is DocumentViewer (3.18.2, Ubuntu 16) displaying a thin line (some zoom levels)? I have set the outer/inner sep  to 0. Is this a flaw in PDF-rendering or has this TiKZ snippet an issue?     \documentclass{book} \usepackage{tikz} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture} \node[inner sep=0mm, outer sep=0mm, fill=blue,minimum width=5cm,minimum height=5cm] (first) at (10,10) {}; \node[inner sep=0mm, outer sep=0mm, fill=blue,minimum width=5cm, fit=(first.north)(first.south),anchor=east] (second) at (first.west) {}; \end{tikzpicture} \end{document}


I'm considering cycling along a sand dune which is 50km. The bike path is mainly flat. The longest I've riden on a bike is probably less than 1 hour. I do occasionally cycle within the city but it's just short distances. I was wondering if 50km will be too much for me? And will an e-bike help?  Jessie

I'm considering to do a 50-55 km distance on a mixed surface. Mostly asphalt and gravel, maybe even a little bit of sand. Haven't done any training or exercise, basically been sitting at home all day, everyday for years. Don't know why but suddenly had an urge to go on a journey.  My bicycle is quite old, 12 or so years, not in a great condition either but nothing is falling off so far. That wouldn't be my concern though, my concern is will my legs be able to cycle for 50 km in one go without any previous leg training. Is it advisable for me to do this? Will my legs be stiff after the first 10 km? What do you guys think?    Edit  I'm 24. Last year I tried a 30 km distance, my legs were gone after 20 and I had to step off my bicycle and walk a bit, as it seemed easier than cycling. That was my only real exercise I've done in a couple of years.  I really have all day and can take as many rests as I want. I'd say I have a solid 8 hours. Is it doable if I go on a gear that doesn't require a lot of push?


I participated in a math competition at a nearby university yesterday, and there was one ciphering problem that no one correctly simplified.  As the title suggests, we were asked to simplify the following trigonometric product such that it was in terms of a single expression (sine/cosine) and $n$.  $$\sin(x)\prod_{i=0}^n\cos(2^ix)$$  Typically with problems like these, which must be solved in under two minutes, the expression is telescoping in some manner that allows one to quickly simplify or solve it. This was how I approached it but simply didn't have enough time to see if it would work.  I know one of the professors, and he said the problem may be simplified using a number of double-angle formulas, but I'm still unsure how this method would work.  Could someone show how they might approach simplifying such an expression?

$$\cos A \cdot \cos 2A  \cdot \cos 2^{2}A  \cdot \cos 2^{3}A  ... \cos 2^{n-1}A = \frac { \sin 2^n A}{ 2^n \sin  A } $$  I am very much inquisitive to see how this trigonometrical identity can be proved.  PS:I am not much of interested about an inductive proof.


I made my domain example.se. I work for the Dutch market and not for the Swedish market. Now I learned that Google Webmaster Tools judges that I am focusing on the Swedish market. (Geographic Target = Sweden). I can't change this in GWT. I am really not looking forward to changing the domain.    What are the other options? My backlink profile is clearly focused on the Dutch market. Will GWT pick up on this eventually?

Because I'm still living like it's 2008, I run a website with a .in TLD. The website has nothing to do we India and does not target Indian users.  Unfortunately, when I go to Google Webmaster Tools I see that Google have locked my geotargeting status to India:    On the , Google state that:     Sites with country-coded top-level domains (such as .ie) are already associated with a geographic region, in this case Ireland. In this case, you won't be able to specify a geographic location.   This seems implausibly inflexible, so I want to know if there are any sneaky ways of removing auto-geotargeting, or changing it to a more appropriate region?


My table has values with quotes and other unescaped characters, and when I   $sometitle = "Ra's al Ghul"; SELECT * from mytable WHERE title='{$sometitle}'   ofc I got an error.  How can I solve this issue?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I have to append the same list to another one more than one time, and then modify only one of them. I tried  list_a = [] list_b = [0,0,0] for x in range(3):     list_a.append(list_b)   but the problem is that if I try  list_a[0][0] = 1   it modifies list_a[1][0] and list_a[2][0] also. How can I avoid that?

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I am a multiple entry visa holder for Malaysia for one year. I will be completing my first 30-day stay in two days. If I need to exit and re-enter Malaysia, how many days do I need to stay out of Malaysia to get another 30-day stay in Malaysia again?

I am US citizen. We are allowed to  stay in Malaysia for 90 days.      Can I extend my 90 days if I cross over to Singapore and return to Kuala Lumpur the following day, hence getting another 90 days "extension" for my stay in Malaysia?    Can I repeat this just a few days before my next 90 day is up?


The other day I was searching for Xcode iOS 5 tutorials. About a day or two later, I noticed my terminal prompt is now "iPhone4s : myusername". Naturally , my biggest fear is that there could be a worm or trojan horse on here. I look up the current procedure for checking the most current Mac Malware and the system turned up clean. I followed the examples to edit the PIF with the code:  PS1="\h : \u\$"    and it does not get rid of the "iPhone4s" prefix. I checked the System Preferences > Sharing and the name for the computer is correct.  How do I go about making sure the system is not hacked, and how to get rid of the iPhone4s name? I have 3 accounts created on this system. The other 2 are not affected.

For three days straight, I have connected to the public WiFi network at my local library. Each day, I have seen a different prompt in Terminal. Here are some of the prompts I've seen:  zp-pc:~ russell$ mary-pc:~ russell$ normob05:~ russell$   I have check under System Preferences -> Sharing, and my computer name is "Russell's Mac". Also, I set the DHCP Client ID to "RUSSMAC" under System Preferences -> Network -> Advanced -> TCP/IP, but I still see the random host names at the Terminal prompt.  Why is my computer name changing every day?


I want to make two columns with items, for example: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel}  \usepackage{multicol}  \begin{document} \section{First Section} \begin{multicols}{2} \begin{itemize}     \item Item 1     \item Item 2     \item Item 3     \item Item 4 \end{itemize} \end{multicols}  \end{document}  This will of course, display like this:  Instead, I want it to automatically write the first one on the left and then the one on the right; then the second one on the left, and so on. Like this:  I had to do that manually by changing the order of the items; is there a way to automate this?

I have spesicif list I need to change into a horizontal alignment. I thought of using the tasks package, but can not figure out how to do it. Here is the list:  \documentclass[12pt,numbers=noenddot,headings=small,parskip=half,headsepline, listof=nochaptergap, listof=totoc,index=totoc]{scrreprt} \usepackage{xpatch} \usepackage[a4paper, includehead, left=3.5cm, right=1.7cm, top=2.5cm, bottom=2.0cm]{geometry}  \setlength{\parindent}{0em} \usepackage{enumitem,tasks} \usepackage{multicol}  \begin{document}  \begin{multicols}{2} \setlist[itemize]{wide =0pt, leftmargin=*, nosep,before=\KOMAoptions{parskip=false}} \begin{enumerate}[topsep=0pt,itemsep=-1ex,partopsep=1ex,parsep=3.5ex,leftmargin=*] \item Item   \begin{itemize}     \item Item \end{itemize} \item Item  \begin{itemize}     \item Item \end{itemize} \item Item  \begin{itemize}     \item Item     \item Item \end{itemize} \item Item  \begin{itemize}[wide=0pt]     \item Item Intertext     \item Item \end{itemize} \item Item \end{enumerate} \end{multicols} \end{document}


What program did this designer used to make this image? and the dot link effect? and if there is any tutorial?

Is it possible to use Delaunay triangulation to generate an image like the below from a raster or vector of an object (in this case, a human heart)? What software and techniques would be required to make something like this? My intention is to make and use something like this in Inkscape without having to draw all the nodes/lines/effects manually.


I have some point data (towns) with population levels. I'd like to show the smaller populations with small dot and increase the size of the dot symbol as the population increases.  I can do this in Mapinfo but I want to do it in QGIS.

This question is stemming from my other question on data defined attributes:    Anyway, can anyone help me create an expression within the data defined properties -> fill color -> expression string builder. See following screenshot     My field is an integer value and I'd prefer light blue to dark blue gradient fill. Can anyone help with the input into the expression builder that would result in gradient filled centroid markers?


We have recurring donations that are able to be "cancelled" (meaning to cease its continued billing, not delete it from the interface). There is a button on our interface called "Cancel". When they hit the button, they get this dialog:    One of our users reported this to us:     I inadvertently canceled a gift. The popup had 2 choices: Cancel or Close. I thought Cancel meant cancel this operation - a little ambiguous.   What options/wording would be less ambiguous and more clear to the user?

I'm in a bit of a verbiage bind. I have a form for a request cancellation. I cannot change the wording on that. The word cancel HAS to be used.  The button bellow sits in the footer of a card. Unfortunately, I cannot show you the rest of the card for context.      Clicking that button brings up the above form in the footer of the card.  The pattern shown here (form input on one line, followed by a cancel and submit button with the below styles and ordering) is used across the application. This is another non negotiable. Clicking that cancel button collapses the form back into the original button ("Cancel Request").  As you can probably tell as this point, I have a Cancel-Cancel-Conundrum. I need a better word than cancel for that form button, but I'm having trouble thinking of something. I was thinking something along the lines of "Exit" but that feels a little weird.


Simple problem but I don't know how to fix it. Here's the code: missing_filters=('Sort key' 'Page' 'Pagesize' 'Sort direction')  for level in {0..$((${#missing_filters[@]}-1))} do     echo "${#missing_filters[$level]}^|^${missing_filters[$level]}" done | column -tes "^"  It should show every element of the array with 1-4 before it like this: 1 | Sort key 2 | Page 3 | Pagesize 4 | Sort direction  However, I get the error ./advancedplexapi.sh: line 4608: {0..3}: syntax error: operand expected (error token is "{0..3}"). I find this strange as the error shows exactly how I want the shell to interpret it (that being {0..3}). I did nothing wrong because otherwise the shell wouldn't give me the correct output in the error. Why doesn't it work? And ofcourse how can I fix this?

I am having difficulty getting a for loop to take user input in the form of an argument to a function I created. #!/bin/bash number1="$1"    #Assume user input 5 loops="$2"      #Assume user input 5 if [[ ${number1} && ${loops} =~ ^-?[0.00-9.99]+$ ]];then    for number2 in {1..${loops}}    do        Product=$(echo "${number1} * ${number2}" | bc -l)        echo "${number1} * ${number2} = ${Product}"        if test ${number2} -eq 7;then            { echo "----------------------"; echo "${number2} is the best number."; echo "----------------------"; continue; }        elif test ${number2} -eq 11;then            { echo "------------------------------"; echo "${number2} is pretty awesome as well."; echo "------------------------------"; continue; }            fi     done else    { echo "Please try again with a valid numerical entry."; exit 1; } fi  This script does not run when the user inputs an integer for the variable "loops", and any number for "number1". number1 = 5 in this case. It returns the error:  (standard_in) 1: syntax error 5 * {1..5} = /home/$USER/For_Loop_Multiplication.sh: line 9: test: {1..5}: integer expression expected /home/$USER/For_Loop_Multiplication.sh: line 11: test: {1..5}: integer expression expected  If I instead directly input an end bound on the number of loops directly into the script like the following, and number1 = 5, it runs fine: #!/bin/bash number1="$1"     #Assume user input 5 if [[ ${number1} =~ ^-?[0.00-9.99]+$ ]];then    for number2 in {1..5}    do        Product=$(echo "${number1} * ${number2}" | bc -l)        echo "${number1} * ${number2} = ${Product}"        if test ${number2} -eq 7;then            { echo "----------------------"; echo "${number2} is the best number."; echo "----------------------"; continue; }        elif test ${number2} -eq 11;then            { echo "------------------------------"; echo "${number2} is pretty awesome as well."; echo "------------------------------"; continue; }            fi     done else    { echo "Please try again with a valid numerical entry."; exit 1; } fi  It returns the result:  5 * 1 = 5 5 * 2 = 10 5 * 3 = 15 5 * 4 = 20 5 * 5 = 25  Essentially what I think is happening is that the script seems to be placing the entire range as the value number2, which is defined as the iterator in the for loop. Since the input for the variable "loops" is an integer, there should be no difference between asking the user for a range and placing it in the loop, or simply setting it as a default when I write the script. However, there apparently is a difference... Any insight into solving this problem is appreciated. Thanks.


I want to share a document with my guild in an MMO, but for obvious reasons I don't want every single person to have knowledge of my real name. Is there a way to make it so that the name displayed is different than the account's profile name? (I'd rather not change that.)  If not, can I turn off peoples' ability to see my account name when it is viewing a document, and would make me appear instead as one of the various "Anonymous [Animal]"s?

How do I set a different display name to show on in the revision history of a Google Docs document?  When I look at the revision history of a shared document that I've edited, all my edits are showing up as having been done by the username on my Google login email, which I want to change.  How can I change the nickname or display name Google Docs uses to label my edits?   For example, if I log into Google as jd1234@example.com, all my revisions show up as having been performed by jd1234, when I really want my co-editors to see "John Doe."  I've already tried setting a nickname on my Google+ account, and that didn't work.


I'm getting black artifacts in my renders. It looks like black pepper.  I've already re-calculated the normals (they were already facing in the right direction, anyway). You can see the artifacts on the door and the awning:    I'm using v2.68, but I get the same thing in v2.70.

I was following  on creating a watch and noticed that when I rendered the watch, some pieces were messed up.  I'm new to 3D modeling and I've just learned Blender, I can't explain it well, so here's a picture:    Other examples:     I don't know if it's a problem with my World texture, the object, or the object's texture/material, so I can't even guess how to fix it. What causes this? Is it possible to fix it?


I have added user using the adduser command, but a directory with is new user name is not created in /home, and I'm also not able to run any command with this user. After logging from this user it's only showing($) on the screen using a cli

I am trying to understand system administration on Ubuntu. So, as an example, I create a dummy user using   sudo useradd -d /home/linda linda   and passwd to create the password. I check that an entry has been made using cat /etc/passwd  linda:x:1004:1004::/home/linda:/bin/sh   However, when I su - linda, I get    No directory, logging in with HOME=/    and indeed, no home directory has been created. What am I missing?  Thanks.


Suppose you have a friend, named “Sam”. You know each other for example for 3-4 months. You see sometimes he plays some offensive practical jokes or makes some impolite advances to his friends and you do not like it at all. Even it seems too offensive for you. Anyway he has not played such jokes with you yet, (you just came across his jokes with some other people in the past.) Once when you are with a company of your common friends, he starts to play some unpleasant jokes with you in front of your friends. He says some offensive words (he thinks that these all are OK and kind of jokes and you can take these jokes. So everything sounds OK and fun for him up to now.) You “severely” dislike his behaviors. You are getting a little bit annoyed and perhaps angry. (But yet you are controlling yourself.) He sees you are getting upset and as another bizarre practical joke, with a loud laughter, he smacks on the back of your neck. I think saying "Sam, please don’t be overly friendly" sounds quite natural under these circumstances. Am I right? Any other suggestion will be welcome. ;)

Let’s suppose someone is behaving in a very impolite and perhaps rude way with you and you dislike his manners toward yourself. In such a condition, do the following sentences mean the same and can they be used under these circumstances?      Don’t seem too forward.    Don’t seem overly friendly.   I wonder if you clarify the meaning of each one.


I use the custom document class  \documentclass{MastersDoctoralThesis}  but hope, my question is more general. In my head there is  \usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} \addbibresource{example.bib}  My example.bib:  @article{Reference1, Abstract = {We have developed an enhanced Littrow configuration extended cavity diode laser (ECDL) that can be tuned without changing the direction of the output beam. The output of a conventional Littrow ECDL is reflected from a plane mirror fixed parallel to the tuning diffraction grating. Using a free-space Michelson wavemeter to measure the laser wavelength, we can tune the laser over a range greater than 10 nm without any alteration of alignment.}, Author = {C. J. Hawthorn and K. P. Weber and R. E. Scholten}, Journal = {Review of Scientific Instruments}, Month = {12}, Number = {12}, Numpages = {3}, Pages = {4477--4479}, Title = {Littrow Configuration Tunable External Cavity Diode Laser with Fixed Direction Output Beam}, Volume = {72}, Url = {http://link.aip.org/link/?RSI/72/4477/1}, Year = {2001}}  @article{Reference2, Abstract = {We present a review of the use of diode lasers in atomic physics with an extensive list of references. We discuss the relevant characteristics of diode lasers and explain how to purchase and use them. We also review the various techniques that have been used to control and narrow the spectral outputs of diode lasers. Finally we present a number of examples illustrating the use of diode lasers in atomic physics experiments. Review of Scientific Instruments is copyrighted by The American Institute of Physics.}, Author = {Carl E. Wieman and Leo Hollberg}, Journal = {Review of Scientific Instruments}, Keywords = {Diode Laser}, Month = {1}, Number = {1}, Numpages = {20}, Pages = {1--20}, Title = {Using Diode Lasers for Atomic Physics}, Volume = {62}, Url = {http://link.aip.org/link/?RSI/62/1/1}, Year = {1991}}   When I use \cite{} in my main, I can only sucessfully use \cite{Reference1}, not \cite{Reference2}. Second only prints "Reference2" in bold. It's not about the Reference2-entry specifically, as it's the other way around, when I put Reference2 before Reference1 in the .bib.  Tell me if you need more information. I firstly wanted to make sure this isn't a common or obvious problem.

I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists.   \documentclass[11pt]{article} \usepackage{cite}  \begin{document}  \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle  Blablabla said Nobody ~\cite{Nobody06}.  \bibliography{mybib} \bibliographystyle{plain} \end{document}   My bibliography (Bib.bbl)  @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" }    Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg  \begin{thebibliography}{}  \end{thebibliography}


I am calling this JS method from a button inside of a flow, which in turn calls the Apex method deleteContentDocument. Upon button click I get the Too Many DML Statements:1 error. What I have tried so far -  I tried running the Apex method through Execute Anonymous Window inside developer console, it runs fine. Upon research I have read removing AuraEnabled would fix the issue, that didn't fix. Also removing AuraEnabled doesn't even call the Apex method because I see not system.debug statement called.  Javascript: deleteContentDocument(event) {     let contenttoRemove = event.target.dataset.name;     deleteContentDocument({         documentId: contenttoRemove     }).then(result => {         console.log(result);     }) }  Apex Method public with sharing class HelperController {     @AuraEnabled(cacheable=true)     public static void deleteContentDocument(String documentId) {         System.debug(documentId);         List<ContentDocument> file = [SELECT Id FROM ContentDocument WHERE Id = :documentId];         delete file;     } }  Why do I get this error? How do I fix it?

@AuraEnabled(cacheable=true) public static String  deleteContacts(List<String> contactIds) {     List<Contact> returnList = new List<Contact> ();     String query = ' SELECT Id,Name, LastName,Department,MobilePhone, Email FROM Contact WHERE id IN : contactIds ';     for (Contact thisContact:  Database.Query(query)) {          returnList.add(thisContact);     }     try {       delete returnList;       return'deleted successfully';     }     catch(Exception ex){        return 'Problem occoured';     }  }  JS Method deleteSelected(){     deleteContacts({         contactIds :this.selectedIds     })      .then(result => {         this.dispatchEvent(             new ShowToastEvent({                 title: 'Success',                 message: result,                 variant: 'success',             }),         );         return refreshApex(this.getContactList, { searchKeyWord: '$searchKeyWord' });     })     .catch(error => {         this.error = error;     });


I get these weird floral patterns on cylinders, I try to Inset the flat part of face on the top of the cylinder to create some sort of geometry to work with.  Any Ideas on how I can fix this???  Thanks!

When I create a UV sphere and add the subdivision surface modifier, the following wrinkle appears.    How can I avoid it?  I've read the article  but there seems to be no clear solution.  UPDATE 1  I've used the word 'apply' in the first sentence of the initial version of this question. It's misleading since I want to preserve the modifier without 'applying' it. Rather, what I meant is 'adding' the modifier.  UPDATE 2  I followed josh sanfelici's solution, but still there is an artifact at the pole.  Here is the screen: (A rendered view with a sun lamp)    Maybe it's the limitation of the general-purpose subdivision modifier.  BTW, when the cast modifier is added after the subdivision modifier, the sphere becomes perfect (even for my original wrinkled sphere).  But since I want to edit the resulting sphere (for example, scaling X, Y, etc) while modifier is added but not applied, it's not usable.


There are several questions about hibernating (suspending to disk) but most are concerned with battery life and so many answers basically say just use sleep (suspend to RAM) because the battery will last better than you think. Other answers are simply out of date.  I don't want to use hibernate because of battery concerns. I want it because the SSD is dead and I use an external USB 3 hard drive as my boot drive. In other words, I have only this one drive. No working built-in drive.  It's almost as fast and I'm happy with it. But if the cable moves too much while the MacBook is in my backpack the OS will crash and anything that was in RAM is lost. I want to transport the gear with the drive separate from the computer. This requires true hibernate and not just sleep.  I've read that MacOS has several heuristics about when to suspend to disk (hibernate) rather than to RAM (sleep) and that one of those is whether any USB devices are plugged in, which for me is always.  I have sudo pmset -a hibernatemode 25 but when I put the Mac to sleep now it starts right up when pressing a key or plugging in the AC, which tells me it's not suspending.  Is there a way to really suspend my MacBook to disk, then safely remove the HD, transport everything, plug the drive back in, wake up the Mac, all without losing what I was working on at the time?  Mid-2013 11" Air / Sierra 10.12.6    Output of sudo pmset -g assertions  2017-08-20 12:10:43 +1000  Assertion status system-wide:    BackgroundTask                 0    ApplePushServiceTask           0    UserIsActive                   1    PreventUserIdleDisplaySleep    0    PreventSystemSleep             0    ExternalMedia                  1    PreventUserIdleSystemSleep     1    NetworkClientActive            0 Listed by owning process:    pid 59(powerd): [0x0000004100088000] 39:29:46 ExternalMedia named: "com.apple.powermanagement.externalmediamounted"     pid 251(mds_stores): [0x0001272e000ba305] 00:04:18 BackgroundTask named: "com.apple.metadata.mds_stores.power"     pid 114(hidd): [0x000100dd0009997a] 03:36:53 UserIsActive named: "com.apple.iohideventsystem.queue.tickle.4294967962.3"      Timeout will fire in 110 secs Action=TimeoutActionRelease    pid 72(mds): [0x000126ae000ba2d1] 00:06:26 BackgroundTask named: "com.apple.metadata.mds.power"     pid 57(configd): [0x000122640007a186] 00:24:44 DenySystemSleep named: "InternetSharingPreferencePlugin"     pid 193(coreaudiod): [0x000122260001889a] 00:25:46 PreventUserIdleSystemSleep named: "com.apple.audio.AppleHDAEngineOutput:1B,0,1,1:0.context.preventuseridlesleep"      Created for PID: 438.  Kernel Assertions: 0x4=USB    id=503  level=255 0x4=USB mod=1/1/70, 10:00 am description=com.apple.usb.externaldevice.14500000 owner=BUP Slim Mac SL Idle sleep preventers: IODisplayWrangler

My 2008 iMac/10.10.5 has recently refused to sleep... either automatically or with a menu command.  The internal HD failed some time ago, since which it's been running fine on an external usb hd.  No 'sharing' options are enabled. 'Wake for network access' is not enabled. 'Allow Bluetooth devices to wake...' is not enabled. The issue also happens with a 'test' account.  SMC and NVRAM have been reset.  'pmset sleepnow', 'osascript -e 'tell application "System Events" to sleep'' and 'osascript -e 'tell application "Finder" to sleep'' immediately sleep the display but not the system.  The 'energy pane' of Activity Monitor doesn't show any apps preventing sleep.  I'd had an issue with 'addressbooksourcesync' preventing sleep, but think that's now sorted.  'pmset -g assertions' shows '0' for 'PreventUserIdleDisplaySleep' and 'PreventUserIdleSystemSleep'.  Assertion status system-wide:    BackgroundTask                 0    ApplePushServiceTask           0    UserIsActive                   1    PreventUserIdleDisplaySleep    0    PreventSystemSleep             0    ExternalMedia                  1    PreventUserIdleSystemSleep     0    NetworkClientActive            1 Listed by owning process:    pid 195(cupsd): [0x0000004600110135] 00:10:00 NetworkClientActive named: "org.cups.cupsd"    pid 49(powerd): [0x0000003c0008012c] 00:10:11 ExternalMedia named: "com.apple.powermanagement.externalmediamounted"    pid 95(hidd): [0x000000a500090183] 00:08:25 UserIsActive named: "com.apple.iohideventsystem.queue.tickle"     Timeout will fire in 218 secs Action=TimeoutActionRelease Kernel Assertions: 0xc=USB,BT-HID    id=500  level=255 0x4=USB mod=21/12/2016 12:46 description=EHC2 owner=AppleUSBEHCI    id=501  level=255 0x4=USB mod=21/12/2016 12:46 description=EHC1 owner=AppleUSBEHCI    id=503  level=255 0x4=USB mod=21/12/2016 12:52 description=UHC4 owner=AppleUSBUHCI    id=506  level=255 0x4=USB mod=21/12/2016 12:55 description=UHC3 owner=AppleUSBUHCI    id=507  level=255 0x8=BT-HID mod=01/01/1970 01:00 description=com.apple.driver.IOBluetoothHIDDriver owner=BNBMouseDevice


let $A$, $B$ and $C$ be three matrices, such that $A$ and $B$ can be multiplied, $A$ and $C$ can also be multiplied, and we can add $B$ to $C$. Prove that $$A(B+C)=AB+AC$$ This is my proof (it's probably wrong.) since we can add $B$ to $C$ this implies that if $B:n\times s$ then $C:n\times s$ and $A:m\times n$ let $$\cases{A=(a_{ij}) \\ B=(b_{jk}) \\ C=(c_{jk})} \implies B+C=(b_{jk}+c_{jk}), \text{ } i=1,..,m\text{ and } j=1,..,n$$ and using the definition of matrix multiplication $$ A(B+C)= \sum_{j=1}^n a_{ij}(b_{jk}+c_{jk})=\sum_{j=1}^n a_{ij}b_{jk}+\sum_{j=1}^n a_{ij}c_{jk}$$ $$=AB+AC$$ I've interpreted $a_{ij}$ and $b_{jk}$ as numbers so that I can apply the distributive rule between them, but i suspect that $a_{ij}$ and $b_{jk}$ are matrices, so I can't do that, is there any method to make this proof rigorous enough?

If $A,B,C$ are matrices I am thinking how to show that $$ A(B + C) = AB + AC$$  Is possible to show without sums like $\sum_i a_i, ..., \sum_j b_j$? It seems if I do the proof with many indexes then is tedious and I don't learn much from it.


I created a website in drupal 7, tested it in my localhost and works good. Now, I want to host the site in our Main server. So, I uploaded the site directory to the server and created a corresponding database for that. Updated the settings.php file with the database name, user and password.   I do hope that the site install process is done. The site is deployed within the server, database created. When I give the address of the site, it shows some PDO exception error.  PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table '[database].semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of /home/cpath/D-6.12/apache2/htdocs/[htdocs]/includes/lock.inc).   I tried re-installing the drupal site, it didn't work.  I even reviewed and tried all the solutions shown in , but no way I couldn't resolve the issue.   I appreciate your valuable suggestions.

I have Drupal running on MariaDB 5.5.33. When I run update.php (after upgrade to Drupal 7.28 from Drupal 6) I get an error:     Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'webdb.location_country' doesn't exist: CREATE TABLE {location_country} ( code CHAR(2) NOT NULL COMMENT 'Primary Key: Two letter ISO Country Code', name VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Full Country Name ', PRIMARY KEY (code) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Country data managed by location.module.'; Array ( ) indb_create_table() (line 2720 of /home/web/public_html/includes/database/database.inc).   When I try to run command     CREATE TABLE {location_country} ( code CHAR(2) NOT NULL COMMENT 'Primary Key: Two letter ISO Country Code', name VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Full Country Name ', PRIMARY KEY (code) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Country data managed by location.module.';   in phpMyAdmin I get an error     #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '{location_country} ( code CHAR(2) NOT NULL COMMENT 'Primary Key: Two letter IS' at line 1   But I wasn't able to find out where is the problem.


So I have this class and struct: class ISDFParams { public:     virtual ~ISDFParams() = default;     Vector3 point; };  struct SDFSphereParams : public ISDFParams { public:     float radius; };  I use it later like this SDFSphereParams p; p.radius = 4;  GetDensityData(p);  In GetDensityData(ISDFParams sdfParams) I do SDFSphereParams* _params = (SDFSphereParams*)&params;  The problem is when I print _params->radius its anything else but 4. What am I doing wrong? P.S. I know the example is a bit pointless, but the original code is rather long so I cut down it my problem.

Someone mentioned it in the IRC as the slicing problem.


If $X,Y$ are random variables, what is the name of the term $E(XY)$? (which if we subtract $E(X)E(Y)$ gives the covariance)

Simple question, yet surprisingly difficult to find an answer online.  I know that for a RV $X$, we define the kth moment as $$\int X^k \ d P = \int x^k f(x) \ dx$$ where the equality follows if $p = f \cdot m$, for a density $f$ and Lebesgue measure $m$.  So, what is the kth moment of, say, $(X,Y)$? $\int (X,Y) \ d P$ doesn't really seem like the answer to me....


I recently purchased a MacBook Air. I have an external 3TB Hard Drive that I would like to use, however, I have used this drive to backup files from my desktop (Windows) computer and the drive is setup with NTFS format, thus I can read files from the hard drive but I cannot write files to the hard drive.  I read that I could install NTFS drivers in Mac OSX allowing me to write to the hard drive.    Is this true? Are there reasons I should not do this? If there is no drawbacks to not doing this what are the best drivers to install and where do I find them?   I ask this because being new to Mac and OSX I want to ensure I do not want to risk messing up my hard drive.

I was able to read and write NTFS filesystems normally in Mountain Lion, but after the upgrade this stopped to work.  I installed ntfs-3g and fuse4x using homebrew in Mountain Lion and followed the instructions displayed by homebrew to finish the installation of fuse4x kernel extension.  To try to solve this problem I removed ntfs-3g, fuse4x and fuse4x-kext and reinstalled them. But this didn't solve my problem.  Does anyone know how to solve this? Thanks.


The  by Bill dubuque was very helpful and got me to read the complete datasheet of MCP73831/2, but there is one thing from the datasheet that I don't fully understand and is the cause of lots of confusion I've been having with my circuit (see below).   Assume that the switch is in position 3, closed circuit, for everything I'm discussing below.  For a long time I was wondering why the MCP73833 wouldn't provide 4.2 V at its output, when I apply 5V from a USB cable, if the battery is not connected. Instead, when powered with 5V at the input, the output of the battery charger is ~3.3V and the output of the regulators drops to ~2.8 V from the expected 3.3 V. Why couldn't I just remove the battery and let the Ireg current from the MCP73833 power the rest of the circuit? (Ireg defined by 1000(V)/Rprog(kOhm), in my case 1000/3.3k= 303mA ).  Well, after reading the  (page 13, section 4.2) I believe I got closer to the truth. There is a feature called battery detection where a small 6uA current is sourced from the Vbat pin (output of the battery charger) and depending on whether the voltage rises to a certain threshold or falls below it, the IC will either not start the charge cycle or detect that a battery is there and begin charging. A few lines below, the datasheet also mentions: "For a charge cycle to begin, all UVLO conditions must be met and a battery or output load must be present"  First question  Why isn't the rest of the circuit (the two LDOs) enough of a load so that even without the battery charging can begin, meaning current can be sourced?  Second question  Say Rprog is 3k and allows for a current of 1000/3k= 333 mA. That is almost exactly 1C, with the battery being 330 mAh.   a) How can simultaneous  be achieved if there is no more current allowed by MCP73833 to power the rest of the circuit? Should I reduce Rprog to allow more current but exceed the recommended 1C, or can I assume that powering the circuit will take precedence over charging the cell? Nothing like that is stated in the datasheet of MCP73833.  b) If for whatever reason the IC is "smart" enough to power the rest of the circuit with some of the 333 mA, while the rest of the current charges the battery, how come then it can identify the two LDOs as this extra load that requires powering but earlier, without the battery connected, it coudn't detect it at all due to the battery detection feature?

What I am thinking of implementing: 1. I have remote monitoring circuit using gsm which senses electrical parameters like phase, power, ac supply etc. Now considering case of no ac supply available then also device should be able to send notifications. to achieve this I am thinking of running module on battery(3.7v Li-Ion). 2. As it is remote monitoring system, so battery will always be connected to supply for charging.  As per my knowledge one should avoide keeping battery connected for charging for all the time, it will reduce life of battery/overheating/overcharging are the parameters comes into the picture.   If I do like |Wall Adapter((ac-dc smps)|-->|battery charger|-->|circuit| above mentioned parameters will participate. If I do like Wall Adapter and battery to use in parallel using OR ing with two diodes or using relay or using IC's like TPS2104/MAX 6326/TPS2110 etc then how can I take care of side by side battery charging?   I googled so many things to implement this but not found useful or may be I am not looking into right direction. I referred similer link '' but no luck. Even I looked into the data sheets and videos for li-ion charging circuits using MCP73831 or TP4056.  I am totally confused how to proceed further. Is it a good idea to use |Wall Adapter((ac-dc smps)|-->|battery charger|-->|circuit| or using Wall Adapter and battery in parallel and side by side charging battery. or to use wall adapter when supply is available and side by side charge battery so that I can use battery when power will be absent.  I know UPS works same way like it powers directly from supply all the time and charging battery side by side. At the time supply is interrupted it switched to the battery. I am looking for simple solution, and I think this is a right forum I am looking for a solution. Thanks in advance...


Recently, I have had trouble comparing LocalDateTime instances using the predefined method isAfter().   I have tried the following in Eclipse and it works fine:   stock.getReserveDate().isAfter(LocalDateTime.now())  where stock is a JPA Entity with a LocalDateTime field that has a getter called getReserveDate().  Executing the following code in JSP(which I believe is identical to the line above) gives me a NullPointerException.  <c:when test="${!compStock.getReserveDate().isAfter(LocalDateTime.now())}">
Stock is reserved!
 </c:when>  After debugging, I've managed to find out that the LocalDateTime.now() part of my code is considered null by JSP / JSTL but I have no idea why. This code works perfectly when ran in Eclipse but fails in a JSP.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have learned multilevel model in Bayes methods, which I think is really cool. Different levels data could share information which could improve the total model.  Is there any similar methods in non-Bayes algo, for example xgboost, which could share informations in different level data?

I'll explain my problem with an example.  Suppose you want to predict the income of an individual given some attributes: {Age, Gender, Country, Region, City}. You have a training dataset like so  train <- data.frame(CountryID=c(1,1,1,1, 2,2,2,2, 3,3,3,3),               RegionID=c(1,1,1,2, 3,3,4,4, 5,5,5,5),               CityID=c(1,1,2,3, 4,5,6,6, 7,7,7,8),               Age=c(23,48,62,63, 25,41,45,19, 37,41,31,50),               Gender=factor(c("M","F","M","F", "M","F","M","F", "F","F","F","M")),              Income=c(31,42,71,65, 50,51,101,38, 47,50,55,23)) train    CountryID RegionID CityID Age Gender Income 1          1        1      1  23      M     31 2          1        1      1  48      F     42 3          1        1      2  62      M     71 4          1        2      3  63      F     65 5          2        3      4  25      M     50 6          2        3      5  41      F     51 7          2        4      6  45      M    101 8          2        4      6  19      F     38 9          3        5      7  37      F     47 10         3        5      7  41      F     50 11         3        5      7  31      F     55 12         3        5      8  50      M     23   Now suppose I want to predict the income of a new person who lives in City 7.  My training set has a whopping 3 samples with people in City 7 (assume this is a lot) so I can probably use the average income in City 7 to predict the income of this new individual.  Now suppose I want to predict the income of a new person who lives in City 2. My training set only has 1 sample with City 2 so the average income in City 2 probably isn't a reliable predictor.  But I can probably use the average income in Region 1.  Extrapolating this idea a bit, I can transform my training dataset as      Age Gender CountrySamples CountryIncome RegionSamples RegionIncome CitySamples CityIncome  1:  23      M              4         52.25             3        48.00           2    36.5000  2:  48      F              4         52.25             3        48.00           2    36.5000  3:  62      M              4         52.25             3        48.00           1    71.0000  4:  63      F              4         52.25             1        65.00           1    65.0000  5:  25      M              4         60.00             2        50.50           1    50.0000  6:  41      F              4         60.00             2        50.50           1    51.0000  7:  45      M              4         60.00             2        69.50           2    69.5000  8:  19      F              4         60.00             2        69.50           2    69.5000  9:  37      F              4         43.75             4        43.75           3    50.6667 10:  41      F              4         43.75             4        43.75           3    50.6667 11:  31      F              4         43.75             4        43.75           3    50.6667 12:  50      M              4         43.75             4        43.75           1    23.0000   So, the goal is to somehow combine the average CityIncome, RegionIncome, and CountryIncome while using the number of training samples for each to give a weight/credibility to each value. (Ideally, still including information from Age and Gender.)  What are tips for solving this type of problem? I prefer to use tree based models like random forest or gradient boosting, but I'm having trouble getting these to perform well.  UPDATE  For anyone willing to take a stab at this problem, I've generated sample data to test your proposed solution .


i have recently bought my first rMBK and i really love it. i would like to start programming in java and have therefore tried installing two IDEs, eclipse and NetBeans. i have also made sure to download the newest java version from oracle (7u45). my problem is that the java provide from oracle is not used in eclipse and i cannot even install NetBeans - it stops installation and ask me to install java 7, even though it should already be installed. i am running OS 10.9.1. typing "java -version" gives the output:  java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)  and "which java" gives "/usr/bin/java". under "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" i can find the java version from oracle - but it is not the version used for anything except browser plugins. typing  "/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version"  java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)  i guess i can change the config file for eclipse, so that it uses the java in the strange "internet plugin" folder but for simplicity i would prefer if i could put Oracles java in my /usr/bin/ folder so all programs automatically uses the newest release. it would also allow me to install all the programs/aps that requires the newest java. renaming apples java to "java_backup" and copying oracles java to the usr/bin folder does not work. would it make sense to update my path variable to include the strange "internet plugin"? i have previously made a mess by adding strange folders to my path environment on linux so i am a bit cautious about that.

Chrome refused to run a java app unless i upgraded to .45, which I did my dling the installer from oracle.  Java 7 u45.  Installer said it worked.  Chrome still won't start java.    $ which java /usr/bin/java  $ java -version java version "1.7.0_06" Java(TM) SE Runtime Environment (build 1.7.0_06-b24) Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode) ~/private/WDI/git🍔     I may be easily fooled, but that doesn't say "45" anywhere.  (Yes, "06", and "24" and "23.2-b09", but nary a 45.  Such numbers!)  Anybody know if this is u45, or where the installer placed it?  UPDATE: there is a Java System Preference Panel that says "Your system has the recommended version of Java: Java 7 Update 45."  Still, Chrome doesn't appear to see it.


I was working with a Tex file in the standard font, and another in Calibri in Tex Studio.  The problem is that I have to switch compiler between the two files.   I don't want to use Configure -> Build -> Default Compiler. When I do that, it sets the default compiler for every Tex file. So I would need to switch between PdfLatex and XeLatex (and back) every time I work on the files.     So instead I would need to go into Tools every time I work on the one with Calibri font to compile using XeLatex. I cannot click on "compile" because that will run the PdfTex compiler and I will get an error involving fontspec package.    Is there a way to set the compiler for just a single Tex file? So I can work on different files with different fonts without having to do extra steps?

It is not hard to change the default compilation engine in TeXstudio from PDFLaTeX to LuaLaTeX (or any other engine for that matter). But if I only want to use LuaLaTeX for a single document, it gets tedious to go into the menus and find the LuaLaTeX option all the time. And the command line approach is also more time-consuming. Is there some clever way to tell TeXstudio to always compile this (and only this) document using LuaLaTeX?


There're k balls in a bag, each one with a different colour. Draw one ball from the bag randomly each time, then put the ball back.  Let random variable X = the number of balls to draw until all k colours have been seen. Find E(X).  Please help me with this question, thanks!

What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die?  The order in which the numbers appear does not matter.  I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation.  We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$  Can someone please explain this to me, possibly with a link to a general topic?


Recently I have taken over as both onsite IT and also head of our internal IT as the last IT guy resigned on my second day. Currently they just switched to an internal Exchange 2016 server and they're getting tons of spam now. I just barely figured out how to get the SSL cert setup correct and fix all the cert errors being thrown around.   I know there are basic anti-spam features in Exchange 2016, but I was wondering if anyone had some general guidelines on how to start off. I didn't want to enable all the filtering without having a solid grasp of what I'm doing since I'm not even sure how to check what emails were blocked in case I am blocking important customer emails. Any anti-spam advice in general for Exchange 2016 would be appreciated. Thanks!

This is a  about Fighting Spam.   Also related:                    There are so many techniques and so much to know about fighting SPAM. What widely used techniques and technologies are available to Administrator, Domain Owners, and End Users to help keep the junk out of our inboxes?  We're looking for an answer that covers different tech from various angles. The accepted answer should include a variety of technologies (eg SPF/SenderID, DomainKeys/DKIM, Graylisting, DNS RBLs, Reputation Services, Filtering Software [SpamAssassin, etc]); best practices (eg mail on Port 25 should never be allowed to relay, Port 587 should be used; etc), terminology (eg, Open Relay, Backscatter, MSA/MTA/MUA, Spam/Ham), and possibly other techniques.


I wrote code below where I use the Id to fill in the name. namespace ConsoleApp1 {     class test     {         public int Id { get; set; }         public string Name { get { return Name; } set { Name = Id.ToString(); } }     }     class Program     {         static void Main(string[] args)         {              List<test> t1 = new List<test>();              t1.Add(new test() { Id = 1 });             t1.Add(new test() { Id = 2 });             t1.Add(new test() { Id = 3 });             t1.Add(new test() { Id = 4 });             t1.Add(new test() { Id = 5 });              Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(t1));         }     } }  When the code runs, an exception is raised:  Exception of type 'System.StackOverflowException' was thrown`.  How resolve problem?

I would like to either prevent or handle a StackOverflowException that I am getting from a call to the XslCompiledTransform.Transform method within an Xsl Editor I am writing. The problem seems to be that the user can write an Xsl script that is infinitely recursive, and it just blows up on the call to the Transform method.  (That is, the problem is not just the typical programmatic error, which is usually the cause of such an exception.)  Is there a way to detect and/or limit how many recursions are allowed?  Or any other ideas to keep this code from just blowing up on me?


I've received a project that some dude did and it's on production stage. But that guy had some issues with project managers and other team members (bad attitude, being an ass.. etc). Intentionally he documented wrong apps, wrong paths, hidden folders, among others. And then left the company. While researching I've found that there's a .sh executing on process list. But that .sh doesn't exist anymore in the specified path (or even another path in the filesystem). Looking at .bash_history I've found that he executed the .sh and then removed the file (intentionally)... To keep the project going I need to know the content of that file. And as far as I understand, this shell still exists on the RAM because it is being executed. Is there any chance to read that file from RAM? or write its content on a new file? Kind regards. EDIT:  @Artem S. Tashkinov and @Gilles. Thank you for your answers. but this only dumps the output of the process. What I need is the code that the .sh contained ando produced that output.

I have an hourly hour-long crontab job running with some mtr (traceroute) output every 10 minutes (that is going to go for over an hour prior to it being emailed back to me), and I want to see the current progress thus far.  On Linux, I have used lsof -n | fgrep cron (lsof is similar to BSD's fstat), and it seems like I might have found the file, but it is annotated as having been deleted (a standard practice for temporary files is to be deleted right after opening):  COMMAND     PID       USER   FD      TYPE     DEVICE  SIZE/OFF       NODE NAME ... cron      21742       root    5u      REG      202,0      7255      66310 /tmp/tmpfSuELzy (deleted)   And cannot be accesses by its prior name anymore:  # stat /tmp/tmpfSuELzy stat: cannot stat `/tmp/tmpfSuELzy': No such file or directory   How do I access such a deleted file that is still open?


It's said that light is invisible because photons don't strike each other, then why we do see the reflected light from other objects?

Let's say we have a cloud of dust which is a lightyear across and someone shoots a beam of light from point A to B , why it is not possible for an observer far far away to see the light while it travels through the cloud at the speed of light?


My code is:  \documentclass[12pt,letterpaper]{report} \usepackage{blindtext} \usepackage[utf8]{inputenc} \usepackage[margin=1in]{geometry} \usepackage{titlesec}   \titleformat{\chapter}[display]     {\filcenter\normalfont\bfseries}     {\MakeUppercase{\chaptertitlename}\ \thechapter}     {0pt}     {} \titlespacing{\chapter}{0pt}{-24pt}{24pt}  \titleformat{\section}[display]     {\filright\normalfont\bfseries}     {\MakeUppercase{\sectiontitlename}\ \thesection}     {20pt}     {} \titlespacing{\section}{0pt}{0}{0pt}  \usepackage{indentfirst} \usepackage{parskip} \setlength{\parindent}{.5in}  \usepackage{setspace} \renewcommand{\baselinestretch}{1.75}     \begin{document}  \chapter{INTRODUCTION} \include{CHAPTERS/Chapter 1}   where Chapter 1.tex:  \section{BACKGROUND OF THE STUDY} Here we describe in some detail the use of the package to generate such tables on a per-chapter basis. The generation of per-section or per-part tables is completely analogous (using differently named commands); an overview appears at the end of the section.   When compiled it shows:    Instead of:    Please help me...

Is it fair to assume that if an \include command does not add a blank page both before and after, it is because the chapter starts on a page with an odd page number ?  EDIT: I thought I was having trouble with \include. I had the impression from for example  that \include would add a page both before and after. I had one \include statement in my document and there was indeed a blank page both before and after the chapter. When I added more \include statements I didn't see the same behavior and thought something was wrong until I noticed chapters start on odd page numbers which lead to my assumption above.


I want to prove that infinite (yet countable) cartesian product of countable sets is countable. Here's what I tried: Step 1: I proved that for 2 countable sets $ A_1,A_2 $ , the product $ A_{1}\times A_{2} $ is countable. Step 2: I proved by induction that for any $n\in \mathbb{N} $  if $ A_{1},...,A_{n} $ are countable sets, then $ A_{1}\times A_{2}\times,...,\times A_{n} $  is countable. Now, I want to show that any countable infinite cartesian product would be countable. How do i show that  $ A_{1}\times,....\times A_{\aleph_{0}} $  is countable? Thanks in advance.

Let $\{E_n\}_{n\in\mathbb{N}}$ be a sequence of countable sets and let $S=E_1\times\cdots\times E_n\times\cdots $. Show $S$ is uncountable. Prove that the same statement holds if each $E_n=\{0,1\}$.  By the definition of Cartesian product of sets,   $$\displaystyle S=\Pi_{n\in\mathbb{N}} \{f\colon\mathbb{N}\rightarrow\cup_{n\in\mathbb{N}}E_n\mid\forall n, f(n)\in E_n\}$$  If $E_n=\{ 0,1\}$, then  $$\displaystyle S_{01}=\Pi_{n\in\mathbb{N}}\{0,1\}=E^{\mathbb{N}}$$, where $E=\{0,1\}$.  By a theorem, $\cup_{n\in\mathbb{N}} E_n$ is countable since the sequence is countable.  I'm not sure how to go on from here to show $S$ is uncountable. Can we say anything about the function $f$ that maps a countable $\mathbb{N}$ to another countable union of sequence of countable sets?


Why this sql instruction doesn't work...?  I want to update the salaries by 15% for all employees who have salaries lower than average ...  UPDATE Employers SET salary=salary * 1.15 WHERE salary < (SELECT AVG(salary) FROM Employers);  Thanks.

I have a table story_category in my database with corrupt entries. The next query returns the corrupt entries:  SELECT *  FROM  story_category  WHERE category_id NOT IN (     SELECT DISTINCT category.id      FROM category INNER JOIN         story_category ON category_id=category.id);   I tried to delete them executing:  DELETE FROM story_category  WHERE category_id NOT IN (     SELECT DISTINCT category.id      FROM category        INNER JOIN story_category ON category_id=category.id);   But I get the next error:      #1093 - You can't specify target table 'story_category' for update in FROM clause    How can I overcome this?


Let $f=(f_0,f_1,f_2...)$ and $g=(g_0,g_1,g_2,...)$ be sequences in $F^{\infty}$. We define multiplication $fg$ by expressing the $n$-th component $(fg)_n=\sum_{i=0}^ng_if_{n-i}$. If $h=(h_0,h_1,h_2,...)$ is also in $F^{\infty}$, we want to show multiplication is associative. Hoffman and Kunze give the following calculation:  \begin{align} [(fg)h]_n&=\sum_{i=0}^n(fg)_ih_{n-i}\\ &=\sum_{i=0}^n(\sum_{j=0}^if_jg_{i-j})h_{n-i}\\ &=\sum_{i=0}^n\sum_{j=0}^if_ig_{i-j}h_{n-i}\\ &=\sum_{j=0}^nf_j\sum_{i=0}^{n-j}g_ih_{n-i-j}\\ &=\sum_{j=0}^nf_j(gh)_{n-j}=[f(gh)]_n. \end{align} My question is regarding the second to last equality. I'm getting $\sum_{j=0}^n\sum_{i=0}^{n-j}f_{i+j}g_ih_{n-i-j}$. Is my calculation wrong, or is the one in the book wrong? If the book is wrong, it doesn't look like we have associativity, so I'm a bit confused.

I am studying the proof of associativity of the multiplication in a linear algebra, from Hoffman and Kunze's Linear Algebra, 2nd edition. I am not understanding one of the steps taken to simplify a summation.  The linear algebra $F^\infty$ is the vector space of sequences in $F$. The elements of $F^\infty$ are of the form $f = (f_0,f_1,f_2,\dots)$. The product of $f,g \in F^\infty$ is defined by $$(fg)_n=\sum_{i=0}^nf_ig_{n-i},\,n=0,1,2,...$$  We then have (on page 118): $$\begin{align} [(fg)h]_n &= \sum_{i=0}^n(fg)_ih_{n-i} \\ &=\sum_{i=0}^n \left(\sum_{j=0}^if_jg_{i-j}\right)h_{n-i}. \end{align}$$  What I do not understand are the following two steps: $$\begin{align} \phantom{[(fg)h]_n} &=\sum_{i=0}^n \sum_{j=0}^if_{i}g_{i-j}h_{n-i} \\ &=\sum_{j=0}^nf_j\sum_{i=0}^{n-j}g_ih_{n-i-j}, \end{align}$$  which gives the result $$\phantom{[(fg)h]_n}=\sum_{j=0}^nf_j(gh)_{n-j} = [f(gh)]_n.$$  I can see the substitution of $f_i$ for $f_j$ after expanding the sum, but I do not understand the next step. Am I supposed to be able to see these steps intuitively (without expanding the sum)? What is going on in the substitution of $n$ for $n-j$?


As a physics bsc student, I have a very limited knowledge of QM:  Dirac formalism, Schrodinger equation and simple solutions (oscillators, particle in a given potential, hydrogen-like atom etc). There are more advanced QM courses I can take, but I find more interest in QFT.  What are the prerequisite subjects of non-QFT QM courses I should learn before starting with QFT?

I am currently in the process of teaching myself QFT.  It is not an easy task.  I have armed myself with many of the standard textbooks.  However, I am slow learner.   I get stuck on a thousand different terms which I don't understand, and a style of 'mathematics speak'  which loses me 95% of the time.   There are so many gaps in my knowledge that if I were a ship I would be at the bottom of the ocean.  What I really need is a book called 'QFT for Morons'. That's a bit harsh but 'QFT for dummies' doesn't quite express it clearly enough and besides there isn't such a book as far as I can find.  Any suggestions of resources or books that might help?   What I am really looking for is the one that explains QFT like you were talking to a five year old.  Perhaps I am asking the impossible.  I will add a bit more of a specific question here.    I have learnt that there are groups and non-abelian Lie groups like SU(2) etc., and then there a lagrangians, as well as a few other things like operators and states.   So a really dumb question is how are the lagrangians derived?  Are they determined by the group?  I am also confused because I understand some of the groups like SU(3) are used for different things in QFT.   I feel compelled to appologize for my ignorance but I am determined to make so more progress with this.   The problem when one is teaching oneself is you don't know which is the most fruitful path to follow.


Prove the following identity :   $$\sum_{k=0}^{n}\binom {2k}{k}\binom {2(n-k)}{n-k}=4^n$$   I am sorry, this topic is very new to me and so is this website.  I have looked at all the "duplicates" of this question on this website, but none have had an answer that I can comprehend.  I thought I was able to just plug each one into the binomial theorem and arrive at the answer, but my professor stated that I am using the theorem incorrectly.  I do not have an intuitive understanding of proofs yet.  Any direction will help!  Thank you.

It's not difficult to show that  $$(1-z^2)^{-1/2}=\sum_{n=0}^\infty \binom{2n}{n}2^{-2n}z^{2n}$$  On the other hand, we have $(1-z^2)^{-1}=\sum z^{2n}$.  Squaring the first power series and comparing terms gives us  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}2^{-2n}=1$$  that is,  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}=2^{2n}$$  My question: is there a more direct, combinatorial proof of this identity?  I've been racking my brains trying to come up with one but I'm not having much success.


I'm running a resource intensive python application but would like to know the CPU usage of this application constantly every 5 seconds and dispay the results.  I use mpstat -P ALL but I need to rerun this command every 5 seconds.  Is there a way to poll and display the results constantly every 5 seconds. I would like to format the output as well.

How can I repeat a command every interval of time , so that it will allow  me to run commands for checking  or monitoring  directories ?   There is no need for a script, i need just a simple command to be executed in terminal.


I have a table with the following schema:  ID NVARCHAR(10) Message NVARCHAR(300) UpdateTime DATETIME   where ID is a foreign key. New message records are added in clusters with the same UpdateTime. An example would be (sorted by ID and UpdateTime):  ID   | Status        | UpdateTime --------------------------------- 42     Cluster1-Msg1   2012-12-25 42     Cluster1-Msg2   2012-12-25 42     Cluster2-Msg1   2013-10-10 42     Cluster2-Msg2   2013-10-10 43     Cluster4-Msg1   2011-11-27   Here ID #42 is associated with 4 messages, clustered in two groups on different dates, while ID #43 is only associated with one message.  From time to time I wish to purge this table by, for each group with the same ID, deleting all message records whose UpdateTime is less than the maximum within the group. The end result in the example above would be:  42     Cluster2-Msg1   2013-10-10 42     Cluster2-Msg2   2013-10-10 43     Cluster4-Msg1   2011-11-27   The following SQL query locates all the records I want to delete:  SELECT Msgs.ID, Msgs.UpdateTime FROM Messages Msgs JOIN (SELECT ID, MAX(UpdateTime) AS MaxTime FROM Messages GROUP BY ID) MaxTimes ON Msgs.ID = MaxDates.ID WHERE Msgs.UpdateTime < MaxTimes.MaxTime   Now I wish to write a DELETE statement that removes the items that match those returned by the query above. The records must be removed based on the ID and UpdateTime values. I'm just not understanding how to express this in Transact-SQL.

What is the best way to remove duplicate rows from a fairly large SQL Server table (i.e. 300,000+ rows)?  The rows, of course, will not be perfect duplicates because of the existence of the RowID identity field.  MyTable  RowID int not null identity(1,1) primary key, Col1 varchar(20) not null, Col2 varchar(2048) not null, Col3 tinyint not null


I've got the new Canon Pixma MG 3150 and so far, I can't seem to find a driver anywhere. I do have the CD for both Windows and Mac, but this doesn't help me, as I have Ubuntu 11.10. I'd prefer to have it running on the wifi.  I'm really new to this, so I need for you to explain this to me as basically as possible.

I tried to install the MP190 drivers, but appeared a message show me that requires to have libcupsys2. I understand that libcup2 is an update of libcupsys2.   How do I solve this? Are there proprietary drivers for my Canon printer or scanner?


I know how to create a new tag on the SE website, if I have enough reputation. But yesterday, I asked a question through Stack Exchange android app. I needed two tags for my question. One was available, so I just searched it & added. The other one I wanted to create (I have reputation to create new tags on site). But I could not do so on the android app.    How to create a new tag while on the Stack Exchange Android app? If this is currently not supported, then can this be added in the newer update?

How do I create a new tag in the mobile iOS/ Android app? This operation is currently not supported.  When I tap the tags section, a search window opens; when I type something not existing and press Done, the tag section remains blank.  Please add such option to the apps. It is specially important in case of newly launched sites.


Notice the italicized part of the following text:     In essence, when a retailer decides to build a larger store, it bets that it can use that extra square footage and expanded inventory to attract the higher volume of customers it needs to generate an acceptable return on investment.    If I am to put a relative pronoun between [the higher volume of customers] and [it needs], I surely can put relative pronoun that.    However, I want to know the type of the relative pronoun. Is the noun being modified by the relative clause the volume(a thing) or customers(people)?  Which of the following is acceptable?        ~the higher volume of customers which it needs~   ~the higher volume of customers whom it needs~

So far I thought the words who and that are usually interchangeable:   There is the man who saw me.  There is the man that saw me.    Both sentences seem fine, who can be replaced with that. But in the following examples:   This is the man to whom I spoke.  This is the man to that I spoke.    The #2 sounds odd, which is why I don’t think it might be correct. The same observation for the words which and that, while   This is the ball which we used today.  This is the ball that we used today.    Seem to be in order and which can be replaced with that. But in the following examples the #2 sounds odd again.   This is the ball with which I scored.  This is the ball with that I scored.    I wonder if there’s any rule regarding the interchangeability of the above mentioned words.


I am trying to copy all the files off a failing/unreliable hard drive(has read errors) using robocopy using this command : robocopy /E /XO /R:1 /W:1 /V /MT:128 E:\ L:\ /Z /xd E:\System Volume Information E:$RECYCLE.BIN E:\OLD$RECYCLE.BIN  But after a few minutes, it gets stuck, and resource monitor shows robocopy is still reading lots of bytes per second (up to 18 million ) yet writing 2000 bytes or less per second, I have left my computer running for hours and the cmd display still shows robocopy being stuck on the same file despite all this supposed data reading robocopy is performing. What should I do to fix this? EDIT: I fixed this by changing /MT:128 to the default setting of /MT:8 and it somehow worked

What steps can I take to try to recover lost or inaccessible data from any storage device?  Answers:   This applies to any computer storage device, e.g. internal/external hard drives, USB sticks, flash memory. The most important thing is to STOP using it, any type of I/O can ruin your chances of a recovery.     We have separate questions covering common problems with USB flash drives in greater detail:


I got a pub/pri key pair generated using ssh-keygen. ssh-keygen -t rsa -b 2048  Now say, I lost the public key but have the private key. So I want to generate the public key using private key, which I know is possible but am not sure how. I went through few post and articles which suggest using below command, but I am facing error? $ openssl rsa -in pri  -pubout #generates public key from private key unable to load Private Key 139858264044864:error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: ANY PRIVATE KEY  Could some one suggest on how to fix this?

I've somehow lost my id_rsa.pub file. I still have my id_rsa file. How do I recover the public key from the private key?  (This question came up after ssh-copy-id was reporting "ERROR: No identities found" while ssh-keygen reported "/root/.ssh/id_rsa already exists". ls ~/.ssh pointed out the problem was having id_rsa but not id_rsa.pub. I found the solution, but it was buried at the bottom of a long post on an Ubuntu support forum.)


I have a private key components p, q, Dp, Dq, and QInv. I need to calculate the public key modulus and exponent. Modulus was super simple p*q, but exponent I can't figure out. Have searched all the articles and often found how to go opposite way - generating public private key once you pick the exponenet.  I have been trying ModInverse from p-1 and q-1, and solve x with GCD on all the componenets, but nothing gave me the right value (I know the value I should get is x010001). Seems to be a little bit more complex that this...  Im really in to the code and less in math, so if I could get the answer which use simple math operations as 'Add', 'Sub', 'Multiply', 'Mod', 'ModInverse', 'GCD' etc. would be great!

I am trying to make the RSA structure of Openssl manually, knowing the public key ($n$, $e$) and the  parameters $p$, $q$, $d_P$, $d_Q$, and $u = q^{-1} \mod p$.  That is, I want to get the $d$ value (private exponent) of the RSA structure by using Openssl API. If there are already any implemented functions, it would be great to me.  Bonus question: is it possible if I have $p$, $q$, $d_P$, $d_Q$ and $u$ but not the public key? I know that $n = p q$, but what about $e$?


Let $R$ be a left artinian ring and $M$ be an arbitrary $R$-module.  Prove that $M/J(R)M$ is a projective $R/J(R)$-module.

Let $I$ ba a two-sided ideal of a ring $R$ and $M$ be an $R-$ left module. Prove that if $M$ is an $R-$ projective left module then $M/IM$ is an $R/I-$ projective left module.  It is easy to see that $M/IM$ has the structure of $R/I-$module. I need some ideas to prove that $M/IM$ is an $R/I-$ projective left module.  Thank you very much.


i am trying to do this for past days , i tried many functions such as      strip_tags , mysqli_real_escape_string , ..etc   // Prevent MySQL Injection Attacks function cleanQuery($connector,$string){     if(get_magic_quotes_gpc())  // prevents duplicate backslashes         $string = stripslashes($string);     return mysqli_escape_string($connector,$string); }   but none gave me the result i want .  what i want is to enter an article text , allow html editing but prevent from mysqli injection ... can anyone helpout ?  as an example : i have this :  $data     = $_POST['data'];   echo "<form method='POST' action='index.php?do=check'> <textarea rows='10' name='data' cols='50'>$data</textarea> <input type='submit' value='send' name='B1'> </form>   ";    mysqli_query($conn,"insert into table(field)values('$data')");    value of data is :
test

         &nbsp;what's your name ?	         &nbsp;my name is `Jhone`	         &nbsp;

         &nbsp;	         &nbsp;	         &nbsp;

   an html input   so how can i insert that into database with no issues ?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


When I come across websites that I really like, I often take a look at their page source just to see if I can learn any new web tricks. I came across , and when looking at how they import their main logo's  tag (top + left of homepage), I was astonished to see:
 = $0
   Ba-ba-bwhat?!?!   Where is the actual logo (an image or  tag) pulled in?!?! What in the world is that = $0?!?!   Am I missing something obvious, or is this some clever trick to pull an image in from some custom webfont/thing?

In what situations is it more appropriate to use an HTML IMG tag to display an image, as opposed to a CSS background-image, and vice-versa?  Factors may include accessibility, browser support, dynamic content, or any kind of technical limits or usability principles.


I am trying to input an infix expression and convert it to a postfix expression using Stack class. I will be outputting the postfix expression as a String.  This is my code so far:  import java.util.*; public class Fix  {     public static void main(String[]args)     {         Scanner s= new Scanner (System.in);          System.out.println("Enter expression in infix: ");         String input= s.nextLine();          Stack<String> operator= new Stack<String>();         Stack<String> operand= new Stack<String>();         System.out.println("Created stacks...");         String expression="";         transferToString(input, operator, operand, expression);         System.out.println("Created string... ");         System.out.println(expression);      } }   Here is the statement that creates the String expression in the void transferToString method:  else if (operand.empty()==false)             {                 String str1 = input.substring(i++,i+2);                 expression.concat(operand.pop());                 expression.concat(str1);             }   The above code is a nested if statement, with the primary condition being whether the next character is an operand or not.  In the above else-if statement, I pop an operand from the stack operand, and concatenate it to String expression. In the main method, I print out expression.  However, this is my output:  Enter expression in infix:  (1+5) Created stacks... Pushed first operator! Created string...    For some reason, the String is not getting printed - I don't understand where I'm going wrong. Can somebody please point out what I'm doing wrong?  Thank you very much!

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


I'm using .Net framework 2.0 to try and do the following:  I've an external service which returns a list of int.  In turn I use each int to find a corresponding Type which has an Attribute with a property, key; the value of that property matches the search parameter.  Using the Type t I'd like to call a generic method, but I'm unable to do this.  As I will only know the Type at runtime, I suspect I may have to use reflection to invoke the generic method GetResultsForType - is this the correct way to go about this?  [MyAttribute(key1 = 1)] class A{     //some properties }  [MyAttribute(key1 = 2)] class B{     //some properties }  //and so on (for hundreds of classes).  The key is unique for every class.  public class Foo{     public void DoSomething(){          IList<int> keys = QuerySomeExternalService();           Assembly asm = LoadAssemblyFromSomewhere();          Type[] types = asm.GetTypes();          foreach(int key in keys){              Type t = SearchTypesForAttributeWithMatchingKey(types, key);  //I omitted caching of all the keys and Types into a Dictionary on first iteration for brevity.              IList<t> results = GetResultsForType<t>(); //won't work!              //do something with the results          }     }      Type SearchTypesForAttributeWithMatchingKey(Type[] types, int key){         foreach(Type t in types){             object[] attributes = t.GetCustomAttributes(typeof(MyAttribute),false);             MyAttribute myAtt = attributes[0] as MyAttribute;             if(myAtt.Key == key) return t;         }     }      IList<T> GetResultsForType<T>(){         IList<T> results = new List<T>();         bool querySuccess = true;         while(querySuccess){             T result;             querySuccess = QueryExternalService<T>(out result);             results.Add(result);         }         return results;     } }

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }