Which language uses .pde extension?

Question: While searching for an implementation of the Barnsley's Fern fractal I came across a implementation that has .pde extension. Which programming language uses this extension?
Implementation Page
Answer: This code is from Processing.org an open source Java based IDE. You can find it Processing.org. The Arduino IDE also uses this extension, although they run on a hardware board.
EDIT - And yes it is C syntax, used mostly for art or live media presentations.
Comment: Well, it's C syntax, not based.
Comment: Current versions of Arduino switched to .ino extensions.  see https://www.arduino.cc/en/Reference/Comparison. They say: "The Arduino language (based on Wiring) is implemented in C/C++, and therefore has some differences from the Processing language, which is based on Java." The switch is since version 1.0 as noted in https://www.arduino.cc/en/Guide/Environment: "NB: Versions of the Arduino Software (IDE) prior to 1.0 saved sketches with the extension .pde. It is possible to open these files with version 1.0, you will be prompted to save the sketch with the .ino extension on save."
Answer: The .pde file extension is the one used by the Processing, Wiring, and the Arduino IDE.
Processing is not C-based but rather Java-based and with a syntax derived from Java. It is a Java framework that can be used as a Java library. It includes a default IDE that uses .pde extension. Just wanted to rectify @kersny's answer.
Wiring is a microcontroller that uses the same IDE. Arduino uses a modified version, but also with .pde. The OpenProcessing page where you found it is a website to exhibit some Processing work.
If you know Java, it should be fairly easy to convert the Processing code to Java AWT.
Answer: Bad news I'm afraid (or maybe great news?) :  it isn't C code, it's an example of "Processing" - an open source language aimed at programming images. Take a look here
Looks very cool.
Answer: pde is extesion for:

Processing: Java derived language
Wiring: C/C++ derived language (Wiring is derived from Processing)
Early versions of Arduino: C/C++ derived  (Arduino IDE is derived from Wiring)

For Arduino for example the IDE preprocessor is adding some #defines and some C/C++ files before giving all to gcc.
Answer: Software application written with Arduino, an IDE used for prototyping electronics; contains source code written in the Arduino programming language; enables developers to control the electronics on an Arduino circuit board.
To avoid file association conflicts with the Processing software, Arduino changed the Sketch file extension to .INO with the version 1.0 release. Therefore, while Arduino can still open ".pde" files, the ".ino" file extension should be used instead.
Each PDE file is stored in its own folder when saved from the Processing IDE. It is saved with any other program assets, such as images. The project folder and PDE filename prefix have the same name. When the PDE file is run, it is opened in a Java display window, which renders and runs the resulting program.
Processing is commonly used in educational settings for teaching basic programming skills in a visual environment.

Which language uses .pde extension?


How to disable posts and use pages only

Question: I am new to Wordpress theming and I would like to set up a Website that only has static content. Therefore would it make sense to disable posts and only use static pages? If so, is there an easy way to do that?
Answer: You can simply hide the posts menu by adding the following to your functions.php file:
function remove_posts_menu() {
    remove_menu_page('edit.php');
}
add_action('admin_menu', 'remove_posts_menu');

WordPress does not permit the disabling of the actual post type with the unregister_post_type() function. The condition is here: https://github.com/WordPress/wordpress-develop/blob/6.0/src/wp-includes/post.php#L1754
// Do not allow unregistering internal post types.
    if ( $post_type_object->_builtin ) {
        return new WP_Error( 'invalid_post_type', __( 'Unregistering a built-in post type is not allowed' ) );
    }

Comment: @ben.kaminski This no longer appears to be the case, for anyone else arriving here several years later :)
Comment: This method will break the Media Gallery uploader as it too deals with "edit.php".
Comment: This solution is purely aesthetic and does not affect the database, so I don't think it is a good solution
Comment: @MarcoPanichi There is ZERO way to do this in the database. Please instead, show a way and add your answer instead of hitting other people's reputation points without cause. I would appreciate it if you would retract the downvote for since your reasoning is not in line with how this works in WordPress. This answer has helped people for 11 years now.
Comment: @BrianFegter your answer doesn't solve the problem because you are not disabling posts. People has the right of put a downvote on an answer if motivated. It is a downvote, not a death sentence. I don't like specially the fact that you are not explaining the situation; your answer could be confusing: "You can simply hide" != disabling post. I think that I could remove my down vote if you explain better that aspect. Could it be a good compromise?
Comment: @MarcoPanichi There is ZERO way to disable posts from the database. The only way in WordPress is to hide the menu. Please take a look at this link: https://developer.wordpress.org/reference/functions/unregister_post_type/ You'll notice on line 1753 you'll see WordPress will not allow you to disable posts.
Comment: @MarcoPanichi I updated the answer with this clarification. This is the only answer to this question.
Answer: I would recommend you to leave the post only for the admin user... literally the "admin", and create another user to manage the page, so I case you need it in the future for scalability you can go back to it with your admin account.
Just add the following code to your functions.php
 function remove_menus () {
 global $menu;
 $user = wp_get_current_user();
 if ($user->ID!=1) { // Is not administrator,

    $restricted = array(__(__('Posts'));
    end ($menu);
    while (prev($menu)){
        $value = explode(' ',$menu[key($menu)][0]);
        if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
     }
   }
 }
 add_action('admin_menu', 'remove_menus');

Answer: Have you thought about just renaming "Posts" to something like "News" ? So that the user (yourself or a client) could still post news, press releases, articles, etc. to prevent stagnant content on the site.
It's quite simple to do. Just pop this in your functions file.
function change_post_menu_label() {
    global $menu;
    global $submenu;

    $menu[5][0] = 'News';
    $submenu['edit.php'][5][0] = 'News';
    $submenu['edit.php'][10][0] = 'Add Article';
    $submenu['edit.php'][15][0] = 'News Categories'; // Change name for categories
    $submenu['edit.php'][16][0] = 'News Article Tags'; // Change name for tags
}

function change_post_object_label() {
    global $wp_post_types;

    $labels = &$wp_post_types['post']->labels;
    $labels->name = 'News';
    $labels->singular_name = 'News';
    $labels->add_new = 'Add Article';
    $labels->add_new_item = 'Add Article';
    $labels->edit_item = 'Edit Article';
    $labels->new_item = 'News Article';
    $labels->view_item = 'View Article';
    $labels->search_items = 'Search News';
    $labels->not_found = 'No Articles found';
    $labels->not_found_in_trash = 'No Articles found in Trash';
}
add_action( 'init', 'change_post_object_label' );
add_action( 'admin_menu', 'change_post_menu_label' );

And now you can have news that everyone can benefit from. Hope this helps!
Comment: I don't think that 'add a blog to a website because the functionality exists' is a very good answer to this question.
Comment: oops .. thanks ungestaltbar .. actions kind of make the wheels go 'round
Comment: I've done this, but now as an administrator I can't see the draft posts either. How can only I see? @ungestaltbar
Answer: posts / page are essentially the same - they are only different by definition of usage (and other minute things) .
more or less like "blog" and "website" . A page is actually a "kind" of post (as far as wp is concerned)
There are a ton of ways you can "disable" one or another .
you can disable them by taxonomies, by hiding the menus, by not using one or another in the theme files...
but in order to know what is the best way , can you explain a bit more WHY you need to "disable" them ?
I suggest that before you start to "disable" things, install WP and start to play with it a bit - you will then understand much better.
Answer:
Would it make sense to disable posts and only use static pages?

No. Unless you only want a small amount of pages.
I would use Posts as they are more flexible. You can disable specific features for posts which you don't want to use like comments and RSS feed etc but you'll find posts are better to use if you want to add content on a regular basis. Otherwise, yes, you can simply use static pages.
You'll find adding useful, relevant content on a regular basis will increase traffic to your site and increase your websites visibility on the internet.

How to disable posts and use pages only


What's the difference between gravitational force and gravitational constant?

Question: I was told that the gravitational constant is the pulling force between two objects in a distance with mass. Though, doesn't that have the same definition as a gravitational force? I know they're different because of the gravitational force formula, I just don't know what.
Answer: The gravitational constant can be thought of as a measure of how strong the gravitational force is. If you plug in the value of mass and the distance between the two objects, you can find out the force of attraction between them, but you need the gravitational constant for this, as this determines the strength of that attraction.
Notice, $F=Gm_1m_2/r^2 $
If you plug in $m_1,m_2,r=1$ , then you get $F=G$. So, the gravitational constant is equal to the force of attraction between two bodies of unit mass, separated by unit distance. Using this definition, we can find the force between two objects with any random mass and a random separation.
Answer: The gravitational constant is a fixed constant determined experimentally. It can be used to compare the general magnitude of gravitational force in comparison to other types of conservative forces. For example, the electrostatic force between two point charges is given by a very similar equation, but a different constant is used (called the coulomb constant) which is much larger than $G$, hence leading to the conclusion that electric forces are much stronger than gravitational forces
It is by no means equal to the gravitational force. In some sources you may find that the gravitational constant $G$ is defined as the gravitational force of attraction between two unit masses separated by a unit radial distance. However, to disprove this, simply notice that $G$ has units of $\frac {N.m^2}{kg^2}$, while any kind of force has units of $N$, and hence an equality between the two is incorrect. It can be thought of as the numeric value of the force of gravity between two unit masses separated by a unit distance, as given by: $$F = \frac {G(1kg)(1kg)}{1m^2} => F = G.\frac {kg^2}{m^2}$$
Answer: In short, gravitational constant G is the magnitude of gravitational force between 2 objects of unit mass and having a unit distance separation between them.
Only for these objects would gravitational force have a magnitude equal to G.
For all other cases, you have to calculate using the masses over distance squared formula.
Answer: See, in Newton's theory of gravity, we say that the force is proportional to the product of the masses of the two objects and inversely proportional to the square of the distance between them. We write this as:
$F\propto m_1 m_2/ r^2 $
To make this an equality , we introduce the constant, say B.
So we have $F = B m_1 m_2/ r^2 $
Now what is the value of this constant?
Just find it out. Take a mass of 5 kg and another mass of 5000 kg, keep them say 100 meters apart and somehow find the amount of force they are exerting on each other. Let us say it is 10 Newton. Then, plugging in all the values we have:
$10 $= $\frac{B * 5*5000}{100^2}$
From the above equation, find the value of B. Then in the future equations, just use its numerical value which will not change ( if it changes, it is no more a constant and the law must be wrong).
Let's say you get the value of B as $0.5 $ then the law becomes:
$F = 0.5 m_1 m_2/ r^2 $
Of course all the above explanation is just to make you understand and the values are all random. The letter B is actually G in the original law and has a certain value = $6.67*10^-{11}$ in S.I. units


How can I configure WhatsApp so that an email is sent to me when someone sends me a message on WhatsApp?

Question: How can I configure WhatsApp so that an email is sent to me when someone sends me a message on WhatsApp?
Comment: You can also tell those people using Whatsapp that you prefer to receive messages via E-Mail.
Answer: Whatsapp natively does not support this, besides, it does not expose an API for other apps to use, so it's not possible. But using the notifications generated on receipt of messages, one can workaround these limitations.
automation is the way to go because, you need an action to be taken  in case WhatsApp is received from one / any senders.
Many automation apps are available. I prefer using MacroDroid , since it is free (upto 5 macros) and easy to learn. To understand how MacroDroid works, see answer here (Not affiliated to any app).
MacroDroid Setup

Give MacroDroid all the permissions it needs.

From Settings → Email account → Gmail account. Enter your account details and authenticate (MacroDroid needs to have access to be able to send you mails). Edit: As pointed out by a user you may need to use APP passwords instead of regular email password.

Create a macro as explained, name it whatever you like and save it.

Trigger: Notification → Notification Received → Select Application → Whatsapp → Text Content → Any (this will mail you for all messages received)

Make sure to uncheck prevent
multiple triggers (Edit:  As pointed out by a user if you get duplicate emails a fix could be, by checking multiple triggers YMMV)
A variant below for one contact
Notification → Notification Received → Select Application → Whatsapp → Text Content → Matches (or contains) → contact name (you can use wild cards or Regular expressions(Regex)
matching too)

Actions: Send Email → account → Email address (where you want the mail to be sent to) → Subject, copy paste

Whatsapp message from [not_title] at  [hour12].[minute][am_pm]
Message Text, copy paste [notification]
You will get mails with sender name, time stamp and textsee note as in screenshot below (Aa is a contact and I configured for a single sender)

Note:

Email  shows the text in notification, which may not be complete text, because Notifications are restricted to 500 characters . Long texts are truncated (in my tests text till see more was mailed).

Notifications need to be enabled for Whatsapp


How can I prevent the lines from showing through when painting paneling?

Question: We put two coats of mud in cracks of paneling, then we primed it.
Then we put two coats of Ultra Behr paint and the lines are still coming through
Comment: do you mean drywall (aka plasterboard, Sheetrock®, gypsum wrapped in paper?) that's the only sort of "panel" you generally "mud", but it's not normally called "panelling" - and if you only applied two coats of mud, no wonder you can see the lines...
Comment: I own a house that has paneling with drywall mud on it. It's unsalvageable at this point. I'm replacing it with drywall.
Comment: You seemed to be asking two different questions, so I edited out the second one. If you have additional questions, feel free to ask them separately using the Ask Question button.
Comment: Related: http://diy.stackexchange.com/questions/2589/how-do-i-fill-in-the-grooves-in-wood-paneling-in-order-to-paint-over-it
Answer: When you say "paneling", do you mean imitation wood paneling with grooves cut in to simulate boards?. If so, it is hard to fill those grooves. I have used Bondo auto body filler but it requires a good bit of work. Properly applied and sanded, the grooves will be invisible.
Comment: epoxy based fillers will work but might be overkill.  Try a setting-type joint compound or 'hot mud'.  "sheetrock brand" is the brand I use.
Answer: I paint paneling frequently. The seams (lines) are more porous and tend to suck in paint and primer, causing the lines to bleed through. This is what I do for good coverage and professional look on paneling:
1) wash panels thoroughly, I use warm water with a small bit of Dawn dish soap (it cuts grease and oil).
2) use spackle on nail holes and cracks, use latex caulk on seams.
3) roll a coat of BIN 1-2-3 water base primer with a medium (1/2") nap roller, let dry 1-hour, then brush the "lines" with a second coat of the BIN.
4) roll on a coat of high quality/high solids flat interior latex paint. Apply a second coat if necessary.
I have done four jobs to date with this method and the results have been great. I do not know what you mean about "mud", are you using drywall joint compound? If so you do not need it, you should be using spackle. Always use high quality brushes and rollers, it will make all the difference.


