I'm drawing graphs by hand and came across the following curious behaviour: When addressing nodes in a foreach loop in order using a regular structure via evaluate=, the node position seems to wander. The same behaviour does not appear when addressing via remember= or a random setup:    I'd love some information as to why that happens and how to avoid that, either by adjusting or using an alternative structure.  \documentclass{standalone} \usepackage{tikz}  \usetikzlibrary{math} \begin{document}  \begin{tikzpicture} \foreach \t in {0,20,...,360}     \fill[color=blue] (\t:2cm) circle (2pt) node (A\t) {}; \foreach \t [remember=\t as \lastt (initially 0)] in {20, 40, 60, 80, 100}     \draw (A\t) -- (A\lastt); \foreach \t [remember=\t as \lastt (initially 120)] in {140, 160, 180, 200, 220}     \draw (A\t) -- (A\lastt); \foreach \t [remember=\t as \lastt (initially 240)] in {260, 280, 300, 320, 340}     \draw (A\t) -- (A\lastt); \foreach \t [evaluate=\t as \tt using \t+120] in {0, 20,...,220}     \draw (A\t) -- (A\tt); \foreach \t [evaluate=\t as \tt using \t+240] in {0, 20,...,100}     \draw (A\t) -- (A\tt); \draw (A0) -- (A100) (A120) -- (A220) (A240) -- (A340); \draw (0,-2.5) node {Lattice}; \end{tikzpicture}  \begin{tikzpicture}  \pgfmathsetseed{8} \foreach \t in {0,20,...,360}     \fill[color=blue] (\t:2cm) circle (2pt) node (A\t) {}; \tikzmath{ %C style brackets for slightly better readability%     int \x, \y, \a;     for \a in {0, ..., 30}{         \x = random(18)*20;         \y = random(18)*20;         {\draw (A\x) -- (A\y);};     }; } \draw (0,-2.5) node {Random}; \end{tikzpicture} \begin{tikzpicture} \foreach \t in {0,20,...,360}     \fill[color=blue] (\t:2cm) circle (2pt) node (A\t) {}; \foreach \x [remember=\x as \lastx (initially 0)] in {220,300,280,340,100,340,300,260,180,240,260,20,260,320,40,240,60,320,240,160,180,240,200,260,80,120,300,140} \draw (A\x) -- (A\lastx); \draw (0,-2.5) node{Preferential}; \end{tikzpicture}  \end{document}

It seems like I'm doing something wrong when using foreach variables to indicate node numbers. The two foreach loops are anchoring the paths to the east of each node. Why does this happen?    \documentclass{article}  \usepackage{tikz} \usetikzlibrary{backgrounds,fit,patterns,decorations.pathreplacing,calc}  \makeatletter \tikzset{   labelnode/.style={draw=none, fill=none, black},   latentnode/.style={draw, minimum width=5mm, shape=circle, ultra thick, black},   dagconn/.style={arrows=->, black, thick}, } \makeatother  \begin{document} \begin{tikzpicture}[scale=1]  \pgfmathsetmacro{\colgap}{1.6}  \pgfmathsetmacro{\rowgap}{1.3}   \node[labelnode] (x1) at (\colgap*0,\rowgap*1) {$X_1$};  \node[labelnode] (x2) at (\colgap*1,\rowgap*1) {$X_2$};  \node[labelnode] (x3) at (\colgap*2,\rowgap*1) {$X_3$};   \node[latentnode,blue] (x4) at (\colgap*0,\rowgap*0) {$X_4$};  \node[latentnode,red] (x5) at (\colgap*1,\rowgap*0) {$X_5$};  \node[labelnode] (x6) at (\colgap*2,\rowgap*0) {$X_6$};   \foreach \c in {1,...,2} {    \foreach \r in {1,...,2} {      \pgfmathsetmacro{\st}{(((\r-1)*3)+\c)}      \pgfmathsetmacro{\en}{\st+1}      \draw[dagconn] ([xshift=0.2cm]x\st) to ([xshift=-0.9cm]x\en);    }  }   \foreach \c in {1,...,3} {    \foreach \r in {1,...,1} {      \pgfmathsetmacro{\st}{((\r-1)*3)+\c}      \pgfmathsetmacro{\en}{\st+3}      \draw[dagconn] (x\st) to (x\en);    }  } \end{tikzpicture} \end{document}


When going to the Questions and Bookmarks tabs on a user's profile's Activity page, the questions and their meta-data are not properly aligned:  Colours due to Dark Reader plugin Of course, this is definitely not a big issue, but I thought I'd mention it all the same.

There's something wrong with the vertical alignment on the :   (click to enlarge)  On the , which uses a similar list but without the Favorite column, the vertical alignment is correct.  (Tested in the latest Firefox, Safari and Chrome on macOS Catalina.)


In hypothesis testing consider this situation:  Define $\alpha=P\{\text{type I error}\}=P\{\text{ Rejecting } { H_0}\text{ when } H_0\text{ is true}\}$.  Also define $p-$value like this  What is the probability of observing a data which is similar to the one on hand, or more extreme, if $H_0$ happens to be true. This probability will be called the $p-$value.  How do I get some inutition about this: A test with a small $p-$value indicates that the null hypothesis is less plausible than the alternative hypothesis and in this case $H_0$ is rejected.

I can't understand why people seek small $p$-value. I mean, $p$-value is the smallest level at which $H_0$ can be rejected. Making level small we minimize the probability of type $1$ error, which as I think means that we are getting more evidence against $H_0$, since now the probability of accidentally rejecting $H_0$ when it is true decreases $=>$ probability of accepting $H_0$ when it is true is becoming bigger, because $P_{H_0}(test = 1)=1-P_{H_0}(test = 0)$  When $p$-value is small we reject $H_0$, but it seems to me that when $p$-value is small it must be vice versa, because the small $p$-value corresponds to the higher probability of accepting $H_0$ when it is true.  I saw the answers that you suggested... but none of them helps. I know the 'interpretation' of p-value, I can imagine it as an area under curve too, but I can't understand the relation to what I wrote above.


