What are some good in-depth resources for learning Sound Design?

Question: I have searched the whole net millions of times to find some useful up to date resources regarding Sound Engineering. I am looking for some practical resources for self studying Sound Engineering. Indeed, I have found lots of videos on Youtube(Such as this) and other media repositories which will talk about Synthesizers and the way to play with bunch of knobs. But those tutorials don't tell you why you should do such thing. Indeed, what I am mostly curious about is what those knobs are actually doing and how I can change their functionality to do what I DESIRE TO DO. My goal is to be able to make the sound I hear in my head. I have found some books on the NET which try to discuss things in tool lengthy, boring, impractical way!
I use FL STUDIO as my DAW and I have access to a bunch of synthesizers inside it. Harmor is one of them. But still I haven't found clear explanations about the capabilities of this Synthesizer in a way which makes me to be able to fully control it as I desire. I have seen some synthesizers(Harmor included) give you the ability to drag and drop a picture into it and edit sounds via picture. I seriously don't understand how such thing is possible and what is actually going on behind the scenes. Even a general picture would be helpful.
I do really appreciate if somebody helps me with this question.
Answer: To fully understand this subject takes years of learning and experience. You have to start at the beginning. My advice would be to find good books and study these subjects:

Read this book by Martin Russ; Sound, Synthesis and Sampling and use it as a reference for the next bits..
Synthesis basics: Analogue additive/subtractive synthesis Learn exactly how every component works.
Learn about Frequency/Amplitude/Ring/Sync modulation and how they are used in synthesis. Find examples of how these techniques have been used in popular songs of the past.
Next, learn about original Polyphonic synthesizers, how and why.
Learn about Modular synthesis.
Learn about MIDI and the MIDI spec.
It's important to now learn how these components really work; Analogue R/C circuits and basic electronic principals. You don't need to be an electrical engineer, just be average or above at maths. This book by T.L.Floyd will help you (I haven't got the book with me now so I can't list chapters to read, but basically any chapters on the basic stuff which I think is 2/3 of the book). Use this time to learn about logic gates, crossovers and transformers too.
Learn how each component in a synth from the 80's like the Jupiter8 works. Understand it completely. Find the circuit diagram for it.

As I'm writing, I realise how broad this question is...

Use a virtual synth creator like Reaktor (Reaktor is the one I know and love; users may want to mention better ones in a comment). Use it to create each of the devices you have learned about so far. This is a fulfilling, informative experience if you understand the components.

When you have learned the basics I recommend you move onto these more advanced subjects:

Learn how microphones and speakers work. Dynamic/Condenser mics etc.
Learn how ADCs and DACs work. Sample Rate and Bit Depth and the compromises.
Learn the basic scientific principals behind sound propagation and traversal through different mediums. I'm sure there are good books out there. Maybe request a book recommendation on Physics.stackexchange if it's on-topic there.
Learn about the "waves on a string" principals; this is very important. Make sure you completely understand it. After this, look into "standing waves in a room". Books, not forums!

By now, approximately one or two years of fulfilment should have passed by and you should have learned the basics and have a better understanding of the subject. You can now freely look into things like how IL's Harmor works behind the scenes. Look into other, newer technologies and what you have learned will tell you how they work.
I've missed a lot of stuff out because otherwise, I'd be here all day. I tried to leave all of the basics in. You'd be better off finding an in-depth course somewhere to be honest. Make sure it includes(at least) the stuff I've mentioned here though.
Comment: @Mac W What an answer! You have pointed important stuff. Thanks. BTW, if you can update the post from time to time I would be happy to hear more from you. Again, thanks!
Answer: Marc w is right. It takes years. I've been studying audio engineering for 14 years including 4 years formal training acquiring a BSc and an MA. And there is still so much to learn you'll never learn it all. I concentrate now on sound design for film and have abandoned such things as musical theory and music production and music recording as I simply will not live long enough.
Answer: Ditto other comments but you can fast track on sound engineering by taking the FutureLearn course CRITICAL LISTENING FOR STUDIO PRODUCTION  (Free, 6 weeks, 8 hours per week).  this is a beginners course for sound techs.
My own experience started with listening to lots and lots of tracks of different genres to get a feel of how music is put together.  Listen to each of the sounds and imagine how you would create them.  Then try to create the sounds you really like using your own instruments.  Its frustrating and challenging but persist and you will get a good result.  I prefer hard-Outboards because I find it easier to work with.  DAW VSTIs however do give you repeatability.


Sending an image file via a HTTP get or post from SketchUp

Question: So this particular programming conundrum I find myself in is quite a bit above my Ruby skills or any programming skills in general I guess.
Using an HTML (Post) form I am able to upload an image to my server side CGI script and from there I am able to take the data and then save it on my server. The bones of HTML required to do this, with all of the formatting fluff stripped away is essentially:
<form enctype="multipart/form-data" action="logoupload.pl" method="post">
    <input name="imagefiletoupload" type="file">
    <input id="newlogo" name="imglogo" value="Update Logo">
    </form>

I really don't understand how this works, other than the HTML form is able to select the file from the client end and then transfer it to my CGI/Perl file (logoupload.pl). On the server end I have some code in place that checks for errors, size etc… and then saves the file to the directory of my choosing.
This is all good, I can make this work.
Now what I want to try and do is within Ruby (given a path to an existing image file) send that image file to my same server side CGI script using some type of GET or POST call.
I have no idea how to do this.
My typical way I make calls to my server (or any other website address) is something like this:
 some_url = "http://design.medeek.com/resources/somescript.pl?var1=#{@Var1}&var2=#{Var2}&var3=#{@Var3}"

    require 'open-uri'

    begin
        open(some_url) { |io|
        url_response = io.read

        # Then parse the response with some code here or convert JSON to ruby array etc...

    }

    rescue StandardError => e
        UI.messagebox ("Unable to connect to server, action aborted.")
    end

How would I send an image via a URL call like this? Or is there a better way to do this?
So far I have no idea how to program this.
Comment: Just for reference the full Ruby language is embedded within SketchUp so my back end code that I am working with is Ruby.  My CGI scripting on the server end is Perl, but this shouldn't really matter in my opinion, so long as I send it a valid call.
Answer: Try this:
require "net/http"
require "uri"

uri = URI.parse("https://your-backend-url")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
request.body = url_response
request["Content-Type"] = "multipart/form-data"

http.request(request)


in Elementary OS 6.1 how to configure Gmail?

Question: I find it very difficult to configure my gmail currently in 2022, how do I solve this?  since I don't even have two-step verification activated.  Thank you
Answer: I deleted their mailbox and installed thunderbird mail. Works perfectly.
Answer: Here is a step by step guide :

Go to your google account (user icon upper right of chrome or google.com)
Click "Manage Your Google Account"
In your account settings click on Security tab
Scroll down to "Signing in to Google" section
Click "App Passwords"
You will have to login with your google password again, for security
Add a new app specific password for Elementary Mail.
Then make sure you copy it to your clipboard
They will not show it to you again

(?) You may also want to save it somewhere in your
password manager / list.

Use this password when adding your gmail account in Elementary.


Inside a trigger create database is not working

Question: I tried using trigger concept. If any new row inserts in the user table my trigger will fire and try to create a dynamic database for that new user. But Inside a trigger create database is not working. How can get it done. Can anybody have any suggestions.Please help of on this
Comment: I'm not certain, but I would wager you're not allowed to run DDL (Database Definition Language) statements inside of triggers -- it would seem to me to be an invitation for security holes...
Answer: As the documentation says (under Trigger Limitations):

The following Transact-SQL statements are not allowed in a DML trigger:
  (...) CREATE DATABASE (...)

