rsyncing a bootable backup

Question: jwz mentions PSA: Backups a backup system that's fairly clever. Your backup method is to essentially restore to the replacement drive. This seems to work simply on OSX. What all do I need to do to adopt this guide to Ubuntu?
Answer: Partition the two external drives the same way as your system drive, and rsync all your partitions as well as dding the boot sector (the first sector of the drive) from the system drive to the external drives.  Ugly, but serviceable, if you get your partitioning right (big if).
Also take a look at more advanced "system snapshot" systems like mondo rescue, which kinda take care of that sort of trickery for you.
Comment: Just copying the bootsector is insufficient. Even in grub, the actual boot sector or MBR contains hard references to the sectors of the stage1/stage1.5 files in /boot/grub. You'll need to re-run the grub installer; there's no shortcut there.
Answer: For Ubuntu I recommend using sbackup, the whole "rsyncing a live bootable disk" just doesn't function very well in Linux. If the UUID's are different on the two drives (9/10 they will be) then you can't simply boot off the backup disk to get back up and running, you'll need to boot off your Ubuntu CD and edit /etc/fstab on the replacement drive first. If the UUIDs are the same, then you're going to run into problems while trying to have the two mounted simultaneously.
There are differences in the Mac filesystem that make this kind of trickery possible, I've never heard of doing this method via rsync but it's very common in the OSX world to backup by simply creating a disk image of your live boot volume, which you can later restore. Functionality to restore such images is provided on the OSX install CD.
The quickest solution for Ubuntu is sbackup and then just reinstalling Ubuntu (from the Ubuntu 'live CD' it's effectively the same as restoring a disk image, after which you restore your previous package selection, config and data from the sbackup archive. Fairly simple and I suspect you could write a howto that takes a new user through the complete steps of backup/install/restore without much problem.
Comment: Have you ever used sbackup?
Comment: And I means used. To restore.
Comment: *used*? Hell I donno how or if italics work here...
Comment: Yup, I used it at my previous job and on my personal laptop where we were ll using ubuntu dekstop machines. Previously I was using homegrown scripts on 10+ servers and 50+ desktops. It's great, and I've restored from a backup as well with great success. I was a debian (and later Ubuntu) sysadmin and C developer for around 7 years. These days I'm mostly using a Microsoft stack but I still occasionally use Ubuntu and haven't found a better backup solution other than coding your own.
Answer: If you are clever, and you plan in advance, you can use LVM to accomplish this for you.
Say you have your system on a drive that uses LVM; in fact, the entire system is on an LVM volume somewhere.
With your second hard drive in an external case, attach the drive to your system, get LVM to recognize the drive, and then use LVM's mirror facility to copy the drive in place.  Once a complete copy is finished, break the mirror.  You will now have an exact snapshot in time (because the mirror also records any changes that take place during the copy process).  The only thing you need now is to make it bootable.  If you're using GRUB, you can do this from your existing system.
If you want to be really clever, write up this process as a script, and run the script on a regular basis.  All you have to do is make sure the external drive is attached when it runs.
Answer: Not sure if I am understanding your question correctly:
If you are wanting to backup your linux machine to create bootable restore cd's, then have a look at mondo
It's a clever backup program that backs up your kernel and all required hardware drivers in such a way to be able to snapshot the entire server to .iso images, which can then be burned to CD/DVD.  Then if a restore is needed, just pop in the first CD, power-on, and select a restore option.
Answer: I don't have an exact step-by-step recipe for you, but I suspect I would start building a system like this.  I am assuming you are an Ubuntu user based on your icon, the tags.

I would start with the mini.iso that matches your running system and do a CLI-only install onto the portable drive.  I would make it one big partition.
I would test booting from the portable drive to make sure everything is working so far.
On the install on your portable drive I would update the /etc/fstab, and /boot/grub/menu.list to use the uuid if they aren't already.
I would create a backup script (/root/rsync-to-portadrive) and exclude file (/root/rsync-exclude) like bellow (you probably need to add/tweak your exclude file).

I haven't tested this and worked out the fine details, but I am pretty sure if you rsync and don't overwrite the /etc/fstab or /boot, then the system should still boot and be able to mount the root filesystem.  The /root/rsync-exclude file will keep you from including tmp files and junk you don't need to backup, and it will keep you from overwriting your /boot directory and fstab.
Like I said, I haven't tested I believe my basic plan is sound.  I agree with other posters in believing that this isn't a great method for backing up your system.  If you have any database applications like mysql, you will want to make sure you back them up separately.
/root/rsync-to-portadrive
<code># mount the portable device
mkdir -p /srv/portabackup/
mount /dev/disk/by-uuid/19976dc9-2d2b-43e3-87ff-d3fb071ddcb3 /srv/portabackup/

# make a backup of your /boot and fstab
mkdir -p /srv/portabackup/boot_backup/
cp /etc/fstab /srv/portabackup/boot_backup/fstab
rsync -va /boot/ /srv/portabackup/boot_backup/
# sync the main system
rsync -vaEH --delete --stats -D --numeric-ids \
      --exclude-from=/root/rsync-exclude \
      / /srv/portabackup/
# unmount
umount /srv/portabackup/
</code>
/root/rsync-exclude
<code>- lost+found/
- core
- *~
- .nfs*
- /tmp/***
- /var/tmp/***
- /boot/***
- /boot_backup/***
- /etc/fstab
- /etc/mtab
- /srv/portabackup/***
- /proc/***
- /sys/***
+ *
</code>
Answer: You didn't mention the frequency and the constraints. For desktops, I used a simple nightly cron script that did a dumb but complete duplication of the drive based on something like :
<code>dd if=/dev/hda of=/dev/hdb
</code>
Advantages

Cannot be simpler. If there is a problem, just throw away the faulty drive and you're good to go with a new one.
Since you will be reading the whole drive again, and writing the whole also it is nice to detect some bad sectors in a proactive way.
Filesystem & partitionning agnostic.

Disadvantages

Horridly slow (Read hours). I did improve it by using a custom tool that did basically the same, but reading the destination in parallel and only issuing a write if the data was changed.
Since you are replicating many live filesystems, not much should change in them, especially since it's not really like a crash, the beginning of the drive will not be in sync with the end. So it's better to do it on a maintenance basis (with temporarily remounting the filesystems R/O)

A more chirugical solution does exist if your system allows "snapshotting" such as LVM snapshots as other pointed out. I proposed mine since the backup/recovery part is not as simple as your question seemed to imply.
Answer: You can't make a safe copy of a live system. The best bet is to make a boot disk, say a live CD, modified to run a script that does the back in one of the ways described above.
You could use these instructions to do the clone with ddrescue.
Comment: Why not? For the simplifying things, lets assume the only databases online are sqlite.

rsyncing a bootable backup


Good book for learning fluid statistics

Question: I'm currently using Gray and Gubbins Theory of Molecular Fluids to learn about the statistical physics of fluids. It may be a fine reference text, but I'm not impressed with it as an introduction to the subject. Its organization seems poor, new symbols are constantly introduced with little motivation, and there is a major lack of solved problems. Results are simply quoted, with the assumption that the reader will read the original papers to learn more. Is there a better introductory book? I need one which explicitly deals with anisotropic interactions.
Answer: My absolute favorite book on the subject is the one that we used in our Gas Dynamics class: Introduction to Physical Gas Dynamics by Vincenti and Kruger.
I had never had an introduction to statistical mechanics prior to this book and it does a great job developing the requirements as they are needed and providing motivation for the path it takes. I also find it very easy to read and very approachable, both in terms of writing style and notation. I still pick it up to read it from time to time just because I like it that much.
Perhaps the best part for my preferences is that it spends more than half the book looking at real, applicable flows -- supersonic and hypersonic flows, chemically reacting flows, and radiative transfer in flows.

Good book for learning fluid statistics


Scripting - Where is data not shown in the "Info" panel shown?

Question: I notice that Blender only logs certain things in the "Info" panel. Is there some other place that they log data(such as if one were to have 3 vertices selected, where would they store that data for later use if someone were to move them)? Another way to phrase this would be: if I am scripting, where can I access the current selected vertices?
Comment: Hi. Please only ask one question at a time. You are welcome to ask multiple questions but as separate posts. I suggest editing your question down to just one question (by using the [edit] link below it) and asking the other one separately. Thanks.
Answer: The info is mainly explicit defined and call from operator :
class mesh_OT_someops(byp.types.Operator):
    def pseudo_excute(self):
        self.report({'INFO'},"This is an Info Output")

It can be arbitrary thing and most of the time, the final output log is been emitted. And for sure, Blender and all other programming language will not automatically "Saved Log" for anything. Unless that is a state machine, which, seems to far away from the topic.
So, if you are scripting, you will always have to dig out the data from the Blender module bpy. For your mesh selected vertices, it will be something like this:
selected_vertices = [i for i in bmesh.from_edit_mesh(obj.data).verts if i.select]

It is not easy when you are not familiar with program, especially pointer-based programming since most of the Blender object you call is reference. And also, using Blender scripting need a certain degree of Python knowledge, which might be hard to learn, despite Python claims for easy to learn.
Answer: Writing scripts based on INFO area reports is not the way to go
Since it appears you are new to blender scripting, thought I'd add somewhat of an answer re getting started, INFO area and selected verts, not so much knife-tool or memory-management
Find I very rarely have the INFO area open.  It is IMO not going to provide that much useful info for anything but the simplest script.  Operators provide an interface between the User and the data.  They use context as input, require the correct context to run and the  results are reflected via context.
It is quite often the case that using an API method is a more practical way of coding directly.
a = bpy.ops.object.empty_add()
b = bpy.data.objects.new("Empty", None)

after running a is {'FINISHED'} ie the operator completed, the newly operator created empty is now the context.object.   b is a ref a newly created empty object.
Developer Extras
There is some assistance via developer extras.  Pretty well covered here:
Displaying vertex indices in Blender 2.8 using debug mode
ie can view the vertex indices via an overlay, and the operator associated with an action via tooltip.
bmesh module
Recommend usage of  the bmesh module for investigating and editing meshes.  Will see nowt about its use in the INFO area.  Perhaps there could be more, but will find a number of fantastic examples dotted thru the API manual.  This one creates a couple of chain links.
https://docs.blender.org/api/current/bmesh.ops.html#operator-example
There are a number of bmesh operators with similar names to bpy.ops.mesh operators. Beauty of bmesh is pick a mode to work in , create a bmesh and not have to bother again with context and mode toggling.
May notice  some recommend not using, or avoiding,  operators.  Would clarify this somewhat to don't over use, particularly don't loop and call
see Python performance with Blender operators
Python Console
Use the python console as an interactive way to "nut out" scripts.
With a mesh in edit mode.  In the console C = bpy.context and D = bpy.data
>>> import bmesh
>>> C.mode
'EDIT_MESH'

Create a bmesh representation of the edit mesh
>>> bm = bmesh.from_edit_mesh(C.object.data)

Similarly to example in the other answer re getting selected verts by attribute from all can look at the select history.  Example below have 3 verts selected, index 14, 17 and 19
>>> for e in bm.select_history:
...     type(e), e.index, e
...
(<class 'BMVert'>, 14, <BMVert(0x7fe2fd006320), index=14>)
(<class 'BMVert'>, 17, <BMVert(0x7fe2fd0063c8), index=17>)
(<class 'BMVert'>, 19, <BMVert(0x7fe2fd006438), index=19>)

Autocomplete, for 2.8 this is the TAB key.  Typing just C.objTAB  will expand to C.object or a narrowed down list of matches.
The up and down arrows for history.
Related
Saving/loading the location(x,y,z) of selected vertices
Comment: Just started learning to script in Blender; this answer confirms my very disappointed impressions :(


Slow cooker ok on high?

Question: I am cooking a tator tot casserole and it has raw cut up chkn breast and frozen broccoli and frozen tataor tots . Can I cook it on high and my slow cooker as opposed to low to accommodate timer restrictions?
Answer: You'll be fine cooking on high.  I'd expect it to be best at 50-70% of the time on low.  Starting any significant ingredients from frozen, I'd be inclined to use high (or auto, though I've never had one with that mode) anyway, as the contents will take a long time to get up to temperature otherwise.
While plenty of things can't be cooked on low for safety reasons, there's very little that's improved by cooking low. Casseroles aren't among them
Comment: I predominantly cook on low, tbh. I start from boiling, but then usually have about 8 hours or so til dinner, so low times it just fine. It might depend how low 'low' is.
Comment: @Tetsujin I nearly always include dried beans (soaked, or soaked+boiled if they're kidney beans) and all day on high works well for those.  Otherwise all afternoon on high (lentil-based things) - but I use mine at weekends or if working from home.
Comment: and (@Tetsujin) the sort of things that can't be cooked on low according to the manuals for all I've owned are pork joints, whole chickens, etc. (not beef joints; they're OK).  It's all about the internal temperature, and holding it high enough for long enough. On the rare occasions I eat meat I don't slow cook it.
Comment: Mine makes no mention of foods that cannot be cooked on low - but then again it makes no mention of cooking whole chickens either. That's something I'd simply never have thought of doing in a slow cooker, ever. I use mine 9/10 times for cooking what could loosely be termed a 'stew', + the occasional pot roast.
Comment: @Tetsujin I also mainly make stew-like things. I have done a chicken in it, many years ago; it looked insipid but the texture was decent.  Starting from the one I had with a metal pot (I didn't get on with it sliding around on the gas stove and went back to a proper one), they seem to have got a bit more powerful.
Answer: My slow cooker has generic instructions for timings as well as specifics for detailed recipes.
We don't know if yours is the same, but as a general guide…
Low 8-10 hours
Medium 5-7 hours
High 4-6 hours.
These timings assume you have pre-seared any meat.
Without pre-heating, add time… Low 2-3 hours, med 1-2 hours, high 1 hour.
It also says to add 15 minutes for every time you lift the lid, to stir etc.
Many of the specific recipes, though, give huge time variants for each dish - for instance goulash 4 - 8 hours on medium, chicken paprika 4 - 7 hours, med.
That's a lot of leeway in which you have to use your own judgement. For stewing/braising beef, longer is better, for chicken breast the shorter end of the timescale might be best. You may end up using the broccoli as your timer; it's done somewhere between when the broccoli is soft but not yet falling apart. Chicken breast somewhere between when the centre of the largest piece is no longer pink & it turning to rubber.
All of this is highly dependent on how full the pan is too. More stew, longer time.
You could reduce all these times if you bring your stew to a boil before putting in the slow cooker - but that's dependent on what your pot is made of. Mine is metal, so it goes straight from stove top to slow cooker. Also how easy it is to stir your stew. Tater tots don't strike me as being very stirrable; I'm assuming they need to just sit gently on top.
Answer: I have never had much luck in cooking frozen foods in a slow cooker. I believe the indirect heat is just simply never hot enough to get frozen foods to the needed temperature for it to be cooked. Just simply better to defrost everything before it goes into the slow cooker.

Slow cooker ok on high?


Don't see the masterpage option in the site settings

Question: I have a sharepoint 2013 portal. When I go to the site settings I normaly see the option "Masterpage". I dont see it at this moment. What can I do to change the masterpage?
Answer: You will only see the option "Master Page" if the site is a Publishing site (having publishing features enabled)
The Url to the master page settings is <code>/_layouts/15/ChangeSiteMasterPage.aspx</code> which will throw an error on for example a Team Site
Comment: Really?  What a shame I used that a lot in 2010 :(
Comment: In my environment this is the case at least :/ Only for publishing sites can I access the page successfully through the link above
Answer: enable publishing feature from site settings. Goto site settings >> Site Collection feature and activate SharePoint Server Enterprise Site Collection features this feature.


Why aren't globular clusters disk shaped

Question: I thought that solar systems and galaxies are disk-shaped because that is the most stable shape under gravitation. Globular clusters are very old, often times older than their host galaxies, so why haven't they flattened out?
Comment: Because if they were disk-shaped, they wouldn't be globular clusters.
Comment: Do globular clusters have big black holes in their center?
Comment: I don't know what you mean my most stable under gravity, but basically, galaxies tend to be disk shaped because it is a shape with relatively low energy that still preserves a certain angular momentum. As celestial bodies collide, some kinetic energy is irreversibly converted into other forms of energy, like thermal, so the total kinetic + potential energy of the system decreases over time, but the total angular momentum is conserved. Therefore, any motion that is outside of the disc and doesn't contribute to the angular momentum tends to dissipate, causing the distinct disc shape.
Answer: In order to result in a disk-like stellar system there are two conditions that need to be satisfied. (a) The initial gas from which the stars form must have a significant ratio of rotational to gravitational energy. (b) The star formation would have to occur slowly enough, that the gas collapses to a disk before star formation is complete.
The formation of a disk from a spherically symmetric state requires a reduction (more negative) gravitational potential energy, whilst conserving angular momentum. This can only happen if there is some means to lose energy from the system in the form of dissipative interactions.
A pure stellar system is almost collisionless and there is no means to dissipate energy. That means once a spherical system of stars has formed, there is no way for it to become more disk-like. Thus if star formation takes place in a spherical way, then those stars will end up in a spherical system. Only in cases where the gas collapses to a disk before star formation occurs do we end up with disk-like systems. This is true of the disk of our Galaxy (and of the solar system).
In the case of globular clusters (and other types of star cluster in the Galaxy) it appears the star formation is rapid enough that the gas cannot have collapsed to a disk before most star formation is complete. NB. Many globular clusters do have measurable rotation.
Comment: But physical friction is not the only effect responsible, right? There are also the gravity pulls, that for example cause heavier bodies to "fall" closer to the middle of a galaxy. I would assume that gravity assists would have similar effect and would flatten the cluster. Why doesn't that happen?
Comment: @TomášZato For the same reason that the planets don't fall into the Sun - any loss of potential energy results in a gain in kinetic energy. Heavier bodies do not generally fall closer to the middle of a galaxy. If you are talking about dynamical friction and mass segregation, that would have no effect on the sphericity of a cluster.
Answer: While some galaxies are disk-shaped, others (elliptical galaxies) are more spherical. Disk-shaped systems are those in which conservation of angular momentum of the star-forming gas played a central role; for more spherical systems, this was not the case. Globular clusters are thought to form in the densest portions of gas in galaxies with the highest external pressure, possibly resulting from collisions of gas clouds. In this case, the initial angular momentum of the larger-scale gas distribution is irrelevant, and the dynamics of the gas on much smaller scales is more important.
To put it another way: it is not the case that disks are the most stable shape under gravitation; spheroidal or elliptical systems are also stable equilibria. The physics of collapse and formation determine the final shape. For globular clusters, the initial angular momentum of the gas is likely irrelevant because they condense out of much smaller pockets of gas.


Link to mobile not working

Question: There is a link saying "mobile" at the bottom of stackoverflow page. The link is not working. It is just showing "about" page. Could anyone confirm this.
Answer: Certain pages on our sites don't have a mobile equivalent - the FAQ is one of those.
Click on the home page after clicking on mobile and you'll see what is intended for mobile devices.
Answer: For what it's worth, the link works for me on the home page.

As Jarrod points out, other pages don't have a mobile theme. It looks like these include chat, about, faq, blog, and legal.

Link to mobile not working


What packages provide visual odometry?

Question:
Is there a package that provides visual odometry aside from vslam? I found visodo but it has a missing/deleted dependency(vop).

Originally posted by Homer Manalo on ROS Answers with karma: 475 on 2011-02-23
Post score: 6
Answer:
I don't believe there is a released package providing that functionality at the moment.

Originally posted by tfoote with karma: 58457 on 2011-03-01
This answer was NOT ACCEPTED on the original site
Post score: 3

Original comments
Comment by Homer Manalo on 2011-03-03:
Would this: (http://www.rainsoft.de/software/libviso.html) work with ros? Or is there anybody who had use it with ros perhaps?
Answer:
Okay ... I have it working, but it is not complete at this point [16 Feb 2012]. I have the mono camera up and running but haven't started on the stereo yet. Feel free to take a look at my github of libviso2. I will improve it over time.

Originally posted by Kevin with karma: 2962 on 2011-04-30
This answer was NOT ACCEPTED on the original site
Post score: 1

Original comments
Comment by jrcapriles on 2011-09-09:
Hi! I'm working in visual odometry, did you make the ROS node for libviso? or how did you resolve the Visual Odometry problem?
Comment by tom on 2011-05-04:
It would be great if you did. To make sure no one else is working on it already it'd be safer to drop a line on firstname.lastname@example.com and email@example.com.
Comment by Thomas D on 2012-02-18:
The code looks great. I'll try it out today with some cameras I have. Thanks!
Comment by Kevin on 2012-02-18:
Thomas, let me know how it goes for you
Comment by Thomas D on 2012-02-19:
It was easy to get running for the monocular case.
Comment by Thomas D on 2012-02-25:
@Kevin, if I have changes I'd like to see in your nodes, do you want me to just push them up?
Comment by Kevin on 2012-02-25:
sure ... thanks!
Answer:
We just released our ROS-Wrapper for libviso2, called viso2_ros. It contains nodes for monocular and stereo odometry. Every parameter from libviso2 can be set through ROS. Odometry information is published as nav_msgs/Odometry and geometry_msgs/PoseStamped as well as through a tf for easy visualization through rviz. Have a look at the corresponding ros wiki page for further information.

Originally posted by Stephan with karma: 1924 on 2012-03-22
This answer was ACCEPTED on the original site
Post score: 7

Original comments
Comment by Thomas on 2012-03-29:
I strongly encourage the use of viso2_ros. So far, it is the best visual odometry package I have found in ROS.
Comment by Giuseppe on 2012-04-05:
Stephan,
do you think it is possible to add the option replace=true as a ros parameter to set at running time? Is it even possible to set parameters without changing those in the program? If yes in which way?
Thanks

What packages provide visual odometry?


Harmony, lead and backing, notes outside the chord

Question: Okay so perfectly happy with the principle playing of say a straightforward major chord and playing a notes of that chord over the top of it. Also happy with the idea of playing say a more dissonant chord like a diminished and playing say b5  over that. We are playing notes that appear in the chord. But is there any place for playing notes not in the chord?  We are always told to mirror the chords notes in the lead.  I like angular stuff, but it can still be angular by using weird chords and progressions, so should we limit to that and keep on mirroring the notes in the chords?  I realsise an answer is you can do what you like, but lets take that as given.
Comment: Many chords began their lives as a chord plus some notes that weren't in the chord.  Another way of looking at it: when you add notes, it's not the same chord anymore, but that doesn't mean that it's wrong.
Answer: It's more of a guideline to say 'use chord tones and diatonics'. It's a great start point, made even simpler with 'use pentatonics instead'. The latter extracts two notes which can sound bad, and the former keeps it all safe and together.
The trick about using 'the other notes' is more about where they go in a bar. They are often used on the weaker parts - off beats, final beat, and so on.
However, they can and do work wherever you want. Take the sequence B C E♭ E G♭ G, all played as quavers in a 3/4 bar. The two chromatic notes shouldn't fit, but they do.
The basic ideas you quote are really to help early players make music that sounds fine. If they were told anything goes, they would be playing seemingly randomly, with no datum points, and nothing to guide their playing. Start in a structured way, and spread out from there?
Answer:
But is there any place for playing notes not in the chord?

Yes.
This is a basic part of understanding homophonic music (essentially music that is chords plus melody) called non-chord tones (nct).
There are many nct's with standard definitions like: suspension, passing tone, appoggiatura, etc.
The principle behind non-chord tones is they are dissonant to the chord being played but then the dissonance is resolved either by the nct moving to a chord tone (usually by step) or by holding the dissonant tone while the chord changes to one where the held tone becomes a member of the chord.
The ebb and flow of consonant chord tones and dissonant non-chord tones is an important dynamic force in melody. The set up of dissonance which then gets resolved - in traditional harmony the dissonance necessitates resolution - gives the melody forward motion.
Nct's can be diatonic or chromatic and metrically accented or un-accented.
Many, many melodies contain non-chord tones.

One thing to keep in mind is harmonic analysis is needed to determine what is a bona fide chord and its tones versus non-chord tones. Most of the time you probably don't need to worry about this, but you should be aware of it. Let's consider three examples in the key of C major:
First an ambiguous dominant seventh case:

...you could label the G chord as a dominant seventh chord, or you could consider the F natural as a passing tone between G and E. If the F fell on a strong downbeat it would make a clearer case for a bona fide dominant seventh chord.
Second an ambiguous subdominant case:

...the first chord could be called ii6 - D minor in first inversion - or you could say the top D is an appoggiatura over an incomplete F major chord IV. Either chord ii6 or IV are a kind of subdominant function leading to the G major chord V so it's kind of "six of one, half dozen of the other."
Third an embellished minor chord:

...the accompaniment chord is a D minor chord in first inversion. In the treble are metrically accented C# and E. Tones are present that match chord symbol Dmin9(M7), but is that the bona fide chord? How do you decide? There isn't one absolutely right answer, but a common way to look at it is ask if dissonant tones require resolution. When a dissonance doesn't resolve there is a good case for considering the tone a member of an extended chord using sevenths, ninths, etc. In the example above the C#, E and G# all move up to chord tones. Even though the tones are metrically accented their movement from dissonance up to chord tones suggested resolution of dissonance rather than dissonances of bona fide chord extensions.
Potential ambiguities like this come up all the time. Make sure to look at the overall context of the music to understand what's going on.
Answer: If you have in mind the harmonic framework of your tune  and at least one chord tone per beat  is present, then  you can really try out "everything goes" because then all other notes are chromatic approaches, passing tones or changing notes (cambiata) (they can be diatonic or chromatic.)
Comment: by harmonic framework, do you mean for example scale or chord progression?
Comment: I mean what you mean when you write: *that chord over the top of it*
Answer:
We are playing notes that appear in the chord. But is there any place
  for playing notes not in the chord?

What chord do you mean by "the chord"? :) Look at it this way: whatever notes you play, contribute to the harmony. If you play the notes on rhythmically strong time positions where "chord tones" are perceived, the note combination effectively becomes the sounding chord. Let the sounding chord be the chord! If you play a ♭5, then the chord is at least an "add ♭5" chord. Maybe it wasn't the originally planned or designed chord, but it is the chord you're playing as a group. A bass player can change a major chord to a minor-seventh chord by playing e.g. a D when others play an F major. F/D = Dm7. From this perspective it is not possible to play notes "not in the chord", because whatever you play as chord-tones is in the chord. And then the whole problem kind of vanishes, doesn't it? Or like you say in the comment, the question becomes, "do I like the new chord" - which pretty much summarizes the whole thing.
To reiterate. If you play your note so that it's perceived as a chord-tone, there are two chords:

(1) First there is a chord before you play your ♭5 note.
(2) After you play the ♭5 note, there is a new chord. It's the old chord with an "add ♭5".

If you had played a seventh, you would have made the chord a seventh chord.
If you play the notes so that they're perceived as passing tones, then you still contribute something, but not necessarily enough to change the perceived overall chord, i.e. how someone might transcribe what they're hearing as chord symbols.
If your song is in C and the base chord is a C major, and you play a strong F# on a strong beat, then you give the chord a lydian feeling. But nevertheless, it's not the same chord anymore, from a listener's point of view.
I think this is an important point to understand for soloists. Chords are not rigid monolithic objects, you can change them with the notes you play. Some guitarists seem to think like, chords are given from somewhere and can withstand any kind of mishandling, playing random notes over them, as long as the notes come from the right scale. Not so! Whatever you play, does at least something to the harmony - and if you play so that your notes are perceived as chord-tones, you can make a big mess if you play randomly, and using the right scale won't save the chords from your mutilation. You should understand what you're doing to the chords. :) This is (I suppose) also why the minor pentatonic scale is so popular - you can play it pretty randomly over chords with limited damage.
Comment: So, if I play a chromatic run using 8 quavers in a bar, which I sometimes do, say C to G, and it actually works fine over a C chord, what is the replacement chord going to be called?! Dv (not mine!) probably as this doesn't answer the question?
Comment: @Tim Ah ok, I see what you mean. Depending on the rhythmic position and dynamics, not all notes contribute to the harmony so much that it would change the perception of the overall chord. I edited my answer.
Comment: @visionset There are two chords. First there is a chord before you play your b5 note. After you play the b5 note, there is a new chord. (if you played your note so that it's perceived as a chord tone, not a passing tone)
Comment: actually quite valuable, it does simplify it. The question then becomes do I like the new chord or not. Tim gets the win though ;)
Comment: This is about improvisation, not about interpretation of written music
Comment: @visionset Of course it's about improvisation. Can you answer the question, what do you mean by "the chord"? I'm trying to explain that whatever you play, contributes to the perceived harmony. If you play a b5 note in such a time location and in such a way that it's perceived as a chord-tone (instead of passing tone), you effectively changed the chord to "add b5" (if such a thing exists). Of course you  cannot _remove_ or cancel notes that others are playing, you can only add to it or change what you're playing yourself. A bassist can do a lot by changing the lowest note. What is "the chord"?
Comment: @piiperiReinstateMonica I give two examples of 'the chord' in the opening sentences. 'the chord' could be anything and 'the notes' can be any outside of the chord.


What is the meaning of the term "thread-safe"?

Question: Does it mean that two threads can't change the underlying data simultaneously? Or does it mean that the given code segment will run with predictable results when multiple threads are executing that code segment?
Comment: Just saw an interesting discussion here about this matter: http://blogs.msdn.com/ericlippert/archive/2009/10/19/what-is-this-thing-you-call-thread-safe.aspx
Comment: This is the new link : https://learn.microsoft.com/en-us/archive/blogs/ericlippert/what-is-this-thing-you-call-thread-safe for the article shared by Sebastian
Answer: Thread-safe code is code that will work even if many Threads are executing it simultaneously.
http://mindprod.com/jgloss/threadsafe.html
Comment: duh! this answer just restates the question! --- And why only within the same process ??? If the code fails when multiple threads execute it from different processes, then, arguably, (the "shared memory" might be in a disk file), it is NOT thread safe !!
Comment: "To write code that will run stably for weeks takes extreme paranoia." That's a quote that I like :)
Comment: Indeed, in the same process :)
Comment: @mg30rg.  Perhaps the confusion is the result of somehow thinking that when a block of code is being executed by multiple processes, but only by one thread per process, that that, somehow is still a "Single-threaded" scenario, not a multiple-threaded scenario.  This idea is not even wrong.  It is just mis-definition.  Clearly, multiple processes do not generally execute on the same thread in a synchronized manner, (except in rare scenarios where processes by design coordinate with one another and the OS shares threads among processes.)
Comment: Just note that here @CharlesBretana is using a more conceptual (and intuitive?) definition of 'thread' in order to cover potentially-multiprocessing scenarios where no actual threading is involved. (In Python, there are whole frameworks for doing this without threads or shared memory/disk but rather by passing pickled objects as messages.)
Comment: @Jon,  .. I would posit that anytime a block of code that creates an invariant in a resource that is accessible (and modify-able) by an other thread, whether that other thread is being executed in the same process or in another process, we are "multi-threading".  Unless explicitly coded not to, all modern OS's can (and do) interrupt running code to implement multi-Processing.
Comment: @CharlesBretana If the code (_segment_) fails if many threads are executing it simultaneously in **different processes**, then it **will** fail if _one thread per process_ executes it **and** those processes run _simultaneously_, so that code (segment) **does not lack thread safety**, but **simply unsafe**.
Comment: @mg30rg,  If it "fails when one thread per process executes it and those processes run simultaneously," then it is NOT "thread safe". your statement would be true if failed when one thread executes it in only one process, THEN it is simply unsafe. If it fails when multiple threads execute it concurrently, (not "simultaneously") but could not experience the same failure when executed in only one concurrent thread, then it is THREAD unsafe.
Comment: @CharlesBretana _"Clearly, multiple processes do not generally execute on the same thread in a synchronized manner"_ I think this statement is only true in the **Windows** (or more generally the multithreaded) environments, but fails to be true in the **Linux** (or more generally in the multiprocess) environments, because the later tends to distribute batched problems between processes instead of threads. _Discalimer: Both multiprocessing and multithreading are available on both mentioned OSs, only they perform better in the manner I addressed them._ #noOSflamepls
Comment: @mrg30rg,  If Linux tends to " ... distribute batched problems between processes instead of threads. ..." then they are on separate threads.  How can two distinct processes run on only one thread ?  They can't, unless they are somehow synchronized (like when running a multi-Process OS on a machine with only one CPU).  But in that case, the single "thread" that everything is running on is a logical abstraction at a much higher level than the threads we are discussing.
Comment: Single-sentence answer with a reference link.. is this a recipe for a great answer :)
Answer: A more informative question is what makes code not thread safe- and the answer is that there are four conditions that must be true... Imagine the following code (and its machine language translation)
totalRequests = totalRequests + 1
MOV EAX, [totalRequests]   // load memory for tot Requests into register
INC EAX                    // update register
MOV [totalRequests], EAX   // store updated value back to memory

The first condition is that there are memory locations that are accessible from more than one thread. Typically, these locations are global/static variables  or are heap memory reachable from global/static variables.  Each thread gets its own stack frame for function/method scoped local variables, so these local function/method variables, otoh, (which are on the stack) are accessible only from the one thread that owns that stack.
The second condition is that there is a property (often called an invariant), which is associated with these shared memory locations, that must be true, or valid, for the program to function correctly. In the above example, the property is that "totalRequests must accurately represent the total number of times any thread has executed any part of the increment statement". Typically, this invariant property needs to hold true (in this case, totalRequests must hold an accurate count) before an update occurs for the update to be correct.
The third condition is that the invariant property does NOT hold during some part of the actual update. (It is transiently invalid or false during some portion of the processing).  In this particular case, from the time totalRequests is fetched until the time the updated value is stored, totalRequests does not satisfy the invariant.
The fourth and final condition that must occur for a race to happen (and for the code to therefore NOT be "thread-safe") is that another thread must be able to access the shared memory while the invariant is broken, thereby causing inconsistent or incorrect behavior.
Comment: This covers only what is known as *data races*, and is of course important. Yet, there are other ways how code could not be thread safe - for example bad locking that may lead to deadlocks. Even something simple like calling System.exit() somewhere in a java thread makes that code not thread safe.
Comment: I guess to some degree this is semantics, but I would argue that bad locking code that can cause a deadlock does not make code unsafe.  First, there is no need to lock the code in the first place unless a race condition, as described above, is possible. Then, if you write the locking code in such a way as to cause a deadlock, that's not thread-unsafe, it's just bad code.
Comment: But note that the deadlock won't occur when running single-threaded, so for most of us this would surely fall under the intuitive meaning of (not) "thread-safe".
Comment: Well, deadlocks cannot occur unless you are running multi-threaded of course,  But that's like saying network problems cannot happen if you are running on one machine. Other problems can happen single-threaded as well, if the programmer writes the code so that it breaks out of the critical lines of code before it completes the update, and modifies the variable in some other subroutine.
Comment: Please use language independent lines of code called "pseudocodes" to explain the concepts as there is no mention of assembly language in the question.
Comment: Comments added to the right of assembly do provide that content/meaning.
Answer: An easier way to understand it, is what make code not thread-safe.  There's two main issue that will make a threaded application to have unwanted behavior.

Accessing shared variable without locking
This variable could be modified by another thread while executing the function. You want to prevent it with a locking mechanism to be sure of the behavior of your function. General rule of thumb is to keep the lock for the shortest time possible.
Deadlock caused by mutual dependency on shared variable
If you have two shared variable A and B.  In one function, you lock A first then later you lock B. In another function, you start locking B and after a while, you lock A. This is a potential deadlock where first function will wait for B to be unlocked when second function will wait for A to be unlocked. This issue will probably not occur in your development environment and only from time to time. To avoid it, all locks must always be in the same order.
Comment: Good one, explaining the problem should always be explained prior to explaining the solution.
Answer: I like the definition from Brian Goetz's Java Concurrency in Practice for its comprehensiveness
"A class is thread-safe if it behaves correctly when accessed from multiple threads, regardless of the scheduling or interleaving of the execution of those threads by the runtime environment, and with no additional synchronization or other coordination on the part of the calling code."
Comment: Be more civil next time and maybe we can discuss. This isn't Reddit and I'm not in the mood to talk to rude people.
Comment: This definition is incomplete and not specific, and definitely not comprehensive. How many times must it run safely, Just once? ten times? every time? 80% of the time? and it does not specify what makes it "Unsafe".  If it fails to run safely, but failure was because there's a divide by zero error, does that make it thread-"Unsafe"?
Comment: Your interpreting comments about someone else's definition as insults to yourself is telling. You need to read and understand substance before reacting emotionally. Nothing uncivil about my comment. I was making a point about the meaning of the definition. Sorry if the examples I used to illustrate the point made you uncomfortable.
Comment: If I may, I think this is a classic misundestanding. The commenter failed to acknowledge the robustness of this fine answer, which didn't address their own reason for clicking on this question. I'm with @Buu here, the commenter should show more courtesy.
Answer: As others have pointed out, thread safety means that a piece of code will work without errors if it's used by more than one thread at once.
It's worth being aware that this sometimes comes at a cost, of computer time and more complex coding, so it isn't always desirable. If a class can be safely used on only one thread, it may be better to do so.
For example, Java has two classes that are almost equivalent, StringBuffer and StringBuilder. The difference is that StringBuffer is thread-safe, so a single instance of a StringBuffer may be used by multiple threads at once. StringBuilder is not thread-safe, and is designed as a higher-performance replacement for those cases (the vast majority) when the String is built by only one thread.
Answer: At least in C++, I think of thread-safe as a bit of a misnomer in that it leaves a lot out of the name. To be thread-safe, code typically has to be proactive about it. It's not generally a passive quality.
For a class to be thread-safe, it has to have "extra" features that add overhead. These features are part of the implementation of the class and generally speaking, hidden from the interface. That is, different threads can access any of the class' members without ever having to worry about conflicting with a concurrent access by a different thread AND can do so in a very lazy manner, using some plain old regular human coding style, without having to do all that crazy synchronization stuff that is already rolled into the guts of the code being called.
And this is why some people prefer to use the term internally synchronized.
Terminology Sets
There are three main sets of terminology for these ideas I have encountered. The first and historically more popular (but worst) is:

thread safe
not thread safe

The second (and better) is:

thread proof
thread compatible
thread hostile

A third is (even better) one is:

internally synchronized
externally synchronized
unsynchronizable

Analogies
thread safe ~ thread proof ~ internally synchronized
An example of an internally synchronized (aka. thread-safe or thread proof) system is a restaurant where a host greets you at the door, and disallows you from queueing yourself. The host is part of the mechanism of the restaurant for dealing with multiple customers, and can use some rather tricky tricks for optimizing the seating of waiting customers, like taking the size of their party into account, or how much time they look like they have, or even taking reservations over the phone. The restaurant is internally synchronized because all of this is included "behind the scenes" when you interact with it. You, the customer, don't do any of it. The host does all of it for you.
not thread-safe (but nice) ~ thread compatible ~ externally synchronized ~ free-threaded
Suppose that you go to the bank. There is a line, i.e. contention for the bank tellers. Because you're not a savage, you recognize that the best thing to do in the midst of contention for a resource is to queue like a civilized being. No one technically makes you do this. We hope you have the necessary social programming to do it on your own. In this sense, the bank lobby is externally synchronized.
Should we say that it's thread-unsafe? that's what the implication is if you go with the thread-safe, thread-unsafe bipolar terminology set. It's not a very good set of terms. The better terminology is externally synchronized, The bank lobby is not hostile to being accessed by multiple customers, but it doesn't do the work of synchronizing them either. The customers do that themselves.
This is also called "free threaded," where "free" is as in "free from lice"--or in this case, locks. Well, more accurately, synchronization primitives. That doesn't mean the code can run on multiple threads without those primitives. It just means it doesn't come with them already installed and it's up to you, the user of the code, to install them yourself however you see fit. Installing your own synchronization primitives can be difficult and requires thinking hard about the code, but also can lead to the fastest possible program by allowing you to customize how the program executes on today's hyperthreaded CPUs.
not thread safe (and bad)  ~ thread hostile ~ unsynchronizable
An example everyday analogy of a thread-hostile system is some jerk with a sports car refusing to use their blinkers and changing lanes willy-nilly. Their driving style is thread hostile or unsychronizable because you have no way to coordinate with them, and this can lead to contention for the same lane, without resolution, and thus an accident as two cars attempt to occupy the same space, without any protocol to prevent this. This pattern can also be thought of more broadly as anti-social, though that's less specific to threads and more generally applicable to many areas of programming.
Why thread safe / not thread-safe are a bad terminology set
The first and oldest terminology set fails to make the finer distinction between thread hostility and thread compatibility. Thread compatibility is more passive than so-called thread safety, but that doesn't mean the called code is unsafe for concurrent thread use. It just means it's passive about the synchronization that would allow this, putting it off to the calling code, instead of providing it as part of its internal implementation. Thread compatible is how code should probably be written by default in most cases but this is also sadly often erroneously thought of as thread unsafe, as if it's inherently anti safety, which is a major point of confusion for programmers.
NOTE: Many software manuals actually use the term "thread-safe" to refer to "thread-compatible," adding even more confusion to what was already a mess! I avoid the term "thread-safe" and "thread-unsafe" at all costs for this very reason, as some sources will call something "thread-safe" while others will call it "thread-unsafe" because they can't agree on whether you have to meet some extra standards for safety (pre-installed synchronization primitives), or just NOT be hostile to be considered "safe". So avoid those terms and use the smarter terms instead, to avoid dangerous miscommunications with other engineers.
Reminder of our goals
Essentially, our goal is to subvert chaos.
We do that by creating semi-deterministic systems we can rely on. Determinism is expensive, mostly due to the opportunity costs of losing parallelism, pipelining, and reordering. We try to minimize the amount of determinism we need to keep our costs low, while also avoiding making decisions that will further erode what little determinism we can afford. Thus, the semi- prefix. We just want certain little bits of our code's state to be deterministic, while the computational machinery underneath doesn't have to be completely so. Synchronization of threads is about increasing the order and decreasing the chaos in a multi-threaded system because having multiple threads leads to a greater amount of non-determinism naturally which must be subdued somehow.
In summary, there are three major degrees of effort some body of code can put in to 'juggle knives'--i.e. to work correctly in the context of multiple threads.
The highest degree (thread-proof, etc.) means that a system behaves in a predictable manner even if you call it from multiple threads sloppily. It does the work necessary to achieve this itself so you don't have to. It makes this nice interface for you, the programmer writing calling code, so that you can pretend to live in a world without synchronization primitives. Because it's already included them internally. It's also expensive and slow and also somewhat unpredictable when it comes to how long it takes for tasks to complete due to synchronization it's doing, which must always be greater than the amount you need for your specific program because it doesn't know what your code will do. Great for casual coders who code in various scripting languages to do science or something, but aren't themselves writing highly efficient close-to-the-metal code. They don't need to juggle knives.
The second degree (thread-compatible, etc.) means that the system behaves well enough that calling code can reliably detect unpredictability just in time to handle it correctly at runtime using its own installed synchronization primitives. D-I-Y synchronization. BYOSP = Bring Your Own Synchronization primitives. At least you know the code you're calling will play nice with them. This is for professional programmers working closer to the metal.
The third degree (thread-hostile, etc.) means that the system doesn't behave well enough to play with anyone else and can only EVER be run single-threaded without incurring chaos. This is classic early 90s and earlier code, essentially. It was programmed with a lack of awareness about how it might be called or used from multiple threads to such a high degree that even if you try to add those synchronization primitives yourself, it just won't work because it makes old fashioned assumptions that these days seem anti-social and unprofessional.
However, some code only really makes sense called single-threaded and so is still written to be called that way intentionally. This is true especially for software that already has an efficient pipeline and memory access sequence, and doesn't benefit from the main purpose of multi-threading: hiding memory access latencies. Accessing non-cache memory is ridiculously slower than most other instructions. So whenever an application is waiting for some bit of memory access, it should switch to another task thread in the meantime to keep the processor working. Of course, these days, that could mean switching to another coroutine/fiber/etc. within the same thread, when available, because these are much more efficient than a thread context switch. But once even those are exhausted for the time being, it's time to switch threads executing on our core.
But sometimes, you have all your memory accesses nicely packed and sequenced and the last thing you want is to switch to another thread because you've already pipelined your code to handle this as efficiently as possible. Then threads hurt not help. That's one example, but there others.
In general, I think it makes sense to go for thread-compatible though whenever possible while programming code meant to be called, particularly if there's no real reason not to and it just requires your awareness while coding the thing.
Answer: Thread-safe-code works as specified, even when entered simultaneously by different threads. This often means, that internal data-structures or operations that should run uninterrupted are protected against different modifications at the same time.
Answer: Let's answer this by example:
class NonThreadSafe {

    private int count = 0;

    public boolean countTo10() {
        count = count + 1;
        return (count == 10);
    }

The countTo10 method adds one to the counter and then returns true if the count has reached 10. It should only return true once.
This will work as long as only one thread is running the code. If two threads run the code at the same time various problems can occur.
For example, if count starts as 9, one thread could add 1 to count (making 10) but then a second thread could enter the method and add 1 again (making 11) before the first thread has a chance to execute the comparison with 10. Then both threads do the comparison and find that count is 11 and neither returns true.
So this code is not thread safe.
In essence, all multi-threading problems are caused by some variation of this kind of problem.
The solution is to ensure that the addition and the comparison cannot be separated (for example by surrounding the two statements by some kind of synchronization code) or by devising a solution that does not require two operations. Such code would be thread-safe.
Answer: Simply - code will run fine if many threads are executing this code at the same time.
Answer: Don't confuse thread safety with determinism.  Thread-safe code can also be non-deterministic.  Given the difficulty of debugging problems with threaded code, this is probably the normal case.  :-)
Thread safety simply ensures that when a thread is modifying or reading shared data, no other thread can access it in a way that changes the data.  If your code depends on a certain order for execution for correctness, then you need other synchronization mechanisms beyond those required for thread safety to ensure this.
Answer: Yes and no.
Thread safety is a little bit more than just making sure your shared data is accessed by only one thread at a time.  You have to ensure sequential access to shared data, while at the same time avoiding race conditions, deadlocks, livelocks, and resource starvation.
Unpredictable results when multiple threads are running is not a required condition of thread-safe code, but it is often a by-product.  For example, you could have a producer-consumer scheme set up with a shared queue, one producer thread, and few consumer threads, and the data flow might be perfectly predictable.  If you start to introduce more consumers you'll see more random looking results.
Answer: In essence, many things can go wrong in a multi threaded environment (instructions reordering, partially constructed objects, same variable having different values in different threads because of caching at the CPU level etc.).
I like the definition given by Java Concurrency in Practice:

A [portion of code] is thread-safe if it behaves correctly when accessed from multiple threads, regardless of the scheduling or interleaving of the execution of those threads by the runtime environment, and with no additional synchronization or other coordination on the part of the calling code.

By correctly they mean that the program behaves in compliance with its specifications.
Contrived example
Imagine that you implement a counter. You could say that it behaves correctly if:

counter.next() never returns a value that has already been returned before (we assume no overflow etc. for simplicity)
all values from 0 to the current value have been returned at some stage (no value is skipped)

A thread safe counter would behave according to those rules regardless of how many threads access it concurrently (which would typically not be the case of a naive implementation).
Note: cross-post on Programmers
Answer: To complete other answers:
Synchronization is only a worry when the code in your method does one of two things:

works with some outside resource that isn't thread safe.
Reads or changes a persistent object or class field

This means that variables defined WITHIN your method are always threadsafe.  Every call to a method has its own version of these variables.  If the method is called by another thread, or by the same thread, or even if the method calls itself (recursion), the values of these variables are not shared.
Thread scheduling is not guaranteed to be round-robin. A task may totally hog the CPU at the expense of threads of the same priority. You can use Thread.yield() to have a conscience. You can use (in java) Thread.setPriority(Thread.NORM_PRIORITY-1) to lower a thread's priority
Plus beware of:

the large runtime cost (already mentionned by others) on applications that iterate over these "thread-safe" structures.
Thread.sleep(5000) is supposed to sleep for 5 seconds. However, if somebody changes the system time, you may sleep for a very long time or no time at all. The OS records the wake up time in absolute form, not relative.
Answer: Yes and yes.  It implies that data is not modified by more than one thread simultaneously.   However, your program might work as expected, and appear thread-safe, even if it is fundamentally not.
Note that the unpredictablility of results is a consequence of 'race-conditions' that probably result in data being modified in an order other than the expected one.
Answer: Instead of thinking of code or classes as thread safe or not, I think it is more helpful to think of actions as being thread-safe.  Two actions are thread safe if they will be behave as specified when run from arbitrary threading contexts.  In many cases, classes will support some combinations of actions in thread-safe fashion and others not.
For example, many collections like array-lists and hash sets will guarantee that if they are initially accessed exclusively with one thread, and they are never modified after a reference becomes visible to any other threads, they may be read in arbitrary fashion by any combination of threads without interference.
More interestingly, some hash-set collections such as the original non-generic one in .NET, may offer a guarantee that as long as no item is ever removed, and provided that only one thread ever writes to them, any thread that tries to read the collection will behave as though accessing a collection where updates might be delayed and occur in arbitrary order, but which will otherwise behave normally.  If thread #1 adds X and then Y, and thread #2 looks for and sees Y and then X, it would be possible for thread #2 to see that Y exists but X doesn't; whether or not such behavior is "thread-safe" would depend upon whether thread #2 is prepared to deal with that possibility.
As a final note, some classes--especially blocking communications libraries--may have a "close" or "Dispose" method which is thread-safe with respect to all other methods, but no other methods that are thread-safe with respect to each other.  If a thread performs a blocking read request and a user of the program clicks "cancel", there would be no way for a close request to be issued by the thread that's attempting to perform the read.  The close/dispose request, however, may asynchronously set a flag which will cause the read request to be canceled as soon as possible.  Once close is performed on any thread, the object would become useless, and all attempts at future actions would fail immediately, but being able to asynchronously terminate any attempted I/O operations is better than require that the close request be synchronized with the read (since if the read blocks forever, the synchronization request would be likewise blocked).
Answer: In simplest words :P
 If it is safe to execute multiple threads on a block of code it is thread safe*
*conditions apply
Conditions are mentioned by other answeres like
1. The result should be same if you execute one thread or multiple threads over it etc.


Is there an explanation for Talbot's abilities?

Question: In Uncharted 3, Talbot (Katherine Marlowe's main henchman) appears to have supernatural powers. He suffers no ill-effects after being shot by Cutter, and can jump incredibly high. Is there ever any explanation for these powers?
Answer: During the hallucination sequence in the "Atlantis of the Sands" chapter, Talbot is seen throwing a smoke bomb at Drake. This could mean that Talbot is simply using special effects to give the illusion that he's a ghost, or that he's invincible.

Shot by Cutter

Bulletproof vest

Disappearing around the corner

Smoke bomb

Forcing Cutter and Drake to do his bidding

Sodium pentathol dart, "truth serum"
Answer: I can't recall where he jumped very high, but in the scene where he gets shot by cutter, we don't see any blood, we can assume he was wearing some kind of body armor
Answer: I've heard from several people that he's an illusionist, able to trick people into seeing things. That being said, he's a pretty cool character, but I totally know what you mean. I think when he got shot it was a bullet proof vest.
Comment: but how does talbot dissapear in the scene when he shoots cutter witth that black ops thingy, he just goes in the corner and dissapers


Why do we need high energy to explore small dimensions?

Question: I am taking a quantum physics class, and for the life of me, I can not remember why we would need a vast amount of energy to understand the microscopic universe.
Comment: You must understand that "high energy" in this context usually refers to the microscopic scales (e.g. accelerating a proton to have the energy of a flying mosquito), which might not seem too impressive on the "human scale".
Answer: Frequently one probes matter by bombarding it with radiation or with other pieces of matter, and then looking at the products. This is called a scattering experiment. Since the probe system is quantum, whether or not it is made of light or matter, it is associated with a wavelength. The de Broglie relation tells you that this wavelength is $\lambda = h/p$, where $h$ is Planck's constant and $p$ is the momentum of the probe.
This de Broglie wavelength gives a lower limit to the resolution of the probe. Any feature smaller than this will simply be smeared/averaged over the probe's wavelength, and so will not be visible. For the same reason, normal microscopes only work down to a few hundred nm (the wavelength of visible light). Electron microscopes allow you to see smaller features because the electrons have a smaller wavelength.
Therefore, the smaller the feature you would like to see, the higher must be the momentum, and thus the energy, of your probe system. This is one (oversimplified) reason why the LHC has to be so large and achieve such high energies (relative to usual microscopic scales).
Answer: Apart from the fact that high energies correspond to short wavelengths, as has been explained in the other answers, another reason for studying high energy collisions is noteworthy as well:
Many unstable elementary particles have large masses and, due to conservation of energy, can only be produced by decay from highly energetic systems. Examples include heavy quarks, W- and Z-bosons and basically all hadrons except for protons and neutrons. So if you include knowledge of all elementary particles and their interactions in the category "understanding of the microscopic universe", then this is definitely an answer to your question.
Below you can find a table of the elementary particles and their masses. As you can see, many of them exceed 1 GeV, which is very heavy compared to electrons, which we experience in daily life.
Answer: You have probably seen the relation between energy and frequency for photons $ E = hf$. Since the speed of a photon is $c$, the wavelength is $\lambda = c/f$ so $$E = hc/\lambda. $$ Therefore short wavelengths correspond to high energies.
Comment: While this information is relevant to someone who already knows the answer, this answer is missing an explicit connection to the question.
Answer: The usual method of "studying" something, is to "take it apart" (break it into its constituent parts).  Small "parts" (atoms, neutrons, protons, etc.) are held together by very large forces (nuclear, electromagnetic, etc,).  Therefore, high energies are required to break them apart (so we can study them).


Is it appropriate to use the sentence- " Greetings of the Day" in a formal email instead of Good morning?

Question: I often receive e-mails which start with the sentence- 'Greetings of the day.' instead of Good morning or good afternoon. I am wondering whether it is correct to use this in formal emails and letters.
Comment: It would be out of the ordinary in British English usage.That doesn't automatically mean it is not appropriate in the usage of other Englishes around the world. If you often see it, that might mean it is fine where you are, but if in doubt avoid it, especially in international communications.
Comment: This is probably a mashup of "greetings" and "top of the day".
Answer: If I receive an e-mail that begins with "Greetings of the day", I will assume that it is spam and automatically reach for the delete button. If I am e-mailing someone that I know (or have e-mailed before), I usually begin with "Hi, Fred" (you can more or less say whatever you like in e-mails - there are no rules). If I am e-mailing someone that I don't know, then I might treat it like writing a letter and begin with "Dear Mr. Jones".
If you want me to read your e-mails, always address me by name. However, if you are sending me spam, please do begin with "Greetings of the day" and I'll know not to read any further and press the delete button.
Having said all that, I do receive perfectly good e-mails (from British companies) that begin with "Good morning". There's nothing wrong with it. "Greetings of the day", however, sounds like Babu English and is probably best avoided.
Comment: I'm with Mick. The closest British English to "Greetings of the day" would be "Season's Greetings" or "The top of the morning".

"Season's Greetings" is American. In Britain it's generally heard as very lazy and it would only ever be used in a festival season lasting at least two or three days, ruling out anything "…of the day".

"Top of the morning" is used only with acknowledgement of both speaker and listener that it comes from Irish, whether a translation from Gaelic or  originating in the English spoken in Ireland; so much so that it's usually spoken with a comic-opera accent.
Comment: I tend to think that e-mails (from British companies) that begin with "Good morning" do that because the writers think e-mails don't need to follow normal rules of writing…
Comment: I can't see any mention of **Babu English** in your link, but there is a good description (with examples) here: http://www.bl.uk/learning/timeline/item126856.html
Answer: It definitely sounds like it is from someone from India to me.  I got one today and they signed their name with a very Italian-sounding name, but they were not fooling me.  I live in Italy and I know what a person who normally speaks Italian, trying to write in English  sounds like, and even Google Translate would not say "Greetings of the Day!" No thanks, "Alvaro."
Answer: I'm not sure there's such a thing as a "formal" email.  Email is informal, and generally doesn't follow the rules of formal correspondence.
If you're referring to an email message conveying information of a "serious" or formal nature (e.g., business correspondence rather than casual conversation), it is probably better to keep it concise and just get to the point, leaving out fluff like "Good morning" (which has no relevance, anyway, since you don't know when the message will be read).
But if you do put in some form of such opening text, "Greetings of the day" is such generic blather that people will associate it with spam, as Mick suggests.
Answer: There is no earthly reason to wish someone good day etc. in an email, formal, or informal, just as it has never been the practice (at least in the twentieth century) to do so in a written letter, at least in my experience in Britain.
An informal communication cuts out the superfluous politenesses, which in English are really only:

The address (Dear Sir, Your Lordship, etc.)
The parting phrase (Yours sincerely etc.)

For a formal email (e.g. to a business or someone you don't know) I would retain them.  For an informal email I would start "John" and sign off with "David". If you are a young person "Hi John" might be more usual.
If I wrote "Hoping this finds you as it leaves me" I would be trying to be humorous.
But the French do it differently. It takes years of study to learn how to sign off a letter in French.


Density Functional Theory (DFT) calculation for metals

Question: Why is DFT not used in calculating electronic structures and properties of metals? I know DFT calculations are not accurate for metallic structures. Can someone explain why?
Answer: Density Functional Theory (DFT) is used to calculate the electronic structure and properties of metals as much and "successfully" as it is used for molecules, clusters, alloys, insulators and semiconductors. Of course there are certain things that DFT is good at and can and cannot do. However saying that "DFT calculations are not accurate for metallic structures" is not correct.
Please have a look at the paper published relatively recently in Science with title "Insights into Current Limitations of Density Functional Theory" where the authors say and I quote

What are some of the major failures in DFT calculations? First, they underestimate the barriers of chemical reactions, the band gaps of materials, the energies of dissociating molecular ions, and charge transfer excitation energies. They also overestimate the binding energies of charge transfer complexes and the response to an electric field in molecules and materials. ...all of these diverse issues share the same root —the delocalization error of approximate functionals, due to the dominating Coulomb term that pushes electrons apart. Furthermore, typical DFT calculations fail to describe degenerate or near-degenerate states, such as arise in transition metal systems, the breaking of chemical bonds, and strongly correlated materials. All of these problems are merely manifestations of another common error —the static correlation error of approximate functionals.
Answer: DFT  can  theoretically depict the ground state of any material, however, we can only deal with the  properties of material by using some approximation.   the quality of  your approximation determines the degree of accuracy.


Photo app in Yosemite

Question: I just had Yosemite loaded onto my laptop and there is no Photo app (nor iPhoto). I do have ImageCapture, but I would like to work with my albums in either Photo or iPhoto. Can't find it at the AppStore to download... How can I get one of them? Thanks.
Comment: Which version of Yosemite? Photos came along with [I think] 10.10.3, so if you're below that, I'd suggest the [combo updater to 10.10.5](https://support.apple.com/kb/DL1832) & it should be installed automatically.
Answer: Keep posted for updates!
Make sure you check for updates to your system. Also, upgrade your system to El Capitan to get a better experience and new features.

Photo app in Yosemite


What is this coming off the drainpipe near the p trap?

Question: A small repair is going on, but what is this other pipe coming off the drain pipe near the p-trap?
Comment: From the picture it looks like water would sooner flow down that then out the p-trap outlet?  Is it actually horizontally lower than the p-trap outflow?
Comment: Since you live in an apartment, you should ask the landlord/management. They'll have a far better chance of answering than we will since we can't see the other end of this pipe.
Comment: Is there a dishwasher? Is there a crawlspace below or a basement? This could be waste from a dishwasher.
Comment: Thanks Jim. The dishwasher attaches elsewhere nearer the sink. This is an apartment building, so only apartments below me.
Comment: Yes Fresh, it's lower than the p-trap outflow, so water goes down it. Why have two drains?
Answer: Possibly an alternative form of "trap primer" for a floor drain (or other rarely used device with a trap) that is being kept from drying out.
Each time you use this sink, a little bit of water goes to that trap.
Comment: That seems like it (thanks also P2000). Why there would be one in my apartment on the 6th floor is beyond me.
Answer: Pumped Drain
There are several plumbing appliances that could connect to the drain as pictured, especially if it has a drain pump incl. a pan pump, sump pump, condensate pump:

dishwasher (dismissed already)
laundry machine (less likely, since larger diameter required)
hot water tank pressure relief
heater/furnace condensate
air conditioner condensate

If you have any of these appliances you could see if they have a pump or relief vent attached to similar copper pipe.
Pumped drain lines do not require down-flow gravity.
The other 1/2in pipe may be a hint: is it your kitchen hot water supply?
Grey Water Primer
Alternatively, as suggested in the answer by Ecnerwal, it could be a trap primer.
I had never seen one like this before, but with a bit research it turns out they are not a DIY-jimmy-rig. They are called a "Grey Water Primer".
Here is an example by siouxchief

If you indeed have a floor drain you could test this suggestion by blocking the P-trap entry after that T-coupling, and pouring some water into the opening so that a copious amount flows down this primer line. You would hear or see it arriving in the floor drain. If you pour some herbal tea or soap water, you would smell it in the floor drain.
Alternatively, you can pour water in the floor drain and listen with your ear closely to that kitchen P trap. This is a bit more difficult due to its location under the cabinet.


Is a suitable power adapter for UK also usable for Canada and USA?

Question: I have a power adapter that works for Great Britain. Can I use the same adapter in Canada and/or the USA too?
Comment: Most electronics, including your Mac, include a transformer (the "brick" in a laptop's power cord) that can handle 100-240V and 50/60Hz, so in this case all you need is a plug adapter. Items with motors or heating elements (e.g. electric razors, fans, hair dryers), however, would probably require a separate converter or transformer.
Comment: The current is different; it is mostly 230V/50Hz in Britain and mostly 110-120V/60Hz in the US and Canada. Whether you need a converter, transformer, or neither depends on what your devices/appliances can handle.
Comment: By "adapter" do you mean a simple plug adapter, or a device which also adapts the current itself, like a transformer or converter?
Comment: I'm talking about a simple plug adapter. Do I need something more fancy there?
Comment: I never thought about that. I hope my Mac will run their.
Answer: No, you can't.   They're different types of adapters.
What I do when I need confirmation is to check this website:
http://www.worldstandards.eu/electricity.htm
It has an EXHAUSTIVE list of each and every type, the voltage and the countries that use them. It's been handy for some of the stranger countries I've been to and hasn't failed yet.
Myself, I have a multi-adapter. The only country it doesn't seem to handle is South Africa, which has 3 giant prongs - bigger than the UK ones!
Answer: No, they are different types of plugs. People in the UK need to buy an adapter to get US or other plugs to work in the UK.
Answer: It is not the current that is different between the UK and North America, it is the voltage rating and frequency as expressed in Hertz or Hz.  Many devices can handle a range of voltages from 110 volt through to 250 volt and also varying frequencies. However, you need to look at the supply label on each device you are wanting to use in North America to determine if it is suitable.  You cannot change a 110 volt, (standard voltage in North America), to 220 volt which most all devices in the UK are supplied.  You can however adapt to 220 volt and use a grounded circuit to convert to 110 volt in the UK if coming from North America and wanting to supply North American devices.  You simply need an adaptor.
Comment: I think your answer is a bit long and complex. You probably mean that beyond the different plug shapes, the difference is also the voltage and the frequency, but it is hard to understand from your answer. Please rephrase it, for example you'd better not start it with a negation.


Accidentally recitate more

Question: Assalamu'alaiykum
Is somebody salat valid if someone recite more than needed accidentally?
For example, if someone recite a surah after Al-Fatihah in third rakaah of Isya, even just the basmallah part then he cut it
Or, if someone accindentally recite Shalawat in first tasyahud (For the people who think the tahiyat is enough at frist tasyahud), even if not completed then he cut it
Oh, and is there any difference whether when he accidentally do it when salat in congregation and alone?
Thanks for your answer
Answer:
Is somebody salat valid if someone recite more than needed accidentally?

Yes it is. You might have done something which is frowned upon according some scholars, but it doesn't count as a mistake or something that invalidates the prayer.
Comment: Do i have to do sujood as-sahw if that happens?
Comment: @Bejo no not AFAIK.

Accidentally recitate more


How do I restrict the number of records to be processed in an SSIS package?

Question: I have a table with 7M records I want to trim down to 10k for dev.  I tried a delete, but the whole world was nearly overpowered by the transaction log size, so I truncated the table.
Now I wish to insert 10k records from the original table, into my dev table, but it has a identity column, and many, many other columns, so I'd thought I'd try SSIS (through the wizard), which handles the identity nicely, but gives me no place to edit a query.  So I quickly made a view with a top clause, and changed the RowSet property of the source to the view.  Now everything fails because nothing sees the view, although I copied and pasted the view name from my create view statement, which fails a second time because, lo, the view actually does exist.
Does SSIS define which DB objects are used when a package is created, which would exclude the new view, and if so, how can I refresh that?
Comment: Do the 7 million records represent transactions?  If so, it may make sense to identify a 1000 or so recent customers and then only take their transactions from each table.  If you use random records, then you may only get old style records and incomplete customers.
Answer: There's really no need to use SSIS to do this.  You should be able to insert the records using SQL.  First, you will need to set IDENTITY_INSERT to on.  Then, you should be able to execute something like this:
SET IDENTITY_INSERT db.schema.dev_table ON
INSERT INTO dev_table SELECT TOP (10000) * FROM prod_table
Comment: My problem here is listing all the fields.  I probably could have found a way of scripting them, but was in a hurry to get started and thought SSIS would offer a nice, quick, convenient way.
Answer: Ed is correct, SSIS is overkill for this task - especially as you are only inserting 10K records.
Assuming the DEV table's schema is identical to the production, the script Ed displayed will work just fine.
If the schema is different, you can specify the columns specifically - including the identity column (remembering to set the identity insert OFF afterwards). For example:
<code>SET IDENTITY_INSERT dbo.dev_table ON
INSERT INTO dev_table (Id, Col1,Col2,Col3,Col4)
SELECT TOP 10000 Id, Col1, Col2, Col3, Col4 FROM prod_table
SET IDENTITY_INSERT dbo.dev_table OFF
</code>
Comment: This solution seems to assume Dev and Prod are either on the same server, a linked server has been setup between Dev and Prod, or a temporary database has been created on Prod that will be populated and moved to Dev, or a copy of Prod has been restored to Dev.  Good solution if 4th is true.
Answer: You could also have used the row sampling control to extract a random number of records from the overall data rather than just getting the top 10000 rows.  This would give a better sampling for use in development/testing since you would not be developing against only your 10000 oldest (if your distribution is like most tables I have seen) records, but instead a sampling from across your entire file.
Answer: Did you try closing and reopening the package?  I wouldn't expect you to have to do this though.  My first thought would be it is a security issue - that you haven't granted yourself select on it.
Comment: I went back to the wizard (a longish back an forth process), and redid it with a query to select top 10k, instead of just copying a table.  I must still check how the second package differs from the first.
Answer: Are you using the fully qualified name to the view?  Doe sit have a different owner than the default owner?  OPen up the data source and do a preview of the data to make sure it's all hooked up.


why does the distribution of height follow Normal Distribution?

Question: The height of a class of students in a school is said to follow Normal Distribution. We know that the domain of a random variable that follows Normal distribution is said to range from minus infinity to plus infinity. But height can never attain a negative value. So how can we say that height follows a Normal Distribution?
Comment: Said by whom?  What is your evidence that height follows a normal distribution?
Comment: What probability does this particular distribution assign to having a negative height?  How many people would that translate into?
Comment: Using [this website](https://investing.calsci.com/statistics.html) our author approximates a $6\sigma$ event (above 7'4", below 4') to occur once in every 1 billion people born.  Quite unlikely.
Comment: Normality is a model, and we should not confuse that with a fact; such statements are typically a rough (if often useful) approximation.
Answer: It is just an approximation, a generalization so that a high-school statistics classes may take samples of their friends in an interactive classroom activity.  It also serves as a nice introductory lesson for these statistics classes, showing the prevalence of the normality assumption in real-life and how close a Gaussian actually comes to modeling real datasets.
According to Wikipedia...

Height is sexually dimorphic and statistically it is more or less normally distributed, but with heavy tails. It has been shown that a log-normal distribution fits the data equally well, besides guaranteeing a non-negative lower confidence limit, which could otherwise attain a non-physical negative height value for arbitrarily large confidence levels.

Also, according to this site (which also makes sweeping approximations and generalizations like the one you are concerned with)...

Note that this density is not Gaussian at all. Instead, it is very flat on top. You might reason that since the average of normal random variables is normal, adult heights should be normal. But we don't have an average, we have a mixture. The density for the general adult population is a mixture of the male and female distributions. If you assigned a height to married couples as an average of the husband's height and the wife's height, the resulting value would be an average than a mixture and would follow a normal density.

Here is a link to an article based in mathematics criticizing the very assumption you are questioning.  Quite a nice article, especially the beginning parts.
Answer: For many statistical analyses the exact distribution is not so important. You could call these analyses robust to the exact shape of the probability distribution. For instance, in regression analysis the distribution of the errors $\varepsilon$ is not so important for estimation of coefficients $\beta$:
$$y=X\beta+\varepsilon$$
Even for estimation of uncertainty $\sigma_\beta=var[\beta]$ of coefficients the exact distribution of errors is not important in many cases.
Since the exact distribution is rarely known it is important that the statistical methods are robust to the choice of the approximation of these distributions. Otherwise, your results become unreliable. I suppose for many techniques in your field the approximation of the height as a normal variable is good enough. It is quite unlikely to encounter a high schools student who is 1 inch tall. The standard deviation of the height distribution is tight enough to make such a probability near zero, and the exact probability is not important. It's important to capture the approximate shape of the distribution in the range of values that matter.
Having wrote all of this, I must warn that sometime the shape of the distribution in tails does matter. One such case is the financial risk management. In this field one must be careful to consider the so called fat tails. Again, we usually do not know the exact shape of the tails of the probability density function, but we know that Gaussian distribution is often not fat enough in its tails. Choosing Gaussian approximation can lead to underestimation of certain risks, and potential for big financial losses. In this case we often pick other approximations that have fatter tails, such as Student t.


macOS – Create an icon for all of one file type

Question: How can I set an icon for a specific file type to be used for all of those files on macOS Sierra? (not High Sierra).
I have seen some tutorials, most of which do not help, including a very in-depth tutorial, that is unfortunately outdated (TextMate now uses standard XML but I don't really undertstand the language), and I cannot follow.
The files that I would like to change are .3dsx files, .cia files, and .3ds (second type) files. I know the trick where you select the item, press CMD + I and click on the icon and paste the icon, but that only changes the icon for that item, and I would like to change the icon for all files. I already have the icons ready, I have no problem with creating the files.
There's one problem, though. These three file types are not openable by any programs I have. macOS lists no programs to open them with, and I do not know of any programs that can open them, and this is why I cannot use any of the aforementioned tutorials.
Thanks in advance.
Comment: The icon is dictated by whichever program opens the file right? Then couldn't you change the icon for the program of a given file type?
Comment: Read above. "these three file types are not openable by any programs I have."
Answer: You can use the RCDefaultApp preference pane to associate any file type/extension with the application of your choosing. The file type/extension will then use the icons associated with the selected application.
While the RCDefaultApp is very old it still works well on macOS 10.12
The duti library can be used to set default applications on macOS as well.


Relative paths from file for img, a and header

Question: I have a dynamic website that can be accessed as domain/categories or domain/categories/article, and it redirects to domain/index.php?category/article.
The problem I'm facing is that I want to use relative paths from the files. I managed to do that for includes with dirname(FILE), as in
ini_set('include_path',  dirname(__FILE__) . '/include');

This works fine.
 Depending on the directory I will change it to, and it also works
ini_set('include_path', dirname(__FILE__) . '/../include'); (extra /../)

But if I try to do the same with img src, A href or php Header, while I get the correct file path to the images or links, they simply do not work. Nothing happens as if I didn't click at all.
    Clicking on a link generated through php with:
print "";

Does not work, even if the html source code is reading as:

How can I make the path to the img, link (and php header) relative to the file location, and no the url, and make it work?
Side note: even my CSS brakes if I acess my site through domain/prettyurl/, but not if I access through domain/prettyurl (no ending slash), pretty weird.
Comment: I noticed that in your link you have some forward slashes (/) and some back slashes (\)... I think some browsers are ok with the backslashes but you probably should really change those to forward (/) slashes... I don't think this is likely to be the problem but probably worth changing (that could have just been a typo in your example)
Answer: it looks like you are running your php on a localhost so
dirname(__FILE__)

is returning a directory
ie "C:\validation..."
try using
 "'http: //' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/include'"

as your include path
Comment: dirname($_SERVER['PHP_SELF']) might do the trick (combining both as you did repeated part of the address twice.)

I will try using your solution for both localhost and online and report results later

. Btw, the include itself is working fine (so far) with dirname. Its the images, href links and header redirection that weren't
Answer: Got it working on local host AND online, here is my setup so:
1) You may use it yourself
 2) Give a better alternative to us newbies
I used what zoranc said above. For example, to get CSS to work on the dynamic-pretty-url pages, I set it up as:
<?php
print "<link href='http://" . $_SERVER['HTTP_HOST'] .'/' . dirname($_SERVER['PHP_SELF']) . "/CSS/main.css' rel='stylesheet' type='text/css' />";

?>
WARNING: the code above will produce links such as  Domain///CSS. I still need to filter the extra slashes out, but it works even as it is for the CSS and everything else (img, a, php headers)
Then I had to do this everytime I wanted to:

Create a dynamic link
Create a dynamic img
Even for my header form! Since my header is always included, when you are browsing pretty-urls, your form can't have action='header.php', because it will then try to find it on whatever pretty-url you are currently browsing (domain/category/article and so on). You'll have to use header='" php the solution we are discussion/header.php endphp.
Again, be warned this produces extra slashes and you'll have to remove them somehow.
With this setup you can have a site that works on your localhost and any web host without the need to change code, but it is somewhat cumbersome and error prone to use. If anyone has a better solution please share.
This works well enough and in my opinion is definitely better than having to change code when you upload your site everytime, which is even more error prone I suppose.
Thanks again Zoranc, really helpful.


Calling Java web service from .Net

Question: I need to call Java web service from .Net application and that web service should accept the parameters from .Net but am not sure about the procedure. If anyone have some idea then please let me know.
Comment: A web service is a web service is a web service. The implementation language is irrelevant. This question is really `How do I call a web service from .Net?`
Answer: .NET web service is SOAP web service. Just get WSDL, generate stubs and use it.
Answer: You should get the WSDL first, then using Eclipse (I would suggest Netbeans) you generate/create the Stubs and call the service. It is really nothing fancy at all. Once you have the WSDL the rest (how you generate the classes using Netbeans) is really covered a lot online.

Calling Java web service from .Net


Cheapest tickets on WIZZ AIR

Question: I'm willing to buy flight tickets from wizz air. During the last week the price changed many times and I wonder how can I predict when will the price drop again (now they are pretty high).
Does anyone know when they release thr cheaper tickets?
Carmen
Answer: Usually the cheap airlines adapt their pricing to demand, so basically they are trying to set the price as high as possible while selling all the tickets at the same time. So it is usually not possible (or very hard at least) to guess when the prices will go up or down.
In general they tend to be higher during peak times (school holidays, events, bank holidays, etc.). From my own (limited) experience during these times the tickets are more expensive even when released and the price rarely falls.

Cheapest tickets on WIZZ AIR