While I'm somewhat interested in job ads in SO, I can't remember seeing one that was related to my interests.  I'm aware that in my main interest topics Dart, Dart Angular,and Flutter there aren't many job offers yet, but almost all ads I get shown are about Java and React, topics I'm not involved in any way. There are also very popular areas like Angular (TS) where I'm very active (#1 top user) but not even here I get related ads.  Is there anything I can do do get more relevant ads or none at all if there are no relevant ads.  A way to dismiss ads I'm not interested in would be great. When I get the same ads I'm not the least bit interested in shown for weeks, the job ads become so useless distraction that the only useful thing to do is to block them.  I can't imagine this being the intention of the SO team.  I also updated my jobs profile a few times with no noticable effect.

I see a lot of job ads on SO, I've searched through them as well. It seems, however, that the ads are very broad in their targeting.  What I would like to see is ads based on tags.  First, it should display ads with relevant tags in your favorites before ads without relevant tags.  Second, it should place more weight on tags that you've got answer points in, allowing things that you're interested in or good at to be first.  This will keep the interesting stuff towards the top and encourage good answers within the community. It will also make the job lister happier, as they'll be able to get their listing seen by relevant developers faster.


Surface is the cone $z^2=x^2+y^2$ delimited by the plane $z=0$ and   $x+2z=3$.   Well, the first thing I thought is to devide it in two parts, the one that is a simple cone and the other part. But I'm a bit lost of how do I find the proper parametrization for this surface.

Compute the area of that portion of the conical surface $x^2 + y^2 = z^2$ which lies between the two planes $z = 0$ and $x + 2z = 3$. Ans:$2\pi\sqrt{6}$. Thank you.


I really like my doorbell and the plastic push button is broken thus not working. It came with the home when we bought the house from the builder. Now it's hard to find builder materials. It's 5.5" height and 1.2" width. Kinda antique brass gold type finish. I did lots of googling but not able to find. Picture is attached if anyone can help me find this price. I appreciate it.  Thanks

See attached picture. I am not sure if the title is correct. The door bell button (the plastic cover area) broke. Can anyone tell where can I buy this exact doorbell?


What are the conditions of solvability of the equation $p^2=2xq^2+2yq+1$ where  $p,q$ being prime and $x,y\in \mathbb{N}$?  Thank you in advance...

I want to find a set of integer solutions of Diophantine equation: $ax + by = c$, and apparently $\gcd(a,b)|c$. Then by what formula can I use to find $x$ and $y$ ?   I tried to play around with it: $x = (c - by)/a$, hence $a|(c - by)$.     $a$, $c$ and $b$ are known. So to obtain integer solution for $a$, then $c - by = ak$, and I lost from here, because $y = (c - ak)/b$. I kept repeating this routine and could not find a way to get rid of it? Any hint?  Thanks, Chan


I have an array in php  <?php $array=array("a"=>"123","b"=>"234","c"=>"345"); array_shift($array); //array("0"=>"234","1"=>"345"); ?>   If I use this function, then key value gets changed. I want my key value to remain the same. How can I remove first element without affecting array key values. My answer should be like  array("b"=>"234","c"=>"345");   Note:Please do not use foreach(); I want to do this by existing array functions in php  array_splice function is working for above array. But consider the below array  <?php $array = Array (     '39' => Array         (             'id' => '39',             'field_id' => '620'          ),      '40' => Array         (             'id' => '40',             'field_id' => '620',             'default_value' => 'rrr',  ));  array_splice($array, 0, 1); print_r($array); ?>   It is showing answer as follows:  Array ( [0] => Array ( [id] => 40 [field_id] => 620 [default_value] => rrr ) )   May I know the reason?? Will array_splice() work only for single dimensional array?? Now key value is reset...

Is there an easy way to delete an element from an array using PHP, such that foreach ($array) no longer includes that element?  I thought that setting it to null would do it, but apparently it does not work.


Consider the C++ 17 code below, which tests a set of enum values to see if another enum value is contained in that set:  enum Flag { val1, val2, val3, val4, val5 };  template<Flag arg> struct Value {     template<Flag... set> struct IsIn {         static constexpr bool value =             static_cast<bool>(((set == arg) || ...));     }; };   This works as intended:  bool x = Value<val4>::IsIn<val1, val2, val5>::value; // x == false  bool y = Value<val2>::IsIn<val3, val2>::value; // y == true   However, I wish to test if all of a set of values are contained within another set, like so:  template<Flag... args> struct Values {     template<Flag... set> struct AreIn {         static constexpr bool value =             static_cast<bool>((Value<args>::IsIn<set...>::value && ...));     }; };   The above does not compile on GCC 7.3 or Clang 5.0; they both give rather cryptic answers that give little insight into the problem. Given that parameter pack expansion in a template parameter list is allowed (as long as the template supports the expansion), I'm having a hard time figuring out why this isn't legal C++.

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


I ran into an interesting interaction tonight when I played Magic. So here's the setting:    I have a  out and the equipment known as .  Pyreheart Wolf's ability says: when this creature attacks, your creatures have to be blocked by two or more creatures this turn, the ability that we now know as menace.  Vorrack Battlehorns ability is: equipped creature has trample and can only be blocked by one creature.   I also have one other creature out.  I have the equipment equipped to said other creature. I go to attack phase. I attack with both my creatures.  My question: does the Pyreheart Wolf's ability trigger first or does the equipment's ability trigger first?

What happens if I equip my      Juggernaut can't be blocked by Walls.   with a      Equipped creature can't be blocked except by Walls.   or if I enchant my      Charging Rhino can't be blocked by more than one creature.   with a ?     Enchanted creature gets +3/+3 and has menace.   From , I'd say they're both unblockable, but I'm wondering if the word "except" allows the blocker to block if he or she satisfies the "except" condition.


I've recently started observing that the highlighting of questions in a site's overview page has stopped working. I've observed this on:    sql_server tagged question  not highlighted    sql-server tagged question not highlighted    windows-10 tagged question not highlighted   ...and possibly others affected.

For the longest time my ignored tags have been working but today they are not. They work on the home page but not the /questions page. However, if you choose the "Gray out questions" option then that fails. Arqade is the only site I've ever had a long-standing ignore list so I don't think I can blame cache. The same behavior seems to be exhibited on Stack Overflow but I added those ignore tags just moment ago so cache could be an issue. If it matters, I am using Chrome x64 v91.0.4472.77 on Windows 10 Via comments, this issue has been confirmed for Watched Tags as well.


I have this code.  When I run it I get this result:      The Circle A :   The center X: 5, the center Y 5 and the Radius 5      The Circle B :   The center X: 10, the center Y 10 and the Radius 10      Change      The Circle A :   The center X: 10, the center Y 10 and the Radius 5      The Circle B :   The center X: 5, the center Y 5 and the Radius 10   if java does not allow to pass values as reference, how did this code allow it?  Just in case, when I look it with the debugger the direction of the object "autre" was the same as the object A.  public class Main {      public static void main(String[] args) {          Cercle A = new Cercle();         Cercle B = new Cercle();         A.creer(5, 5, 5);         System.out.println("The Circle A : ");         A.show();         B.creer(10, 10, 10);         System.out.println("The Circle B : ");         B.show();           System.out.println("Change");         B.change(A);         System.out.println("The Circle A : ");         A.show();         System.out.println("The Circle B : ");         B.show();     } }  public class Cercle {     public int x, y;     public int r;      public void creer (int n1, int n2, int n3)     {         x = n1;         y = n2;         r = n3;     }      public void show()     {         System.out.println(" The center X: "+x+", the center Y "+y+" and the Radius "+r);     }       public void change(Cercle autre){         int tmp ;         tmp = x ;         x = autre.x;         autre.x = tmp;         tmp = y;         y = autre.y;         autre.y = tmp ;     }  }

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


Previous posts:                           After a long hiatus, a new Custom Question Lists update is out with a fresh new design.  What's shipped?  If you are participating in the Custom Question List alpha (by ), you'll see some brand new UI components when viewing question lists:  New tab bar and editor    Based on your feedback, we decided to rethink the whole UI, removing some confusing and redundant components, and bringing back some much loved pieces.  The new design is closer to "the existing question lists with advanced options" than "a radically new experience".  Huge shoutouts to our new designer, , for making this new design possible and to  for picking up development while I was on sabbatical!  Some important notes for existing testers:   The summary is back in its rightful place next to the tab bar.  If bounty or unanswered filters applied, the summary provides a clearer explanation of what you're looking at, inspired by /unanswered. The "Filter" and "Sort" popovers are gone. Sort was too similar to the existing tabs, and Filter was a form in a popover. (how were you supposed to submit or cancel?)  Now there's a dedicated UI for filtering. The complex "Create" and "Edit" modals are gone.  Now you just configure your list with the same UI as if you were filtering and click "Save filter" when you're ready to save. You can preview your changes before updating a filter.  Editing a saved filter and clicking apply shows you your new options while remembering what filter you were looking at.  You can then click "Save filter" to either update your existing filter or create a new one. We handle responsive better.  The tab bar has been set up so it compresses more naturally on narrower browsers and mobile devices.   New sidebar widget    A new right-sidebar widget has been added, similar to Watched Tags, to give you more direct access to your saved lists.  This is where indicators will live in Phase 3 (which I swear we are actually going to ship).  Please give it a try.  If you have any questions, bugs, or feedback, you can reply to this post directly or add a new question with the  tag.  A wider alpha  Since we're nearing launch, we're expanding the alpha out to the whole network.  So feel free to try this out on any site you frequent, to help suss out any site-specific issues.  What's next?  As always, Phase 3 of this project is adding indicators for new content, now in the right sidebar widget.  There's increasing interest in this feature from Enterprise, so I do really expect this to ship and get out of Alpha sooner rather than later and this time, I mean it.

After an extended alpha period, we are pleased to announce the release of Custom Filters (formerly known as Custom Question Lists).  Custom Filters provide a rich UI for building more tailored views of questions around your specific needs  (e.g. ) as well as the ability to save those lists for quick access later.  So, what does it look like?  The change in the UI is subtle, and if you never use the feature it shouldn't impact you too much.  We're going from this:    To this:    With this component in the sidebar:    Notably, the order of tabs has rearranged slightly, Featured has been renamed Bounties, and a few items have been tucked into a "More" dropdown.  There's also a blue Filter button.  Once you click Filter or "Create a custom filter", though, you're brought into a new UI that lets you select tags, choose a sort order, and specify the attributes of the questions that you want to view.    From there, you can apply your filter to the current page or save it so that you can quickly access it again from the sidebar or More dropdown.  .  What about new content indicators?  If you've been following this project, you know that new content indicators have been "just around the corner" for a while.  It's not a trivial problem to get right at scale, and while we've been close for a while, there's one last issue we want to resolve before shipping.  That is targeted for mid-July.  Where do I file bugs and feature requests?  You can file on meta using the  tag.  Special thanks to our alpha testers  You have all been a huge help both not just in finding bugs but also in shaping the direction of the product.  For a history of the project, you can view these previous meta posts:


So I had successfully install Cuda 7.5. Turns out I needed something pre 6.5, and I was having difficulty installing it.   Seemed like no matter what i did it stayed there, so I did a good search for cuda7.5 using "find" --- and found something like "cuda-repo"  in /etc/apt/sources.list.d and erased them (without making backups)  Since then, I've tried installing everything again, but to no avail.   Thinking it was a broken package, I've tried everything from   sudo dpkg --remove --force-remove-reinstreq cuda-repo-ubuntu1404   to plenty of other posts like       http://askubuntu.com/questions/650692/installing-cuda-7-0-on-ubuntu-14-04   and      http://ubuntuforums.org/showthread.php?t=947124   To no avail.  After doing       sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb   and        sudo apt-get update   I get   sudo apt-get install cuda     Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:     The following packages have unmet dependencies:      cuda : Depends: cuda-7-5 (= 7.5-18) but it is not going to be installed      libcogl15 : Depends: libegl1-mesa-drivers E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.   going down the chain of dependencies manually gets me nowhere-- I went all the way down the chain and simply got to the point where it gave the same error, asking for decencies i had already added to the list! (circular dependency, if you will)  It's also very strange that 6.5 would appear to depend on 7.5  Help? I want to install cuda 6.5!

I am not sure what caused this error, but here is what the whole error says, and also this is sitting as a notification, and preventing me from updating any software using Update Manager - Please provide some assistance or tell me how to figure out what to do to fix it.  Could not calculate the upgrade  An unresolvable problem occurred while calculating the upgrade.  Please report this bug against the 'update-manager' package and include the following error message: 'E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.'


I have a table like below  Type of Station | Broadcast Management ----------------+------------------------- Full Power      | Sinclair Broadcast Group Full Power      | Sinclair Broadcast Group LPTV cable      | Sinclair Broadcast Group LPTV no cable   | Sinclair Broadcast Group   Now I want to execute a query that will bring result looks like below  Broadcast Management       | Full Power | LPTV cable | LPTV no cable ---------------------------+------------+------------+-------------- Sinclair Broadcast Group   |  2         |     1      |  1   Can anyone please help me how to write this query

I'm building a query with a GROUP BY clause that needs the ability to count records based only on a certain condition (e.g. count only records where a certain column value is equal to 1).  SELECT  UID,          COUNT(UID) AS TotalRecords,          SUM(ContractDollars) AS ContractDollars,         (COUNTIF(MyColumn, 1) / COUNT(UID) * 100) -- Get the average of all records that are 1 FROM    dbo.AD_CurrentView GROUP BY UID HAVING  SUM(ContractDollars) >= 500000   The COUNTIF() line obviously fails since there is no native SQL function called COUNTIF, but the idea here is to determine the percentage of all rows that have the value '1' for MyColumn.  Any thoughts on how to properly implement this in a MS SQL 2005 environment?


I want to add a new item (in this particular case a shortcut to Putty SSH client) to my Windows 10's All Apps section.   I have already found out that I can "Pin to Start" any item, however, this will only create a new tile on the right side of the Start Menu and won't add any new item to All Apps. Thus, pressing  Win and typing "putty" won't return any result.  Creating a new shortcut and adding it to shell:start menu has the same effect as pinning to Start, so it's not a solution.  Note:  question might look the same, but the accepted answer doesn't apply to my requirements as I need the item to be searchable, and not only a new tile.  Note 2: I can confirm that after waiting several hours for Windows to reindex its index I manually rebuilt the whole index, but putty still can't be found neither in search results nor in "All Apps" list.

I just added the latest version of the Eclipse IDE to my computer. Eclipse is distributed as a ZIP file, so I unzipped it into a directory in C:\Program Files like I've done for past versions of Eclipse. However, I also like a shortcut in the start menu. I don't see a way to make that happen.  After I extract the ZIP, one of the files is eclipse.exe. What I've done in the past is to right click on this file, create a shortcut, and drag it into the start menu's All Programs section and it lives there. When I do that in Windows 10, I get an icon that indicates that I can't drop it there (there's a red circle with a slash through it).  I then tried to pin the application to the start menu using the right click menu. It's not what I'm looking for, though:    I then found  and follow that instructions. I made a shortcut on the desktop to the application and then copied that shortcut into %appdata%/Microsoft/Windows/Start Menu/Programs:    However, the result was identical to right clicking and pinning to the start menu - not what I want.  I don't want the Eclipse icon in the section on the right. I want it to appear in the section on the left, where Dia, Eclipse Luna, and other apps are listed. The three obvious solutions don't appear to give me what I want.  How do I do this?    As of 7 Sept 2015, I'm running Windows 10.1 Build 10240 and I still have this issue. I've tried the advice posted in the answers - putting the shortcut to the executable in the %appdata%\Microsoft\Windows\Start Menu\Programs and C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ directories, yet no success getting the desired result.  I did try something new. I went to %appdata%\Microsoft\Windows\Start Menu\Programs (where the Eclipse Process Framework and Eclipse Luna shortcuts are located) and made a new folder called Eclipse. This folder appeared in the Start Menu. I copied the Eclipse Process Framework, Eclipse Luna, and Eclipse Mars shortcuts into this folder. The end result was this:    Again, not what I was expecting to happen. The Eclipse Process Framework and Eclipse Luna icons went into the new folder, which is good. The Eclipse Mars icon stayed on the side, where I don't want it.  This is what the folder structure looks like:      I'd be curious to know if this is an issue that may be resolved in a later build. Unfortunately, I do like some level of stability, so changing to one of the other release streams isn't going to help me. But if someone can point to this being a known issue that has been confirmed as resolved in a later build, I'd be willing to accept that answer once the build flows out to the main release stream.