There are further limitations, consulting the documentation is highly recommended.
This all means, to my understanding, that you should solve this problem at application level*: check whether your user is successfully created, and then issue a CREATE DATABASE statement.  Preferably these two are enclosed in a transaction, so that either both succeed or both fail - this way you can be sure that your data are in a consistent state.  You may have to issue a DROP DATABASE if the transaction fails.  (Thanks to Jon Seigel for pointing this out.)
*: From this point of view, the 'application' may be a T-SQL block of code (or a stored procedure) as well.
Comment: `CREATE DATABASE` can't be put in a user transaction because it affects things outside the database engine. See the Remarks section [here](http://msdn.microsoft.com/en-us/library/ms176061.aspx). I agree with the rest of your answer, though, so +1.
Comment: @JonSeigel Thanks for your notice.  Does this mean that you can't even enclose it in a transaction started by a database abstraction layer?
Comment: A DAL merely *abstracts* the database operations, it doesn't perform any special behaviour. In theory, a DAL could roll it back, but it would have to be coded to manually execute a `DROP DATABASE` command, as a `ROLLBACK` won't work.
Answer: You do not want to provision a seat for your new tenant in a DML trigger. For one, provisioning is usually lengthy and you do not want to block the DML, and likely the HTTP request for new user onboarding behind it. You want to be able to create and onboard the user, then start the provisioning process. If the provisioning goes awry, you can resolve the problem with offline intervention later, and you have the user record to contact and to notify that the account is now properly provisioned (ie. you do not lose a customer). The second reason is the problem you run into, namely that some provisioning operations are simply not do-able from a DML trigger, and as things will evolve and your architecture becomes more complex the provisioning will become more complex (eg. load balance the account resources).
The universal solution is to decouple the two and use queues. The account creation drops a message into a queue to request provisioning the account. A queue monitoring process kicks off (after the user account is committed!) and does the necessary work, asynchronously. SQL Server can handle this via Service Broker and internal activation. This is much better than doing it at application level because is reliable (ie. if the user stops the page load during the account creation, which in turn triggers a cancellation of the application processing the HTTP request, it does not leave an orphaned non-provisioned account).
Comment: Very important points!
Answer: I would question this whole design.  Even if you could create a database, it won't be being backed up, so what's the point of it?
Is there any reason your user needs a whole database?  How about just having normal tables, with a userId or userName column, so if there is user-specific data they need, they can just query the relevant table filtered by userId/name.
This has a number of advantages, including (presumably) your database being backed up and maintained as part of a regular maintenance plan, non-proliferation of the same objects over multiple databases.
Have you mentioned this design to your DBA?  I'd be keen to know what they think.
Comment: Both approaches (shared db vs. 1 db per tenant) have pros and cons. Think about systems where tenants can opt in for schema upgrades. Shared db. and scoped queries ([act_as_tenant](https://github.com/ErwinM/acts_as_tenant) like) tend to be favored  at the low end spectrum, while 1 db per tenant tends to be favored at the enterprisey high end of the spectrum. All in all is a separate debate though. And btw provisioning that configures maintenance (ie. regularly backs up the account db) are rather the norm than the exception.
Comment: There definitely are multi-tenant databases around, just think of SaaS.


What can I do to to store/save a list of Class on Windows Phone 8.1?

Question: I have a small Project. I want to write a Windows Phone Application which stores a List of Items.
I tried to save the list as a XML document using Linq, that worked fine on a PC but i got a problem with the
<code>XDoc.Save();
</code>
On PC I could use a String but on Windows Phone I need a Stream or a XML(Text) Writer but I have no idea how I can do this.
I tried to save a .txt file too, I always get the same exception and have no idea why.
<code>#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
        UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached)global::System.Diagnostics.Debugger.Break();
        };
#endif
        }
    }
}
</code>
If someone knows a way to store the List items. Please Help me.
Answer: To save to a file under Windows Phone 8.1 you have to use a StorageFile object. Here is an example:
<code>      using System.IO;  // needed for OpenStreamForWriteAsync()
      ....

      StorageFile storageFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("myfile.xml", CreationCollisionOption.ReplaceExisting);
      using (Stream stream = await storageFile.OpenStreamForWriteAsync())
      {
          //try XDoc.Save(stream);
      }
</code>
to read a file:
<code>        StorageFile storageFile = await ApplicationData.Current.LocalFolder.GetFileAsync(FILENAME);
        using (Stream stream = await storageFile.OpenStreamForReadAsync())
        {
            var XDoc = System.Xml.Linq.XDocument.Load(stream);
        }
</code>
Comment: Thanks for that. But what what should i use for reading the XML?
XDoc.Load(storageFile.???)


Selecting overlayed colors/objects in Illustrator

Question:
I've created a (very) large image in illustrator, a portion of which is shown. There are numerous circles on top of each other with their transparencies set to multiply (so that Yellow over Cyan produces Green - similar to a color halftone effect).
I've used pathfinder to divide all the shapes (and ungrouped).
I would now like to select all the visibly different color shapes and place on different layers (so C, M, Y, K, C+M, C+Y, M+Y, etc).
When I go to Select>Same>Appearance or Fill, I am only able to select the base color (C,M,Y or K), not the Greens (C+Y) or Reds or Purples.
Is there any way to 'combine' the C+Y (etc) so it becomes a single color to select? (Or another way to achieve the same effect?)
Obviously, I could manually select individual objects, but the size of the image actually makes this next to impossible. TIA!
Answer: Select all your shapes and go to Object> Flatten Transparency. This will "bake in" the blend mode color so that you can then select these shapes with Select> Same Fill Color. This will group everything so you can un-group if desired (Object> Ungroup).
This will leave the underneath shape intact but will divide the upper shape (the one that had the blend mode applied) into 2 separate shapes- so the Pathfinder divide step would be unnecessary.
The down side to this is that you would not be able to move things around afterward so I would suggest copying all your shapes before you do this to a new locked layer so you can access them again if needed or save an extra copy of the document prior to flattening.
Comment: That's exactly what I needed! (I was worried I might have to do this manually.)  Thanks so much!
Answer: Perhaps you should check Layers panel, because "Select same .." doesn't work if the whole layer is highlighted.  In order to work properly,  object should be highlighted as well as selected.  That is that blue highlight in Layers panel. Those are two separate things.  So,  select object,  and make sure it's also highlighted in Layers panel, and then go to Select same appearance.
Comment: Interesting- my select same worked from the Select Menu>select same or from the control bar select same every way- with the entire layer highlighted, or with nothing highlighted in the layers panel, or even when the objects were on separate layers- not sure what is going on with your AI- I am on AI 2020 on a mac- just sayin'......


skipping characters with printf

Question: I'm trying to write a program which would write on the console at a very specific position in the screen. Say for example from column 20 to column 39.
After each write, the line is "reset" thanks to the \r parameter. This ensures that the line remains static and only the specific fields are updated.
Problem is, i can instruct printf to write from column 0 to 19 without erasing the rest of the line, but it seems i'm not able to instruct printf to write from column 20 onwards without erasing in the process columns 0 to 19.
Is there a (standard) way to do this ?
using something else than printf is possible.
[Edit] I've read there is a gotoxy() function in C which is available for windows apparently, and can be emulated in Linux using ncurses. Is there any problem with this function ?
Comment: `\r` does not mean *reset* but *carriage return*.
Comment: yes, thanks for the reminder. I know, it's just that in this context, `\r` serves this purpose.
Comment: What Operating System do you use? For UNIX-like there is the curses- or ncurses-library.
Comment: Primary target OS is windows. Linux comes afterwards. I would prefer to avoid using an external library.
Answer: AFAIK there's no standard way to do this because there's no console behavior standarization (eg Windows' console does not behave like Linux's)
Answer: According to ANSI documentation, you can use "\033[1;20H" to position the cursor.
It will move the cursor to the needed position. The values 1 and 20 are the row and the column, just change it to position correctly your print.
Or you can try with only "\033[20C" to move your cursor to column 20.
Comment: Thanks for the tip Cédric. Unfortunately, it did not work. I guess this could be because it needs ANSI.SYS driver loaded.
Answer: You can try printing as many backspaces (and spaces to clear old text) as needed to position the cursor.
No guarantee it works for you ... if it does: no guarantee it works on the other computer :)
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(void) {
  int i, k;
  time_t oldtime = time(0);
  if (oldtime == (time_t)-1) {
    fprintf(stderr, "time function does not work on this machine\n");
    exit(EXIT_FAILURE);
  }
  while (time(0) == oldtime) /* void */;

  printf("fixed stuff: ");
  for (i = 1; i < 6; i++) {
    int val = pow(10, i) * i;
    printf("%d", val);
    fflush(stdout);
    oldtime = time(0);
    while (time(0) == oldtime) /* void */;
    if (i < 5) {
      for (k = 0; k < i + 1; k++) printf("\b \b"); // go back; erase; go back again
      fflush(stdout);
    } else {
      puts("");
    }
  }

  return 0;
}

It works for me, on both Linux and Windows computers
Comment: OK, this is the better work-around so far. It's not that easy though, since i would like to have several processes updating their fields on the same line. With the `\b` command, i can at least come up with a 2-fields line mechanism. But for 3 and more, it doesn't work.
Answer: I have had the same trouble before. I used gotoxy() when I coded in TurboC++.
Check this out. Looks good.
http://www.daniweb.com/software-development/c/code/216326#
Answer: Why Don't you just sprintf (myStr,.... and build the line in memory then output it in one go?
You could keep the fields you want from the previous update.
Comment: Several different processes are writing on the line. It's not a single program.
Answer: Marc Rochkind wrote a realy good book which is the leading reference on the subject! Advanced C Programming for Displays: Character Displays, Windows, and Keyboards for the Unix and Ms-DOS Operating Systems

skipping characters with printf


Dryer with one wire connected to water pipe does not work after replacing copper pipe with pex

Question: I have a dryer with a 3-wire power cord. One wire was fastened to a copper water line. I replaced the copper water line with pex tubing and now the dryer won't work.
Comment: Looks like an open neutral and ground was taking it's place, which you lost when you removed copper pipes. Can you take a picture of your outlet, how it's wired ?
Comment: Yes, can we have a photo of the inside of the receptacle box please? Also, does the wire that was going to the pipe go to the receptacle box, or somewhere else?
Comment: Yes it was open neutral had a professional come run new wire to breaker box. Thank you so much for all the insight!!!! Dryer working!!!!!
Comment: @RandallRAndrews, thanks for the update!  This question needs more upvotes.  Great to see a safe resolution.
Answer: Danger!
A 3-wire dryer connection has two hots & neutral. It does not have a separate ground.
A 4-wire (required for all new installations for many years now) has two hots, neutral and ground.
The only time you should have a wire connected to copper pipe (and even then, it is limited for various reasons) is ground. Never neutral. So you appear to have two problems combined:

Neutral from dryer treated as ground by connecting to copper water pipe
Pex doesn't conduct so it is not a valid ground path

