Drawing Farseer Fixtures

Question: Is there any way how to draw a Polygon / Fixture from Farseer Physics with XNA?
As I deform these polygons at runtime I can't take any texture from my Content folder, the texture must be generated at runtime too.
Answer: You can draw the polygons easily, if you attach the DebugView from farseer, in your physics simulation.
If this is not what you want, you will need to write your own renderer, which is not going to be a trivial task.
You could also extend the DebugView from the Farseer library, seeing as it is open source.

Drawing Farseer Fixtures


How to use SVM to do time series prediction?

Question: I want to know how to use SVM to do time series prediction? what the differences of input vecvtor X of our model between time-series prediction and standard kernelized regression problem?
Answer: The fundamental difference in case of time-series prediction against general regression problem (not only for SVM) is the dependence of response on more than one cases.
So, for example if the input vector with N cases is X1...XN, then for predicting some case number n, all the input-response data from X1 through Xn-1 can be used (and are supposed to effect its outcome).
Generally, a fixed number of cases immediately preceding the case to be predicted are used. One way to do time-series prediction with SVM is to transform your input variable X to include features derived from the desired number of preceding cases.
Here is a code example by Quantum Financer.


Using DataContractResolver in WF4

Question: We are developing workflows in WF4 way. When we use some custom classes we have to add them to knowntypes collection in each send/receive activity to avoid serialization exception. Is there any way we can use DataContractResolver feature which is a new dotnet 4 feature to avoid adding knowntypes ?  Or any alternate solution if any one can suggest ?? Thanks.
Answer: Sure - check out the sample:
http://msdn.microsoft.com/en-us/library/dd807504.aspx

Using DataContractResolver in WF4


Is there a way to get rid of deleted posts?

Question: I have deleted an answer to my own question. I knew that a deleted post can only be seen by the mods only. Although, I have not become moderator, I still can see my deleted answer. So how can I get rid of the deleted answer so that I don't have to see it?
Comment: You should post this type of questions on http://www.meta.stackoverflow.com. About this question, it's already asked o MSO under different title.
Answer: I don't think you can unfortunately. Deleted material is seen by moderators and the person who originated the post.
Comment: This, also that form of deletion is called a 'soft delete' as it is hidden from view.  Only SE employees can truly purge something from the site entirely.
Comment: @TylerShads, which I imagine they would only do for a very good reason.
Comment: Exactly, only if personally identifying information is placed in a post.


Disabling IPV6 on Always on availability group

Question: In our environment we only have one network adapters for the Replicas and IPV4 is being used. By default the IPV6 is also enabled. My question is will there be any problems if I unchecked IPV6 from the Adapter properties
Comment: Why fiddle if there is no issue and everything is running fine ?
Comment: Application is going slow at a certain period of time. Vendor asking if we can disable it.
Comment: That means they are stalling because whoever you are talking to doesn't know what is going on. I would immediately escalate upon receiving such a request from a vendor. Especially since I _know_ I'm using IPv6 and disabling it would interrupt production services.
Comment: the cluster is only using ipv4 not ipv6 but it was enabled as part of the default seryp.
Answer:
My question is will there be any problems if I unchecked IPV6 from the Adapter properties

Do not disable it, specially if you are not having any issue. WSFC does use IPV6 both for internal communication and can also be used for public network communication. Plus even if you disable IPV6 it is highly unlikely that cluster would not work or start giving some issue. I am sure that even if you disable IPV6 the WSFC would work but may be other network functionality might be affected since network is beyond scope of discussion I am not sure what might be affected but WSFC will work.
I would quote from Failover Clustering and IPv6 in Windows Server 2012 R2

Should IPv6 be disabled for Failover Clustering?
The recommendation for Failover Clustering and Windows in general,
  starting in 2008 RTM, is to not disable IPv6 for your Failover
  Clusters. The majority of the internal testing for Failover
  Clustering is done with IPv6 enabled. Therefore, having IPv6 enabled
  will result in the safest configuration for your production
  deployment.


How do I revert to 11.04's version of Nautilus?

Question: Since the developers deliberately broke the very useful emblems feature that I've relied on for years and years with Ubuntu ( How do I tag files with custom emblems in Nautilus? ), while offering no replacement whatsoever, I guess I need to revert to the older version of Nautilus. How can I do this?
Answer: Nautilus in oneiric requires the GTK+3 libraries whereas Nautilus in Natty requires the GTK+2 libraries - quite different.
I'm afraid this will not be easily possible - you will need to recompile and probably have to do major code surgery... it's far easier just to stay with 11.04 if this emblem function is a major capability you require until a Gnome 3 alternative is developed.

workaround
Please see this Q&A for a scripted workaround:
Is there any tweak to bring back emblems in Nautilus?
Answer: The new Nautilus is part of the gnome 3 software bundle, while the old nautilus was part of gnome 2. So I guess it is not the fault of the ubuntu developers. Some changes from gnome 2 to gnome 3 cannot easily be understood and complicate the workflow imho. Maybe there is an extension for nautilus somewhere to attach the icons.
EDIT: Ok I found an explanation here on askubuntu: How do I tag files with custom emblems in Nautilus?
The Gnome developers simply removed this feature and here is an explanation by the gnome developer team. http://mail.gnome.org/archives/nautilus-list/2010-July/msg00023.html
Sorry that there is nothing more to do right now, but I guess someone will design a nautilus-extension for customizing icons with emblems.
Comment: If a major feature that has existed for years is intentionally removed from a program, it is the fault of the developers. They released an incomplete version of the program. This is why open source for the Desktop is unreliable and not ready for commercial use, you never know when the next semi-annual release will regress important features you rely on. I've never installed a Windows service pack and had critical features disabled because of it.
Comment: Semi-annual? You're talking about replacing a decade old software. (Released in 2002) Microsoft has done the exact same thing lots of times, and they're really manic about backwards compatibility. Replacing ancient technologies is not specific to open source. However, these things are easily fixable in Ubuntu. In Windows, you cannot fix them at all and even if you could, you wouldn't be allowed to.
Answer: This feature is not useful to the majority of people, but it does add UI elements that clutters the experience. That's why it should be implemented as a plugin so that the relatively few people who wants it, can have it without bothering the majority. The freedom to tailor your software to suit your specific needs, is what makes open source a very friendly way of satisfying all needs. You really wouldn't want to have hundreds of dialogs installed by default in order to suit all potential use cases.
And before you start complaining that nobody has written that plugin for you yet, please keep in mind that Ubuntu 11.10 has not been released. Ubuntu 10.04 is supported until April 2013. 11.04 is supported until October next year. There is plenty of time to fix this before you need to upgrade.
Comment: My sentiments entirely
Comment: Thanks, Jo-Erlend Schinstad, your rude condescending attitude typical of FOSS zealots is what finally drove me to dump ubuntu and buy a mac. It's nice finally having an OS where everything works without constant regressions and tweaking. And yes, I can tag files to my heart's content.
Comment: Thank you Ben. Everyone who disagrees with you, are condescending, right? But I'm glad to hear that you got yourself a new PC.


What is the coloring convention should I adopt for Buy and Sell