I am running Ubuntu 20.04 on my Acer Swift 3. This occurred when my system froze because of Mozilla Firefox and I forced restarted the laptop. Since then my touchpad stopped working. I tried to reinstall xserver-xorg-input-synaptics and xserver-xorg-input-libinput but nothing worked. Please help me.

I updated ubuntu 18.04 to 20.04. All worked fine for weeks until today. Touchpad on lenovo y580 stopped working just like that. I didn't install any new updates yesterday.   Xinput log:  Virtual core pointer                        id=2    [master pointer  (3)] ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)] ↳ PS/2 Synaptics TouchPad                   id=14   [slave  pointer  (2)]  Virtual core keyboard                       id=3    [master keyboard (2)] ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)] ↳ Power Button                              id=6    [slave  keyboard (3)] ↳ Video Bus                                 id=7    [slave  keyboard (3)] ↳ Power Button                              id=8    [slave  keyboard (3)] ↳ Sleep Button                              id=9    [slave  keyboard (3)] ↳ Video Bus                                 id=10   [slave  keyboard (3)] ↳ Lenovo EasyCamera: Lenovo EasyC           id=11   [slave  keyboard (3)] ↳ Ideapad extra buttons                     id=12   [slave  keyboard (3)] ↳ AT Translated Set 2 keyboard              id=13   [slave  keyboard (3)]


I want to randomize several procedural textures in the same material. For example, have 3 different Noise textures with a random number as their Scale. I can use the Random output of the Object Info node, but this gives me the same random number each time.  Is there a way to get more random numbers?

Is it possible to generate a random number for use in the node editor?  I am aware of the Object Info node, but I want a random number which I have more control over. Ideally I could change it with some sort of "seed" vale and be able to define limits for maximum and minimum values.  How is this possible?


I have disk space allocated as per below.   Model: INTEL RS2BL040 (scsi) Disk /dev/sda: 1998GB Sector size (logical/physical): 512B/512B Partition Table: msdos    Number  Start   End     Size    Type     File system     Flags  1      1049kB  512MB   511MB   primary  ext3            boot  2      512MB   922GB   922GB   primary  ext4  3      922GB   1998GB  1076GB  primary  linux-swap(v1)    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0   1,8T  0 disk ├─sda1   8:1    0   487M  0 part /boot ├─sda2   8:2    0 858,3G  0 part / └─sda3   8:3    0  1002G  0 part [SWAP]   I would like to change my swap partition to 32GB and add that left over space to the sda2 drive how can I do this from a command line.  Thanks

How can I increase the size of the root partition of a system at runtime?   I have a partition that is not allocated after the root partition (which is also ext4), how can I add that unallocated space to the space allocated to the root partition without having to shutdown the server?


I got this error when debugging in VC++: _Scary->_Myhead was 0xDDDDDDDD. I would like to know what this error means, possible sources, and possible solutions. I think it may have something to do with std::map usage, but I'm not sure. For reference, the debugger leads me to a file called "xtree". Unfortunately, I have no idea how to reproduce this because it is a big project and I do not know why this error is occuring.

I know that the compiler will sometimes initialize memory with certain patterns such as 0xCD and 0xDD.  What I want to know is when and why this happens.  When  Is this specific to the compiler used?  Do malloc/new and free/delete work in the same way with regard to this?  Is it platform specific?  Will it occur on other operating systems, such as Linux or VxWorks?  Why  My understanding is this only occurs in Win32 debug configuration, and it is used to detect memory overruns and to help the compiler catch exceptions.  Can you give any practical examples as to how this initialization is useful?  I remember reading something (maybe in Code Complete 2) saying that it is good to initialize memory to a known pattern when allocating it, and certain patterns will trigger interrupts in Win32 which will result in exceptions showing in the debugger.  How portable is this?


It seems to me, that since in C++ we can pass a template template, then a function accepting a template template should be able to pass a (its) template template into itself. However this appears not to be the case.  template< typename PREVIOUS_TYPE_T, typename TYPE_T > struct Node {     typedef TYPE_T TYPE;     typedef PREVIOUS_TYPE_T PREVIOUS_TYPE;     PREVIOUS_TYPE_T* previous;     template< template< typename... > typename FUNCTOR_T, typename... CURRENT_ARGUMENTS_T >     void DoCall() {         previous->DoCall< FUNCTOR_T, TYPE_T, CURRENT_ARGUMENTS_T... >();     } };   Is there anyway to pass FUNCTOR_T above, or any work around to doing so?

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


Currently I'm using the following command:  file image.jpg | cut -d " " -f 2   So far so good. It works on a file without an image extension too. So, I was wondering if there's another way to do this? I might have not seen a certain case where the above code would fail.  Edit: I am trying to create a script for renaming the image files in a directory sequentially.

I would like to create a shell script that will check to make sure all files in a directory are image files.  We recently had an issue where a hacker was able to generate a file in a directory and mask it as a .jpg file. I would like to create a shell script to check all files in the directory to make sure they are real jpg, gif or png files.


Is it "Even if our trips are of different lengths" or "Even if our trips are different lengths"? Why?  More specifically, the construct would be [verb] [subject] [preposision?] [adjective] [object]. Is there a definitive answer for this specific construct?

I have seen people say  'I am your age' instead of saying 'I am of your age'. Similarly, a sentence like 'you have done this your whole life' instead of 'you have done this for your whole life'. My question is: why for/of is omitted? Any gramatical reason?  Thanks in anticipation


Define an equivalence relation on $S^1\times[0,1]$ by: $(x,t)$~$(y,s) \iff xt=st$. Show that $(S^1\times [0,1])/$~ is homeomorphic to the unit disc $D^2$.  My attempt: Let $g: S^1\times[0,1]\to D^2$ by $g(x,t)=xt$. Now $g(x,t)=g(y,s)\iff xt=ys\iff (x,t)$~$(y,s)$. This shows two things: that $g$ is injective (forward direction) and $g$ is constant on each equivalence class of $S^1\times [0,1]$ (reverse direction). The latter means that $g$ induces a map $f:(S^1\times [0,1])/$~$\to D^2$. Now $S^1$ and $[0,1]$ are compact, so $S^1\times [0,1]$ is compact, and so $(S^1\times[0,1])$/~ is compact by the projection map $\pi$. We know $g$ is a surjection as well because for $y\in D^2$, we have $g(y/\|y\|,y)=y$. Since $g=f\circ\pi$, we have that $f$ is bijective, and we have that $f$ is continuous by the universal mapping property of quotients. Hence, $f$ is a continuous bijection from a compact space to a Hausdorff space, so it is also a homeomorphism.  Does anyone see any problems with my argument?

Let $\sim$ be the equivalence relation on $S_1 \times I$ given by $(x,t)\sim(y,s)$ if and only if $xt=ys$ where $I=[0,1]$  How do I prove that $(S_1 \times I)/\sim$ is homeomorphic to the unit disk $D^2$ with the induced topology?


i want to ask about error of my project. My project (add data) have a uploading image function, when i not uploading the image, why my project get error ???   It's my script  for(int x = 0; x < 1; x++){         String outFileName = DB_Path + sNama + x + ".jpg";         InputStream myinput = null;         try{                 myinput = getContentResolver().openInputStream(selectedImage[x]);           }catch(FileNotFoundException e){             //e.printStackTrace();         }         OutputStream myoutput = null;         try{             myoutput = new FileOutputStream(outFileName);         }catch(FileNotFoundException e){             e.printStackTrace();         }         try{             IOUtils.copy(myinput, myoutput);         }catch(InterruptedException e){             e.printStackTrace();         }catch(IOException e){             e.printStackTrace();         }          try{             myinput.close();         }catch(IOException e){             e.printStackTrace();         }          f1 = sNama = "_" + x + ".jpg";          sFoto1 = sNama + "_" + 0 + ".jpg";         }      }   and it's the error  11-18 13:20:45.855: E/AndroidRuntime(1214): java.lang.NullPointerException 11-18 13:20:45.855: E/AndroidRuntime(1214):     at android.content.ContentResolver.openInputStream(ContentResolver.java:303)  error is  myinput = getContentResolver().openInputStream(selectedImage[x]);

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


I am reading  on Bayesian modelling explanation and there is a statement (section 2.1) there which I can't understand:    Here we have a regression problem, where $X$ are our inputs, $Y$ are outputs and $\omega$ are model parameters.  Why we have $p(\omega)$ instead of $p(\omega | X$)? If we apply Bayes rule to $p(\omega|X,Y)$ we get:  $$p(\omega|X,Y) = \frac{p(Y|X, \omega) p(\omega | X)}{p(Y|X)}$$  The only way to get the statement from the paper is to assume either $p(\omega | X) = p(\omega)$ or $p(X,Y) = p(Y|X)$, both of which feels wrong to me.

