While looking at the most common mistakes while working with const & readonly. I came across .  I tried doing with an example where an assembly AssemblyA contains the const and readonly 100 & 100 respectively. And now while consuming AssemblyA in AssemblyB, the application takes corrects values.  But when I changed the Const & ReadOnly to 200 & 200 and rebuilt AssemblyB. AssemblyB is consuming the 200 & 200. I just really want to replicate the scenario for when const value is being changed.  Below are scenarios    When const & readonly values are changed from (100,100) to (200,200) AssemblyA is build, run AssemblyB it consumes the updated values(200,200) When const & readonly values are changed from (100,100) to (200,200) and .cs is saved. Then AssemblyB it consumes the  values(100,100). Is this what the post tells us?? When const & readonly values are changed from (100,100) to (200,200) and .cs is saved. Then AssemblyB is rebuilt,it consumes the updated values(200,200).   So anybody tell me how these const and readonly variable work when dealing with different assemblies.  Please help in this understanding. It would be great help Thanks in advance Below is the code :  AssemblyA  public class ClassA {     public const int Constant = 400;     public readonly int ReadOnly = 400; }   AssemblyB  using ConstantAndReadOnly;  namespace ConsumerClass {     class Program     {         public void GetConstAndReadOnly()         {             Console.WriteLine(ClassA.Constant);             ClassA obj = new ClassA();             var readOnly = obj.ReadOnly;             Console.WriteLine(readOnly);          }          static void Main(string[] args)         {             Program objClass = new Program();             objClass.GetConstAndReadOnly();             Console.ReadKey();         }     } }

What is the difference between const and readonly in C#?   When would you use one over the other?


I am using the SABS dataset:   In particular, let's say I am using the "SABS_1314_High" layer. (This provides the school attendance boundaries for many US school districts.) The identifying variable is "ncessch".  I also have a list of latitude and longitude coordinates that looks like this ("sampledata.csv"):  num lat long 1   37.378309   -122.052739 2   37.320722   -122.020981 3   37.436397   -122.149727   For each row of this, I want to know the "ncessch" value of the polygon that the point belongs in.  After much trial and error (I am completely new to GIS, though not to R), I am able to read in the shapefile properly, together with its projection:  library(rgdal) poly3 <- readOGR (".", "SABS_1314_High") proj4string(poly3) [1] "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0"   I can also create a SpatialPointsDataFrame for my list of points:  library(sp) locations <- read.csv("sampledata_2.csv", header = TRUE) locations <- SpatialPointsDataFrame(locations[ , 2:3], locations)   At this point, it would appear that I need to use the over function in the sp package to check, for each point, which polygon it lies in, but that throws an error:  over(locations, poly3) Error: identicalCRS(x, y) is not TRUE   It would therefore appear that the projections are not the same. Okay, so I tried a couple of different things:  library(mapproj) locations.proj <- mapproject(locations[,2], locations[,3], projection = proj4string(poly3)) Error in min(x, na.rm = na.rm) : invalid 'type' (list) of argument In addition: Warning message: In is.na(x) : is.na() applied to non-(list or vector) of type 'S4'   Using a different package:  library(proj4) locations.proj <- project(locations[,2:3], proj = proj4string(poly3)) Error in as.numeric(x) :    cannot coerce type 'S4' to vector of type 'double'   What am I missing?

I am trying to figure out how I can transform my unit of length from decimal degree to km when I import the following simple ArcGIS polygon shape.  Ultimately, I would like to have this information available when I assign this spatial polygon to my window in spatstat [i.e., Window area = xx square unit & Unit of length: xx km].   I did came across this post:   This is what I've done so far, but I don't understand why/if I need to do so. Doesn't my div0A SpatialPolygonsDataFrame already has my CRS argument defined? Why do I need to spTransform then?  library(spatstat) library(maptools) library(lattice) library(sp) library(foreign) require("rgdal") div0A <- readOGR(dsn="Archive", layer="Projections") > summary(div0A) Object of class SpatialPolygonsDataFrame Coordinates:      min       max x -80.00 -57.63430 y  66.25  78.16666 Is projected: FALSE proj4string : [+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0] Data attributes:        Id      NPAzimutha         UTM20            UTM19           AlberEA        Min.   :0   Min.   :348877   Min.   :349232   Min.   :349162   Min.   :348656    1st Qu.:0   1st Qu.:348877   1st Qu.:349232   1st Qu.:349162   1st Qu.:348656    Median :0   Median :348877   Median :349232   Median :349162   Median :348656    Mean   :0   Mean   :348877   Mean   :349232   Mean   :349162   Mean   :348656    3rd Qu.:0   3rd Qu.:348877   3rd Qu.:349232   3rd Qu.:349162   3rd Qu.:348656    Max.   :0   Max.   :348877   Max.   :349232   Max.   :349162   Max.   :348656   proj4string(div0A) <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs") xxlcc <- spTransform(div0A, CRS("+init=epsg:4326")) res1 <- lapply(slot(xxlcc, "polygons"), function(x)   sapply(slot(x, "Polygons"), slot, "area"))  > summary(unlist(res1))    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.   89.72   89.72   89.72   89.72   89.72   89.72  newW<-as(xxlcc, "owin") > summary(newW) Window: polygonal boundary single connected closed polygon with 29 vertices enclosing rectangle: [-80, -57.6343]x[66.25, 78.16666]units Window area =  89.7204 square units   Does this look correct? How can I specify/know my unit of length in km? Moreover, this window is ~Baffin Bay, west of Greenland and I am wondering if I should be using a different datum? E.g. EPSG Projection 4747 - GR96? Although, I will have to create ppp object, for which the coordinates have been taken with GPS satellite navigation system.  I would appreciate if someone can walk me through this or suggest an online example or further readings. I read chapter 4: Spatial Data Import and Export in Applied Spatial Data Analysis with R (2008), but I'm obviously very new to all of this.


If matrix A is orthogonal (dot product of each pair of its columns is zero; also dot product of each pair of its rows is 0; dot product of each row or column with itself is 1), show that $A^T = A^{-1}$.  I'm stuck with this proof because I'm not sure how to theoretically calculate $A^TA$ and $AA^T$.

So the question is in the title. It's easy to prove when we know that there are real numbers in it and the dot product is standard. But why this works in the general case - when there are complex numbers inside and the dot product is something else?


In a 2D environment, I have a circle with velocity v, a stationary point (infinite mass), and I am trying to calculate the velocity of the circle after a perfectly elastic collision with the point.   This is what I've came up with:   $p$ is the position of the point  $c$ is the position of the circle  On a collision, the new velocity is $normalize(p - c) * velocity.magnitude$.    Would this approach be right? If not, how do I correctly determine the velocities after a collision?

I am implementing this simplified model at the moment, and I am trying to get my head around the physics concepts behind this model.    So the model has two parts, first is collision predictions, and then collision resolution.  The collision resolution part says that:     When two hard discs collide, the normal force acts along the line   connecting their centers (assuming no friction or spin). The impulse   ($J_x, J_y$) due to the normal force in the x and y directions of a   perfectly elastic collision at the moment of contact is:   $$J_x = \frac{J\Delta rx}\sigma, ~~J_y = \frac{J\Delta y}\sigma$$ where $$J= \frac{2m_im_j(\Delta v\cdot \Delta r)}{\sigma(m_i + m_j)}$$      and where $m_i$ and $m_j$ are the masses of particles $i$ and $j,$ and $\sigma, \Delta x, \Delta y$   and $\Delta v \cdot \Delta r$ are defined as above. Once we know the impulse, we can   apply Newton's second law (in momentum form) to compute the velocities   immediately after the collision.   Can somebody walk me through the concept behind the impulse's above given formula? I am particularly interested how is the impulse related to $\sigma?$ I tried to find an explanation on-line, but none of the tutorials talk explicitly about $\sigma.$  I know that my knowledge is limited (I have never taken dynamics or kinetics courses) but still, if this can be explained in layman terms than please don't give up on me. I will also be happy if somebody will point me to an on-line explanation off-site.    Update, based on @user115350's answer I did this: $$ J_x = J \cos(\theta) = J \frac{(\Delta rx_i + \Delta rx_j)}{\sigma_i + \sigma_j} $$ and similarly $$ J_y = J \sin(\theta) = J \frac{(\Delta ry_i + \Delta ry_j)}{\sigma_i + \sigma_j} $$  Then based on the velocity equations working backwards suggested by @lemon I get this: $$ J_x = m_i(vx_i^\prime - vx_i) $$ $$ J_x = m_j(vx_j^\prime - vx_j) $$ $$ J_y = m_i(vy_i^\prime - vy_i) $$ $$ J_y = m_j(vy_j^\prime - vy_j) $$  and then this: $$ J = \frac {m_i \Delta vx_i \sigma}{\Delta rx_i + \Delta rx_j} $$ $$ J = \frac {m_j \Delta vx_j \sigma}{\Delta rx_i + \Delta rx_j} $$ $$ J = \frac {m_i \Delta vy_i \sigma}{\Delta ry_i + \Delta ry_j} $$ $$ J = \frac {m_j \Delta vy_j \sigma}{\Delta ry_i + \Delta ry_j} $$  So from here, how can I combine these 4 equations to get the original compound formula of J?


The good: When I use plain TeX, and then run dvips to get the Postscript output, I see negative page numbers for the front matter in the thumbnail pages on the left in evince and gv (ghostview), followed by positive page numbers starting at 1 after the front matter, although okular shows positive pages pages starting at 1 for the front matter, ignoring the negative page numbers of the front matter.  The bad: When I convert the Postscript file to PDF using ps2pdf, all of my four PDF viewers show me the pages starting at 1 for the first physical page instead of using negative page numbers for the front matter. Then the numbering continues with a constant offset between the page number in the PDF thumbnails and the printed page number on each page.  What I would like is for the postscript-to-PDF conversion to produce a PDF file which shows pages -1 to -22 for the 22 pages of front matter, and then shows 1 for first page after the front matter. In other words, the thumbnails should show the page number which is printed on each page.  I've looked through the parameters for ps2pdf and dvips, but nothing there looks promising. I have heard that LaTeX users do get the right result, but I am using plain TeX.  PS. Here's a sample file which demonstrates the problem.  % test1.tex   2015-8-4   Alan U. Kennington. % Demo of using \pageno to set negative page numbers, like normal plain TeX. % Compile with tex, dvips and ps2pdf.  \pageno-1 Page minus 1. \vfill\eject Page minus 2. \vfill\eject  \pageno1 Page plus 1. \vfill\eject Page plus 2. \bye   The PDF viewers show pages i and ii as 1 and 2. Then they show pages 1 and 2 as 3 and 4. I would really like them to show i and ii as -1 and -2. Then they should show pages 1 and 2 as 1 and 2.

