Can I make a copy of a Halo disc to USB?

Question: I have a Halo Combat Evolved disc. Is it possible to copy the files to a USB so I can play Halo wherever I want without carrying my CD case?
Comment: Do I need a DVD burning software?
Comment: Your using P.C or Xbox?
Answer: Yes, you can on Windows!

You will need to "install" the game from the CD onto the flash drive.
Patch the game to 1.09, this is very important. 1.09 removes SafeDisc and the CD-check.
Using regedit, export the proper key for your OS:

32-bit: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Halo
64-bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft Games\Halo

Save this .reg file onto the USB stick.
Make a copy of it, and remove or add the Wow6432Node in this copy so that you have one of each.

Now, when you want to play, you will need to do the following.

Open the proper .reg file in Notepad. This will be the one with Wow6432Node for 64-bit systems, and without it for 32-bit systems.
In the .reg file, change the EXE Path value to the proper USB path (this may change depending on what drive letter you get when you plug in in, hence the need to change it).
Merge the .reg file into the Registry.
Install redist\msxmlenu.msi from the Halo directory. (If this isn't installed already, you will have issues with the chat UI disappearing).
Run the game!

When you are done, you will need to open regedit and delete the registry key you imported before you started playing (if you forget where to find it, look at the paths back in the first section). This registry key contains your CD key, and you don't want to leave that lying around. :)
Answer: The best way is to make an image of the CD and carry that around on the USB stick.  You'll need software like Daemon Tools to mount the image so you can install and play, though.  You will need other software in order to create it in the first place -- I don't know of anything free offhand, but I've used Nero 7 for this.  (Edit: Daemon Tools can now create .mdx images, which I believe only they support.)
Another option is a U3 USB key.  They have a special partition that appears as a CD drive to the computer.  If you got one of those there are some third-party tools to replace the content of that partition so you could potentially put Halo there (or at least the files required by the CD check, since I'm not sure the whole game could fit).  That would be better if you only want to install Halo and not any image-mounting software.
Answer: If you are talking about the Mac OS X edition of Halo, then you can try the following:

Open /Applications/Utilities/Disk Utility.app (part of OS X)
Select the volume you wish to image (you should select the drive in this case to get all partitions on the disc).
Choose File > New > Disc Image from <your selected device> or click the New Disk Image button.
Image format: DVD/CD Master
Encryption: None
Name it & hit save.

Disk Utility will then make an exact copy of your disc that you can keep on your laptop or flash media so you don't have to take the CD with you all the time.


Virtex 4 fx 12 ff668

Question: Could anyone explain me how I can use DCM of Virtex 4 fpga to get divided clock-50MHz of the system clock-100MHz?
Answer: In UG070v2.6 (the V4 userguide), see Fig 2-8: Standard Usage but use CLKDV instead of CLK0 as the output.  Make sure the Divide by Value is set to 2.
Or use the Clocking Wizard in Coregen to walk you through the options and generate you an HDL file.

Virtex 4 fx 12 ff668


Deal with humidity in Garage with no vapor barrier

Question: My garage slab has no vapor barrier and I live in Houston which is often wet and almost invariably humid. Water seeps up through the concrete and humidity is always pretty high in the garage. Power tools don't care much but my chisels and hand planes are a red mess after a few months which requires very deep and cumbersome cleaning. Is my only option to install a vapor barrier and add on 3 or more inches of concrete on top? Would it be possible to wait for a long dry spell and apply some kind of sealant or will this just peel off as the water moves up?
Comment: I think that'll depend on the ground under the concrete. If it's as damp as the air, paint will just peel. Do you know how deep your water table is?
Comment: What about a dehumidifier in the garage? Maybe a cabinet in the house for just your chisels  and hand planes.
Comment: Are you sure it's not condensation from the air? In the spring when the ground is sill cool my slab sweats like a rock drummer. It's not from the ground. The only solution then is to dehumidify the air. I suggest absorbent material in totes for tool storage rather than fighting nature throughout the garage.
Comment: Dehumidifier in a sealed cabinet (or closet) for the tools. Costs less to run than getting the whole garage dry...
Answer: I have had great luck at sealing slabs with 2 part epoxy paint, in a garage you don't want to go cheap or when you drive the car in and park it where the tires are ends up pealing up.
I have painted in summer when the slab was dry enough and eliminated a huge amount of moisture in basements.
This will help if the source is from the slab if high humidity is from the air a dehumidifier will be needed.
I had a friend use a single part epoxy paint and he had the pealing problem. We stripped the paint and used 2 part and it held up fine.
Answer: I've used a product called Xypex.  There's a lot of these Integral Crystalline Systems on the market. The manufacturers say that the thin slurry penetrates wet concrete, especially new concrete, forming dendritic crystals that grow into and fill the microscopic pores and cracks. They claim that the crystal growth penetrates concrete several inches deep. These products are used to seal public concrete water tanks, tunnels, underwater bridge supports, etc. These crystalline sealers are sold by masonry supply companies.
The product, unused, just resembles a very fine grained Portland cement powder. It is mixed with water to a slurry. The idea for application is to thoroughly soak the concrete, then brush on the slurry. As the concrete drys the crystals grow into it, sealing it up. Xypex leaves a finish reminiscent of kiln fired ceramic glazing. I've used it to seal concrete basement/foundation walls, with good results. The basements stay dry.


Only be able to sign into app after existing user send invitation

Question: I am looking to build an app where the only way a new user can enter the app is if they have been invited by an existing user. Are there any API's, tutorials or resources that can help me achieve this. I am using Firebase as my backend and I know it has phone number verification, but I want only invited users to be given an access code to access the app.
Answer: If registration is only possible by invitation, then there are a few possibilities:

Your registration page asks for an invitation code. Such a code could only be generated and sent by a logged-in user and should be one-time-use.
As part of the invitation, you send a one-time-use link to a "registration page". I put the registration page in quotes, because you might also do the user creation part when sending the invitation and then use the password recovery mechanism of your framework to complete the registration process.


Will uneven speed be rounded up or down?

Question: When using the sneak action you can move up to half your speed. If I play a goblin with 25 base speed what would be half the speed? Will 12.5 be rounded up to 15 or down to 10? Since 2.5 is difficult to use in a grid map.
Answer: Always round down (unless told not to); half your speed is 10
The General Rules state:

Rounding
You may need to calculate a fraction of a value, like halving damage. Always round down unless otherwise specified. For example, if a spell deals 7 damage and a creature takes half damage from it, that creature takes 3 damage.
Comment: This doesn't directly address, if 12.5 speed should be rounded down to 12 or down to 10. Is there anything in the rules about rounding movement on grid?
Comment: @Waki I couldn't find anything. But even if it rounded to 12, you couldn't move 3 squares AKA *15* feet
Answer: It would round down to 10, because that obeys the rule to move up to, but not beyond, half your speed.
It can't be rounded up to 15, because that would be more than half your speed, breaking the rule that you can move only up to half your speed.
Comment: @Exempt-Medic I see what you mean, but I don't think that quite reaches the finish line. Half of 25 rounded up would be 13. With an answer of 13, you would still have to answer the question of how to use the partial square of movement when using a grid. Both rounding up and rounding down would still needs the above reasoning to resolve on a grid.
Comment: Ah, that makes sense to me! Comment removed
Comment: Thanks for dropping by, is the grid point you make in the comment due to PF 2e being grid centric? (Don't have that game)
Comment: @SevenSidedDie Given the context of Grid squares and 5 foot intervals for grid movement, rounding up or down also occurs in intervals of 5, as you had mentioned a movement of 12 or 13 would both be invalid for movement on a grid system.
Comment: @KorvinStarmast, it is very grid centric. Not quite as openly as DnD-4e was, where your speed was provided in squares instead of in feet, but still. For example, the Difficult Terrain rules mention squares first, and feet only in parenthesis.


scribe log analysis

Question: I have decided to use scribe to log all the error and request details in my site for analysis.
How can I use the scribe log data to analyze the data.  Is there any tool for this or scribe server programs?
I am using PHP as my scripting language
Answer: People usually use the Hadoop framework to process data coming out of scribe. You can use PHP to script map/reduce steps...
However, unless you have a lot of data, this is probably going to be a lot of work for a small benefit:

http://hadoop.apache.org/

Good luck with that !

scribe log analysis


Can't sign in to Apple Music, TV or Podcast on Mac

Question: I recently did a clean install of macOS Catalina on my MacBook Air and since I can't sign in my Apple Music account in Music App. Neither I can connect to TV although I don't have a subscription contrary to Apple Music. Same thing for Podcast, I can't sign in.
My Apple Music account works fine on the beta website or on my phone and every other iCloud service is fine too.
I tried deleting the full library, rebooting, login out and in again to iCloud and other things like that.
Sometimes I got various error ranging from 11556 to "not available in your country".
Any advice or solution?
Answer: It magically solved itself after few days.


Negative examples for a Yes/No image classification neural network

Question: I am trying to retrain a neural network using transfer learning that can classify whether an image has a certain object, say, a car. My positive sample dataset is quite small, only 2500~ images. It works really well with "regular" binary classification (2500 images of cars/2500 images of flowers and it has to differentiate between those two), but the problem is that I am not sure how to make it classify for all types of images, or how to make it 2500 images of cars/2500 random images and it would have to classify whether Yes - the image is a car or No - it is not a car. What would those random images be? Thanks.
Answer: Have you tried creating a dataset with 2500 images of cars and ~2500 images of random stuff and trained it first?
if so you should try that and see how it works, if it doesnt work you might have to add more images in the "distractor" class.
Provide more information about what you find after you do this experiment and may be we can help further?
Comment: I did! Sorry for not mentioning that. I downloaded batch images of nature, dogs, food, etc. I think that might have been the problem? The images that I downloaded could have been too similar to each other so it would have ended up being a bunch of batches of similar images. It failed, miserably. It thought that a hotdog was a car. Basically ended up having a very high bias towards the positive examples. That's where I got lost and started doubting if it's even possible to do with such a small dataset of positive examples.
Answer: It depends on the goal of the project. What is a "not car"? A motorcycle? A truck? A van? A billboard with a picture of a car?
Within the project's goals, the "random" images should be as close to a car as possible and as diverse as possible.


How do modules come up with their green, yellow, and red releases?

Question: As we all know, not every module marked "Recommended Release" on drupal.org is truly stable. In fact some modules are perpetually marked beta, in some sort of permanent limbo state. Even when hundreds of sites use them every day.
I was wondering what kind of standards or best practices do you use, as a maintainer or contributor, in your modules to mark releases 'Recommended' (Green), 'Other' (Yellow), or 'Dev'(Red)? What do you use when marking it beta, alpha, or stable as well?
Thank you in advance for any advice, help, or documentation you can provide.
NOTE: Many of these standards may be general standards for coding or project development. I simply wanted to know what methods or standards are used in Drupal modules specifically, even if they are / can be generalized.
Answer:
Many of these standards may be general standards for coding or project development.

In Drupal there is no standard for this. It is left to the best intentions of the module owners.
My personal philosophy is:

Release beta and/or releasecandidate if tested in a testing environment, or if all testcases pass.
Release stable only if I, myself, have successfully implemented the (version of the) module in at least three different real-world projects; or if someone whom I know has my standards, did that and reports back.
A module can be finished. It needs no additional work ever anymore. Something that is limited and scoped in featureset, is stable and predictable. Such modules need no bugfixes, feature-requests or tasks.

In practice, this means very few releases, yet the releases done will affect hardly anyone. That results in hardly ever releasing anything in practice.
My reasoning behind this is:

People in issue-queues hardly test appropriately: they apply a feature, fix or patch, hit f5, see it working and say "yes, works for me +1". "It seems to work" is not equal to "it is fixed". You need trustworthy testing, or else the rest, those who did not even test the change, will flock in with issues reporting something COMPELETELY BORKEND, need fix NOW!!.
Only when a module is implemented in different situations and environments will it have some real-world experience. Most often, during the second implementation you find that you need to rewrite some central api's, forgot some usefull parameter, or simply had a wrong idea about the need for some feature. Only after real-world deployment can something be considered stable. Else it is only stable in theory.
Developers and maintainers of sites, the users of your modules, need to put a huge effort (far more then in any other piece of software I know) in keeping up with new releases, security releases and new versions. any relief for that effort (and budget and time) should be more then welcome.
Answer: If there is a module that you use where you found bugs the best thing you can do is file an issue. Even better is if someone writes a patch for that issue, the patch can be written by a developer that needs the feature or it can be written by a developer who got sponsored to write that patch. Contrib maintainers usually maintain a lot of modules and when you create a module you automatically become the maintainer, needless to say that puts a lot of strain into us, so we alway need help by people who write patches, sponsor patches or review them.
When you maintain releases in drupal.org you have a 'Supported' checkbox, enabling that will give you a recommended release (green) and if you also enable the 'Show snapshot release' you will get a dev release (red). If you have more then one major versions of your module (6.1 & 6.2) you can choose which one will be in the the recommended release section (green). Only betas and regular releases will go into the 'recommended' section (green) alphas and lower releases will be displayed in the 'other releases' section (yellow).
Answer: Regarding betas, rcs and dev, it depends on the popularity and niche your module fills imo.
If earl rolled out an official version of views that had a data loss issue the internet as a whole might cease to function.
However, if you have a small module that is relatively unpopular (>1,000 users) and youre just just going through routine bugfixes it is more reasonable to just make new releases and not beta/rc them.
if you know youve made some big chnages or seen alot of churn then test more thouroughly.
I tend to test and roll betas/rc when i am altering the DB or issuing update() hooks because i realize the permanence of data loss. I can reroll and rerelease a small bug fix fast right the world but i can recreate your sites data.
Hope that helps.


How to know client's Magento configuration

Question: I have developed an open source magento Extension but it failed to install in client's Magento and crashed the whole magento.
But when I install the Magento Extension on my own fresh Magento installation it is working fine. I have no idea how to replicate the issue on my own Magento.
How can I know what is the cause for this. One way I can ask client to enable the System Logs or developer mode in the test environment and then install the Extension. Later on I can ask log files.
But how to make extension compatible for all or most of the Magento configurations.
Moreover is there any way to know the client's Magento Configuration and Extensions they have installed.
Comment: you could ask your client to check his apache logs. If his site is crashed, there probably is a php or mysql error that will be logged in /var/log/apache2/error.log. To replicate the issue, the best way would be to replicate his site in your local machine and install your extension
Answer: Instead of rewriting of core classes, you need to use event-observer method wherever possible.
And regarding development environment, you can note the points from following article:
http://www.blog.magepsycho.com/configuring-magento-for-development-debug-mode/
Thanks
Regards
Comment: Well, that's the wrapper logic. You all need to find the related event that would be dispatched for your extension(for example if you are tracking visitor info then you need to collect  data by hooking into; controller_action_predispatch event) and write the event-observer code accordingly.
Comment: I know all this but I can't do this for each and every client who use the extension. The problem is to make the extension robust and compatible for any type of magento configuration.


Show preset taxonomy description

Question: In educational courses database, institute is used as custom taxonomy. How can I display description of "institute" taxonomy in all related posts as one institute will have at least 50 posts (courses)...
Answer: Assumptions:

institute is the taxonomy
course is the term
only one course is assigned per post
you want to display the course description?

If so, the simplest way would be to use get_the_terms(). If your taxonomy is institute, you can do something like the following:
<?php
// globalize $post
global $post;
// Get the course for the current post
$post_courses = get_the_terms( $post->ID, 'institute' );
// Assuming only one course, get the first object of the array
$post_course = $post_courses[0];
// Get the course description
$course_description = $post_course->description;
// Output the course description
echo $course_description
?>

If my assumptions are incorrect, then let me know in the comments, and I'll update the answer.
EDIT

Other assumption is all right but I want to show "institute description". Only one course is assigned per post but each institute contains several courses. Institute is taxonomy and name of institutes are used as categories.

I'm still not entirely sure that I'm following you. Are you saying that institute and course are hierarchical taxonomies? If so, then my original assumptions are incorrect. Can you more clearly describe your schema?
EDIT 2

In this case, I want to show description of university of Auckland. While this university is also used in many other posts. In my case, each course is a post.

Okay, now we're getting somewhere! It seems that course is a Custom Post Type, and that institute is a Custom Taxonomy for that CPT. If this is correct, then my above code should work for displaying the term description for a given post.
Comment: Thanks Bennett. Other assumption is all right but I want to show "institute description". Only one course is assigned per post but each institute contains several courses. Institute is taxonomy and name of institutes are used as categories.
Comment: I am very sorry sir, I am not a professional developer so might be using wrong terms to explain. Please have a look at this.. http://www.wikivisas.com/courses/bachelor-of-science-in-bioinfrmatics/ In this case, I want to show description of university of Auckland. While this university is also used in many other posts. In my case, each course is a post.
Comment: Should I use it as $post_courses as I have no t created (course) custom post type. i am using the default post type for this purpose and only have created taxonomies.
Comment: Post or Custom Post Type shouldn't matter, since you're querying the *taxonomy*, anyway.
Answer: Here is the code that I used recently to display each Term within the Custom Taxonomy (called Service Types), with the description, and then under it displays all of the custom post types (Services) underneath it.
I added an if statement so that if a Service_type does not have a description it does not create the div for it (so there is not a big blank space). You can modify it to show your particular custom taxonomy. This will at least get you started. I did some other pages as well that were to show specific terms within the taxonomy, so if you need more info write out a description.
<?php

//get all service_types (custom taxonomy) then display all posts in each term

$taxonomy = 'service_types';

$term_args=array(

    'orderby' => 'menu_order',

    'order' => 'DESC'

);

$terms = get_terms($taxonomy,$term_args);

if ($terms) {

   foreach( $terms as $term ) {

    $args=array(

      'post_type' => 'services',

      'service_types' =>  $term->name ,

      'post_status' => 'publish',

      'posts_per_page' => 50,

      'caller_get_posts'=> 1

      );

    $my_query = null;

    $my_query = new WP_Query($args);

    if( $my_query->have_posts() ) {  ?>

<?php echo $term->name;?>

        <?php

            $termDiscription = $term->description;

                if($termDiscription != '') : ?>

<?php echo $termDiscription; ?>

                <?php endif; ?>

        <?php

      while ($my_query->have_posts()) : $my_query->the_post(); ?>

<?php the_title(); ?>

                        <a href="<?php the_permalink() ?>" title="<?php echo $term->name;?>"><?php the_post_thumbnail(); ?>

                    <?php the_excerpt(); ?>

       <?php endwhile; ?>

Show preset taxonomy description


Best way to ping for the API changes in the wordpress?

Question: I am importing the posts into the wordpress from external API's , i have created the plugin for this, posts are imported successfully. but now i am going to implement auto check for the new API changes and if new posts exists on the API then import that post into the wordpress.
What is the best way to implement this ?
Can i request the API URL after a certain amount of time ?
Answer: Yes you can use wp_schedule_event to trigger a hook used in your plugin to request the API URL after a certain amount of time.
Comment: It will be nice if you can add some snippet of psedu code that illustrates the use of the technique and not only a link to RTFM ;)
Comment: There are already working code examples at the link provided.
Comment: As I said RTFM do not make a good answer and the codex is obsolete in any case


How do I remove ON UPDATE CURRENT_TIMESTAMP from an existing column?

Question: I did a dump of a mysql 5.5 database and loaded it into a 5.6 server.
The dump added ON UPDATE CURRENT_TIMESTAMP to a bunch of columns that didn't have it previously.
I'm searching for an ALTER TABLE statement that will remove the ON UPDATE CURRENT_TIMESTAMP rule without making any other changes. In my imagination it should be something like ON UPDATE NOOP or ON UPDATE NO_CURRENT_TIMESTAMP.
ON UPDATE JUST_BE_A_NORMAL_COLUMN?
I tried using the "Clear default" option in mysql workbench and it did the opposite of what it should have done - it gave the column a default!
I was able to get rid of the default with ALTER TABLE t ALTER COLUMN c DROP DEFAULT, so the column is mandatory in INSERTs (just like it was before the dump/reload, as I wanted it) but the unwanted behavior on UPDATEs remains.
I have not enabled the explicit_defaults_for_timestamp option. If I was starting fresh I'd definitely use that option since it seems a lot more sane. But since I already had the columns configured the way I wanted them in 5.5, I expected them to keep the same semantics when transferred to 5.6. Apparently mysqldump just wasn't smart enough.
At this point I'm not sure I understand what effects would result from enabling explicit_defaults_for_timestamp. Would that option change the behavior of existing tables, or does it only change the interpretation of future CREATE TABLE commands? Would turning it on somehow help me fix the broken columns?
UPDATE:
A similar question is here but that one is about creating a new table, not altering an existing column. In fact that question is the one I used as a guide when creating the tables on the 5.5 server. I used the 2-step procedure: create with default 0 to suppress ON UPDATE CURRENT_TIMESTAMP, then drop default.
The 2-step procedure definitely doesn't produce the correct result on the 5.6 server without explicit_defaults_for_timestamp; this is a sign that either 5.6 doesn't perfectly imitate the old behavior in this mode, or the old server never did what I thought it was doing. I can't be sure which.
Answer: ALTER TABLE mytable
     CHANGE mycolumn
            mycolumn TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP

I believe this will reset and void the ON UPDATE. This would effectively make this definition:
CREATE TABLE mytable (
  # Other Columns
  mycolumn timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
)

Change into this one:
CREATE TABLE mytable (
  # Other Columns
  mycolumn timestamp NOT NULL default CURRENT_TIMESTAMP
)

If you wanted to reset the column entirely, you should be able to simply redefine it like:
ALTER TABLE mytable
     CHANGE mycolumn
            mycolumn TIMESTAMP NOT NULL;

Comment: Actually, on a second attempt, your first suggestion followed by a `ALTER TABLE ... ALTER COLUMN ... DROP DEFAULT` seems to be working. I'm still trying to figure out why that exact combination works and other similar ones don't.
Comment: I need a way to do this *without* adding a default. Your suggestions create a default, and then if I drop the default, the auto-update attribute comes back.
Comment: See the second alter statement. That modifies the column without specifying a default.
Comment: Which brings in all the "hidden default" behaviors - CURRENT_TIMESTAMP as both the default for insertion and the auto-update. Maybe with explicit_defaults_for_timestamp it would work. But since I discovered I can't set that option without restarting the server, it's not something I can test right away.
Comment: It still doesn't make sense, but I have gathered enough information to describe (if not explain) the behavior. And as a lucky side effect I solved my original problem too. I posted my results as a self-answer, but I'm giving you credit for pointing me in the right direction.
Answer: Using the ideas from the other answers, and a couple of freshly installed mysql server instances, I have done a comparison of the behavior of several different CREATE and ALTER commands on 3 different server configurations:

mysql 5.5.45
mysql 5.6.26 without explicit_defaults_for_timestamp
mysql 5.6.26 with explicit_defaults_for_timestamp

The easiest one to explain is 5.6 with explicit_defaults_for_timestamp. Everything is sane. The timestamp type is not noticeably different from any other type. Columns created before the explicit_defaults_for_timestamp flag was turned on retain their old defaults and magic update.
In 5.5, the implicit defaults happen when a timestamp column is created (if it is the first timestamp column in the table). These are well documented already. The magic update behavior can be avoided by setting an explicit default, and then the default can be removed, leaving the column with the 3 desired attributes: non-nullable, no default, no magic update. This is the result of CREATE TABLE t (TIMESTAMP c NOT NULL DEFAULT 0) and ALTER TABLE t ALTER COLUMN c DROP DEFAULT.
This state can't be recreated with a single CREATE TABLE command, and it doesn't survive a mysqldump.
5.6 without explicit_defaults_for_timestamp is the most interesting case. It's almost the same as 5.5, but the DROP DEFAULT command is different. If you try the "create with default 0 then drop default" sequence, the magic update attribute appears as a side effect of the drop. But if you make the default CURRENT_TIMESTAMP instead of 0, then the DROP DEFAULT works without the side effect. (Must be a bug. I can't imagine any reason it would intentionally behave this way.)
Therefore this pair of commands will have the same result on all of the server configurations I tested:
ALTER TABLE t CHANGE COLUMN c c TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE t ALTER COLUMN c DROP DEFAULT;

The column now has no default and no magic update.
Comment: Accept your answer! (I'm honored to encounter the same problem with a 10k user :D)
Comment: Work on 5.7 too ! Thank you !!
Answer: For your use case I think you would be better served with DATETIME, eg:
ALTER TABLE `my_table`
    CHANGE `my_col` `my_col` DATETIME NOT NULL DEFAULT NOW();

This will default to NOW() on insert, but remain unaffected on update.
See this question for a good explanation of the difference:
Should I use field 'datetime' or 'timestamp'?
Answer: If you want to remove both the DEFAULT value and ON UPDATE value, nothing but the following helped me
ALTER TABLE `your_table` CHANGE `your_column` `your_column` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00';

Answer: Try enabling the explicit_defaults_for_timestamp system variable and then redefine the columns with:
ALTER TABLE `table` CHANGE COLUMN `col` `col` TIMESTAMP NOT NULL;

If I understand the documentation correctly enabling explicit_defaults_for_timestamp is mandatory to be able to define TIMESTAMP columns declared as NOT NULL and without an explicit DEFAULT.
Comment: I suspect you're right. I wish the documentation would be more clear about the option's effect on existing columns so I could be more confident about turning it on. Taking the plunge... and `set @@explicit_defaults_for_timestamp=1` didn't work. Read-only variable. I guess that means it requires a server restart.


Can I say 'I will keep your heart from the fall'

Question: Can I say in the poem: "I will keep your heart from the fall"?
Or "I will save your heart from the fall'?
Of course, it's indirect meaning.
Comment: Poetic license means that you can use any wording that is understandable. In normal usage however you are unlikely to find "from the fall" used this way. Rather "from falling". keep vs. save does not change this.
Answer: If you are referring to a particular fall, then yes, you can say:

I will keep your heart from the fall.

But if you don't have a particular fall in mind, and the meaning you want to convey is that you will take care so that the person's heart never falls, you can say:

I will keep your heart from falling.

P.S. So you want to ask, "Can I say in a poem..." or "... in my poem", because we, the readers|listeners, don't know which poem you are referring to when you say "the poem". After you have made clear to us which poem you have in mind (e.g "my poem"), then you can begin to say "the poem".


Chrome Driver not functioning preventing use of Selenium

Question: I am trying to run a script with selenium using chromedriver as the driver.  I receive the following error information:
Traceback (most recent call last):
  File "C:\Users\samde\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
    stdin=PIPE)
  File "C:\Users\samde\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\samde\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scrape.py", line 10, in <module>
    options= chrome_options)
  File "C:\Users\samde\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
  File "C:\Users\samde\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

I think this maybe a path issue, but am unsure how to fix it. I added the chromedriver location to PATH in "Environment Variables" when I installed the chrome driver. Its location/ path is : "C:\Web_Drivers".
When I call chromedriver in powershell, I receive the following message:
Starting ChromeDriver 76.0.3809.126 (d80a294506b4c9d18015e755cee48f953ddc3f2f-refs/branch-heads/3809@{#1024}) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

Answer: Basic Troubleshooting

You may want to try using a regular command prompt (rather than PowerShell) and see if that helps to resolve the issue.
Another consideration may be if you placed the path to chromedriver.exe in your User path rather than your System path.
You should log out and log in after updating your path variables. In some cases, you may need to restart the PC as well.

Calling ChromeDriver
Assuming ChromeDriver resides in your Windows path, use either chromedriver or chromedriver.exe in your script e.g.:
ex. without executable_path
driver = webdriver.Chrome('chromedriver')

ex. with executable_path
driver = webdriver.Chrome(options=options, executable_path='chromedriver')

ex. with executable_path and a variable
chromedriver_path = 'chromedriver'
driver = webdriver.Chrome(options=options, executable_path=chromedriver_path)

Other Options
There are also several options for specifying the path to ChromeDriver directly:

Assuming chromedriver.exe is in the same folder as your script:
driver = webdriver.Chrome()

Specifying the full path to chromedriver.exe without executable_path:
driver = webdriver.Chrome('C:/path/to/chromedriver.exe')

Specifying the full path to chromedriver.exe with executable_path:
driver = webdriver.Chrome(options=options, executable_path='C:/path/to/chromedriver.exe')

Specifying the full path to chromedriver.exe with executable_path and a variable:
chromedriver_path = 'C:/path/to/chromedriver.exe'
driver = webdriver.Chrome(options=options, executable_path=chromedriver_path)

Be aware that while you can also use C:\path\to\chromedriver.exe and C:\\path\\to\\chromedriver.exe, some Chromium\ChromeDriver forks may not accept C:\path\to\chromedriver.exe. In this instance, try using either \\ or / instead.


Need help with checking responses from balanceOf functions

Question: So I have two contracts
Contract A & Contract B
Contract A is an ERC721 that allows for the balanceOf function to be called after passing it an address. It will return response of how many NFTs the address you pass it has in the wallet.
Contract B is a ERC20 contract. I am trying to implement transfer requirements on Contract B that call for the balanceOf Contract A based on the msg.sender address you pass it & return the value to compare against >= 1 to make sure the transfer is even eligible.
Overall, trying to make Contract B check if the msg.sender has a balance of Contract A & then as long as it is >= 1, the Contract B transfer should work.
Anyone know how I would do this using require() in the transfer function on Contract B?
Below is the transfer function within Contract B that I am trying to mess with. I have tried a ton of methods & just cannot figure out the best way to implement this logic.
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");
        require(address(0xEBE7d6984917DEcceaCc089bb7E33471CCe566b8).balanceOf(msg.sender) >= 1, "You must be a member by obtaining your badge!");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        _balances[sender] = senderBalance - amount;
        _balances[recipient] += amount;
        holderManage(recipient);

        emit Transfer(sender, recipient, amount);
    } ```

Answer: You should first cast the contract to a certain type before accessing its methods. In this case, you need to query the balanceOf an ERC721, so we'll use the IERC721 interface:
require(IERC721(0x..).balanceOf(msg.sender) >= 1, "...");

P.S. To access IERC721 you can import the OZ implementation, which you're probably already doing.
Comment: Thanks, gonna implement this now, couldn't figure out why it wasn't working but swapping address for IERC721 makes sense. I will keep you updated
Comment: Just ran some tests, this method is working perfectly. Thanks a ton for the help


Want to remove Unlock login key ring when no keyring directory is there?

Question: Recently I lost my root user password. So I had reset it using the Recovery terminal.
Now whenever I login, the Ubuntu shows a dialogue box with unlock keyring. I already tried for deleting the keyring folder in the .gnome2 folder but there is no folder related to keyring or anything.
Comment: You see there is the problem. There is nothing to edit or do right click on... if i try to make a new keyring named as login it hangs up. Even the folder in gnome2. doesn't has any folder named keyring or login rather it is empty...
Comment: When I open passwords and keys, there is no key or keyring or tabs. though there is an option adding a keyring and others.
So you see there is nothing to change.
Comment: What if you don't know the original user password, which was the reason for the change in the 1st place? You can't add a new password. Tks
Answer: The answer is provided in Ubuntu One help faq. The link is here.
That says:

Open Applications->Accessories->Passwords And Encryption Keys or on
Ubuntu 11.04 or greater press the "super key" (Windows key on most keyboards)
and type "Passwords" then click on "Passwords and Encryption Keys"
Right-click on the "Passwords" folder and select "Change Password"
Set the new keyring password to be the same as your login password.

Alternatively, if you don't know the old password at step 2.

Right-click on the "Passwords" entry and select "Delete".
Now create a new "Passwords" entry and give it a password (likely the same as your login for simplest usage.)
Comment: Have you changed your keyring password to login password?
Answer: For others coming across this from Google who have a fully encrypted hard drive and want to remove the passwords here is an alternative.
This will disable the key ring prompt by removing the password.
Set the key ring to no password.

Press super key, or click launcher orb, enter password and select "Passwords and Keys" when it comes up
Right click "Login" for Passwords section
Follow the prompts and set an empty password
Accept the prompt for storing keys/data unencrypted

I do realize some people are gonna jump all over this answer, but if you have your entire hard drive encrypted with LUKS, then the data is already encrypted and the drive unlocked/decrypted during startup prompt.
If you're like me and prefer your drive encrypted, then typing both the drive encryption password and then a login password is redundant and annoying.
Some references:
http://ubuntuhandbook.org/index.php/2013/07/disable-unlock-login-keyring-ubuntu-13-04/
How secure is an encrypted LUKS filesystem?


Smoothen an Arc

Question: I'm completely new to Blender.
I am trying to smoothen out the arc.
however when I'm using the Shade smooth or Subdivision surface modifier, the whole shape crashes.
is there a way to smoothen out the arC?
Comment: it won't smooth on the inner faces because you have too many edge loops and they tend to flatten the faces, you should try first to X > Limited Dissolve (see the parameters in the Operator box on the bottom left of your 3D view), then shade smooth, then Properties panel > Object Data > Normals > Auto-Smooth
Answer: Sorry, I've gone a bit nuts, and this answer has turned into an essay. If you just want a suggestion on how to model your arch, jump to the TLDR, below.
Smooth shading:
Roughly speaking, smooth-shading works by:

Triangulating the mesh
Calculating vertex-normals by taking an average of the normals of adjacent triangles
Linearly interpolating the shading-normals between the vertex-normals, across the triangles.

These averages and interpolations may be weighted in various ways, but the principle remains the same.
The interpolated normals may be very different from the normals of the underlying geometry, yielding weird-looking results:
Behind your back, the renderers are doing this:

The illustration also shows the vertex-normals. As you can see, where faces meet at 90 degrees, the averaged vertex-normals stick out at 45 degrees. The shading normals are interpolated between those vertex-normals, across the triangles, which is not the same thing as the normals of the underlying faces, at all.
This is especially apparent when large, thin, triangles are interpolated across right-angles between faces. This is partly why N-gons are best avoided, except within entirely flat areas.
By switching on Autosmooth, in the object's Data tab, Normals panel, you can split the normals, per-face, preventing interpolation of normals where faces meet at greater than a threshold angle:

.. which can be an instant 'fix'. But the result can be unnaturally flat. (The material, here, is the same as the one in the previous illustration.)
The normal-interpolation is strictly between adjacent faces. So a Bevel can ease the interpolation of normals between large faces, by inserting small intermediate faces. If the profile of a 2-segment bevel is 1, (so the new faces are coplanar with the old ones) the interpolation is still between normals at right-angles, but restricted to the small bevelled area:

Top Left: No bevel.

Top Right: Bevel, 2 segments, shape 1, pretty much the same result as Autosmooth, but with a glint on the edges.

Bottom Left: Bevel, 3 segments, shape 0.75. You can soften the bevel quite some way. Adjusting the shape can make the normal-interpolation across the original, large, faces more reasonable.

Bottom Right. Subdivided. Bevelling won't necessarily rescue you from the entirely different problem of how Catmull-Clark subdivision creates new faces, and where it puts new vertices.

Subdivision
Making topology suitable for subdivision is another subject.. but a few rules of thumb:

Don't give Catmull-Clark faces with concave outlines to subdivide. The algorithm will usually place new vertices outside the faces altogether.
For the same reason, avoid narrow triangles, sharp angles at 'poles', where more than 4 edges meet.
After 1 level of subdivision, all your faces will be quads, anyway, so, if you're at a low-poly stage of modelling, n-gons in generally flat or near-flat areas aren't too harmful, but try to model with all-quad topology with squarish faces wherever possible. Blender's selection and modelling tools are geared to working with loops and rings of quads, so your life will be easier,too.
Try to keep the density of faces even across the model. If you need higher densities in some areas, try to make the transitions smooth.

TLDR;
To model this way, you need some sort of even transition from the semicircular arch to the rectangle that surrounds it. One possible route is this:

Starting with a subdivided plane, select inner vertices
X > Dissolve the vertices, leaving the perimeter subdivided
Face menu > Poke the face
CtrlShiftB Bevel the central vertex
J join the vertices across the middle
X > Delete unwanted faces
EY (or whatever axis you're working on) Extrude the  bottom edges straight down
Select the new long edges, and Edge menu > Subdivide them
Select all faces, and E extrude, or use a Solidify modifier.

Then the model is suitable for a Bevel of its sharp edges, either CtrlB by hand, or by using a modifier, and a level or two of Subdivision.
Comment: Dunno why step 5 is in there.. forget that one..
Answer: Let's say that you have this arch:

To shade smooth, right click and choose Shade Smooth. The result will be horrible as it will try to smooth between large perpendicular faces, so what you need to do next is go into the Properties panel > Object Data > Normals and enable Auto Smooth in order to define which faces will be smoothed.

Note that the profile won't be rounded though, you need more geometry if you want a round profile, in that case you need to subidive with a smooth value of 1, but it won't work fine, it will round everything unless you've sharpened your angles with additional edges.
The problem with your current topology is that you must have tried to round with subdivisions, but you didn't do the right way, so now it has a lot of faces that are coplanar, so instead of rounding the surface, it will tend to flatten it, even with the Shade Smooth and Auto Smooth. A lot of faces can round a surface if the faces are not co-planar, which is not the case here:

A way to fix your problem is to dissolve the co-planar faces with X > Limited Dissolve, you can tweak the angle in the Operator box if necessary, then give your object Shade Smooth and Auto Smooth and it should work.

Smoothen an Arc


Using shared files as database

Question: As a project for my database classes, I built a simple object-oriented database (coded in C++). The DB manages concurrency by using a gateway file, which grants read/write access to the entire DB. To access the same DB across different machines, you use shared folders.
I built a little quizzing application on top of that. Everything works fine on a single system with multiple users as well as on a 3 computer network on my home. But when its run on my University's network, I keep getting inconsistent data corruption in the form of bad CRCs (in my database, not the disk), file headers being inconsistent with file data, and other weird errors, which I'm unable to track down.
   The network is problematic - sometimes some nodes on the network become unreachable, and sometimes copying a file takes across the n/w takes an inordinate amount of time.
Occasionally, I get an error message 'Windows delayed write failed', so I'm thinking the problems are being caused by problems with file sharing across the network. From some analysis its seems that data is being cached, and so I don't know really know whether a disk write is successful.
Does anyone have any experience in using shared files as databases? I want to know whether using shared files is reliable, and whether I should be looking at bugs in my code as the cause of the problems.
Thanks.
Answer: No, it's not reliable. It was the reason why CVS disabled mode that used shared files for repository. The solution is to create a server (e.g. a simple TCP/IP server).
Comment: Thanks. Any pointers as to why its unreliable and why a TCP/IP server would be more reliable?

Using shared files as database


What is the origin of the trope where a person lays on the ground with their "soul" coming out of their mouth?

Question: So I was re-reading the Fullmetal Alchemist series recently. I noticed this scene below with the man presumably on the verge of death with I presume to be his "soul" coming out of his mouth. I was wondering what the origin of this trope is, since I have often seen this in other mangas and animes.
Comment: Please de-accept the answer by Dimitri mx, since it's mostly if not entirely wrong.
Answer: According to chinese traditional medicine, when a person dies, the soul escapes the body from one of its orifices (any). These beliefs passed to the other asian cultures. So, the soul leaving the body from the mouth is a familiar image that would need no explanation for asian people.
Answer: This is a sample of the Giving Up the Ghost tropes The term itself actually originates from the King James Version of the Bible

when Jesus was on the cross, His last words were
  "Father, into your hands I commit my spirit." When he had said this, he breathed his last." (New International Version)
  The King James Version of 1611, however, gave it the contemporary wording
  "... and having said thus, he gave up the ghost." source

The trope is a spinoff version of the western version Winged Soul Flies Off At Death. The western version got first used in 1948 in a western animation

The 1948 short "Back Alley Oproar" with Sylvester and Elmer Fudd. Sylvester insists on singing when Fudd wants to sleep, and Sylvester eventually ends up on a cloud, complete with halo and wings.

as for the giving up the Ghost trope I am not certain when it first occured.
Comment: This is fine as far as explaining the purpose/function of the trope, generically, but it does nothing to explain why this particular _representation_ of it (soul leaking out mouth) occurs.
Comment: @senshin I did not directly quote it but the first link directly provides the answer to this " ...This is a comedy trope found in anime and manga. Sometimes, a character may feel like they could die at any moment due to some form of sudden external stimulation or just plain exhaustion. It could be getting knocked out with a sudden blow to the head...."
Comment: As mentioned [here](https://wordhistories.net/2018/06/18/give-ghost-die/), the phrase "give up the ghost" appeared in the 1395 Wycliffe Bible, which predates the King James by centuries, and there are similar phrases in Old English. The origin of the English term is irrelevant in any case. The concept of a life essence that leaves in one's last breath is very old, probably much older than recorded history, and has appeared in different cultures independently. You've presented no evidence that the ghost in the question is related to Western winged angels. It looks more like a hitodama to me.


Pin Assignment in ispLEVER Classic

Question: I have an ispGAL22LV10C that I'm trying to program. I wrote and synthesized the VHDL in ispLEVER Classic, but I cannot seem to figure out how to create pin assignments. Documentation on this is kind of lacking, how might I go about this? I cannot seem to find this fabled "constraint editor" in my version (the latest). Thanks
Answer: Found it on my own after an hour of searching. As per the website:

How can I assign device pin out for GAL devices?
The Design Planner (or the Constraint / Preference Editor) is not
  supported for GAL devices. The pin assignments can be made either in
  the HDL source code itself or you can let the software choose them.
For ABEL, specify a pin number when declaring the pin.
Example syntax for ABEL source pin assignments can be found in File >
  Open Examples. Then browse to Examples > SPLD > gal > mlcount >
  mlcount
For VHDL or Verilog, use the attribute 'LOC'
Below is an example in VHDL:
  Syntax
attribute LOC : string;
attribute LOC of SigName: signal is "P[Pin#]";

Example
attribute LOC : string;
attribute LOC of out0: signal is "PA3";
attribute LOC of out1: signal is "PF8 PA2 PB3";

Comment: This seems to work with "simple" signals. The problem I have is when I want to assign vector members: `attribute LOC of A(15):signal is "P15";`. In such case I get `@E: CD128 :"C:\users\public\documents\isplever\design.vhd":28:18:28:18|Expecting : before class of object(s)`. Any help with that?
Answer: I have found a different solution (with at least ABEL_Schematic):
In the 'Chip Report' there is a line with 'ABEL PLA file'. Find that file in your design directory and inside you will find the following line
#$ PINS .....

now here you can reassign the pins like "A11:13 A12:15 "..etc {signal name}:{pin#}
After done, just run the 'Fit design' (+create fuse map) again and voila, you have the right signals at the right place.

Pin Assignment in ispLEVER Classic


How to know the locale that has been used to initialize a Postgres server?

Question: I need it in order to create a new database with initdb with the same locale, otherwise pg_upgrade will fail.
Answer: One option is to use psql -l, but it outputs many lines if there a lot of databases.
Answer: When upgrading to postgresql 16 or later, this is no longer relevant. The locale and encoding match requirement has been removed as redundant, pg_upgrade now copies the encoding settings itself: https://github.com/postgres/postgres/commit/9637badd9f9209166140eb567602e91699dd2ffb
When upgrading to postgresql 15 or older, the most important are the locale settings for the database named template0.
psql -c '\l template0'

initdb should be called with same --encoding=... --locale=... --lc-collate=...


Don't charge iphone when plugged into macbook?

Question: Is it possible to temporarily keep your iPhone from draining the macbook battery? When I'm out and about I sometimes want to connect my [nearly empty] macbook to my [not so empty] iphone so I can tether without using WiFi (saving battery), but then my poor macbook starts charging my iPhone and is drained even faster.
Comment: Would it work to connect the iPhone via a basic unpowered USB hub? That should limit the current available to the iPhone to 100 mA maximum.
Answer: Not possible, you would have to physically alter the USB cord and remove the pins related to power and leave the data ones intact.
Answer: That's not possible. Also, modifying a USB cable (as suggested in another answer) is a) probably not a good idea and b) probably won't even work (see this question & answer).
Energy-wise, you are most likely better of by just using wifi for tethering.


Problem with lights in blender 2.81

Question: I'm having some problems with a blender project, I'm trying to learn how to animate and I did this very simple barrel that falls: only problem is, I can't figure out why but there is way too many light in my simulation (There maybe is a more precise name for that), and I really can't work out why the light that I created does not seem to work. I tried to increase a lot it's watt and change color, and I even tried to get it closer to my object, but it simply does not seems to work and I don't understand why. I'm leaving the project file so if you want you can download it and try to give it a look.
Project file (google drive)
Answer: Okay I looked at your file. There are some major problems, you are working on your lighting too soon. You have no materials applied to any of your objects. You need at least a basic material to setup lighting. Also your camera isn't placed very well to catch the action, it is barely getting the barrel at all. Fix these first then try to get the lighting. I would use a sunlamp, not the spot lamp.
Comment: Well of course I didn't mean to render the scene with the camera and the light placed in that fashion, i was just trying to see if i could have an idea of what to do in the future. You say that using some texture and material i should not have problem of this kind?
Comment: There was only the one default light, if you have materials it will let Blender know beter what to do with the light and give you contrast as you adjust your lighting.

Problem with lights in blender 2.81


Find users with the Manage Encryption Keys permission with Apex

Question: I'm trying to find users with the Manage Encryption Keys permission. I want to ensure only specific users have this permission, and I'd like to do this without reviewing every user in my Salesforce environment.
Answer: Use the following query:
SELECT Id, AssigneeId, Assignee.Name, PermissionSet.IsOwnedByProfile
FROM PermissionSetAssignment
WHERE PermissionSet.PermissionsManageEncryptionKeys = True AND Assignee.IsActive = TRUE
ORDER BY PermissionSet.IsOwnedByProfile DESC, Assignee.Name

You can get a list of all Permissions (they are individual boolean fields) by looking at Workbench for Object PermissionSet
Reference: User, Sharing, and Permissions Objects
Answer: If you are using source code management like git and you have your permission sets and profiles in your Repository you can simply check which profiles and permission sets contain the permission and find the corresponding users.
Comment: this can get tedious/involved if a permission set is part of many permission set groups; that said - for the `Manage Encryption Keys` permission, one would hope it is not enabled in too many places!


Why can't a particle rotate about its axis?

Question: When treating an atom as a point partcle, it is usually assumed that it cannot rotate about its axis. Is it that anything considered as a point particle cannot rotate about its own axis? If so, why is that the case?
Comment: Does this answer your question? [In counting degrees of freedom of a linear molecule, why is rotation about the axis not counted?](https://physics.stackexchange.com/q/168943/)
Comment: See this one:https://physics.stackexchange.com/q/460841/
Answer: It is because of quantization of the angular momentum. If an atom rotates, that would mean a higher orbital angular momentum for the electrons. Usually, that is a state several electron-volts higher than the ground state. Not accessible at ordinary temperatures.
Comment: I don't have much knowledge of quantum theory. What about a classical single particle? Can such a particle rotate about its axis?
Comment: Doesn't quite answer the question I think. The question was about point particles. An atom which can get excited into a state with non-zero orbital angular momentum for the electrons is, for that very reason, not a point particle.
Comment: @AndrewSteane The question was about atoms. The standard explanation for that is not that it cannot rotate because "an atom is a point particle".
Comment: The question reads "Is it that anything considered as a point particle cannot rotate about its own axis? If so, why is that the case?"
Comment: I have edited the question. I hope it is clearer now
Comment: @Toba At some energy scale, quantization of angular momentum becomes noticeable. Also for the rotations of a diatomic molecule. It can be treated as a rigid rotor. Different values of the angular momentum of rotation then have different energies. At very low temperatures, only the ground state is populated for practical purposes. Rotation is then said to be a "a frozen degree of freedom".
Comment: In classical statistical mechanics no reference was made to quantization of angular momentum (I believe statistical mechanics was already well established before the advent of quantum theory), it was simply stated that the atom cannot rotate because it is a point particle for all our purposes. I am trying to understand the basis for this assumption.
Answer: The aim of this answer is to give a physical intuition without quantum mechanics (The answer by Pieter should be the correct rigorous answer):
A monoatomic gas contains per definition of single atom particles. That means these particles consist of the core of the Atom (with the whole mass, roughly point particle in comparison to the size of an atom) and the electronic orbitals (Contain a negligible amount of mass compared to the core).
I think the intuitive way of thinking is to say, by 'rotating' this negligible small mass (the electrons) you are nowhere near the energy scale of the displacement degrees of freedom (DOF) of the atom.
In comparison in a two atomic gas, only if the two atomic cores are rotating around the rotation axis the DOF is considered. We have the same case as for the one atomic gas if both cores lie on the rotation axis.
Hope this gives you some intuition behind this consideration in stat. phys. .
Comment: Why can't the core of the atom rotate about its axis?
Comment: It could, but intuitively an atomic core would have a small moment of inertia https://en.wikipedia.org/wiki/Rotational_energy https://en.wikipedia.org/wiki/Moment_of_inertia and therefore you could store far less energy in the rotation of a core
Comment: The moment of inertia is dependent on the expansion of the object, therefore in point particles with roughly no expansion we have a negligible moment of inertia and therefore negligible rotational energy
Comment: The moment of inertia was derived based on the assumption that the object contains many particles. How is the derivation modified for the case in which the object is a single particle?
Comment: There is no. That is the whole point. For one point particle, you go in the integration of the density $r\rightarrow 0$ and the moment of inertia is zero, which means the rotational energy is zero.
Comment: $I=\int_V r^2_\perp \rho(\vec r)$ with $\rho(\vec r)=\delta(\vec r)$ a particle density delta peak leads to a moment of inertia that is zero
Comment: jan0155 can you give your opinion as an answer instead of a comment? I think I understand what you're talking about
Comment: But does it even make sense to talk about the moment of inertia of a point particle rotating about its own axis?
Comment: @Toba Have you looked at the equations for moment of inertia and observe what happens when you set all dimensions in the equation to zero?
Answer: If the particle is charged, then rotation would mean acceleration of charge. Rotation means constantly changing the direction of the velocity, ergo acceleration. An accelerating charge would radiate (emit photons), so this state would never be stable. The idea of spin came about because we observed stable charged particles that interacted with magnetic fields as if they were rotating, but weren't emitting any photons. So this classical interpretation led to a contradiction, and we knew it couldn't be the correct picture.
In general, small things in classical theories can rotate. But that's just not how particles actually behave.
Answer: I will answer the title

Why can't a particle rotate about its axis? for elementary particles.

If you look at the table, almost all elementary particles are axiomatically assigned spin. Spin in classical mechanics is a rotation about an axis going through the center of mass of the particle. Thus , in a classical picture elementary particles do rotate.
BUT elementary particles are quantum mechanical entities, and their position in space is controlled by a probability distribution, which is predicted by the wavefunction of the solution for the boundary conditions of the specific problem, scattering or decay. So what does spin mean for elementary particles?
Spin had to be assigned in elementary particle interactions, particle by particle in the table, in order fot the law of angular momentum conservation to apply at the quantum mechanical frame.
The assignment in the tables has been found to be consistent with all the up to now data. Thus the answer for elementary particles to the title is also: yes , elementary particles rotate in a mathematically convoluted probabilistic way.

In quantum mechanics and particle physics, spin is an intrinsic form of angular momentum carried by elementary particles, composite particles (hadrons), and atomic nuclei. extends to composite particles and also to atoms

So the argument above holds for atoms too. That is why one has nuclear magnetic resonance phenomenon.

All isotopes that contain an odd number of protons and/or neutrons (see Isotope) have an intrinsic nuclear magnetic moment and angular momentum, in other words a nonzero nuclear spin, while all nuclides with even numbers of both have a total spin of zero.

To address this:

Is it that anything considered as a point particle cannot rotate about its own axis? If so, why is that the case?

Strictly, if one considers the center of mass of the particle as a point, and the particle has a volume about that point, there will be a possibility of acquiring angular momentum when, if it is a dust particle, it hits another dust particle; this will give a linear momentum and can (if not head on) also induce rotation about an axis that goes through the center of mass. But if, for simplicity of mathematics to be derived, it is really considered as a particle with no extension about the center of mass  point, there is no way an impact can transfer angular momentum, by construction of the model.
Comment: Really nice answer.
Answer: A point has a location but zero size aka a radius/diameter/dimension of zero.
In order for something to rotate, some part of the thing must orbit around some other part of that thing. But if something has zero size, that means the entirety of the object exists in the same infinitesmal location in space. So how can multiple parts of an object orbit each other when all those parts are located at the same infinitesmal point in space?
Answer: As requested by Toba, I would like to summarise my thoughts on the moment of inertia of a point particle and how it leads to a trivial consideration of the energetics of the rotation of a point particle.
This consideration is purely classical.
Moment of Inertia:
The moment of inertia is defined as follows: $$I=\int_V r_{\perp}^2\rho(\vec r)$$
The integral over a particle density $\rho(\vec r)$ multiplied with the square of the distance from the rotational axis $r_\perp$.
The moment of inertia is related to the rotational energy of the object described by the density rotation with an angular velocity $\omega$ as follows: $$E_{\text{rot}}=\frac{1}{2}I\omega^2$$
And also related to the net angular momentum of the system via: $$L=\frac{I}{\omega}$$
Moment of inertia of a point particle:
Now let's consider a point particle, that means we consider a particle density that is peaked at a single point $\rho(\vec r)=m \delta(\vec r)$ (That means it is described by a delta distribution, coordinate frame is chosen in the way that the particle is located in the origin). $m$ is the mass of the point particle. We can now use this definition of the moment of inertia to calculate it for the point particle. $$I_{\text{point particle}}=\int_V r_\perp^2\rho(\vec r)=m \int_V r_\perp^2 \delta(\vec r)=0$$ As the delta distribution gives a non-zero contribution only at $\vec r = 0$ where $r_\perp=0$.
Interpretation:
As we see the moment of inertia of a point particle is always zero, therefore, a point particle never has any intrinsic rotational energy or intrinsic angular momentum. So the internal rotational DOF of a point particle do not contribute in the statistical mechanical as they do not change the energy of the particles.
Angular velocity
It does also not make much sense to talk about the angular velocity of the particle because it because the angular velocity is defined by the angle the object rotates around the rotational axis in a certain time. If the particle is only present at the rotational axis the common definitions of the angular velocity fail:
$$\vec \omega = \frac{r\times v}{r^2}$$
As it describes the rotational between points which is no longer possible in a point particle.
Conclusion

Rotational DOF are irrelevant for point particles as $E_{\text{rot}}=0$
It does also not make much sense to talk of the rotation of a point particle because in order to define rotation you need two distinct points in the object.

What changes towards the two atomic gas
In the two-atomic gas (two particles of mass $m$, and distance $2\vec d$ perpendicular to the rotation axis, rotation axis between the particles) we have the following particle density \rho = m\delta(\vec r + \vec d) \delta(\vec r - \vec d) therefore the moment of inertia of this system is:
$$I_{\text{2 atomic gas}}=\int_V r_\perp^2\rho(\vec r)=m \int_V r_\perp^2 \delta(\vec r + \vec d)\delta(\vec r - \vec d)=m|d|^2+m|d|^2 = 2 m|d|^2$$
So we have a non zero moment of inertia.
Also the angular velocity $$\vec \omega = \frac{r\times v}{r^2}$$ can be defined and calculated for the system. Therefore the rotation of those particles with respect to the rotational axis matters and leads to a change of the rotational energy of the gas constituent and has to be included in the thermodynamic considerations
Some Links

https://en.wikipedia.org/wiki/Moment_of_inertia
https://en.wikipedia.org/wiki/Angular_velocity
https://en.wikipedia.org/wiki/Rotational_energy
https://en.wikipedia.org/wiki/Dirac_delta_function
Answer: It doesn't make sense for a point particle to rotate classically. In classical mechanics, a point particle is characterized by it's position and momentum (and mass and charge). The smallest possible rotating object is then a set of two particles that are attached to each other and separated by some small distance. This object can have angular momentum as long as the component particles have different velocities at a given point in time. A point particle cannot have angular momentum in this sense. The only way this would be possible is if we add angular momentum as an additional fundamental quantity to our description of particles. This is more or less what happens in quantum mechanics.
Comment: Though I like your answer, I still don't fully understand why two connected particles is the smallest possible object that can rotate. Can't we also specify the position and momentum of a rotating point particle?
Comment: How would you define the angular momentum of a point particle? Normally, momentum is a sum over mass times tangential velocity times the distance from the axis of rotation. For a point particle, all the mass is located at zero distance from the axis of rotation, so the only way to get angular momentum is if we define our particles as having intrinsic angular momentum (like how mass and velocity are intrinsic properties of a classical particle).


Miraak is stealing all my dragon souls

Question: After reading the book Waking Dreams and seeing Miraak, I couldn't absorb a dragon's soul. I killed more than 10 dragons and Miraak took all the souls. Is this supposed to happen?
Answer: Yes. Miraak steals the souls of dragons when you kill them, all but a few. Until you kill him, you'll only get roughly 10% of all the dragon souls you collect.
Additionally, as per the comments, when you kill Miraak you get all of the souls back, which in all honesty, I find can be quite ridiculous. I played the game for ~100 hours before I finally killed Miraak. I now have over 40 Dragon souls that are completely useless.
Comment: You'll also get back any souls that he steals once you kill him
Comment: That's also why [this](https://www.nexusmods.com/skyrim/mods/2063/) is a great mod.
Comment: Returning, via black book, to where you kill him allows you to spend Dragon souls to respec your perks.  Other than activating Words, this appears to be the only other use for Souls.
Answer: The stealing really is supposed to happen because the devs assume you have completed the main plot at this point, and have stockpiled Dragon Souls, but I you can use these tips to avoid it:

Using Ahzidal's boots of Waterwalking, kill a dragon on the water and SUCC the soul. Miraak cannot appear on water.
Save before killing a dovah. Keep reloading and killing until Miraak does not steal the soul.
If you haven't already, go to the ruins of Saering's Watch, on the northern end of the island. Again, save and reload killing the dragon and Draugr. Obtain the first word to Bend Will, "Earth"/"Gol", and unlocking it will make Miraak less annoying. Unlocking the second word, "Mind"/"Hah", will make him even less annoying, and unlocking the third word "Dragon"/"Dov", at the beginning of "At The Summit of Apocrypha", will stop his stealing completely.

He will harvest souls on the mainland, too, so I would try to use the same tactics as listed above.
Answer: Yes, it is supposed to happen. Miraak has taken all of my dragon souls but one, and it's ticking me off. All I know about how to get rid of this is to complete the questline about him.
Answer: What worked for me was using the electrocuting destruction magic, because I leveled it up enough to turn things into ash when they die. And then boom-batta-bang, I had the dragon soul and Miraak did not.
Hope this helps!

Miraak is stealing all my dragon souls


How to store NPC movement data?

Question: In my 2D tile-based game, I have NPCs that move around on a fixed path. I am putting the information about the NPCs in a .plist file that is loaded on startup. The thing is, I'm not sure how to format the data specifying the path that the NPC moves on. What I was thinking was to have an origin property, a horizontalMovement property, and a verticalMovement property, so when the starts at its origin, then walks right the number of tiles specified by horizontalMovement, then walks the number of tiles down specified in verticalMovement, etc. However, this doesn't seem like the best approach. Is there a better way to store the movement data?
Comment: If it doesn't seem like the best approach, what does? There's nothing wrong with that unless you've identified problems. Do what works and don't worry about making things overly complex until you have to. :)
Comment: @RichardMarskell-Drackir - But my point is that what I am doing may be overly complex and there may be a simpler solution.
Comment: Seems pretty straightforward to me. I suppose a "simpler" option would be to just store all of the tiles on the path individually and move from one to the next. But, that doesn't seem necessary when you can just do what you said in your question.
Comment: Sounds less like storing and more like implementing.
Answer: It all depends on how flexible you want to be. I dont think the approach you suggested is bad, in fact its one of two main possibilities i would consider in your case:

store a list of checkpoints that the NPC walks through (once it reaches the last checkpoint it goes back to the first and repeats). Once arriving at a checkpoint, the NPC will find the best path to the next checkpoint (using A* algorithm for example). This has some advantages, like for example the map can change (obstacles can move around etc.) but also can break down if there is no path between a pair of checkpoints. It is also a bit more complex to code.

OR, as you said:

store a list of fixed actions: 1) walk 3 tiles south, 2) walk 4 tiles east... etc. Something very similar to what you suggested. Simple and easy to code, but not very flexible. Thats not necessarilly a problem though.

Its up to you to decide what works for you the best. There is nothing bad in trying something you made up yourself, in fact its better than just always looking up a "perfect" solution on the internet.
Good luck!

How to store NPC movement data?


Forecasting sales from balance sheet data

Question: I have got a database with balance sheet and income statement data of 150.000 firms for the period 1995-2014. I need to get a good forecast of each firm's sales. As exogenous variables I can use the industrial production index of the relative industrial sector and the lagged other balance sheet variables. I would be grateful if you could suggest me the best methodology to use. I was thinking to try ARIMA, ARIMAX and exponential smoothing.
Comment: ARIMA, ARIMAX and exponential smoothing sound reasonable. There are automated procedures for selecting an "optimal" ARIMA model (function `auto.arima`) and exponential smoothing method (function `ets`) in "forecast" package in R. These methods were tried out on large datasets and delivered satisfactory performance, see Rob J. Hyndman's blog post ["R vs Autobox vs ForecastPro vs …"](http://robjhyndman.com/hyndsight/show-me-the-evidence/) for a reference.
Comment: A few questions.  First do you mean 150 firms, or 150 thousand firms?  Your post says 150.000 with a period.  Another question is how far ahead are you forecasting?  If you are just going ahead one or two periods, then some kind of arima model or such would be fine.  If you are forecasting a year or two, then I think you should try to capture the correlations between the companies and sectors using something like PCA. Also the question of what you mean by a good forecast.  If you want good you and need years of forecasts, and you've got 150 firms, then you need a staff of analysts.
Comment: Hi, thank you very much for your kind replies. My database is made of 150 thousand firms and I need forecast for two years.
Comment: Hi, thank you very much for your kind replies. My database is made of 150 thousand firms and I need forecast for two years. The total economy is disaggregated into around 100 so-called "micro-sectors" and I have exogenous forecast for the industrial production of each of them. Each firm belongs to only one micro-sector. @horseless would you be so kind to tell me something more abot applying PCA, I am completely new to this kind of analysis. Thank you very much again. Best Regards
Comment: You might also consider looking in to panel methods. You should be able to exploit the fact that N >> T.
Answer: [Sorry, I'm new here and accidently posted this as an answer and its just meant as a comment responding to a question, but it does not let me delete answers to put it under comments. If I last long enough, I'm sure I'll figure out how to edit things.]
PCA is an eigenvalue/eigenvector decomposition of the data frequently applied in risk management to look for systemic factors effecting a large portfolio.  My favorite introduction to the concept is an excellent efficient and very focused chapter in Carol Alexander's Market Risk Analysis vol 2 (and the volume number is critical since there are 4 books). This can give you factors that explain the majority of the variability in your series and it reduces your problem from 150,000 series down to a few factors.  There are lots of articles on this if you search.  Alternatively, and less techy, you could create your own capital weighted indexes and use those to predict the 150,000 individual series, using betas estimated off that index for each firm. Your IP index could influence these indexes.


How to change welcome text in Magento 1.7?

Question: I'm trying to change the color of the welcome text, and I have found the place( Configure-design) to change the actual text, but no way to change the color. Any ideas about where to look?
Answer: Changing color of welcome text from backend is not possible, you need to define in theme css file.
If you are using custom theme, some custom theme provide option to write custom css in backend also. you can use that option also to write css in custom theme.
Comment: So I have found the css file that will change attributes for this bar everywhere else, but the changes still won't affect the welcome text.For example the text attributes on my about me page will change, while on my home page is still the default. Any ideas?


Why is tin-112 stable, but indium-112 radioactive?

Question: According to Wikipedia, tin-112 is a stable nuclide, but indium-112 is radioactive (half-life only 14 minutes). What is the explanation for this?
Answer: For isobars (i.e. nuclides with a constant mass number $A$), the binding energy $E$ as a function of the atomic number $Z$ describes a parabola, the so-called valley of β-stability (see also Weizsäcker's formula or semi-empirical mass formula).
$$E = a \cdot Z^2 + b \cdot Z + c \pm d/A^{3/4}$$
The most stable nuclides lie at the bottom of the valley (but not necessarily exactly at the minimum of the parabola). Isobars with lower atomic numbers $Z$ are unstable to $\beta^-$ decay. Isobars with higher atomic numbers $Z$ are unstable to $\beta^+$ decay or electron capture. Therefore, at least one of two adjacent isobars must be radioactive (see Mattauch isobar rule).
Thus, since Sn-112 is stable, we expect In-112 to be radioactive.
The last term $(\pm d/A^{3/4})$ gives rise to three different parabola depending on whether the nuclides are even-$A$ (with even $Z$ and even $N$), even-$A$ (with odd $Z$ and odd $N$), or odd-$A$ (with even $Z$ and odd $N$, or with odd $Z$ and even $N$).
In the last case, in which the mass number $A$ is odd, the result is a single parabola with one stable nuclide at the bottom.
However, for even mass numbers $A$, we find two parabolas; the odd-odd-curve always lies above the even-even curve. Hence, it is possible that two or even three stable isobars exist.
The case with two parabolas also applies to your example. The stable nuclide Sn-112 has 50 protons and 62 neutrons (even-even). The radioactive nuclide In-112 has 49 protons and 63 neutrons (odd-odd). The next neighbour, Cd-112 has 48 protons and 64 neutrons (even-even) and is stable.
Comment: I think it's worth noting that tin (Z=50) has a ["magic" number](https://en.wikipedia.org/wiki/Magic_number_(physics)) of protons, regardless of the isotope. Indium (Z=49) being "off by one" makes it less stable relative to its neighbour.


play two sounds simultaneously iphone sdk

Question: I am trying to make a small music app on the iphone. I want to have an octave a piano which will respond to touches and play the key or keys that the user touches. How would i be able to get two or more sounds to play at the same time so it sounds like a chord? I tried using AVFoundation but the two sounds just play one after the other.
Answer: You would have to use AudioQueueServices. The docs are here:
Apple.com - AudioQueueServices Reference
Essentially you would have to write some code to open up multiple outputs, and then prime the queue and have them block before AudioQueueStart(AudioQueueRef aq) until everything was primed and ready and then let them go.
AVAudioPlayer isn't really good enough for this sort of thing, unfortunately.
Answer: If you create multiple AVAudioPlayers you can play them at the same time, and they will mix per the restrictions outlined in the documentation (not all file types can be played simultaneously).
If you allocate them first, then play them in order, they will play at virtually the same time.
If you need absolutely perfect timing, use the AudioQueue as described above or use OpenAL.


tripwire report - inode number

Question: Hi I am investigating tripwire and have stumbled upon something which i am unsure about. in a tripwire report generated after i modified hosts.deny to include an extra # I noticed the inode number changed from 6969 to 6915. I would like to know why this happened. I know inodes are records which store data about where data is stored on the file system, but would like to know why this number changed for a simple # being inserted.
Answer: Standard behavior for text editors is to rename the original file to a temporary name before writing out changes, so if there is a problem (such as out of disk space) you don't lose the file entirely.  Thus the file gets a new inode number.  If the editor is configured to leave the original as a backup file, you'll find the backup file has the original inode number; if not, then the backup will have been deleted after the new file was successfully written.
Comment: @Mintuz: Depending on the circumstances, when you save editor might either create a new file and rename it into place, or write to the original file. There are up- and downsides to both methods. I know this has been discussed before, either on this site or on [Stack Overflow](http://stackoverflow.com/) or [Super User](http://superuser.com/), though I can't find the thread right now.
Comment: is there somewhere where I can reference this information. it makes sense but i am not allowed to reference a place such as stackexchange thank you very much :D
Comment: Not offhand; it's a programming best practice, I would expect it to be covered in any book which discusses developing applications.

tripwire report - inode number


In which Lupin III film did Fujiko Mine get possesssed/brainwashed by a cult?

Question: I watched a certain Lupin III film as a kid at my neighbors' and never got to learn the title. I really enjoyed that movie and wish to see it again.
Comment: Could you give us the approximate year in which you watched it? That would be very helpful in narrowing down our guesses.
Comment: When were you a kid. We were all kinds once at different times. Are you sure it was a movie and not a series like "The Woman Called Fujiko Mine"?
Answer: This is probably Lupin III: Farewell to Nostradamus

After the mishap, Jigen and Goemon arrive in a helicopter and try to help Lupin escape, but Lupin is shot in the arm by Chris and falls into the ocean. The next day, Lupin wakes up on an island and is being nursed back to health by a boy named Sergio and his grandmother. While on the island, he discovers that Fujiko is there as well, but Sergio's grandmother says that she's really a handmaiden of the Nostradamus Sect named Tanya. Lupin follows Fujiko to a cathedral where the sect is located. When he sneaks in, he finds out that Julia is being kept prisoner there and Fujiko has lost her memory. Before he can find out anything else, Lupin is discovered by the sect and they throw them in a cell.


I am trying to get a list of all users who haven't logged in 30 days but code isn't working

Question: echo here is a list of the users who have not logged in for a month
olduser="who | grep | -u, -q +30"
if $olduser
then
 echo these users havent been logged in for thirty 30 days
else
 echo user is active
;;

Comment: Firstly, you are using command which is designed to list _logged_ users. I find it not useful in this scenario. More, is your command line lost during writing a question? It is not a valid not mentioning of providing some useful data. Please, edit your question, use code formatting and try to be more specific about what you tried already.
Comment: Use accounting, not `who`.
Answer: One recommendation... edit the question with the following, to allow a more thorough/relevant answer:

Your OS (i.e. Solaris is very different than RHEL in acct mgmt)
Type of script/code (Bash, csh, ksh, etc) as it looks like this is just part of a script and not the whole thing, since we can't see the shebang (#!/bin/bash, etc..).

First thing I do notice is that your variable $olduser is not set to command substitution but to the literal string "who | grep | -u, -q +30"
Command substitution is generally done with $(command_to_be_run) or with backticks like `command_to_be_run`. And I don't think you are looking for who but rather should be looking, as mentioned above, at accounting commands like logins or last or even log files.
Something like a for-loop to gen a list of users, and from there using that last and your variable substitution to generate a last logon date for each invidivual so you can perform an evaluation statement like a if-then-fi if they are older than 35 days.
e.g. On Solaris 10, with Bash
LAST_LOGON_DATE=$(last $user | awk 'NR==1{print $5,$6}' | custom_date_convert_cmd )

if [[ ${LAST_LOGON_DATE} -ge 35 ]]; then
    echo "${user} is expired. Last logon: ${LAST_LOGON_DATE} days ago"
    important_commands_here
fi

Obviously sed/perl would probably be a better solution as far as speed of processing over AWK, but if you are in a fix and just need something working, that's probably a good place to start.
Look up your system STIG from DISA, as usually they include commands to do exactly this... check users last logins, users w/o passwds, etc...
https://www.stigviewer.com/stigs


Trello Auto Send Email to Cards

Question: Can Trello be set up to automatically send emails from certain email addresses directly to client's card?
Answer: You could accomplish this with a combination of Trello's card-specific emails and email filtering/forwarding or IFTTT.
First, grab the email address for the card you want to add comments to. You'll find this under "Share and More" on the back of the card.
Depending on your email provider, there are various ways to forward emails based on a rule or filter. Basically, you want to look for all emails from those certain addresses and forward them to the card's email address.
If you're using Gmail, here's an example using IFTTT:

Create a new recipe that starts with the Gmail "New email in inbox from" trigger
Enter the email address of the sender whose emails you want to send directly to Trello
Now choose the Gmail "Send an email" action
Enter the card's email address as the To address
Fill in the subject, body, and attachment URL with the info from the trigger

If you're using Outlook/Exchange, here's an example using inbox rules:

Create a new inbox rule
For "When the message arrives, and" choose "It was received from..." and enter the email address(es) whose emails you want to send directly to Trello
For "Do the following" choose "Forward the message to..." and enter the card's email address

It's the same concept, just two different ways of implementing it.

Trello Auto Send Email to Cards


(Photoshop) What is the name of this effect? (Shine in corner)

Question: Does anybody know what the name of this effect is? It is on both the bottom left corner, and the top right of this image, and it seems to be a reflection of some type of light source.
Comment: Some call it a glass (bead) effect. It usually goes hand in hand with other effects to make the whole, such as the gradient fill that's in evidence on your image. It's basically a highlight, though.
Answer: The bright spots that give the illusion of a surface being glossy or highly reflective are called "specular highlights".
Answer: It's an illusion of rounded thickness, created by simulating lights and shadows. The shiny reflection is called a highlight. In Photoshop you can create it with layer style Bevel&Emboss:

The drawn shape is a rounded rectangle. There's also a shadow at the other side, because the light comes from south-west.
You wanted the same to the opposite corner, too. Changing shadow color to white unfortunately doesn't the trick and my antique Photoshop hasn't multiple lights, but I can turn the shadow to another highlight with curves. It's possible because the color is grey:

Grey can be colorized with another adjustment layer above all:

As well there above all could be an image layer with blending mode =Color.

An experienced designer doesn't need effects, in simple cases he draws the highlights and shadows and inserts them with layer blending modes without destroying the drawn shapes.
Real 3D software with proper rendering has best options to make realistic lights and shadows with very little drawing effort.


Travel immediately after swearing in as a US citizen?

Question: My brother-in-law is a UK citizen who just passed his US citizenship interview. They scheduled his oath ceremony for late August, and he has flights to Mexico booked for late October, so he wouldn't get his US passport in time (expedited passports take 3 months currently). Any ideas for how he could keep his travel plans? He is not willing to travel to Mexico by land, which rules out getting Real ID. He is considering getting a same day passport in Chicago, but is stressed out at having to leave that for within 72 hours of the travel and not having a guarantee that it will work.
Comment: In reality expedited passports are taking about 4 weeks so he should receive it. Alternatively he could do the same day passport. Finally absolute worst case scenario he can fly on his British passport while carrying his naturalization certificate. British nationals can enter the US if they have not been in the UK, Ireland, Schengen zone, Iran, Brazil, China, South Africa or India within the previous 14 days. https://www.gov.uk/foreign-travel-advice/usa/entry-requirements. At immigration he can ask to be admitted as a US citizen. No need to stress, at least one of these alternatives will work.
Comment: Of course, you could also apply for a US passport in Mexico if there is enough time during your trip to do so.
Comment: @AugustineofHippo that looks like an answer.
Comment: REAL ID has nothing to do with it (REAL ID enforcement does not begin until May 3, 2023 in any case). For the purposes of TSA security checkpoints, he can use any US state driver's license or non-driver ID (regardless of whether it's REAL ID or non-REAL-ID), or his British passport.
Comment: @ginger_cat: There is a law making it "unlawful" for a US citizen to enter or exit the US without "bearing" a US passport, but there are no consequences for violating that law. A US citizen who manages to make it to a US port of entry, and can satisfactorily prove their US citizenship (with a US certificate of naturalization plus photo ID can), cannot be denied entry no matter what (though they can detain the person while verifying it). So there should be no problem entering by land from Mexico, or by air if you can get the airline to board you, and an ESTA should satisfy the airline.
Comment: Getting through a TSA security checkpoint is not the same as passing the airline's "will this passenger be admitted at the destination" check. Here, the BIL is a UK citizen who can, presumably, enter Mexico freely. Other travelers may have difficulty in doing so.
Comment: @AugustineofHippo that's great! How do you know expedited passports are moving so quickly? Also, do those rules apply to dual citizens? We read on travel.gov that dual citizens need their US passport when entering the US.
Comment: I've also heard anecdotal reports that expedited passport applications are being processed a lot more quickly than the months-long figure quoted on the website, but of course that's no guarantee and individual experiences may vary.
Comment: What state does your brother in law reside in?
Answer: The most surefire approach is as follows:

Wait until its 2 weeks before your trip, making sure you already have your citizenship document at hand by then
Call the Department of State at 8:00am ET on the dot (important - you want to be one of the first callers that day) and make an appointment for an emergency passport. You can only do this 2 weeks before your travel date, otherwise they won't give you a slot.
Show up for the appointment, hand them your documents and you'll have a passport in your hands within 24 hours

My US citizen friend did this last week and it was very easy to get an appointment at the Seattle passport agency. But do note that this will require you to travel in person to one of the passport agencies which could mean taking an extra round-trip flight depending on where you live.
Other options include:

Fly to Mexico with your UK passport and try to fly back on an ESTA obtained on your British passport, along with your naturalization certificate. As long as your ESTA is issued, you're good to go. You'll be scolded by the CBP agent upon arrival for doing this but legally speaking there's nothing they can do to you once you're arrived to a point of entry.
Fly to Mexico, then cross overland to go back home. Same deal as with option #1 - the CBP agent might be annoyed you don't have your US passport but they don't really have a choice other than to let you in. Carry your UK passport and your naturalization certificate.
File an expedited passport application and pray for the best. There are some reports of the State Department issuing passports faster these days so there's a good chance you'll get it by your flight in the end of October.
Answer: There seems to be conflicting information between the CBP and usa.gov, the latter suggesting that US citizens entering from the western hemisphere (Canada, Mexico, and the Caribbean) can use an enhanced driver's license (Real ID), while the CBP states that only for land or sea travel, but not for air travel.
In any case, as in the comments above, a US citizen entering the us with foreign passport and presenting his naturalization certificate cannot be denied entry.
Comment: An enhanced driver's license is certainly not the same thing as Real ID.  EDLs have machine readable characters on the back (not a barcode) like at the bottom of a passport ID page, and they have an RFID chip. Only five states issue them.  In any event, the rules allowing entry with an enhanced driver's license do not apply to air travel.  The information on usa.gov is incorrect.
Comment: I submitted feedback to the usa.gov site to tell them that they should correct the page.  We'll see how long it takes.