In continuation to  question  $p(h|D) = \frac{p(D|h)p(h)}{p(D)}$  $p(h) = $prior  probability of hypothesis $h$  $p(D)$ = prior probability of training data $D$  $p(h|D)$ = probability of $h$ given $D$  $p(D|h)$ = probability of $D$ given $h$  I am inputting to a machine a training data $D$ in form of a table with $n$ training instances.  The machine read only $m$ training examples among $n$ training examples in order to get a hypothesis as output.  I have the following understanding: .  $p(h) = $prior  probability of hypothesis $h$ = $\frac{\left\vert{Version- space}\right\vert}{\left\vert{Hypothesis-space}\right\vert}$  $p(D)$ = prior probability of training data $D$ = $\frac{\left\vert{Observed-training-data}\right\vert}{\left\vert{Training-data}\right\vert}$ = $\frac{{m}}{{n}}$   $p(D|h)$ = probability of $D$ given $h$ = $\frac{\left\vert{Training-examples-satisfied-by-hypothesis-h}\right\vert}{\left\vert{Training data}\right\vert}$ = $\frac{\left\vert{Training-examples-satisfied-by-hypothesis-h}\right\vert}{{n}}$  I do not know how to interpret   $p(h|D)$ = probability of $h$ given $D$  in the above forms.  Is my understanding about formulas for corresponding probabilities is correct and what is formula for $p(h|D)$?


If $x_n \to a$ then $$\lim_{n \to \infty}\frac{x_1+x_2+x_3+...+x_n}{n}=a$$  My attempt  $$=> \lim_{n \to \infty} x_1+x_2+x_3+...+x_n = na \\ => x_1-a +x_2-a +...+x_n-a = 0 \ where \ n \ is \ not \ finite$$  Since $x_n \to a$ Given $\epsilon >0$ there exists $N$ such that   $|x_n-a| < \epsilon$ whenever $n>N$  Applying to what we ended up with :  $n \epsilon = 0$  let $\epsilon \to 0$

Prove that if $\lim_{n \to \infty}z_{n}=A$ then:  $$\lim_{n \to \infty}\frac{z_{1}+z_{2}+\cdots + z_{n}}{n}=A$$ I was thinking spliting it in: $$(z_{1}+z_{2}+\cdots+z_{N-1})+(z_{N}+z_{N+1}+\cdots+z_{n})$$ where $N$ is value of $n$ for which $|A-z_{n}|<\epsilon$ then taking the limit of this sum devided by $n$ , and noting that the second sum is as close as you wish to $nA$ while the first is as close as you wish to $0$. Not sure if this helps....


Looking at the refractive index of glass, it's around $1.6$.  Then the speed of light $x$ through light should be given by $$ 1.6 = \frac{3.0\times10^8}{x}, $$ so $x$ is about $2\times10^8~\mathrm{m}~\mathrm{s}^{-1}$  The frequency is kept constant, so the wavelength must adapt to suit the slower speed, giving a wavelength of $2/3$ the original.  Does this mean that when passing through glass, say red light (wavelength $650~\mathrm{nm}$) changes to indigo ($445~\mathrm{nm}$), as $650 \times 2/3 = 433~\mathrm{nm}$, or is my logic flawed somewhere?

What determines the color of light -- is it the wavelength of the light or the frequency?  (i.e. If you put light through a medium other than air, in order to keep its color the same, which one would you need to keep constant: the wavelength or the frequency?)


I'm creating a calculator using VUE JS. I was wondering how to do exponents in that if I had something like "8^3", how would I split the string into the two separate digits?

I have this string  'john smith~123 Street~Apt 4~New York~NY~12345'   Using JavaScript, what is the fastest way to parse this into  var name = "john smith"; var street= "123 Street"; //etc...


I tried to boot into my ubuntu machine and this error message appears. I read through dozens of previous questions about this and unfortunately no one answered with an objective step by step on how to solve the problem and boot to the system. Edit: I was able to solve my problem reinstalling the OS without erasing data, by not setting the "format" flag in the ubuntu live usb. It doesn't get to the root of the problem, but solves the issue of how to gain access to the system and the data once again.

While I was upgrading to Ubuntu 15 (the development version), my system crashed. After I restarted the laptop, I saw a kernel panic. I also did a memtestx86 which didn't find any error.    more info :   Before doing upgrade i have changed my default desktop to gnome which by entering wrong commands i lost some packages .to revert the previous desktop i removed all the packages and then installed them then i face that some packages weren't still installed . after i run terminal and started to upgrade ( i found it good to troubleshot the problem by upgrading somehow ) however after crash i got that screen by the way i have faced another screen after this one which backed to the first again


What is a good way to protect a camera when it is raining besides a waterproof camera cover?

I've been trying to photograph lightning lately, as we have had some great storms in Colorado. I've had some difficulty getting a good vantage point, however, as almost all of these storms include rain as well. To keep my camera from getting drenched (I have weather-sealed lenses, but my camera body, a Canon 450D, is not weather sealed as far as I can tell), I've had to shoot under the eve of a building or under a thick canopy of trees, however that has greatly limited my ability to adapt to the changing weather and get get a vantage point on the best lightning.  Is there any equipment, something I can purchase or something home-made that has easy-to-find parts, that can help me protect my lens from the rain while still being able to shoot? Additionally, I've been getting rain on a UV filter I have on the front of my lenses, simply to prevent rain from getting on the front lens element itself. However, once a storm really gets going, so does the rain. Is there a simple solution to keep rain off the front of the lens?


Is their any way that whenever a user upload file via ftp a function fire automatically.I don't have any code.Search it on internet but not find any solution.

Much like a , I am trying to monitor a directory on a Linux box for the addition of new files and would like to immediately process these new files when they arrive. Any ideas on the best way to implement this?


When I click on the Ubuntu software icon on the dock, pointer turns to spinning circle for a while but the application does not launch. I tried to run below commands but I am getting an error while refreshing cache. Please help. sudo rm /etc/apt/sources.list  sudo software-properties-gtk

I am running 19.10 on a Lenovo flex 11 and all seems to be working smoothly. I regularly check for updates and often get something new installed apparently. Well, today I checked for updates and get the message "Failed to load repository information". My network connection is good...hello, my question is getting in here...so what is going on? Fetching e-mail works, surfing the web works, streaming works, but am unable to download repository information. What's up? results of update attempt:  tom@tom-Lenovo-FLEX-6-11IGM:~$ sudo apt update [sudo] password for tom:  Ign:1 http://dl.google.com/linux/earth/deb stable InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu eoan InRelease                     Hit:3 http://us.archive.ubuntu.com/ubuntu eoan-updates InRelease             Hit:4 http://us.archive.ubuntu.com/ubuntu eoan-backports InRelease Get:5 http://dl.google.com/linux/earth/deb stable Release [933 B] Get:6 http://dl.google.com/linux/earth/deb stable Release.gpg [819 B] Hit:7 http://security.ubuntu.com/ubuntu eoan-security InRelease Ign:6 http://dl.google.com/linux/earth/deb stable Release.gpg Reading package lists... Done W: GPG error: http://dl.google.com/linux/earth/deb stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 78BD65473CB3BD13 E: The repository 'http://dl.google.com/linux/earth/deb stable Release' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. tom@tom-Lenovo-FLEX-6-11IGM:~$   my ignorance is nearly complete, but it appears to me that something may be lacking in the place where updates live - I am grateful for the assistance I get here.


I am relatively new LAMP dev who is trying to learn Linux primarily through AWS. I have a live Elastic Beanstalk instance up and running. I did a yum install of the following packages:  mysql55.x86_64 mysql55-bench.x86_64 mysql55-common.x86_64 mysql55-devel.x86_64 mysql55-libs.x86_64 mysql55-server.x86_64 mysql55-test.x86_64    Which all seemed to install fine ... then typed ...  mysql -V    which gets me   mysql Ver 14.14 Distrib 5.5.20, for Linux (x86_64) using readline 5.1    ... which confirms mysql is installed ... but then when I type ...  mysql -u ec2-user -p Enter password: /*leaving blank*/   I get ...  ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)   Now the thing is I am ssh-ing into this server with a Security Group key pair I created in AWS Console. So the key is authenticating me (from the .ppk file) when I log into the box as ec2-user. That IS my "root" user as far as I know, there is no password, but I may be mistaken.  So, basically I don't understand the basics of how to begin using MySQL in a linux environment. I've only really used PHPMyAdmin and the MySQL command line from WAMP until now.  Can somebody help me with where I'm getting my wires crossed here?

This is a  about  the use of a *AMPP's stack.    I recently had a talk with some experienced people and they suggested to me not to use a WAMP stack, and instead install apache, mysql and php separately.  I don't understand why they have suggested this, though, so can anyone tell me?  Is there a particular disadvantage of WAMP, or a particular advantage to installing all of them separately?  Since a WAMP stack itself is composed of apache, mysql and php, then what's the difference between using the WAMP stack and installing them all separately?


Having been thinking about some of my favorite Sci-Fi shows from long ago I managed to jog my memory about one I just barely remember.  Hopefully, with the bit of detail I do remember someone might be able to recognize it.  First, the production details:   It would have been aired ~15-20 years ago in Canada (likely on the then equivalent of the Space Channel, but I don't guarantee that) It was in English It was definitely not animated, no puppet people either It was definitely a series, but I cannot remember the number of seasons it might have run for It could have been a rebroadcast of a show earlier, but it was definitely new to myself and the station at the time. It was definitely aimed towards a younger audience (Young me at the time would not have been watching an adult TV series)   Now, for what I do remember.  Take everything with a grain of salt, as particulars might also be mixed up with other shows (I'll make note of parts I'm not sure of:   There were likely three main characters (Could have been more, but three is a definite minimum) Each character had a personal fighter/ship, colour coded to their uniform colours (I don't think they were designed as pure fighters, but they definitely had some kind of weapons). The show took place in deep space and I don't specifically remember any kind of references to Earth. There were definitely FTL jumps, but the terminology used for the technology escapes me. There was a large ship capable of devouring asteroids/planets for some reason, likely controlled by whatever passed for the bad guys. (Young me was likely quite impressed by it) One particular scene that I have quite vividly (probably from the series premier) had them exploring an abandoned wrecked ship, exterior lights flickering over the ships name (This ship was probably very important and likely became their home base, but I don't guarantee that).   And, sadly, I think that's about all I can confidently remember.  I thank you for indulging me in my little bit of nostalgia with my childhood.