Question: This might be more of a UX question, but since it relates to buying and selling of stocks, I wanted to ask if there is a standard coloring convention for Buy and Sell like we have for Up (Green) Down (Red)
Comment: I work for one of the larger global trading software vendors ([Fidessa](http://www.fidessa.com)). We use blue for buy, red for sell. I can see the logic behind green, though.
Answer: That would depend on your broker, but in most cases if they do use colours it would also be green for buy and red for sell (that has been the case with the brokers I have used where they do use colours for buy and sell in the order input box).
Comment: @ChrisW.Rea - just checked with my wife, she says in the West red represents danger, whilst in Asia red represents good luck. This might be the reason for Red representing an up market in China.
Comment: is it a standard convention to have green for buy and red for sell? it was less intuitive to me since buy means, your money is tied up, so what is the logic for being green.
Comment: Definitely green for buy. It is not uncommon to have a different color for shorts (i.e. buy to cover/sell short).
Comment: @ssinganamalla - The logic for buy being green, is that you are buying because you are after a stock that will rise in price. On the other-hand you would sell (or short sell) when you think the price will drop, so the colour would be red.
Comment: It's the opposite in China. http://graphicdesign.stackexchange.com/questions/6982/except-china-which-country-will-use-red-for-up-and-green-for-down


What are some sources Charlotte Brontë might have learned about physiognomy and phrenology from?

Question: Charlotte Brontë frequently makes use of physiognomy and phrenology in describing her characters. Do we know of any sources where she might have learned about it? They would be interesting references to have on hand while reading her books. Sources that Brontë herself might have read, rather than any and all that were available in her time, are of particular interest to me.
Note – I'm aware that these "disciplines" were unscientific and often very racist. I'm only looking to learn more about them to enhance my understanding of Brontë's character descriptions.
Comment: Unless you're specifically asking about one of those novels, you shouldn't tag your question with it (the general author tag is sufficient). Similarly, unless you're asking us to do character analysis I don't believe the tag is appropriate.
Comment: @bobble Sorry, I will delete those tags. I tried to add more relevant tags but they didn't exist yet and I don't have enough points to add them.
Answer: According to a recent paper (Tytler, 2019) on the subject, Charlotte Brontë's fascination with physiognomy and phrenology were likely inspired by Johann Casper Lavater's Physiognomische Fragmente (Essays on Physiognomy), which caught on in English literature through the influence of Sir Walter Scott.
This paper examines her first novel, The Professor, finding thematic similarities between the type of physiognomic analyses employed by the protagonist, William Crimsworth, and the ideas and applications of physiognomy in Scott and Lavater.

And though Lavaterian ideas may also be discerned outside contexts of
the composite portrait in the works of, say, Ann Radcliffe, 'Monk'
Lewis and William Godwin, it is principally in Sir Walter Scott's
fiction that such ideas are to be found in abundance. It is for this
very reason that Scott may be rightly deemed a watershed figure in the
history of the relationship between physiognomy and the modern novel.
Charlotte Bronte was, as is well known, a great admirer of Scott's
writings, and there can be no question but that she was much indebted
to him for her own treatment of the outward person in her novels. This
would appear to be especially true of her uses of three aspects of
physiognomy which, prominent enough in Scott's narratives, had already
been specially pointed up and even partly illustrated in Lavater's
Essays: the national physiognomy, the family physiognomy and the
social physiognomy. The same may be justly said of those contexts in
The Professor where individuals are described in highly analytical
detail, where physiognomic judgements are made and where physiognomic
discussions take place.

Tytler, Graeme. "Physiognomy in The Professor." Brontë Studies 44.4 (2019): 339-350.


/var/log/auth.log stops recording authentication errors

Question: As the title says, /var/log/auth.log stops recording authentication errors. It all began with I accidentally deleting it. Then I created it using touch command and changed the owner:group to syslog:adm. I have had rsyslog installed. But it just does not record anything.
Any idea to fix it? The OS is Ubuntu Server 22.04.3 LTS. Thanks.
Answer: Have you restarted rsyslog or kill -HUPped it after recreating the file? You probably should.
In POSIX-compliant systems, deleting a file while some other process is using it will make the file inaccessible to new processes, but any process that already has the file open (like rsyslog in your case) will be able to keep using it as normal. The file deletion will be completed by the filesystem driver only after all the processes having the file open will have either terminated or closed the file.
This behavior enables things like updating program binaries while they are in use: any processes started with the old version of the binary will keep using the old version until terminated, and new processes will start with the new version automatically.
The side effect is that any deleted-while-still-open files will keep using disk space until the files are closed (or the processes holding them open are ended). If a logfile that gets a lot of message gets inadvertently deleted while still open, such a file can grow to an arbitrarily large size. You can see such deleted-while-still-open files with sudo lsof +L1.
Comment: I restarted `rsyslog` using `systemctl restart rsyslog`. It takes effects immediately. Thank you.


Prompting user to save when they leave a page

Question: I need to prompt a user to save their work when they leave a page. I've tried onbeforeunload but I need to show a styled prompt not the usual dialog box. Facebook has managed to achieve this (if you have a Facebook account, edit your profile info and go to another page without saving and you get a styled prompt). I've also tried jquery unload but there doesn't seem to be a way to stop the unload event from propagating.
Comment: StackOverflow uses a regular window.onbeforeunload it seems.
Comment: Going to check what stack overflow uses. They are able to sense when someone is leaving, even if they are going somewhere other than another stack overflow page. Therefore, they must be doing it client-side.
Comment: Have you tried showing a special div on the "onbeforeunload" event? That may work.
Answer: Take a closer look at what Facebook is doing: you get a prompt if you click a link on the page, but nothing when entering a new URL in the address bar, clicking a bookmark, or navigating Back in your browser's history.
If that works for you, it's easy enough to do: simply add a click event handler to every link on the page, and trigger your stylized confirmation from it. Since these handlers will get called prior to the start of any navigation events triggered from within the page itself, you can pretty much do whatever you want in the handler - save data, cancel the event entirely, record the intended destination and postpone it 'till after they confirm...
However, if you do need or want to respond to navigation events triggered externally, you'll have to use onbeforeunload. And yes, the dialog is crappy, and you can't cancel the event - that's the price we pay for all the scandalous idiots abusing such features back in the '90s. Sorry...
Comment: I would use event delegation instead of registering event handlers on EVERY SINGLE link...
Comment: If that's not enough you can add a window.onbeforeunload for other purposes to keep users from losing their data in case of the other events Shog9 mentioned.
Comment: +1 for belt-and-braces with links and onbeforeunload. Although, be sparing with this and only use it where there is a real danger of important data loss. Personally I find SO's onbeforeunload a bit irritating!
Comment: @JimmyP: good suggestion - not only would that be easier/faster, it'd allow for per-link event handlers to easily avoid the confirmation by simply eating the event themselves.
Answer: The selected answer is good but I still had to dig around for the details.  If you want to use the onbeforeunload event, here's some sample code:

Answer: to improve on the answers of the others here I developed a great little script.
    $('.measurement_value').change(function() {
        $(window).bind('beforeunload', function(){
            return 'You have unsaved changes, are you sure you want to leave?';
        });

        $('#MeasurementAdminEditForm').submit(function(){
            $(window).unbind('beforeunload');
        });
        $('#CancelButton').click(function(){
            $(window).unbind('beforeunload');
        });
    });

On each of my form elements I give a class of 'measurement_value' and then only load the beforeunload if one of those elements change.  Furthermore I unload the beforeunload on submit of my form and on the click of the cancel button.
hope this helps someone else.


How to simulate a vehicle CAN bus network?

Question: I wish to do a project about CAN bus message testing, but without a real vehicle. Is there any way to simulate a virtual CAN bus network?
Comment: It would help if you gave more details on what you are trying to do with your project.
Answer: It's a worthy endeavor, but I suspect any solution that you could buy would be far more expensive than salvaging the important computers from a wrecker [junkyard] and creating your own virtual "test vehicle".
Even just an ECU and "body module" (in GM terms, BCM/BCU) might be enough to simulate an entire vehicle for your purposes.
Or perhaps purchase a wrecked vehicle, no need for aesthetics or even an engine.  You just need the wiring harness and computers intact.
Answer: There are really two ways of achieving this.

Wire up all of the required Nodes on the bench, for example this can be the Engine ECU, Instrument cluster, BCM, indicator stalk, rear convenience module etc etc.
Monitor the CAN data on the vehicle in question so you know what data is required and then transmit this from your own device such as a PC, CAN bus development board etc etc. I prefer to use a USB-CAN transceiver and a PC that way I can write custom scripts and software to monitor the traffic and transmit at certain times under certain conditions. The benefit with this method is you can have gauges and graphs on screen.

It really depends what you want to achieve and why.
Number one has the benefit of being 'real world' hardware, it is exactly as it would be in the vehicle. The problem however is that there would be hundreds of errors unless you have every last electrical device hooked up as certain ECUs would be looking for sensors, actuators even light bulbs etc that were not present.
Number two has the benefit of saving space and eliminates the problem of missing hardware. You simply transit all of the CAN IDs and data that would be present on the vehicle. The problem with this is that there can be timing issues with security and safety systems. With 95% of the data transmitted it doesn't really matter about when exactly the data is transmitted it just needs to see it within a certain amount of time. But some data acts as a call and response system, e.g. Node 1 sends 'xxxxxxx', Node 2 will only then send 'xxxxxx1' then Node 1 continues to send the rest of the data. Or a specific Node will have to transmit first in order to wake up the rest. Although after monitoring the live data enough it is not that hard to work the timing out.
I usually have the Engine ECU hooked up on a bench rig with all of the required sensors and actuators, I then hook this up to my PC using a USB-CAN device.
Just remember the automotive CAN bus isn't really that complicated at all, each node simply transmits a number of IDs with up to 8 bytes of data. ECUs/Nodes don't 'talk' to each other, they're dumb, they simply monitor the bus for the data and make changes based on this data. Simulate this data exactly and there will be no issues.
I would avoid DIY and open source CAN bus devices such as Arduino as they are usually not fast enough to transmit and process up-to 100 IDs. I would invest in a decent CAN bus analyser such as Kvaser.
I have personally made my own CAN bus analyser with a 72Mhz processor, which I would say is the minimum required to simulate a complete network. It all depends on your electronics and software knowledge, building your own analyser and custom PCB is not that hard with beginner electronics knowledge.
Answer: Check out the ICSim: https://github.com/zombieCraig/ICSim
And the following great guide:
https://medium.com/@yogeshojha/car-hacking-101-practical-guide-to-exploiting-can-bus-using-instrument-cluster-simulator-part-i-cd88d3eb4a53
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


Does Cold Damage Slow Enemy Movement Speed Only?

Question: When dealing cold damage to an enemy, what all does it slow down?  I know it obviously slows down an enemies movement speed, but does it affect casting time?  Or does it slow down their attacks also?
Answer: Cold damage applies a snare effect to the enemy.  This effect slows them generally, so yes, it slows their attacks, casting and so forth.
I have no citation for this other than my extensive use of cold weapons and caltrops over the last 60 levels.
Comment: I *thought* so also I just didn't know if there was anything citation wise or proof wise to go with it.
Comment: Can someone provide a value for the slow?  I am not sure if it is out there, but if you had cold damage on a weapon, how much does it slow them?


Honda Civic 2002 damaged immobiliser EEPROM and MICU swap

Question: My car developed a few electrical issues one of which is the immobiliser is not recognising the key. To drive the car I had to remove the immobiliser EEPROM (IC: L56R-93c56) on the ECU. The car drives fine but the engine management light is ON as well as there is a fault code P1607.
Therefore I fitted a salvaged MICU and all the systems that did not work before work fine now apart from remote central locking (as immo EEPROM is missing) and green key flashing.
I intended to solder back the original EEPROM however it got damaged either in storage or during unsoldering. Now my question is there a way to program immo EEPROM using code stored in keys? Or is there a "virgin" hex load that could be used to initialise syncing between ECU, immo and keys?
Another worrying fact is that when I opened the old faulty MICU I noticed IC: IS93C46-3 1024-bit memory. I was under impression that in the 7th generation, Civic MICU is not serialised could anyone confirm?
Additionally, I never paid attention to the fact that my old MICU R1 relay is missing. I believe it operates the magnetic clutch of the AC unit during the startup. Could anyone shine more light on its function?
Answer: There is no virgin file for these floating around so you would have to buy a virgin ecu to copy it from. There is no point tho cause you'd still have to program it same as if using a used file.
Use this file on a new 93C56 eeprom for your ecu : https://autoelectronics101.com/tmp/civicl56ecudump.zip
After, you will need to use a diagnostic tool like Autel or dealers iHDS to run the "immobilizer/ecu/micu replacement" function. After that your ecu/micu/keys will all be synced and immo system will be back to normal with out the rom errors from ECU like your getting now with no eeprom installed.
The micu is part of the immobilizer chain so replacing it requires re-programming the immobilizer system same way I described above for the ECU. The relay missing in your micu is probably normal. They used the same pcb for different models. Your car probably just did not have what ever the function of what that relay controlled so it was not populated for boards with your part number. If your replacement has it then that means its not the correct part and may or may not have DTC's related to the added functions that are not present.
Comment: Thank you for your answer. I will try what you suggested while using Foxwell 2 inn 1 tool e.g. NT510 elite. Thank you for the file I will write the new EEPROM with it. Hopefully, it will go smoothly as soon as I make progress I will report the findings. Fortunately, the relay I mentioned was not present in the replacement MICU. So the new MICU fixed all the problems (apart from immo). One thing I have noticed is that the electric window on the driver's side remained powered on even without the key. I will assure the parasitic drainage to make sure that other systems are off.
Comment: Quick update. I fitted a new MICU. During installation, I noticed that MICU also has EEPROM (93c46) and ignored it for time being. With the new MICU fitted car drives fine apart from the engine management light being on and the immo key flashing as well as the remote central locking not working. I also tested EEPROM removed from ECU (93c56) with the new EEPROM reader and it turns out it is not damaged (initially I thought it was).
Comment: As soon as I fitted the original ECU EEPROM the car will not start (immo key flashing). This leads me to the suspicion that MICU is also serialised hence EEPROM on the MICU board (93c46). This could explain why with all original parts apart from MICU the car does not start. I intend to swap the MICU EEPROM from my old MICU to the new one. If for any reason it does not work can you provide me with a virgin hex file for MICU?
Comment: yes the micu is part of the immo chain. I do not have any virgin files for it sorry. Its pretty easy to just adapt it through obd2 tho.


Mysql Performance tuning for myisam tables.

Question: Folks
I have a 4-core MySQL server with 4 GB of RAM, holding 19 MyISAM tables (total: ~164GB of data) and 32 innodb tables ( 5mb ) and we use it to process CDR files( basically call detail records files)
I have a table(billing_datas) with about 200 million records.( myisam table). ( basically we store all the cdr files data with the ids of carriers etc) which keeps on growing at a rate of 90 million rows per month
We need to generate reports based on selected "date from" and "date to" criteria. I m confused with the approach
The current scenario that we have is we are firing the query on the main table i.e billing_datas and creating the temporary table with "date from" and "date to" parameters and performing the aggregate calculations on this temp table. But the real performance hit is creating the temporary table is taking about 18 seconds for 1 month records.

should we create 3 summary tables based on
summary_monthly,summary_weekly,summary_daily and run the reports
query on these summary tables??
will it improve the performance as described in point 1?
Answer:
Increase size of tmp_table_size

The maximum size of internal in-memory temporary tables. If an in-memory temporary table exceeds the limit, MySQL automatically converts it to an on-disk MyISAM table. Increase the value of tmp_table_size (and max_heap_table_size if necessary) if you do many advanced GROUP BY queries and you have lots of memory. This variable does not apply to user-created MEMORY tables.
You can compare the number of internal on-disk temporary tables created to the total number of internal temporary tables created by comparing the values of the Created_tmp_disk_tables and Created_tmp_tables variables.

Based on tmp_table_size value adjust max_heap_table_size

This variable sets the maximum size to which user-created MEMORY tables are permitted to grow. The value of the variable is used to calculate MEMORY table MAX_ROWS values. Setting this variable has no effect on any existing MEMORY table, unless the table is re-created with a statement such as CREATE TABLE or altered with ALTER TABLE or TRUNCATE TABLE. A server restart also sets the maximum size of existing MEMORY tables to the global max_heap_table_size value.
This variable is also used in conjunction with tmp_table_size to limit the size of internal in-memory tables.
After setting proper tmp_table_size and max_heap_table_size restart your server and try those reporting queries and observe performance.
Please refer How to optimize Group By queries from here:
http://dev.mysql.com/doc/refman/5.0/en/group-by-optimization.html


Resistor selection based on power rating

Question: For example, I have a cicuit of single resistor R = 2k, apply with Vdc = 18V.
The Power of the resistor is about 162mW.
Should I pick a resistor with higher Power rating (Eg 0.25W 0.5W) or lower power rating (Eg 0.1W).
Comment: come with a requirement. Resister wattage is determined by current handling, tell where is the resister is used/circuit etc.
Answer: Since 0.1 < 0.162 it would be a bad idea to pick a resistor that is not rated for the actual nominal dissipation.
For high reliability, or if the environmental conditions exceed what is in the datasheet for the rated power, you should derate the part. So 0.25W or 0.5W would be better (either would be acceptable in many situations, 0.5W would likely be larger and more expensive but probably a bit more reliable).
Or you could change the circuit to use less power. For example, if the 2K is a dropping resistor for an LED, use a more efficient LED and increase the resistor. Or use a switching power supply to reduce the 18V to 5V and then the resistor might only be required to dissipate 20mW --  (5V-3V)*10mA.
Answer: The power rating strongly depends on the removal of heat.
Very short leads, soldered to large regions of chilled copper foil, are a good approach.
Forced air cooling (some power-resistors, 5 watts and up, have metal cases with fins) also is a good approach.
If forced air cooling, is the resistor located in the airstream near the air intake where the moving air is coolest?
Can we think about using copper foil to cool resistors, whether leaded or SurfaceMount? Sure.

simulate this circuit – Schematic created using CircuitLab
Now how much are we stressing your resistor?
If you have large regions of copper soldered to the resistor, using the 49 degree Centigrade per Watt numbers we computed here, you'll only have 49 * 0.16 = 7 degree Centigrade heat rise.
Answer: You have to go for higher power resistor..
every resistor along with resistance value, power is the most important factor.
P = I^2 * R
selected resistor power > P;


If the Sun disappeared, could some planets form a new orbital system?

Question: If the sun were to suddenly disappear, the planets would continue to travel tangentially to their former orbits. (This I know from this answer to a somewhat related question here.)
In such a scenario, is it possible (however unlikely) that a new orbital system would form from two or more of the now-rogue planets?  For example, is it physically and mathematically possible that Earth might end up getting captured by Jupiter and thereby become one of its moons?  Or do the size and speed of the planets completely rule out such a scenario, even if the sun disappeared at such a time that the planets' new trajectories would cross?
Comment: @ben But it is trivially easy to make a hypothesis and run a simulation based upon it.
Comment: @BenCrowell: "Our best current theory of the speed of light is that it varies depending on the movement of the aether. Therefore we can't say anything about what would happen if it was constant, and no use speculating what would happen if it was" -- Someone in 1880. Thought experiments, even starting from seemingly nonsensical initial conditions, can be useful for learning and understanding the physical world.
Comment: Those objecting to the premise of the sun disappearing are missing the point of the question. You could just as easily assume that the question is about pairs or sets of completely independent rogue planets that happened to meet in a neighbourhood of space, on any of the same set of possible trajectories envisaged in the OP. This scenario is certainly _realistic_ insofar as it doesn't violate the laws of physics (though of course it's vanishingly _unlikely_).
Comment: @Ben your line of reasoning is a completely general argument against any kind of counterfactual reasoning. The laws of physics are deterministic so there is only ever one possible future (ignoring quantum randomness, but then quantum jumps also make it possible for the sun to disappear with a vanishing chance). A what-if scenario is thus in general asking about a situation that cannot actually happen. Nevertheless there is usually a strictly speaking not physical model describing the situation that is still useful.
Comment: Our best current theory of gravity is Einstein's theory of general relativity (GR). According to GR, mass-energy is locally conserved, and therefore the sun can't suddenly disappear. Therefore our current theories can't say anything about what would happen if the sun suddenly disappeared.
Comment: There's nothing preventing those tangent paths of two planets to intersect. It all depends on the planets' positions at the time. Are you asking about our solar system specifically, or any realistic solar system? The answer to the latter seems "yes but unlikely", but the former might be disproven using some basic number crunching.
Comment: @BenCrowell: OK, fine. Blow up the Sun instead, ejecting its mass as two high-velocity beams of matter in opposite directions (to conserve momentum) as far from the plane of the ecliptic as possible. The effects on space-time curvature within the solar system should be pretty much indistinguishable from the Sun just magically disappearing.
Comment: I really like how you start out with a (to the best of my knowledge and understanding) not only unlikely but outright impossible scenario, and then ask about possibly highly unlikely outcomes. - What is to prevent the same deity that removed the sun to magick the planets into orbiting each other?
Answer: The issue here is whether pairs of planets can become gravitationally bound to each other.
In the two-body problem the trajectories or orbits are ellipses (bound orbits), parabolas and hyperbolas (unbound). For all practical purposes, an encounter looks like they start out at infinity with some finite speed, approach each other, and then maybe fly away or remain bound. This situation (finite speed when far away) corresponds to a hyperbola, so the generic case will not form a new bound system: some of that energy needs to be shed somehow.
One way this can happen is an inelastic collision, i.e. a merger. A less extreme case is a close encounter where tidal forces dissipate some of the kinetic energy. But the kinetic energy of planets is large, so a single encounter is unlikely to dissipate enough to make them bound.
Another important possibility is a three-body encounter. This is how comets get into short-periodic orbits when falling into the solar system: an encounter with Jupiter (or some other planet) leads to a gravitational "assist" that makes it bound with the sun.
In your scenario where the rogue planets fly off along their tangents it is very unlikely that any start out bound to each other since planetary orbital velocities around the sun are much bigger than the orbital velocities of a bound planet-planet pair at a large distance. Hence they will just fly apart. In theory they might have an encounter before leaving the solar system vicinity (e.g. Mercury by sheer chance sweeping past Jupiter) and that leaves a tiny chance of a three-body interaction with moons or a merger, but the chances are truly tiny. The generic case is just scattering.
Addendum: Some estimates
For a body to be bound to another body of mass $M$ it need to move slower relative to it than escape velocity $v_{esc}=\sqrt{2GM/r}$. If we assume planets move in circles we can then take their orbital velocities for all possible positions along the orbit, calculate the relative velocity, and compare it to the escape velocity.
The result is this diagram, where I have plotted the separation on the x-axis and how many times escape velocity the relative velocity is on the y-axis. The numbers denote which pair of planets I am comparing. The blue horizontal line is $\Delta v=v_{esc}$.

Looking just at the lowest relative velocities shows that the closest to being potentially bound is Saturn to Jupiter were the sun vanish just as they are moving in parallel, but even in this case Saturn has several times Jupiter escape velocity.
One could complicate it with inclinations and elliptic orbits, but it will not change the qualitative picture: the planets are not even close to being bound to each other in the absence of the sun.
Comment: The formula you're using for escape velocity $v_{esc} &= \sqrt{2GM/r}$ is for the case where the mass of the escaping body can be ignored. For planets that's not valid, and the escape velocities will be higher due to the mass of the other planet that this equation ignores.
Comment: @AndersSandberg I might suggest using the mutual escape velocity $v_e=\sqrt{\frac{2G(M+m)}{R}}$ derived here: https://physics.stackexchange.com/questions/121679/is-escape-velocity-the-same-for-all-objects/121834#121834.  It will dispel this argument and cut the number of pairs you need to graph in half.  It should increase rather than decrease $v_e$. By the way, I think your graphs are a genius way of presenting this problem! Love this answer!
Comment: Something to consider is that the planets may not even be starting on Hyperbolic orbits relative to each other.  Mars and Jupiter have their lowest relative velocities at the same time as they have their closest approach.  If this orbit isn't already hyperbolic then the interaction with moons becomes largely irrelevant.

I'm at work so can't spend the time to work it out right now, but I'd be interested to see someone do that calculation.
Comment: The only planet likely to get a three-body capture is Mercury.  Everything else is just too large relative to the available moons.  You might be able to capture Mars by ejecting all four of the Galilean moons, but that's a *real* longshot.
Comment: What about orbital inclination? From Jupiter, Mars is less than a degree off; Mercury is over five. But even at only .54 degrees off, I'd assume that's too much over the distances we're talking about. Also, what speeds are they all going to be going at? Who's going to be playing catch-up to who? (assuming you pick the exact right time to send two of them off in the same direction - not that you really can because of their inclinations....)
Comment: @JanKanis that was my hunch as well, especially seeing separate lines for (5,6) and (6,5). Not sure the adjustments are enough to make a difference to the final result, though.
Comment: @JanKanis - Yes, you are right. I checked with running with the reduced mass, and it moved things a little bit (since it is smaller than either mass it reduces V_{esc} and makes it harder to get bound orbits), but does not change the overall conclusion much. Thanks for writing the refined answer!
Comment: I suggest the issue is nothing related "pairs of planets" but rather to everything except the vanished Sun.
Answer: No. The 8 planets would go into 8 different directions. It is because their relative velocity to each other is much higher than the escape velocity, even from their smallest distance. If it would not be so, their orbits could disturb each other significantly, even today with the Sun. Thus, the Solar System would become chaotic.
However, the moon systems of the planets would remain practically intact.
There is a very little chance that a 3-body or more-body system from the planets is created for a short time. Then some of them escapes, leaving a gravitationally bound (most likely) 2-body system. Similarly possible, but very unlikely, that an impact would happen. Both of these have a very small probability, you can safely expect that all the 8 planets go into 8 directions.
Comment: Just saying....it should be 9 .
Comment: @Spencer 1. Mercury, 2. Venus, 3. Earth, 4. Mars, 5. Jupiter, 6. Saturn, 7. Uranus, 8. Neptune. Wow! You are right. I fixed the post.
Comment: @Spencer Well we know it shouldn't be 9.  Maybe 10, 19, or many more depending on how you want to define a planet and what we've discovered in our solar system.
Comment: Did you really mean 9?
Comment: @JasonGoemaat Right, thanks :-)
Comment: @JasonGoemaat I don't think it so. The new planet definition says that the body needs to clean up the asteroids on its orbit. In such big distances, that would require an extreme mass, what would make the object detectable.
Comment: @peterh-ReinstateMonica Exactly :)  I was saying that if you wanted to include Pluto you would have to use some other definition of a 'planet' and there would be more than 9.  There's no way I could figure out how to make the number come out to exactly 9 for Spencer's comment.  I'd stick with the IAU definition and leave it at 8.
Answer: I gave a try at refining Anders Sandberg's answer with the equations for a two body system.
Basically, a two body system is bound if the sum of the total kinetic energy and the (negative) gravitational potential energy is still negative. (To escape, kinetic energy needs to cancel out the potential energy.)
Gravitational potential energy:
$$U = -{GMm\over{R}}$$
where the gravitational constant $G = 6.67430×10^{−11}\ m^3kg^{–1}s^{–2}$, $M$ and $m$ are the masses of the two bodies, and $R$ is the distance between them.
The total kinetic energy is the sum of the kinetic energies ($E={1\over{2}}mv^2$) for each body relative to the common center of mass.
According to Anders' plot Jupiter and Saturn are the closest to being bound, so I made a calculation for that pair using data from these nasa pages, ignoring excentricity and inclination.
Jupiter:
$M = 1.898×10^{27}\ \text{kg}$
$\mathrm{semimajor\ axis} = 778.570×10^{9}\ \text{m}$
$v = 13060\ \text{m}⋅\text{s}^{-1}$
Saturn:
$M = 5.683×10^{26}\ \text{kg}$
$\mathrm{semimajor\ axis} = 1433.529×10^{9}\ \text{m}$
$v = 9680\ \text{m}⋅\text{s}^{-1}$
At closest approach, the distance $R = 654.96×10^{9}\ \text{m}$. The gravitational potential energy then becomes $-1.099×10^{32}$ joules.
The difference in speed $\Delta v = 3380\ \text{m}⋅\text{s}^{-1}$. Weighted by the relative masses that velocity is attributed to Jupiter for 23% and to Saturn for 77%. This gives Jupiter a kinetic energy of $5.76×10^{32}$ and Saturn $19.23×10^{32}$
So in conclusion, the kinetic energy is about 25 times too high for Jupiter and Saturn to be bound, so they will fly apart.
Comment: @Steve indeed. Peterh makes the same argument in his answer.
Comment: It occurs to me that, even without these detailed calculations, there's a more intuitive reason they couldn't be close to being gravitationally bound - if they were, the same rules of motion would apply even in the presence of the sun, so they'd already be orbiting one another and we'd call the smaller one a "moon", just like the earth/moon pair; or at least significantly disrupting each other's orbits.
Answer: I love Anders's answer — well done.
But you could have got the idea already by looking at orbit perturbations the planets inflict on each other: They are mostly negligible.
Come to think of it — it cannot be otherwise in a stable planetary system: During the evolution of planetary systems the orbits of planets which are too close to each other will be changed exactly because they are too close (relative to their mass). Their orbits will become irregular; they may be ejected from the system, collide with other bodies or come to rest in a new, more stable orbit. The stable state of a planetary system, and hence the look of any "mature" system, is one where the planets don't perturb each other's orbits.
In such a system, like ours, the central star's gravitational impact is orders of magnitude stronger than the planets'. (Some residual perturbations have an effect when accumulated over astronomical times and lead to resonances etc., but we are looking at one-time effects here.)
Even strictly empirically we can observe that Earth's trajectory does not depend significantly on the relative position e.g. of Jupiter. That fact is independent of the Sun: If it went AWOL Earth's trajectory would still not depend on Jupiter. it would look significantly different, namely mostly straight, because the Sun does have a significant impact on Earth's trajectory, as long as it's around. But as with an orbit, that straight trajectory would simply continue imperturbed.
Anders' computations showed that the same is true for the other planet pairings.
Answer: I see one possible way for this to sort-of happen.  Anders Sandberg did a good job of showing why a simple capture is impossible, but there's an extremely unlikely but not impossible scenario he missed.
Consider Jupiter and Saturn.  They're on the same side of the sun, Saturn is ahead of Jupiter.  The black hats kidnap the sun and they're free flying. Jupiter comes barreling up on Saturn, way too fast for a capture--but what if we have an offset impact event?  Jupiter will steal mass of Saturn but if exactly the right amount of energy gets transferred Saturn ends up with ever so slightly more energy than it needs to escape.  It then needs to run over a Jovian moon on the way back out, losing a bit of speed but changing the shape of it's orbit so its periapsis isn't within Jupiter's Roche limit.
The results are cataclysmic, whether you should even call the results the same planets is questionable.
Answer: Without the sun... at current orbital velocities... The planets would fly apart... But exactly how far would they fly? Would they continue indefinitely into interstellar space? Or would they fly out into the Kuiper belt or Ooort cloud and subsequently fall back toward some barycenter.
Removing the sun removes 99% of the mass of the solar system... so this could dramatically alter the barycenter of the system. Assume all/most planets are in one quadrant at time of sun's disappearance. Then presumably those planets with roughly similar trajectory would not have escape velocity relative to their shared barycenter.
Take for example the recent alignment of Jupiter and Saturn. There was definitely a window of time this year where if the sun had disappeared, Jupiter and Saturn would have formed an orbital system between the two, and had Earth or some other planet been behind them in orbit, overtaking them like a rock in a sling that, released at the precise moment, find its mark, that planet might get caught up in their system. (especially because our inner planets have higher velocities than more outer planets)
But if you could, with your hand of god, place the planets just so that they were least optimally arranged for the formation of an orbital system in the sun's absence... how far would they fly? Would they escape into interstellar space? I would think in 99% of planetary arrangements, this would happen since these planets are so tiny relative to the space between them and relative to their velocities and relative to the mass of the sun which is 99x the total mass of everything else in the solar system.
Comment: Escape velocity depends on distance, and at a distance of 4.4 AU, the mutual Jupiter-Saturn escape velocity is near zero.
Comment: Wikipedia actually says Sun constitues 99.86% of the solar system mass... that's a difference from 99%. Then where the "99% of planetary arrangements" number comes from?
Comment: The whole point of escape velocity is that the objects in question will not orbit each other at any distance if the escape velocity is exceeded, no? Also, there will be no Oort Cloud or Kuiper Belt, as all of those objects will fly apart absent the sun's gravity, too.


