I have a script that streams a pattern in a single line (no linebreaks). I want to grep stock_ticker in that line and output it as soon as I have found one. Now the script is never ending and is essentially looping indefinitely.   One alternative I thought how I could work on this probably would be to split the input stream into lines and pipe it to grep. I understand that you can grep an output - however per my understanding I find everything from grep, sed, awk read line by line.   Anyway I can change this behavior and work on this?  ./a.out | grep 'stock_ticker'   currently outputs Memory exhausted. This is because grep reads line by line before spitting output. I would want to change that behavior. Any ideas how?

I was doing a very simple search:  grep -R Milledgeville ~/Documents   And after some time this error appeared:  grep: memory exhausted   How can I avoid this?  I have 10GB of RAM on my system and few applications running, so I am really surprised a simple grep runs out of memory. ~/Documents is about 100GB and contains all kinds of files.  grep -RI might not have this problem, but I want to search in binary files too.


Are any of these two phrases appropriate, or are they both wrong?        tables two and three's information are more suited for   table two's and three's information is more suited for

Which option is grammatical?        There will be readings from Nikki Giovanni’s and Alice Walker’s writings.   There will be readings from Nikki Giovanni and Alice Walker's writings.      Saying it out loud the latter sounds right, but looking at it the former looks better.


How should I approach this question? I was thinking of splitting it up such as as $ mt=b$ and $ax + ny=b$

Prove $x \equiv a \pmod{p}$ and $x \equiv a \pmod{q}$ then $x \equiv a\pmod{pq}$ for $p\neq q$ distinct primes.  Where can I start with this proof? It looks similar to the Chinese Remainder Theorem, but that deals with two different a values.


I have an existing Stack Overflow account but somehow made another Stack Overflow account while using the StackExchange app, so now I have unpredictable behavior when I visit Stack Overflow.  Sometimes I'm using one account, sometimes I'm using another.  You can see the different reputation that I have because the Open ID links to a different account than when I actually visit Stack Overflow.  I'm not concerned with the reputation, but this makes it hard for me to manage my questions and answers because I cannot easily control which account I am using when posting.  Is there a way to delete one of my accounts?  I can provide the exact ID but not sure if posting it is safe.

I accidentally posted a question without being logged in. Is there a way to associate that question with my account?   For more information, visit "" in the .   a.k.a. How can you link a registered account to a cookie-based account? a.k.a. How do I merge an unregistered account with a registered account a.k.a. Merging users a.k.a. How do I associate anonymous questions I’ve asked with my registered account? a.k.a. Is there a way to claim an unregistered user? (in case anyone searches with those terms)


How to prove the language of all binary numbers that are prime is not regular using pumping lemma? I have seen  We have not studied the CFG so I do not understand that proof. I need a proof by  that shows the language of all the prime binary numbers is non-regular. the pumping lemma says: that for any regular language $L$ there exists a constant $m$ such that for any word $w$ in $L$ with length at least $m$ there exits a representation, $w = xyz$ , such that :  $length(y)\gt 0$ $length(xy) \le m$ $xy^iz \in language$ for any $i\ge0$