I'm trying to identify a Disney TV movie from the late-80s to mid-90s.  The plot points that I can remember are:   3 teenagers on a spacecraft, all in recently in trouble at their (military?) academy so being sent somewhere the ship malfunctions no adults around, period they meet some alien woman who agrees to help them because she "thought they were much older warriors" rather than kids the kids somehow have mechs (they look exactly like the Battlech Timber Wolf/Mad Cat mech) harvesting ice on a planet for water, they encounter some gigantic worm creature that can sense heat


I read a book about a group of travellers who discover a ship that is 30km long (I am not sure about the length of the ship).   The ship belonged to a race who were researchers. The ship can create life from some dna samples in the ship, I remember a tyrannosaurus rex being created and killing one of the characters.   The main character was a bald man who likes cats.

I recall reading a book where the nondescript quirky captain of an independent starship was hired to take a group to a possible lost starship. The ship was a giant ecological repository and contained tech which had since been lost. Everyone tried to board, running afoul of various creatures and defenses. The independent captain (thought least likely to survive) wound up somehow managing to become recognized by the ecological ship as its new captain-owner, and spent the rest of the book providing its services, on his terms.  Part of this story also appears as a short story in an Analog magazine.  I probably read this in the late 80s, early 90s.


I have a lot of photos in different folders. Some of them are copies of each other. I want to put those photos in one folder and I want a tool to identify the duplicate files.   I also want some photo managers.  I'm using Ubuntu 14.04

What can I use to find duplicate photos, including photos that have been resized?


I got my PhD degree from the one of the most excellent universities in Asia and am currently postdoc in US. However, I had the worst nightmare PhD advisor who thought his own students as potential competitors and tried to disturb their future career. He usually did not write reference letters for his own students and I saw most of my seniors leaving the lab without reference letters. Fortunately I got a good postdoc position in US and escaped from the previous lab. After postdoc, I would like to continue research work in US, because I am so exhausted with my PhD advisor and never want to see. Is it difficult to get a position if I do not list my former PhD advisor in the reference list? I can get recommendation letters from postoc supervisor and other professors. In fact, I usually have nice relationships with other people. Also, my PhD advisor has different research interest field from mine.  This situation is causing me such difficulty. Please give me any good advice to overcome this situation. My current aim is working in the tenure-track academic position or national lab than industry. However, if this problem is distracting me too much, I am considering of working in the industrial field.

I received my PhD in 2009 and my adviser will not provide a good recommendation for me. This is mostly because we have fundamentally different approaches to science, and in retrospect I see that I could have avoided a breakdown in our relationship if I had been more deferential.  At this point, I leave his name off of my list of references, but I suspect that a diligent potential employer might call him anyway. I would be willing to discuss any concerns that were brought up in such a call - indeed I think that doing so will help me to find a good fit in a new position - but I do not know if I should, or how to state this fact in my job applications.  I am currently finishing my post doc, and one recommendation has been to take another post-doc so that I at least have two supportive references from postdoc advisers - and that the additional publications will place less weight on recommendations. Still, others have told me that not having a good reference from my adviser is a kiss of death.   How can I most effectively handle this situation?


I do not find any option to change my username. Please do add a feature to change the user name.

It would be nice to update the profile page from within the app.  Perhaps not many people update their profiles more frequently, but when required to do so, I would prefer to do it from the app instead of the mobile browser.


i have this code in  class  A   private RtcListener mListener;  @Override public void Update(String string) {     //here its work now i want to pass data to Interface           mListener.onUpdate(sometext);   }   public interface RtcListener{      void onUpdate(String string);  }   now in another class and its B     i implements the Interface   public class B extends Service implements A.RtcListener{  // here i Override interface method   @Override public void onUpdate(String string) {   Log.d("dwdwadwadwd"," the data is"+string);  }    }   its give me the error   Attempt to invoke interface method 'void .....  on a null object reference

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


I was trying to dual-boot with Windows 8 on my Lenovo y-500 recently, but I gave up because there were so many difficulties. Couple hours ago I decided to try again, but I'm running into some difficulties. I received the error:   Executing 'grub-install/dev/sda' failed. This is a fatal error   when installing Ubuntu alongside Windows 8. I turned my computer off, made sure my secure-boot was off, Legacy support turned on, with priority on UEFI. I retried, but ran into the same error message, so I ran Boot Repair. I came across what appeared to be a concerning error message here:     I'm a little apprehensive at this step because    There were some errors in the terminal and  I have no idea what a kernel is and renaming EFI files seems potentially dangerous.    Any help would be enormously appreciated. Thanks!  EDIT: Hit "No" in the second screenshot, and bootrepair continued. I got this url:   EDIT #2: Ran installation again after boot-repair finished, got the same "Executing 'grub-install/dev/sda' failed. This is a fatal error" error message -.-

I used boot repair commands on try Ubuntu terminal. It said "EFI detected check options"  I used the recommended repair option. In the end it said "buggy kernel detected, do you want to activate (Windows efi files will be saved and renamed)?"  After the reboot, I didn't get the option to choose the OS. It justy goes straight to Windows 8.   What could be the problem?


I have a python list of chars and want to join them to create a list of strings of 8 elements each, eg:   x = ['0','0','1','a','4','b','6','2','2','1','4','1','5','7','9','8']   result  ['001a4b62', '21415798']

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


I installed Ubuntu 12.10 on my old Compaq/Hp Preario V3000 to replace Windows XP. Every thing works fine except I'm getting no wireless network options in the network drop down menu. I'm using a cable at the moment.   Wirless chipset is:  05:00.0 Network controller: Broadcom Corporation BCM4311 802.11b/g WLAN (rev 01) 08:08.0 Ethernet controller: Intel Corporation PRO/100 VE Network Connection (rev 02)   I ran rfkill:  0: hp-wifi: Wireless LAN Soft blocked: no Hard blocked: no   I also ran iwconfig and got this  lo        no wireless extensions.  eth0      no wireless extensions.   In the additional drivers it says: "Using Broadcom 802.11 Linux STA wireless driver source from bcmwl-kernel-source (proprietary)"  Any help to resolve the problem would be greatly appreciated.

--Edit-- (in case I need to see this again)  After a clean install this worked: Your device uses the driver b43 and proprietary firmware. The Broadcom STA driver which provides wl is not appropriate. Please get a temporary wired ethernet connection and do:  sudo apt-get remove --purge bcmwl-kernel-source   If it isn't installed, just proceed.  sudo apt-get install linux-firmware-nonfree sudo modprobe -r b43 && sudo modprobe b43   You should be all set.  --  Thank you guys!!   Tried using the Additional Drivers gui and that didn't work. Tried using jockey-text --list  kmod:wl - Broadcom STA proprietary wireless driver (Proprietary, Disabled, Not in use) [auto-install]   Tried using jockey-text --enable=kmod:wl this was the response  Sorry, the installation of this driver failed. Please have a look at the log file for details: /var/log/jockey.log   From the log file:  2013-02-09 00:49:57,904 DEBUG: BroadcomWLHandler enabled(): kmod disabled, bcm43xx: blacklisted, b43: enabled, b43legacy: enabled 2013-02-09 00:50:05,572 WARNING: modinfo for module wl failed: ERROR: modinfo: could not find module wl 2013-02-09 00:50:05,572 WARNING: /sys/module/wl/drivers does not exist, cannot rebind wl driver 2013-02-09 00:50:05,600 DEBUG: BroadcomWLHandler enabled(): kmod disabled, bcm43xx: blacklisted, b43: enabled, b43legacy: enabled    Now it looks and feels like I'm doing everything right and the similar searchs seemed to suggest doing what I've done, so what am I doing wrong and how does one enable this driver? second to last line of the log suggests the file or directory is missing, is there somewhere I can get a linux broadcom driver from to put in that directory? If it's missing why is it in the list?  Please help, while the graphics driver is only partially supported it has given me the right resolution, and everything runs without crashing (but the system information says it's an unknown graphics card, I can live with that) but without the wireless card working I have sit really close to the router thanks to a very short cable...  Hopefully I've given enough information, please send Linux.Ninjas to help.  --  OK, used.  lspci|grep Network    not sure if that would give differentt results but I got   01:00.0 Network Controller: Broadcom Corporation BCM4311 802.11b/g (rev 01)    so then used   iwconfig    and got   lo no wireless extensions.  wlan0 IEEE 802.11bg ESSID:off/any  mode:managed access point not-associated tx-power=0 dbm  Retry long limit:7 RTS thr:off Fragment thr:off power management:on   eth0 no wireless extensions   --  After @Chili555 advice I did   sudo apt-get remove --purge bcmwl-kernel-source   But got   E: dpkg was interupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.   When I do it runs ok, but then crashes and freezes. Halway through it says that it's fixing recurrent problems but needs rebooting, then gets to a line "End of trace" and thats where it halts.


What's the meaning of Mushrooms it is? What is this grammar structure and inversion? Please include a grammar source and some more examples.  Arlene: would you like to go to a movie tonight? Jim: I'd rather stay home and watch T.V. Arlene: Sounds good. Maybe we could make dinner later. Jim: I'd rather not cook tonight. Let's order out for some pizza. We haven't done that for a while. Arlene: OK. Mushrooms or anchovies? Jim: I'm in the mood for pepperoni. Let's get a pepperoni pizza. Arlene: I'd rather not. Pepperoni gives me heartburn. I'd rather have mushrooms than pepperoni, if that’s OK with you. Jim: Mushrooms it is! Now. What should we watch on TV? How about the new Stephen King thriller?

I was googling but I couldn't find any answers:  What is the precise meaning of the words 'it is', when they are used in a way        Are we going to the cinema on Friday or Saturday?   I don't have any time on Friday.   OK, then Saturday it is.