A typical US residential clothes dryer uses neutral for controls & lights, possibly the motor. It does not use it for the main power draw - the heating element. As a result, it can "kind of squeak by" but in a dangerous way if instead of ground on neutral (the usual 3-wire way, now deprecated) you have neutral on ground. When you made the ground no longer work (because pex doesn't conduct), instead of just losing ground (a safety issue) you also lost neutral (a functional issue).
In a way, this is a blessing in disguise, because you have found a major safety issue before it had the chance to kill anyone (seriously!).
Get this Fixed Properly

Replace the 3-wire cord from the dryer with a 4-wire cord
Remove the jumper wire in the dryer that connects ground & neutral (if you can't figure out how to do that, post the model # and we can probably figure it out)
Replace the 3-wire receptacle with a 4-wire NEMA 14-30:

The hard part: RUN A NEW 4-WIRE (2 HOT, 1 NEUTRAL, 1 GROUND) CABLE to your electrical panel. Normally this will be 10 AWG for 30 Amp. The problem is that based on what was previously done - routing neutral as ground - it is really not clear what you will find when you get to the electrical panel. I recommend posting a picture of the electrical panel showing the current dryer circuit breaker before doing any work so that we can review it for other possible issues.

In some cases if running a new cable is not a simple thing to do (e.g., different part of the house) there are ways to run ground separately through another path. However, that is dependent on ground being the only problem. In this case, all indications are that you only have 2 wires - not 3 - going back to the electrical panel, in which case taking care of ground through an alternate method will not solve the problem.
Answer: Pop the covers and see what you have
We're interested in what's happening at both ends of the dryer cable: The service panel end (maybe the neutral wire got corroded), and the receptacle end (maybe the wire has an issue).  We need to salvage all 3 of the following wires:

Hot L1 (typically black)
Neutral (white or gray by law; except for SE cable (bare wire woven around 2 hots).
Hot L2 (typically red or black; yes, both can be black; white only if SE cable).

And we want to see 120V between neutral and L, and 240V between L1 and L2.  Somewhat lesser voltage won't do; that is phantom voltage.  117V is within normal tolerance, 109V is not OK and is just phantom voltage.
What if my neutral is bare?
If it's a solid or stranded wire, that's no good.  That's a ground wire.   You cannot use that as a neutral.
However, if the bare wire is a bunch of strands woven around the two other conductors (often black and white), that is SE cable, and you get to exploit a statutory exception where you get to use the bare strands as a neutral, but then, not ground:

Mark any white wire with black tape (it's a hot).
Gather the woven wires and insulate thoroughly; it must not touch ground!
Do the same in your service panel. Watch for someone letting the cable clamp touch the bare wires; insulate that.

If you don't have the right voltages
Then you look closely at the wires in the panel to see if you see any damage.  If you do, try to repair it.  Then you follow the cable to the extent practicable from the panel toward the outlet, looking for any physical damage.
If you find physical damage at the outlet, you can try tracing the cable back toward the panel, and look for another place to put an outlet that is along the cable.    You would need to fit an junction box here, assuring at least 7" of spare length of good cable inside the box. I recommend using a steel, 4" square deep junction box, either embedded up against a joist, or just surface mounted. (rather than the bakelite style recep you have now; which is unfit for the ground retrofit we'll probably do).
If all that fails, the cable is done for.  You will need to pull a new 10/3 cable from the service panel to this location.
Anyway, if you're sitting there happy-dappy with two colored wires and a white wire with all the right voltages, now we go on to phase 2.
Phase 2: Making it live/safe
In all cases, you'll be hooking up a NEMA 14-30R receptacle.  You'll be jumpering the dryer for a 4-wire plug, with the neutral-ground interconnect removed.  If you have 4 wires that all work -- hot, hot, neutral and separate ground (I assume you had to pull a new cable), then you're at the end! Victory!
All other options assume you have 3 wires: 2 hots and a neutral.
Option 1: GFCI
Here, we fit a 2-pole GFCI breaker ($90) to replace the dryer breaker.  We label the NEMA 14-30 receptacle "GFCI Protected. No Equipment Ground."   And we're done.
Failure mode here is if you touch the washer-dryer chassis at the same time, you get lethal shock for about 3 milliseconds, the GFCI trips, and you don't die.
The downside of this method is that if your appliance develops a ground fault, it will keep tripping the breaker.  This is the safety device actually working, so it's hard to complain about that. But it won't happen with a proper 4-wire connection, nor with an old 3-wire connection (though the latter might murder you).
Option 2: Retrofit a ground wire
NEC 2014 liberalized -- actually I think earlier NECs permitted this.  You can keep the hot-hot-neutral you already have, and retrofit the ground wire.  This can follow any viable route back to the panel.  It doesn't actually have to go all the way back to the panel, if it can find any of:

A junction box that is grounded and whose wires have a large enough ground wire (we're talking  10 AWG) back to that same panel.  You can't steal this from common receptacle circuits which have #12 or #14 wire.
A junction box with continuous metal conduit back to that panel; nonflexible or AC allowed; other flexible types not allowed.
Any part of the Grounding Electrode System - the bare copper wires going out to water pipes or grounding rods.

You are not allowed to use a random water pipe for ground. One guess why.

Option 3: Pull a new 10/3 NM or UF cable
the entire route from the panel to the dryer outlet.
Go over the rest of the house with a fine tooth comb
The last electrician was obviously a horrible shortcut-taker.  This thing was practically a booby-trap, with the installer clearly oblivious to the lethality of a neutral failure in a 3-wire dryer connection.  Take it to the bank that the house is full of other booby traps.
Therefore I recommend to you what I usually recommend to the over-ambitious: Make yourself a wiring expert.  Have your new favorite thing be getting a book from the library on home wiring and devouring it cover to cover. Get 5000 rep here.  Make yourself a subject expert on home wiring.  Then go through and inspect every single box in your house.
Noting the 2-prong outlet below, this would also be a great time to avail yourself of the 2014 code and retrofit grounds!
I had the occasion to do this when we acquired a factory building for pennies on the dollar.  Oh man -- MWBCs with 3 hot wires on them (no, not 3-phase panels), fan and furnace circuits stealing neutrals from other circuits in different services, therefore returning current via the building frame... it was uggggggly.  Also, made me learn about (and concede the usefulness of) multi-wire branch circuits - I thought they were more wiring incompetence at first.


How do I create custom Controls for my VS2005 toolbox?

Question: Ok, this question might more about design theory.  I have successfully created controls that show up in my toolbox, so I'm pretty sure I have the process right.  Also, my "AutoToolboxPopulate" is set to true, so things are showing up as I create them.  My question is this: I'm sub-classing a native Control for specialized use.  When I derive my class from an exposed concrete class, such as BulletedList, my custom Control appears in my Toolbox.  However, when I drop it back to the parent, such as ListControl, my Control is not listed (actually it's grayed out when I "List All").  What am I missing?
Answer: I think the answer is that there must have been a problem with my code.  I did eventually get these to show up, and it may have been an error somewhere.
However, here's an important tip:  In order to get custom server controls to show up in your toolbox, you have to load your page into "design" mode.  This will update the toolbox list.  (apparently, it's necessary for the document outline, too)


Reacquiring a Pennsylvania driver's license

Question: I had to surrender my Pennsylvania license when I acquired my Norwegian driver's license. If I move back what is required to get my Pennsylvania license back.?
Comment: I do not know, but the answer might depend on the expiration date of your original license.
Answer: You can go to the DMV and begin the renewal process the next time you're in Pennsylvania. You will require your social security card, and some proof of a Pennsylvania address (A few pieces of mail which comes in your name to whichever PA address you're using). I did this last summer and I did not have to provide my old PA license. You can't do the 'online renewal' and you may need to go through the process of claiming a lost license, but you should be able to go to the DMV and do the whole thing in a few hours.
Whether you have to go through the 'lost license' or 'license renewal' process is up to your local DMV (the website even tells you to go there and ask). You won't be able to do the process online, but as long as you have all the documentation, you should be fine to do everything in person.
There is a rule which states that your license cannot have expired more than 6 months in the past, but it was not being enforced when I went through the process recently. I hadn't had a PA license in about 10 years. However, YMMV.
https://www.dmv.org/pa-pennsylvania/renew-license.php

Reacquiring a Pennsylvania driver’s license


List of all possible melodic sequences (2-note, 3-note, etc)

Question: Does anyone know where I can get a list of all possible 2-note, 3-note etc melodic sequences? I could use a script to generate them myself, but if someone else has already done the work this would save me a lot of trouble.
Comment: By the time you add timing into the equation, there are hundreds of thousands - the main reason why there are so many different melodies! A possible task, but then what happens to the data?
Answer: There was an attempt of "Copyrighting all the melodies to avoid accidental infringement", see this TED-talk:

The numbers are huge!
Answer: Such list will make lot of sense, because when you have this catalogue you can decipher and recognize written music much faster (sight reading! (like reading entire words than spelling the letters like a 6 years old child that starts reading.) That's is like a kind of meta or makro reading.
You can make your list yourself: It will also be a good ear-training, if you try to imagine with your inner ear the sound by singing and playing them (solfege). You can write a matrix with letters or numbers and also using the abbreviations of minor (m) Major (M) dim. and aug. naming the standard intervals  - just to have the inventary - but much better is you notate them in sheet music!
2 tones:
There are 12 intervals up and 12 intervals down = about 48 intervals
3 tones:
After each interval you can add an other one of this 24 intervals, so you'll have 24 steps for 2 tones and 24X24 for 3 tone melodic motifs. (about 600 combinations).
If you ignore the rhythmic motifs you will have a list of about 600 combinations. Many of this motifs you can ignore because they are rarely used in music. (theory and practice ;). Finally it would be interesting to have a statistic of the most applied motifs.
I haven't made such a list but I can always represent it in my mind.
I'm very interested in your solution, as I am looking for something similar, as I want to name them by their shape and figure like the neumes in Gregorian chant have been characterized or the ornaments like trills, mordent and praller. But there will be longer motifs than only 3 tones.
Maybe this idea will help us making such a list:
Describing them
- as changing notes,
- passing tones,
- chord tones, (harmonic reduction to the chords from which this motifs come from,
- than scales
- typical head motifs of songs  or compositions.
On my way to find such figurations I came to the theme of musica poetica and have found the book of   Dietrich Bartel with all the terms of music motifs and right now I 've found this book by A. Beyschlag
Die Ornamentik der Musik
as I have found out that the elements and figures I am looking for to characterize and label them are a part of the ornaments in  music.
Look up ornaments in wiki and also  figuration.


Does signing out of FaceTime disconnect your Apple ID from a specific device?

Question: I used my Apple ID to sign in only to FaceTime on my friend's iPad device. Later I went to Settings → FaceTime and clicked Sign out. Does that mean that this iPad an my apple ID are now completely disconnected? Or is there a chance that my friend can get my FaceTime calls or even my iMessages etc.?
Answer: Yes - tapping the sign out button disconnects FaceTime. The messages app uses a different account unless you set them all up using iCloud preference or a setup assistant screen to log into all icloud services with one Apple ID.
As long as you signed out of the FaceTime portion of the settings app - more deliveries won't happen to that device.
as long as you didn't sign in to the iCloud settings or anywhere else - you should be safe with no data of yours on that device other than for the moments you allowed it.
Comment: Cheers @user172240 and Welcome to Ask Different. Be sure to use the vote / accept marks so that others will know your issue is solved without looking in the comments section :-)


Does my Canon dRebel fully support the 600EX II-RT and ST-E3-RT?

Question: Will using a Canon T3i as a body with the 600EX II-RT & ST-E3-RT limit the transmitter or speedlite from full potential use? Does this body fully support the external equipment?
Answer:
Does this body fully support the external equipment?

The EOS Rebel T3i/600D fully supports the capability of the Canon ST-E3-RT other than being able to only use two groups instead of the three supported by the transmitter when used with other Canon models that support 3 groups.
The Canon ST-E3-RT, however, does not fully support the capabilities of the EOS Rebel T3i/600D.

Based on what little information the EOS Rebel T3i/600D Instruction Manual provides, it appears that Canon includes a more or less full external flash control menu under [Shooting (red) tab 1 → flash control → external flash func. setting] and [Shooting (red) tab 1 → flash control → external flash C.Fn setting]. This menu is used to control external flashes directly attached to the camera's hot shoe as well as off camera flashes controlled by either a directly connected "master" flash or by a wireless optical or radio transmitter.
There are at least three limits imposed by Canon when using the EOS Rebel T3i/600D with external speedlights controlled by using the camera's menu via the radio-based ST-E3-RT or the previous optical-based ST-E2. The first two are the case with all current Canon cameras, the other is only the case with Canon cameras released prior to 2012 (which includes your EOS Rebel T3i/600D). Each of these limits can be circumvented by using a Yongnuo YN-E3-RT transmitter instead of the Canon ST-E3-RT.
Full Group control
None of the menus built into the various Canon bodies allow for fully independent group control of external flashes via the camera's menu with a Canon controller, either the radio based ST-E3-RT or the older ST-E2. The controls on both ST units also limit fully independent group control. This, however, can be circumvented by using the Yongnuo YN-E3-RT instead of the Canon ST-E3-RT. The Yongnuo "clone" allows one to fully control each group independently of the others.
From a YN-E3-RT announcement at Flash Havoc:

Group Mode functionality is a big advantage in the Canon RT system, as it allow access to 5 groups (instead of just 3), but most importantly it allows the mixture of ETTL and Remote Manual groups used at the same time, which can't otherwise be done without access to the Group Mode. Any group can be set to set to ETTL / Manual / External Auto / or OFF. Flash Exposure compensation (FEC) can also be set by group, which is generally much more intuitive than Canon's old ratio selection.

Even with a compatible external flash on the camera's hot shoe controlling off camera flashes the Rebel T3i/600D can only control up to two groups. Many other Canon models allow only three groups. With the controls on the YN-E3-ST you can set five groups fully independently of each other. You can use different modes, such as E-TTL or Manual Power, for each group. You can also set each group to different FEC values (for each group set to E-TTL) or manual power levels (for each group set to manual power) without having to use Canon's A:B C ratio settings.
2nd Curtain Sync
Canon does not allow second-curtain sync when using external flashes controlled by the ST-E3-RT (or the optical ST-E2). The option is greyed-out in the camera's flash control menu. Using a YN-E3-RT the controller can be used to set second-curtain sync. When second-curtain sync has been enabled via the YN-E3-RT controller, the new setting is accurately reflected on the camera's control panel! Of course with most Canon cameras, any shutter time shorter than 1/30 second results in first-curtain sync even if second-curtain is selected via the camera's menu. But at longer shutter times it can be quite useful!
Sync speed
Canon cameras released prior to 2012 have a shortest sync speed of one stop slower than the camera's rated X-sync when using the ST-E3-RT. Even though your EOS Rebel T3i/600D is capable of 1/200 second X-sync with hotshoe mounted flashes, using the ST-E3-RT will limit you to shutter times of 1/100 second or slower. Again, the YN-E3-RT removes this limit and allows you to use the 1/200 X-sync that your camera is capable of using.
Other benefits of the YN-E3-RT that the ST-E3-RT lack are:

A USB port that allows firmware updates to the flash controller
An AF Assist emitter on the front of the controller
Control Canon RT compatible flashes from the YN-E3-RT in manual mode when shooting with a NON-Canon camera.

For additional reading regarding the differences between the Canon ST-E3-RT and the Yongnuo YN-E3-RT:
Yongnuo YN-E3-RT vs. Canon ST-E3-RT
YN-E3-RT – Adds GR Group Mode for Pre 2012 Cameras!
YongNuo YN-E3-RT – Now Available!
YN-E3-RT – Adds Remote Manual for NON Canon Cameras!
Yongnuo YN-E3-RT vs Canon ST-E3-RT Speedlite Wireless Tra...
Comment: It's been years since I've seen an ST-E2. My memory must have been playing tricks on me again. Of course the ST-E2 has controls. It was introduced when EOS film cameras had no "menu" with which to control a flash!
Answer:
Will using a Canon T3i as a body with the 600EX II-RT & ST-E3-RT limit the Transmitter or Speedlite from full potential use?

Yes.
But it may not matter if you don't need those features.

Does this body fully support the external equipment?

Yes and No. It does support the equipment and is compatible, but cannot do all the features in the ‑RT system.
It is a pre-2012 body (i.e., was introduced before the RT gear hit the market), and therefore does not support all the new features that were introduced with the -RT system.  Group ID codes, Gr mode (where you can individually assign groups as M or TTL and turn groups on and off), and using the flash as your shutter remote with an ST-E3-RT on-camera, etc. are not something this camera body's menus and hotshoe can do.
It can do pretty much everything you can do with the optical wireless system, though. You can still control three groups (if not five) in Manual or in TTL with ratios.  And you should have HSS, TTL, and remote power control over radio.


How Secure are Virtual Networks

Question: When using a Virtual Network, is it possible to infect the underlying Network infrastructure with malware from the Virtual Network.  How safe is the use of Virtual Networks?
Comment: From your question it is not clear what do you mean by "virtual network". There are several common possible meanings: [virtual LAN (VLAN)](https://en.wikipedia.org/wiki/Virtual_LAN), virtual network implemented by a [hypervisor](https://en.wikipedia.org/wiki/Hypervisor), or [virtual private network (VPN)](https://en.wikipedia.org/wiki/Virtual_private_network).
Answer: Because virtualization software is not perfect, it is in some cases possible to escape out of the virtual environment and do bad things on the host.  It is important to keep your virtualization (and other software) up to date, because security patches to prevent this attack are sometimes released.  I believe that malware could indeed then be put onto the host network if other vulnerabilities were exploited.  So, yes, I believe it would be possible... however, it would be very difficult.  This would be a significant hurdle that should keep most attackers out of the host network.  I believe virtual networks are a great safety measure to take, as long as the security implications are considered.
Another attack to consider (not quite malware on the host network) is a Denial of Service (DoS), or Distributed Denial of Service (DDoS) attack in which network traffic is flooded.  If the virtual host shares the same network resources with the host network, then if the virtual network is flooded with traffic, it would also flood the host network, bringing both to a crawl / halt.
Answer: Short answer: no. The hosting network can't be affected from within a virtual network.
A bit longer answer: by design, a virtual network should be considered a sandboxed virtual environment within a physical implementation of a networking environment. You can't break out of the sandbox. So the hosting network can't be infected by the virtual network.
Wether the hosting network can see the traffic in the virtual network depends of your virtualization choices. For example a VPN tunnel can't be accessed by the hosting network. A VLAN without further security measurements is transparent to the hosting network.
Of course, with the "if properly implemented and maintained"-disclaimer. Be aware of 0-days (unpatched security leaks), configure the network properly (eg: set resource limits) and keep everything patched with the latest security updates.
Comment: Never say never :-)  There have been vulnerabilities that allow escape from the virtual environment, and if one of those is exploited, I am sure the host network could then be impacted.  Another attack I can think of is a denial of service (DoS).  If your virtual network and host network use the same bandwidth, ad DoS (or DDoS) could then affect both the host and virtual network (depending on network implementation).  However, I do believe the virtual network provides a pretty good separation from the host network and would be a significant hurdle for an attacker (depending on implementation).
Comment: But with your last paragraph, your answer is "yes". A properly patched machine is still subject to 0-days.
Comment: Agee. Added a "if properly implemented and maintained"-disclaimer.
Comment: Thanks for your help this together with Jonathan's answer really cleared up things.  Best Regards.

How Secure are Virtual Networks


How do i tighten my sprocket with these bolts?

Question: Here is the photo of my sprocket. After adjusting the chain slack and axle, I can still hear a bit of grinding sound. Maybe because the chain is hitting the outer side of the sprocket (you can see the smooth sides of sprocket teeth). It appears to be a bit loose but I have no idea how to tighten those bolts. I mean do i tighten the 2 bolts on the side or do I need a special tool for the center thing. Please help.
Comment: On my bikes yes, this allows for imperfections with the chain or movement due to torque etc.  Add the model of your bike and year so we can look up any manuals about it too.
Comment: is your chain correctly aligned?  - can you take a picture from the rear of the bike showing the length of the drive chain.  The middle part is the drive from the gearbox and cannot be tightened, the two outer bolts should already be tight and are the ones that hold your sprocket on to the drive shaft.
Comment: @Mauro Thanks for replying and the info. Id have to get back with the pic tomorrow as its already night here. Is it normal that the sprocket wiggles a bit?
Comment: Honestly, I don't how you would know anything is wrong with that sprocket specifically without knowing what is causing the grinding noise. The sprocket looks normal to me. The teeth wear like that normally from the chain passing over it. Why do you believe it is this sprocket causing the noise?
Answer: You cannot actually tighten it to the shaft, those 2 bolts just hold the retainer plate, this is all that keeps the sprocket from coming off. Once the plate is removed you can slide the sprocket off of the output shaft.
Sprocket and output shaft are machined for a tight slip fit, so if there is play either the sprocket is worn, the output shaft is worn or both. Remove the Sprocket and inspect for wear, replace worn part(s).


Maths behing implementing temperature compensation on a signal

Question: I have a fluid pressure sensor (blue line) whose measurements are affected by outdoor temperature (yellow line). So there is a 12 hours cyclic component (day/night) in my pressure measurements. How can I use the temperature variable to compensate (or "decycle") the pressure readings accordingly? I'd appreciate if you could direct me in the right direction, what are the mathematics concepts to look at?
Comment: Unless you know what pressure you were actually supposed to be measuring, that graph isn't too useful because other things could be changing the pressure reading (like the actual pressure or whatever phenomena the pressure is reflecting) along with temperature. So you would need to connect the pressure sensor to a known, constant, quantity and measure how the reading responds as the temperature changes. Then you can start compensating.
Comment: Assuming you can separate real pressure variation from sensor response variation as DKNguyen mentioned, the first thing I would do would be to plot these two variables using a **scatter plot**.
Answer: You can start with a regression analysis, but there's a lot of noise in the signals and you'd be better off with larger datasets and/or cleaner data.
Comment: Thank you, with about 40000 data points I have a nice quadratic fit. I use a one week moving average of temperature to calculate delta with actual temp and use the fitting equation. Seems correct so far.


Image Recognition between 2 images vb.net Lockbits

Question: I was in the process of using Pixel to do my search between a large image and a small image.  I got that one to successfully work but am having trouble getting the lockbits version to do what I want it to do.
Fist I want to loop through the large image finding the first pixel of the smaller image inside it. Then once finding the first pixel to do a math equation to tell me what percentage of accuracy it got off it.  In doing so if it meets the criteria to move my mouse to that location on the screen at the first pixel (top most left) of that small image inside the large image.  Which works with a great rate of success and is extremely fast compared to GetPixel format.
Problem Cannot get location on the large image of where the beginning Pixel of the small image is and move the mouse to that location.  Below is the code:
<code>             Try
        Dim ifnd As Boolean = False
        Dim PreviousX As Integer
        Dim PreviousY As Integer
        PreviousX = MousePosition.X
        PreviousY = MousePosition.Y
        Dim MatchCount As Integer = 0

        Dim oX As Integer = 0
        Dim oi As Integer = 0
        Dim iX As Integer = 0
        Dim iY As Integer = 0
        Dim bmp_original As Bitmap
        Dim ImG As Bitmap
        ImG = PictureBox2.BackgroundImage
        bmp_original = ImG
        Dim bmp_large As Bitmap
        Dim SmG As Image
        SmG = PictureBox1.BackgroundImage
        bmp_large = SmG
        Dim bmg As Bitmap
        'large image
        ImG = BBt
        'small image
        bmg = Abt
        Thread.Sleep(1000)
        'large image
        If BBt Is Nothing Then
            Dim xbit As Bitmap = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)

            Dim g As Graphics = Graphics.FromImage(xbit)
            BBt = xbit
            g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size)
            g.Dispose()
            Thread.Sleep(2000)
        End If

        'small image
        PictureBox5.BackgroundImage = Abt
        'large image
        PictureBox6.BackgroundImage = BBt
        'For value As Integer = 0 To 5
        'For value As Integer = 10 To 0 Step -2
        Thread.Sleep(1000)
        'original image
        Dim oRect As New Rectangle(0, 0, bmg.Width, bmg.Height)
        Dim oBmpData As BitmapData = bmg.LockBits(oRect, ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format24bppRgb)
        Dim oPtr As IntPtr = oBmpData.Scan0
        Dim oPixels(99) As Integer
        Dim oMaxPix As Integer = bmg.Width + bmg.Height
        Marshal.Copy(oPtr, oPixels, 0, oMaxPix)
        Dim smWidth As Integer
        smWidth = bmg.Width - 1
        'small image
        PictureBox3.BackgroundImage = bmg
        'large image
        Dim lRect As Rectangle = New Rectangle(0, 0, bmp_large.Width, bmp_large.Height)
        Dim lBmpData As BitmapData = ImG.LockBits(lRect, ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format24bppRgb)
        Dim lPtr As IntPtr = lBmpData.Scan0
        Dim PixelCount As Integer = ImG.Width * ImG.Height
        Dim lPixels(PixelCount - 1) As Integer
        Marshal.Copy(lPtr, lPixels, 0, PixelCount)
        'large image
        PictureBox4.BackgroundImage = ImG

        Dim MathScore As Integer
        Dim MaxScore As Integer = bmg.Height

        'beginning of Marshal Loop
        For i As Integer = 0 To lPixels.GetUpperBound(0)

            If oPixels(0) = lPixels(i) Then
                'we have a match for top left pixel - so compare the other pixels
                Dim PixelsToLeft As Integer = (i Mod ImG.Width) - 1 'pixels to left of 10by10 section of large image
                Dim PixelsToRight As Integer = ImG.Width - PixelsToLeft - smWidth 'pixels to right of 10by10 section of large image
                Dim d As Integer = PixelsToLeft + PixelsToRight 'array distance between right edge of 10by10 section and left edge of next row

                For y As Integer = 0 To 9
                    For x As Integer = 0 To 9
                        Dim oIndex As Integer = (y * 10) + x
                        Dim lIndex As Integer = (i + (y * (d + smWidth))) + x
                        If oPixels(oIndex) = lPixels(lIndex) Then
                            MathScore = MathScore + 1
                            xx = oPixels(0) + 2
                            yy = lPixels(i) + 3
                            SetCursorPos(xx, yy)
                        End If

                    Next

                Next
                If MathScore >= Val(MaxScore / 2.5) Then
                    SetCursorPos(xx, yy)
                    Dim percent As String
                    Dim myDec As Decimal
                    'inttemp = (intData2 * 100) / intData1
                    myDec = Val((MathScore * 100) / MaxScore)
                    myDec = FormatNumber(myDec, 0)
                    percent = myDec & "%"
                    Label16.Text = "Match Score: " & percent
                    Label17.Text = "Math Score: " & MathScore & " out of " & MaxScore
                    Me.ToolStripStatusLabel2.Text = "Completed"
                    Me.Button4.Enabled = True
                    GoTo Foundit
                End If
            End If
        Next
        PictureBox1.Image = (Abt)
        PictureBox2.Image = (BBt)
        ImG.UnlockBits(oBmpData)
        bmg.UnlockBits(lBmpData)
</code>
Foundit:
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
        Catch
        End Try
Now if I could figure out how to get the mouse to move on the screen then I would have figured it out.  Unfortunately I have been working on this for several days without any success.  If you could help I would greatly appreciate it. Thank you in advance.
Answer: to move the mouse do this
<code>dim a as new point
a.x = "the number you want"
a.y = "the number you want"
windows.forms.cursor.position = a
</code>


Import file cx_Freeze

Question: I have a problem, everytime I use python setup.py build, it doesn't import the all files, like ws.ini, tcl.dll, tk.dll and etc.
And whitout this files my app.exe doesn't work.
I tried to copy and paste these files and the application works normally, but I need a way to import automatically.
Thanks.
import sys, os
from cx_Freeze import setup, Executable

os.environ['TCL_LIBRARY'] = r'C:\Users\matheus.sales.GTONIATO\AppData\Local\Programs\Python\Python35\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Users\matheus.sales.GTONIATO\AppData\Local\Programs\Python\Python35\tcl\tk8.6'

build_exe_options = {
        "packages": ["os", "configparser", "glob", "xml.dom", "lxml"],
        "includes": ["lxml.etree", "lxml._elementpath"],
        "include_files": ["img/logo.png", "README.md", "ws.ini", "tcl86t.dll", "tk86t.dll"]
    }

base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(
    name="myapp",
    version="1.0.0",
    description = "Web Service My App",
    options = {"build.exe": build_exe_options},
    executables = [Executable("interface.py", base=base)]
    )

Answer: What is the exact error?
Having just spent ages trying to get cx_freeze to work, I found you need forward slashes for the environment variables & you need to give a path to include_files. This works for me:
import sys
import os
from cx_Freeze import setup, Executable

os.environ['TCL_LIBRARY'] = 'C:/Program Files/Python36/tcl/tcl8.6'
os.environ['TK_LIBRARY'] = 'C:/Program Files/Python36/tcl/tk8.6'

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"includes": ["tkinter","unguilded"],
                     "packages":["tkinter"],
                     "include_files":["C:/Program Files/Python36/DLLs/tcl86t.dll", "C:/Program Files/Python36/DLLs/tk86t.dll"]}

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(
    name = "Scraper",
    version = "0.1",
    description = "Scrapper",
    options = {"build_exe": build_exe_options},
    executables = [Executable("Scrape.py", base = base)])

Import file cx_Freeze


Replacing both 3-way switches I found 2 hot wires one in each box

Question: Since the new switches were not same make\model as the old ones I had to remove both switches (6 wires) and test for the hot wire and I found 1 hot wire in each to the 2 boxes.  Now what?  It seems which ever way I install only one switch truly controls the light.  Let me say again, there is a hot wire at the top of the stairs and a hot wire at the bottom of the stairs and one light half-way up the stairs.
Comment: Did you photograph the original wiring or at least record it? If so, please edit that information into your question. If not, please photograph the wiring, looking into the boxes and add those photos into your question.
Comment: You need to look at the existing switches and identify the common wire, versus the 2 traveler wires.  Normally common is black and travelers are brass.  For most installations, the 2 travelers will be the same color at both ends.  Further, the 2 travelers are *always* in the same cable.
Comment: Can you provide us with photos of the insides of the boxes involved please?
Comment: When you see something like this and you're not sure what you're looking at, turn off every breaker except the one feeding that circuit.  See if you still have two hot wires.  If you do, find everything else in the house that still has power.  You should be able to figure out where the back fed wires go to/come from.
Answer: Two ways to connect 3-way switches and load. Firt feed and load in same junction box. Second feed and load connected in different boxes. In second only three wires run between boxes: two travelers and one phase return. So two wires live voltage.


Restoring Minecraft PE world

Question: My daughter had a Minecraft PE world saved in the Files app on an iPad. How can she restore it to a fresh reinstallation of Minecraft after the game was uninstalled? Note that she could not sign in to Microsoft and had to create a new account.
Comment: Have you seen this post? https://gaming.stackexchange.com/q/238485/163757
Answer: Welcome!
If the backup is saved in the Files app, try this:
You will need...
The apple device (Duh)
A computer with iTunes installed
A data-transfer cable (The one that came with the device will work)

Plug the device into the computer and open iTunes
Click the phone/tablet icon that appears in the upper left of the screen. It may take a few minutes to show up
Select "File Sharing" from the left-hand menu
Select "Minecraft", select the "games" folder and select "Save File" (You may also want to backup this folder just in case something goes wrong)
Select "Files", then locate the backup folder and save it as well.
Using the file explorer on the computer, copy the backup folder into the "minecraftWorlds" folder (Located within the "games" folder you downloaded.)
Back in iTunes, select "Minecraft" again, then "Add File", upload the modified "games" folder containing the new backup.
Eject the device and test.

Restoring Minecraft PE world


is it acceptable to use ThreadPool in a library?

Question: is it acceptable to use ThreadPool in a library?
because that obviously might cause some unpleasant problems if the user of your library is using ThreadPool as well (due to ThreadPool being a static class of course)..
what's the convention?
Answer: Yes.I think it is appropriate to make use of the ThreadPool in library code. Even if the user may use ThreadPool outside, ThreadPool is still good enough to tune itself.
On the other hand, as a library developer, you should provide flexibility: user may choose to use ThreadPool, a specific thread(s), or even a 3rd party thread pool implementation.
Answer: Yes.
As long as it's well documented, and you provide methods to allow the user of the library to control the threadpool, such as min/max threads and maybe the option to not use a threadpool at all.
You should also make it very clear which exposed parts of your library are threadsafe and which are not.
Answer: ThreadPool is designed to be used by multiple components simultaneously.  So it in itself presents no particular problem if used from your particular library.
What can be a problem is threading behavior in general in your library.  It must be clearly documented what the threading semantics of your library are.  How these threads are created and used should should be an implementation detail.  The ThreadPool itself shouldn't present a problem unless one of it's inherent properties (COM apartment affinity, inability to cancel threads, etc ...) presents a problem for your API or consumers.


Clustered index size requirement

Question: I have a HEAP table with no indexes (on SQL Server 2012 Std). I need to create a clustered index on an INT column. There are ~1.2 billion rows and the int column is nullable and not unique. I'm struggling to figure out how much space this will take up in the filegroup. Could someone advise please?
Edit: I'll sort in the tempdb by the way
Answer: When you create a clustered index this "replaces" the heap so there are no extra index pages as such (aside from the upper levels of the b-tree), and as you have absolutely no other indexes there is nothing else to affect the size of.
Therefore if your target column already exists I wouldn't expect very much extra space to be permanently taken unless you have fill factor set to something other than full (for example with a fill factor of 80% the new index would leave approximately 20% of each leaf page spare for later additions).
Some extra space may be used as the heap is rebuilt as a clustered index so your database may need to grow to accommodate this, but any such extra space will be free for future allocation once the process is complete.
For an example, see Index Disk Space Example in the product documentation.
There is even more detailed information in the Online Indexing Operations in SQL Server 2005 technical article (despite the name, it covers offline operations as well).
Extra
It could take less space than before as you have noticed. You may have had a lot of part-used or empty pages due to deletes and updates over time. Heaps do not release the space used by empty pages created by deletes unless TABLOCK was specified at the time of the deletion, and even then not always. From DELETE (Transact-SQL):

When rows are deleted from a heap the Database Engine may use row or page locking for the operation. As a result, the pages made empty by the delete operation remain allocated to the heap. When empty pages are not deallocated, the associated space cannot be reused by other objects in the database.

There may also have been a small amount of space used by forward record pointers (which don't exist in clustered indexes), and if your rows are of variable length blocks of space in pages that are too small to use for new rows. Your newly reorganised rows will be more tightly packed (fill factor settings permitting) so may well use fewer pages.
Comment: It finally finished - it actually looks like it's using up much less space than before, which is great. It's worth pointing out that I used about 250GB in the tempdb and then an additional ~250GB in the filegroup (presumably the temp table?). All this space is freed now however.
Answer: As mentioned in MSDN:
You can use the following steps to estimate the amount of space that is required to store data in a clustered index:

Calculate the space used to store data in the leaf level of the clustered index.
Calculate the space used to store index information for the clustered index.
Total the calculated values.

Also, you can refer to this article Heaps in SQL Server: Performance, Maintenance, and Your Sanity, which helps how to identify heaps, how to measure their size, and how to plan a change to convert your heaps to clustered indexes.

Clustered index size requirement


How to get music metadata in Banshee?

Question: I'm using Banshee 2.2.1 on Ubuntu 11.10. When I tried to import my music library, which I
made by ripping CDs with Windows Media Player, only two albums retained their information. The rest (about 300 songs) were dumped into the unknown artist, unknown album folder. All of them have names and some have genre information. The two albums mentioned retained everything: artist, album, names, art, etc. I am not completely sure with what I ripped these albums.
Answer: If you select the Unknown Album of the Unknown Artist, Banshee will display the corresponding track-list (which should contain all the unidentified tracks you imported).

Select all the unknown tracks which you believe belong to a same album (using shift+left-click or ctrl+left-click), then right-click to get the context-menu. In this menu you will choose Edit Track Information:

You will then see an Edit Track Information dialogue, where you will be able to edit your metadata manually:

There are also plug-ins to fix metadata.
Comment: Thank you for the answer, but I'm afraid that'd take quite a long time. There are 300 songs after all. I'm trying to convert the library to mp3s and adding tags right now. I hope someone else will be able to use your beautifully formatted advice.
Comment: @valtteri read the last line again, about the plugins. This will automate the process.
Comment: @valtteri: perhaps you should consider re-doing the ripping process differently, with a different software, in case the data was lost during that process?
Comment: Thanks for the help. I did read the link, but wasn't in the mood for creating accounts. I converted everything into mp3 (from wav) and tagged the information on the files themselves. Now everything works fine. I used SoundConverter, Audio Tag Tool and Easytag (for cover art) from the Ubuntu Software Center in case anyone is interested.
Answer: Try using EasyTag, it is a ver easy to use metadata manager/editor. You can edit many files in one step. I have around 3000 music files, all edited with it.

How to get music metadata in Banshee?


How do you convince your publisher that your story is good?

Question: Any suggestions on how to convince your publisher that your story is good, and that it would be a good idea to publish it?
Comment: Got any particular length in mind?  Short stories you just send, and they'll make up their own minds.
Comment: some clarification would be good - do you have a specific case in mind ("the publisher said X in my rejection letter")?  In some cases rejection letters give you exactly what you need to change to get things published.  Is there a genre you are discussing?  A publisher you already have a relationship with?  Are you just casting a wide net across many publishers and getting frequently rejected?  Is this a theoretical question?
Answer: If the publisher does not want to publish your story, then at least one of these is true:

The goodness isn't in the text.
The text is good, and the publisher doesn't recognize it.
The publisher's idea of "good" differs from yours in ways that matter.
The publisher has reasons that outweigh the goodness of your story (e.g. more than enough stories that better fit their needs).

I'd focus on #1. To convince the publisher, you'd have to say something that isn't in the text. If there's something relevant to say that isn't in the text, that is a sign that the text does not yet sufficiently convey the goodness.
My advice for #1: Improve the story.
As for #2, proceeding under the assumption that the publisher doesn't recognize the goodness of your story is fraught with peril. If the assumption is true, that means they don't know what they're doing. If they do know what they're doing, then your attempt to persuade will be at best a waste of time, and at worst insulting.
My advice for #2: Whenever you catch yourself imagining that a publisher just can't see the goodness in your story, try to find another interpretation. If you can't find another interpretation, reconsider whether you really want to publish with a publisher who doesn't know what they are doing. And make note of how often you insist on this interpretation.
As for #3 and #4, those are all signs that this is not the right publisher for this story at this time. If a story comes close to meeting a publisher's needs, they'll usually tell you that, and clearly. Otherwise the story probably is not within range of persuasion.
My advice for #3 and #4: Seek publishers whose current skills, preferences, and business model match your story more closely.
Answer: There are many ways to impress a publisher.
The most obvious and effective way is to show them that you're a professional. Make sure your manuscript and cover letter has been proofread and edited. Make sure there aren't any typos or glaring editing problems, those are sure signs that you're not a professional. Make sure you have a neutral third party go over your manuscript and give opinions and look for errors. Your close family and friend don't count, they're going to tell you the love it and that's not what you need. Never /ever/ send them a first draft. You should go through at least a half dozen drafts before you even consider sending it to a publisher.
The next step is to make sure you do your homework about the publisher. Make sure they accept the genre of manuscript you have. Don't send a mystery publisher your romance novel. Also make sure that they are accepting manuscripts. Some publishes only accept new submissions at certain times of the year.
If the publisher does reject your manuscript, move on. Don't try and argue with them, you're not going to win and you'll be making sure that they never want to publish anything of yours. And publisher do speak to each other. Especially in the smaller houses, at lot of staff work for multiple publishers. So if you make an ass out of yourself to Publisher A, and they happen to work for Publisher B and C as well, you can bet they've passed along the memo to them not to consider you. A lot of editors and publishers have blogs and Facebooks, and you can bet there will probably be a post saying "Guess what this jackass just said to me..."
In general, acquisitions editors know what they're doing. If they reject your manuscript, it most likely means they don't think it will sell very well with them. Most of the time (unless you make a jackass out of yourself like I mentioned earlier) rejections aren't personal. Publishers are in it to make as much money as they can and if they don't feel they can make money off of your manuscript, they won't try.
And don't let that discourage you. 99% of writers have tons of rejections under their belt before they finally get an acceptance.
Answer: For nonfiction, write a good proposal.
I searched the web for an explanation of what publishers would expect in a proposal and created mine from what I found. Basically I used a one page explanation of my idea and why I was the best person to write it. To that, I added a ten page chapter-by-chapter description of the entire manuscript, and then three sample chapters. This was my proposal.
I started sending it out with a one page cover letter where I tried to offer a short reason why I was sending to the particular editor/agent. Use a spreadsheet to track who you send it to and when you sent it. If you don't hear back in 6-12 weeks, assume the worst. Always try to keep it out to at least two or three at a time. If someone rejects your work (or the time to live on the proposal expires), have a few places in mind where you can send it next. Look for similar works from small publishers and query them.
This is what worked for me. A small publisher who had published a similar title picked up my book on the basis of the proposal. I'm almost finished writing the first draft. It's tentatively titled Dopefiend (apologies to Mr. Goines) and forthcoming from CRP in Sept 2011.
Answer: Start a blog and post an excerpt from your story in serial form on the blog. Do some minor promotion but don't go overboard. Gather thousands of readers for your blog who post comments like, "I'm really into this story. Hurry up and post the next installment!"
Then go to the publisher and show them a Google Analytics report of your blog's traffic and say, "Here's hard proof that people will respond to this story. Look at all these readers and comments."
Comment: This strikes me as being way out of the league of most amateur writers. Building up an audience is _tough_. And if the piece is good enough to hook all those fans, and the author is good enough at promotion to get the word out to all those fans, then really, they won't have much trouble with the publishers in the first place.


UPBGE how to replace emptys with list or dictionary

Question: I'm trying to make an Openworld game. I have a script that turns all objects to emptys to but the ground,player and camera to save space,then use a pool to call objects to positions in the world where emptys are close enough to player and once out of range send them back to the pool.At first it works well but since emptys are still objects once it gets to 5000 the game will crash. Is there a way to efficiency look through a list or dictionary for world positions in specific range and place correct objects there? (Please help if can)
Answer: https://blenderartists.org/t/how-to-add-objects-once-in-range-from-dictionary/1422979 I found the answer to my question here.
Comment: Hi, Strawberrydshake !  Glad you got an answer! BSE answers form an archive, they can't rely on links alone, because they might break. Please add a summary of the solution here, enough for other users to benefit from.


Is the CiviCRM WhatsApp integration extension available now?

Question: Is the CiviCRM WhatsApp integration extension available now and how do you integrate CiviCRM with WhatsApp?
Comment: Curious, what does an extension like that do?
Answer: User 'sluc23' created a 'whatsapp' extension: https://civicrm.org/extensions/whatsapp but there is no content.  That sometimes happens when someone intends to publish an extension but doesn't get round to it.  I'd suggest asking on the ~extensions channel on https://chat.civicrm.org
Answer: iXiam has self-funded and developed the WhatsApp extension and it is near ready to be deployed to a few organizations. However, it requires a fair deal of setup and integrating with a provider to be able to send messages; it's not just plug and play. With that said, we are open to publicly releasing the extension if there are parties that want to put funding behind it to cover the development cost and steps to making it public.
Feel free to get in touch with us for a demo: https://www.civi-go.net/en/contact.
Comment: Does the end-user need WA Business (which no one uses) or does s.he receive the message on his normal WA app but the organization needs a WA Business account or number to be able to access to the WA network?
Comment: Only the organization needs a WA business account.
Comment: great to know. I'm asking a few clients if they would be interested in adding WA to their CiviCRM.
Comment: Have you done any progress with the extension?


How does the combination of lens create a sharper image?

Question: There's a line in a book which states that the combination of lens helps create a sharper image, but I don't understand how. Does more magnification mean sharper image?
Comment: TLDR: In compound lenses (i.e., lenses made from more than one lens _element,_) one element can somewhat compensate for the defects that are inherent in other elements. Lens elements with simple, spherical surfaces are inherently defective, but until recently, that was the only kind of lens element that anybody could afford to manufacture.
Answer: It's hard to answer without knowing the context of the statement.  But generally, multiple lenses can reduce aberrations.   Real lenses aren't perfect, and images suffer because of that.  Rays originating at a single point hit the lens at different places and at different angles and they do not converge on a single point.  The image of the point is blurred. It's impossible to design a single lens that does not suffer from these aberrations, although some of them can be greatly reduced by figuring the surface in a profile other than spherical.  Additional lens elements can correct for these defects to a degree, often at the expense of something such as brightness of the image, size of the lens, weight of the lens, or larger-than-desired depth of field. The resulting compound lens will produce much sharper images.  Photographic and cinemagraphic lenses are developed with much effort in design, with high-quality and carefully selected glass types, and with very tight manufacturing tolerances.  So they are expensive. The Leica Noctilux lens, which mates to an "ordinary" (in the sense that you wear it around your neck with a strap while on vacation.  That's the only sense in which a Leica camera is ordinary) photographic camera is expensive.
Magnification generally makes things worse, not better.
Comment: Thanks, I think I get it now. That was actually given in the geometric optics lesson, in the combination of lenses subtopic. So, basically multiple lenses reduces the aberrations.
Answer: The distance between nerve endings in the retina of the eye places a limit on the sharpness of an image that you can observe.  A good lens system can bring the image closer and larger.  This can cause the sharpness observed to be limited by other (smaller) factors.
Comment: It's not clear if the OP meant sharpness of a photograph, or sharpness of vision.   I had taken the question to be about photography.  But what you say is true in either case if you swap between "distance between nerve endings" (receptors?) and "pixel pitch".
Answer: I'd like to try explain this in the context of information. Images that have the highest resolution contain the most accurate information per unit area. In optics, this image information is carried by photons. The more photons collected from an image, the more accurately the image can be reproduced. In an ideal lens system, photons are concentrated from a larger "surface area" to a smaller "surface area" they pass through the lens system without alteration. This  increases the information density which increases resolution. In a non-ideal lens system, aberrations distort some of the information carried by the original photons as they pass through the lens system. This decreases the amount of accurate imformation per unit area and decreases overall resolution. In a well designed lens system constructed from good optical materials, these abberations can be considered a deviation from the ideal lens system.
Comment: Pixel per square inch is the spatial resolution of the detector array, not the image resolution.   The two are related in cases where the point spread function is on the order of a pixel.   Practical photography cameras (as distinct from scientific cameras) have the point spread function rather larger than a pixel so that the effect of the pixel size on image resolution is negligible.  Increasing the ppi does little to improve resolution.  For "casual" photographers it is usually of no advantage to increase pixel pitch *all other things being equal*.
Comment: Would a better description be in the context of information? Each photon carries information about an image. The image that has the highest resolution has the largest amount of information per given area. In this way, a lens system increases image resolution.
Comment: I've edited my original post based on your comments. Thanks for the input.


how to create auto atttendance system using filemaker

Question: Hi i am new to filemaker, i am interested to learn and create an attendance system using filemaker. the way i like to do it is using the solution provided in filemaker ( Time Cards ). i would like my code to capture the timestamp of the user when ever the user enter his/her id and filemaker will automatically store the timestamp of that particular event. also the solution should be able to detect if it is already capture any previous time already entered by the same user. Sorry for my explaination. i hope its clear and understandable by you guys. Thanks in advance.
Comment: What you are trying to do sounds very possible and not too difficult. May I suggest that you give it a try and come back and ask one specific how-to question for each problem you encounter?
Answer: If the users are logging into the system (username and password), you can accomplish this by running a script on open (login).
That would work like:

go to tracking table (table made of timestamp and accountName field)
set error capture on
perform find - accountName = get(accountName)
if get(lastError) = 401 [this shows there are no records from this user], create new record, set field timestamp = get(currentTimestamp), set field accountName = get(accountName)
else [you can exit application, show dialog, or skip adding a new record if they entered previous data]
endif, then script whatever else you need to do onOpen.

If your users are entering in a temp field to log in against a user table, it's a similar step, you just need to grab $accountName as a variable to use in the find.


NLP Making new Predictions on Vectorized set

Question: Vectorization techniques like TF-IDF are very common techniques for transforming text data into numerical data that can be more easily feed to ML Algorithms. Before we first train the model, each word of each document is given a number (a frequency) which depends on the whole data.
How can I input to the already trained model, a new custom, unseen before sentence since the model was trained with the whole dataset vectorized?
For instance, my new sentence has a different number of features compared to the dataset used for training and testing. Moreover, the frequencies, as far as I understand are computed based on all the words in the dataset, so ,from my perspective, I also need to include this dataset in the operation of vectorization of the new custom sentence.
Answer: I found the issue, I should use tf.transform, not transform_fit


Visual work Flow: Display multiple records via Record lookup

Question: We have a requirement where in we need to search for duplicate contacts ( based on contact email , first name, last name etc). Once all duplicates are listed to the user , then they can choose the valid one. We were hoping to use flow using Record lookup functionality.
Is there a way we can do a record lookup and list the resultset in a screen element.
Comment: There are quite a lot of duplication checkers for Salesforce, some for free. May I ask why you want to build your own? This is one I found after a quick Google search, http://appexchange.salesforce.com/listingDetail?listingId=a0N30000003IYLlEAO
Answer: Well actually there is a way to find all of the duplicate records in flow. You could use this by populating a a Dynamic Choice. You could populate all the records in the picklist that are duplicate. Create a for loop and have them deleted if you wanted.
Answer: Unfortunately the Record Lookup element only returns one record, see the implementation guide here. See the Record Lookup section, which says 'The Record Lookup element ultimately returns only the first
record from the filtered results'.
You might be able to achieve what you want with a Flow ApexPlugin making the query and providing a list back to the Choice display element. Though I suspect your wanting to be code free here.
I am not sure if you are or have searched but there is quite a few duplication checkers / removal tools for Salesforce. Try searching AppExchange.


How to schedule a picture into an existing album on Facebook

Question: I have a fan page with different photo albums. I'd like to add more pictures to each album by using the schedule feature of Facebook. How do I do this and make sure that the picture  I schedule for a later post is saved in the correct album?
Answer: I don't think it's possible using Facebook. Facebook only allows you to schedule photos to the Page timeline / wall photos.
You will have to use a 3rd party app. A lot of them offer this functionality. I can recommend you Publer. Besides scheduling photo to existing albums, it also allows you to schedule new albums.
Disclaimer: I'm the founder of Publer.


Stability of the spectrum for perturbations of the boundary

Question: Consider the Laplace operator on a smooth bounded open set with Dirichlet boundary conditions. I need some result of the following type: if one perturbs the boundary in a suitable sense to be determined, say depending on a small parameter $\epsilon$, then it is possible to order eigenvalues and eigenfunctions so that they are smooth functions of $\epsilon$ and spatial variables. At first this seemed a very natural result, but the total scarcity of references suggests otherwise, and I am starting to think that this kind of result is rather difficult, if one wants to achieve some generality. Has anyone encountered any result in this direction?
Comment: Assume your domains are diffeomorphic to a ball. Then instead of looking at the Laplace operator on the domain, you can look at the Laplace-Beltrami on the ball with a strange metric. This reduces the problem to comparing the Laplace operator for two different metrics. If I remember correctly, the main terms will be the same, so all that is left is a small perturbation in an appropriate operator theoretical sense. There might be quite a few details here that are annoying to work out, in particular if the closeness of metrics corresponds to the closeness you want.
Comment: Indeed, but I guess one can obtain at most the asymptotics of eigenvalues and some quantities connected with the eigenfunctions, while I need more or less a sort of Fourier expansion depending on the parameter (probably too much)
Answer: This is true, as long as your domain depends smoothly upon one real parameter. Say that you are insterested in the $n$ first eigenvalues. Using a Lyapunov-Schmidt procedure, you may reduce to the situation of an $n\times n$ symmetric matrix $S(\epsilon)$. Then look at Kato's book in the Grundlehren series.
If instead your domain depends on two or more parameters, the matrix $S$ will depend on several variables, and the eigenvalues will not be smooth functions, unless they remain simple.
Comment: I remember that F. Murat wrote a paper on the dependency of elliptic BVPs upon the domain.
Comment: Thank you Denis. Actually the domains I have in mind are sections of a higher dimensional domain, and I am looking for sensible assumptions on the global domain such that the sections have (locally) similar spectral properties. Clearly in the greatest generality this seems hopeless, but maybe for domains with a special structure...
Comment: By the way, when I say smooth I mean $C^2$, but I could probably go a long way with Lipschitz only
Answer: Look at ``Perturbation of the boundary in boundary-value problems in partial differential equations'' by Dan Henry, London Math Society Lecture Notes #318
Comment: Ah, now I recall I already checked that book, but it gave information on the eigenvalues mostly. I would rather need some kind of Fourier expansion depending on the parameter(s). It is easy to conceive some special cases (e.g. a ball with varying radius) and I was hoping some more general class of examples could be known.
Answer: Hello, My name is Marcus Morocco. My doctoral thesis was on exactly these issues. I calculated the expressions for the first and second derivatives of eigenvalues and eigenvectors of the laplace opelador ccom Neumann boundary condition. If interest can send the file.
Comment: Thank you for the info. Did you publish your results?


Does an auto touch app categorize my device as rooted

Question: Does using frep categorize my device as rooted. My device is not rooted right now.
It is an auto touch that can be used without root
Comment: Are you asking if your device is rooted?
Answer: Frep doesn't necessarily require superuser permissions. A more complicated setup as described in the Google Play description can suffice, though su permissions certainly streamline the process.
So, your phone isn't necessarily rooted. It could be, but it could very well also be not rooted.
That being said, if you say

My device is not rooted right now.

You're the authority on your own device.


One Mouse, Two Computers, One-Click Switch

Question: I have two computers set up next to each other - one Mac and one PC. Is there a mouse out there (Bluetooth, perhaps?) that I can use on both - one computer at a time - without linking the desktops? I'm thinking maybe a mouse that has a side toggle that switches which machine it's hooked up to at any given time. Doable?
Answer: Not to my knowledge, SamTheBrand.
But a KVM Switch is going to do exactly that, as well as allowing you to share keyboard and monitor if you so wish. They go for cheap (20 USD and under) on many stores, with more capable ones not going much over 40 or 50 USD.
Computers won't need to participate on a network.
Comment: Thanks, this seems an elegant and useful solution. I'll check my options on the market.
Comment: Actually I think KVMs are a horrible solution--they just happen to be one of the better options available, since mouse and keyboard makers are too stupid to offer mice and keyboards like you describe.  Of course Synergy is another, but I've found it to be a pain for various reasons.
Answer: Will this do what you want?  http://synergy-foss.org/
Answer: @A Dwarf's answer may work.  The only consideration is how close are the two computers?  The fact that you stated "without linking the desktops" leads me to believe they aren't right next to each other.  There is such as thing as KVM-over-IP.  They're expensive, so it may not be the best option for you but you can run them farther.  Additionally your keyboard wouldn't be very mobile.
Bluetooth will be your best bet.  You can get a receiver for each PC and use the same keyboard on each.  The problem with that is it will do the exact same thing on each PC at the same time so you'd have to manually disable it on one of them.
Comment: The laptops are right next to each other. KVM seems like its the way to go. Thanks all!
Comment: @SamTheBrand - you should update your question to include the fact that these are laptops, particularly if you only want to share the mouse between them and not also a keyboard (and possibly an external display).  Many SOHO KVM switches require that a keyboard is connected as they are controlled with special key-sequences from the connected keyboard (commonly `SCR-LCK`-`SCR-LCK`-`SPC`).