summary
stringlengths
15
147
text
stringlengths
1
19.3k
answer
stringlengths
32
22.6k
labels
float64
0.33
1
answer_summary
stringlengths
5
164
Close all file descriptors in bash
Is there a way to close all the open file descriptors, without having an explicit list of them beforehand?
No. The kernel can close only one FD at a time, and bash does not have "group commands" for FDs. for fd in $(ls -1 /proc/27343/fd); do echo exec "$fd>&-"; done Remove the echo after testing. If this is not for the shell itself but for a command to be run then you can use nohup.
1
Nohup exec for FDs
Group texting with Iphone users, my texts get delayed until theirs all stop
I have an S4 with the latest software update (though this has been a problem for a long time before too). And when I am in a group text with Iphone users, it seems that my outgoing texts get stuck in limbo until all of theirs is through. Sometimes several minutes, so I am always behind in the conversation. Is there a fix?
What messaging app are you using? People experience a lot of variation depending on the app. I think even Samsung will allow you to change your default texting app. May I suggest Google's very own Messenger? Link It's supposed to have pretty good group messaging support.
0.888889
What messaging app are you using?
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?
To answer your question, you just need to convert the low voltage to a high voltage by use of a transistor switch. Using a BJT transistor will work, but I recommend using a MOSFET. They are more efficient and can handle more power without getting hot due to the very low "on" resistance. Consider this circuit: The P channel MOSFET gate is pulled HI by RA, so it is turned "OFF." Remember, P channel transistors (or PNP) work opposite to that of N channel transistors (OR NPN). Since the FET is OFF, the outputs signal is pulled LO by RB. If a switch is closed/pressed, then the FET gate is LO, turning the FET "ON." Now, the transistor acts like a switch, connecting the output to the 12V power source. There is a bit of loss in the transistor, but not a lot. Using a "Power MOSFET" is necessary to handle the level of current required to operate an automotive relay - not a problem since many of these transistors can switch dozens of amps. Since the MOSFET is a voltage controlled device, only a negligible amount of current would be needed to control the transistor (this is the current through your steering wheel wires). A similar circuit could be made using an N channel MOSFET instead. See this website on using a MOSFET as a switch: http://www.electronics-tutorials.ws/transistor/tran_7.html But realistically, this is all probably unnecessary. Have a look at the wire gauge table on this website: http://www.powerstream.com/Wire_Size.htm You will see that the few hundred mA needed to trip a relay are safely carried in wire size all the way down to 27 gauge (handles 288 mA). You should check those wires to see how big they actually are (usually printed on the side of the wire somewhere).
0.888889
How to convert low voltage to high voltage by using a transistor switch?
Is my interval training routine effective for mountain bike training?
During these winter months I am currently attending the gym 3 times a week. On each of the days I start my training on an exercise bike with the following: 5 minute warm up 30 minutes, 1 minute hard, 1 minute recovery 5 minute warm down I am using a specific interval training setting on the bike. I preset the training to level 15, which is a high resistance and as much as I can take. Hard is a cadence of between 80-90rpm high resistance. Recovery is a cadence of 60prm and the resistance backs off considerably, I imagine to approximately level 7. My heart rate towards the end of the session reaches 170–190bpm, and I am working flat-out. I turn 30 in March, am 5' 8" and weigh approx 168lbs. Does this training routine seem sensible for building strength and speed on the mountain? Should I be changing up the training with other types of bike training? It is also worth noting that after the interval training I perform free weight strength training too.
Whether an interval training is effective or not depends mostly on your particulars relative to the interval. Heart rate is only a very inexact measure of effort, but you seem to be roughly in the ballpark. However, such quick switching between on/off interval state does not generally produce interval-like results and should be viewed as a single 30-minute interval at the average power of this period. A better gauge of interval quality would be this: how long can you keep up the effort? A more typical interval training might be e.g. 6-7 times 3-8 minute efforts, with 2-5 minute rests, at such intensity that you simply cannot complete another interval round. A goal of "strength and speed" on the mountain is unspecific enough that you can be sure it's being helped somewhat, and in some way, by the intervals. However, it's counterproductive to do interval training and weight training both in one session. If you are still in shape to do weight training after your intervals, it means the intervals weren't done hard enough. Do intervals and weights on alternate days.
1
How long can you keep up the effort?
How to extract name/data from database and use it as my folder name which is created dynamically in asp.net c# using server.MapPath()?
I have used AjaxFileUpload to upload multiple image files. Now i want to store the uploaded images inside rootfolder>subfolder. The rootfolder is in the name of the user. The rootfolder is created dynamically by taking the session of the user who has logged in Like this: string username = Session["username"].ToString(); I am able to create this folder and save images in it. but i want to save it in subfolder. the subfolder is also created dynamically but this time i have to take the value(id) from the database and name the folder by that id name. (this is so that i can refer to the database) I know how to create a new folder using Server.MapPath(); Here is the code for it in brief using System.IO if (Directory.Exists(Server.MapPath(uploadPath))) return; else Directory.CreateDirectory(Server.MapPath(uploadPath)); where uploadPath is the folder's name i want to create dynamiclly. but how do I include the subfolder too in my Server.MapPath() so as to make my path as rootfolder/subfolder ? Small example to make the question understandable. I am a seller. I have posted 4 ads online. Now when i am posting my 5th ad i want to include many images. these images should be saved in the folder Seller/5/imagename.jpg. (where Seller is the username(main folder), 5 is the advertID in the database and the name of the subfolder) How do i do this? Please help. I am using asp.net c#
As far as I know, you can't do one statement to create folder and subfolders because you need the folder to be created first. You have all of the code you need, you just need to repeat it. Check to see if the main folder (username) exists. If it doesn't create it, if it does, check to see if the subfolder exists. If it doesn't, create it. Just work through that logic and you'll be set.
0.888889
How to create folder and subfolders
Is there an "Appending \let"?
After \def\MyText{\textbf{My Text}} \let\MySaved\MyText \MySaved and \MyText have the same \meaning. What I would like to have further down in the document is % \MyText = \textbf{My Text} \def\MyText{\textit{More Text}} \let\MySaved{\MySaved \MyText} % \MySaved = \textbf{My Text} \textit{More Text} but obviously \let does not allow a group of tokens in the second argument. Is there any way to append like this with the same specific (non-)expansion properties \let has?
Without reinventing the wheel, we can use etoolbox: \appto{\MySaved}{\textit{More text}} with \gappto if the change should be global. If you want to add to \MySaved the (first level) expansion of \MyText, there's \eappto{\MySaved}{\expandonce{\MyText}} and \xappto will do the same globally. Let's see: \documentclass{article} \usepackage{etoolbox} \def\MyText{\textbf{My Text}} \let\MySaved\MyText \def\MyText{\textit{More Text}} \eappto\MySaved{\MyText} \show\MySaved The output on the terminal will be &gt; \MySaved=macro: -&gt;\textbf {My Text}\textit {More Text}. To make the thing more symmetric, you can use \eappto{\MySaved}{\expandonce{\MyText}} also in place of \let, but this wouldn't reinitialize \MySaved. If only Plain TeX is wanted, just copy the implementation: \protected\def\appto#1#2{% \ifundef{#1} {\edef#1{\unexpanded{#2}}} {\edef#1{\expandonce#1\unexpanded{#2}}}} \protected\def\eappto#1#2{% \ifundef{#1} {\edef#1{#2}} {\edef#1{\expandonce#1#2}}} \protected\def\gappto#1#2{% \ifundef{#1} {\xdef#1{\unexpanded{#2}}} {\xdef#1{\expandonce#1\unexpanded{#2}}}} \protected\def\xappto#1#2{% \ifundef{#1} {\xdef#1{#2}} {\xdef#1{\expandonce#1#2}}} \def\ifundef#1{% \ifdefined#1% \ifx#1\relax \expandafter\expandafter \expandafter\@firstoftwo \else \expandafter\expandafter \expandafter\@secondoftwo \fi \else \expandafter\@firstoftwo \fi} \long\def\@firstoftwo#1#2{#1} \long\def\@secondoftwo#1#2{#2} \def\expandonce#1{% \unexpanded\expandafter{#1}}
0.777778
apptoMySavedtextitMore text with gappto if the change should be
I am or was a religious jew and purposely ate non kosher
I'm a religious Jew. I kind of lost faith and ate non-kosher purposely, and now I feel so bad with myself that I want to die. What should I do? Is there any type of repentance I should take upon myself so that I feel better and stop in general to eat non kosher?
I'm more concerned that you want to die. Why would you want to die after eating non kosher food? You can break nearly any mitzvah to save your life, certainly kashrut laws are included in Pikuach Nefesh. So I just find it concerning that you'd want to lose your life after committing an aveira. Do teshuvah and you're fine.
1
Why would you want to die after eating non kosher food?
What are lightbox / modal window UI best practices for viewing full-sized images in a gallery?
I'm an artist and amateur web designer. On my portfolio website, I've grouped my work into projects. Most of my projects contain few (20 or less) images, so I just display them in full size and let the visitor scroll (example) because this is how I prefer to browse other artist's work as well. For projects containing more images, I use thumbnails which link to the full-sized images, because, again, when I browse other artist's portfolios, if there are lots of images on a page it's kinda cumbersome to load. Recently I wrote some jQuery to implement a lightbox effect (modal window overlay) so when you click on a thumbnail, the full-sized image appears (example). My main reasons for implementing this: it's much more presentable than having a direct link to the image, which is what I used to do if the visitor shares the image on something like tumblr or Pinterest, the link back will be to the project page instead of a direct link to the image if the visitor wants to right-click on the thumbnails to load several images in several new browser tabs/windows, they can still do so (the lightbox is triggered on left click) I did not include a close button because it seems like more work for the visitor to have to look for a close button, than to simply click anywhere to close the lightbox (which is what I did). What are your thoughts regarding lightbox interface for this particular use? The goal would be the best way to showcase visual art/design work, and the target audience would be, well, anyone who wants to view the work. The display method, in this case a lightbox interface, should be efficient, useable, and presentable (it should highlight, not detract from, the work).
The modal image roll is very nice and is used on bigger social media sites, such as Facebook and Google+. So stick to it, but please do not omit the close button. It makes users confused and we wouldn't want that. One idea to use is Facebook's implementation, where you have the [X] fully working, but on hover user get a clue: use Esc to close! I think this is splendid design telling the users there are other ways and you do not have to grab your mouse to close the image:
0.666667
Use Esc to close modal image roll .
Unix C++: get time at a different zone
I'm trying to get the time in a different timezone (PST) using C++. #define PST (-8); char* Time::getSecondSystemTime() { time_t rawtime; struct tm * timeinfo; char buffer[80]; time(&amp;rawtime); timeinfo = gmtime(&amp;rawtime); timeinfo-&gt;tm_hour = timeinfo-&gt;tm_hour + PST; strftime(buffer, 80, "%I:%M %p", timeinfo); std::string temp = std::string(buffer); // to get rid of extra stuff std::string extraInfo = " Pacific Time ( US &amp; Canada )"; temp.append(extraInfo); return (char*) (temp.c_str()); } The problem here is that when the GMT time is less than 8 hours (for example, right now, the time there is 3AM in the morning), subtracting 8 hours from it does not work! What is the proper way to get time at a different time zone in Unix?
I have the following C code stashed away to deal with the problem. Efficiency isn't the first word that springs to mind (two calls to setenv(), two calls to tzset()), but the standard C library doesn't make it easy to do better: #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;time.h&gt; #include &lt;unistd.h&gt; static void time_convert(time_t t0, char const *tz_value) { char old_tz[64]; strcpy(old_tz, getenv("TZ")); setenv("TZ", tz_value, 1); tzset(); char new_tz[64]; strcpy(new_tz, getenv("TZ")); char buffer[64]; struct tm *lt = localtime(&amp;t0); strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", lt); setenv("TZ", old_tz, 1); tzset(); printf("%ld = %s (TZ=%s)\n", (long)t0, buffer, new_tz); } int main(void) { time_t t0 = time(0); char *tz = getenv("TZ"); time_convert(t0, tz); time_convert(t0, "UTC0"); time_convert(t0, "IST-5:30"); time_convert(t0, "EST5"); time_convert(t0, "EST5EDT"); time_convert(t0, "PST8"); time_convert(t0, "PST8PDT"); } In your original code, you have to worry about normalizing the time structure after changing the hour offset. You can do that with the mktime() function. Here's a program based on the function in the question, which is pure C and avoids the problems of returning a pointer to a local variable (and the #define ending with a semi-colon): #include &lt;assert.h&gt; #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;stdlib.h&gt; #include &lt;time.h&gt; #define PST (-8) extern int getSecondSystemTime(char *buffer, size_t buflen); int getSecondSystemTime(char *buffer, size_t buflen) { time_t rawtime = time(0);; struct tm *timeinfo; char t_buff[32]; timeinfo = gmtime(&amp;rawtime); timeinfo-&gt;tm_hour = timeinfo-&gt;tm_hour + PST; time_t pst_time = mktime(timeinfo); assert(pst_time != (time_t)-1); int len = strftime(t_buff, sizeof(t_buff), "%Y-%m-%d %H:%M:%S", timeinfo); assert(len != 0); int rv = snprintf(buffer, buflen, "%ld = %s (%s)", (long)rawtime, t_buff, "Pacific Time (US &amp; Canada)"); assert(rv &gt; 0); return rv; } int main(void) { char buffer[128]; getSecondSystemTime(buffer, sizeof(buffer)); printf("%s\n", buffer); return(0); } Clearly, a better interface would pass the UTC time value and the time zone offset (in hours and minutes) as arguments. Despite the fact that my computer runs in US/Pacific (or America/Los_Angeles) time zone by default, I tested with TZ set to various values (including US/Eastern, IST-05:30) and got the correct values out; I'm reasonably convinced based on past experience that the calculation is correct. I have another program that attempts to dissect whether the -1 returned from mktime() is because of an error or because the converted time corresponds to (time_t)-1: /* Attempt to determine whether time is really 1969-12-31 23:59:59 +00:00 */ static int unix_epoch_minus_one(const struct tm *lt) { printf("tm_sec = %d\n", lt-&gt;tm_sec); if (lt-&gt;tm_sec != 59) return(0); printf("tm_min = %d\n", lt-&gt;tm_min); /* Accounts for time zones such as Newfoundland (-04:30), India (+05:30) and Nepal (+05:45) */ if (lt-&gt;tm_min % 15 != 14) return(0); /* Years minus 1900 */ printf("tm_year = %d\n", lt-&gt;tm_year); if (lt-&gt;tm_year != 69 &amp;&amp; lt-&gt;tm_year != 70) return(0); printf("tm_mday = %d\n", lt-&gt;tm_mday); if (lt-&gt;tm_mday != 31 &amp;&amp; lt-&gt;tm_mday != 1) return(0); /* Months 0..11 */ printf("tm_mon = %d\n", lt-&gt;tm_mon); if (lt-&gt;tm_mon != 11 &amp;&amp; lt-&gt;tm_mon != 0) return(0); /* Pretend it is valid after all - though there is a small chance we are incorrect */ return 1; }
0.888889
Using mktime() to correct a time variable
Recover Console Text Output after Using fbi App to display image on /dev/fb0
I am not using X and I'm using fbi to display an image on the /dev/fb0 framebuffer device. When I boot up my Pi, I see all the usual text and it boots up to where I can log in on the console. After I use fbi like this: fbi -T 2 -d /dev/fb0 -a myimage.png My image is displayed and replaces the text. How do I 'discard' the image painted in fb0 and recover my text session so I can type?
From man fbi: COMMAND USAGE ESQ, q Quit. I think that should be "ESC" -- anyway, lots of informative stuff in the man page. In case you are unaware, there are 6 virtual terminals (VTs) with log-in prompts created at boot, but only the first one is where init messages appear. You can access these via CtrlAltF1-6. Which I think you know since you are using -T 2, making it sort of a strange question...
1
Man fbi: COMMAND USAGE ESQ, Q Quit
Why do I have house flies in my carport?
I bought my home in early September 2012. I noticed that flies were flocking around a light in my open air carport whether it was on or off. I tried a few products like fly tape, spray and a fly trap. Still no results. This continued through fall until temps dropped. This Spring I thought I would take preventive measures and cleaned my entire carport with Lysol including my garbage cans which are new. But still flies are flocking around this light. Its strange, they don't land on it that much as if there were some food source. They just fly around it all day until the sun goes down and even then there are a few stragglers. I would say at peak during the day there are about 150 to 200 flies. Why are they attracted to this area and What do I do to get rid of them?
You need to do three things. Remove all trash/food from the area and clean with bleach - spray down the whole area fumigate - you need to bomb everything with bug spray. Maybe a few times. Lay it on. Use all precautions and such (wear a mask). keep your trash far far away for at least a month. Flies are attracted to trash and often lay eggs in the trash or close by. You need to find another area to put your trash for a while.
1
Keep your trash far away for at least a month
jQuery - Adding a hyphen inside string
I am pulling the text from a select box's options. Now I pass this string value to an append() function, but I want to add a hyphen to the string, for calling an image name: HTML: &lt;select&gt; &lt;option&gt;Demo Cars&lt;/option&gt; &lt;option&gt;New Cars&lt;/option&gt; &lt;option&gt;Used Cars&lt;/option&gt; &lt;option&gt;Other&lt;/option&gt; &lt;/select&gt; var p = 'http://myurl.com/images/'; $('select').eq(0).on('change',function(){ $('#productQuote').empty(); var j = $(this).children(':selected').val(); $('#productQuote').append('&lt;img src="'+ p + j + '.jpg' '" /&gt;'); }); For example: If I choose the first select option, the string will be: "Demo Cars", and thus, j == "Demo Cars". But now I want to call its image, and my image names are not allowed to have spaces inside them. So, this begs the question, how do I add a hyphen between Demo and Cars?
There are many simple ways to do this, each with different purpose at times. Here are a couple simple ways to do this "inline", without affecting much of your already usable code: With .replace() (The downside is if you have more than one white space, it won't replace them all. This can be remidied with regex, as I'll show below, or split join) $('#productQuote').append('&lt;img src="'+ p + j.replace(" ", "-") + '.jpg" /&gt;'); Replace ALL style: $('#productQuote').append('&lt;img src="'+ p + j.replace(/ /g, "-") + '.jpg" /&gt;'); With the team of .split().join() $('#productQuote').append('&lt;img src="'+ p + j.split(" ").join("-") + '.jpg" /&gt;');
0.666667
How to do this "inline" with .replace()
Is my interval training routine effective for mountain bike training?
During these winter months I am currently attending the gym 3 times a week. On each of the days I start my training on an exercise bike with the following: 5 minute warm up 30 minutes, 1 minute hard, 1 minute recovery 5 minute warm down I am using a specific interval training setting on the bike. I preset the training to level 15, which is a high resistance and as much as I can take. Hard is a cadence of between 80-90rpm high resistance. Recovery is a cadence of 60prm and the resistance backs off considerably, I imagine to approximately level 7. My heart rate towards the end of the session reaches 170–190bpm, and I am working flat-out. I turn 30 in March, am 5' 8" and weigh approx 168lbs. Does this training routine seem sensible for building strength and speed on the mountain? Should I be changing up the training with other types of bike training? It is also worth noting that after the interval training I perform free weight strength training too.
At the end of this workout are you 'smoked'? If so, then these are 'anaerobic endurance' intervals. Some training plans suggest just starting these 6-8 weeks before your first "A race" Some plans suggest you work on "muscular endurance" first with long fairly hard efforts = 10m plus - then 6-8 weeks prior add anaerobic endurance intervals. The two biggest abilities for MTB are said to be muscular and anaerobic endurance. http://www.joefrielsblog.com/2011/01/build-period-overview.html
1
'anaerobic endurance' intervals
How to convert particles to mesh
I need to convert a Particle System to a mesh object, so I can export it to Unity 3D. How could I do this?
The following assumes that you are using 'Particle System-> Render-> Object -> Dupli Object'. Option 1) You can press the Convert button for the Particles Modifier. Option 2) If you would like to keep the particle Emitter intact, you can use the 'Make Duplicates Real' Tool Shift+Ctrl+a. This will create object particles at every particle position just as if you applied the Modifier but the particle emitter and its particle system will still be intact in case you would like to make further changes.
1
Particles Modifier
Is it possible to set borderless window mode?
I am playing Mass Effect again but there doesn't appear to be an option to enable a borderless window mode in either the game or the configuration utility, leaving the game running inside of a visible window. Is it possible to set a borderless window mode either by editing one of the configuration files or using a third party utility or some kind?
Mass Effect does not come with any support for borderless window mode. The only way to do so is to use a third party utility such as ShiftWindow. There are also ways to do it with autohotkey
0.888889
Mass Effect does not come with borderless window mode
check if a string has four consecutive letters in ascending or descending order
Good day stack overflow. I'm a noob in using regex and here is my problem - I need to check a password if it contains 4 consecutive characters. so far what I have just covered is regarding the digits. Here is my regex: ascending digits - ^.?(?:0123|1234|2345|3456|4567|5678|6789).$ descending digits - ^.?(?:9876|8765|7654|6543|5432|4321|3210).$ This works only for the digits. I know this is already an overkill in regex so I dont want to do it with the letters. It will be waaay too overkill if I do that. abcdblah //true because of abcd helobcde //true because of bcde dcbablah //true beacause of dcba heloedcb //true because of edcb Any help would be highly appreciated. Thanks stackoverflow.
The answer is simple: don't use regexes. Use this approach: iterate over each letter (of course, skip the last tree letters) iterate over the next three letters and check for ascending order if they all were ascending return true. iterate over the next three letters and check for descending order if they all were descending return false. return false In code, this would look like this (untested code): public boolean checkForAscendingOrDescendingPart(String txt, int l) { for (int i = 0; i &lt;= txt.length() - l; ++i) { boolean success = true; char c = txt.charAt(i); for (int j = 1; j &lt; l; ++j) { if (((char) c + j) != txt.charAt(i + j)) { success = false; break; } } if (success) return true; success = true; for (int j = 1; j &lt; l; ++j) { if (((char) c - j) != txt.charAt(i + j)) { success = false; break; } } if (success) return true; } return false; } Good luck! StackOverflow :)
0.666667
Iterate over each letter
getopt, getopts or manual parsing - what to use when I want to support both short and long options?
Currently I'm writing a Bash script which has the following requirements: it should run on a wide variety of Unix/Linux platforms it should support both short and (GNU) long options I know that getopts would be the preferred way in terms of portability but AFAIK it doesn't support long options. getopt supports long options but the BashGuide recommends strongly against it: Never use getopt(1). getopt cannot handle empty arguments strings, or arguments with embedded whitespace. Please forget that it ever existed. So, there still is the option of manual parsing. This is error-prone, produces quite some boilerplate code, and I need to handle errors by myself (I guess getopt(s) do error-handling by themselves). So, what would be the preferred choice in this case?
getopt vs getopts seems to be a religious issue. As for the arguments against getopt in the Bash FAQ: "getopt cannot handle empty arguments strings" seems to refer to a known issue with optional arguments, which it looks like getopts doesn't support at all (at least from reading help getopts for Bash 4.2.24). From man getopt: getopt(3) can parse long options with optional arguments that are given an empty optional argument (but can not do this for short options). This getopt(1) treats optional arguments that are empty as if they were not present. I don't know where the "getopt cannot handle [...] arguments with embedded whitespace" comes from, but let's test it: test.sh: #!/usr/bin/env bash set -o errexit -o noclobber -o nounset -o pipefail params="$(getopt -o ab:c -l alpha,bravo:,charlie --name "$0" -- "$@")" eval set -- "$params" while true do case "$1" in -a|--alpha) echo alpha shift ;; -b|--bravo) echo "bravo=$2" shift 2 ;; -c|--charlie) echo charlie shift ;; --) shift break ;; *) echo "Not implemented: $1" &gt;&amp;2 exit 1 ;; esac done run: $ ./test.sh - $ ./test.sh -acb ' whitespace FTW ' alpha charlie bravo= whitespace FTW $ ./test.sh -ab '' -c alpha bravo= charlie $ ./test.sh --alpha --bravo ' whitespace FTW ' --charlie alpha bravo= whitespace FTW charlie Looks like check and mate to me, but I'm sure someone will show how I completely misunderstood the sentence. Of course the portability issue still stands; you'll have to decide how much time is worth investing in platforms with an older or no Bash available. My own tip is to use the YAGNI and KISS guidelines - Only develop for those specific platforms which you know are going to be used. Shell code portability generally goes to 100% as development time goes to infinity.
1
"getopt cannot handle empty arguments strings"
Why do Football players prefer to use their family name?
I read that in Western countries, people prefer their first name over their family name, that is why they put their first name first, in form first name + family name For example Wayne Rooney, Steven Gerrard, ... This is contradicts with Eastern countries, where people full name is of form family name + first name But in Football (or Soccer in America), you can see in the uniform that they use their family name only. For example Rooney, Gerrard, ... Why is that?
Because back in the days when they first invented putting names on jerseys, there would have been too many "John's" and "James's" and "Tom's" (and "Dick's" and "Harry's") to keep everyone sorted out. First names in the US have become much more creative since then, but the tradition stands.
1
Putting names on jerseys in the US
How to fix "g.aoColumns[a.aaSorting[f][0]] is undefined" errors after updating dataTables and ColReorder plugins?
I just downloaded the latest versions of DataTables and ColReorder (primarily to make use of the new html5 data- attribute for sorting). After doing so, I am getting this error: "TypeError: g.aoColumns[a.aaSorting[f][0]] is undefined" referencing ColReorder.js. I have tried with a variety of options, and have set up various minimal test tables and run into the problem in all of my cases (so long as ColReorder is called). This stops the ColReorder, and anything called after it, not to work. Debug info here: http://debug.datatables.net/ixuwih Any tips? I am stuck. thanks! {{edit: on further investigation, it appears to happen only when state save is set to true. State save is a required feature, however, so I can't just turn it off.
Ok, well despite not getting an answer on the DataTables help forum, this appears to have been a known issue, addressed with this Git commit: https://github.com/DataTables/DataTables/commit/77343b72cb035e1ceba387335136f010282c0940 Solution: download the commit or link to the latest nightly build via the CDN.
0.833333
Git commit or link to latest nightly build via CDN
Is this function bijective?
Consider the function $\theta:\{0,1\}\times\mathbb{N}\rightarrow\mathbb{Z}$ defined as $\theta(a,b) = a-2ab+b$. Is this function bijective? For injective, I tried doing the contrapositive by supposing $\theta(a,b)=\theta(c,d)$, then $a-2ab+b=c-2cd+d$, but I have no idea where to go from there. I tried solving for a and b separately and plugging it back in, but that just turned into a huge algebraic mess. I haven't figured what I'm going to do for surjective yet. I'm not very good at this subject, so sorry if this is a stupid question. Any hints are appreciated, thanks.
Formulas are nice, but let's find out what's really going on: $\theta(0,b)=b\,$ and $\theta(1,b)=1-b$. Much clearer. Could $x=1-y\,$ where $x$ and $y$ are natural numbers? Depends on what one means by natural number. It can certainly happen if we allow $0$ to be a natural number. I am inclined to allow that, out of loyalty to logic, where it is a standard convention. But I am in a minority. Certainly it cannot happen if $x$ and $y$ are positive. Finally, for surjectivity (love that word) is every integer of the form $x$ or $1-y$ where $x$ and $y$ are positive integers? Sure.
1
Could $x=1-y and $y$ be a natural number?
Is it appropriate to follow up on a faculty application?
I am currently applying to faculty positions, primarily teaching positions at 4 year colleges and universities. I am told many of these jobs have more than 100-200 applicants. Some of the jobs ads themselves say they get hundreds of applicants, and go on to say something to the effect 'you probably aren't going to hear anything from us', which says to me - 'don't bother us'. I have 3 questions, which overlap: If I don't hear back from them at all, is it appropriate to contact the department? If I hear back that they got my application and materials, is it appropriate to contact the department? People that I know from the business world encourage me to be more aggressive by calling the departments to check in, and even asking if I can come visit the department. I am concerned that this sort of attitude can have a backlash effect. Is this sort of aggressive approach accepted in academia?
You should keep in mind that the people running searches are busy academics who are doing this as service to the department. Checking-in aggressively — following your intuition for how this would work in business — will annoy and will be very unlikely to help. At the moment (early/mid- February), it is still early enough in some job markets that interviews have not been scheduled so asking for updates might be seen as pushy. I think it's unlikely that your chances will go down if you ask, but it still might be nicer to wait. That said, there are many situations where contacting in normal and you might to do it through one of those channels: For example, if you have another offer from somewhere with a deadline, it is normal — and a good idea — to contact other departments to let them know that you will have to move forward without them. I've had friends who have had interviews offers within hours of telling a department this. Also, if you have updated material on your CV (e.g., a paper accepted, positions changed, an award, whatever) go ahead and send your updated CV. You can mention in that email that you're excited to hear about any updates from their search. Contacting search committees in this context is normal and can signal that you continue to be very interested in a job. I was told by a search committee that ended up making an offer that they thought I might be unlikely to accept an offer and that one of these update emails rovided a useful signal. Of course, if they're not interested, emailing will probably just be noise and extra work for them. I think that emailing or not-emailing is unlikely to tip the scale either way. They're going to make a decision based on the intersection of the quality of your work and what they're interested in having in their department. But out of kindness for the work of the search committee and its chair, try to do it as little as possible.
1
Checking-in aggressively will annoy and will be very unlikely to help .
Photo icons have generic picture only
When going to a JPG photo folder OS C drive and opening it to view photos in an icon mode the icons only show a generic picture. If I click on the icon then the actual photo comes up. It seems like this problem just started happening. In the past I would open a folder and view icons and the photos were all there to view at once. I don't believe I made any intentinal changes. Thanks for the help.
I had this problem with my new installation of Windows 8.1. After I had installed most of the regular Windows applications I was using in Windows 7, I started on a getting-acquainted tour of the new OS and its "ModernUI"apps. The generic file type icons displayed in the Photos app really puzzled me, but a lot of Internet searching finally led to the solution: any installation of a recent version of the open source office suite "LibreOffice" changes the Windows registry of common graphics file types in an undesirable way, so that they are treated as a document rather than a picture. There is a very long thread about the problems and solutions at http://answers.microsoft.com/en-us/windows/forum/windows8_1-pictures/windows-81-photos-app-does-not-show-any-photos/5b1740bc-d87d-4d07-afe5-c1a60cdecd55?page=6&amp;msgId=9cdf0542-aab0-4a0b-85aa-e9f6d40b64fc The simplest solution presented was a registry file which has to be reapplied every time LibreOffice is upgraded. The file must contain the following text and be named with a .reg suffix, then double click on it to load it into the registry. You may have to log out and back in, or even restart the computer--I can't remember which I did to get it to work. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\KindMap] ".wpg"="picture" ".dxf"="picture" ".emf"="picture" ".eps"="picture" ".met"="picture" ".pct"="picture" ".wmf"="picture" ".bmp"="picture" ".cdr"="picture" ".cmx"="picture" ".gif"="picture" ".jpg"="picture" ".jpeg"="picture" ".jpe"="picture" ".pbm"="picture" ".pcx"="picture" ".pgm"="picture" ".png"="picture" ".ppm"="picture" ".psd"="picture" ".ras"="picture" ".svg"="picture" ".tga"="picture" ".tif"="picture" ".tiff"="picture" ".xbm"="picture" ".xpm"="picture" ".pcd"="picture" I hope this helps, but I am not (yet) sufficiently familiar with Windows internals to explain the problem and the solution presented here.
1
Windows Registry Editor Version 5.00
Combining Java with SQL?
This isn't a code question for once, but it definitely has me confused. Basically, my lecturer has told me that we have a project due next semester that involves us to use Java and SQL intertwined with each other. I had no idea the combining of languages was even possible! So my mind's really blown. I've been searching around looking for examples of such code but no luck. So I thought I'd ask you guys. I think the most logical thing to do since I have no experience with combining would be too create tables in SQL due too its use in databases and call them through Java. Can anyone explain to me how this is possible or just the jist of how languages combine.
What you will probably be doing is using JDBC to allow Java to connect to SQL databases. There are also persistence layers, such as Hibernate, that you can use to store and retrieve data in a database using Java. I think the JDBC tutorials should be enough to get you started. Just don't get in too far over your head too early. Take your time and ask questions as they come up.
0.888889
JDBC to connect to SQL databases
What is the exact word used for this unusual "interval" of sorts?
I knew this word a long time ago. Then I lost my memory. childhood and all. mva trauma, head injury.. I was good with words before because I was a songwriter, and I had a feeling that this word was etched in my memory somewhere but was just inaccessible.. knowing this word again could solve a lot of consequent problems in writing/overcome writers block to some degree for me. So here it is: You know how there is an "interval" between say a "train of events"? "Interval" is the best and only word I could think of -closest to this phenomenon- to describe it. To be a bit more vivid, imagine a train (locomotive) with 10 carriages, and the third and fourth carriage missing above the wheels. So, as the train moves past you, there is a "gap" that transitions through your visual and sound spectrum yes? What is this phenomenon? "Something" (that) passes by you.. It is a very obvious word, but I just can't figure out.. Even after one of you points it out, I might have to give it a memory marker to make it a long term memory- as my short term memory is still not in very good shape (or maybe it's just in the head). Further, imagine this "gap" or "interval" of sorts streaking past you like a bullet.. What is this phenomenon? :)
'hiatus' is a break, pause or interruption in a sequence, series or process. e.g.: 'The show was on hiatus for three months and was not expected to start up again until April. 'After a 23-year hiatus he only made one more appearance at a major golf tournament before retiring.'
0.555556
'hiatus' is a break, pause or interruption in a sequence, series or process
JavaScript Equivalent Of PHP __invoke
I'm developing a small framework (in JS) and for esthetic reasons and simplicity I was wondering if there could be a way to implement something like PHP "__invoke". For example: var myClass = function(config) { this.config = config; this.method = function(){}; this.execute = function() { return this.method.apply(this, arguments); } } var execCustom = new myClass({ wait: 100 }); execCustom.method = function() { console.log("called method with "+arguments.length+" argument(s):"); for(var a in arguments) console.log(arguments[a]); return true; }; execCustom.execute("someval","other"); Desired way to execute: execCustom("someval","other"); Any ideas? Thanks.
if you are ready to use JS pattern, you can do this in following way: var myClass = function(opts) { return function(){ this.config = opts.config; this.method = opts.method; return this.method.apply(this, arguments); }; }; var execCustom = new myClass({ config:{ wait: 100 }, method:function() { console.log("called method with "+arguments.length+" argument(s):"); for(var a in arguments) console.log(arguments[a]); return true; }}); execCustom("someval","other"); jsbin this is the best way I can think of UPDATED VERSION (by op) var myClass = function(opts) { var x = function(){ return x.method.apply(x, arguments); }; x.config = opts.config; x.method = opts.method; return x; }; var execCustom = new myClass({ config:{ wait: 100 }, method:function() { console.log("called method with "+arguments.length+" argument(s):"); for(var a in arguments) console.log(arguments[a]); return true; }}); execCustom("someval","other"); jsbin
1
UPDATED VERSION (by op)
What does "to become controversial" mean?
As a non-native speaker, I do not fully understand the meaning of the term "to become controversial" in the following text, which I have to translate into German: Where translators have made their presence felt they have become controversial, with those who characteristically intervene, seeking to domesticate texts, contrasted with those who foreignise, supposedly allowing other languages to alter our own.
What this is trying to say is "when a translator makes their presence felt, that act generates controversy". That is, a translator who makes their own changes to the text that might not be justified by the original, causes people to become upset about those changes.
1
"when a translator makes their presence felt, that act generates controversy"
Should performance tests be instrumented by build tools?
Should performance tests be instrumented by build tools as part of the build process, or should they live completely outside? If outside, then where in the deployment pipeline should they live? I currently see performance tests being attached to integration testing lifecycle phases. While it's fine for now, I know this doesn't seem quite right, and I'm having difficulty finding an actual answer as to where we should be attaching and running these performance tests. For the sake of the question, we can assume an environment utilizing Jenkins for CI, and Maven as a build tool. We can also assume a scrum SDLC.
Ask yourself: what kind of performance tests do you have, and how often do you need them to be run? Tests for the "daily use"? Then make them part of your unit tests. Just in the QA cycle of every release/deployment? Keep them as part of your integration tests (assumed those tests are run for every release/deployment). Tests for an isolated part of your application, just needed once for optimizing purposes and then never again? Then keep them out of your CI cycle. Running time of those tests will probably be a factor. If your performance tests need less than 20 minutes, you won't have much trouble to integrate them into your "nightly builds" on your CI server. If they need a week for a complete run, you obviously need a different strategy. And to my understanding, using an agile model like "Scrum" means to adapt your process to the software you are building, not vice versa. So no decision of "where to place your performance tests" may be final. If you have tests at the beginning which are very fast, and become slower the more you expand them over time, you may have to relocate them in your process, split them up, change them to your needs etc.
1
How often do you need performance tests to be run?
What do I do when a co-author takes too long to give feedback during the peer review process?
Two years ago I did a piece of research for a journal's especial edition. I got the reviewer's comments, did all the corrections and sent it to my co-authors. One of them took so long to return his comments that the paper wasn't included in the EE. I then tried to submit it to another journal but again the same co-author took long time to provide his comments. Finally my boss suggested me to submit it to another journal (good one) without waiting for my co-author's opinion. I got the reviewer's comments back, I did all the corrections (I have 45 days), sent it to my co-authors and gave them a week to send me their comments. The same co-author is now telling me he's not happy I didn't tell him I submitted to that journal and that he won't be able to make comments in a week. I'm again in a catch-22. What do you do?
It's inappropriate to submit a paper for publication before all authors agree that it is ready. Your boss shouldn't have advised you to do this. First, you should apologize profusely to your coauthor. Make sure he knows about the deadline, then wait patiently until he is able to give his comments. If the deadline gets close, you could ask the editor whether you can have more time. If not, it may be necessary to withdraw your submission and resubmit later. When you collaborate with coauthors, you have to accept that the final product needs to be something that everyone can agree on. Yes, this may be inconvenient if one of them is slower, or has different standards than the others, and it can cause you to miss opportunities. This is the price of collaboration. If it becomes a problem, you should talk to your coauthors and try to work out a solution that's agreeable to all, but you cannot act unilaterally.
1
When you collaborate with coauthors, you have to accept that the final product needs to be something that everyone can agree on.
Why choose an 80-200mm over an 18-200mm lens?
Being a beginner, I can't see why I must choose an 80-200 over an 18-200. Are there scenarios where an 80-200 would be preferable over an 18-200? I will be buying a D7000 soon and am looking at these: AF Zoom-NIKKOR 80-200mm f/2.8D ED AF-S DX NIKKOR 18-200mm f/3.5-5.6G ED VR II but similar considerations would apply to other brands as well.
Usually lenses with a large focal ranges end up having poorer quality than lenses for each "normal" focal range (tele, wide, regular zoom). You get more versatility with lower image quality, it's a case of "Jack of all trades, master of none".
0.888889
Usually lenses with large focal ranges end up having poorer quality .
Is there anyway to return particular elements from JFrame?
Lets imagine that JFrame containes 9 JTextFields like so: public static JFrame generateFrame(){ JFrame frame = new JFrame(); Container c = frame.getContentPane(); JPanel panel = new JPanel(); panel.setLayout(new GridLayout(3,3)); JTextField[]textFields = new JTextField[9]; for(int i=0; i&lt;9;i++){ textFields[i]= new JTextField(1); textFields[i].setFont(new Font("Sans-serif", Font.BOLD, 30)); panel.add(textFields[i]); } c.add(panel); frame.setVisible(true); frame.setSize(300,300); return frame; } So I assign this returned JFrame to variable in main method like so: public static void main(String []args){ JFrame gameFrame = generateFrame(); } Is there anyway to extract all the textfields from "gameFrame" object? Something like docyment.getElementByTagName("element") equivalent in DOM?
If the components are all on a single panel you can use the getComponents() method of the panel as already suggested. If you have components on multiple panels then you need to use recursion to get all the component. In this case you may find Darryl's Swing Utils class handy.
0.666667
Darryl's Swing Utils class handy
Is it possible to have a convergent subsequence of a divergent sequence?
Is it possible to have a convergent subsequence of a divergent sequence? Thanks!
It depends on your definition of divergence: If you mean non-convergent, then the answer is yes; If you mean that the sequence "goes to infinity", than the answer is no.
1
Non-convergent sequence
Why Do People "Pre-empt" With Seven Of A Suit In Bridge?
One advantage of a "pre-empt" is quite clear: You take two levels of bidding away from your opponents with a "three" bid. But could that be cutting off your nose to spite your face? Recently, I had something like KQxxxxx, and a side queen (I forget how the other suits were distributed but was told it didn't matter). My partner was disappointed I didn't "preempt" (in "third" seat). My response was "with seven points?" My understanding is that people often bid three of a suit with seven cards and this little. Sometimes even less, particularly when non-vulnerable vs. vulnerable. In its extreme version, the mantra is "with any seven (suited) cards." Isn't this risky? What if we're doubled and only make three or four tricks?
Generally speaking, if you have only seven points as in the example hand, your opponents will have the preponderance of strength. Pre-empts are designed to eat up the bidding room that your opponents could otherwise use to zone in on the right contract. If, as it sometimes happens, your partner has the strength instead, the pre-empt is still good, as it paints a very accurate picture of your hand that your partner will use to determine the right contract. If you get doubled and go down three or four, think about what your opponents will have. They will usually have missed a slam, and your result will compare favorably. It will happen, but it is very rare that your pre-empt will be a total disaster.
1
Pre-empts are designed to eat up the bidding room that your opponents could otherwise zone in on the right contract .
Make *Buffer List* always appear in horizontal split
I know Emacs tries to be intellectual and opens its helper buffers depending on which dimension of the window is bigger, so it may appear in vertical split window if current width is bigger than height, and in horizontal split otherwise. But I’d prefer it to open that list always in horizontal split, because there are long paths I can’t see when the buffer is placed in vertical split. How can I do this?
I believe you've got the horizontal/vertical split terminology back to front (I can never remember which is which either), but as your goal was to retain the original window's width, I'm forcing a vertical split. See C-hf split-window-sensibly RET. It tells you what to do: You can enforce this function to not split WINDOW horizontally, by setting (or binding) the variable `split-width-threshold' to nil. If, in addition, you set `split-height-threshold' to zero, chances increase that this function does split WINDOW vertically. So as a permanent setting: (setq split-width-threshold nil) (setq split-height-threshold 0) For just a specific function, you can advise that function (but see Edit 2 below!): (defadvice list-buffers (around list-buffers-split-vertically) "Always split vertically when displaying the buffer list. See `split-window-sensibly'." (let ((split-width-threshold nil) (split-height-threshold 0)) ad-do-it)) (ad-activate 'list-buffers) Edit: Actually, in this instance I suspect you're only concerned with the interactive case, in which case it's preferable to define a function and remap the bindings: (defun my-list-buffers-vertical-split () "`list-buffers', but forcing a vertical split. See `split-window-sensibly'." (interactive) (let ((split-width-threshold nil) (split-height-threshold 0)) (call-interactively 'list-buffers))) (global-set-key [remap list-buffers] 'my-list-buffers-vertical-split) Edit 2: And Stefan points out that display-buffer-alist facilitates such things without advising functions (and of course avoiding unnecessary advice is always a good thing). I believe we still need a custom action, so: (defun my-display-buffer-pop-up-same-width-window (buffer alist) "A `display-buffer' ACTION forcing a vertical window split. See `split-window-sensibly' and `display-buffer-pop-up-window'." (let ((split-width-threshold nil) (split-height-threshold 0)) (display-buffer-pop-up-window buffer alist))) (add-to-list 'display-buffer-alist '("\\*Buffer List\\*" my-display-buffer-pop-up-same-width-window))
1
Vertical/vertical split terminology
Unit test with HttpWebClient or RestSharp
I am trying to find a way to write the unit test for the "CheckSomething" method, but i am having a very difficult time figuring out what to do with the RestClient object i am instantiating in the method. Should I abstract away the RestClient, and put the Interface dependency at the class level and injected from withint he constructor?? If i go with this route, does that mean I have to interface out all the dependencies ?? public class SomeRepository : IXRepository { public SomeRepository() { } public bool CheckSomething() { var client = new RestClient("someurl"); var request = new RestRequest("resourceX/{name}", Method.GET); request.AddUrlSegment("name", "ABC"); var response = client.Execute(request); if (response.StatusCode == HttpStatusCode.NotFound) return false; if (response.StatusCode == HttpStatusCode.OK) return true; throw new Exception("Something is messed up"); } }
If you don't want a class level RestClient field in SomeRepository, you can use method injection, and add a RestClient parameter to the CheckSomething method. You can then mock the RestClient for your unit tests. public bool CheckSomething(RestClient restClient) { var request = new RestRequest("resourceX/{name}", Method.GET); request.AddUrlSegment("name", "ABC"); var response = client.Execute(request); if (response.StatusCode == HttpStatusCode.NotFound) return false; if (response.StatusCode == HttpStatusCode.OK) return true; throw new Exception("Something is messed up"); } If that were my code, I would want to test the following things: Has the RestRequest that was passed into the RestClient.Execute method been properly setup. Does the method return true or false based on the response.StatusCode Does any other status code result in an exception being thrown. If that is all you need to test, then the only thing you need to mock is the RestClient, which means you could easily just use method injection, or constructor or property injection.
0.666667
How to mock the RestClient?
create a list (or any variable) dynamically, add data to each list and later compare them in C#
I have a list of some strings and I want to create a list for each of them dynamically inside a loop. The main idea is to get each string from this list through the loop and create a list with this string as a name. Then add some data to it. Example: List&lt;string&gt; names = new List&lt;string&gt;(); // this is the main list with strings foreach (string nm in name) { // Here create a new list with this name // Add data to the list } // Now, compare all of them to find duplicate data // Give message if any duplicate data found Update: Basically, I am going to add data to the list using some database APIs on runtime and the string names are the keys in that API. So with each name in the main list, I will retrieve some data from the database, create a list with that name and add data to it. Later we will compare them together. So the basic question is still how do I create these lists at runtime.
You can use IList&lt;KeyValuePair&lt;String,IList&lt;SomethingData&gt;&gt;&gt; or Hastable&lt;String,IList&lt;SomethingData&gt;&gt; //fill data to lists IList&lt;KeyValuePair&lt;String,IList&lt;SomethingData&gt;&gt;&gt; dataSets=new List&lt;KeyValuePair&lt;String,IList&lt;SomethingData&gt;&gt;&gt;(); IList&lt;string&gt; names = new List&lt;String&gt;(); foreach (string nm in names) { IList&lt;SomethingData&gt; data = new List&lt;SomethingData&gt;(); //...fill data dataSets.Add(new KeyValuePair&lt;string, IList&lt;SomethingData&gt;&gt;(nm, data)); } //search lists by name String nameForSearch = "test"; IEnumerable&lt;KeyValuePair&lt;String,IList&lt;SomethingData&gt;&gt;&gt; dataSetsByName = dataSets.Where(ds =&gt; ds.Key == nameForSearch);
0.888889
IList&lt;KeyValuePair
How do you grapple in Dead Rising 3?
I just started playing Dead Rising 3 on the Xbox One. I got to the first grapple, and I can't figure out what I'm supposed to do. The top of the screen says "Perform a gesture to escape a grapple" - what does "gesture" mean in this context? Is it something to do with Kinect?
Turns out you need to do a Kinect gesture - just flail around and it will fling off the zombie!
1
Do a Kinect gesture
Is this strengthening of paracompactness known?
Consider a topological space $X$. What can be said about the following property? For any open cover $\mathcal U = \{ U_i \}_{ i \in I }$ of $X$, there exists an open refinement $\mathcal V = \{ V_j \}_{ j \in J }$ such that any set $V \in \mathcal V$ of the refinement intersects only finitely many other sets of $\mathcal V$. This property is stronger than paracompactness, but is it weaker than compactness? Does it hold on topological manifolds (which are paracompact and second-countable)?
This property has been called hypocompactness; it is strictly weaker than compactness and strictly stronger than paracompactness. The Sorgenfrey line is hypocompact but not compact: every open cover has a disjoint clopen refinement. Any hedgehog space $X$ of uncountable spininess is an example of a paracompact space that is not hypocompact. $X$ is metrizable, so it’s paracompact. If $X$ has spininess $\kappa$, $p$ is the centre point of the hedgehog, the points at the ends of the spines are $q_\xi$ for $\xi&lt;\kappa$, and the metric $d$ is as in the linked article, the open cover $$\left\{B_d\left(p,\frac23\right)\right\}\cup\left\{B_d\left(q_\xi,\frac23\right):\xi&lt;\kappa\right\}$$ has no open refinement that is star-finite at $p$. Added: Henno reminds me that I forgot to answer the last question. Paracompact Lindelöf spaces are hypocompact, so separable metric spaces are hypocompact.
0.888889
Paracompact Lindelöf
What order do multiclass characters spend Hit Dice at the end of a short rest?
This is a followup question to "What Hit Dice do multiclass characters spend at the end of a short rest?". Under the rules for Short Rest (PHB 186): A character can spend one or more Hit Dice at the end of a short rest, up to the characters maximum number of Hit Dice, which is equal to the character's level. For each Hit Die spent in this way, the player rolls the die and adds the characters Constitution modifier to it. The character regains hit points equal to the total. I have a multiclass character - level 1 Monk (d8 Hit Die), levels 2 - 4 Wizard (d6 Hit Die). At the end of a short rest I can spend up to 1d8 and 3d6 Hit Dice to regain hit points. Can I spend the dice from my pool in any order? Or do I have to spend them in the order that I got my class levels - so always a d8 first, then the d4's?
This is a pool of dice for you to spend at your leisure. You spend them in whatever order you want to. There's no rule to dictate which one you spend when or in what order. Thus, spend the dice that it makes sense to spend, if you're sitting there with 8 points of damage, roll the d8 (or, well, 2 of the d6s...). Some folks might feel like this is a bit metagamey, those folks could randomize or create an order in which they always spend them, but that's going to be highly sub optimal. The whole process of spending HD is already slightly metagamish so I wouldn't sweat this one.
0.777778
How to spend a pool of dice at your leisure?
What is the English name for Chitra Rajmah?
What is this variety of kidney beans called in English? We call them "Chitra Rajmah" in Hindi. http://www.helloorganic.com/Rajma_chitra.html
we have reached three varieties of common beans (Phaseolus vulgaris) commonly used in India while researching for website. kidney beans - rajma. pinto beans - chitri wala rajma, printed rajma. Navy bean - white rajma, white beans, safed rajma. You can found more about Indian ingredients in English to Hindi here.
1
Indian ingredients in English to Hindi
Need more memory to install Nova 3 Near Orbit on Samsung Galaxy S2
I have a Samsung Galaxy S2, running Android 4.0.3. I want to install Nova 3 Near Orbit on this device. I need 2 gigabyte of memory to install the game, but I only have 1.97 gigabytes in total. How can i get the other 3 megabyte? I have 11 gigabyte of space on my phone, and I also have an SD card with 14 gigabyte.
You can get free storage space the same way you do on your PC: Uninstall some apps you're not using. You might find it useful to go into the device Settings, then Apps (or Applications manager), then press the menu key and choose Sort by size to see which are taking up the most space. If you have lots of videos, photos, or music in your internal storage, delete them, or move them to your SD card.
0.888889
Uninstall some apps you're not using
How to specify the multicolumn width in table header?
I want to read/input the body of a table from a separate file. I have mostly solved this problem using this question. But when I try to read a table with multicolumn from a separate file, it failed. The following is an example. %main.tex \documentclass{article} \usepackage{filecontents,catchfile} \begin{filecontents*}{table.tex} %table.tex \hline A &amp; B &amp; C &amp; D \\ \hline E &amp; \multicolumn{3}{l|}{This is generated by excel2latex macro. I want to let it auto wrap according to the width of (B+C+D) } \\ \hline \end{filecontents*} \begin{document} Table test. \section{Insert a full table} \begin{tabular}{|p{2cm}|p{2cm}|p{2cm}|p{2cm}|} \hline A &amp; B &amp; C &amp; D \\ \hline E &amp; \multicolumn{3}{p{6cm}|}{This is generated by excel2latex macro. I want to let it auto wrap according to the width of (B+C+D) } \\ \hline \end{tabular}% \section{ Input the body of table from a separate file} \CatchFileDef{\mytable}{table.tex}{}% table.tex &gt; \mytable \begin{tabular}{|p{2cm}|p{2cm}|p{2cm}|p{2cm}|} \mytable \end{tabular}% \end{document} I just don't want to manually define the width in the body of table because it is generated automatically.
I have solved this by specifying \multicolumn{ncols}{ p{\tablewidth} }{long sentence...} And then use a minipage enviroment outside of it %main.tex \documentclass{article} \usepackage{filecontents,catchfile} \begin{filecontents*}{table.tex} %table.tex \hline A &amp; B &amp; C &amp; D \\ \hline E &amp; \multicolumn{3}{ p{\tablewidth} }{This is generated by excel2latex macro. This is generated by excel2latex macro. This is generated by excel2latex macro. I want to let it auto wrap according to the width of (B+C+D) } \\ \hline \end{filecontents*} \begin{document} Table test. \section{Insert a full table} \begin{tabular}{|p{2cm}|p{2cm}|p{2cm}|p{2cm}|} \hline A &amp; B &amp; C &amp; D \\ \hline E &amp; \multicolumn{3}{p{6cm}|}{This is generated by excel2latex macro. I want to let it auto wrap according to the width of (B+C+D) } \\ \hline \end{tabular}% \section{ Input the body of table from a separate file} \CatchFileDef{\mytable}{table.tex}{}% table.tex &gt; \mytable \begin{tabular}{|p{2cm}|p{2cm}|p{2cm}|p{2cm}|} \mytable \end{tabular}% \end{document}
1
multicolumnncols ptablewidth long sentence
Calculate integral for arbitrary parameter n in infinite square well problem
I'm continuing[1,2] the study of an infinite square well in the context of quantum mechanics. Ultimate goal is to calculate the product $\Delta x\Delta k$, for various eigenstates, that is for various values of number $n$. I have finished with $\Delta x$, but I'm stuck with $\Delta k$. ClearAll["Global`*"]; (* The length of the well *) L = 1; (* The eigenfunctions, n=1,2,3,... *) u[n_, x_] := If[x &lt;= 0 || x &gt;= L, 0, Sqrt[2/L] Sin[n π x / L]] (* The Fourier transform of eigenfunctions u[n,x] from the position domain onto the momentum domain *) φ[n_, k_] := Simplify[ FourierTransform[u[n, x], x, k, FourierParameters -&gt; {0, -1}], n ∈ Integers] (* The probability density function η(n,k) *) η[n_, k_] := FullSimplify[φ[n, k] \[Conjugate] φ[n, k], {n ∈ Integers, k ∈ Reals}] (* Calculate (Δk)^2 = &lt;k^2&gt; - &lt;k&gt;^2 = &lt;k^2&gt; *) Integrate[ k^2 η[n, k], {k, -∞, +∞}, (* Edited: Was: {n ∈ Integers, n &gt; 0}, but this edit didn't fix the problem. *) Assumptions -&gt; n ∈ Integers &amp;&amp; n &gt; 0] The problem is that Mathematica can't calculate the last integral for any arbitrary $n$, although it can, correctly, calculate its value for hardcoded $n$s. Like $n=1,2,...$. My question is: Do you have any idea on how I could calculate it, perhaps by rewriting it a bit, or by using some other trick? In case it helps, the result should be $n^2\pi^2$. Note: Actually it can be calculated with Cauchy's residue theorem, but I'd like to avoid taking that route, if possible. Though, if it can't be done otherwise, I will post a solution with residual calculation so that this question has an answer. Mathematica.SE related (to the physical problem) questions: Is there a more mathematica-y way to label these plots? Why does FourierTransform converge while same integral manually written does not?
The following code yields the correct result: Another interesting fact is that if I omit the assumption that k ∈ Reals, then Mathematica still gets it right, but it takes ~3x more time: What is puzzling though is that if I use Assumptions with Integrate I don't get the expected result: I was under the impression that Assuming[{a1,a2,...}, Integrate[...]] was equivalent to Integrate[..., Assumptions -&gt; a1 &amp;&amp; a2 &amp;&amp; ...]. Could anyone please try to reproduce my results, ideally in a different OS/Mathematica version combination ? That is something other than Mathematica 9.0.1/Mac OSX 10.9 ?
0.833333
Mathematica 9.0.1/Mac OSX 10.9
Where did the daylight come from in the interior of Babylon 5?
The interior (open space) of Babylon 5 had night and day; whence came the daytime light? Light sources bright enough to account for the ‘daylight’ were never depicted in the show. In Arthur C. Clarke’s Rama, the light sources are well described, and very bright.
In a piece originally written on GEnie and archived on the excellent Lurker's Guide website, J. Michael Straczynski describes the station as being; "...patterned physically after the work of such scientists as Gerard K. O'Neill" with the central core of the station containing a "hollow-world look, with fields and hydroponic gardens along the 360-degree circular section (which is about a half-mile, or a mile across)...This area is known as the Garden." If you study other O'Neill Cyclinders, you can see that they have alternating glass and land sections to allow light but the B5 gardens seem to be lit using a "sun line", either chanelling light from the nearby Epsilon Eridani star using mirrors or simply creating artificial light using the station's powerful fusion reactors. The lack of an obvious channel between the exterior of the station and the interior would strongly suggest that it's the latter. You can see the "sun lines" in the pictures and video below;
1
The central core of the station is patterned after the work of such scientists as Gerard K. O'Neill
ERR_SSL_PROTOCOL_ERROR in chrome 39 and 40 but works in chrome 36.Help fix in chrome 39
I am able to access a URL in Chrome 36 and IE8 but in Chrome 39 or 40 or Firefox 35 it throws the error: Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have. Error code: ERR_SSL_PROTOCOL_ERROR}. It seems that it is an issue related to the SSL certificate. How can I fix this?
Try this. In Chrome, enter "chrome://flags/#enable-quic" without the quotes as a URL. CTRL + F to search for "quic", at which point you'll find... Experimental QUIC protocol. Mac, Windows, Linux, Chrome OS, Android Enable experimental QUIC protocol support. #enable-quic Turn that to disabled, and let it restart your browser when prompted below.
0.888889
Experimental QUIC protocol
How to add classes to comments?
I've put the following code above print render($content['comments']); in comment-wrapper.tpl.php of our theme to add question or answer class to every comment: foreach($content['comments'] as &$c) { if(is_array($c) && array_key_exists('#entity_type', $c) && $c['#entity_type'] == 'comment') { $uid = $c['comment_body']['#object']->uid; $c['#attributes']['class'][] = $uid == 1 ? 'answer' : 'question'; } } The generated HTML however has no question or answer classes. Please help me to correct the error.
The following code worked for me, put it in your theme's template.php and replace theme with the name of your theme: function theme_preprocess_comment(&amp;$vars) { $element = $vars['elements']; $comment = $element['#comment']; if(array_key_exists('#entity_type', $element) &amp;&amp; $element['#entity_type'] == 'comment') { $vars['classes_array'][] = $comment-&gt;uid == 1 ? 'answer' : 'question'; } } Although I think the extra checks for entity type is not necessary since this theme is only applied to comments.
1
Using template.php theme
C++ queue with multiple values
I am looking for a queue with multiple values but the default std::queue supports only two values like queue&lt;int, int&gt; myqueue; I have eight elements and want the same functionality of queue (PUSH, POP, etc.) like this queue&lt;int, int, int, int, int, int, int, int&gt; myqueue;
Simply store std::vector in the queue for instance. Or if the values have different meaning, simply create a custom structure and store it in the queue instead. By the way std::queue stores a single value meaning each element is a single value(if that is what you meant).
0.833333
Simply store std::vector in the queue for instance
Access/Pass variable between windows form and DataSet TableAdapter SQL where clause
In Visual Studio 2010, I have a windows forms application frmMain.cs with a ComboBox. From the form itself I can access its value with cmbxYear.SelectedValue. I also have a DataSet.xsd file to bind to an rdlc report to a TableAdapter to present view data. The TableAdapter has a SelectCommand that takes SQL code. I need to get the value of cmbxYear.SelectedValue into the WHERE clause of the TableAdapter. Does anyone know how I can access/pass the variable value from the form into the DataSet TableAdapter SelectCommand WHERE clause?
I am using the OleDb provider for Oracle. The bind variable should be a question mark ? not :DEPTCODE The bind variable :DEPTCODE would be valid for System.Data.OracleClient See full walk through here: http://www.fullstackbusinessdesign.com/forums/ORA-01008.html Many thanks to Prashant Kumar for this solution. http://forums.asp.net/members/Prashant%20Kumar.aspx
1
bind variable :DEPTCODE
"Caldoniafied" In General Use in the 1980s?
I am curious about the word "Caldoniafied" meaning, roughly, hard headed, and presumably coming from the song entitled "Caldonia" ("Caldonia, Caldonia, what makes your big head so hard?". )Louis Jordan had a big hit with it, and BB King still sings it. This word was used by my Brooklyn landlady in the 1980s. Was it in general use at this time? Also, was it a huge insult? I am writing a novel set at this time and wanted to use it as a light term. Google doesn't have much about it.
I would not use the term "Caldoniafied," even in a lighthearted way. In the first place, I'm not aware that the expression was ever common in the United States, either during the 1980s (I spent 1980–81 in Washington, D.C.; 1982–84 in Staten Island, New York; and 1985–89 in Berkeley, California) or afterward. A Google search turns up just one match for Caldoniafied and none for Caldoniafy. From Ed Ward, "Dedicated to You," in Greil Marcus, ed., Stranded: Rock and Roll for a Desert Island (1979): One night, as they were leaving the backstage of a show, a teenager had called Obediah [Carter, who sang tenor for the "5" Royales] "an old Caldoniafied nigger," and the rest of the guys had to hold him back to keep him from outright throttling the kid. This incident occurred sometime in late 1959 or early 1960. It's not clear to me what exactly the teenager meant by "Caldoniafied." Since Louis Jordan sang comic and novelty songs (as the "5" Royales often did a decade later), and since Jordan's vocals launched into the high tenor range on "Caldonia" (as Carter's did on various songs in the "5" Royales repertoire), perhaps the kid was implying that Carter was stealing his singing style from Jordan and that the style was in any case behind the times. Or perhaps the kid simply meant that Carter and the other Royales were hopelessly hardheaded in refusing to adapt to the fundamental changes then occurring in R&amp;B and rock. In any event, the remark didn't sit well with Obediah Carter, and I don't get the impression that the choice of "Caldoniafied" as a modifier softened the blow of the ultimate racial epithet. It would be difficult (I think) to use "Caldoniafied" today in a non-race-inflected way. The OP's Brooklyn landlady may have pulled it off, but for anyone who has committed Louis Jordan's "Caldonia! Caldonia! What makes your big head so hard?" to memory, it is hard not to think of Caldonia as anything but a lean, lanky, hardheaded Black woman (with great big feet)—even though Jordan never specifies her race or color. In a culture sensitized to and uneasy about the implications of racial innuendo, I would do my best to steer clear of "Caldoniafied," "Jemimafied," "Porgyfied," "Rochesterfied," and the like as if they were so many land mines.
0.888889
"Caldoniafied" is a non-race-inflected expression of racial innuendo
Nexus 7 is stuck in reboot loop after full discharge
I have a few day old Nexus 7 tablet, unrooted, bootloader still locked, and otherwise in factory condition. This morning, it ran its charge out. When I plugged in it, this happens: Google Logo appears. Nexus Logo appears. Lock screen which shows charging: 0%. White screen, device powers off. Repeat. What is happening? Thanks!
Some devices (I don't know about the Nexus 7, but I think it will be about the same) only charge when they have still a little charge left on their battery, because - believe it or not - charging happens electronically. So it can be that your device has absolutely no juice left to run. An example of such a device is the BlackBerry PlayBook (not Android) where this trick works when your tablet doesn't want to boot. But there is a simple solution for that, which can take some time. Try to keep your device awake for as long as possible, even if that means you have to restart it a couple of times. Of course you do this while your charger is connected. After you have restarted it a couple of times, it should normally boot up. I expect it will take about 7 or 8 boots for the battery to be charged at minimum level again. After that, make sure you keep the device connected long enough so the battery is fully charged (have a look in your user manual how long it is recommended, most tablets need about 8 hours). Another option is that your device just needs a little more juice to start. In that case you should leave it plugged in for some time (I recommend at least an hour) before booting. tl;dr: Two options you could try: 1) Just keep restarting it, after a while it will start as normal. Recharge the battery for a long time (probably around 8 hours). 2) Leave it plugged in for a long time before restarting
1
Try to keep your device awake for as long as possible .
How to prove that $f_n(x)=\frac{nx}{1+n\sin(x)}$ does not converge uniformly on $[0, \pi/2]$?
If $f_n$ is a sequence of functions over $[0, \pi/2]$ given by $$f_n(x) = \frac {nx} {1+n\sin(x)},$$ then how would I go about proving that $f_n$ does not converge uniformly to a function $f$ on $[0, \pi/2]$?
When $x=0$ then $f(x)=0$. When $x\not = 0$ then $f(x)=\frac{x}{\sin x}$. So, $$f(x)=\begin{cases}0 &amp; \text{ for } x=0\\\frac{x}{\sin x} &amp; \text{ for } x\in (0,\pi/2]\end{cases}$$As, $f$ is not continuous at $x=0$, so $\{f_n(x)\}$ is NOT uniform convergent.
0.888889
When $x = 0$ then $f(x)=0$
Is there a single word that means "self flagellation" or "self punishment"?
In the back of my mind, I'm almost certain there are at least several individual English word that means to punish one's self. It doesn't have to be physical, necessarily, but it must be some kind of self-punishment. Are there such words? Clinical words are also accepted (i.e. psychological terminology).
You'd describe a person who believes that they are in need of self-punishment as penitent. I think that's more a state of mind than an actual act of self-punishment, though.
1
Self-punishment is more a state of mind than a penitent act, though
How are futures contracts setup at an exchange?
I'm having a hard time wrapping my head around how the actual contracts are structured at an exchange. Here are my questions: If an exchange facilitates the trading of futures contracts and nobody intends to take delivery of the product, nor do they own it so they can deliver it, then how are the contracts issued? Is there a fixed number of contracts that are created and traded, or is there an "unlimited" number of contracts? If none of the traders intend to take delivery nor do they want to deliver, then where do the sellers get the contracts to sell? How does that process work? It's easy to figure out how it works with trading stocks or currencies: the stocks are issued by the company and granted to the owners, then they sell the stocks. Currencies are much the same: you have accumulated some cash and you want to trade it. But in both of those cases the trader either owns something or buys it from somebody else. How do traders of futures contracts obtain them? P.S. I'm not sure if this is the correct place to get clarification on this subject, but if there is a better stackexchange sub-domain for it, then I'll go there.
If an exchange facilitates the trading of futures contracts and nobody intends to take delivery of the product, nor do they own it so they can deliver it, then how are the contracts issued? Say I want to buy a future contract that allows me to buy coffee at a given price in December 2013. Technically, this contract allows me to buy 37,500 pounds of coffee at the specified price in December 2013. I have two options. If the contract already exists in the market (this contract does), I can simply purchase the contract in the market. If it doesn't exist, however, the process works like this: I approach a futures commission merchant, who sends the buy order to a broker on the trading floor/pit or to the exchange order system. Assuming someone else has put in a sell order for the same commodity, expiration, etc. the orders are matched at the agreed upon price, and the futures contract is created. Also, the FCM reports the trade to the exchange's clearing house, which guarantees the trade and removes counter-party risk. In other words, if the price of coffee changes dramatically, and one of the parties in the trade cannot meet its buy or sell obligation, there isn't a default. The clearing house settles the trade. Is there a fixed number of contracts that are created and traded, or is there an "unlimited" number of contracts? No, there is no fixed number. The Wikipedia article on futures exchanges sums this up: Futures contracts are not issued like other securities, but are "created" whenever Open interest increases; that is, when one party first buys (goes long) a contract from another party (who goes short). Contracts are also "destroyed" in the opposite manner whenever Open interest decreases because traders resell to reduce their long positions or rebuy to reduce their short positions. If none of the traders intend to take delivery nor do they want to deliver, then where do the sellers get the contracts to sell? How does that process work? The futures market doesn't consist of only traders. The terminology that you usually hear are speculators and hedgers. Speculators are the traders you're thinking of, while hedgers are farmers, oil producers, or companies that rely on commodities. All of these groups enter the futures market in order to lock in a future price at which to buy or sell the products they need, in order to protect themselves from future price swings. For example, if I'm an oil producer like ExxonMobil, the price of oil significantly affects my future revenue. The price of Brent crude oil is currently around $108/barrel. If this price increases to $120/barrel in a year, they may earn much more revenue. However, if the price drops to $80/barrel, however, their revenue stream is negatively affected. Therefore, I go to the futures market and sell a futures contract that expires in one year and allows me to sell oil for $108/barrel. If the price of oil jumps to $120/barrel in one year, I would have been better off without a futures contract. However, if the price drops to $80/barrel, I saved myself a considerable loss. This is how the futures market lowers risk and helps to smooth commodity prices in the long run. Who takes the other side of the trade? Consider an airline company that knows it will need oil1 for its planes in a year. The airline company will earn more revenue if the price of oil drops to $80/barrel (the exact opposite of ExxonMobil), but lose revenue if the price jumps to $120/barrel. The airline may decide to enter the futures market and agree to buy oil at $108/barrel in one year, thus completing the trade. The futures contract is created and traded in the market.2 3 Expiration When the contract expires, the buyer/seller either takes delivery of the commodity or the contract is settled for cash between parties. As maturity nears, the price of the contract usually converges to the spot price. Consider our example oil contract, which was created at $108/barrel. If in one year, the spot price of oil has increased to $120/barrel, the contract's price will converge to $120/barrel. Exxon received $108 for its sale of the contract, and now owes $120 in cash or $120 in oil. The cost of its hedge was $12. The airline company bought the contract for $108, and now receives $120. It profited $12 from its hedge, so Exxon would pay the airline company $12. Exxon could sell oil for $120/barrel, but because of the cost of its hedge, it's only receiving $108/barrel, exactly the price it locked in by selling the contract in the first place. Consider what happens if the price of oil had decreased to $80/barrel. Exxon received $108 for its sale of the contract, and now owes only $80, for a profit of $28. The airline company, however, paid $108, but only received $80 in return, for a loss of $28, so the airline company would pay Exxon $28. Similar to above, Exxon can only fetch $80/barrel for its oil in the spot market, but because it earned $28/barrel by selling a futures contract, it's really receiving $108/barrel for the barrels in the contract. 1 In reality, planes don't run on oil; they run on jet fuel. Since there isn't a futures contract for jet fuel, the airline could study the past relationship between prices of jet fuel and oil in order to estimate the future price of jet fuel, given a future price of oil. Since the company can lock in the price of oil through a futures contract, they'll lock in a price of oil that, based on their estimated model of jet fuel/oil prices, will give them enough funds to purchase the appropriate amount of jet fuel. 2 It's also important to understand that not all hedgers will operate this way. It's certainly possible for a company to hedge too much, and therefore not benefit at all if the price swings in their favor. This has happened to airline companies in the past; even when oil prices have fallen, they haven't benefited because their hedges were expensive enough to outweigh the potential gain. However, had the price increased dramatically, their hedge would have been highly effective. 3 Also, in this simple example, two companies may choose to bypass the futures market all together and create an over-the-counter (OTC) contract instead. For example, ExxonMobil could agree to sell oil to a specific company at $108/barrel in one year, without entering the futures market at all. This option may be cheaper than entering the futures market, but futures markets also have the benefit of clearing houses to mitigate counterparty risk. If Exxon agrees to sell oil to a company, which then goes bankrupt, Exxon is protected if the hedging was done through the futures market. In the OTC market, this protection isn't always there. OTC contracts can be useful, however, if (for example), the company wants to make or take delivery of a commodity at a different location than that specified in the standardized contracts available on an exchange.
0.666667
How do futures exchanges work?
Specifying the keyboard layout for Chinese input
I use both Chinese (pinyin) and Japanese (romaji) input and am used to having them mapped to a standard US keyboard layout. However my regional setting is Switzerland since I'm studying here and “internet services may vary according to region”. Strangely, the Japanese input uses the US keyboard layout, but Chinese uses a European layout (not sure what, but z and y are switched). (Irrelevant to problem). My inputs are, in this order: English (US) German Japanese (Kotoeri) Chinese As Tom pointed out, in Kotoeri's preferences the layout can be defined. The Chinese input however uses the last layout of a Latin input, in this case German. There also doesn't seem to be an option to customise the order of these inputs. My workaround is to cycle backwards, but this obviously is a special case. If anyone has a better solution it would be appreciated.
You set the Latin keyboard layout for Japanese input in the Kotoeri Preferences. For Chinese, the IM normally uses the last Latin keyboard layout that you have used. Settings you make in the system preferences/language &amp; text/language or formats tab are irrelevant for the keyboard layout. Only the input sources tab affects that (and Kotoeri preferences when that is chosen as an input source).
0.666667
Kotoeri Preferences for Japanese input
How to create an app/package whose sole functionality is to redirect?
I want to create an app/package to be published on the appexchange. The only functionality of that app/package will be to redirect the user to a configured URL in the app. This will happen once enterprise admin adds the app from the appexchange. The redirect functionality is related to remote access via Oauth2. Once redirected to the URL, the URL endpoint will kick in and do all the further steps. I do NOT want the admin of the enterprise to make any config e.g creating webtab or a link as a workaround to making some package. This SHOULD be done when the app is added. In other words, can we make an app that does not contain any tab, but just a URL? Also, Can we package remote access apps?
I highly recommend you review Force.com Platform Fundamentals Workbook which has a complete tutorial on building an App. I think you'll find the answer to what constitutes an App there. To help you get the most benefit from Salesforce StackExchange, you may find it helpful to look at our FAQ which explains how to post effectively when you visit this site. I'll add that I also believe you'd have also discovered the answers to your question through the many resources available to developers linked from the Wiki provided to you in the response to your previous post.
0.888889
How to build an App?
Which color scheme to choose for applications that require long work hours?
I'm working on a ERP / Accounting (lots of tables and data) web app and was wondering what color scheme would be appropriate for this type of application? Users will be sitting in front of their computers for 8+ hours enetering lots of data on daily basis and I would like to make that experience as comfortable as possible to their eyes. Most of these application I've seen are using some sort of a white/grey/blue scheme with white being dominant but I'm concerned that this color might strain their eyes to much especially considering different brightness of monitors and working in the dark. Any help would be appreciated.
While a good color scheme will help, the key thing to note here is the need for contrast for enhanced readability. To quote this article from eyemagzine Light grey text on a white background and small text size both lead to an increased orbicularis oculi activity and decreased blinking. These two conditions are related to text quality, and we would expect to find similar indicators of eye fatigue with poor font quality or condensed letter spacing. For examples of good color combinations with sufficient contrast I recommend reading this article on UX matters which has this to say on what contrast to choose for minimal eye strain. Ensuring the Readability of Text Through Contrast For backgrounds behind text, use solid, contrasting colors, and avoid the use of textures and patterns, which can make letterforms difficult to distinguish or even illegible. Choose combinations of text color and background color with care. Value contrast between body text and its background color should be a minimum of about eighty percent. Contrast with a white background Black text on a white background provides maximal value contrast and, therefore, optimal readability for body text. The contrast between charcoal gray (#333333) text and a white background is about eighty percent—thus giving minimally good value contrast. - The following dark colors provide good to excellent contrast and legibility for text on a white background: The importance of contrast with regards to reducing eye strain is explained further in the article as highlighted below Contrast and Legibility “To provide the best legibility, ensure that text contrasts adequately with its background in both hue and value.” To provide the best legibility, ensure that text contrasts adequately with its background in both hue and value. When there is insufficient contrast between the hue or value of text and its background color, the text appears blurred or has a halo effect around it, making it difficult to read and resulting in eye strain. That said the choice of text and size is also critical. To quote the above referenced eye magazine site article Designers usually try to use high quality text when readers are expected to read for any period of time, but using a comfortable text size is not always possible. In print, there is a trade-off between type size and the amount of text that can fit on a page. Nine-point type may be chosen because it is cost-effective, whereas eleven-point would be easier to identify visually and would reduce eye strain. Twelve-point text may be needed for good character definition on computer screens, because readers frequently sit further from a screen than from a printed page, but many Web pages specify small font sizes despite the fact that it costs no more to create additional or longer pages. Designers need to argue for larger text sizes to reduce the effects of eye strain. From an Accessiblity standpoint I also recommend looking at W3C guidelines on recommended level of contrast 1.4.3 Contrast (Minimum): The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for the following: (Level AA) Large Text: Large-scale text and images of large-scale text have a contrast ratio of at least 3:1; Incidental: Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains significant other visual content, have no contrast requirement. Logotypes: Text that is part of a logo or brand name has no minimum contrast requirement. You should also considering offering a high contrast option which will allow users to work comfortably in low light situations. It would be a good idea to provide multiple options like how kindle handles it as shown below. With regards the benefits of using the high contrast mode in dark rooms,I recommend looking at this snippet from this article However, using light text on a dark background also has its advantages for attracting less light in a dark room. That said, while reversing color ensure this taken care of better readability When reversing colour out, eg white text on black, make sure you increase the leading, tracking and decrease your font-weight. This applies to all widths of Measure. White text on a black background is a higher contrast to the opposite, so the letterforms need to be wider apart, lighter in weight and have more space between the lines. Lastly here are some articles on color schemes suitable for coding which might help you make your final decision (I know your application does not deal with users coding on it but the use case is similar here..) Solarized color schemes help you code longer :To quote the article Solarized doesn’t just claim to be easy to read based on the designer’s personal preferences, though. Ethan Schoonover, the designer responsible for the project, clearly explains the rationale behind the decisions he made on the project site. The most prominently visible is the use of selective contrast: “On a sunny summer day I love to read a book outside. Not right in the sun; that’s too bright. I’ll hunt for a shady spot under a tree. The shaded paper contrasts with the crisp text nicely. If you were to actually measure the contrast between the two, you’d find it is much lower than black text on a white background (or white on black) on your display device of choice. Black text on white from a computer display is akin to reading a book in direct sunlight and tires the eye. Solarized reduces brightness contrast but, unlike many low contrast colorschemes, retains contrasting hues (based on colorwheel relations) for syntax highlighting readability.” White-on-black themes, popular among developers who want to reduce eye strain, are an improvement over black-on-white themes, but the contrast is still far too great. Here are some links worth checking out Color schemes for vim What makes a good IDE color scheme
1
Color schemes for vim What makes a good IDE color scheme?
When ordering lumber what percentage of waste should be expected?
Let's say I'm getting ready for a remodeling project, and I'm getting ready to order 2x lumber for framing. Specifically, I'll be ordering No. 2 or better 2x lumber. What percentage of my order should I expect to be scrap (i.e. twisted, warped, crap)? I've dug through the junk at places like Home Depot and Lowe's, and found it difficult to find a relatively straight board. Do big box stores just keep re-stacking the picked over garbage, so the percentage of junk increases over time? Should I expect this level of waste when ordering from a lumber yard?
In the big picture, if you order a lumber package from a reputable lumber yard, they'll replace any boards that are not usable. So technically, "Zero." Practically, it may be cheap "insurance" to order one or two extra of what you deem to be the pieces that would most halt your forward progress at a critical phase of the operation.
1
If you order a lumber package from a reputable lumber yard, they'll replace any boards that are not usable
Log4j2 not logging to console
I cannot get Log4j 2 to log to the console. Nothing is showing up when running with gradle. log4j2.xml in the projects root directory: &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Configuration status="ALL"&gt; &lt;Appenders&gt; &lt;Console name="Console" target="SYSTEM_OUT"&gt; &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt; &lt;/Console&gt; &lt;/Appenders&gt; &lt;Loggers&gt; &lt;Root level="all"&gt; &lt;AppenderRef ref="Console"/&gt; &lt;/Root&gt; &lt;/Loggers&gt; &lt;/Configuration&gt; Usage in my classes: public class ABCHandler { private final Logger logger = LogManager.getLogger(); public ABC(String serialPortName) { logger.info("Opening serial port {}", serialPortName); } }
Loading your file and configurations on my machine works. This was the class I used: import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class Test { private final Logger logger = LogManager.getLogger(Test.class); public Test(String serialPortName) { System.out.println(logger.isInfoEnabled()); logger.entry(); logger.info("info! {}", serialPortName); logger.error("error! {}", serialPortName); logger.debug("debug! {}", serialPortName); } public static void main(String args[]) { Test h1 = new Test("1001"); } } This is the log4j2.xml: &lt;ThresholdFilter level="all"/&gt; &lt;Appenders&gt; &lt;Console name="STDOUT" target="SYSTEM_OUT"&gt; &lt;PatternLayout pattern="%d %-5p method: [%t] %C{2} (%F:%L) - %m%n"/&gt; &lt;/Console&gt; &lt;/Appenders&gt; &lt;Loggers&gt; &lt;Root level="all"&gt; &lt;AppenderRef ref="STDOUT"/&gt; &lt;/Root&gt; &lt;/Loggers&gt; and finally, this is the output: true 2014-05-29 12:19:15,266 TRACE method: [main] Test (Test.java:10) - entry 2014-05-29 12:19:15,268 INFO method: [main] Test (Test.java:11) - info! 1001 2014-05-29 12:19:15,269 ERROR method: [main] Test (Test.java:12) - error! 1001 2014-05-29 12:19:15,269 DEBUG method: [main] Test (Test.java:13) - debug! 1001 One common error when using Log4j2 is placing the log4j2.xml in a file that is not in the classpath. To diagnose if that is the problem, change the line logger.info("Opening serial port {}", serialPortName); to logger.error("Opening serial port {}", serialPortName); If you see any output it is because log4j can't load your file. This is because the default log level when the file is not found is ERROR, not DEBUG. The location of the log4j2.xml on my project (Maven) is in src/main/resources, which I know it is in my classpath.
1
Log4j2.xml is in classpath
Google chrome and chromium black window
When I update my google chrome or chromium to a version that is higher than 38 The window of the browser gets black functional square. It's all black even the top bar. I basically can't see anything just black. When I downgrade to version 38 or previous version, It runs correctly. The machine has centos 6.6 3.10.56-11.el6.centos.alt.x86_64.
Black Chrome windows are often, but not always, a symptom of a version mismatch between the X11 video driver and the kernel video driver. I've found that, amongst the programs I use regularly, Chrome was by far the most sensitive to such mismatches. Such a mismatch usually happens after doing a partial system upgrade. Finishing the upgrade and rebooting (to get the new kernel driver) solves the problem, if a driver mismatch was the cause.
0.888889
Windows mismatch between X11 video driver and kernel driver
Where does the Bible say to read itself?
It seems rather basic, but I'm having trouble finding verses that say to read God's Word often. It seems like something that Paul said quite a few times, and it's obviously a good thing, but I can't find any specific verses. Can someone help me?
Isaiah 28:10New King James Version (NKJV) 10 For precept must be upon precept, precept upon precept, Line upon line, line upon line, Here a little, there a little.”
0.777778
Isaiah 28:10New King James Version (NKJV) 10 For precept must be upon precept, Precept upon Precept
Does port forwarding a port on one computer expose other computers in the network as well?
I have read that port forwarding exposes your computer to security breaches. Does port forwarding a port on one computer expose other computers in the network as well?
You can consider your router the perimeter between those machines you trust and those you don't. When you port-forward, you are permitting access from machines you don't trust to one that you do. This automatically lowers the trust of your machine. This is warranted because when you are port-forwarding you are saying that it is acceptable for a machine that you don't trust to influence the behaviour of one that you do trust, each time a connection is made to it. While you may only permit access to a specific service on your machine and so influence should be confined to a known quantity (such as serving a web page), there are no guarantees that there are no exploitable vulnerabilities in the application you are allowing to be accessed by external parties. If a vulnerability exists and is exploited, the worst case is that someone else has control of your machine. If they have control of your machine, then they can use it as a jumping point to probe other machines in your network for vulnerabilities. This is why in corporate environments, efforts are made to ensure that any machine that will be directly accessed from the internet is segregated from the rest of the network via firewalls. This can help limit the ability of an attacker to get further into the network. So this is the risk you must accept, and help better define the risk, you would need to examine the history of the application being exposed - how frequently critical vulnerabilities are uncovered, and how quickly they are addressed. Mitigation strategies you can employ are about reducing your exposure. This can be done by only port-forwarding when you want to use the service, or closing the application when not needed.
1
When port-forwarding, you are permitting access from machines you don't trust to one that you do trust .
how can I create data table component by Polymer
How can I make a data table component by using polymer, This data table component have feature like datatables.net , ng-grid, ng-table does. Thanks
The best I have found is sortable-table by stevenrskelton github: https://github.com/stevenrskelton/sortable-table also on http://component.kitchen/components
1
Sortable-table by stevenrskelton github
Understanding a \@for loop
I'm having trouble with a \@for loop. I've got a macro that takes a comma delimited list and puts each element into a row of an array. When I do this using a \@for loop, I get an extra row that I don't understand. I can manually get rid of it with a negative space, (as in the commented line below) but that can't be the right way to do it, so I must be doing something wrong. Here's a minimal example. For comparison, if I construct what I expect the result of the loop to be manually, the extra row doesn't appear. \documentclass{article} \usepackage{amsmath} \makeatletter \newcommand{\fbun}[1] {\ensuremath{\left[\begin{array}{c} \@for\xx:=#1\do {\text{\xx}\\} % \\ [-2.75ex] % why is this required? \end{array}\right]}} \makeatother \begin{document} $\left[\begin{array}{c} A\\ B\\ C\\ D\\ \end{array}\right]$ % same array, but generated by a macro \fbun{A,B,C,D} \end{document}
The problem is that TeX finds something following the last \\ which starts a new row (it's neither \noalign nor \crcr that wouldn't). A solution might be to use a token register: we develop the loop while in the first cell, so there's no problem of \xx not being defined any more after TeX has seen \\ (or &amp;). \usepackage{amsmath} \makeatletter \newcommand{\fbun}[1]{% \begin{bmatrix} \toks@={\@gobble}% \@for\next:=#1\do {\toks@=\@xp{\the\@xp\toks@\@xp\\\@xp\text\@xp{\next}}}% \the\toks@ \end{bmatrix}} \makeatother I've used \@xp (from amsmath) that's a shorthand for \expandafter; if the \text around the entry wasn't required, then \toks@=\expandafter{\the\expandafter\toks@\next} would have sufficed. Initializing \toks@ to \@gobble has the effect that the first \\ is swallowed. Instead of array I've used bmatrix (change it if you like) and, of course, I deleted \ensuremath as the first step. :)
1
The problem is that TeX finds something following the last which starts a new row .
local AJAX-call to remote site works in Safari but not in other browsers
I am maintaining a website that uses Javascript. The script uses jQuery and loads some content from the server at which the site is normally hosted. Just for convenience while maintaining the site, I run a local copy of the site on my iMac. This works perfectly fine when I use Safari. But Firefox, Opera and Chrome refuse to work. I guess it is because of cross-domain-policy. (I couldn't test this with IE, because IE has to run in a virtual machine on my iMac, so for this reason it is not possible to access any local files) Is there a setting within Firefox and the other browsers where I can tell the browser that it is ok to ajax-load files that are located on a remote server from a local html-page with a local javascript? In a nutshell: This my html-page: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;some title&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="../css/stylesheet.css"&gt; &lt;script src="../js/jquery-2.1.3.min.js"&gt;&lt;/script&gt; &lt;script src="../js/myScript.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;!-- some content with a div-container to receive the ajax-content --&gt; &lt;/body&gt; &lt;/html&gt; This is myScript.js: var errorMsg = function (msg) { //insert the message into the html-page }; var JSONerror = function (jqXHR, textStatus, errorThrown ) { var msg = 'JSON-answer: '+jqXHR.responseText; msg += '&lt;br&gt;'+'JSON-Errorstatus: '+textStatus; if ($.type(errorThrown) === 'string') { msg += '&lt;br&gt;'+'Error: '+errorThrown; } errorMsg(msg); }; var JSONreceive = function (JSONobj, StatusString, jqXHR) { //insert the data in JSONobj into the html-page } var StartAJAX = function () { $.ajax({ url: 'http://my.domain.tld/cgi-bin/myPerlScript.pl', data: "lastID=" + lastID + '&amp;qkz=' + Math.random(), dataType: "json", success: JSONreceive, error: JSONerror }); }; There is also an event-listener, that listens for page-scroll and resize and checks some other constraints (like: is there already an ajax-call in progress?). This listener calls StartAJAX. When it calls StartAJAX on a local copy of my page (file:///User/...) within Safari, I get the Ajax-content perfectly fine inserted into my html-document. within the other browsers i get the error-message inserted into the html-page. It is: JSON-Answer: undefined JSON-Errorstatus: error Error: Why does it work in Safari but not in Firefox, Chrome and Opera? How can I make those browsers work? (I need to test it with all browsers, because all browsers render the same html-domument differently, but I don't want to upload all files to the server after every change just to test it.) EDIT: After reading some answers, I want to make something clear, that I obviously did not make clear enough: I am searching for settings in Webbrowsers I will NOT change the settings of my remote webserver (Apache) I will NOT manipulate any files on my remote machine (.htaccess) I will NOT set up a webserver on my local iMac I will NOT change the code of the AJAX-calls in my Javascript-files I will NOT change the code of the Perl-Scripts on my remote Server I can tell you why: I am just doing a short maintainance, and i am too lazy to upload every manipulated file to the remote machine after I edited it. The settings of the webserver are fine for actual operation. I don't want to change them (and maybe forget the changes before finishing my work). Same for the scripts: Those parts that some of you want to change work fine as they are now. There is no reason to touch the Ajax-Calls, because there is nothing wrong with them in the productive environment. All I want is that those stupid browsers Firefox, Opera and Chrome behave like Safari and process the Ajax-calls correctly. BTW: Please can anyone explain what is so risky to call data via Ajax from an other domain in Firefox, Opera or Chrome while it seems to be harmless doing the same thing in Safari?
Assuming the web site is domain A, and the perl script is on Domain B, you have two options: 1) Enable CORS on the web server at Domain B. http://enable-cors.org/ 2) Create a script (php, perl, ashx, etc) on Domain A that calls the script on Domain B. The script on Domain A will act as a proxy and will be allowed by all web browsers.
1
Enable CORS on Domain B
How do you grapple in Dead Rising 3?
I just started playing Dead Rising 3 on the Xbox One. I got to the first grapple, and I can't figure out what I'm supposed to do. The top of the screen says "Perform a gesture to escape a grapple" - what does "gesture" mean in this context? Is it something to do with Kinect?
You can also switch gesture based grapple escapes off in the Kinect settings of Dead Rising 3 (along with all the rest of the Kinect features) so that you have to do QTE type button presses instead.
1
Shift gesture based grapple escapes off in Kinect settings
Real time PCR normalization algorithm
When performing normalization of real time PCR results, I found two ways of doing it: In my lab they follow the next layout: $\text{Efficiency}^{-(CT\ _{\large\text{interest gene}} - CT _{\large\text{ housekeeping}})}$ each time controls with controls and treatments with treatments. Then they divide the all values (treated and controls) each with controls. On the other hand I found another way to normalize that follows this steps: $\text{Efficiency}^{(CT_{\large\text{control}} - CT_{\large\text{treated}})}$. Then you make the same for the normalizing gene and divide the first by the last. The values obtained are similar but not exact. Also I noticed that first algorithm gives rather different values for most diluted when performing a standard curve. Which is correct?
First step is the calculation of efficiency, denoted by lets say $E_{gene}$. See this post for calculation of primer efficiency. So the fold change for that gene will be calculated by $E_{gene}^{-\Delta Ct_{gene}}$ Where: $\Delta Ct = Ct^{treated} -Ct^{control}$ But these Ct values are not normalized. For normalization, you take some reference gene which need not be a housekeeping gene. Reference gene should chosen such that it is not affected by the treatment. In some cases usual housekeeping genes can also get affected for e.g. in treatments affecting cell cycle or differentiation. In such cases you should use a spike-in (an artificial RNA bearing low resemblance with any known gene). You can either normalize the fold change (Case A) or find fold change of the normalized expression (Case B). Means the same mathematically. Case A: $E_{gene}^{-\Delta Ct_{gene}} / E_{ref}^{-\Delta Ct_{ref}}$ Case B: $\large\frac{[E_{gene}^{-Ct^{treated}_{gene}}]/[E_{ref}^{-Ct^{treated}_{ref}}]} {[E_{gene}^{-Ct^{control}_{gene}}]/[E_{ref}^{-Ct^{control}_{ref}}]}$ You can rearrange the numerator and denominator to get Case A from Case B. I'm not sure how you are ending up getting different values. Recheck once. It may be because of numerical approximation errors. Case A looks much neater; so it is best to calculate that way :)
1
Calculation of efficiency of primer efficiency
What are the benefits of owning a physical book?
I have seen this question about updates of the D&amp;D 4th Edition books, and it got me thinking. Since I got my Kindle I have not read a single paper novel; they have fewer drawbacks compared to digital copies than rpg rulebooks. Dead-tree types have some benefits like looking good on a bookshelf, but any ebook reader weighs less with 100 novels than the usual hard-cover book. If you want to look for the damage of Ares Alpha, even with a half-decent tablet it takes less than 2 seconds. Digital copies do not get worn, they never get unwanted earmarks, but you can bookmark them. Rulebooks do get updates, and unless you are willing to take a pen to your book, your hard copies will never contain them. The pdfs can be edited and resent to the buyers. Even better is the WotC approach with the DDI, you can look up any monster or item or (almost any) rule, in the most recent form, for 3 years at the cost of seven books. I think this is the way to go, even considering the horribly slow character builder. Although I must admit good illustration can help build the athmosphere. So what am I missing? Why are people buying rpg rulebooks in paper format? Why are books even published, I do not need to know if feats are supposed to be on the right page and skills on the left, I just want a list of them, filterable any way I want. Is this just a necessary part of earning money? I understand that pdfs are copied illegally, but the Compendium is not.
I own an ebook, and I find it more comfortable linear reading than in physical books. Also, it's very handy when looking for exact words. But I find flipping the pages looking for something that is not bookmarked or you don't know exactly where it is, (and you don't know what words look for) or doing diagonal reading on several pages much easier in physical books. One thing that it's not very important to me, but it is to a lot of people is the aesthetic and emotional factors. A good physical book is something pretty that you can have and manipulate on your hands and that looks well on your bookshelf. Also, in time you can be emotionally attached to your manuals (especially if you own only a handful), but is rarer to feel the same to a digital file. Still, it's probable that if you have a good and fast ebook reader, the advantages of digital formats are more than the disadvantages, but answering your question, these are the benefits of physical books that come to my mind.
0.888889
A good book is something pretty that you can have and manipulate on your hands and that looks well on your bookshelf
Is there a difference between "brainstorming" and "mindstorming"?
Some people use brainstorming, others use mindstorming. I could not find the difference between the two words.
Mindstorming doesn't appear in the most common dictionaries. Aside from the fact that mindstorming is uncommon to the point of invisibility, its meaning is fairly clear, especially in the context of brainstorming. But the difference is that it's never used, or as good as never used. Consequently, if you have a choice, use brainstorming.
1
Mindstorming doesn't appear in most common dictionaries
Perform Insert operation when two tables are related by foreign key?
I have creates two tables in sql server 2008 as shown in diagram I have added some data in product table insert into tblproduct values ("I PHONE"); insert into tblproduct values ("SAMSUNG"); insert into tblproduct values ("SONY"); ...etc Now my Question is how will I write sql statement for inserting data in tblOrder so that Pid will be automatically filled in tblOrder.
Well, to answer to your question sql data are manipulated by sql language. But sql server is just a way to saved structured data. So, when you are building an application, and you are listing products available to order, you know the ids of thoses products. And then you can do something like : INSERT INTO tblOrder(OName, Pid) VALUES ('name_choosen', [product_id_selected]) In your case, for sql training, you do : INSERT INTO tblOrder(OName, Pid) SELECT 'name_of_order', Pid FROM tblProduct WHERE PName='IPhone' Or INSERT INTO tblOrder(OName, Pid) SELECT 'name_of_order' , (SELECT Pid from tblProduct WHERE PName='IPhone') Or INSERT INTO tblOrder(OName, Pid) VALUES ('name_of_order' , (SELECT Pid from tblProduct WHERE PName='IPhone'))
1
sql server is just a way to save structured data
Create heatmap with PSTricks or TikZ
I have a huge amount of 2D-coordinates, associated with a value, e.g.: x | y | value 27.50 52.15 12.51 61.83 13.32 57.56 36.23 21.83 41.73 40.46 85.67 25.20 ... The data is not tabular and I Want the points between two data-points to be interpolated in some way (which way is not really clear, yet) I want to preset the data as heatmap like this: Is there any ready-to-use package for PSTricks or TikZ to do it?
There is tikzDevice for R which will generate TikZ code for a plot created in R. So, if you use R to create your heat map (say, using ggplot2's geom_density2d()), you also get the TikZ code with little effort. There is a learning curve, though. However, this kind of image should be included as a (perhaps high-resolution) raster image in your document, as the vector version might take a long time to render. So you can create a TikZ version of the plot, compile it to PDF and then convert to PNG at the required resolution/pixel density.
1
tikzDevice generates TikZ code for a plot created in R
How to disable the shape toggle hotkey in Windows Chinese Input method?
In any version of Windows I have used so far (Xp, Vista, 7, 8) and all versions of the MSPY IME (RTM versions and the 2010 version) There is this annoying bug that you cannot change or disable the hotkey for Chinese shape troggle (normal to double spaced chars). The default is Shift+Space, and cannot be changed from the language input settings pane in the control panel. Here are a couple screenshots to show the problem: After that press Change Key Sequence This dialog will appear: Disabling it, has no effect, i.e. Windows will ignore the setting. You will notice I already managed to change the sequence to Shift-None by using the registry, but Windows still uses Shift+Space for shape toggle, which is really annoying when you type Chinese faster (especially if you want to switch between English and Chinese). Now after you changed or deleted the key with the dialogue, the setting will not be persistent with hitting Apply. Changing the corresponding registry value and rebooting also doesn't help, as the following screenshot demonstrates: I hope anyone has experience with this problem.
Why can't you change the Shift+Space combination to some unlikely combination like Alt+F12 or whatever ? This is not the same as totally disabling it, but it will liberate at least the space-bar. As more experimentation, I believe that this key-combination is defined in the registry at : HKEY_CURRENT_USER\Control Panel\Input Method\Hot Keys\00000011. Export this registry-key to a .reg file and change the following items : Key Modifiers to "00 C0 00 00", meaning no "Control" or "Shift" or "Alt". Virtual Key to 0, meaning "None". If this does not work, maybe a more forceful action is required, such as totally deleting the 00000011 key. Unfortunately also, this thread claims that Windows will reset these keys as soon as they are changed, which you can verify on your computer, (The above is based on Simplified Chinese MSPY 3.0 IME Hot Key Registry Settings.) A reboot is required to be absolutely sure that any such change had an effect. Create also, as a safety measure, a system quite-point before modifying the registry. [EDIT] It seems like Windows will not suffer a change to the above registry keys, so any changes are immediately nullified. The only working solution is to use AutoHotkey to replace the Shift+Space combination to something else. One possibility is detailed here : "+Space::Space". The poster actually used "+Space:: WinActivate".
1
Why can't you change Shift+Space combination to Alt+F12?
Exit Google Chrome from terminal
Is there a way to cause google-chrome to quit, from the terminal, besides using killall google-chrome? I would like to be able to close it from a script without killing it.
This works for me: killall --quiet --signal 15 -- chrome Note that I'm using a rather verbose command to keep it readable in the code, of course you could also issue: killall -q -15 chrome
1
killall --quiet --signal 15 -- chrome
What is the limit on the number of INSERT statements you can paste into SSMS and run?
I am currently creating a stored procedure that populates a table with a list of insert statements so that my DBAs can export the contents of the table to a text file and then paste the statements into SSMS and run (it is to copy data from test environment to live enviroment - I am constricted by the fact the 2 environments cannot see each other, bcp is not configured on the environment My question is that the table I am going to export could have up to 2,000,000 insert statements. Is there a limit to what can be pasted in and run?
bcp is not configured on the environment BCP is an exe that comes with SQL Server. The default path is C:\Program Files\Microsoft SQL Server\100\Tools\Binn\bcp.exe You can refer to my BCP and BULK INSERT script here. I am going to export could have up to 2,000,000 insert statements. SSMS wont be able to support this. You have to use SQLCMD. Highly suggest you to use BCP or SSIS to do the task.
1
BCP is not configured on the environment
What is the difference between "Mongolian Grill" and "Hibachi"?
For years I have been frequenting Chinese restaurants that feature "Mongolian Grill" (or Mongolian BBQ depending on the location). Recently I tried a new place that had (what they called) "Hibachi", which looked very similar, and I originally mistook for 'the same'. When I inquired about the Mongolian grill I was informed that there is a difference. While the host went on about what those differences are I am afraid that the subtleties were "lost in translation". Can someone clarify for me what the differences are?
I know this is an old post but I'd like to add something that I was told by the owner of a Mongolian resturant. He told me the origin of what is now called Mongolian BBQ was the cooking methods of the Mongolian soldiers (read: Genghis Khan's army) who fought and traveled for long periods. They would communally gather food - meats, fish, vegatables, etc., and then individually cook their own meals in their helmets, over an open campfire. They carried oils and sauces along with them and they were considered prized possessions. I can easily imagine this to be true and that this tradition would evolve into a family practice in a home, in a larger "wok" device, and eventully into a resturant setting. Somewhere along the line, the wok was inverted to make the cooking of multiple meals possible.
1
Mongolian BBQ was the cooking method of the soldiers who fought and traveled .
How to expire cache part using rake task in rails3?
I am creating a application, rails3 with ruby 1.9.2. I have a left menu with some blog posts. This is displaying in every page in my application, so I am using cache concept in views. That blog posts update in database every day using rake task. In rake task database update everyday first hour, after update database I want to clear that cache part from rake task. Any one help how to write rake task for expiring cache.
use a cronjob for your rake tast: https://github.com/javan/whenever expire fragments with a sweeper: http://guides.rubyonrails.org/caching_with_rails.html#sweepers
0.833333
Use a cronjob for your rake tast
Which episodes of One Piece are filler?
I want to watch One Piece, but the anime has a lot of filler content not in the manga. I'd rather not watch the filler content and only watch the episodes which are directly related to the plot. To be clear, I'm defining a filler episode as one which is not based on any story in the manga or based on extra manga chapters which have nothing to do with the overarching story. Which episodes are filler? This question is taken from this question. I was curious about this myself after completing the One Piece manga, but to keep uniformity between similar questions, I took the same wording as Logan-M had used in his question about Bleach filler.
There seems to be alot less filler in One Piece than in Naruto or Bleach. That being said, there have been 12 filler arcs: Warship Island Arc (episodes 54-61) Post Alabasta Arc (131-135) Goat Island (136-138) Ruluka Island (139-143) G-8 (196-206) Ocean's Dream (220-224) Foxy Returns (225-228) Lovely Land (326-335) Spa Island (382-384) Little East Blue (426-429) Z's Ambition (575-578) Ceasar Retrieval (626-628) Episodes 50,99,102,213,280-283,291,292,303,317,318,336,406,407,492,499,506,542,590 are also listed as filler on the wiki. There are additional episodes that are part of main arc that spend time on (sometimes non-canon) details that aren't significant in the manga. As this is subject to opinion and doesn't take an entire episode, I don't have a simple list for this.
0.833333
There have been 12 filler arcs in One Piece
US Customs check External hard disk
Do US customs check external hard disk? I am worried because I am going to carry data like softwares, ebooks and other things which are illegal according to US laws.
US customs (technically either CBP or ICE) do have the authority to inspect your external hard drive and other electronic devices and there are a few criminal cases based on such searches. But they obviously cannot systematically inspect all devices or HD people carry through the border and would not be primarily looking for illegally downloaded music (if that's what you mean). Data obtained by the ACLU suggest that such searches remain exceedingly rare. Obviously, none of this positively guarantees that you won't get in trouble but thousands of people do the same everyday.
0.888889
CBP or ICE cannot systematically inspect your external hard drive and other electronic devices .
Does one need a master's in math before taking a PhD in math in Europe?
This question is a variation of my earlier questions. Okay so in the US, I guess one does not need a master's in math before pursuing a PhD in math since the US apparently usually assumes only a bachelor's. What about in Europe? Technically, my master's is in mathematical finance not mathematics. So I didn't have research experience in looking through (pure) math books or articles in order to try to prove something theoretical or anything like that except for a few problem sets. On an answer to one of my previous questions, user deviantfan commented that: "In many european countries, it´s not even allowed/possible to skip the master degree." Perhaps my question may be rephrased: Is the master's in X PhD requirement in Europe satisfied by a master's in Applied X rather than Pure X?
I will try to respond to the abstract question, with a perspective from Germany (that may or may not be valid for other European countries): Is the master's in X PhD requirement in Europe satisfied by a master's in Applied X rather than Pure X? The general answer to this is yes. As opposed to the subject chosen for the Bachelor and Master degree, which is usually supposed to be the same or closely related in Europe, as Bachelor and Master curricula are closely coupled here, a PhD is often completely disconnected from the former studies. Note that the Austrian website that Moritz linked to in the original version of his answer does not require a particular Master's degree, but a "relevant Master's degree". Without any further restrictions, this means that anything closely related to the subject (and the relationship between Applied X and Pure X might very well be sufficient) should do. At least, that would be the interpretation in Germany; it is possible Austrians interpret this differently. However, it is also very well possible that the suitability of the Master's major is determined based on the research projects at hand. In that case, it depends entirely on the decision of the respective department chair, and it would be worthwhile to contact departments you are interested in. As a concrete example, it is completely normal in Germany to see Masters of Physics, Linguistics, and Maths starting PhDs in Computer Science, not only Masters in Computer Science. EDIT: To clarify the last remark: None of them have to take any extra courses; rather, they are expected to bring their professional subject-specific knowledge from physics, linguistics, and maths, respectively, into their computer science research (while "informally" (i.e. without a class) catching up with the CS knowledge), just like Masters in CS are expected to use their professional CS-specific knowledge in their computer science research, while "informally" acquiring knowledge on (w.l.o.g.) physics, linguistics, and maths, as required for their respective research.
1
Is the master's in X PhD requirement in Europe satisfied by a Master's degree in Applied X?
How to use t() function with node_load in custom drupal module?
I am using a custom module for my site, and I am using node_load to get the field value of type "long text" field and field of value of type "text". Something like this $com_types = "".$ucom->node_title.""; How should I translate $ucom->node_title ? t() function does not translate variables. Thanks
Node translation should be done at the node level. the t() function is for labeling elements of the interface and theme things. You should look at multi-language node translation modules, this link is helpful You'd first want to use something like this: https://api.drupal.org/api/drupal/modules!translation!translation.module/function/translation_node_get_translations/7 It'll let you get the NIDs of the translated versions of the node you want, then you can use node_load() to get the translated version.
0.777778
t() function for labeling elements of interface
What do you call a customer's customer in a specification document, use case, or scenario?
My team and I develop software that our customers will use to interact with their customers. Additionally, we also eat our own dogfood and use the software ourselves to interact with our customers. Therefore, it can sometimes be difficult to explain use cases and scenarios, as our employees can be operators, our customers can be operators, and our customers' customers can be visitors. However, our customers can also be visitors interacting with our operator employees, our customers' customers can be visitors interacting with our customer or our employee. Here is a model where: A is an employee B is a customer C is our customers' customer X interacts with Y Operator --&gt; Visitor A --&gt; B A --&gt; C B --&gt; C Because sometimes our customers can play different roles, it's sometimes necessary to refer to the specific role, Operator or Visitor, instead of Employee and Customer. It's also a mouthful to say "customer's customer" all the time. I was wondering how other development shops handle these semantic details when writing their use cases and scenarios. Are there any one-word, generic terms that can apply to any product that involves a third-level actor? Other than using the specific roles, Operator and Visitor, what words could be used to identify a customer of a customer? The word would need to be short enough as to be adopted within an organization. If longer than a couple syllables, it's shortened form must still differentiate it from the other actors.
So the question becomes simpler when think of Roles as being relative entity a performs a role in relation to entity b. Your Customer consider's themselves to be a User and their Customer's are Customers to them. The only person who cares about your Customer as a Customer is you. You have two roles in the system as an Administrator and as a User. I saw the explanation that you have Employees who interact with the End Customers through your chat software (let's call this role Agent). For clarification, does the Agent represent himself as an employee of your User? I would argue that the role is still Agent, User, Customer. Referring to your User as a customer just confuses things. (As you can see). I've had it worse...I had to work on three levels of indirection. There was a Company entity which in some cases were direct Users of our application. They had Accounts that they sold various packages from our offerings to and they tracked Customers for those Accounts.
0.888889
Roles as being relative entity a performs a role in relation to entity b.
Monitor when the user enables/disables mobile data
I'm building an app, on which I want to capture when a user enables or disables mobile data usage on his device. I read about using android.net.conn.CONNECTIVITY_CHANGE to monitor such changes, but then I came across various posts and questions here that said that this wouldn't work, and the majority of the answers suggested to use reflection. These led me to believe that there is no specific event being fired when the user changes the state of mobile data that I can use. Is it possible that a custom event can be created to handle it? If not, what would you suggest the best practice is for monitoring the state of mobile data? Thanks in advance
Hey you can find what you looking for by downloading from here the sample app NetworkUsage.
0.888889
Download NetworkUsage sample app from here
What is the the Ehrenfest-Oppenheimer rule on the statistics of composite systems?
Ehrenfest 1931 gives an argument to the effect that the application of the spin-statistics theorem to composite systems is valid, but only as an approximation and under certain conditions. Unfortunately this article is behind a paywall. The abstract reads as follows: From Pauli's exclusion principle we derive the rule for the symmetry of the wave functions in the coordinates of the center of gravity of two similar stable clusters of electrons and protons, and justify the assumption that the clusters satisfy the Einstein-Bose or Fermi-Dirac statistics according to whether the number of particles in each cluster is even or odd. The rule is shown to become invalid only when the interaction between the clusters is large enough to disturb their internal motion. The quaintness of the abstract is enhanced by the mysterious failure to mention neutrons -- this being explained by the fact that the neutron was not discovered experimentally until the following year. Pretty amusing that the American Physical Society still owns the copyright on a paper this old, one of whose authors was probably paid through my grandparents' and great-grandparents' income taxes. Googling quickly turns up various loose verbal characterizations of this result, without proof. Can anyone supply an outline of how the argument works and possibly a more precise statement of what the result really is? Some sources seem to refer to this as the Wigner-Ehrenfest-Oppenheimer (WEO) result or Ehrenfest-Oppenheimer-Bethe (EOB) rule. Historically, Feynman seems to have used this result to show that Cooper pairs were bosonic. Although I've tagged this question as quantum field theory, and the spin-statistics theorem is relativistic, the 1931 date seems to indicate that this would have been a result in nonrelativistic quantum mechanics. This answer by akhmeteli sketches what seems to be a similar relativistic result from a book by Lipkin. In the limit of low-energy experiments, the EO rule says the usual spin-statistics connection applies, and this seems extremely plausible. If not, then it would be too good to be true: we would be able to probe the composite structure of a system to arbitrarily high energies without having to build particle accelerators. Bethe 1997 has the following argument: Consider now tightly bound composite objects like nuclei. It then makes sense to ask for the symmetry of the wavefunction of a system containing many identical objects of the same type, e.g., many He4 nuclei. This symmetry can be deduced by imagining that the interchange of two composites is carried out particle by particle. Each interchange of fermions changes the sign of the wavefunction. Hence the composite will be a fermion if and only if it contains an odd number of fermions[...] Note the qualifier "tightly bound," which implies a restriction to low-energy experiments. The abstract of Ehrenfest 1931 seems to say that this is a necessary assumption, but it is never used in Bethe and Jackiw's argument, and this suggests that their argument is an oversimplification. Fujita 2009 recaps the Bethe-Jackiw argument, but then says: We shall see later that these arguments are incomplete. We note that Feynman used these arguments to deduce that Cooper pairs [5] (pairons) are bosonic [6]. The symmetry of the many-particle wavefunction and the quantum statistics for elementary particles are one-to-one [1]. [...] But no one-to-one correspondence exists for composites since composites, by construction, have extra degrees of freedom. Wavefunctions and second-quantized operators are important auxiliary quantum variables, but they are not observables in Dirac's sense [1]. We must examine the observable occupation numbers for the study of the quantum statistics of composites. In the present chapter we shall show that EOB's rule applies to the Center-of-Mass (CM) motion of composites. Unfortunately I only have access to Fujita through a keyhole, so I can't see what the references are or any of the details that they promise in this beginning-of-chapter preview. Related: Huge confusion with Fermions and Bosons and how they relate to total spin of atom Bethe and Jackiw, Intermediate Quantum Mechanics P. Ehrenfest and J. R. Oppenheimer, "Note on the Statistics of Nuclei," Phys. Rev. 37 (1931) 333, http://link.aps.org/doi/10.1103/PhysRev.37.333 , DOI: 10.1103/PhysRev.37.333 Fujita, Ito, and Godoy, Quantum Theory of Conducting Matter: Superconductivity, 2009
An SE user was kind enough to send me a PDF of the paper, so I'll try to give a summary of my own understanding of it. The historical context is interesting. This was before the neutron was discovered experimentally, so they thought nuclei were made out of protons and electrons. What we would today describe as a nucleus with mass number $A$ and atomic number $Z$, they would describe as a system consisting of $m$ protons plus $n$ electrons bound inside the nucleus, where $m=A$ and $n=A-Z$. (These $n$ electrons are in addition to the $m$ electrons that are outside the nucleus.) This model gets the statistics of a nucleus wrong when $N$ is odd, and the discrepancy had shown up in the spectroscopy of rotational bands of symmetric diatomic molecules such as $\text{N}_2$. Regardless of whether you use the archaic model of the nucleus or a modern one, you're dealing with two species of fermions inside the nucleus. This leads to a lot of complications in the notation and equations, which I think is not really crucial to the content of what people would today describe as the Ehrenfest-Oppenheimer rule. I think all the interesting issues can be seen when there is only one species of fundamental fermion present, so that simplified version is what I'll outline here. The argument, if I'm understanding it properly, seems to be as follows. You have two identical composite systems, which if not interacting would be described by internal quantum numbers $\sigma$ and $\tau$ and quantum numbers $s$ and $t$ describing their center-of-mass motions. Under interchange of the members of the two clusters, the wavefunction $|F\rangle=|st,\sigma\tau\rangle$ representing them has to pick up a phase $\theta=(-1)^k$. We can make such a wavefunction out of a Slater determinant. We then fairly trivially obtain -- The Ehrenfest-Oppenheimer rule: If the internal states of the two clusters are the same, $\sigma=\tau$, then under interchange of the centers of mass $s$ and $t$, the total wavefunction picks up a phase $\theta$. If we now turn on an interaction between the two clusters, the E-O rule is no longer exact, and the meat of the paper is to show the conditions under which it is a sufficient approximation. The wavefunction F is no longer a stationary state. However, the set of such wavefunctions still represents a complete basis, so we can write the actual physical state $|\phi\rangle$ as a superposition of the F's. This mixes the F's, and the mixing destroys the symmetry under interchange of $s$ and $t$. However, the mixing depends on matrix elements of the form $$ \langle st,\sigma\tau | H | s't',\sigma'\tau' \rangle $$ where $\sigma\ne\sigma'$, $\tau\ne\tau'$, i.e., the internal states are different. The resulting mixing is then small when the energy scale of the interaction between the two clusters is small compared to the energy differences $E_\sigma-E_{\sigma'}$ for $\sigma\ne\sigma'$. This is, for example, an excellent approximation for the nuclei in a diatomic molecule.
1
The Ehrenfest-Oppenheimer rule: a nucleus with mass number $A$ and atomic number $Z
Enclosure for whole house water filter
I plan to install a whole house water filter system. I will buy the cartridges separately and have a plumber hook it up. I don't want to trench from one end of the house to the other to put them on the garage wall, so I plan to just have it installed outside in the bushes where the water line comes in from the street. I will have 3 cylinder cartridges that are about 7" diameter and 24" tall. For reference, 3 of these: http://www.purewaterproducts.com/whole-house-filters-compact (Style C + Style B). One particulate filter + 2 carbon filters in parallel. Any ideas on enclosures I can use to protect them from the weather?
So if I understood you correctly then you want to dig in the ground, raise the water pipe to a filter, then back down into the ground? I have to say that doesn't seem like a good idea to me. If I were doing this I would just cut a pipe in the basement and put the filter there. In particular I would cut just the pipe going to the kitchen, and not the whole house. But if you really want too... For the enclosure use double layer (4 inches) extruded foam sheets including on the ground! Then cover them in some exterior-grade plywood on the outside to protect from damage. i.e. build a plywood box without beams/poles inside it (put them on the outside), then glue the foam sheets to the inside. Lay some plastic on the ground with small holes for the pipe, tape the plastic to the pipe, then foam sheets on top of that, and put the whole plywood box on top of it. You'll probably need a 3rd hole for some sort of support to hold the filters. I would suggest you wrap the pipe first in electrical heating tape (they sell it to protect pipes from freezing, it's what you want) then in waterproof (i.e. closed cell) foam rated for underground use several inches think and bury it. Taxes is rather large - if you happen to live in a place that doesn't get very cold then this might not be necessary. I checked and record low in taxes was -23F, but that's probably not where you live.
1
Do you want to dig in the ground, raise the water pipe to a filter, then back into the ground?
How can I debit money to Accounts Receivable in Gnucash without raising an invoice?
I have some income from Amazon Associates that is paid to me automatically every few months. I don't raise an invoice and Amazon doesn't create one for me. Amazon does specify a date when the payment amount is calculated and then a week or so later, the payment arrives in my current account. It looks like Gnucash expects me to raise an invoice and assign it to a customer before it can be entered in to Accounts Receivable. The Gnucash documentation says that users should never create entries directly in to Accounts Receivable. Even if I try this, there's no option to select a customer (eg, from a drop-down list), but only to type a customer name, which makes me wonder if the transaction actually gets tied to a customer in the Gnucash system. So how can I debit non-invoiceable amounts due to Accounts Receivable? Is this possible, or should I be handling this transaction another way?
You should be handling it in another way. You cannot, strictly speaking, have AR entry if you didn't issue an invoice. You should record it as a current income. Unless you're on accrual basis (in which case you could either create a "dummy" invoice or not accrue this income), AR has no real meaning to you. AR means that you billed someone and you have the right to the money. With Amazon affiliate program you do not have the right to the money until they decide you do, and once they do decide that - they just pay you.
1
You can't have AR entry if you didn't issue an invoice
Why do read links turn purple?
Today I saw a post on Facebook that had this pun: Clicked links turn purple because blue + "read" equals purple Is there any specific reason why a link is blue and when it is clicked/read, it turns to purple? Do these colors have any meaning?
It all depends on the CSS for the page. It may not always be purple. The CSS :visited selector is what controls it: http://www.w3schools.com/cssref/sel_visited.asp example: &lt;style&gt; a:visited {color:#00FF00;} /* visited link */ &lt;/style&gt;
1
CSS :visited selector
Why would you use the __LINE__ macro in C++
I am trying to figure out how people use the __LINE__ macro at work. How do you guys use it?
Most of the answers so far have involved some sort of debugging code. Another use of __LINE__ (and possibly __FILE__) is to enable a macro to generate a unique identifier each time it's called. This implementation of coroutines in C uses these macros to generate labels for a case statement, so it can jump to the last line you called yield from.
1
__LINE__ (and possibly_FILE__)
COD Black Ops: Can opponents voice chat in free for all?
In a free for all match, can I voice chat with my opponents? One of my friends started playing Black Ops (it's her first FPS game ever) and to teach her how to play I created a private free for all match so we would be the only two players on the map. I tried voice chat with her and everything was set up correctly (we could see the speaker icon above our heads blink when either of us spoke in the map). Only thing is I could not hear her at all (the volume was up high). I know in TDM you can't listen to the enemy chatter due to strategy and stuff but I would guess you could listen to enemies in free for all (for trash talking). Anyway, to repeat, is it possible to listen to enemy voice chat in FFA?
It should work just fine. I once played 1v1 against a friend on Nuketown. It was a free for all or team deathmatch, I don't remember, but we could hear each other very clearly.
1
1v1 game against a friend
Would a monk with the tavern brawler feat have improvised weapons count as monk weapons?
Would a monk with the tavern brawler feat have improvised weapons count as monk weapons? It states in the monk martial arts feature that: At 1st level, your practice of martial arts gives you mastery of combat styles that use unarmed strikes and monk weapons, which are short swords and any simple melee weapons that don’t have the two-handed or heavy property. Now for the Tavern Brawler feat it states that: You are proficient with improvised weapons and unarmed strikes. And the rules for improvised weapons are: In many cases, an improvised weapon is similar to an actual weapon and can be treated as such. For example, a table leg is akin to a club. At the DM’s option, a character proficient with a weapon can use a similar object as if it were that weapon and use his or her proficiency bonus. An object that bears no resemblance to a weapon deals 1d4 damage. If the improvised weapon does not resemble a weapon, is simple, and is not heavy or two-handed, could a monk replace the d4 dice? For example if the monk is level 6 and has a unarmed attack of a d6, with a d6 dice instead?
In many cases, an improvised weapon is similar to an actual weapon and can be treated as such. For example, a table leg is akin to a club. At the DM’s option, a character proficient with a weapon can use a similar object as if it were that weapon ... This is the crux of the matter, If the weapon can be treated as a qualifying simple weapon, then the DM may allow it. Else you only escape the non-proficiency penalty. At the end of the day everybody is playing by "House Rules"
0.777778
improvised weapon can be treated as a simple weapon
A Question about Matrix Elementary Row Operation = Scalar multiplication to a row
The task is that I have to determine whether this statement is true, to prove my guess by an example, and to explain why: Given a matrix A, then: To multiply a row in matrix A by a scalar k is the same as dividing some row by a nonzero scalar. I guess the statement is correct. And I think it's because instead of multiply a row by a scalar k, I could just divide that row by 1/k ... But somehow I think my thought is too "good". I think if they go thru the trouble of asking me to explain, then there maybe something more to it. I guess the words "some row" somewhat confuse me. Also, I'm assuming that by how they ask the question, I'm not allowed to switch or to add any 2 rows. So I can't use the idea of pivoting ... So would someone please tell me if my thought is correct? Thank you very much ^_^
Yes, your thought is correct, as specified, because $\,k\neq 0$. As you say: multiplying a row by a non-zero scalar $k$ is precisely equivalent to dividing a row by the reciprocal of $k\neq 0,\;$ i.e., dividing the row by $\;\dfrac{1}{k}.$
0.888889
multiplying a row by a non-zero scalar $k$ is precisely equivalent to dividing by the reciprocal
Is it a problem with radiometric dating that carbon 14 is found in materials dated to millions of years old?
The preferred method of dating dinosaur fossils is with the radiometric dating method. And the result of this accepted method dates dinosaur fossils to around 68 million years old. However: Consider the C-14 decay rate. Its half-life ($t_{1/2}$) is only 5,730 years—that is, every 5,730 years, half of it decays away. The theoretical limit for C-14 dating is 100,000 years using AMS, but for practical purposes it is 45,000 to 55,000 years. If dinosaur bones are 65 million years old, there should not be one atom of C-14 left in them. Dinosaurs are not dated with Carbon-14, yet some researchers have claimed that there is still Carbon-14 in the bones. So what needs to be done about this inconsistency? Do these data indicate that a more accurate method needs to be derived? What solutions are available for increasing accuracy of the tests? Or do we need another dating method all together? Considering Contamination From the source linked above: Carbon-14 is considered to be a highly reliable dating technique. It's accuracy has been verified by using C-14 to date artifacts whose age is known historically. The fluctuation of the amount of C-14 in the atmosphere over time adds a small uncertainty, but contamination by "modern carbon" such as decayed organic matter from soils poses a greater possibility for error. Dr. Thomas Seiler, a physicist from Germany, gave the presentation in Singapore. He said that his team and the laboratories they employed took special care to avoid contamination. That included protecting the samples, avoiding cracked areas in the bones, and meticulous pre-cleaning of the samples with chemicals to remove possible contaminants. Knowing that small concentrations of collagen can attract contamination, they compared precision Accelerator Mass Spectrometry (AMS) tests of collagen and bioapatite (hard carbonate bone mineral) with conventional counting methods of large bone fragments from the same dinosaurs. "Comparing such different molecules as minerals and organics from the same bone region, we obtained concordant C-14 results which were well below the upper limits of C-14 dating. These, together with many other remarkable concordances between samples from different fossils, geographic regions and stratigraphic positions make random contamination as origin of the C-14 unlikely".
There is a lot of discussion about this issue on this internet, so I think this question may be worth addressing seriously. The main point of the debate seems to be the following: Over the past decades, several research groups of self-proclaimed creationist scientists have claimed discoveries of dinosaur bones that they have managed to date, using radiocarbon dating methods, at some age which is a lot below the 'usual' i.e. mainstream accepted date for the age of these bones (several dozens of million years old). The age that these groups claim to find is usually on the order of thousands or tens of thousands of years old. The research by Miller et al. The claims by these creationist research groups are quite spectacular; they deserve to be seriously looked into. Let us investigate the specific case referenced in the question: A research team from the CRSEF, or Creation Research, Science Education Foundation, led by Hugh Miller, has claimed to have dated dinosaur bones using radiocarbon methods, determining them to be no older than several dozens of thousands of years old. Let's look at their research methodology in detail (indicated by bullet points): As it turns out, Miller's research group obtained their sample in quite a remarkable way. In fact, the creationist posed as chemists in order to secure a number of fragments of fossilized dinosaur bone from a museum of natural history, misrepresenting their own research in the process of doing so. When the museum provided the bone fragments, they emphasized that they had been heavily contaminated with "shellac" and other chemical preservatives. Miller and his group accepted the samples and reassured the museum that such containments would not be problematic for the analysis at hand. They then sent it to a laboratory run by the University of Arizona, where radiocarbon dating could be carried out. To get the scientists to consider their sample, the researchers once again pretended to be interested in the dating for general chemical analysis purposes, misrepresenting their research. Let's quickly stop to consider the general issue of misrepresenting your own research. It is understandable that Miller et al. did this, since there would have been a slim chance (at best) of the museum curator providing them with any dinosaur bone fragments if he or she had known what the true intent of the supposed chemists was. In particular, it is implausible that it would have been considered worthwhile to try to use radiocarbon dating methods on these bones, since the rocks that they were taken from were determined to be 99+ million years old, as shown in this paper by Kowallis et al. Now, it is known that $^{14}\text{C}$ decays at a fast enough rate (half-life ~6000 years) for this dating method to be absolutely useless on such samples. Thus, it appears that Miller et al. would not have been able to obtain this sample, had they been honest about their intent. This, of course, raises some ethical questions, but let's brush these aside for now. We proceed with the examination of the research done by Miller and his fellow researchers from the CRSEF. What exactly are we dating here? Sample contamination and general trustworthyness After the samples were submitted by the laboratory, Miller et al. were informed by a professor from the University of Arizona that the samples were heavily contaminated, and that no collagen (where most of the carbon for $^{14}\text{C}$ dating comes from) was present. Miller let assured the professor that the analysis was still of interest to the group. The issue of contaminations is quite a serious one, as can be seen in this paper by Hedges and Gowlett (sorry, paywalled!!!). I quote (quote also reproduced in the paper by Lepper that I linked earlier: At a horizon of 40,000 years the amount of carbon 14 in a bone or a piece of charcoal can be truly minute: such a specimen may contain only a few thousand 14C atoms. Consequently equally small quantities of modern carbon can severely skew the measurements. Contamination of this kind amounting to 1 percent of the carbon in a sample 25,000 years old would make it appear to be about 1,500 years younger than its actual age. Such contamination would, however, reduce the apparent age of a 60,000-year-old object by almost 50 percent. Clearly proper sample decontamination procedures are of particular importance in the dating of very old artifacts It is clear that the sample provided by Miller did not under go any 'sample decontamination procedures' at all, and it is therefore strongly questionable to which extent it can be used to obtain a good estimate of the age of the bones. Furthermore, it appears less than certain that the carbon found in the bones actually had anything to do with them being dinosaur bones. In the article by Leppert, we find: Hugh Miller generously provided me with a copy of the elemental analysis of one of their dinosaur fossils. Daniel Fisher of the University of Michigan’s Museum of Paleontology examined these results and concludes that there is nothing whatsoever extraordinary about them. The predominant suite of elements present and their relative percentages (including the 3.4% carbon!) are about what one would expect to find in hydroxyapatite and calcite, two of the commonest minerals present in ordinary dinosaur fossils. There is absolutely nothing unusual about these fossils and no reason to think the carbon contained in them is organic carbon derived from the original dinosaur bone. Robert Kalin senior research specialist at the University of Arizona’s radiocarbon dating laboratory, performed a standard independent analysis of the specimens submitted by Hugh Miller and concluded that the samples identified as “bones” did not contain any collagen. They were, in fact, not bone. These results corroborated established paleontological theories that assert that these fossiles presumably were 'washed away' over long periods of time by ground water, replacing the original bones with other substances such as the minerals naturally present in the water, implying that this sample could not tell you anything about when a dinosaur lived (or rather, died). Conclusions At this point, it is quite clear that there is little reason to trust the research by Miller's research group. In fact, the article by Leppert raises a number of additional issues (e.g. Miller's group refuses to reveal where some other samples of theirs were dated), but I think it is pointless to argue further: It is obvious that the CRSEF research group did a poor job in sticking to the scientific method, and that little objective value can be assigned to their supposed findings.
0.888889
What is the true intent of creationist scientists?
How to scale entire document including Maths symbols?
I'm trying to make a cheat-sheet for my Math class. I wonder is there a way to scale the entire document so that I can fit more formulas and theorems into it. It doesn't need to be super tiny though. I tried tiny font, but it still waste too much space. Have anyone done it before could share me some experiences? Thanks in advance.
The best way to create some space in your document is to use a combination of geometry (for setting/removing margin dimensions) and some standard documentclass font settings: \documentclass[10pt]{article}% default is 10pt font However, in terms of creating a cheat-sheet that should condense a number of pages on (say) a two-sided single piece of stock, I would suggest creating a document as per usual and then creating a second document that includes the pages of the first in "n-up" style, depending on your page count. Let me explain... Consider your original straight-forward document that has a bunch of content in it, including formulas and nifty how-to's: cheat-material.tex \documentclass{article} \usepackage[margin=1cm]{geometry}% http://ctan.org/pkg/geometry \usepackage{blindtext}% http://ctan.org/pkg/blindtext \usepackage[english]{babel}% http://ctan.org/pkg/babel \begin{document} \Blinddocument% Creates a 8-page document in the current style \end{document} The above is just a mock-up of your document using the blindtext package. It creates 8 pages of wholesome cheat-sheet material. Now I create my second document using the pdfpages package to insert output of cheat-material.tex in n-up style (I chose 4-up, since 8 is divisible by 4): cheat-sheet.tex \documentclass{article} \usepackage{pdfpages}% http://ctan.org/pkg/pdfpages \begin{document} \includepdf[nup=4,pages=-,frame]{cheat-material} \end{document} pages=- includes all pages of cheat-material.pdf, and frame adds a page border around each included page. This way you're not bound as much by trying to modify things - you're merely creating a document (cheat-material) and squeezing it as needed into a specific shape (cheat-sheet). This is especially helpful if you have multiple pages that you want to condense, as seems to be the case for you.
1
How to create some space in your document?
How do you create the vertical endless scrolling view in HTC WorldClock.apk, when setting the alarm?
In the WorldClock.apk of a HTC Sense Android phone, when a user wants to set the alarm, the user would see a black pop-up showing three vertical dials (value pickers, value selectors, etc). Those three vertical dials all can scroll up/down and cycle through the valid values. One is for hours, one is for minutes, and one is for AM or PM. There are no button, other than Done and Cancel. The vertical scrolling sliders is the one thing I'm looking for in the Android SDK Reference, and is the one I wanted to create. What are the vertical scrolling dials (number picker, sliding thing) called? What name? What class should I use to create it in Java? Is there anything else like it? Note, it is not for Windows Phone. It's an Android phone with the HTC Sense app, WorldClock.apk. Also note that I'm trying to obtain a picture of the Alarm Clock sliders on my HTC phone. But it's really hard when no one else has a digital camera for me to borrow.
I suppose what you want is a wheel like this: http://code.google.com/p/android-wheel/ I have use it in my project, really help.
1
What you want is a wheel like this?
Implement signature-level security on Android services with more than one allowed signature
I'm developing on an application at the moment which contains quite a lot of personal user information - things like Facebook contacts, etc ... Now, one of the things I want to be able to do (and have done, quite effectively) is open up parts of the application to "3rd Party" applications, using Android's build-in inter-process communication protocol (AIDL). So far so good. Here's the catch: because we're involved in handling quite a lot of personal information, we have to be quite careful about who can and can't access it; specifically, only "Trusted" applications should be able to do so. So the natural way to do this is to use a custom permission within the AndroidManifest.xml file where we declare the services. My problem is this: I want to be able to enact signature-level protection (similar to the normal "signature" permission level), but with a bit of a catch: I don't only want application signed with our internal signature to be able to access the services. I'd like to be able to build a list of "trusted signatures" &amp; at runtime (or if there's a better way, then maybe some other time?) be able to check incoming requests against this list of trusted keys. This would satisfy the security constraints in the same way as the normal "signature" permission level I think - only programs on the "trusted keys list" would be able to access the services, and keys are hard to spoof (if possible at all?) - but with the added bonus that we wouldn't have to sign every application making use of the APIs with our internal team's key. Is this possible at the moment in Android? And if so, are there any special requirements? Thanks
Great info jelford, but I would suggest instead of storing the entire string of the signature, to store/compare the SHA-1 of the certificate as shown in this answer from matreshkin. This is similar to how Google handles the Maps Android API, and this will match the output shown via keytool. private boolean checkAuthorized() throws SecurityException { PackageManager pm = getPackageManager(); try { PackageInfo packageInfo = pm.getPackageInfo(pm.getNameForUid(getCallingUid()), PackageManager.GET_SIGNATURES); Signature[] signatures = packageInfo.signatures; byte[] certBytes = signatures[0].toByteArray(); CertificateFactory cf = CertificateFactory.getInstance("X509"); X509Certificate cert = (X509Certificate)cf.generateCertificate( new ByteArrayInputStream(certBytes)); MessageDigest md = MessageDigest.getInstance("SHA1"); byte[] encodedCert = md.digest(cert.getEncoded()); String hexString = byte2HexFormatted(encodedCert); Log.d("public certificate SHA-1: " + hexString); String trustedAppName = trustedCerts.get(hexString); if (trustedAppName != null) { Log.d("Found public certificate SHA-1 for " + trustedAppName); return true; } } catch (Exception e) { Log.e(e, "Unable to get certificate from client"); } Log.w("Couldn't find signature in list of trusted certs!"); /* Crash the calling application if it doesn't catch */ throw new SecurityException(); } public static String byte2HexFormatted(byte[] arr) { StringBuilder str = new StringBuilder(arr.length * 2); for (int i = 0; i &lt; arr.length; i++) { String h = Integer.toHexString(arr[i]); int l = h.length(); if (l == 1) h = "0" + h; if (l &gt; 2) h = h.substring(l - 2, l); str.append(h.toUpperCase()); if (i &lt; (arr.length - 1)) str.append(':'); } return str.toString(); }
1
Storage of SHA-1 of a certificate
Set your journey to the wellness.. "set" used as "begin" , goes right here?
Using 'set' as 'begin' or closely similar way. The sentence "Set your journey to the wellness.." is ok? Set goes right here? From definition, I want to use "set" for this purpose.. cause (someone or something) to start doing something. "the incident set me thinking"
Which "wellness" is this? I suspect you might mean "Begin your journey to wellness", but can't be sure. Set does not have this meaning, but the idiom "set out on" is used specifically for journeys, so "Set out on your journey to wellness" works, though it focuses a bit more on the idea of a literal journey than a figurative one. I'd therefore advise against unless perhaps it was used with some visual imagery of journeys that would more strongly bring the imagery to mind. (Metaphors need to either be strong in the imagery or else quiet and let the figurative meaning dominate, "set out on" risks falling between the two).
0.555556
Which "set out on" is this?
Will a spellcaster interrupted mid-meditation or -study have any spells?
I've noticed that Wizards, Clerics, Druids, and most other spell-casting classes (With the exception of Sorcerers) spend at least 1 hour Studying or Meditating to regain their spells. What I want to know is that if I (As the GM) used an encounter to interrupt the preparation time of the party halfway through, will the party have any spells available to utilise? If they do, is there any RAW method to restrict which spells they will have? (Such as no spells requiring an attack roll, or spells that deal damage.) Is there anything I can do to force a Sorcerer or other spontaneous caster to contend with the same issue? Backstory: I want to introduce a recurring villain, who will be involved as a plot device for quite a while before eventually transforming into a BBEG. Said villain will have quite high DR-which will prevent melee characters from being able to kill him, but looking for a method to surprise the casters, forcing them to look for alternate methods to escape. (Particular villain has yet to be decided, but I don't think it would help the answer at all.) I'm not looking to kill the PCs, at all. Just want a way to scare them a bit, making them think about what they are actually doing. I have considered an anti-magic field already, but I think this would lead the party to kiting, rather then looking outside the box.
Officially, interrupting the 1-hour of meditation or study results in no spells prepared... Each of the classes you mention has no provision for partial preparation of spells. "Each cleric must choose a time when she must spend 1 hour each day in quiet contemplation or supplication to regain her daily allotment of spells." "A druid must spend 1 hour each day in a trance-like meditation on the mysteries of nature to regain her daily allotment of spells." "[A wizard] must choose and prepare his spells ahead of time by getting 8 hours of sleep and spending 1 hour studying his spellbook." Using a strict reading of the rules as they are written, that's exactly how long preparing all of the appropriate caster's spells takes, and stopping early means no prepared spells. Yes, the day after the massive battle that exhausted all his spells, even Count Slimeheart, Archmage of the Drooling Tower, if interrupted 1 min. before finishing his hour of study, will find himself with no spells prepared. But, as per Preparing Wizard Spells, a wizard [p]reparing some smaller portion of his daily capacity takes a proportionally smaller amount of time, but always at least 15 minutes, the minimum time required to achieve the proper mental state. Thus, a wizard can choose beforehand after resting to prepare a fraction of his spells, yet it's up to the DM if the wizard who planned to spend an hour preparing but actually spent less time preparing has prepared some of his spells or none at all. Likewise, as per Preparing Divine Spells, divine spell casters who prepare spells must meditate for at least 15 min. at their appointed or chosen time, but can also leave spell slots unfilled for filling later, taking 15 min. per quarter of spells. (A clever wizard or divine caster of prepared spells may start preparing 25% of his spells in 15-min. bursts instead of 1-hour long stretches, or the DM can just assume every experienced caster does this. I'm going to go out on a limb and say that this isn't the default method of spell preparation because the default method of 1 hour and get 'em all makes bookkeeping easier and arguments fewer.) ...And sorcerers need only 15 min. to concentrate... Although sorcerers lack many problems their more devout and studious compatriots possess... Unlike a wizard or a cleric, a sorcerer need not prepare her spells in advance. She can cast any spell she knows at any time, assuming she has not yet used up her spells per day for that spell level. ...the section Magic under Sorcerers and Bards says Each day, sorcerers and bards must focus their minds on the task of casting their spells. A sorcerer or bard needs 8 hours of rest (just like a wizard), after which she spends 15 minutes concentrating. (A bard must sing, recite, or play an instrument of some kind while concentrating.) During this period, the sorcerer or bard readies her mind to cast her daily allotment of spells. Without such a period to refresh herself, the character does not regain the spell slots she used up the day before. So there's a 15 min. window during which a sorcerer still hasn't regained yesterday's used spell slots upon awakening from 8 hours rest, but then the sorcerer's ready to go. (Of course, there's also the 50/50 chance he's 1 entire spell level below other full casters, but that's beside the point.) ...So the the GM could make a house rule that such concentration takes longer than 15 min. If made at the campaign's beginning, a house rule mandating that the sorcerer (and similar casters like the bard) must spend, instead, an hour concentrating upon awakening from 8 hours rest is reasonable. Although such characters often have hard enough lives, such characters are also usually full casters, so it's not as damaging a house rule as, for example, a house rule that somehow nerfs melee attacks. It's a burden, certainly, but it's not an excessive burden so far as house rules go. However, a GM who makes such a house rule mid-campaign then attacks the party of sorcerers 16 min. into their preparation time is really just asking his players to leave. An Aside: Please don't attack PCs while they're preparing spells. If you do, they'll try to do the same to the bad guys. You don't want to spend a whole afternoon making a wizard baddie only to have the baddie dead before his turn because the PCs interrupted him while he was studying, so don't do that to the PCs your players have been tinkering with for months either. If you're afraid of the PCs downing the big bad evil guy early, don't use him! Send instead paid assassins, bound or allied creatures, created minions, simulacra, projected images, or fanatics. Have the baddie mail threatening letters containing a magic mouth or explosive runes. While the PCs aren't around, have the villain explode their home towns, frame them for crimes, damage their reputations, hurt their moms, ruin their NPC friends, and eat their pets. Sending the BBEG into harm's way means the PCs should have a chance to end him. (And any method the GM uses to save the BBEG should eventually be accessible to the PCs!) If the only way to further the plot is a house rule that mandates sorcerers concentrate longer, it might be time to consider—sadly—a different plot.
1
How long does a wizard's spell preparation take?
What should my credit limit be?
I have two credit cards (through the same bank). The first I got at age 18, and the 2nd I applied for while in grad school for better rewards. I use credit cards (primarily the more recent one) for routine monthly expenses and I pay them off in full every month and reap the rewards. The limits were pretty low while I was in school, but every 6 months or so they would notify me that they were raising my credit limit by a modest amount. This continued for a while, but it stopped not long after I left school (which roughly coincided with banks becoming more reluctant to offer credit). My income has increased several hundred percent over what it was while I was in grad school, and I feel my credit limits do not reflect that. My combined credit limit between the two cards is a little over 12% of my yearly gross income. I feel this is probably low, and I might like to increase it both to increase my credit score and to easier allow for multiple large purchases (computer, furniture, etc.) in the same month without using an excessively high portion of my available credit. What guidelines should I use to determine how much of an increase, if any, to request?
They probably stopped raising your limit because of the credit crisis and new regulations. If you are planning a large purchase then call them and ask for a higher limit. Although with current rates you might be better off finding financing through the retailer or getting a new card with promotions. If you have a good credit score you shouldn't have a problem either way. I don't think raising a limit "just because" makes a lot of sense. Some say it effects your credit score in the long run, but chances are they'll pull your credit when you ask for a raise and that will just lower the score.
1
If you have a good credit score then ask for a higher limit
How to compile and install programs from source
This is an issue that really limits my enjoyment of Linux. If the application isn't on a repository or if it doesn't have an installer script, then I really struggle where and how to install an application from source. Comparatively to Windows, it's easy. You're (pretty much) required to use an installer application that does all of the work in a Wizard. With Linux... not so much. So, do you have any tips or instructions on this or are there any websites that explicitly explain how, why and where to install Linux programs from source?
I think it's just best to read the documentation coming with that specific program or application that you're wanting to install. Usually there are readmes/READMEs inside the tarballs (the application source archive which you can usually download) or maybe even INSTALL files to read and learn about what is the preferred way of installing said application. In short: RTFM ;)
0.833333
What is the preferred way of installing a specific application
Capture all queries that use hints
How can I capture or list all queries that use hints and have executed since the last instance restart? I am using SQL Server 2005 Standard Edition.
At my prodding @buckley already provided a query from which you can derive information. I'll add that you can capture snapshots of this DMV periodically so that you capture things even if they have been pushed out of the cache since their last use. I won't get into how to maintain an archive of DMV data here; maybe a good blog post in the making. Once you have the data (or just looking at the current plans that are cached), some common hints you can derive from the XML returned by sys.dm_exec_query_plan.query_plan: &lt;QueryPlan NonParallelPlanReason="MaxDOPSetToOne" ---- this query used OPTION (MAXDOP 1) ^^^^^^^^^^^^^^ ---- or perhaps was forced using server maxdop settings or resource governor &lt;IndexScan Ordered="0" ForcedIndex="0" ForceScan="1" NoExpandHint="0"&gt; ---- this query used WITH (FORCESCAN) ------------^ &lt;IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="1"&gt; ---- this query used WITH (NOEXPAND) ------------------------------^ &lt;IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="1" ...&gt; ---- this query used WITH (FORCESEEK) ------------------------------------^ &lt;IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="1" ForceSeek="1" ---- this query uses WITH (FORCESEEK(index(col))) ----------^-------------^ &lt;IndexScan Ordered="0" ForcedIndex="1" ForceScan="0" NoExpandHint="0"&gt; ---- this query used WITH (INDEX = ...) -^ I am NOT an XML guy so I have no clue how to tell you to extract that information dynamically. (More on this below.) I can't see any way to determine whether isolation has been set (at the batch level or using things like WITH (NOLOCK)) - you might have to: capture those in the act by polling sys.dm_exec_requests (though transaction_isolation_level really only tells you about things like SET TRANSACTION ISOLATION LEVEL, not table-level hints, since you can apply NOLOCK only to some tables in the query), or rely on parsing of the query text itself from sys.dm_exec_sql_text (noting that this can yield false positives if, say, NOLOCK is commented out, or you have a table name like dbo.SubmitNoLocks). I also can't see any difference in the plan for query hints like OPTION (FORCE ORDER) or OPTION (FAST n), so likewise these may also need to rely on parsing the query text as opposed to relying on the plan XML. EDIT Since you can get a non-XML version of the plan from an alternate DMF, sys.dm_exec_text_query_plan, you don't necessarily have to become an XML guru to perform this parsing. For example, the following will capture all query plans in the cache that used WITH (INDEX...), WITH FORCESEEK[(...)], WITH FORCESCAN, WITH (NOEXPAND) or WITH (NOLOCK): SELECT t.[text]--, qp.query_plan FROM sys.dm_exec_cached_plans AS p CROSS APPLY sys.dm_exec_sql_text(p.plan_handle) AS t CROSS APPLY sys.dm_exec_text_query_plan(p.plan_handle, 0, -1) AS qp WHERE t.[text] NOT LIKE '%dm_exec%' -- to keep this query out of result AND ( qp.query_plan LIKE '%ForceSeek="1"%' OR qp.query_plan LIKE '%Forcescan="1"%' OR qp.query_plan LIKE '%NoExpandHint="1"%' OR qp.query_plan LIKE '%ForcedIndex="1"%' OR t.[text] LIKE '%NOLOCK%' ) -- t.[dbid] = DB_ID() -- to limit results, but may be too exclusionary ; As identified earlier, this could produce false positives for queries like this: SELECT * FROM dbo.table /* WITH (NOLOCK) */ SELECT * FROM dbo.RenoLocksmiths; But outside of parsing the query text for NOLOCK, for all the plan attributes - since the XML gets entitized and characters like quotes get escaped - it will not return false positives for queries like this: SELECT * FROM dbo.table /* Forceseek="1" */ SELECT * FROM dbo.[WITH (FORCESEEK)];
0.888889
How to parse a query from a XML query?
Amplifier damage caused by failed power supply capacitors
MY QUESTION IS THIS: Would failed power supply caps cause peripheral damage to the amp, preamp or control circuits ? Supposedly there is "protection" for "DC offset, over current and over heat" I have a Proton AM-656 amplifier with "Dynamic Power on Demand" which is a second higher voltage supply rail (switched to when needed) that creates 6db of headroom and 2 ohm stable. I did not think there was fault protection, turns out the schematic block diagram states there is. One day with the amp power on I tightened/snugged up the speaker binding post. There was a single frayed speaker wire (unnoticed) that shorted. The amp proceed to billow smoke. I looked inside to find several power supply caps having oozed their electrolyte onto the circuit board. I am shopping to recap two of my other amps and was thinking of recapping the Proton, however I do not want to waste my time if there is likely to be damage to the circuits other than electrolytic capacitors.
If you are going to recap, I can assume you have the tools to check the entire circuit (DMM, etc). The only way to really know what went wrong is to start tracing through the circuit. You may need to get more parts than just the caps - if the transistors and other components were taken down at the same time, there could be quite a few more parts to buy. Test all components first, get parts when you know exactly what you need to replace. Otherwise, I'm with Brian D on this!
1
How to check the entire circuit?
Advice on using FORMAT_MODULE_PATH
From what I have read FORMAT_MODULE_PATH allows to use custom formats. How can I access the first value from DATETIME_INPUT_FORMATS in my application? The DATETIME_INPUT_FORMATS variable for german should be '%d.%m.%Y', whereas for english should be '%Y-%m-%d'. I want to use the values from the formats.py files depending on the language. I followed the Django documentation for how to use the FORMAT_MODULE_PATH variable, but I don't get the expected results. settings.py: USE_L10N = True USE_I18N = True FORMAT_MODULE_PATH = 'myproject.formats' myproject/ formats/ __init__.py en/ __init__.py formats.py de/ __init__.py formats.py I change the browser's language from English to German, and back and nothing happens with the date format. It is always '%Y-%m-%d'. The displayed date format is the value of settings.DATE_INPUT_FORMATS[0]. Django version is 1.2.5 and Python version is 2.5.4.
In Django 1.3, I have this working properly: in settings.py: USE_I18N = True USE_L10N = True TIME_ZONE = 'Europe/Amsterdam' LANGUAGE_CODE = 'nl_NL' FORMAT_MODULE_PATH = 'settings.locale' In settings/locale/nl/formats.py: DATETIME_FORMAT = 'j F Y \o\m H:i'
0.888889
In settings/locale/nl/formats.py: DATETIME_FORMAT
Using FORCE INDEX
I was in a presentation recently given by a Facebook MySQL engineer and he mentioned there that using FORCE INDEX reduces I/O. It was something to do with the MySQL Query Optimizer not needing to go to the data dictionary and make calculations. Can anyone explain how this works (preferably with references)? Is this a good optimization practice to follow in general?
One good source to refer to on FORCE INDEX would be the book MySQL Database Design and Tuning. On page 120 paragraph 4, it says: Where does FORCE INDEX fit in? FORCE INDEX (first enabled in version 4.0.9) is very similar to USE INDEX; the main difference between the two options is that FORCE INDEX demands that MySQL use the index (if possible) in lieu of a more expensive table scan, whereas USE INDEX still allows the optimizer to choose a table scan. The same page says that MySQL does not warn that an index is irrelevant and switches to a table scan in the case of USE INDEX. Thus, FORCE INDEX can take the MySQL Query Optimizer out of the equation before using the index. Any query using FORCE INDEX properly will reduce I/O. Why do I say properly? Think about it. If the index you choose to navigate through is a covering index and you only need the columns as listed in the covering index, contacting the table for data becomes unnecessary. All I/O is restricted to index pages. All the data requested is retrieved by performing index scans in the worst case. That is indeed a good thing if the requested data needs to be ordered, thus bypass any requested sorting. In terms of "rules of engagements", FORCE INDEX should only be used when referring to covering indexes all columns in the index are small in size you effectively tweek the caching behavior of SELECT queries For adhoc queries, use SQL_NO_CACHE For frequently updated data, cache judiciously FORCE INDEX should not be made to force queries to use indexes if you are trying to fit a square peg in a round hole. In other words, traversing an index only to access table data in a specific order buys you nothing. In fact, it throws query performance under the bus because of not exercising any foreknowledge about how available your data needs to be.
1
FORCE INDEX can take the MySQL Query Optimizer out of equation