why segmentation fault is arising , because of these three lines?

The code is giving segmentation fault. But it is working fine, :

  1. if i remove the first weird line “q++;”. Or
  2. if i call solve(s,1) in main function instead of solve(s,0) at third weird line.
  3. the code is working fine if i use “solve(s,q)” at second weird line.
 ''' #include using namespace std;  >bool solve(string s,int q) {     q++; //first weird line     if(q==10)         return true;     solve(s,q+1);//second weird line     return false; }  int main() {     string s;     cin>>s;     solve(s,0);//third weird line      return 0; }'''    

SSIS 2017 – Parse flat file with multiple columns and headers on multiple lines

I receive a daily CSV file that contains 600+ company employee positions, each of which are formatted as follows:

Position,Description SUP1015,Shipping Supervisor Day Work UOM:,Hours,Active:,Yes,Permanent:,Yes,, Default Rate Level:,0,Default Rate Source:,Master,Default GL Source:,Master,, Effective Date:,,Expiry Date:,,Created Date:,29-Apr-2014,Revised Date:,06-Jun-2019 Job Class:,,,,,Location:,,1004 - Shipping,, Union Code:,,,,,Reports To:,,MGR1056 - Delivery & Shipping Manager,, Position FTE:,,1.0000,,,,,, 

My goal is to transform all 600+ records into one table:

Position | Description                     | Work UOM | Active | Permanent | Default Rate Level | Default Rate Source | Default GL Code | Effective Date | Expiry Date | Created Date | Revised Date | Job Class | Location                 | Union Code | Reports to                                    | Position FTE | ========================================================================================================================================================================================================================================================================================================================= SUP1015  | Shipping Supervisor Day         | Hours    | Yes    | Yes       | 0                  | Master              | Master          |                |             | 29-Apr-2014  | 06-Jun-2019  |           | 1004 - Shipping          |            | MGR1056 - Delivery & Shipping Manager         | 1.0000       | 

I have no idea how to parse this, given the connection managers in SSIS. Any help and guidance is greatly appreciated.

How many lines can I draw for four-points-only-lines on a plane, given N points in total?

Given N points on a plane, you are drawing straight lines that cross precisely 4 points per line. How many lines at maximum can you draw? For simplicity, let’s assume there are 20 points, then what is the result?(Answer with pics would be nice) Can it be generalized to N points for which we are able to write an algorithm?

Updated multiple lines in $wpdb

I have the following code and I’m trying to update all the changes at once. But it did not work. Someone please help me!

Thanks!

<?php if(isset($  _POST['updateDays'])){         $  clock = $  _POST['clock'];         $  id = $  _POST['days_id'];         $  post_data=array(             'dayweek_id' => esc_html($  id),             'opend_closed' => esc_html($  clock)         );         var_dump($  post_data);          $  wpdb->update( $  table_days, $  post_data, array( 'dayweek_id' => $  id ), $  format = null, $  where_format = null );     } ?> <form class="wmtp-form-info" action="" method="post" enctype="multipart/form-data">     <?php         echo '<input type="hidden" name="days_id" id="days_id" value="'.esc_attr($  info->dayweek_id).'" />';         $  get_data_dayweek = $  wpdb->get_results($  wpdb->prepare( "SELECT * FROM $  table_days"));         foreach ($  get_data_dayweek as $  info) {             echo $  dayoftheweek;             echo '<select name="clock">'; ?>               <option value="<?php echo $  opend_closed; ?>" <?php echo (isset($  _SESSION['clock']) && $  _SESSION['clock'] == $  opend_closed) ? "selected" : "" ?> hidden><?php echo $  opend_closed; ?></option>               <option value="true"> Opened</option>               <option value="false"> Closed</option>             </select>         <?php } ?> <?php echo '<input class="button button-primary" type="submit" id="" name="updateDays" value="'.esc_html__('Update', $  domain).'">'; ?> </form> 

What’s the maximum amount of lines from Sunbeam possible within a single round?

I noticed that sunbeam allows you to to create multiple lines within a single turn. What’s the maximum possible amount of sunbeam lines able to be created by a single caster within one turn?

For reference, the spell has a casting time of 1 action and states:

A beam of brilliant light flashes out from your hand in a 5-foot-wide, 60-foot-long line. Each creature in the line must make a Constitution saving throw. On a failed save, a creature takes 6d8 radiant damage and is blinded until your next turn. On a successful save, it takes half as much damage and isn’t blinded by this spell. Undead and oozes have disadvantage on this saving throw.

You can create a new line of radiance as your action on any turn until the spell ends.

Rules

  • Level 20 Character, any combination of multi-classing allowed
  • Only official material published by WOTC in book form is allowed. No Unearthed Arcana
  • Setup is allowed, including any magical items present in the Dungeon Master’s Guide or any other source-book. Items only present in campaign books are not allowed.
  • You may have 4 allies at level 20
  • Simulacrum is allowed

Typography for arrow-linked list on several lines

I’m working on a text-based UI (no graphics other than text) which lists food items ordered one after the other. These food items are connected one another with an arrow symbol. For example:

“Food A –> Food B –> Food C –> Food D” and so on. The list takes the number of lines necessary to display all the content.

The question is when I reach the end of a line, should I display the arrow leading to the next item in the current line, or on the next line ? Is there is a typographical convention for this ?

I mean, either: “Food A –> Food B –> Food C –>

Food D”

Or: “Food A –> Food B –> Food C

–> Food D”

Thanks !

Efficient data structure for matching 3D lines

I’d like to

  • Store a set of many infinite undirected 3D lines.
  • Make lookups against this set – i.e. given an arbitrary line, ask “Does the set contain a line coincident with this one?”

The incidence-checks would of course have to be fuzzy to account for floating-point errors.

Question:

What would be a good data structure to implement such a set?

My thoughts so far:

Each line is originally represented as:

$ $ \begin{align*} p &= \text{an arbitrary point on the line} &= 3 \;\text{floats} \ v &= \text{an arbitrary vector parallel to the line} &= 3 \;\text{floats} \end{align*}$ $

To facilitate lookups, this should probably be converted such that coincident lines turn into the same tuple of floating-point numbers (within the margin of error). For example like this:

$ $ \begin{align*} p’ &= \text{the point on the line closest to}\;(0,0,0) &= 3 \;\text{floats} \ v’ &= \text{normalized direction vector} &= 2 \;\text{floats} \end{align*}$ $

Where “normalized” means unified (that’s easy) and reversed in half the cases (this will be a bit tricky to do without introducing inconsistencies).

And then I’d just need a data structure for fuzzy look-up of tuples of 5 floats.

  • A 5-dimensional Binary Space Partitioning Tree, maybe?
  • Or just multiply the 5 floats together to get one float per line, use them as keys in a sorted map (e.g. std::multimap<double, Line3D*> in C++ or TreeSet<Double, List<Line3D>> in Java), and do range lookups like $ [x – \epsilon, x + \epsilon)$ for a given key $ x$ and error margin $ \epsilon$ and then only do the full incidence check for each line in that range?

Or maybe there’s an altogether different approach?