I am looking for a formal way to proof that $k! > (k/2)^{(k/2)}$ for any $k \in \{1,2,3,4...\}$  I tried proof by induction but this didn't really work out. So I kind of know why $k! > (k/2)^{(k/2)}$, but can't come up with a good way to write it down.

I'm working on a homework problem that has me showing a "$\Omega(n\log k)$ lower bound on the number of comparisons needed to sort a sequence of $n$ elements, when the input sequence consists of $\frac{n}{k}$ subsequences each containing $k$ elements. Each element in a subsequence will be larger than its preceding subsequence and smaller than its succeeding subsequence."  Essentially, I just need to sort $k$ elements in each of the $\dfrac{n}{k}$ subsequences.  I realize that to do this I need to show that the maximum possible height of a binary tree $2^h \geq (k!)^{n/k}$. I did this to try and solve it (assuming we are using $\log_2x)$:  $\log(2^h) \geq \log((k!)^{n/k})$  $h \geq \dfrac{n}{k}\log(k!)$  This is as far as I got. However, my professor told me that in order to solve the problem I would need to prove that for all $k$, $k! \geq \left(\dfrac{k}{2}\right)^{k/2}$  I can obviously see why this would be true, but I don't really know how to prove it. Looking it up online I found an answer that someone posted stating:     (1)$\qquad$ $k! = k(k-1)(k-2)\ldots(2)(1)$      (2)$\qquad$ $k! \geq k(k-1)(k-2)\dots\left(\dfrac{k}{2}\right)$      (3)$\qquad$ $k! \geq k(k-1)(k-2)\ldots\left(\dfrac{k}{2}\right) \geq \left(\dfrac{k}{2}\right)\left(\dfrac{k}{2}\right)\ldots\left(\dfrac{k}{2}\right)$      (4)$\qquad \geq \left(\dfrac{k}{2}\right)\left(\dfrac{k}{2}\right)\ldots\left(\dfrac{k}{2}\right) = \left(\dfrac{k}{2}\right)^{k/2}$      For (2), half of terms are greater than $\frac{k}{2}$ and half are   smaller drop all terms less than $k$      Since $\dfrac{k}{2} \geq k$ we can write (3)   From this answer I know that by plugging in $\dfrac{k}{2}$ for $k!$ in the original equation will give me the answer $\dfrac{n}{2}\log\left(\dfrac{k}{2}\right)$. But I don't understand why we dropped half of $k!$ and how we could know that $\dfrac{k}{2} \geq k$. I understand part (4) but I don't really understand the transformations taking place in between (1) and (2), and (2) and (3).


My page's code is:  <!--Custom JavaScript --> // --> This Script contains the initLoadMore function <-- <script src="/static/js/custom.min.js"></script>      <script src="/static/js/moment.min.js"></script> <script src="/static/js/material-datetimepicker.js"></script> <script>    $(function(){       initLoadMore("btnLoadMoreEvents","events-list");    }); </script>   the Script custom.min.js contains:  $(function(){ function initLoadMore(btnLoadMore,container){     let num_page = 2;     $("#"+btnLoadMore).click(function(){         $.get("?p="+num_page).done(function(data) {             $("#"+btnLoadMore).prop("disabled",true);             if(data.last_page == true){                 $("#"+container).append(data.content);                 $("#"+btnLoadMore).remove();             }else{                 $("#"+container).append(data.content);                 num_page = num_page + 1;             }        }).fail(function(xhr){             swal("Error", "Ha ocurrido un error al cargar m\u00E1s contenido. Por favor, int\u00e9ntalo de nuevo.", "error");        }).always(function(){            $("#"+btnLoadMore).prop("disabled",false);        });     }); } });   The console says Uncaught ReferenceError: initLoadMore is not defined. The function only works if I delete the $(function(){ ... });(document ready) in the custom.min.js Script.  Why does this happen?

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


I have played this game for 40 years, however, yesterday I experienced a "first."  Runner is at third, two out ...batter hits but is super slow running.  The play for the out develops terribly slowly and the runner at third crosses home.  Much later, the throw gets to first, forcing the third out.  Does the run count.  I thought not, but in the confusion - I'm second guessing...

Under what conditions can a run be scored on a play that results in a 3rd out for the team?  I was under the impression that if a 3rd out happens, all runs that might have scored before time during that at-bat are invalid, but apparently there is more to it than that.


I've been trying to understand C++ inheritance and polymorphism a little bit better. But I'm having a really hard time getting this to work. I have a base class called Shape. I have Rectangle that is child of Shape. And Square that is child of Rectangle. Shape has no area. Rectangle and Square have area equal to width*height. Setting width and height for Rectangle is independent. In the case of Square, when setting width or height, the function will set both attributes to the same value. Unfortunately that is not what is happening if I try to use polymorphism by creating a Square on a Rectangle.  shapes.hpp: #ifndef SHAPES_H #define SHAPES_H  // Base class class Shape {     public:         virtual void setWidth(int w);         virtual void setHeight(int h);     protected:         int width;         int height; };  // Derived class class Rectangle: public Shape {    public:       int getArea(); };  class Square: public Rectangle {    public:       void setWidth(int w) override;       void setHeight(int h) override; };  #endif /* SHAPES_H */  shapes.cpp: #include "shapes.hpp"  // Base class void Shape::setWidth(int w) {     width = w; } void Shape::setHeight(int h) {     height = h; }  // Derived class int Rectangle::getArea() {      return (width * height);  }  // Overloading void Square::setWidth(int w) {     width = w;     height = w; } void Square::setHeight(int h) {     width = h;     height = h; }   Testing the getArea() functions:     Shape rect = Rectangle();     rect.setHeight(7);     rect.setWidth(5);     //I had to cast the Rectangle so it would be able to call getArea()     cout << "Total rectangle area (w5xh7): " << ((Rectangle*)&rect)->getArea() << endl;     Rectangle square = Square();     square.setHeight(7);     square.setWidth(5);     //I would like to be able to call Square's getArea() without having to cast it.     cout << "Total square area (w5xh7): " << square.getArea() << endl;  I had to cast the Rectangle so it would be able to call getArea(). I would like to be able to call Square's getArea() without having to cast it. Is that possible? Thank you.

Someone mentioned it in the IRC as the slicing problem.


Is there a way to use apostrophes ' with the sed command?     I mean this: -    sed '-2 a\\ What's up?' text     I am talking about the apostrophe in "What's up". If I do it like this it gives me an error "Unmatched"    I tried to escape that apostrophe with \ OR \\ like this What\'s up?, but it doesn't work.

I'm having trouble with escaping characters in bash. I'd like to escape single and double quotes while running a command under a different user. For the purposes of this question let's say I want to echo the following on the screen:  'single quote phrase' "double quote phrase"   How can I escape all the special chars, if I also need to switch to a different user:  sudo su USER -c "echo \"'single quote phrase' \"double quote phrase\"\""   Of course, this doesn't produce the right result.


I have a code that group multiple columns as a one column. But I have problem with separation of it.   \documentclass[conference]{IEEEtran}  \usepackage{pgfplots} \usepackage{siunitx} \usepackage{multirow}  \pgfplotsset{width=7cm,compat=1.3}  \begin{document} \begin{table}[h]     \caption{Calculation}     \label{tbl::agreement}     \centering     \begin{tabular}{|l|l|c|c|c!{\vrule width 2pt}l|l|c|c|c|}         \hline         & \multicolumn{4}{|c|}{class1}{\vrule width 2pt}&\multicolumn{5}{|c|}{class2}\\         \hline         \textbf{Column}&\textbf{Algorithm}&\textbf{min}&\textbf{max}&\textbf{std}&\textbf{Column}&\textbf{Algorithm}&\textbf{min}&\textbf{max}&\textbf{std}\\\hline         \multirow{3}{*}{age}&Original&9&2.8&100&\multirow{3}{*}{age}&Original&13&2&10\\ \cline{2-5} \cline{7-10}         &A&2&95&96&&A&2&100&100\\\cline{2-5} \cline{7-10}         &B&100&100&100&&B&100&100&100\\\hline     \end{tabular} \end{table} \end{document}     between class1 and class2 separation is thicker. And I want to group {Column, Algorithm, min, max, std} as class1 for left of table. But there is a split between {Column} and {Algorithm}. Can you please help me?

I have a code that prints a table with 2 rows. I want to keep format of it and change 2 rows into 3.   \documentclass[conference]{IEEEtran}  \usepackage{pgfplots} \usepackage{siunitx} \usepackage{multirow} \begin{document}  \begin{table}[h] \caption{Family data set results} \label{tbl::Fam} \centering \begin{tabular}{|l|l|c|c|c!{\vrule width 2pt}l|l|c|c|c|} %\noalign{\hrule height 2pt} \hline \textbf{Column}&\textbf{Algorithm}&\textbf{min}&\textbf{max}&\textbf{std}l&\textbf{Column}&\textbf{Algorithm}&\textbf{min}&\textbf{max}&\textbf{std}\\\hline \multirow{2}{*}{age}&Original&9&2.8&100&\multirow{2}{*}{employer\_type}&Original&13&2&10\\ \cline{2-5} \cline{7-10}&PrivBayes&2&95&96&&PrivBayes&2&100&100\\\hline \multirow{2}{*}{education\_level}&Original&7&2&98&\multirow{2}{*}{marital\_status}&Original&10&2&100\\ \cline{2-5} \cline{7-10}&PrivBayes&2&6&96&&PrivBayes&2&6&100\\\hline \hline %\noalign{\hrule height 2pt} \end{tabular} \end{table}  \end{document}   In this picture, I have 2 algorithms {Original, PrivBayes}. I want to change 2 algorithms into 3 algorithms with keeping the format of table. Can you please help me to do it?


I have a base interface FunctionCredential:  public interface FunctionPrivilege {}   and several other interfaces extending this interface:  public interface ReadSomethingPrivilege extends FunctionPrivilege {} public interface WriteSomethingPrivilege extends FunctionPrivilege {} ...   The interfaces are used as marker interfaces only (no implementations). I want to discover interfaces (all reachable using the current context classloader), not check known interfaces.  Within a Java application, can I somehow discover (list) those interface classes at runtime? If so, how would I do that?  Note: CDI does something similar, also discovering/scanning classes at runtime.