I am using (plain) TeX (not LaTeX or any other ...TeX). I want a pdf file made from my TeX-source/output that is able to have acrobat reader shown logical page numbers. My document’s preface page numbering should be displayed like “vi (6 of 123)” and the main part like “2 (12 of 123)” in acrobat reader’s tool bar.  How do i achieve that? Do I have to use \special, pdfTeX, dvipdfm(x)? How do I specify the roman numeral page numbers in the TeX source? Is there a (TeX) macro package for that?  Thanks to all TeX Wizards for your answers!


I'm writing code c++ in LaTeX using listing...but I have some weird output instead of "blank space " it appears unknown symbol, here is the code of the list:  \defverbatim[colored]\lstI{ \begin{lstlisting}[language=C++,basicstyle=\ttfamily\scriptsize,keywordstyle=\color{blue}\ttfamily,stringstyle=\color{red}\ttfamily,commentstyle=\color{green}\ttfamily,breaklines=true] fprintf(gnuplot,"set term postscript\n");   fprintf(gnuplot,"set output \"kmeans_graphs.ps\" \n"); fprintf(gnuplot,"plot 'nomExt.txt' lt 3 linecolor rgb \"red\", 'init_center.dat' lt 7 linecolor rgb \"blue\"\n");  fprintf(gnuplot,"plot 'nomExt.txt' lt 3 linecolor rgb \"red\", 'center_progress.dat' lt 7 linecolor rgb \"yellow\"\n");      fprintf(gnuplot,"plot 'nomExt.txt' lt 3 linecolor rgb \"red\", 'final_center.dat' lt 7 linecolor rgb \"green\"\n"); fprintf(gnuplot,"set term x11\n set out\n"); fprintf(gnuplot,"plot 'nomExt.txt' lt 3 linecolor rgb \"red\", 'final_center.dat' lt 7 linecolor rgb \"green\"\n");     cout<<"\tsaving all plots in the file directory with kmeans_graphs.ps name..."<<endl;     cout<<"\tdisplaying final center for the data set..."<<endl; \end{lstlisting} } \begin{frame}{partie 3 du code}{Extrait main.cpp} \lstI \end{frame}   Here is the output :  fprintf ( gnuplot , " set ␣ term ␣ postscript \ n " ) ; fprintf ( gnuplot , " set ␣ output ␣ \" kmeans_graphs . ps \" ␣ \ n " ) ; fprintf ( gnuplot , " plot ␣ ’ nomExt . txt ’␣ lt ␣ 3 ␣ linecolor ␣ rgb ␣ \" red \" , ␣ ’ init_center . dat ’␣ lt ␣ 7 ␣ linecolor ␣ rgb ␣ \" blue \"\ n " ) ; fprintf ( gnuplot , " plot ␣ ’ nomExt . txt ’␣ lt ␣ 3 ␣ linecolor ␣ rgb ␣ \" red \" , ␣ ’ ce n te r_ pr o gr es s . dat ’␣ lt ␣ 7 ␣ linecolor ␣ rgb ␣ \" yellow \"\ n"); fprintf ( gnuplot , " plot ␣ ’ nomExt . txt ’␣ lt ␣ 3 ␣ linecolor ␣ rgb ␣ \" red \" , ␣ ’ final_center . dat ’␣ lt ␣ 7 ␣ linecolor ␣ rgb ␣ \" green \"\ n " ) ; fprintf ( gnuplot , " set ␣ term ␣ x11 \ n ␣ set ␣ out \ n " ) ; fprintf ( gnuplot , " plot ␣ ’ nomExt . txt ’␣ lt ␣ 3 ␣ linecolor ␣ rgb ␣ \" red \" , ␣ ’ final_center . dat ’␣ lt ␣ 7 ␣ linecolor ␣ rgb ␣ \" green \"\ n " ) ; cout < < " \ tsaving ␣ all ␣ plots ␣ in ␣ the ␣ file ␣ directory ␣ with ␣ kmeans_graphs . ps ␣ name ... " << endl ; cout < < " \ tdisplaying ␣ final ␣ center ␣ for ␣ the ␣ data ␣ set ... " << endl ;

I'm seeing an odd character like a very flat U, where there should be a space, with the listings package. See example below. Does anyone have any idea why this is happening, or how to get rid or work around it?  \documentclass{standalone} \usepackage{underscore} \usepackage{listings} \usepackage[usenames,dvipsnames, rgb, svgnames, x11names]{xcolor} % Text layout \topmargin 0.0cm \oddsidemargin 0.5cm \evensidemargin 0.5cm \textwidth 16cm \textheight 21cm  \lstnewenvironment{cmd}[1][]{%   \lstset{language=sh, backgroundcolor=\color{LightSteelBlue1}, #1}} {}  \begin{document} \begin{cmd}[caption=Configuration file section including filters] [affy6] [...]     [[hapmap]]     phenofiles = "data/Hapmap6.0/Pheno/hapmappheno_909.csv",     genofile = "/data/snppy/Hapmap6.0/Geno/birdseed-v2.calls.txt"     anno_filter = "chromosome = 5"     idlink_filter = "studyid = 'CEU'"     some_other_stuff = "foo = bar" \end{cmd} \end{document}


My 8gb USB drive just became 4mb. I already tried the diskpart method, bootice, HP USB Storage Format. But still the capacity still the same. Is there other way?

After writing the FreeNAS IMG to a 16 GB USB flash drive, I can now only use 938 MB. I used the Win32 Disk Imager tool to write the IMG to the device. Then later, when I inserted the the USB drive into my Windows 7 computer it said that it had to be formatted, because it couldn't read it. I believe this is normal. So I formatted it inside Windows using the format option when prompted. So in Windows Explorer now, 938 MB is reported as capacity of this device.    Also, when i check the properties dialog box I can see the same numbers.    And when I check with diskmgmt.msc I can see there are several volumes I don't recognize and unallocated space of 12.79 GB.    Now, I have another 2 GB USB flash drive with the same problem. It too was used for FreeNAS, and it too has a reported capacity of only 938 MB. I thought it was broken there for a while, until I saw the same problem with this 16 GB model.  I tried using diskpart on the 2 GB model, and I saw that there were several partitions there (list partitions) just like on this one. So I used the clean option to try to wipe it, but that wiped off everything so it's totally useless now. I'm not sure how to rebuild it.  Is this a standard routine, like part of the whole "user experience", that whenever you make a bootable USB falsh drive with FreeNAS, it messes up your device? I am new to FreeNAS, so i wouldn't know. But it sure looks like it. Maybe it is in fact the format operation in Windows that messes things up... I don't know. It's not very nice.  How do I restore the capacity back to 16 GB-ish (14.9 GiB)?


I've observed a strange behaviour with Windows Update (Win7 SP1). The process svchost is consuming an entire core of my Virtual Machine (VirtualBox) doing nothing (i.e., there is no network traffic and the folder C:\Windows\SoftwareDistribution remains at the same size with the same number of files). Moreover, the process sometimes consumes a large quantity of memory (> 1 GB). I've also noted that sometimes the folder SoftwareDistribution increases in size during a period of time, and after that nothing happens and svchost continues to consume an entire core.  I know that the problem is with Windows Update, since I've tracked (using Resource Monitor) what service is related with the behaviour related above.  The image below shows what I'm facing:    The next image shows a detailed information about svchost:    If I try to perform the update, nothing happens. The Windows Update doesn't progress. See the image below:    I left this machine trying to do the update for 4 hours. During this time the consumption of CPU remained high (as related above) and no update was installed.  My question is the following:   What is the reason why Windows Update doesn't work and still consumes an entire core of my processor doing nothing?  Related Question(s):

I installed Windows 7 fresh and installed SP1. Now, when I try to check manually for Windows Updates it just hangs on the Checking for updates screen.    I tried running the tools in , but this did not fix the issue either:  No matter what I do it just hangs on the "Checking for updates..." screen and goes no further.


$ which doxygen /home/gauthier/bin/doxygen $ $(which doxygen) -v 1.8.13 $ doxygen -v 1.8.11 # <- ??? $ doxygen error: Doxyfile not found and no input file specified! Doxygen version 1.8.11 Copyright Dimitri van Heesch 1997-2015 # ... doxygen's help $ type -a doxygen doxygen is /home/gauthier/bin/doxygen doxygen is /home/gauthier/bin/doxygen doxygen is /usr/bin/doxygen   I'm trying to setup a new version of doxygen, to use in parallel to the one already on my machine.  I downloaded binaries, placed them somewhere in /opt, and created a symlink to them in my ~/bin, which is in my PATH.  As seen in the terminal paste above, running doxygen does not seem to call to the same binary found by which doxygen.  What might be going on?

Observation: I have an executable named foo, located in /b/foo. It is compiled against an old header of a dynamic library, causing it to segfault when executed:  $ foo Segmentation fault. // Expected behaviour.   Now, I compile a new version of foo to /a/foo against the new dynamic library that should execute just fine. Directory a/ is in my $PATH before b/, so /a/foo should be selected:  $ which foo /a/foo   When I execute foo, the following happens:  $ foo Segmentation fault.   Therefore, it seems that /b/foo gets executed, whereas "which" tells me that /a/foo should be executed. To make things weirder, when I run the full path $(which /a/foo), things run fine:  $ /a/foo OK!  $ cp /a/foo . $ ./foo OK!     To go yet one step further, if I now delete /a/foo:  $ rm /a/foo   Then /b/foo must surely be chosen, right?  $ which foo /b/foo $ foo bash: /a/foo: No such file or directory $ $(which foo) Segmentation fault. // Expected result.   Nope!  Fix: Source .bash_profile and .bashrc and the problem disappears.  Reproducibility: Every time. Just remove /a/foo, source ~/.bash_profile, create /a/foo, and the above observation re-occurs.  Question: Does anyone have an idea what went wrong here?  Hypothesis: "which" is up-to-date, but the system chooses based on "what was used to be the case". In my example above, /a/foo did not yet exist when the terminal was opened: I had only just created it. Therefore, when /a/foo was created, "which" did detect /a/foo, but the system still chose /b/foo, because it was somehow out of sync? But why is the system out of sync?