Are 'neurons' and 'feature detectors' the same? (in the context of neural networks)

Question: Are 'neurons' and 'feature detectors' the same thing in the context of neural networks? Are neurons feature detectors? Or is there some fundamental difference that I'm missing?
Comment: It might be helpful to specify whether you're talking about biological or artificial neural networks.
Answer: In short, no they are not the same.
In artificial neural networks as well as real neural networks inside the brain, features can be encoded in multiple ways. It might be helpful to have a concrete example. In biology, the visual system is often used as an example of neural encoding. I feel like it also provides a good illustration of how we could understand feature encoding in artificial networks. A presentation of feature encoding in the visual system can be found here: http://cdn.intechopen.com/pdfs-wm/332.pdf
In particular, take a look at figure 3a, which depicts encoding of an oriented edge in the retina. At the level of the input layer, rods and cones in the visual system, an oriented edge (a single feature) would be represented by the activity of a group of neurons. The hidden layer (bipolar cells in the retina) has a somewhat more abstract encoding that may be difficult to conceptualise. At the output layer (ganglion cells) the feature is encoded by the activity of a single neuron.
So at different levels of processing features can be encoded in different ways. In this example, the feature is encoded by a population of neurons at the input and by a single neuron at the output. In more complicated examples, the output may also involve activity from a population.
So far, we have implicitly assumed that neurons are normally off, and turn on when presented with a preferred stimulus, so that features would be encoded by a population turning on. But it's also possible to have more complicated schemes where features can be encoded in terms of the response amplitude, frequency and/or phase of a single neuron or population of neurons.
Answer: No, they are not the same.
In Convolutional neural networks, the features in the image are extracted using multiple Feature detectors. The result(convolved feature map) again is pooled (shrinking the image to reduce the size) and then the result of pooling step(matrix) is flattened into an array. This flattened array acts as the input layer of the neural network, which is fed to the hidden layer, which has neurons.