Prove that the language $\{bin(p) \mid p\ \text{is prime}\}$ is not regular, where $bin(p)$ denotes the binary representation of $p$. I should use the pumping lemma. But I have a problem. Could you help me? Any clues?  Edit. This question is asking whether the set of primes is $2$-recognizable. A set $X$ of natural numbers is $k$-recognizable (or $k$-automatic) if the language consisting of the base-$k$ representations of the elements of $X$ is accepted by a finite automaton. More details on this theory can be found in the survey article   V. Bruyère, G. Hansel, C. Michaux, R. Villemaire, . Journées Montoises (Mons, 1992). Bull. Belg. Math. Soc. Simon Stevin 1 (1994), no. 2, 191--238.  The following example is an illustation of a much more general result of this theory. Let $$ T = \{n \in \mathbb{N} \mid \text{the binary representation of $n$ contains an odd number of $1$'s}\}. $$ Then the infinite binary word $t = t_0t_1t_2 \dotsm$ defined by $t_n = 1$ if and only if $n \in T$ is the Thue-Morse sequence, obtained by iterating the substitution $0 \to 01$ and $1 \to 10$.


Let $f:[a,b]\to \mathbb{R}$ be a continuous function and let $g:[a,b]\to \mathbb{R}$ be a function such that $g(a)=f(a)$ and $g(x)=\sup_{t\in [a,x]}f(t)$. Prove that $g$ is continuous on $[a,b]$.   I noticed that $g$ is increasing so if somehow I show that it satisfies Intermediate value property then it must be continuous.

Suppose $f$ is continuous on $[a,b]$. Show that the functions defined by $m(x)=\inf\{f(y):y\in[a,x]\}$ and $M(x)=\sup\{f(y):y\in[a,x]\}$ are well defined and are also continuous on $[a,b]$  I have already managed to prove that they are well defined, since $f$ is continuous on $[a,b]$ so it is bounded. Therefore for every $x\in[a,b]$, the set $\{f(y):y\in[a,x]\}$ has a supremum and an infimum. To prove that they are continuous on $[a,b]$, I've taken an arbitrary sequence $\{x_n\}$ contained in $[a,b]$ converging to some number $c\in[a,b]$ and am attempting to show that $m(x_n)\rightarrow m(c)$ and $M(x_n)\rightarrow M(c)$, but I'm not quite sure how. Any help would be appreciated, thanks!


A person is their parent's child always, but past an arbitrary age, it's no longer appropriate to call them a "child".   I'm familiar with the term "Offspring", but that sounds technical, is there a more conversational synonym?

Is it normal to refer to adult-age sons and daughters of someone as children?  A native speaker of Arabic learning English has said that in Arabic, the word for sons and daughters is "أولاد" (awlaad) (), and that it applies no matter how old they are, and that the word for people who are not adults is  "أطفال" (atfaal) (). The person wanted to know whether you can still use "children" to mean "sons and daughters", even after you can no longer describe someone as a child in the "not yet adults" sense.


This is my first post so pardon any errors in formatting.  I'm trying to create a script that opens a file and links objects to it however when I attempt to link the objects it gives me a polling error. I looked up how to fix it and I found this code.  for area in bpy.context.screen.area:     if area.type == 'VIEW_3D':         override = bpy.context.copy()         override['area'] = area         bpy.ops.view3d.background_image_add(override, name="BG", filepath=r"image.png")                 break   it only works when the following code isn't present  bpy.ops.wm.open_mainfile()   When it is present I get  AttributeError: 'NoneType' object has no attribute 'area'   I have looked all over and could not find anyone else having this issue so I'm under the impression it is a very niche case so any help would be greatly appreciated. Below is similar code without all the extra filler I've written. The code in question is on lines 44-58.  import bpy  bl_info = {     "name": "Link & Append",     "author": "Exotic",     "version": (0, 0, 1),     "blender": (2, 7, 9),     "location": "Render > sample",     "description": "",     "warning": "",     "wiki_url": "",     "tracker_url": "",     "category": "System"}   class SampleMessage(bpy.types.Operator):     """SampleMessage"""     bl_idname = "button.message"     bl_label = "Message"      def execute(self, context):         bpy.ops.wm.save_load_operator()         return {'FINISHED'}      def invoke(self, context, event):         wm = context.window_manager         return wm.invoke_props_dialog(self, width=400, height=400)      def draw(self, context):         layout = self.layout         layout.label("WARNING", icon='ERROR')         row = layout.row()         row.label("Are you Sure?.")         row = layout.row()         row.label("Press OK")   class SaveNLoad(bpy.types.Operator):     """save_load Operator"""     bl_idname = "wm.save_load_operator"     bl_label = "Save N' Load Operator"      def execute(self, context):         yourpath = "C:\\Your path here\\mother.blend"         bpy.ops.wm.open_mainfile(filepath=yourpath)          for area in bpy.context.screen.area:             if area.type == 'VIEW_3D':                 override = bpy.context.copy()                 override['area'] = area                 bpy.ops.view3d.background_image_add(override, name="BG", filepath=r"image.png")                 break          directory = "C:\\Your path here\\Cone.blend\\Object\\Cone.001"         filename = "Cone.001"         filepath = "C:\\Your file path\\Cone.blend\\Object\\Cone"          bpy.ops.wm.link(filepath=filepath, directory=directory, filename=filename)         return {'FINISHED'}   def add_object_button(self, context):     self.layout.operator(         SampleMessage.bl_idname,         text=SampleMessage.__doc__,         icon='BLENDER'     )   def register():     bpy.utils.register_class(SaveNLoad)     bpy.utils.register_class(SampleMessage)     bpy.types.VIEW3D_MT_object.append(add_object_button)   if __name__ == "__main__":     register()   Any help would be greatly appreciated.

The code below works flawless, if e.g. triggered by a menu button in a 3D view.          for area in bpy.context.screen.areas:            if area.type == 'VIEW_3D':             for space in area.spaces:                 if space.type == 'VIEW_3D':                      space.viewport_shade = 'BOUNDBOX'   However, if I bundle it into a function and hook it to a handler, it returns a NoneType error:  @persistent def allBound(dummy):   for area in bpy.context.screen.areas:        if area.type == 'VIEW_3D':         for space in area.spaces:             if space.type == 'VIEW_3D':                  space.viewport_shade = 'BOUNDBOX'   bpy.app.handlers.render_pre.append(allBound)   Returns:  AttributeError: 'NoneType' object has no attribute 'areas'   How to solve this?


Suppose $\phi(\cdot)$ and $\Phi(\cdot)$ are the density function and cumulative distribution function of the standard normal distribution. $a<b$ are finite real numbers.  How can I calculate the integral:  $$\int^{b}_{a}\Phi\left(\frac{x-\mu}{\sigma}\right)\phi(x)\,\mathrm dx$$  Note that the question is similar to . There, the comments to the accepted answer suggest that the solution can be generalized to definite integrals, but I haven't been able to figure it out.

Suppose $\phi(\cdot)$ and $\Phi(\cdot)$ are density function and distribution function of the standard normal distribution.  How can one calculate the integral:  $$\int^{\infty}_{-\infty}\Phi\left(\frac{w-a}{b}\right)\phi(w)\,\mathrm dw$$


I was just going though some source code here on the index file of glide.js and saw the following code :   mount (extensions = {}) {     this._e.emit('mount.before')      if (isObject(extensions)) {       this._c = mount(this, extensions, this._e)     } else {       warn('You need to provide a object on `mount()`')     }      this._e.emit('mount.after')      return this   }   So basically mount (extensions = {}) {} is a method inside the Glide class and the mount being invoked inside this mount method is a function that is being imported like so:  import { mount } from './core/index'   My question is how does JavaScript differentiate between recursively calling the mount method or the imported function since both have the same name ?  note ::- code can be found .

Can someone provide a simple explanation of methods vs. functions in OOP context?


For example, the space spanned by the columns in  $$\mathbf{X} = \begin{bmatrix} 0 & 0 \\ 1 & 0 \\ 0 & 1 \end{bmatrix}$$  is the y-z plane. Further,  $$\mathbf{X'X} = \begin{bmatrix} 1 & 0  \\ 0 & 1 \\ \end{bmatrix}$$  $$\mathbf{P = X(X'X)^{-1}X'} = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}$$  $$\mathbf{y} = \begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix}$$  Then to project y onto the column space of X,  $$\mathbf{Py} = \begin{bmatrix} 0 \\ 2 \\ 1 \end{bmatrix}$$  I understand why this works. What I don't understand is how this works for linear regression - in the above example, each row represents a dimension in space I think (row 1 - x, row 2 - y, etc). In linear regression, the columns act as the dimensions. How does this transition work?  Thank you for any help!

I am interested in the geometric meaning of the multiple correlation $R$ and coefficient of determination $R^2$ in the regression $y_i = \beta_1 + \beta_2 x_{2,i} + \dots + \beta_k x_{k,i} + \epsilon_i $, or in vector notation,  $$\mathbf{y} = \mathbf{X \beta} + \mathbf{\epsilon}$$  Here the design matrix $\mathbf{X}$ has $n$ rows and $k$ columns, of which the first is $\mathbf{x}_1 = \mathbf{1}_n$, a vector of 1s that corresponds to the intercept $\beta_1$.   The geometry is more interesting in the $n$-dimensional subject space rather than in the $k$-dimensional variable space. Define the hat matrix:  $$\mathbf{H} = \mathbf{X \left(X^\top X \right)}^{-1} \mathbf{X}^\top$$  This is an orthogonal projection onto the column space of $\mathbf{X}$, i.e. the   through the origin spanned by the $k$ vectors representing each variable $\mathbf{x}_i$, the first of which is $\mathbf{1}_n$. Then $\mathbf{H}$ projects the vector of observed responses $\mathbf{y}$ onto its "shadow" on the flat, the vector of fitted values $\mathbf{\hat{y}} = \mathbf{Hy}$, and if we look along the path of the projection we see the vector of residuals $\mathbf{e} = \mathbf{y} - \mathbf{\hat{y}}$ forms the third side of a triangle. This should furnish us with two routes to a geometric interpretation of $R^2$:   The square of the multiple correlation coefficient, $R$, which is defined as the correlation between $\mathbf{y}$ and $\mathbf{\hat{y}}$. This will appear geometrically as the cosine of an angle. In terms of lengths of vectors: for instance $SS_\text{residual} = \sum_{i=1}^{n}e_i^2 = \|\mathbf{e}\|^2$.   I would be delighted to see a brief account which explains:   The finer details for (1) and (2), Why (1) and (2) are equivalent, Briefly, how the geometric insight lets us visualise basic properties of $R^2$, for instance why it goes to 1 when the noise variance goes to 0. (After all, if we can't intuit from our visualisation then it's no more than a pretty picture.)   I appreciate this is more straightforward if the variables are centred first, which removes the intercept from the question. However, in most textbook accounts which introduce multiple regression, the design matrix $\mathbf{X}$ is as I laid out. Of course it's fine if an exposition delves into the space spanned by the centred variables, but for insight into the textbook linear algebra, it would be very helpful to relate this back to what's happening geometrically in the uncentred situation. A really insightful answer might explain what exactly is breaking down geometrically  - i.e. when the vector $\mathbf{1}_n$ is removed from the spanning set. I don't think this last point can be addressed by considering the centred variables alone.


I set all about encoding to utf8. but browser show me '???????'. My settings are below.    MySQL "show variables like 'c%'"  character_set_client     | utf8 character_set_connection | utf8 character_set_database   | utf8 .... (all utf8)   MySQL my.cnf  [client] default-character-set = utf8 [mysqld] init_connect="SET collation_connection = utf8_general_ci" init_connect="SET names utf8" character-set-server = utf8 collation-server = utf8_general_ci [mysql] default-character-set = utf8   In all my PHP file included:  <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />   Apache2 httpd.conf  AddDefaultCharset Off (if utf-8, show me '???' ,too)   In MySQL console, (database is dumped)  SELECT name from campagin LIMIT 1     => print in working order, not '????'       I don't know what is problem.  For reference, I test this case.. in test.php  <?php     mysql_connect('localhost','root',ROOT_PW);     mysql_select_db(TEST_DB_NAME);     mysql_query("INSERT INTO a SET msg='안녕하세요'"); // char is KOREAN, meaning 'Hi'     $res = mysql_query("SELECT msg FROM a LIMIT 1");     $row = mysql_fetch_assoc($res);     echo $row['msg']; ?>     => this print '안녕하세요' in working order not '????'   but in MySQL console   "SELECT msg FROM a LIMIT 1"      => print not '안녕하세요' but abnormally 'ì•ˆë…•í•˜ì„¸ìš”'   ADDED : in mysql console   "SHOW CREATE TABLE a"     => Table | Create Table        a     | CREATE TABLE `a` ( 'msg' varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I am trying this code on the Firefox console, and I don't know how to get the correct answer(0.11). I would like to understand why this code doesn't work as I expected. Can someone help me understand. Thanks!    var a = "12,25";   var b = "12,14";    console.log("A: " + a);   console.log("B: " + b);    var parsedA = parseFloat(a.replace(',', '.'));   var parsedB = parseFloat(b.replace(',', '.'));    console.log('Parsed A: ' + parsedA);   console.log('Parsed B: ' + parsedB);    console.log("Dif Parsed Float: " + (parsedA - parsedB));    var numberA = Number(a.replace(',', '.'));   var numberB = Number(b.replace(',', '.'));    console.log('Number A: ' + numberA);   console.log('Number B: ' + numberB);    console.log("Dif Number: " + (parsedA - parsedB));

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I am new to tikz and I am struggling to be precise with the placement of my figures. Specifically, I was looking to have angle EDF be labeled with $\frac{x}{2}$ and angle ADF to have the "right angle" symbol. Also, I would like the line segment AB to be labeled with $\sqrt{1+t^2}$. Any help would be greatly appreciated! If there are any other reccomendations to make the image look better, maybe fix the arbitrary bold lines, I would also appreciate that! Here is my code for the figure:  \begin{figure} \centering \begin{tikzpicture}    % Define coordinates   \def\Radius{5}   \path     (-\Radius, 0) coordinate (A)     -- coordinate (M)     (\Radius, 0) coordinate (B)     (M) +(60:\Radius) coordinate (C)     +(120:\Radius) coordinate (D)   ;    % Draw semicircle   \draw     (B) arc(0:180:\Radius) -- cycle ;   ;   \draw (0,0) -- (0,5) ;   \draw (-5,0) node[below=.333em]{$A$} node[right =4.0em, above left=0.01em]{$\frac{x}{2}$}   -- (2.96,0) node[below = .333em]{$E$}   -- (2.96,4) node[above right=.333em]{$D$}   -- cycle; \draw (0,0) node[anchor=north]{}   -- (5,0) node[anchor=north]{}   -- (2.96,4) node[above right=.05em]{}    -- cycle;    \draw (0,0) -- (0,3) node[anchor = north east]{$B$};   \draw(0,0) node[below=.333em]{$C$};   \draw (5,0) node[below=.333em]{$F$};  \draw [black, thick] (-4,0) arc[start angle=0, end angle=37, radius=0.7cm];     \draw [black, thick] (2.5,3.9) arc[start angle=270, end angle=360, radius=0.7cm];          \filldraw [black] (0,0) circle (2pt);         \filldraw [black] (-5,0) circle (2pt);         \filldraw [black] (5,0) circle (2pt);         \filldraw [black] (2.96,4) circle (2pt);         \filldraw [black] (2.96,0) circle (2pt);         \filldraw [black] (0,2.5) circle (2pt); \end{tikzpicture} \end{figure}

I am able to draw a nice right triangle with  \begin{tikzpicture}[thick]   \draw (0,0)  -- (4,0) node[midway,below]{$f$} -- (4,2) node[midway,right]{$\frac{x}{2}$}-- cycle; \end{tikzpicture}   Now I want to label the left angle of the triangle and I am stuck on how to do this.


In my homescreen, I have a startGame button that when pressed should set off an animation (sender.pulsate()) and then also change viewController:   @IBAction func newGamePressed(_ sender: UIButton) {         currentScore = 0         timeRemaining = 60         visualTime = "01:00"          sender.pulsate()          let storyboard = UIStoryboard(name: "Main", bundle: nil)         let viewController = storyboard.instantiateViewController(withIdentifier: "firstLevel")         self.present(viewController, animated: false, completion: nil)      }   However, the new viewController appears instantly rather than waiting for the Pulsate animation to occur (the pulsate animation does work).  I know this has something to do with the code not being read top down, but what can I add to tell xcode to run one before the other?  Thank you!  ps. this is the pulsate code if its relevant:     func pulsate() {          let pulse = CASpringAnimation(keyPath: "transform.scale")         pulse.duration = 0.6         pulse.fromValue = 0.95         pulse.toValue = 1.0         pulse.autoreverses = true         pulse.repeatCount = 2         pulse.initialVelocity = 0.5         pulse.damping = 1.0          layer.add(pulse, forKey: nil)      }

I'm wondering where the callbacks are (or if there are anything) for animations in a CALayer. Specifically, for implied animations like altering the frame, position, etc. In a UIView, you could do something like this:  [UIView beginAnimations:@"SlideOut" context:nil]; [UIView setAnimationDuration:.3]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(animateOut:finished:context:)]; CGRect frame = self.frame; frame.origin.y = 480; self.frame = frame; [UIView commitAnimations];   Specifically, the setAnimationDidStopSelector is what I want for an animation in a CALayer. Is there anything like that?  TIA.


The default output format for a query is something like this:  ID | field1 ----------- 1  | val1  2  | val2   Is it possible in SQL to change it to a CSV format like this?  ID , field1 1  , val1  2  , val2   Currently, I am converting fields to string values and then concatenating them using the || operator, e.g.  SELECT ID::text || ', ' || field1 ...   FROM ...    But this is really cumbersome to write, and not very readable either.  Is there a more succinct way of doing this without converting to strings?  This isn't a duplicate of  because as shown in my example, I am looking to output in CSV, not store the output as a CSV file.

I have read-only access to a database on a remote server. So, I can execute:  COPY products TO '/tmp/products.csv' DELIMITER ',';   But on that server I don't have permissions to create/save a file, so I need to do this on my local machine.  When I connect to the remote database, how can I execute a command to save the file on my local machine instead of the remote server?  Or, how can I execute a Linux command to connect to the remote database, execute a query, and save the output as a file to my local machine?


In airline travel, how does Saturday-night stay pricing work for multi-city itineraries?  For a roundtrip booking it is pretty clear what the destination is, but less so for more complicated itineraries. I've been playing with some transatlantic trips in online booking tools and I'm not getting a clear intuitive sense for how this works (i.e. where I need to spend the Sat night to get good pricing).  I mainly fly OneWorld carriers but would be curious to learn how this works for other airlines too.  edit: In the comments there appears to be some doubt about whether Sat night stay is still a thing, but I see this sort of price graph all the time (maybe it's an international/transatlantic/OneWorld thing?):    Here is a direct copy-and-paste from britishairways.com for a booking I'm looking at right now:    "first sun after arrival at turnaround" — how do they define "turnaround" if it's a multi-city trip?

What signal will "a trip with an overnight stay on Saturday" give to the airlines and how would they possibly react?


When we print values in a dictionary, is there any default sorting that use to print the keys and values in a Python dictionary? Or do they randomly print the key , value pairs?  Please see below code. is there any order of dictionary value print in python?  confusion = {}  confusion[1] = 1 confusion[4] = 22 confusion['5'] = 2 confusion['2'] = 2 confusion[1.0] = 4 confusion['1'] = 2  print confusion   The result is {'2': 2, 1: 4, '1': 2, '5': 2, 4: 22}

Here is the dictionary I have  propertyList = {     "id":           "int",     "name":         "char(40)",      "team":         "int",     "realOwner":    "int",      "x":            "int",     "y":            "int",      "description":  "char(255)",      "port":         "bool",     "secret":       "bool",     "dead":         "bool",     "nomadic":      "bool",      "population":   "int",     "slaves":       "int", }   But when I print it out with "\n".join(myDict) I get this  name nomadic dead port realOwner secret slaves team y x population id description   I know that a dictionary is unordered but it comes out the same every time and I've no idea why.


I've just bought the above adapter after my old Belkin one gave up. I've seen a few solutions to peoples problems on here but haven't had any success myself yet. Which means this is coming from my phone. Not good.  The adapter doesn't seem to be working at all, the only time I can see it is lsusb- id 0bda:8179 realtek semiconductor corp. Is this what the adapter is meant to look like?  Running 10.04, kernel 2.6.32-45. I've tried installing the rtl8721 drivers, which comes up with 2 errors when I try to install it. Something to do with linux header package, but I'm pretty sure I've got them for my kernel. Tried blacklisting a few drivers but nothing's working. Will upgrading to the latest release be the quickest solution?  Sorry I can't copy more info across, as I said, working off my phone for now!  Thanks for any help  Tim

I installed Ubuntu yesterday, so I'm trying to get used to it.  I'm really close to my router, but my wifi signal gets too low. Sometimes I'm in Facebook or Youtube and the signal is high, almost full, but it is usually in one or two bars, and sometimes none.  I can use Internet normally, I can watch videos and stuff, but the problem is when I try to update something or Ubuntu is downloading stuff, the downloads get stuck or get cancelled telling me that I should check my connection.  How can I fix this? I should be getting a really good signal, I'm really close to my router, my phone has full signal, and a notebook with Windows 7 has full signal here too.  Sorry my bad English and I hope you can help me.  $ lsusb Bus 009 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 002: ID 0bda:8179 Realtek Semiconductor Corp.  Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 002: ID 0458:003a KYE Systems Corp. (Mouse Systems) NetScroll+ Mini Traveler / Genius NetScroll 120 Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


When I firstly installed Ubuntu I gave it 20GB of space for the filesystem. ...time passed and I get a message "the system has only 300MB available" so I need to enlarge the filesystem.  Here's my partition table:      I'm a total noob to partitioning and I have a horrible experience with it; once i had this problem:  on my notebook. Thanks to the great support I got, I gained the tumbleweed badge and I couldn't fix it and I had to re-install windows. The notebook didn't have much important data but this computer's much more important to me. I have backed up the data on the "Database" partition.  anyways  I need step-by-step instructions how to take space from the "Database" partition to enlarge my "filesystem" partition. and what about that red exclamation mark at /dev/sda6?  how do I deal with it? ... what is it?? The red exclamation is not gone!  Tell me any extra information you need to know. Thanks in advance! :D

I've got Ubuntu 10.10 installed to use my whole hard-disk, but would like to use the 130GB of free space I've got to create a new partition and do some development on Unity and Natty.  Can I use gparted to do this?  If so how?


I want to have an Ubuntu LiveCD or LiveUSB with a program (Cisco Packet Tracer) installed on it that’s always there every time I boot.   Anyone knows how to do this?   (Preferably as an image as I want this on several USB-sticks, but maybe I can also do some kind of clone if I succeed on one.)    Thanks!  Magnus

I would like to customize Ubuntu live CD by installing some additional packages. I have followed   but it doesn't seems to work. Can anyone provide clear instructions?   Note: I do not prefer Remastersys, manual way will be appreciated.  Customization  Packages that I want to install:   Thunderbird    Samba    SSH       Changes that I need:   Remove Games menu from the Application menu Firefox shortcut on Desktop Radiance as the default Theme Different default Ubuntu Wallpaper   Configuration file changes   I want the panel to be placed at the bottom I want to paste my Samba configuration file instead of default Samba configuration I have few Firefox shortcuts and folders I would like to show that in Desktop Also it will be nice if you say me how to change the icon sets   Recent Updates   I have customized Ubuntu 10.10 with Firefox shortcuts and few folders on desktops. Everything went smooth. But the installer gets crashes after choosing the timezone. How do i fix this issue? Also setting wallpaper affects the login screen. The wallpaper which i set is displayed on the login screen also. I just want the default one for the login screen.


How do I browse through my account history on Stack Overflow? I have signed in with a Stack Exchange account. I want to revisit a recent question I visited, but I forgot the title.

On your user profile page there are six (6) tabs; stats, activity, reputation, favorites, prefs and accounts.  I would like to see in a new tab, maybe named 50 latest viewed questions, which would contain the 50 latest viewed questions.  This would help when I want to follow a question but don't want to bookmark it or add it to my favorites list.   Sometimes, or a few hours later, I can't even find it again. I think this would be good for when you're viewing questions at work and want to check it up at home but can't because it's not in the same browser history.


I had trouble proving that a nonidentity cyclic group has at least two generators, but I am starting to think that it has to be disproven. Would I have to disprove it by showing that any cyclic group has at least two generators besides the identity?

Every cyclic group with order > 2 has at least 2 distinct generators   Here's what I've got so far:  Either order of our group, $G$, is finite or infinite.  Suppose infinite: then our group is isomorphic to $\mathbb Z$ under addition. This group has two distinct generators, therefore so does $G$.  Suppose finite: Then $G$ is isomorphic to $\mathbb Z_n$ under addition modulo $n$.  We know order of $G$ is $\geqslant 3$. If order of $G$ is odd, both 1 and 2 are generators of $\mathbb Z_n$ under addition modulo $n$, so $G$ has at least two generators.  If order of $G$ is even, then both 1 and some odd number between 1 and $n$ are generators. How do we determine this odd number?  Does this look like I'm on the right track?


Inside UIHandling.h:  enum eType{...};  class UIHandling : public exception { ... UIHandling(eType); template <class T>   UIHandling(eType, T); ... }   Inside another file CompaniesMap I call the second constructor many times using different enums and second variables of different types (double, unsigned int, eType, etc...)  I get the following errors:  1>CompaniesMap.obj : error LNK2019: unresolved external symbol "public: __thiscall UIHandling::UIHandling<double>(enum eType,double)" (??$?0N@UIHandling@@QAE@W4eType@@N@Z) referenced in function __catch$?addCompany@CompaniesMap@@UAEXXZ$2 1>CompaniesMap.obj : error LNK2019: unresolved external symbol "public: __thiscall UIHandling::UIHandling<__int64>(enum eType,__int64)" (??$?0_J@UIHandling@@QAE@W4eType@@_J@Z) referenced in function __catch$?addCompany@CompaniesMap@@UAEXXZ$4 1>CompaniesMap.obj : error LNK2019: unresolved external symbol "public: __thiscall UIHandling::UIHandling<unsigned int>(enum eType,unsigned int)" (??$?0I@UIHandling@@QAE@W4eType@@I@Z) referenced in function __catch$?changeHoldingAmount@CompaniesMap@@UAEXXZ$0 1>CompaniesMap.obj : error LNK2019: unresolved external symbol "public: __thiscall UIHandling::UIHandling<class Date>(enum eType,class Date)" (??$?0VDate@@@UIHandling@@QAE@W4eType@@VDate@@@Z) referenced in function "public: virtual void __thiscall CompaniesMap::postponeExpiryDate(void)" (?postponeExpiryDate@CompaniesMap@@UAEXXZ) 1>D:\Asaf\C\VS\hw5\HW5\Debug\HW5.exe : fatal error LNK1120: 5 unresolved externals   Do I need to define the class itself to be a template? If so than why? If not, why do the errors appear?

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


Is it possible to attack Westeros from Qarth, if one sail to the East? How far is it in the book?  Here's an infographic map:

For quite some time now I have been asking myself how the world of Game of Thrones is shaped and if the people living in that world know the shape.   In questions here on SciFi.Stackexchange concerning the unnatural seasons or the definition of a year in Westeros, it is often  that the Westerosi can measure the duration of a revolution of their planet around the sun. But that only works if they know that they actually live on a planet.   In  answer it was said that people have been travelling in ships around the world. However, I cannot remember any passage in the books supporting this. Actually I only remember evidence for the opposite:    During the  on the Iron Islands, there is a man called  who promises the Ironborn treasures from lands far to the west, if they elect him as king. However, the POV character of that chapter (I think it was Victarion Greyjoy) does not believe him and sees the madness in Gylbert's eyes - as if speaking of travelling west is crazy.  Later when he leads the attack against the Shield Islands, the Iron Fleet travels out of sight of the coast line. This manoeuvre is considered very dangerous and risky. If this is already dangerous, traveling even further west appears close to suicide.   In addition, there was a  who sailed to the far west and never returned.   establishes that the world is not a hollow world, but is not conclusive as to whether it is a planet.  Is there any evidence in the books that the World of Ice and Fire is a planet? Was it established that the Westerosi know the nature of their world?


I linked objects with Ctrl+L. How can I now unlink a single object from the group with links? It used to be "U" in version before 2.8, I guess.

In 2.79 I could press U to make data single user.  How can I do this in 2.80, what is the hotkey?


I find myself typing these commands a lot (on Mac):  $ touch example.txt $ open example.txt   I was wondering if there was an easier way to do this. I tried this:  $ alias t='touch $0 && open $0’   But I got this:  $ t awef.txt touch: illegal option -- b   Note: I do not want to empty the file. If the file already has content, I just want to open it.

For bash script, I can use "$@" to access arguments. What's the equivalent when I use an alias?


While writing a resume , I have come across this question while specifying work experience.      Total Experience of One and Half Years   or     Total Experience of One and Half Year   This may seem duplicate question , but I have read      but it was inconclusive when it came to time span referred for any activity.

Possible Duplicate:             When talking about "one and a half" of any object, do we use the subsequent noun in plural or just singular? I'm aware that "A minute and a half" is also correct but I'm looking for the specific "One and a half"-construction here.   So for example, which of the below phrases is correct?     You're one and a half minutes late!   or     You're one and a half minute late!   Is there any difference when using the phrase as an adjective like so: "One-and-a-half-minute recipe"?


when I add an object, what do I do if I cant adjust the setting in the bottom left corner. I have tried changing my preferences and random stuff around blender and I cant find anything that works. what do I do?

When adding a UV Sphere mesh in Blender 2.8, the creation parameters menu on the bottom left of the attached image for this UV Sphere seems to be greyed out. Any idea why this might be? Thanks.


I'm getting a NullPointer exception when I try to add an array of JLabels to my panel.   the error happens in the last line of the inner loop   Panel panneauScore; Panel panneaujouonsAuGolf; Label [][] arrayscore = new Label [4][9];  for (int c = 0; c<arrayscore.length; c++){         for (int p = 0; p<arrayscore[c].length; p++){             score1 = Choisirrandom();             nombre[c][p] = score1;              arrayscore[c][p]= new Label(String.valueOf(nombre[c][p]));             panneauScore.add(arrayscore[c][p]);         }     }

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 just downloaded it and I accidently pressed fullscreen. Now all I see is a back screen in front of me. I tried all commands and stuff, but only the quit command works. I want to exit full screen but not actually exit out of Minecraft, just the fullscreen.

I switched to full screen on minecraft, the screen turned black as if it were loading it took a while so i closed minecraft and reopened it. When I logged on it gave me a program on my taskbar saying "minecraft minecraft" then when i closed the program it gave me this error message:   java(tm) platform SE binary has stopped working.    Is there a way to fix this?


Recently I stumbled upon a sentence      I have to roll my eyes any time I hear someone say they started or   work for a startup.   I tried to find a grammar rule which explains it but all in vain. Can anybody point me in the right direction on why it is "someone say"?!

"Heard me [infinitive]" vs. "heard me [present participle]"             At that time, you wouldn't have heard me talk about it.   At that time, you wouldn't have heard me talking about it.         At that time, you wouldn't have heard me condemn it.   At that time, you wouldn't have heard me condemning it.         Which one of the above sentences are incorrect and why?


How could I achieve the animated Combo bar effect used in Ski Safari / Ski Safari: Adventure time? Preferably with Unity 4.6 UI. General explanations also welcome!  Links to videos showing the wanted effect:  and

I want to make a progress bar made of text! I have two images: One with the text in gray, the other coloured:     As my game is loading, I want the letters to "fill up" with color:    They would start out gray, then fill in.  I was thinking of overlaying a transparent rectangle over the gray image, then stretching the transparent rectangle to match the progress. But then the background will be coloured too. I want only the letters to be coloured!  How can I do this?


touch(1) can only change modification and access times, but has no options for creation time.  does not work, at least not on Lion.  So how do I change the creation time, also referred to as birthtime in fstat(2)? There's no corresponding call in utimes(2) and there doesn't seem to be any command line tool for this.  I know I can copy the file to a new file, which then gets the current time as birthtime (and then delete the original), but surely there must be a better way?

I have a script that converts a file to another format, and I want the resulting file to have the same timestamps as the original, including the creation time (as shown by ls -lU).  I can use touch to set the access and modification time, but I don't see a way to set the creation time.


First english is not my first language. If you need something explained more just ask.   What I want to do, is make a class that extends the use of an enum. Say you have   enum Color  { red,   green,    blue };   I want to make a class, so I can make an object like   CustomEnum myEnum("red",                    "green",                    "blue",                    "The house is red",                    "The tree is green",                    "The car is blue");   This way, I could call something like  myEnum.getString(red);   With a custom function, it would return the mapped value of "The house is red". However I have many many more functions I want to write, and have many enum's.   CustomEnum mySecondEnum("pizza",                    "soup",                    "eggs",                    "burger",                    "The pizza is hot",                    "The soup has gone cold",                    "The eggs are bad",                   "The burger has cheese");   Notice the two enum's have different sizes, but CustomEnum does not care.   I have done lots of googling and came up with either this cannot be done (because enums are made at compile), or I am googling the wrong things. at this point I want to confirm that this cannot be done or if someone can point me in the right direction.

I have a bunch of enum types in some library header files that I'm using, and I want to have a way of converting enum values to user strings - and vice-versa.   RTTI won't do it for me, because the 'user strings' need to be a bit more readable than the enumerations.  A brute force solution would be a bunch of functions like this, but I feel that's a bit too C-like.  enum MyEnum {VAL1, VAL2,VAL3};  String getStringFromEnum(MyEnum e) {   switch e   {   case VAL1: return "Value 1";   case VAL2: return "Value 2";   case VAL1: return "Value 3";   default: throw Exception("Bad MyEnum");   } }   I have a gut feeling that there's an elegant solution using templates, but I can't quite get my head round it yet.  UPDATE: Thanks for suggestions - I should have made clear that the enums are defined in a third-party library header, so I don't want to have to change the definition of them.  My gut feeling now is to avoid templates and do something like this:  char * MyGetValue(int v, char *tmp); // implementation is trivial  #define ENUM_MAP(type, strings) char * getStringValue(const type &T) \  { \  return MyGetValue((int)T, strings); \  }  ; enum eee {AA,BB,CC}; - exists in library header file  ; enum fff {DD,GG,HH};   ENUM_MAP(eee,"AA|BB|CC") ENUM_MAP(fff,"DD|GG|HH")  // To use...      eee e;     fff f;     std::cout<< getStringValue(e);     std::cout<< getStringValue(f);


See this question:    considering the opinions expressed in there, I don't understand why downvote-explaining comments are disallowed:    Not every downvote can be converted into a suggestion for improvement - and it seems popular opinion on meta has it (or rather, had it, a decade ago...) that it's better to explain a downvote rather than not leave any comment.

If you add a comment explaining why you downvoted - and I mean a long-ish comment which goes into a bit of depth to explain the issue you have with the answer - your comment gets rejected, and a dialog box pops up saying:     Don't comment on your downvote. If you think this post can be improved, please offer specific guidance.   That's just wrong, since:   Downvotes without comments are antagonistic and somewhat hurtful (for posts written in good faith). You might well be offering specific guidance in the downvote comments. It's much better for the downvoter to leave a sub-optimal comment with some feedback then to be discouraged by this message and not provide any feedback.   Instead, the comment should be accepted (except perhaps for a very brief "-1 wrong"-style comments), and the message could say something like:     When commenting on a downvote, try to explain how this post can be improved, and offer specific guidance.   The comment should remain in edit mode to encourage it to be edited, but canceling the edit would leave the comment as-is (again, except for the case of problematic/very brief comments).  Notes:   This question focuses on the specific scenario of a meaningful comment being rejected, and on the rejection message. This is distinct from how to encourage meaningful/positive criticism in general. If it's the "-1" indication that is super-bothersome to people, then either this should be removed from the comment (with the rest of it left), or it should be made very clear that is the reason the comment can't be accepted i.e. "don't explicitly mention the downvote in downvote comments" rather than "don't comment on downvotes".


I'm writing my master's thesis in Minion Pro using LyX and I would like to use that font for math, too. For PDF output I use LuaTeX due to several nice features I got used to in the past (such as easy font configuration).  To get Minion Pro to work in math I use the following code in my preamble (copied from ):  \usepackage{amsmath} % always load before mathspec or unicode-math \usepackage[math-style=ISO]{unicode-math} % try sans-style=upright \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} \setmainfont[Numbers={OldStyle,Proportional},SmallCapsFeatures={LetterSpace=6},%              BoldFont={Myriad Pro Bold},BoldFeatures={LetterSpace=3}]{Minion Pro} \setsansfont[Numbers={OldStyle,Proportional},LetterSpace=3]{Myriad Pro} \setmonofont{Crystal} \setmathfont{xits-math.otf} \setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{Minion Pro} \setmathfont[range=\mathsf/{num,latin,Latin,greek,Greek}]{Myriad Pro} \setmathfont[range=\mathbfsf/{num,latin,Latin,greek,Greek}]{Myriad Pro Bold} \setmathfont[range=\mathit/{num,latin,Latin,greek,Greek}]%             {Minion Pro Italic} \setmathfont[range=\mathsfit/{num,latin,Latin,greek,Greek}]%             {Myriad Pro Italic} \setmathfont[range=\mathbfsfit/{num,latin,Latin,greek,Greek}]%             {Myriad Pro Bold Italic} \setmathfont[range=\mathtt->\mathup]{Crystal} \let\mathbf\mathbfsf \let\mathbfit\mathbfsfit \AtBeginDocument{\let\phi\varphi}   It works nearly as expected but the symbols like sqrt etc that xits-math provides look really strange:    Is there a way to fix this or (maybe even better?) another solution to achieve good looking formulas with Minion Pro using LuaTeX?  (I know there is MnSymbol but I couldn't get it to work correctly with LuaTeX neither. I also don't want to use Minion Math because I prefer solutions that are free (at least free as in free beer)).  Thanks in advance!

I’m having trouble with XeLaTeX (0.9998) and unicode-math (0.7a). If I use \setmathfont more than twice, the \sqrt command breaks when a superscript is specified.  \documentclass{minmal} \usepackage{unicode-math} \setmathfont{Latin Modern Math} \setmathfont[range=\mathup/{num,latin,Latin}]{Linux Libertine O} \setmathfont[range=\mathup/{greek,Greek}]{Symbola} \begin{document} \[ \sqrt[5]{2} \] \end{document}   If I typeset this code, XeLaTeX will produce the following error  Font \l_tmpb_font has only 8 fontdimen parameters.   If I remove the superscript from \sqrt or remove the last \setmathfont command, the document compiles correctly. I’ve tested this code with several OTF files, and they all produced the same result. (I know the resulting superscript is improperly positioned, but I can work on this once I know the document can be typeset.)   because I believe it’s a problem with the package, but I should have checked here before doing so, and I will gladly close the bug if I find I was doing something stupid.


I'm trying to use GParted to resize an ext4 partition on /dev/sda2, and I've been watching a youtube tutorial for that. But my /dev/sda2 cannot be resized. I've tried to change the number but it kept returning to the previous value. I've tried to use cursor but still cannot. when I saw on youtube it could reduce the partition size just shifting dev/sda2. I cannot shift the /dev/sda2 by the cursor and resize that.

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I'm a VB developer currently deciphering an application written in C#. Generally I can find the answer through Google. But I'm lost on this. What is the tilde (~) used for in C#??  Here is a snip-it containing the expression:     /// <summary>         /// Updates the window style for the parent form.         /// </summary>         private void UpdateStyle()         {             // remove the border style             Int32 currentStyle = Win32Api.GetWindowLong(Handle, GWLIndex.GWL_STYLE);             if ((currentStyle & (int)(WindowStyles.WS_BORDER)) != 0)             {                 currentStyle &= ~(int) (WindowStyles.WS_BORDER);                 Win32Api.SetWindowLong(_parentForm.Handle, GWLIndex.GWL_STYLE, currentStyle);                 Win32Api.SetWindowPos(_parentForm.Handle, (IntPtr) 0, -1, -1, -1, -1,                                       (int) (SWPFlags.SWP_NOZORDER | SWPFlags.SWP_NOSIZE | SWPFlags.SWP_NOMOVE |                                              SWPFlags.SWP_FRAMECHANGED | SWPFlags.SWP_NOREDRAW | SWPFlags.SWP_NOACTIVATE));             }         }

I'm always surprised that even after using C# for all this time now, I still manage to find things I didn't know about...  I've tried searching the internet for this, but using the "~" in a search isn't working for me so well and I didn't find anything on MSDN either (not to say it isn't there)  I saw this snippet of code recently, what does the tilde(~) mean?  /// <summary> /// Enumerates the ways a customer may purchase goods. /// </summary> [Flags] public enum PurchaseMethod {        All = ~0,     None =  0,     Cash =  1,     Check =  2,     CreditCard =  4 }   I was a little surprised to see it so I tried to compile it, and it worked... but I still don't know what it means/does. Any help??


Since there is a strong result that follows for any two functions say f(x) and g(x) , i.e $$\max [f,g] (x)=\dfrac {f(x)+g(x)}{2}+ \dfrac{|f(x)-g(x)|}{2},$$ $$\min [f,g] (x)=\dfrac {f(x)+g(x)}{2}- \dfrac{|f(x)-g(x)|}{2}.$$ How can we derive a similar result by extending it for any three functions ? Do any general result exist ? Any help would be highly appreciated. Thanks in advance .!

As we saw , the minimum of two quantities can be written using elementary functions and the absolute value function.  $\min(a,b)=\frac{a+b}{2} - \frac{|a-b|}{2}$  There's even a nice intuitive explanation to go along with this: If we go to the point half way between two numbers, then going down by half their difference will take us to the smaller one. So my question is: "Is there a similar formula for three numbers?"  Obviously $\min(a,\min(b,c))$ will work, but this gives us the expression: $$\frac{a+\left(\frac{b+c}{2} - \frac{|b-c|}{2}\right)}{2} - \frac{\left|a-\left(\frac{b+c}{2} - \frac{|b-c|}{2}\right)\right|}{2},$$ which isn't intuitively the minimum of three numbers, and isn't even symmetrical in the variables, even though its output is. Is there some nicer way of expressing this function?


I'm writing you as I would like to receive some information about entering in the US under the VMP.I'm an Italian citizen, living and working in Italy, and I entered in the US on December 26th and June 4th, which stays lasted 88 and 87 days, respectively, for both business and vacation purposes.  I searched for detailed information regarding how many days I am allowed to spend in the US under the VWP program - apart of 90 days per stay -, as well as what can be considered a reasonable amount of time between visits, without any luck.   Since I am planning to visit a friend of mine in the US for 9 days, may I ask you if it would be allowed or if there is any constraint that might prevent me to enter in the US? Would it be too risky?   Edit: My question is slightly different than the older one because I'm concerned about entering in the US after two ~90 days stays in one year.

I am currently visiting the USA from the UK (I am a UK citizen) and am intending on staying here for the full 90 days under the Visa Waiver Program.     How long would I have to stay out of the US at the end of this period before returning again?    Would I have to return to the UK, or could I stay with friends in another country (such as Canada) for a while?


I am working on building an LWC component for a requirement. I would like to find a way to change/update the properties of an JavaScript Array that contains objects returned from Apex Controller. I tried below code, but there seems to be a javascript error. I tried many ways to change the properties of the object returned by Apex controller. But nothing worked. Code snippet & error details provided below. Can someone please help on this ?  public class FetchCPData {     @AuraEnabled(cacheable=true)     public static List<PRListWrapper> getPRList(String CPId) {         List<PRListWrapper> prList = new List<PRListWrapper>();         for(PR__C pr : [SELECT Id, Status__c, Value__c, (select Id, Name from Opportunities__r limit 1) FROM PR__C WHERE PC__c=:CPId]){             PRListWrapper prw = new PRListWrapper();             prw.PRRecord = pr;             if(!pr.Opportunities__r.isEmpty())              {                 prw.disable = true;             }else {                 prw.disable = false;             }             prList.add(prw);         }         return prList;     }     public class PRListWrapper{         @AuraEnabled public Boolean disable;         @AuraEnabled public PR__C PRRecord;     } }  import { LightningElement, api, wire, track} from 'lwc'; import getPRList from '@salesforce/apex/FetchCPData.getPRList'; const actions = [     { label: 'Delete', name: 'Delete' } ]; const columns = [     { label: 'Status', fieldName: 'status', editable:'true', type: 'text' },     { label: 'Bid Value', fieldName: 'value', editable:'true', type: 'currency', typeAttributes: { currencyCode: 'USD'}},     {         type: 'action',         typeAttributes: { rowActions: actions }     } ] export default class ShowDataInTable extends LightningElement {     @api recId;     @track error;     @track recSize;     @track data = [];     @track columns = columns;     @wire(getPRList, { CPId : '$recId' })      projectRolesFn ({error , data}){         if(data){             const lostFilter = data.filter(element => {                 return element.PRRecord.Status__c!=='Lost';             });             this.data = lostFilter.map(element => {                 alert(element.PRRecord.Status__c); //This is fetching data as expected                 alert(element.PRRecord.Value__c);  //This is fetching data as expected                 element.status = element.PRRecord.Status__c; //JavaScript error at this point(error given below)                 element.value = element.PRRecord.Value__c;                 return element;             });                   this.recSize = this.data.length;             this.error = undefined;                    } else if(error){             this.error = error;             this.data = undefined;         }     } }   JavaScript Error:     aura_proddebug.js:43117 Error: Invalid mutation: Cannot set "status" on "[object Object]". "[object Object]" is read-only.       at ReadOnlyHandler.set (aura_proddebug.js:1100)       at eval (showBiddersInTable.js:81)       at Array.map ()       at ShowBiddersInTable.projectRolesFn (showBiddersInTable.js:79)       at WireEventTarget.dispatchEvent (aura_proddebug.js:8329)       at Object.next (lds.js:1157)       at Subscription.next (lds.js:202)       at FilterOnSubscribeBehaviorSubject._nextWithErrorHandling (lds.js:272)       at eval (lds.js:304)       at Set.forEach ()

Am not doing anything fancy, just trying to update a field on Contact in JS of LWC but getting this exception.  Uncaught TypeError: 'set' on proxy: trap returned falsish for property 'Name' throws at mydomain/auraFW/javascript/mhontaYdOya4Y_lBu7v9yg/aura_prod.js:2:27687  HTML Code:   <template>      <template if:true={wiredContact}>          {wiredContact.Name}          <lightning-input value={wiredContact.Name} onchange={updateName}></lightning-input>     </template>  </template>   JS:   import { LightningElement ,wire,track,api } from 'lwc'; import myContact from "@salesforce/apex/ContactController.fetchContact";  export default class Myrefreshapextest extends LightningElement {    @track wiredContact;   @wire (myContact)         fetchedContact({error, data}){             if(data){                 console.log(JSON.stringify(data));                 this.wiredContact = data;             }else if (error){                 console.log(error);             }     }      updateName (event){         console.log(JSON.stringify(event.detail.value));         console.log(JSON.stringify(this.wiredContact));         this.wiredContact.Name = event.detail.value;     }  }   Apex:  public class ContactController {      @AuraEnabled(cacheable=true)     public static Contact fetchContact(){         return [SELECT Id,Name FROM COntact LIMIT  1];     } }   On top of my head, am not doing anything wrong, anyone has idea what's wrong with my code?  When I print console.log(JSON.stringify(this.wiredContact)); I get old values so am pretty sure it exists.  I tried with @track and @api, but same response. Can anyone shed some light?


The computer is a fresh install (5 days old) of Ubuntu 16.04 LTS. The FS is fully encrypted.  Just before the crash,    I installed openvpn, added my configuration. I wanted to restart NetworkManager, and sudo restart network-manager strangely told me it was not authorized (even with the sudo). I restarted the machine to see if it would make things better   Since then, upon restart just after typing my filesystem encryption password, I have the following error:  Bluetooth: HCIO command 0xaabbccdd tx  timeout  [4:46] Bluetooth: HCIO: fail to send firmware data (-110)   (where 0xaabbccdd is always a different address) and the system won't boot.  The only thing I did related to bluetooth since the last time I rebooted is disabling it from the top-right menu.  When trying to boot with grub (holding shift at startup), the screen stays black forever.  I succesfully accessed my filesystem through a live usb, but I don't really know what I need to do now.  If need be, the errors shown and the last things the Kernel did before dying in the kernel log :   EDIT I've disabled bluetooth driver completely (blackisted the kernel module), and it turns out it's the last error that was printed but it's not the cause of the crash. Now on startup, the screen stays black with a blinking cursor.  but the syslog ends with a message saying it can't connect to the serverX, which could clearly be an explanation as to why it's staying with a blinking cursor.

Xserver keeps crashing on my general user account both in Unity 3D and 2D. It doesn't do it on the guest account.  That's why I want to reset / rollback everything xserver related, hoping this is going to fix it.  Most answers on this involve sudo dpkg-reconfigure xserver-xorg. However, this does nothing for me (generates no output) and I read in other forums, that it's deprecated.  So, what's the current way to reset all xserver / xorg options; what's the alternative to sudo dpkg-reconfigure xserver-xorg? X crashes during work, not before login or so. And the effect of a crash is, that I get thrown out of the session, not a freeze or machine crash.


I'm using amsmath and its \tag command to tag equations. I remember having a situation where I liked having the tag on the left better than on the right. So I gave my class (which is report btw) the leqno options. Now, however, I find myself wanting to revert to reqno. However, I fear actually removing leqno will make the above mentioned situation look worse. I found that the solution in  does not work with equation: \documentclass{report} \usepackage[leqno]{amsmath}  \makeatletter \newcommand{\leqnomode}{\tagsleft@true} \newcommand{\reqnomode}{\tagsleft@false} \makeatother \begin{document}  \begin{align}   f(x) &= ax^2 + bx + c \\   g(x) &= dx^2 + ex + f \end{align}  \reqnomode  \begin{align}   f(x) &= ax^2 + bx + c \\   g(x) &= dx^2 + ex + f \tag{e} \end{align}  \begin{equation}   a^2+b^2=c^2.\tag{1} \end{equation}  \leqnomode  \begin{equation}   -\Delta\phi=4\pi k\rho.\tag{2} \end{equation}   \end{document}  Output:  The first equation should still be in \reqnomode (alias \tagsleft@false) from the second align, yet the tag is on the left. How do I solve the problem without using an align or such which are for multiline display and would therefore be out of place on a single one-line equation?

I'd like to know if it is possible switch between the leqno and reqno options in the same document keeping the numbering of the equations. Namely i use the reqno option (default for amsmath and the standard article class), but i want that some equations are numbered by the left side (as if I had relied the leqno option) and the others no.  I'd like a commands as \leqnomode and \reqnomode to change the position of \tag in anywhere of the document.  Is this possible?


How can I use asymptote language inside an exsheets question?  For example, the code below will compile perfectly fine. But if the asypicture environment is moved inside the exsheets question environment, then errors happen.  (The same behavior is used if asy environment from asymptote package is used.)  \documentclass{article} \usepackage{asypictureB} \usepackage{exsheets}  \begin{document}      \begin{question}         How can I use asymptote inside a question?     \end{question}      \begin{asypicture}{}         import graph3;         import palette;          size3(400,400,200,IgnoreAspect);         currentprojection=orthographic(1,-3,50);          real f(pair r) {return r.x^3-3*r.x*r.y^2;}          real Arg(triple v) {return degrees(cos(v.z),warn=false);}          surface s=surface(f,(-4,-4),(4,4),20,Spline);          s.colors(palette(s.map(zpart),Rainbow()+opacity(0.75) ));         draw(s,render(compression=Low,merge=true),meshpen=black);          real xmin = -5;         real xmax = +5;         real ymin = -5;         real ymax = +5;         pen axisPen = red + 0.75;         draw(Label("$x$",1),(xmin,0,0)--(xmax,0,0),axisPen,Arrow3);         draw(Label("$y$",1),(0,ymin,0)--(0,ymax,0),axisPen,Arrow3);          pen p=fontsize(12pt);         pair P = (2.5,-2);         dot("$P$",(P.x,P.y,f(P)),N,p);          xaxis3("$x$",Bounds,InTicks);         yaxis3("$y$",Bounds,InTicks(beginlabel=false));         zaxis3("$f$",Bounds,InTicks);     \end{asypicture}  \end{document}

I am trying to use exsheets to prepare the tests for Foundation of Programming exam. I need to include snippets of C code in some question and solution and I am going to use listings (with the options specified in the minimal working example below). However I realised that the code is messed up if injected inside a question or a solution.  Do you know how to work around the problem?    Minimal Working Example  \documentclass{article}  \usepackage{xcolor} \usepackage{listings} \usepackage{exsheets}  \lstset{   frame=single,   xleftmargin=20pt,   numbers=left,   numberstyle=\small,   tabsize=2,   breaklines,   showspaces=false,   showstringspaces=false,   language=C,   basicstyle=\small\ttfamily,   commentstyle=\itshape\color{gray} }  \begin{document}  \begin{question}{6} Consider the following C program. \begin{lstlisting} #include <stdio.h>  int main(int argc, char *argv[]) {   printf("hello, world\n"); } \end{lstlisting} \end{question}  \begin{solution} Consider the following C program. \begin{lstlisting} #include <stdio.h>  int main(int argc, char *argv[]) {   printf("hello, world\n"); } \end{lstlisting} \end{solution}  \pagebreak \printsolutions   \end{document}


Does anyone know how to put your programs that you've installed on your Desktop?

In older versions it was easy to create a launcher on my desktop. All I had to do is right click on my desktop and select the "create launcher" option.  How can I create such launchers now?


I'm not positive if the title of the thread is accurate.   I have a class of different enums:  public class Enums {     public enum StringActions      {           FIRSTNAME,          MIDDLEINITIAL,          LASTNAME     }      public enum IntegerAction     {         RANGE,         RANDOM     } }   I have an object who's constructor, I'd like to take in a generic Enums parameter, which would be capable of accepting either a StringAction or a IntegerAction. I have dictionaries (one for each enum type) that has these enums as the keys, and delegates as values. I want to use the passed in enum to lookup the correct delegate for that enum and then do some work with it.  public class DataPoint {     public DataPoint(Enum mAction)     {         if (mAction == Enums.StringAction)         {               var act = StringActionDictionary[mAction];         }         else if (mAction == Enums.IntegerAction)         {              var act = IntegerActionDictionary[mAction];         }         ...     }  }   With this implementation, I'll need to cast 'mAction' to the correct type but how can that be accomplished at runtime? Is reflection an option here, or is there another way?

Seeing as C# can't switch on a Type (which I gather wasn't added as a special case because is relationships mean that more than one distinct case might apply), is there a better way to simulate switching on type other than this?  void Foo(object o) {     if (o is A)     {         ((A)o).Hop();     }     else if (o is B)     {         ((B)o).Skip();     }     else     {         throw new ArgumentException("Unexpected type: " + o.GetType());     } }


There are many questions which have bad SO/markdown syntax, most notably when referring to code. I like to fix this syntax and add the appropriate language tag so that the code is nicely formatted. However, often my edit is not big enough to be allowed, even though the net effect of the edit would in fact be a substantial improvement to the question.  Has there been any consideration to change the edit size requirements for such circumstances?  update see my feature proposal here:

Without 2k rep, code formatting is impossible, because it just adds spaces, which don't count for the 6-character-ritual-threshold.  This question is related to impossible title-improvements for a similar reason, brought up here:   A more or less  crossed my way today, which wasn't readable because of missing code-indentation. (Many regex-tools like grep, sed, awk work on a line-by-line basis, so it is essential to see, where a line starts and ends.    I put the indentation in, but got an error: at least 6 changes, not counting: white space. Uhm.    I looked for something obvious, which could be changed too - nothing.  I looked for something not so obvious, which could be changed too - nothing.  I got angry and left the page, because I didn't want to write some foobar, or a disclaimer why this disclaimer, which would be much longer than 6 characters.  I had the idea to comment my edit in the question itself - this wouldn't be foobar, but have a bit of sense.  When I finished my comment, I was informed, that meanwhile somebody else did edit that question. I left the question, angry. Lost much time in doing 6-character-gymnastics.    Conclusion: The quality of an improvement isn't much related on the quantity of changed characters, especially not, if whitespace doesn't count.   P.S.: I suggest the new "6-character-rule"-tag.


I have a client-server system, both sides written by me, and I would like to put the clients in an 'offline' state when the server disconnects/dies, and then automatically bring them back 'online' when the server is available again.  For the first part, I listen for channel faulted events and handle that by setting the client to offline. I then start calling a 'ping' service on the server (every 30 sec.) which just returns a bool if it is alive. Once it is alive the client gets the bool and switches back online.   This all works, the problem I am having is that when the client calls the ping service and the server is down, no response is sent (obviously) and eventually, after about 2mins I get an endpoint not found exception. By this time I have already tried 3-4 more pings and hence have 3-4 exceptions brewing.  My question is, how can I deal with the ping service more gracefully? Ideally I would like to periodically call a service that lets me know if it is online, and instantly lets me know if it is not.

I want to check the availability of the WCF web service i.c service is up or down through  the C# code. How to achieve that?


I want a to be rounded to 13.95.  >>> a 13.949999999999999 >>> round(a, 2) 13.949999999999999   The  function does not work the way I expected.


I have Windows 10 on my laptop, i decided that i would like to dual-boot it with ubuntu (this was my first time installing ubuntu onto any device/ or any linux-based system).  Made my USB Bootable, went through the installation process choose the option to dual-boot, everything seemed to be fine, my pc restarted to finish installation (after it went off I took out my usb) then it booted directly to windows, so I shut down my computer pressed f12, and I just saw the windows boot manager in the options, the I did the same thing with my usb plugged on, and now I see the windows boot manager, the usb for installing ubuntu, and an unknown device(that was grub btw) after looking for a few fixes couldn't get anything to repair that, figured out that i just installed grub into the usb, i gave up and deleted the partition that had ubuntu.  Now it's where my problems really started, i had no sound, my drivers were perfect it detected the speakers and everything but it simply didn't play sound couldn't play test tone, same thing for audio input, and camera, also i am unable to go into services.msc, now chrome closes itself from time to time, i cannot use the reset option nor update, it's a nightmare.  Then i reinstalled Ubuntu to test if it would have problems too, it was perfect actually it had sound input/output, it would detect my camera everything was fine except that i couldn't get grub to boot first.  Then i tried everything, boot-repair, moving partitions, literally everything that a normal user could do so i just uninstalled ubuntu again to see if ubuntu was "sucking the periphericals or something" and im still without clue to what to do.  Right now i just want my W10 back to normal, i won't be trying to install ubuntu again until i have some partition knowledge, so if someone could help me out to get my windows back to normal it would be great.  EDIT 1:   When i tried to open the setup for windows 10 this happens:   thing pops up for a few minutes everything fine  then  and that's it

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


Err:17 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata   Hash Sum mismatch   Hashes of expected file:    - Filesize:762382 [weak]    - SHA256:6992cdbbeec75ab9a81f82dfe79b787bbe0da0587ddbb71090e3f5a1d6f14794    - SHA1:c8ad07aa2316c5db1251db7ba3c8cc83d74deded [weak]    - MD5Sum:e8523de342151179aac680d249b86bed [weak]   Hashes of received file:    - SHA256:ee0640fcd2f7494c1e038f2aa14b91f3e4bcd1a7262052e981b40f5cabf1d22a    - SHA1:c8ad07aa2316c5db1251db7ba3c8cc83d74deded [weak]    - MD5Sum:e8523de342151179aac680d249b86bed [weak]    - Filesize:762382 [weak]   Last modification reported: Tue, 29 Sep 2020 00:30:01 +0000   Release file created at: Tue, 29 Sep 2020 01:31:09 +0000 Fetched 218 kB in 3s (83.8 kB/s)    Reading package lists... Done E: Failed to fetch store:/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_focal-updates_universe_dep11_Components-amd64.yml.xz  Hash Sum mismatch    Hashes of expected file:     - Filesize:762382 [weak]     - SHA256:6992cdbbeec75ab9a81f82dfe79b787bbe0da0587ddbb71090e3f5a1d6f14794     - SHA1:c8ad07aa2316c5db1251db7ba3c8cc83d74deded [weak]     - MD5Sum:e8523de342151179aac680d249b86bed [weak]    Hashes of received file:     - SHA256:ee0640fcd2f7494c1e038f2aa14b91f3e4bcd1a7262052e981b40f5cabf1d22a     - SHA1:c8ad07aa2316c5db1251db7ba3c8cc83d74deded [weak]     - MD5Sum:e8523de342151179aac680d249b86bed [weak]     - Filesize:762382 [weak]    Last modification reported: Tue, 29 Sep 2020 00:30:01 +0000    Release file created at: Tue, 29 Sep 2020 01:31:09 +0000 E: Some index files failed to download. They have been ignored, or old ones used instead.

When I check for updates, I get a "Failed To Download Repository Information" error.   This is what comes up under details:   W: Failed to fetch gzip:/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_natty_main_source_Sources  Hash Sum mismatch,  E: Some index files failed to download. They have been ignored, or old ones used instead.


I am trying to understand and clarify the way time dilation occurs due to general and special relativity and for which reason. In the case where an object is approaching a planet in free-fall how does the gravitational field affect time dilation in the object? I have set out the case below is this correct? I have ignored the effect of the object on the planet.   If an object is approaching a planet, for example, in a straight line from a distance due to gravity it will only experience time dilation due to its velocity and this will increase according to its velocity and SR. It would not experience time dilation due to proximity of the larger body as it is in free fall.  If the object is then stationary on the surface of the planet it will experience time dilation due to being in an accelerated frame as it can no longer fall freely, it would only experience time dilation due to motion of the planet.

Time dilation  using Schwarzschild metric for a non rotating spherical body is: $$t_0=t_f\sqrt{1-\frac{2GM}{rc^2}}$$  For such a non rotating spherical body, what would the time dilation of a clock in vacuum free-falling from infinity be?  (If the answer is non-trivial; a high level outline of the calculation would suffice / be appreciated)  Edit: I am currently working on an iOS app that is trying to model the mechanism underpinning relativity.  So, far the mechanism that I have created is shockingly simple and shockingly good at conforming to Relativity.  However, I am trying to break it.  I am trying to find any possible areas where the two may diverge.  I have noted that using my model a clock in freefall will experience no time dilation, i.e. $t_0=t_f$ and I want to make sure Relativity agrees.  I have noted the gravitational component of time dilation above.  Since my clock is moving one might also expect a kinematic time dilation.  I can calculate the velocity of my clock: $$E_k=\frac{1}{2}mv^2$$ $$E_p=\frac{-GMm}{r}$$ $$v=\sqrt{\frac{2GM}{r}}$$ Plugging this velocity into the kinematic time dilation equation: $$\Delta t'=\frac{\Delta t}{\sqrt{1-\frac{v^2}{c^2}}}$$ $$\Delta t'=\frac{\Delta t}{\sqrt{1-\frac{2GM}{rc^2}}}$$  At this point one might make the observation that the kinematic dilation is the inverse of the gravitational dilation and therefore conclude that: $$t_0=t_f$$


Im triying to create users in a database in mongo, I want to lock the usage of te collections for some users, I'll give an example:  Lets say that I actually have a db with 3 collections:  Books, Students, Proffesors  And 3 users:  Librarian, SecretaryManager, Director  And I want the Librarian have r/w permissions just in Books, SecretaryManager r/w permissions in Students and Professors, and finally, Director that would have the same permissions as Librarian + SecretaryManager.  I've readed the documentation of mongo main website, im aware of using db.adduser, but I haven't find the way of doing this or I've miss something.  Need help, thanks in advance.

I'm building a backend system using MongoDB. Now I want to restrict access on certain numbers of database collections to this system. For example I have users, admin_users, pageviews and I want this system to be able to read and write only admin_users and pageviews collections but no read or write access on users colection. Is there any ways to do so?


I have recently seen a post on Twitter that said something along the lines of:  "If you are a gnome and cast Reduce on yourself, you can use Mage Hand to pick you up by the collar for a quick getaway"  This sounds really cool, but I wonder if it is within the rules defined by Mage Hand. Mage Hand :  You can use the hand to manipulate an object, open an unlocked door or container, stow or retrieve an item from an open container, or pour the contents out of a vial. You can move the hand up to 30 feet each time you use it.  The hand can't attack, activate magic items, or carry more than 10 pounds. from looking around on RPG.SE I saw :  An object is any physical thing that is not a creature:  ... targets creatures, objects, or a point of origin for an area of effect...   The same question then continues to discuss that an object is not a creature. For completness sake,  shrinks the player to:  ...and its weight is reduced to one-eighth of normal.  Which for an average  of 40-45 pounds, would be below the weight capacity of Mage Hand, assuming they weren't carrying more than 10-15 pounds of gear. So my question is: Can I Use Mage Hand on a reduced PC, who has enough gear to be below the weight limit of Mage Hand, to pick him up and fly?

Could I first cast Mage Hand, then Polymorph into a Tiny creature less than 10 pounds then use the Mage Hand to pick myself up and fly at 30 Ft per turn?  Polymorph says:     The new form can be any beast ... The target's game statistics,   including mental ability scores, are replaced by the statistics of the   chosen beast. It retains its alignment and personality ... The   creature is limited in the actions it can perform by the nature of its   new form and it can't speak, cast spells, or take any other action   that requires hands or speech.   This keeps me from casting spells, which keeps me from just casting Mage Hand to fly as long as I want to over and over. But for that initial duration of the Mage Hand cantrip, could I use the Mage Hand to fly as a Tiny polymorphed creature until the spell runs out?


So I was sorted into Horned Serpent in Ilvermony on Pottermore.   What are the other ones?

At Hogwarts, there are four houses: Slytherin, Gryffindor, Hufflepuff, and Ravenclaw.  Do any of the other wizarding schools, like Durmstrang or Beauxbatons, sort their students into separate houses?


I'm a beginner in Java. I have to make shopping cart. But I'm stuck on remove method.  Please help me!  I tried to make remove method. But it doesn't work well..  Customer.java  public class Customer {     private String id;     private String firstName;     private String lastName;     private ShoppingCart shopCart;      public Customer(String id, String firstName, String lastName) {         this.id = id;         this.firstName = firstName;         this.lastName = lastName;         shopCart = new ShoppingCart();     }      public ShoppingCart getShopCart() {         return this.shopCart;     }     @Override     public String toString() {         return ("Customer ID is: " + this.id + "\n" + "Customer's name is: "                  + this.firstName + " " + this.lastName + "\n\n"                  + "Shopping list: \n\n" + shopCart.toString());      }    ShoppingCart.java  public class ShoppingCart {     private int itemCount;     private double totalPrice;     private static int capacity;     private Item[] cart;     public ShoppingCart()     {                capacity = 5;         itemCount = 0;         totalPrice = 0.0;         cart = new Item[capacity];     }      public void addBooktoCart(String title, String description, double price, int pageCount) {         if (itemCount < 5) {          Item item = new Book(title, description, price, pageCount);         totalPrice += price;         cart[itemCount] = item;         itemCount += 1;                }          else {             System.out.println("The maximum number that you can input is 5." +                      "You cannot add item anymore");         }      } //This remove method may be a problem.     public void removeItemFromCart(String title) {         boolean found = false;         for (int i = 0; i < cart.length; i++) {                         if (cart[i] != null)                                 {                    if (cart[i].getTitle().equals(title)) {                    totalPrice -= cart[i].getPrice();                    cart[i] = null;                    itemCount -= 1;                    found = true;                    }                }         } if(found != true) {              System.out.println("Item is not found in cart. Nothing removed");          }     }     @Override     public String toString() {         String contents = "";          for (int i = 0; i < itemCount; i++)         {             contents += cart[i].toString() + "\n\n";         }          String strDouble = String.format("%.2f", totalPrice);          contents += "The total price is: $" + strDouble + "\n\n"                 + "How many items do you have in your shopping cart? \n"                 + "There are " + this.itemCount + " items in my shopping cart. "+ "\n";         return contents;      } }    Test.java  public class Test {         public static void main(String[] args) {          Customer c1 = new Customer("12345", "Hyun Min", "Lim");         c1.getShopCart().addBooktoCart("Harry Potter", "Fantasy Genre", 10.99, 309);         c1.getShopCart().addCDtoCart("Abbey Road", "Pop Genre", 6.50, 18);         c1.getShopCart().addMovietoCart("Forrest Gump", "Drama Genre", 13.23, 141);         c1.getShopCart().removeItemFromCart("Harry Potter");         System.out.println(c1.toString());          }   I want to remove array of elements. But output is   Exception in thread "main" java.lang.NullPointerException.  What do I do if the compiler works well. I think that the remove method is a problem.

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?


How would I normalize my data between -1 and 1? I have both negative and positive values in my data c# array ?

How would I de normalize the values which where normalized by the min max normalization below ?


Let $f:\mathbb{R}\to\mathbb{R}$ be an integrable function. Show that if $\int\limits_a^bf(x)dx=0$ for all rational numbers $a<b$, then $f(x)=0$ all most everywhere. Hint:  First prove $\int\limits_Af=0$ for $A$ an open set, then for $A$ measurable. My attempt: Let $A$ an open set in $\mathbb{R}$. Then  we can write $A=\bigcup\limits_{k}(a_k,b_k)$ where $\left\{(a_k,b_k)\right\}_{k=1}^{\infty}$ is a disjoint collection of open intervals with rational end points(Is this possible?) So $\int\limits_Afdx=\int\limits_{\bigcup\limits_{k}(a_k,b_k)}fdx=\sum\limits_{k=1}^{\infty}\int\limits_{a_k}^{b_k}fdx=0$ Then how should I use the result to for measurable $A$ and moreover, after doing so, does $\int\limits_{\mathbb{R}}f=0$ implies $f=0$  a.e? Appreciate your help

Suppose $f:\mathbb{R}\to\mathbb{R}$ is Borel measurable. I want to show that $\displaystyle \int_a^b f(x)\mathrm dx=0$ for all $-\infty<a<b<\infty$ with $a$ and $b$ rational implies that $f=0$ a.e. I'm really not sure how to approach this problem; any help would be welcome.


Need your support on this.  We have a sharepoint list having number of fields. I am requesting a solution here.  We have two fields.  Field-1 : Department (Sales) Field-2 :system Configuration: (i5,500 GB HDD, 8 GB RAM - for sales)                              : (i5, 256 GB SSD, 8 GB RAM - for operations)  Resoulation required: If i select department "sales", It should take automatically system configuration field with "i5,500 GB HDD, 8 GB RAM". Like wise if department is selected "Operation" it should take system configuration field with "i5, 256 GB SSD, 8 GB RAM". Would be great help if system configuration field will be readonly.

We are preparing a Asset request list in sharepoint. We have different department with specific system configuration. For Ex, If user will select "sales department" automatic the system configuration field should taken required system configuration details.  For Ex: Department : Sales         System configuration: i5,8GB RAM, 512GB SSD.  Please help me on this.


I want to make a script in Python that has to do some relatively simple calculation. I noticed that some very simple additions like 1.3+0.13 yield strange results (1.4300000000000002 for this example). Is this a known issue? Is there a way to avoid it? To test it by yourself: print (1.3+0.13)

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


This is a simple question: Did Voldemort faint because of the blood connection between him and Harry,  or because of the Horcrux inside Harry?  Those are the 2 things that connect Voldemort to Harry so I am assuming it's one of those reasons.

Book 7: When Lord Voldemort "killed" Harry in the Forbidden Forest, he is apparently knocked out (like Harry) for some reason.  Why?  What happened to Voldemort when he was knocked out? Did he also visit Limbo?


In order to measure negative and positives voltages with Arduino I found this solution.  I need to understand how to calculate R1, R2 and R3 according to specifications below. Specs are: The impedance has to be < 10K according to arduino ADC specs. VOutput min voltage 0v and max voltage 5v. VMeasure voltage range goes from -25v to +25v In the solution ground can be shared without problems.  I tried to simulate in LTspice after I chose some values, but I cannot get output values on a dc sweep. It only gives me constant voltage in the output of R2 and R3. Does anyone know the reason?

I am trying to measure voltage & current off a solar charge controller from panel, battery & load simultaneously with my arduino. I have managed to achieve this by tying all the negatives together and using it as GND, however, when I do that the charge controller doesn't function properly and when I switch to off-mode the loads still run. After checking the instruction manual further, I found out that the positives are shared common between Pan, Bat, Load. This was confirmed with a multimeter.   So now what I am thinking of doing is using the positive from the battery as the GND reference and then measuring all other voltages (through voltage dividers with respect to the GND). The voltages should then range between -17V to 0V.   However, I have read that the analog input pins are not able to read negative voltages, and with respect to the positive GND, the Analog inputs will all be negative.   EDIT: I was thinking of using an amplifier to invert positive ground to a negative ground, meaning I could measure all the positive sides of the voltages. But after getting answers from you guys it seems I may not have to use an amplifier and a voltage divider may suffice. I have currently included a 2 resistor voltage divider between each analog input, +5V source, Vmeasure which you can see in the diagram below.  According to my calculations, if this works, @-17V I should see 0.6V @ analog input. @0V I should see 4V at analog input.   I'd appreciate feedback on this circuit, and below in the second image I've also included a piece of another method suggested by @jonk (thanks), and would be interested in knowing what the benefits are of method B) over method A)  Thanks!  Ps. the ameters are there in place of ACS712 current sensors which also go into analog input pins.   Method A)        – Schematic created using   Method B (EDIT: This method has worked, I am still yet to test method A) thanks @Jonk))


I just installed Ubuntu on my computer as a beginner and found out there is no LAMP server available in the software center. I'm somehow stuck on how am going to install LAMP server on my Ubuntu since there is no particular website for doing that.  Please , where are the sources where I can install LAMP server into my computer and the processes I will follow to make it work.  Thanks.

I set up a new VPS instance of Ubuntu and am wondering what the easiest way is to get up and running with a basic LAMP stack (i.e. which packages are required, which configuration options need to be tweaked, if any, etc.).


Euclid's lemma states that: if a prime $p$ divides the product $ab$ of two integers $a$ and $b$, then $p$ must divide at least one of those integers $a$ and $b$.  My question is can $a=b$? or must they be different integers?   If they can would I be able to use Euclid's Lemma to prove a question such as this:  Prove that if $n^2$ is divisible by $13$ then $n$ is divisible by $13$

The proof is already given in the textbook but I tried other way around.   Proof by contradiction: Let's assume that $p$ doesn't divide $a$ and $p$ doesn't divide $b$, but $p$ divides $ab$. So $\gcd(p,a)=1$ and $\gcd(p,b)=1$. Given that we can construct linear combinations   $sp+ta=1$ together with $up+wb=1$. Multiplying the left and the right sides of the equations we get  $spup+spwb+taup+tawb=1$ or $p(sup+swb+tau)+ab(tw)=1 \implies \gcd(p,ab)=1$. This is a contradiction.   Is it rigorous and sound proof?


I have a timer that works, but I don't have leading zeros in the form of 00:00.000. How can I make that happen? Here's my code:  mEndTime = System.currentTimeMillis(); mTotalTime = mEndTime - mStartTime; int seconds = (int) (mTotalTime / 1000); int minutes = seconds / 60; seconds = seconds % 60; int millis = (int) mTotalTime % 1000; String sectime = Integer.toString(seconds); String milsectime = Integer.toString(millis); String time = minutes + ":" + sectime + "." + milsectime;

How do you left pad an int with zeros when converting to a String in java?  I'm basically looking to pad out integers up to 9999 with leading zeros (e.g. 1 = 0001).


Problem: Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a differentiable function with $f(0) = 0$ and $f'(x) = [f(x)]^2$.Prove that $f(x) = 0$ for all $x \in \mathbb{R}$.   My incomplete attempt: Consider an interval $[0, x]$ . Thus, by the mean value theorem,  $$ \frac{f(x) - f(0)}{x - 0} = f'(c_x) = (f(c_x))^2 $$ thus,  $$ f(x) = (f(c_x))^2 x .  $$  So, if there is any $ x_0 $ such that $ f (x_0) \neq  0 $ can this argument be applied to arrive at a contradiction?

Let $f: \mathbb{R} \to \mathbb{R}$ be a differentiable function such that $f(0)=0$ and $\forall x \in \mathbb{R}$, we have $f'(x)=[f(x)]^2$. Show that $f(x)=0, \forall x \in \mathbb{R}$.


I'm trying to practice proof writing, and found the following text question:  For all sets A,B,C:  $ (A \cup B) \cap C \subseteq A \cup (B \cap C)$  The first step I was thinking of showing is that:  $ (A \cup B) \cap C = (A \cap C) \cup (B\cap C)$  or the subset is the sliver only where A and B intersect C.  I'm kind of stuck on  where to go from here. I know the statement is true as the superset contains ALL of A, and the parts where C and B intersect, but I'm not really sure how to prove this. Any tips?

Prove:  $(A\cup B) \cap C \subseteq A\cup (B\cap C)$  How could I go about proving this?


#include<stdio.h> void fun(int a[]) {         int m=sizeof(a)/sizeof(a[0]);     printf("m=%d\n",m);  }  int main() {     int arr[]={1,2,3,4,5,6};     fun(arr);     int n=sizeof(arr)/sizeof(arr[0]);     printf("n=%d\n",n);     return 0; }   Output: m=2 n=6  Why is m not also 6? How to find the size of an array passed as a function argument?

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


Let $g(x) = \frac{1}{1-x}$ and $h(x) = \frac{x}{1-x}$:  Their derivatives are:  $$\frac{d}{dx}g(x)=\frac{1}{\left(1-x\right)^2}$$  $$\frac{d}{dx}h(x)=\frac{1}{\left(1-x\right)^2}$$  Integrating the RHS I should get back the initial function(s):  $$\int \frac{1}{\left(1-x\right)^2}\;\mathrm dx=\frac{1}{1-x} + C$$  But I obviously get only one of the expressions, namely $g(x)$. So my question is how can both functions have the same derivative even though when integrating the derivative, I get back only one of the expressions?   What am I missing? Does it have something to do with the $C$ constant?

Maybe I'm just having a brain breakdown moment, but it seems weird to me that both functions have exactly the same derivative, namely $\frac{1}{(1-x)^2}$.  Obviously I'm not disputing whether or not it's correct, but I'm looking for some sort of intuition/justification (geometric or otherwise) as to why this is indeed the case.  I can take the derivatives manually so this is really not a question of not understanding the algebra, rather maybe having poor geometric intuition as to why the changing numerator as a function of $x$ doesn't impact the rate of change of the overall function.


I'm having a hard time figuring out how this destructor call  So I have class A with virtual destructor and inline virtual clone function  class A{ public:     A(){ }     virtual ~A(){         qDebug() << "Class A destructor";     }      inline virtual A *clone(){         return NULL;     } };   Then I have sub-class B also have destructor and clone function return pointer to class A  class B : public A{ public:     B() { }     ~B(){         qDebug() << "Class B destructor";     }     A *clone(){         B *temp = new B();         return static_cast<A *>(temp);     } };   And I have main function and test function and i start do some crazy thing about pointer  A *test(A *input){     return input->clone(); }  int main(){      B temp2;     A *temp = test(&temp2);     delete temp;      return 0; }   Finally if I have the output is   Class B destructor Class A destructor Class B destructor Class A destructor   and if I'm not using virtual before destructor class A, I have ouput is  Class A destructor Class B destructor Class A destructor   So can anyone explain me why virtual make so much different

I have a solid understanding of most OOP theory but the one thing that confuses me a lot is virtual destructors. I thought that the destructor always gets called no matter what and for every object in the chain. When are you meant to make them virtual and why?


Hey guys. I dont know how i suppose to do about setting values to derived classes ctor. And here is my code. I remember something like that build in my class. But i know that we can write something like that build ( xxx():yyy(){,,,};). Check the main's second object.      #include <iostream>  using namespace std;  class vehicle { protected:     string brand;     int wheelNumber;     double maxSpeed=0; public:     vehicle(){cout<<"default ctor for vehicle"<<endl;}     vehicle(string br1, int wn1, double ms1)     {brand=br1; wheelNumber=wn1; maxSpeed=ms1;}      void setbrand(string br){brand=br;}     string getbrand(string br){return brand;}     void setWN(int wn){wheelNumber=wn;}     int getWN(int wn){return wheelNumber;}     void setMaxS(double ms){maxSpeed=ms;}     double getMaxS(double ms){return maxSpeed;}     ~vehicle(){cout<<"dtor for vehicle."<<endl;} }; class car: public vehicle { private:     int numberOfDoors;     string fuelType; public:     car(){cout<<"default ctor for car"<<endl;}     car(int nOD,string fT){numberOfDoors=nOD; fuelType=fT;}      void setnOD(int nOD){numberOfDoors=nOD;}     int getnOD(int nOD){return numberOfDoors;}     void setfT(string fT){fuelType=fT;}     string getfT(string fT){return fuelType;}      void printFeatures()     {         cout<<endl;         cout<<"brand:"<<brand<<endl;         cout<<"wheelNumber:"<<wheelNumber<<endl;         cout<<"MaxSpeed:"<<maxSpeed<<endl;         cout<<"NumberOfDoors:"<<numberOfDoors<<endl;         cout<<"FuelType:"<<fuelType<<endl<<endl;     }     ~car(){cout<<"dtor for car."<<endl;} };  int main() {     car *cc;     cc= new car;     cc->setbrand("bmw");     cc->setfT("diesel");     cc->setMaxS(333.25);     cc->setWN(4);     cc->setnOD(6);     cc->printFeatures();     delete cc;      car *xx;     xx= new car;     car(5,"gasoline"):vehicle("mercedes",4,489.12);//Part that i cant figure it out.     xx->printFeatures();     delete xx; }

What are the C++ rules for calling the base class constructor from a derived class? For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an implicit call to a no-arg super constructor is assumed - giving you a compile error if that's missing).