I want to do something like this:  List<Animal> animals = new ArrayList<Animal>();  for( Class c: list_of_all_classes_available_to_my_app() )    if (c is Animal)       animals.add( new c() );   So, I want to look at all of the classes in my application's universe, and when I find one that descends from Animal, I want to create a new object of that type and add it to the list.  This allows me to add functionality without having to update a list of things.  I can avoid the following:  List<Animal> animals = new ArrayList<Animal>(); animals.add( new Dog() ); animals.add( new Cat() ); animals.add( new Donkey() ); ...   With the above approach, I can simply create a new class that extends Animal and it'll get picked up automatically.  UPDATE: 10/16/2008 9:00 a.m. Pacific Standard Time:  This question has generated a lot of great responses -- thank you.  From the responses and my research, I've found that what I really want to do is just not possible under Java.  There are approaches, such as ddimitrov's ServiceLoader mechanism that can work -- but they are very heavy for what I want, and I believe I simply move the problem from Java code to an external configuration file. Update 5/10/19 (11 years later!) There are now several libraries that can help with this according to @IvanNik's   looks good. Also  from @Luke Hutchison's  looks interesting. There are several more possibilities in the answers as well.  Another way to state what I want: a static function in my Animal class finds and instantiates all classes that inherit from Animal -- without any further configuration/coding.  If I have to configure, I might as well just instantiate them in the Animal class anyway.  I understand that because a Java program is just a loose federation of .class files that that's just the way it is.  Interestingly, it seems this is  in C#.


I have two .blend files, and I want to get nodes from one into the other .blend file.

I have created several designs for a particular project and they are related, but I don't want to have to keep recreating any similar elements, such as shared materials or textures.  How can I use the existing data in a new Blender file?


