summary
stringlengths
15
147
text
stringlengths
1
19.3k
answer
stringlengths
32
22.6k
labels
float64
0.33
1
answer_summary
stringlengths
5
164
Do Americans pronounce "Ellen" and "Alan" in the same way?
Do Americans pronounce "Ellen" and "Alan" in the same way? I am especially concerned with the first vowel. EDIT: Here is a quote that may be a case in point: Being a Brit also, the names "Ellen" and "Alan" tend to sound the same when spoken with an American tongue. It was just unfortunate that the child was very tom boyish and had an ambiguous sounding name Context: discussion on why they chose a boy-looking girl for the movie "Fatal Attraction" Link: http://www.imdb.com/title/tt0093010/board/thread/186160978?d=186229310&p=1#186229310
Ellen /ɛlən/ (with variant Helen) is pronounced with an /ɛ/. This is the vowel found in SET and FELL. Alan /ælən/ (with variants Allan and Allen) with an /æ/. This is the vowel found in CAT and PAL. But the vowels /ɛ/ and /æ/ are admittedly fairly close in sound, and can be difficult to differentiate for those who don't use both vowels in speech. This may be where your confusion lies. As you can see on this general American vowel chart, they are very close to each other on the lower left. EDIT: To the specific point in your question, "Being a Brit also, the names 'Ellen' and 'Alan' tend to sound the same when spoken with an American tongue" - well, that IMDB commenter from somewhere in the British Islands (an area with hundreds of dialects) may not hear the difference - but Americans certainly pronounce the difference.
1
American vowel chart: 'Ellen' and 'Alan' tend to sound the same when spoken with an American tongue
Need a software backup solution with specific features
I'm going to be formatting my machine in the next couple of days. I finally got Windows 7 set up how I like it and decided on a suite of software that I will be installing after each format. Since I tested a bunch of programs and the Windows installation is full of Junk, a clean install is needed. After I reinstall Win7 along with all the other software, I want to make a Drive Image so I can at any time go back to that exact setup. In the past I used Clonezilla. I would have it backup the entire drive, compress it, and then transfer it to a network store. This process is a pain in the butt though. It also ends up taking up too much space since Clonezilla uses dd and dd does not care what filesystem you are using. It makes a copy of the drive sector by sector. It doesn't know where a file ends or free space begins. This is what I am looking for this time around... (I don't care if its Open Source or Commercial, although free alternatives are always nice). Does not include Unused Space in the drive image Backs up the MBR and any other absolutely necessary information so the system goes back to exactly the way it was when it was backed up. I don't want to be worried that I have to repair the MBR or deal with other booting issues. Can write the image to multiple DVDs AND to a network share. This means that it has to be able to split the backup. Does not need Windows to work. It has a bootable disc version of the program in case I can't get into Windows and need to restore the backup. Preferably makes the initial backup DVD (Disc 1) also the boot disc. So I can insert disc 1 into the computer, restart, and it will allow me to begin restoring the image to the drive. It would only ask for Disc 2 after it restored everything from the disc it booted from. Loads itself into RAM, does not need to have the disc in the drive to function. Supports NTFS (This should be pretty obvious). Allows me to view the image file in a file editor and make changes in case I want to add/remove anything. (I don't care if this is only possible on the single file Network Backup and I have to recreate the DVDs. The bootable version does not need this). I am going to be using this software only to image the drive. It will not be my daily/weekly/monthly backup solution. Therefore I don't want the imaging to force me into some backup schedule. If I have to force it to not make automatic backups after the initial image, I don't want it. Is reliable, you would use it, makes consistently good images. I guess that's it. Hopefully someone here knows of a program that does all this. I have been looking at various backup solutions and have not found something that I have really been happy with.
windows 7 has a backup tool that makes bootable cds, or will work with a readily available recovery boot disk iirc. Otherwise pretty much any decent imaging software, like macrium reflect free will do most of what you need, other than running in ram.
0.666667
Windows 7 has a backup tool that makes bootable cds, or will work with a readily available recovery boot disk i
Electric current of inductor
I have a homework problem that was solved by our instructor: "Calculate the electric current of the inductor at \$t=0^+\$." He calculated \$1/30\$ but the answer sheet was says \$-1/30\$. Which of them is correct? Our instructor's work:
I agree with Andy. The voltage in the inductor is always 0 V and therefore iL remains at 0 A. The solution of your instructor doesn't make any sense and it's probably for a different problem.
1
The voltage in the inductor is always 0 V but iL remains at 0 A
Apache won't allow multiple name-based virtual hosts
Here's the problem I'm facing: I've added multiple virtual hosts(name based) to apache yet still only one is loaded. For example I have two domains with different contents. Site1 Domain -> Site1 Content Site2 Domain -> Site1 Content aswell.. I've included the httpd-vhosts file in the httpd config file, and I've edited it to match what it asks me to do on their documentation yet still only one folder of contents is served. Here is my httpd-vhosts file, the httpd file I assume doesn't need posting but if required I shall: NameVirtualHost * <Directory "C:/www/"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> <VirtualHost *> ServerName www.*****.com DocumentRoot "C:\www*****" </VirtualHost> <VirtualHost *> ServerName ****.co.cc DocumentRoot "C:\www\****" </VirtualHost> ofcourse I removed the unnecessary comments and my domains names(private reasons). Oh yeah, and my server is hosted on Windows Server 2008 Standard
For example I have two domains with different contents. Site1 Domain -> Site1 Content Site2 Domain -> Site1 Content aswell.. So which is it? Different content or the same content for both domains? If its the same content then the correct way is to use the serveralias option: <VirtualHost *> ServerName www.firstdomain.com serveralias firstdomain.com www.seconddomain.com seconddomain.com DocumentRoot "C:\www*****" </VirtualHost> Now you can serve the same content in the manner YOU were trying to do as well. You just have to set the correct document root for domain number 2. In your example the doc root contains a backslash that it shouldn't if the idea is to serve the same content as domain 1.
0.666667
Different content or the same content for both domains
Application deployment using MDT with no access to network.
Is it possible to install ONLY software using MDT via USB? I don't want to deploy OS as don't want to lose the licence. I would like to achieve this scenario: Laptop with installed Windows 8.1 USB stick with MDT on it is plugged in I run silent deployment of software using the wizard. Other bits to clarify: I don't want to run MDT connected to network I don't want to install OS from scratches
Just to clarify, you need the offline media (not the boot media). The process is explained in the step by step guide for Deploying Windows 8.1 from a USB Stick.
1
Deploying Windows 8.1 from a USB Stick
How did the Female Titan cut Eren's titan form?
After she killed the Levi squad, Eren transformed to fight the Female Titan. In Chapter 29, Hammer, it looked like Eren was having the upper hand, but then the Female Titan turned around, and with one horizontal motion, cut Eren's titan form's head in half. How did that happen? That part wasn't clear in the anime nor the manga. Did she take a tree and smacked him? Did she harden her hand and hit him?
As I recall there was an reaction of fist movement (in the anime). Probably harden her hand and got the tree on the way when cutting his head off.
1
Fist movement (in anime)
Hide microphone button Android virtual keyboard
I wanted to know if is it possible to hide the microphone button (speech-to-text) in Android Virtual Keyboard programatically. I know I can disable this option through device settings, but I don't want the user to use this feature in my application independently of his/her settings. I mean i want to force this behaviour inside my app. Thanks in advance, Demian
You can't force the user input through anything other than pre-defined keyboards that already exist in the user's device. The only way you could get around this is by programming your own custom, on-the-fly keyboard, and that is a very bad idea. Just disable voice input programmatically by using XML declarations in the EditText you're looking at. You can do this with the attribute: android:privateImeOptions="nm"
0.888889
You can't force user input through pre-defined keyboards
Performance of SQL query with condition vs. without where clause
Which SQL-query will be executed with less time — query with WHERE-clause or without, when: WHERE-clause deals with indexed field (e.g. primary key field) WHERE-clause deals with non-indexed field I suppose when we're working with indexed fields, thus query with WHERE will be faster. Am I right? Thanks!
There are cases where a where clause on the primary key will be slower. The simplest is a table with one row. Using the index requires loading both the index and the data page -- two reads. No index cuts the work in half. That is a degenerate case, but it points to the issue -- the proportion of the rows selected. Or, more accurately, the proportion of pages needed to resolve the query. When the desired data is on all pages, then using an index slowed things down. For a non primary key, this can be disastrous, when the table is bigger than the page cache and the accesses are random. Since pages are ordered by a primary key, the worst case is an additional index scan -- not too bad. Some databases use statistics on tables to decide when to use an index and when to do a full table scan. Some don't. In short, for low selectivity queries, an index will improve performance. For high selectivity queries, using an index can result in marginally worse performance or dire performance, depending on various factors.
1
Where clause on primary key slows the work of a table with one row
How do you decide what to get first, Forge or Twilight Council?
Once you have a decently size ground force (~ 6 troopers?), you want to start upgrading them, right? Now ... if you're seeing some concrete threat like Mutas or Tanks, then you'll want a specific upgrade like Blink or Charge. But ... assuming you haven't found any concrete intel at this point, what do you lay down first, Twilight Council or Forge? While Forge in itself isn't that expensive, you can't seriously plan to build both Forge and Twilight Council and and have enough minerals / gas left to buy upgrades at both. One advantage of Twilight is of course enabling High/Dark Templars. So ... how (and when) do you decide which of them to get first?
You shouldn't be thinking "I get some troopers and some upgrades.". Base yourself on what you need to do and what is the best to perform than situation. If you play defensive you probably want more Sentries to block the ramp, while if you play aggressive you want the right mix of Zealots of Sentries based on what you are up against. Sorean outlined some... Let's suppose you are not planning on early DTs (cheese) or HTs (later game units)... For defensive play, it makes sense to start of with a Forge and +1 Armor; also, cannons. For aggresive play, your should have an intention. Denying an expansion, taking down supply or even having the chance to win the game are possible choices. In most cases you would probably go for a Forge and either get +1 Attack or +1 Armor first based on the situation. You should get an idea how a certain upgrade affects your units againt other Tier 1 units; for example, in PvZ the +1 Attack helps a Zealot to kill a Zergling in 2 hits instead of 3. Sorean outlined more... There aren't much cases where you would go Twilight instead, one that would make sense is when you planned on blinking inside the main using an observer. However, you shouldn't be getting blink because you can blink your Stalkers back easily because it will go at the cost of their HP / Damage. Your intention is to do as much damage while losing the least of your units in that early push... You should be thinking "I'm going to attack/defend this way, using these units/upgrade(s)." The other upgrades can follow up while you expand simultaneously, 'cause that gives you the edge... Update, might not be relevantt: Please note that the cost of several Forge updates have been decreased in the latest patch!
0.888889
If you play defensive you probably want more Sentries to block the ramp .
Is there a word for "rule by criminals"?
Is there a word for "rule by criminals"? Not kleptocracy, which is rule by thieves, but more broadly by criminals.
This is an interesting question because it depends upon your meaning: If you mean the government is filled with people who are not adhering to the laws of that they enforce: this would just be a corrupt government, riddled with corruption, etc. etc. If you mean the government is filled with people who've committed crimes, but are now functioning as a standard government that is a different story. The government would be whatever form it took. (e.g. A republic of thieves doesn't cease to be a republic.) Carribean Pirate crews were well known for their democratic governance. But, several terms have been used to describe "legitimate" governments whose members' morality was questionable. I've seen criminocracy used in the manner you're describing. (Also, thugocracy, and others.) For the most part, if you use the suffix -ocracy with a criminal sounding prefix, people will get your meaning.
1
a corrupt government, riddled with corruption, etc.
Flash 24fps vs 30fps
I inherited a bunch of Flash animations that I am in charge of updating, maintaining, editing, etc. They are really basic animations, really just sideshows of pictures with the occasional floating text. My question is, some of them are 30fps and others are 24fps. I am the kind of guy that likes standardization, so I would like to set them all the same. There is no documentation as to why the person that originally created them used two different speeds (in fact I am not even sure if they were all made by the same person). Any real advantage with one over the other?
A lot of LCD computer displays are locked at 60FPS*, so 30FPS fits best, fitting one animation frame perfectly into two display frames. 30FPS should look smoother than 24FPS or even 35FPS. Fitting non-perfect frame rates can lead to juddering effects, as some kind of pulldown method is needed. 2:3 Pulldown used for movies shown on TV in the US I'd use a frame rate that's perfectly divisible 60FPS. That means 15, 30 or 60FPS. If, like Ben suggested, you're outputting to be displayed somewhere else and/or via a file, a different frame rate might be better. Also, depending on your needs and requirements, you may want to reassess the use of Flash at all at some point soon — Flash's future looks pretty grim as a web format. *I believe almost all flavours of OS X and Windows use 60FPS as the default LCD frame rate. Linux can apparently use other values easily, but 60FPS is still by far the most common frame rate for computers, including iPads and iPhones.
1
60FPS is the default LCD frame rate for Windows and Mac .
PhD dissertation different from master thesis; What might I be able to do about methodology?
I understand that it's possible, thankfully, to have your dissertation in a different topic from your master's thesis, but I seem to have a problem (see below). Do you know any other problems might I run into? Background on me: I am finishing up my master's in mathematical finance and now plan to pursue a PhD with my dissertation being in stochastic analysis/calculus, a branch of mathematics used in finance and physics. My background on stochastic analysis: I have had 3 classes related to stochastic analysis and 2 classes applying the concepts. My thesis, being on the P-side of mathematical finance, has extremely little relevance to stochastic analysis, which is more used in the Q-side of mathematical finance. The ONLY time stochastic analysis ever came up was encountering something in a paper that gives probabilities in the Q-side, and I thought of using a theorem to convert them to the P-side but later found out the paper was unnecessary or inapplicable (I forgot; I think I figured out another solution). One problem I seem to have: Some PhD applications seem to require a PhD proposal including a hypothesis, literature review and methodology. I am not quite sure how mathematical research is conducted. Most of my research has been mainly in finance and statistics. What might I be able to do about this? I am considering taking a second master's if needed but hopefully it need not come to that.
If you are accepted into a PhD program, you should consider your dissertation topic to be independent of, and separate from your masters thesis topic. A PhD dissertation is fundamentally different from a Masters thesis. A PhD dissertation is expected to make a new contribution to research (however small), whereas a Masters thesis is a summary and application of existing research. PhD dissertations are a deeper dive into a topic or research questions, and an attempt to shed new light on the topic or questions. You may have a Masters thesis that leads naturally into a deeper investigation as a PhD dissertation. Or not. You should focus your attention on the topics and questions that motivate your interest in a PhD. What are the core, unanswered questions? Which of these questions can you, with your skills and interests, address with some chance of success? Leave behind the details of your Masters thesis. Focus on what you have learned in the process, and what new skills or capabilities you have. Now, with these insights, you should engage with surveys of research in your field -- those describing the unsolved problems or most critical questions. How does your experience, education, and interests lead you to engage with these unsolved problems or critical questions?
1
What are the core, unanswered questions?
Confusion about the Kronecker delta symbol
I am not sure I understand what the short-hand anti-symmetrization means. I.e. I know that $$\delta_{cd}^{[ab]} ~=~ \frac{1}{2}(\delta_{c}^{a}\delta_{d}^{b} - \delta_{c}^{b}\delta_{d}^{a})$$ but how do we expand "bigger" analogues? I.e. $$\delta_{b_1 b_2 b_3 b_4}^{[a_1 a_2 a_3 a_4]} ~=~ ?$$ What is the order of permutation in this case?
$$ \delta^{[\mu_1\mu_2\ldots \mu_n]}_{\nu_1\nu_2\ldots \nu_n}~=~ \frac{1}{n!}\sum_{\pi\in S_n}{\rm sgn(\pi)} \prod_{i=1}^n \delta^{\mu_{\pi(i)}}_{\nu_i}. $$ More generally, $$ T^{[\mu_1\mu_2\ldots \mu_n]}~=~ \frac{1}{n!}\sum_{\pi\in S_n}{\rm sgn(\pi)} T^{\mu_{\pi(1)}\mu_{\pi(2)}\ldots \mu_{\pi(n)}}. $$ Here $S_n$ is the symmetric group of permutations, and $\pi\in S_n$ is a permutation with signature ${\rm sgn(\pi)}$. The order of $S_n$ is $$|S_n|~=~n!~.$$ See also this and this related Phys.SE posts.
0.777778
$S_n$ is a permutation with signature $rm sgn(pi)
Combine jQuery .addClass() on button click only to element that button is in
I am trying to combine multiple click functions with toggle class into one that will affect multiple elements separately. As seen on image i want to change css of element on click only for one which is inside same parent element as button ignoring any other elements with same class. HTML: <div style="display: inline-block"> <section class="container2"> 1 </section> <section> <p><button id="button">change</button></p> </section> </div> CSS: .background { background: red !important; } .container2 { background: black; width: 100px; height: 50px; color: white; } jQuery: var removeClass = true; $("#button").click(function () { $('.container2').toggleClass('background'); removeClass = false; }); $(".container2").click(function() { removeClass = false; }); $("html").click(function () { if (removeClass) { $(".container2").removeClass('background'); } removeClass = true; }); http://jsfiddle.net/dkhhecf2/1/ I know i can write something like this $("#one, #two, #three").click... But is there any other way? http://i.stack.imgur.com/wJhKu.png Any help would be greatly appreciated.
First of all, id has to be unique. So, you can NOT have the same id for different element. And, in order to fire the function to different elements, it is easy that elements have different id. Hence, $("#button1").click(function(){ $("#1").toggleClass("background"); }); $("#button2").click(function(){ $("#2").toggleClass("background"); }); http://jsfiddle.net/dkhhecf2/3/
0.888889
id is unique for different elements
Unable to make Zsh not to suggest a fix for an alias
I have an alias for alias tdA='todo -a' I get the following in Zsh tdA zsh: correct 'tdA' to 'tda' [nyae]? How can you make Zsh not to suggest a fix for an alias?
try % unsetopt correct I have the spelling correction off by default. If it works, add it to your .zshrc file.
0.777778
Try % unsetopt correct
How can I build a switching circuit that scales several 12v signals down to <5v?
Let me start off by saying that I know just enough about electronics to be dangerous (how to solder, follow a simple schematic, and check for connectivity problems and usually figure out what each wire is for). I've installed a cruise control kit in my car, and I want to use a set of Honda steering wheel controls instead of the stock controls from the kit. The cruise kit controls are expecting 12 volts, but I'm not comfortable running any more than 5 volts through the small steering wheel wires next to the airbag wiring. I'd prefer even less, like 2-3 volts. So I need to build a switching circuit that will provide the 12 volt signals to the cruise kit. I was thinking of keeping it solid-state, since I don't know of any relays that will switch on 2-3 volts. However, if there's a good reason to use relays then I can. Here's a rough drawing of what I need: How can I get started with this project?
Airbag requires about 6V only to set it off, so setting 5V as your ceiling is probably pushing it, I think I remember it needed less than 200mA, so a fuse is actually a waste of time, if not a bad placebo. I only know this because I once helped build an airbag tester to be used for Volkswagen and BMW on the Uitenhage plant in South Africa, AND had to wait patiently while everyone still messed about with antistatic gear (which I thought was overkill, but I may be wrong). The trouble with relays or switches, is that they need to have a good bit of juice running through the contacts, else they do not make good contact (they are designed to actually arc, and in low current applications, a small ceramic is used to sometimes make a tiny spark to weld the contacts together). DC is also not that great, since the arc carries metal with it. So a transistor switching (boosting) circuit (which you have designed) is also getting my vote, you can use the transistors to drive a 12V relay (small one), ro regulators needed, and since car battery is 13.5V and the darlington-style circuit (which you drew) often looses just over a volt anyway. The voltage (and needed current) for the BASE of the darlington is going to be low enough to be safe. Just remember to place a diode across the relay coil for back EMF taking your transistors out.
1
Airbag tester for Volkswagen and BMW in South Africa .
Notification email on Content creation - admin approval?
I made a custom content type to replace comments, as the current comment options are not satisfactory for me. Anonymous users can create this content type (comment). I need to send an email to the administrator users each time a new comment is written, to allow them to publish the new comments. I searched for notification email, but it is not what I expected; it only allows to send emails on regular basis. Maybe I could not make it work. How can I send automatic emails to administrators to notify them a new comment has been created, and it is waiting for approval?
You should try the Rules modules, it can does exactly what you want. The rules module allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules). It's a replacement with more features for the trigger module in core and the successor of the Drupal 5 workflow-ng module.
1
Rules module allows site administrators to define actions based on occurring events .
Can std::unique_ptr be used as an argument?
Now, I'm just studying about smart_ptr (unique_ptr / shared_ptr). And I wrote test code like this for checking unique_ptr can be used as argument. typedef struct __T_TEST { char cT1; char cT2; } T_TEST; int main(...) { ... char szB[2] = {0x61, 0x62}; auto pTest = std::make_unique&lt;T_TEST&gt;(); std::memcpy(pTest, szB, 2); printf("T1 = [%02x]\n", pTest-&gt;cT1); printf("T2 = [%02x]\n", pTest-&gt;cT2); return 0; } And then, I added one function using unique_ptr as parameter like this. int TestPrint(std::unique_ptr&lt;T_TEST&gt; p_pData) { printf("T1 in TestPrint Func = [%02x]\n", p_pData-&gt;cT1); printf("T2 in TestPrint Func = [%02x]\n", p_pData-&gt;cT2); return 0; } I'm just calling that function in main function after printf. But it doesn't work. printf("T1 = [%02x]\n", pTest-&gt;cT1); printf("T2 = [%02x]\n", pTest-&gt;cT2); TestPrint(pTest); &lt;- Can't pass the pTest! return 0; } In this case, I can't pass the pTest. Why not? I think pTest is std::unique_ptr and p_pData is std::unique_ptr in TestPrint function. So it's the same type!! But I can't. I want to know why it doesn't work. Of course, it can work after changing the function to std::unique_ptr&lt;T_TEST&gt;&amp; p_pData. But I don't understand why I can't pass the parameter despite of same data type.
std::unique_ptr is a move only type(cannot be copied), if you want to pass it in to the function as a parameter, you can 1 : pass by reference int TestPrint(std::unique_ptr&lt;T_TEST&gt; const &amp;p_pData) { printf("T1 in TestPrint Func = [%02x]\n", p_pData-&gt;cT1); printf("T2 in TestPrint Func = [%02x]\n", p_pData-&gt;cT2); return 0; } 2 : move it TestPrint(std::move(pTest)); 3 : do not use unique_ptr as parameter, use pointer int TestPrint(T_TEST *p_pData) { printf("T1 in TestPrint Func = [%02x]\n", p_pData-&gt;cT1); printf("T2 in TestPrint Func = [%02x]\n", p_pData-&gt;cT2); return 0; } TestPrint(pTest.get()); Pointer is bad at resource management, but good at access resource, if you do not need to pass the ownership to the function, you can use pointer to replace unique_ptr, this is more flexible IMHO, because the raw pointer can work with shared_ptr, unique_ptr, weal_ptr and other smart pointer, but unique_ptr must work with unique_ptr only. In most cases, I only use smart pointer as a function parameter when I want to share(std::shared_ptr) or transfer ownership(std::unique_ptr).
0.777778
std::unique_ptr is a move only type(cannot be copied)
Fancy tree disable checkbox selection for nodes
Fancy tree What we want is to disable the checkboxes based on custom classes that we add. For e.g.: renderNode: function(event, data) { if(!data.node.folder) { $(data.node.span).addClass("custom-class"); } $(".custom-class").css({ // css to disable checkbox}); }
You cannot disable checkboxes using css only (just switch or dim the image). Rather use the api: node.unselectable = true; node.render();
0.777778
Can disable checkboxes using css only
What to call "Cancel" when "Cancel" is already the default action?
When attempting to cancel a service or setting, "cancel" is the default action. What should the normal "cancel" button be called? Redbox uses a playful "just kidding", which may not be appropriate in all circumstances.
My suggestion: never use the word "Cancel" in the default action. To cancel a subscription, you can, for example, say "Remove Subscription" or "Unsubscribe." To cancel a download, you can, for example, say "Stop Downloading". To cancel a setting, you can, for example, say "Revert Settings".
1
Use the word "Cancel" in the default action
Does every floor contain a secret room?
Does every floor contain a secret room (entered via bombed wall or having X-Ray Specs), including the Womb and Sheol?
Yes. The Secret Room is a special room type. One secret room will appear on every floor in the game and will have a pre-determined location when the floor is spawned. The Secret room cannot be entered normally; ways to enter include: XXVIII The Moon Tarot Card Random Teleport Bombing in through any adjacent room (excluding boss rooms and mini-boss rooms) Using the X-Ray Glasses Ways to identify the Secret room on the map include: The Treasure Map The Spelunker Helmet (when in an adjacent room) XXI The World XIX The Sun X-Ray Glasses (when in an adjacent room) The Compass (will be identified as a mini-boss room if and ONLY if Greed is in the Secret Room) The secret room is typically placed adjacent to three or four other adjacent rooms, often adjacent to a Treasure Room if possible. If applicable, the Secret Room will always have preference over three adjacent rooms to two rooms. This preferrence does not occur when comparing three adjacent rooms to four adjacent rooms.
0.777778
The Secret Room cannot be entered normally
Lego Star Wars - The Complete Saga: How do I save the game?
I just got Lego Star Wars - The Complete Saga for my son. It seems to autosave in some fashion. But it also warns me on exit that my progress will be lost since the last save. How can I save manually?
Playing on iOS I've found a way to trigger a save in the cantina without having to purchase an item. View one of the minifigs in the cylindric water chamber, change at least one of their parts using the white arrows and exit the edit mode. This brings up the Death Star briefly in the upper right corner indicating a save is happening.
1
How to trigger a save in the cantina?
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.
Building on Mr.Black and Roberts126 answers: /(&lt;img(?!.*?alt=(['"]).*?\2)[^&gt;]*)(&gt;)/ This will match an img tag anywhere in the code which either has no alt tag or an alt tag which is not followed by ="" or ='' (i.e. invalid alt tags). Breaking it down: ( : open capturing group &lt;img : match the opening of an img tag (?! : open negative look-ahead .*? : lazy some or none to match any character alt=(['"]) : match an 'alt' attribute followed by ' or " (and remember which for later) .*? : lazy some or none to match the value of the 'alt' attribute \2) : back-reference to the ' or " matched earlier [^&gt;]* : match anything following the alt tag up to the closing '&gt;' of the img tag ) : close capturing group (&gt;) : match the closing '&gt;' of the img tag If your code editor allows search and replace by Regex you can use this in combination with the replace string: $1 alt=""$3 To find any alt-less img tags and append them with an empty alt tag. This is useful when using spacers or other layout images for HTML emails and the like.
0.888889
This will match an img tag anywhere in the code which either has no alt tag or an alt tag which is not followed by =""
Examples of RESTful Web Services for Browser Games
Can anyone point me towards examples of Browser Games / Browser Game Sites that use RESTful web services? I have been convinced time and again that building web sites using RESTful principles is a good idea. And I agree. But I just can't wrap my head around what RESTful means when the service you're providing is just a single (or a few) games. Any ideas or thoughts would be nice, but I'd also love to see some solid examples.
You would have REST services for all the moves one could make, or for the game information requests. Something like: POST /game/45093/move?x=3&amp;y=2 POST /game/45093/surrender GET /game/45093/status GET /games etc...
0.777778
REST services for all the moves one could make, or for game information requests
hide javascript/jquery scripts from html page?
How do I hide my javascript/jquery scripts from html page (from view source on right click)? please give suggestion to achive this . Thanks.
Firebug can show obfuscation, and curl can get removed dom elements, while checking referrers can be faked. The morale? Why try to even hide javascript? Include a short copyright notice and author information. If you want to hide it so an, say, authentication system cannot be hacked, consider strengthening the server-side so there are no open holes in server that are closed merely though javascript. Headers, and requests can easily be faked through curl or other tools. If you really want to hide the javascript... don't use javascript. Use a complied langage of sorts (java applets, flash, activex) etc. (I wouldn't do this though, because it is not a very good option compared to native javascript).
1
Why try to hide javascript?
C++ new memory allocation fragmentation
I was trying to look at the behavior of the new allocator and why it doesn't place data contiguously. My code: struct ci { char c; int i; } template &lt;typename T&gt; void memTest() { T * pLast = new T(); for(int i = 0; i &lt; 20; ++i) { T * pNew = new T(); cout &lt;&lt; (pNew - pLast) &lt;&lt; " "; pLast = pNew; } } So I ran this with char, int, ci. Most allocations were a fixed length from the last, sometimes there were odd jumps from one available block to another. sizeof(char) : 1 Average Jump: 64 bytes sizeof(int): 4 Average Jump: 16 sizeof(ci): 8 (int has to be placed on a 4 byte align) Average Jump: 9 Can anyone explain why the allocator is fragmenting memory like this? Also why is the jump for char so much larger then ints and a structure that contains both an int and char.
For small allocation, boost has a very simple allocator I've used called boost::simple_segregated_storage It creates a copy of slists of free and used blocks, all the same size. As long as you only allocate to its set block size, you get no external fragmentation (though you can get some internal fragmentation if your block size is bigger than the requested size.) It also runs O(1) if you use it in this manner. Great for small allocation the likes of which are common with template programming.
1
Build a copy of slists of free and used blocks, all the same size
Symfony 2 and Twig custom error page
I give up. The problem is with the overrided Twig 404 template. It is overrided in a default way by creating an error404.html.twig under the /app/Resources/TwigBundle/views directory. The template itself does not contain any irregular or complex logic: just a layout with some translated text (|trans) and a menu with several links. The problem is, that I can't get app.user object (returned as NULL) or current app.request.locale (always returned as default locale) inside this template. I have even tried to override the twig exception controller and dump a current locale (Request::getLocale()) or get user - the results are the same - default locale and NULL for user. Then I decided to dig deeper and found a dozens of listeners (locale listeners, exception liteners, ...) and tried to debug/fix/test there, but I didn't proceed any further. By the way, I have overrided the 500 error page too, and everything is fine there. Well I guess that when 500 error (exception) is thrown, the symfony has already set up user/locale/etc, because it already has got to the target (controller/action) and other listeners been already executed. But 404 error (NotFoundHttpException) is being thrown BEFORE Symfony targets the action... Some words about project: symfony 2.4.8, doctrine, Gedmo extensions/stof bundle, JMS i18n routing bundle. Symfony version: v2.4.8 JMS I18n Routing bundle: 1.1.1 Appreciate your help.
You can create register listener on KernelException event and define any logic you need there. Like this: use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; class YourKernelExceptionListener { public function onKernelExcpetion(GetResponseForExceptionEvent $event) { // if the exception is instance of Symfony NotFoundHttpException // you can do whatever you need and render whatever you need } }
0.777778
Create register listener on KernelException event
I teleported too high on my Minecraft server
My friends own a Minecraft server and I was playing around with commands when I teleported to y 100000000000000000000000000000000 just because I wanted to see how high maps could go. That was a big mistake. Now every time I go on the server I crash. I don't have access to the server files and I don't have the owner's email or phone number or anything and I'm the only one that plays on the server. I know that one solution is to make a new Minecraft character but that would involve me to pay. Is there some way I can delete my player information or change the location without access to the server files? I don't want to leave the server because I've been building a castle for 3 months now and I don't want to give up that easy.
Yer, you're basically screwed :I. Even though you don't have contact to the owner maybe try and get a friend to go online and get them to teleport you to the ground or get them to contact the owner, as only he will be able to fix this.
0.888889
How do I get a friend to go online?
Why does not the derailleur adjustment work the same way while riding?
I suppose most of the people have noticed it. While adjusting both front and rear derailleurs, it will shift accordingly, when you have adjusted or are adjusting it, but when you test it by riding, the adjustment fail to perform the same way, Why does this happen? How does the added weight affect the shifters?
Frame flex under the added weight affects the relative position of derailleurs and shifters, which is reflected in the cable length. Movements of the cable when changing gears are on the millimeter scale, so even lengthening of the cable by a fraction of a mm due to frame flex can have an effect.
0.555556
Frame flex affects the relative position of derailleurs and shifters
Bad practice to pass IQueryable to ViewModel
I might be misunderstanding something about ViewModels here (I'm new to them), but is it a bad practice to pass a static Get method an IQueryable? I haven't tried this, so I'm not sure if it'll even work, but this is a larger question about the usage of ViewModels. For example: using (var db = something.Invoke()) { var query = some query; var data = MyViewModel.Get(query); //pass an IQueryable //do something with data } class MyViewModel { public List&lt;int&gt; Something {get; set;} public static MyViewModel Get(IQueryable data) { var view = new MyViewModel(); var list = new List&lt;int&gt;(); foreach (var d in data) { list.Add(d.Column); } view.Something = list; return view; } } It would just seem really redundant to have to map my database to a more generic data structure and then pass that to my ViewModel to do another mapping (like database -> List -> ViewModel). It would be easier if I could just pass in my query and have 100% of the mapping take place in the ViewModel, instead of having that inbetween step (database -> ViewModel).
We have tried using logic in ViewModels, but this is a path to madness. ViewModels should be POCO - only properties with no (or very basic) logic. All the mapping should be done in controller or even in QueryHanlder that is called by a controller. And QueryHanlder would take dependency on DB and do required mapping to get from DB data structure to ViewModel. Responsibility of ViewModel is to carry data from controller to a view (or backwards). And if you get DB or mapping logic into, this is a violation of Single Responsibility Principle.
1
ViewModels should be POCO - only properties with no logic
AMD processors VS Intel Processors in virtualization and SQL tasks
I need to buy a server. This machine will be used as a virtualization host, therefore it will have a lot of v-machines sitting there using its resources. One of those v-machines is a SQL Server that provides for our ERP which is used, intensively, by about 30 people, one automatic instance of that same ERP and one external app that provides messaging capabalities to our ERP everytime something of importance happens. On top of that, i want to run RDS to about 20 offsite users, AD, and probably some other services like SMS messaging, and setting up our own email service... I'm heading to a box that runs 2 AMD Opteron 6100 series (8 cores/pp), 32GB, RAID controller (512MB) and 8 SFF (500GB) in RAID 10. Is this hardware fit to run such a setup? Any ideas, clues, thoughts? I'm a bit worried about AMD performance when executing SQL tasks/jobs/queries... Thanks for your help.
You're going to want to get some idea of the performance required by each planned VM, and then size your virtualization host(s) appropriately. You need to consider CPU, RAM, and IO (speed, latency, etc.) Especially latency if you're going to be serving RemoteApp off of a VM. Realistically, you'll probably want more than one machine, and shared storage. Your concerns about the processor architecture WRT SQL are kind of off-base; you're not really asking the right questions.
0.777778
You need to consider CPU, RAM, and IO (speed, latency)
WYSIWYG HTML / CSS builder
Maybe it is to much to ask... I want to make a online WYSIWYG HTML / CSS builder where the graphic designer can build a website template without knowing CSS /HTML. For that purpose there should be a GUI to build a website template. That means HTML and CSS are created out of the choices selected in the GUI. http://www.constructyourcss.com kinda does what I want. But I can't set width/height etc + I need to integrate it into my system (I use PHP, MySQL,jQuery) Question: Do you know any html/css builder tools like ala jquery sortables?
I don't know of any online tools, but I really like the way this standalone program called Stylizer enables users who don't know CSS very well to modify web site layouts. But honestly, there's no way I'd pay $89 for it. I recommended it to some friends to use it for the trial period, but learn how to use Firebug as well. That being said, I tend to agree with the comments above. A designer is more likely to learn CSS/HTML and do it themselves or pay a service to convert their pdf into a page.
0.888889
Stylizer enables users who don't know CSS to modify web site layouts
Drupal redirects to old url after moving to new server
I am in the process of moving a drupal site to a new server. I copied the drupal db and moved all the files of the drupal installation. The old url is http://www.sniffingmusicians.echidna-band.com/ and the new is http://www.sniffingmusicians.com/, which point to 2 different servers. Even though the frontpage of new is there when I login it redirects me to the old domain! Additionally, all the content is prefixed with the old url. I changed the $base_url in the settings php but there is no real impact. Where else can I reconfigure my site's url?
I came up with the same error after did a server migration. After all those try error, I just realised I didn't give apache permission to access the web folder. After added in apache config, everything works as charm
1
apache permission to access the web folder
Why do I have double slash here?
$ which mycommand /home/t/program_files/document/other edits//mycommand Why do I have double slash // here?
which searches your PATH. It happens that mycommand is found in a $PATH entry with a trailing slash: /home/t/program_files/document/other edits/. which concatenates the directory, a / as separator, and the command name to build the filename to check; when the directory has a trailing slash, this results in two slashes. Multiple slashes are equivalent to a single one, so this is completely inoccuous. P.S. Why not use &quot;which&quot;? What to use then?
0.666667
Why not use &quot;which&quot
Cant retrieve PHP arrays outside the assigning loop
I am trying to create a 2-dimensional array, reading specific values from a (large) met file. The arrays are empty and I dont know why. I have the following array: $varmet = array('tasmax', 'tasmin', 'pr', 'clt'); I have two loops: The first is for ($j = 0; $j &lt;= 3; $j++) { ... I read the corresponding files and variables, etc. It works properly. Then I have the other loop for ($i = 1; $i &lt;= 360; $i++) { .... $valor = $valor * $correctp; It works perfectly, retrieving the required value in $valor The problem arise when I want to store the value in a different array, according to the met variable: switch ($j) { case 0: $tmax[$i] = $valor; break; case 1: $tmin[$i] = $valor; break; case 2: $prec[] = $valor; break; case 3: $clt[$i] = $valor; break; } // Fin del switch } // Fin del for para un fichero met } // Fin del for para todas las varmet The $tmax, $tmin, etc. have no value, although $valor does have. Furthermore, if I assign the array within the loop (i.e. $valorest[$j][$i] = $valor) it still have the values, but not outside it. Anybody knows what I am doing wrong?
Try like this $tmax = array(); //declare this outside the loop i.e before the loop starts In switch case statement, replace the below line $tmax[$i] = $valor; with array_push($tmax,$valor);
0.888889
Replace the below line $tmax[$i] = $valor
Homework with logarithms
I'm stuck on continuing the next exercise: Considering: $\log_{c}a = 3$ $\log_{c}b = 4$ and: $$ y = \frac{a^{3}\sqrt{b \cdot c^{2}}}{2} $$ What's the value of $\log_{c}y$ (integer)? So far, I did all the substitutions that were obvious at my eyes: $$ y = \frac{a^{3}\sqrt{b \cdot c^{2}}}{2}\quad\rightarrow\quad y = \frac{c^{9}\sqrt{c^{4} \cdot c^{2}}}{2}\quad\rightarrow\quad y = \frac{c^{9}\sqrt{c^{6}}}{2}\quad\rightarrow\quad y = \frac{c^{9} c^{3}}{2}\quad\rightarrow\quad y = \frac{c^{12}}{2} $$ The last equality is the same as $c^{12} = 2y$, which could be written as: $$ \log_{c}2y = 12\quad\rightarrow\quad \log_{c}2 + \log_{c}y = 12 $$ I really don't know haw to continue. I've managed to find a $\log_{c}y$, but I don't know what to do with the $\log_{c}2$. Either I took the wrong path, or I'm missing something that prevents me to finish this exercise. Any hints are much welcome! Thanks in advance.
Note that we know $\log_c y$ is an integer, so $\log_c 2$ must also be an integer, hence $c^k=2$ for some $k\in\mathbb{Z}$. If we also assume $c$ is an integer, then the problem does in fact have a unique solution. Hope this helps.
0.666667
If we assume $log_c y$ is an integer then the problem does in fact have a unique solution
how to get specific value from json file in java
I have a json file like this: { "list": [ { "ID" : "1", "value" : "value is one" } { "ID" : "2", "value" : "value is two" } { "ID" : "3", "value" : "value is three" } { "ID" : "4", "value" : "value is four" } ] } what I want to do is read the josn file and returns the message based on the ID i specify. So for example if (this.list.containsKey("1")) { return this.list.get(messageTitle); } That's what I tried but it returns all the values and ID. JSONParser parser = new JSONParser(); try { Object obj = parser.parse(new FileReader("jsonFile.json")); JSONObject jsonObject = (JSONObject) obj; // loop array JSONArray msg = (JSONArray) jsonObject.get("list"); Iterator&lt;String&gt; iterator = msg.iterator(); while (iterator.hasNext()) { System.out.println(iterator.next()); } }
How try like this, JSONArray msg = (JSONArray) jsonObject.get("list"); for(int i = 0;i &lt; msg.length();i++ ) { JSONObject jsonObj = msg.getJSONObject(i); //now get id &amp; value int id = jsonObj.getInt("ID"); String value = jsonObj.getString("value"); if (1 == id) { //now 'value' is what you want System.out.println(value); } } Note: can break the loop when the result is satisfied.
0.777778
How to break the loop when the result is satisfied
Is a self cleaning lube enough for chain maintenance?
I've been trying to figure out what I should use when cleaning my bicycle chain. When I first purchased my bike, I knew I needed to lube my chain when i did regular maintenance. I purchased some White Lightning Self Cleaning Bicycle lube, which suggested to me that I only needed to put that lube on the chain and everything would be fine. I recently purchased another brand of lube, and it didn't say anything about self cleaning. I've read in several places that a degreaser is needed and a cloth and some soap to clean a chain properly, and then lubing takes place afterwards. If I buy White Lighting self cleaning lube, do I need to go through the regular chain cleaning steps? or can i just lube my chain and go?
I've used white lightening and thought it was good. I never use oil based lubes now - they're just too messy and you end up paying double because you need to first buy the oil and then also buy expensive degreaser to wash them off again. I do get through wax based lubes faster than oil - you have to reapply more often. Compared to the faff of oil based lubes though, it seems worth it. You do have to still clean your chain and cogs off every so often. How often depends on the weather, distance and type of terrain you've been cycling through. But, it seems like far less mess and time is required than oil based lubes. To clean I soak the chain in a mix of hot water, washing up liquid and something like kitchen/hob surface cleaner. I think my girlfriend appreciates it too as I make less of a mess when doing any bike maintenance. I forgot how nasty oil based lubes can be until recently when I stopped on a trail to help a guy with a broken chain. His chain was gunked up nastily. The oily emulsion looked like it held particles of grit in it well, so I'm sure he was grinding through his chain and transmission with it. Also, I gave up trying to wash the stuff completely off my hands after I got home, and ended up with marks that lasted a few days until my body shed a layer of skin. I wouldn't have had that problem if he'd used a wax based lube.
0.777778
How often do you get through wax based lubes?
Why is Misato Tachibana always shooting Koujirou Sasahara?
Whenever Sasahara does something mildly inappropriate in Tachibana's presence, such as playing video games under the desk or reading a manga while he's supposed to be working on some sort of school assignment, Tachibana reacts out of proportion and unleashes a barrage of deadly firepower, but he doesn't even react to that. What's this supposed to mean?
That is because Tachibana is a Tsundere, she even got her own slang term of it due to her extreme tsundere attitude, called GUNdere. Misato Tachibana is a peach haired high school girl who generally acts cold towards Koujirou whenever he does anything that reminds her of how she likes him, or simply doing anything at all. She is a member of the Kendo club. Misato's feelings usually materialize as assault with various guns and heavy weaponry that come out of nowhere, which Koujirou miraculously survives despite being injured, and just turns white with the dust. In reality Misato has feelings for Koujirou, but due to her tsundere attitude, she constantly denies her feelings and shoots Koujirou. She somehow manages to always trace everything back to Koujirou in conversations, even when he wasn't involved in it, leading her to wildly deny accusations, such as marriage and children, that nobody said. - Wiki
1
Misato Tachibana is a peach haired high school girl who always denies her feelings and shoots Kou
AES 256 Encryption - Is it really easy to decrypt if you have the key?
So this might sound like a crazy question but bear with me for a minute. I can't find any info on the internet and so am here, although this might have been a good place to start. I've recently developed an encryption engine using the .net's AES managed classes. I use a 256 bit key generated by the Rfc2898DeriveBytes function. The key is generated from a pass phrase that is at least 40 characters long. The IV is also generated from this pass phrase. The encryption class uses a CypherMode of CBC and a padding mode of PKCS7. There is a static salt that is 8 bytes long. The key is stored in a separate database to the data and is itself encrypted using a certificate based on the database master key. So, my question is: is it really easy to decrypt the data if the attacker has the key? I'm not talking about the Chinese government (or even GHCQ given recent headlines), I'm talking about an attacker who steals both databases. What would be the steps they have to follow and/or how can I stop them on their path? The reason I ask this is that I want to know how feasible it is. Is it something that can be done in minutes or does it fall into the bracket of being infeasible? Do they have to calculate all of the parameters used when encrypting?
I assume you follow Kerckhoff's principle so the attacker knows the padding scheme and derivation function so the answer is yes, it only takes a few seconds to decrypt and anyone can do it. If he doesn't know these things, he can find them by trial and error (assuming he can get his hands on a valid ciphertext). The IV can be sent in the clear so making it depend on the key reveals some information on the key. It should also be unique for each session so I'm a bit worried about it. It should be OK if the KDF you're using is non-deterministic, which implies it uses its own IV so the problem remains. See this question for more on IVs. Edit based on comments: The cracking procedure is the following: $a$ is the number of all modern ciphers. Let's set this to 100. $m$ is the number of modes per cipher, set it to 6. $k=100$ is the number of key derivation functions, $p=100$ are the padding schemes. The values are arbitrary. So we have $(p*k*m*a*c)/n = 6*10^6$ which equals to approx. 69 days with $c=1$ second and $n=1$ processor. Your adversary will solve the problem in $69/2=34.5$ days. Not as practical but definitely feasible, especially if you throw extra processors at it. This solution is completly brute-force, it makes no attempt at distinguishing and pre-eliminating ciphers. Since non-indistinguishability is a business requirement (really?) you could just get away with using ECB instead of any other mode.
1
How to decrypt a cipher using ECB?
Restoring from BackUp Exec to 2003 Recovery Storage Group
We seem to have some issue with recovering Exchange 2003 data via BackUp Exec 12.5 to Recovery Storage Group. We have set-up a dial-tone Exchange database, and now trying to restore latest backup to new recovery group. Problem is, it seems as BackUp Exec recovers the data to the dial-tone database instead of Recovery Group. There is no way to select destination in BackUp Exec, but I was sure Exchange alone knows where to restore data. I also double-checked the "this database can be overwritten by restore" check-boxes on dial-tone and recovery data-bases - it's unchecked on dial-tone, and checked on recovery, as instructed in every article. Following this guide doesn't seem to help - it still restores to dial-tone: http://www.symantec.com/business/support/index?page=content&amp;id=TECH29719 P.S.: if this doesn't work, how safe is restoring the backup directly to dial-tone, and just using it as the production data-base from now on? Thanks for any ideas!
For for those wondering what a dial tone database is take a look at this article:Recovering a Mailbox Database Using a Dial Tone Database in Exchange Server 2003. As far as your question goes the dialtone database will not have any of the server based rules that the user created, folder permissions, end encryption keys for OST files. You can use the dial tone database as production but you will have to use exmerge to bring the old mail in. See Considerations and best practices when resetting an Exchange mailbox database
1
Recovering a Mailbox Database Using a Dial Tone Database
Why would one shoot a fully blurred picture?
Focus and blur have a reason in a picture when they come together. Blur alone is just a loss of an important element in the photography art, unless it has a reason, like obscuring nudity or creating an additional value... but what is the value of an entirely blurred picture?
One more suggestion: if the picture is meant to be a background for something else (like a computer desktop, a printed page or a work of art), then the "something else" forms the foreground of the resulting work, and the picture in the background should not excessively distract the viewer from it. Thus, a completely blurred or defocused picture may be exactly what the overall composition needs. It's also worth noting that not all blur is the same: for example, motion blur only loses detail along the direction of motion, but retains variations orthogonal to it. Besides, blurring can also add detail. For example, a defocused photo can show the camera's bokeh, while motion blur adds information about the movement of the subject (and/or the camera). An extreme example would be star trail photography, where the motion blur is provided by the Earth's rotation. Obviously, these images are blurred by definition &mdash; but that blur is precisely the subject of the image.
0.888889
a completely blurred or defocused picture may be exactly what the overall composition needs .
Are there any disadvantages to encrypting the password hash?
Is encrypting the password hash in database more secure than storing only the hash? Suppose we store encrypted SHA-256 result with AES instead of hash directly. Is this a good protection from a situation in the future when someone will break one of the algorithms?
Bob Brown has covered most of the salient points in his answer but I did want to point out that there is one significant disadvantage: Complexity. You are increasing the complexity of your application to some degree, lesser (in the case of adding a pepper to the hash where you need to think about key management as well as storage of password hashes and salts) or greater (in the case of implementing something more sophisticated like AES and needing to store IVs or Nonces and possibly tags/MACs as well as the output, the salt, and managing the key(s).) So, is the value you're going to add sufficient to justify the additional cost of complexity? You'll have to answer that question for your application. I'd would say that it generally doesn't, while there certainly are cases out there where it does. In any case, as Bob mentioned, you need to start with a strong foundation and move to a better hashing algorithm like Bcrypt regardless of whether you decide to encrypt or not.
1
Complexity is a disadvantage to encrypting your application
regex to match xml tags not containing other tags
Let's say I want to look for XML like this: &lt;Address&gt; &lt;Street&gt;Windsor&lt;/Street&gt; &lt;/Address&gt; and I do not want to match XML like this: &lt;Address&gt; &lt;Number&gt;15&lt;/Number&gt; &lt;Street&gt;Windsor&lt;/Street&gt; &lt;/Address&gt; That is, I am looking for addresses where the Address node does not contain a Number tag. I tried patterns like &lt;Address&gt;(?!Number)&lt;/Address&gt; or &lt;Address&gt;.*?(?!Number).*?&lt;/Address&gt; But I can't quite figure it out :-( Any ideas?
&lt;Address&gt;(?:(?!&lt;Address&gt;)(?!&lt;Number&gt;).)*&lt;/Address&gt; Warning: that assumes that you either have no newlines in your text, or that . can cross newline boundaries, the so-call /s or DOTALL mode, which (?s) will enable in some regex languages.
0.888889
&lt;Address&gt;(?
Is there a limit to how fast one can harvest minerals and gas?
Possible Duplicate: What&#39;s the correct number of workers to put on gathering vespene and minerals in StarCraft 2? Is there a point where any additional workers won't speed up the harvesting process of minerals or gas from a certain mineral field or refinery?
Your third worker will gather at a reduced rate. Your fourth worker will not produce additional income. Please note that MULEs can gather over workers, but not over other MULEs. This results in a limit of 16 workers at full rate, an additional 8 workers at a reduced rate totaling in 24 workers per 8 mineral patches. Please note that this is a full page at the bottom of the screem, as each row is 8 units long. It is however advised that if you have less than 16 workers at an expansion that you transfer those of an expansion with more than 16 workers. As for MULEs, you can have up to 8 MULEs per 8 mineral patches. The fastest income of a single base you can get is by 24 workers and 8 MULEs on a gold expansion. For gas, it depends on the distance to the gas geyser. In some cases, full saturation is reached on your third worker, in other cases (diagonal placement) the full saturation is reached with a fourth worker. However, the difference between the third and fourth worker is minimal and probably only matters when you are at a high grand master level. And even then, there are probably other more important things to focus on. You don't need a graph for this, when you see a worker waiting outside the gas geyser for long enough you simply have reached saturation... Here is a graph for gathering minerals with workers: (Click to enlarge) &mdash; Source: TeamLiquid Wiki - Mining Minerals
0.888889
You can have up to 8 MULEs per 8 mineral patches .
Kosher salt vs. Table salt for rib eye steak
I don't have any Kosher salt on hand and I'm cooking a rib eye steak tonight. Can I just use table salt, or would that drastically effect the taste of the steak? Why is Kosher salt better to use?
The reason people choose Kosher/Sea/Rock salt over table salt is mainly down to the crystal size and the lack of additives like iodine. Kosher salt is less soluble and less dense than table salt. The large crystals in these salts mean that unless there is a fair bit of water present they don't completely dissolve. This means it is less likely you'll over salt steak even if it's caked in crystals. Table salt will dissolve with far less water present and will, therefore, get absorbed more easily into the meat. Also the lower density means you can liberality sprinkle Kosher/Sea/Rock salt on things and even if it does all dissolve you've actualy added less salt than you would think. It looks like a lot but 1g of Kosher/Sea/Rock salt takes up a lot more space than 1g of table salt. 1tsp table salt would be way too much. I'd go for about half the volume of Kosher salt if you were dissolving it in liquid and maybe as little as quarter the volume if I was using it as a rub (as in salting a steak).
1
Kosher/Sea/Rock salt over table salt
In set theories where Continuum Hypothesis is false, what are the new sets?
So, say we are working with non-CH mathematics. This means, AFAIK, that there is at least one set $S$ in our non-CH mathematics, whose cardinality is intermediate between $|\mathbb{N}|$ (card. of naturals) and $|\mathbb{R}|=2^\mathbb{N}$, the continuum. Question: what kind of objects would we find in this set $S$? Also: is this mathematics radically different from the one where CH holds? Specifically, are there results that are used in everyday math , at a relatively introductory level, which do not hold on our non-CH math.?. What results that we find in everyday math would not hold in our new math? Would there, e.g., still exist non-measurable sets? Maybe more specifically: what results depend on the CH?
A very natural question for algebraists is the Whitehead problem: is there an abelian group A which is not free but for which Ext^1(A, Z) = 0? Shelah showed that this natural problem was independent of ZFC. If you assume CH is false and Martin's axiom is true, then such a group exists. On the other hand, V=L, which implies CH, also implies such a group does not exist.
0.444444
Whitehead algebraic problem
How can I cut fudge smooth and uniform?
I've recently taking up making fudge for family and friends. However, my cutting technique lacks a desirable smooth uniform piece. How can I cut equal smooth cuts?
The first question is how fussy you want to be about uniformity. Many people are satisfied just using a long, thin knife to score the fudge in roughly straight lines. If you want professional-level uniformity in the size of pieces, you'll need to lay out a grid with a straightedge, measuring equal distances on all four sides, and then use the straightedge across the fudge to score it. (If you plan on doing this repeatedly, I'd recommend preparing a template on a piece of cardboard or something, so you don't need to measure equal spacing on the edges each time.) As for smooth cutting, there are standard recommendations: Score the grid onto the fudge with a sharp knife when just barely set but still warm. This will make the final cuts easier, as well as giving you guidelines to follow. Everyone has an opinion about the best implement to do the final cuts with. If the fudge is still slightly warm (but firm), a plastic knife may work best. If the fudge is cooler and harder, a thin smooth metal blade is often easiest (usually with no sawing motions; just pressing down). A long blade makes for quicker work. Some people like to use a bench knife pushed straight down; others use a pizza wheel or smooth pastry wheel. It all depends on your technique, as well as the consistency and temperature of the fudge. If you have difficulty cutting or if the fudge crumbles with the cuts, try warming the metal knife (or wheel or whatever) in hot water between cuts. Wipe the hot knife dry before cutting. Whatever you use, always wipe the cutting implement clean between cuts. Some people claim to use dental floss for cutting. While I've used that for cakes a few times, it seems overly fussy and difficult for fudge (but I've never tried it), though you might consider using it for fast scoring.
1
How fussy you want to be about uniformity?
Sharing files with a dd-wrt router
I plan to buy a new wifi router with the intention of installing dd-wrt right away. One of the features I plan to use is attaching a USB harddrive to the router and using it to backup (using rsync) my laptop and desktop. As far as I can google, dd-wrt shares files through SAMBA. I know it's not the prefered option for Ubuntu users and we would prefer NFS, but does anyone know how bad or good it is this setup? Does anyone here use dd-wrt as a file server succesfully?
If you just want to rsync to it, you can run it over ssh. You can also browse files over SSH, even mount it permanently. For just moving files around, it's a bit slower and resource intensive than plain samba or NFS but for running rsyncd, it should be fine. NFS isn't compiled into the dd-wrt kernel so if you want to use it, you need to use the userspace version which is somewhat slower. Routers don't tend to be the best fileservers. They have a great networking stack but the interface between the router and the drive is pretty slow. On top of that CPU overhead that wouldn't be noticed on a proper server can cause a little router quite a lot of stress. There are also possible security ramifications of running a precious service like a fileserver on something with a direct connection to the wild. A NAS (Network Attached Storage) device would probably give you better performance and not cost all that much. A lot of the QNAP devices are multi-protocol aware and perform quite well.
0.666667
NFS isn't compiled into dd-wrt kernel
Changing package names before building in Bamboo
I recently discovered that BlackBerry treats all classes with the same fully-qualified name as identical--regardless of whether they are in entirely different apps or not--causing apps that use different versions of our shared libraries to break when they are installed on the same phone. To solve this problem, we are planning on changing the package names to include a version number, then building. Can someone explain how, using Bamboo, I can insert a step in our build process that: changes certain packages names replaces all code references to the old package name with references to the new package name?
A great tool that is made especially for the task of changing the fully qualified names of Java classes in jar files is jarjar. It can be used easily from within Ant, or alternatively from a shell script. I have never used Bamboo - I assume, it should work there, too. Of course, there may be some special restrictions in that environment (concerning bytecode manipulation), I don't know about (?)
0.888889
jarjar is a great tool for changing Java classes in jar files
should have done vs should had done (sequence of tenses)
imagine you want to use "should have done" in a subordinate clause when there's some past tense in the main clause. e.g.: "He said I should have(had?) done it." which one is correct? or should i use some other modal verb for this purpose? thanks
"should had done" is never correct. Go with "should have done".
1
"should have done" is never correct
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?
In addition to the Minhagim mentioned, it also is closely related to the direction one wraps. Wrapping inward tends to make it obvious how many loops there are, whereas wrapping outward leaves it unclear, hence the need for different Minhagim (6 and 2 halves, 7 and a half, etc.) to make an extra loop to ensure 7 complete loops.
0.888889
Wrapping inward tends to make it obvious how many loops there are, while wrapping outward leaves it unclear
rsync partial LVM volume to Remote Directory
Can I rsync a full hdd partition (which is inaccessible) to a remote directory? Inaccessible means it cannot be mounted, it was part of LV volume merged with other HDD which is faulty and removed from the server. I tried to mount it but not working unknown filesystem type 'LVM2_member' so I'm using rsync to mount it on remote desktop. Advise me what's the best solution? rsync -avz /dev/sda1 user@ip:/backup/ I want to copy all files and directories of /dev/sda1 to remote device at the directory backup.
rsync -avz /dev/sda1 user@ip:/backup/ would attempt to copy the device node, not the disk content. You can make an image of the partition as a remote file: ssh -C user@ip:/backup/sda1.img &lt;/dev/sda1 This makes an image of the partition. It won't give you access to your files. In order to access your files, you need to mount the partition or the image: that's what mounting means. If you only have one disk in a two-disk volume group, you won't be able to get your files from it, because you only have half a filesystem. Half a filesystem doesn't mean you have half the files, any more than having half a car doesn't mean you can travel on half the roads. If you have half a car, you can use it for parts, but you can't drive it. If you have half a filesystem, you may be able to use forensic techniques to recover some of the data, but it's hard work and individual files and directories are likely to be split over the two disks anyway. If your volume group is split over two disks and one of the disk fails, your whole volume group is effectively lost.
0.777778
rsync-avz /dev/sda1 user@ip:/backup/
Why can syn-periplanar E2 elimination happen in molecules like vinyl bromides but seemingly not in other molecules?
E2 eliminations occur when the leaving group and the proton are in the anti-periplanar conformation not syn-periplanar. This is beyond a merely a preference as leads to E2 reactions being stereoselective. However, when it comes to vinyl bromides for example (involving a double bond) the reaction can occur in the Z- and E- isomers (i.e both syn-periplanar and anti-periplanar). How can this be the case?
Elimination from vinyl halides occurs faster when the halide and proton have a trans relationship. When the halide and proton are located on the same side of the double bond (cis), the elimination to form an alkyne is much slower. The faster elimination from the trans arrangement is consistent with a preferred anti-periplanar arrangement in the E2 reaction. The fact that elimination still occurs, albeit at a slower rate, when the groups being eliminated are arranged cis to one another suggests that a different mechanism is involved in the "cis" case. Two possible mechanistic alternatives are cis elimination from a higher energy (higher energy, therefore less preferred, slower) syn-periplanar conformation, or an E1CB mechanism where the proton is removed in a first step and a carbanion is generated, and this is followed by halide ejection in a second step. Experiments in analogous molecules suggest that the E1CB pathway is most often followed in "cis" elimination from vinyl halides.
1
Elimination from vinyl halides occurs faster when the halide and proton have a trans relationship .
Shared memory: shmget fails: No space left on device -- how to increase limits?
I call shmget many times in my program, to get shm of of average size 85840 bytes. I obtain about 32771 shm ok, then shmget doesn't return a shm, but the error: "No space left on device". I have increased the kernel limits to: $ sysctl -A|grep shm kernel.shmmax = 33554432 kernel.shmall = 1677721600 kernel.shmmni = 409600 But still get the issue. Why? Do I have to put something into /etc/security/limits.conf too? I only have "user - nofile 1000000" because the program also opens about as many files as shms. This is the output of free $ free total used free shared buffers cached Mem: 8150236 7261676 888560 0 488100 3270792 -/+ buffers/cache: 3502784 4647452 Swap: 12287992 554692 11733300 And ipcs $ ipcs -lm ------ Shared Memory Limits -------- max number of segments = 409600 max seg size (kbytes) = 1638400 max total shared memory (kbytes) = 6710886400 min seg size (bytes) = 1 Since I assume shm is capable of being swapped out, there should be enough space.
It turns out shmmni is limited to 32768 in the kernel: define IPCMNI 32768 /* &lt;= MAX_INT limit for ipc arrays (including sysctl changes) */ in the file ...version.../include/linux/ipc.h So short of recompiling the kernel, that is the hard limit on the number of shared memory segments. Sorry.
0.888889
Define IPCMNI 32768 /* &lt;= MAX_INT
No module named 'Dajaxice'
import in HTML: &lt;script src="/media/js/jquery-2.0.2.js"&gt;&lt;/script&gt; &lt;script src="jquery.dajax.core.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function oneri() { Dajaxice.rezervationApp.oneri(Dajax.process) } &lt;/script&gt; I use: &lt;div class="span6"&gt; &lt;a href="#adviceModal" class="btn" role="button" onClick="oneri()" data-toggle="modal"&gt;Öneri Al&lt;/a&gt;&lt;/div&gt; in ajax.py from django.template.loader import render_to_string from dajaxice.decorators import dajaxice_register from django.shortcuts import render from rezervationApp.models import RoomType, Room, Market, Profile, Reservation @dajaxice_register def oneri(request, word): dajax = Dajax() p = Profile.objects.get(firstname__contains=word) dajax.assign('#advice','innerHTML', p) return dajax.json() Fully error: ImportError at / No module named 'Dajaxice' Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.5.1 Exception Type: ImportError Exception Value: No module named 'Dajaxice' Exception Location: C:\Python33\lib\site-packages\dajaxice\core\__init__.py in &lt;module&gt;, line 3 But, always same error. I configured other file as dajax tutorial. Do you have any idea?
If that is your generated HTML then there's where the problem lies. If you followed the Dajaxice set up tutorial on their documentation, you probably used {% load dajaxice_templatetags %} {% dajaxice_js_import %} in the head of your templates. This is supposed to generate a static dajaxice.core.js file where your static folder is and show you something like &lt;script charset="utf-8" type="text/javascript" src="/static/dajaxice/dajaxice.core.js"&gt; in your generated HTML. If you have followed the installation steps for both Dasjax and Dajaxice exactly then define a STATIC_ROOT setting in your settings.py as the location of your static root folder (relative to the settings.py file) and then run python manage.py collectstatic this should give you 200 and eventually 304 responses for the Dajaxice javascript file and your app should run just fine.
0.555556
Create static dajaxice.core.js file with static folder
What's the difference between Fermi Energy and Fermi Level?
I'm a bit confused about the difference between these two concepts. According to Wikipedia the Fermi energy and Fermi level are closely related concepts. From my understanding, the Fermi energy is the highest occupied energy level of a system in absolute zero? Is that correct? Then what's the difference between Fermi energy and Fermi level?
It depends on who you ask. If you ask someone with solid-state physics background, they will probably answer along the lines of Colin McFaul or John Rennie: The fermi level is the same as chemical potential (or maybe one should say "electrochemical potential"), i.e. the energy at which a state has 50% chance of being occupied, while the fermi energy is the fermi level at absolute zero. If you ask someone with semiconductor engineering background, they will probably give the same definition of "fermi level", but they will say that "fermi energy" means exactly the same thing as fermi level. (The obvious question is, "Then what term would a semiconductor engineer use to describe the fermi level at absolute zero? The answer is, they call it "the fermi level at absolute zero"!)
1
"fermi energy" means exactly the same thing as fermi level
What does "deal" and "take " person mean?
E.g. when somebody say something like: Person 1: "Jeana can deal but not take." Person 2: "Yes, she always was the deal but not take person." Could somebody explain to me what "deal" and "take" person mean?
In this example, it looks like deal and take are being used in the same way that dish out and take are used in the following example (from wiktionary's dish out entry): She can dish out criticism but she can't take it. Just what it is that's being dealt or taken depends on context, but common examples include criticism, orders, and unsolicited advice.
0.777778
Deal and take is being used in the same way that dish out and take are used in this example
Running something in a cron environment?
Cron executes whatever program is sent to it in such a fashion that anything written to STDERR causes either the kernel (or cron I'm unsure) to receive SIGPIPE. How does this functionality work? Is cron sending SIGPIPE or is the kernel? How can I get that same effect, without running something in cron? Could someone tell me for instance how to run a Perl script such that #!/usr/bin/env perl warn 'foo'; print "bar; Receives a SIGPIPE when it tries to write 'foo' to STDERR, and never writes 'bar'? I want to see Perl terminate and shell variable $? return 255.
"How does this functionality work?" What you are describing is not really functionality, it's dysfunctionality caused by a misconception. It's not cron that sends the SIGPIPE, but it is because of the way you are using it. By default cron emails the stdout and stderr of a process to the owner of the crontab using sendmail (see man cron; if you don't have an MTA installed, the output is just discarded), unless they are redirected. To do this, it must wait for the process to complete. However, if you have backgrounded the process with &amp;: * * * * * /bin/someprogram &amp; It won't wait, and if the program now tries to write to stdout or stderr, it will get a SIGPIPE, because the pipe is broken (the read end was closed). [This might also happen to a non-background process on older crons if your MTA is missing and you have a lot of output] So I am going to guess that you have something like this in your crontab: * * * * * /bin/someprogram &gt; log.file &amp; Meaning the stdout is redirected to a file, but the stderr pipe is still broken. This has led you to the erroneous conclusion that "cron executes whatever program is sent to it in such a fashion that anything written to STDERR causes ... SIGPIPE". You can fix your crontab by either removing the backgrounding &amp; or redirecting stderr too: * * * * * /bin/someprogram 1&gt;&amp;2&amp;&gt; log.file &amp; If you want. WRT duplicating this yourself, as qqx says, just close one end of a pipe and then write to it.
0.666667
How does cron send SIGPIPE?
Driving electric cars through large pools of water
The state of California is expected to be hit by a large storm in the coming days and there are frequently clogged drains in my town. I have an electric vehicle that seemed to handle driving through large puddles during the last storm but I was curious if anyone could tell me what the potential hazards are of driving an EV through a large standing pool of water. I don't need to worry about getting water in the engine (I think) since there is no air intake. There are fans that cool the battery if it gets too hot but I don't think that will be a problem during this storm. EDIT: I have a Ford Focus
The answer to this question is what was put into its design at the drawing board stage. Encapsulation and water proofing of components susceptable to being submerged in water being the main consideration. As an electric vehicle construction is usually decided by its weight, less weight means less drain on the battery means greater distance between charges, encapsulation would not be a consideration. So I would be reluctant to drive through puddles higher then the hubs of the wheel at any sort of speed.
1
What was put into the design at the drawing board stage?
Why don't wifi managers remember mac addresses for hotspots to defeat the jasager attack?
So I just learned about the jasager attack, via the wifi pineapple and it struck me immediately that it wouldn't work at all if network managers (privately) associated MAC addresses with hotspots and asked for explicit permission if you were going to connect to a new physical device. Obviously this would be mildly irritating in public hotspots where devices change and hundreds of diverse locations share network names, but it would make home and work networks much harder to penetrate. I haven't found any wifi managers that do this, or at least I haven't found information that any do. My question: Am I missing something obvious? Would remembering MACs not actually increase security? If it would, are there any network managers that do this? (I'm on Linux, but if there are tools for other OS's I think it's worth having them in the answers)
Convenience, mostly: I'm now historically using my third AP device - each one has been completely different make and vendor, but as long as the configuration stayed the same (SSID, encryption mode, passphrase), there was no need to re-enter the AP data on any of the client devices. This may not be enough of an issue in a home setting; if you have hundreds of devices which can connect to the network, reconfiguring them when an AP dies would be a royal pain. Likewise, having multiple identically-configured APs (and thus a larger signal-covered area), the client devices will switch to the AP with the strongest signal without trouble. A few frames may be lost before the new MAC address location propagates through the local network, but overall the roaming is close to seamless. As for the "only connect to this AP if it has a specific MAC address" - this is already possible with NetworkManager on Linux: there is an option to specify the AP's BSSID, which should be the AP's MAC address (of course, the BSSID can be spoofed - hence "should").
1
Re-enter AP data on a third AP device
Index "server_name" not exist
I try to execute a bat, and in this file i try to acceed to this variable : $_SERVER['SERVER_NAME'] But it doesn't exist this index. In fact, when i try to print_r($_SERVER), there is no SERVER_NAME index. There is a reason ? Is it because i launch this function in a bat ? Have I an other solution for get this variable ? Thank you !
The $_SERVER['SERVER_NAME'] variable holds the name of the server as supplied by the HTTP client in the Host HTTP header field. Because you do not use HTTP, this variable is not defined.
1
$_SERVER['SERVER_NAME']
MonoTouch: How to save a huge PDF downloaded from an URL incrementally?
I need to download a huge PDF file from an URL in my MonoTouch iPhone/iPad newsstand app. The PDF is too big to fit in memory, so I need to save it incrementally with NSData. My idea is the following: instead of appending all the downloaded data in NSData and at the very end of the download, when I got all data, to store it to a file, I want to execute the download asynchronously in a separate thread and append to a file each received chunk and free my memory, but be certain that if the connection is dropped or the app crashes the download would resume automatically from the last chunk without corrupting the file. What do you suggest? Is there a better method? How can I do it in MonoTouch? I did't find any documentation or code example about iOS incremental download/resume on the Xamarin website.
You can use System.Net.WebClient and use the DownloadFile method, which will stream the data from HTTP to disk, without keeping it in memory.
0.888889
System.Net.WebClient and DownloadFile
PHP and MySQL calendar issue
I'm writing trying to build a calendar right from scratch. I'm using the function written by David Walsh (see link) and it's great. He does a query for each day's cell. But, I'm afraid that when the script's gonna have to run 30 queries in each render, it's gonna be sloooow. So, I was trying to think in another logic, for example, make a big query from X date to Y date at the begining of the script and then, at each day, check if that particular day has an event in the previous query. But I have no idea of how to do this... So, if anyone can help, please shout! Thanks.
Yes, I would go with your...uh...bold suggestion. As posted above, it makes no sense to run the query in a loop. What exactly do you need help with, then?
0.888889
How to run query in a loop?
Can I change my loan term from 60 to 36 months?
I am on a 60 months plan with USCCU and now they are offering APR rate of 1.36% for 36 months on used and new vehicles as shown here. Is it a good idea to change my loan term from 60 to 36 months considering the fact that I can afford the monthly installments which could be higher that what I am paying for in 60 months term with an APR rate of say, for example x%.
Some places banks/Credit Unions will allow you to refinance a auto loan. My credit Union only does this if the original loan was with another lender. They will send the money to the old lender, then give you a loan under the new terms. They are trying to get your business, not necessarily looking for a way make less money for themselves. You will have to see how much you will save. Which will be based on the delta of the length of the loan or the change in interest rate, or both. My Credit Union has a calculator to show you the numbers based on keeping the size of the payments the same, or keeping the number of payments the same. Make sure you understand any limitations regarding the refinance based on the age of the car, and if you are underwater.
1
How much can I refinance a car?
How TCP/IP server listens to several clients?
I'm setting up a small tcp/ip connection using GSM/GPRS modems, I have a server PC which runs a server (listener) program, and have several (more than 100) modems located in different places, they send small packets of data to the server in specific periods. I have tested system with one client, but how can I test it with several clients? how will my server respond to several clients? Here is my server code: private TcpListener tcpListener; private Thread listenThread; public static TcpClient client; public Form1() { InitializeComponent(); this.tcpListener = new TcpListener(IPAddress.Any, 2020); this.listenThread = new Thread(new ThreadStart(ListenForClients)); this.listenThread.Start(); } private void ListenForClients() { this.tcpListener.Start(); while (true) { //blocks until a client has connected to the server client = this.tcpListener.AcceptTcpClient(); //create a thread to handle communication //with connected client Thread clientThread = new Thread(new ParameterizedThreadStart(HandleClientComm)); clientThread.Start(client); } } private void HandleClientComm(object client) { TcpClient tcpClient = (TcpClient)client; NetworkStream clientStream = tcpClient.GetStream(); //TcpClient client = new TcpClient(servername or ip , port); //IpEndPoint ipend = tcpClient.RemoteEndPoint; //Console.WriteLine(IPAddress.Parse(ipend.Address.ToString()); //label3.Text = IPAddress.Parse(((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address.ToString()).ToString(); SetControlPropertyThreadSafe(label3, "Text", IPAddress.Parse(((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address.ToString()).ToString()); byte[] message = new byte[4096]; int bytesRead; while (true) { bytesRead = 0; try { //blocks until a client sends a message bytesRead = clientStream.Read(message, 0, 4096); } catch { //a socket error has occured break; } if (bytesRead == 0) { //the client has disconnected from the server break; } //message has successfully been received ASCIIEncoding encoder = new ASCIIEncoding(); //System.Diagnostics.Debug.WriteLine(encoder.GetString(message, 0, bytesRead)); string received_text = encoder.GetString(message, 0, bytesRead).ToString(); SetControlPropertyThreadSafe(label1, "Text", received_text); if (received_text == "cmdtim") { SendData(DateTime.Now.ToString()); } } tcpClient.Close(); } As you see I've created a separate thread for listening clients, how can I listen to several clients? Should I create a thread for each client? I don't know how many clients will I have in each moment, will the server buffer data of other clients when it listens to a specific client? What is the best strategy for listening to several clients and also sending all of them data?
Some advise: Remove: public static TcpClient client; Replace: client = this.tcpListener.AcceptTcpClient(); with TcpClient client = this.tcpListener.AcceptTcpClient();
0.666667
Public static TcpClient client
Has Jesus ever directly said he would die as a voluntary sacrafice? If so, wasn't it double sense?
I know about mentioning Jesus died to redeem mankind in evangelical literature like: For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life. (John 3:16) But I suspect these are only later interpretations. Has Jesus himself ever said his dead is a sacrifice? If so, isn't double meaning in Greek? At least in Czech, English and German you could use the phrase "he died for humans' sins" in sense of "because of" - like cause of his death was humans' fault - fault of the Romans who crucified him. (btw I think I understand the evangelical message so I'm not asking how christians get it today, so please don't make your interpretations of the direct Jesus' quote much distant) Thank you.
But I suspect these are only later interpretations. Has Jesus himself ever said his dead is a sacrifice? Jesus's death is placed in the context of a Passover (Seder) meal, and since the meal is literally a liturgy, it must be completed or the participants defy the commandment of God. Anyway, Four cups must be drunk to complete the ceremony, and the Eucharistic cup Christ passed around at table was what the Jews call "the cup of blessings," the third cup. However, any devote Jewish person would realize that the meal is then cut short, with Christ going to the Garden to pray while forgoing the fourth cup, meaning the meal was not completed. However, later on, in the Garden, Christ prays about "letting this cup pass from me," which still indicates that Christ has the fourth cup in mind. He is captured, and eventually sentenced, and again we hear "Truly I tell you, I will not drink again from the fruit of the vine until that day when I drink it new in the kingdom of God," another reference to the fourth cup. Notice how he refuses to drink the wine while he still hasn't suffered. After his agonizing pain on the Cross, right before His death, Christ is given some sour wine, which He does drink "And someone ran, filled a sponge with sour wine, put it on a stick, and gave it to him to drink (Mark 15)" which St. John, an eyewitness, describes in more detail: A jar full of sour wine was standing there. So they put a sponge full of the wine on a branch of hyssop and held it to his mouth. When Jesus had received the wine, he said, “It is finished.” Then he bowed his head and gave up his spirit (John 19:29-30) In all Gospel accounts, Jesus drank the wine and then died. That wine was the fourth cup which finished the Pasover meal. And what do Jews call the fourth cup? The cup of Salvation, meaning that the Cruxifiction was a part of the Last Supper which ended in the cup of Salvation, bitter in more ways than one. St. Mark and St. Matthew then go on to point out: "And the curtain of the temple was torn in two, from top to bottom" immediately after, which indicates that the relationship between God and Man was healed, He forgave Man, as forgiveness is the only way to continue a relationship. Thus, the Cruxifiction was for forgiveness. In other words, all four Gospels teach that the Cruxifiction was for the forgiveness of sins. It is not a later interpretation (as if that is a bad thing anyway :shrug:). Christi pax, Lucretius Note:* I assume Markian priority in this article, although I disagree with it. Note:** I also assume GJohn was written by an eyewitness. If you wish to believe otherwise (as the OP seems to implicitly believe), and instead see it as written by later Christians adding theological detail, that is fine. The point is that the Synoptics indicate the same events, although GJohn most clearly expresses the theological meaning, which are no less absent in the Synoptics, although they are not as clear. In a sense, one can see GJohn as a Gospel written to flush out more of the theological meanings of the other Gospels (which might be why GJohn is traditionally symbolized by an eagle, the bird that flies higher and sees farther than all other animals). Simply stated, the Synoptics, as well as the Old Testement, are the raw material which GJohn builds his theology.
0.888889
What do Jews call the Cruxifiction for forgiveness?
Wordpress 4 invalid username special charachters issue
I have some danish users that uses special chars like æøå and they can't log in to my wordpress blog. I tried on a fresh install on 4.2.2 and on 4.1.5 and it did not work, for example Andrew Schønnemann with a simple password and it did not work, got message ERROR: Invalid username. Lost your password?. But with user Andrew Schonnemann works fine, what could be the issue?
Found the answer, created the following function: function wscu_sanitize_user ($username, $raw_username, $strict) { $username = wp_strip_all_tags ($raw_username); return $username; } add_filter ('sanitize_user', 'wscu_sanitize_user', 10, 3);
0.888889
Function wscu_sanitize_user
How to get the path of android installed application
Hi I am new to Android and I want to know that how can we get the path of the installed application in android, So that we can open the file in our application by using that installed application. for example: I want to open the pdf file or doc file in my application but i require the path of that application which can open this file... Please Help me Thanks in advance...
This is not how things work in Android. To call another installed application, you'll have to do it with an Intent. Android will then select the application(s) best suited for what you're trying to do, and use them to open the file you need. In your example, the code would be something like this : Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/pdf"); startActivity(Intent.createChooser(intent, "Open PDF")); Look at the Intent javadoc to have more explanations about that (the createChooser part is here to allow the user to choose between various apps if more than one can open the designated file)
0.888889
Intent javadoc
How do I create a simple yet complex business layer?
I'm working with a fairly complex web application. It's split up into the following layers: Presentation - HTML Service layer - A REST and SOAP API communicating with the business layer Business layer - Contains the business logic. Data access - Provides access to the storage (SQL etc) The business layers contains classes encapsulating specific areas, such as customer registration, user management and more. The problem we are seeing is that the business layer is starting to get a bit messy. We have a single class handling customer management but as this area of the application grows more and more complex, the class grows and grows and become messy. For example, we may have the following classes class CustomerManager void CreateCustomer(...) void DeleteCustomer(...) class UserManager void CreateUser(..) void DeleteUser(...) void ActivateUser(...) void InactivateUser(...) void ResetPassword(...) Creating a customer involves creating users as well. So CustomerManager calls misc methods in the UserManager class. As the application has evolved, creating a new customer means roughly 10 different things needs to be done except for registring the customer in the database, such as informing sales, audit logging, configuring default user accounts, creating a default configuration for the customer, notifying end-users of their auto-generated passwords and more. So CustomerManager.CreateCustomer grows to ~100 lines of fairly hairy code. I'm trying to think of a good way to handle this but am assuming that there's some common good way to do this which I'm simply not aware of. I've considered creating "Task"/"Command" classes implementing small sub-processes and then let the CustomerCreation.CreateCustomer simply execute a set of tasks. I would have more classes but they would each do less things. I've also considering implementing some kind of global application-level event/plug-in systems where CustomerManager.CreateCustomer just creates the customer in the database and then publishes an event that the customer is created. Plug-ins/something can then subscribe to these events and do stuff such as informing sales and logging the fact. Using this method, I wouldn't have to actually update CustomerManager.CreateCustomer when I want to do more stuff which is something which feels attractive to me. What obvious design pattern am I missing?
Component architecture can provide good tools for fighting complexity of the business layer. For example, notifications can be done with registering subscribers (event handlers). A lot of logic can be done by adaptors, which will provide certain specific interfaces to your User and Customer interfaces. This way logic can be decoupled, making large monolithic classes unnecessary. Hopefully your platform already has some proven component architecture you can use, which is much better than implementing "plugins" from scratch. Older answer (see first comment): My first impression of having CustomerRegistration and UserRegistration classes with the methods mentioned is that OO analysis has not been properly accomplished. I always thought that having sensible entities at business layer is the only way to prevent the mess. My advice would be to redesign (if it is not late yet) the business layer classes to better reflect business entities and not frontend processes. It may well be, that after such a redesign complexity will be a fraction of what you have now, and, more important, natural representation of the problem domain will answer your goals better than classes, combined with seemingly related functions. For example, even as such, UserRegistration should not have DeleteUser method! The task naturally belong to UsersManager class or maybe UserRegistry, if you wish. In short, I think the problem is that classes are formed around action-like entities, which requires much more interconnections (=mess) than class system around (say) User, Customer, and Managers of those two (managers are more like containers). There is little point of making User Management OOA from scratch. Good examples can be found from many frameworks, and sometimes they handle much more complex things, like fine-grained authorization, role/permission management, group management, etc.
0.888889
Component architecture can help combat complexity of the business layer
It was a tough question. I thought it through, though. Rules for 'ough'?
Is there a rule, or rules, for how to pronounce ough? trough (short o, gh pronounced f), thought (short o, silent gh), though (long o, silent gh), through (oo, silent gh), tough (short u, gh pronounced f).
There are at least five ways to pronounce ough: tough, enough (rhymes with cuff) through (rhymes with blue) trough, cough (rhymes with off) ought, bought (rhymes with caught) bough (rhymes with cow) As for the rules, the only one I can think of is that the pronunciation found in thought only happens with the ough is followed by a "t". Other than that, there's really no way to tell by looking at the word. I remember the first time I met someone with the last name of Gough. I didn't know if it was pronounced as "go", "goff", "guff", or "gow" (that last one rhyming with "now," not "know"). English has many letter combinations like this; consider: earth vs hearth now vs low eight vs height food vs blood pint vs lint to name but a few. Some words (like bow and wind) have vowels that can be pronounced two different ways, depending on the meaning of the word, leading to some ambiguous sentences, like this one: He took a bow as he gave her a bow.
1
How to pronounce a 't'
What does biting off the Pitum have to do with Pregnancy?
I recently read that it's a Segulah (others put it as a minhag) for a pregnant woman to bite off the Pitum of the esrog on Hoshana Rabbah for an easy labor. (please correct me if I misunderstood it) What is the connection between biting off the pitum and childbirth? I read in the Halacha For Today email for Wednesday, 21 Tishrei 5772 (October 19, 2011). The original email read: It is a Segulah for pregnant women to bite off the Pitum of the Esrog on Hoshana Rabbah, and to give Tzedakah and daven for an easy labor. (See Likutei Maharich Sukkos page 106a. See also Elef Hamagen Siman 660:6 and Sefer Moed L'Kol Chai Siman 24:25 where a special Tefilah text is printed for the woman to say)
According to some the sin of the Eitz HaDaas was with a Esrog tree. Through this came the curse of pain by child birth. When the lady bites the Pittum she is saying "just like I have no enjoyment now, I had no enjoyment then (at the sin of the Eitz HaDaas). Taamei HaMinhagim Likutim 68
0.666667
The sin of the Eitz HaDaas was with a Esrog tree
Formating Text added via Data Sets in Photoshop
I've been using Data Sets to fill alot of my graphics with Text. However I want the text to have different formatting styles (New Lines, Tabs, Bold and Italic to be specific) with certain words. For example: "He should have seen it coming." I'm using .csv Files for Data. Are there any "special characters" I can insert to allow this? Or any other way to do this using standard Data Sets in Photoshop (CS3)? I want to avoid editing each file seperatly. Thanks in Advance!
Unfortunately, text replacement in Photoshop is a bit of an all-or-nothing proposition. When it comes to text, PS is a fairly blunt instrument, and lacks the sophistication of a layout program like InDesign. You can preset the basic text styling, but any fine tuning, such as italicizing individual words, is going to have to be done by hand. I've not tested tabs, but I expect that you can insert an actual tab in a text field in a comma-delimited file and have that honored by Photoshop. There aren't any special codes that would make this work. That said, what you are trying to do most likely can be accomplished by scripting. There are plenty of helpful folks who hang out on SO and on the Adobe Photoshop scripting forum. In my experience, scripters are terrifically willing to help out when asked.
0.777778
Text replacement in Photoshop is an all-or-nothing proposition
Existing proofs of Rokhlin's theorem for PL manifolds
I'm looking for a comprehensive reference to existing proofs of Rokhlin's theorem that a 4-dimensional closed spin PL manifold has signature divisible by 16. I'm specifically interested in direct proofs (if any such exist) which do not rely on the fact that $\pi_i(PL/O)=0$ for small $i$. The most commonly cited reference seems to be the book by Kirby "The Topology of 4-manifolds". But the proof there is for smooth manifolds and I'm not sure why it works for PL manifolds although I've seen it claimed in various places that it does. The same is said about Rokhlin's original proof but I don't know why that's true either. I would also like to know if other proofs for PL manifolds exist. I'm particularly interested to know if there is a PL proof based on the Atiyah-Singer index theorem.
There is a proof which uses quantum invariants. Since these invariants are typically defined using state-sums and are combinatorial in nature, I suppose that they work in the PL setting. A nice introduction is Justin Roberts' PhD thesis where Rohlin's theorem is proved as Corollary 5.14 at page 55.
0.833333
Quantum invariants are defined using state-sums
executeQuery only working for queries when mySQL commands are uppercase?
I am developing a two-tier java application that basically displays mySQL database results in a JTable in a GUI. The mySQL queries are typed in by the user in a textArea and then an 'execute command' button is pressed and the mySQL results corresponding to that command simply appear in the JTable. The problem I am running into is when I try to type in a query such as "SELECT * FROM bikes WHERE COST=10000;" everything works as expected and results are returned. However, if I type in "select * from bikes where cost=10000;", no results are returned and basically nothing happens, not even getting an error. I tried running 'toUpperCase()' on the query, which didn't fix the problem. I was wondering what might be causing this problem? I am aware that mySQL is not case sensitive, so it should work even if my SELECT is lower case... The code below is a snippet of the area that might be causing the problem. public void setQuery(String query) throws SQLException, IllegalStateException{ if(!connectedToDatabase) throw new IllegalStateException("Not Connected to Database"); String firstWord = query.substring(0, 6); if(firstWord.toUpperCase().equals("SELECT")){ resultSet = statement.executeQuery(query); } else if(firstWord.toUpperCase().equals("INSERT") || firstWord.toUpperCase().equals("DELETE") || firstWord.toUpperCase().equals("UPDATE")){ statement2.executeUpdate(query); } metaData = resultSet.getMetaData(); resultSet.last(); numberOfRows = resultSet.getRow(); fireTableStructureChanged(); }
Try using equalsIgnoreCase instead of straight equals. If you don't know if the code is getting into an if block, try adding some logging into that block. Assuming it is getting into the block, the query is likely causing the problem.
0.888889
logging into if block
Left align equation description
I have a short description for each of my equations. I want to have them flushleft (similar to the equation numbers which are flushright). How can I do that? Here is a MWE: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \text{this is my first equation: } z = x \end{equation} \begin{equation} \text{this is my second equation: } z = x+y \end{equation} \end{document} And my desired output is like this:
The following example uses environment tabular* to simulate the equations and to achieve the alignment requests: \documentclass{article} \usepackage{amsmath} \usepackage{array} \begin{document} \noindent A\hfill Z \begin{center} \begin{tabular*}{\linewidth}{% @{}l% description @{\extracolsep{\fill}}% &gt;{$\displaystyle}c&lt;{$}% simulate displayed equation &gt;{\refstepcounter{equation}\thetag\theequation}r@{}% equation number } this is my first equation:&amp; z = x &amp;\\ this is my second equation:&amp; z = x + y &amp;\\ \end{tabular*} \end{center} \noindent A\hfill Z \end{document}
0.777778
environment tabular* to simulate the equations
Use multiselect false property with checkboxCellTemplate
I have an ng-grid that utilizes the showSelectionCheckbox: true property with a custom checkboxCellTemplate. If I remove checkboxCellTemplate I get the functionality I want where only one checkbox can be clicked at a time and clicking another checkbox will remove the selection from the previous one. I need the template to call a specific function so my question comes down to what property to I have to pass in the template so it can be aware of the multiselect property? The plunker can be found at http://plnkr.co/edit/nULoI4?p=preview.
So to clarify you're wondering if you can get all the values that are selected when you call a function? Don't you already have this setup in the $scope.selections. You could pass this in the function of the template by doing something like this ng-click="getDeliveryLocation({{selections}})". Another thought is that you use afterSelectionChange:function(){} and add in whatever you need instead of the ng-click on the checkmarks. This will remove some of the odd issues you have between the different selects.
1
How do you get all the values that are selected when you call a function?
Drawing (R)-1,1,2-trimethylcyclohexane
I tried drawing out (R)-1,1,2-trimethylcyclohexane but I can't seem to figure it out. I think I"m getting hung on assigning priorities. I've labeled the chiral carbon with an asterisk. I've also drawn out all the groups it is attached to. I gave the hydrogen the lowest priority (4) and I'm giving the methyl carbon a priority of 3. I am giving the other carbons priorities of 1 and 2 (as can be seen in the picture). However, this doesn't seem to make any sense; I get a molecule that I can neither assign S nor R to since the numbers are out of order. Also is this really an image of (R)-1,1,2-trimethylcyclohexane?
You've correctly identified the chiral center in your molecule (the carbon with the asterisk), that is the first step. When doing work with chiral centers, it is very important to use solid lines to denote bonds in the plane of the screen, bold wedges to denote bonds coming from the plane of the screen towards the viewer and dashed wedges to denote bonds from the plane of the screen away from the viewer. Drawing all 4 bonds as simple solid lines, as you did, will often lead to confusion. Look at the figures below, both enantiomers of 1,1,2-trimethylcyclohexane are shown. The next step in assigning R/S configuration is to rank the 4 groups around the chiral carbon by molecular weight, with "1" being assigned to the highest molecular weight group, and "4" to the lowest (you also did this correctly). Now, grab the "4" group in your hand so that groups "1" through "3" form a circular pattern between your eye and your hand. If moving from 1->2->3 involves clockwise movement, then this is the "R" configuration. If the movement is counterclockwise, then it is the "S" compound you are observing. Take a look at this link for a nice picture of what I'm describing. You cannot determine the R/S configuration of the chiral carbon in the compound you've drawn on paper at the top of your post because it is unclear which group 3 or 4 is projecting towards the viewer and which is projecting away from the viewer. Finally, note that my "R" drawing matches the "R" drawing at the bottom of your post.
1
Using solid lines to denote bonds in the plane of the screen
Is it possible to get a popup to ignore MenuDropAlignment in a WPF / Touch app?
As a bit of background - Windows has a facility for Touch/TabletPCs whereby it shifts the position of popups/menus depending on your "handedness" (to prevent the menu appearing under your hand). Essentially what this does is if you are set to "right handed" (which it seems to default to once you've connected a touch device), every popup you open is artificially kicked to the left - this causes massive layout issues where we try and line up a popup with the item it "popped up from" : Tablet PC Settings set to Left handed - no artificial correction from Windows Tablet PC Settings set to Right handed - Windows artificially adjusts our positioning We can detect what this setting is set to with SystemParameters.MenuDropAlignment, and for trivial popups we can adjust this using the actual width of the popup - but for dynamic popups and when we throw right to left support into the mix, this just doesn't work. Currently it's looking more likely that we are going to have to go through every popup, manually work out a value to adjust the kick, and add something like this to every one: &lt;MultiDataTrigger&gt; &lt;MultiDataTrigger.Conditions&gt; &lt;Condition Binding="{Binding Source={x:Static SystemParameters.MenuDropAlignment}}" Value="True"/&gt; &lt;Condition Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=FlowDirection}" Value="RightToLeft"/&gt; &lt;/MultiDataTrigger.Conditions&gt; &lt;MultiDataTrigger.Setters&gt; &lt;Setter Property="HorizontalOffset" Value="-50"/&gt; &lt;!-- Set to arbitrary value to test --&gt; &lt;/MultiDataTrigger.Setters&gt; &lt;/MultiDataTrigger&gt; So.. back to the question :-) Does anyone know of a way to stop a WPF popup looking at this setting at all? For those that don't have a touch device you can access the Tablet PC settings by running: C:\Windows\explorer.exe shell:::{80F3F1D5-FECA-45F3-BC32-752C152E456E} And see the mess it makes for yourself :-)
It would appear this just isn't possible, so we are resorting to the MultiDataTrigger in the question to compensate.
0.666667
MultiDataTrigger in the question
Solve for time, given distance and acceleration
Two gangsters are flying down I-70 West at a constant 108 hm/hr. If they make it to Indiana, they will be safe. When they are 1 km away from the Indiana border, while still traveling at a constant 108 km/hr, they pass a concealed police car hidden in a speed trap. At the instant that the criminals pass the patrol car, the cop pulls onto the highway and accelerates at a constant rate of 2 m/s^2. Does the cop catch up with them before they cross the state line? Here's what I have progressed so far ΔV = (ΔX)/(T) when V is velocity, X is distance, and T is time. 108 = (1 - 0)/T 108T = 1 T = 1/108 T = 0.00925 hours T = 0.00925 * 60 * 60 T = 33.33 seconds (this is the time it takes the gangsters to get to the borders of Indiana) What I am stuck at is the time it takes the cop to travel the same distance. I have used the distance formula to find time as follows: Xf = Xi + 1/2 * A * T^2 where A is acceleration Since the cop is starting from rest, the initial velocity is 0 (zero), so 1 = 0 + 1/2 * (2) * T^2 1 = T^2 T = 1 seconds So it takes the cop 1 seconds to travel the whole mile to Indiana? What am I doing wrong?
The acceleration is in meters/second^2 but the distance is 1 kilometer=1000 meters. The left side should be 1000, not 1.
1
acceleration is in meters/second2 but distance is 1 kilometer=1000 meters
Stocks and Bankruptcy
Trying to understand what happens when a company goes in and out of bankruptcy. I'll use American Airlines as an example because it's what I've been following for some years. In November 2011, AA announced its bankruptcy; its stock, which was sliding, dropped to 0.38. It stayed flat during 2012, and now that a merger deal has been approved, it climbed up to almost 12. During 2012 I thought of buying some AA stock because it was so damn cheap. If I had, I could be selling it today for a nice 32x profit. But at the time I was adviced not to - I was told because the company was bankrupt, its stock was just for speculators, pump and dump schemes, and so on, and it would become worthless when the company merged (it would be delisted and a new one added). So when I read that the merger was approved, I expected it to drop to near zero. Instead, it climbed sharply. Can anyone explain what's going on? If I had bought in 2012, what would have been the risk to offset this fantastic 32x reward? What will actually happen to AA stock once it exits bankruptcy? It sounds too good to be true, so it probably is, but I can't see why. What am I missing? Why didn't everyone buy AA during 2012?
As Mhoran said, the risks of buying a bankrupt company are huge, and even successful bankruptcy turnarounds don't involve keeping the same stock. For instance, the GM bankruptcy was resolved by the company more or less selling all its valuable assets (brands, factories, inventory) to a new version of itself, using that money to pay off what liabilities it could, and then dissolving. The new company then issued new stock, and you had to buy the new stock to see it rise; the old stock became worthless. AA could have gone the same way; Delta could have bought it out of bankruptcy and consumed it outright, with any remaining shareholders being paid off at market value. That's probably the best the market was hoping for. Instead, the deal is a much more equal merger; AMR brings a very large airport network and aircraft fleet to the table, and Delta brings its cash, an also-considerable fleet and network, and a management team that's kept that airline solvent. The stockholders, therefore, expect to be paid off at a much higher per-share price, either in a new combined stock, in Delta stock, or in cash.
0.777778
GM bankruptcy was resolved by the company selling all its valuable assets to a new version of itself . AA could have gone the same
Can't verify signature in JAVA but success in .NET
We have old system using .NET 3.5 (run on Windows Server 2003 32bits) to verify e-receipts from our customers (all use SHA1RSA algorithm as agreement). We store their certificates in database in Base64 string. Old code look like that: //Store certificates String certificateEncodeBase64 = Convert.ToBase64String(byteArrayCertificateFile); //Verify signatures //Hash algorithm SHA-1 HashAlgorithm hashAlgrothm = new SHA1Managed(); //Data byte[] data = System.Text.Encoding.UTF8.GetBytes(request.DataInUTF8); //Signature byte[] signature = Convert.FromBase64String(request.SignatureInBase64); //Certificate X509Certificate2 certificate = new X509Certificate2(Convert.FromBase64String(certEncodeBase64)); //Verify using algorithm RSA RSACryptoServiceProvider pubKey = (RSACryptoServiceProvider)certificate.PublicKey.Key bool vr = pubKey.VerifyData(data, hashAlgrothm, signature); Nothing issues except the performance is not good. That's why we want to move to new system using Java 1.7 (run on Windows Server 2012 64 bits). Our new code look like that: //Using the same DB store certificates //Verify signatures using Bouncy Castle JCE Provider //Hash data using SHA-1 byte[] data_ = request.getDataInUTF8().getBytes("UTF-8"); MessageDigest messageDigest_ = MessageDigest.getInstance("SHA-1", "BC"); byte[] hashed = messageDigest.digest(data); //Signature byte [] signature = new BASE64Decoder().decodeBuffer(request.getSignatureInBase64()); //Certificate CertificateFactory certificateFactory = CertificateFactory.getInstance("X509", "BC"); byte[] buffer = new BASE64Decoder().decodeBuffer(certEncodeBase64); ByteArrayInputStream byteArrayCertificateInputStream = new ByteArrayInputStream(buffer); Certificate certificate = certificateFactory.generateCertificate(byteArrayCertificateInputStream); //Verify using algorithm RSA Signature verifyEngine = Signature.getInstance("RSA", "BC"); verifyEngine.initVerify(certificate); verifyEngine.update(hashed); result = verifyEngine.verify(signature); And we get this problem: In our test using all verified data taken from old system, new system verify some customer's data but some customers always return fail. For one failed example Certificate in Base64 MIIGVzCCBD+gAwIBAgIQVAHV43oelxumKTwtrMV+ljANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJWTjETMBEGA1UEChMKVk5QVCBHcm91cDEeMBwGA1UECxMVVk5QVC1DQSBUcnVzdCBOZXR3b3JrMSUwIwYDVQQDExxWTlBUIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEyMDQxNjA1NTg0NloXDTE0MDQxNjA1NTg0NlowgcExCzAJBgNVBAYTAlZOMRIwEAYDVQQIDAlIw6AgTuG7mWkxFzAVBgNVBAcMDkhhaSBCw6AgVHLGsG5nMTMwMQYDVQQKDCpOR8OCTiBIw4BORyBUTUNQIEPDlE5HIFRIxq/GoE5HIFZJ4buGVCBOQU0xUDBOBgNVBAMMR05Hw4JOIEjDgE5HIFRNQ1AgQ8OUTkcgVEjGr8agTkcgVk4gLSBUUlVORyBUw4JNIEPDlE5HIE5HSOG7hiBUSMOUTkcgVElOMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqxx3EzTjZLaBh2ymig4aQoqZK5R/wiVnq8hGUjyG95Fvr+IZvBKrE0Rp6+yZI5yQfWhLKoXwrcfV9qwYvDaeL7BQJpCDnEu3Xih3E66o59/zx/PjSCbhA+c9kuu5irasTLuxX2iUBbBZjzDw4TLzcWeo7HAY+WgNik1YjOy8ZINnYJfB99cwpvDpAL1nw+4dX8hYaKbwJiVLf+KwGvj/v/jxTCiZo1Ob48chiw88Y2S3ak0K26euZxQ3lFYoMKs0qp2FQuK7x0B1UY3WymXc+qWFp6z7p+XiVIyr0Rv1/C8mO4AzCY2xKkfkPTkWyHay5NffbP8gJYV+J/KYO6uDEQIDAQABo4IBoDCCAZwwcAYIKwYBBQUHAQEEZDBiMDIGCCsGAQUFBzAChiZodHRwOi8vcHViLnZucHQtY2Eudm4vY2VydHMvdm5wdGNhLmNlcjAsBggrBgEFBQcwAYYgaHR0cDovL29jc3Audm5wdC1jYS52bi9yZXNwb25kZXIwHQYDVR0OBBYEFM+JjYgczFow9j23/ufgnb0BiO91MAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUBmnA1dUCihWNRn3pfOJoClWsaq8wdgYDVR0gBG8wbTA0BgkrBgEEAYH6OgIwJzAlBggrBgEFBQcCARYZaHR0cDovL3B1Yi52bnB0LWNhLnZuL3JwYTA1BgsrBgEEAYH6OgICAjAmMCQGCCsGAQUFBwICMBgeFgBEAEkARAAtAEIAMQAuADAALQAyAHkwMQYDVR0fBCowKDAmoCSgIoYgaHR0cDovL2NybC52bnB0LWNhLnZuL3ZucHRjYS5jcmwwDgYDVR0PAQH/BAQDAgTwMB8GA1UdJQQYMBYGCCsGAQUFBwMCBgorBgEEAYI3CgMMMA0GCSqGSIb3DQEBBQUAA4ICAQBvkxvjAFJKM5/4wgtW2wx+Q0O2XhanV5nPv+mW2dODyner4wki+7hZQZ6LeufZ/ktNKAv2gm9Jt9uiQDVNh037WJu5haYBhxGFgFr96ZY9Cb9boPJ5p7u+k3K/4EDlmmVh4QgV/3HbKedpfvU7QtpSHyv6Fff7KaP3MzFgQZekocHaB8kRn8XL6vc+OLZp+wXeg9WYL9x0aO+JUSU5mWzPKX5tVukgciVWblVAN8jVOgZl+VgkJa10dQZP32Zk6AuBmznQJu8Oxpbrn600lyC8lj78f2tNxTgYrbw28Cx5+N5YYL7lIzsJAfnfKNTlFx9me/a/CL8b1KWx0FyjUN50tU7C2GX+Vt/lnSlvfH5gU/UKbiorqz5pyEzSocmScrcuWuzvZzHQkgxP/fsGfrAfN9cl+2GPewtzb+e2WaGoBo56t908IBDaQGlwHx5lpnM8i/8LERXv4It37SqdSe/2mtah7AvmIYkYu6REVQC1/bnfra7/gtk5i/nGA8vdxU417VgYOmQu2sYcEPd/3KhDjImiAkYd6UzFGXpZJL8/uqjL70U7++V6VObjpbsOuuZwh1Xl9h2Mbds++EnUvmP+Jb8R9m0U4dPFr8POexPJwdDGLE5aEjn4TrPgkEIaKyx+FRVLZUJzUELQODfvdGgt8eSNSTqRc+xp3/eutP56NQ== RawData &lt;HEADER&gt;&lt;VERSION&gt;1.0&lt;/VERSION&gt;&lt;SENDER_CODE&gt;TTSP_ICB&lt;/SENDER_CODE&gt;&lt;SENDER_NAME&gt;He Thong Thanh toan song phuong cua Ngan hang Vietinbank&lt;/SENDER_NAME&gt;&lt;RECEIVER_CODE&gt;TTSP_KBA&lt;/RECEIVER_CODE&gt;&lt;RECEIVER_NAME&gt;He thong Thanh toan song phuong cua Kho bac Nha nuoc&lt;/RECEIVER_NAME&gt;&lt;TRAN_CODE&gt;103&lt;/TRAN_CODE&gt;&lt;MSG_ID&gt;TTSP_ICB103004203763&lt;/MSG_ID&gt;&lt;MSG_REFID /&gt;&lt;SEND_DATE&gt;04-03-2014 09:03:15&lt;/SEND_DATE&gt;&lt;ORIGINAL_CODE&gt;TTSP_ICB&lt;/ORIGINAL_CODE&gt;&lt;ORIGINAL_NAME&gt;He Thong Thanh toan song phuong cua Ngan hang Vietinbank&lt;/ORIGINAL_NAME&gt;&lt;ORIGINAL_DATE&gt;04-03-2014 09:03:15&lt;/ORIGINAL_DATE&gt;&lt;ERROR_CODE /&gt;&lt;ERROR_DESC /&gt;&lt;SPARE1 /&gt;&lt;SPARE2 /&gt;&lt;SPARE3 /&gt;&lt;/HEADER&gt;&lt;BODY&gt;&lt;MT_ID&gt;1420110300335833&lt;/MT_ID&gt;&lt;SEND_BANK&gt;89201001&lt;/SEND_BANK&gt;&lt;RECEIVE_BANK&gt;89701002&lt;/RECEIVE_BANK&gt;&lt;CREATED_DATE&gt;04-03-2014 09:26:24&lt;/CREATED_DATE&gt;&lt;CREATOR&gt;DD740063&lt;/CREATOR&gt;&lt;MANAGER&gt;DD740096&lt;/MANAGER&gt;&lt;VERIFIED_DATE&gt;04-03-2014 09:29:41&lt;/VERIFIED_DATE&gt;&lt;F20&gt;1474010300001334&lt;/F20&gt;&lt;F23B&gt;CRED&lt;/F23B&gt;&lt;F26T&gt;C&lt;/F26T&gt;&lt;F32AS1&gt;04-03-2014&lt;/F32AS1&gt;&lt;F32AS2&gt;VND&lt;/F32AS2&gt;&lt;F32AS3&gt;324000000.00&lt;/F32AS3&gt;&lt;F33BS1&gt;VND&lt;/F33BS1&gt;&lt;F33BS2&gt;324000000.00&lt;/F33BS2&gt;&lt;F36 /&gt;&lt;F50P1&gt;VND101101001&lt;/F50P1&gt;&lt;F50AP2 /&gt;&lt;F50KP2&gt;HUYNH THI KIM THOA&lt;/F50KP2&gt;&lt;F51AP1S1 /&gt;&lt;F51AP1S2 /&gt;&lt;F51AP2 /&gt;&lt;F52P1S1 /&gt;&lt;F52P1S2 /&gt;&lt;F52AP2&gt;89201001&lt;/F52AP2&gt;&lt;F52DP2&gt;89201001&lt;/F52DP2&gt;&lt;F53P1S1 /&gt;&lt;F53P1S2 /&gt;&lt;F53AP2 /&gt;&lt;F53BP2 /&gt;&lt;F53DP2 /&gt;&lt;F54P1S1 /&gt;&lt;F54P1S2 /&gt;&lt;F54AP2 /&gt;&lt;F54BP2 /&gt;&lt;F54DP2 /&gt;&lt;F55P1S1 /&gt;&lt;F55P1S2 /&gt;&lt;F55AP2 /&gt;&lt;F55BP2 /&gt;&lt;F55DP2 /&gt;&lt;F56P1S1 /&gt;&lt;F56P1S2 /&gt;&lt;F56AP2 /&gt;&lt;F56CP2 /&gt;&lt;F56DP2 /&gt;&lt;F57P1S1&gt;C&lt;/F57P1S1&gt;&lt;F57P1S2 /&gt;&lt;F57AP2&gt;89701002&lt;/F57AP2&gt;&lt;F57BP2 /&gt;&lt;F57CP2 /&gt;&lt;F57DP2&gt;KBNN PHU TAN - AN GIANG&lt;/F57DP2&gt;&lt;F59P1&gt;372301048091&lt;/F59P1&gt;&lt;F59AP2 /&gt;&lt;F59P2&gt;UBND XA BINH THANH DONG#####&lt;/F59P2&gt;&lt;F70 /&gt;&lt;F71A&gt;SHA&lt;/F71A&gt;&lt;F71GS1 /&gt;&lt;F71GS2 /&gt;&lt;F72&gt;UBND XA BINH THANH DONG NOP TIEN XE CHUYEN BENH&lt;/F72&gt;&lt;F77B /&gt;&lt;F77TS1 /&gt;&lt;F77TS2 /&gt;&lt;F77TS3 /&gt;&lt;F77TS4 /&gt;&lt;F77TS5 /&gt;&lt;F77TS6 /&gt;&lt;F77TS7 /&gt;&lt;F77TS8 /&gt;&lt;F77TS9 /&gt;&lt;F77TS10 /&gt;&lt;F77TS11 /&gt;&lt;F77TS12 /&gt;&lt;F77TS13 /&gt;&lt;F77TS14 /&gt;&lt;F77TS15 /&gt;&lt;F77TS16 /&gt;&lt;F77TS17 /&gt;&lt;F77TS18 /&gt;&lt;F77TS20 /&gt;&lt;F77TS19 /&gt;&lt;/BODY&gt; Hash data in Base64 using SHA-1 KLpuojRk329lb++8CFKTFADh+3c= Signature in Base64 KWMVPKpQ8Pg3fUij9pND/me3orlplkbdNLWcH5rztMhIz0BjTN8CJJHiFrN1w1Qkih0lSl24zDE5nbYw/vo+EG3tSJzC+d/h7wkm6ad9LHt5Y0cxYRIKWSHJRbCjkOXcO/eE3KZaAZONGEVWt1bLkL3zERN11RAyZjFEzrGE7WbiLvp/51Cy5zBU/mLJts3waiEpqycjOOVNo59ICulwclhcPR+gVzcwh65oxBelI+XRbRN1PfEw5J48R6fTwmdtRzD+OJejMLHmiHUBErRNo+XG7Q5ovwY1AG2GfCOCYIOu2jYd5DD9ZDuLEMa54Uz7cy3UbciXG5/n+7GtLfGeHA== For investigate further, we debug class DigestSignatureSpi that Bouncy Castle use to verify at line try { sig = cipher.processBlock(sigBytes, 0, sigBytes.length); expected = derEncode(hash); } catch (Exception e) { return false; } sig is [48, 33, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20, 40, -70, 110, -94, 52, 100, -33, 111, 101, 111, -17, -68, 8, 82, -109, 20, 0, -31, -5, 119] while expected is [40, -70, 110, -94, 52, 100, -33, 111, 101, 111, -17, -68, 8, 82, -109, 20, 0, -31, -5, 119] This debug show sig include expected bit (last 20 bytes). I don't know what is wrong. PLEASE HELP!!! Thank you.
I don't think you're using the correct signature algorithm. The documentation suggests that you should probably be using SHA1withRSA as the signature algorithm. This is further indicated by the signature vs. expected. The "expected" value you give is the raw SHA-1 hash, whereas the signature you're providing is a PKCS#1 v1.5 DigestInfo (See RFC2313, section 10.1.2).
0.888889
Signature vs. expected
Retirement Funds: Betterment vs Vanguard Life strategy vs Target Retirement
I'm a 20 something grad student and would like to open a hands off retirement account with beta exposure to the market and would make monthly contributions. I'm fairly illiterate when it comes to investing, and the betterment account seems so user friendly. However, I realize it is a more expensive fund. Being that I can do math, I realize these fees add up over time. However, I like that betterment re-balances it self and I really like that it allows one to easily change the allocation of stocks and bonds. I know I said I wanted a hands off account, but what if the stock market crashes and I want to allocate more to bonds??? Does Vanguard re-balance and allow you to reallocate? So far, I'm am leaning towards Vanguard? Does Betterment have advantages? Which Vanguard fund is more appropriate for a hands off investment account for retirement? Both Vanguard accounts (Life strategy vs Target retirement) seem to have very similar fees and returns over the last 5 years. Thank you in advance.
Katherine from Betterment here. I wanted to address your inquiry and another comment regarding our services. I agree with JAGAnalyst - it's detrimental to your returns and potential for growth if you try to time the market. That's why Betterment offers customized asset allocation for each portfolio based on the nature of your goal, time horizon, and how much you are able to put towards your investments. We do this so regardless of what's happening in the markets, you can feel comfortable that your asset allocation plus other determining factors will get you where you need to go, without having to time your investing. We also put out quite a bit of content regarding market timing and why we think it's an unwise practice. We believe continuously depositing to your goal, especially through auto-deposits, compounding returns, tax-efficient auto-rebalancing, and reinvesting dividends are the best ways to grow your assets. Let me know if you would like additional information regarding Betterment accounts and our best practices. I am available at [email protected] and am always happy to speak about Betterment's services. Katherine Buck, Betterment Community Manager
1
Betterment offers customized asset allocation for each portfolio based on the nature of your goal, time horizon, and how much you are able
How do I counter support Zyra?
I main support, usually opting for poke supports such as Lulu and Sona or aggressive supports such as Blitzcrank and Leona. Since the various Regional Finals, however, I've begun to encounter support Zyras in my bot lane. This is a very difficult lane for me. I can't establish lane dominance, since Zyra just sits in her bush and puts seeds in mine. I've tried a rune page with flat MR for when I play against Zyra to counter some of her harass, but it doesn't help against her cc. How can I effectively counter a support Zyra?
I just played as Janna against Zyra in a MF vs MF match-up. Key was to sheld in time of the damage that was comming while being in range of friendly MF and also well positioned. I simply wasnt skillfull enough with the sheld, so we got pushed back and Tower fell. You are now be thinking that I should sheld the Tower, but trying to sheld MF or myself (often too late) made the skill go on cooldown when the Tower was taking damage. Janna should be a useful counter, but it takes more skills than me and most supports players have.
1
Janna vs Zyra
why EF cant translate Int32.Pars(...?
why EF cant translate Int32.Parse in Where Condition section? for example below code has error : var query = (from list in dbContext.Packages where list.Id == Int32.Parse(Request["Id"].ToString()) select list).FirstOrDefault(); i solved this problem : Int32 ID = Int32.Parse(Request["Id"].ToString()); var query = (from list in dbContext.Packages where list.Id == ID select list).FirstOrDefault();
Because the query is simply an Expression that gets translated into SQL. EF doens't know how to translate Int32.Parse into an equivalent SQL statement, so it fails.
0.555556
Translating Int32.Parse into SQL
Log out user to change home dir and then re login - Linux
I'm trying to change git user's home directory using: sudo usermod -d /home/git git However, the response I receive is: "user git is currently logged in". How can I logout that user, change the home directory and then login it again? Thanks
Find processes/services started under user git: ps axu | grep "^git" And stop/kill them all. Then you will be able to change home directory for this user.
0.888889
Find processes/services started under user git
What's the highest number of countries whose borders meet at a single point?
What is the maximum number of countries meeting at a single point on earth? Where is it? What are the countries?
To some extent, this depends how you define a "country". For one definition of country, the maximum countries that meet at a single point is 7. The countries that meet at this single point are : Argentina Australia Chile France New Zealand Norway United Kingdom The point where they all meet? Latitude 90 degrees South - otherwise known as the South Pole! All of the countries have territorial claims to pie-shapes pieces of Antarctica, meeting at (or at least, near) the south pole as a part of the Antarctic Treaty.
1
Maximum countries that meet at a single point is 7 .
Easiest way to persist data on a PHP page
I a web application that I am developing (being developed in PHP) when a user posts any request for service the user has to fill in a very length form. Once user fills in the form and submits it another page (confirmation page) is loaded in which all values filled in by user are show. I must point out that at this stage the data is not saved to MySQL yet. Now on this page the user can either save the service request or go back. My problem starts here. When the user goes back. All data filled in is lost. BTW User tend to use Browsers Back button instead of the back button provided on the confirmation page. How can is persist data filled in by user so that user can edit/make changes to data and again submit changed data.
On your confirmation page you can put a form with hidden fields that contain all values and a Back submit button which will post them to the previous page. You could also have a second submit button on this form which will post to an url that will write the values to the database.
1
On your confirmation page put a form with hidden fields and a Back submit button .
How do I export a Keynote Presentation to PDF while embedding the font
It seems like the export to PDF option currently exists on Keynote (version '09) does not embed the font I use. What are my options besides buying Adobe Acrobat Professional?
I have tested the font you mention in exporting pdf (best quality) from keynote and it is both embedded and displays correctly on my iOS devices using Adobe Reader or iBooks to open the file. It should work for you as well. If not, feel free to send me an example of your pdf for testing (tom at bluesky dot org).
1
How to export pdf from keynote
Why does Bane's henchman sacrifice himself?
In the very beginning of the movie (the airplane scene,) when Bane is about to leave the plane with the nuclear scientist, the following dialogue takes place between Bane and one of his men: Bane: No, they expect one of us at the wreckage brother. Man: Have we started the fire? Bane: Yes, the fire rises. And then the guy just gives up his parachute and stays behind in the plane. What is this all about? Does Bane have mind-manipulating powers of some sort, or are his men just so loyal that they are willing to kill themselves just because he asks them to nicely? And what about the word "brother"? It reminds me of cult leaders who convince people to just kill themselves so that they can be redeemed. In addition, what is Bane's ethnic background supposed to be in the movie? He clearly has an accent in English.
Bane was in the prison pit and escapes where he joins the League of Shadows. After Bruce kills the leader Bane becomes the leader for the League of Shadows. So in a way Bruce is responsible for the Bane's authority over the league. I thought it was mentioned in the film, that after his training by the league he returns to the prison pit and frees the prisoners. They all join him as his army to take over Gotham. The prison pit was created to hold the most notorious criminals and the insane. So their extreme loyalty comes from his history in the prison. Where he was known as the ruthless prisoner who would kill anyone in his way.
0.777778
Bane is responsible for the league's authority over Gotham .
IPython Qt Console doesn't have a title in GNOME app switcher
When I use the app switcher in GNOME 3.16, the IPython Qt Console (version 3.1.0) doesn't have a title under its icon (see image, and compare with Chromium). I also noticed that the icon doesn't have a title in the GNOME dock, nor is it present in the GNOME bar at the top. I thought that maybe the title would be set in the .desktop file, but then I had a look at my /usr/share/applications/ipython-qtconsole.desktop and it doesn't look any different from other applications (i.e. it has a Name label set to an IPython value). Is there a way to add a title manually? I'm on Arch Linux using GNOME 3.16.1.
This has never happened to me but this is more a "menu" issue than an application one. As a starting point I suggest you navigate to the file ~/.config/menus/gnome-application.menu See if its listed there and if there are any issues with the listing. There is also an app called "menulibre" which allows you to add/modify icon names. It available in the AUR.
1
"menu" issue than an application one
Is there a word specifically referring to the stand upon which a large book is displayed, opened to a page?
I'm thinking in particular of dictionaries or illuminated bibles being displayed on these stands, which are at least waist-high on a standing person, constructed of wood. Is there a particular word for this, other than "book stand"?
It is just a display book stand. You might need a lectern or Shtender (for DavidM) if the main purpose was someone reading at the "stand". Also if it is for a Bible and you want something grand then you may want an ambo or pulpit.
1
a display book stand
Modern design - What's that?
I am working on redesigning my website and iterating through fivesecondtests. The overall feedback is improving but no matter what I change, several people have mentionned that my designs look "dated". "Not modern". "Use modern fonts". What are "modern fonts"? Technically, Calibri, Cambria, etc. are "modern fonts", but I hardly ever see those online. What fonts are considered "modern" in the context of web design? What are the characteristics of a "modern design"? Conversely what are the tell tale signs of a "dated" design? For reference, here is the latest iteration of my design. Does it still look "dated"? If so, what elements give that impression? I think I am starting to get a better idea of what "modern web design" is: No or light gradients Sans serif typefaces Light drop shadows Good page hierarchy / directing visitor's attention Is there anything else that makes a design look "modern"? I have implemented the most of the recommendations in the answers, and I feel it has improved the design a lot. (Never mind the logo - will figure that one out later) Am I still stuck in the past? Or am I finally getting somewhere? Implementing all recommendations, this is what I get: It's obviously much better, but is it up to modern standards yet? If not, can it get there without changing massively the layout? The learning process never ends, does it? Assume that the central menu has a lava effect and that hopefully I can get a decent photo of myself shot to replace that one. Looking at the various versions, I can see the design improving by leaps and bounds. Not sure how much further it needs to improve to reach professional standards, but it's certainly moving in the right direction. Thanks a lot to all of you. I am impressed by the quality of the advice and how specific and actionable most recommendations have been so far.
The third version is looking much better. Here's a few additional changes I would make. Drop the little flying arrows and dotted rules in the background. They're just a distraction from in an increasingly focused layout. Don't stretch the type in your buttons. Make up your mind in the top half of the page. You still have two competing blocks of info. Here's what I would do: Make "Professional translation services" the headline over the whole thing. Move the bullet list to the left side. Remove the "Need translations?" headline. Shrink the box with the call center lady down to about the height of your bullet list (cut the padding about in half). Put the buttons in the center of the page under all of that info. With all that, I'd say you're ready for prime time. After you make your first $100k on this, go hire a UI designer to take it to the next level ;)
0.777778
Make "Professional translation services" the headline over the whole thing
How to identify if sentence is passive Voice or Indicative sentence?
Examples: "One car was parked outside of the gate." "Your work volume is increased or not" "He was arrested" "She was raped" "After accident he was taken to hospital" "He was informed about this" “My heart was broken” All above statements can be in the stative form if we do not mentioned the agent. But if we use the agent i.e. By Driver, By Boss, By Police, By boyfriend, By friend, By father, By husband respectively, then sentence become as passive voice. My questions are a) How to quickly make out whether a sentence is in the passive voice or just a simple sentence (Stative)? B) If i use had been in above sentence does it mean the same?
English "got" was long considered substandard, even though it disambiguates these situations efficiently. The car got parked. The car was parked. Without such disambiguation, context is required.
0.444444
An English "got"
most basic laser diode driver?
Is a simple LM317-based laser diode driver safe for powering a laser diode? https://www.youtube.com/watch?v=iuMngik0GR8 (the diagram is at 1:37) I've been told the the proprietary drivers offer some extra protection from very short spikes (on power up and shutdown) in the current which laser diodes are very sensitive to and might be damaged from. But isn't the LM317 regulator taking care of that itself already? I've been told this from people who actually sell commercial laser diodes so I'm thinking they might be showing some bias.
The main issue with the circuit you've shared is transients. Some linear regulator circuits will tend to overshoot on turn-on, or allow input transients to pass through to the load. Here's the ripple rejection curve for TI's LM317: You can see that the LM317 will do very little to protect the laser from transients with characteristic times below about 1 us. And an ESD event can easily have a pulse width as short as 1 ns. And many laser diodes are quite sensitive to over-voltage and over-current. They may also respond very quickly to transients compared to other devices that you might connect to an LM317. A good laser driver circuit should have ESD protection, transient protection, and a slow-start behavior. These things are more important if you are driving a low-cost CD laser, or a high-speed telecommunications laser than if you are driving a high-power material processing laser. They may also be less important today than they were 20 years ago due to improvements in the robustness and reliability of newer laser designs.
0.777778
TI's LM317 will do very little to protect the laser from transients
What does mathematics have to do with programming?
I just started a diploma in software development. Right now we're starting out with basic Java and such (so right from the bottom you might say) - which is fine, I have no programming experience apart from knowing how to do "Hello World" in Java. I keep hearing that mathematics is pertinent to coding, but how is it so? What general examples would show how mathematics and programming go together, or are reliant on one another? I apologize of my question is vague, I'm barely starting to get a rough idea of the kind of world I'm stepping into as a code monkey student...
It honestly depends on what sort of programming you're doing. If you're making light web apps with some logic, you probably don't need the more advanced math classes that many degrees require. If you're working with things that are a bit more processor heavy, than you're going to need more math. If you're doing work with any kind of scientific field, you'll really want to keep your calc references at hand. Another place where you'll need math is if you want to write games. The second you want to move diagonally, you'll need to start doing some careful calculations so that you don't end up with characters that accelerate if the move to a block to the NE. That said, you don't necessarily need to learn math, then learn programming. It's perfectly valid to learn programming, then pick up some advanced math. I started coding before I ever set foot inside a Calc or Trig class and did just fine. When I did start learning advanced math, I found that coding really helped me, as I could explore the topic more by changing variables in a quick script than I could with pen and paper.
1
Math is a good way to learn programming
Native Exchange Email app does not synchronize folders properly
Recently I created/removed some folders on Outlook desktop app. When I synchronized my corporate account by manually refreshing under the folders screen, it didn't bring the new folders, nor removed the removed ones. Is this a known bug? I have a Motorola Milestone, and I remember in the past, at least the folder addition worked.
I ended up deleting my account and registering it again, and it worked, but this is a workaround. As pointed out by other people, the native Mail app is buggy, so I started evaluating Touchdown.
1
deleting my account and registering it again
Is it ok to use self-signed certificates for smtp transport?
By "by ok to use" I mean: are MTA agents receiving emails from my server going to reject my email if not, are they going to make other kind of bad treatment for my emails (marking as spam, unsafe and so...)? ...or is it just better idea to stick with non-encrypted emails?
I ran an MTA with a self-signed certificate for a couple of years, until real ones got cheap enough that I could no longer be bothered to do so, and I didn't have a single rejection because of the unsigned certificate in all that time. I never had a single complaint about a mail being marked as spam because of it, either; if anything, using TLS often seems to mark you out as a non-spamming professional. In my opinion, it is definitely worth enabling SMTP TLS if you can, whether or not you pay for a third-party-signed certificate. Edit in response to your comment: It's not that someone couldn't choose to restrict inbound mail on that basis; I've never come across it, is all. A third-party-signed certificate is still useful to prove there is no man-in-the-middle attack happening; but that doesn't seem to be a serious problem in the MTA world at this time. If that starts to change, we could well find that people start to insist on signed certificates. Security exists to address threats, so if the threat model changes, the range of sane and proportionate security responses will change with it.
0.888889
SMTP TLS if you can, whether or not you pay for a third-party-signed certificate
Events management using SDL 2.0
I wrote a simple SDL program using SDL 2.0. I have a little problem when I want to check the mouse wheel events. Actually, in the version 2.0 the flags SDL_BUTTON_WHEELDOWN and SDL_BUTTON_WHEELUP no longer exist. There is just the flags SDL_MOUSEWHEEL. The code below check correctly the' WHEELUP' and 'WHEELDOWN' events but with the same flag. while(!terminer) { while (SDL_PollEvent(&amp;evenements)) { switch (evenements.type) { case SDL_QUIT: terminer = true; break; case SDL_KEYDOWN: switch (evenements.key.keysym.sym) { case SDLK_ESCAPE: terminer = true; break; } break; case SDL_MOUSEMOTION: std::cout &lt;&lt; "MOUSE : MOVE" &lt;&lt; std::endl; break; case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONDOWN: std::cout &lt;&lt; "MOUSE : BUTTON DOWN" &lt;&lt; std::endl; break; case SDL_MOUSEWHEEL: std::cout &lt;&lt; "MOUSE : WHEEL" &lt;&lt; std::endl; break; } } But I would like to handle separately the 'WHEELUP' and 'WHEELDOWN' events. I tried several others flags in my condition but without success. Does anyone can help me, please ? Thanks a lot in advance for your help.
According to the SDL documentation: Movements to the left generate negative x values and to the right generate positive x values. Movements down (scroll backward) generate negative y values and up (scroll forward) generate positive y values. So in your case, you could modify the code as such: case SDL_MOUSEWHEEL: if(evenements.x &lt; 0) { std::cout &lt;&lt; "MOUSE : WHEEL LEFT" &lt;&lt; std::endl; } else if(evenements.x &gt; 0) { std::cout &lt;&lt; "MOUSE : WHEEL RIGHT" &lt;&lt; std::endl; } if(evenements.y &lt; 0) { std::cout &lt;&lt; "MOUSE : WHEEL DOWN" &lt;&lt; std::endl; } else if(evenements.y &gt; 0) { std::cout &lt;&lt; "MOUSE : WHEEL UP" &lt;&lt; std::endl; } break;
0.888889
Movements to the left generate negative x values and to the right generate positive y values .
Why is this type of hesitation considered unethical?
In two previous questions, it was clearly agreed that hesitating before playing a singleton specifically, and hesitating during play as a bluff generally constitute "wrongful/unethical hesitation." As an advanced beginner, I don't understand this rule at all. I know that at the highest level, the best way to play and not give away any information about your holding to the opponents is to play each card at a nice even tempo. I am not a world class player; I am not even an advanced player (if I endplay you, I promise it wasn't intentional). As such, I frequently need to pause and calculate what to play, even in situations where the correct play should be obvious. Knowing that I will inevitably need to pause and consider a play and that that pause will provide my opponents with the information that I had a potentially difficult decision to make, why is it considered unethical for me to occasionally insert a similar pause before a routine play? It isn't as if I could use such a pause to reliably signal something to my partner. In fact, this strategy removes the temptation for partner to draw unauthorized inferences from my pauses.
Bridge players derive pleasure from using their brains, be it a technical play, or some nice logic to read the cards perfectly, which includes inferences from opponents hesitations. Allowing coffee-housing like invalid hesitations just destroys that pleasure, as now there is garbage thrown into the pool of inferences available. That said, beginning players usually hesitate for no valid bridge reason, and many better players indeed try to take that into account. Note that is very different from deceptive plays in bridge, where you deceive the opponents purely using the card you play (and not in the manner you play it), are completely ethical and quite a useful weapon.
0.888889
Bridge players derive pleasure from using their brains, whether it be a technical play, or some nice logic to read the cards perfectly