Distribution of stochastic integral in small time

Question: Let $W^1$ be a Brownian motion and $\sigma(\cdot)$ be a positive, bounded, continuous function. Define
\begin{align*}
V_t=\int_0^t\sigma(Y_s)dW_s,
\end{align*}
where $(Y_t)_{t\geq 0}$ is a deterministic function, so
\begin{align*}
t^{-1/2}V_t\thicksim N\left(0,\frac{1}{t}\int_0^t\sigma^2(Y_s)ds\right)\to N\left(0,\sigma^2(Y_0)\right),\text{ as }t\to 0.
\end{align*}
Does the Gaussian limit as $t\to 0$ still hold if $Y_t$ is no longer deterministic? Assume
\begin{align*}
dY_t & =\alpha(Y_t)dt+\gamma(Y_t)\left(\rho dW_t+\sqrt{1-\rho^2}dZ_t\right),\\
Y_0 & =y_0,
\end{align*}
where the initial value $y_0$ is deterministic, $\rho\in[-1,1]$, and $Z$ is a Brownian motion, independent of $W$. Then, if I'm correct,
\begin{align*}
\mathbb{E}\left(t^{-1/2}V_t\right)&=0,\\
\text{Var}\left(t^{-1/2}V_t\right)&=\frac{1}{t}\int_0^t\sigma^2(Y_s)ds\to\sigma^2(Y_0)
\end{align*}
but is the limiting distribution as $t\to 0$ Gaussian (under any circumstances)?
Answer: Yes, and it doesn't depend on $\alpha$, $\gamma$ or $\rho$. Fix $\theta\in\mathbb{R}$. Then, define $M$ for $t\ge 0$ by
$$ M_t = \exp\left[i\theta\int_0^t\sigma(Y_s)dW_s+\frac{\theta^2}2\int_0^t\sigma(Y_s)^2ds\right].$$
As $\sigma$ is bounded, $M$ is a martingale (with $M_0=1$). Fix $t>0$ and $u\in\mathbb{R}$. Set $\theta = \frac{u}{\sqrt{t}}$ to get
$$\mathbb{E}\left(\exp\left[\frac{iu}{\sqrt{t}}\int_0^t\sigma(Y_s)dW_s + \frac{u^2}{2t}\int_0^t\sigma(Y_s)^2ds\right]\right) = 1.$$
By Cauchy-Schwarz, or other estimates,
$$\mathbb{E}\left(\exp\left[\frac{iu}{\sqrt{t}}\int_0^t\sigma(Y_s)dW_s\right]\left(\exp\left[\frac{u^2}{2t}\int_0^t\sigma(Y_s)^2ds\right] - \exp\left[\frac{u^2}{2}\sigma(y_0)^2\right]\right)\right)$$
converges to $0$ as $t\to 0$.
So
$$\lim_{t\to 0} \mathbb{E}\left(\exp\left[\frac{iu}{\sqrt{t}}\int_0^t\sigma(Y_s)dW_s + \frac{u^2}2\sigma(y_0)^2\right]\right) = 1.$$
Hence we are done by Lévy's Continuity Theorem.
Comment: @ Ben Derret: Very nice I thought it wasn't true. I really learned something today Sometimes thank you. Best regards
Comment: @TheBridge Thanks!
Answer: Hi your first assertions are true because $\sigma$ is bounded so that $V_t$ is a martingale, this gives the null expectation result and then by Itô's isometry you get the convergence result for the "averaged" variance.
Regarding the distribution here I am quite convinced that it is false, to prove it under milder hypothesis than yours, I would suggest that you try a smooth $\sigma$ and use a euler scheme to approximate $Y$ in small time and look at a Taylor expansion to try to see how the integral behaves in that case, I am quite sure (but I can be wrong) that you might be able to find nice (or bad) $\sigma, \alpha, \gamma$ that makes $V_t$ non gaussian even in small times.
Best regards