How to support multiple android version in your code?

Question: Take accessing contacts in android
android.jar for versions 1.6 has People.CONTENT_URI for invoking contacts related info whereas in later versions we need to have api support for RawContacts.CONTENT_URI.
Same thing is true for accessing calendar for instance as its URI is changed in android 2.2.
Is there a best practice to manage all different changes without adding additional application or build separately for each version of changes?
Answer: For my money, a very good answer is at http://android-developers.blogspot.co.uk/2010/07/how-to-have-your-cupcake-and-eat-it-too.html. However, the example there is a little more complicated than need be, so based on that, here is an example of how to cope with it when building notifications. The underlying reason this works is a consequence of how java engines interpret classes: it only looks at them when needed, so if you wrap version specific code up in a class and only create it when you know you are using that version, it all works ...
There are, as far as I can tell, two generations of approaches to creating notification, and a naming change along the way in the second. So that gives three ways to do it. For each way, create a class with the notification generation in it:
The first approach (used through to Gingerbread):
public class MyNotificationBuilderToGingerBread {
Notification notification = null;

MyNotificationBuilderToGingerBread(Context myContext, int icon, String ticker, String title, String info, Long timeStamp, PendingIntent pendingIntent, int flags) {
    notification = new Notification(R.drawable.ic_sb, ticker, timeStamp);
    notification.setLatestEventInfo(myContext, title, info, pendingIntent);
    notification.flags |= flags;
}

Notification get() {
    return notification;
}
}

The second approach, Honeycomb to IceCreamSandwich:
public class MyNotificationBuilderHoneyCombToIceCreamSandwich {
Notification.Builder mb = null;

MyNotificationBuilderHoneyCombToIceCreamSandwich(Context myContext, int icon, String ticker, String title, String info, Long timeStamp, PendingIntent pendingIntent, boolean onGoing) {
    mb = new Notification.Builder(myContext);
    mb.setSmallIcon(icon);
    mb.setContentIntent(pendingIntent);
    mb.setContentTitle(title);
    mb.setContentText(info);
    mb.setWhen(timeStamp);
    if (ticker != null) mb.setTicker(ticker);
    mb.setOngoing(onGoing);
}

Notification get() {
    return mb.getNotification();
}
}

The second generation, with the name change, Jellybean (onwards, so far ...):
public class MyNotificationBuilderJellyBean {

Notification.Builder mb = null;

MyNotificationBuilderJellyBean(Context myContext, int icon, String ticker, String title, String info, Long timeStamp, PendingIntent pendingIntent, boolean onGoing) {
    mb = new Notification.Builder(myContext);
    mb.setSmallIcon(icon);
    mb.setContentIntent(pendingIntent);
    mb.setContentTitle(title);
    mb.setContentText(info);
    mb.setWhen(timeStamp);
    if (ticker != null) mb.setTicker(ticker);
    mb.setOngoing(onGoing);
}

Notification get() {
    return mb.build();
}
}

Then, you just need to pick which class to instantiate on the fly:
// System information
private final int sdkVersion = Build.VERSION.SDK_INT;
// If you want to go really old:
    // (actually, there is a question about how this issue should be handled
    // systematically. Suggestions welcome.)
// final int sdkVersion = Integer.parseInt(Build.VERSION.SDK);

    // This is for a permanent notification. Change the final argument (flags or boolean) if it isn't meant ot be
    // For meaning of other variable, see notification documentation on the android website.
    if (sdkVersion < Build.VERSION_CODES.HONEYCOMB) {
        MyNotificationBuilderToGingerBread mnb = new MyNotificationBuilderToGingerBread(myContext, R.drawable.notification_icon, ticketText, title, infoText, timeStampMillis, pendingIntentForTapOnFullNotitifcation, Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR);
        notification = mnb.get();
    }
    else if (sdkVersion < Build.VERSION_CODES.JELLY_BEAN) {
        MyNotificationBuilderHoneyCombToIceCreamSandwich mnb = new MyNotificationBuilderHoneyCombToIceCreamSandwich(myContext, R.drawable.notification_icon, ticketText, title, infoText, timeStampMillis, pendingIntentForTapOnFullNotitifcation, true);
        notification = mnb.get();
    }
    else {
        MyNotificationBuilderJellyBean mnb = new MyNotificationBuilderJellyBean(myContext, R.drawable.notification_icon, ticketText, title, infoText, timeStampMillis, pendingIntentForTapOnFullNotitifcation, true);
        notification = mnb.get();
    }

    // Send the notification.
    notificationManager.notify(idForNotificationManager, notification);

Hope this helps!
Answer: There are many resources for you to utilize to help support multiple versions of android.

Read this blog post here and
then read this one here, they
will help you address API level
version support issues.
Read this blog post on multiple
screen support, especially how the
asset hierarchy in parsed in res
folder. This will help you
understand and design how to do
asset folder structure to support
different screen size/densities and
android versions.
Lastly write your own custom ant build
scripts so that you can compile with
all versions of android.
Answer: Quite Honestly, it's a pain.
I usually, just isolate parts of code that are different and access them using abstract classes. So technically creating different version for different OS.
But there are other ways. The best one i've seen involves using reflection.
Comment: yes, thts closer to the specific problem of accessing contacts. Maybe similar code will need to be built for additional data that keep changes the uri over versions like calendar
Answer:
If you don't really need the new functionnalities, and really have to support old Android versions, drop it. Build your app for the oldest version, and don't bother with this kind of thing.
In the other case, you can detect the version using Build, and use reflection to load the classes you need. An example of that can be found in the source code of the K9Mail app
Answer: There's a nice article on android.com about it:
http://developer.android.com/resources/articles/backward-compatibility.html
Personally I would suggest the wrapper class or wrapper library solution. But in small cases the reflection should be fine (and in case performance is not a problem for you).
If you need more info, ask in comments.
Comment: Unfortunately, the link is down :) Is it this one: http://developer.android.com/training/search/backward-compat.html ?
Answer: This is a great article for when you have to do reflection in Android (to support multiple API levels).
And when you have to have different resources for different API Levels, this is the reference to use (see the section on "Platform Version (API level)").
Answer: If on Eclipse, from ADT version 17 you can specify code to run with some version simply as described in Lint API Check.
The code word is @TargetAPI(XX)
Hope it helps
Answer: Best practice (though not for Android, but for J2ME) to my knowledge is to use preprocessing C/C++ styled statements, like:
//#if S40
    ...