I'm not sure whether it's appropriate to ask this here. I'm concerned about the memory allocation and I don't know where to read up on that.  I'm debating with myself whether I should declare local variables per root-finding function, or just use global variables that each function can reuse per call. Please note that I don't plan on using recursion here. Just (do-)while (or for) loops only.  I'd really appreciate it if I can get sufficient explanation too.  // [1] // global(?) variables // functions.cpp  #include <cmath> #include "functions.h"  using namespace std;  double guess1;     // upper double guess2;     // lower double root; double prevGuess; double sigFigs; double minSigFigs;  double newt_rhap(params) {    // do stuff } double bisection(params) {    // do stuff }   ===============  // [2] // local variables // functions.cpp  #include <cmath> #include "functions.h"  using namespace std;   double newt_rhap(x,y,z,f(),f_prime()) {    double guess = x;    double sigFigs = y;    double minSigFigs = z;     // do stuff } double false_position(w,x,y,z,a()) {    double xr;    double upper = w;    double lower = x;    double xprev;    double fxr;    double fxu;    double fxl;    double sigFigs = y;    double minSigFigs = z;     // do stuff }

In C/C++, are global variables as bad as my professor thinks they are?


I know that latest official openJDK is java version "1.7.0_25". But there is java version "1.7.0_40" in development. Does anyone know how to install openJDK "1.7.0_40" on an Ubuntu machine?

How do I install Java, including in my browser, so websites with Java work?


I'm performing regression on data derived from a known underlying model with normally distributed errors, and I don't understand how the fitted regression coefficients can be as far as they are from the underlying model (coefficients 0, 1, -2 in underlying model, with coefficients -1.6, 6.2, and -23.9 in resulting regression). See below.  I'm seeking help in understanding this phenomenon. By the way, the phenomenon is insensitive to random seed (although the exact coefficients do vary in that circumstance).  The data is generated in R as follows:     set.seed(1)   x=rnorm(100)   y = x - 2*x^2 + rnorm(100)   The regression is simply:     lm2=lm(y~poly(x,2))   summary(lm2)      Residuals:       Min              1Q        Median          3Q          Max   -1.9650   -0.6254   -0.1288    0.5803    2.2700       Coefficients:                      Estimate  Std. Error   t value   Pr(>|t|)   (Intercept)   -1.5500      0.0958   -16.18   < 2e-16   poly(x, 2)1    6.1888       0.9580        6.46  4.18e-09   poly(x, 2)2  -23.9483      0.9580   -25.00   < 2e-16   Residual standard error: 0.958 on 97 degrees of freedom Multiple R-squared:  0.873, Adjusted R-squared:  0.8704  F-statistic: 333.3 on 2 and 97 DF,  p-value: < 2.2e-16

I'm trying to create a second order polynomial fit to some data I have. Let's say I plot this fit with ggplot():  ggplot(data, aes(foo, bar)) + geom_point() +         geom_smooth(method="lm", formula=y~poly(x, 2))   I get:    So, a second order fit works quite well. I calculate it with R:  summary(lm(data$bar ~ poly(data$foo, 2)))   And I get:  lm(formula = data$bar ~ poly(data$foo, 2)) # ... # Coefficients: #                     Estimate Std. Error t value Pr(>|t|)     # (Intercept)         3.268162   0.008282 394.623   <2e-16 *** # poly(data$foo, 2)1 -0.122391   0.096225  -1.272    0.206 # poly(data$foo, 2)2  1.575391   0.096225  16.372   <2e-16 *** # ....   Now, I would assume the formula for my fit is:  $$ \text{bar} = 3.268 - 0.122 \cdot \text{foo} + 1.575 \cdot \text{foo}^2 $$  But that just gives me the wrong values. For example, with $\text{foo}$ being 3 I would expect $\text{bar}$ to become something around 3.15. However, inserting into above formula I get:    $$ \text{bar} = 3.268 - 0.122 \cdot 3 + 1.575 \cdot 3^2 = 17.077 $$  What gives? Am I incorrectly interpreting the coefficients of the model?


I tried two ways. First I edited gdm3/custom.conf  sudo gedit /etc/gdm3/custom.conf   in order to add up a greetere section where the user to be hiden should be listed like  [greeter] Exclude=nobody,anakin,r2d2   I restarted Ubuntu and still the use to be hidden was shown on login screen. I tried to locate the [greeter] section before or after the [daemon] section with no more luck.  Second, I tried to install gdm3setup et gdm3setup-utils in the directory  /home/moi/IT/GIT This install is checked ok :  git status Sur la branche master Votre branche est à jour avec 'origin/master'. rien à valider, la copie de travail est propre   I aded-up /home/moi/IT/GIT to the $PATH by   export PATH=$PATH:/home/me/IT/GIT/gdm3setup   But still I can't find gdm3setup either in the applications list or in the Activities drop down list.  Some help would be much appreciated.  EDIT : Thanks to PRATAP, I managed to get rid of the user to be hidden during login. At Danzel's attention : the git deposits are here :  git clone https://github.com/Nano77/gdm3setup-utils.git git clone https://github.com/Nano77/gdm3setup.git   However, as I succeeded in my intent, I will no longer try to install gdm3setup. Thank you for your worthy help.

I have recently added several new users, that I need for qmail. Now they appear in the box in the login screen and clutter it, and I have to scroll to find my user. How can I hide those users from the login box?