jMeter thread running capacity

Question: I am wondering if there is a way to know how many threads JMeter can support for a given machine configuration? Currently, I am working toward a task that requires me to check how many VMs I need to support different API threads.
Comment: you can scale jmeter with thousands on threads using plugin i developed: https://github.com/nirmal-mewada/jmeter-loom
Answer: There is one: measure it.

Make sure to follow JMeter Best Practices
Make sure to set up monitoring of baseline OS health metrics like CPU, RAM, Network, Disk usage, etc. If you don't have better options you can consider using JMeter PerfMon Plugin for this.
Start with 1 user and gradually increase the load at the same time looking at resources consumption
When any of the monitored metrics starts exceeding i.e. 80% of maximum available capacity stop the test and record how many threads (virtual users) were online at very that moment. You can check it using i.e. Active Threads Over Time Listener)

This is how many users you can simulate from particularly this machine for particularly this test, if you change machine or .jmx test script - you will need to repeat the measurement.
Answer: There is no straightforward answer to determine the number of threads that JMeter can support for a given machine configuration. The number of threads that can be supported depends on various factors, including:

Machine Configuration: Processor type, RAM, and available disk space
Network Configuration: Network Bandwidth, Latency, and JVM network configuration.
Test Scenario: Number of requests, type of requests, size of requests and response.
Test Configuration: Number of loops, ramp-up time, think time, etc.
JMeter Configuration: JVM memory allocation, Garbage collection settings, etc.

To determine the number of threads that a machine can support, you can perform load testing using JMeter and monitor the performance of the system under different load conditions. You can increment the number of threads until you reach the maximum capacity of the system. This is commonly referred to as the maximum throughput that a system can support.

jMeter thread running capacity


I want to study all 613 Mitzvot in depth. Can someone recommend a good book for me to read dedicated to that topic?