//#else
    ...
//#endif

Some IDE's support these kind of preprocessing, e.g. Netbeans. To my knowledge Eclipse has some plugins to enable preprocessing also. I don't really know are they applicable to Android development. Try to google yourself.
Comment: Netbeans supports inclusions of multiple jars depending on configuration key - which is in fact used as preprocessor #define. There's bad news: Netbeans doesn't support Android :) From the other hand there's Android plugin for Netbeans called nbandroid - it was in deep beta (1/2 yr ago - probably smth has changed)


Predicate logic notation: where to put the parentheses, etc.

Question: My math professor tends to write $\exists x\in\mathbf{X} \ni P(x)$. Is this a correct use of the such that symbol $\ni$? If not, what is the use of that symbol? Isn't it better to write $\exists x\in\mathbf{X} (P(x))$ assuming $P(x)$ is a complex proposition? Also, while we're at it, is $\forall x\in\mathbf{X} : P(x)$ an acceptable notation or should it really be $\forall x\in\mathbf{X} (P(x))$ for precision?
Comment: I'm guessing he means it as "such that."  Often we just use a colon: $\exists x\in\mathbf{X}: P(x)$.  You could put parentheses around it, as you do.  Incidentally, even that is shorthand, since what it really means is: $\exists x(x\in\mathbf{X} \text{ and } P(x))$.
Comment: This is semi-formal notation, at some distance from the standard ways of expressing the idea in a formal language.
Comment: I would describe $\exists x\in\mathbf{X}\ni P(x)$, $\exists x\in\mathbf{X}: P(x)$, and $\exists x\in\mathbf{X}$ s.t. $P(x)$ as shorthand for an English sentence, *There is an x in ...* . $\exists x\in\mathbf{X}\big(P(x)\big)$ and $(\exists x\in\mathbf{X}) P(x)$, on the other hand, are expressions in slightly different formal languages, abbreviating the even more formal $\exists x\big(x\in\mathbf{X}\land P(x)\big)$ or $(\exists x)\big(x\in\mathbf{X}\land P(x)\big)$.
Answer: The backwards epsilon means "such that", but in this context it's slightly bizarre since the usual set membership symbol appears symmetrically before the $\mathbf{X}$ and of course means something quite different. After all, if $P$ were a function symbol rather than a relation symbol then we might parse the statement quite differently, as $\exists{x} (x \in \mathbf{X} \wedge P(x) \in \mathbf{X})$.
We can't see inside your professor's mind, but with usual usage in mind, your expansion is correct: it abbreviates $\exists{x \in \mathbf{X}} (P(x))$, which is in turn an abbreviation for $\exists{x} (x \in \mathbf{X} \wedge P(x))$.
Universal quantifiers expand similarly: $\forall{y \in Y} \; \varphi(y)$ is short for $\forall{y} (y \in Y \rightarrow \varphi(y))$. Both colons and full stops (periods) are acceptable separators: $\exists{y \in Y} : \varphi(y)$ and $\forall{z \in Z} \; . \; \psi(z)$ are reasonably common.
The key to using abbreviations effectively is to employ them to increase clarity. They increase brevity, but if using one might be ambiguous, go for the expanded version instead. I recommend reading things like Knuth on mathematical writing for further explanations of good practice in mathematical writing.


Codeigniter page caching: Is 24Gb of cache files too much?

Question: I am running a Codeigniter application that uses page cache with ~350k files and take up ~26Gb of disk space in ONE folder. Is that too much?
Comment: Yes, in general it is too much. what you're doing exactly?
Answer: If memory serves, CI puts each page cache in a single folder. Assuming you are a FAT32 Linux machine, and the files aren't grouped into sub-folders I imagine you may be taking a performance hit.
Referencing this; How many files can I put in a directory?
A reasonable solution could be to override the default caching library to group things into folders (perhaps based on the first N of the hash name) to improve performance.


How to pause using DownloadManager?

Question: I want to achieve that when downloading, it can be paused, stopped by user. How can I achieve this with DownloadManager?
Comment: I also wish to know this. I tried to stop downloads with remove(ids) method, and it seems to work if we check it in Downloads table, but in notification area it still is shown as downloading.
Comment: Downloads table I am talking about is accessible by using this:
Intent i = new Intent();        i.setAction(DownloadManager.ACTION_VIEW_DOWNLOADS);
startActivity(i);
Comment: I am new to Android, but I have created a Download Manager using C++ Qt, Here is link to my implementation, if you plan to implement download manager yourself then it might help. http://kunalmaemo.blogspot.com/2010/05/simple-download-manager-in-qt-with.html
Comment: I have seen another Android download manager that works.
 http://stackoverflow.com/a/22346459/185022
Answer: You can remove a download from the queue. Then you can start it up again, passing the Range HTTP Header when re-adding it to the queue (like TryTryAgain mentioned). I don't believe this currently can be done more easily.
Comment: I've tried your idea but it seems it doesn't work or did I miss something important. I get the bytes of data that has been downloaded and I rename the file to prevent on removing when executing downloadmanager.remove(referenceId) into the DownloadManager. And Create a request again with corresponding request.addRequestHeader("Range", "bytes=" +bytesStored+"-"); and enqueue again to create a download again. Can you help me about it?
Answer: It may be that "pausing" isn't exactly necessary for you? As DownloadManager actually doesn't need to pause to be resumed.
Instead you may be getting tripped up with resuming? See if this helps:
how to resume an interrupted download Where the solution is implementing a Range request header...
// Open connection to URL.
HttpURLConnection connection =
        (HttpURLConnection) url.openConnection();

// Specify what portion of file to download.
connection.setRequestProperty("Range", "bytes=" + downloaded + "-");
// here "downloaded" is the data length already previously downloaded.

// Connect to server.
connection.connect();

Unless you need to actually allow "pausing" (because of switching file download priority,  maintaining a list or something else more complicated) and not just provide resuming capability, that should help.
Answer: Do you mean to do this in Web Application ?
I am also thinking about the same thing. This might have been possible with flash or sliverlight etc., but in pure HTML?
On the server side we can use RandomAccessFileReader(Apache) or similar FileReader (in bytes) to access file and write to output stream. We can remember how much bytes was downloaded in previous session by the user too. But the problem is there is no standard way to save file to disk in the client's local file system. You can use ActiveX Object in IE to write some file provided it is a sequential (plain text) file and not binary file(like mp3, flv etc). But this ActiveX is not a solution. So you may need to design something like 'Downloader' for you website. Just like Youtube Downloader.
Comment: I am talking about the API for DownloadManager in android. I want to know DownloadManager has api about pause/resume.

How to pause using DownloadManager?


Can the word "since" be used in this way?

Question: In terms of academic achievements, he is within the top one percent of students since the establishment of this department.
Comment: I can't succinctly explain exactly why, but it seems to me that when you use adverbial ***since** [some point in past time]* like this, the main verb should be ***Present Perfect*** - thus, it's *I **have been** in the top one percent of students **since** I started in this school* (not *I **am** in the top...*). Personally, I don't like ***since*** being used in a true Past Tense context, so *I **was** in the top one percent **since** I joined the class* doesn't work for me, regardless of whether I'm *still* in the class at time of utterance.
Comment: It sounds awkward to me. I can't quite work out why though! I'd probably say something like say something like "...he's within in the top 1% of all students in the history of this department."
Answer: Yes, you can use "since" to mean from a specific point in time. For example, "I have felt ill since I ate that sushi". So, from an English grammar point of view, your example is fine. It helps establish that the person is not just in the top 1% of current students, but of all students, ever.
Comment: I agree, but I think the sentence would be a little easier to understand if it was "
.. top one percent of *all* students since ...".


Playing games over different profiles

Question: a- I downloaded GTA V game from UK account profile, and it's working normally
b- I tried to start it on another profile registered on US account and it's getting me error (Xbox store, can't open the game)
notes:
all this happening at the same XBOX console
I work on XBOX 360
Answer: The digitally purchased games are associated to a single Xbox Live profile.
Answer: When you purchase a game on the Xbox 360 Marketplace, you get two licenses for playing the game:

The first one is connected to your gamertag (profile), and allows you to always play the games you buy, on any console, as long as you are signed into that gamertag.
The second license is connected to the Xbox 360 console you purchased the game on, and allows everyone on that console to play the game, with any gamertag.

If that is the case here, you can transfer your license from the other console to the one you're both playing on (you don't need the other console) by following these instructions.

Playing games over different profiles


Scheduling a task for the duration of the project

Question: How would you recommend to schedule a task such as create and maintain  project plan which applies regular weekly updates for the duration of the project?
Answer: There is a concept of BAU or CDB. That is "Business as Usual" or "Cost of Doing Business". In official PMI speak, it is called "Monitoring and Controlling". These are tasks and activities that need to be done and yet have nothing to do with the actual project.
For example, we have staff meetings every week, we don't task these out in a project. It's part of an overhead.
Creating a project status report falls into this category. It is part of the normal day to day function of the job.
If you are running an agile project, all these "Cost of Doing Business" items are just things you need to take into account when determining how much capacity you have to work. If the project status will take you four hours a week, your capacity is four hours less (Pro Tip- Capacity is NOT 40 hours. Average team capacity is about 20-24 hours a week).
If you're in a traditional project I recommend having a separate "project" which is your "Project Management Project". In here track all the things you have to do every week as part of your "day job."
Comment: It can also be useful to track this capacity by type, to be included in any retrospectives or discussions around "we're in too many meetings!", etc. My experience with team capacity matches Joel's as well - about 25 hours of actual work time per week is typical.
Answer: "Maintaining project plan" and similar tasks shouldn't be in the project plan. It can be included in the project estimation or as part of resource planning though.
Comment: Thanks for the feedback - makes sense to track separate from the project.  However, I manage 12-13 projects and want to somehow be able to allocate my time across all as best as I can and sometimes managing communication, status, plans etc take up a significant chunk of it
Comment: I understand. The project plan timeline contains the deliverable's and milestones rather than the day-to-day work activities though. It sounds like the real issue is how to best plan/allocate your time in relation to your day-to-day PM tasks. With 12-13 projects, that's a real challenge.
Answer: You could use a hammock task and assign yourself to a low assignment unit (<5%).
See: https://support.microsoft.com/en-us/kb/141733
The link references Project 2003 - but the same applies to later versions of project.