I've a 'classic' humanoid player with an animation controller and some animations.   This is the code i'm managing state changin          float h = CrossPlatformInputManager.GetAxis ("Horizontal");         if (h < 0) {             m_Animator.SetTrigger ("LeftWalking");         }         else if (h > 0) {             m_Animator.SetTrigger ("RightWalking");         }         else if (m_CharacterController.velocity.magnitude != 0) {             m_Animator.SetTrigger ("Walking");         }         else if (m_Jumping) {             m_Animator.SetTrigger ("Jump");         }         else {             m_Animator.SetTrigger ("Idle");             m_Animator.ResetTrigger ("Walking");             m_Animator.ResetTrigger ("LeftWalking");             m_Animator.ResetTrigger ("RightWalking");             m_Animator.ResetTrigger ("Jump");         }     }   My problem is that after i stop to press my "forward" button (that make my player walking), the walking animation continue to play itself till the end.   This is my state machine   This is options of Walking to Idle state    I'm pretty sure I've to "play" with HasExitTime and/or FixedDuration but i'm not sure...

I'm trying to make a simple idle-walk transition in Animator using Unity. I've set a script that changes the Speed value from the Animator, and it works perfectly when I move the character forward when the game is on.  The transitions work well between both animations, except that they don't start automatically after the speed has changed to greater than zero.  I've found out that it waits until the animation loop gets to it's end, which makes the game feel dull and not fluid at all.    I don't think there's an issue with the code, but I'm attaching it anyway:  #pragma strict var anim : Animator;  function Start () {     anim = GetComponent("Animator"); }  function Update () {     var move : float = Input.GetAxis ("Vertical");     anim.SetFloat("Speed",move);     transform.Rotate(0,Input.GetAxis("Horizontal"),0);     transform.Translate(0,0,(Input.GetAxis("Vertical")*Time.deltaTime*move)); }


I am currently studying the effects of intercontact time in a customer's purchase journey related to his/her purchase probability, as well as the influence of the number of contacts. Based on extensive literature I expected an inverted U-shaped relationship between intercontact time and purchase probability, which is why I developed the following model:  mylogit_poly <- glm(purchase_any ~ poly(intercontact_time, 2)  + number_contacts_mc, data = Subs1, family = "binomial"(link="logit")) summary(mylogit_poly)   Which results in:  [  Now, based on feedback I received from my supervisor, I tried different levels of the polynomial term. When I got to the model below (with poly being 4), I suddely get all significant results.  mylogit_poly4 <- glm(purchase_any ~ poly(intercontact_time, 4)  + number_contacts_mc, data = Subs1, family = "binomial"(link="logit")) summary(mylogit_poly)   [  My question now is what to make of this? Does this mean that the relationship can be considered fully non-linear? Can I infer something from this?  PS: My full model exists of an additional 15 control variables that I left out for the sake of complexity. The output shown above comes from the full model.


Trying to understand how font sizes in 3rd-party apps will be different on iPhone 6/6+ compared to 5S when all apps get iPhone 6/6+ support:   What are Apple's guidelines for app developers in terms of font sizes for 6/6+? How are they different compared to earlier iPhones? How strictly are those guidelines enforced via app moderation (or any other means)? Should all apps effectively demonstrate the same font size for similar UI elements, or they are allowed to decide on the size individually? Should DisplayZoom be strictly supported by every app developer? Should Dynamic Type be strictly supported by every app developer?

How font size is different in iPhone 6 / 6 Plus as compared to earlier iPhones (e.g. 5S)--given both the different screen size and DPI?   Did the perceived* font sizes in system interfaces and built-in apps grow proportionally with screen size?  [*] Perceived--i.e. as measured in milimeters/inches, not in pixels. What are Apple's guidelines for app developers in terms of font sizes for 6/6+ as compared to earlier iPhones? How strictly are they enforced via app moderation (or any other means)? Should all apps effectively demonstrate the same font size for similar UI elements, or they are allowed to decide on the size individually? Should DisplayZoom and Dynamic Type be strictly supported by every app developer?   The reason I'm asking is that with iPhone 4 I struggle with a small font in most of the apps I use--so curious whether it will change if I switch to iPhone 6/+.


I often find pages which are marked as duplicate in a block just below the question, and it looks something like this:     marked as duplicate by ..., ..., ... Jan 31 '17 at 23:59      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.   Why are there no links in the marked as duplicate block pointing to those duplicate questions? (F:A) (or a single link helping you point to those questions, see below)  It is quite frustrating that you have to think of similar questions (or try to rephrase your question) yourself and then look them up, if it could also supply those apparently known duplicate links.  When a user marks a question as duplicate, then I guess that user knows about the duplicate question in question (no pun intended) and might as well supply a link to that other question with little effort, so other users don't have to get creative to find it. (F:A)      (Sorry, the question grew very long. Please focus on above first before reading further)  As I am writing this I notice that when asking a new question (the window I am currently in) there are already functionalities showing similar questions as the one I am typing:     "Questions that may already have your answer" (F:E) a block with links to existing questions just below your new question title. "Similar Questions" (F:F) a pop-up block with links to existing questions in the sidebar. (only visible when your input focus is in the question-description-textarea)     Perhaps an alternative or additional feature could be to put general links in that "Marked as duplicate"-block, which give the same functionality (generated links) as I see here in the ask a new question window:     "See other questions that may have your answer" (F:B)   "See Similar questions" (F:C)     Come to think of it, those general links might also be useful for questions which aren't yet marked as duplicate.      There is already a sidebar "Related" (F:G) which seems to show links which also could be interpreted as "Similar Questions". If the links below "Related" are generated in the same way perhaps the title might be rephrased to "Related, similar or possible duplicate questions", so you know where to look. And put a "See Related" (F:D) #anchor link in the "Marked as duplicate" block which helps focus your attention on that Related block.    If the "Related" questions are generated differently then it might help to add a new block with "Similar (or possible duplicate) questions".    To make replies to this question a bit more managable let's mark mentioned features for easier reference:    Feature (F:A) : (new) when marking as duplicate, supply a link to the duplicate, and show that in de "Marked as duplicate box. Feature (F:B) : (new) a general "See other questions that may have your answer" link. Feature (F:C) : (new) a general "See Similar questions" link. Feature (F:D) : (new) a "see Related" link. Feature (F:E) : (existing) the "Questions that may already have your answer" list of links as seen on the asking a new question page. Feature (F:F) : (existing) the "Similar Questions" sidebar list of links as seen on the asking a new question page. Feature (F:G) : (existing) the "Related" sidebar list of links as seen on an existing question page.     Meta-meta:  Sorry for the wall of text, I was thinking about how to split this up but couldn't figure out how without losing cohesion on how all these things relate to eachother.  Wanted to add tag "question-linking" but not allowed to add new tags yet.  Ofcourse... only after typing all this I find duplicate questions to mine: (only showed up on the next page for my search for questions...) -     I Still feel my question covers more than the "duplicate question" mentioned above, so I thought it might be better to start this new question as a seperate question "thread" to cover all new mentioned options.

There is one box at the top with links to the duplicates, and one box under the question, starting with "marked as duplicate by ...". Actually I have never seen the links before today - I have totally missed them, so I have just wondered throughout all the years I have been a passive reader, where those duplicates were. I think when I have arrived at a page, I have just scrolled past the "header" (including the title of the question, an ad and the first duplicate box) down to the question text and the first answer, and there in between - the second duplicate box, which I have noticed. But there is no explanation or hint where to find the duplicates, which one have to find further up the page.  Reading and scrolling from the top to the bottom, I think it is illogical to go up again to find the links/duplicates, that the second box mentions. A notice could be written that they are "above", but I think it would just be better if these were combined, to have all information in one place/box.  Or is there any reason that this information should be split into two boxes?