Question: Other than the Mishnah and the Talmud , are there any books that give in-depth commentary, explanation, and context for each and every mitzvot? I'm only referring to books soley focused on the topic of the 613 mitzvot.
Comment: I found this book on amazon but I don't know if its high quality. 613 Mitzvot: A Contemporary Guide to the Commandments of Judaism https://a.co/d/j9brbem
Answer: One of the classics is Sefer HaChinuch.
It's available online here in Hebrew and English.
Answer: This is a wonderful intention, I did it a few times both alone and with my daughter and it is a great way to acquire broad knowledge.
As Joel K indicated, the classic way to acquire this learning is through Sefer Hachinuch, which brings for each of the 613 mitzvot (according to the Rambam's list) its description, purpose (an innovation on its own since the Torah rarely describes it), a summary of its laws and to whom it applies.
Artscroll has a truly excellent elucidation that covers 10 volumes (here) and is the gold standard in English. The challenge is that it is very broad and deep, and takes a few months of consistent learning.
Two ways to ease your learning and potentially help you decide whether to engage more deeply are

the Concise Sefer HaChinuch, an abbreviation written by R Asher Wasserman in one volume - I started there and found it an excellent start
use the larger version but study only the commandments, which can be performed today (ca. 270 of the 613, see here and here). The Chofetz Chaim has a small book describing those: The Concise Book of Mitzvoth. It can serve as a wonderful "appetizer" for the others
Comment: So helpful thank you very much! ✌


Are there any Ubiquity System blogs?

Question: There are many D&D, Pathfinder or generic RPG blogs, but are there any Ubiquity System or Hollow Earth Expedition blogs out there?
Answer: Blogs for Ubiquity can be found at:

Sechin Tower, as mentioned by Nestor has great material for running pulp adventures
The Black Campbell's blog has entries on Ubiquity in general and HEX in particular from time to time. He tends to produce posts on how to run games, play reports, and gear stats.
Casting Shadows, my blog, has a slowly growing collection of material for HEX, All for One, and Desolation. I tend to post entries on using the system, running heroic pulp action games, adventure seeds, and settings.

Resources for Ubiquity can be found at:

Mythic Eras, although it does not have blog articles per se. The site has a forum, and links to adventures, alternate rules and settings, and the Danger Magnet magazine.
The Hollow Earth Expedition page of John Kahane's Emporium used to have a wealth of links to all sorts of useful resources, such as specific historical information for the period. It is sadly no longer available.
Each line has its own forum as well, where lots of information can be shared and discussed:

HEX
Desolation
All for One: Regime Diabolique
Comment: Mythic Eras is currently down for renovation
Comment: Mythic Eras is back!
Comment: exilegames.com is dead
Answer: A german Ubiquity-Blog called ubiHEX.
Answer: Sechin Tower, whose a lead developer for Exile Games, has a writer's blog that includes material about pulp gaming with HEX and in general. That's one.

Are there any Ubiquity System blogs?


How to rotate a vector by a given angle about a given axis

Question: Let's call the angle $\theta$, and the axis $\underline{\text{n}}$. I'd like to rotate a 3 dimensional vector $\underline{\text{v}}$ by $\theta$ about the $\underline{\text{n}}$ axis. I know that the rotation matrix $\underline{\underline{\text{R}}}$'s elements are $R_{kl}=\cos(\theta)\delta_{kl}+n_kn_l(1-\cos(\theta))+\sum\limits_{m}\epsilon_{kml}n_m\sin(\theta)$, but I'd like to do it a different way: Transform the vector to a different basis, where $\underline{\text{n}}$ is the z axis, and rotate there:
$\underline{\underline{\text{R}}}\underline{\text{v}}=\underline{\underline{\text{A}}}^{-1}\underline{\underline{\text{R}}}'\underline{\underline{\text{A}}}\underline{\text{v}}$
Where $\underline{\underline{\text{R}}}'=\begin{bmatrix}
    \cos(\theta) & -\sin(\theta) & 0 \\
    \sin(\theta) & \cos(\theta) & 0 \\
    0 & 0 & 1
\end{bmatrix}$
But I'm having trouble with finding the $\underline{\underline{\text{A}}}$ matrix. Is there an easy way to find it?
Answer: The problem you're having probably arises because given $n$, there's no "natural" way to pick $v_2$ and $v_3$.
Because $n$ is a unit vector, you can regard its "tip" as a point on $S^2$. Then $v_2$, as a vector perpendicular to $n$, is a tangent vector to $S^2$ at the tip of $n$. If there were a continuous way to choose $v_2$ as a function of $n$, you'd have a continuous everywhere nonzero vector field on the 2-sphere, which would contradict the "hairy billiard ball" theorem -- that for every vector field on the 2-sphere, the algebraic sum of the indices at the zeroes of the field is two, hence, there must be someplace where the vector field is zero. So that's a proof that there's no continuous way to get $v_2$ from $n$.
That being said, if you assume that $n$ has a nonzero $z$-component, so
$$
n = \pmatrix{a \\ b \\ c}
$$
with $c \ne 0$, then there's an easy way to pick $v_2$, namely,
$$
w_2 = \pmatrix{-c \\ 0 \\ a}\\
v_2 = \frac{1}{\| w_2 \|}
{w_2}
$$
Because $c$ is nonzero, the vector $w_2$ is nonzero, so it can be 'normalized' to get $v_2$. You then pick $v_3 = n \times v_2$.
What if the $z$-component of $n$ actually is zero? Then you suppose that the $y$-component is nonzero and do something similar. What if the $y$ and $z$ components are both zero? Then $n = \pm e_1$, and you pick $v_2 = e_2, v_3 = e_3$ and you're done.
Note that this sequence of "what do you do if ...?" things amounts to a piecewise definition of $v_2$ in terms of $n$, and the piecewise-ness is exactly what makes continuity fail.
post-comment addition
Once, starting with $n$, you've produced $v_2$ and $v_3$, I'd be inclined to form a matrix  $A$ whose first column is $n$, whose second column is $v_2$, and whose third is $v_3$. (I've altered $n$ above to be a column vector so that this makes more sense.) If you do this, then $A$ will be orthogonal, so that $A^t = A^{-1}$, and
$$
A \pmatrix{1 & 0 & 0 \\ 0 & c & -s \\ 0 & s & c} A^t
$$
(where $c = \cos \theta, s = \sin \theta$) will be the rotation matrix you're looking for.
So I've put the rotation in the $yz$-plane rather than in the $xy$-plane. If you want it in the $xy$-plane, you'd want to set the columns of $A$ to be $v_2, v_3, n$, in that order.
Comment: This way the $A^{-1}$ will look like $\begin{bmatrix}
    (v_1)_1 & (v_2)_1 & (v_3)_1 \\
    (v_1)_2 & (v_2)_2 & (v_3)_2 \\
    (v_1)_3 & (v_2)_3 & (v_3)_3
\end{bmatrix}$ in the $A^{-1}RA$, and I will need to rotate around the $v_1$ axis?
Comment: See edits above.
Comment: Thank you for covering everything. It's much easier to remember (and also to prove) it than the R matrix I've given above.
Comment: Actually, the R-matrix you've given above comes from Rodrigues' formula, which is pretty simple to prove. (You can see the proof in *Computer Graphics, Principles and Practice, 3rd ed*, on which I'm the lead author, among other places.) If you write $$R = c\mathbf I + (1-c) \mathbf {n n^t} + s U$$, where $U = \pmatrix{0 & -c & b \\ c & 0 & -a\\ -b & a & 0}$ is the matrix of the transformation $v \mapsto n \times v$, then it's clear that $Rn = n$, and if $v$ is perp to $n$, then $Rv = cv + (1-c)0 + s n \times v$, which represents rotation by $\theta$ in the plane perpendicular to $n$.
Comment: I've seen my teacherderiving it on a black board, with vectors and also quaternios, but it was fast and required too much visualization. But I'm going to check your book, it might be understandable.
Answer: Consider the new basis $B=\{v_1=n,v_2,v_3\}$ and the matrix
$$M=[v_1 \quad v_2 \quad v_3]$$
which represent the change of basis from B to the standard, that is
$$v_S=Mv_B \implies v_B=M^{-1}v_S$$
thus since in the base B the rotation of $v_B$ is given by
$$w_B=R'v_B$$
in the standard basis we have
$$w_B=R'v_B\iff M^{-1}w_S=R'M^{-1}v_S \iff w_S=MR'M^{-1}v_S \iff w_S=Rv_S $$
Comment: @Botond you need two vector orthogonal to n and each other.
Comment: This is what I've done so far, but I can't find the M matrix. What properties should the basis vectors satisfy in B?
Comment: With $v_1=n$, the rotation axis in B will be the $v_1$, right?


Stuck on finishing import (from external hard drive to computer hard drive)

Question: I started the process of importing my iPhoto library from an external hard drive to my Mac with a newly replaced hard drive.  I have roughly 180,000 photos and it looked like it was uploading all day.  Now it seems to be stuck on "finishing import".  Do I just wait?  Is this a lengthily process, too, or is it really just stuck?
Comment: If you end up canceling this current import, I recommend the second time over importing the photos incrementally - say 40K at a time. That is a *huge* collection of photographs and the machine could get easily hung importing, caching, and indexing all the data being processed.
Answer: If you are not sure if the process is actually doing something or just stuck, you can get an idea from the following
Activity Monitor
/Applications/Utilities/Activity Monitor.app

See if the process is frozen. In that case activity monitor should
show the process/App (iPhoto in your case) in red color. If it is
red, there is a high probability that the app is "hung".
See if the process is actually doing something on the CPU or Hard Drive.

If you see something going on there, it is highly possible that it is still doing something.
If you don't see anything, you may want to check Console:
Console.app
/Applications/Utilities/Console.app
Console shows error messages that the app may have generated to give some idea on what is happening.
Note that both these are indicative and may not be 100% accurate. In the worst case you may have to import again (I would search Google for any issues with importing large iPhoto libraries before trying again)
This is a snapshot of my activity monitor, I have selected QuickSilver and it shows 59.0 MB Bytes Read and 27.6 MB under Bytes Written. This data is dynamically refreshed so you can get a fair idea of the disk usage of an app. The same for CPU. Memory may not be a very good indicator though, even if an app has frozen it may still use memory.
Answer: I found this post because my large Photos import appeared to be stalled too. The Activity Monitor is a good way to at least see that Photos was doing something. But it's a bit frustrating not being able to see why it's stopped at one specific file and that there's no telling how much time it will take - there's just no basic way of seeing the problem.
I closed all other apps and processes and let my iMac chew through it for about two hours. When I came back there was an error window that said it couldn't import 16 specific files, which all turned out to be .pdf file types.
So I think the lesson here is to verify the only file types that are being imported are acceptable formats.


Falling Chain help!

Question: I was going through Example 9.2 in Thornton and Marion's Classical Dynamics, and I am stuck on the Potential Energy part of the Question. How do they get the term at the top of the page on the right? I understand how to reach U0, but getting from there to U is really confusing me. P = linear mass density "M/l", length "l" and mass "M", with "x" being distance traveled by the falling end of the chain.
Comment: What do you think the expression for $U$ should be? What exactly is confusing you?
Answer: In sketch (a), if we assume, b, is the total length of the chain, then the gravitational potential energy is mgh, where m = ρb, and h = - b/4 (measured down with the zero potential chosen at the top). This is consistent with his formula if you set, x = 0.  For sketch (b), The total length (down and up) is, (b+x).  The left side P.E. = -ρ[(b+x)/2]g(b+x)/4.
The right side P.E. = -(ρ){[(b+x)/2]-x}g[({[(b+x)/2]-x}/2)+x]. You must add these two.

Falling Chain help!


Django: Structure Django Model to allow Arbitrary Fieldtypes

Question: I'd like to make a user profile app in Django (I know there are some that exist, thanks) and I'm wondering how you would structure the models to allow for an arbitrary combination fields in each sub-section.
As an example, the section 'education' may have a sub-section called 'Programming Experience', and the section 'personal info' may have a sub-section called 'favourites'.
Thinking in terms of a typical side bar navigation setup each section would be a header, and each sub-section would be a link to a form where the information can be manipulated.
Education
- Schooling
- Programming Experience

Personal Info
- Location
- Favourites
- Look a-likes

What I'd like to do is be able to add items to the sub-sections on an Arbitrary basis. Whatever the feel of the site calls for.
Maybe one site would benefit from photos of the school a user attended, while another might only need a description.
I'd like to use the admin interface to add these field types to the sub-section. So adding an item would present the choice of what type of information it is (image, video, text, etc) and what sub-section it's to be applied to.
I'd like to know how you would accomplish this; and more importantly, by jumping through as few hoops as possible.
Thanks.
Edit:
To hopefully clarify the question I'll provide a sample models.py file. This is just a quick moch-up to demonstrate the problem more accurately. I have two solutions in mind, and I think solution two will work better than solution one; but I'd also like to here what the SO community thinks and if they have any other solutions of their own.
**models.py**

class Section(models.Model):
    """
    The root of categorization. Acts much like a header
    """
    name = models.CharField(max_length=30)
    description = models.CharField(max_length=255)

class SubSection(models.Model):
    """
    The contents of each section. Contains many items of varying types as needed
    by the site developer.
    """
    name = models.CharField(max_length=30)
    description = models.CharField(max_length=255)
    section = models.ForeignKey(Section)

class Item(models.Model):
    """
    I would like this to store the information here and have a foreign key to the
    'SubSection' table. The problem is that there are a lot of different information
    types that can be stored and I'd need a row for each type. Thus for each
    entry most of the columns will be blank.

    I'm thinking that it may be better to use this table as a pointer to another
    table that actually contains the information. This will result in a lot of
    tables but will eliminate waste.
    """

    name = models.CharField(max_length=30)
    description = models.CharField(max_length=255)
    sub_section = models.ForeignKey(SubSection)

    ### Solution One
    # Storing the info here results in a lot of wasted space and may not be all
    # that flexible
    image = models.ImageField()
    text = models.CharField(max_length=255)
    numeric = models.IntegerField()
    time = models.TimeField()
    # etc ...

    ### Solution Two
    # Storing the field info results in more tables but allows for a better match
    # of information and field type.
    field_type = models.CharField(max_length=255)
    field_properties = models.CommaSeparatedIntegerField(max_length=None)

### Solution Two Tables
# Solution two would require a table for each field type supported here, which
# is quite a few different types.

class ImageStorage(models.Model):
    item = models.ForeignKey(Item)
    information = models.ImageField()

class IntegerStorage(models.Model):
    item = models.ForeignKey(Item)
    information = models.IntegerField()

### etc ...

Just keep in mind it's targeted at user profiles. So a weight loss site may want the users current weight in the profile (numeric information) while a travel site may want a list of places visited (text information, could even use the IPAddressField I suppose). I just have no idea what will pop up so I'm trying to make it as generic as possible.
Answer: If I'm understanding you properly, the simplest way to do this would likely be a many-to-one relationship. I'm not sure if you wanted these on a per-user or per-site basis so I'll assume you want to customize it per-site (switching that is easy).
Create a table that looks something like this:
class Section(models.Model):
    section = models.CharField()
    sub-section = model.CharField()
    site = models.ForeignKey(Site)

For multiple subsections that belong to the same section, simply give them the same primary section name so that you can query the DB for the accompanying subsections using that name.
Another way would be to use two tables to accomplish the same thing, but given the application I think this might be more appropriate.


What to look for in a motor?

Question: I am going to be making a small robot using a Arduino Mega ADK Rev3 with 4 motors, and about a pound of other stuff. This is the first time I'm doing any major hardware project, so I'm not really sure what to look for in a motor.
Comment: What are the motors being used for?
Comment: A small robot, doesn't carry any load besides itself, just to cruise around. When I say small, I mean about the size of a sheet of paper, but much taller ofcourse :p
Comment: So they're used to drive the wheels? Treads?
Comment: Drive the wheels
Answer: There are a few primary specifications you should look for in a motor:

The type of the motor. There are a variety of different electric motors out there. In my experience the cheapest ones are brushed DC motors. These are fairly simple to drive: you send the motor a PWM signal and it spins faster with a higher duty cycle. Reverse the polarity and they spin the other way. I'm guessing this will probably fit your project the best.
Electrical characteristics. This includes the nominal voltage the motor runs at, what the stall current is, and what the rated current is (note: the rated current doesn't necessarily have to be greater than the stall current). Most DC motors I've used which are capable of driving semi-small to medium sized robots (about what size you have, though probably heavier) run in the 12-24V range so you may have to plan your battery packs accordingly. The stall currents has varied anywhere from a 1-2 amps to over 30 amps.
Mechanical characteristics. This includes the no-load speed of the motor, the stall torque of the motor, and any other mechanical characteristics such a rated torque or any gear ratio present (if in a geared motor). DC motors have a linear torque to speed ratio, i.e. they develop the maximum torque when stalled which decreases until the motor is spinning at it's maximum speed. The speed-power curve increases until the motor reaches half the no-load speed and then decreases. Typical DC motors have a very high no-load speed. Most I've seen vary between ~5000 rpm up to ~20000 rpm, though much high rpm ranges are definitely available.

Here's how I would determine what kind of motor to look for:
First I would figure out what kind of speed I want my robot to achieve. Next I would determine roughly how much my robot weighs. I would do a quick survey of what motors are available keeping in mind the mechanical characteristics. A quick calculation of the max speed of a robot is:
$$speed_{robot} = diameter_{wheels} * \pi * speed_{motor} / gear~ratio
$$
The required torque is a trickier quantity to calculate as you'd need to know what kind of friction/resistance your robot is going to encounter and know roughly how much your robot weighs. Assuming rotational inertia of the wheels is small compared to the mass of the robot (and if I did my math right), the ideal speed of the robot vs. time is given by:
$$
V(t) = w_d \cdot \pi \cdot \omega_{NL} \cdot ( 1 - e ^ {\large{- \tau_S / (2  \pi \cdot m \cdot \omega_{NL}) t}})
$$
Where:
$$V(t) = robot~speed$$
$$w_d = wheel~diameter$$
$$\omega_{NL} = no-load~motor~speed~(including~gear~ratio)$$
$$\tau_S = stall~torque~(including~gear~ratio)$$
$$m = mass~of~robot$$
$$t = time$$
$$\pi = 3.14...$$
$$e = 2.72...$$
You can add the torque of all the drive motors together.
I would then design the electrical systems to fit the required electrical characteristics of the motor. This includes the motor driver, battery packs, and any wiring.
Gear ratio is the ratio between the input speed divided by the output speed of a gear box. They are used to speed up or more often slow down the output drive shaft speed. As a consequence of the speed ratio change the output torque also changes. In an ideal gear box with 100% efficiency the gear ratio is equal to the output torque divided by the input torque. This is mostly true for real gear boxes, but in reality most gear boxes lose ~2% between gear mesh (note that this relation is exponential as each gear mesh produces an input/output set, so for a gear box with 12 meshes the efficiency drops from 100% to ~78.5%).
Comment: :P I'm actually a mech-e, so I've used pi=e=3 many times. Or more often, I just type "pi" or "e" and the computer computes it to machine precision and I chop all but a few sig figs.
Comment: Say, you're not a physicist, are you? To an EE e = 2.72, and pi = 3.14 (sometimes just 3). How accurate do you want to express speed, and how many of your significant digits will be correct?
Comment: Thanks for the answer, could you explain gear ratio though?
Comment: added a section about gear ratios.
Answer: This is a very complicated issue. It entails a lot of questions. For instance: what kind of motor are you going to use? Are you going to use a gearbox? How heavy is the battery? How heavy and strong is your robot enclosure?
Motors are characterized by their speed/torque curve. You'll find that most electric motors are not capable of achieving high torque for small speeds, like the speed you'd expect from a mobile robot wheel. What that essentially means is that you won't be able to move an inch when the motor is set to move very slow. That's why you either need to use e.g. a stepper motor (which is very powerful even at low rpms) or a gearbox. You can find DC motors with a built-in gearbox.
A lot of this design will be about tradeoffs: if your motors are weak and heavy, their own weight will diminish the efficiency of the entire robot. If you have a heavy battery, you need stronger motors. Stronger motors will be heavier, and also suck up more current. So you'll drain the battery faster. So you need a higher density battery, and a motor which has a high torque/weight ratio. But those are expensive!
And so on and so on. This is an issue of optimization.
When I built my first mobile robot, I used this tutorial. It covers all aspects of building a robot, including the motors (actuators).

What to look for in a motor?


Is it bad to up-vote low-reputation posters more?

Question: I never planned this out, but I found myself more inclined to up-vote people with lower reputation. Is this something you guys experienced, and do you think it's unfair?
Comment: Is their contribution good? No problem. If not...bad Hassan...bad.. It's funny actually because not that long ago someone argued that people would be far more inclined to upvote high rep users.
Comment: @Bart [Here you go](http://meta.stackexchange.com/questions/133511/does-a-famous-name-on-an-answer-gain-more-upvotes-than-a-stranger).
Comment: Really? Could you post a link?
Comment: I'll do so when I find it. Not sure if that particular question remained.
Comment: @razlebe Bingo!
Answer: It's unfair, of course, by definition.
I'm also inclined to up-vote particularly good content from a newer or lower-rep users... this may be due more to surprise ("Look, somebody is paying attention and trying!") given their experience on SO.
All good, on-topic, reasonable content deserves upvoting, regardless of the user.
That said, an upvote for new users' content is likely more motivational than with higher-rep users.
Increasing the amount of well-maintained content while growing participation is what makes SO neat.
Comment: +10 Looks like you could use some meta upvotes... Oh... and your answer is pretty good too ;)
Comment: @AndrewBarber My manipulation is more devious and difficult-to-detect.
Comment: I don't agree that it's unfair.  The more rep you have, the more your answer is trusted, and the greater the expectation of a quality answer.  I think it would be more unfair to judge new users against the same standards as those who've been around for years.
Comment: +3, because I think +10 is too much! ;) I like how you covered both angles succinctly, and suggested an answer without any appearance of dictating a behavior.
Comment: *"Look, somebody is paying attention and trying!"* Some days that *really* is a surprise, and it is worth encouraging.
Answer: Upvotes encourage and denote good content. When a new user posts I am more inclided to remember to vote to encourage this behavior. There's absolutely nothing wrong with wanting to encourage new users in particular; this is why I'll often take a peek in Review and upvote good First Answers/Questions.
Don't just upvote people because they're new or if they clearly aren't contributing quality content, but there's nothing wrong with encouraging those who stand to gain the most from the encouragement. If you upvote Jon Skeet he won't even notice. If you upvote a brand new user who posted a good question/answer you might actually help encourage them to stay around and help the site for weeks/months/years to come.
Comment: The first few upvotes/accepts give a fantastic feeling for a new user.  If the content is indeed worthy of encouragement then it's a win-win situation...
Comment: Agreed; As much as my flagging, commenting and voting tends to hit hard on 'new' users (often illegitimate/bad ones, but still), I like to balance that by seeking good content from new users to encourage.
Answer: To drive up the quality of both questions and answers, it would be ideal for everyone to vote based on a cold appraisal of the question, and not for any other reason.
However...
As Bart pointed out in the comments, it was recently argued in a seperate question that up-voters might be more inclided to favour high-reputation users. (Indeed, I was one of those who posted an answer making the argument for that being likely.)
What's clear from these two questions, and from countless examples across SO where upvotes and downvotes are cast with seemingly no explicable reason, is that users can and do upvote for whatever reasons they like, (and this is not a comprehensive list, of course:)

Some will favour a low-rep user's questions, whether to encourage them or out of sympathy for their low rep.
Some will favour a high-rep user's contributions, maybe because their high-rep implies some experitse, or maybe because they are a famous name with "real" reputation outside of the concept of SO rep.
Some will vote for questions and answers following a cold appraisal of their individual merits, regardless of who the OP is and his/her reputation. Surely this is what we should be aiming for in order to drive high quality standards.
...and some will vote for whatever reason pops into their heads: because it's Tuesday; because they like the OP's gravatar; because they're voting tactically to bag some badge or other; or because they just do.

My point then, long though it's taken me to make it, is that there's really no telling why people vote the way they do unless they're willing to tell you; that we shouldn't read too much into voting patterns; and that in an ideal world, to keep quality standards high, a cold appraisal of any given question should be the only criteria used to vote.
Comment: It's Wednesday, otherwise I'd vote this up.
Answer: I think it depends on what you are calling "new users". I think it's fair until ... well ... between 1 and 15 or 1 an 25. That lets them (us ? me at least ;)) discovering the happiness of being considered as "someone who is interesting". I got self caught up by the game.
Nevertheless, when I vote up, it's often because I'm interested in the thread, more than this is new posters.
When I posted for the first time on Meta StackOverflow, this was probably a duplicate. I was not sure of that, and I said that I would delete it, if true. But, peoples voted up for me, and I feel reasonably confident for future questions.
Don't mistake, I am not saying that whe should vote up for every questions of each begginers. I recently obtain vote down privilege, and I founded many situations in which I'd prefered vote down than up. But for new members who make some efforts (understandable english, explaination, reaseaches), I am also inclined to up-vote.
I don't want to give a straight range (1 to 25 for instance), especially since I am not registered for so long (6 monthes). However, until you obtain the privileges of voting up, I think this is fairly positive.
Answer: I hate pile-on downvoting.
Negatively scored posts aren't given the benefit of the doubt and are downvoted as an afterthought.
When posts get to be around -10, people are even more likely to downvote (especially if it is a question, since negative votes don't cost any reputation). This forms a pretty significant reputation-sink that is difficult to escape.
In these cases, given that downvotes are -2 and upvotes are +10 for answers and +5 for questions, I would say that this is behavior is perfectly reasonable. The "sympathy upvotes" are all that is preventing these users' reputation from going down the drain.
Comment: if you get -10+ on your question and don't make an effort to fix/ clarify your question, I'd say you deserve to get dragged down for it.  had one the other day, -21 last I saw (it was a bad question) and all he did was call people names and spam the downvote on all his answers.
Comment: I agree... I'd probably downvote the question too from what you've described. But there are also questions out there that are perfectly reasonable and don't deserve to be downvoted at all... those are the questions I'm talking about.
Comment: Some people are quite downvote-happy and the criteria are loose.  I'm still a fan of requiring a comment on downvotes or it doesn't count.
Comment: *When posts get to be around -10, people are even more likely to downvote* I am curious where you get that idea. I have *never* downvoted a post that low, and almost never DV if a post is below the "visibility affecting" threshold, on the theory that the point has been made, and my vote is better spent elsewhere.
Comment: @AndrewBarber, well I was mostly talking about questions (which can't be deleted if someone has already answered it). Most people will delete answers before they can even make it down to -10, and yes, I agree with your "visibility affecting" threshold argument. But I certainly think that questions with around -10 downvotes are more likely to get downvoted than questions with, say, -2. You are clearly an experienced SO user who knows better, but the majority of users will downvote these posts mindlessly.
Comment: @AlexLockwood I don't want to give an incorrect impression; I don't think my personal experience here gives me a significant greater insight on this than you. I *do* think that the claim you make would have a clearly visible effect on the actual voting data, though. But deletion *could* skew that data. (related: questions can be deleted by their owner if there are no *upvoted* answers. Also, heavily-downvoted questions tend to get closed/deleted by the community, which can be done regardless of answers.)
Comment: I couldn't agree with you more. When one person down-votes for what could be an erroneous reason, others follow suit. I think the same thing happens with [up-votes](http://meta.stackexchange.com/questions/9731/fastest-gun-in-the-west-problem).
Comment: You're right... but I don't mind as much about the upvotes ;-)
Answer: There's some value in encouraging participation early on.  I would say my standards for a good answer go up as the rep goes up.  An adequate answer from a 200 rep user will usually get an upvote from me; the same answer for a 10K+ user will not get an upvote without being complete.  At that point they should know better and hold themselves to a higher standard.
Comment: So what you are saying essentially is that the user (and his/her rep) matters just as much as the content.  I don't think that's the correct way to vote.  A correct answer is correct no matter who posted it.
Comment: Well, we are discussing opinion here, but an answer from someone with a 10K+ rep has more weight and is treated more seriously, don't you think?  Keep in mind the definition of "reputation"
Comment: It shouldn't... I've seen v.high rep users post absolutely useless answers.  Doesn't matter who you are or how much rep you have - if you don't put some effort into your posts the votes will reflect that.
Comment: "It shouldn't" and "what is" are different things.  High-rep users are more trusted, it's the purpose of rep in the first place.  Likewise, if a low-rep user posts an ugly answer, I am much more likely to comment why I think it's ugly vs. a high-rep user who I will downvote with a polite admonition.
Answer: I don't think is the best of the ideas, but it should not be big deal if you follow some kind of voting criteria.
My criteria for upvoting on posts that wouldn't normally vote up:
Questions:

he is low rep (250 or less)
he showed some effort to solve the problem before posting
he took appropriate time to the esthetic of his post
the post doesn't have many of votes like this

Answers:

he is low rep (250 or less)
answer works
doesn't use notably bad practices
there are notably better competing answers with tons of upvotes
the post doesn't have many of votes like this

If it doesn't met with ALL points, I will then vote normally