I'd like to redefine \big, \Big etc. commands to change their dimensions for single equations. E.g.  {\makeatletter\renewcommand{\big}{\bBigg@{2}}\makeatother% \begin{equation} \big(\frac{1}{2}\big) \end{equation}}\relax   For practical reasons I'd like to define, in the preamble, a command like this:  \newcommand{\mybig}[1]{\makeatletter\renewcommand{\big}{\bBigg@{#1}}\makeatother}   so to have something like:  {\mybig{2}% \begin{equation} \big(\frac{1}{2}\big) \end{equation}}\relax   But it doesn't work. Where am I wrong?

After hours of banging my brain against my skull, I narrowed down an issue I'm having to the fact that \makeatletter doesn't work inside \newcommand. Commands that I call after \makeatletter are registered as undefined, as if \makeatletter didn't do anything.  Why is this the case?  In the example below, I define two commands. Calling one of them from the document body causes the undefined error, while the other doesn't.  \documentclass[11pt]{book} \usepackage{kvsetkeys}  \newcommand{\commandThatFails}{     \makeatletter \comma@parse{}{} \makeatother }  \makeatletter     \newcommand{\commandThatWorks}{         \comma@parse{}{}     } \makeatother  \begin{document}  Hi there.  \commandThatFails \commandThatWorks  \end{document}


I want to change the space between the dots in ToC in order to pass from this (an example)    To this    I have read the tocloft package but I can't understand how to do it.  Thanks for your help.

I am writing a small KOMA-Script scrartcl document with multiple sections. In the table of contents, LaTeX fills the current line with dots between the end of the section name and the page number. Is there any way to customize this behavior? I would like to reduce the space between the single dots (i.e. use more dots in the same space).


I'm wondering how I can use file_get_contents to load an external page and exit off before the page loads (I don't need the output). Here's the essential flow:   A: POST request with file_get_contents to B B:  and does a very long action A: finishes right after it makes the connection to B B: finishes after the very long action   How would I go about "exiting" right when script B starts executing (before the page loads)

I'm attempting to do an AJAX call (via JQuery) that will initiate a fairly long process. I'd like the script to simply send a response indicating that the process has started, but JQuery won't return the response until the PHP script is done running.  I've tried this with a "close" header (below), and also with output buffering; neither seems to work. Any guesses? or is this something I need to do in JQuery?  <?php  echo( "We'll email you as soon as this is done." );  header( "Connection: Close" );  // do some stuff that will take a while  mail( 'dude@thatplace.com', "okay I'm done", 'Yup, all done.' );  ?>


Suppose that $A$ and $B$ are commutative rings containing a field $k$, and $B$ is finitely generated $k$-algebra. Let $\phi: A\rightarrow B$ be a ring homomorphism with $\phi|_k =\mathrm{Id}$. I am trying to prove that if $M\subset B$ is a maximal ideal, then $\phi^{-1}(M)$ is a maximal ideal of $A$.    The case when $A \subset B$ is an integral extension of rings is well-known. I think I can also prove the result when $\phi$ is surjective.    discusses the case when $B$ is a finitely generated $\mathbb{Z}$-algebra but I am not sure how to generalize this.

Let $k$ be a field and let $A \subset B$ be two finitely generated $k$-algebras. Prove that the contraction of any maximal ideal of $B$ is a maximal ideal of $A$.   thank you very much again!


I want to be realistic whether I am a material who can complete PhD at top universities such as Stanford, Princeton, Berkeley or Caltech. Grad school courses were hard. I scored 3.5 GPA in my specialization for MS with thesis. My overall GPA was 3.42.  Whether I will get in these universities or not, that is different question. My concern is: If I get into one of these universities, say because of other achievements like research, LOR, SOP etc., it will be harder to maintain this GPA at these universities. Given the fact that U of Michigan has its Electrical Engineering Grad program is ranked 6th in US.  Any suggestions? Reason I want to apply to these universities is because of my area of research.   Course directly related to my research: I have A-, A. Closely related to area of research, but in my specialization: I have B+, A-, B+, B.  I do not want to talk lot about my MS thesis, because I want to focus more on rigor of the course and qualifying exam at these universities.

When applying to a PhD program in the US, how does the admissions process work? If an applicant is weak in a particular area, is it possible to offset that by being strong in a different area?  Note that this question originated from this . Please feel free to edit the question to improve it.


What would be the purpose of using a colour code for resistors instead of just printing their values?

I always wondered why color coding is still used on resistors in 2014.   Here is Wikipedia's word on the original reason why :      Colorbands were commonly used (especially on resistors) because they   were easily printed on tiny components, decreasing construction costs.   However, there were drawbacks, especially for color blind people.   Overheating of a component, or dirt accumulation, may make it   impossible to distinguish brown from red from orange. Advances in   printing technology have made printed numbers practical for small   components, which are often found in modern electronics.   However, like pointed out in this quote, printing small numbers on electronic is now quite an easy thing (or so it seems) and it would, in my opinion, be much more convenient, especially for colour-blind people.   Is there reason why we still use colour coding on resistors in 2014?


I have a pendrive with the ubuntu root partition encrypted with LUKS, and it's inside a lvm volume. How could I read the data from Windows 10?

The answer to this question used to be FreeOTFE (); sadly, the project has not been updated for three years and its website () is no longer online.  Is there any software available now that can be used to access LUKS/dm-crypt volumes from Windows, now that FreeOTFE is no longer maintained/available?


check my proof, I feel like I made a mistake :)  so I'm looking to prove that when $p(n)$ is $n!<n^n$, $p(n)$ is true for all $n>1$.  Base Case $$ p(2) \iff 2!<2^2 \iff 2<4 $$  Assume p(k) is true $$k!<k^k$$  Prove p(k+1)  $$(k+1)!<(k+1)^{(k+1)}$$ $$(k+1)(k)!<(k+1)(k+1)^k$$ $$(k+1)(k)!<(k+1)(k^k+1)$$ This part above. Can I assume that $1^k$ is always $1$ given any $k$ such that $k>1$? $$(k+1)(k)!<(k+1)(k^k+1)$$ $$(k)!<k^k+1$$ Then above, can I factor out a k+1 from both sides? $$(k)!<k^k+1$$  Is this a completed proof? Would my ending statement be something like "since we assumed $p(k)$ and $p(k+1)$ is still true given $p(k)$, and since $p(k+1)$ is a higher degree than $p(k)$...." (not sure what really to say here)?  trying again  prove p(k+1)  to start, im now looking to multiply the sides by (k+1)? not replace?  so   $$k!<k^k$$ $$(k+1)k!<(k+1)k^k$$ $$(k+1)!<(k^[k+1]+k^k$$

Call $P(k): k!<k^k$, for $k\geq 2$ Test it out with 2, and it's true ($2<4$).   Assume that $P(k)$ is true for some $k\geq2$.  Then show that $P(k+1)$ is true.   $P(k+1): (k+1)!<(k+1)^{k+1}$  Ministep: $(k+1)!=k!(k+1)$ Ministep: $(k+1)^{k+1}=(k+1)^{k}(k+1)$    $k!(k+1)<(k+1)^{k}(k+1)$  Can I just pull out that (k+1) and call it a day? That will make $k!<(k+1)^{k}$.   We're already assuming that $k!<k^k$, for some integer $k\geq 2$, and I don't think I need to prove that $k^{k}<(k+1)^{k}$. I mean, I guess I could go prove that as well, but let's assume for the moment that I don't have to. Since we're assuming the original $P(k)$ is true, I should be able to write $k!<k^{k}<(k+1)^{k}$ right? That would prove the $k+1$ case. Is this the correct way to go about things? It seems too easy, but makes sense.  Thanks for confirmation and/or pointing out mistakes!


I recently overhauled a website for a client. Their preference was to switch from a www url to a non-www url as part of the redesign.  Once we launched the site, it took a major plummet in its position on SERPs. Now, I know this could be for several reasons outside of the projected issue I presented. But has anyone else ever made a similar switch and saw their website take a decline on SERPs?  Thanks in advance for your comments.

After having read various articles on this site about WWW or Non-WWW website setup, ,  and , and after having setup a correct redirection rule in .Htaccess to at least eliminate duplicate contents (currently the non-www solution (e.g. http://example.com) I have a feeling that my site rank less since I changed this.   My confusion was strengthened by these two opponents:     &     Could the change of www.example.com >> http://example.com have a factual impact on ranking?  say either is better or worse. Are they holding information back?  I am confused fellow folks...  As much as I would like to separate facts from fiction, I am aware that not all the good valid information is written. Not on google webmaster site and perhaps not elsewhere. If so it seems out of date!  Does or does not a WWW domain impact SEO/rank better than its NON-WWW version? (Given that you have setup a proper redirect to avoid duplicates and go with one)


Is it possible to return two or more values from a method to main in Java? If so, how it is possible and if not how can we do?

I want to return two objects from a Java method and was wondering what could be a good way of doing so?  The possible ways I can think of are: return a HashMap (since the two Objects are related) or return an ArrayList of Object objects.  To be more precise, the two objects I want to return are (a) List of objects and (b) comma separated names of the same.  I want to return these two Objects from one method because I dont want to iterate through the list of objects to get the comma separated names (which I can do in the same loop in this method).  Somehow, returning a HashMap does not look a very elegant way of doing so.


Currently I'm on Windows 10, I want to install Ubuntu OS. I want to fully remove windows OS & want only Ubuntu running on my PC.  Is it possible ?  I will be using Ubuntu mostly to solve JAVA programs & SQL Queries.

I would like to see a full how-to guide on how to install Ubuntu.


After i installed shutter all my screenshots looks like this:    Anyone had and fixed this problem?  EDIT: probably relevant - i'm using ubuntu 17.10

I'm running Fedora 25 and I need to take a few particular screen captures so I've read that shutter is a great tool for that. Sadly I am unable to use it for some reason. Whenever I try to take a screenshot this is the result:


This is my first try on the Ubuntu. The original laptop ( Asus A43S Intel i5, 4 GB RAM,Nvidia GT-520M ) is running:  Windows 10 (free upgrade from window 7 during the window 10 introduction period)  Created the bootable USB using Universal-USB-Installer-1.9.8.7, with the BIOS ubuntu-18.04.2-desktop-amd64  Booted into BIOS using F2 button, selected to boot from USB (UEFI enabled) Popped up the selection page, Try Ubuntu without installing, install Ubuntu etc. Tried both option but the results are the same.Right after selection the screen goes black (but the background was lit and the fan started running a little faster. This remains the same for over an hour without any progress. Is my machine too old to run Ubuntu? Any idea how to fix this issue?

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I know that I can create up to 24 partitions (C to Z), can we create more? and how?  Thanks.

As we know, in Windows the partition location is prefixed with [a-z]:. What happens if there are more than 26 partitions?


From :     sometimes there will be characters in the text that can not be displayed, because no font that supports them is available to the computer. When this occurs, small boxes are shown to represent the characters. In slang those small boxes have sometimes been called "tofu".   Apart from the Noto font authors, I can find no further evidence for that use of the word tofu. What's happening here?

Is there a name to describe the situation where a particular  is shown on a computer screen in a particular , but this font does not have a  for this particular character?  Usually, the result looks like this: □    A kind of empty rectangle. Sometimes it shows the code for that character within the rectangle.    What do yo call this phenomenon?  If there is no name, is there a common term referring to this "rectangle"?  Some Japanese people call this "tofubake" because rectangles look like .  (It is not . Mojibake happens when  meta-information is lost. It is not the problem here. Using a better font solves this phenomenon, but does not solve mojibake. Selecting a character encoding solves mojibake, but does not solve this phenomenon.)


Traceback (most recent call last):   File "E:/Portable Python 3.2.5.1/Tasks/Wk7", line 16, in   monthlySalary = hourPay * 0.1   TypeError: can't multiply sequence by non-int of type 'float'  #Input hoursWorked #Input hourPay #Ask “Consultancy income? (Leave blank if none)” #   If value: #       Input consultFee #       monthlySalary = ((hourPay - (hourPay * 0.1)) * hoursWorked) + (consultFee – (consultFee * 0.2)) #   Elif no value: #       monthlySalary = hoursWorked * hourPay #print (“The monthly wage is $”,monthlySalary)  hoursWorked = input ("Hours worked: ") hourPay = input ("Hour pay: $")  consultFee = input ("Consultant fee? (Leave blank if none): $") consultFee == '' monthlySalary = hourPay * 0.1 '' == False monthlySalary = ((hourPay - (hourPay * 0.1)) * hoursWorked) + (consultFee - (consultFee * 0.2))  print ("The monthly salary is: $",(int(monthlySalary)))

I am typing to get a sale amount (by input) to be multiplied by a defined sales tax (0.08) and then have it print the total amount (sales tax times sale amount).  I run into this error. Anyone know what could be wrong or have any suggestions?   salesAmount = raw_input (["Insert sale amount here \n"]) ['Insert sale amount here \n']20.99 >>> salesTax = 0.08 >>> totalAmount = salesAmount * salesTax  Traceback (most recent call last):   File "<pyshell#57>", line 1, in <module>     totalAmount = salesAmount * salesTax TypeError: can't multiply sequence by non-int of type 'float'


I've a problem with a few packages that I've installed from the repositories in the past. However now I prefer to compile them myself because this makes it possible to use the newest version. Unfortunately Ubuntu remembers that once those packages have been installed from a repository so I get update reminders about 'new' versions in the repository even though those are older than my current version. How can I make Ubuntu to forget that those packages were installed from the repository?

Because of  I'd like to prevent apt-get upgrade and Update Manager from updating the "libgtk2.0-0" package.   How can this be achieved?


So here's an example, a user disliked my comment.   Honestly I'd rather ignore this flag though marking it helpful, but I don't want to discuss here what it the best action in this particular case in general. All I wonder about is what should I do as a moderator. I mean:   Act just like I am acting usual, but this is strange because even the most honest judge in the world does not adjudicate himself. Ignore this flag to avoid the possibility of preconceived decision.

I think I just witnessed a moderator decline a flag raised on his own comment. (I'm hesitant to discuss specifics unless I have to, as I don't mean to put anyone in a negative light.)  Since there are at least 2 other moderators per site, I'm not sure this should be allowed—I feel that either   only uninvolved moderator(s) should be able to view and handle flags on co-moderators' posts, or moderators should be able to view all flags, but a flagged moderator should not be allowed to decline a flag against him- or herself.   I have no personal issue with this moderator. I just felt in this case that there was truth in both sides (the moderator's as well as the flagging user's), and sought a win-win solution, i.e. by improving the disputed answer. Coming back an hour later to see that the moderator unilaterally declined the user's flag—that didn't seem fair to the user...  I am making some assumptions based on the "Last Seen" stat in the moderator tools, so if I'm simply mistaken on what happened, I apologize in advance.


If you run the following snippet, it will ignore the 'print' on line 2 and 'exit' on line 3.  However, if you comment out the already unreachable 'yield' from line 4, lines 2 and 3 will execute normally.  This makes me think that Python (3.5.2) looks for a 'yield' anywhere in the function, and if one is found, even an unreachable one, nothing is executed until a next() is called on the returned iterator.  Up until now, I was under the impression that the function would execute normally up until hitting a yield, at which point it would begin acting like an iterator.  def func():     print("> Why doesn't this line print?")     exit() # Within this function, nothing should matter after this point.  The program should exit     yield "> The exit line above will exit ONLY if you comment out this line."   x = func() print(x)   Does this seem strange to anyone else?  Does anybody have some insight to share here?

What is the use of the yield keyword in Python? What does it do? For example, I'm trying to understand this code1: def _get_child_candidates(self, distance, min_dist, max_dist):     if self._leftchild and distance - max_dist < self._median:         yield self._leftchild     if self._rightchild and distance + max_dist >= self._median:         yield self._rightchild    And this is the caller: result, candidates = [], [self] while candidates:     node = candidates.pop()     distance = node._get_dist(obj)     if distance <= max_dist and distance >= min_dist:         result.extend(node._values)     candidates.extend(node._get_child_candidates(distance, min_dist, max_dist)) return result  What happens when the method _get_child_candidates is called? Is a list returned? A single element? Is it called again? When will subsequent calls stop?   1. This piece of code was written by Jochen Schulz (jrschulz), who made a great Python library for metric spaces. This is the link to the complete source: [Module mspace][1].


Our development environment consist of JBoss 5.0.1 DB Server, SQL Server 2008, Oracle IDM. Hardware is Win 2008 32 bit, 4GB RAM. We have reached stage where our environment can not handle application resulting in JBoss shut down throwing out of memory errors and CPU reaching to 90% usage. I am looking methodology to calculate correct server sizing where I input TPS, max number of concurrent users, max CPU utilization etc.. to give me number of servers, RAM size, number of cores. I am expecting application to grow 10% annually. Load Balancer and Failover should also be taken in account while sizing.

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


I m having such type of XML with me   <?xml version="1.0" encoding="UTF-8"?> <ArrayOfCustomer  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:xsd="http://www.w3.org/2001/XMLSchema"  xmlns="http://tempuri.org/">  <Customer> <Customer_id>143</Customer_id> <Cust_last_name>Deutsch</Cust_last_name> <Cust_first_name>Leslie</Cust_first_name> <Gender_id>2</Gender_id> <Email>ldeutsch16@univ.demo</Email> <Income_id>3</Income_id> </Customer>  <Customer> <Customer_id>327</Customer_id> <Cust_last_name>Marko</Cust_last_name> <Cust_first_name>Shelby</Cust_first_name> <Gender_id>1</Gender_id> <Email>smarko75@free.demo</Email> <Income_id>5</Income_id> </Customer>  </ArrayOfCustomer>   Can u suggest how to parse it ?

Is there a simple method of parsing XML files in C#? If so, what?


The stuff after the #### are just to tell you what I am doing and it's not actually part of my ssl.conf file  Trying to modify an ssl.conf configuration to do the following...  RewriteCond %{REQUEST_URI} ^/$ RewriteRule ^/(.*) https://misc.org/scores [L,R=301]  # takes misc.org and makes it misc.org/scores  #1  RewriteRule ^/scores/liverpool https://misc2.org/liverpool2 [L,R=301] # redirect for '/scores/liverpool to misc2.org/liverpool2' works  #2  RewriteRule ^/scores/liverpool/child https://misc2.org/liverpool2/child [L,R=301] # only redirects to /misc2.org/liverpool2 and never makes it to /misc2.org/liverpool2/child   If I comment out #1...#2 works but I need both to work.    What am I missing?  Thanks in advance

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


Question about DES-CBC : how to know IV if I have key, input buffer (plaintext),  output buffer (encrypted) and decrypted result where first 8 bytes are incorrect but all other bytes are correct ?"

If I have the plain text, the ciphertext and the key for an AES-128 CBC operation, can I determine the IV, even if I don't know the padding (assuming the padding follows one of the more common formats)?  I believe it should be possible since my understanding is that the IV is only used as an initial XOR of the plain text in encryption, and should, therefore, be able to be available like this:  AESDecrypt(key, ciphertext) => (PlainText XOR IV); IV = ((Plaintext XOR IV) XOR (Plaintext))   Is this correct?


Well, robots.txt prevent crawling and meta robots tag in HTML (or) X-Robots-Tag HTTP header prevents indexing (and other functionalities available too).  So, even when a URL is disallowed in robots.txt, it can be indexed in Google if it is referenced somewhere using an anchor tag.  So, my question is, how can I prevent public CDN URL being indexed by Google?  For example, I upload an image on Facebook which is private. But, the CDN URL holding the data is actually public, so anyone with the complete link can access the content. How does Facebook prevent these URLs being indexed?  Example textual URL:   Now, I posted the above URL here. Will google index this URL? Update:  How about this anchor URL: .  Will this be indexed if this is referenced this way?  Update:  When I say "link indexing", I'm not talking about  but .   Example:  in the site's  but you can see that it is actually indexed.  My question is, how does Facebook prevent the FBCDN URL above being indexed while you search like this in Google: site:fbcdn.net inurl:21616414_867163746798211_8462429064810946636_n.jpg  This didn't work, and my question is how does Facebook do this.  Reference 1:   Reference 2:   Reference 3:  (Check the table at bottom)

I use a cookieless sub domain static.example.com to serve all images, js, and css files. This static sub domain has as its root directory the same directory as the parent http://example.com. So static.example.com/index.php will result in calling the same file as http://example.com/index.php  Google has taken up indexing static.example.com and I need to stop this.  I can't modify robots.txt since it would apply to both domains. Webmaster tools allows "temporary" removal of a link, but this needs to be permanent.  I registered this static domain through google as a separate site from example.com, but this doesn't seem to buy me anything since I can't see a way to block crawling without using robots.txt - which would block it from the parent domain.  Any other ideas?  UPDATE  Found this conversation on   I am looking into whether it's possible to insert a META tag dynamically into the header of every page called on the static domain using php  CLARIFICATION  I am not putting any content on static.domain.com. There are NO webpages on it that are called - it only serves images. I have it redirecting to the same root directory as the main site for ease of coding image links (not every image is fed from the same image path).  Google got a hold of the static web root address - probably because .htaccess redirects to index.php if a file is missing and then crawled it. Now Google is showing the static version of the same pages with search results.


Just wondering, how do you find out the name of the method that invokes another method? I want to use the    Method   class.

I need to find the caller of a method. Is it possible using stacktrace or reflection?


I am calculating an integral $\displaystyle \int \limits_{-\infty}^{\infty}\dfrac{\sin(x)}{x}$ and I dont seem to be getting an answer.    When I integrate by parts twice, I get: $$\displaystyle \int \limits _{-\infty}^{\infty}\frac{\sin(x)}{x}dx = \left[\frac{\sin(x)\ln(x) - \frac{\cos(x)}{x}}{2}\right ]_{-\infty}^{+\infty}$$   What will be the answer to that ?

A famous exercise which one encounters while doing Complex Analysis (Residue theory) is to prove that the given integral: $$\int\limits_0^\infty \frac{\sin x} x \,\mathrm  dx = \frac \pi 2$$ Well, can anyone prove this without using Residue theory?  I actually thought of using the series representation of $\sin x$: $$\int\limits_0^\infty \frac{\sin x} x \, dx = \lim\limits_{n \to \infty} \int\limits_0^n \frac{1}{t} \left( t - \frac{t^3}{3!} + \frac{t^5}{5!} + \cdots \right) \,\mathrm  dt$$ but I don't see how $\pi$ comes here, since we need the answer to be equal to $\dfrac{\pi}{2}$.


I currently have a HCL Beanstalk desktop PC which is quite old now. I have another shared and quite new HCL Laptop with intel CORE i3 processor and it came with Ubuntu 12.04 LTS on it as it is a government laptop. Having used Ubuntu on that laptop now, I wish to install Ubuntu on my desktop as well. Can someone please provide me the link for the desktop version as I am quite a N00B in these matters and might end up with a bricked desktop. And after download, how do I install it from boot DVD?

I would like to see a full how-to guide on how to install Ubuntu.


I am trying to test if there is any significant difference between the areas under two curves.  x-axis: length of stay (los) y-axis: percentage curve1: control group curve2: intervene  Any idea how can I do it?  Thanks!

I have a test set of 100 cases and two classifiers.  I generated predictions and computed ROC AUC, sensitivity and specificity for both classifiers.  Question 1: How can I compute p-value to check if one is significantly better than the other with respect to all scores (ROC AUC, sensitivity, specificity)?    Now, for the same test set of 100 cases, I have different and independent feature assignments for each case. This is because my features are fixed but subjective and provided by multiple (5) subjects.  So, I evaluated my two classifiers again for 5 "versions" of my test set and obtained 5 ROC AUCs, 5 sensitivities and 5 specificities for both classifiers. Then, I computed the mean of each performance measure for 5 subjects (mean ROC AUC, mean sensitivity and mean specificity) for both classifiers.  Question 2: How can I compute p-value to check if one is significantly better than the other with respect to mean scores (mean ROC AUC, mean sensitivity, mean specificity)?    Answers with some example python (preferably) or MatLab code are more than welcome.


His first law of motion states that every object will remain at rest or in uniform motion in a straight line unless compelled to change its state by the action of an external force.  That means, delta(a) = 0 if external F = 0. ..... (i)  His second law of motion can be formally stated as follows: The acceleration of an object as produced by a net force is directly proportional to the magnitude of the net force, in the same direction as the net force, and inversely proportional to the mass of the object.  That means, delta(a) = F/m. ...... (ii)  If we put F = 0 in eq. (ii), then we get delta(a) = 0. But wait! Isn't this exactly what first law says? So is first of law a corollary of the second law? And if so, why the obviously-not-stupid Newton proposed it as another law rather than proposing a corollary? Are we missing something?

Newton's second law says $F=ma$. Now if we put $F=0$ we get $a=0$ which is Newton's first law. So why do we need Newton's first law ?   Before asking I did some searching and I got this: Newtons first law is necessary to define inertial reference frame on which the second law can be applied.  But why can't we just use Newton's second law to define an inertial frame? So if $F=0$ but $a$ is not equal to 0 (or vice versa), the frame is non-inertial.  One can say (can one?) we cannot apply the second law to define a reference frame because it is only applicable to inertial frames. Thus unless we know in advance that a frame is inertial, we can't apply the second law.  But then why this is not the problem for the first law?  We don't need to know it in advance about the frame of reference to apply the first law. Because we take the first law as definition of an inertial reference frame.  Similarly if we take the second law as the definition of an inertial frame, it should not be necessary to know whether the frame is inertial or not to apply the second law (to check that the frame is inertial).


I recently purchase some JBL SP8II wall-mount speakers that I would actually like to use in the ceilings. However these speakers don't come with a between-the-studs support of any kind (there is a wall bracket but it's a flimsy plastic that wouldn't add any support for a ceiling mount situation).   Do you think my 1/2" drywall ceilings would support these 7lb speakers without creating sag? The installation instructions are basically to cut out a 8"x10" rectangular hole in the drywall and then put the speakers in that hole, mounting them to the drywall.   Thanks in advance!