City Building Program

I want to build a city building game that’s super back end and not visual. I want to focus on complexity, different modes of transportation, and how that impacts peoples lives; lots of statistics on how much people travel, what kind of access and resources people have. Quality of life. I also want to have it be able to generate cities based on smaller scale models, using templates, and fractal templates of the city to expand into a much larger city. Where can I start?

In Unity how do I easily snap modular building pieces to the grid without overlaps or gaps?

I’m new to Unity and purchased a set of modular building pieces from the asset store. I’m trying to arrange pieces of wall. The pieces are 5 x 5 x 0.5, so I’ve set my world grid size to 5 units and am using align to grid to make them line up nicely. I’m running into an issue when I try to make a corner. When I align the pieces to the grid, there is some gap and overlap, as seen in this picture:

enter image description here

I then tried to manually move the end piece inwards, which resulted in this:

enter image description here

That looks slightly better, but needed a manual adjustment so I don’t think doing this everywhere scales very well, and plus there is some kind of visual/lighting artifact where the pieces overlap (hard to see in the screenshot but very obvious when I move around in game mode). Then I tried resetting that end piece back to the grid and pushing the two side pieces inwards, which resulted in this:

enter image description here

This looks good and has no overlap, but required a bit of manual adjustment and brought the sides off of the grid.

Assuming a set of wall pieces that are 5x5x0.5, how can I configure my grid and snap settings so that everything fits together nicely?

Building WordPress Plugin Using FPDF – How do you get post content from currently viewed post?

I am using FPDF to build a plugin in wordpress that will add a button on each post(documentation) that gives the user the ability to export it as a styled pdf from the post without having to maintain working files and uploading attachements for hundreds of files.

I used this as a guide, and it currently works in one respect, however this current iteration exports a PDF of ALL posts in the documentation post type. How do I instead pull the post content from the currently viewed post only?

I have been banging my head for a week, so hopefully someone can point me in the right direction. Let me know if I can clarify anything additional.