Why does eigendecomposition is in the same form of $A=CBC^{-1}$ as using eigenvectors as basis for a transition matrix?

Question: Let A be a linear transformation matrix f(x)=Ax, and if D is A in the eigenvector basis, $$D = Q^{-1}AQ$$, where Q is eigenvector matrix of A and a change of basis matrix changing A in standard basis to a basis of eigenvectors of A. It seems to be similar  to eigendecomposition $$ A = Q\Lambda Q^{-1} $$ $$ \Lambda = Q^{-1}AQ$$ So the linear transformation matrix D with eigenvectors of A as basis is just the eigenvalues matrix of A. What are the connections here?
Comment: Other than whether the diagonal matrix is called $D$ or $\Lambda$ there seems to be no difference between your first and last equations.
Answer: You  simply have different cases of the same result:

If $A$ is the matrix that represents a linear transformation in the standard basis and $Q$ is a matrix that has as columns the vectors of a new basis, than the same linear transformation is represented in this new basis by the matrix $B= Q^{-1}AQ $. This result is always true, for any matrix $A$.

Obviously we have also: $A=QBQ^{-1}$ and the eigendecomposition is a special case.
If $A$ is diagonalizable than it has a set of eigenvectors that forms a basis and, in this basis, the linear transformation is represented by a diagonal matrix  $D$ that has as diagonal elements the eigenvalues. In this case the transformation matrix $Q$ has as columns the eigenvalues and, using the same formula, we have that $D=Q^{-1}AQ$
Also if the linear transformation  is not diagonalizable than we can represent it in a canonical form (the Jordan canonical form) in a basis that is formed by the proper and the generalized eigenvectors. In this basis the transformation is represented by a matrix $\Lambda$ that is given by the same formula $\Lambda=Q^{-1}AQ$ (and $A=Q\Lambda Q^{-1}$) where, now, $Q$ is the matrix that has as columns the  proper and generalized eigenvectors of $A$.
Comment: No. The transformation is represented by a diagonal matrix only in the eigenbasis.
Comment: Thanks. If the basis is not eigenvectors, then is D still a diagonal matrix? (It is diagonal with eigenvalues when the eigenvectors are basis.)


VHDL code Process

Question:
Question:
 change
  z <= y AFTER 30 ns
to
  z <= y after 15 ns
why after the change above ,the value of w never updates ?
Comment: I tried to simulate it. the value of `w` is changing. you mean `x`?
Answer: Besides providing a picture as a code example:
ENTITY top IS
END ENTITY;

ARCHITECTURE example of top IS
    SIGNAL w, x, y,z : integer := 0; -- initialised to 0 (zero)
BEGIN
    p1: PROCESS (z)
        VARIABLE a, b : integer := 0; -- initialised to 0 (zero)
    BEGIN
        b := a - 8;
        w <= a + b;
        a := a + 20;
        x <= a + b + w AFTER 20 ns;
    END PROCESS;

    p2: y <= x + w;
    p3: z <= y AFTER 30 ns;

END example;

We see X does change:

(clickable)
Making your change:
        p3: z <= y after 15 ns;

We see x no longer shows a different value, yet the simulation continues:

(clickable)
The reason we see any continued action is because the process is sensitive to z.
The reason we see x is 0 and never changes is because how projected waveforms are scheduled for signal events.
A new event on z comes along and causes a new assignment to x before the scheduled previously projected waveform resulting in the previously scheduled transaction being deleted from the projected output waveform.
See IEEE Std 1076-2008 10.5.2.2 Executing a simple assignment statement, paragraph 7:

The sequence of transactions is then used to update the projected output waveform representing the current and future values of the driver associated with the simple waveform assignment statement. Updating a projected output waveform consists of the deletion of zero or more previously computed transactions (called old transactions) from the projected output waveform and the addition of the new transactions, as follows:

 a) All old transactions that are projected to occur at or after the time at which the earliest new transaction is projected to occur are deleted from the projected output waveform.
b) The new transactions are then appended to the projected output waveform in the order of their projected occurrence.

If the initial delay is inertial delay according to the definitions of 10.5.2.1, the projected output waveform is further modified as follows:

1) All of the new transactions are marked.
2) An old transaction is marked if the time at which it is projected to occur is less than the time at which the first new transaction is projected to occur minus the pulse rejection limit.
3) For each remaining unmarked, old transaction, the old transaction is marked if it immediately pre- cedes a marked transaction and its value component is the same as that of the marked transaction.
4) The transaction that determines the current value of the driver is marked.
5) All unmarked transactions (all of which are old transactions) are deleted from the projected output waveform.

Our first transaction on x is scheduled to occur at Time 20 ns.
An event on z causes a new x transaction to be scheduled for  Time 35 ns.  This does not result in the old transaction being marked and it is removed.
The why of this comes from the delay model. See 10.5.2 Simple signal assignments, 10.5.2.1 General, the difference between inertial and transport delays. An inertial delay model is the default (when the transport delay model isn't specified).
See 10.5.2.1 paragraph 6:

Every inertially delayed signal assignment has a pulse rejection limit. If the delay mechanism specifies inertial delay, and if the reserved word reject followed by a time expression is present, then the time expression specifies the pulse rejection limit. In all other cases, the pulse rejection limit is specified by the time expression associated with the first waveform element.

The previously scheduled transaction on x is within the pulse rejection limit for the new transaction on x and is dropped.  This happens for every z transaction scheduled to occur within the pulse rejection limit of x.
It happens because the rejection limit is taken from the first scheduled waveform (the expression after 20 ns), which tells you the delay represents the switching time for x.  You could change the delay mechanism to transport and remove the pulse rejection limit or artificially shorted in by providing an explicit reject time.
VHDL by default expects you to use switching delays and not transport delays.

VHDL code Process


Very slow Network printing using PrintServer and PrintQueue

Question: I am working on an ASP.NET application and need to send documents to a network printer. I have utilized the PrintServer and PrintQueue to achieve the purpose as follows:
<code>using System.Printing;

private void PrintTicket
{
  var server = "Network Server Name";
  var filePath = "File to Print";
  var printer = "Network Printer Name";

  var printerServer = new PrintServer(String.Format(@"\\{0}", server));
  var printQueue = printerServer.GetPrintQueue(printer);

  printQueue.AddJob("New Printing Job", filePath, false);
}
</code>
The network printer can be found and the print job is executed.
However, the performance is very slow. It took 5-10 seconds to start printing when method printQueue.AddJob() is executed.If the printer is connected to my local machine, there is no performance issue at all.
Any suggestions? Thanks in advance.
Answer: Instead of using PrintQueue class you can simply use File.Copy(filePath, printerDestination, true);
I have tried both the options i.e. using printqueue as well as file copy and file copy is much faster compare to using printqueue class.
Thanks,
Arnab


Apply fulltext index on existing mysql table

Question: I have applied the full-text index on two fields (title, description) of an existing table. This table already have 7000 - 8000 records.
The search is not working as expected. Even i provide the full title in the search field but i could not get that record at the top and there are also some non-relevant records.
Is there any need to re-insert all the records in the table after adding the full text index?
Or what could be the problem?
Here is the query for reference:
SELECT * FROM f_table f WHERE MATCH (f.tit, f.des) AGAINST ('Rasta Man Vocal 4')

Its not showing this 'Rasta Man Vocal 4' record at the top. Its it on the 4th position.
Here is the detail of first four records:
#  (tit)                (des)
---------------------------------------------------------------------------------
1) Rasta Vocal 1.wav    Male Rasta Vocal-Tune into the King
2) Rasta Jah DnB        Rasta Increase Come from Jah DnB Vocal Reggae
3) Rasta Man Vocal 2    Rasta Man Vocal 2 Download
4) Rasta Man Vocal 4    Rasta Man Vocal 4 Download

Its just an example.
Please help, thanks in advance...
Another question: Is there a way to give more preference to one field (tit) than other (des)?
Answer: Try this::
SELECT *,MATCH (f.tit, f.des) AGAINST ('Rasta Man Vocal 4') as relevance  FROM f_table f WHERE MATCH (f.tit, f.des) AGAINST ('Rasta Man Vocal 4') order by relevance desc


convert from ndip to dip

Question: I have a V9958 NDIP (Narrow DIP) chip that I would like to use with a breadboard, is it possible to somehow convert NDIP to DIP or use an external adapter?
Answer: Actually, if you have a SDIP chip, the pin spacing has 0.07 spacing. Because of this, there's a unique trick you could use without having to dead-bug it and solder wires all over the place!
If you place the IC diagonally...
No need to buy expensive adapters, or glue the IC down and solder wires all over the place.
Pitch of the SDIP: 1.778mm
2.54 * (1 / sqrt 2) = 1.796mm

In fact, there's even a specialized protoboard which does this:
Answer: Shrink Dip is a non-standard variation of DIP ics. Narrow normally refers to the width of the ic at 0.3" inches (and Wide at 0.6"), while Shrink refers to the pitch of the leads. A typical DIP ic should have 0.1" pitch, while Shink DIP has 0.07" spacing. SOIC has 0.05" for comparrison.
The quickest way to use a Shrink DIP in a standard 0.1" pitch breadboard, is to use an adaptor. Make or buy a custom pcb. Or if you need to use multiple of them without soldering, a ZIF adaptor is better.
If you need one right away, a cheap and ugly method is using some pref board, headers, and wire. Solder the headers on the pref board, then Glue the chip upside down on the pref board. Then solder some wires from the leads to the header. Dead Bug style. Won't win a beauty contest though.
Answer: If anyone is interested here is the datasheet: link.
As per page 134 the correct name of this kind of package is 'shrink dip' (narrow is apparently used only for SOIC or smd-ish packages). Searching the web with the correct keyword leads to a ton of results. Check on rs, mouser, digikey or with your local electronics goodies dealer and you can start coding on your chip with a nice reusable adapter:

convert from ndip to dip


Possible to use double DNS?

Question: Before I used my plesk DNS and found that there is no SPF records in plesk and now I left plesk and started using Godaddy DNS and here I found that there is no PTR records in Godaddy DNS. But I need both PTR and SPF records. Now can I use both Plesk and Godaddy DNS together or  is there any issue in using more than one DNS service for a same domain?
Answer: I think what you want to do is configure your SPF record with GoDaddy and have your ISP configure your reverse DNS record. This should accomplish what you're looking for.
Answer: No this is not possible. You need to have one authorative DNS server and can setup others to be slaves that replicate the zone(s). But this is not an easy task and can't be done via a (web)frontend.
Comment: PTR and SPF records are in different zones and thus can very well live on a different set of DNS servers.

Possible to use double DNS?


Can there be acceleration without work?

Question: Since $W=Fs$, $F=\frac{W}{s}$. When you substitute this in the formula for acceleration, $a=\frac{F}{m}$, you will get that $a=\frac{W}{ms}$. Then, when work equals zero, acceleration will be zero.
Comment: $W ≠ FS$  but $W = \int F.dS$
Comment: It is the "dot" of the "dot product" that is important. Even if we consider constant forces and constant displacements, the work is not $W=FS$ but $W=\vec F\cdot\vec S$. If the angle between $\vec F$ and $\vec S$ is $\theta$, then we have $W = FS\cos\theta$. If the force and the displacement are perpendicular ($\theta=90^\circ$), the work is zero.
Comment: How could there be? Don't you see acceleration as some kind of change? How does the First Law of Motion allow change without work?
Comment: @RobbieGoodwin:  Take a look at [the top rated answer](https://physics.stackexchange.com/a/747203/81133) for how you can have acceleration without work.
Comment: @MichaelSeifert Why not try to explain that?
Answer:
Can there be acceleration without work?

Yes. An object going round in a horizontal circle at constant speed is accelerating because the direction of its velocity is changing. However, the magnitude of its velocity (its speed) is constant, and so its potential and kinetic energy are constant. Therefore it neither does work nor has work done on it. Although there is a force acting on the object (the centripetal force which keeps it moving in a circle) this force is always at right angles to the velocity of the object and so it does no work on the object.
Comment: Kinetic energy is transfer of energy, so work is doing. What is potential energy here.
Comment: @RobbieGoodwin "if it's moving, neither kind of energy is constant" - incorrect. An object moving along a horizontal path (e.g. a horizontal circle) at constant speed has both constant kinetic energy (because its speed is constant) and constant potential energy (because the path is horizontal). However, it may still be accelerating if the *direction* of its path changes. "Does gravity 'do no work' on objects in orbit?" - yes, if the orbit is circular so KE and PE are both constant.
Comment: By definition, no. What can 'acceleration' be but a change…? Who doubts a circling object is accelerating, because its direction is changing?

If in velocity, only speed mattered, potential and kinetic energy could only be constant with continuous input to at least one… if it's moving, neither kind of energy is constant.

Can you explain how a force at right angles to the velocity of an object 'does no work…'?

Does gravity 'do no work' on objects in orbit?
Comment: Of course the object moving in a circle at constant speed is accelerating because the direction of its velocity is changing.

That doesn't alter the fact that the velocity is being changed by a force. Whether that's 'pure' gravity, or some centrifugal or centriputal of G, I don't mind.

Either that, or Newton was wrong. Which would you prefer?
Comment: @Gandalf How would you you define that 'horizontal circle' please?
Comment: @RobbieGoodwin Yes, there is a force acting on the object moving in a circle, but since that force is always at right angles to the velocity of the object *it does no work* on the object.
Comment: @gandalf61 Can you go back and explain where Newton got motion wrong, or not?
Answer: Yes, there can be acceleration without work.
Consider a particle on a string in uniform circular motion with constant speed.  Since the speed is constant the kinetic energy (KE) is constant.  But due to the centripetal force on the particle from the tension in the string, the particle has acceleration toward the center of the circle.  The work from the tension force is determined by $\vec T \cdot \vec v$ and since $\vec T$ and $\vec v$ are at 90 degrees there is no work.  The velocity vector changes, hence the particle is accelerated; the speed (magnitude of the velocity) is constant, hence the KE is constant and there is not work done on the particle.
Comment: @NeilLibertine I'm not sure what you mean. Centripetal force is a force that acts on the particle. It's a real physical force - if it's too strong it will break the string. In a rotating reference frame there is an additional fictional force, centrifugal, that acts in the opposite direction and stops the particle accelerating.
Comment: Centripetal force *is* a true force – it is the actual physical force that makes an object move in a circle. For a mass on a string it is the tension force in the string, pulling the mass inwards. For a gravitational motion of a small body (e.g. Earth) around a much larger body (e.g. Sun) it is the gravitational force, again pulling the body inwards.
Comment: Centripetal force is for frame not particle.
Answer: Magnetic forces don't do work on an otherwise free particle because the force is always perpendicular to the velocity. Without using calculus, you have to remember that the work $w=F S$ only when $F$ and $S$ are parallel. More completely, $w=F S \cos(\theta)$ where theta is the angle between $F$ and $S$. In the magnetic case, $\theta=90$ degrees so $\cos\theta=0$ and $w=0$
With calculus, the force is defined as $\vec{F}=q\,\vec{v}\times\vec{B}$ where $\vec{v}$ and $\vec{B}$ are the velocity and magnetic field. A useful fact to know is that the cross product of two vectors will always be perpendicular to the original two vectors. Now calculate the work, $w=\int \vec{F}\cdot d\vec{s} = \int (q\,\vec{v}\times\vec{B})\cdot d\vec{s}$. Recall that $d\vec{s} = \vec{v}\,dt$ so $w=\int (q\,\vec{v}\times\vec{B})\cdot \vec{v}\,dt$. The useful fact above says that the dot product in the integrand is 0 so the work is 0.
Answer: The Coriolis force is always orthogonal to the velocity vector so it does not do any work on a fluid parcel it acts on, but it causes acceleration that changes the direction of the velocity vector.
When deriving an equation for the kinetic energy balance (or turbulent kinetic energy balance), the Coriolis term drops out.
Answer: The fundamental physics principles state that energy does not vanish, it just changes its form. Consider E=mc^2, electromagnetic waves interacting on particles or circular motion.
Work is the change in energy (e.g. difference of potentials energies).
Acceleration is due to the change in velocity and thus change in kinetic energy.
When you have acceleration you increase kinetic energy and this reduces other types of energy (or similar resource). Therefore you cannot have acceleration without work.
Most of the answers claiming that circular motion has acceleration without work are neglecting the fact that the object creating the force at the center is also affected by the object circulating the center (e.g. Moon creates tides on Earth).
The simplest example is a Olympic sport of hammer throwing. The thrower stands straight initially straight. Once there is motion in the hammer, the thrower leans in the opposite direction to gain balance and does work into the system.
For example, a 100kg person is moving his mass by 10 cm to balance the centripetal force of the hammer. Thus, in radial direction only, the hammer thrower has done work W = F.s where F is the horizontal Force component caused by the gravity and the tilt-angle of the thrower and s is the horizontal distance of the tilt. The F equals the centripetal force of the hammer (and the corresponding centripetal acceleration). The work has to come from somewhere. The same applies to all fields (magnetic, gravity, etc.).
No Work, No Acceleration.
Don't believe everything you are told to.
Comment: I guess I am just repeating myself at this point, but this is fundamentally wrong: "Acceleration is due to the change in velocity and thus change in kinetic energy." Velocity is a vector. Acceleration is a vector. **Change in velocity does not imply change in kinetic energy**. The circular motion due to a centripetal force (e.g. gravitational force) towards a fixed centre is an example. The *velocity* (a vector) is constantly changing, thus there is acceleration. The *speed* (absolute value of velocity) does not change, hence the kinetic energy ($\frac12mv^2$) does not change.
Comment: @printf There does not exist "a fixed centre" anywhere in the known universe. This is an imaginary object. The rotating object always affects the central object and there is motion of these both. This creates work. The "centripetal story" assumes that there are fixed objects which is not true in the real world.
Comment: Nobody is talking about a "fixed centre". The rotation of the Earth around the Sun – or the rotation of both around the common centre of mass – will continue forever (at least in classical physics, ignoring gravitational radiation). No work is done. No energy is expended.
Answer: Simple answer is Gravity.
When a ball dropped from a height, it experienced acceleration without any external work or force acting on it.
Comment: This is deeply incorrect. In newtonian mechanics (the context of the question), gravity leads to an external force… It's called weight, or gravitational force, and it does provide the work that makes the object accelerate during its fall.
Comment: Obviously this is very incorrect. It is the gravitational force that causes the ball to accelerate towards the Earth, and it certainly does work.
Answer: This depends on the definition of work.
The answers including circular trajectory should also include the mention that acceleration towards center has a change of distance towards the center. Thus, if you define work as force times travelled distance, acceleration towards center also includes work.
However this work is immediately released to the change of motion from linear path.
The discrepancy here is that usually definition of work is taken from linear systems that is not compatible with particles in nonlinear systems. Definition of acceleration and work have to be compatible.
In other words:
No, there cannot be acceleration without work. Otherwise you violate Newton's laws and you get a Nobel price.
Comment: "If you define work as force times travelled distance" – work is defined as (an integral of) the *dot product* of force (a vector) and displacement (a vector). If these vectors are orthogonal (perpendicular), the work is zero. (And hence the change in kinetic energy is zero.) If a body moves in circular trajectory (with fixed radius) around another body, then the work performed is zero, and the change of kinetic energy is zero, and this circular motion can continue forever.
Comment: @printf yes, in a circular track there is displacement towards center (displacement =>acceleration) and a force towards center (keep particle in track). Hence, there is work towards center. There is a problem with the definitions. The definition of work is different in circular track _or_ definition of acceleration is different (not towards center or not at all). You cannot take one from linear coordinate system and the other from circular. In other words, the has to be both acceleration and force (F=ma) => work.
Comment: @printf They are NOT orthogonal. Centripetal force and centripetal acceleration are parallel. That is my whole point. If you accept that centripetal acceleration is real acceleration you have to accept that there is displacement radially as acceleration is the second derivative of displacement. The particle is kept in track by a centripetal force. Hence, there is force and displacement radially. The problem here is that centripetal force and acceleration are not real but mathematical constructions. Thus, No work, no acceleration.
Comment: The point is that if a body travels in a perfect circle (not a spiral), then the *displacement* is always orthogonal to the force applied (and to the corresponding centripetal acceleration), and hence there is no work. The sun does not do any work on earth (in the model where the earth rotates around the centre of the sun). The earth does not come any closer to the sun; it stays at the same distance. There is force and acceleration; there is no work. The sun does not spend any energy.

Can there be acceleration without work?


iPad Mini 5th Gen won't update from iOS 12 to 16

Question: I am trying to update an old iPad Mini (5th gen) from iOS 12 to 16. I have it plugged into my MacBook (running on Ventura) and every time I go to run a backup via "Finder" I get an error message that my iPad could not be backed up or updated because the iPad disconnected when the cord and everything is still very much intact. I have gone through two cords, used both ports, restarted both iPad and computer, deleted cookies, and tried everything. Any help would be appreciated!
Comment: Can't you update it via Wifi?
Answer: I'd be inclined to think dirty contacts.

https://www.amazon.com/CRC-05103-Electronic-Cleaner-11/dp/B000BXOGNI
https://www.homedepot.com/p/WD-40-SPECIALIST-11-oz-Contact-Cleaner-Quick-Drying-Electric-Equipment-Cleaner-with-Smart-Straw-300554/307599950

Get a can of contact cleaner - WD40 make a good clean one that won't damage circuit boards or plastics [not the lube in a blue/yellow can, the actual contact cleaner in a silver/green can]
Many generic contact cleaners are fine on circuit boards, but rot plastics rapidly. Don't buy cheap. If you cannot access contact cleaner, then 90%+ isopropyl alcohol & some cotton buds will suffice. This is harder to apply safely, though and leaving cotton on the connectors will be another problem to solve.

Power off, don't just sleep, both the iPad & the MacBook.
Liberally spray the contacts on the plugs, not into the sockets on the devices.
Jam the plugs in & out of the sockets a dozen times, rapidly but carefully.
Repeat at least once, maybe three times.
Allow at least an hour to fully evaporate.

Contact cleaner is conductive whilst still wet, so you need to be patient.

Test again.
Answer: Previous phone tech here,
Chances are that the gap between the version that your iPad is running and the version that you want to update to are too great.
Try 3uTools it's free. (a Windows route)
If you have access to a Windows computer I would highly recommend both backing up your iPad through 3uTools and using 3uTools built in cable checking tool to double check if you have a genuine Apple/MFI certified cable and if the cable is working as intended.
Once you have the iPad backed up through 3uTools (guide here). I would recommend putting the device into recovery mode (iPad guide here), then using macOS's built software to update the iPad to the latest firmware (3uTools can do it as well). Both ways will display an option to update and restore the device as soon as it's connected while in recovery mode.
I know there are macOS tools that you may be able to use to achieve the same thing. I will update my answer as I find one that works.
Note:
If you are okay proceeding without a backup then you can skip all steps and just put your iPad into recovery mode and perform a factory reset using macOS without any third party software.
Comment: I was thinking the same - problems backing up often need an erase / restore. The upgrade could flow if the device was healthy enough to do a backup. Let's hope it's contacts and not something the OP has to choose to lose data and get a newer OS running.
Comment: I have seen it several times with different customers. One comes to mind. Someone had an original 2015 12.9" with **iOS 9.2.1** installed and they weren't able to update their device through settings or through their MacBook because of how different versions were. I was amazed that they used this iPad every day but never thought to update it at any point. I even still have the image that I took [here](https://imgur.com/a/NhNXjcl).


What god if any do Asgardians worship in the MCU?

Question: After watching Vikings on the History Channel, Floki and the other characters are always talking about the gods Odin and Thor. This got me thinking, in the Marvel Cinematic Universe what god, if any, does Thor worship ?
Comment: I'm fairly sure that those that pose as gods are unlikely to have a personal faith.
Comment: Actually, in the comics, there are references to "Those Who Sit Above In Shadow". They are quite mysterious.
Comment: @Richard - tell that to JC.
Comment: In comparison with Living Tribunal Asgardians are rather insignificant.
Answer: Thor is a god in Norse mythology. Therefore, he doesn't believe in a religion. He is the religion himself.
In Norse mythology that is mentioned in Vikings is so different than MCU references of Nordic items. However, they share the same origins.
In Marvel Comics (Earth-616) there are references to the Norns. Norns are the fate incarnate. Even the Aesir and the Vanir respect and fear them. There wasn't any mention in MCU about them so far.
Short story, Asgardian Gods do not have other gods to believe. They are the ones who are worshipped.
Comment: In Norse mythology the tree Yggdrasil and fate (represented by the Norns) seem to be beyond  the Asgardian Gods, though not in a worship sense.  In particular the Asgardians are unable to avoid the devastating and foreseeable consequences of Ragnarok, though in the MCU film *Thor: Ragnarok* the outcome is very different for Thor - more evidence of a departure from the original mythology.
Answer: There is no evidence of any specific religious believes held by Thor in the MCU. This doesn't mean he doesn't have them or that they could never be introduced, but the MCU varies from Norse myth and faith on a number of points, while drawing from others. Explicitly outlining Thor's faith (if any) is likely made considerably more complicated as a result.
That said, the MCU has been vague about the religous beliefs of most of the characters (with the notable exeception of Steve Rogers, who avers his faith publicly in Avengers). The writers may simply not be interested in answering the question in general.


Is alcohol forbidden in Islam and written clearly in the Quran?

Question: Is alcohol halal/haram in Islam and written clearly in the Quran
Comment: shouldn't there be a rule that says you have to at least do some research before coming to ask a question on this forum? because I hear this being recited from the Qur'aan almost every year during Ramadaan.
such a silly question.
I would rather have preferred "Why was Alcohol made forbidden"
Answer:
Is alcohol forbidden in Islam and written clearly in the Quran

Yes. It is directly haram in Quran.
Its in Surat Al-Mā'idah.

5:90
O you who have believed, indeed, intoxicants, gambling, [sacrificing on] stone alters [to other than Allah ], and divining arrows are but
  defilement from the work of Satan, so avoid it that you may be
  successful.
5:91
Satan only wants to cause between you animosity and hatred through intoxicants and gambling and to avert you from the remembrance of
  Allah and from prayer. So will you not desist?
Answer: The Arabic word used in al-Mā'idah 90-91 is khamr خمر which literally means "wine, fermented grape juice". There has been a lively debate amongst the mufassirūn and the fuqahā' as to whether the prohibition of wine encompasses other alcoholic drinks. The classic position of the Hanafi school was that only wine is specifically forbidden.


How to manually upgrade Magento?

Question: I want to upgrade Magento from version 22.214.171.124 to 126.96.36.199. How can I do this upgrade manually or via any other method?
Comment: This worked pretty well http://stackoverflow.com/questions/11662347/how-to-upgrade-magento-1-4-1-1-to-1-7-0-2
Answer: Ugh, just no!
This is how I do it - I use command line stuff, so you need to be logged in via ssh or similar, have write access to the files and be in the document root.

Go through all of your extensions and ensure that there is a version available for the current Magento release.
Take a backup, and load it on a dev server, updating hosts/DNS as necessary. ( this is so I can test the upgrade before going live! ).
Update all extensions to support 188.8.131.52 ( this is for the first attempt. If the process fails, then I will disable all extensions and retry ).
Disable and clear cache, and re-index the database.
If on 1.4 or earlier.
( note the filter on output for old php with 5.3+ )
./pear mage-setup . 2>&1 | egrep -v '^$|Undefined|Function|deprecated'
./pear channel-update pear.php.net 2>&1 | egrep -v '^$|Undefined|Function|deprecated'
./pear install --force PEAR 2>&1 | egrep -v '^$|Undefined|Function|deprecated'
./pear install magento-core/Mage_All_Latest  2>&1 | egrep -v '^$|Undefined|Function|deprecated'

rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*

Restart your web server, then access the home page, and wait until the system load has dropped back down and the home page is displayed. This will have completed the upgrade to final 22.214.171.124. I manually rebuild the indexes at this time to confirm all is ok.
php shell/indexer.php reindexall

Upgrading 188.8.131.52 or higher to 1.7.
chmod +x mage
./mage mage-setup .
./mage sync
./mage config-set preferred_state stable
./mage upgrade-all

As above, restart web server, and reindex.
If you're extremely lucky, the prevailing wind direction is ESE, and you sacrificed the correct type of virgin to your preferred $deity, all will be working fine, and you can proceed to
Test, test, test.

It's far more likely that you'll be making stock installs of various versions of Magento, and running the

magento-db-repair-tool-1.1.php

on a regular basis.
Once you've managed a successful upgrade in private, you can stick the production site into maintenance mode, and use the notes you created to do it for real.
Good luck!
Steve
Comment: I recommend to start the upgrade-scripts from the console: `php index.php`
Comment: Your answer is good for the question, but in #5 you say "Upgrading 126.96.36.199 or higher to 1.7". That is incorrect. You are telling how to upgrade to the latest version, not to 1.7. Nowhere is the version to upgrade to specified. Is there some way to do that? I need to upgrade to 220.127.116.11 specifically.
Answer: If you want to upgrade in manual mode just download and extract contents from archive http://www.magentocommerce.com/downloads/assets/22.214.171.124/magento-184.108.40.206.tar.gz and copy all folders and files over your site.
The best way should be:
 1. copy your installation for example siteA -> siteA.bck
 2. copy new files in siteA.bck
 3. make backup of DB
 4. rename folder siteA in siteA.old and siteA.bck in siteA
 5. open you site

If something goes wrong
Restore db Dump, rename siteA.old back to siteA, investigate the problem.
Comment: You should also deactivate cache and check if there are any upgrade scripts, you can or should execute manually.

How to manually upgrade Magento?


Clarification of doubt

Question: This is my wife's third marriage and my second. She does not have any children from all her marriages. I am her third husband I recently found out she has been in contact with second ex husband is this allowed because now I don't trust her is it grounds for talaq
Answer: I'm sorry you are going through this. Have you tried to talk to her about it and let her know that it makes you uncomfortable? Talaq is very, very serious. I think it is better for both of you to be completely open about your opinions on the issue and then decide whether you want to go forward in your marriage or not. I hope everything works out for you inshallah.

Clarification of doubt


Dashcode user guide application

Question: I was working on dashcode application (Dual product web application)i have mention a URL (http://www.apple.com/trailers/home/xml/current.xml).after running the application i am getting an error "trailers/home/xml/current.xmlFailed to load resource: the server responded with a status of 500 (Internal Server Error)" So is any other URL which can i use instead of that URL. Or how can i sort out that error? Please help me in this regards.
Thank you
Prince
Answer: instead of the given URL (http://www.apple.com/trailers/home/xml/current.xml),use this URL http://trailers.apple.com/trailers/home/xml/current.xml.

Dashcode user guide application


Mesh not moving with the armature

Question: I tried using rigify and after parenting it with the mesh and using weight paint it still doesn't seem to move. I'm still a newbie so this is my first model that I've made so I'm not sure what I'm doing wrong.
https://drive.google.com/file/d/1T58z256-yVLu8i7b5RACKeloV3Tnfhhz/view?usp=sharing
Answer: Congratulations on your first rigged model. There are a few common mistakes but they are easy to fix:

The Body mesh has 22 duplicated vertices. This will cause the infamous "Heat Weighting: Failed to find solution for one or more bones" error. You need to remove them with the Merge By Distance operation. Select everything in *Edit mode with key A and press key M. It's also described in one answer to the linked question.
The clothes have flipped normals. This will mess up the calculation of the Automatic Weights. You need to flip the faces. See the question: Bad auto weight paints

Furthermore,

The leg bones of the meta rig are X-legs. You need to straighten them else the knee tilts inwards or outwards when the character lifts the leg. See Rigify leg issue for details.

The hair strands have around 400,000 vertices. That's very heavy. Consider adding a Decimate modifier on the hair strands with the option Un-Subdivide and 4 or even 6 levels. The level value should be an even number to maintain the topology. This way you can reduce the number to about 50,000.

For these "extensions"/"cloak parts" you can add extra bones to the metarig and define a Rigify Rig Type to create controls in the animation rig. This question may also be interesting for you: How to make rig that reacts to gravity or seem to behave physically correct? might be useful, too.

Mesh not moving with the armature


How do I channel heavy water runoff on my sloped desert land?

Question: I live on a sloped lot in desert country. There is little vegetation on the lot - bushes and small trees. When it rains there is 99% runoff. I want to channel the water so that it does not eat away existing structures. I have earthen (natural soil) ditching now. I am looking for ideas of what to use to remove the water without losing too much cover - with some esthetic appeal.
Comment: In a desert environment, you would do better (IMHO) to work on swales and similar features to encourage as much water as possible to slow down, stop, and soak into the ground before you let it run away, rather than trying to get it to drain even faster...
Comment: @Ecnerwal that's what I was thinking, get the water to stay. In Florida where it can get VERY dry, almost desert dry in some places, we built berms around the edges of our property to make the water go down into the soil rather than run off into the storm drains where it does no good except get polluted.
Comment: Hey, I actually taught grading and drainage in another life!  Send a few pictures!!
Comment: pictures and a site plan with the slope.  Where do you want the water to go?  Are you intending to grow plants with it?  More details=better answer
Answer: If you're living in desert country, you should be aiming to capture as much rainwater as possible, and prevent it from leaving your property if you can.  If the property is sloping, you need to build swales on contour with the dirt excavated from the swale used to build berms on the downhill side of the swale where you then plant deep rooting plants to hold the berm in place.  If there's a lot of water, it can also be directed into ponds for storage or underground storage if it's really a desert.
Geoff Lawton has done a lot of work in Jordan in re-greening the desert using various permaculture techniques, and the first part of the video discusses water capture.
Comment: Catching rainwater is actually a good idea but may be illegal in some US states. Also it's not practical to cover his whole property with tarps. Redirecting water is still the OPs best bet.
Comment: http://www.harvesth2o.com/statues_regulations.shtml
Answer: If you can dig small 6" deep ditches, and it's legal (it's illegal in most US campgrounds to use even 1" deep trenches around a tent or anywhere else), and they stay formed, use that to collect and redirect runoff. If not, line the ditches with house gutters and stake them in place somehow.
I don't know exactly how your soil is, but you might have to put a 6-12" stake in a hole in the bottom of the gutter. Before putting the stake in the gutter hole, fill the hole with silicone caulk to prevent leaks, then pound the stake right through the hole and the caulk.


Running CLion on the System console (like Visual Studio)

Question: I am trying to run a simple C++ program on CLion. The problem is that when I try to compile and run it, it shows the result in the application console. I want to run on the System console like the Visual Studio runs the output of the console apps. Is there a way of doing this. I use MINGW compiler.
Answer: You can use an external terminal, do these steps.

(top menu) run\ edit Configurations
tick 'run in external console'
Comment: What IDE version is it? I don't have that option.
Answer: Well, if anyone is still around wanting to open an external cmd window on run, there is a way to do it on Windows as well:

Go to Run > Edit Configurations
For the executable select C:\Windows\System32\cmd.exe
For program arguments use: /c "start cmd.exe @cmd /k "ProjectName.exe""
For working directory set the cmake debug (or release) folder
Save and select the profile from the dropdown right next to the run button

Note: In the third step /k can be replaced with /c to make the window close after the program is run (with /c its more like visual studio and with /k its more like code blocks)
Answer: the above answer works fine in windows also. In working directory you can set this $CMakeCurrentBuildDir$
enter image description here
Comment: Please don't put text in images.
Answer: I am not sure about Windows but in linux you can do it using this answer.
You might be able to change the gnome-terminal to cmd if you are using windows but you will probably need to change the "Program Arguments" too.


How to obtain range object for window.getSelection()?

Question: In a js function, I want to obtain all Nodes(HTML elements) that are part of the content in a web page, when the content has been selected by the user.
Now, I understand that window.getSelection() will give me a selection object. Also, this selection object has to be converted into a range object, before I can obtain the list of nodes(HTML elements) that are part of that selection.
How do I obtain the range object? From what i read, different browsers have different implementations of range objects...Initially, I will use this js function only in Google Chrome...So code should work perfectly in Google Chrome... but I do want that the code works across all/most new versions of Google Chrome... The code may be JS or pure Jquery.
One more question-- do I have to use a js library like "Rangy"- http://code.google.com/p/rangy/  for this purpose? Or can this be achieved using pure js or jquery code?
Comment: Have a look at [this](http://stackoverflow.com/questions/5222814/window-getselection-return-html). This might help.
Answer: Apart from IE < 9, all major browsers implement the same standards for Selection and Range and have done for years. There are some differences but the APIs are the same. If you're not bothered about IE < 9 then you really don't need to use Rangy (it's around 40KB before gzipping), although it does have a convenient method for getting nodes that you may find helpful.
To get the nodes within the selection, you can get the selected range like this:
var sel = window.getSelection();
if (sel.rangeCount > 0) {
    var range = sel.getRangeAt(0);
}

To get the nodes from the range, you could use the code from this answer. If you used Rangy, it would be
var sel = rangy.getSelection();
if (sel.rangeCount > 0) {
    var range = sel.getRangeAt(0);
    var nodes = range.getNodes();
}

Answer: I can see the problem that you are facing is not to get a range object but to find the HTML nodes inside the selection. In this demo, if you select text and click 'get selection html' button, you get the selected text including the DOM. Once you get that, you can find a list of DOM nodes using jquery code.  Let me know if you need more info on this.
Comment: if the selection is within some top level html nodes, then will I also get the top level nodes with the selection's HTML, in the demo you have provided? Basically, I need the entire node path, from top level node downwards, for the current selection... Also will the demo work with selections that include images/links/tables? Thanks...


Can "plural subjects be single object"?

Question: "Computers are often argued to be the most important invention of the last hundred years." Could anyone tell me whether this sentence is right? And why? Thank you!
Answer: Yes, it is perfectly correct. Here is another example:

These flowers are a gift from an admirer

When we talk about the flowers themselves, we view them as plural. When we talk about those same flowers as a gift, we view them as singular.
In the same way, if we talk about a packet of biscuits, when we talk about the biscuits themselves, we  view them as plural, but when we think of them as a packet, the packet is singular.

Can "plural subjects be single object"?


Windows Phone prohibit textboxes focus getting

Question: I have four textboxes and 10 buttons for digits. I need to change
background of textboxes when one of four is focused. But when i click
on button there i loose textbox focus and background return to normal
(from focused visual state). So how can i prohibit buttons to catch focus when i clicked
them and save focus on textboxes?
Answer: Are you using numbers on your buttons?  If so, is there a specific reason that you're making your own number pad?  If it is just because you want to have a number pad instead of the regular keyboard, are you aware that you can add this property to your textboxes InputScope="TelephoneNumber" which will give you a number pad similar to the telephone dialing pad.


Why does formation of bond releases energy and where does that energy come from?

Question: I am having a hard time to imagine why does bond formation releases energy and where does that energy comes from?? It is easy to understand that breaking a bond requires energy because it can be viewed in many ways like breaking a wood into pieces requires energy, ripping your shirt into half requires energy, converting liquid water into gaseous water requires energy. These tangible concepts make it easy to understand why bond breaking requires energy. From these examples it answers the question why does bond breaking requires energy and where does that energy comes from (surroundings/thermal energy/mechanical force applied by the surroundings). But bond formation have so little comparisons and most of the examples associated with it are vague and hard to communicate with non science major. Thanks for the help.
Comment: Bond formation is like the same processes in reverse. True, this doesn't happen in our everyday world. Well, on atomic level it does.
Comment: Well, electrons have a lot of energy and can lose a bit. While *why* they lose it is hard to explain, the source is kinda simple.
Comment: If you want to keep it simple, you can say that an electron (negative charge) that can interact with two nuclei (positive charges) has a lower energy than an electron near a single nucleus. Of course, this would mean that all atom-atom interactions would be covalent, which is not true. To understand this, you will need to get more sophisticated: orbitals, Pauli exclusion principle, exchange interaction...
Comment: The shirt and the wood are not the best analogies. Two magnets are - take a look at Snatoms, https://www.youtube.com/watch?v=He30D8M5fNc
Comment: I think the shirt and the wood are good analogies because it is what ultimately felt at a macro scale. Just keep into account that some of the bonds might be not covalent. Nice question. Plus 1.
Answer: It's a matter of perspective. You say you understand why bond breaking requires energy. In other words:
$$\ce{A2 + energy -> 2A}$$
But consider the reverse reaction:
$$\ce{2A -> A2 + energy}$$
This is also valid and can be understood in the following way: Bonds stabilize the electrons. In the unbound or atomic state, the electrons have a bit more energy. You can consider that atoms have some potential energy, like a ball on a hill. By forming a bond, the atoms "go down the hill" into a more stable state and thus lose this potential energy. This energy must go somewhere, and it is thus released in one form or another (heat, light, etc.) To break the bond is to push the atoms "up the hill" again, which requires energy.


Why does diffused reflection not form a virtual image

Question: I know that most of the objects around us, like tables, doors etc reflect irregularly and do not form an image. I know that to form a real image, a lot of reflected rays must converge, and this is not possible for diffused or irregular reflection. But my question is: Why do these opaque objects that reflect irregularly not form a virtual image?
Comment: A virtual image of what, of the light bulb?
Comment: A virtual image of objects
Comment: Like a door forming a virtual image of a table?
Comment: Lenses form images (both virtual and real) as a certain proportion of all rays emanating from a diffuse but specific point in space are captured by the lens and focused to another very specific point in the image plane, there are many focused points in the image plane that make an image. (assumes the original object has features and is also in a plane).
Answer: When an image is formed by a lens or a mirror, ray bundles which originate from a single point on the objective (and thus are 'related' to each other in that sense) are focused back into a point in the image plane.

A diffuser, by definition, scatters the light rays in a random manner, thus the rays are no longer related to each other, that is to say, no longer form a bundle, and thus cannot be focused into a point in the image plane.


Native Error Code: 4. Out of memory while reading tuples

Question: I'm loading data from ODBC(32 bit) source(3M records) to OLEDB destination it is executing successfully in SSIS package. But throwing below error while executing from integration catalog. Kindly let me know how to resolve below error.
1.Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on ODBC Source returned error code 0x80004005.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure
2.: Open Database Connectivity (ODBC) error occurred. state: 'HY001'. Native Error Code: 4. Out of memory while reading tuples.
Thanks in advance.
Answer: Postgres ODBC Driver SSIS 32 Bit
Setting the Declare/Fetch option ON and tweaking the Cache Size in your Postgres ODBC data source may help.
See:
https://www.simba.com/products/PostgreSQL/doc/ODBC_InstallGuide/win/content/odbc/re/options/ui/declarefetchmode.htm
Answer: I am getting the same error pulling 2 million records from postgres using 32bit odbc driver with oledb ms sql destination. This is a memory leak in the VS debugger. All I can say at this point in testing is at 1.5 million rows and I don't get the error. Perhaps you have the 64 bit driver and the server has 32? In any case over 1.5million rows is asking for memory errors in this configuration


When to build the Stone Quarry in Goblin Camp?

Question: For those that play Goblin Camp in its early stages (build 0.11) when do you guys put up the Stone Quarry?  Right away?  Wait until you have a certain number of orcs?
Answer: Wait until you have the resources to wall it off so you don't get ambushed.
The best way to do that is to create an "Ant Lock" For example:
<code>--------+-------
|              |
|---+----------|
| Quarry goes  |
| in here      |
----------------
</code>
With the "+" being doors.  This allows your goblins to come and go, without letting the ants out to rampage around your base, since they can't open doors.  Once you are attacked by ants, you can send in an orc squad to mop them up.
I usually wait until I've got at least 15 or so orcs, which I then make 2 squads of 5 and use the rest for labor.  Take care of just about everything else before you open up a new door for bad stuff to get you.
Comment: holy crap awesome answer!!
Comment: Glad to help, good to find more people playing an awesome game!


Address reuse, one address per person

Question: I know about the privacy and security implications of address reuse. But I was thinking about a scenario where I have one address for every person I receive transactions from. This would still have the security problems, but not the privacy problems? Did I overlook something here?
Comment: so you would have 1 address per user, that sends you Satoshis. This is  address re-usage, and has the same PRIVACY implications, as if you'd have only one address for all users. Just at a different scale. Not sure, what the security issue is, what you mean by that. To avoid this, you may want to look into BIP32/44 wallets (HD wallets), that can assign everytime changing adresses, without you to worry too much... I put the answer here:

https://bitcoin.stackexchange.com/questions/46718/bitcoin-system-with-payins-and-payouts-using-bip32/52900#52900
Comment: The security problem is that when you create a transaction you have to publish the public key belonging to your address.

But you transact with everybody over another pseudonymity. I am sure the privacy is improved because not everyone of your transaction partners can see your balance. (for example) But I am not sure what exactly I am overlooking.
Answer:
but not the privacy problems? Did I overlook something here?

Yes, unfortunately.   When you later spend you often need to use coins originating from multiple transactions that previously paid you and these co-spends will link together your transactions.
For example.  Say Alice pays you 1 bitcoin to address A and then Bob pays you 1 bitcoin to addess B. You then spend 2 bitcoin and use those to coins, indicating to the world that the same party probably controls A and B.  Later Bob pays you 1 bitcoin again and Charlie pays you 1 bitcoin to address C.  You make another 2 BTC payment using the coins from Bob's second payment and Charlie's payment, now the world has reason to believe A, B, and C are all controlled by the same party.  Without the reuse people would know less.
This privacy loss doesn't just hurt you, but also A, B, and C and potentially the people they interact with so even if privacy isn't very important to you today it's still better to not gratuitously lose privacy.
Bitcoin Core has some logic to try to spend all payments to the same address at once (though in 0.17 it isn't enabled by default) but even that won't help you if the payments/spending are spread out over time. If you are forced to reuse addresses it's preferable to delay spending payments to a particular address until its unlikely to get any more and to then spend them all at once.
Using one address per paying party is the bare minimum needed to even know who paid you but doesn't provide particularly great privacy.
Answer: maybe need to (re-)define security a bit more. A security issue would imply a harm to you, your computer or maybe to your money (aka lost Satoshis). You are correct, you publish the public key of your address in a signed transaction. This is done by all users, which do transactions, and as such "works as designed". No security harm is involved with such a disclosure of your address (senior bitcoin experts to proof me wrong). Why? But your privacy may get lost. Again, you are right, re-using address is bad for privacy. Hence HD wallets and (BIP32/43/44).
Loosing privacy can become a security issue in the next step for more or less reasons:
1. someone tries to hide the bitcoin wealth or hasn't declared the funds in front of the tax authorities, and now "fears" sanctions, once his activities get discovered. In this case, sanctions are rightful. And yes, they then cause a security issue to you (computers confiscated, eventually risk to go to prison).
2. someone's (tax declared, rightful) wealth is disclosed, which attracts criminals, which could prepare measures to rob you in one way or another. This is usually considered to be a security issue as well.
Summary: keep privacy at max, do not re-use addresses. The bitcoin technology allows for protection of assets and a minimal set of privacy. Higher privacy, and as such more "possible security" comes with next technology levels like tumblebit or mimble wimble. Just my thoughts.
Comment: The problem with publishing the public key belonging to an address is that you break one layer of security. If there is a problem with ECDSA and an attacker can calculate your private key from your public key, they can spend all funds if only knowing the public key. An address is a hash of the public key. To get the private key from an address you need to break more layers.
Comment: If I have a pseudonym with everyone of my transaction partners they can only see my "wealth" with them, so only the transaction sent between them and not my overall wealth.

Address reuse, one address per person


Is it possible to find when the last insert took place?

Question: I have several tables that I'm not sure whether they are still in use by some old tools. Not all of them have columns with timestamps so I was wondering if there is some secret internal sql-server table where I could see when the last insert (or any other operation) took place for certain tables?
Answer: Not giving away any code or anything just yet but ways to detect whether a DB is still in use by some app can be as follows:
- turn the DB off (set to single user mode, set as read-only, etc) many variations to effectively get the result of someone shouting at everybody else because one of their processes stopped unexpectedly and its because of the server you just "turned off"
.. personally this is my favourite approach - but I do understand that it may cause some real business issues and some people just can't deal with emotions ;).

you could also monitor the database size and see if that changes
you could have a small process that counts all rows from particular tables (all tables) and logs that into some other database for you.. then simply see if the row count changes
you could monitor the log file (if anything happens in terms of INSERT, UPDATES, DELETES, then you will see that there.
you could run sp_who(2) at regular intervals to check who's connected

These are just quick and easy to implement methods to see if someone, somewhere is still using the database.
I hope this helps,
B
Comment: How about watching statistics? Last update and row modification counter would be a tell-tale too.
Comment: Unless you have automatic operations doing stuff like data deletion in the background which are not "in use" but maintenance tasks on a database level.
Answer: SQL Server doesn't have any secret internal mechanism to track all data changes to all tables. There are some things that can give indicators, such as row counts or statistics, but there are edge cases that make them imprecise. For row counts, you will miss things like a user deleting 10 rows, adding 10 more, and updating 20, all between your polling of row counts. Statistics updates can be triggered by all kinds of things that don't necessarily mean an end user or application was involved.
You could easily add triggers to all the tables to capture new inserts / updates / deletes, or add timestamps to all the tables that don't have them. After a certain period of time, preferably a complete business cycle, this could help you determine which tables are used. You need to wait for a whole business cycle, because some tables may only be written to at the end of a week, month, or other period. But this won't give you any data about the past.
Be careful to not fall into a common trap: timestamp does not enable you to see when a row changed, only whether it has changed since the last time you checked. And of course if rows get deleted, you won't be able to check their timestamp values, because the row simply isn't there.
When you've identified the tables you think are okay to delete, a trick I've used to make sure they're not still being used is to rename them or transfer them to a different schema. You'll find out pretty quick when an application or user can't find a certain table.
The other thing you could do, which is a little more disruptive, is move the things you know are still being used (and the connection strings for their applications) into their own database. And in fact each set of related things into its own database. You shouldn't ever be in a situation where you have a mix of things that are and aren't being used in a single database. When you've moved the known things, you could do a similar trick to above: mark the old database as read only and wait for someone to complain.