summary
stringlengths
15
147
text
stringlengths
1
19.3k
answer
stringlengths
32
22.6k
labels
float64
0.33
1
answer_summary
stringlengths
5
164
Folder compare tool?
I'm looking for a Windows GUI tool to compare the contents of two folders and show which files are different....
I check all recommended applications , and find out this one more useful. FreeFileSync That application have compare two folder you easily. If you use this commend in its filter "*" and use = button in under pages you just see each folders, that they are same in other location. enjoy it
1
FreeFileSync That application compare two folders easily
Is IP restriction enough or should I SSL my web authentication?
I want to connect to my home install of phpmyadmin. I restricted the connection for this to my 2 IPs. But I don't really understand this whole OSI layering. I do know that the IP is saved in the second layer, and I guess that the IP restriction will just look for this layer. Is it possible to read out the password from the 7th layer, even if I have an IP restriction?
Having an IP address based restriction will help to stop unauthorised users from connecting to the application, however it doesn't protect information in transit from the authorised PCs to the server. Say for example that one of the authorised systems uses a wireless network to access your server. without SSL it might be possible for an attacker to sniff your password as it goes over the network and use that to get unauthorised access to your server. So implementing SSL (and ensuring that you have a trusted certificate installed to help stop Man-In-The-Middle attacks) is a good additional security measure.
1
Having an IP address based restriction protects unauthorised users from connecting to the application
Migration Assistant fails on Ethernet Mavericks-to-Mavericks migration
I have the following setup and am attempting the use Migration Assistant over Ethernet: Source machine: Early 2009 24-inch iMac running OS X 10.9 Destination machine: Latest MacBook Pro Retina running OS X 10.9 Connection: direct Ethernet cable between machines When I use Migration assistant following Apple's documentation I pass through the confirmation code step on both machines, and then get as far as the "Checking Source Machine" screen on the destination, and am stuck there for about 10 minutes, at which point the destination machine jumps back to the language selection setup page, and the source machine says "This machine is attempting to reconnect to your other Mac". At this point I'm at a dead end: Attempting to proceed through the setup again on the destination gets me nowhere, and the only option on the source machine is "Cancel Transfer", which quits Migration Assistant there and ends the whole process. On the source machine I've turned off LittleSnitch, which I normally have running, turned off Apple's firewall, and enabled file sharing. What am I missing? Are there other settings somewhere that I need to check? I've also tried using FireWire to connect my machines, but have a different set of issues there.
I have the same setup except my iMac sports Thunderbolt. I had the same problem and never solved it, but I did find the following work-around helpful: Place the iMac in Target Mode by going to Apple|System Preferences|Startup Disk, make sure your startup disk is highlighted, select Target Disk Mode and confirm. Connect the computers by Firewire or Thunderbolt (TDM does not support Ethernet). Start Migration Assistant on the MacBook Pro, allow it to change your system, and select the iMac's startup disk. From there it is easy sailing - choose what you want and how to handle the user accounts and you are home and dry! Don't forget to eject all connected iMac drives before unplugging the cables.
0.888889
Connect the iMac by Firewire or Thunderbolt
Fedora manual installation and dependencies
Following answers on this website (like: How to use TeX Live on Fedora 17? and Manually installed TexLive on Fedora 16 ) I installed texlive manually on fedora and it works flawlessly. The problem I have is that tex is a requisite for other packages (such as R). Whenever I try to install (through yum) R i am required to install another tex from fedora. I don't want to do so because the package is old, it doesn't have tlmgr and I don't want to have two installed tex. Is there a way to make the OS notice I already have tex installed and the dependency is satisfied? Thanks!
I'm running also Fedora. What I have done was: Installation of a minimal tetex system using yum (so that the other dependencies are met) Installation of TexLive in /opt/texlive Configure PATH and ?TEX? variables to use /opt/texlive... (add the /opt/texlive/.../bin to be before /usr/bin, so that the Texlive executable are found first
1
Installation of a minimal tetex system using yum
Structure for nitrate ion?
Why is the above structure not considered a valid structure for the nitrate ion? Is it because adding a double bond reduces the formal charges present on the nitrogen? Does the above form exist anywhere?
Nitrate actually exists as a superposition of these three resonance forms: Essentially, a lone pair from an oxygen with a negative formal change forms a double bond to nitrogen. However, as nitrogen is a period II element, and hence must obey the octet rule, it can not have 5 bonds to other atoms. The already-present double bond then turns into a single bond and the pair of electrons moves onto the oxygen. This "movement" can happen with all three of the oxygen atoms and all three of the bonds. This is called "resonance". Due to resonance, the energy of the system is minimised making it more stable. Your Lewis structure is not far off. The "true" structure of nitrate is: Approximately, each oxygen atom contributes one third of a bond with the nitrogen, lowering the formal charge on each atom from what you have written, which does not exist in nature. The true structure is sort of an average of the properties of each possibility for where the electrons could be located, including the three resonance forms above, your structure, and any other configuration. However, these other forms are of minuscule probability to be formed (perhaps read up on wavefunctions and electron distributions if you're interested), and so the main contributors to the "real" structure are the three resonance forms. Note that none of these structures ever exist in isolation for more than the most infinitesimal of time periods.
0.666667
Nitrate exists as a superposition of these three resonance forms
Isn’t the FAQ label obsolete by now?
Don’t get me wrong in the beginning of reading this. I really mean the label and not the content of FAQ. The content is very useful if its’ made the right way (as here on ux.se), but there are plenty of examples where it isn’t. The real question concerns the label which is a convention I’d like to challenge. History In 1647 Matthew Hopkins wrote The Discovery of Witches which were introduced as "Certain Queries answered" and had the form of a list of Question and Answer, even if the topic is inappropriate by today’s standards. The label FAQ origins from the early 1980s mailing lists where NASA hoped to get new users read the old mail conversations, which were not the case. Instead the same questions were answered again and again and the need for FAQ was born. The acronym FAQ was invented by Eugene Miya and FAQ were later used in mail on a weekly basis at first and later on as a daily mail. Today FAQ is more frequently used to refer to the list, and a text consisting of questions and their answers is often called an FAQ regardless of whether the questions are actually frequently asked, if they are asked at all.[1] Problem Acronyms are generally bad, since it excludes those who do not know the meaning. They either have to search for the acronym, if they are interested, or just ignore it. If a label is ignored, there is not much use of it and an entire section of valid content is lost by bad labeling. However, it is a very strong web convention which might lead to confusion over time for experienced users. Also the original meaning have changed (see quote), which also implies that the label would be wrong. Question Isn’t the FAQ label obsolete by now? and if so How do we relabel it to suit both experienced and new users? Edit: I’d really like to know why we can or cannot change the label FAQ. Current answer does not meet that criterion. [1] http://en.wikipedia.org/wiki/FAQ
I think the problem is the reverse--the fact that FAQ lists are no longer actually lists of frequently asked questions. FAQs are still important, but all to often the FAQs are incredibly poorly written or just plain irrelevant. A new label won't fix that problem.
1
Problem is the reverse: FAQ lists are no longer lists of frequently asked questions
Vixion IRUX Tablet battery will not charge
I bought this tablet recently in Tenerife. Can find no information about the manufacturer. Now the battery will not charge through the mains adapter. It did charge at first. However, I have found it does charge through USB connection to my PC. When it charged previously a light at the connector would be red. When it was not charging it would be green. It is red while USB connected. Also it tells me now that it is charging, but if I remove the USB connection it stops charging. It has a screen showing battery condition in the form of a graph. I could see the graph of battery % decreasing gradually. A few days ago there was a sudden drop as if some App had used a lot of power. I decided to remove all Apps and did a factory reset. This made no difference regarding the failure to charge. I have tried shutting down completely (hold the off button for a while and it asks if I want to power off) This made no difference. Any advice please? Edit #1: Thanks ce4 for your response. The charger is stated to be 5v and when I check it with a voltmeter, it shows 5.2v. Also I have tried pushing the plug into the tablet to varying amounts and makes no difference. Another point maybe I didn't make clear is that when I connect with USB only, the light does not come on but the device tells me it is charging. But when I connect the power supply as well, the light comes on red as if indicating charging. But when I remove the USB leaving the power supply connected, the light goes back to green and is not charging from the power supply. Despite apparently charging on USB, the percentage of battery left charged has not yet increased from 10%. I understand that USB cannot deliver high current. It appears you are right - something wrong with the charger - maybe it is not the correct one for this model - I guess it needs to be able to deliver power at a higher current level?
From reading what you have already tried, this sounds pretty much like a hardware issue failure. You may have: a broken wall charger a broken power plug or torn connection on the device side Try replacing the charger or (in the latter case) pushing the plug a little (to see if it then reconnects temporarily).
0.888889
Install a broken wall charger or torn connection
Show an ad (revmob) on app exit
I'm still new at java programming (for Android), usually I find everything that I need to know on the internet, but not this time, even if the problem doesn't seems that much complicated. I would like to show an Ad (RevMob) when the user exits the application, an then kill the app. If I do this, it kills the app before showing the ad: public void onBackPressed() { super.onBackPressed(); RevMob revmob = RevMob.start(this); revmob.showFullscreen(this); android.os.Process.killProcess(android.os.Process.myPid()); } So it thought about waiting 10seconds before killing the app, but I don't know how to do it correctly. I tried a lot of things, like this: public void onBackPressed() { super.onBackPressed(); onBackPressedExit(); RevMob revmob = RevMob.start(this); revmob.showFullscreen(this); } private void onBackPressedExit() { try { Thread.sleep(10000); android.os.Process.killProcess(android.os.Process.myPid()); } catch(InterruptedException ie) { } } What should I do? Thanks
Try this, first you finish up showing whatever ad you want and finally call finish, this will close the application. This code willl take care of the back key exit scenario. @Override public void onBackPressed() { //Do your stuff finish(); return; }
0.888889
@Override public void onBackPressed()
Should a woman avoid singing in front of her husband while she is a niddah?
Should a woman avoid singing in front of her husband while she is a niddah? Is it strictly prohibited or just inadvisable? (Obviously I am not talking about deliberately seductive songs.)
Per Rabbi Shimon Eider's Sefer Hilchos Nidah one should "refrain from listening to his wife's singing when she is a Niddah."
1
Sefer Hilchos Nidah one should "refrain from listening to his wife's singing when she is a Ni
Why didn't the First and Second Hokage's fight with full power against the Third?
When revived by Orochimaru, the First and Second were sent to fight the Third, however, we know today that: The First beat one of the most powerful ninjas in history (me), could heal himself without activating any special jutsu, could summon a freaking chakra sucking tree dragon. Moreover! The Second had known (invented!!) Edo Tensei (meaning he could have broken free of Orochimaru's control), he also knew space-time ninjutsu. With those abilities, plus immortality, they couldn't have possibly lost against the Third at their full power. So in that case, why didn't they use their full power against the Third? Their emotions should have been completely erased, and made into a strict killing machine, and nothing more.
It's actually because the author (Kishimoto) did not plan out the entire story at that point. They used to describe the Third as the strongest Hokage, but this all changed when we got to Shippuuden. Don't bother trying to explain it within the Naruto universe - it's simply an inconsistency in the story, even if Kishimoto writes in some details to patch this error up later on. It's not a knock on the Naruto series though, as this show has been going on for over a decade.
1
Kishimoto did not plan out the entire Naruto series at that point
How to use part of a file name as a link within a word document
How do I have a link within a word document to certain text strings of the file name? For example, I am editing a word document where the file name is: 'File 075 - Test result 101.doc', and would like to only use the strings 'File 075' rather than the full file name in the word document as a automatic link / field that updates itself when the file name changes. How would you proceed with it?
I think you are talking about a field and not a link as in hyperlink. A hyperlink can have its display text different from its url. A field cannot change its display text though.
0.777778
A field cannot change display text as in hyperlink
Standards/recommendations for Drush make files included in contrib modules
What are the standards/recommendations for Drush make files that are included in contrib modules? Specifically, should these make files be included by default (module_name.make) or not (module_name.make.example)? If they should be included, what is the recommended/supported method of overriding/ignoring them? Is there any documentation to point module maintainers to when discussing this in their issue queues? EDIT: Found this post by jhedstrom from June 2012 recommending naming make files with '.example' suffix. Is this still the recommendation, or have things changed since then? https://drupal.org/comment/6160018#comment-6160018
@jhedstrom recomendation is valid. Modules should not include a module_name.make file, to prevent drush make running them on recursion. Adding module_name.make.example is desired, and is helpful to build makefiles, specially when the module has several dependencies, including libraries. OTOH profiles do include makefiles. It is a common practice for a different use case, where discovery and recursion is desired.
1
@jhedstrom recomendation is valid
Combining two fields in SELECT statement
In my table I have a field "firstname" and a field "lastname". I would like to select all records where firstname + space + lastname is a certain value. I've tried this: $sql = "SELECT * FROM sam_users WHERE (user_firstname + ' ' + user_lastname LIKE ?)"; But this isn't working. With Google I've found something about using ||, but I don't really understand how I should use that operator. Note that I don't want to use an or-operator (what || is in many languages), but something to concatenate 2 fields (with a space between them) and using a LIKE on that. Thanks!
SELECT * FROM sam_users WHERE TRIM(Concat(user_firstname, ' ', user_lastname)) LIKE ?;
0.777778
SELECT * FROM sam_users
What is the best tool for working with oracle db?
What is the best data management application for working with oracle db?
Oracle SQL Developer There is no debian installation file for it though so start here and accept the license. Installation Ensure you have a JDK installed, if not, you can download one here. Download the zip file. Unzip sqldeveloper.zip cd sqldeveloper/ sh sqldeveloper
1
Oracle SQL Developer There is no debian installation file for it though
How to use ARM software in Raspberry?
I would like to run Maestro Control Center software (for Mini Maestro 24-Channel USB Servo Controller) in Raspberry. But it is not ARM software. It is availabe for Linux and Windows. I'm total newbie so i have no skills to do it, but i desperately need to do this and surely there is others who would like to do this too. Maestro Control Center Thanks
Short answer: Without the source code, you can't (unless you convince the developers to support the ARM architecture). Long answer: Think of the apps on a phone. If there wasn't a similar application for your computer, you could not run the phone application on your computer natively. This is also the same reason Raspberry Pi users can't run Ubuntu. So how can you get the software you want on the Raspberry Pi? To start, you need the source code. Unfortunately for you, it does not look like it is publicly available. If you were able to get your hands on the source code, you would have to build it; depending on the size of the source code base, you might need a build farm for that.
0.666667
How to get the software you want on the Raspberry Pi?
strtotime calculates wrong when moving over to linux (webhost) from windows (localhost)
I've some problem with make a simple PHP function to work on my webspace meanwhile it works like expected at my localhost server. The problem is the following calculation: echo $Formated = date("Ymd",strtotime("last day of next month")); This script dosen't seem to work b/c i simply gets the default date 19691231 instead of the correct one 20110630 when running it on my server. I use windows (XAMP) as my localhost server so i guess there must be some form of problem that lies within the two platforms way of handling it?
Forget Migration and Deployment, in fact strtime is not reliable. Navigate PHP's official site: Check the strtotime manual, especially this comment. If you have a MySQL connection available, SELECT DATE_ADD( '2011-05-31', INTERVAL 1 MONTH ) would be less redundant since the (correct) functionality is already implemented without you having to implement it yourself.
0.777778
Forget Migration and Deployment
Ideas for patenting/selling a trading strategy
I think that I have stumbled upon a good idea for stock trading. In all my simulations, the results were great. It's a method based on technical analysis and momentum. How do I go about selling or patenting my idea OR should I just write a blog about it and let the whole world know?
If you have a great technical trading system that gets you winning trading 80-85% of the time in backtesting, the question should be why are you not trading it? To get a better idea of how good your trading system is you should work out your expectancy per trade. This will tell you how much you should make on average for every trade you take. Expectancy not only considers your win rate but also you win size to loss size ratio. For example if you are getting winning trades 80% of the time but your average win size is $100, and your 20% of losses average $500, then you will still be losing money. You should be aiming for an average win size of at least 2.5 to 3 times you average loss size. This will provide you a profitable trading system even if your win rate is 50%. If your trading system is really that good and provides a win size of at least 2.5 times your loss size then you should be actively trading it. Also, if you put your trading system out there in the public domain together with your trading results you will actually find that, quite opposite to what the consensus above is, your results from your trading plan should actually improve further. The more people acting on the outcome of a signal in the same direction the higher the probability that the movement in the desired direction will actually occur. If you are looking to make money from your trading ideas, no one will pay anything unless you have real results to back it up. So if you are so confident about your system you should start trading it with real money. Of course you should start off small and build it up over time as your results eventuate as per your simulations.
1
Why are you not trading your system with real money?
how to identify IC codes?
I want to buy a LM4558N ,which is unavailable in the local store. I found similar ones online but not sure if they are the same ones i need. 1)Manufacturer: TEXAS INSTRUMENTS Man. Part No.: RC4558P 2)Part No: MC4558CN FOC Code: 1467662 Manufacturer: STMICROELECTRONICS 3)Manufacturer: TEXAS INSTRUMENTS Man. Part No.: RC4558IP Are this the same ones with different names or completely different?
I don't know if this qualifies as an answer, but to be sure you will have to take a look at the manufacturer data-sheet. There should be a section named similar "Marking information" or "Part labeling" or "Package marking". Example:
1
Manufacturer datasheets
How can I organise photos on a network storage device, and what software can help me?
I have a recently bought a NAS and am in the process of transferring my photo collection onto it. I probably have over 300GB of pictures (many in various RAW formats). At the moment these are just organized in “old fashioned” file structures but I have am hoping to improve this to a some sort of cross referenced tagging system. So far though I am running into a few problems and any help would be appreciated. I have tried using the following software: Windows photo gallery - and this appears to rapidly retrieve photos from the NAS based on chose tag words. The main down side that I have found so far is that the windows camera codec does not yet support my S95 RAW files and so they are not visible. Picasa – this looks as though it might work well on a local drive (and certainly get good reviews) but I am finding it very slow when scanning the photo library on the NAS (even when left for a number of hours the scan in only approx. 5% complete!). I can live with a bit of a delay when using the NAS but this is unworkable - am I getting something wrong? Various other photo viewers - Although they allow me to see my RAW files do not appear to support tagging and the development of a cross referenced library. I am also considering looking at getting Lightroom but don’t want to shell out the money only to find it is as slow as Picasa. Finally, my ideal would be to have different layers of tags so for example I could tag all my pictures from the “Lake District” but then also have the option of sub dividing within this category based on the valley etc. Without different levels of tagging I risk winding up with an unwieldy list of tag words. I do not know if this is possible/normal but if anyone has any points about what software packages support this arrangement that would also be appreciated.
Lightroom is the way to go. Download the trial and give it a try, though I do recommend reading a bit or watching a few videos first to get the most out of your trial. Lightroom will let you do whatever you wish on the file system side, and then offer flexibility beyond it. This is important, because this NAS won't be your last, and in fact, you may have more than one eventually. Lightroom does not care where your images are, and even functions with them offline (though not as well). By arranging things on your harddrive, you are providing information about your images that will be lost when your images are separated from your hardrive, such as posting onto Flickr. The info is useful to you...I do understand that. However, the fact that the image came from "2010/Christmas2010" will not transfer to your Flickr upload, so it is important that you leverage something else, in particular keywords and tags that can be embedded into the image. You can arrange your photos however you wish on the hard drive (date, event, or one big directory if you wish) and then in Lightroom create collections, tags, keywords and even what are called 'smart collections' that dynamically add images. You can tag images with keywords that will write to EXIF/IPTC, and use Lightroom's filters and search to show you related images. However it can be a bit of a pain to constantly search and filter, so Lightroom offers Collections, which are 'virtual directories' that contain images you have assigned to them. Of course, these have no relation to the actual directories on your hard drive, which is nice...you no longer have to worry about this aspect of organizing. And finally, there are Smart Collections, or virtual directories that are dynamic and automatic, so for example, you can create a Smart Collection based on certain keywords. Every new image with that keyword will be automatically added to the Smart Collection. I find it helpful to have my images in directories related to year, then by day that I took the image: (2010/2010-12-25), because I recall when I took photos. Lightroom does this for me with its import utility. I simply tell Lightroom how I want to import, and it does automatically every time. Then, I tag images with keywords, typically related to events or subjects. If I have a particular event or project, I will create a collection to make it easy to return to (vs searching or filtering the view). For some items I create smart collections that are dynamic, such as images of family members. When I upload to Smugmug, all the tags and keywords stay with the image, and they are easy to find on Smugmug as well. Give Lightroom a try.
1
Lightroom does not care where your images are, and even functions with them offline .
How do I find wiper refills for my 2008 Nissan Frontier?
I never had any trouble finding wiper blade refills for my 1998 Honda Accord or 2000 Toyota Echo. They were inexpensive because all you bought was the rubber part of the blade. The steel strips to reinforce them were retained from the original wipers. When my 2008 Nissan Frontier passenger wiper blade edge separated from the rest of the wiper I started looking for a replacement. Refills I found claiming to be for my Frontier were usually refills for an after-market replacement arm assembly and did not fit my stock wipers. I did finally find a Trico refill for my passenger side (18-240, narrow profile) but their recommended driver's side refill (24-240) is the same profile but needs to be wider (9mm vs 7mm??) Local auto parts stores all say they stopped carrying OEM refills. I could get a new wiper arm but years ago when I did that I regretted the poor quality of the replacement and the way it never quite fit the window as well.
I ran into the same problem recently. It does appear that all the autoparts places have stopped carrying inserts. They'd rather sell you a $10-20 blade than a $1-2 insert it seems. :-) The good news is that my car dealer DOES still carry inserts, and they're only $1.20 a piece... Try your dealer, could end up saving you a good deal of money down the road!
1
Autoparts places have stopped carrying inserts
Is there a "covariant derivative" for conformal transformation?
A primary field is defined by its behavior under a conformal transformation $x\rightarrow x'(x)$: $$\phi(x)\rightarrow\phi'(x')=\left|\frac{\partial x'}{\partial x}\right|^{-h}\phi(x)$$ It's fairly easy to see that the gradient of the field doesn't have this nice property under the same transformation, it gets a non homogeneous term. Still, is it possible to construct a derivative that would behave nicely under conformal mappings and give the usual derivative for Lorentz transformations? By adding a "connection" similarly as what is done in general relativity or gauge theories. And if not, why?
I) Here we discuss the problem of defining a connection on a conformal manifold $M$. We start with a conformal class $[g_{\mu\nu}]$ of globally$^{1}$ defined metrics $$\tag{1} g^{\prime}_{\mu\nu}~=~\Omega^2 g_{\mu\nu}$$ given by Weyl transformations/rescalings. Under mild assumption about the manifold $M$ (para-compactness), we may assume that there exists a conformal class $[A_{\mu}]$ of globally defined co-vectors/one-forms connected via Weyl transformations as $$\tag{2} A^{\prime}_{\mu}~=~A_{\mu} + \partial_{\mu}\ln(\Omega^2). $$ In particular it is implicitly understood that a Weyl transformation [of a pair $(g_{\mu\nu},A_{\mu})$ of representatives] act in tandem/is synchronized with the same globally defined function $\Omega$ in eqs. (1) and (2) simultaneously. II) Besides Weyl transformations, we can act (in the active picture) with diffeomorphisms. Locally, in the passive picture, the pair $(g_{\mu\nu},A_{\mu})$ transforms as covariant tensors $$ \tag{3} g_{\mu\nu}~=~ \frac{\partial x^{\prime \rho}}{\partial x^{\mu}} g^{\prime}_{\rho\sigma}\frac{\partial x^{\prime \sigma}}{\partial x^{\nu}}, $$ $$ \tag{4} A_{\mu}~=~ \frac{\partial x^{\prime \nu}}{\partial x^{\mu}} A^{\prime}_{\nu}. $$ under general coordinate transformations $$ \tag{5} x^{\mu} ~\longrightarrow~ x^{\prime \nu}~= ~f^{\nu}(x). $$ III) We next introduce the unique torsionfree tangent-space Weyl connection $\nabla$ with corresponding Christoffel symbols $\Gamma^{\lambda}_{\mu\nu}$ that covariantly preserves the metric in the following sense: $$ \tag{6} (\nabla_{\lambda}-A_{\lambda})g_{\mu\nu}~=~0. $$ The Weyl connection $\nabla$ and its Christoffel symbols $\Gamma^{\lambda}_{\mu\nu}$ are independent of the pair $(g_{\mu\nu},A_{\mu})$ of representatives within the conformal class $[(g_{\mu\nu},A_{\mu})]$. (But the construction depends of course on the conformal class $[(g_{\mu\nu},A_{\mu})]$.) In other words, the Weyl Christoffel symbols are invariant under Weyl transformations $$ \tag{7} \Gamma^{\prime\lambda}_{\mu\nu}~=~\Gamma^{\lambda}_{\mu\nu}.$$ The lowered Weyl Christoffel symbols are uniquely given by $$ \Gamma_{\lambda,\mu\nu}~=~g_{\lambda\rho} \Gamma^{\rho}_{\mu\nu} $$ $$ ~=~\frac{1}{2}\left((\partial_{\mu}-A_{\mu})g_{\nu\lambda} +(\partial_{\nu}-A_{\nu})g_{\mu\lambda}-(\partial_{\lambda}-A_{\lambda})g_{\mu\nu} \right) $$ $$\tag{8} ~=~\Gamma^{(g)}_{\lambda,\mu\nu}+\frac{1}{2}\left(A_{\mu}g_{\nu\lambda}-A_{\nu}g_{\mu\lambda}+A_{\lambda}g_{\mu\nu} \right), $$ where $\Gamma^{(g)}_{\lambda,\mu\nu}$ denote the lowered Levi-Civita Christoffel symbols for the representative $g_{\mu\nu}$. The lowered Weyl Christoffel symbols $\Gamma_{\lambda,\mu\nu}$ scale under Weyl transformations as $$ \tag{9} \Gamma^{\prime}_{\lambda,\mu\nu}~=~\Omega^2\Gamma_{\lambda,\mu\nu}.$$ The corresponding determinant bundle has a Weyl connection given by $$ \tag{10} \Gamma_{\lambda}~=~\Gamma^{\mu}_{\lambda\mu}~=~(\partial_{\lambda}-A_{\lambda})\ln \sqrt{\det(g_{\mu\nu})}.$$ IV) Let us next define a conformal class $[\rho]$ of a density $\rho$ of weights $(w,h)$, who scales under Weyl transformations as $$ \tag{11} \rho^{\prime}~=~ \Omega^w\rho $$ with Weyl weight $w$, and as a density $$\tag{12} \rho^{\prime}~=~\frac{\rho}{J^h}$$ of weight $h$ under general coordinate transformations (5). Here $$\tag{13} J ~:=~\det(\frac{\partial x^{\prime \nu}}{\partial x^{\mu}}) $$ is the Jacobian. Example: The determinant $\det(g_{\mu\nu})$ is a density with $h=2$ and $w=2d$, where $d$ is the dimension of the manifold $M$. V) The concept of (conformal classes of) densities $\rho$ of weights $(w,h)$ can be generalized to (conformal classes of) tensor densities $T^{\mu_1\ldots\mu_m}_{\nu_1\ldots\nu_n}$ of weights $(w,h)$ in a straightforward manner. For instance, a vector density of weights $(w,h)$ transforms as $$ \tag{14} \xi^{\prime \mu}~=~ \frac{1}{J^h}\frac{\partial x^{\prime \mu}}{\partial x^{\nu}} \xi^{\nu} $$ under general coordinate transformations (5), and scales as $$ \tag{15} \xi^{\prime \mu}~=~\Omega^w \xi^{\mu} $$ under Weyl transformations. Similarly, a co-vector density of weights $(w,h)$ transforms as $$ \tag{16} \eta^{\prime}_{\mu}~=~ \frac{1}{J^h}\frac{\partial x^{\nu}}{\partial x^{\prime \mu}} \eta_{\nu} $$ under general coordinate transformations (5), and scales as $$ \tag{17} \eta^{\prime}_{\mu}~=~\Omega^w \eta_{\mu} $$ under Weyl transformations. And so forth for arbitrary tensor densities $T^{\mu_1\ldots\mu_m}_{\nu_1\ldots\nu_n}$. Example: The metric $g_{\mu\nu}$ is a tensor density with $h=0$ and $w=2$. The one-form $A_{\mu}$ is not a tensor density, cf. eq. (2). VI) Finally, one can discuss the definition of covariantly conserved (conformal classes of) tensor densities $T^{\mu_1\ldots\mu_m}_{\nu_1\ldots\nu_n}$. A density $\rho$ of weights $(w,h)$ is covariantly conserved if $$\tag{18} (\nabla_{\lambda}-\frac{w}{2}A_{\lambda})\rho~\equiv~ (\partial_{\lambda}-h \Gamma_{\lambda}-\frac{w}{2}A_{\lambda})\rho~=~0. $$ A vector density of weights $(w,h)$ is covariantly conserved if $$\tag{19} (\nabla_{\lambda}-\frac{w}{2}A_{\lambda})\xi^{\mu}~\equiv~ (\partial_{\lambda}-h \Gamma_{\lambda}-\frac{w}{2}A_{\lambda})\xi^{\mu}+\Gamma_{\lambda\nu}^{\mu}\xi^{\nu} ~=~0. $$ A co-vector density of weights $(w,h)$ is covariantly conserved if $$\tag{20}(\nabla_{\lambda}-\frac{w}{2}A_{\lambda})\eta_{\mu}~\equiv~ (\partial_{\lambda}-h \Gamma_{\lambda}-\frac{w}{2}A_{\lambda})\eta_{\mu}-\Gamma_{\lambda\mu}^{\nu}\eta_{\nu} ~=~0. $$ In particular, if $T^{\mu_1\ldots\mu_m}_{\nu_1\ldots\nu_n}$ is a tensor density of weights $(w,h)$, then the covariant derivative $(\nabla_{\lambda}-\frac{w}{2}A_{\lambda})T^{\mu_1\ldots\mu_m}_{\nu_1\ldots\nu_n}$ is also a tensor density of weights $(w,h)$. -- $^{1}$ We ignore for simplicity the concept of locally defined conformal classes.
0.666667
defining a conformal class $M$
How do you include a user's default image in a Drupal 7 view that lists people?
I have a view in Drupal 7 that lists people (users). It shows the username and the standard user picture field. If a user has a set image, it comes through perfectly. However, for users that didn't set a profile image no image is shown, even though I have a default profile image set in the people settings for the site. How do I get views to use the default profile picture for people that do not have a profile image set? Update: I wasn't clear. I know how to use the default image in the no results behavior. The issue is that I can't get the default image to use the imagestyle I use for the other images.
Grab the path on the default image setting. Head over to your view and click on your image field. Look for "no results behavior". In the text area add Verify that your view does not have hide if empty checked. Save your view.
1
Save the path on the default image setting
Local user accounts have disappeared after installing Active Directory and running dcpromo
I'm kinda newbie in this Windows 2008 Server R2 configuration stuff, so I would appreciate any help regards the issue I'm facing. After a Windows 2008 Server R2 clean install I created a couple of local user accounts and joined them to the administrators group, I tested them and I was able to log on with each one. Then I installed Active Diectory role (DNS role implied) and runned DCPromo. The domain was created and promoted succesfully and I was able to log on into the domain from a client machine. The issue began when I realized that I was no longer able to log on locally into the server (meaning LOCALMACHINE\localusername). I looked into domain user accounts and noticed that the local user accounts I created previously were now part of the domain. I consider a bad thing not being able to log on locally anymore, so in a shot to fix it I stopped the Active Directory service... my bad! Now I'm sort of locked up, I can't log either locally or as part of the domain. Can someone please shed some light in this? What did I miss in the process? I tried googling but could find any straight forward solution or explanation. What concept I'm not catching?How can I promote a server to PDC and still be able to log on locally? Thanks in advanced.
Once a member server is promoted to a domain controller it will no longer have local accounts. When you demote the domain controller it will ask you to set a new local administrator password. However I am not sure how you would restart the active directory service if you disabled it entirely. Here is a link for reference about local accounts not being available on a domain controller. EDIT: like Ben said directory restore mode is your best bet with this.
0.888889
When a member server is promoted to a domain controller it will no longer have local accounts
Using regular expressions to find img tags without an alt attribute
I am going through a large website (1600+ pages) to make it pass Priority 1 W3C WAI. As a result, things like image tags need to have alt attributes. What would be the regular expression for finding img tags without alt attributes? If possible, with a wee explanation so I can use to find other issues. I am in an office with Visual Web Developer 2008. The Edit >> Find dialogue can use regular expressions.
Here is what I just tried in my own environment with a massive enterprise code base with some good success (found no false positives but definitely found valid cases): <img(?![^>]*\balt=)[^>]*?> What's going on in this search: find the opening of the tag look for the absence of zero or more characters that are not the closing bracket while also … Checking for the absence of of a word that begins with "alt" ("\b" is there for making sure we don't get a mid-word name match on something like a class value) and is followed by "=", then … look for zero or more characters that are not the closing bracket find the closing bracket So this will match: <img src="foo.jpg" class="baltic" /> But it won't match either of these: <img src="foo.jpg" class="baltic" alt="" /> <img src="foo.jpg" alt="I have a value.">
0.888889
What's going on in this search: find the opening of the tag look for zero or more characters that are not the closing bracket
Laptop Battery does not show true charging level
My laptop has a 6 cell Lithium Ion Battery. Even when the battery is fully charged it shows the battery charge status at 0%. As a result if there is a power loss (when I want to move the laptop from one place to another) it immediately goes into hibernation. However, when I restart the laptop WITHOUT plugging in the power, it starts and the battery meter shows some figure like 95-96% remaining. The battery then runs for almost an hour and a half. The laptop is around 2 years old. How can I rectify this issue?
Easiest way is to buy a new battery - Sorry, but batteries are unreliable, especially if they are over 2 years old. You can also try a free program called Battery Care. The fact is, you can recalibrate laptop batteries if it supports such a feature (Cheak in BIOS, or power software), but it sometimes does not work. Doing what you do of having a full battery and allowing it to run down completely usually does the trick.
1
How to recalibrate a laptop battery?
WYSIWYG TinyMCE Editor Integration
I have integrated WYSIWYG Editor using this tutorial. I can see it in my custom module, but when I try to insert variable it gives me following error in console Error: ReferenceError: widgetTools is not defined Source File: http://mywebsite.com/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js Line: 44 There is also another error when I try to insert widget, Error: ReferenceError: widgetTools is not defined Source File: http://mywebsite.com/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js Line: 44 Could anyone pls guide me on how to integrate WYSIWYG editor in backend custom module as well as frontend without having console errors. Also how to add necessary WYSIWYG (TinyMCE) JS files to insert widgets, variables, images and other media types ? Thanks.
You will need to include the wysiwyg javascript files. I think the lines of code you need are. <script type="text/javascript" src="<?php echo $this->getJsUrl() ?>tiny_mce/tiny_mce.js"></script> And <action method="addItem"><type>js</type><name>mage/adminhtml/wysiwyg/tiny_mce/setup.js</name><params/><if/><condition>can_load_tiny_mce</condition></action> These should be set by default on normal adminhtml pages as long as you turn on the editor. To do this you can add the following to your block class in the _prepareLayout function. $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
0.777778
wysiwyg javascript files
Error: "Sub-process /usr/bin/dpkg returned an error code (1)”
for example when I "sudo apt-get install libmemcache0", I got: Reading package lists... Done Building dependency tree Reading state information... Done libmemcache0 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 2 not fully installed or removed. After this operation, 0B of additional disk space will be used. perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "zh_CN.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Setting up linux-image-2.6.24-16-xen (2.6.24-16.30) ... perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "zh_CN.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). Running depmod. update-initramfs: Generating /boot/initrd.img-2.6.24-16-xen Could not find postinst hook script [update-grub]. Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin' dpkg: error processing linux-image-2.6.24-16-xen (--configure): subprocess post-installation script returned error exit status 2 Setting up linux-image-2.6.24-24-386 (2.6.24-24.61) ... perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "zh_CN.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). Running depmod. update-initramfs: Generating /boot/initrd.img-2.6.24-24-386 Could not find postinst hook script [update-grub]. Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin' dpkg: error processing linux-image-2.6.24-24-386 (--configure): subprocess post-installation script returned error exit status 2 Errors were encountered while processing: linux-image-2.6.24-16-xen linux-image-2.6.24-24-386 E: Sub-process /usr/bin/dpkg returned an error code (1) What can I do?
As you are running in a VM you don't want ubuntu to try to re-install grub after changing any kernel related stuff, as you don't have a boot loader of your own. Edit /etc/kernel-img.conf And comment out the lines: postinst_hook = update-grub postrm_hook = update-grub You'll probably need an sudo apt-get -f install afterwards
0.888889
ubuntu trying to re-install grub after changing kernel related stuff
Is this backscatter?
I noticed a mail is hanging in the mailq, so my question is if that is backscatter. The mail in question: Jul 1 10:38:48 a1a postfix/qmgr[30971]: F2C95230470: from=<[email protected]>,size=125817, nrcpt=1 (queue active) Jul 1 10:38:53 a1a amavis[24301]: (24301-10) Blocked BANNED (.exe,.exe-ms,dokument 0503279005.xml.exe), ORIGINATING LOCAL [197.254.27.150] [219.69.130.6] <[email protected]> -> <[email protected]>, quarantine: t/banned-tdxHoTNjn7FG, Message-ID: <[email protected]>, mail_id: tdxHoTNjn7FG, Hits: -, size: 125817, 4642 ms Now postfix is trying to connect to ebok.upc.pl and the connection gets refused. Jul 1 10:47:14 a1a postfix/smtp[23733]: connect to ebok.upc.pl[81.18.192.65]:25: Connection refused Jul 1 10:47:14 a1a postfix/smtp[23733]: 4D1BA2304EF: to=<[email protected]>, relay=none, delay=501, delays=501/0.02/0.03/0, dsn=4.4.1, status=deferred (connect to ebok.upc.pl[81.18.192.65]:25: Connection refused) and it keeps trying to connect.
Yes, that is a backscatter. Your antivirus caught the virus (or a simple ban on exe's), so it sends a bounce saying the email was rejected since it contained a virus (a typical response from an innocent mailserver). The bounce fails as you see, and Postfix will keep trying to deliver it until it times out.
1
Backscatter: exe's sent a bounce
Is Mac OS X in a VirtualBox VM suitable for iOS development?
I have finally successfully managed to install Mac OS X in a virtual machine on my Windows 7 laptop using VirtualBox and a tutorial from Lifehacker. Performance is very slow, with Mountain Lion reporting that it is seeing just 4MB video memory (I didn't manage to load the Intel HD3000 driver). Youtube is essentially unplayable, with even the audio potion stuttering. That said, the interface and general UI is pretty acceptable. Even with such slow performance, does it make sense to download and develop with Xcode? I am allocating 3GB of RAM. What would performance be like under those conditions?
If this is a hobby and you are not planning on releasing any apps to the app store, and you can tolerate the slow performance and don't care about running on real devices, then don't worry about it. However, if you are creating a business the it is essential to run on real hardware. Any low end Mac (MacBook Air 11", is my current favorite) will blow away any virtual machine. I have a fairly simple app that runs fine on my iPad and iPod Touch, but has all sorts of graphic anomalies in the simulator.
1
Macbook Air 11 is my current favorite.
Why does my bike make a noise when I pedal hard?
When I pedal forcing a little with my right leg, the bike makes a noise that I don't know how to describe. I'll try to do it. It's like: a short "ting" a tiny bell if a small rock hits the down tube I don't know what is causing this noise, but I think that it could be any of this things: pedal crank arm/pedal connection crankset I think the material of all these things is alluminium. I don't feel anything (like a bad shifted chain) when I hear the noise. It happens when there is movement and when there is NO movement (I use the brake, so the bike doesn'e move, stand using all weight on right pedal, and it makes the noise) The pedals could be in any position, It is not in a particular position. Just pressing the right pedal. Has someone else has this "problem"? Any ideas of where this comes from? Update: Yesterday I took out the chain and stood on the right pedal, and made the noise. Then is not the chain, nor the transmission system. I put oil in the pedal axis, but had no luck. Also tried to loose the pedal, but the juncture point is too tight, and I couldn't. Today I will try to use oil in the bottom bracket. Update: here is a link to info on the bike http://www.diamondback.com/2012-sorrento maybe it helps to know the model of all the components.
check everything that has human contact because there is a force exerted on all thes eparts when stomping on pedals pedals, cranks, BB, chain, cassette, spokes the seat post and seat rails bars and the stem connection Also check the frame for cracks, especially if it is a full suspension bike. when stomping on the pedal you may be exercising a small crack in the frame that is pinging -- check all the welds first - particularly round the BB area. It might be worth saying which bike frame it is and see whether it has a history of cracks.
1
When stomping on pedals, check all the welds first
How do I count the number of different child id's belonging to a parent record?
For instance I have two tables in a music database. Table album and table track. Each track record has (amongst other things), an album_id and an artist_id Each album record has a unique album_id In order to spot which albums are by 'various artists' I want to count the number of distinct artist_id's which belong to each album. Such that two or more track records with the same album_id but with differing artist_id's should signal that I can flag the album as 'various artists' I can do it with multiple queries but I'm seeking the elegant all in one query.
There are various ways to solve this problem, but with a composite index on (album_id, artist_id) most DBMS will manage to use only this index (a full index scan) with the following query and thus be quite efficient: SELECT album_id FROM track GROUP BY album_id HAVING MIN(artist_id) < MAX(artist_id) ; If you also want the number of artists per album, you can add COUNT(DISTINCT artist_id) in the select list. A less obfuscated alternative condition is to use (which could be less efficient than the above MIN < MAX method): HAVING COUNT(DISTINCT artist_id) > 1 ;
1
SELECT album_id FROM track GROUP BY album_Id HAVING MIN <
What is the best place to start Warhammer 40k?
I've got three omnibus books containing 9 total Warhammer 40,000 stories. Before I mention which ones I've got, which book would you recommend as a good place to start the series?
I personally started with Let the Galaxy Burn and the Caiaphas Cain omnibuses. From there I went into Space Marines with the Ultramarines series followed by the Soul Drinkers. But by far my favorite two have been the Eisenhorn series and the Caiaphas Cain novels.
1
Let the Galaxy Burn and the Caiaphas Cain omnibuses
Scatterplots for subsets of multivariate data [Updated]
Update/Re-write There has been a lot of ambiguity over what i'm am trying to do with this question so I have decided to give it a full rewrite. I'm really sorry for the confusion. If you want to see the background please see the edit history. I hope things are clearer now.. I have some data made up into the following fashion: datac = { data1 = RandomReal[1, {7, 3}], data2 = RandomReal[1, {13, 3}], data3 = RandomReal[1, {19, 3}], data4 = RandomReal[1, {16, 3}], data5 = RandomReal[1, {5, 3}] }; data1 through data5 are subsets of a multivariate dataset with 3 independent variables. data1, for example, is composed of 7 individual data points (each with 3 variables). If I use the following function: Needs["StatisticalPlots`"] pairwisecol[data_, col_] := PairwiseScatterPlot[data, PlotStyle -> col, DataTicks -> True, DataLabels -> {"x", "y", "z"}] I can create a combined plot comparing the various subsets. E.g. Show[{pairwisecol[data1, Red], pairwisecol[data2, Blue], pairwisecol[data3, Green], pairwisecol[data4, Purple], pairwisecol[data5, Orange]}] This curently has the major drawbacks that each subset has to be defined and have a colour explicitly assigned to it. Also, Show in this instance overlays all of the DataTicks etc, rather than just the elements from the first plot (as is normally the case with Show[{Plot1,Plot2}]). What I'm looking for is a way to use the whole (partitioned) dataset datac to generate such a plot/diagram. i.e. something like, Show[pairwisecol[#, Red] & /@ datac] but, with Red being replaced by a series of colours to represent each subset (like in the plot shown). ...Alternatively, starting with a 2-level list e.g. datap = RandomReal[1, {60, 3}]; and a definition of sublist partitions, parts = {7, 13, 19, 16, 5}; or partspos = {[[1;;7]], [[8;;20]], [[21;;39]], [[40;;55]], [[56;;60]]}; then defining a function something like: pairwiseP[data_, partlist_] := ... that would partition datap into appropriate sublists, create a series of PairwiseScatterPlot's (each with a different plot colour) and then combine them using Show. Note that this example has n = 3 independent variables. I am looking for a method that works for 1 < n < ~20. Can anyone suggest how to do this?
I'm still uncertain whether this is what you want. Just make an array of plots and wrap it in Grid. Fiddle with the options to get axes, dividers, etc. the way you want them. The way I understand it, the data is really four subsets, each a group of datasets. For each group, you want to plot one group vs. another group, for each pair of groups, data[[1, All, i ]] vs data[[1, All, j ]]. I'm still unsure about the desired coloring. I've colored the plots by subset (which gives no extra information, except colors are pretty :). The question states The individual colouring of the subsets is what i'm aiming for. In the example plot, there are mixed colors. I can only think that the plot is an amalgamation of subsets. With my current understanding of the question, I don't how to use color to add more to each plot. I feel like I'm missing something here. Some random data with some structure: SeedRandom[1]; data1 = Map[(# + RandomReal[{-0.1, 0.1}, 3])^Range[3] &, RandomReal[{-1, 1}, {4, 4}], {-1}]; Dimensions[data1] Plotting functions: colorFn[subset_] := Hue[subset/4]; plot[subset_, datasets_] := Graphics[{colorFn[subset], Point[#]}, AspectRatio -> 1/GoldenRatio, ImageSize -> 100] & /@ datasets; Mapping the plotting functions: Grid[ MapIndexed[plot[First@#2, Thread /@ Subsets[Transpose[#], {2}]] &, data1], Dividers -> All] It's more interesting with 40 points instead of 4: SeedRandom[1]; data1 = Map[(# + RandomReal[{-0.1, 0.1}, 3])^Range[3] &, RandomReal[{-1, 1}, {4, 40}], {-1}]; Grid[ MapIndexed[plot[First@#2, Thread /@ Subsets[Transpose@#, {2}]] &, data1], Dividers -> All] Just to show the data is being processed as indicated: foo = MapIndexed[Thread /@ Subsets[Transpose@#, {2}] &, data1]; foo[[1, 1]] == Transpose@{data1[[1, All, 1]], data1[[1, All, 2]]} foo[[1, 2]] == Transpose@{data1[[1, All, 1]], data1[[1, All, 3]]} foo[[1, 3]] == Transpose@{data1[[1, All, 2]], data1[[1, All, 3]]} (* etc. *) True True True
1
Coloring subsets by subset is what I'm aiming for
Can I substitute a stainless steel pot for the traditional iron dutch oven?
I have very limited options in my kitchen, and while the dutch oven is the preferred method for getting an 'oven spring' while baking sourdough, I do not have a cast iron pot to do it. IF stainless steel is a good substitute, should I consider extra precautions?
i have not tested this myself but I do have a thought. I would tend to think that something a little less conductive would yield better results than a stainless steel stock pot. Cast Iron, Terracotta, earthenwear and other pots typically used for this are decent insulators, they take much longer to heat up. Just a stainless steel pot would probably transmit the heat too quickly resulting in and uneven baking of your bread.
1
Cast Iron, Terracotta, earthenwear and other pots used for this are decent insulators .
Please help me in changing layout of all products page
can anyone tell me where can I change layout of this page i think this page is now having 3columns.phtml layout but I need 2columns-left.phtml layout please help me.
To change the product page layout: From the Admin menu, select Catalog > Manage Products. Find the product in the list, and click to open the record. In the Product Information panel on the left, select Design. Then in the Design section, set Page Layout to a different column configuration. When complete, click the Save button. To change the category page layout: From the Admin menu, select Catalog > Manage Categories. In the Categories tree, select the category level you want to change. On the Custom Design tab, set Page Layout to “2 columns with right bar.” Click the Save Category button.
0.777778
Change product page layout from Admin menu to Catalog > Manage Products
2 servers, high availability and faster response
I recently bought a second webserver because I worry about hardware failure of my old server. Now that I have that second server I wish to do a little more then just have one server standby and replicate all day. As long as it's there I might as well get some advantage our of it ! I have a website powered by ubuntu 12.04, nginx, php-fpm, apc, mysql (5.5) and couchdb. Im currently testing configurations where i can achieve failover AND make good use of the extra harware for faster responses / distributed load. The setup I am testing nowinvolves heartbeat for ip failover and two identical servers. Of the two servers only one has a public ip adress. If one server crashes the other server takes over the public ip adress. On an incoming request nginx forwards the request tot php-fpm to either server a of server b (50/50 if both servers are alive). Once the request has been send to php-fpm both servers look at localhost for the mysql server. I use master-master mysql replication for this. The file system is synced with lsyncd. This works pretty well but Im reading it's discouraged by the (mysql) community. Another option I could think of is to use one server as a mysql master and one server as a web/php server. The servers would still sync their filesystem, would still run the same duplicate software (nginx,mysql) but master slave mysql replication could be used. As long as bother servers are alive I could just prefer nginx to listen to ip a and mysql to ip b. If one server is down, the other server could take over the task of the other server, simply by ip switching. But im completely new at this so I would greatly value your expert advice. Is either of the two setups any good ? If you have any thoughts on this please let me know ! PS, virtualisation, hosting on different locations or active/passive setups are not solutions im looking for. I find virtual server either too slow or too expensive. I already have a passive failover on another location. But in case of a crash I found the site was still unreachable for too long due to dns caching.
We do it on all our customer HA boxes and our Magento MicroCloudTM/ configurations, so that the fail over system(s) isn't idle. Look into DRBD, Linux VServer and heartbeat. Read the following for an insight into it. http://linux-vserver.org/Getting_high_with_lenny Caveat But as always, we advise not trying to do this unless you have substantial experience, as you are more likely to end up with a more unreliable configuration, that is harder to debug and if you end up in a split brain situation, more likely to have data loss ... than a plain old single server.
0.888889
Look into DRBD, Linux VServer and heartbeat
Online broker available in Europe - to buy index funds or ETF with small investments
So i am trying to start investing periodically some small amounts. I am particularly interested in index funds or ETF. I would like to be able buy, track, sell them, and etc online. There are a lot of online brokers like : TD Ameritrade, etrade and etc. , but i cant seem to find the one that would allow to register fro Europe citizen, like from Denmark. (all the top ones require USA citizenship or etc). Is there any like that at all ? If not - what other options there are to make such investments ?
You should try Nordnet. I think they should have a monthly saving plan on ETFs over there too.
0.888889
Nordnet should have a monthly saving plan on ETFs
Able to Access Elements with Index Greater than Array Length
The following code seems to be running when it shouldn't. In this example: #include <iostream> using namespace std; int main() { char data[1]; cout<<"Enter data: "; cin>>data; cout<<data[2]<<endl; } Entering a string with a length greater than 1 (e.g., "Hello"), will produce output as if the array were large enough to hold it (e.g., "l"). Should this not be throwing an error when it tried to store a value that was longer than the array or when it tried to retrieve a value with an index greater than the array length?
It is not safe to be doing this. What it is doing is writing over the memory that happens to lie after the buffer. Afterwards, it is then reading it back out to you. This is only working because your cin and cout operations don't say: This is a pointer to one char, I will only write one char. Instead it says: enough space is allocated for me to write to. The cin and cout operations keep reading data until they hit the null terminator \0. To fix this, you can replace this with: std::string data; C++ will let you make big memory mistakes. Some 'rules' that will save you most of the time: 1:Don't use char[]. Instead use string. 2:Don't use pointers to pass or return argument. Pass by reference, return by value. 3:Don't use arrays (e.g. int[]). Use vectors. You still have to check your own bounds. With just those three you'll be writing some-what "safe" code and non-C-like code.
0.666667
Write over memory that happens to lie after the buffer
"you will" vs "will you"
Which sentence is Correct Among both How much will you pay for me How you will pay for me
"How much" is asking for a quantity. "How" by itself is asking for a means or method. Example 1: How much will you pay for me? I'd pay up to $20. Example 2: How will you pay for me? I'll pay with a credit card. By the way, both sentences sound, at least taken out of context, like the speaker is asking the person about buying him or her, like you would buy a slave or a prostitute. Perhaps the intent is that they are asking about buying something on behalf of him or her?
0.777778
How much is asking for a quantity?
IE9 RC crashes on my Windows 7 laptop?
I was using IE9 beta till now and installed IE9 RC today. However it starts crashing on 50% of the sites I visit. This also includes www.youtube.com. I did not uninstall IE9 beta before installing IE9 RC. Could this be the reason? EDIT: I have uninstalled IE9 RC and installed it again after restart but that has not fixed this issue.
I would uninstall all versions of IE9, reboot and try installing RC again.
1
Uninstall all versions of IE9, reboot and try installing RC again
How to find inter-country buses in Europe?
I was traveling from Zurich to Frankfurt, and when I asked a tourist information, the guy advised that the best way is train. I took the train, and when arrived in Frankfurt, I found that there is a German company having bus from Zurich to Frankfurt with 1/3 of the train price. The problem is that bus companies are small and not-connected. On the other hand, such small companies have website mainly in their local languages (not English). As a result, it is difficult for a foreigner to find the best option for bus from a country to another; particularly, as they operate from small stations rather than a big united terminal (as one can go and ask for options). Are there resources (e.g., websites) for searching all bus routes around Europe?
Busbud is quickly becoming the go to site for bus tickets around the world, as it's adding more inventory to its database. Currently there are many routes in Europe that you can search, compare and book bus tickets directly on the busbud site, otherwise you can view schedules and prices and get redirected to the bus companies website to purchase your ticket. Very soon, there will be some new bus routes added for Spain and Turkey as well as some other countries around Europe and the world. Also another thing to keep in mind is that there is no additional fees for booking on busbud, the price you will pay is the same as on the website of the bus company.
1
Busbud is adding more inventory to its database .
does every right-angled coxeter group have a right-angled artin group as a subgroup of finite index?
I thought that I read a paper making this claim a few months ago, but now I can't find it. If the answer is yes, is there a nice way to go from the presentation of the right-angled coxeter group to a presentation of its right-angled artin subgroup? Thanks.
As James points out, the paper of Davis and Januskiewicz proves the inverse. To see that the answer to your question is 'no', consider the right-angled Coxeter group whose nerve graph is a pentagon. That is, it's the group with presentation $\langle a_1,\ldots, a_5 \mid a_i^2=1, [a_i,a_{i+1}]=1\rangle$ where the indices are considered mod 5. This group acts properly discontinuously and cocompactly on the hyperbolic plane, and it's not hard to see that it has a finite-index subgroup which is the fundamental group of a closed hyperbolic surface. Every finite-index subgroup of a right-angled Artin group is either free or contains a copy of $\mathbb{Z}^2$, but the fundamental group of a closed hyperbolic surface has no finite-index subgroups of this form.
0.777778
Right-angled Coxeter group whose nerve graph is a pentagon
Java ServiceLoader with multiple Classloaders
What are the best practices for using ServiceLoader in an Environment with multiple ClassLoaders? The documentation recommends to create and save a single service instance at initialization: private static ServiceLoader<CodecSet> codecSetLoader = ServiceLoader.load(CodecSet.class); This would initialize the ServiceLoader using the current context classloader. Now suppose this snippet is contained in a class loaded using a shared classloader in a web container and multiple web applications want to define their own service implementations. These would not get picked up in the above code, it might even be possible that the loader gets initialized using the first webapps context classloader and provide the wrong implementation to other users. Always creating a new ServiceLoader seems wasteful performance wise since it has to enumerate and parse service files each time. Edit: This can even be a big performance problem as shown in this answer regarding java's XPath implementation. How do other libraries handle this? Do they cache the implementations per classloader, do they reparse their configuration everytime or do they simply ignore this problem and only work for one classloader?
This question seem to be more complicated than I first anticipated. As I see it, there are 3 possible strategies for dealing with ServiceLoaders. Use a static ServiceLoader instance and only support loading classes from the same classloader as the one holding the ServiceLoader reference. This would work when The service configuration and implementation are in a shared classloader and all child classloaders are using the same implementation. The example in the documentation is geared towards theis use case. Or Configuration and implementation are put into each child classloader and deployed along each webapp in WEB-INF/lib. In this scenario it is not possible to deploy the service in a shared classloader and let each webapp choose its own service implementation. Initialize the ServiceLoader on each access passing the context classloader of the current thread as the second parameter. This approach is taken be the JAXP and JAXB apis, although they are using their own FactoryFinder implementation instead of ServiceLoader. So it is possible to bundle a xml parser with a webapp and have it automatically get picked up for example by DocumentBuilderFactory#newInstance. This lookup has a performance impact, but in the case of xml parsing the time to look up the implementation is small compared to the time needed to actually parse a xml document. In the library I'm envisioning the factory itself is pretty simple so the lookup time would dominate the performance. Somehow cache the implementation class with the context classloader as the key. I'm not entirely sure if this is possible in all the above cases without causing any memory leaks. In conclusion, I will probably be ignoring this problem and require that the library gets deployed inside each webapp, i.e. option 1b above.
1
Configuration and implementation of ServiceLoaders in shared classloader
Is it better for a beginner to start with black and white photography?
I'm quite a beginner in photography with no real experience in visual art. I became interested in it about 10 months ago. I inferred from the literature to avoid color photography for 2 to 3 years, or until I have a strong feeling for composition. It seems reasonable that first you should know to spot your interest in subject and express it on final print, a task in which colors may confuse a beginner. Besides I'm afraid that with no skill of actual seeing and analyzing I may end up with ugly oversaturated and dull images. Is there a professional opinion on subject, or I'm just inventing limitations of my own?
I think the opposite question could also be posed: should a beginner start with color photography? B&W requires knowledge and experience of how differently colors will render in gray. Reds, for example, will always appear as dark gray/black. Turning your question around (without actually changing it), with no skill of seeing and analyzing you may end up with ugly oversaturated and dull images. It's probably best to accept that your first images are not going to be particularly great, no matter what. But that shouldn't discourage you! Photography is a learning process. If you're interested to learn B&W, then you should do just that.
1
Should a beginner start with color photography?
Indexing encrypted data for efficient searching
I have implemented encryption for certain columns in a database. In some cases it may be necessary to search by these columns, either for exact matches or for substrings. At the moment, there is less than 10000 rows to search through (at most). However this will probably change in the future so I am anticipating efficency problems. The data will remain encrypted in the database, but when retrieved by the application, it can then be decrypted. This means that the retrieval does not have to be 100% accurate, it can retrieve more records than actually match the query, and the application itself can discard the non-matching records. With this in mind I came up with the following solutions: For exact text match, hash the encrypted data and modulo this with a relatively low number (2^16 perhaps), and store that value in an additional column. When querying the database, it is only necessary to perform the same operation on the input string, and retrieve all records with matching hash value. For finding substrings, hash each letter and mod 32 the result. Then set the corresponding bit in an integer. Perform the same operation on the query string. Thus it is only necessary to retrieve records where the result of a binary AND on the query with the stored value is greater than 0. This could also be done using each pair of letters, perhaps with a 64-bit or longer integer to allow for more records to be discarded. My question is, would either of these techniques have a real impact on the security of the data in the encrypted columns? The encryption scheme is AES-256.
Ability to narrow searches tends to be in direct opposition with the confidentiality that you seek through encryption. For instance, if you store your "16-bit hash" in an extra column then that hash reveals 16 bits of the data -- 16 indirect bits, but 16 bits nonetheless. An attacker who sees the database may try to guess (brute force) the record contents, and the 16 bits will allow him to detect 65535/65536th of bad guesses: this is a substantial advantage. Ability to do substring searches is even worse, since it necessarily reveals information that allows the brute force attack to proceed in gradual steps (this is in fact the same problem as partial password authentication). At best, what you could do is to implement deterministic encryption, such that encryption of a given record value always yields the same encrypted result. This leaks a modicus of information (if two records have the same contents then this will show, despite the encryption layer); on the other hand, it allows for exact searches: you encrypt the value to search, and use the index on the encrypted values. Substring searches, however, should be avoided at all costs. I think a better method would be to revisit your assumptions: However this will probably change in the future so I am anticipating efficency problems. Usually, performance issues don't exist until having been actually encountered (at least in a test platform, if not in production) and duly measured. As Donald Knuth once wrote: premature optimization is the root of all evil. Even if the envisioned performance issue is real and you know how much it will cost, some alternate methods might be applicable. For instance, you could read all the records in the RAM of the application, decrypt them all, and keep them in RAM. This would allow very fast searches without even going to the SQL level. Modern servers have a lot of RAM. As an example, the servers that maintain the StackExchange sites (all of them) are reputed to have been sufficiently boosted in RAM (a few hundred gigabytes) so that all the data can be cached, and the servers can perform all read accesses at RAM speed. If your records are, say, no longer than 100 bytes (e.g. they are the names of some people), then you can store 10 millions of value in a mere gigabyte of RAM. What is a gigabyte ? Even your phone has more RAM than that.
1
Ability to narrow searches tends to be in direct opposition with encryption
From the 4th to the 8th of June - [date ranges]
In a business letter, what's the correct or more frequent way to write date ranges? from the 4th to the 8th of June 2014, we have been working on the project or from 4 to 8 June 2014, we have been working on the project or In June 2014, 4 to 8, we have been working on the project
Both forms are acceptable. The use of 8th is more common than either 8 June or the eighth of June. Because both dates are in the past, consider using past tense. "We worked on the project from June 4th 2004 through June 8th 2014." The use of through is slightly less ambiguous.
1
Use of 8th is more common than 8 June or the eighth of June
Facebook - Music, Books, Interests.. are they all included in "Likes"?
I am trying to retrieve a list of users' interests. So I am making calls to the graph api to retrieve things like books, music, etc. It seems everything under "Likes" also includes everything listed under books, music, etc. Are their any exceptions, or can I just make one call to retrieve Likes?
As you can find it on the API documentation, the "Likes" retrieve "All the pages this user has liked". You need the permission user_likes. You just need to do the following request: https://graph.facebook.com/ID/likes?access_token=TOKEN where ID is the ID of the user and TOKEN is the token that you have received. It will return An array of JSON objects containing like id, name, category and create_time fields. Cheers
0.666667
"Likes" retrieve "All the pages this user has liked"
Recursion depth of 1024 exceeded during evaluation
This is my very first day using Mathematica, so please forgive me my complete ignorance... I fear that this might be one of those questions that gets rejected for being "easily found in the documentation"... Nevertheless, searching hard and long through the documentation all that I may, I completely fail to find an answer to my - no doubt obvious - mistake... I tried to define a function x[t_] and a function y[t_], both as it seems successfully... I then tried to put them together in a complex valued function f[t_], which I believed to be an operation that could not possibly go wrong... However to my surprise I keep getting a "Recursion depth of 1024 exceeded during evaluation of f[0]" error... I really fail to see where this "recursion" could possibly come from... Could anyone please put this noobie on the right track? a = 2 (* 2 *) T = 2^(3/2) (* 2 Sqrt[2] *) x[t_] = a Cos[2 Pi t/T] - Cos[2 Pi t] (* -Cos[2 \[Pi] t] + 2 Cos[(\[Pi] t)/Sqrt[2]] *) y[t_] = a Sin[2 Pi t/T] - Sin[2 Pi t] (* -Sin[2 \[Pi] t] + 2 Sin[(\[Pi] t)/Sqrt[2]] *) f[t_] = x[t] + I y[t] During evaluation of In[112]:= $RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of f[0]. >> During evaluation of In[112]:= Set::write: Tag Hold in Hold[f[0]] is Protected. >> (* -Cos[2 \[Pi] t] + 2 Cos[(\[Pi] t)/Sqrt[2]] + I (-Sin[2 \[Pi] t] + 2 Sin[(\[Pi] t)/Sqrt[2]]) *) f[0] During evaluation of In[113]:= $RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of f[0]. >> (* Hold[f[0]] *)
So much wrong there... a = 2; tx = 2^(3/2); x[t_] := a Cos[2 Pi t/tx] - Cos[2 Pi t]; y[t_] := a Sin[2 Pi t/tx] - Sin[2 Pi t]; f[t_] := x[t] + I y[t]; f[20] (* -1 + 2 Cos[10 Sqrt[2] π] + 2 I Sin[10 Sqrt[2] π] *) Don't use uppercase initials for your symbols - you might clash with built-ins. Don't use some external user-defined global symbol inside a definition in the manner you have unless there's a good reason to do so (I left that as is, but it's bad practice). Read the documentation, learn the difference between Set (=) and SetDelayed (:=). Read What are the most common pitfalls awaiting new users? on this very site. Great resource for new users. Go through the tutorials in the Mathematica documentation. Very worthwhile.
0.888889
What are the most common pitfalls awaiting new users?
sharing state between different controllers in angular
I have two controls : Left Side Navigation and the right pane that changes the content on clicking of any item on left navigation. Here is the html (angular view): <nav class="navigation"> <ul class="list-unstyled" ng-controller="NavigationController as navigation"> <li ng-repeat="nav in navigation.tabs" class="has-submenu"> <a href="#" ng-click="navigation.changeContent(nav.name)">{{nav.name}}</a> <ul class="list-unstyled" ng-show="nav.subNav"> <li ng-repeat="subnav in nav.subNav"><a href="#" ng-click="navigation.changeContent(subnav.name)">{{subnav.name}}</a></li> </ul> </li> </ul> </nav> <section class="content" ng-controller="ContentSwitcher as content"> {{content.tab}} <div class="warper container-fluid" > <div class="container-scroll"></div> </div> </section> And here is the controller (function () { var app = angular.module('provisioning', []); app.service('contentService',function(){ var tab = 'Dashboard'; return { getTab : function(){ return tab; }, setTab : function(value){ tab = value} } }); app.controller('NavigationController',['contentService','$log', function(cs,log){ this.tabs = [ { name: 'Dashboard' }, { name: 'Manage', subNav: [ { name: 'Account' }, { name: 'Facility' }, { name: 'Doctors' }, { name: 'Patients' }, { name: 'Nurses' }, { name: 'Device Inventory' } ] }, { name: 'Health Tracker' }, { name: 'Reports' }, { name: 'Settings' }, { name: 'Logout' } ]; var template = this; this.changeContent = function(tab){ cs.setTab(tab); } }]); app.controller('ContentSwitcher', ['contentService',function(cs){ this.tab = cs.getTab(); }]); })(); Also, is it best way to achieve what I intend to do in angularjs? I created a service and shared the variable in the two different controllers. However it doesn't work. The content on right never gets updated on clicking any of the item on left menu.
You need to tell your controller that the value of the tab has changed and then update it with the new value from the service. The second controller (ContentSwitcher) can not know, that the value changed and you simply assigned the string value of getTab once to this.tab. One way to archive this automatically is changing the type of the variable inside your serivce from string to an object (e.g. tab = {name:'Dashboard'}) and then call $scope.$apply after you made changes to it. In your first controller you still assign this.tab = service.getTab() (which will be an object) and in your view {{tab.name}}.
0.777778
Change the value of the tab to a new value from the service
Why are papers without code but with results accepted?
I just started reading some papers (Computer Science, specifically Computer Vision) and thought "now let's look at the source code" and was quite astonished that most of the papers don't have any source code implementing the described methods to look at, while claiming some performance or being better than other papers. How do these papers get accepted in journals / conferences? Do people have to submit their source code privately to the reviewers at least, so that they can reproduce the experiment if possible. Do most journals / conferences just "trust" that people who submit the paper really implemented the theory and got those exact results? I always had this idea that any experiment should be reproducible by others else it's not scientific justified. Been wondering about this the last few days.
What field are you talking about? A CS paper describing the design and performance of a computer vision algorithm is different from a sociology paper that used a spreadsheet to crunch demographic data. Do most journals / conferences just "trust" that people who submit the paper really implemented the theory and got those exact results? Yes. The presumption is always that there is no scientific fraud involved. I always had this idea that any experiment should be reproducable by others else it's not scientific justified. If the algorithms are fully described in the paper, then the result is reproducible. To reproduce it, you have to reimplement the algorithm. I just started reading some papers and thought now let's look at the code and was quite astonished that most of the papers don't have any code to look at, while claiming some performance or being better than other papers. Presumably the better performance is because the algorithm described in the paper is a more efficient algorithm. For example, when sorting a large amount of data, a quicksort is a better sorting algorithm than a bubble sort. The quicksort has O(n log n) performance on the average, while the bubble sort has O(n^2), and this is true regardless of the details of the implementation.
1
How does a computer vision algorithm work?
Is there any performance difference between ++i and i++ in C#?
Is there any performance difference between using something like for(int i = 0; i < 10; i++) { ... } and for(int i = 0; i < 10; ++i) { ... } or is the compiler able to optimize in such a way that they are equally fast in the case where they are functionally equivalent? Edit: This was asked because I had a discussion with a co-worker about it, not because I think its a useful optimization in any practical sense. It is largely academic.
Guys, guys, the "answers" are for C and C++. C# is a different animal. Use ILDASM to look at the compiled output to verify if there is an MSIL difference.
1
Use ILDASM to look at compiled output
What's a common mechanism for emailing in the background?
When users sign up to my site, the connection from my server to our 3rd-party SMTP provider is very bad and the app takes from a few seconds to a few minutes to connect. While it is trying to connect and send, users are forced to wait there and sometimes they would just give up and leave the site. This is horrible user experience. What is a good way to make this seem instantaneous (having to host our own mailserver is not an option at this point)? Some way to execute this in the background? Maybe using some type of queuing mechanism? I'm using the LNAMP stack on a CentOS 5 x64 machine. App is using CodeIgniter. EDIT: It seems using a local mailserver to use as a relay is a common solution. But how does one log or track whether or not email was delivered correctly by using this method? Sidenote: Some ESPs provide a REST API for email delivery (ours do too). We currently use SMTP and not their REST API.
You can use Postfix as a nullmailer (relay only to ISP). This is nothing more than a four-liner: main.cf myorigin = $mydomain relayhost = $mydomain inet_interfaces = loopback-only local_transport = error:local delivery is disabled Reference: http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client
1
Postfix as a nullmailer
Is there a comprehensive life science techniques/methods database?
There are so many techniques/methodologies in the life sciences that we can use to interrogate interesting questions. The thing is, most of us are completely unaware of the available methods we can employ. Rather, we go with the techniques we are familiar with or that are popular in our subdomains at the time. But that's pretty limiting. So I'm wondering... we have databases for everything else... is there one for life sciences techniques/methods? Something like this could be immensely helpful in experimental planning. In particular, I think a comprehensive database would help scientists break outside of their spheres of familiarity and to employ less known (but potentially illuminating) methods to their questions. I know there are journals that publish protocols and methods, but they are fragmented and don't encompass everything. Does what I'm looking for exist? If not, how might one go about creating such a tool?
you can use something like https://www.synbiota.com/ where you can store and share your protocols with collaborators. If you make your project open, then anyone in the world can view your protocols. The nice thing about this is you can reference actual experiments that made use of the protocol (and literature) and this gives better context and understanding about the protocols...
1
How to store and share protocols with collaborators?
How to read NTFS drives in Linux (RHEL 6)?
My system is on dual boot. I have installed both RHEL 6 and win7 in it. I use RHEL mostly and I want to use my windows' NTFS drive in RHEL. How can I do it? Tell me the procedure.
I don't have RHEL, but yum install fuse-ntfs-3g should work AFAIK.
1
yum install fuse-ntfs-3g should work AFAIK
How can I bypass double quotes in a attribute based xss attack
The code that I have is: <input type="text" name="some_name" value="<?php echo CHtml::encode($str); ?>" /> $str is the input data. 'CHtml::encode()' is Yii's way of encoding special characters into HTML entities. Can this be bypassed? I know it can be broken if I do not put those double quotes around the input. But I do not think just by putting double quotes around will make it unbreakable.
The encode() method HTML encodes characters, which is the correct XSS prevention method in this context. So if a " character was inserted inside of $str to try and break out of the HTML attribute context, this would be converted to " or " which is the HTML representation. Therefore it is not possible to inject script here, assuming encode does not have any flaws itself that allows this to happen.
0.666667
HTML encodes characters, which is the correct XSS prevention method
ExPex no longer available
I have noticed that the excellent linguistic package ExPex is no longer available on the website of the maintainer. (This package is not in CTAN and was only maintained there.) Does anyone know why? Is it no longer being developed?
I contacted the author of ExPex (John Frampton) and he was unaware of the web page issue. The issue has now been resolved, and the link in the question has been changed (although the link in the question now redirects there). He has no intentions of abandoning development of the package. It is likely that it will be uploaded to CTAN in the future. Until the package is released on CTAN, users should continue to use this link to get the current version of the package. Update ExPex has now been submitted to CTAN, so users should use their package manager or the CTAN website to keep their version up to date.
1
ExPex has now been submitted to CTAN .
Can monsters make multiple attacks in a single action?
In the bestiary for the new D&D Next playtest packets, some creatures look as though they get multiple attacks per round. e.g.: An owl bear gets Melee Attack: Claws +5/+5 (etc.) and Bite +5 (etc.) along with a special power says that if both claw attacks hit, then extra damage is done. However, the basic rules don't seem to cover this situation. I can't tell if the owlbear is able to use both claws AND bite in one action, or if it can only use one claw OR a bite, or 2 claws OR A bite. So, do monsters get multiple attacks per action? And what are the rules for the owl bear, or other monsters that have a +x/+x description for an attack? One possible way to answer this question would be to explain how this worked in earlier editions of D&D. If you can tell from the rules test how this is supposed to work, that would be a better answer.
It gets all the attacks. In earlier pre-3e editions that kind of notation meant simply that the monster got all those attacks, and I'm sure that's the intent in D&D Next. In 3e and later there were more complex action types but those are not in 5e (yet).
1
D&D Next gets all the attacks
What does “sign the final flourish” mean?
There was the following sentence in Time magazine’s a bit old article (December 11, 2013) titled, “Pope Francis, the people’s Pope,” in which I was drawn to the phrase, “sign the final flourish”: “He returned o Buenos Aires and looked to retirement. - - He handed his letter of resignation to the Pope when he turned 75 in 2011.”I’m starting to consider the fact that I have to leave everything behind,” he said in 2010. “It makes me want to be fair with everyone always, to sign the final flourish ... But death is my thought every day.” He insisted he was not sad, and he went on posing for pictures with the faithful.” http://poy.time.com/2013/12/11/person-of-the-year-pope-francis-the-peoples-pope/ I thought “sign the flourish” an idiom, but I don’t find the phrase in dictionaries I use to consult, or on Google.” I wondered if it’s similar with Japanese idiom, “一花咲かせる-hitohana sakaseru” meaning to bloom the last blossoms at the ending, at the last stage of one's career, or before retiring, like a baseball player who passed his peak hitting a streak of homeruns before retiring, but then, the word, “sign” seems to be incongruent. Or, does “sign the flourish” mean “sign by using decorated-letters”? What does the phrase, Pope wanted to “sign the final flourish” mean?
When you sign something with a flourish you make a kind of bold dramatic motion of the pen. I think it's a metaphor to living the end of his life, and how he would like to deal with it, in style and displaying good character.
1
When you sign something with a flourish you make a bold dramatic motion of the pen
Change Background Image in Itext to watermark or alter opacity c# ASP.net
I want to make my background image in iText transparent here is my code for the image: string root = Server.MapPath("~"); string parent = Path.GetDirectoryName(root); string grandParent = Path.GetDirectoryName(parent); string imageFilePath = parent + "/Images/logo.png"; iTextSharp.text.Image jpg = iTextSharp.text.Image.GetInstance(imageFilePath); jpg.ScaleToFit(1700, 800); jpg.Alignment = iTextSharp.text.Image.UNDERLYING; jpg.SetAbsolutePosition(100, 250); jpg.ScaleAbsoluteHeight(500); jpg.ScaleAbsoluteWidth(500); Any idea?
Please take a look at the BackgroundTransparant example. It is a variation on the BackgroundImage example. In your code, you're adding the Image to the Document instance. That's OK, but if you want to make such an image transparent, you need to introduce a soft mask. That's not difficult, but there's an easier way to make your background transparent: add the image to the direct content, and introduce a PdfGState defining the opacity: PdfContentByte canvas = writer.getDirectContentUnder(); Image image = Image.getInstance(IMAGE); image.SetAbsolutePosition(0, 0); canvas.SaveState(); PdfGState state = new PdfGState(); state.setFillOpacity(0.6f); canvas.setGState(state); canvas.addImage(image); canvas.restoreState(); Compare background_image.pdf with background_transparent.pdf to see the difference. My example is written in Java, but it's very easy to port this to C#: PdfContentByte canvas = writer.DirectContentUnder; Image image = Image.GetInstance(IMAGE); image.SetAbsolutePosition(0, 0); canvas.SaveState(); PdfGState state = new PdfGState(); state.FillOpacity = 0.6f; canvas.SetGState(state); canvas.AddImage(image); canvas.RestoreState();
0.666667
How to make background transparent?
Is research a viable business model?
I have had the suspicion that it may be for a while and apparently not all is a product of my mind. Let me quote from an answer: In my experience, in UK and other European countries, the research funding comes from successful proposals to the relevant funding bodies. There are research centres that were established and keep going only because the staff there constantly submits project proposals (somebody told me that the success rate is 1 out of 5 or maybe even lower). There are two questions here. Can a company feasibly focus on obtaining funds in publicly funded research (as a business model) successfully enough to "survive"? Can such a company be started (nearly) from scratch? In short, the company would be exactly like a research institute (or institution) except that it would be private. Reasons why question 1 may not be feasible: I don't see any company doing this kind of thing, i.e. there may be some, but there are not many, which means that it may be hard. It's a bad sign. Public funds seem to be assigned to public entities, while companies can benefit from the collaboration and synergy, but they are expected to get their funding from their work as companies (searching for customers, etc.) In this case the customers would be the partners in the projects and the society itself, but again, this seems to be an "innovative" (maybe naïve, or even plain stupid) idea. Research is a means for something, not an end on itself, that's why the business model should be on something else (point two) and that's why such a company would raise eyebrows on the mere idea of its existence. It may even be against some kind of tacit rule or even written laws. Reasons why question 2 may not be feasible: No previous history of success of the company, or products or anything means zero (or negative) trustworthiness and no projects assigned to the company. No partners would like to associate with the company in a project for the reasons in point 1. The most similar case I can think of are spin-off companies that are created from successful research labs, not from scratch. OMG so much communism! Go to kickstarter you hippie! As an example, a possible scenario that could be close to this: Someone writes a paper about a software system that does something not very novel in the state of the art but in a way that is very different from an architectural point of view, leading to good results in practical terms. In short: in theory nothing is new, in practice what was just a dream is now a reality. What is done remains the same in theory, but how it is done is completely different in practice (and now it works). Unfortunately only a proof of concept (PoC) can reasonably be implemented. Would it be feasible to request funds to continue the development of this PoC (still very far from a commercial product) as a start-up or that simply doesn't make sense?
From the perspective of the US, there are many research institutes that operate as a private business entity. These research institutes can apply for some federal funding in the same capacity as a research at an educational institution. I see it being possible to start a private company without a lot of capital, although you will need to have a very strong skill set that is in demand. Whether this is a sustainable model really seems to depend on the specialized skills that the business would offer and the infrastructure that would allow it to efficiently prepare grants. Research-I educational institutions in the US have an incredible infrastructure to prepare and apply for grants that would be difficult to replicate in the private sector.
0.666667
Research institutes in the US can apply for federal funding in the same capacity as a research at an educational institution
Manually adding 's' to 'http'
I did a Wireshark capture of my login into a drupal-based website. The website does not use https. And so, quite obviously, I was able to capture my username and password in plain text by simply using the http.request.method==POST filter in Wireshark. Then, I tried to access the same web page by manually adding a s to http in the url. Quite naturally, my browser showed this: Then I went ahead and did my login again, and did the Wireshark capture again. To my surprise, I do not have the any captures corresponding to the http.request.method==POST filter. So, my questions: When I am not really using https, why wasn't I able to capture login id and password in plain text? What effect did manually adding s to http have?
Despite what you may think, you actually were using HTTPS. This is perhaps an over-simplification, but here's more or less what happened: When you accessed the website with http:// as the protocol in your Address Bar, you effectively told your computer "Make a request for this webpage, from this server, and send that request to port 80 on the server". If the server is configured to allow access via plain HTTP (apparently, it was), the server will respond and your session (unless re-directed) will continue over HTTP. By changing the protocol to https://, you instead directed your computer to attempt an SSL/TLS handshake via port 443 on the server and then send the HTTP requests through that tunnel. Obviously, this worked or you would not have been able to access the page. Since the SSL/TLS connection was successful, that meant that all subsequent HTTP requests sent through that tunnel would be secured from casual eavesdropping (e.g.: via Wireshark). But now, you ask, what about that nasty red slash through https, and the "x" on the lock? These indicators do not mean that the SSL/TLS connection was unsuccessful, or that your communications to the website are not encrypted. All these negative indicators mean is that the website is not signed by an authority your browser recognizes. This is often the case for the web interfaces on SOHO networked equipment, business applications, or websites where the administrator has chosen to use a self-signed certificate instead of purchasing one from a well-recognized authority (e.g.: VeriSign). This is analogous in some ways to selling alcohol in a jurisdiction where such sales are age-restricted. Since I don't know all the intricacies of the real-world laws, let's say for the sake of argument that the law only goes so far as to say it is illegal to sell alcohol to a person who is younger than a given age. What the law in this hypothetical case does not specify is whether you are required to check I.D. prior to a sale, or which forms of I.D. are considered to be valid proofs of age at time of sale. Authoritative proof of the buyer's age is only ultimately required in court if the legality of the sale is ever challenged. However, it is still of course a good idea to check I.D.s on every sale just to be safe. Here, you are a clerk at a convenience store in the great state of Comodo. Most of your customers will be fellow Comodoans, and so you are naturally able to easily recognize and verify their I.D.s which are issued by the Comodo Government. One day though, you get a customer from the distant state of VeriSign. What do you do now? Fortunately, your store has a book called Trusted Root Certificates which has pictures and tips on how to verify I.D.s issued from various states in your country. You check your book, compare the customer's I.D. to the relevant photograph and notes, and judge that the I.D. is indeed issued by an authority trusted by your store. Given this, you can now trust that the information on the I.D. (particularly, stating the customers identity and age) is accurate, and therefore be comfortable in knowing that you are making a legal sale. On another day, a customer comes in from overseas. His name is Drupal, and he hails from the land of DigiNotar. He says he is old enough to buy alcohol, and his DigiNotarian Government I.D. concurs with his statement. However, your Trusted Root Certificates book does not have any information to help you verify an I.D. from his country. What do you do here? Strictly speaking, by the letter of the law in this hypothetical country, your sale would still be legal if your customer is in fact as old as he says he is. You could choose to assume he is telling the truth and, if he actually is, go on with your life without ever being convicted of any crime related to that action. But, without any documentation from an authority you recognize, you are still taking the risk that he is not telling the truth. It's very possible that he is not of the proper age, despite what he and his I.D. may claim. In this case, the sale will still be completed. The product will still only be transferred between you and your customer (not immediately available to anyone else, unless your customer chooses to distribute it), but now the problem is that the alcohol has been given to someone who legally should not have it - and you could be in trouble for this. TL;DR: As long as your browser shows https:// as the protocol, you can be assured that the data in your communications are secured between your computer and some endpoint. If there's any warning signs around that https:// area though, that means that the browser does not trust that endpoint to be what it claims to be. It is then up to you to decide whether you trust the endpoint's claims to identity enough to transfer sensitive data over the connection. The connection is still secure in the sense that nobody between you and the other end of the HTTPS connection can sniff the data, but you are taking the chance that the other end isn't what it claims to be.
1
What do you do to verify an I.D. from an authority?
Do the preset picture styles also affect the White Balance?
I started shooting RAW with my Canon 550D, and tried out different Picture Style settings on some of the images using the software provided by Canon (I am assuming that the Picture Style settings are consistent with those in the camera). The Picture Style seems to contain only settings related to Sharpness, Saturation, Tone and Contrast. However, when I switch across different styles, the white balance seems to change as well even though the preset styles seem to differ only in sharpness. E.g. the Portrait style appears warmer than the Standard and Landscape styles. So, do the preset styles have any impact on the white balance? Also, are there any differences between the camera & computer software styles?
Picture Styles generally don't affect white balance per se, but they do affect colour balance. For example, portrait styles increase red channels to provide warmer skin tones, and landscape portrait styles boost the blue and green channels for more vivid scenery and skies.
0.888889
Portrait styles increase red and green channels for more vivid scenery and skies
Getting information from database and giving it to javascript
The main thing I want to achieve is that my module makes a google map with markers. For now im doing this: drupal_add_js('https://maps.googleapis.com/maps/api/js?key=AIzaSyDcl28Qcn9GTi02rRtQaLgVS4GWZbGcQ8E', 'external'); $locations = db_query('SELECT * FROM {locations}')->execute(); $script = '<script> function initialize() { var mapOptions = { center: { lat: 56.9714744, lng: 24.1291624}, zoom: 9 }; var map = new google.maps.Map(document.getElementById(\'map-canvas\'), mapOptions); var locations = ['; for($i = 0; $i < $locations->length;$i++){ $string = '['.$locations[$i]['locationsTitle'].','.$locations[$i]['locationsLat'].','.$locations[$i]['locationLng'].'],'; $script = $script.$string; } $script = $script.']; for (var i = 0; i < locations.length; i++) { var loc = new google.maps.LatLng(locations[i][1], locations[i][2]); var marker = new google.maps.Marker({ position: loc, map: map, title: locations[i][0] }); }; } google.maps.event.addDomListener(window, \'load\', initialize); </script> '; $html = ' <div id="map-wrapper" style="width:100%;height:500px;margin:auto"> <ul id="map-list"></ul> <div id="map-canvas" style="width:100%;height:100%;margin:auto></div> </div> '; return array('#markup' => $script.$html); As you can see in the third line of code im trying to get information from the database that I have saved. The problem is I dont know how would i get it properly. And then I want to pass it down in the var locations part in the script.. I have tried finding some tutorials where they explain how would this work but most of them is just how to show some posts or somthing like that and that doesnt help me. Thanks for help already! :) // EDIT This is the script that i have now in js file (function($) { Drupal.behaviors.myModule = { attach: function(context, settings) { function initialize() { var mapOptions = { center: { lat: 56.9714744, lng: 24.1291624}, zoom: 9 }; var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var locations = [ ['Mājas',56.956344, 24.197409], ['Domina',56.966058, 24.162004] ]; for (var i = 0; i < locations.length; i++) { var loc = new google.maps.LatLng(locations[i][1], locations[i][2]); var marker = new google.maps.Marker({ position: loc, map: map, title: locations[i][0] }); }; } //google.maps.event.addDomListener(window, 'load', initialize); } } )(jQuery); I have the "google.maps.event.addDomListener(window, 'load', initialize);" commented becouse I think i dont need it..? And becouse there is no function initialize anymore? Or should i add that back? The problem now is that my script seems to be added.. But it doesnt seem to be run becouse the google map dosnt show up..
You should never need to build javascript with PHP, there's just no need (especially in Drupal, which already has a mechanism). What you should do instead is put your JS in an external file, then use Drupal's JS settings to pass the data. So the JS file might look like: (function($) { Drupal.behaviors.myModule = { attach: function(context, settings) { var locations = Drupal.settings.myModule.locations; // Do something with the locations var. } } )(jQuery); And in your page callback or whatever: $settings['myModule']['location'] = db_query('SELECT * FROM {locations}')->fetchAll(); drupal_add_js($settings, 'setting');
0.888889
javascript should never be built with PHP .
97 Honda Civic dies in neutral
I have a 97 Honda Civic that will occasionally die in neutral. This is what I have done so far: Replace both O2 sensors Replace MAP sensor Replace Air filter Added Lucas treatment to fuel tank Even after the above changes, occasionally when coasting in neutral the rpm's will eventually drop to 0 and the engine will die. It starts back up just fine. My engine and fuel mileage have definitively improved with all the changes, especially after using Lucas.
My suspicion is it's related to the fuel system. So I'd be testing the fuel pressure. If fuel pressure is fine, then check the injectors.
0.888889
If fuel pressure is fine, check the injectors.
Why does playing the piano give me a pain in the neck?
I have a keyboard set up with a proper stool so my arms are held straight out, with music at eye level - almost identical to how I set up my PC for good posture. But while I can use the PC all day with no issues, within 5 minutes of playing the keyboard - I'm just starting - I get stiffness pain at the bottom of my neck, probably one vertebra above the shoulders. Can anyone advise what is causing this and how to adjust? I think my main posture can't be too bad - I'm not hunching or craning my neck - but wondered if perhaps I am 'clenching' somehow?
I'm a violinist, not a pianist, but it's very common for beginning violin players to have severe pain because they are too tense, especially when they are self taught. I'm going to suggest a few generic techniques to start minimizing tension. When you sit down at the piano, think about how you are sitting. Look for any tension, especially in your neck and shoulders. Close your eyes, and take a few deep, slow breaths to help you relax. Play a note. Not a piece, or even a scale, just a single note. Think about how relaxed you feel playing that note. Think about tension in your back and shoulders. If you find any, slow down again and relax. Now try two notes, or maybe even three or four. But still think about relaxing, not about music. This is what your body should feel like all the time when you play. Now you've got a baseline for how you should feel while playing. So play something simple. Either a short tune you know well, or a scale, or whatever you find easy. Halfway through, stop and think about tension. Did you tense up again? If you did, sit back, relax, and start over, slower. Slowing down makes it easier to play, and easier to think about not getting tense. Another exercise is to practice breathing while playing. A lot of beginners tend to hold their breathe, which just adds stress and tension. So play a scale. Depending on your speed, you may want to breathe in going up, and out going down, or breathe in for 4 notes, out for 4 notes. Just practice breathing in rhythm, and being aware of your breathe. When you are playing music, start thinking about when you breathe in general. Breathing exercises aren't just for singers. In summary: Consciously relax before playing, and check for tension as you play. If you get tense, back off, relax, and slow down. Make sure you breathe. If the tension is caused more by your posture, you may need to find a teacher to help you out, since we can't see how you hold yourself over the net. A teacher could also help with the sort of tension issues I'm talking about here, so if lessons are an option, it would probably be worthwhile, even if only for a short time.
1
How to minimize tension when playing music?
interpolation of 3D data
I have a 3D surface given in data-points of the form ${x,y,z}$. What is the easiest way to get the interpolated value $z=f(X,Y)$ for given coordinates ${X,Y}$ (which are of course not in the data list)?
Mathematica's interpolation function, Interpolation, works on multidimensional data. For example, data = Flatten[Table[{x, y, x^2 + y^2}, {x, -10, 10}, {y, -10, 10}], 1]; int = Interpolation[data]; Then, you can extract the values for values between the data points: int[1.1, 1.1] (* ==> 2.42 *) And Plot3D, or whatever else you want. Plot3D[int[x, y], {x, -10, 10}, {y, -10, 10}] Note, that the interpolation is pretty good: exact[x_, y_] := x^2 + y^2 int[1.1, 1.1] == exact[1.1, 1.1] (* => True *) Or better yet (thanks @rcollyer): (int[1.1, 1.1] - exact[1.1, 1.1])/exact[1.1, 1.1] (* 1.83508*10^-16 *) Update Leonid's comment below pointed out that the accuracy of Interpolation will be worse with an unstructured grid. For example: dataDelete = Delete[data, RandomInteger[{1, Length[data]}]] intD = Interpolation[dataDelete] Then, (intD[1.1, 1.1] - exact[1.1, 1.1])/exact[1.1, 1.1] (* ==> 0.0743802 *) which is worse. It seems particularly bad close to the origin: Plot3D[(intD[x, y] - exact[x, y])/ exact[x, y], {x, -10, 10}, {y, -10, 10}]
0.777778
Interpolation works on multidimensional data
Medibuntu vs Fluendo
Can someone describe the difference between the codecs in the Medibuntu Repository versus buying the Fluendo codecs? Are they the same? Does one have better quality etc? My Dell Mini originally came with Fluendo installed, but I have since upgraded several times and just used Medibuntu - but I am wondering if I am missing something.
Fluendo multimedia codecs exists as commercial products because of software patents (required for decoding mpeg, mp3, etc) and silly-DRM removal laws (ie parts of DMCA, Digital Economy and ACTA) that stop you removing the CSS DRM on DVDs. The Medibuntu variants are still free software as they're not infringing any copyright (to my knowledge anyway). Whether you legally need it or not comes down to where you live honouring software patents or the DMCA-style DRM-cracking laws. Regarding quality: the codebase for each implementation is different so there is scope for one implementation being better than another. The only test I've really seen is ffmpeg vs Google's own implementation, where ffmpeg trounces Google. Dell plays it safe. They want top sell a product internationally that they can advertise as being able to play DVDs. That means they have to adhere to local laws and that undoubtedly means they'll need to license the software in some regions. I expect it is easier (and therefore cheaper) for them to just bulk-license from Fluendo.
1
Fluendo multimedia codecs exist as commercial products because of software patents and silly-DRM removal laws .
Why are two eigen-state-kets with different eigenvalues orthogonal?
The operators $J_1^2$, $J_2^2$, $J_{1z}$, and $J_{2z}$ are mutually commuting operators. Likewise, $J_1^2$, $J_2^2$, $J^2$, and $J_z$ are mutually commuting operators. The two groups are incompatible, and the simultaneous eigenkets along with their eigenvalues are given by: ${J_1}^2 \left|j_1,j_2;m_1,m_2\right> = j_1 \left(j_1+1\right) \hbar^2 \left|j_1,j_2;m_1,m_2\right>$ ${J_2}^2 \left|j_1,j_2;m_1,m_2\right> = j_2 \left(j_2+1\right) \hbar^2 \left|j_1,j_2;m_1,m_2\right>$ $J_{1z} \left|j_1,j_2;m_1,m_2\right> = m_1 \hbar \left|j_1,j_2;m_1,m_2\right>$ $J_{2z} \left|j_1,j_2;m_1,m_2\right> = m_2 \hbar \left|j_1,j_2;m_1,m_2\right>$ and ${J_1}^2 \left|j_1,j_2;j,m\right> = j_1 \left(j_1+1\right) \hbar^2 \left|j_1,j_2;j,m\right>$ ${J_2}^2 \left|j_1,j_2;j,m\right> = j_2 \left(j_2+1\right) \hbar^2 \left|j_1,j_2;j,m\right>$ $J^2 \left|j_1,j_2;j,m\right> = j \left(j+1\right) \hbar^2 \left|j_1,j_2;j,m\right>$ $J_z \left|j_1,j_2;j,m\right> = m \hbar \left|j_1,j_2;j,m\right>$ I read that each set of eigenkets are mutually orthogonal [1] (for eigenkets corresponding to different sets of eigenvalues). This is what I don't understand. In principle it makes sense, but when I plug in numbers I don't get zero for the inner product. For example take the first eigenket: $\left|j_1,j_2;m_1,m_2\right>$. If I choose different eigenvalues for this eigenket (e.g. let $j_1 = 0$ and then let $j_1 = 1$) I get the following: for $j_1 = 0$ I can have: $\left|0,j_2;0,m_2\right>$ for $j_1 = 1$ I can have any of the following, since $\left|m_1\right| \leq j_1$: $\left|1,j_2;-1,m_2\right>$ $\left|1,j_2;0,m_2\right>$ $\left|1,j_2;1,m_2\right>$ If I take the inner-product of the $j_1 = 0$ eigenket with any of the $j_1 = 1$ eigenkets I do not get zero, e.g.: $\left<0,j_2;0,m_2 \mid 1,j_2;-1,m_2\right> = {j_2}^2+{m_2}^2$ which is non-zero unless $j_2 = 0$. What am I misunderstanding here? How do you show that eigenkets with different eigenvalues are orthogonal?
The error is most likely that you are using $$\left<j_1,j_2;m_1,m_2 \mid j'_1,j'_2;m'_1,m'_2\right> = j_1j'_1+j_2j'_2+m_1m'_1+m_2m'_2, \quad \mathrm{(Wrong!)}$$ where you should be using $$\left<j_1,j_2;m_1,m_2 \mid j'_1,j'_2;m'_1,m'_2\right> = \delta_{j_1,j'_1}\delta_{j_2,j'_2}\delta_{m_1,m'_1}\delta_{m_2,m'_2},$$ where $\delta_{k,\ell}$ is the Kronecker delta function. In other words, the $j$'s and $m$'s are not the coefficients $v^i$ of a vector $\vec{v}=\sum_i v^i \vec{e}_i$ in a Hilbert space, where $\vec{e}_i$ is an orthonormal basis, so that $$ \left<\vec{v}\mid\vec{v}'\right> = \sum_i (v^i)^*v'^i, \qquad \left<\vec{e}_i\mid\vec{e}_{i'}\right> = \delta_{i,i'}. $$ Rather, the $j$'s and $m$'s correspond to the $i$-labels of the basis $\vec{e}_i$. For brevity, we often write $\left< i \mid i'\right>$ instead of $\left<\vec{e}_i\mid\vec{e}_{i'}\right>$. Finally, to give a complete answer, let me include my comment above that it is a general property of eigenvectors for different eigenvalues of a Hermitian operator, that they are orthogonal to each other, see e.g., Lubos Motl's answer or here.
1
The error is most likely that you are using $left<j_1,j_2;m_1,m_2
Can I expect my e-mail to be routed securely?
If I connect to my e-mail server via SSL (SMTP/SSL) and the recipient also only checks his e-mail via SSL (web/https or IMAP/SSL), does this - generally speaking - increase the security for the message content in any way? That is, will the communication between my providers e-mail server and the recipients e-mail server be "secure"(*), or will the e-mail be delivered plain text between the servers? (*) Secure in the context of: encrypted throughout it's transit. Not secure in the sense that I'd put any really sensitive info in there.
Also, bear in mind that as email is store-and-forward even if the network link is encrypted in some way, each server in the delivery chain could potentially have stored a copy of the message which would potentially be readable to an administrator. Whether this is likely or not depends entirely on who manages those servers... it might be a small risk in some cases and a huge one in others
1
Email is store-and-forward even if the network link is encrypted in some way
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!"; }
In your while loop, you iterate over all entries in the supplier_stats table. For every iteration, you output "<p>Insurance Expires ! .... You probably do not want to do that. Edit your query to only select the entries that will expire within your range. Example: SELECT * FROM supplier_stats WHERE insurance_date >= yourDateToCompareTo Depending on how you did set up your Database, insurance_date may be of 'MySQL Type DATE or String or even Integer. Depending on that, you have to make the Comparsion to check if the date is close to your expiration range. After your loop (closed by }) you still use the $info in your if ($info['insurance_date'] which will only use the LAST entry in your table. This is however a very, very basic Question and i'd advise you to read up on some very basic beginners tutorials which can be found easily using an internet search engine.
0.777778
In your while loop, you iterate over all entries in the supplier_stats table
Control Fields vs Heap "Mock" Fields for Branching Trigger Behavior
I've seen solutions that talk about adding control fields to allow for clever trigger branching in problems like this. I know that works, but it annoys me (feels architecturally wrong) to create such fields if it can be avoided. I've also seen solutions that have to do with using static variables for a similar purpose, but I have found occasions where one global flag is not good enough because I need the flag per record. I've tried both out and I think I want something in the middle. Something like this: global without sharing class HeapControl { private static Map<Id, Set<String>> recordTags = new Map<Id, Set<String>>(); public static void AddRecordTag(Id rowId, String tag) { if (recordTags.containsKey(rowId)) { Set<String> tagsForThisRow = recordTags.get(rowId); if (!tagsForThisRow.contains(tag)) { tagsForThisRow.add(tag); } } else { recordTags.put(rowId, new Set<String> { tag }); } } public static boolean IsRecordTagged(Id rowId, String tag) { if (recordTags.containsKey(rowId)) { Set<String> tagsForThisRow = recordTags.get(rowId); if (tagsForThisRow.contains(tag)) { return true; } } return false; } @IsTest public static void HeapDemo() { Account a = new Account(Name = 'Testing'); insert a; HeapControl.AddRecordTag(a.Id, 'Control-Field-Name-1'); a.Name = 'Testing2'; update a; // A trigger that fired on Account Update could check the HeapControl for the record like this system.assert(HeapControl.IsRecordTagged(a.Id, 'Control-Field-Name-1')); } } I'd like a pro-con analysis of using real control fields vs mock control fields on the heap (doesn't have to be my code, anything along the lines of static Map<Id, ...>, if you know of a field-tested version of this code please share). In my not-yet-field-tested opinion, the control field concept evolved out of a workflow world, but once you decide to drop down to triggers the heap will serve you better--at least you don't have to create control fields for every little trigger branch. I apologize this isn't standard Q&A format--but this issue has been burning in my mind for months now and I think there are a lot of Salesforce developers (writing business process triggers in particular) that wrestle with this regularly. Thanks in advance for sharing your wisdom and experience!
Is it wise to use system methods when it comes to using static variables for recursive? http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_system.htm Using IsBatch() and ISfuture() context I feel the static variables need to be used to can be minimized Instead of doing public class abc{ if(static_variable == false){ // do something static_variable = true; } } try: public class abc{ if(isBatch() || Isfuture()){ } } Just in case there are multiple batch jobs that are being executed Instead of setting multiple static variable references, this way one check on the class to find if there are batch/future process.
0.666667
Is it wise to use system methods when using static variables for recursive
Can one follow Rabbeinu Tam time for beginning Shabbos?
Does anyone today follow Rabbineu Tam time for the beginning of Shabbos? Reading some tshuvas (e.g. Eretz haTzvi) it is clear this was widespread in Europe. If one has previously been accustomed to accept Shabbos according to the Gra/Baal HaTanya, can one switch to Rabbeinu Tam? (In particular, if one is sure his ancestors did so in Europe, can one revive this minhag after it fell into disuse after migrating to America?)
I have no source, but have heard that when Rav Yoel of Satmar came to America, he and his followers did follow Rabenu Tam. Rav Moshe Feinstein, the story goes, asked him if he could desist, explaining that Americans would follow his own view for the end of Shabas and Rav Yoel's for the start, and Rav Yoel agreed to.
1
Rav Yoel of Satmar came to America and his followers did follow Rabenu Tam .
Noise comparison for sensors the D800 vs the D600
If the main criteria of buying new FX camera for landscape photography is low sensor noise, what camera do you suggest to buy (Nikon): D800 ~2.5k, D600 ~1.7k. Does it make sense to pay extra money for this, if noise is almost the same, if it's true?
I struggle to understand why you would rate low noise over amount of detail as the main criteria for a landscape camera, but if this is the case then there's no reason to pay extra for the D800 as noise performance is very similar when resized to 24MP.
1
Low noise over amount of detail
Custom key binding/mapping
Currently I am starting to develop my first serious game. Before the games are all training, and learning how to do things in a good way. Unfortunatly, I've missed a big part in my preparation: Key binding. Currently I am trying to figure out how I can bind keys to action for each scene in my game. For example: If the user presses the JumpButton during the GameScene, the avatar should jump, but pressing the same key in a MenuScene, the currently selected menuitem should be activated. Which key the JumpButton is, should the user be able to set. But the behaviour should be always the same. Here is my first, and I think very naviive idea: I am having a HashMap with HashMap where Key is the key on the Keyboard and ACTION is just an enumValue. When I am in the scene, and a button is pressed, I will take that button, and ask the HashMap which action is bind to the button. using a switch I can now determine what to do. In my mind there is a little gap.. I have ONE action per Button, maybe named: ACTION_PLAYER_JUMP as an enumValue, and when I am in a GameScene this is okay, but in a MenuScene this ACTION_PLAYER_JUMP is not a very nice name... I do not want to have all bindings two times, just for better names. Can someone tell me how to fix this, or a better system? I am sure there is a much better system for handling those bindings.
Your mapping strategy sounds like it'll work great. The problem you really need to solve is having pretty display names for your enum values. See this question and answer on SO. Essentially, you can switch from a enum or you can use C# properties to save and display additional information about each enum value. Using either option, your dictionary is still going to use some kind of key mapping from a key code to an action. The dictionary is an ideal data structure for this kind of operation.
0.888889
How to switch from a enum to an action
What does the Result property of a windows message mean and when and how to use it?
Result property meaning: Specifies the value that is returned to window in response to handling the message But MSDN does not says anymore: http://msdn.microsoft.com/en-us/library/system.windows.forms.message.result%28v=vs.110%29.aspx I will remark this quote words from the user @Idle_Mind in this question Trying to write a better WndProc Handling: You can set the Result() property to change the way the message is handled. It is just like a winapi function return success value? Zero = true and non-zero = false, or what is? Someone could explain me really what means the value of that propertie, in which circunstances I should need to use this value, and show me a code example of how I can use it handling messages from a wndproc sub? UPDATE: Example of how I'm trying to handle WM_CREATE message... Protected Overrides Sub WndProc(ByRef m As Message) Select Case m.Msg Case &H1 ' WM_CREATE m.Result = -1 End Select MyBase.WndProc(m) End Sub
I depends on the message. According to the API reference it is bound to the specific message. http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950%28v=vs.85%29.aspx E.g.: Return value An application returns zero if it processes this message. http://msdn.microsoft.com/en-us/library/windows/desktop/dd145213%28v=vs.85%29.aspx It can be used as a flag, indicating that the message doesn't need further attendance. If your application handles, i.e. processes the message, a result of 0 will do.
0.666667
Application returns zero if it processes the message
add_action(), add_filter() before or after function
When looking through WordPress snippets/tutorials/plugins I often see add_action() and add_filter() being placed before the function is declared: add_action( 'publish_post', 'email_friends' ); function email_friends( $post_ID ) { $friends = '[email protected], [email protected]'; mail( $friends, "sally's blog updated" , 'I just put something on my blog: http://blog.example.com' ); return $post_ID; } From a logic standpoint this just doesn't make sense to me. Why would you place the function after it is called in your code? This is usually how I would handle the same situation: function email_friends( $post_ID ) { $friends = '[email protected], [email protected]'; mail( $friends, "sally's blog updated" , 'I just put something on my blog: http://blog.example.com' ); return $post_ID; } add_action( 'publish_post', 'email_friends' ); I know both scenarios work, but is there a specific advantage to one or the other? About 90% of the time I see the first scenario being used, so that leads me to believe there is a benefit to this in some way.
It is easier to read: When is what called? If you are debugging a hook you can immediately see if you have to read the function or not: If it is not your hook, you can skip the code. In my themes and plugins I combine all registrations for actions, filters and shortcodes at the top and I add the hook to the PHPDoc block: add_action( 'wp_head', 'foo' ); add_action( 'shutdown', 'bar' ); /** * Foo you! * * @wp-hook wp_head * @return void */ function foo() { print '<!-- foo -->'; }
0.888889
When is what called?
Bottom bracket bearing Issues
Been having some bottom bracket (BB) woes. Noticed a click on the top of the left pedal stroke decided to re-grease the BB. Took it apart cleaned everything re-greased, put it back together. Roll forward a week. Notice my cranks sticking here and there, gets progressively worse on the ride. Get it home and off the bike notice my bike has turned into a rain-stick (this provided no calming effect) Que another strip down of the BB. Upon inspection, I found all the bearing on the non lockring side of the where out of the cage, which now would no longer hold them. I pinched the cages with pilers to secure the ball bearings back in place. Re-greased repacked. Lifted my bike out today for my cycle to work jingle-jingle; LOOSE BEARING! Cycle to work was sub 3miles so risked it. Want to take care of this ASAP, so my questions are: 1. I figure I am over-tighting the bottom bracket, causing the damage to the cage, however what else could cause? BB info: Campagnolo Italian threaded plastic sleeve is in two parts, the smaller part pushes into the other. 2 caged bearings from memory 8/9 bearings in each cage. Two screw in cones one locking. here is a pics of my spindle: Brev whatever that means 2. What size bearing does an Italian threaded BB take?
Take everything apart,get all the grease out of the bb and feel inside where the bearings go,it should be fairly smooth,do this to both sides and compare the "feel" of each..If it doesn't feel right(burrs,cracks) there's your problem...I just replaced the bearings in my bike and they were 1/4 inch but your bearings will probally be metric in that general size,it's easy enough to find online...don't skimp on the bearings,get grade 25 bearings,there the best...amazon has them for short money and good luck
0.666667
Compare the "feel" of the bb bearings
How to delete duplicate solutions of this system of equations?
I want to find vertices (has integer coordinates) of the triangle $ABC$ with the centorid is $G(1,1)$ and orthocenter is $H(3,3)$. I tried a = {x1, y1}; g = {1, 1}; h = {3, 3}; b = {x2, y2}; c = {x3, y3}; Solve[{x1 + x2 + x3 == 3 g[[1]], y1 + y2 + y3 == 3 g[[2]], (h - a).(c - b) == 0, (h - b).(c - a) == 0, -20 < x1 < 20, -20 < y1 < 20, -20 < x2 < 20, -20 < y2 < 20, x2*y3 - x1*y3 + x1*y2 - y2*x3 + y1*x3 - y1*x2 != 0}, {x1, y1, x2, y2, x3, y3}, Integers] There are some duplicate triangles. How to delete this duplicate triangles?
I am not certain I understand, but starting with sols = Solve[ . . . ] does this help?: {{x1, y1}, {x2, y2}, {x3, y3}} /. sols; Union[Sort /@ %] {{{-17, 7}, {7, -17}, {13, 13}}, {{-11, 3}, {7, -9}, {7, 9}}, {{-9, -3}, {3, 9}, {9, -3}}, {{-9, 7}, {3, -11}, {9, 7}}, {{-5, -5}, {1, 7}, {7, 1}}, {{-3, -9}, {-3, 9}, {9, 3}}, {{-3, 3}, {3, -3}, {3, 3}}}
1
Solve = Solve
Wordpress - Custom taxonomy page of custom post type listing by terms
I have a taxonomy-taxonomy.php page that needs to look like so: CUSTOM POST TYPE TITLE (RESOURCES) Custom Taxonomy 1 (Resource Types) Resource Type Term 1 (White Papers) White Paper post 1 White Paper post 2 White Paper post 3 Resource Type Term 2 (Videos) Videos post 1 Videos post 2 Videos post 3 Tried to make sense of all the new documentation for Wordpress 3.0, but it only made me more confused as it seems to be mixed up with 2.8.
It's not necessary to transform the object to an array, you can perfectly work with the object without too much hassle. What is curious (at least for me), is that you get something like this: Array ( [0] => stdClass Object ( [term_id] => 7 [name] => Magister comunicaciones aplicadas [slug] => magister-comunicaciones-aplicadas [term_group] => 0 [term_taxonomy_id] => 7 [taxonomy] => linea-de-estudio [description] => [parent] => 0 [count] => 4 ) [1] => stdClass Object ( [term_id] => 8 [name] => Engagement marketing [slug] => engagement-marketing [term_group] => 0 [term_taxonomy_id] => 8 [taxonomy] => linea-de-estudio [description] => [parent] => 0 [count] => 5 ) ) It's basically, an array of objects, so you've to treat them that way. For example if I want the name of the the first one: $myterms = get_terms('taxonomy-name', 'orderby=none&hide_empty'); echo $myterms[0]->name; If you need to iterate through the elements, you still can use foreach();. foreach ($myterms as $term) { ?> <li><a href="<?php echo $term->slug; ?>"><?php echo $term->name; ?></a></li> <?php } ?> That way you can post the articles from your taxonomy. For the custom post types, you'll have to create a loop like this: $args = array( 'post_type' => 'post-type-name', 'taxonomy' => 'term' //for example //'resources' => 'videos' ); // assigning variables to the loop global $wp_query; $wp_query = new WP_Query($args); // starting loop while ($wp_query->have_posts()) : $wp_query->the_post(); the_title(); blabla.... endwhile; Then you can create multiple loops each of one for each taxonomy/term :). If you want to get even more fancy (don't want to repeat yourself a hundred times) you can include the second loop inside the first one and assign variables to the taxonomy (resources ie) and the terms it has (videos) (from your example only the last one). The idea is that you would have a normal (typical) wordpress loop restricted to the custom post-type and each one of the terms. foreach ($myterms as $term) : ?> <li><a href="<?php echo $term->slug; ?>"><?php echo $term->name; ?></a></li> <?php $term_name = $term->slug; $args = array( 'post_type' => 'post-type-name', 'taxonomy' => "$term_name" ); // assigning variables to the loop global $wp_query; $wp_query = new WP_Query($args); // starting loop posting only while ($wp_query->have_posts()) : $wp_query->the_post(); the_title(); blabla.... endwhile; endforeach; ?> Obviously you can do the inverse thing too, create the normal loop for a single-template custom type (it's looks like you have only one), and inside includes all the custom terms. Not very elegant, but that's the best way I can came up with it :P. Hope that someone can understand this, sounds confusing. Maybe could it be possible with some callback function?.
0.444444
How to transform an array to a custom array?
Should I include high school details in Grad School Resume?
I was wondering if I should include my high school details in the resume of my graduate school application ? It's unclear about this bit since we are not actually submitting any proof of high school records during grad school application( they only ask for undergraduate details). But my high school final examination details are particularly good (better than my undergraduate credentials infact!)
I have to disagree slightly with the stark "No" answers. Only when those details provide evidence of your potential for research. Some information about your high-school experience may shed light on your research potential. Certainly you would want to mention winning the Intel Science Talent Search or the International Olympiad in Informatics, or describe the peer-reviewed research papers you published as a high school student. But your high school grades? No, leave them off.
1
What is your high-school research potential?
hadoop complains about attempting to overwrite nonempty destination directory
I'm following Rasesh Mori's instructions to install Hadoop on a multinode cluster, and have gotten to the point where jps shows the various nodes are up and running. I can copy files into hdfs; I did so with $HADOOP_HOME/bin/hdfs dfs -put ~/in /in and then tried to run the wordcount example program on it with $HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar wordcount /in /out but I get the error 15/06/16 00:59:53 INFO mapreduce.Job: Task Id : attempt_1434414924941_0004_m_000000_0, Status : FAILED Rename cannot overwrite non empty destination directory /home/hduser/hadoop-2.6.0/nm-local-dir/usercache/hduser/appcache/application_1434414924941_0004/filecache/10 java.io.IOException: Rename cannot overwrite non empty destination directory /home/hduser/hadoop-2.6.0/nm-local-dir/usercache/hduser/appcache/application_1434414924941_0004/filecache/10 at org.apache.hadoop.fs.AbstractFileSystem.renameInternal(AbstractFileSystem.java:716) at org.apache.hadoop.fs.FilterFs.renameInternal(FilterFs.java:228) at org.apache.hadoop.fs.AbstractFileSystem.rename(AbstractFileSystem.java:659) at org.apache.hadoop.fs.FileContext.rename(FileContext.java:909) at org.apache.hadoop.yarn.util.FSDownload.call(FSDownload.java:364) at org.apache.hadoop.yarn.util.FSDownload.call(FSDownload.java:60) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) How can I fix this?
I had the same error with the /hadoop/yarn/local/usercache/hue/filecache/ directory. I've done sudo rm -rf /hadoop/yarn/local/usercache/hue/filecache/* and it solved it.
0.888889
/hadoop/yarn/local/usercache/hue/filecache
Modifying Local Within Function Changes Global Passed to Function in Python
I am trying to understand why the global copy of an object passed to a function is modified by the function. I understand that if I assign an object mylist to a second variable name, it does not make a copy and modifying the second object changes the first because they are one in the same. For example: mylist = [] s = mylist s.append(2) print(mylist) [2] However, I did not think this occurred within a function unless made explicit with global varname. As this answer puts it, "If you want to simply access a global variable you just use its name. However to change its value you need to use the global keyword." This is how the function mult below behaves (though I am not modifying x but assigning a new value to it). However, when I pass a global variable to either app or noreturn, in both instances the global variable is modified by the function without a declaration that I want to modify the global variable with a global keyword. import pandas as pd def mult(x): x = x * x return x def app(mylist): mylist.append(4) return mylist def noreturn(df): df['indexcol'] = list(df.index) df = pd.DataFrame({"A": [10,20,30,40,50], "B": [20, 30, 10, 40, 50], "C": [32, 234, 23, 23, 42523]}) print(df) A B C 0 10 20 32 1 20 30 234 2 30 10 23 3 40 40 23 4 50 50 42523 noreturn(df) print(df) A B C indexcol 0 10 20 32 0 1 20 30 234 1 2 30 10 23 2 3 40 40 23 3 4 50 50 42523 4 x = 3 mylist = [] y = mult(x) newlist = app(mylist) print(x, y) (3, 9) print(mylist, newlist) ([4], [4]) If I want a function that does not modify global variables do I need to use copy.deepcopy on every variable passed to the function?
Your quote says: If you want to simply access a global variable you just use its name. However to change its value you need to use the global keyword. I would modify that to: If you want to simply access the object a global variable refers to, you just use its name. However to change what object it refers to, you need to use the global keyword. Accessing a global object can include changing things about the object (such as appending a new object to an existing global list). However, if your function tried to do: def app(mylist): mylist = mylist + [4] return mylist which attempts to change the global mylist reference (by creating a new object and assigning the result to mylist), then you would need to use the global keyword.
0.777778
To access a global variable you just use its name
Full height & width, fixed header, full content height with CSS
I have been searching for this on SO, but I just could not find something exactly similar. What I am trying to achieve is to have a page, that is full in height and in width, but does have a fixed header. The content height needs to be the remaining area left, but that area needs to have a height of 100%, most of the html code found on SO is just using height: auto. Basically I want to do this so that I can style it: adding border etc. Here's the code so far: <html> <head> <title>Test</title> <style type="text/css"> body, html { height:100%; } body { margin:0; padding:0; } #header{ height:50px; background:green; width:100%; } #wrapper { background:blue; position:relative; min-height:100%; height:auto !important; height:100%; } #content { margin: 10px; background-color: black; height: 100%; width: 100%; border: 3px dashed gray; } </style> </head> <body> <div id="wrapper"> <div id="header">header</div> <div id="content"></div> </div> </body> </html>
See: http://jsbin.com/agiyer Note that if the content is too tall to fit inside #content, it will simply be hidden. HTML: <div id="header">header</div> <div id="content">content</div> CSS: #header { position: absolute; top: 0; left: 0; right: 0; height: 50px; background: green } #content { position: absolute; top: 50px; left: 0; bottom: 0; right: 0; border: 3px dashed gray; background: #ccc }
0.777778
if the content is too tall to fit inside #content, it will simply be hidden
IRS2003 half bridge driver
I am fairly new to half bridge drivers and understand the concept of a full bridge. I was looking at building a basic full bridge using 2 half bridge drivers, the driver IC's I was going to use were the international rectifier IRS2004 (datasheet can be found here http://www.irf.com/product-info/datasheets/data/irs2004pbf.pdf). However the college will have issues ordering them due to USA stock so extra carriage, so I have been looking at the IRS2003 (datasheet can be found here http://www.irf.com/product-info/datasheets/data/irs2003pbf.pdf) This seems like it will do the task, but I am struggling to understand the timing diagram and the benefit of having the LIN input out of phase by what looks like 180 degrees. The datasheet states: My understanding is that if I want to use the irs2003 in a similar fashion to the irs2004 (minus the ShutDown input) , I Feed the same PWM signal into both the HIN and LIN pins?
Your analysis appears to be correct. Tying the IRS2003 inputs together and driving them with a single PWM signal should provide similar functionality to the IRS2004 single input device, per the hyperlinked datasheets. The discrete inputs on the IRS2003 gives you the flexibility to manually adjust the deadtimes higher than what's provided by the IC itself, and give you complete phase control over the outputs.
0.777778
Adding the IRS2003 inputs together with a single PWM signal should provide similar functionality to the IRS2004 single input device
Molarity exercises
Can anyone direct me to a good book with lots of molarity exercises, i really want to practice this and would like to find as many types of exercises involving molarity. I of course did google this and there are some, but usually they are three or four exercises per resource. Thanks in advance.
U can try rc mukherjee,an indian author for preliminary level.and schaum publishers for higher level.
0.666667
U can try an indian author for preliminary level.
unique in .hbm.xml file not raising exception
I am having the following in my .hbm.xml file <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Core.Domain.Model" assembly="Core"> <class name="Category" table="Categories" dynamic-update="true"> <cache usage="read-write"/> <id name="Id" column="Id" type="Guid"> <generator class="guid"/> </id> <property name="Name" length="100"> <column name="Name" unique="true" index="IX_Category"/> </property> </class> </hibernate-mapping> I am having the following code, however, I can see that no exception is being raised when I am inserting a duplicate value for the Name field. Why is that so? void IRepository<Category>.Save(Category entity) { using (var scope = new TransactionScope(TransactionScopeOption.Required)) { using (ISession session = NHibernateHelper.OpenSession()) { using (ITransaction transaction = session.BeginTransaction()) { session.Save(entity); transaction.Commit(); } } scope.Complete(); } }
The unique attribute is only used when generating a DDL schema from a mapping (hbm). If you want to check uniqueness with NHibernate, it is data validation and you should look NHibernate validator. And as Rafael said you have to write your own validator. You can also check the natural-id element. Unless you absolutely need to validate uniqueness on application side, this sample and this one make me think it may be better to let the database do this job.
1
Unique attribute is only used when generating a DDL schema
Any omitted word in this sentence?
The dark guy took a week to fall down. He stumbled, caught himself, waved one arm, stumbled again. His hat fell off, and then he hit the floor with his face. After he hit it he might have been poured concrete for all the fuss he made. I just guess the guy fell on the floor (by a gun-shot) wouldn't move like a concret cast??? Any missing word in this sentence, like a preposition? It's a part of Red Wind by Raymond Chandler.
Yes, "might have been poured concrete" does mean that he was immobile like a poured-concrete cast. The sentence could use a comma: After he hit it, he might ... Also the part “been poured concrete” seems odd. I was half expecting it to end “... he might have been poured out and shaken up for all he could remember.” In other words, coming after been, I tended to parse poured as a verb at first; its use as an adjective threw me briefly. But I can't think how one would improve that except by being more verbose, as in: ... have been made of poured concrete ... That's two missing words, rather than one, and it seems to weaken the directness of the author's style.
0.888889
"might have been poured concrete" does mean that he was immobile like a cast
Unreachable IP on local subnet
I have a network printer at 192.168.2.101 that I can reach just fine with other machines on my network (ping and access the printer web server). For some reason I can't access the printer from my Ubuntu machine--pings return host unreachable. I'm running Ubuntu 11.04 ifconfig eth1 Link encap:Ethernet HWaddr 38:59:f9:c4:52:a9 inet addr:192.168.2.11 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::3a59:f9ff:fec4:52a9/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:167828 errors:0 dropped:0 overruns:0 frame:2000398 TX packets:116132 errors:16 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:213283954 (213.2 MB) TX bytes:15552076 (15.5 MB) Interrupt:16 Edited Oct/20/2011 I've added the requested diagnostics below. Any hints in here? ip route show $ ip route show 192.168.2.0/24 dev eth1 proto kernel scope link src 192.168.2.11 metric 2 169.254.0.0/16 dev eth1 scope link metric 1000 default via 192.168.2.1 dev eth1 proto static traceroute $ ip route show 192.168.2.0/24 dev eth1 proto kernel scope link src 192.168.2.11 metric 2 169.254.0.0/16 dev eth1 scope link metric 1000 default via 192.168.2.1 dev eth1 proto static netstat $ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth1 Edited Nov/2/2011 After a bit more digging it appears this might be an issue with MAC address translation. arp yeilds $ arp Address HWtype HWaddress Flags Mask Iface 192.168.2.101 (incomplete) eth1 192.168.2.1 ether 00:17:3f:90:cd:93 C eth1 I've tried adding a static entry, per this post Add static ARP entries when network is brought up, but the result is the same. Any thoughts?
The output of netstat -rn should show something like: $ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.100.1 0.0.0.0 UG 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 You should have all 3 lines - a default route, a link local route, and a local subnet route.
0.888889
Netstat -rn Kernel IP routing table
Why is the limit of this root the absolute value
Define $$ h_n (x) = x^{1 + {1 \over 2n - 1}}$$ for $x \in [-1,1]$. Why is $\lim_{n \to \infty} h_n(x) = |x|$? I know that for $C > 0$ it holds that $$ \lim_{n \to \infty} C^{1\over n} = 1$$ but I don't know why the other limit should hold. Especially not $$ \lim_{n \to \infty} C^{1\over n} = -1$$ if $C < 0$.
Note that $h_{n}(x)=x\cdot x^{1/(2n-1)}$, and since $n$ is a natural number, this is an odd root of $x$. In particular, it preserves the sign, since $$(-x)^{1/r}=-x^{1/r}$$ is true iff $r$ is odd (for a proof, raise both sides to the power $r$). So when $x\ge0$ you have seen the result is obviously true, and if $x<0$ we can apply the above result.
0.777778
$h_n(x)=xcdot x1/(2n-1)$ is true
Why do some people wrap their Tefilin around their arms 8 times?
I have seen people who wrap the Tefilin 7 times around their arm and some that wrap it 8 times around their arm. Why do the people who wrap it 8 times do so?
I don't know about 8 times, but the Shulchan Aruch OC 27:8 says ונוהגין העולם לכרוך על הזרוע ששה או שבעה כריכות The custom is to wrap [the strap] around the forearm 6 or 7 times. It seems not only that we should be discussing 6 or 7 and not 8, but also that the exact number doesn't really matter.
0.888889
The custom is to wrap the strap around the forearm 6 or 7 times
SASS Index in nested list
I'm trying to get the index of an item in a nested SASS list — by the first property. But the only way i can get a result is to include both properties in the item. Is is doable with native SASS, or would it require a mixin/function? And any input to how i would do that? The code i got: $icons : ( 'arrow--down--full' '\e806', /* '' */ 'cog' '\e805', /* '' */ 'info' '\e807', /* '' */ 'arrow--down' '\e800', /* '' */ 'arrow--left' '\e801', /* '' */ 'arrow--right' '\e802', /* '' */ 'arrow--up' '\e803', /* '' */ 'close' '\e804', /* '' */ 'search' '\e804', /* '' */ 'spin' '\e809' /* '' */ ); And my lookup //Working index($icons, 'search' '\e804'); //Not working, but what i want to achieve index($icons, 'search');
@cimmanon answered this: http://stackoverflow.com/a/17004655/786123 @function find-value($list, $key) { @each $item in $list { @if ($key == nth($item, 1)) { @return nth($items, 2); } } @return false; }
0.666667
@cimmanon answered this:
What is the cardinality of the family of unlabelled bipartite graphs on n vertices?
I have attempted to calculate the number of unlabelled bipartite graphs as follows: Let $G = (V_1, V_2, E)$ be a bipartite graph on $n$ vertices with $|V_1| = m$ and $|V_2| = n-m$. Assume without loss of generality that $|V_1| \leq |V_2|$ so $m \leq \left\lfloor \frac{n}{2} \right\rfloor$. If $G$ is complete bipartite then it has $m(n-m)$ edges since each of the vertices in $V_1$ is connected to each in $V_2$. Thus, the total number of bipartite graphs with parts of size $m$ and $n-m$ is $2^{m(n-m)}$. In order to find the total number of possible bipartite graphs on $n$ vertices we sum over all possible $m$: \begin{align} \sum^{\left\lfloor \frac{n}{2} \right\rfloor}_{m=1} 2^{m(n-m)} \end{align} However, I notice that I have counted labelled bipartite graphs where I need the number of unlabelled graphs. I'm struggling to see how to account for this.
In the formalism of species of structure. The species $Bip(X,Y)$ of bipartite graphs on two sorts of vertex $X$ and $Y$ can be described as, $$ Bip(X,Y) \simeq E^2 \circ (E^\bullet(X) E^\bullet(Y)) \simeq E^2 \circ (XY E(X + Y)) $$ where $E$ is the species of sets, $\circ$ is the functorial composition of species and $\bullet$ is the pointing operator. If I make no mistake the series you search is, $$ Bip(x,y) = \prod_{k \ge 1}\exp\left[\frac{2}{k}x^ky^k\prod_{l \ge 1} \exp\left(\frac{1}{l}(x^{kl}+y^{kl}) \right)\right] $$ Hope this helps. Edit : Doing the computations I find, \begin{align*} Bip(xt,yt) &= 1+2xy{t}^{2}+ \left( 2y{x}^{2}+2{y}^{2}x \right) {t}^{3}+ \left( 5{y}^{2}{x}^{2}+2y{x}^{3}+2{y}^{3}x \right) {t}^{4} + ... \end{align*} which is wrong. For example we should have $x^2 + y^2 +2xy$ in front of $t^2$, a $xt$ term as well as a $yt$ term..
1
Bipartite graphs on two sorts of vertex $X$ and $Y$
Force exerted on potential wall
A particle bound in an infinite potential wall at $x=0$ will apply a force on the wall. For a plane wave and imagining it as a fluid bouncing off the reflection wall at $x=0$, find the force in terms of $\phi'(0)$, the derivative of wave function at $x=0$. We know, for a reflecting fluid, $\textrm{force }= \frac{dp}{dt}$, where $p$ is momentum. Classically, $p=mv$. In our case, $v$ is $\hbar k/m$, the velocity of the plane wave. Instead of mass, we have $|\phi|^2dx$, the probability of finding the massive particle in an interval $dx$. So $p= \frac{\hbar k}{m}|\phi|^2 dx$. Then, force $f=\frac{dp}{dt} =\frac{d(|\phi|^2 dx \hbar k/m)}{dt}$ By the continuity equation, $\frac{d(|\phi|^2)}{dt}=-\frac{dj}{dx}$, where $j$ is probability current = $\hbar k/m |\phi|^2$. So $f=\frac{dp}{dt}=\left(\frac{\hbar k}{m}\right)^2 \frac{d(|\phi|^2)}{dx} = \frac{\hbar k}{m} 2 \phi \phi' dx$. But for infinite potential, $\phi(0)=0$, so this gives 0. So I have an unwanted $\phi$ and a pesky $dx$ in my problem. I'm stumped for days, I'd appreciate all help. I'm fairly sure I should be getting an answer of force ~ $\phi'(0)^2$.
Your answer gets derailed at the point where you try to apply the two classical equations $$p=mv\textrm{ and }F=\frac{dp}{dt}$$ to this (very) quantum problem. To see why this is fundamentally flawed, notice that the plane-wave situation you consider (not exactly a plane wave, though: it's two counter-propagating plane waves) is a stationary state, so that all time derivatives are zero. You then make a couple of slips that get you badly off track. Equating $p=\frac{\hbar k}{m}|\phi|^2 dx$ can't be right since it's a finite quantity equal to an infinitesimal. Though in this particular situation the equation $j=v|\phi|^2$ kind-of holds (instead of the actual current, $j=\frac{\hbar}{2im}\left(\phi^* \frac{d\phi}{dx}-\phi \frac{d\phi^*}{dx}\right)$), here you must add the currents of left- and right-going particles to get $j=0$. The right approach to this problem needs a fundamental re-think of what we mean by force in this context, and indeed in all of quantum mechanics, where energy is a far more fundamental concept than force (which becomes merely the gradient of the potential). Suppose the wall slipped to the left a small amount $\Delta x$, over a long time. What would be the work done by the particle on the wall? This work would then have to come from the particle's (purely kinetic) energy. How would that change with the slight enlargement of the box?
1
How to apply the two classical equations to this (very) quantum problem
What is it called when a music has two concurrent tempos
I've recently watched a BBC documentary about the history of music and recall an episode where they talk about music that has two distinct tempos (and possibly time signatures) at the same time for different sets of instruments. Still, I can't remember how this is called and who are the famous composers that composed that way (Stravinsky?).
Neilsen's 5th symphony was an early example (1922). Towards the end of the first movement, the side drum part is in a different tempo and time signature from the rest of the orchestra. The first edition of the score instructed the drummer to "improvise as if at all costs he wants to stop the progress of the orchestra". In a later edition that instruction was replaced by a written part which breaks off with the direction "cadenza ad lib". Skip to about 14:45 here: (There is also an important side drum part in a more "conventional" rhythm earlier in the piece.
1
Towards the end of the first movement, the side drum part is in a different time signature from the rest of the orchestra
Clustering algorithm and distance function for sets
I am willing to run a clustering algorithm on data records consisting in sets each one representing the features enabled at a certain time. Is there any clustering algorithm you would recommend me to try out? In my first tests I'm experimenting with K-means, but maybe there is something more suitable. Is there any distance function that works well with sets? I guess that there is something better than the Euclidean distance but I don't have may clue on how the better metric could look like.
You can convert set information to binary vectors (0/1 for presence/absence of a feature), then use a binary metric (e.g. Jacard, Tanimoto, Russell-Rao, Skal-Sneath, Yule metric) to cluster your data. I would try to pick a good visualization tool to explore the results and decide which algorithm/metric is the best for the data/problem.
0.555556
Using a binary metric to cluster your data
check if bottom reached method of scrollview
I have the this code and I get 2 error on line with getChildCount() and on the last line. protected void onScrollChanged(int l, int t, int oldl, int oldt) { // Grab the last child placed in the ScrollView, we need it to determinate the bottom position. View view = (View) getChildAt(getChildCount()-1); // Calculate the scrolldiff int diff = (view.getBottom()-(view.getHeight()+view.getScrollY())); // if diff is zero, then the bottom has been reached if( diff == 0 ) { // notify that we have reached the bottom Log.d("Hier", "MyScrollView: Bottom has been reached" ); } super.onScrollChanged(l, t, oldl, oldt); }
Generally on scroll changed work on ListView.. So GetChildView() will not work as you are calling in the listener of listview You can try this method outside of your listener and use the value inside the listener...
0.666667
GetChildView() will not work as you are calling in Listener of Listview
Does "so far, so good" carry a negative connotation?
As a follow up to this etymology question, does "so far, so good" carry a negative connotation? For example, after having her sonogram, my wife asked the technician if everything was okay. The technician replied, "so far, so good." My wife later remarked that she didn't like that the technician used the phrase because it sounded like things will be going wrong later. I always thought this phrase was positive and that it was a replacement for the word "good."
"So far so good" means that things are "fine" in the up-to-now sense of the word. What your wife found missing in the phrase was an "all clear" for the future.
1
"So far so good" means that things are "fine"
Why did they choose Barabbas?
John 19:38 - 40 (NLT) 38 “What is truth?” Pilate asked. Then he went out again to the people and told them, “He is not guilty of any crime. 39 But you have a custom of asking me to release one prisoner each year at Passover. Would you like me to release this ‘King of the Jews’?” 40 But they shouted back, “No! Not this man. We want Barabbas!” (Barabbas was a revolutionary.) Why were they so messed up that they would choose the rebellious, murderous Barabbas over the innocent Son of God?
John 12:12-13 (KJV) 12On the next day much people that were come to the feast, when they heard that Jesus was coming to Jerusalem, 13Took branches of palm trees, and went forth to meet him, and cried, Hosanna: Blessed is the King of Israel that cometh in the name of the Lord. When Jesus came into Jerusalem on Palm Sunday, the people welcomed Him as a deliverer from the oppression of Rome. They cried, "Hosanna!" which means "Save us!" They threw down palm branches, which since the time of the Maccabean revolt had been a Jewish symbol of victory (see section "3. Palm Branches" from Bible Encyclopedia and 1 Maccabees 13:51). John 12:14-15 (KJV) 14And Jesus, when he had found a young ass, sat thereon; as it is written, 15Fear not, daughter of Sion: behold, thy King cometh, sitting on an ass's colt. This prophecy is from Zechariah 9:9, and if you read the entire passage, you can see again what the Jews expected: a Messiah that would drive out their oppressors and be a physical savior. Why did the Jews choose Barabbas instead of Jesus mere days after they welcomed Him so strongly? The other answers correctly point out that the chief priests and elders stirred the crowd against Jesus. However, the people were able to be swayed because their expectations were disappointed. Jesus didn't ride into Jerusalem on a battle charger, accepting a crown and forming an army to defeat Rome. Instead He came humbly, on a donkey, and He came not to conquer Rome, but to conquer death and sin through His sacrificial death.
0.888889
Why did the Jews choose Barabbas instead of Jesus just days after they welcomed Him?
Networking Questions: Serialization and Frequent Small Packets or Fewer Large Packets
I'm working with a socket server and I'm trying to decide how to update all of the clients. I'm currently sending few packets with entire objects serialized in JSON. In most cases this adds a lot of overheard in the form of unneeded data. This to me is a no brainer, get rid of the serialization and send only what is needed. Lets say I have four server-side AIs. Should I send all four of the AIs in one giant update, therefore serializing only the needed data or should I send each one in a separate update?
When you send small messages, you have to be aware of the protocol overhead: Imagine you are sending a 10 byte message. A TCP header is 24 bytes, an UDP header is 8 bytes. Assuming you use UDP, you have 18 bytes in total. But you also have the IP header, which is at least an additional 20 bytes in IPv4 or 40 bytes in IPv6. That's 38 bytes in total when you use IPv4. And then you also have the ethernet frame around all that, which is (usually) another 42 bytes. So you are at 80 bytes. That's 7 times as much protocol overhead as the data you were sending. As you see, sending small data messages is not very bandwidth-efficient because there is a fix-cost of 70 bytes of protocol overhead for each message. to visualize this better, seventy bytes is as much data as this string But delaying small messages just so you can send more at the same time is often not a good idea either, because this will make the game feel more laggy. There is no golden hammer solution to finding the ideal compromise for this. But all data which is available at the same time should be sent in one message instead of separating it into multiple. There is nothing to gain and a lot to lose by adding unnecessary fragmentation on the application level. (Image source: http://en.wikipedia.org/wiki/File:UDP_encapsulation.svg)
0.888889
When sending small messages, you have to be aware of the protocol overhead .
Why do the Borg have physical computer interfaces?
I was watching Scorpion (VOY) parts 1 and 2 last night and a thought struck me: sure, their computer interface looks pretty cool, but why do they have a physical interface (i.e. they tap the screen physically) in the first place? It's made quite clear that they can interface with each other through mental transceivers and they make a big deal about thoughts being a more efficient communication method than verbal communication in Scorpion Part 2 with Tuvok and Janeway. Therefore, wouldn't a mental interface with a computer be more efficient? Surely, then, they could have the drones in their stations for most of the time, just thinking to interact with the computer rather than having to tap their way through an interface. Is there any reason given for this? And, although I only recall seeing 7 of 9 using the computer via physical interaction in Scorpion, there are plenty of instances in other episodes where other drones also use physical interaction with the computer.
1) Efficiency of Assimilation - As mentioned by MarvelX42, when assimilating a ship that uses screens, it makes sense to just keep using those screens rather than to re-program the whole ship to bypass them. This is especially compelling since we see "Borg consoles" much more often on assimilated ships, like the Enterprise-E, than on native Borg constructs, like the Cubes, where Drones are more commonly locked into their docking stations. However, there are three other considerations that may be relevant: 2) Security - The Borg have been shown to be a powerful force, but they have still been hacked before, sometimes to disastrous effect. There may be a certain amount of security in having certain significant functions, like propulsion and weapons, require a physical presence at a console. That way, an errant Drone or an outside influence cannot gain complete control remotely. 3) Efficiency and Decentralization - It may be more efficient to have Drones perform certain functions physically, rather than devote bandwidth and processing power that could be used for more difficult operations. It's impossible to say without examining the exact technical setup of the Collective, but it may be that their mental network is reserved for communication, analysis, and forming a consensus, while the trillions of commands for controlling equipment aren't processed through the Collective at large. Therefore, the Collective decides where a ship should go, and then a Drone inputs the commands into the ship manually so as not to clutter up the data stream with the nitty-gritty details of execution. 4) Cybernetic Compatibility - It is easy to think of the Borg as a purely mechanical, computerized race, but we are reminded over and over that their biological components are equally important. It may very well be that their biological halves are why the consoles remain necessary. The Borg are obviously VERY well-integrated with their ships, facilities, and tools, but that integration may not be perfect, so it may not be entirely possible to control a ship, especially an assimilated ship built by others, by thought alone. Whatever prevents the Borg from making purely-robotic Drones may be preventing them from fully interfacing with their ships as well. It's impossible to say for sure, but I think between those four answers, we've probably got a rough understanding.
1
Efficiency of Assimilation - When assimilating a ship that uses screens, it makes sense to keep using those screens rather