summary
stringlengths 15
147
| text
stringlengths 1
19.3k
| answer
stringlengths 32
22.6k
| labels
float64 0.33
1
| answer_summary
stringlengths 5
164
|
---|---|---|---|---|
Does one need a visa to visit Antarctica? | What is the status of Antarctica in terms of visa regulation? Does one need a visa to visit Antarctica? If so, which country does issue such a visa?
| There are seven countries which have territorial claims on parts of Antarctica: Britain, France, Australia, New Zealand, and Norway, which all recognize each other's claims; and Chile and Argentina, whose claims are disputed.
In practice, however, all claims are suspended under international treaty, and there are no checkpoints or immigration officers. For most people, a visit to Antarctica consists of a flight over it or a ride on a ship through its waters, neither involving disembarkation and thus both avoiding immigration formalities.
Land tourism does exist, and a permit is required. The vast majority of visitors will arrive by commercial ship or helicopter, and the tour operator is responsible for obtaining the necessary permits. You may, of course, need a visa for the country where your tour is departing from.
To land on the continent in a private vessel such as a yacht, you would need to obtain a permit yourself from your own government, if your country is a signatory to the Antarctic Treaty System. For example, Britons would apply to the Foreign and Commonwealth Office, Polar Regions Department; Americans would file the DS-4131 Advance Notification Form – Tourist and Other Non-Governmental Activities in the Antarctic Treaty Area with the Department of State’s Office of Ocean and Polar Affairs
Due to Antartica's extreme physical conditions and remoteness, only a few dozen yachts make the trip each year, and there are special yachting guidelines for Antarctic cruises.
For a list of tour operators, see the International Association of Antarctica Tour Operators.
| 1 | There are seven countries which have territorial claims on parts of Antarctica: Britain, France, Australia, New Zealand, and Norway . |
How do I make the country field unrequired? | In the addressbook I already made the telephone field unrequired by setting the field is_required to 0 for attribute with the attribute_code "telephone" in the eva_attribute table. I searched for an attribute with the attribute code "country" but I just found "country_id".
(Yea and I already copied the abstract.php into the local code folder and commented out the two if-s in the function _basicCheck(). And I removed the class="required" in edit.phtml and shipping.phtml)
The reason I want to make it not required is because it is blank and even when I found a solution and it showed countries and I pressed "Save Address" the error poped up that "Country is a required field". So a soltuion for making the country drop down work would also be very nice.
| The address validation is done in Mage_Customer_Model_Address_Abstract::validate.
You need to copy this class in the local folder (because you cannot rewrite it in a clean way) and remove the lines that validate the country
if (!Zend_Validate::is($this->getCountryId(), 'NotEmpty')) {
$errors[] = Mage::helper('customer')->__('Please enter the country.');
}
| 1 | Address validation in Mage_Customer_Model_Address_Abstract::validate |
Why is the result not 1? | int m = 0;
m += m++;
System.out.println(m);
prints to 0
but i thought m will be post incremented and finally be 1.
Would someone please explain.
Note: i know how post increment works (atleast i think i do :P). But what i am trying to figure out is that when i say m + = m++ lets assume it means m = m + m++ which will evaluate m++ after sending the value of m, 0 in this case, and evaluate to m = 0 + 0 then increment the value of m because of the post increment. now if post increment has occured, why is m not 1
| The sequence of events is:
The RHS is evaluated (0)
The post increment is done (m++).
The evaluated result is assigned (m=0 again).
i.e. this is equivalent to:
tmp = m;
m++;
m = tmp;
If you did m = ++m, the sequence would be:
The pre increment is done (++m).
The RHS is evaluated (1)
The evaluated result is assigned (m=1).
| 1 | The RHS is evaluated (0) The post increment is done |
Equivalent of Java 1.6 @Override for interfaces in C# | This question gives the answer that Java's @Override has the C# equivalent of the override keyword on methods. However, since Java 1.6 the @Override annotation can be applied to interfaces also.
The practical use for this is that in Java you get compile errors when a class claims it implements an interface method when it no longer does (e.g. if the interface method is removed). Is there equivalent functionality in C#?
Some code examples:
Java:
public interface A {
public void foo();
// public void bar(); // Removed method.
}
public class B implements A {
@Override public void foo();
@Override public void bar(); // Compile error
}
C#:
public interface IA {
void Foo();
// void Bar(); // Removed method.
}
public class B : A {
public override void Foo(); // Doesn't compile as not 'overriding' method
public void Bar(); // Compiles, but no longer implements interface method
}
| As stated, you cannot get that kind of control from an interface alone in C#. You could get it from an abstract class however. For the purpose of completeness, here is what you could do:
public interface IA
{
void Foo();
//void Bar(); - removed
}
public abstract class A : IA
{
virtual void Foo()
{ }
// Removed method
//virtual void Bar()
//{ }
}
public class B : A
{
public override void Foo()
{ }
//throws an error like the one you were receiving regarding no method to override.
public override void Bar()
{ }
}
| 0.666667 | Public interface IA void Foo() |
How can I speed up the rate at which putty dries? | We're (slowly) renovating the sash windows in our house and the current window is causing problems. What should have been a quick job (especially at this time of year!) has turned into a marathon because the putty won't dry.
We had to replace a couple of panes of glass (one was cracked and we broke another when using a heat gun to remove the paint) so we knew it would take a little while. On a previous window the putty took over three weeks to dry enough to paint partly because (as we thought) there was too much oil. So this time we rolled the putty on newspaper first to try to remove the excess oil. It seemed to work, but after two weeks the putty is still soft to the touch.
We've tried standing the windows next to a radiator but all that seemed to do was make it softer (which was obviously going to happen in hindsight).
So given that we don't want to reputty the windows what can we do to speed up the drying process.
We've had to seal off the room and cover the window as best we can in the meantime.
I've found this advice on DoItYourself.com which doesn't really help as it says use other materials!
The answers to this post on DIY-Forums are confusing at best and possibly contradictory as one recommends exposing the putty to moisture(!) to speed the drying process.
| I always use DAP glazing compound and have never had a problem being able to paint it 24 hours later. I think you may have a bad or old lot there. Go to the latex based products and you will not have the same problem again. good luck.
| 1 | Do not have a problem with DAP glazing compound |
How to put @nickname at the comments? | Is it possible to enter @nickname in comments, automatically? Or is one just supposed to write out the names letter by letter?
| @names autocomplete only when you actually need to use them.
If the auto-completion box doesn't appear after typing @ and the first character of a name, then the @name is not needed. Either you are addressing the OP, or trying to address someone that is not nameable in a comment.
See How do comment @replies work? for when naming someone with the @name syntax is needed. When you are talking directly with the OP on their question and noone else has as yet commented, for example, @name name completion is not available because you don't need to use that syntax to notify the author.
There is one exception to this; you can name an editor of your post in comment, but the name will not be available for auto-completion. E.g. if I were to edit your question, you can use @MartijnPieters in a comment and I would be notified, but you'd have to type out my name yourself.
| 1 | @names autocomplete only when you actually need to use them |
Is it copyright infringement by US copyright law if someone else modifies and uses my design? | My company is in a small town and there are not any graphic designers but we have enough business in the town and the surrounding area to support us. But because of the small town nature some business owners do not know all the laws. And since I am starting this from a career in architecture I am not quite clear on copyrights. So here is my problem.
I created a sign that has an oval with scrolls and flowers in different colors on a field of turquoise. The client did not want to spend the money on a logo design so I said that I will just retain the rights so that she would have to come to me for the approval to use the logo on anything else. So anyway everything seems to be fine, I do her business cards and now all of a sudden I see a sign at the street. I quoted her on this job figuring in using the logo. Apparently this company did for much less and you can tell by the quality.
But here is my problem. She had a jpeg that I allowed her to have so she could create her own fliers and I was ok with that since it would not have made me much if any money. Well I am looking at the sign that the other person did and all that was done is they made a longer oval since this sign is more rectangle and used a different font. And put this over the design that I did. To me this is copyright infringement since the client did not want to buy all the rights. But who do I address? The client or the person that did the sign?
| Did you have a contract that explicitly stated the agreement you had with the client? That would be ideal. But barring that, verbal agreements can still have some weight.
If you want to pursue this, you really need to get a lawyer involved. I'd suggest consulting a lawyer. They may consult you for free, or perhaps you may have to pay for an hour of their time. Only you can decide if it's worth that.
| 1 | Do you have a verbal agreement that explicitly stated the agreement with the client? |
How to Construct the Coproduct of Pointed Categories? | A pointed category is a (small) category together with a distinguished object, called the basepoint $*$. How does one explicitly construct the coproduct of two pointed categories?
This problem reduces to constructing the coproduct of two pointed connected categories. If both categories have one object, this becomes the free product of monoids.
| It is useful to consider this construction in more generality, as is well written up in the case of groupoids (see Higgins' book "Categories and groupoids"). Let $C$ be a small category, and $f: Ob(C) \to Y$ a function. Then there is a category $f_*(C)$ with object set $Y$ and satisfying a universal property with regard to functors on $C$ whose object function factors through $f$. If $C,D$ are two categories with base points, then you get the free product by taking the disjoint union of $C$ and $D$ and then identifying the base points.
To put this in a more general light, the objects of a (small) category can be regarded as a functor Ob from the category $\mathsf{Cat}$ of small categories and functors to the category $\mathsf{Set}$ of sets and functions, and then this functor Ob is both a fibration (this is about pullbacks) and cofibration (this is about pushouts). There is a basic account of these ideas, which originated with Grothendieck, in
R. Brown and R. Sivera, `Algebraic colimit calculations in
homotopy theory using fibred and cofibred categories', Theory and
Applications of Categories, 22 (2009) 222-251.
| 1 | How to consider a functor Ob in more generality? |
Putting the cursor back at the bash prompt after a script returns delayed output | Just a minor issue. I'm writing a simple bash script that starts and stops Jetty. When I execute it, the script immediately puts my cursor back on the bash prompt. However, as Jetty starts up and writes its initialization output back to stdout, it leaves the cursor on a line of its own (without a prompt) until I enter a command or hit enter. Nitpicking, I know, but I figure there's an easy way to avoid this that I'm missing.
Here's the script:
#!/bin/bash
cd /opt/jetty/jetty-distribution-7.4.5.v20110725/
if [ "$1" = "-stop" ]
then
java -DSTOP.PORT=8079 -DSTOP.KEY=something -jar start.jar --stop
else
java -DSTOP.PORT=8079 -DSTOP.KEY=something -jar start.jar &
fi
Here's the output:
[user@machine ~]# jetty
[user@machine ~]# 2011-08-11 14:47:34.818:INFO::jetty-7.4.5.v20110725
2011-08-11 14:47:34.866:INFO::Deployment monitor /opt/jetty/jetty-distribution-7.4.5.v20110725/webapps at interval 1
2011-08-11 14:47:34.878:INFO::Deployment monitor /opt/jetty/jetty-distribution-7.4.5.v20110725/contexts at interval 1
2011-08-11 14:47:34.883:INFO::Deployable added: /opt/jetty/jetty-distribution-7.4.5.v20110725/contexts/javadoc.xml
2011-08-11 14:47:34.934:INFO::started o.e.j.s.h.ContextHandler{/javadoc,file:/opt/jetty/jetty-distribution-7.4.5.v20110725/javadoc}
2011-08-11 14:47:34.935:INFO::Deployable added: /opt/jetty/jetty-distribution-7.4.5.v20110725/contexts/test.xml
2011-08-11 14:47:35.011:INFO::Extract jar:file:/opt/jetty/jetty-distribution-7.4.5.v20110725/webapps/test.war!/ to /tmp/jetty-0.0.0.0-8080-test.war-_-any-/webapp
2011-08-11 14:47:35.645:INFO::started o.e.j.w.WebAppContext{/,file:/tmp/jetty-0.0.0.0-8080-test.war-_-any-/webapp/},/opt/jetty/jetty-distribution-7.4.5.v20110725/webapps/test.war
2011-08-11 14:47:36.127:INFO:org.eclipse.jetty.servlets.TransparentProxy:TransparentProxy @ /javadoc to http://download.eclipse.org/jetty/stable-7/apidocs
2011-08-11 14:47:36.199:INFO::Started [email protected]:8080 STARTING
And the cursor ends up on a blank new line just below. Is there a way to prevent this? I'm pretty new to bash scripting, is there something I should be doing that I'm not?
| You can't prevent this easily – bash does not receive any signal at all when a background process writes to the terminal, only when it exits completely. (SIGTTOU is only delivered to the writing process, in this case Java, which doesn't have any control over when the prompt is displayed...)
| 0.777778 | Bash does not receive any signal at all when a background process writes to the terminal |
Need Quartis II CPLD tutorial for learning VHDL from ZERO | I am learning VHDL from zero using Altera CPLD. Already got Quartis II 12.1 and a 15-lines example VHDL (like Hello World for C learner).
To avoid learning bad coding style or digging too deep too early, what should I look out for?
| This page has a (PDF) book that is quite good on the process of learning the tools and the stages between VHDL and a working design. It uses the Xilinx tools and an FPGA but the steps are similar for Altera.
Plus it costs nothing except disk and bandwidth to download the Xilinx tools and have them on hand for comparison.
In particular he says quite a lot that I skipped over, on the process of diagnosing and optimising performance problems.
| 1 | Altera uses Xilinx tools and an FPGA but the steps are similar for Altera |
Is the Mechromancer's Little Big Trouble tree worthwhile in UVHM (72 level cap)? | So far, the tree seems rather underwhelming, especially the low-tier skills like Myelin, More Pep, Strength of 5 gorillas, etc.
Evil Enchantress apparently doesn't affect shock, fire and acid direct damage; it only buffs the status effects which is pretty pointless when slagging an enemy does 3X damage.
Shock storm doesn't sound useful as most enemies won't be bunched up enough.
On the other hand, the damage buffs from Wires Don't Talk and Interspersed Outburst look very useful. Make it Sparkle also apparently gives Deathtrap massive additional damage of up to 3X.
Is it worthwhile to spec into this tree just for the end-tier perks?
| I have a Mechromancer character focusing on the 'Best Friends Forever' and the 'Little Big Trouble' skill trees (no Anarchy from 'Ordered Chaos') that I've been playing from TVHM to UVHM with UVH Upgrade Pack Two. As long as you have gear that will supplement Gaige's Little Big Trouble skills, you should be able to do fine on UVHM.
The most important skill in the Little Big Trouble skill tree is probably 'Wires Don't Talk' (increases all Shock and Electrocute Damage that you inflict). Due to that, I use gear that focuses on taking advantage of that skill.
Instead of More Pep, focus your points into another skill. More Pep's description is misleading, as described here.
Increased Elemental Chance effects are applied multiplicatively, not additively. For example, a base 20% Burn Chance with a 30% bonus will result not in 50% Burn Chance, but in 0.2 + (0.2 * 0.3) = 26% Burn Chance.
Although, if you have a class mod that gives a bonus to More Pep, like Zapper or Legendary Catalyst, you might want to assign at least one point to the skill to get the bonuses given by that class mod.
LBT's The Stare is pretty weak (damage does not scale well) in UVHM. It also has bugs detailed here. It's pretty much a waste of a skill point. BFF's Explosive Clap seems to scale just fine in UVHM.
Gear that helps take advantage of Little Big Trouble skills:
Class Mods
Zapper, preferably 'Wired' (gives most bonus damage to 'Wires Don't Talk') and blue or purple rarity (Note that the Zapper class mod's description is misleading, and due to that, the mods below are better, IMO.)
Necromancer, preferably 'Chaotic Evil' (bonus fire rate and critical damage) and the version that gives the most damage to 'Wires Don't Talk', and blue or purple rarity. This is a TTAODK class mod. More details here.
Legendary Catalyst (UVH Upgrade Pack Two class mod) - +5 Wires Don't Talk, +5 Evil Enchantress, +5 More Pep, +5 Electrical Burn, +5 Interspersed Outburst; bonus to Team Elemental Effect Dmg - this is probably the best class mod (and the rarest) for a Mechromancer looking to spec into the 'Little Big Trouble' tree.
Relics
An Elemental Relic (common) or a Bone of the Ancients (e-tech) that increases shock damage. The Bone of the Ancients also increases the Action Skill recharge rate, which can allow you to summon Deathtrap sooner.
Grenade Mods
Quasar (legendary, shock-element only)
Storm Front (legendary, shock-element only)
Chain Lightning (legendary, shock-element only, TTAODK) - Always Shock. Regenerates grenade ammo over time. Shoots a bolt of lightning straight forward that explodes on impact and arcs to nearby targets.
Quoting Borderlands wiki:
The Chain Lightning is ideally suited for Gaige builds with heavy investment in the Little Big Trouble tree (specifically Wires Don't Talk, Electrical Burn and Myelin). Its arcing effect can also help a similar build to hit targets at range with a high Anarchy stack, as it can mitigate the accuracy penalty.
The Chain Lightning may pair exceptionally well with the Grog Nozzle, Rubi, and other Moxxi-brand weapons for health restoration. Because the damage from the grenade is practically instantaneous, health may be replenished as soon as the grenade is thrown. Adding to this end are its arcing effect to damage multiple enemies and ability to pass through some surfaces. As aim need not be precise in close- to mid-range, one throw may serve as a panic button when low on health.
Shock 'Bouncing Bonny'
Shock 'Crossfire'
Magic Missile - Always slag. Grenades slowly regenerate over time. Two (Blue) or Four (Purple) child grenades home in on targets and explode instantly.
This is mostly for slagging and for helping to heal with the Rubi. I opt to go with the Magic Missile if I am playing solo or if my co-op allies don't have much slagging capabilities. Otherwise, using a shock damage-dealing grenade mod is better.
Shock-only weapons
Thunderball Fists, preferably 'Binary' (one trigger squeeze fires two shots) - deals heavy shock damage
Little Evie, preferably 'Binary' - killing an enemy increases action skill cooldown rate by 12%; allows you to summon Deathtrap sooner.
Florentine, preferably 'Consummate' (more damage) - a Seraph SMG that fires shock projectiles which deal bonus slag damage on impact.
Elemental weapons that have shock versions
Rubi, preferably 'Binary' - for healing; Any damage dealt by the player while wielding the weapon heals them, at a rate of 12% of the damage inflicted. Grenades can also be used to heal with the Rubi.
Interfacer, preferably 'Practicable' (more pellets per shot)
Shredifier, preferably 'Rabid' or 'Ferocious' (more fire rate or damage, respectively) - deals heavy damage, eats a lot of ammo, though
Avenger, preferably 'Hefty' (more damage) - all-around high stat SMG, regenerates bullets
FFYL weapon, or area-clearing weapons
Shock 'Norfleet' - will deal a lot of shock damage over a wide area
Shock 'Fibber' (second unique barrel version) - I'm putting this here, as IMO, it's too 'overkill' as a normal weapon. Quoting Borderlands wiki:
The second barrel shoots bullets that shatter upon impact or ricocheting off walls, creating pellets. It bounces off walls if it doesn't hit anything and travels with the same velocity as normal pistols' bullets. For some reason, when the shatter effect and Gaige's Close Enough skill occur at the same time, the ricocheted "homing" pellets will do 100% damage, thus ignoring the -50% bullet damage penalty from Gaige's skill...
Due to the lack of a yellow multiplier to the damage each of the 9 ricocheted bullets will receive the full bonus of amplify shields. Especially with The Bee this variant becomes one of the most powerful weapons in the game, due to the "damage per ammo"-ratio, its rate of fire and the fact, that the player doesn't need to aim properly.
Shield
Antagonist (Seraph) - Deflects enemy bullets with increased damage toward nearby enemies. High Damage Reduction and Capacity. Launches homing balls of slag at its attackers. A good overall shield for Gaige.
Black Hole (legendary) - quoting Borderlands Wiki:
This shield can be extremely effective when used by a Mechromancer investing heavily in the Little Big Trouble tree (specifically Wires Don't Talk, Electrical Burn and Myelin) and Blood Soaked Shields. Once the shield is depleted, the singularity effect will momentarily stun most enemies in the area while pulling them in for its deadly nova blast. A single kill will then recharge the shield to full capacity, immediately readying another nova. This strategy is particularly deadly under heavy fire, where the shield will be depleted almost immediately after being recharged.
The Black Hole also makes a good shield for Deathtrap with Gaige's Sharing is Caring skill, because the singularity will pull enemies into Melee range for Deathtrap.
The Bee (legendary amplify shield) - High amp shot damage, 0 amp shot drain. Lowered shield capacity. Increased shield recharge rate. Increased recharge delay.
This increases your weapons' damage at the cost of lower defensive capability. If you find that your Mechromancer's weapons' damage are lacking, you might want to use this shield. Works best with high fire rate weapons like the Shredifier and the Avenger. The Best Friends Forever skill tree's 'Fancy Mathematics' or 'Unstoppable Force' skills, or Ordered Chaos' Blood Soaked Shields skill will help keep this shield at full capacity.
| 0.888889 | 'Little Big Trouble' skill tree's 'Fancy Mathematics' or 'Unstoppable Force' skills |
Terminal error File system read only (Solo lectura) | When I install a terminal application in the following error occurs
Cuando instalo una applicacion por terminal me ocurre el siguiente error
omega@omega-desktop:~$ sudo apt-get install wine
[sudo] password for omega:
sudo: Can't open /var/lib/sudo/omega/0: Sistema de archivos de solo lectura
W: No se utilizan bloqueos para el archivo de bloqueo de sólo lectura /var/lib/dpkg/lock
E: se interrumpió la ejecución de dpkg, debe ejecutar manualmente «sudo dpkg --configure -a» para corregir el problema
omega@omega-desktop:~$ sudo dpkg --configure -a
[sudo] password for omega:
sudo: Can't open /var/lib/sudo/omega/0: Sistema de archivos de solo lectura
dpkg: error: no se puede acceder al área de estado de dpkg: Sistema de archivos de solo lectura
How do I fix this?
Como lo soluciono?
| It would seem that another application is locking the package manager.
Is Synaptic open?
Are you updating your system or some applications using Update Manager?
Are you installing an application using Software Center?
If so, wait until these operations are completed, and try to install your application again.
| 0.888889 | Is Synaptic open? Are you installing an application using Software Center? |
pdfpages breaks display of small caps | I try to create proceedings with a uniform title page for individual pdfs that I get from the authors. I use pdfpages for this. The individual pdfs are included and I add title information (not shown in the example below). I have one paper that looks fine, but when I include it, the result does not contain the small caps letters in the attribute value matrices (see figures on page 7 and 8).
\documentclass{article}
\usepackage{pdfpages}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\setcounter{page}{335}
\begin{document}
\includepdf[pages=-,pagecommand=\thispagestyle{plain}]{Includes/yatabe.pdf}
\end{document}
This is the paper: yatabe.pdf
What I get from including is yatabe-broken.pdf
| use in the preamble:
\pdfinclusioncopyfonts=1
otherwise the SmallCaps font is not included. From the pdftex manual:
\pdfinclusioncopyfonts (integer)
If positive, this parameter forces pdfTEX to include fonts from a pdf
file loaded with \pdfximage, even if those fonts are available on
disk. Bigger files might be created, but included pdf files are sure
to be embedded with the adequate fonts; indeed, the fonts on disk
might be different from the embedded ones, and glyphs might be
missing.
| 0.888889 | pdfinclusioncopyfonts=1 |
How does critical strike chance stack? | I was wondering how critical strike chance stacks? Say I buy a Phanton Dancer with its 30% crit chance. Now if I buy another Phanton Dancer, what is my critical chance?
| they stack additively, so just add up the crit chance. 1 PD will increase your total crit chance by +30%. The 2nd PD will increase your total crit chance by +30%, so +60% crit chance total from 2 PD's.
| 0.777778 | 1 PD will increase your total crit chance by +30% |
Recursive setTimeout in javascript | Is it possible to run this "indefinitely", without causing stack overflow or running out of memory?
function eternal(){
var time = recalculateTime();
doSomething();
setTimeout(eternal,time);
}
setTimeout(eternal,200000);
I'm not using setInterval, because the triggering time is variable.
| This is not actually a recursive call because the first invocation of eternal() has actually finished before the setTimeout() calls the next one. So, it's not technically recursion and does not build up the stack over time. It can run forever without any buildup and this is a perfectly fine way to keep something running over and over.
In response to one of your comments, javascript is not multi-threaded so it does not create multiple threads for timers. Each timer event that fires just puts an event into the event queue and if no JS is running at the time, that event is triggered (thus calling the callback function). If JS is running at the time, the JS engine waits until the currently executing JS finishes and then services the next event in the event queue (thus calling the callback).
| 0.777778 | javascript is not multi-threaded so does not create multiple threads |
Proving square root of a square is the same as absolute value | Lets say I have a function defined as $f(x) = \sqrt {x^2}$. Common knowledge of square roots tells you to simplify to $f(x) = x$ (we'll call that $g(x)$) which may be the same problem, but it isn't the same equation. For example, say I put $-1$ into them:
$\begin{align}
f(x) &= \sqrt {x^2} \\
f(-1) &= \sqrt {(-1)^2} \\
f(-1) &= \sqrt {1} \\
f(-1) &= 1
\end{align}$
$\begin{align}
g(x) &= x \\
g(-1) &= -1
\end{align}$
thereby, we conclude that $f(x)$ and $g(x)$ do not produce the same results even though they are mathematically the same. This is also shown when we try to graph the functions:
$y = \sqrt {x^2}$:
$y = x$:
$y = \mid x \mid$:
From this, we can see that given $f(x) = \sqrt {x^2}$, when simplified is not the same as $f(x) = x$. So, is there any way to prove that $y = \sqrt {x^2}$ is not the same as $y = x$ for negative values, but is infact the same as $y = \mid x \mid$?
| Given a non-negative real number $\alpha$, the number $\sqrt\alpha$ is defined to be the unique non-negative real number $\beta$ such that $\beta^2=\alpha$. Since $\sqrt{\alpha}\geq 0$ for all $\alpha\geq 0$, then for any real $\gamma$, it follows that $$\sqrt{\gamma^2}=\begin{cases}\gamma & \gamma\geq 0\\-\gamma & \gamma<0,\end{cases}$$ that is, $$\sqrt{\gamma^2}=|\gamma|.$$
| 1 | Non-negative real number $alpha$ |
How to add special price to category products grid? | How to add Special price column to
category products grid
under
Catalog -> Manage Categories -> Category_to_be_edited
| In order to achieve this you need to override the block that displays the product grid in the category edit screen. This block is Mage_Adminhtml_Block_Catalog_Category_Tab_Product.
For this, create a new module. Let's call it Easylife_Adminhtml with the following files:
app/etc/modules/Easylife_Adminhtml.xml - the module declaration file.
<?xml version="1.0"?>
<config>
<modules>
<Easylife_Adminhtml>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Adminhtml />
</depends>
</Easylife_Adminhtml>
</modules>
</config>
app/code/local/Easylife/Adminhtml/etc/config.xml - the module configuration file
<?xml version="1.0"?>
<config>
<modules>
<Easylife_Adminhtml>
<version>0.0.1</version>
</Easylife_Adminhtml>
</modules>
<global>
<blocks>
<adminhtml>
<rewrite>
<catalog_category_tab_product>Easylife_Adminhtml_Block_Catalog_Category_Tab_Product</catalog_category_tab_product><!-- override the default block with your ownw-->
</rewrite>
</adminhtml>
</blocks>
</global>
</config>
app/code/local/Easylife/Adminhtml/Block/Catalog/Category/Tab/Product.php - the block override class.
<?php
class Easylife_Adminhtml_Block_Catalog_Category_Tab_Product extends Mage_Adminhtml_Block_Catalog_Category_Tab_Product{
protected function _prepareCollection()
{
if ($this->getCategory()->getId()) {
$this->setDefaultFilter(array('in_category'=>1));
}
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('name')
->addAttributeToSelect('sku')
->addAttributeToSelect('price')
->addAttributeToSelect('special_price')//add attributes you need
->addStoreFilter($this->getRequest()->getParam('store'))
->joinField('position',
'catalog/category_product',
'position',
'product_id=entity_id',
'category_id='.(int) $this->getRequest()->getParam('id', 0),
'left');
$this->setCollection($collection);
if ($this->getCategory()->getProductsReadonly()) {
$productIds = $this->_getSelectedProducts();
if (empty($productIds)) {
$productIds = 0;
}
$this->getCollection()->addFieldToFilter('entity_id', array('in'=>$productIds));
}
//simulate parent::parent::_prepareCollection() because you cannot call parent::_prepareCollection
if ($this->getCollection()) {
$this->_preparePage();
$columnId = $this->getParam($this->getVarNameSort(), $this->_defaultSort);
$dir = $this->getParam($this->getVarNameDir(), $this->_defaultDir);
$filter = $this->getParam($this->getVarNameFilter(), null);
if (is_null($filter)) {
$filter = $this->_defaultFilter;
}
if (is_string($filter)) {
$data = $this->helper('adminhtml')->prepareFilterString($filter);
$this->_setFilterValues($data);
}
else if ($filter && is_array($filter)) {
$this->_setFilterValues($filter);
}
else if(0 !== sizeof($this->_defaultFilter)) {
$this->_setFilterValues($this->_defaultFilter);
}
if (isset($this->_columns[$columnId]) && $this->_columns[$columnId]->getIndex()) {
$dir = (strtolower($dir)=='desc') ? 'desc' : 'asc';
$this->_columns[$columnId]->setDir($dir);
$this->_setCollectionOrder($this->_columns[$columnId]);
}
if (!$this->_isExport) {
$this->getCollection()->load();
$this->_afterLoadCollection();
}
}
return $this;
}
protected function _prepareColumns()
{
//add the special price collumn after the 'price' column
$this->addColumnAfter('special_price', array(
'header' => Mage::helper('catalog')->__('Special Price'),
'type' => 'currency',
'width' => '1',
'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
'index' => 'special_price'
), 'price');
return parent::_prepareColumns();
}
}
Clear the cache and it should work. It worked for me.
| 0.777778 | How to override the block that displays the product grid? |
Get current Activity with Android | I have a method that scans the position and gets called on every activity I have, everytime an actions trigger I need to show an alertDialog, this is the code:
AlertDialog.Builder builder = new AlertDialog.Builder(mMainActivity.this);
builder.setMessage("test")
.setCancelable(false)
.setPositiveButton("go", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent intent = new Intent(mMainActivity.this,LocationDetails.class);
intent.putExtra("placeId",1);
startActivity(intent);
}
})
.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
But How can I create the alert on the current activity? Because now it only gets created on AlertDialog.Builder(mMainActivity.this);
| create class vis static method in vich you transfer "link" yours activitis
for example from MainActivity call :
DialogUtils.createSomeDialog(MainActivity.this);
or from SecondActivity:
DialogUtils.createSomeDialog(SecondActivity.this);
public class DialogUtils
{
public static void createSomeDialog(final Context context){
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage("test")
.setCancelable(false)
.setPositiveButton("go", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent intent = new Intent(context,LocationDetails.class);
intent.putExtra("placeId",1);
context.startActivity(intent);
}
})
.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
}
| 0.888889 | Create class vis static method in vich |
How to verify the line starts with a number while reading variable line by line in shell | I got the contents between two strings in a variable which contains multiple lines.
I want to check whether each line starts with a number and if so I will increment a counter and also need string after that number and before the next number.
Say I have a variable $line which contains:
1. Create
create a volume.
2. destroy
destroy a volume.
and so on.
I want to get the count say 10 operations in var1 , string after number in var2 and text after create,destroy (so on) in var3.
How to handle in shell script.
Thanks in advance
Adding Code :
line=$(sed -n '/Description/,/properties/p' readme.txt)
echo "$line"
sed -n -e '/^[0-9]/{s/\([0-9]*\).*/\1/;h;n;s/^ *//;H;x;s/\n/ /p;d;}' <<< "$line"
operations=0
while read -r n str ;
do
let operations+=1
printf '%d, %d, %s\n' "$operations" "$n" "$str"
done < <(sed -n -e '/^[0-9]/{s/\([0-9]*\).*/\1/;h;n;s/^ *//;H;x;s/\n/ /;p;d;}' <<<"$line")
printf "Opertions = %d\n' "$operations"
done
Where $line contains contents between Description and properties on which I have to do the required operations.
| If I understand you correctly then you want something like this (note that I presume you are using bash for some things below, if this is not the case it would have to be modified somewhat).
First, get the bulleted number plus the string on the next line. A little sed will do it.
sed -n -e '/^[0-9]/{s/\([0-9]*\).*/\1/;h;n;s/^ *//;H;x;s/\n/ /p;d;}' <<<"$line"
Next we just need to read the lines, count the lines and store them in variables.
operations=0
while read -r n str ; do
let operations+=1
printf '%d, %d, %s\n' "$operations" "$n" "$str"
done < <(sed -n -e '/^[0-9]/{s/\([0-9]*\).*/\1/;h;n;s/^ *//;H;x;s/\n/ /;p;d;}' <<<"$line")
printf 'Opertions = %d\n' "$operations"
During each loop n is the number from the bullet and str is the string from the following line.
| 0.833333 | sed is the bulleted number plus the string on the next line . |
Can symmetry be restored in high energy scattering? | Suppose you have a field theory with a real scalar field $\phi$ and a potential term of the form $\lambda \phi^4 - \mu \phi^2$ that breaks the symmetry $\phi \to - \phi$ in the ground state. Is this symmetry restored in a scattering with high momentum transfer in any physically meaningful way? My problem is that there is no background field for which I could take a mean field approximation, so the usual argument for phase transitions does not work.
One thing that came to my mind is that the potential will have higher order corrections, so maybe one could ask which way these corrections work in the limit $\Lambda \to \infty$, where $\Lambda$ is a UV scale? I know the first order correction for small $\phi$ does actually contribute to the breaking rather than to restoration, but then that doesn't seem to be the right limit for the scattering. If you don't know the answer I'd also be grateful for a reference. (Please do not point me to references that are for in-medium effects, nuclear matter etc, as I have plenty of these and it's not addressing my problem.)
| First of all, the vev of $\phi$ scales like a positive power of $\mu$ which has the units of mass. So all the effects of the symmetry breaking scale like a positive power of the mass scale $\mu$. At energies $E$ satisfying $E\gg \mu$, i.e. much higher than $\mu$, the value of $\mu$ itself as well as vev and other things may simply be neglected relatively to $E$: all the corrections from the symmetry breaking go to zero, relatively speaking.
In the UV, i.e. at short distances, the dimensionless couplings (and interactions) such as $\lambda$ are much more important than the positive-mass-dimension dimensionful couplings such as $\mu$.
It's still true that the high-energy theory wasn't exactly symmetric in the treatment above; it was just approximately symmetric. However, in fact, sometimes it is exactly symmetric under the sign flip of $\phi$. That's because the value of $\mu$ runs, as in the renormalization group, and in many interesting theories, $\mu$ actually switches the sign at energies exceeding some critical energy scale $E_0$. So the high energy theory may have a single symmetry-preserving minimum of the potential and the symmetry breaking may be a result of the flow to low energies.
It's legitimate you want to know the higher-loop corrections to the Higgs potential but the subtlety you should appreciate is that all these calculations proceed relatively to some renormalization (mass) scale. If the scale is low, the behavior of the theory at much higher energies may only be deduced by the (inverted) RG flows. However, the deduction of the short-distance theory from its long-distance effective field theory approximation is never exact; it's the high-energy theory that is the legitimate starting point and the low-energy physics is its consequence.
| 0.777778 | symmetry breaking scales like a positive power of the mass scale |
basic date comparsion for expiration checking | i want to create a traffic lights system that will tell me how many days are left to go until a document reaches its expiration date.
I want it to be marked by colors in my html.
green: if the document has 31 days or more to go until it expires.
amber: 30 days or less until it expires.
red: for 7 days or less.
I also want to display a text, telling me how many days until expiration.
The expiration date comes from my database in the field called insurance_date
Heres my code i am new to php so struggling to put my code together, if someone could show me how to restructure my code in order to achieve what im trying to do id be greatful, thanks.
my code:
<?php
include 'config.php';
$data = mysql_query("SELECT * FROM supplier_stats")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
echo "<p>Insurance Expires ! - <font color=\"red\">".$info['insurance_date'] . "</font></p>";
}
$date_diff = 60*60*24*7; // 7 days
// time()+$date_diff will be a timestamp 7 days in the future
if ($info['insurance_date'] < time()+$date_diff) {
echo "less than 7 days left!";
}
| I'm guessing $info['insurance_date'] is a datetime string in the format YYYY-mm-dd HH:ii:ss, right?
If this is the case, you will need to run it through strtotime before comparing it to a numeric time (time()+$date_diff)
| 0.888889 | $info['insurance_date'] is a datetime string in the format YYY-mm-dd HH |
Update table with subquery and duplicates | I need to update a table based on another table, so I have the statement:
update FAULTS
set FAULTS.FAULT_STATE = (
select INCIDENTS.TICKET_STATE from INCIDENTS
where INCIDENTS.CF_ID = FAULTS.CF_ID
)
And it gives me error saying:
ORA-01427: single-row subquery returns more than one row
I tried DISTINCT but the state values are different too so DISTINCT does not work. So I changed it too:
update FAULTS
set FAULTS.FAULT_STATE = (
select INCIDENTS.TICKET_STATE from INCIDENTS
where INCIDENTS.CF_ID = FAULTS.CF_ID and rownum = 1
)
Now it does not give errors.
The problem is, if the sub-query returns a null, it will also update the row and clear the content. Any fix for that?
| merge variant (10g+):
merge into faults
using (select cf_id, ticket_state from incidents) incidents
on (incidents.cf_id = faults.cf_id)
when matched then update
set fault_state=ticket_state;
| 1 | merge into faults using (select cf_id, ticket_state from incidents) |
AppleScript - "Close tabs to right of current tab" in Safari 7 | I have been using the AppleScript below as an Automator service in order to get Safari to close all tabs to the right of the current tab. However I have updated to Mavericks (10.9) and find that this no longer works.
Can anyone advise how this AppleScript should be changed in order to make it work again?
Here's the script:
tell application "Safari"
set indexActive to index of current tab of window 1
repeat until (get index of last tab of window 1) = indexActive
close last tab of window 1
end repeat
end tell
| Your script still worked in my limited testing, but you could also try something like this:
tell window 1 of application "Safari"
close (tabs where index > (get index of current tab))
end
| 1 | "Safari" close in window 1 |
What were the questions and answers the Aelfinn gave to Moiraine? | Now that A Memory of Light has been released are we able to deduce what Moiraine's questions / answers were and Rand's final one was from / to the Aelfinn?
We know two of Rand's:
Question: How to cleanse Saidin? Answer: Unknown, but Herid said it "stated sound principles in both high philosophy and natural philosophy."
Question: How can I win the Last Battle and survive? Answer: "The north and the east must be as one. The west and the south must be as one. The two must be as one. If you would live, you must die."
Edit: The third question will apparently be revealed in the forthcoming (print) encyclopaedia. (Source)
I don't think we know any of Moiraine's. We get to witness Mat's 3+
Related: What did Rand ask the Aelfinn?
| Moiraine tells Egwene and Elayne in tSR that:
"I could wager I know the face of the man I will marry better than either of you knows that of your future husband."
[...]
The Aes Sedai appeared regretful of having spoken. "Perhaps I only meant we share an ignorance. Do not read too much into a few words." She looked at Nynaeve consideringly. "Should I ever choose a man - should, I say - it will not be Lan. That much I will say."
This is before Rhuidean and the rings ter'angreal, so this knowledge could have come from the Aelfinn. Alternatively it could have come from a viewing by Min (for evidence, see the tEotW passage quoted by @DavidH in the comments), though I can't remember us ever seeing Min knowing about Moiraine and Thom in a Min-PoV chapter.
| 0.888889 | Moiraine and Thom in a Min-PoV chapter |
How to specify stream/project in ClearCase snapshot view load rules? | How to specify load rules in this case?
Previously discussed in http://stackoverflow.com/questions/1367635/how-do-i-create-a-snapshot-view-of-some-project-or-stream-in-clearcase
| When you create a UCM snapshot view, you reference the stream at the creation:
cleartool mkview -snap -tag myView_myStream_snap -stream myStream@\myPVob -stg myStorge myRootDir
Note: "myView_myStream_snap" is a convention of mine for naming a UCM snapshot view using the stream "myStream". You can actually name that snapshot view with whatever naame you want.
The load rules are only there to specify what to load within a snapshot view whatever the selection rules are (the "element ..." rules which are before the load rules)
load /myVob/dirA
load /myVob/dirB/dirB1
load /myVob/dirB/dirB2
There is no notion of stream or projects here.
The stream represents the "configuration" (i.e. the list of labels referencing some files)
The load rules represent what you want to load, without making any assumptions on the exact version selected
The combination of the two (the select rules based on the stream + the load rules) enable you to see the actual files within your newly created snapshot view.
| 0.666667 | naming a UCM snapshot view using the stream "myStream" |
Using PHP to dynamically create pages from a template | I'm creating a blog for a website I am building. The main blog page obviously has each blog listed as it should. But I want each blog to also have it's own individual page on the website. I want this page to be generated on creation of the blog post.
My question is, what would be the best method of creating this page. If I use the php file functions to create it, I would need to fill up a $data variable with hundreds of lines of HTML for the page. Which I guess is feasible, IF I am also able to dynamically change the variable to work for the new content that needs to be posted on said page.
Is there better methods? Would PHP work for this? Any suggestions would help.
| Its possible to create individual page for each blog dynamically. Here are the steps you can follow.
Create one master template. Add some special tags where you want dynamic content.
While adding new post, Read the content from that master template, replace appropriate special tags with actual values
Write finally generated content into new file and save it to associated location.
You are ready to access that page.
| 0.888889 | Create one master template for each blog dynamically |
async & await - poll for alternatives | Now that we know what is in store for c#5, there is apparently still an opening for us to influence the choice of the two new keywords for 'Asynchrony' that were announced by Anders Heijsberg yesterday at PDC10.
async void ArchiveDocuments(List<Url> urls) {
Task archive = null;
for(int i = 0; i < urls.Count; ++i) {
var document = await FetchAsync(urls[i]);
if (archive != null)
await archive;
archive = ArchiveAsync(document);
}
}
Eric Lippert has an explanation of the choice of the current two keywords, and the way in which they have been misunderstood in usability studies. The comments have several other propositions.
Please - one suggestion per answer, duplicates will be nuked.
| Given that I'm not clear about the meaning/necessity of async, I can't really argue with it, but my best suggestion for replacing await is:
yield while (look! no new keywords)
Note having thought about this a bit more, I wonder whether re-using while in this way is a good idea - the natural tendency would be to expect a boolean afterwards.
(Thinks: finding good keywords is like finding good domain names :)
| 1 | re-using while in this way is like finding good domain names |
C# + PHP in the same application? | What im trying to do is a little different, im wondering, if its possible to create sorts of an interface, so that if a particular function is called in php (stand alone), than the arguments will be forwarded to a method in C#, and vice versa.
| Depends of course on what kind of data you want to exchange, if the applications are on the same server or on two different ones etc.
I did briding between PHP and C# in some of my web based projects. What I did: create an ASP.NET MVC project which exposes a RESTful API. The methods exposed by this API are then called from PHP via HTTP (using CURL). I used JSON as a data exchange format to pass data from PHP to C# and back again. This worked good as the two applications were on different servers.
I could also imagine some kind of socket server. E. g. a background process written in C# is listening on some port, and then you connect to it via PHP´s socket functions. I did something like this to connect PHP and Java. The Java app ran as a demon process on port XXXX and was a wrapper around Apache FOP. I used PHPs socket functions to pass XML and XSLT to the Java demon which then used Apache FOP to transform the data into a pdf and returned that via the socket connection back to PHP which in turn sent the PDF file to the client requesting the page.
There are probably some other approaches, but these were my experiences so far in connecting two different technologies together.
EDIT: as an aside: PHP on a windows webserver using IIS was really not that nice to work with. Sometimes strange errors occured or certain permission related errors that were not easy to resolve. YMMV though.
| 0.777778 | ASP.NET MVC project exposes RESTful API |
Wordpress and isotope filtering | Im trying to use Isotope(http://isotope.metafizzy.co/) to filter my Wordpress posts,
http://i44.tinypic.com/fco55k.jpg this is how my site looks like, i would like to filter posts depending on a post category so i need to add a class name to each post and then filter it using isotope
<li><a href="#" data-filter="*">show all</a></li>
<li><a href="#" data-filter=".design">design</a></li>
<li><a href="#" data-filter=".typo">typography</a></li>
those are the names of my categories, and then i would like to add class name of a post depending on a category he is in.
<div id="main">
<?php
$args = array('orderby' => 'rand' );
$random = new WP_Query($args); ?>
<?php if(have_posts()) : ?><?php while($random->have_posts()) : $random->the_post(); ?>
<a href="<?php the_permalink() ?>"> <div id="img" class="<?php $category = get_the_category();
echo $category[0]->cat_name; ?>">
<?php
the_post_thumbnail();?>
<h1><?php the_title(); ?></h1>
</div></a>
and javascript im using
<script type="text/javascript">
jQuery(window).load(function(){
jQuery('#main').isotope({
masonry: {
columnWidth: 20
},
});
$('#filters a').click(function(event){
var selector = $(this).attr('data-filter');
$('#main').isotope({ filter: selector });
return false;
});
});
</script>
| Add the animationEngnine: 'jquery' - and the animation will be smoother.
var mycontainer = jQuery('#projects');
mycontainer.isotope({
filter: '*',
animationEngine: 'jquery',
animationOptions: {
duration: 350,
easing: 'linear',
queue: true
}
});
jQuery('#projects-filter a').click(function(){
var selector = jQuery(this).attr('data-filter');
mycontainer.isotope({
filter: selector,
animationOptions: {
duration: 350,
easing: 'linear',
queue: true,
}
});
return false;
});
| 0.666667 | AnimationEngnine: 'jquery' |
Computer browsing not working | We have multiple computers joined in domain. We also have domain controller (Windows server 2008 Enterprise).
The problem is, that sometimes computer browsing (Windows Explorer: My Network Places/Entire Network/MS Windows Network) works and sometimes doesn't.
Restarting Computer browser on domain controller helps poorly - usually not.
If users type other computer's name like Start/run:
\\computer1
computer is accessible.
What seems to be the problem?
We already have WINS server installed.
| DNS doesn't facilitate network browsing. NetBIOS facilitates network browsing.
Network browsing has never been "reliable" in the sense that the list of computers is always accurate and complete.
If you want to have an accurate and complete list of computers while browsing the network then you'll have to implement a WINS server.
Personally, I don't understand why this is an issue. Why is it important that users be able to browse an accurate and complete list of computers on the network? Do they not know where resources are (shared folders and printers) and need to browse the network to find them? If so, that's poor infrastructure design and management, IMO.
| 0.888889 | Why is it important to have an accurate and complete list of computers on the network? |
Sorting the output of "find"? | I need to be able to alphabetically sort the output of find before piping it to a command. Entering | sort | between didn't work, so what could I do?
find folder1 folder2 -name "*.txt" -print0 | xargs -0 myCommand
| I think you need the -n flag for sort#
According to man sort:
-n, --numeric-sort
compare according to string numerical value
edit
The print0 may have something to do with this, I just tested this. Take the print0 out, you can null terminate the string in sort using the -z flag
| 1 | -n flag for sort# |
Why can't my C++ compiler deduce template argument for boost function? | I define a method like so:
template <class ArgT>
void foo(ArgT arg, ::boost::function< void(ArgT) > func)
{
func(arg);
}
and use it like this --for instance--:
foo(2, [](int i) -> void { cout << i << endl; });
Why can't the compiler deduce the type since it's definitely an int?
I get 'void foo(ArgT,boost::function<void(ArgT)>)' : could not deduce template argument for 'boost::function<void(ArgT)>' from 'anonymous-namespace'::<lambda0>'.
| While C++ lambdas are strictly monomorphic, they are merely shorthand for function objects (aka functors), and in general functors can be polymorphic; i.e., their call operators can be overloaded or templated. As a result, functors (and, consequently, lambdas) are never implicitly convertible to templated std::function<> (or boost::function<>) instances because functors' operator() argument types are not automatically inferable.
To phrase it slightly differently, the natural type of your lambda expression is a functor with a parameterless constructor and an operator() with the signature void operator ()(int) const. However obvious this fact may be to you and I, it's not automatically inferrable that ArgT should resolve to int because lambdas are functors and functors' operator()s are possible to overload and template.
TL;DR: What you want isn't possible.
| 0.888889 | Functors' operator() argument types are not automatically inferable |
How to add a free information layer in the [top|bottom] toolbar? | I hope you can help me. I can't find any information about my topic neither in the jqGrid documentation, nor in stackoverflow.
I would like to add a free information layer as shown in the "How it works" section in the jqGrid Documentation.
Thanks in advance for your help!
| You can use toolbar option of the grid. For example toolbar: [true, "top"] add empty div at the top of the grid. The option toolbar: [true, "both"] will add top and bottom divs. You can add any custom HTML information in the divs. You can access the dives by ids. See documentation for details. The demo from the answer provide an example of usage the top toolbar.
| 1 | Use toolbar option of grid |
Excel VBA App stops spontaneously with message "Code execution has been halted" | From what I can see on the web, this is a fairly common complaint, but answers seem to be rarer. The problem is this:
We have a number of Excel VBA apps which work perfectly on a number of users' machines. However on one machine they stop on certain lines of code. It is always the same lines, but those lines seem to have nothing in common with one another.
If you press F5 (run) after the halt, the app continues, so it's almost like a break point has been added. We've tried selecting 'remove all breaks' from the menu and even adding a break and removing it again.
We've had this issue with single apps before and we've 'bodged' it by cutting code out of modules, compiling and then pasting it back in etc.
The problem now seems to relate to Excel itself rather than a single .xls, so we're a little unsure how to manage this.
Any help would be gratefully received :)
Thanks,
Philip Whittington
| Thanks to everyone for their input. This problem got solved by choosing REPAIR in Control Panel. I guess this explicitly re-registers some of Office's native COM components and does stuff that REINSTALL doesn't. I expect the latter just goes through a checklist and sometimes accepts what's there if it's already installed, maybe. I then had a separate issue with registering my own .NET dll for COM interop on the user's machine (despite this also working on other machines) though I think this was my error rather than Microsoft. Thanks again, I really appreciate it.
| 0.888889 | REINSTALL explicitly re-registers some of Office's native COM components |
Why upvotes and downvotes are not visible in sites other than stackoverflow.com |
Possible Duplicate:
Why is it a privilege to view vote counts?
I can see upvotes/downvotes total in Stackoverflow.com. But the same information seems unavailable in other sites (meta.stackoverflow.com, programmers.stackexchange.com, other stackexchange sites).
What is the reason this feature is not enabled of other sites?
| You cannot see the exact vote breakdown until you have reached the "established user" reputation level, 1000 points.
At that point, you can click on the vote tally to see the up and down vote counts:
| 1 | Click on the vote tally to see the up and down vote counts |
What went down in 1666 before Shabtai Tz'vi's apostasy? | It seems agreed upon that one or more representatives from Lvov traveled to either investigate, visit or out Shabtai Tzvi in 1666 when he was still claiming to be the mashi'ach. Immediately following this meeting he [at least nominally] converted to Islam. It also seems accepted that the visitors had some relationship to the Ta"z, who was the av bes din at the time.
Encyclopedia Judaica has at least three conflicting stories of the nature and events of this meeting written by three different authors - one of whom (Abraham David) cites the work of another (Gershon Scholem) as a source. And I've heard yet other versions elsewhere.
What really happened? Who was sent from Lvov? What was their mission? What happened at the meeting in Gallipoli?
| Scholem says it was the Taz's son and stepson, Reb Aryeh Leib. Their mission was to meet and determine the legitimacy of S"T as a Talmid Chochom and Tzaddik. According to Scholem he wowed them and they left convinced of his righteousness and status as the messiah with a present of a garment for the ailing Taz to wear as a segulah for improved health. Scholem quotes all this from other sources on page 600. The end of 1666 is when S"T YS"V converted but the news did not hit most of bnei ashkenaz until 1667.
| 0.777778 | Scholem was the Taz's son and stepson, Reb Aryeh Leib . |
How do I fix my Base URLs so I can access my Magento site? |
I changed Base Urls and now my website is inaccessible
I moved everything to a new server, didn't change the base_url and my website is inaccessible
How do I change or restore base_url my BaseURL settings?
| Symptom: I changed Base Urls and now my website is inaccessible or I moved everything to a new server, didn't change the base_url and my website is inaccessible.
How to change or restore base_url settings with phpMyAdmin
Instructions are for a simple "one store" website where the "default store view" is set to inherit its setup from the "default config". There will be an additional instance of the below mentioned table rows for each unchecked Use Website checkbox.
Open your core_config_data table in phpMyAdmin.
Sort table by path column and find the following rows for your unsecure section, they should look like the following:
Columns
PATH VALUE
web/unsecure/base_url http://www.mydomain.com/
web/unsecure/base_link_url {{unsecure_base_url}}
web/unsecure/base_skin_url {{unsecure_base_url}}skin/
web/unsecure/base_media_url {{unsecure_base_url}}media/
web/unsecure/base_js_url {{unsecure_base_url}}js/
Replace http://www.mydomain.com/ with your appropriate domain url (trailing slash necessary) and if you’ve installed in a subfolder append it with a / after it.
Find the following rows for your secure section, they should look like the following:
Columns
PATH VALUE
web/secure/base_url https://www.mydomain.com/
web/secure/base_link_url {{secure_base_url}}
web/secure/base_skin_url {{secure_base_url}}skin/
web/secure/base_media_url {{secure_base_url}}media/
web/secure/base_js_url {{secure_base_url}}js/
Replace https://www.mydomain.com/ with your appropriate domain url (trailing slash necessary) and if you've installed in a subfolder append it with a / after it. If you haven't received your security certificate and enabled TLS/SSL yet, use http instead of https
Clear contents from var/cache, var/session directories after changing base_urls.
Clearing cache and sessions is necessary because your config is cached and clearing it forces a reread of the configuration data from the core_config_data table and reestablishment of sessions with the proper information.
NOTE: If you have set your base_url correctly for web/unsecure/base_url and web/secure/base_url you do not have to mess around with changing the {{UNSECURE_BASE_URL}} and {{SECURE_BASE_URL}} macros in the rest of the entries.
How to change base_url settings with mysql from the command line
Log into your MySQL database, replace $USER with your database user name and $DBASE with your database name. It will prompt you for your password:
mysql -u $USER -p $DBASE
Below are the SQL commands to change your base_url values. Replace unsecure http://www.mydomain.com/ and secure https://www.mydomain.com/ (if you have SSL/TLS enabled, else https should be http) with your appropriate domain url (trailing slash necessary) and if you’ve installed in a subfolder append it with a / after it.
SQL Commands
UPDATE core_config_data SET value = 'http://www.example.com/' WHERE path LIKE 'web/unsecure/base_url';
UPDATE core_config_data SET value = 'https://www.example.com/' WHERE path LIKE 'web/secure/base_url';
Check your base_url settings with the following:
SQL Commands
SELECT path,value FROM core_config_data WHERE path LIKE 'web/unsecure/base%';
SELECT path,value FROM core_config_data WHERE path LIKE 'web/secure/base%';</code>
Clear contents from var/cache, var/session directories after changing base_urls. Clearing cache and sessions is necessary because your config is cached and clearing it forces a reread of the configuration data from the core_config_data table and reestablishment of sessions with the proper information.
| 0.888889 | How to change base_url settings with phpMyAdmin |
Low pass filter to maintain edge information | I am looking for a kernel acting as a low pass filter that satisfies these conditions:
$$K(-\mathbf{u})=K(\mathbf{u}) \tag{1}$$
$$K(\mathbf{u}) \ge K(\mathbf{v}), \;\; \text{if} \;\; |\mathbf{u}|<|\mathbf{v}|, \;\; \text{and} \;\; \lim_{|\mathbf{u}|\rightarrow\infty} K(\mathbf{u})=0 \tag{2}$$
$$\int K(\mathbf{x})d\mathbf{x} = 1 \tag{3}$$
In the reference paper, the author suggested a Gaussian kernel that is:
$$K_\sigma(\mathbf{u})=\frac{1}{\left(\sqrt{2\pi}\sigma\right)^n}e^{-|\mathbf{u}|^2/2\sigma^2} $$
with a scale parameter $\sigma > 0$.
The Gaussian kernel is very good at approximating the required properties. But the kernel reduces edge information when the kernel size is large.
Could you suggest to me any kernel that can satisfy the three conditions above, and is more robust than Gaussian in noise reduction, while maintaining edge information? I found a modified kernel, but it was very difficult to implement. Thank you so much.
| There are many "Edge Preserving" filters in the image processing world.
2 very popular would be:
The Bilateral Filter.
Anisotropic Diffusion Filter.
Google search on each of the terms will give you plenty of data and code samples of each.
For any specific question about them, let me know, I'd be happy to assist.
| 0.888889 | "Edge Preserving" filters in image processing world |
How can I achieve ACID on multiple physical front-end servers | I'm looking for a way to have several physical front-end servers with ACID data access.
In a setup where several servers gets load-balanced using DNS-round robin, the problem is that whatever server you land on the data must be ACID. E.g. when sharding data you need to have the shard-mapping ACID across servers, right?
How can I achieve this using open-source software?
One solution is MySQL Cluster but Google or Facebook does not use this(?). Is there an alternative?
| Google and Facebook almost always don't need ACID data. If your Facebook news feed is out of date by a few seconds (or minutes, or more) or you're seeing yesterday's Google search index it's not the end of the world.
For anything that does absolutely need to be ACID, you'd likely want to look into sharding, where specific servers are masters for specific subsets of the database.
| 0.888889 | sharding, where specific servers are masters of the database |
What package managers do popular Unix Distributions Use? | I am creating a Script and I need to know what package manager each Popular Unix Distribution Uses (especially those distros that are commonly-used for Servers)...
I mean:
Debian uses apt-get
Fedora uses yum
| You would probably be better off creating a .deb package for Debian based distros (including Ubuntu), and .rpm package for Red-Hat based distros (including Fedora), and making the .tar file available for everybody else. Don't concern yourself with which package manager each distro uses. For instance, although I run a Debian-derived distro, I personally use the aptitude package manager. But and .deb package will install for me, assuming that it targets the versions of dependencies that I have installed.
| 0.888889 | .deb package for Debian based distros (including Ubuntu) and .rpm package for Red-Hat |
Around the Clock | I want to produce with Mathematica something like this
Or this
12 hours should be arranged in a pleasing ("rotated") style around / within a rectangle. I don't ask for the hands - depending on numerical input - but only for a Graphics to begin with.
"Have you tried anything ?"
"Sure, but with non-presentable results."
| For a constant angular speed watch, if you want some specific figures being placed at the corners, you have to adjust the aspect ratio of the dial rectangle.
A Graphics to begin with:
Manipulate[
{
Dashed, GrayLevel[.7],
InfiniteLine[{0, 0}, Through[{Cos, Sin}[π/6 #]]],
Dashing[{}], Black, Thick,
InfiniteLine[{0, 0}, Through[{Cos, Sin}[π/12 + π/6 #]]]
} & /@ Range[0, 5] //
Graphics[{#,
EdgeForm[{Black, Thick}], FaceForm[White],
Rectangle[##] & @@ (1/
2 {{-1, 1}, (Tan[π/6] + ε) {-1,
1}})
},
PlotRange -> {{-1, 1}, (Tan[π/6] + ε) {-1, 1}},
Frame -> True, FrameStyle -> Thick, FrameTicks -> None] &,
{{ε, 0}, -0.5, 10}]
With a proper grid, you can then use the transformation method from other answers to fill in good-looking figures.
| 0.666667 | Angular speed watch angular |
Verifying the integrity of ciphertext using the cleartext hash? | I want to be able to verify the integrity of a ciphertext by providing the cleartext hash, for this to work it would need to:
$$hash(crypt(cleartext)) = f(hash(cleartext))$$
Where $f$ is an arbitrary function mapping the cleartext hash to the ciphertext hash.
Is there such a pair?
Update: I'm trying to prove the integrity to the receiver while delaying the key exchange until I'm ready to commit (send him the decryption details). The hash that proves the integrity comes from another source entirely.
| There really isn't such a function $f$; encryption algorithms attempt to generate what looks like random bitstrings (at least, it looks that way to anyone who doesn't know the key), and because the plaintexts and the ciphertexts look unrelated, their hashes are also going to look unrelated.
On the other hand, what is the problem you're trying to solve? When you say 'verify the integrity of a ciphertext', who is doing the verification?
Are you trying to allow the decryptor to verify that the message he got was the message that the encryptor sent without someone modifying it in the middle? If that's the case, the standard way of addressing it is with a Message Authentication Code
Are you attempting to allow the encryptor to verify that the encryption process proceeded properly? About the only ways to do that are to either run the encryption process again (with the same IV) and compare, or attempt to decrypt the ciphertext and compare.
Are you trying to allow someone in the middle (without the keys) to verify that a specific ciphertext happens to be a specific plaintext? Well, that would be an unusual requirement; I don't have any bright ideas on that one.
| 1 | What is the problem you're trying to solve when you say 'verify the integrity of a ciphertext' |
Slowdown in large perl array | I'm currently running a perl program where I have to take a 1 million line text file, break it down into chunks (anywhere between 50 and 50,000 lines per chunk), and run some calculations and such on them. Right now, I load all of the data into array1. I take array2 and use it to pull just the chunks of data I need. I then do what I need to perform on array 2, and then go back and grab the next set.
example data
A, blah1, blah2
A, blah6, blah7
A, blah4, blah5
B, blah2, blah2
So I would grab the first three into array 2, sort them, then move on to the next set. My program works pretty well and efficiently to begin with, but it experiences a severe slowdown later on.
50K takes 50 seconds, 100k takes 184 seconds, 150k takes 360 seconds, 200k takes 581 seconds, and it only gets exponentially worse as the program continues (4500 seconds at line 500k)
No, I cannot use a database for this project, any suggestions?
my @Rows1=<FILE>;
my $temp = @Rows1;
for($k = 0; $k < $temp; $k++)
{
my @temp2array = ();
my $temp2count = 0;
my $thisrow = $Rows1[$k];
my @thisarray = split(',', $thisrow);
my $currcode = $thisarray[0];
my $flag123 = 0;
$temp2array[$temp2count] = $thisrow;
$temp2count++;
while ($flag123 == 0)
{
$nextrow = $tuRows1[$k + 1];
@nextarray = split(',', $nextrow);
if ($currcode eq $nextarray[0])
{
$temp2array[$temp2count] = $nextrow;
$k++;
$temp2count++;
}
else
{
$flag123 = 1;
}
}
}
I have edited my code to more resemble the answer below, and I've got these times:
50k = 42, 100k = 133, 150k = 280, 200k = 467, 250k = 699, 300k = 978, 350k = 1313
Its not exactly keeping linear, and by this trend, this prog will still take 14000+ seconds. I'll investigate other parts of the code
| Loading an entire large file into memory will slow you down as your OS will need to start swapping pages of virtual memory. In such cases, it is best to deal with only the section of the file that you need.
In your case, you seem to be processing lines that have the same value in the first field together, so you could do something like:
my @lines = ();
my $current_key = '';
while (<FILE>) {
my ($key) = split /,/; # get first column
if ($key ne $current_key) {
# new key. Process all the lines from the previous key.
if (@lines > 0) {
process(@lines);
}
@lines = ();
$current_key = $key;
}
push @lines, $_
}
# don't forget the lines from the last key
if (@lines > 0) {
process(@lines);
}
This way, you are only storing in memory enough lines to make up one group.
(I am assuming that the input data is sorted or organized by the key. If that's not the case, you could make multiple passes through the file: a first pass to see what keys you will need to process, and subsequent passes to collect the lines associated with each key.)
| 0.888889 | Loading an entire large file into memory |
Is the Power-Link designed for routine usage? | I have a Power-Link which i intended to use in emergencies (when the chain breaks and i'm far from home). Used it once, worked pretty well.
Now i wonder, what if i use it permanently with my chain? My idea is that it might be convenient to quickly remove the chain, stuff it into a bowl of acetone/oil/whatever, and easily install it back onto the bike.
But will the Power-Link wear out quickly (e.g. quicker than the other "links" of the chain)? I am not sure whether it was intended to be used all the time or just for emergencies.
| It's intended for permanent use -- it's what SRAM provides for permanently joining their chains. I've got several thousand miles on them, with no difficulties.
| 1 | SRAM is intended for permanent use |
How to compile and install programs from source | This is an issue that really limits my enjoyment of Linux. If the application isn't on a repository or if it doesn't have an installer script, then I really struggle where and how to install an application from source.
Comparatively to Windows, it's easy. You're (pretty much) required to use an installer application that does all of the work in a Wizard. With Linux... not so much.
So, do you have any tips or instructions on this or are there any websites that explicitly explain how, why and where to install Linux programs from source?
| Recently I've started using "Checkinstall" when installing from source outside of my package manager. It builds a "package" from a 3rd party tarball which can then be installed and managed (and uninstalled) through your package manager tools.
Check out this article - http://www.linuxjournal.com/content/using-checkinstall-build-packages-source
| 1 | Checkinstall builds a "package" from a 3rd party tarball |
How do I completely uninstall an app in OS X without the use of a dedicated app eg AppZapper? | I came across this post, however all the answers recommend using Applications eg AppZapper or similar to achieve the uninstallation of the App desired.
What are the steps required where the uninstallation is carried out by "manual means" by the user to achieve complete uninstallation ?
| There are several steps you may want to take:
remove any support files in /Library
remove any support files in ~/Library
remove any installed kernel extensions
remove any cache files left in /LibraryCaches
remove any cache files left in ~/LibraryCaches
Generically: remove any file created by the application at installation or during its run time.
To answer the question I think you want answered: there is no built-in facility to remove all traces of an app that you wish to uninstall (which is why programs like AppZapper exist at all).
| 1 | Remove any support files in /Library Remove any installed kernel extensions remove any cache files left in /libraryCaches |
why do hosting co charge so much just for RAM? | I'm a little confused, I realize hosting co. are there to make money, but why is it that RAM is so cheap these days and the monthly cost for just adding more ram is so much?
why doesn't someone come out and just break even on RAM and destroy the market? (someone has to, I mean there are so many companies...)
| As previously stated, quality server's and ram are not cheap, but unless it's some rare form/spec, the prices are not that extreme. There are other costs though that are considered by companies when setting their pricing. Employees' salaries, electricity, air conditioning, rent, etc.
But I do agree, when you see 2G DDR3 for $60(CDN) and then your hosting company wants to charge you $10/mo for 1G DDR2, it seems a rip off.
You said it yourself though, they are there to make money.
| 0.777778 | Quality server's and ram are not cheap, but the prices are not that extreme |
Riemann-Lebesgue equivalence for n-dimensional integration | "Lebesgue's Theorem" states that for any bounded $f:[a,b] \to \mathbb{R}$, $f$ is Riemann Integrable iff $m\{x:f \text{ is not continuous at x }\}=0$, and if so Riemann's integral coincides with Lebesgue's. ($m$ is Lebesgue's measure).
Does there exist a generalization of this theorem for higher dimensions? Can I have a proof or a reference please?
| First note that the Lebesgue-Riemann theorem states that $f:[a,b]\to \mathbb R$ is Riemann integrable if, and only if, $f$ is bounded and is continuous almost everywhere (if a function is not bounded, it can't be Riemann integrable).
A proof of the more general result for multivariable functions can be found in volume 1 of "Real Analysis" by Duistermaat. A better exercise in fact will be to take this wiki proof and adapt it to $\mathbb R^n$.
| 1 | Lebesgue-Riemann theorem states that $f:[a,b]to mathbb |
In a Derby DBMS, How can I pad a number with zeros? | VALUES TRIM(CAST(CAST(YEAR( { fn TIMESTAMPADD(SQL_TSI_MONTH, -6 ,
CURRENT_DATE) }) AS CHAR(4) ) AS VARCHAR(4))) || '-' ||
TRIM(CAST(CAST(MONTH( { fn TIMESTAMPADD(SQL_TSI_MONTH, -6 ,
CURRENT_DATE) }) AS CHAR(2) ) AS VARCHAR(2)))
The above statement returns 5 instead of 05 for MONTH(xxx)
which is not desired. It is not correct for comparisons
as 11 is smaller than 5 where in essense 11 is actually bigger
than 5
Edit:
With the JavaDB/Derby SQL statement above, I'd like to get
for example today is 2013-11-23, six months before was 2013-05-23
When comparing
select p.ProductCode , p.ProductName as pn, sum( od.NetSales) AS Sales
from
products p
INNER JOIN order_details od ON (p.ProductCode = od.ProductCode)
INNER JOIN orders o ON (od.OrderCode = o.OrderCode)
where TRIM(CAST(CAST(YEAR(o.PurchaseDateTime) AS CHAR(4)) AS VARCHAR(4))) || '-' ||
TRIM(CAST(CAST(MONTH(o.PurchaseDateTime) AS CHAR(2)) AS VARCHAR(2)))
>
TRIM(CAST(CAST(YEAR( { fn TIMESTAMPADD(SQL_TSI_MONTH, -6 , CURRENT_DATE) }) AS CHAR(4) ) AS VARCHAR(4))) || '-' ||
TRIM(CAST(CAST(MONTH( { fn TIMESTAMPADD(SQL_TSI_MONTH, -6 , CURRENT_DATE) }) AS CHAR(2) ) AS VARCHAR(2)))
group by p.ProductCode, p.PRODUCTNAME
orders that are within the range are not included.
Whereas I want to include them
Hope you understand
Thanks
Jack
| I find it easier to format my data in my application. Use SQL to select the data that you want; use JDBC to fetch that data into variables in your program (e.g., use ResultSet.getDate() to get the value of a date column); use the Java libraries to format the data as you desire (e.g., use SimpleDateFormat to format your date data).
To learn how to use the ResultSet methods such as getDate: http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html#getDate(int)
To learn how to use SimpleDateFormat: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
| 0.666667 | Use SQL to select the data that you want in your application |
create a list (or any variable) dynamically, add data to each list and later compare them in C# | I have a list of some strings and I want to create a list for each of them dynamically inside a loop.
The main idea is to get each string from this list through the loop and create a list with this string as a name. Then add some data to it.
Example:
List<string> names = new List<string>(); // this is the main list with strings
foreach (string nm in name)
{
// Here create a new list with this name
// Add data to the list
}
// Now, compare all of them to find duplicate data
// Give message if any duplicate data found
Update:
Basically, I am going to add data to the list using some database APIs on runtime and the string names are the keys in that API. So with each name in the main list, I will retrieve some data from the database, create a list with that name and add data to it. Later we will compare them together. So the basic question is still how do I create these lists at runtime.
| Use a generic Dictionary:
List<string> names = new List<string>(); // this is the main list with strings
Dictionary<string, List<string>> dict = new Dictionary<string, List<string>>();
foreach (string name in names)
{
if (!dict.ContainsKey(name))
dict.Add(name, new List<string>());
dict[name].Add("another one bytes the dust :)");
}
In the above example, you will have a Dictionary with amount of keys equals to the number of unique names, and you can find duplicates by keys having more than one item in their associated List.
For example:
string[] dupes = dict.Keys.ToList().Find(k => dict[k].Count > 1).ToArray();
| 0.888889 | Use generic Dictionary: List<string> names |
What to do with old connections when moving outlet to dedicated circuit? | I would like to remove one of the outlets from a circuit, and run a dedicated wire to it from a separate breaker, placing it on it's own circuit.
When I disconnect the existing circuit from the receptical, that will leave pigtails for the old circuit.
What do I do with the pigtails from the old circuit that the outlet will no longer be wired to?
-Do they need to stay in the box(which would mean they would be pigtailed in the box, but not connected to the outlet, and new wiring would also run into the box for the new circuit connected to the outlet)?
-Get pushed into the wall?
-What seems the safest thing: Remove the outlet, leave the pigtails in the box, and put a blank over it. Then cut a new hole for a new box for the receptacle and new wiring to go into.
| Your best option, after having read the comments you provided, is to put a new branch circuit in for the Microwave, even though it is more difficult in your particular circumstance. The microwave should have a 20amp circuit, because it runs at over 13 Amps. 14AWG wire is rated for 15 Amps, but for continuous loads the rating drops to 12 Amps (80 percent of non-continuous per NEC 210.20(A)). You should also protect this new circuit with an GFCI outlet, especially if it is near a sink/water. Leave the 14 AWG wires connected in the back of the box so they feed the other outlets.
| 1 | The Microwave should have a 20amp circuit, because it runs at 13 Amps . |
Why is a precoder necessary for DQPSK and what does it accomplish? | I've implemented a soft-decoder for DQPSK using the wonderful answers I received here:
How to soft decode DQPSK?
To get the soft-decoder working properly I needed to precode the data I was sending out. I implemented the precoder mentioned in this paper:
$I_k=\overline{u_k \oplus v_k}*(u_k \oplus I_{k-1})+(u_k \oplus v_k)*(v_k \oplus Q_{k-1})$
$Q_k=\overline{u_k \oplus v_k}*(v_k \oplus Q_{k-1})+(u_k \oplus v_k)*(u_k \oplus I_{k-1})$
I'd like to know why this precoder is necessary -- what does that complicated expression of XORs actually accomplish?
Here's a table showing what the equation yields. If "to_encode" is 00, the to_send symbol is the same as the previous ("prev") symbol. If the "to_encode" is 11, the to_send symbol is the previous symbol xor 11. What is the meaning in other cases?
to_encode prev to send
[ 0 0 ] [ 0 0 ] [ 0 0 ]
[ 0 1 ] [ 0 0 ] [ 1 0 ]
[ 1 0 ] [ 0 0 ] [ 0 1 ]
[ 1 1 ] [ 0 0 ] [ 1 1 ]
[ 0 0 ] [ 0 1 ] [ 0 1 ]
[ 0 1 ] [ 0 1 ] [ 0 0 ]
[ 1 0 ] [ 0 1 ] [ 1 1 ]
[ 1 1 ] [ 0 1 ] [ 1 0 ]
[ 0 0 ] [ 1 0 ] [ 1 0 ]
[ 0 1 ] [ 1 0 ] [ 1 1 ]
[ 1 0 ] [ 1 0 ] [ 0 0 ]
[ 1 1 ] [ 1 0 ] [ 0 1 ]
[ 0 0 ] [ 1 1 ] [ 1 1 ]
[ 0 1 ] [ 1 1 ] [ 0 1 ]
[ 1 0 ] [ 1 1 ] [ 1 0 ]
[ 1 1 ] [ 1 1 ] [ 0 0 ]
| Differential encoder to the Gray mapping is to remove the 90 degree phase variance, e.g. the received constellations are 90 degree rotated. The receiver doesn't reply on the absolute phase of the QAM constellations but uses the transition between consecutive symbols to demodulate the data.
| 1 | Differential encoder to Gray mapping to remove 90 degree phase variance |
Is it ok to mix 2 GB and 4 GB DIMMS in an iMac (mid 2011)? | I've been told it is important to use matching DIMMs when installing memory to take advantage of the 128 bit throughput. I'm looking to buy a new 27" iMac (mid 2011) which has 4 memory slots. If I put matching 2x2GB in 2 of the slots and matching 2x4GB in the other two slots, will that reduce its throughput or cause any problems?
Do all 4 have to match or do each set of 2 need to match?
| Just to add to your peace of mind, my 21" iMac (prior version) is working beautifully at 2x2 and 2x4 (12 total) GiB. Way faster than before (4GiB really isn't sufficient for what I do), and I don't see any oddball slowdowns.
I got good quality memory that matched the MHz (1333) of the existing memory. Works like a charm.
That said, I didn't try going to 16 GiB, so I can't vouch that 16GiB isn't faster than 12, but for me, 12 is more than sufficient at the moment. When the time comes, I'll switch out the older 2x2 sticks, but I don't see that it will make a huge improvement.
| 0.888889 | 2x2 and 2x4 (12 total) GiB. |
Implement signature-level security on Android services with more than one allowed signature | I'm developing on an application at the moment which contains quite a lot of personal user information - things like Facebook contacts, etc ... Now, one of the things I want to be able to do (and have done, quite effectively) is open up parts of the application to "3rd Party" applications, using Android's build-in inter-process communication protocol (AIDL). So far so good.
Here's the catch: because we're involved in handling quite a lot of personal information, we have to be quite careful about who can and can't access it; specifically, only "Trusted" applications should be able to do so. So the natural way to do this is to use a custom permission within the AndroidManifest.xml file where we declare the services. My problem is this: I want to be able to enact signature-level protection (similar to the normal "signature" permission level), but with a bit of a catch:
I don't only want application signed with our internal signature to be able to access the services. I'd like to be able to build a list of "trusted signatures" & at runtime (or if there's a better way, then maybe some other time?) be able to check incoming requests against this list of trusted keys.
This would satisfy the security constraints in the same way as the normal "signature" permission level I think - only programs on the "trusted keys list" would be able to access the services, and keys are hard to spoof (if possible at all?) - but with the added bonus that we wouldn't have to sign every application making use of the APIs with our internal team's key.
Is this possible at the moment in Android? And if so, are there any special requirements?
Thanks
| I've now found the answer to this question, but I'll leave it for the sake of anyone looking in the future.
I opened up a discussion on android-security-discuss where it was answered. Link: http://groups.google.com/group/android-security-discuss/browse_thread/thread/e01f63c2c024a767
Short answer:
private boolean checkAuthorised(){
PackageManager pm = getPackageManager();
try {
for (Signature sig :
pm.getPackageInfo(pm.getNameForUid(getCallingUid()),
PackageManager.GET_SIGNATURES).signatures){
LogUtils.logD("Signature: " + sig.toCharsString());
if (Security.trustedSignatures.get(sig.toCharsString()) != null) {
return true;
}
}
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
LogUtils.logD("Couldn't find signature in list of trusted keys! Possibilities:");
for(String sigString : Security.trustedSignatures.keySet()){
LogUtils.logD(sigString);
}
/* Crash the calling application if it doesn't catch */
throw new SecurityException();
}
Where Security.trustedSignatures is a Map of the form:
Map<String,String>().put("public key","some description eg. name");
Put this method inside any code that is being called by the external process (ie. within your interface). Note that this will not have the desired effect inside the onBind() method of your RemoteService.
| 0.888889 | What is the answer to android-security-discuss? |
Solution disappearance responsive navigation after open/close | I asked this before, but still not successful. Hope someone can help me now... In the fiddle you see a responsive menu that has 4 menu-items horizontal inline when it is larger than 1000px. Smaller than 1000px the menu shows a nav-btn (now a RED box!) that onclick shows the menu-items, but when open and close and resize to larger than 1000px the rest of the 3 menu-items don't show up. I did some tests with media queries but i think the solution must be find in the javascript part. Anyone can handle this challenge?
Here the FIDDLE
$(function() {
$('.nav-btn').click(function(event) {
$('nav ul').fadeToggle(300);
});
});
| You might want to add a new media query like i did here @ FIDDLE
@media all and (min-width: 1000px) {
nav ul {
display: block;
top: 60px;
}
}
| 0.888889 | FIDDLE @media all |
How to Construct the Coproduct of Pointed Categories? | A pointed category is a (small) category together with a distinguished object, called the basepoint $*$. How does one explicitly construct the coproduct of two pointed categories?
This problem reduces to constructing the coproduct of two pointed connected categories. If both categories have one object, this becomes the free product of monoids.
| Well it is the pushout of $C \leftarrow 1 \rightarrow D$. Colimits of categories can be constructed by "merging" generators and relations, as it is the case with every algebraic category. [Of course, here $2$-colimits are pretty natural, but they turn out to be far more complicated!] Explicitly, $C \cup_1 D$ is the following category: It has objects $\mathrm{ob}(C) \cup_{\star} \mathrm{ob}(D)$, where we identify the two base objects $\star$. A morphism from, say, $c \in C$ to $d \in D$ is a finite chain of morphisms
$c \to c' \to \star \to d \to d' \to \star \to c'' \to c''' \to \star \to \dotsc \to d$.
We have the obvious cancellation rules. When $C,D$ have just one object, namely $\star$, this is the usual construction of the "free product" (this terminology is quite misleading since it is not a product, but rather a coproduct) of monoids.
| 1 | Colimits of categories can be constructed by "merging" generators and relations . |
Increasing the search query limit (Apache Solr) | We want to create a search page with Apache Solr with an increased query limit. I was reading that using hook_search_execute was not a recommended way to do this.
Is this statement correct? What would be the recommended way to go about this?
Apache Solr Views module?
Some other solution?
The page absolutely has to have more than 10 search results, and no pager.
| There is apparently a setting for this in the Apache Solr module itself.
Go to the specific search that you want to modify, and edit the "Advanced Search Page Options" value.
| 0.888889 | Apache Solr Modified search page |
Can I rest cement posts directly on the bedrock to build a structure for a large shed? | So I live in Canada, where winters are cold, and where there's not much soil above the bedrock. I would like to build a sturdy structure for an existing "shed" (in fact a 100-year old former stable or something) that's about 4m by 5m (12'x 15') and that's kind of collapsing. Currently, there's no real structure to speak of: it's only 2-inch thick boards piled up and nailed together, with small posts (like 2x4s) in the corners, resting on slabs of cement or something, each one about half as big as a basketball.
There's only about 60 cm of soil above the (granit) bedrock, and I was considering pouring concrete "posts" to rest directly on the bedrock, then using them as a basis for my structure (placing a metal plate on top that I can put a wood post on). My neighbour says that in the spring the meltwater will accumulate over the bedrock and may damage the concrete posts. Also, I would guess the ground probably freezes down to the bedrock in winter.
Any thoughts about this? alternative solutions? Note that I don't want to take the shed apart because it's 100-year-old wood and I think I would inflict substantial damage to it.
| Piles to bedrock (essentially what you are proposing, albeit with really short piles) is an excellent foundation. I'd suggest drilling some holes in the rock so you can pin (with steel rebar) the base of the concrete post/pile into the bedrock.
I don't think you'll have any issues with the freezing - it will happen, but the bedrock isn't going anywhere, and the building set on piles set on bedrock won't, either.
| 1 | Piles to bedrock is an excellent foundation |
Should I tell other interviewers where else I've interviewed? | I am currently travelling for faculty interviews. Some professors and other interviewers have asked me where else I have interviewed. Should I tell interviewers where else I've interviewed?
Intuitively I would like to give them less information, but I also don't want to appear guarded and defensive as a person, either.
| I cannot speak for faculty interviews personally and this may be redundant information but I interviewed at multiple "top ranked" schools for PhD admissions and in everyone of them I was asked where else I was interviewing and I told them the truth.
Having said this, nowadays, most job talk notifications are available on the website of the university or college or institution where you are interviewing and it is relatively easy to determine this from a google search of your name. For instance, this year our department is hiring for 2 different job lines and there are quite a few faculty candidates giving talks every week. We always Google their names to find out where else they are interviewing. In the case of one particular candidate it was very useful to find out that that that candidate had put up a list of other institutions where he/she was interviewing this particular season.
I do not think personally that giving them information about where else you are interviewing will add or subtract from your overall job application materials and probabilities.
Best of luck for getting a job !
| 1 | How do I find out where else you are interviewing? |
Are there English equivalents to the Japanese saying, “There’s a god who puts you down as well as a god who picks you up”? | There is an old Japanese saying, “捨てる神あれば、拾う神あり-Suterukami areba hirou kami ari,” meaning “There’s a god who puts you down as well as a god who picks up you.” In other words, “In this world, some people help you, and some people harm you” or “Fortune and misfortune come alternately.”
For example, when you are fired from an IT company, and then hired by its rival company with a higher salary three months later, your peers will say to you “You're a lucky man. There’s a god who throws you away as well as a god who picks you up.”
I’m curious to know if there are similar sayings in English to “Suterukami areba hirou kami ari.”
| Sometimes You Eat The Bear, Sometimes The Bear Eats You
(The quote from one great movie to lighten down this solemn thread.)
| 1 | Sometimes You Eat The Bear, Sometimes The Bear Eat You |
Unwanted vertical space before tabular on title page | I worked on my title page, and there is some undesired vertical space before a tabular environment. I made two fboxes to illustrate the vertical distance I wanted to be the same 116 pt. But after the second box, a tabular environment starts and I assume it adds some vertical space before itself. This could be removed manually via \vspace*{-6pt}, but I am curious where does it come from?
\documentclass[a4paper, 12pt, headsepline, headings=small,]{scrreprt}
\overfullrule=1mm
\usepackage[onehalfspacing]{setspace}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,showframe]{geometry}
\geometry{left=2cm,right=2cm,top=2cm,bottom=2cm}
\newenvironment{tightcenter}{%
\setlength\topsep{0pt}
\setlength\parskip{0pt}
\begin{center}
}{%
\end{center}
}
\begin{document}
% \topskip= x pt % 12 pt in scrreprt
\vspace*{12 pt} % so in effect 24 pt
\begin{tightcenter}
Title \\
Title more info \\
Title more info \\
\fbox{\begin{minipage}{116 pt} \hfill\vspace{116 pt}\end{minipage}}\\
%\vspace{116 pt}
\Large\textbf{\textrm{Huge Title Huge Title Huge Title Huge Title Title Huge}}
\fbox{\begin{minipage}{116 pt}\hfill\vspace{116 pt}\end{minipage}}
%\vspace{116 pt}
\end{tightcenter}
% \vspace*{-6pt}
\noindent\begin{tabular}{p{3cm}p{3.75cm}l}
& Advisor: & text text text\\
& More info: & text text text\\
& More info: & text text text\\
& More info: & text text text\\
\end{tabular}
\end{document}
Can I somehow remove this space other than using a negative vspace?
Thanks.
| that is the default vertical skip after the center environment. Try:
[...]
}{%
\end{center}
\vspace{-\lastskip}%
}
[...]
| 0.888889 | default vertical skip after center environment |
VB.net Service Programming and using TCP Sockets | I am having a problem and I was curious if anyone could help me solve it. I took a tutorial for client-server socket programming for VB.NET. I then tried to implement it using a service rather than a program. I understand how it works as a program, but when I try to port it over to a service it doesn't work. When I run the service it starts and stops instantly. It never makes a connection. Unfortunately, I am not that great of VB.net programmer but so far I am liking it a lot for rapid development of programs.
The idea of this service is to:
run when the computer starts
grab the name of the PC
Send the name of the PC to the server
a. the server then takes the name and looks it up in a database
b. returns the time that the client machine is suppose to back up
The client machine then does the math for the current time and the time it’s suppose to backup & put everything in ms.
Then the machine backs up at that specified time by running a dos command to launch the program.
Now to answer a question that I have found common in the forums. Why don't I use task scheduler. Well I did use task schedule and had the server control times to machines that way. However, some computers will go into a dormant state, I would say this dormant state affects 20% of the machines. No this dormant state is not sleep mode and not hibernation. The computers are on and they are react very quickly to mouse movement. I created a service that writes the time to a file on the C:\ and this has always worked. So now I have decided to have a service on the client machine and have it communicate with the server.
I have collected very little information about creating service and network socket programming. Unfortunately, I haven’t found anything that ties the 2 together. I found a vb.net client-server program that does what I want, but I want it as a service not a program. I found a temporary solution with creating files using PSEXEC from the server, but this process is just so umm unsophisticated.
I did the next best thing and I went and reviewed the Microsoft library for sockets and tried to build my own service based on what makes sense. Still nothing works. If you know of any books, resources, have any advice, etc. any help you can give me will be greatly appreciated. Thank you for your assistance.
Below you will find my code. At this point all I care about doing is making the connections between clients and the server. I can go back to figuring out the rest and tweek the code from there.
Mike
Here is the server code I have been playing with:
Imports System.Net.Sockets
Imports System.Net
Imports System.Text
Public Class BackupService
Private Mythread As Threading.Thread
Private clientThread As Threading.Thread
Private listener As New TcpListener(IPAddress.Parse("#.#.#.252"), 8888)
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
listener.Start() 'Listener for clients
System.IO.File.WriteAllText("C:\test\listener.txt", My.Computer.Clock.LocalTime)
Mythread = New Threading.Thread(AddressOf listenerLoop)
Mythread.Start()
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
Mythread.Abort()
End Sub
Protected Sub listenerLoop()
Dim client As TcpClient = listener.AcceptTcpClient()
Dim networkStream As NetworkStream = client.GetStream
Dim bytes(client.ReceiveBufferSize) As Byte
Dim dataReceived As String
While True
networkStream.Read(bytes, 0, CInt(client.ReceiveBufferSize)) 'Receives data from client and stores it into bytes
dataReceived = Encoding.ASCII.GetString(bytes) 'Encodes the data to ASCII standard
System.IO.File.AppendAllText("C:\test\listener.txt", dataReceived) 'Copies information to text file
Threading.Thread.Sleep(1000)
End While
'Listening for incoming connections
'While True
' If (listener.Pending = False) Then
' System.IO.File.AppendAllText("C:\test\listener.txt", "Sorry, no connection requests have arrived")
' Else
' 'Finds Incoming message and creates a thread for the client-server to pass information'
' clientThread = New Threading.Thread(AddressOf clientConnection)
' clientThread.Start()
' End If
' Threading.Thread.Sleep(1000) 'Let loop/thread sleep for 1 second to allow other processing and waits for clients
'End While
End Sub
'Protected Sub clientConnection()
' Dim client As TcpClient = listener.AcceptTcpClient()
' Dim networkStream As NetworkStream = client.GetStream
' Dim bytes(client.ReceiveBufferSize) As Byte
' Dim dataReceived As String
' Dim datasent As Boolean = False
' While datasent = False 'Continuously loops looking for sent data
' If (networkStream.CanRead = True) Then
' networkStream.Read(bytes, 0, CInt(client.ReceiveBufferSize)) 'Receives data from client and stores it into bytes
' dataReceived = Encoding.ASCII.GetString(bytes) 'Encodes the data to ASCII standard
' System.IO.File.AppendAllText("C:\test\listener.txt", dataReceived) 'Copies information to text file
' datasent = True
' End If
' Threading.Thread.Sleep(1000)
' End While
' networkStream.Close() 'Closes the network stream
' client.Close() 'Closes the client
' clientThread.Abort() 'Kills the the current thread
'End Sub
End Class
Client Code (service):
Imports System.Net.Sockets
Imports System.Net
Imports System.Text
Public Class TestWindowsService
Dim Mythread As Threading.Thread
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
'clientCommunication()
Mythread = New Threading.Thread(AddressOf KeepCounting)
Mythread.Start()
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
Mythread.Abort()
End Sub
'Protected Sub KeepCounting()
' Dim wait As Integer = 0
' Dim hour As Integer = 0
' Dim min As Integer = 0
' System.IO.File.WriteAllText("C:\test\StartTime.txt", "Start Time: " & My.Computer.Clock.LocalTime)
' Do While True
' hour = My.Computer.Clock.LocalTime.Hour
' If (hour = 1) Then
' min = (My.Computer.Clock.LocalTime.Minute * 60) + 60000
' Threading.Thread.Sleep(min) 'Sleeps for the number of minutes till 2am
' file.FileTime()
' Else
' Threading.Thread.Sleep(3600000) 'Sleeps for 1 hour
' System.IO.File.WriteAllText("C:\test\hourCheck\ThreadTime.txt", "Time: " & My.Computer.Clock.LocalTime)
' End If
' Loop
'End Sub
Protected Sub KeepCounting()
Dim tcpClient As New System.Net.Sockets.TcpClient()
tcpClient.Connect(IPAddress.Parse("#.#.#.11"), 8000)
Dim networkStream As NetworkStream = tcpClient.GetStream()
If networkStream.CanWrite And networkStream.CanRead Then
' Do a simple write.
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes("Is anybody there")
networkStream.Write(sendBytes, 0, sendBytes.Length)
' Read the NetworkStream into a byte buffer.
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
' Output the data received from the host to the console.
Dim returndata As String = Encoding.ASCII.GetString(bytes)
Console.WriteLine(("Host returned: " + returndata))
Else
If Not networkStream.CanRead Then
Console.WriteLine("cannot not write data to this stream")
tcpClient.Close()
Else
If Not networkStream.CanWrite Then
Console.WriteLine("cannot read data from this stream")
tcpClient.Close()
End If
End If
End If
' pause so user can view the console output
Console.ReadLine()
End Sub
End Class
Client Code (extended Module)
Imports System.Net.Sockets
Imports System.Net
Imports System.Text
Module Client_TCP_Communication
Public Sub clientCommunication()
Dim tcpClient As New System.Net.Sockets.TcpClient()
tcpClient.Connect("127.0.0.1", 8000)
Dim networkStream As NetworkStream = tcpClient.GetStream()
If networkStream.CanWrite And networkStream.CanRead Then
' Do a simple write.
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes("Is anybody there")
networkStream.Write(sendBytes, 0, sendBytes.Length)
' Read the NetworkStream into a byte buffer.
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
' Output the data received from the host to the console.
Dim returndata As String = Encoding.ASCII.GetString(bytes)
Console.WriteLine(("Host returned: " + returndata))
Else
If Not networkStream.CanRead Then
Console.WriteLine("cannot not write data to this stream")
tcpClient.Close()
Else
If Not networkStream.CanWrite Then
Console.WriteLine("cannot read data from this stream")
tcpClient.Close()
End If
End If
End If
' pause so user can view the console output
Console.ReadLine()
'Dim clientSocket As New System.Net.Sockets.TcpClient()
'Dim serverStream As NetworkStream
'While True
' serverStream = clientSocket.GetStream()
' Dim outStream As Byte() = System.Text.Encoding.ASCII.GetBytes("Message from client$")
' Dim inStream(1024) As Byte
' Dim returnData As String
' System.IO.File.WriteAllText("C:\test\client\ClientStarted.txt", "Time: " & My.Computer.Clock.LocalTime)
' clientSocket.Connect(IPAddress.Parse("#.#.#.11"), 8999)
' System.IO.File.WriteAllText("C:\test\client\ClientConnected.txt", "Time: " & My.Computer.Clock.LocalTime)
' serverStream.Write(outStream, 0, outStream.Length)
' serverStream.Flush()
' serverStream.Read(inStream, 0, CInt(clientSocket.ReceiveBufferSize))
' returnData = System.Text.Encoding.ASCII.GetString(inStream)
' System.IO.File.WriteAllText("C:\test\client\returnData.txt", "Time: " & returnData)
'End While
End Sub
End Module
| To find out why it's starting and then stopping, you might try looking in the Application event log after trying to start the service. Could be running into an error on (or just after) startup that is causing the service to stop.
I ran into that problem when trying to write a similar service--in my case I was trying to auto-detect the IP address to use, and it turns out it was inadvertently selecting my IPv6 loopback address and failing to bind. An error in the event log hinted at this for me.
| 0.666667 | Running into an error when trying to start a service |
Why Didn't Théoden Let Merry Fight In the Battle At Minas Tirith? | In the Peter Jackson version of The Return of the King, Merry offers Théoden his sword and service, which Théoden accepts. Théoden gives Merry the title of "Meriadoc -- Esquire of Rohan."
When the Rohirrim set out to ride to Minas Tirith, Théoden is very firm with Merry, that he is not allowed to ride into battle, and tells Merry that he is a burden that none of the Rohirrim can bear at that time.
Why didn't Théoden let Merry ride to war? And yes, I know that Merry was taken into the Battle of the Pellenor Fields by Éowyn, who herself was going to fight on the sly.
| Théoden accepts Merry's pledge of service, but in good conscience cannot see letting Merry ride into battle against foes twice his size, on a battlefield with horses, oliphants, and god knows what else might be there. Théoden appreciated the gesture and uses the excuse of there not being a warrior able to bear Merry as a burden as a polite way of saying, "stay out of the way."
| 1 | Théoden accepts Merry's pledge of service, but in good conscience cannot see letting Merry ride into battle against foes |
Drupal redirects to old url after moving to new server | I am in the process of moving a drupal site to a new server.
I copied the drupal db and moved all the files of the drupal installation.
The old url is http://www.sniffingmusicians.echidna-band.com/ and the new is http://www.sniffingmusicians.com/, which point to 2 different servers.
Even though the frontpage of new is there when I login it redirects me to the old domain! Additionally, all the content is prefixed with the old url. I changed the $base_url in the settings php but there is no real impact. Where else can I reconfigure my site's url?
| If you are using domain access, be sure to check the table PREFIX_languages. I had the exact same problem and wasted 2 days before I found the problem. The old domain was hard coded in the PREFIX_languages table and once I changed it everything worked perfectly.
| 1 | PreFIX_languages |
What does the inspector mean by "Hot and Neutral are not separated"? | In an inspection report on my house, the inspector said "hot and neutral" are not separated. I think he meant "neutral and ground" are not separated. I've attached the picture, is that the case?
| I'm guessing from the image that this is a sub-panel, in which case the inspector is correct. The National Electrical Code (NEC) says:
National Electrical Code 2008
250.24 Grounding Service-Supplied Alternating-Current Systems.
(A) System Grounding Connections.
(5) Load-Side Grounding Connections. A grounded conductor shall not be connected to normally non–currentcarrying metal parts of
equipment, to equipment grounding conductor(s), or be reconnected to
ground on the load side of the service disconnecting means except as
otherwise permitted in this article.
Which means the only place the "neutral" (grounded conductor) is bonded, is in the main service panel. If the grounded (neutral) and equipment grounding conductors (EGC) are bonded anywhere else, you can end up with neutral currents on the EGC and metal parts of equipment which is a violation of 250.6(A).
250.6 Objectionable Current.
(A) Arrangement to Prevent Objectionable Current. The grounding of electrical systems, circuit conductors, surge arresters,
surge-protective devices, and conductive normally non–current-carrying
metal parts of equipment shall be installed and arranged in a manner
that will prevent objectionable current.
A second look
After taking another look at this, he could mean that the white insulated wires are not marked appropriately. When you use a wire with white (gray, or with three continuous white stripes) insulation as an ungrounded (hot) conductor, you have to mark the wire in some way to indicate that it is not used as a grounded (neutral) conductor.
200.7 Use of Insulation of a White or Gray Color or with Three Continuous White Stripes.
(C) Circuits of 50 Volts or More. The use of insulation that is white or gray or that has three continuous white stripes for other
than a grounded conductor for circuits of 50 volts or more shall be
permitted only as in (1) through (3).
(1) If part of a cable assembly and where the insulation is
permanently reidentified to indicate its use as an ungrounded
conductor, by painting or other effective means at its termination,
and at each location where the conductor is visible and accessible.
Identification shall encircle the insulation and shall be a color
other than white, gray, or green.
Since the white wires connected to the breakers are not marked, it looks (to the untrained eye) as if the grounded (neutral) conductors are connected to the hot bus. The most common way to mark the wires, is to wrap a bit of black electrical tape around a small section of the wire.
| 1 | Grounding Service-Supplied Alternating-Current Systems |
My visa period start on arrival, would they let me get into the plane? | I have a question, I applied for the Schengen visa through Germany, on the form they ask me when I'd arriving (to Germany) and when I'd returning. they take this exact date as the visa period.
I wondering if they would let me get into the plane, even though my flight it a day before the arrival.
Let get the real deal; let say this:
My visa is valid from 02/12/2014 to 02/02/2015. But, my flight is scheduled to be departing on 01/12/2014, but entering Germany 02/12/2014. the flight duration is almost 9hours and there is 7hours difference between Germany and the departing flight country.
| The purpose of the airline checking your ticket, visa and passport is to ensure that they can legally transport you to your destination, and believe from that evidence that you will be permitted into the country of destination.
For this to occur, you need to usually show some or all of:
a return ticket, or exit ticket out of the destination country
a valid passport, sometimes with pages/months free on the passport
a visa for the country, valid for when you enter the country
So, for this question, the focus is on the visa. Their simple process will be - when he arrives, will he have a valid visa? Yes. Great, approved.
Similarly, if your visa was valid on the day you left and NOT when you arrived (ie you were arriving at the end of your visa for some weird reason) they'd hopefully not let you board, as when you arrive, your visa wouldn't be valid.
Conclusion: Fly, and enjoy Germany!
| 1 | What is the purpose of checking your ticket, visa and passport? |
I can't find a PFET protected against ESD | I like to use OmniFETs for MOSFETs because they have internal protection against ESD so I am unlikely to damage them while handling and then when they don't work I don't have to wonder if it was damaged or I have a circuit mistake. These are n-channel FETs, but now I need a p-channel FET. I tried to find one Mouser and Digikey, but was unsuccessful. Is there such a thing?
It would basically be a MOSFET and a diode in one package. Other things like over-current and over-temperature protection would also be nice, but are less important.
| I would like to add that it seems to me like a very futile effort to only use ESD-protected FETs. If you have a FET that is large enough to hold in your hand, it is already fairly rugged by virtue of physics. Gate and drain-source capacitance make sure that whatever charge you can inject into the device will not cause large enough voltages to spark over.
But much more importantly: when handling any other active device, you are probably holding tens, hundreds, thousands of tiny little FETs in your hand, each and every one of them orders of magnitude more sensitive to ESD. There is usually some protection on the outgoing pins, but I'm afraid that the only way to really set yourself free from the worry of ESD is to regard proper ESD safety:
Regard air humidity at all times, try to keep it high (70%+). Air humidity dissipates static charges extremely effectively.
When dealing with sensitive devices - something that is almost always mentioned in the datasheet or on the package if this is especially so - wear an ESD dissipative wrist band connected to an ESD mat, which in turn is connected to your mains electricity ground with an appropriate connector. ESD mats nowadays are very inexpensive.
Regard your clothing. Do not wear clothing with long exposed fibers (e.g. wool).
This way you will be able to enjoy electronics with access to the full gamut of devices, instead of having to artificially limit yourself to only those which explicitly advertise ESD protection. Which doesn't guarantee you in any way that you do avoid ESD damage either!
| 0.888889 | Use ESD-protected FETs in your hand |
Conscript won't install - what to do? | I'd like to started with Scalatra. For that, I need to use giter8 to generate a template project. To install giter8, I need to install conscript first. But doing that (at least using the runnable jar on Windows) fails with this error:
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: net.databinder.conscript#conscript_2.11;0.4.4: not found
::::::::::::::::::::::::::::::::::::::::::::::
This is with the latest conscript version. Doesn't it support scala 2.11 yet? Is conscript even still actively maintained? The mailing list is dead and there's not even a stackoverflow tag.
Although I'd prefer to fix the conscript installation issue, is there an easy workaround? Like installing giter8 without using conscript? Or setting up scalatra without using giter8?
| It turned out I had an older conscript version installed that I didn't remove first. Starting from scratch (deleting conscript and g8 installations) allowed me to install version 0.4.4 without this issue.
| 0.888889 | deleting conscript and g8 installations |
Export error with addon | Im trying to export a model for the Euro Truck Simulator 2 game with the Blender2SCS addon and I get the following error, any help?
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\addons\io_scene
_scs\__init__.py", line 1951, in execute
error = export_scs.save(filepath, origin_path, root_object, self.copy_textur
es, int(self.pmg_version))
File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\addons\io_scene
_scs\export_scs.py", line 27, in save
status, ob = export_pmd.save(exportpath, originpath, root_ob, copy_textures)
File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\addons\io_scene
_scs\export_pmd.py", line 305, in save
pmd.write(f, exportpath, originpath, copy_tex)
File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\addons\io_scene
_scs\export_pmd.py", line 267, in write
ret_ob = exp_mat.write(copy_tex)
File "C:\Program Files\Blender Foundation\Blender\2.72\scripts\addons\io_scene
_scs\export_mat.py", line 91, in write
for option in self.__options.keys():
AttributeError: 'str' object has no attribute 'keys'
location: <unknown location>:-1
location: <unknown location>:-1
| The addon seems to be broken due to api changes in Blender, either use the addons bug tracker or try an older version of Blender that is compatible. According to the video tutorials version 2.66 was used.
| 0.888889 | Addons bug tracker in Blender |
In a C# ASP.NET view, how can I wrap numbers after a comma? | At the moment I have something that looks a little like this
@string.Format("{0:#,###,###.##}", "9999999999")
which will display the value as: 9,999,999,999
However sometimes I have only a small DIV to display this large number. So I want to wrap the number after the commas.
I did try this
@string.Format("{0:#,###,###.##}", @lot.MinDecrement).replace(",", ",< wbr>")
I just tried to see if it would but a break in the word, but this doesn't work and actually puts in the string.
Does anyone know how I can simply make the text wrap if it needs to, after a comma?
Thanks
| You can wrap the content of a DIV with CSS, like so:
div{
word-wrap: break-word;
}
Here is a working example (resize the output pane)
If you want it to wrap after each comma, then you can add spaces to the value (which may be what you was trying to do, like so:
@String.Format("{0:#,###,###.##}", "9999999999").Replace(",", ", ");
Here is an example using this result
| 1 | Wrap content of a DIV with CSS |
Is there anyway to return particular elements from JFrame? | Lets imagine that JFrame containes 9 JTextFields like so:
public static JFrame generateFrame(){
JFrame frame = new JFrame();
Container c = frame.getContentPane();
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(3,3));
JTextField[]textFields = new JTextField[9];
for(int i=0; i<9;i++){
textFields[i]= new JTextField(1);
textFields[i].setFont(new Font("Sans-serif", Font.BOLD, 30));
panel.add(textFields[i]);
}
c.add(panel);
frame.setVisible(true);
frame.setSize(300,300);
return frame;
}
So I assign this returned JFrame to variable in main method like so:
public static void main(String []args){
JFrame gameFrame = generateFrame();
}
Is there anyway to extract all the textfields from "gameFrame" object? Something like docyment.getElementByTagName("element") equivalent in DOM?
| Try following.
Component[] components = gameFrame.getComponents();
for (int i = 0; i < components.length; i++) {
if (components[i] instanceof JTextField) {
//DO what you want with the text field here
}
}
Hope it helps.
| 0.777778 | Component[] components |
How to Enable Ports 25 - 28 on a Cisco Catalyst 3750 | I am trying to enable ports 25 - 28 on my 28 port Catalyst 3750. These four ports are my fiber ports. I am using the following command to bring up that interface.
interface range Gi1/0/25 - 28
That works and it dumps me in the config-if-interface prompt. This is where I get stuck. I just want to enable these four ports and have them be in VLAN1 and On just like ports 1 - 24.
How do I do this?
| Have you tried:
- a show interface gi1/0/25 capabilities to see if the switch recognizes the SFP?
- checked that the SFP type works with the fiber type you are trying to use?
- The fiber path in properly patch and consistently the same type of fiber?
- The switch on the other end has a compatible SFP as well?
- some interfaces allow speed changes to be configured, you might check that the switches are configured the same on both sides.
I took a short LC and flipped the TX - RX, so that I can default the interface do a no shut, then plug in the tester to two interfaces on the same switch. That will eliminate the other switch and the path if the link doesn't come up.
| 1 | How to check if the switch recognizes the SFP? |
What kind of gasoline additives will help maintain the engine efficiency/life? | Aside from the traditional maintenance of oil changes, and keeping fluid levels correct - what else will help prolong the engine's life?
I recall a few years back gasoline additives were the thing to go with - what's the best/recommended one currently? If any.
Edit: I recall reading about each gasoline brand having their own set of additives at one point, where it was suggested to cycle between a few different brands every X amount of km/miles. The reason behind switching was so that the next brand would cleanup any sediments left by the previous brand. How likely is this in today's world? And better yet, how important is it?
| The most important thing is to use good gas (Top Tier if you are in the states), and change your oil. Other than that, I use all high quality synthetic products from AMSOIL in my ride.
I personally use one bottle of their fuel treatment (P.i) in the spring and I use their oil flush before each oil change. Other than that I just keep to the maintenance schedules for when to flush/change fluids and filters etc...
Also if you are going to store your vehicle for any period of time never forget to use gasoline stabilizer.
Edit: Top Tier is a trademarked standard of gasoline which meets a certain specification or requirement for additives. You can read/see the retailers on their site.
| 1 | Use good gas (Top Tier if you are in the states) |
Disabled buttons while long running task | My application has a toolbar and a lot of buttons on it. Some buttons start a long running processes(tasks). At this moment every task executes asynchronously to allow user to do something else while task is executing. Thereby I have a problem: user can click the same button many times to start others same tasks. I have decided to disable button before start task and enable it after finish. Other problem, I should to protect other buttons from pressing (some of these would be disabled after done current tasks). In general, I have to disable all buttons (toolbar) to be sure that user cannot do something dangerous with buttons at transient. My questions are:
Could someone recommend way to distract users from flickering (disable/enable buttons) or how to involve them in process, how to made them filling that task is not so long?
Maybe I should to execute tasks synchronously and disable all UI for time of execution?
By the way:
Delay can vary from 1 to 10 sec. About progress bar: it is a difficult to calculate current progress, and it causes some performance degradation (task can be done faster without any additional UI iterations from other threads).
| A quick suggestion: can you make it a "checkbox button", having its "Pressed"/"Checked" state indicate that task is running. Then automatically "un-press"/"un-check" it when the task async finishes?
| 0.333333 | Can you make it a "checkbox button" or "un-press" |
iTextSharp read pdf template from hard drive and write text | I have a basic PDF file that I has 5 different blank content areas that I want to use iTextSharp to write text too. The problem is I'm not sure the best way to accomplish this. I have attempted to use ColumnText to accomplish this, but I cannot seem to add multiple ColumnText objects.
ColumnText tagColumn = new ColumnText(pdfContentByte);
tagColumn.SetSimpleColumn(460, 100, 620, 160);
string[] tagColors = bt.DealerTagColor.Split('|');
Font tagFont = FontFactory.GetFont(bt.DealerTagFont, bt.DealerTagSize, Font.NORMAL, new BaseColor(int.Parse(tagColors[0]), int.Parse(tagColors[1]), int.Parse(tagColors[2])));
Paragraph p = new Paragraph(dto.Tag, tagFont);
p.Leading = bt.DealerTagSize;
tagColumn.AddElement(p);
tagColumn.Go();
What I like about the ColumnText is it allows me to essential define a heigth/width, and position of the text area.
Any thoughts on how I can accomplish this with or without using ColumnText? I just need to have control of the font/fontsize/font color/leading/and width of the area which will allow the text to wrap.
| The easiest way would be to create and use form fields on your template PDF. This way you can reference a form field by name and set its value with a simple function call.
This article helped me:
Fill in PDF Form Fields using the Open Source iTextSharp Dynamic Link Library
EDIT: PdfPTables?
If your ColumnTexts are tabularly arranged consider using a PdfPTable. I've used PdfPTables to fill rows of data in forms generated from a blank template form. You need to figure out the x-coordinate of each of your columns and use these values when adding PdfPCells to your table, but it does work. I've never had to set an upper limit to the height of a PdfPCell but I image you can do it.
Check this page for more on PdfPTables.
| 0.888889 | PdfPTables to fill rows of data in templates |
AES using derived keys / IVs. Does it introduce a weakness? | I'm looking for an efficient way to encrypt multiple fields in a database with AES using a single global key, used throughout a large web application.
Obviously in order to re-use this key, a unique random IV is required for each field that is to be encrypted.
I'd rather not introduce more fields to the database to store each of these IVs, so the programatic approach seems to be to derive these IVs some how.
I'm toying with using either:
key = sha256(global_key + table_name)
iv = sha256(column_name + primary_key)
Or even simply:
key = global_key
iv = sha256(table_name + column_name + primary_key)
I'm leaning towards the former to generate per-table keys.
I've already read that the IVs do not need to be kept secret. So I'm working on the assumption that a derived key or IV (even if the algorithm becomes known), is no more insecure than any other non-secret IV, as long as the original key remains secret.
The question is:
Is there a fatal flaw in my approach? Am I introducing any serious weaknesses that, in the event that an adversary obtains a copy of the database, would make it easier for them to retrieve the plaintext data?
I realise that is potentially soliciting one word answers.
Suggestions for alternate / better schemes very much welcomed, as well as references to existing works and how they implement similar scenarios.
| A potentially better approach would be to store the IV and ciphertext in one column. This way, you can generate IVs in the way most appropriate for your choice of encryption mode while also not having to add columns.
Something like "$AES-128-CBC$" + Base64.encode64(iv) + "$" + Base64.encode64(ciphertext) is similar to the format used in crypt, easily parseable, and being Base64-encoded is slightly more convenient when doing queries on the database using command-line clients.
| 0.888889 | storing IVs and ciphertext in one column |
ifpackageloaded question | why when i comment \usepackage{geometry} i get error?
\documentclass{book}
\usepackage{geometry}
\makeatletter
\@ifpackageloaded{geometry}
{ % i the package was loaded
\newcommand*{\qw}{\itshape} % this is enabled, else is not enabled.
}{}
\makeatother
\begin{document}
\qw hallo
\end{document}
| LaTeX defines several conditional macros, with a syntax very different from the primitive
\if?<condition><true>\else<false>\fi
where \if? denotes any of the primitive conditionals. The conditionals defined by LaTeX have the form
\@ifsomething{<arg>}{<true>}{<false>}
or
\@ifsomething{<arg1>}{<arg2>}{<true>}{<false>}
Conditionals of the first kind are \@ifundefined and \@ifpackageloaded; among the second kind are \@ifpackagelater and \@ifpackagewith. The motivation for the distinction is that in the second kind we need something more to check a condition (the package name and an option name, for \@ifpackagewith).
The <true> and <false> code are executed respectively when the condition is satisfied or not. So
\@ifpackageloaded{geometry}
{\newcommand\qw{\itshape}}
{\newcommand\qw{\bfseries}}
is the answer. Either argument can be empty, of course.
You find an example of \@ifpackageloaded and some more information in Italian in this book (p. 78 for the main problem)
Note There is also \@ifdefinable<control sequence>{<true>} that has no "false" branch; it will execute the code <true> if the <control sequence> is undefined and raise an error otherwise (ignoring the <true> code).
| 0.888889 | LaTeX defines several conditional macros with a syntax very different from if? |
What is Application Pool in IIS and Asp.Net? | How is application pool implemented in IIS?
Is each application pool equivalent to a .Net AppDomain?
Or it is a equivalent to a .Net process?
How is Application pool related to IIS w3wp.exe?
|
1 . Is each application pool equivalent to a .Net AppDomain?
No, an application pool may have several AppDomains. Each AppDomain represents a single running ASP.NET Application. Many ASP.NET Applications may belong to a single Application Pool.
2 . Or it is a equivalent to a .Net process?
Not quite. See below.
3 . How is Application pool related to IIS w3wp.exe?
An application pool represents a limited number of worker processes that may host a potentially larger number of applications. This is similar to how a SQL Connection Pool shares a limited number of connections among an arbitrary number of requests.
By default, an Application Pool gets one Worker Process (w3wp.exe), and it's usually best to leave this setting alone unless you know what you're doing. Still, an Application Pool can be configured to use any number of processes.
The Worker Process is actually the resource that's being pooled here, not the AppDomain. There will always be the same number of AppDomains as there are ASP.NET Applications (unless one is in the middle of shutting down, or an application creates its own AppDomains), but the number of Worker Processes is independent; an Application Pool gives you a specific number of Worker Processes to handle requests for a specific number of AppDomains.
A setting of 1 (the default) for the number of worker processes in an App Pool means that all Applications/AppDomains in the pool share the same worker process.
| 1 | Is each application pool equivalent to a .Net AppDomain? |
Generate mousemove event with dispatchevent? | Is there anyway to do a mousemove event with java.awt.Component.dispatchEvent(AWTEvent)?
.dispatchEvent(new MouseEvent(client.a
.getComponentAt(1, 1),
MouseEvent.MOUSE_MOVED,
System.currentTimeMillis(),
MouseEvent.NOBUTTON,
x,y,
1,
false));
I got this now but it doesnt perform a mouse move.
How can i do it?
Edit:
I tried it like this but its not working:
.dispatchEvent(new MouseEvent(client.a
.getComponentAt(1, 1),
MouseEvent.MOUSE_MOVED,
System.currentTimeMillis(),
MouseEvent.NOBUTTON,
x,y,
0,
false));
Thanks,
Jeffrey
| I know of no way to do this the way you're trying as the MouseEvent (as far as I understand it) is for sending mouse messages to components not the operating system. Usually I've used the Robot class or JNA to actually move the mouse cursor on the screen.
| 0.777778 | MouseEvent is for sending mouse messages to components not operating system |
Finding the smallest binary relation in a given set including a relation | The following binary relation of the set {a, b, c, d, e} is given:
R = { (a,b), (a,c), (b,c) }
What I have to do is to find the smallest reflexive / symmetric / transitive / antisymmetric relation including R.
I know what these relations are all about, but what I have trouble with is how to find them. For example, I see no reflexive relation in the set. Does "including R" mean that i can extend R with any element from the given set? So for example, if I am looking for a reflexion can I just add (a, a)?
If I can extend the set, my solution would be:
Reflexive: Add (a,a)
Symmetric: Add (b,a)
Transitive: Already satisfied
Antisymmetric: Already satisfied? I am not sure about this one
| You're on the right track. "Containing" means just what you would think, since $R$ is a set, we want another set of pairs of elements $(x,y)\in S\times S$ so that $R\subseteq R'$ and $R'$ has one of the properties you mention.
First you need to add $(x,x)$ for every $x\in S=\{a,b,c,d,e\}$ which will give you $R_r=R\cup\{(a,a),(b,b),(c,c), (d,d), (e,e)\}$--the smallest reflexive relation containing $R$.
For a symmetric one, you need to add all of the elements of $R$ where you switch $x$ and $y$, i.e. $R_s=R\cup\{(b,a), (c,a), (c,b)\}$
Continuing for the others, we need a transitive one, so we need to see if there are $xRy$ and $yRz$, and in-fact there is exactly one, namely since $aRb$ and $bRc$ we need to add $aRc$, but you already have $(a,c)\in R$, so $R_t=R$.
Finally anti-symmetry is already satisfied, since there are no $x,y\in S$ such that $xRy$ and $yRx$, so $R=R_a$ is already anti-symmetric. If you have trouble seeing how this is, remember that antisymmetric is parsed in logical symbols as
$$\forall x,y\in S (xRy\land yRx\implies x=y)$$
Since the set of $x,y\in S$ such that $xRy$ and $yRx$ is empty, the condition is vacuously true because all $\forall z\in\varnothing$ statements are vacuously true because the negation is $\exists z'\in\varnothing$ which is clearly false, since there are no elements in an empty set.
| 0.777778 | "Containing" means just what you would think . |
Native Browser Automation using Appium 1.2.0.1 on Windows 7 Android real device: Could not find a connected Android device | I have looked many forums for this issue, there are quite a few answers on this topic but none of these have worked for me/match my criteria.
I recently took up Mobile Automation task and hence am completely new to Appium. I am working with Appium 1.2.0.1 on Windows 7 and trying to automate the native Android Browser(not Chrome or an App) on an Android v4.3 real device.
I have installed everything according to the instructions. I am using Selenium in Maven Build in JUnit Framework to execute the scripts through Appium. I use Appuim.exe in Admin mode and use the GUI to start the node. Then I run my scripts.
My issue is that when I try "adb devices" in cmd, I am able to see the device. Whereas, during execution, Appium is throwing an Error "Failed to start an Appium session, err was: Error: Could not find a connected Android device." I tried many troubleshooting options and verified if everything is in place. No luck. Please help.
Below is the trace of Error:
> Checking if an update is available
> Update not available
> Starting Node Server
> info: Welcome to Appium v1.2.0 (REV e53f49c706a25242e66d36685c268b599cc18da5)
> debug: Non-default server args: {"address":"127.0.0.1","fullReset":true,"logNoColors":true,"platformName":"Android","platformVersion":"18","automationName":"Appium","browserName":"Browser"}
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"4.3","browserName":"Browser","platformName":"Android","device":"Android","deviceName":"Android"}}
> debug: Appium request initiated at /wd/hub/session
> info: Retrieving device
> warn: code=ENOENT, errno=ENOENT, syscall=spawn
> debug: Request received with params: {"desiredCapabilities":{"platformVersion":"4.3","browserName":"Browser","platformName":"Android","device":"Android","deviceName":"Android"}}
> debug: The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : device
> debug: Looks like we want chrome on android
> debug: Creating new appium session fa19e382-c178-4e6b-8150-a386a51bee39
> debug: Preparing device for session
> debug: Not checking whether app is present since we are assuming it's already on the device
> debug: Checking whether adb is present
> debug: Using adb from C:\Android\android-sdk\platform-tools\adb.exe
> debug: Trying to find a connected android device
> debug: Getting connected devices...
> debug: executing: "C:\Android\android-sdk\platform-tools\adb.exe" devices
> debug: Could not find devices, restarting adb server...
> debug: executing: "C:\Android\android-sdk\platform-tools\adb.exe" kill-server
> warn: code=ENOENT, errno=ENOENT, syscall=spawn
> warn: code=ENOENT, errno=ENOENT, syscall=spawn
> debug: Getting connected devices...
> debug: executing: "C:\Android\android-sdk\platform-tools\adb.exe" devices
> debug: Could not find devices, restarting adb server...
> debug: executing: "C:\Android\android-sdk\platform-tools\adb.exe" kill-server
> error: Error killing ADB server, going to see if it's online anyway
> debug: Getting connected devices...
> debug: executing: "C:\Android\android-sdk\platform-tools\adb.exe" devices
> debug: Could not find devices, restarting adb server...
> warn: code=ENOENT, errno=ENOENT, syscall=spawn
> warn: code=ENOENT, errno=ENOENT, syscall=spawn
> debug: executing: "C:\Android\android-sdk\platform-tools\adb.exe" kill-server
> warn: code=ENOENT, errno=ENOENT, syscall=spawn
> error: Error killing ADB server, going to see if it's online anyway
> warn: code=ENOENT, errno=ENOENT, syscall=spawn
> info: <-- POST /wd/hub/session 500 20314.056 ms - 206
> debug: Getting connected devices...
> debug: executing: "C:\Android\android-sdk\platform-tools\adb.exe" devices
> debug: Cleaning up appium session
> error: Failed to start an Appium session, err was: Error: Could not find a connected Android device.
> debug: Error: Could not find a connected Android device.
> at ADB.getDevicesWithRetry (C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:600:15)
> at androidCommon.prepareActiveDevice (C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\lib\devices\android\android-common.js:349:12)
> at null.<anonymous> (C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\lib\devices\android\android-common.js:289:26)
> at C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\node_modules\async\lib\async.js:610:21
> at C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\node_modules\async\lib\async.js:249:17
> at iterate (C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\node_modules\async\lib\async.js:149:13)
> at C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\node_modules\async\lib\async.js:160:25
> at C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\node_modules\async\lib\async.js:251:21
> at C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\node_modules\async\lib\async.js:615:34
> at androidCommon.prepareEmulator (C:\Selenium\AppiumForWindows-1.2.0.1\Appium\node_modules\appium\lib\devices\android\android-common.js:339:5)
> debug: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not find a connected Android device.)","origValue":"Could not find a connected Android device."},"sessionId":null}
And here is my code:
if (runEnv.equals("Android"))
{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("device","Android");
capabilities.setCapability("deviceName","Android");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("browserName", "Browser");
capabilities.setCapability("platformVersion", "4.3");
try {
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
} catch (MalformedURLException e) {
e.printStackTrace();
}
driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
}
Please help!
Thanks,
Arpitha
| Try this code
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "4.4");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");
Change the Device_Name to "Android", this might work.
| 0.888889 | DesiredCapabilities capabilities = new Desired Capabilities() |
What might cause "junk after document element" error? | I have PHP errors redirected to log file. Only for WP installation so this definitely doesn't come from somewhere else. This is what started to come up recently (this is all of them, not cut):
[22-Sep-2010 14:30:41] junk after document element at line 2, column 0
[22-Sep-2010 16:17:08] junk after document element at line 2, column 0
[22-Sep-2010 17:19:42] junk after document element at line 2, column 0
[22-Sep-2010 18:30:19] junk after document element at line 2, column 0
[22-Sep-2010 20:19:23] junk after document element at line 2, column 0
[23-Sep-2010 14:51:40] junk after document element at line 2, column 0
[23-Sep-2010 15:54:33] junk after document element at line 2, column 0
[23-Sep-2010 17:23:02] junk after document element at line 2, column 0
This doesn't really look like PHP error (function blah-blah failed at line x), they are very infrequent and don't seem to be tied to page loads (maybe to some cron event?) and there hadn't been any major configuration changes in months other than keeping plugins up to date and one or two new ones (days before this started).
Googling results are mostly about XML parsing... Of which WP probably does plenty (feeds, updates, what else?..) but how to pinpoint what is going wrong?
This has me really puzzled.
| A quick Google search confirmed your suspicion ... this is likely an XML parsing error. Furthermore, some discussion on the forums suggests it's caused by script insertion after a closing </rss> tag.
If it is an inserted script, this is likely the result of a hack or an attack on your site or host.
Another possibility is a PHP error in the RSS-generation script. PHP would return the error in-line, and the error message, being non-XML, would be read as "junk" by the XML parser. This could also be the result of a feed your site is trying to read (i.e. on the admin dashboard), not necessarily a feed you're generating.
| 0.888889 | XML parsing error in RSS-generation script |
Silverlight: Returning value from synchronous method using Rx | I am writing a simple Silverlight application and WCF Service.
I want to create a synchronous method that return a value.
The method itself, call an asynchronous method from WCF Services. After I call asynchronous method, I want to get it value, and return to sender.
I hear that Rx can solve this kind of problem.
This is my code :
private void btnCreate_Click(object sender, RoutedEventArgs e)
{
string myResult = getMyBook(txtBookName.Text);
MessageBox.Show("Result\n" + myResult);
// myResult will be use for another purpose here..
}
// I want this method can be called anywhere, as long as the caller still in the same namespace.
public string getMyBook(string bookName)
{
Servo.ServoClient svc = new ServoClient();
string returnValue = "";
var o = Observable.FromEventPattern<GetBookCompletedEventArgs>(svc, "GetBookCompleted");
o.Subscribe(
b => returnValue = b.EventArgs.Result
);
svc.GetBookAsync(bookName);
return returnValue;
}
When I click btnCreate, myResult variable still empty. Is that something wrong with my code? Or maybe I am just don't understand with Rx concept? I am new to Rx.
My goal is : I need to get the result (myResult variable) from asynchronous method, and then used in later code.
| Remember that GetBookAsync returns immediately, and will return the value stored in returnvalue. When the data arrives returnvalue will be out of scope, and by then btnCreate will have finished.
U could use await on the GetBookAsync, so that it will wait for the data to arrive before continuing. Don't forget that would mean u also need the async on the method.
Not a great example or use of either RX or await, but trying is how we learn!
| 0.888889 | GetBookAsync returns immediately, and returns the value stored in returnvalue |
What should a DM do if a player wants to do something impossible? | If a player wants to do something a little out of the ordinary such as punching down a wall with his bare fists, what should I do? Do I make a DC for it? Do I make it so that no matter how much he rolls, he won't destroy the wall? Should I simply tell him that it won't work?
| For things that are physically impossible, don't bother with dice. As DM, dice are for when the group needs to determine whether something happens that's probable but neither impossible nor guaranteed. For impossible things, you're allowed to just say so:
Player: I fly to the moon!
DM: …You can't. You don't have wings, a ship, a Instant Moon Travel power, or anything like that.
Player: Can't I just roll against a really high DC?
DM: No.
Perfectly acceptable.
When there isn't a rule allowing something to happen, it's the DM's prerogative to judge whether something is possible, and how difficult it is. Things that are very easy like "I walk up the stairs" don't need rolls for you to say "OK" to — neither do impossible things need rolls for you to say "No" to.
Nota bene, for truly "out of the ordinary" but not impossible things there is Difficulty Class and Damage by Level (DMG, p. 42), which gives you a framework for assigning DCs to tasks that aren't otherwise covered by another rule in the game. Punching down a whole masonry wall with bare fists shouldn't ever need a DC (because it's just not happening), but punching a hole in a wall while accidentally turned into a golem might call for a high DC, and that's where to find it.
| 0.777778 | Difficulty Class and Damage by Level (DMG, p. 42) |
Nikon D3100 Won't Take Photo -- says light is too low | I've had my Nikon D3100 camera for about 3 years. I recently accidentally reset my shooting options.
Since I've done that, I'm having a hard time getting the camera to focus and take photos in lower light. I can hear it (and see it) hunting to focus, but the bottom right flashes the image suggesting I use the flash and it won't let me take a picture.
I've ensured that it's set to AF-C, but I'm still not able to force the photo to be taken. This happens with multiple lenses, including my prime which is fairly decent in low light. Often the exposure information on the screen shows me that I am close to perfect exposure (and sometimes just a bit underexposed).
What's going on? Is there something wrong with the camera? What other settings can I check?
Some other tidbits, I have it set to Manual, and I'm able to take the photos if I manually focus--but that doesn't work for me since my eyesight isn't great.
| What I try to do in these cases is to shoot in Manual and with manual focus using Live-view to assist. Of course you can always use the flash, that should help.
Have you got the AF light turned on? In alternative, you can use a torchlight or a smartphone flashlight to lit the scene and autofocus before taking the shot.
| 0.888889 | How do I get the AF light turned on? |
What are the disadvantages of "puncture proof" (or puncture resistant) tires? | Some people refer to tires that are more resistant to punctures as "puncture proof" tires.
For example: Specialized All Condition Armadillo Tyre
Even though these tires are not really puncture proof, they do reduce a lot the chances of puncturing. So the advantage is obvious.
Apparently, they're not too expensive compared to regular tires. So, I was wondering why people would choose not to use these more resistant tires. What are their disadvantages?
| The obvious advantage is puncture resistance
There are several disadvantages:
weight
rolling resistance
grip
ride
cost
There are several levels of puncture resistance and a Kevlar belt is not the only means.
Let me tell you a story. After two years on a tire with moderate puncture resistance got my first flat and had to walk it home. I got on-line and bought THE most puncture resistant tire I could find ignoring all other factors. It is twice as heavy as the old tire (and feels twice as heavy), noticeably more rolling resistance, less grip, terrible grip in wet, and a harsh ride. I don't like it. If I get zero flats in two years compared to one not worth it.
Even racing tires typically come with some puncture resistance. Some time trial tires have none.
Means of puncture resistance
Puncture resistant material such as Kevlar.
There are other materials such as Duraskin by Continental.
The material may be only on the tread strip or include sidewall.
Can even have a combination like a Gator Hard Shell.
Material in tread strip
Not material specifically designed for puncture resistance - more material.
Rubber or SmartGuard. Make the glass or thorn travel further.
An example is the Marathon Plus HS 440.
Harder rubber
Bounce glass and thorns off and also slow them down if they do penetrate
Pick your level of protection
Puncture resistant material in tread only
This adds puncture resistance at a very small performance impact.
Comes in all but very very cheap tires.
Most racing tires even have this.
Puncture resistant material(s) in tread and sidewall
Adds even more puncture resistance at still a very small performance impact.
At this level it is more just a cost thing.
A cheap tire is not going to have this extra material.
An expensive tire will have better puncture resistance, performance, and ride compared to a cheap tire.
More material (e.g. rubber)
Adds more puncture resistance but now you get into noticeable performance impacts.
Harder rubber
Harsher ride and less traction.
Pick a tire for a combination of performance, ride, puncture resistance, and price.
| 1 | Puncture resistant material in tread strip |
'Insufficient space on the device' | So, I'm having problem downloading apps from Play Store because apparently, I have insufficient space on device. The app I want to download is of only 12.68 MB and my system storage has 113 MB, phone storage has 596 MB, and SD card has 1.46 GB available.
I tried cache cleaning, uninstalling unwanted apps, moving the movable apps to SD card but it still won't work.
The device I'm using Micromax Bolt A089 with a 4 GB SD card.
Please help. Thank you.
| I think what you have to do is to delete the large apps then after installing the app reinstall the large app that you deleted because then it simply moves it to SD card sometimes by itself
| 0.888889 | delete large apps then reinstall the large app that you deleted |
House rules to make the cloister less of a game winning tile in Carcassonne? | In my experience, cloister tiles in Carcassonne are often "too lucky". If you draw a cloister tile in the beginning of the game, it will typically still require an investment of quite a bit of "meeple" time to obtain the full 9 points, which makes it a fair trade-off. However, after about half of the game, it's relatively likely that you can "parachute" a cloister tile in some spot and get 8 or 9 points immediately. This adds a lot of randomness to the game.
What house rules work well to diminish this effect?
| I don't have bad experiences with cloisters. But if they count too heavy, you can rule that an unfinished cloister counts as 0 points in the end. Which makes it harder to spend too much meeple on them.
Another possible rule is that cloisters must have unique 9 squares, not shared with another cloister.
But use them wise.
| 1 | if a cloister counts too heavy, it's harder to spend too much meeple on them |
yum hangs on installing a specific package | tried to install squid with command
yum install squid
and it consistently hangs on
Running Transaction
Installing: squid ##################### [1/1]
Had no problems with hundreds of other packages. Does anyone have an idea on what could be the problem?
edit: tried both: yum clean all + changing mirror, and rebuild rpm, doesn't help.
Thanks.
| I wonder if you have a corrupted package. I suggest running yum clean all and start again. You probably will get a different mirror and a fresh download.
| 0.777778 | Is there a corrupted package? |
When to use layoutSubview in iOS | I am writing iOS application for iPad that require custom layout.
The layout from portrait and landscape are totally difference, so it can't be solve by using UIAutoResizingMask.
I try to use the layoutSubview Method, but I detected that layout subview is called a lot (from UIScrollView).
How can i reduce the layoutSubview call to optimize the code , or I should call it by my self when ever the device is rotated.
Thank.
| You should not do expensive calculations in layoutSubviews:
| 0.666667 | LayoutSubviews: |
USB 3.0 to USB 3.0 | I have an external HD with USB 3.0 and a laptop with a USB 3.0 port. Can I connect the two safely to transfer data and watch films stored on the HD for instance? If so where can I buy such a cable to do so?
| Yep.
Pick your favorite online tech store (i.e. such as where you bought the hard drive from) and search for "USB 3.0 Data Cable."
USB 3.0 on the device end looks different than USB 2.0 devices. The end that plugs into the computer ought to be colored blue to specifically identify it as a USB 3.0 cable (the port you are plugging it into will be blue as well).
When you connect it, if it's a Windows PC, go to the Start Menu, then Computer, and your external HD should show up as another drive letter. You can then browse files and double-click them to play them. If you have problems playing them, download and install VLC Player.
| 1 | USB 3.0 on the device end looks different than USB 2.0 devices |
Can directed set be finite? | Can we have directed sets to be finite sets?
How do we define nets on such sets?
How do we define clustering and convergence of such nets?
| Note that in a directed set every finite subset has an upper bound. If the directed set itself is finite, then it must have a maximum (why?). Therefore the limit of such net is the element associated with the maximum index.
Convergence is trivial in that case.
| 1 | Maximum index in a directed set |
How is this site different from Stack Overflow? | I've decided to check this site out since it was tweeted by the great Jeff Atwood himself. The first question I saw was "Advice on making ruby code more ruby-like", which is the kind of question I see all the time on Stack Overflow.
So what is the difference between the questions on SO and the questions here? It seems to me there is enough overlap between the two that the difference is not clear, and I may not be alone in feeling this. So far this site seems redundant.
| I've just asked a Perl coding question here that I would be embarrassed to put on SO. Seems to be SO is good for 'how it works' questions, whereas CR is for 'how it codes / reads / looks'.
I'm delighted, by the way, that CR has come into existence. Thanks for taking the time!
| 0.888889 | CR is good for 'how it works' |
US income taxes for an Indian citizen with US-sourced income | I am an Indian citizen who left US after completing my masters in Aug 2010. Since then I have never re-entered the US and I stayed only in India. I was in the US only on a student visa and did not have a green card or anything alike.
However, I have been working as an independent contractor for a US software company since Jun 2010. I generate invoices for them and they make payments in my Bank of America account. From there I transfer it back to India.
I had filed an income tax return and paid required taxes in US for the year 2010 when I did stay in US till Aug. For years 2011 and 2012, I was under the impression that I am required neither to pay taxes nor to file a return in US. But I got a notice from IRS saying that I haven't filed any return for year 2011.
Am I still supposed to file return and pay taxes in US (whatever remains after foreign tax credit for what I pay in India) as my income originates in US?
I have been paying taxes and filing returns regularly in India.
| The fact that you got notice doesn't necessarily mean that you should have filed. What it means is that the IRS thought that you should file. They're expecting your tax return, and I suspect it is because you made a mistake.
There are several different mistakes that you could have made (the list below is not complete, just what came to my mind right now):
You filed 2010 return as a resident (form 1040) instead of non-resident (1040NR) that you should have. IRS expects you to continue filing as resident, or to notify them of termination of residency. But since you've been on a student (J/F) visa - you were not a resident to begin with.
You filed form W9 with your bank or your clients. Form W9 is for residents, so they report your income to the IRS as if you were a resident. Hence the IRS expectation of a tax return. What you should have filed with them was form W8-BEN or W8-ECI, to show your non-resident status.
You received interest on your BofA bank account and didn't report it to the IRS, while they did. This is a matching error. Even if you're not supposed to pay tax, you should file tax returns in these cases to avoid these notices. However, if that's the case, you should have also paid some tax (check the treaty).
Your client issued a W2 for you. If that happened - it could really mess you up in the US, so I hope its not the case.
I suggest you take it to a US-licensed tax preparer (EA or CPA) who can check what exactly that is that the IRS want from you, why, and how to resolve it.
| 1 | The fact that you got notice doesn't necessarily mean that you should have filed . |
PHP Fatal error: Call to undefined function plugin_basename | I'm receiving this error: [27-Jun-2012 18:22:39 UTC] PHP Fatal error: Call to undefined function plugin_basename() in /XXXX/public_html/wp-content/plugins/price-update/price-update.php on line 68:
//We set the plugin basename here, could manually set it, but this is for demonstration purposes
$this->plugin_basename = plugin_basename(__FILE__);
in this block of code:
class PriceUpdate extends mtekk_admin
{
protected $version = '0.0.1';
protected $full_name = 'Price Update';
protected $short_name = 'Price Update';
protected $access_level = 'manage_options';
protected $identifier = 'pr_upate';
protected $unique_prefix = 'prud';
protected $plugin_basename = 'price-update/price-update.php';
protected $opt = array();
/**
* __construct()
*
* Class default constructor
*/
function __construct()
{
//We set the plugin basename here, could manually set it, but this is for demonstration purposes
$this->plugin_basename = plugin_basename(__FILE__);
register_deactivation_hook(__FILE__, array($this, 'deactivate'));
add_action($this->unique_prefix . '_cron_hook', array($this,'cron_handle'));
//Register some of our custom taxonomies
add_action('init', array($this, 'wp_init'), 0);
add_action('wp_footer', array($this, 'footer'));
//We're going to make sure we load the parent's constructor
parent::__construct();
}
However, its defined above:
protected $plugin_basename = 'price-update/price-update.php';
any ideas?
| plugin_basename is a WordPress function that gets your plugins file name by simply passing it the directory.
When you call $this->plugin_basename PHP is looking for a function plugin_basename defined within YOUR class. No function plugin_basename() in your class == PHP Fatal Error.
If you simply want to define a variable that contains the plugins file name do this:
var $plugin_filename = plugin_basename( __FILE__);
| 0.777778 | PHP is looking for a function plugin_basename defined within YOUR class |
ASP.net Website want debug to == false on IIS | Have tried adding this to web.config
<compilation debug="false" targetFramework="4.0">
</compilation>
but website still executes code in #if DEBUG when it shouldn't
*Wierdly the inline statement <% #if DEBUG %> on aspx files works but require also for .cs code.
NB development and live website on same box
| Ensure the compile configuration to release as well. In Visual Studio, Build Menu > Configuration Manager and make sure "Release" is selected for all your assemblies, and/or is the active solution configuration.
| 0.666667 | Ensure the compile configuration to release as well |
Why is it not dangerous to dissolve NaCl? | $$\ce{H2O~(l) + NaCl~(s) ->[\Delta] Na+~(aq) + Cl^{-}~(aq)}$$
When table salt is placed in water, it dissolves due to the polarity of water molecules. When solvation takes place, negatively polar sides of water molecules attach to $\ce{Na+}$ ions, and positively polar sides of water molecules attach to $\ce{Cl-}$ ions. The ions are then carried away by water molecules through diffusion. Since the sodium is now isolated from the chlorine, what keeps it from violently exploding with water in the following chemical reaction?
$$\ce{2Na + 2H2O -> 2 NaOH + H2}$$
Also, since chlorine is poisonous, wouldn't that make drinking salted water extremely lethal?
| Sodium ion Na+ should not be confused with metallic sodium Na. They are actually two different chemical species (atoms vs ions), so it is expected that they chemically behave in a different way. The same applies to chlorine Cl and chloride ion Cl-.
Na can "switch" to Na+ when it is oxidated; this process of oxidation requires a first ionization energy: Na is supplied with energy in order to become Na+, so it is an endoergonic process; a strongly energetic one. When NaCl dissolves in water, the partially negative side of water molecule bonds weakly with Na+ (intermolecular bond, which has electrostatic character); in a qualitative view, forming a bond is an exoergonic process; since this type of bond is weak, the energy lost by Na+ isn't enough to bring Na+ back to Na.
Cl- has a lower energy than Cl has, so when Cl- forms a weak bond with the partially positive side of water molecule, its energy lowers and it's thermodinamically impossible for it to become Cl.
What you asked about poisoning power of Cl is a Biochemistry topic, but it's reasonable thinking that in a healty person's body at room conditions (e.g. not a scuba diver underwater) the total amount of Cl (Cl• radicals or Cl2 molecules) isn't large enough to cause health issues and it won't appreciably raise by drinking salted water. On the other hand, Cl- is part of our daily consumption of mineral salts.
| 1 | Sodium ion Na+ should not be confused with metallic sodium Na . |
Differences between PS3 and Wii version of Rock Band The Beatles | I'm considering buying Rock Band The Beatles for my only gaming console, the Nintendo Wii, but I was wondering if there are any big differences between the version on Wii and the version on Playstation 3?
| The only real difference is the graphics and maybe sound quality of the game. More so the graphics though but, not enough for it to bother me honestly.
| 1 | The only real difference is the graphics and maybe sound quality |
build email notification sytem that send emails on sql server triggers | I have a web project which is written in C# and uses SQL Server. I need to write an email notification system. I did some research and some people suggest to use CLR and some suggest to the business logic in C# code. I haven't done this system before and I want to know how other people do it.
What I have in my mind is to create a Queue table and and triggers for the tables I want to watch for changes. When the trigger is executed, it will insert an email request to the Queue table. Later, I will loop that queue table and send emails. I might be using Amazon web services to send emails in near future but not decided yet.
Do you think this is a good idea?
| It is a good idea, but wave you looked at what's already there, out-of the box? sp_send_dbmail does pretty much the same. It puts the mail request in a queue and uses an external application to do the SMTP stuff. I reckon that if you must use Amazon SNS then the built-in Database Mail will not work.
Do not listen to advice that recommends sending the email directly from trigger (eg. using SQLCLR). Beside the obvious performance hit (every DML operation on the table now has to wait for the huge latency of a SMTP or HTTP operation) you have the much bigger problem of transactional consistency, how do you recall the email on rollback? So yes, using an intermediate queue is mandatory. Also have a look at Using Tables as Queues.
| 0.777778 | How do you recall the email on rollback? |
How can an Imperator Titan house a city on its shoulders when it's only 100 meters tall? | I've often been confused at the size of Warhammer 40k titans. I've been reading one of the Horus Heresy books and it describes an Imperator class titan as having a small city on its shoulders with command stations, barracks, etc. At 100 meters tall, this is only 7 meters taller than the Statue of Liberty. I've been up the Statue of Liberty, and it definitely couldn't host a small city. I get that they're wider but still it seems that it's a bit of a stretch of imagination to suppose that it could host such a large structure.
| This is partially a style issue. This is a partially medium translation issue. How the Imperator Titans look in the games and how they look in the minds of artists are completely different. There are no cities on the tops of these Imperator Titans. There is often a command center where the battle can be seen and managed since they supposed to tower over the battlefield stylistically and figuratively.
This is the Imperator Class Titan figure. Most of the time there is nothing around it, so you don't know how big it is in proportion to anything else. Different sculptures emphasize different things. Some are more ornate than others and have better detail. These are some of the early designs.
The titan is often shown not alongside anything that gives it scale. The structure on the top of the shoulders of the central body has three (possibly four) guns mounted on the very top for ranged mortar fire. Some of the early paintings depicted them like this. Again, nothing really to scale it against so it can look so large…
Some artists when they cast the Imperator Titan, in the right light, with billowing smoke wafting up from the craters below, it can seem monstrously large. Just the way the God Emperor's avatar, the Imperium's most terrifying war machine should look.
But if you are from one of those Forge worlds and stylish lighting isn't going to cut it, you can compare the size of the Imperator and realize it isn't a small city of there, nor a castle, instead it is just four very large cannons mounted there. There is also a heavily shielded command center with room enough for a good deal of staff. Maybe a latte bar. A matter of style over substance.
Here how the figures compare to the field of battle at scale. The second image shows the Imperator against the other titans at scale. Look at the teeny-tiny space marine at his feet. Remember that guy is supposed to be this guy...
Now can you see why Imperators are supposed to be terrifying and people might be prone to exaggerate what they remember seeing? Shellshock, hysteria. This is the impression the Imperium wants to leave you with.
See Also: What makes titans so valuable in the Warhammer 40K universe?
| 0.666667 | What makes the Imperator Titans so valuable in the Warhammer 40K universe? |
Subsets and Splits