<?php  if ( ! defined( 'ABSPATH' ) ) { exit; }  include( 'atomicsmash-pdf-helper-functions.php');  $  pdf = new PDF_HTML();  if( isset($  _POST['generate_posts_pdf'])){ output_pdf(); }  function output_pdf() { $  args = array(     'post_type'   => 'manual_documentation'   );  $  posts = get_posts( $  args );  if( ! empty( $  posts ) ) {     global $  pdf;     $  title_line_height = 10;     $  content_line_height = 8;      foreach( $  posts as $  post ) {          $  pdf->AddFont( 'Lato', '', 'Lato-Regular.php' );         $  pdf->AddFont( 'Lato', 'B', 'Lato-Bold.php' );         $  pdf->AddFont( 'Lato', 'I', 'Lato-Italic.php' );         $  pdf->SetMargins(12.7, 12.7);         $  pdf->SetDrawColor(36,161,89);          $  pdf->AddPage();         $  pdf->SetFont( 'Lato', 'B', 24 );         $  pdf->SetTextColor(4,23,51);         $  pdf->Write($  title_line_height, $  post->post_title);          $  pdf->SetLineWidth(1);         $  pdf->Line(14, 27, 40, 27);          // Add a line break         $  pdf->Ln(14);          // Image         $  page_width = $  pdf->GetPageWidth() - 20;         $  max_image_width = $  page_width;          $  image = get_the_post_thumbnail_url( $  post->ID );         if( ! empty( $  image ) ) {             $  pdf->Image( $  image, null, null, 100 );         }                  // Post Content         $  pdf->Ln(10);         $  pdf->SetFont( 'Lato', '', 10 );         $  pdf->SetTextColor(38,59,71);         $  pdf->WriteHTML($  post->post_content);     } }  $  pdf->Output('D','atomic_smash_fpdf_tutorial.pdf'); exit; }  function as_fpdf_create_admin_page() {  ?>  <div class="wrap"> <form method="post" id="as-fdpf-form">     <button class="custom-botton" type="submit" name="generate_posts_pdf" value="generate">Download PDF</button> </form> </div>  <?php }  function register_shortcodes(){ add_shortcode('fpdf-doc', 'as_fpdf_create_admin_page'); }  add_action( 'init', 'register_shortcodes'); 

Building Suffix Array from Suffix Tree. Inorder visit when node has more than two children

From the notes:

It is not difficult to observe that the suffix array $ \texttt{SA}$ of the text $ \texttt{T}$ can be obtained from its suffix tree $ \texttt{ST}$ by performing an in-order visit: each time a leaf is encountered, the suffix-index stored in this leaf is written into the suffix array $ \texttt{SA}$ ; each time an internal node u is encountered, its associated value is written into the array $ \texttt{lcp}$ .

How do you do the inorder visit when a node has more than two children?

Let’s say you visit the leftmost child, then the node, then the other leftmost child. Then do you visit again the node?

SA in an array of pointer to suffixes, ordered lexicographically.

lcp contains the longest common prefix between two consecutive suffixes $ \text{suff}_{SA[i]} \text{ and } \text{suff}_{SA[i+1]}$ .

The $ represents a char that’s smaller than every other char.

The value associated to each node is the length of the prefix spelled so far.

The leaves represents indices of suffixes. If T = banana$ , the leaf 3 represents nana$ (T[3,7])

In the image there’s what is supposed to be a suffix tree, but I think there’s an error since the edges should be sorted according to their label and the leaf 7 with the edge labeled "$ " should be the leftmost leaf and edge.

enter image description here

When simulating the algorithm, first you visit the node 7 ( using the fixed version of the tree ), then the root, so you have

SA = [7, ...] lcp = [0, ...] 

Then let’s say you keep going on with an inorder visit of u. When you go back to the root, do you insert the value 0 again in the lcp? Or do you do it just the first time you visited the root?

In other words, do I visit child-root-child-root… or child-root-child-child…

Seeking advice – Building a Landing Page

I need your help to pass a job test! I have to design and implement a landing page. I have some experience with html and css, but i never implemented a landing page or a website, and I never used Java script.

They mainly want to evaluate my html skills and want to "understand my idea behind how certain elements behave and why these particular elements behave that way". It's important to make the landing page responsive. I am allowed to use "frameworks" and other sources.

So, here are my…

Seeking advice – Building a Landing Page

Is building part of an href on a webpage from URL parameters a security risk?

I’ve written some code and have a feeling there’s a security issue with it, but I can’t figure out what it is.

Is there a security risk in including URL parameters directly into part of a link on a webpage?


  • User visits
  • JS reads the URL, and retrieves part of it, in this case guid
  • JS builds a URL using that data
  • That new URL is added to the page (Adding the URL to the page is escaped, so injecting JS shouldn’t be a problem, in theory)

Is there any way that displaying or clicking on<any plain text here> could be a security flaw?

Building more diverse local Organized Play RPG community

How do I build a more diverse local RPG community? Currently, there’s several Organized Play RPG communities in my closest metro region (West Coast, USA). The largest OP group has several thousand members and a very broad, diverse demographic base with members from almost every social facet of urban life.

There are a few other OP groups that are far smaller and insular. From my observation, these groups are almost entirely ethnically white, middle-aged men. These groups range from 50-200 members at most.

I am an active member in multiple Organized Play groups, and there is a glaring difference in membership and demographics.

How do I help build an Organized Play community that doesn’t become insular and homogenous? I don’t know if a reformation approach is helpful or appropriate for these groups, but I’m not willing to accept the status quo.

Building and Pricing a Collapsible Lance

I have a player who has specced out to use lances while riding as one of his preferred methods of fighting. He has an efficient quiver and would like to be able to store his lance in the third slot (from the rules it can hold the following):

The third and longest portion of the case contains as many as 6 objects of the same general size and shape as a bow (spears, staffs, or the like).

Obviously the lance is too big for this section so he asked if it was possible to give it a “collapsible” property, which would effectively allow it to go from the size of staff to the size of a lance in a swift action. As the DM I’m okay with this, but since it’s a unique item I want to roleplay him getting this from a smith, and a large part of that involves specific pricing.

The way I see it, it can either go closer to the price of a masterwork item or it is effectively treated as a magical weapon and requires the +1 before it can get the “collapsible” trait. Not entirely sure which would make more sense for this case, looking for any insight.