Let f :  ]0;1[ $\longrightarrow \mathbb{R} $, uniformly continuous on ]0;1[. I want to show that f is bounded. My idea is to show that $lim_{x \rightarrow 0+} f(x)$ and $lim_{x \rightarrow 1-} f(x)$ exists (take a sequence ($x_n) \subset ]0;1[ $ ; $\forall n \in \mathbb{N}  x_n >0$ ;  $lim_{n \rightarrow + \infty} x_n = 0$ then by using that f is uniformly continuous we have that (f($x_n$)) is Cauchy and as a result the limit $lim_{x \rightarrow 0+} f(x)$ exists. Same reasoning for the other limit) . Hence we can extend by continuity f in 0 and 1, so f is uniformly continuous on [0;1] and is bounded. I think this reasoning is to simple and wonder what is the problem in it. Thank you by advance for your help.

I need to prove that if $f: (0,1) \rightarrow \mathbb{R}$ is Uniformly continuous then it is  bounded.   Thank you.


So I'm playing a D&D 5e homebrew campaign and while I was in a battle in one round I did this.   Move 15 feet (from basic 35 feet) Put my light crossbow away Drew a longsword with two hands (as a part of the attack) Attacked an orc with that longsword with two hands   I'm not sure how many times I can interact with an object and I searched the player's handbook and it only says that you can draw your sword as a part of the attack? And I'm not sure that you can put your crossbow away too.

I've seen this question asked about 4e, and I think I've found the passage in the 5e PHB that answers the question, but I'd like to make sure I understand this correctly before I impose it on my game.  The question is can sheathing one weapon and drawing another be part of the same "free action", or does this take a full action?  The PHB (page 190)     You can also interact with one object or feature of the environment for free, during either your move or your action. For example [...] you could draw your weapon as part of the same action you use to attack.   If you want to interact with a second object, you need to use your action. Some magic items and other special objects always require an action to use, as stated   in their descriptions.   As a bonus question, what do you think about a Rogue using their "use object" bonus action to draw a weapon after using their free action to sheath one, leaving a standard action and movement action left to be used.


When I turn the LCD monitor into portrait mode, the fonts rendering gives my head dizziness.  There are numerous questions and answers for the case of Windows OS. Also, there are answers for gnome.  I am using Ubuntu 16.04 LTS with unity.  The problem seems to be connected with RGB vs. BGR font rendering.  How to set BGR font rendering in Ubuntu 16.04?

In Ubuntu 11.10, I can't find a way to change the sub-pixel byte ordering to BGR. I have a BGR monitor and fonts look blurry because of this. I've installed gnome-tweak-tool but I can't find an option for the sub-pixel ordering. This used to be easy to do with the old font settings window.


Are there actually "maphacks" out there? I don't see how this is possible but a lot of people seem to be talking about them. Personally I would never use them and I think they ruin the game. But, are there such things as map hacks? If so how do you report players using them? Most important what are tell-tale signs of someone using them?

Are there people who map cheat the fog of war away in Starcraft 2 on Battle.net? Do I have to worry about this?


In my basement I have 24V AC power outlet. I need it to be 230V.  I found some fairly big, old transformer core, on the one side of it I winded 3 turns of standard power cable, on the other side I winded 30 turns. When I connect either of those sides to power outlet (while the other coil remains unconnected), the light in the whole basement goes down (it doesn't break, it starts to glow really low). As I said, It doesn't matter which coil I plug in, the result is the same. Also, when I connect the 3-turns coil into my outlet, the transformer is making quiet buzzing, while, when I connect the 30-turns coil, it starts buzzing kinda loud.  Why does the light in the basement go down? Why is the transformer buzzing? How do I convert this 24V into 230V? I only have this big transformer core, some standard home power cables (the ones that you are using to power your pc, tv, etc.), and some unisolated wires (those were in the transformer previously, but now I think they are useless, since they got no insulation on them).

I found a fairly big, old transformer. I unwinded all the coils and winded them again. My primary coil has 20 turns, and the secondary coil has 200 turns. I didn't use any tools while doing this, so it isn't precisely woud.  Now, when connecting this transformer directly into the power outlet, the power fuse goes out. I have 3 theories for why this is happening:   Maybe I shouldn't connect the transformer directly into the outlet - do I need to put something "in between" the transformer and the power outlet? Maybe I am connecting the transformer in a wrong way? Currently I connect it by putting first primary coil wire into first hole in my power outlet, and second primary coil wire into second outlet hole. Is it possible that there is something wrong with the wires? I put isolation tape all over the primary coil so that those two won't touch.    What is wrong with my transformer?


I have a currently open bounty in Magento site  & I have solved the problem myself  I can accept my answer as valid, but I am not sure what to do with the bounty points  I am not asking to be able to give the points to myself, but I don't think it is right to give points to other answers which won't solve the problem... so, what's the right thing to do? Give the points to the most valid answer? Don't give any points?

I posted a  about an unusual issues I desperately needed help fixing. When I didn't get any relevant answers and the project deadline was approaching, I created a 500 point bounty. Since then I have received only one other answer, and it was just a suggestion on how to clean up my code, it had nothing to do with the core issue.  The project went live even with the issue. I found a workaround, but it's far from perfect. I posted my own workaround as an answer, hoping that it would provide more information about the issue, and that if anyone finds the question in the future at least there is a workaround in case no answer is found.  The bounty expires in 4 hours. My own workaround has received +1 votes so far. I doubt anyone will provide an answer in the next 4 hours. My question is, what is the best action for me to take? Should I just let the bounty expire? Should I accept my own answer, even though it's incomplete? Should I accept one of the other answers even though they had nothing to do with the issue, just so that the 550 rep points don't go to "waste"?


While this is directly executed in terminal it works fine  zenity --info --text "pure info" --title "get info"   But this script doen't work what's wrong?  !/bin/bash ZEN="--info --text \"pure info\" --title \"get info\"" zenity $ZEN   The script outputs like : "info in text and '"jeevan in title. It is skipping the remaining part. Is it because the space (special character) loses it's special meaning inside double quotes?

I want to run a command such as this in a bash script:  freebcp <authentication and other parameters> -t "," -r "\r\n"   When run directly on the command line, the command works as expected. But when placed in a variable in a bash script it returns an error such as this:  Msg 20104, Level 3 Unexpected EOF encountered in bcp datafile  Msg 20074, Level 11 Attempt to bulk copy an oversized row to the server  bcp copy in failed   When command is placed in a variable and double quotes are escaped:  cmd="freebcp ${db_name}.dbo.${table_name} in ${p_file} -S ${server_name} -U ${username} -P ${password} -t \",\" -r \"\r\n\" -c" `$cmd`   Note: Putting the following in the script works as expected:  `freebcp ${db_name}.dbo.${table_name} in ${p_file} -S ${server_name} -U ${username} -P ${password} -t "," -r "\r\n" -c`   So I know there's some quoting/escaping/expansion problems but I can't figure out how to fix it.  Note 2: Single quoting -t -r parameters doesn't work either


I am attending two independent conferences in Germany that are one month apart. Ideally, I want to apply for them concurrently, with minimal costs. I will fill two applications, and book one interview. Beyond that, do I have to pay the fees twice? Can I apply for a single multiple entries visa for a duration that covers the two conferences instead?

I will go to France from 17/12/13 – 19/12/13, then I will come back to London. And again I will go back to Portugal and Spain from 26/12/13 to 03/01/14 which I will stay in Spain for the longest period. However, the Spanish consulate told me that I have to request for the visa from the French consulate.  The point is: Do I need to apply for a visa for a single trip two times (from French and Spanish consulate) or a single visa for multiple time (from French consulate).


Does anybody know how to move the keyboard caret in a textbox to a particular position?  For example, if a text-box (e.g. input element, not text-area) has 50 characters in it and I want to position the caret before character 20, how would I go about it?  This is in differentiation from this question:  , which requires jQuery.

How do you set the cursor position in a text field using jQuery?  I've got a text field with content, and I want the users cursor to be positioned at a certain offset when they focus on the field.  The code should look kind of like this:  $('#input').focus(function() {   $(this).setCursorPosition(4); });   What would the implementation of that setCursorPosition function look like?  If you had a text field with the content abcdefg, this call would result in the cursor being positioned as follows: abcd**|**efg.  Java has a similar function, setCaretPosition.  Does a similar method exist for javascript?  Update: I modified CMS's code to work with jQuery as follows:  new function($) {   $.fn.setCursorPosition = function(pos) {     if (this.setSelectionRange) {       this.setSelectionRange(pos, pos);     } else if (this.createTextRange) {       var range = this.createTextRange();       range.collapse(true);       if(pos < 0) {         pos = $(this).val().length + pos;       }       range.moveEnd('character', pos);       range.moveStart('character', pos);       range.select();     }   } }(jQuery);


The following exercise is taken from      Suppose $\mathbb{P}$ is non-atomic and $A\in \mathcal{F}$ with $\mathbb{P}(A)>0.$         Show that for every $\epsilon>0,$ we have $B\subseteq A$ such that $0<\mathbb{P}(B)<\epsilon.$   Prove that if $0<a<\mathbb{P}(A),$ then there exists $B\subseteq A$ with $\mathbb{P}(B)=a.$      I solved the first problem in this .  The following is my attempt to part $2.$  Let $\epsilon_n = \frac{1}{n+1}$ for all $n\geq 0.$ By part $(1),$ the set $\{G\subseteq A: \mathbb{P}(G) <  a\}$ is nonempty. Let  $$ x_0 = \sup\{\mathbb{P}(G): G\subseteq A, \mathbb{P}(G) < a\}. $$ Then there exists $G_0\subseteq A$ such that $\mathbb{P}(G_0) < a$ and $x_0(1-\epsilon_0) \leq \mathbb{P}(G_0).$  By using part $(1)$ inductively, for any $n\geq 1,$ let  $$ x_n = \sup\{\mathbb{P}(G): G\subseteq A\setminus (G_0\cup\cdots G_{n-1}), \mathbb{P}(G_0\cup \cdots G_{n-1} \cup G) < a\}. $$ Then there exists $G_n\subseteq A\setminus (G_0\cup\cdots G_{n-1})$ such that $\mathbb{P}(G_0\cup \cdots G_{n-1} \cup G_n) < a$ and $x_n(1-\epsilon_n) \leq \mathbb{P}(G_n).$  Let $B = \bigcup_{n=0}^\infty G_n.$ Note that $B\subseteq A,$ $\mathbb{P}\left( \bigcup_{n=0}^\infty G_n\right) \leq a$ and $\{G_n\}_{n=0}^\infty$ is mutually disjoint. So, $\mathbb{P}(B)\leq a.$ By countably additivity of $\mathbb{P},$ we have $$ \mathbb{P}(B) = \mathbb{P}\left( \bigcup_{n=0}^\infty G_n \right) = \sum_{n=0}^\infty \mathbb{P}(G_n) \geq \sum_{n=0}^\infty x_n(1-\epsilon_n). $$ I do not know how to conclude that  $$\sum_{n=0}^\infty x_n(1-\epsilon_n) \geq a.$$ Any hint is appreciated.

Suppose $Pr$ is non-atomic that is $Pr(A)$ implies the existence of $B$ with $B\subset A$ such that $0<Pr(B)<Pr(A) $ and $A\in\mathcal{F}$ with $Pr(A)>0$. (a)show that for every $\epsilon>0$, we have $B\subset A$ such that $0<Pr(B)<\epsilon$. (b)Prove that if $0<a<Pr(A)$ then there exists $B\subset A$ such that $Pr(B)=a$.  Here is a hint: fix $\epsilon_n \to 0$ and define inductively numbers $x_n$ and sets $G\in \mathcal{F}$ with $H_0=\emptyset$, $H_n=\cup_{k<n} G_k$, $x_n=\sup\{Pr(G): G\subset A\setminus H_n, Pr(H_n\cup G)\leq a\}$ and $G_n\subset A\setminus H_n$ such that $Pr(H_n\cup G_n)\leq a$ and $Pr(G_n)\geq (1-\epsilon_n)x_n$. Let $B=\cup_{k} G_k$.


This issue is absolutely killing me, I cannot get a single solution online to work!  I am trying to import the following text from a CSV to a MySQL table - via Navicat's import wizard:  L154 – TRAINING WARRANTY   The hyphen is a wide hyphen and so far I've managed to import it as either a question mark, or a black diamond with question mark inside. Same for £ symbols and other special characters.    Everyone always talks about UTF-8. So far I have tried:  Saving the CSV in Excel, clicking Tools > Web Options > Encoding: UTF-8  Right clicking the database and clicking EDIT. Setting Char set to utf8 Unicode and Collation: utf8_general_ci  I have "designed" the table and set the 2 options above to exactly the same.  I have edited the varchar field in question and set the same 2 fields again to the 2 types above.  But my hyphen will not import correctly.  It would be nice to know exactly how to go about importing data that has £ symbols and other special characters once and for all.

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.


Is it possible to compensate a digital potentiometer's 75 ohm wiper resistance with a negative resistance amplifier?

I am trying to find a 1k linear digital pot which has a very low (preferably 0) wiper resistance. Any interface would be ok (apart from just up/down).   I found this article:  resistance  which could be a way around the issue.   What I am trying to do, is substitute the 1k pot in the classic fuzz circuit     with a digitally controlled one, and it needs to pretty much go down to 0 Ohm to get the full fuzz effect. I am not sure if the above 'trick' may interfere the fuzz's simple circuit which is extremely sensitive.  Does anyone have any suggestions, feedback or alternative idea?   Thanks!


How to prove that if $x$ satisfies  $x^n+a_{n-1}x^{n-1}+\dots+a_0 = 0$  for some integers $a_{n-1}$, ..., $a_0$, then $x$ is irrational unless x is an integer.  Thanks for your help in advance.

Let $n > 0$ and let $a_{n-1}, ..., a_0$ be integers. Prove that, if $x^n + a_{n-1}x^{n-1} + ... + a_0 = 0$ has a rational root, then such root is an integer.   I understand that posting questions without showing your work is frowned upon, but I don't know where to start with this one.. thanks in advance.


SQLAlchemy ORM Mavens,  Using SQLAlchemy ORM (not CORE), how can a bulk UPDATE be configured on an unknown quantity of objects in a manner similar to a SQL UPDATE-SET-WHERE command (such as this one:)?   UPDATE items SET items.price = (items.price * 1.1) WHERE Left(item_id, 4) = "PAX-";   After hours of poring over manuals and docs...all I can find are CORE examples—and hope you'll be so kind as to offer a tip.  Many, many thanks! Planewryter  PS: Using Python 3.7 and SQLAlchemy v1.2.13 on an iMac w/macOS 10.14.1

I'm starting a new application and looking at using an ORM -- in particular, SQLAlchemy.  Say I've got a column 'foo' in my database and I want to increment it.  In straight sqlite, this is easy:  db = sqlite3.connect('mydata.sqlitedb') cur = db.cursor() cur.execute('update table stuff set foo = foo + 1')   I figured out the SQLAlchemy SQL-builder equivalent:  engine = sqlalchemy.create_engine('sqlite:///mydata.sqlitedb') md = sqlalchemy.MetaData(engine) table = sqlalchemy.Table('stuff', md, autoload=True) upd = table.update(values={table.c.foo:table.c.foo+1}) engine.execute(upd)   This is slightly slower, but there's not much in it.  Here's my best guess for a SQLAlchemy ORM approach:  # snip definition of Stuff class made using declarative_base # snip creation of session object for c in session.query(Stuff):     c.foo = c.foo + 1 session.flush() session.commit()   This does the right thing, but it takes just under fifty times as long as the other two approaches.  I presume that's because it has to bring all the data into memory before it can work with it.  Is there any way to generate the efficient SQL using SQLAlchemy's ORM?  Or using any other python ORM?  Or should I just go back to writing the SQL by hand?


Some non-paywalled news websites started recently adding 'see more' dividers to their articles on mobile versions of their sites.  This made sense on sites likes the Wall Street Journal, where you have to be a paying subscriber to continue reading, but what about free-to-access articles? What's the purpose of adding them there?  We can't say that it's for analytics (how many people read beyond this threshold) since we already have more precise tech for this that doesn't require the user to click on a button.  Some notable examples are: qz.com, techcrunch.com and nytimes.com.

I've noticed a lot of news websites, particularly on mobile, sometimes will cut off their story with a button you have to click to see the rest of it. I can understand why they'd do this if they wanted to make you pay for the rest of the article or shove an ad in your face, but sometimes the button just shows the story and does nothing else.   .    To me, this seems like a really bad user experience. Making someone tap a button to continue browsing your site seems like a good way to lose their interest. Is there some hidden value in this interface design choice? Or does it serve some unrelated purpose (perhaps for analytics on user engagement?)


I am trying to get from one minor city (X) in Europe to the other (Z). There are many options. I could train for an hour to X, then fly to Y, then train to Z. Or I could train from X to Z, or I could, bus to other airport W, fly to other airport Q, then train Q to Z, etc. etc.  Many website (e.g. skyscanner) will show me all the flights. Some show train sites will show me how to get from A to B via train (maybe by bus).  Is there any site that links them all together? So I enter a city/town name, and it tells me all the options for how to get there. Price is a factor, but not the main factor.

Travel sites that search all the major air lines are a dime a dozen.  And in some localities, there are travel sites that at least pay lip service to searching major bus carriers.  But are there any travel sites that will search all major forms of transportation, and let you form a mixed itinerary? I'm thinking at least air, bus, and train.  For instance, if I want the cheapest way to get from Town A to Town B, I'd like options like:        Take Foo Bus Line from Town A to City Q   Fly Bar Airline from City Q to City Z   Take Baz Passenger Train from City Z to Town B      For bonus points, it might even include public transit options, in localities where it's actually feasible to take public transit between major cities.


Lifelink typically says:     Lifelink (Damage dealt by this creature also causes you to gain that much life.)   Suppose I attack with a 5/5 creature which has Lifelink, and it's blocked by a 1/1 creature.  Do I gain 1 life or 5?

I have recently began playing a deck that has a number of creatures with lifelink in it.  I want to be certain I understand the mechanic and the following question occurred to me.  Which damage total do you use to determine the life gain from lifelink?  I had assumed that if  a 3/3 creature with lifelink was blocked by a 2/2 creature that the life gain total would be 2, the maximum that the blocker can absorb before dying.  This seems to be incorrect, as when I read the example attached to CR 119.4c      [...] attacks with a 3/3 creature with wither and lifelink. It’s blocked by a 2/2 creature, [...]. The damage event starts out as [3 damage is dealt to the 2/2 creature, 2 damage is dealt to the 3/3 creature]   Have I been short changing myself?


When I type the command   pip   it works fine (gives me a help page). But when I type the command   sudo pip   it gives me the response  sudo: pip: command not found   whereas for example 'sudo python' works fine. How is this situation possible? I am not very familiar with what is going 'behind the scenes' when I invoke a command with sudo

Sample command:  drush cc all   works, but this:  sudo drush cc all   gives me:  sudo: drush: command not found   Why? How to fix this?


I have found out the .tar.gz for my printer but i do not know which one to download from the list. plz tell me which one to download and how to install..  Here's the link   I use lubuntu 14.04

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


I have Lenevo P700 It supports this memory . This is ram which is currently inside  THis is what i find from google it supports 32GB  I want to buy this and not sure if its same or not  Also is it possible that i can buy single stick to test if it works or i have to buy 2 sticks together in pair to make it work ? i want o buy 8 4 sticks

I don't have any knowledge in hardware and would like to know which RAM should I buy for my laptop.  How do I discover what RAM I need & how much my machine can take?  I have a Razer Blade 15 (RZ09-02705F76) 2018 but don't know if there is a specific type or format of RAM that suits it and don't know where to find this information.


I take photos with my phone (a Galaxy S9) frequently and this problem seems to plague me every time I try taking photos indoors near a window during daytime. The light from the window which is above the table seems to be leaking into the image and it messes with the white balance very badly, along with producing a photo that looks like it was taken with a smudged lens. The first image below is the photo taken on auto mode normally. The second one is similar but I used my finger to cover the top of the lens where the light is leaking in. I put my finger as close as possible to the lens without having it show up in the image. As you can see, the second photo came out much better, without any sunlight leaking in from the top. As a result, the colors are so much better in the second image compared to the first. Is this a problem with my lens, my photography skills, or is it something else?

Someone mentioned that "veiling glare" or "veiling flare" was to blame for reduced contrast in a photo. What does this mean exactly?  What causes veiling glare, and how can it be avoided? How does it relate to those floating polygonal lens flares one often sees in movies?


This is essentially an expansion on my earlier problem () to which I have found a fix, but not really a solution. I made a document using a header file which I called in my main document with \include{chem-hdr}. Here is what this file looks like: % LaTeX header file for chemistry  % Packages \usepackage{chemfig} \usepackage[version=4]{mhchem} \usepackage{siunitx}  % Chemfig settings \setchemfig{atom sep=2em}  % Print atoms with a sans-serif font \renewcommand*\printatom[1]{%     \ensuremath{\mathsf{#1}}% }  This would cause any curly arrows to be placed beside my reaction scheme, instead of inside. In this incomplete reaction scheme, the arrow should be on the aldehyde.  Now with the background covered here's my actual problem: In my earlier question, I did not specify that I used a header file; instead, I just pasted the header-file code into the MWE. I assumed this would make no difference. But it does! Replacing the \include{chem-hdr} line in my preamble with the actual code in the file makes everything work as expected. Would anyone happen to know why? Thanks all.

There are two different commands to incorporate another file into the source of some document, \input and \include. When should I use one or the other? What are the differences between them? Are there more things like them to be aware of?


Sorry maybe this question already answered. In latex i want to generate table and i'm new in table. I found some cool online tool  i draw my table now i paste to my latex code but it breaks my paper width. Then i google it and find some suggest they suggest \usepackage{tabularx} but i can't figure this out here is my code   \begin{table}[] \begin{tabular}{|l|c|c|l|} \hline \multicolumn{1}{|c|}{Авбал зохих нийт оноо}                                                                        & \multicolumn{1}{l|}{15 оноо} & \multicolumn{1}{l|}{} &                                       \\ \hline  & \multicolumn{1}{l|}{}        & \multicolumn{1}{l|}{} &                                       \\ \hline \multicolumn{1}{|c|}{Гүйцэтгэлийн шалгуур}                                                                      & Үнэлгээний эзлэх хувь        & CLOs хамаарал         &  \multicolumn{1}{c|}{Багшийн үнэлгээ} \\ \hline Хичээлийн ирц/оролцоо                                                                                & 10\%                         & 7,8                   &                                       \\ \hline Хэмжүүрийн тоног төхөөрөмж, програм хангамж ашиглах                                                         & 20\%                         & 7                     &                                       \\ \hline \begin{tabular}[c]{@{}l@{}}Лабораторийн заавар, дарааллын дагуу  хэмжилт, симуляци\\ гүйцэтгэх\end{tabular} & 20\%                          & 8                     &                                      \\  \hline Хэмжилт, туршилт, симуляцийн үр дүнг тохирох аргаар боловсруулах                                            & 30\%                         & 9                     &                                       \\ \hline Лабораторийн тайлан бичилт, хамгаалалт                                                                      & 10\% + 10\%                  & 10                    &                                       \\ \hline \multicolumn{1}{|c|}{Нийт үнэлгээ / хувиар/}                                                                & \multicolumn{1}{l|}{}        & \multicolumn{1}{l|}{} &                                       \\ \hline \multicolumn{1}{|c|}{Нийт үнэлгээ /оноогоор/}                                                               & \multicolumn{1}{l|}{}        & \multicolumn{1}{l|}{} &                                       \\ \hline \end{tabular} \end{table}   i want this table width equals my page width. can you help me sorry for bad english

I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist?


So, I've just bought a new Laptop with an i7-1065G7 CPU, which runs at a base clock speed of 1.3 GHz and is able to go up to 3.9 GHz when turbo-boosting. 1 TB SSD, 16 GB RAM, good integrated and discrete graphics, feels nice, looks nice. BUT... it is too loud, and I haven't even done anything with it yet. Whenever the CPU goes beyond 3 GHz the fan is just screaming. I don't think I can work with this for the next four to five years. Right now my only hope is that I can somehow limit the GHz count when the CPU goes into Turbo mode, though I'm not sure how to do that. I'd also appreciate any alternative solutions.

I have a Lenovo T480 with an Intel i7-8650U, which has the notorious problem of dropping itself down to 400 MHz whenever it feels like it, due to power limits.  For example, even opening an application that uses the Nvidia GPU (before it even fully loads) causes the machine to throttle down and the fan to slow or stop.  Intel Extreme Tuning Utility shows power limiting.  Adjusting the power limits lower in XTU doesn't actually help anything.  Neither does limiting the CPU usage to as low as 25% in the Windows Power Settings.  (The CPU never goes above 25%, but it still clocks way up to 3.8 GHz.)  I have outright disabled using the Nvidia GPU and instead stick to the Intel graphics, which helps but doesn't totally resolve the problem.  This is a system power limit of some kind.  Naturally, I'd rather use my computer at a slower speed for longer, than suddenly landing at 400 MHz.  It takes minutes for the Windows start menu to appear when I'm throttled at 400 MHz.  While I can't disable TurboBoost with XTU, I found that I could disable it with ThrottleStop.  With TurboBoost disabled, my CPU never goes above 1.9 GHz.  It also never goes lower.  No power throttling!  I can use my computer all day.  The down side of this is that when I'm doing normal things with spikey loads like web browsing, it would be nice if I could let that CPU go a bit faster.  It doesn't need to go all the way to 3.8 GHz though.  Is there any way to limit the CPU clock speed while in TurboBoost?


I bought a new HP Notebook with an NVIDIA RTX2060 graphics card and I would like to install the proprietary graphics driver. I cannot install it from Additional Drivers,  because it does not find any available drivers.  So I installed it with the .run file from NVIDIA (version 430). I did the Installation in tty1.  After the installation, I cannot login. Ubuntu asks me for my password in a loop. After I enter my password, a black screen appears and then I it asks me to enter it again.  What can I do?

My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back.   I've read that the problem might be caused by an error depending on the graphics, here's my graphics card: ATI Radeon 7670M


I am trying to change the 'arrowup' icon replacing with 'up' icon. Is there any way to do the same? I have been able to override CSS of this datatable component in various places, but changing the icon is taking a lot of time. Any suggestions will be quite helpful.

How can I change the colors of lightning-button?  I tried doing this in my css:  .my-button {     background-color: #14a6bc;     color: #ffffff; }   and applying that class to my <lightning-button> and removing the variant but I still get the base colors? I am trying to use these examples:


I have quite a large csv file (call it file.csv). It looks like this one:  col1,col2,col3,... 1,2,3 1,2,5 ...   So after doing something like this cat file.csv | grep "_some_pattern_" I receive only the output values. Is there a way to append the header (the first line) to the output?   It would be very convenient...

Assuming a simple grep such as:  $ psa aux | grep someApp 1000     11634 51.2  0.1  32824  9112 pts/1    SN+  13:24   7:49 someApp   This provides much information, but as the first line of the ps command is missing there is no context for the info. I would prefer that the first line of ps be shown as well:  $ psa aux | someMagic someApp USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND 1000     11634 51.2  0.1  32824  9112 pts/1    SN+  13:24   7:49 someApp   Of course, I could add a regex to grep specifically for ps:  $ ps aux | grep -E "COMMAND|someApp"   However, I would prefer a more general solution as there are other cases in which I would like to have the first line as well.  Seems like this would be a good use case for .


This question is not the same as the 36 gear post which used a combination of internal hub gears, cogs, and chainrings.  This one is much simpler and much lower cost.  Part of the problem of something like a 1x15 (which doesn't exist) is chain misalignment.  However what about something like this to get 15 progressive gears with good chain alignment?  You have 5 cogs in the back, spanning a 1.75:1 range (28, 24, 21, 18, 16 for example).  However, instead of the typical triple front, have the fronts so they are 2x of the next smaller chainring.  For example, imagine something like 14, 28, and 56 front.  This would be most practical on something like a roadbike.  The 3 front chainrings would be aligned with the innermost, the middle, and the outmost cog.  Crosschaining would be moderate at most so nothing to worry about.  The idea here is you can start with the granny chainring, shift all 5 cogs, then go to the middle chainring and repeat all 5 cogs, then shift to largest chainring and shift all 5 cogs again.  That would give you 15 progressive gears without having to do any fancy interleaved shifting.  There is no way to get duplicate gear ratios here and the change between adjacent gear ratios is a reasonable 15%.  The range (spread) between lowest and highest gear would be 7 which is quite generous (lowest is 14/28 = 0.5 and highest is 56/16 = 3.5).  If someone wanted this biased more towards taller gearing that could easily be done.  So my question is why don't we see gearing like this on bikes when it makes good sense?  Even a child can grasp the simple concept of shifting thru all 5 cogs then go to the next larger chainring and repeat.  This concept can be tweaked to 3x4 for someone who wants wider gaps between gears and fewer gear ratios and to 3x6 for someone who wants narrower gear spacing and more gears (18 vs 15 vs 12 gears total).  If a 56 tooth front chainring is too large, we can go with 13, 26, and 52 instead and adjust the rear cogs to 26, 23, 20, 17, 15.  I think it would be fun to make a bike like this but I think the problem is the FD wont be able to handle that much difference in tooth ranges but if that is the only limiting factor, then perhaps a 2x5 or even a 2x6 with this same concept.  That would have a spread of about 4 which is good enough for a roadbike.  I actually checked this technique with my bike and if I change my granny chainring to 22 and keep my 42 large, it will work fine cuz when I shift from small/small, I don't then go to large/large cuz of the MegaRange gear I may eventually have.  I am actually temped to try it.  It would give me 13 progressive gears which beats a 1x11 in several ways.  1x11 has its advantages but well chosen sprockets in a 2x7 setup can beat it in other ways.  Changing my $100 bike to a 2x7 is much more cost effective than going to a 1x11 and I will have more range too.  Actually there is $0 cost if I just shift over the middle chainring (skipping it entirely but just using it as a "ramp" between the smallest and largest chainrings.

I had an idea.  Why not space gears on a bike the same as musical notes?  For example, in music, if you start on a certain note (let's say C3), you need to go up 12 more half steps (notes) to get to C4, an octave above C3.  The frequency of C4 vs. C3 is exactly double.  The notes are spaced with intervals of 2 ^ (1/12) which is about 1.06. So for a 12 speed bike, you would have 12 closely spaced gears which you could shift individually if you need close ratio or in pairs if you want more normal 12% spacing.  When you run thru all those gears you could then flick a doubler gear (maybe located in the bottom bracket) that then doubles all the ratios and then you repeat all of those 12 gears again in order.  There would also be a doubler gear in the hub.  So for example, in the low mode, you can have gears 0.50 to 0.94  Engage one doubler (either one) and you get 1.00 to 1.92, engage both doublers and you get 2.00 to 3.84.  Notice there is no overlap in the gears.  you will basically have a progressive 36 speed with the option to shift 2 gears at a time (skipping gears) if you want 12% between gears and thus making it a progressive 18 speed.  More likely is you would pick a range (low, med, or high) and use it as a close ratio 12 speed.  You could even use it as a super wide range (4:1) 3 speed.  Just pick a middle cog for example with the halving gear enabled, spin that out then disable it, thus doubling your gear.  After spinning that out actuate the doubler gear and you can go fast.  You can control the overall range by changing the single front sprocket.  For example, 36T could start you out at 0.50 in the low gear but maxes out at 3.84.  If you prefer taller you could run a 45T so you start out at 0.625:1 and top out at 5.00:1. (135 gear inches on a 27" diameter tire).  Also since the gear changes between the 3 ranges are from one end of the shifter (12) to the other (1), you can just twist the shifter quickly, eliminating the need for a precision shift like in a 3x9 progressive shift attempt where you have to "bounce" between chainrings and cogs.  So here is my 1st attempt at getting close to 6% between gears using cogs:  36, 34, 32, 30, 29, 27, 25, 24, 23, 21, 20, 19.  I know for me, I would spend a lot of time in the middle range (1.00 to 1.92) and would love to have the close ratios for when I get a headwind.  What sometimes happens is I would shift from a 16T cog to an 18T but what I really needed is a 17T.  Well my new gearing system would handle that cuz you can shift from a 32T to 34T which is same as going from 16T to 17T as far as gear ratio.  So is this a good enough idea for someone to build this bike?  What would be the drawbacks of it?  Might the efficiency go down significantly with the triple gear setup or should it be ok?  Note that on motorcycles, only about 85% of the power of the engine makes it to the rear wheel so I would think if a bike is 85% or better that is acceptable with 90+% being a target.  Correction:  one will be a halving gear and the other would be a doubling gear.  With both disabled (bypassed), the bike would be in the midrange gears (1.00 to 1.92 for example).  Front sprocket would be size 36T to get midrange to start out at 1.00 (36/36) but of course roadies can adjust larger such as 45T and mountain bikers can adjust lower such as 32T or even 30T.  Extreme hill climbers that want a 7.5" gear (27" diameter tires) would need a 0.278:1 low gear which can be had by replacing the 36T front sprocket with a 20T.  Even with that ultra low first gear, shifting to the highest gear would give about 60 gear inches which is good enough for cruising around.


I believe the main protagonist’s name is Falconer. A human spaceship crashlands on a planet where  conditions are inimical to human life - including a hostile sentient native species. So the humans build a large enclosure for themselves and undergo induced mutations so each succeeding generation is better adjusted to conditions on the planet than the last until finally the last generation is ready to step out of the enclosure.

I am looking for a short story and anthology / anthologies containing it: A multi generation ship has landed on a planet with very hostile inhabitants on it. The aliens are chipping away at the hull of the ship with primitive instruments.   The leaders of the space ship decide to breed aggressive children to counter the aliens. They know that this is suicidal as the children will be so aggressive that they will kill the parental generation.   I think I read this in an anthology in early 80's / late 70's. Most likely published in 70's.


I have two lists:   A =  ["a", "b", "c"] B = ["H", "N"]   How to append values from second list to first, if I need to get this:  C = [["a","H"], ["a","N"], ["b", "H"], ["b", "N"], ["c", "H"], ["c", "N"]]

How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]


Hi I have a requirement in which i need to add a new key value pair in the JSON response, with the help of the for loop, kindly help me out for this below is my JSON: [       {          "asdf":"",          "fdrtf":"869966",          "hdhfhfh":"utytut",          "Cat":"A",          "hghg":"jguyhj",          "hfj":"Resolved",          "hghgjg":"",          "hgfjf":"",          "jghjf":"",          "hgjfhfj":"",          "contraName":""       },       {          "hjhj":"",          "hfhfhf":"h",          "hhfh":"hfjfhdj",          "cat":"B",          "jghgj":"jhgjgk",          "hgjfjf":"jghjg",          "hgjgugj":"",          "jghfj":"",          "jghgj":"",          "gjghfj":"",          "hgjgh":""       }     ]   i am trying to add a new key value pair like : -- "ASD":"1" in the first row and "ASD":"2" in the second row by the help of for loop in my jS file ,, kindly help me out for this. below is the method i tried: addvalue(data) {         for (let i = 0; i < data.length; i++) {            data[i].ASD = `[i]`;         }              }

I am trying to add key value pair in the below JSON object, but it is getting added in the wrong way, is there any way i can add to each object a new  key value pair, that will help me to complete the req. JSON as follow : var object =[       {          "asdf":"",          "fdrtf":"869966",          "hdhfhfh":"utytut",          "Cat":"A"                 },       {          "hjhj":"",          "hfhfhf":"h",          "hhfh":"hfjfhdj",          "cat":"B"                 },       {          "hjhj":"",          "hfhfhf":"h",          "hhfh":"hfjfhdj",          "cat":"B"       } ]  code i am using to add the new key value pair : for (let i = 0; i < object.length; i++) {             object[i]['ABC'] = [i];         }  Actually expected should be: var object =[       {          "asdf":"",          "fdrtf":"869966",          "hdhfhfh":"utytut",          "Cat":"A",          "ABC": "0"                 },       {          "hjhj":"",          "hfhfhf":"h",          "hhfh":"hfjfhdj",          "cat":"B",          "ABC": "1"                 },       {          "hjhj":"",          "hfhfhf":"h",          "hhfh":"hfjfhdj",          "cat":"B"          "ABC": "2"       } ]  the final value i am getting as below: ["0":{          "hjhj":"",          "hfhfhf":"h",          "hhfh":"hfjfhdj",          "cat":"B",           },    "1":{          "asdf":"",          "fdrtf":"869966",          "hdhfhfh":"utytut",          "Cat":"A"              },    "2":{        "hjhj":"",          "hfhfhf":"h",          "hhfh":"hfjfhdj",          "cat":"B"    }   ]  kindly someone help me out to achieve this


I am trying to do add values after a specific node.Each task should add a value from a given list by index.  For example: the list contains 2 numbers {1,10} i want to add 6 values after the 10, so it will look like {1,10,11,12,13,14,15,16}. The problem is that it adds the last value N amount of times and the result is {1,10,16,16,16,16,16,16}.  static async Task<LinkedList<int>> ParrallelInsertion(List<int> values, LinkedList<int> list)     {         var tasks = new List<Task>();          for (int i = 0; i < values.Count-1; i++)         {             tasks.Add(Task.Run(                 () =>                 {                     lock (list)                     {                         var node = list.Find(10);                         if (node == null)                         {                             list.AddLast(values[i]);                         }                         else                         {                             list.AddAfter(node, values[i]);                         }                     }                 }                 ));         }          await Task.WhenAll(tasks);         return list;     }

I met an interesting issue about C#. I have code like below.  List<Func<int>> actions = new List<Func<int>>();  int variable = 0; while (variable < 5) {     actions.Add(() => variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable?


Does it need to fly forward? Or just need to fly to keep at the same position as usual?

I got this micro helicopter to play with, you know that cheap double bladed ones you can find for $25 or so. Anyway last night I was on bed trying to sleep and I got this idea, what if we put the helicopter inside a box and then seal the box, then we hover the helicopter inside the box. While the helicopter is hovering what will happen if we move the box left and right or up and down? will the helicopter move with the box without me controlling it so it's position will be relative to the box? or will it keep the position relative to the room and the box will move until it hits the blades? and why?  Sorry if this question is not about physics, physics was never my favorite and please if this is answerable here try to provide a "for dummies" answer :)  UPDATE: I just remembered something, when we are in a plane, we move with the plane! so logic says the helicopter will move with the box, correct?    Please excuse my MS Paint skills.


Suppose two coins $C_1$ and $C_2$ are tossed and suppose further that $C_1$ was tossed $40$ times and $C_2$ only $20$ times. The outcome for $C_1$ is $8$ times heads and $32$ times tails. For $C_2$ we have once head and $19$ times tails. My question is, what test do I use in order to try to show that the probabilities for having heads are significantly different for $C_1$ and $C_2$?  In addition I'd be interested if anyone could explain the following confusion to me. If I estimate the probability for heads of $C_1$ by $p_1=1/5$ then the probability of the outcome of $C_2$ under the hypothesis that the probability is $1/5$ as well equals $$ \binom{20}{1}\frac{1}{5}\left(\frac{4}{5}\right)^{19}\approx 5.7\% $$ which is not significant (I would like to have a significance level of $<5\%$). On the other hand If I reverse the situation I obtain for the probability of the outcome of $C_1$ assuming a probability for heads of $p_2=1/20$ $$ \binom{40}{8}\frac{1}{20^8}\left(\frac{19}{20}\right)^{32}\approx 0.06\% $$ which is by far smaller than $5\%$. So one test tells me the probabilities are significantly different, while the other doesn't (this is the source of confusion) but in fact I would just like to know how I can tell that $p_1\ne p_2$ significantly.

I am using a chi-sq test between two proportions (). I am using this over the z-test for proportions because I do not think my data is normal.   My question is how do I get the difference (shift) estimate & confidence intervals for this test.   For example,     Data1: 193/252=.77   Data2: 154/227=.68   P-value=.032 (I used the formula in the link above. I will also add my exact code below)  Shift Estimate: I assume its the difference between proportions, ie .77-.68=.09. Is this correct?   Confidence Interval: ??????????????????  Code for generating P-value (matlab):   % Pooled estimate of proportion  p0 = (n1+n2) / (N1+N2); % Expected counts under H0 (null hypothesis)  n10 = N1 * p0;  n20 = N2 * p0; % Chi-square test, by hand  observed = [n1 N1-n1 n2 N2-n2];  expected = [n10 N1-n10 n20 N2-n20];  chi2stat = sum((observed-expected).^2 ./ expected);  p = 1 - chi2cdf(chi2stat,1);  H=0; if(p<.05), H=1; end


I can't seem to find any examples on the internet for this particular task.

I want to kill all running processes of a particular user from either a shell script or native code on a Linux system.  Do I have to read the /proc directory and look for these?  Any ideas? Is there a dynamic mapping of the pids under UIDs in Linux? Isn't this in the proc?  If not, then where is this list maintained? Should I read from it? Also where is the static list of all UIDs in the system so I can validate this this user exists and then proceed to kill all processes running under it?


I'm wanting to mix archetypes (traditions) for my monk. I'm wanting specifically the 3rd and 17th level feats from Way of the Open Fist and the 6th and 11th level feats from the Way of the Shadows. I know we can't multiclass into the same class to gain both but in the PHB page 79 2nd column "Monastic Traditions" reads "Three traditions of monastic pursuit are in common in the monasteries scattered across the multiverse." I'm fine with that but where I question is "Most monasteries practice one tradition exclusively, but a few honor the three traditions and instruct each monk according to his or her aptitude and interest."   So my question would be can I build a monk that is split like that without homebrewing to much?

Once you've picked a subclass option at level 3, could you later take a different subclass option, or do you lock into a specialty at level 3 and then run with it for the rest of that class' progression?  For example, as a rogue, if you took the "Thief" archetype at level 3, giving you access to Fast Hands and Second Story Work, could you then take the "Assassin" archetype to give you the specific benefits that archetype gives instead of the "Thief" ones?  The  seems to imply that you couldn't:     At 3rd level, you choose an archetype that you emulate in the exercise of your rogue abilities: Thief, detailed at the end of the class description, or one from another source. Your archetype choice grants you features at 3rd level and then again at 9th, 13th, and 17th level.   but I'd like a more certain answer, especially one that refers to archetypes in general. Also I'm not ashamed to admit I'd prefer a source with some authority that tells me you can mix and match, but I am looking for the truth of the rules when all is said and done...   Different to  because the no on that demonstrates that you can't re-take a level of the same class. Taking different features for different levels is not the same thing, and would work differently. Similar to  but that one was specific to monks - which is why it didn't show up on any searches I did, and why it wouldn't on the searches of others. This question is specific enough to be clear and precise, but broad enough to be useful to others who aren't in the exact same situation/using the same class.


This question was asked in a masters exam for which I was preparing and I had hard time solving it and still unable to do it.  Let $f (x)= x^7  - 105 x +12$ then   $f (x)$ is reducible over $ \mathbb {Q} $  There exists an integer $m$ such that $f (m)=105$  There exists an integer $m$ such that $f (m)=2$  $f (m)$ is not a prime number for any integer  $m$   I proved 1 wrong using Eisenstein criteria . But for proving or contradicting 2,3,4 there hasn't been significant progress. I tried putting integers for d. Kindly tell how to approach these.

Let $f (x)= x^7  - 105 x +12$ then  $f (x)$ is reducible over $ \mathbb {Q} $  There exists an integer $m$ such that $f (m)=105$  There exists an integer $m$ such that $f (m)=2$  $f (m)$ is not a prime number for any integer  $m$    By Eisenstein 1 option is false.  For option 2, if  possible  let  there  be   an   integer   such   that   $f (m)=105$   then $ m^7  - 105 m +12= 105$ implies $ m^7  -105 m -93=0$,  $m$ can be  $1, -1, 3, -3, 31, -31, 93, -93$  so clearly  option 2  is  false   and  in a  similar  way  option   3   is  also false. I   have  no  idea  about   option  4. So my request  is  to check  whether  my reasoning  of  option 1, 2  and  3  are alright  and   to give  me  a  hint  for   option  4. Thank you in advance.


I have been accepted for postdoc position at university A. In the meanwhile, I applied for postdoc in university B, and I am waiting to hear from them.  I would like to write a follow-up email to my potential mentor at university B asking about the decision of their committee, because I need to finalize my decision about the job at university A. How can I express my situation in a polite email to university B?

I will graduate soon from the doctoral program. I will apply for multiple postdoc positions. The results of the one that I really think is great for my career will be probably announced later than the others. If I accept an earlier offer, and later learn that I could also get the one I desire the most, then I will really regret. However, I don't want to risk by refusing an early offer, since at the end I may get nothing.  Do you have any recommendations for such situations? Have you ever experienced this dilemma? How did you manage it?


Find the integers $n$ and $m$ that satisfy this equation:  $$ n^2-m^2=28 $$  I tried to use ideas of diophantine equations, but it goes to something too complicated for something found in a textbook.

We have to find the integers $m$ and $n$ which will satisfy the given condition: $$m^2-n^2=1111.$$  What could be the answer and how? i tried using trial and error and that took a long time.


I am making a simple thing to use my php knowledge and learn it and its working so far but i run into a problem when ever the string has ' in it. I get why it's doing it and i know there are ways to do it but i can't find a specific answer to this question.   <?php if (isset($_POST['submit'])){     $title = $_POST['title'];     $text = $_POST['text'];     $connection = mysqli_connect('localhost','root','','blog');     if (strpos($text,"\'") !== false){         str_replace("\'","\'",$text);     }     $query = "INSERT INTO `posts`(`title`, `text`) VALUES ('".$title."', '".$text."')";     $result = mysqli_query($connection,$query);     if (!$result){         die("error" . mysqli_error($connection));     } else {         header("Location:http://localhost/blog-testing/");         die();     } }   How can i make it automatically find ' and fix it so it doesn't mess up the string?

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


I want to install the program ImageJ from the Ubuntu repositories (mainly because it's easier than compiling the code from source), but I need to add a few plugins to the basic installation.  I would like to know where would the program be installed (physically, like the directory path on my computer) so that I can manually add the plugins. Does anybody knows what it is?  Thank you very much!

Under Windows, most applications and application data are stored in a special directory known as C:\Program Files (and occasionally C:\Program Files (x86)). What is the Ubuntu/Linux equivalent to this path? Is there even one?


Hello I need to update the field type of one of my content types. The content type is of a module so I need to do this with the Drupal API for let users update the module for their 7.x-1.0 branch.  This is the hook for update the field, I need to change it from Integer to Decimal like this:   /**  * Change field_inq_description field from Integer to Decimal  */ function field_updates_update_7100() {   // Manual database changes.   db_query("UPDATE {field_config} SET type = 'number_decimal' WHERE field_name = 'field_rin'");   db_change_field('field_data_field_rin', 'field_rin_value', 'field_rin_value', array(     'type' => 'numeric',     'precision' => '10',     'scale' => '2',   ));   db_change_field('field_revision_field_rin', 'field_rin_value', 'field_rin_value', array(     'type' => 'numeric',     'precision' => '10',     'scale' => '2',   ));   // Clear caches.   field_cache_clear(TRUE);   // Apply the new field instance configuration. }   After I apply the update with update.php script I get these notices everywhere in the test website.  Notice: Undefined index: precision in number_field_schema() (line 35 of /home/servilla/public_html/servillantasgiraldo.com.co/modules/field/modules/number/number.install). Notice: Undefined index: scale in number_field_schema() (line 36 of /home/servilla/public_html/servillantasgiraldo.com.co/modules/field/modules/number/number.install).   What Im I doing wrong?

I have a content type with an integer content field. The field needs to contain float data. What's the easiest way to change the field type from integer to decimal? (There are thousands of existing nodes I will have to convert).     I've found a solution in  and . Is it the best?


Hello I'm trying to create a generic repository pattern class that uses 2 generics in its implementation. The entity type itself (TEntity) and the key/identifier type (TKey).  Problem occurs whenever I try to check for equality of TKey's.  Error: Operator '==' cannot be applied to operands of type 'TKey' and 'TKey'.  Entity.cs  public class Entity<TKey> where TKey : struct, IComparable, IFormattable, IConvertible, IComparable<TKey>, IEquatable<TKey> {     public TKey Id { get; set; } }   IRepository.cs  public interface IRepository<TEntity, in TKey> : IDisposable          where TEntity : Entity<TKey>          where TKey : struct, IComparable, IFormattable, IConvertible, IComparable<TKey>, IEquatable<TKey>     {         /// <summary>         /// Get the <typeparamref name="TEntity"/> by id.         /// </summary>         /// <returns>The entity.</returns>         /// <param name="id">Identifier.</param>         TEntity Get(TKey id);     }   Repository.cs  public class NoSQLRepository<TEntity, TKey> : IRepository<TEntity, TKey>          where TEntity : Entity<TKey>          where TKey : struct, IComparable, IFormattable, IConvertible, IComparable<TKey>, IEquatable<TKey>     {             public TEntity Get(TKey id)         {             // error occurs in the line below.             return _context.Get<TEntity>(typeof(TEntity).Name).Find(entity => entity.Id == id).FirstOrDefault();         }     }   This being said, I need my TKey generic to not be constrained to a class. I rather use primitive types (i.e Int).  Can this be achieved or am I doing something wrong ?

According to the documentation of the == operator in ,      For predefined value types, the   equality operator (==) returns true if   the values of its operands are equal,   false otherwise. For reference types   other than string, == returns true if   its two operands refer to the same   object. For the string type, ==   compares the values of the strings.   User-defined value types can overload   the == operator (see operator). So can   user-defined reference types, although   by default == behaves as described   above for both predefined and   user-defined reference types.   So why does this code snippet fail to compile?  bool Compare<T>(T x, T y) { return x == y; }   I get the error Operator '==' cannot be applied to operands of type 'T' and 'T'. I wonder why, since as far as I understand the == operator is predefined for all types?  Edit: Thanks, everybody. I didn't notice at first that the statement was about reference types only. I also thought that bit-by-bit comparison is provided for all value types, which I now know is not correct.  But, in case I'm using a reference type, would the == operator use the predefined reference comparison, or would it use the overloaded version of the operator if a type defined one?  Edit 2: Through trial and error, we learned that the == operator will use the predefined reference comparison when using an unrestricted generic type. Actually, the compiler will use the best method it can find for the restricted type argument, but will look no further. For example, the code below will always print true, even when Test.test<B>(new B(), new B()) is called:  class A { public static bool operator==(A x, A y) { return true; } } class B : A { public static bool operator==(B x, B y) { return false; } } class Test { void test<T>(T a, T b) where T : A { Console.WriteLine(a == b); } }


I have been looking for the cross product symbol in latex, but haven't found any yet. Any help would be appreciated!

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


i am learning on TextSuggestion leson with AndroidStudio. Here's my code :  activity_main.xml  <?xml version="1.0" encoding="utf-8"?> <LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     tools:context="com.zihadrizkyef.belajar_textsuggestion.MainActivity"     android:id="@+id/activity_main"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     android:padding="16dp">      <EditText         android:id="@+id/etText"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_marginBottom="30dp"         android:hint="Enter Text"/>      <TextView         android:id="@+id/tvSuggestion"         android:layout_height="wrap_content"         android:layout_width="match_parent"         android:layout_marginBottom="5dp"         android:hint="Suggestion"/>      <Button         android:id="@+id/btSuggestion"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:hint="Suggestion"/>  </LinearLayout>   MainActivity.java  package com.zihadrizkyef.belajar_textsuggestion;  import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.textservice.SentenceSuggestionsInfo; import android.view.textservice.SpellCheckerSession; import android.view.textservice.SuggestionsInfo; import android.view.textservice.TextInfo; import android.view.textservice.TextServicesManager; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast;  public class MainActivity extends AppCompatActivity implements SpellCheckerSession.SpellCheckerSessionListener {     EditText etText;     TextView tvSuggestion;     Button btSuggestion;     SpellCheckerSession scs;      @Override     protected void onCreate(@Nullable Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);          TextServicesManager tsm = (TextServicesManager)getSystemService(TEXT_SERVICES_MANAGER_SERVICE);         scs = tsm.newSpellCheckerSession(null, null, this, true);          etText = (EditText)findViewById(R.id.etText);         tvSuggestion = (TextView)findViewById(R.id.tvSuggestion);         btSuggestion = (Button)findViewById(R.id.btSuggestion);          btSuggestion.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 TextInfo[] ti = new TextInfo[1];                 ti[0] = new TextInfo(etText.getText().toString());                  scs.getSentenceSuggestions(ti, 3);             }         });     }      @Override     public void onGetSuggestions(SuggestionsInfo[] results) {      }      @Override     public void onGetSentenceSuggestions(SentenceSuggestionsInfo[] results) {         System.out.println(results.length);     } }   I tried to put "A" on edit text then clicked the suggestion button. But it always throws null pointer exception. I've try search about it on google and here but not found any article talking about this problem  ---EDIT---  Of course my post different with  question. Mine asking about SpellCheckerSession.getSentenceSuggestion that throws null, and  question asking about "what is null exception pointer".

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 can I disable the automatic locking on idle mechanism in Windows 8? I have tried:   Disabling screen saver and screen saver "lock on resume" --> done Disable lock on wake in power options --> done   I still cannot find a solution - it seems to lock after some period of inactivity.  Edit:  This is NOT A DUPLICATE - the answer and question marked as duplicate are both unrelated to the question. The question is to disable auto-lock not to disable the screen before the password entry.

So I took a plunge and installed Windows 8 Consumer Preview on my main home PC. So far so good, but there is one annoyance - the system "locks" the computer after a period of inactivity causing me to re-enter my password.  I really would like to avoid this, but have no idea how. I already tried the power settings (no pass on wake up) and the screen saver settings with no luck. Is this some sort of bug, or am I missing something?  P.S. In this case I favor convenience over security.


I am new to GIS, so forgive me. I have set up a project using Open Street Map as my background, I have set the CRS to ESPG:27700 British National Grid, however the status bar is not displaying the coordinates correctly, and still says 000,000 is located on the intersection of Greenwich meridian and the equator...any thought how to resolve this?

I've been working with loads of shapefiles projected according to OSGB 1936 (CRS 27700). The project CRS is set to EPSG:27700 and "On the fly reprojection" to EPSG:27700 is set (I keep this as a default as I work with OSGB 1936 95% of my time).  I decided to download OSM layers from the OpenLayers plugin. When I load this, the EPSG in the bottom right of the screen goes from EPSG:27700 to EPSG:3857   Question 1: should this be happening anyway as it would suggest that the whole project has been re-projected to EPSG:3857?   As soon as the OSM layer is loaded it's way out of alignment but a quick pan seems to bring it altogether quiet nicely.   What I have noted is that (Question 2), if I try to re-specify the CRS to 27700, then the shapefiles "move" by a few tens of meters with respect to the OSM. Does this suggest that QGIS is doing a second re-projection (from what to what?)?   Also (Question 3), does it mean that if I import another shapefile that would be originally a dataset digitised with EPSG:27700 it would be re-projected to EPSG:3857 because the CRS in the bottom right of the screen was set to EPSG:3857 after the OSM import. This is all a bit confusing and logic would suggest that the import of a non-ESPG:27700 (project default CRS) should not go and change the EPSG setting in the bottom right of the screen. Anita Graser's book says on page 34 "Your project CRS will automatically be changed to Pseudo Mercator when you load a background map using the OpenLayers plugin option".   Does that mean there is no way of keeping ESPG:27700 active in the project when importing basemaps from OpenLayers? If so, what alternatives are there?  What I am trying to bottom out is to understand the correct way of importing basemaps (usually Google, Bing or OSM through the OpenLayers plugin) into my projects (always EPSG:27700) without losing alignment and getting layers to correctly re-project. I'm trying to support greater use of QGIS in my company but don't want to lose credibility by promoting the use of a tool that is misaligning datasets. Don't get me wrong. QGIS is a great tool and I am very fond of it but importing layers with different CRS's is quite common these days and getting this right from the start is half the job done.  I did quite an extensive Google search before posting and didn't come up with a recent, clear cut answer to my questions above. There is a bit of content out there on problems with older versions of QGIS, PROJ4, etc. but nothing recent for QGIS 2.0 so worth an update.


My question is: If the bar magnet is moved towards a coil connected to a galvanometer and instead of a opposing magnetic pole a attractive pole i.e. south of coil and north of magnet is created due to induced emf in coil then how is Conservation of energy violated/ perpetual motion body created? Isn't it similar of having two bar magnets with attractive poles ?

When we bring opposite poles of two magnets together, they attract each other (or vice versa). Now, we can say that the kinetic energy gained by the magnets is due to the attractive force.  Similarly, we say in Lenz's law that if the north pole of magnet is moved towards a solenoid (for example) then the north of the magnetic field produced by the induced current will be towards the north of the magnet to oppose the change in magnetic flux.  The explanation we give for the above (2nd paragraph) phenomena is the law of conservation of energy. Now, suppose that the opposition is not offered in the above phenomena and the south of the magnetic field produced by the induced current is towards the north pole of magnet. The motion of the magnet will be enhanced in this case and the magnitude of change of magnetic flux will increase. This is said to be the violation of law of conservation of energy. My question is that why is this violation of energy? if two opposite poles of magnet can attract each other why not the south of magnetic field of induced current and north of the magnet?  I know its a complicated question but that's is the best i could do with it. I will appreciate if anyone could edit it to make it better but don't change the question.


The order of a group $G$ is $pq$ where $p$ and $q$ are both prime. Show that all proper subgroups of $G$ are cyclic. I need help with this. I know that all the orders of subgroups divide the order of the larger group, but I do not know where to go from there.

Let G be a group with |G| = pq. (p and q are both prime).  How can we prove that every proper subgroup of G is cyclic?


which kind of font has been used in this picture?     I want to sart my sentences with this font ,

Is it possible to identify the font used in a specific document/picture?  Answers to this question should identify:   Possible methods to do this (perhaps one answer per method) and adequately describe how to use it (as opposed to merely stating it); Ways of finding the identified fonts, if possible (free or not); and Any prerequisites associated with the method used, if required (for example, "In order to use method X, your document has to be in format Y").   This question is meant as an FAQ, based on an . Its aim is to facilitate the community with the general procedures involved in font identification. Similar cases are solved on a per-usage basis on 's  tag.


Should I use an interrogation mark in the following examples?     Did you know that…?      ...in Finland, there is only 1 mandatory test, PISA, taken when children are 16 ?      ...in Brazil an estimated one-quarter of children do not attend school?      ...in the sub-Saharan, 11.07 million children leave school before finishing their primary         education ? In South and West Asia, that number reaches 13.54 million .      ...in Cambodia, only an estimate of 45% of the students finishes elementary school ?

If one wishes to pose a series of questions in the form of a list, how would one go about punctuating that list?  For example:  I write to a colleague asking for an update on a project he is working on. I phrase my request like so:     Dear xxx,      How are you doing with regard to:     - Sourcing the moose hair    - Reticulating the splines    - Extolling the virtues of silk underwear    - Estimating the project completion time   In this case, should question marks be placed after each bulleted item? Or should one only be placed after the last item? If this is the case, should semi colons be placed after each item?  E.g.        Extolling the virtues of silk underwear?     Estimating the project completion time?      or        Extolling the virtues of silk underwear;     Estimating the project completion time?


(This question is NOT about Macbook Pro keyboards. It is about an Apple Wireless Keyboard)  I'm using an old Apple Wireless Keyboard (can't find model number - it's the white and clear plastic model).  Yesterday the SHIFT-P (capital 'P') functionality suddenly stopped working. I didn't spill anything or otherwise mess with the keyboard (that I am aware of).  The "p" key works fine but in order to type a capital 'P', I need to set the caps lock. I looked at the 'keyboard viewer' and SHIFT-P doesn't trigger an event. No other keys appear to be affected.  Anyone seen this before?  UPDATE ok, so it's the left SHIFT key which is failing with the letter "P" but the right SHIFT key works fine with it. Weird. I understand total hardware failure but why would the left SHIFT key only fail with the letter "P"?  (the irony here: I am using the wireless keyboard because my MacBook Pro laptop battery swelled up and knocked out the Y, U, I, O keys. I replaced the battery but that didn't fix the keyboard issue)

This is an attempt to write a canonical QA for this issue, as per the Meta post:   I expect it to be periodically edited with the goal of becoming a comprehensive information resource.  I have a MacBook Pro that has a key(Shift, Return,   Command, P, etc.) that doesn’t respond when pressed or is stuck in the down position.    It's possible that my favorite beverage was spilled (or some other liquid damage).  It's also possible that I have no idea what happened.  It was working yesterday and suddenly today it's no longer working.  Is there any way to bypass or remap the key?  Can I  have the system ignore it completely?  (This question can also apply to external USB keyboards or the Bluetooth keyboards)


Marking a method parameter as final is needed to allow for variable access by inner anonymous classes and is a useful coding-tool for enforcing certain variable use conventions within the method.  Apart from that, is there some other compilation-related motivation to use the final-keyword? Specifically, does it give the compiler any hints which facilitate some specific optimization that would otherwise not be performed? Or is the compiler smart enough to always recognize if a variable is never modified anyways?  For example, I'm thinking whether there is any difference how the variables are passed into the method. E.g. a variable of primitive type (int, byte, etc.) needs to be copied when passed into the method to prevent any modifications to trickle out into the calling code, whereas if the parameter is marked final, it could be "passed by reference" without such concerns, i.e. no copy-operation would be needed.  But let's keep the question more general than this example:  Are there scenarios where adding final to a method parameter will change the generated byte-code?

Is there any performance reason to declare method parameters final in Java?  As in:  public void foo(int bar) { ... }   Versus:  public void foo(final int bar) { ... }   Assuming that bar is only read and never modified in foo().


I'm using Samsung Galaxy S5. There is an icon which looks like a house with 2 waves in the notification bar, in between (and slightly above) the 4G and mobile signal strength icons.    Here's the screenshot  Click to enlarge    I only saw it once and never again. I was reading text messages.

There is a strange icon that shows up in my status bar only when I'm at a certain restaurant. It looks like a cross between a house and wifi.   I suspect it might be a free wifi hotspot or something related to a nearby phone store, but I can't find any information about it in manual for my phone.  See the following screenshot:


Using the path defined in bash shell How would i pass the variable to applescript using osascript/applescript? Here's what I have so far.. The path of $FOOD_NUM is subject to change and it must be a variable that I have defined in bash. The "-e open... doesn't seem to like the path. error code 810:815: execution error: The variable input is not defined. (-2753  Thanks!.       FOOD_file=~/Desktop/FOOD/FRUIT/ FOOD_NUM=012345  osascript -e 'tell application "Adobe Photoshop CC 2017"' -e 'open "'$FOOD_file/$FOOD_NUM/apples.psd'"' -e 'end tell'

I have a file with a list of URL's. I need to pass each URL from a bash script to be used in an AppleScript.    while read urls do      osascript -e \     'tell application "Safari"         tell window 1              tell current tab to open location "$urls"         end tell     end tell' done <file.txt   This doesn't work. It passes the literal string $urls as the location to be opened in Safari. How can I pass the bash variable $urls to AppleScript?


We are currently studying Liouville's Theorem and had a few questions which weren't too hard, but I'm kinda struggling with this one. $f$ is entire but $f(z)\notin \left[0,1 \right]$. I tried to play around and prove f is bounded, but nothing seems to work. Would love even a hint :)

If $f:\mathbb{C}\longrightarrow\mathbb{C}$ is an entire function such that $f(z)\neq w$ for all $z\in \mathbb{C}$ and for all $w\in [0,1]\subset \mathbb{R}$, how to prove that $f$ is constant (without using Picard's little theorem).   Any hint would be appreciated.


For a complex inner product space, $X$, Cauchy-Schwarz inequality states $$ | \langle x,y \rangle |^2 \leq \langle x,x\rangle \cdot \langle y, y\rangle , $$ for any $x,y \in X$.  Equality holds if and only if $x$ and $y$ are linearly dependent.  I noticed that this can be restated as: $$ \left|\begin{array}{cc}  \langle v_1, v_1 \rangle & \langle v_1, v_2\rangle \\ \langle v_2, v_1 \rangle & \langle v_2, v_2\rangle \\  \end{array}\right| \geq 0$$  with strict equality if $\{v_i \}$ is linearly independent.  Does this (somehow) generalize for $n$ vectors?  That is, does the following hold:  $$ \left|\begin{array}{cccc}  \langle v_1, v_1 \rangle & \langle v_1, v_2\rangle & \cdots &\langle v_1, v_n \rangle \\ \langle v_2, v_1 \rangle & \langle v_2, v_2\rangle & \cdots &\langle v_2, v_n \rangle \\ \vdots & \vdots & \ddots & \vdots \\ \langle v_n, v_1 \rangle & \langle v_n, v_2\rangle & \cdots &\langle v_n, v_n \rangle  \end{array}\right| \geq 0$$   At the very least, can we prove that the above determinant is non-zero if $\{v_i \}$ is linearly independent?  I came across this working on a functional analysis problem set, but this isn't a homework problem.    EDIT: For those tagging it as a duplicate, I see this as different because this question specifically concerns inequality, and not just proving that the determinant is non-zero if they are linearly independent.  Additionally, this post specifically suggests a connection to Cauchy-Schwarz that isn't mentioned in the other post.    As a commenter (Algebraic) pointed out, this matrix is called the Gram matrix of the vectors $\{v_i\}$; Wikipedia states that this matrix if positive semi-definite, and is positive definite in the case where they are linearly independent.  This proves that the determinant is indeed greater than or equal to zero for arbitrary $\{v_i\}$ and is strictly positive in the case where the $\{v_i\}$ are linearly independent.

Let $V$ be a real inner product space and $S=\{v_1,v_2, \dots, v_n\}\subset V$. How am I to prove that $S$ is linearly independent if and only if the determinant of the matrix $$ a_{ij}=\pmatrix{\langle v_i , v_j \rangle}$$ is nonzero?    Just to be clear, the matrix we're talking about is this one:  $$\pmatrix{\langle v_1,v_1\rangle & \langle v_1,v_2\rangle &\langle v_1,v_3\rangle & \cdots & \langle v_1,v_{n-1}\rangle & \langle v_1, v_n\rangle \\\langle v_2,v_1\rangle & \langle v_2,v_2\rangle &\langle v_2,v_3\rangle & \cdots & \langle v_2,v_{n-1} \rangle & \langle v_2,v_n\rangle \\\langle v_3,v_1\rangle & \langle v_3,v_2\rangle &\langle v_3,v_3\rangle & \cdots & \langle v_3,v_{n-1}\rangle & \langle v_3,v_n \rangle \\ \cdots&\cdots&\cdots&\cdots&\cdots&\cdots\\\langle v_{n-1}, v_1\rangle & \langle v_{n-1},v_2\rangle &\langle v_{n-1},v_3\rangle & \cdots & \langle v_{n-1},v_{n-1}\rangle & \langle v_{n-1},v_n\rangle \\\langle v_n,v_1\rangle & \langle v_n,v_2\rangle &\langle v_n,v_3\rangle & \cdots & \langle v_n,v_{n-1}\rangle & \langle v_n,v_n\rangle \\ }$$    I highly doubt that anybody here has Roman's Advanced Linear Algebra, or maybe you do, but I think on page $261$ there is a small note on something which looks similar.    Should anybody need the code (C++) in their research, here is a gadget which streams LaTeX code to a file named "matrix.txt" for an $n \times n$ matrix such as this with some value for $n$:  ofstream fout; fout.open("matrix.txt");  int n; cout << "Enter your desired n: "; cin >> n;  fout << endl;  fout << "$\\begin{pmatrix}" << endl;  for( int j = 1 ; j <= n ; j++ ) {     for( int i = 1 ; i<= n ; i++ )     {         if( j == i && i == n )         {             fout << "\\langle v_" << j << "," << "v_" << i << " \\rangle" << endl;         }         else         {             if( i == n )             {                 fout << "\\langle v_" << j << "," << "v_" << i << " \\rangle\\\\" << endl;             }             else             {                 fout << "\\langle v_" << j << "," << "v_" << i << " \\rangle&" << endl;             }         }     }     //fout << endl; }  fout << "\\end{pmatrix}$" << endl << endl;   For n equal to 5 you get this result:  $\begin{pmatrix} \langle v_1,v_1 \rangle& \langle v_1,v_2 \rangle& \langle v_1,v_3 \rangle& \langle v_1,v_4 \rangle& \langle v_1,v_5 \rangle\\ \langle v_2,v_1 \rangle& \langle v_2,v_2 \rangle& \langle v_2,v_3 \rangle& \langle v_2,v_4 \rangle& \langle v_2,v_5 \rangle\\ \langle v_3,v_1 \rangle& \langle v_3,v_2 \rangle& \langle v_3,v_3 \rangle& \langle v_3,v_4 \rangle& \langle v_3,v_5 \rangle\\ \langle v_4,v_1 \rangle& \langle v_4,v_2 \rangle& \langle v_4,v_3 \rangle& \langle v_4,v_4 \rangle& \langle v_4,v_5 \rangle\\ \langle v_5,v_1 \rangle& \langle v_5,v_2 \rangle& \langle v_5,v_3 \rangle& \langle v_5,v_4 \rangle& \langle v_5,v_5 \rangle \end{pmatrix}$  As is lengthily explained .


Recently I'm trying to get more familiar with the Comparator interface in Java. I have an exercise which is about to sort the ArrayList of strings from the shortest to longest. I used a Comparator of Strings. When searching the net, I found the following solution proposal:      public static Comparator<String> lengthComparator = new Comparator<String>() {     @Override     public int compare(String a, String b) {         if (a.length() == b.length()) {             return a.compareTo(b);         } else {             return (a.length() > b.length() ? 1 : -1);         }     }  };   Then I used it in my code to sort the set:   Collections.sort(set, lengthComparator);   And it worked. What I'd like to ask is the specific way of defining the lengthComparator object here. We create a new object:   new Comparator<String>()   with the default constructor. But then there is a further code with overwritten method in "{}" brackets. Is it a normal way of creating objects? I've never met it before and I'd like to learn more about it. Could you please advise me some referal materials where I can find more informations about it?

What is the use of anonymous classes in Java? Can we say that usage of anonymous class is one of the advantages of Java?


I looked around and I could not find a solution of my problems in other question. For some reason, then I get segmentation fault when I run my program and it seems to be because i am changing the give string. I tried passing a pointer to a char pointer and edit that, but to no avail.  what I get:  before: juanpablo Segmentation fault (core dumped)  My code:  void rm_char(char* word, int pos){     printf("before: %s\n", word);     int len = strlen(word);     int i;     i = pos;     while(word[i+1] != '\0'){       word[i] = word[i+1];       i++;    }      word[i] = '\0';     printf("after: %s\n", word); }    int main(void){     rm_char("juanpablo", 2);  }

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


I have a point $A\in\mathbb{R}^n$ and a set of $k$ constraints of the form $$a_i + \alpha a_j+ \geq \epsilon$$ for $\epsilon>0$ and $a_i$ the $i$ dimension of $A$. How can I find the projection of the point against this set? I am suspecting that if I project iteratively against each semi-space/restriction, I'll have the job done.

I have a convex polytope described by the intersection of a hypercube and two parallel lower and upper hyperplanes cutting through the hypercube. I want to find the projection of a point onto the polytope. I read the question  and see that the general problem of finding a projection onto a convex polytope can be solved with quadratic programming. However, taken alone, projection onto a hypercube or a hyperplane is trivial. For the hypercube, each dimension is defined by a lower+upper bounds and we just pull each dimension within those bounds, which take $O(n)$ time in $n$ dimensions. For the hyperplane just find the projection onto it. So I'm wondering whether there is simpler method for finding such a projection, maybe somehow combining the two independent projections.


I have a question on scientific notation in a calculated CI and how to present it. The value of my CI is: 1.623497e+01. So when I write that out do I say that the CI for that variable is 1.62... or is it 16.23 since the e+ means move the decimal one spot to the left?

I have a problem with the interpretation of a test result in which the p-value is 8.6e-28. How should it be interpreted? What is the e for?  Specifically, I used White's Test for the homoscedasticity assumption of a linear regression:  White's general test statistic :  150.0535  Chi-sq( 9)  P-value =  8.6e-28