What I'm doing is pretty new to me, or at least I think it is, so I'm not really sure of what I'm looking for. Hopefully someone here knows =-)  Using a grid of hexes I generate, I can hover over any tile and it will highlight just fine. Now what I'm trying to figure out is how to allow for a radial selection of tiles around that hovered tile (brush size, basically), eventually allowing for a somewhat radial soft-selection gradient to allow falloff.  Each hex already knows about their neighbors, so currently I am hard-coding logic to handle a radius of 1, 2 or 3. I could duplicate that logic over and over to handle bigger radii but this is definitely not going to work for much longer, so I am trying to figure out a more efficient and cleaner way using loops/recursion/whatever.  Can anyone offer any pseudo-code or possibly a link that explains how to do this? Below is a (probably bad) attempt at what I think it would look like.  OnMouseOver(){     // This would select a radius of x hex tiles including center tile     this.SelectTile(3);  }  SelectTile(selectionRadius){     if(!this.alreadySelected){         this.Select();     }     for(int i = 0; i &lt;= selectionRadius; ++i){         if(i &lt; selectionRadius){             foreach(HexTile tile in thisTile.neighbors){                 tile.SelectTile(selectionRadius - i);             }         }     } }   Edit: I'm using this fantastic resource to help with hexes -  - so might there be a section on this page that may explain what I need and I'm just missing?
Here is the situation.  I have hexagonal board,and a unit on it,with speed or move value 4.Diffrent terrain has a diffrent cost.When i click on the unit,game should show me a move range.  My solution was to check each  hex in range of 4,with A* pathfinding,and if path cost was less than 4 then this hex was in range.Finally game nicely show me range of that unit.  My question is:   Is there other solution to search for range on hex grids or square grid,because even if i am really proud of what i did in my solution,i think,it is a little to exaggerated?:))  What make me ask this question?I noticed that when unit speed is 4 or 6 or even 8,time to computing range for my computer was really good,but when speed was 10 and more i noticed that i needed to wait few second to compute.Well in real games i rather dont see something like this and my A* pathfinding is rather well optimized,so im thinking that my solution is wrong.  Thanks for any replies.
Keyboard shortcut to autocomplete the user in comments I need to analyse data and am unsure whether or not I should use a multinomial logistic regression analysis or a binary logistic regression analysis. I have just conducted a latent class analysis and am interested in seeing if my variables can predict class membership. There are only two classes and so my response variable only has two categories; however the variables range from having 2 to 3 to 4 and are mostly nominal categorical data. How do I pass variables and data from PHP to JavaScript? Does one need a visa to transfer between two airports during a transit through the Schengen area? I am an Indian citizen travelling from New York to Delhi with a layover in Paris where I need to transfer between Paris Orly Airport (ORY) and Paris Charles de Gaulle Airport (CDG).  Do I need to have a visa to make this transfer?  I didn't notice that while booking the ticket. I have Ubuntu 14.04 and two monitors. When I open applications I need some of them to be on the primary monitor and others On the secondary. At the moment, apps always open in the primary monitor.   I have dash icons only on one (left) display, so I can't launch apps using the cursor or active window setting from Compiz. $-1$ is a quadratic residue modulo $p$ if and only if $p\equiv 1\pmod{4}$ I came across this problem and I believe Lagrange's theorem is the key to its solution.  The question is:     Let $p$ be an odd prime. Prove that there is some integer $x$ such that $x^2 \equiv −1 \pmod p$ if and only if $p \equiv 1 \pmod 4$.   I appreciate any help.  Thanks. Servlet returns "HTTP Status 404 The requested resource (/servlet) is not available" What is the point of isomorphism concept? I need to find algorithm that can calculate centroid A (aka gravity center, geometric center, center of mass) from the figure where circles T1,T2,T3,T4,T5,..,Tn intersect AND length of line R from centroid to farthest corner of mentioned figure   Following information is given:   T1   Latitude    =   56.999883   Longitude   =   24.144473   Radius  =   943 T2   Latitude    =   57.005352   Longitude   =   24.151168   Radius  =   857 T3   Latitude    =   57.005352   Longitude   =   24.163356   Radius  =   714 T4   Latitude    =   56.999042   Longitude   =   24.168506   Radius  =   714 T5   Latitude    =   56.994226   Longitude   =   24.15709    Radius  =   771   Result should look like this:  A Latitude = XX.XXXXXXX    Longitude = XX.XXXXXXX  Radius = XX    As you probably already figured out, I am working on software that can find device location by closest Wifi Access Points or Mobile Base stations, as number of access points or base stations might change, I need an algorithm that can adapt to uncertain amount of points.  There are some similar questions  and , but none of them exactly answers to my question. I managed to successfully publish my old bachelor thesis in a good quality national journal in my country. However, I am thinking of retracting the article due to certain circumstances. First, I felt really embarrassed by the low quality research methodology used in my bachelor thesis. I only used simple correlation in my research. After it was published, I realized that the journal editor team forgot to include a reference in that article because they were rushing me throughout the editing process. I informed them about their mistake and it seems that they have done nothing to fix the problem. I became a bit annoyed because the editor team has never made this problem in the past.  I felt that it would be better for me to simply ask for retraction to solve this issue, but I am a bit afraid of negative consequences in the future. Is it okay to do this? I am really interested of entering the academic world in the future. How to make Table of Contents manually I'm trying to make table of contents manually, I mean I set the page of each of sections one by one. Here's my target:  and I'm using book class here.  Here's the code that I found   \documentclass[oneside]{book} \renewcommand\contentsname{CONTENTS} \renewcommand\listtablename{LIST OF TABLES} \renewcommand\listfigurename{LIST OF FIGURES} \addtocontents{toc}{{\bfseries Contents\hfill Page No.\bigskip\par}} \addtocontents{lot}{{\bfseries No.\hfill Title\hfill\hfill Page No.\bigskip\par}} \addtocontents{lof}{{\bfseries No.\hfill Title\hfill\hfill Page No.\bigskip\par}}  \usepackage[titles]{tocloft} \usepackage{xcolor,xpatch} \renewcommand\cftbeforechapskip{0ex} \renewcommand\cftchapfont{\mdseries} \renewcommand\cftchappagefont{\mdseries} \renewcommand\cftchappresnum{Chapter~} \renewcommand\cftchapaftersnum{. } \newlength\tocindent \settowidth\tocindent{\cftchapfont\cftchappresnum9\cftchapaftersnum} \edef\cftchapnumwidth{\the\tocindent} \edef\cftsecindent{\the\tocindent} \advance\tocindent2.3em \edef\cftsubsecindent{\the\tocindent} \advance\tocindent3.2em \edef\cftsubsubsecindent{\the\tocindent} \renewcommand\cftsecdotsep{\cftnodots} \renewcommand\cftsubsecdotsep{\cftnodots} \renewcommand\cftsubsubsecdotsep{\cftnodots} \newcommand\tocmainmatter {\renewcommand\cftchappagefont{\color{white}}% } \xapptocmd\mainmatter{\addtocontents{toc}{\protect\tocmainmatter}}{}{}   \newif\ifschaptertoc \makeatletter \renewcommand\@makeschapterhead[1]% {{\parindent \z@ \centering     \normalfont     \interlinepenalty\@M     \Large \bfseries  #1\par\nobreak     \vskip 20\p@ }% \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}% \ifschaptertoc \addcontentsline{toc}{chapter}{#1}% \fi } \makeatother  \usepackage{blindtext}  \begin{document} \frontmatter  \tableofcontents \schaptertoctrue  \chapter*{ACKNOWLEDGEMENTS} \blindtext  \chapter*{ABSTRACT} \blindtext  \listoftables  \listoffigures  \chapter*{ABBREVIATIONS} \Blindtext  \chapter*{NOTATIONS} \Blindtext  \mainmatter  \chapter{INTRODUCTION} \blindtext  \section{General Background} \blindtext  \section{Objective} \blindtext \subsection{Objective 1} \blindtext \subsection{Objective 2} \blindtext \subsection{Objective 3} \blindtext  \section{Scheme} \blindtext \end{document} What is Attribute Based Encryption? How to mount electronics on a vehicle chassis safely I want to implement a control system I designed for a light electric motorbike. I would like to mount it as professionally as possible on the chassis. It consists of a power system pcb and a SAMC21 development board which I'll merge later once this all works properly. I have tried screwing it directly on the aluminium chassis but have found that shocks and vibrations from the horn disturbed the system or even destroyed it upon large shocks like a few hammer hits. Is there a specific way car and motorcycle manufacturers mount their electronics to make their system as robust as possible? Thank you for your help! Does the Google spider render JavaScript? Scanner issue when using nextLine after nextXXX Decorating Python class methods - how do I pass the instance to the decorator? What is the purpose of the word 'self'? My brother owns Skyrim on steam. We use Steam Family Share, but we were wondering how both of us could play it at the same time? My (very simple) question to a friend was how do I prove the following using basic trig principles:  $\tan75^\circ = 2 + \sqrt{3}$  He gave this proof (via a text message!)  $1. \tan75^\circ$   $2. = \tan(60^\circ + (30/2)^\circ)$  $3. = (\tan60^\circ + \tan(30/2)^\circ) / (1 - \tan60^\circ \tan(30/2)^\circ) $  $4. \tan (30/2)^\circ = \dfrac{(1 - \cos30^\circ)}{ \sin30^\circ}$    Can this be explained more succinctly as I'm new to trigonometry and a little lost after (2.) ?    EDIT  Using the answers given I'm almost there:   $\tan75^\circ$    $\tan(45^\circ + 30^\circ)$   $\sin(45^\circ + 30^\circ) / \cos(45^\circ + 30^\circ)$   $(\sin30^\circ.\cos45^\circ + \sin45^\circ.\cos30^\circ) / (\cos30^\circ.\cos45^\circ - \sin45^\circ.\sin30^\circ)$    $\dfrac{(1/2\sqrt{2}) + (3/2\sqrt{2})}{(3/2\sqrt{2}) - (1/2\sqrt{2})}$   $\dfrac{(1 + \sqrt{3})}{(\sqrt{3}) - 1}$   multiply throughout by $(\sqrt{3}) + 1)$   Another alternative approach:   $\tan75^\circ$    $\tan(45^\circ + 30^\circ)$   $\dfrac{\tan45^\circ + \tan30^\circ}{1-\tan45^\circ.\tan30^\circ}$   $\dfrac{1 + 1/\sqrt{3}}{1-1/\sqrt{3}}$   at point 6 in above alternative need to make salesforce app available in multiple language I want to make my appexchange app available in multiple language like Spanish, dutch etc. so that depend on the language of the user they can access the app.  Is it possible in any way..  any help will be appreciated.. Thanks