I have a multiple regression equation that reads as follows: ln10(DV) = 0.437 + 0.394(ln10(IV_1)) + 0.061(IV_2) - 0.145(IV_3) I performed the ln10 transformations for the DV and for IV_1 to get around heavy skewness in the original data. The ln10 transformed data is normally distributed. IV_2 is a principal component (which hasn't been transformed) IV_3 is a variable that represents 0 = "disagree" and 1 = "agree" The ln10 transformation helped me to perform the regression but I'm now struggling to interpret what this means in practical terms, all help appreciated! (The model is significant, but has a fairly modest R^2 of .33)

I'm wondering if it makes a difference in interpretation whether only the dependent, both the dependent and independent, or only the independent variables are log transformed.  Consider the case of  log(DV) = Intercept + B1*IV + Error    I can interpret the IV as the percent increase but how does this change when I have   log(DV) = Intercept + B1*log(IV) + Error   or when I have   DV = Intercept + B1*log(IV) + Error   ?


I am currently reading Analysis on Manifolds by Munkres and this problem has me flustered.  $f(x, y) = \frac{xy(x^2 - y^2)}{x^2 + y^2}$ and $f(0) = 0 $. Show that $D_1D_2 f$ and $D_2 D_1f$ exist at $0$ but are not equal there?  I can calculate $D_1D_2f$ and $D_2D_1f$ using partial differentiation. Thus \begin{align} D_1D_2 f &= \frac{\partial }{\partial x}\left( \frac{\partial f}{\partial y}\right) = \frac{(x^2 - y^2)(x^4 + 10x^2y^2 + y^4)}{(x^2 + y^2)^3}\\ D_2D_1f &= \frac{\partial }{\partial y} \left( \frac{\partial f}{\partial x} \right) = \frac{(x^2 - y^2)(x^4 + 10x^2y^2 + y^4)}{(x^2 + y^2)^3} \end{align} So I know for a fact that this is not the way to go. However, how do I actually calculate $D_1 D_2 f(\bf 0)$ using definition of derivative? I can calculate $D_2 f(\bf 0)$ as follows: \begin{align} D_2 f({\bf 0}) &= \lim\limits_{\lambda \to 0}\frac{f({\bf 0} + \lambda(0 , 1)) - f({\bf 0})}{\lambda} = \lim\limits_{\lambda \to 0} \frac{f(0, \lambda) - 0}{\lambda} \\ &= 0 \end{align} How do I get a closed form function for $D_1 f$ 0r $D_2 f$ so I can take a second derivative?

$$f(x,y) = \begin{cases} \displaystyle \frac{xy(x^2-y^2)}{x^2+y^2} & \text{if } (x,y) \neq (0,0), \\ 0 & \text{if } (x,y) = (0,0). \end{cases}$$ I tried finding both mixed partial derivatives but they ended up being the same for that function. I must be failing to take into account something dealing with the fact that it is piece-wise. I still need to show the mixed partial derivatives exist. How can I do all of this?


If $a_n = \left(1+\frac{1}{n^2}\right)\left(1+\frac{2^2}{n^2}\right)^2\left(1+\frac{3^2}{n^2}\right)^3\ldots\left(1+\frac{n^2}{n^2}\right)^n$ then find $\lim_{n\to \infty} a_n^\frac{-1}{n^2}$

$$ a_n =\left(1+\frac{1^2}{n^2}\right)^1\left(1+\frac{2^2}{n^2}\right)^2\cdots \left( 1 + \frac{n^2}{n^2} \right)^n$$  $$\lim_{n\to\infty} a_n^{-1/n^2}$$  So I tried solving it by taking the logarithm.   Let the limit be $L$.   Hence,   $$\lim_{n\to\infty}\log(L) = \lim_{n\to\infty} \left(-\frac{1}{n^2}\log\left(1+\frac{1}{n^2}\right)-\frac{2}{n^2}\log\left(1+\frac{2^2}{n^2}\right)-\cdots - \frac{n}{n^2}\log\left(1+\frac{n^2}{n^2}\right)\right).$$  This looks like it should be tractable using the definition of   $$\int^1_0 f(x)\,dx =\lim_{n \to \infty} \frac{1}{n}\sum^n_{r=0}f\left(\frac{r}{n}\right)$$  with taking $f(x) = \log(1+x^2)$ but I am not being able to simplify it to the requisite form. I took this approach mainly because we were recently taught this in school, and it seems to work quite well. I would be interested in alternative solutions too of course. Thanks in advance.


I am transforming some TEI XML to HTML, and I need to list various parts of the document, preserving the numeration of the original.   Regular numbered lists are no problem, and any inconsistencies in the source numbering can be accommodated with the value attribute; but I am having problems getting around variations when the items use letters or symbols according to something other than a natural sequence, eg

this is Toulouse

this is Vauban

   Browsers seems to ignore this, and I'm not clear how CSS can help, as browsers seem to ignore the attr() function; unless I just use paragraph and fake up the hanging indentation.  Has anyone done this successfully?

How can I left-align the numbers in an ordered list?  1.  an item // skip some items for brevity  9.  another item 10. notice the 1 is under the 9, and the item contents also line up   Change the character after the number in an ordered list?  1) an item   Also is there a CSS solution to change from numbers to alphabetic/roman lists instead of using the type attribute on the ol element.  I am mostly interested in answers that work on Firefox 3.


When using the extra objects add on, I can create the shape (sine wave) I want by inputting the correct function.  Once I move onto another object, I can't reopen the options for changing the equation/size of the object.  I just want to add more periods to the sine wave but I can't get the original options for choosing the x and y size.

When you first add a cylinder, you have the option to change the number of vertices, etc, but once you do anything else in blender, it seems you no longer can edit those parameters.   Is there a setting anywhere or an add-on that allows these parameters to be edited later on? If not, how easy would such an addon/feature be to create for anyone reading this?


Has anyone in the Star Wars books ever wielded a black lightsaber, one that expels black light making the surroundings darker?  Is there a reason he/she uses one?

I just saw the fan film  and the Force-sensitive bounty-hunter, Korbain Thor, wielded an ochre lightsaber (or at least that's what  described it as).   I'm just wondering if ochre is a canon color for a lightsaber?


(Note: I apreciate very much who marked this as a duplicate but I would like an answer for why my proof is wrong)  This is my solution, I have no clue why it failed. Let's start:  define $$I_n(m) = \int_{0}^{x} \frac{t^m}{1 + t + t^2/2 + ... + t^n/n!}\ dt$$  so it should be true that  $$\sum_{m=0}^{n}\frac{I_n(m)}{m!} = x$$  Then I use Pascal inversion:  $$\sum_{m=0}^n \frac{n! I_n(m)}{m!} = n!x$$  $$\sum_{m=0}^n {n\choose m} B_n(m) = n!x$$  where $B_n(m) = (n-m)!I_n(m)$  by Pascal's formula:  $$I_n(n) = (-1)^nxn! \sum_{m=0}^{n} \frac{(-1)^m}{(n-m)!}$$  what did I do wrong ????

Calculate $$\int \limits {x^n \over 1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+...+\frac{x^n}{n!}} dx$$ where $n$ is a positive integer.  Would you give me a hint?


I am an active member on Stack Overflow and usually love to read all the questions and answers to improve my programming skills.  Recently I found an invalid answer and flagged that answer as Not an  Answer but it was disputed.  So main question is, Is there any procedure where the user who flagged the answer will be given some hint (comments) as to why that flag is being disputed so that flagging can be improved ?   is an example, I flagged this answer as "Not an answer" because this one is wrong. but flag was disputed without any comments.!!

In my flagging summary under the statistics, there is 1 flag listed as "disputed".  This is the first time I've ever seen a disputed flag in my summary, so I'm just curious, what is a disputed flag? How would you even dispute a flag? Is this the same as voting a flag as invalid?


Hey I know why they are there but is there anyway around having edges visible for cutting holes in ngons? I need it gone because the edges for my flashlight cut is visible on the model.

So, I'm working on a control station that has buttons. It is a one-mesh creation, that means, I don't want to create buttons and things like that separated from the main mesh, but as you can see, I have problems. I would like to make the highlighted parts to be one with the main part around them. I've tried everything, and I have this problem on multiple creations. Any idea?  Update: I've added another example of the problem. I want them to be one face, instead of two. (2nd picture)


I want to replace Windows 10 with Ubuntu 16.04 on my Dell computer.  What should I do?

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


I need to create 3 user groups and all of these groups must to have discount on all products in percent.  Example:  Group1 have discount of 10% on all products, Group2 have discount of 13% on all products, Group2 have discount of 16% on all products  Any idea how to do that?

I am using Drupal Commerce and I would like to know if it is possible to have discounted prices for registered users and much better for roles.  For example, the nomral price is $100 but when a user logs in that belongs to Role1 for example, he will see different prices with the percentage discount that I will have assigned to that role.  How can I accomplish such a feature?


My Multiple entry Schengen Visa (from Portugal embassy) is expiring on the 2nd of June 2019. I have to travel to Hungary (Budapest) on 2nd June. Is it possible to travel to Hungary on 2nd June, with new Schengen visa with validity from 3rd June?

I have a Schengen Visa issued by Germany, which expire on 11th Jan 2014, and I can remain in the zone till 11th Jan 23.59 PM. I have already visited Germany in the past with this visa, so I can travel whenever in Schengen zone directly from my country (Turkey).  I have a second Schengen Visa issued by Italy, which START on 12th Jan 2014, such that I can remain in Schengen zone from 12th Jan 00.00 AM onwards (I'm putting times to clarify which dates are inclusive).  I would like to travel to Greece with this visa: Entering the country on 6th January, and leaving the country on 19th January.  Is this allowed? Or do I have to leave the country first, and then re-enter through Italy?


I am trying to add the formula in the workflow mentioned below:  AND( ISCHANGED (Account.Name),OR( ( Account.Type  =  'Client')))    But it shows this error:     The ISCHANGED function cannot reference the Account.Name field   Basically I trying to do here is when I change the Account Name field on Contact and Account Type field on account is "Client", the Contact Owner should get an email alert.    The account name is a lookup value here. Can you suggest me a correct formula?

I am trying to add the formulae in the workflow mentioned below:   AND( ISCHANGED (Account.Name),OR( ( Account.Type  =  'Client')))    but it shows the error as Error:      The ISCHANGED function cannot reference the Account.Name field   Basically I trying to do here is when I change the account name field on contact and account type field on account is client,the contact owner should get an email alert.  The account name is a lookup value here. Can you suggest me a correct formulae?


Could someone please explain to me why the figure in my code is not appearing when I compile the code thanks.  MY CODE:  \documentclass{article} \usepackage{tikz,hyperref,multicol,lipsum,geometry,titlesec,fancyhdr,amsmath,MnSymbol,wasysym,fleqn}% \fancyhf{}% Clear all headers/footers \renewcommand{\headrulewidth}{0pt}% No header rule \renewcommand{\footrulewidth}{0.4pt}% No footer rule \fancyfoot[L]{*\href{myemail}{\emph{myemail}}}%  \usepackage{pgfplots} \pgfplotsset{compat=1.11}  \titleformat{\section}   {\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}  \geometry{margin=1in}  \title{Title} \author{\textbf{myname}*}  \begin{document} \maketitle  \begin{abstract} Abstract \end{abstract}  \begin{multicols}{2} \thispagestyle{fancy}%    \section{Introdution}    some writing   \begin{figure} \begin{tikzpicture}     \begin{axis}[         xlabel=$x$,         ylabel=$\mu(x)$     ]     % invoke external gnuplot as     % calculator:     \addplot[smooth,samples=180,domain=0.0001:20] {1/(1+(1/x))};     \end{axis} \end{tikzpicture}  \end{figure}    some writing      \end{multicols}  \end{document}

I am having the following problem with adding a figure inside the multicol environment:  \documentclass[10pt, twoside]{book} \usepackage{graphicx} \usepackage{subfig}  \begin{document}   \begin{multicols}{2}  a test file for picture inclusion along with the captions and labeling \begin{figure}  \centering  \includegraphics[width=5cma]{Cauchy_sequence_illustration-png}\\  \caption{Lets see}\label{pinki} \end{figure} \end{multicols}  \begin{figure}  \centering   \includegraphics[width=5cm]{Cauchy_sequence_illustration-png}\\  \caption{Lets see}\label{pinki} \end{figure}    \end{document}    After this while I am pressing Ctrl + Shift + X (usually I compile like this in DVI format and then clicking "dvi--->pdf" I convert it into PDF document.) the picture in multicol environment is not shown in YAP Viewer but the second one (which is outside of multicol environment) is shown along with the caption.  Kindly help me how to handle this problem. Please note that I am using the figure in .ps format. And I am not allowed to use any other format according to the instruction.


I came across some code (posted ) and I can't seem to figure out what I'm supposed to do with it. @namespace appears three times in the code. Here's what I'm looking at.   public string GetFullSchema()  {       string @namespace = "yourNamespace";       var q = from t in Assembly.GetExecutingAssembly().GetTypes()              where t.IsClass && t.Namespace == @namespace              select t;       XmlReflectionImporter importer = new XmlReflectionImporter(@namespace);       XmlSchemas schemas = new XmlSchemas();      XmlSchemaExporter exporter = new XmlSchemaExporter(schemas);       foreach (var x in q)      {          var map = importer.ImportTypeMapping(x);          exporter.ExportTypeMapping(map);      }       using (MemoryStream ms = new MemoryStream())      {          schemas[0].Write(ms);          ms.Position = 0;          return new StreamReader(ms).ReadToEnd();      }   }   Am I assuming correctly this is some sort of coding convention I'm unaware of? Should that line be replaced by something?

I discovered that you can start your variable name with a '@' character in C#.  In my C# project I was using a web service (I added a web reference to my project) that was written in Java. One of the interface objects defined in the WSDL had a member variable with the name "params". Obviously this is a reserved word in C# so you can't have a class with a member variable with the name "params". The proxy object that was generated contained a property that looked like this:  public ArrayList @params {     get { return this.paramsField; }     set { this.paramsField = value; } }   I searched through the VS 2008 c# documentation but couldn't find anything about it. Also searching Google didn't give me any useful answers. So what is the exact meaning or use of the '@' character in a variable/property name?


Some books contain boxes with additional advice, tips or questions which have a signaling symbol on the left (like a question mark, an exclamation mark, a light bulb etc.). Is there a package which offers something like this?

I am writing an Article in LaTeX.  Please suggest me how to create a highlight boxes like the ones shown below in LaTeX:


I've seen similar answered questions like this.  I'm unable to boot into my MacOS partition.  Long story short, I had Windows BootCamp, removed it and then later installed Ubuntu Linux, then tried to delete the Linux partition and I think I ended up deleting the Boot recovery partition. And then tried to run repair, and now my main mac partition now shows FFFFFFF something.  My Macbook is this one   I'm guessing my Macbook got updated to Mojave 10.14 before this happened but I'm not 100% sure of it, it may be on High Sierra but I'm guessing.  I'm booting into Internet Recovery and this is what I've pulled up in the pictures below.  I would like to be able to boot into my regular Mac OS partition.   I'm unable to figure out if the partition is a OS X Standard Partition or CoreStorage or APFS or etc. Is my recovery boot system too old if I need to use gpt to set it to an APFS argument? Should I check if the EFI partition and the Recovery HD partition are corrupted Would the 650 MB boot/recovery partion always be the last 650 MB of the disk Does the partition table contains an MBR instead of an PMBR and would the MBR need to be replaced by a PMBR? Previously the main MacOS partition was resized by me, how and when would be the best time and way for me to resize it to occupy the entire free space like stock?   Please Help.  It default boots into this.  If type exit, I get this.  Holding Option on boot shows   This is rest of the stuff I pulled from internet recovery        Please Help!

Yesterday, I have tried to delete an Ubuntu partition. Since, my Mac (13", MBPro mid-2014) doesn't boot. Now, I boot on Mac OS copy with an USB. i follow different subject of this forum (like this : ), and my volume partition change from FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF to 48465300-0000-11AA-AA11-00306543ECAC. But I still can't boot to it...    Thank you very much !


I can't say confidently that an atom is mostly vacuum, but I am somewhat sure of it because electrons and nucleons cover little space, and everything other than these elementary particles in an atom is vacuum.  Why is everything around us rigid even if the atom is mostly vacuum?  EDIT  The question over which this question is marked duplicate has a completely different premise as compared to this question as this question asks about rigidity of materials around us rather than interaction between things around us and their subsequent behavior that they do not pass through each other.

The ghostly passage of one body through another is obviously out of the question if the continuum assumption were valid, but we know that at the micro, nano, pico levels (and beyond) this is not even remotely the case. My understanding is that the volume of the average atom actually occupied by matter is a vanishingly small fraction of the atom's volume as a whole. If this is the case, why can't matter simply pass through other matter? Are the atom's electrons so nearly omnipresent that they can simultaneously prevent collisions/intersections from all possible directions?


I am trying to print the window without header and footer but if i print printContents as  then css are not attached and if i print originalContents then footer are seen as   . Thanks in Advance <script>    function printTicket(printable) {       var printContents = document.getElementById(printable).innerHTML;       var originalContents = document.body.innerHTML;       document.body.innerHTML = printContents;       window.print();       document.body.innerHTML = originalContents;    } </script>  This is button of print   <button type = "button" class = "btn btn-outline-secondary btn-preview" id="printable" onclick = "printTicket('printable')">Print</button>

I have a link on my webpage to print the webpage. However, the link is also visible in the printout itself.  Is there javascript or HTML code which would hide the link button when I click the print link?  Example:   "Good Evening"  Print (click Here To Print)   I want to hide this "Print" label when it prints the text "Good Evening". The "Print" label should not show on the printout itself.


I got 10 raised flags which are not reviewed yet and marked active. What will happen to them?

I have 17 flags waiting for review, where the oldest one is from 8th January Now I am wondering what happens with these old flags? Will they stay open until forever or is there a system that ensures every flag will be dealt with?


when I visit a website, the website gets my ip address.  Does it get any other info, i.e., MAC?  My ISP is TWC.

When you hit up a site, such as cnn.com, does the TCP/IP packet contain the MAC address of your network card?  Could cnn.com theoretically record my MAC address?


I'm trying to create an exec on mac to compile Latex, MakeIndex and BibTex in same time.  Here my make file :  latex -output-directory=build -interaction=nonstopmode sample.tex makeindex build/sample.idx makeindex build/sample.nlo -s nomencl.ist -o build/sample.nls latex -output-directory=build -interaction=nonstopmode sample.tex bibtex build/sample latex -output-directory=build -interaction=nonstopmode sample.tex latex -output-directory=build -interaction=nonstopmode sample.tex   But when I launch this exec with this in my sample folder, Terminal return me "Command not found".  I think this is a path problem but I'm not really efficient in this domain...

A lot of people write makefiles that say something like  paper.pdf: paper.tex         pdflatex paper         bibtex paper         pdflatex paper         pdflatex paper   To handle re-running TeX to get new/changed references and so forth. Is there a better way to do this?


Is it possible that apart from positive and negative charges, there is a third kind of charge that we have somehow, not discovered yet?  If not, is there some proof of the existence of only two types of charges?

Upon reading my book on physics, it mentions that there are only two discovered types of electric charges. I wonder if there could be a third type of elusive charge, and what type of effects could it have upon matter or similarly?


Drawing different size balls from a bag (No replacement)  Let's suppose I have a bag with $N$ balls inside. Each ball has a different size. The volume of the $i$th ball is $V_i$ ($i \in [1,N] \land j \in \mathbb{N}$). Let's assume that the probability of drawing the ball $i$ in a turn is proportional to $V_i$. That is to say: The bigger the ball the more likely it will be picked up from the bag. I want to draw $k$ balls from the bag-where $k < N$-one at a time and without replacement of the balls extracted.  Question: What is the probability of drawing the ball $i$ in this process?  This probability has to be expressed in terms of $k$ and $V_j$, where $j \in [1,N] \land j \in \mathbb{N}$.  Thanks!!!

Given $n$ items with weight $w_n$ each -- what is the probability that item $i$ is chosen in a $k$-out-of-$n$ "weighted random sampling without replacement" experiment? Can a closed-form solution that depends only on $w_i / w_\cdot$ be derived ($w_\cdot = \sum_j w_j$.)?   EDIT: A solution that depends only on $w_i / w_\cdot$ is impossible. Assume $n=3$, $i=1$, $w_1 = 1$, and two cases: (1) $w_2 = 1, w_3 = 1 + \varepsilon$, (2) $w_2 = 2, w_3 = \varepsilon > 0$. In case (1) the probability is almost $2/3$, in case (2) it is almost $1$, but in both cases $w_1 = 1$ and $w_\cdot = 3 + \varepsilon$.  What I have tried so far to solve the problem:  Let $P^n_k(w, i)$ be the probability that item $i$ is chosen in an $k$-out-of-$n$ experiment with weight vector $w$. In the first draw, the item is chosen with probability $w_i / w_\cdot$. Otherwise, we are looking for the probability to choose this item in a $k-1$-out-of-$n-1$ experiment, with the same weight vector except for the item that has been selected. Hence:  $$ P^n_k(w, i) = w_i / w_\cdot + \sum_{j \neq i} w_j / w_\cdot \cdot P^{n-1}_{k-1}(w - j, i) $$ $$ = w_\cdot^{-1} \left( w_i + \sum_{j \neq i} w_j \cdot P^{n-1}_{k-1}(w - j, i) \right) $$  with $w-j$ being "the vector $w$ without the $j$th element".  How to solve this recurrence relation? (If it is correct at all...)


I am learning regex. I am trying to get spans of a word in a text as follows:  import re reg=re.compile(r'\b({0})\b'.format('Ipsum'))  text = '''Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.  It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).   Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.  The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.'''  print reg.search(text).span()   Trouble is I am able to get only spans of the first location. How do I get spans for all matches of the word

How can I get the start and end positions of all matches using the re module? For example given the pattern r'[a-z]' and the string 'a1b2c3d4' I'd want to get the positions where it finds each letter. Ideally, I'd like to get the text of the match back too.


well I need do some things when new category is created,   I've been looking for which is the hook for this but I don't found nothing that's works.  If you can help me, thanks.

So, i have a function in my template file functions.php which cache a search form that contain a custom taxonomie terms. I want to flush cache (or delete one cache group) when I add/delete/edit terms of a specific taxonomie.  Is it possible? maybe with do_action, but for which hook? thx


We are going to work on a new project which is a website that contains many details of commercial companies in an area.  People can search for bars, shops, garages and so on.  We are brainstorming on the website structure.  For now we have a structure like:  Main categories  http://www.example.be/restaurant-tavern-bistro/  http://www.example.be/sports-relaxation/  http://www.example.be/pets-animals/  ...  Sub categories  http://www.example.be/restaurant-tavern-bistro/restaurant/  http://www.example.be/restaurant-tavern-bistro/lounge/  http://www.example.be/restaurant-tavern-bistro/italian-restaurant/  ...  Company details  http://www.example.be/restaurant-tavern-bistro/restaurant/company-1/  http://www.example.be/restaurant-tavern-bistro/restaurant/company-2/  http://www.example.be/restaurant-tavern-bistro/restaurant/company-3/  ...  But isn't this to long? Also it will contains some keywords more then once.  So another structure that we have in mind is:  Main categories  http://www.example.be/restaurant-tavern-bistro/  Sub categories  http://www.example.be/category/restaurant/  http://www.example.be/category/lounge/  http://www.example.be/category/italian-restaurant/  Company details  http://www.example.be/company/company-1/  http://www.example.be/company/company-2/  http://www.example.be/company/company-3/  What will be the best solution or pro and cons of one structure of another with SEO in mind?

Let’s take an example of a movie site. So a well structured set of URLs for this site can be:     Movie page - example.com/movies/the-matrix Review for movie - example.com/movies/the-matrix/reviews Trailers for movie - example.com/movies/the-matrix/trailers Specific trailer for movie - example.com/movies/the-matrix/trailers/trailer1   where it’s possible to navigate the resource even by directly deleting/appending resource name seamlessly.  For SEO purpose I read somewhere that for two given pages, Google will prefer the page which have search query up in the URL hierarchy among other things. So for the given 2 URLs and the query "the matrix trailer"    example.com/movies/the-matrix/trailers example.org/trailers/the-matrix/    `     Google might prefer the second URL as it has the keyword "trailer" at first level comparing to first URL which has "trailer" at 3rd level (a resource deeper in URL hierarchy may be less important).    If it is correct, one may be tempted to create URL hierarchy somewhat like      Movie page - example.com/movies/the-matrix Review for movie - example.com/reviews/the-matrix/ Trailers for movie - example.com/trailers/the-matrix/ Specific trailer for movie - example.com/trailers/the-matrix/trailer1     which will break the seamless hierarchy.    My questions are:   Is it true that resource deeper in URL hierarchy is tend to be less important when comparing to URLs of other site?   Is sacrificing meaningful, seamless hierarchy worth for this SEO optimization?


soon I'm going to start a little company. It's a company/website where a customer can configure their own pc. I am very experienced pc builder, but I never knew what PSU to use best. How do I know what PSU I need to use? Where do I start looking at before buying a PSU for the build. The wattage of volts? or maybe other things

Given that I am building a home computer from scratch and I have several components (MB, CPU, HDD, Video, Sound, etc) which have specific power requirements, is there a formula for me to calculate the size/capacity of the Power Supply I will need? I want to be able to expand the setup later on also...


I want to know if I should use may or  can for this sentence: **Can** I borrow your book **May** I borrow your book  I want to know which is more suitable in the context of politeness.

Which is correct if I want to request for a pen?        Can I have your pen please?   May I have your pen please?


is it possible to check for the presence of a DLL file and if it is present run some code that is accessing the DLL, but if you then remove the DLL file the code will not be run and start throwing exceptions?

Is it possible to instantiate an object at runtime if I only have the DLL name and the class name, without adding a reference to the assembly in the project? The class implements a interface, so once I instantiate the class, I will then cast it to the interface.  Assembly name:     library.dll    Type name:      Company.Project.Classname     EDIT: I dont have the absolute path of the DLL, so Assembly.LoadFile won't work. The DLL might be in the application root, system32, or even loaded in the GAC.


I am running Ubuntu 20.10 and have wine 6.0. Trying to install Adobe acrobat writer pro 9 or 10. But at last it showing some error like the picture. How to fix it?[This message appears at the end of installation process Installation result of adobe acrobat writer 9

Adobe Acrobat XI has a , meaning it should work, right? I right click acrobat.exe, and the installation wizard pops up and installs successfully with no errors. However, I tick the 'open application' box at the end of the installation and...nothing happens. Adobe Acrobat isn't appearing in my list of installed apps. Basically it's not working at all, despite a very promising installation. WineHQ has this to say on installing Acrobat XI:  What works opening documents, OCR. No problems by now. Acrobat asked me to install Adobe Application Manager (), so i did installed and no problem since then. What does not Isn't able to install. As first review said, use winetricks atmlib , and copy the acrobat folder into proper .wine folder.  Wine beginner here. Could someone explain what he means by use winetricks atmlib , and copy the acrobat folder into proper .wine folder. Could someone guide me through those steps slowly? Thanks. Greatly appreciated, really want to get acrobat working :)


A question in my assignment asks: Suppose that $X$ and $Y$ are independent with a common uniform distribution over $(0,1)$. Find the probability distribution function of $X+Y$. First I assume that I have a variable $a$ such that $a = X + Y$, and $ 0 < a <2$. I can then formulate the following: $$f_{X+Y}(a) = \int^\infty_{-\infty} f_X(a-y)f_Y(y)dy$$ So far so good, mostly just putting in formula. Now I'm stuck. A quick reference to the answer key tells me that the above is also: $$=\int^1_0f_X(a-y)\times1dy \\=\int^1_0f_X(a-y)dy$$ Can someone kindly explain the logic between the jump of converting the $(-\infty, \infty)$ to $(1,0)$, then assuming $f_Y(y) = 1$? How does that work, and does it have anything to do with the fact that I'm integrating w.r.t. $y$? Thank you in advance!

I am trying to understand an example from my textbook.  Let's say $Z = X + Y$, where $X$ and $Y$ are independent uniform random variables with range $[0,1]$. Then the PDF is $$f(z) = \begin{cases} z & \text{for $0 < z < 1$} \\ 2-z & \text{for $1 \le z < 2$} \\ 0 & \text{otherwise.} \end{cases}$$  How was this PDF obtained?   Thanks


There are fields on my server's control panel like this  Minute -  Hour -  Day of month - Month - Day of the week - Command  How can I create a cron job runs on first day of the month with this fields?

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


I have multiple tabs open in the chrome browser and I wants to shift to the previous active tab is there any shortcut for that or can I define any shortcut for that.  Scenario :  Working on multiple tabs more then 10 , I google some thing and now I am on that tab, I wants to go the facebook tab were I was last in. Its not the previous tab its in the middle of the tabs.

How do I toggle back to the last tab used in Chrome on Mac? Ctrl-Tab and Ctrl-Shift-Tab navigates the tabs in order.  But I want to switch back and forth between two tabs similar to how how Cmd-Tab switches between the last two apps.  There's  but is there a solution for Chrome?


There's a novel I read years ago but I can't remember the title. Here's what I do recall, hope it rings a bell with someone....   It begins with the 2 main characters in ship called Kraftwerk II - they are chased into an asteroid field/meteor storm or some such by another larger vessel, but it turns out their pursuers were just using them for combat practice and did not really mean to destroy them. One of the characters has been 'modified' - which means they are able to temporarily change themselves and speed up their reflexes. They grow fangs and claws as well.    Unfortunately that's about all I've got.

I have very vague impressions of a book I must have read as a child/teenager in the 1980s (so probably published in the UK in the 1970s or early 1980s).  It featured a man who had been technologically enhanced with special powers that he could activate only for short periods (probably because they took a lot of energy), possibly by tonguing one of his teeth.  They gave him:   Much faster reactions; everything around him slowed down. Greater strength/speed. Metal fingernails/claws. Possibly some sort of enhanced vision, too.   I think it described him engaging these powers as: He activated. or similar.  He may have been a mercenary type, who had paid a lot for them; they were rare or unique.  I don't recall any plot or other characters; it was probably a techno-action story.  (No magic, armies, warrior races, telepathy, vampires, or mutants, and I don't recall aliens or space travel.)  It may have been part of a short series of 2 or 3 books.  I'm afraid this isn't much to go on!  I'd completely forgotten about this book until recently, and my impressions are very hazy, so any of the above could be wrong.  (I remember enjoying it, though.)  I've not found anything I recognise on this site, or others; nor in lists of adult and young-person's SF for that period (so it probably wasn't a big-name author).  Does it ring any bells for anyone?


So I'm in a tiny dorm room and I normally point my fan blowing outside the window to cool my room off.  I've been in some debates on blowing air out or in is more effective, so I'm hoping to get some empirical data to back up my claim. Things I have   A Heater with only low, medium, high settings. The Fan. I do not have a thermometer.   So the best I could think of was melting ice cubes.  I don't care about the exact temperature, just which method is more effective. I've outline the basis of my experiment:  Shut the windows and turn the heat on high, 15 minutes  Open the windows, turn off the heat, turn on the fan on high, 15 minutes  Leave $n$ ice cubes out and take the average of how long it takes them to melt.  All the ice cubes are from the same tray.  Can anyone devise a better experiment with no tools...

If it's really hot inside, but cooler outside; what is the best way to place a single fan to try and cool a room down?  I always assumed it would be better pointing inwards (and  suggests the same).  However; today I had a thought - if the room had a bad smell in it, we would probably expect a fan blowing air out would remove the smell faster than a fan blowing inwards. Is a smell really any different to heat? Would it be more efficient to remove heat by blowing the fan a different way to a smell?


Error mounting /dev/sda5 at /media/shashank/New Volume: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" "/dev/sda5" "/media/shashank/New Volume"' exited with non-zero exit status 14:  The disk contains an unclean file system (0, 0). Metadata kept in Windows  cache, refused to mount. Failed to mount '/dev/sda5': Operation not  permitted The NTFS partition is in an unsafe state. Please resume and  shutdown Windows fully (no hibernation or fast restarting), or mount the  volume read-only with the 'ro' mount option   I'm getting this error whenever I'm trying to access the Local Disk

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


It was a top 6. First match a team lost 3:2 on penalties after 0:0 score at regulation time. The other one lost 4:3 and the other one lost 4:3 on penalties after 2:2 draw on regulation time Who is the best loser?

We have played a 7-team competition, all seven teams met, we eliminated the team with the lowest points. After that the remaining six teams played knock out games and the three winning teams will go direct to semi-finals.  We decided that 4 teams should be picked to go for semi-final and that the best loser will join the other three to make it four teams to battle at the semi-final and final.  During the quarter final games, one team is beaten 2-0, another is beaten 3-0 and the third team is beaten in a penalty shoot-out by 4-0.  Now should you want a best loser to join the other three teams making four teams to play in the semi-final, who among these three teams would be in the best losers position.


[Fixed! There was a typo error. I wrote productsTable1 when it was supposed to be productsTable2] I'm trying to assign the values of a JTable's row (which was created from a 3d array) to an array, invoiceDump, after I click on the row, but I get an error Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "javax.swing.JTable.getValueAt(int, int)" is null when I selected the 1st row and this error Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1 >= 1 when I select the 2nd row. Here's is what I did private void productsTable2MouseClicked(java.awt.event.MouseEvent evt) {                                                 int[] selectRow = productsTable2.getSelectedRows(); // array that stores selected row's data     // Displays the selected row's data to text fields     invoiceDump[0] = productsTable1.getValueAt(selectRow[0], 0).toString();     invoiceDump[1] = productsTable1.getValueAt(selectRow[0], 1).toString();     invoiceDump[2] = productsTable1.getValueAt(selectRow[0], 2).toString();     invoiceDump[3] = productsTable1.getValueAt(selectRow[0], 3).toString();     invoiceDump[4] = productsTable1.getValueAt(selectRow[0], 4).toString();     invoiceDump[5] = productsTable1.getValueAt(selectRow[0], 5).toString();     invoiceDump[6] = productsTable1.getValueAt(selectRow[0], 6).toString();     System.out.println(Arrays.toString(invoiceDump)); }     I replaced int[] selectRow = productsTable2.getSelectedRows(); with int selectRow = productsTable2.getSelectedRow();, but it generated the same errors. This block of code works fine when I want to set text fields from the row's values. However, I want to get the values directly from the table and assign it to my array. How to make it work?

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?


Still discovering Ubuntu on my Mac, I would like to know how to change the behaviour of my keyboard and use cmd as the super key (and do stuff like cmd+c for copy).  I'm using a 2010 white Macbook with Ubuntu 16.04.  I have read somewhere that in previous Ubuntu versions there were something to activate in the settings like "Use win command as Super" but correct me if I'm wrong, it's not in Ubuntu 16.04 ?

I switch back and forth between two computers constantly:   OSX Snow Leopard  Ubuntu 10.10    I'd like to be able to make Ubuntu use the same keyboard shortcuts as OSX System Wide, for the following keyboard sequences only (ie I don't want to make Ctrl act like Super)   Super+C -> Copy Super+V -> Paste Super+T -> Open a new tab in whatever browser I'm in.  Super+W -> Close a tab in whatever browser I'm in.    So in short, is there anyway for me to map just these keyboard sequences to the following, system wide ?   Super+C -> Ctrl+C Super+V -> Ctrl+V Super+T -> Ctrl+T  Super+W -> Ctrl+W   I know there are ways for me to do this for vim, and Firefox, and I'm sure specifically for most applications... but I would prefer to have to do this just once and have it work that way system wide!  I'm using a standard PC keyboard, that is "Generic 105 key (intl) PC" on Ubuntu. I'm also using the same keyboard on my Mac mini.


How can I use sed to delete lines two (or any number) after a match but not including the match and lines in between?  For example:  Enter command below > login Command valid Enter your password at the below prompt Remember to make sure no-one is looking at your screen > mysecretword Password accepted   I want to only delete the line "> mysecretword" on account of it being two lines after the line "Enter your password at the below prompt". I can't use absolute line number positions, because the match could appear any number of lines after the start of the file.  Searching online I find a lot of solutions like sed '/Enter your password.*/,+3d' filex, but this would also remove the "Enter your password..." line and the following line, which is not what I want. I only want to remove one line, which is a certain number of lines after a match.  How can I do this with sed (or indeed any other commonly-available tool)?

I have a question related to deletion of strings that appear at the n+2 position after the matched string which is at position n using awk for multiple files. I am able to print it using the command:   awk -F '/radius-server/{nr[NR+4]}; NR in nr' *   Where the matched string is radius-server.  Since I'm not too familiar with  awk I would appreciate it if someone could help me  delete this line in place , that would mean that I want the files to be modified and saved after the deletion is done.  An example scenario is below - file 1 which is unmodified    radius-server dz7HQQH4EqT5 1645-1646  !  oj5icqh1dGpSK  !    alias exec t telnet  alias exec sis show interface status  !   file 2, after modification is -  radius-server dz7HQQH4EqT5 1645-1646 ! ! alias exec t telnet alias exec sis show interface status !   I understand that I can do a pattern matching method using sed -i '/pattern/d' to remove it but that is not what I want as the values change from file to file. Any help would be much appreciated.


I know from verious other discussions that 'can not' and 'cannot' are basically both correct but 'cannot' is being used more often. Nonetheless what happens if I have a 'not only...but also' construction like in  the following sentence:  "Heat pumps cannot only be used for space heating but also for space cooling."  Is it also correct to use 'cannot' in this context?  I'd appreciate every comment.

Why is “cannot” spelled as one word whereas other similar constructions such as “do not,” “will not,” “shall not,” “may not” and “must not” are spelled as two words (unless they are contracted as “don’t” and so on)?  (I know that languages are not always logical, so I would not be too surprised if there is no known reason for this.  But I am asking this in the hope that there is some explanation.)


This question was bugging me for many years.  it was argued that it would take an infinite time for somebody (suppose, an astronaut) to fall into the black hole, given that it is not his time, but the time at spatial infinity (suppose it is the time on the space station). I completely agree with this result.  Now to my question. Forget about the astronaut for a moment, let's focus on the process from the point of view of the person on the space station. Imagine him immortal. Then he will live long enough for the black hole to evaporate due to the Hawking effect. But the astronaut wouldn't reach the event horizon by that point (it is taking infinitely long for him to do so). So after all he will be killed by a flash of light/particles before falling inside the black hole.  Because all frames of reference are good to go, this also holds in the frame of the astronaut. He will not experience 'nothing' when falling into the black hole. Instead, he will almost instantly (his clocks are ticking much slower) be evaporated by the Hawking radiation. Right?  There are another likely scenarios of the end of the outside world (like thermal death) which would take finitely long of the space station time. They would also destroy the astronaut before he crosses the event horizon.  It seems like these arguments also prohibit any matter to be sucked inside the event horizon. Black holes then have no horizons, they are just very dense formations of matter with scales very close to the black hole diameter, but yet larger.  What is wrong in my propositions? After all, it is commonly believed that black holes suck in the neighbouring matter.

This question was prompted by . Notoriously, if you calculate the Schwarzschild coordinate time for anything, matter or light, to reach the event horizon the result is infinite. This implies that the universe ages by an infinite time before someone falling into the black hole reaches the event horizon, so could that person see the universe age by an infinite time?  To be more precise, suppose the observer starts falling from rest at time $t = 0$ and some initial distance $r > r_s$. If we wait for some time $T$ then shine a light ray at the falling observer. Will the light ray always reach the falling observer before they cross the event horizon? If not, what is the formula for the longest time $T$ that we can wait and still be sure the ray will catch the observer? If $T$ is not bounded it implies that observer could indeed see the end of the universe.  I can think of a qualitative argument for an upper limit on $T$, but I'm not sure how sound my argument is. The proper time for the observer to fall to the event horizon is finite - call this $\tau$. The proper time for the light ray to reach the horizon is zero, therefore the light ray will reach the observer before they cross the event horizon only if $T < \tau$. Hence $T$ is bounded and the observer won't see the end of the universe.  I think a more rigorous approach would be to determine the equations of motion (in the Schwarzschild coordinates) for the falling observer and the light ray, and then find the condition for the light to reach the falling observer at some distance $\epsilon$ from the event horizon. Then take the limit as $\epsilon \rightarrow 0$. In principle this seems straightforward, but in practice the algebra rapidly defeated me. Even for a light ray the radial distance:time equation isn't closed form (Wolfram claims it needs the $W$ function) and for the falling observer the calculation is even harder.


Someone has already asked  and  on this but no one has answered yet in terms of predictive modelling.  If I have a  of customers, their demographics and their order amount in dollars in a day over a period of time, how would I implement ML models(Neural network or standard ML like decision tree, logistic regression), say to forecast their next  order amount or which specific item they are likely to order or whether they are going to order anything in the next week?  Goal is to create customized engagement campaigns to improve conversion/revenue.

I was wondering if there were any machine learning techniques (unsupervised) for modelling longitudinal data? I've always used mixed effects models (mostly non-linear) but I was wondering if there are any other ways of doing this (using machine learning).  By machine learning, I mean random forest, classification/clustering, decision trees and even deep learning, etc.


I cycle to work on a daily basis, however I do like to also sweat a lot. Most of this is ok, I have a change of clothes and can managed, but when it comes to my helmet, it's a different story.  There is a headband around the helmet, which likes to soak up my forehead sweat, the problem is, this headband doesn't like to dry out and I can see it getting mouldy soon. I can't seem to removed the band, so I was wondering:   Are there helmets where this band is removable? Are there alternatives, like wearing a headband underneath to soak up the sweat instead?   I've seen , but it's more talking about keep the sweat out of the eyes, rather than the helmet headband. Though the site does sell things called, skull caps, will that be suitable for soaking the sweat and then I can wash it? I need to find something that will fit under my helmet and prevent the headband from soaking up more sweat.

Heading into the southern hemisphere spring I'm starting to contemplate another summer of having sweat running into my eyes and down my face.  I have a couple of lightweight headbands from Netti (that I can't find anymore) that have been reasonably good. They still get saturated on a long ride though and they're old enough that they're starting to smell.  There's an  with some discussion around this area.  I've done some research and seen a couple of options:  Halo Headband    Aside from the incredibly lame website they look like a reasonable option, with a fairly unobtrusive design and also the features to redirect sweat away from the eyes when they get saturated.  Sweat Gutr    This looks like it's very effective, but I'm not 100% sold on having all the sweat running down near my ears. Plus how would it fit with helmet and glasses?  Cotton Bandanna  The general opinion here appears to be that once it's wet, it's useless.


I am writing a simple code trying to read 2d vector by using template. But get error like:  Severity    Code    Description Project File    Line    Suppression StateError  LNK2019 unresolved external symbol   My main.cpp is like:  #include "header\\read_2d.h" #include <iostream>   #include <fstream> #include <vector> #include <string> #include <stdlib.h> using namespace std;  int main() {     //input image array parameters and initialize a 2D array     int nx = 200;     int ny = 200;     std::vector<std::vector<unsigned char> > image(nx, std::vector<unsigned char>(ny));     std::vector<std::vector<unsigned char> > mask(nx, std::vector<unsigned char>(ny));     string disk_filename = "disk.dat";      //read image     read_2d<unsigned char>(disk_filename, image);      return 0;  }   My read_2d.h file is:  #ifndef READ_2D_H    // To make sure you don't declare the function more than once by including the header multiple times. #define READ_2D_H   #include <iostream>   #include <fstream> #include <vector> #include <string> using namespace std;  template <typename myType> void read_2d(string filename, vector< vector<myType> >& image);  #endif   My read_2d.cpp is:  #include "..\\header\\read_2d.h" using namespace std;  template <typename myType> void read_2d(string filename, vector<vector<myType> >& image) {      int nx = image.size();     int ny = image[0].size();     int sizeOfData = nx*ny*sizeof(myType);     std::vector<char> raw_data(sizeOfData);     std::ifstream inputFile;      inputFile.open(filename.c_str(), ios::binary);      if (inputFile.is_open()) {         inputFile.read(&raw_data[0], sizeOfData);         inputFile.close();          for (int i = 0; i < nx; i++) {             memcpy(&image[i][0], &raw_data[(i*ny)*sizeof(myType)], ny*sizeof(myType));         }      }     else {         cerr << "Input file for " << filename << " could not be opened...\n" << endl;         exit(EXIT_FAILURE);     }  }   Can any one help me point out what I have done wrong? Any comments will be very much appreciated!

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


I have an overfull line in my bibliography (BibLaTeX) that I can't get rid of, see the image below. I would assume that this behavior is caused by the hyphenated double word "Password-Scrambling". For long URLs I have managed to properly break the lines using the following commands, where a high penalty value is defined for URL characters: \setcounter{biburllcpenalty}{9000}% Lowercase \setcounter{biburlucpenalty}{9000}% Uppercase  However, I cannot find anything about how I could get this hyphenated word to correctly break. Thank you so much!

Here's my MWE (this is an actual bibliography item, the draft option is there to show the overfull hbox):  \documentclass[draft]{article}  \usepackage{filecontents} \begin{filecontents*}{x.bib} @BOOK{LV12,   title = {Algebraic operads},   publisher = {Springer},   year = {2012},   author = {Loday, Jean-Louis and Vallette, Bruno},   volume = {346},   pages = {xxiv+634},   series = {Grundlehren der Mathematischen Wissenschaften [Fundamental Principles     of Mathematical Sciences]},   address = {Heidelberg},   doi = {10.1007/978-3-642-30362-3},   isbn = {978-3-642-30361-6}, } \end{filecontents*}  \usepackage{biblatex} \addbibresource{x.bib}  \begin{document} \nocite{*} \printbibliography \end{document}   This produces:     Overfull \hbox (15.12822pt too wide) in paragraph at lines 27--27   I'm generally aware of how to fix overfull hbox from text I wrote myself, but not when the text is produced by a package. What is the best course of action here? Altering the entry is not an option.


Bonjour à tous!  As the title suggest I want to find all the $n>1$ such that $n^2| 2^n+1$.  My attempt: Let $p$ an odd prime dividing $n$. We know that $2^p+1|2^n+1$ $\textit{ (Isn’t it the only divisor of $2^n+1$?)}$  and by Fermat $p|2^{p}-2$ therefore $p|3$ thus $p=3$. Since p is the only divisor of $n$, n must be a power of 3. Conversely $n=3^k$ verify the assert.  Is it correct?   By the way is there another proof, specially proof based on group theory.

Find all $n>1$ such that $\dfrac{2^n+1}{n^2}$ is an integer.   I know that $n$ must be odd, then I don't know how to carry on. Please help. Thank you.


I have this function that receives a word and lists the index of each capital letter:  def capitals(word):     print word     lst = []     for i in word:         if i.isupper():             lst += [word.index(i)]     return lst   When all capital letters in word are different, it runs fine. Example:     capitals("AuIkkdjsiP") returns [0,2,9]   However, if a string has duplicate capitals, this happens:     capitals("AuAskdjfIsjUsdhA") returns [0,0,10,0]   How do I get the index of the other occurrences of the char "A" when iterating the string?

How do I access the index in a for loop like the following?  ints = [8, 23, 45, 12, 78] for i in ints:     print('item #{} = {}'.format(???, i))   I want to get this output:  item #1 = 8 item #2 = 23 item #3 = 45 item #4 = 12 item #5 = 78   When I loop through it using a for loop, how do I access the loop index, from 1 to 5 in this case?


I'm trying to create a regexp that will capture the first occurrence of a repeating string.  The string is a "list" of RSA certificates , in succession. I am only interested in the first.   The string looks like:  -----BEGIN CERTIFICATE----- CERT1.......... -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- CERT2............ -----END CERTIFICATE----- ... ... ...   I've tried variations on the following , but it is returning the full list rather than the first item:  set match [regexp {(-----BEGIN CERTIFICATE-----.*-----END CERTIFICATE-----$).*} $certs matchAll firstCert]

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


Given a set $M$ of all $n\times n$ real matrices with the usual norm topology. Then, is the set of all symmetric positive definite matrices in $M$ connected?   Also, is the set of all invertible matrices in $M$ compact?  All I can infer so far is that the set $M$ is probably not compact as, if $M$ is positive definite then so is $cM$ for positive scalars $c$ and as $c\rightarrow \infty$, there is no limit.   Thank You.

1.Consider the set of all $n×n$ matrices with real entries as the space $\mathbb R^{n^2}$ . Which of the following sets are compact?  (a) The set of all orthogonal matrices.  (b) The set of all matrices with determinant equal to unity.  (c) The set of all invertible matrices.  2.In the set of all $n×n$ matrices with real entries, considered as the space $\mathbb R^{n^2}$ , which of the following sets are connected?  (a) The set of all orthogonal matrices.  (b) The set of all matrices with trace equal to unity.  (c) The set of all symmetric and positive definite matrices.  FOR 1 (a) may be true as determinant mapping is continuous and it maps to the compact set{1,-1} but it is only a necessary condition.and (c) is not true as determinant mapping is continuous and it maps to a non compact set.do not know about (b).but i think it is not true. FOR2 (a) is not correct.do not know about (b) & (c)


Suppose $E/F$ is an algebraic extension, where every polynomial over $F$ has a root in $E$. It's not clear to me why $E$ is actually algebraically closed.  I attempted the following, but I don't think it's correct:   I let $f$ be an irreducible polynomial in $E[X]$. I let $\alpha$ be a root in some extension, so $f=m_{\alpha,E}$. Since $\alpha$ is algebraic over $E$, it is also algebraic over $F$, let $m_{\alpha,F}$ be it's minimal polynomial. I now let $K$ be a splitting field of $m_{\alpha,F}$, which is a finite extension since each root has finite degree over $F$.  If $m_{\alpha,F}$ is separable, then $K/F$ is also separable, so as a finite, separable extension, we can write $K=F(\beta)$ for some primitive element $\beta$. By assumption, $m_{\alpha,F}$ has a root in $E$, call it $r$. Then we can embed $F(\beta)$ into $r$ by mapping $\beta$ to $r$. It follows that $m_{\alpha,F}$ splits in $E$. Since $f\mid m_{\alpha,F}$, we must also have the $f$ is split in $E$.  But what happens if $m_{\alpha,F}$ is not separable? In such case, $F$ must have characteristic $p$. I know we can express $m_{\alpha,F}=g(X^{p^k})$ for some irreducible, separable polynomial $g(X)\in F[X]$. But I'm not sure what follows after that.  NB: I say $E$ is algebraically closed if every nonconstant polynomial in $E[X]$ has a root in $E$.

If I have a field $K$ and an extension $L$ of $K$ such that all (non-constant) polynomials in $K[X]$ have a root in $L$, is the set of algebraic elements  of $L$ over $K$ (the sub-field of all the elements of $L$ which are roots of a polynomial in $K[X]$) algebraically closed ?  Do you have a counterexample ?


How can limit the characters of UITextField without using delegate methods. Im using UITableView in which i have UITextField in cell and used in different position within same screen and i want to limit text field on certain position UITableViewCell. Any help will be appreciated.

How can I set the maximum amount of characters in a UITextField on the iPhone SDK when I load up a UIView?


DatabaseHelper.java      public class DatabaseHelper extends SQLiteOpenHelper {     public static final String DATABASE_NAME="register.db";     public static final String TABLE_NAME="registeration";     public static final String COL_1="USERNAME";     public static final String COL_2="FirstName";     SQLiteDatabase db;       public DatabaseHelper(Context context) {         super(context, DATABASE_NAME, null, 1);           db.execSQL("CREATE TABLE " + TABLE_NAME + " (USERNAME TEXT,FirstName TEXT)");      }      @Override     public void onCreate(SQLiteDatabase sqLiteDatabase) {         db.execSQL("DROP TABLE IF EXISTS" +TABLE_NAME); //Drop older table if exists         onCreate(db);       }      @Override     public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {      } }   Mainactivity.java  public class MainActivity extends AppCompatActivity {      SQLiteOpenHelper openHelper;     SQLiteDatabase db;     Button _btnreg;     EditText _txtpass,_txtuser;       @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);          openHelper = new DatabaseHelper(this);         _txtuser = (EditText)findViewById(R.id.txtuser);         _txtpass = (EditText)findViewById(R.id.txtpass);         _btnreg=(Button)findViewById(R.id.btnreg);         _btnreg.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 db=openHelper.getWritableDatabase();                  String user=_txtuser.getText().toString();                 String pass=_txtpass.getText().toString();                   insertdata(user,pass);                 Toast.makeText(getApplicationContext(), "register successfully",Toast.LENGTH_LONG).show();              }         });     }      private void insertdata(String user, String pass) {         ContentValues contentValues = new ContentValues();         contentValues.put(DatabaseHelper.COL_1, user);         contentValues.put(DatabaseHelper.COL_2, pass);      } }   Error:     java.lang.RuntimeException: Unable to start activity   ComponentInfo{com.example.vivekpc.myapplication/com.example.vivekpc.myapplication.MainActivity}:   java.lang.NullPointerException: Attempt to invoke virtual method 'void   android.database.sqlite.SQLiteDatabase.execSQL(java.lang.String)' 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?


To convert raster grids to vector points In QGIS there we have different possibilities (grass tool "to.vect"; saga tools "grid values to points").   My problem is a little bit complicated. In the beginning I have a point layer. For further data processing I need to convert the vector points to a raster file (every point is a raster now). In the end I want to convert this raster (raster points) backwards to a point layer for the kriging tool.   The grass tool (to.vect) is very slow and the saga tools (grid values to points) gives me more than just the points I need to have (I get a very high density point shape). Is there another solution just to convert the few rasters into a point layer?

How can I extract values from a raster by points?  I prefer not in Arcgis.   I prefer in Qgis or Mapwindow or other open source gis.


I want to drive one or two small (5 or 10 mm) white LEDs in parallel using one or multiple 18650 3.7vV Li-ion cells. The main reason I want to use the 18650's is, I already have them, they are rechargeable and have a pretty good mAh rating.    Is this as simple as putting a resister and a switch and I'm done? What about when the battery is drained and can only output 2.x volts? Will the light simply not light at that point and we charge the batteries?

I want to supply constant voltage to my LED's but the supply varies from 3.7V to 4.2V (Li-ion battery). I cannot use 3.3V voltage regulator as it will need at least 4.3V voltage at the input but my battery can supply only 4.2V max. so is there any other way I can supply regulated 3.3V to my LED.   RGB LED = 3.3V, 60mA Battery = 3.7V - 4.2V, 3000mA Number of LEDs = 24 The LED's are connected in parallel


My question is about counting the six-month period for a 90-day Schengen area visit:  Visit May 15 - June 5, 2014 (20 days) under name X Visit Aug 28 - Sept 25, 2014 (29 days) under name X Nov 11 marks end of 180 day period    Change name  Visit Dec 10, 2014 - Mar 10, 2015 (90 days) under new name, Y  Can I return in May?    If the first period ends Nov 11 and the new period starts Nov 12, then the next 180-day period would end May 11.    Am I eligible to return on May 12?  If my name change starts the count anew, I cannot return until mid-June.  I should add I didn't intend to stay 90 days over the winter.  I am traveling with two dogs and the temperatures in NY, USA were too cold safely to fly (not that it matters to Immigration).

I have searched the web a lot and could not find an answer that fits my situation. Here are two links that are quite contradictory:       My situation:  I've visited Portugal in December 2012 for 29 days on a Schengen visa valid from December 1st, 2012 to February 1st, 2013 for research purposes (I am a Ph.D. student). I want to visit Sweden from February 10th, 2013 to May 10th, 2013 (89 days). I have applied for a Schengen visa again (for research). How will the 90/180 rule work in my situation?