summary
stringlengths
15
147
text
stringlengths
1
19.3k
answer
stringlengths
32
22.6k
labels
float64
0.33
1
answer_summary
stringlengths
5
164
Quartz cron expression of 0/0
As a part of a input validation I was thinking whether this is a really valid cron expression and how it would executed: 0 0/0 * * * ? Quartz validation returns true org.quartz.CronExpression.isValidExpression("0 0/0 * * * ?") So, does this run all the time, never, every hour or every minute...?
More information at CronTrigger documentation. My guess is that the expression 0 0/0 * * * ? means once every hour (i.e. 0/0 does not denote every minute). However, if you need all the time (i.e. every second), you can use * * * * ? *.
0.333333
0 0/0 * * *
How can I find out which server OS a particular site is running?
Is there a way to check which server OS a particular site is running. For example from linux command line. Maybe via telnet? But all I can get from "telnet www.google.com http" is: Trying 209.85.173.104... Connected to www.l.google.com. Escape character is '^]'. Can somebody dwell on the subject if possible at all?
Many sites will tell you in the HTTP headers: $ curl -s -I hotmail.com | grep Server Server: Microsoft-IIS/7.5 $ curl -s -I pinterest.com | grep Server Server: nginx/0.8.54 Some include the OS and sometimes version: $ curl -s -I linuxquestions.com | grep Server Server: Apache/2.2.9 (Unix) $ curl -s -I red.com | grep Server Server: Apache/2.2.3 (Red Hat) $ curl -s -I slashdot.org | grep Server Server: Apache/2.2.3 (CentOS) $ curl -s -I bar.com | grep Server Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.8 Some write their own web serving software: $ curl -s -I google.com | grep Server Server: gws $ curl -s -I yahoo.com | grep Server Server: YTS/1.20.10 But some don't send the Server header: $ curl -s -I serverfault.com HTTP/1.1 200 OK Cache-Control: public, max-age=41 Content-Length: 129706 Content-Type: text/html; charset=utf-8 Expires: Tue, 27 Mar 2012 13:01:46 GMT Last-Modified: Tue, 27 Mar 2012 13:00:46 GMT Vary: * Date: Tue, 27 Mar 2012 13:01:04 GMT $ curl -s -I www.facebook.com HTTP/1.1 302 Found Location: http://www.facebook.com/common/browser.php P3P: CP="Facebook does not have a P3P policy. Learn why here: http://fb.me/p3p" Set-Cookie: datr=sbpxT_PpXR9FO5mMTy8pCTjD; expires=Thu, 27-Mar-2014 13:03:45 GMT; path=/; domain=.facebook.com; httponly Content-Type: text/html; charset=utf-8 X-FB-Debug: VJycxKwQ9bAV0Z/n6jfN1WSFx4pqj2337c1jc+pPlE0= X-Cnection: close Content-Length: 0 Date: Tue, 27 Mar 2012 13:03:45 GMT Any or all of these could be lying. Bart's suggestion of nmap is more likely to be accurate but cannot produce 100% accurate results for the reasons he mentioned. It doesn't even make sense sometimes, for instance with the number of servers that are involved in fulfilling a single HTTP request at Google, their web servers, search servers, database servers, caching servers and whatever else they run could all potentially be using different operating systems and you would have no way of knowing.
1
HTTP headers - HTTP
Logging layers openings?
i would like to log every layers openings in PyQGIS, regardless of the opened project. Is there a way to achieve that ? Where should be the Python code be located in that case ? Thanks for your help !
What you need is to create (if it doesn't exist yet) a startup.py file in the QGIS python folder: On GNU/Linux: /home/YOUR_USER/.qgis2/python/ On Windows: (User folder)/.qgis2/python/ Not sure about it, please tell me if you find it to update the answer and write inside that file something like this: from qgis.core import QgsMapLayerRegistry def myLog(layers): f=open('/tmp/log.txt','a') # Change this path to your own file for lyr in layers: f.write('Layer added: %s, id: %s, source: %s' % (lyr.name(), lyr.id(), lyr.source())) f.close() QgsMapLayerRegistry.instance().layersAdded.connect(myLog) Every time you start QGIS, the code is executed, making myLog to listen to any layer opening, as well as to leave some data into /tmp/log.txt Note that the layer id already stores date/time data, but you could also use Python to write such data into the log.txt file. You would end up with this: ---- EDIT ---- Note: According to the docs, layersAdded is "[...] emitted for layers added to the registry, but not to the legend and canvas." In case that you want to make sure to only add to the log those layers loaded into legend/canvas, you probably would use the legendLayersAdded SIGNAL instead. Just replace the last line of the code snippet above by: QgsMapLayerRegistry.instance().legendLayersAdded.connect(myLog)
0.888889
Create a startup.py file in the QGIS python folder
What's the difference in meaning between "emigrate" and "immigrate"?
What's the difference between emigrate and immigrate? They seem to have the same definitions in the dictionary but they are antonyms...  
Emigration & immigration are almost equal to product movement internationally: Export: leaving this country and go to another country — emigration Import: Leaving another country & arriving in to this country — immigration
1
Emigration & immigration are almost equal to product movement internationally
Demonstrating the insecurity of an RSA signature encoding scheme
I'm working on problem 12.4 from Katz-Lindell. The problem is as follows: Given a public encoding function $\newcommand{\enc}{\operatorname{enc}}\enc$ and a textbook RSA signature scheme where signing occurs by finding $\enc(m)$ and raising it to the private key $d \bmod N$, how can we demonstrate the scheme's insecurity for $\enc(m) = 0||m||0^{L/10}$, where $L = |N|$ and $|m| = 9L/10 - 1$ and m is not the message of all zeroes?
An RSA signature scheme with public key $(n,e)$, private exponent $d$, and encoding function $enc$ (including but not limited to the question's $enc$), signs message $m$ as $$Sign(m) = enc(m)^d\bmod n$$ Such scheme is insecure if an adversary can figure out $k>0$ distinct messages $m_i$, and integers $u_i$, $r$, $s$ verifying $$s^e \cdot enc(m_0) \cdot \prod_{0\lt i\lt k} enc(m_i)^{u_i} \equiv r^e \pmod n$$ because this implies (by raising to the power $d$) $$ Sign(m_0) \equiv r \cdot s^{-1} \cdot\prod_{0\lt i\lt k}Sign(m_i)^{-u_i} \pmod n$$ which allows computing the signature of $m_0$ (if $k\gt 1$, it is also necessary that the attacker obtain the signatures of the other messages $m_i$; that becomes an existential forgery, or chosen-message attack). Although dated, Jean-Francois Misarsky's How (Not) to Design RSA Signature Schemes is an interesting and relatively easy reading on that topic. In fact, every known attack on an RSA signature scheme is either of the above kind (with more or less involved computations to exhibit $m_i$, $u_i$, $r$, $s$); or amounts to factorization of $n$ (which includes anything recovering $d$, perhaps by side-channel attack); or is some implementation error, perhaps widespread. In order to mount an attack of the above kind, a relation of the form $enc(m_0)=r^e$ is ideal. It gives the signature of $m_0$ without any consideration on $n$ or known signature. When $e$ is 3, 5 or 7, this can be done with the encoding $enc$ in the question, by considering $r=2^t$ for some appropriate $t$, and extended to $r=v\cdot2^t$ for some small $v$. Similarly, $enc(m_0) = r^e\cdot enc(m_1)$ gives the signature of one message from the signature of the other, without any consideration on $n$. This can be done with the encoding $enc$ in the question, for a wider choice of $e$. Similarly, $enc(m_0) \cdot enc(m_1) = enc(m_2) \cdot enc(m_3)$ gives the signature of one message from the signature of the other three, for any public key $(n,e)$. With the encoding $enc$ in the question, there is ample choice (the equation simplifies to $m_0\cdot m_1=m_2\cdot m_3$, and all messages which left bit is 0 or which integer representation is composite are vulnerable). The ISO/IEC 9796:1991 signature encoding scheme (section 11.3.5 of the Handbook of Applied Cryptography), now withdrawn, turned out to be vulnerable to that, of course if the adversary can obtain the signature of three chosen messages, and is content with the signature of the fourth. Even the hash-based ISO/IEC 9796-2:1997 (now known as ISO/IEC 9796-2:2010 scheme 1), still in wide use, is vulnerable if the adversary can obtain the signature of many weird chosen messages and is content with the signature of another, which fortunately is seldom the case in practice. Some require $e>2^{16}$ (FIPS 186-3 appendix B3.1, RGS Annex B1 section 2.2.1.1, and I have seen suggestions for much wider random $e$), because some attacks on weak encoding schemes or implementations of RSA signature/encryption have been easiest for $e=3$ or other small $e$, as is the case for the scheme in the question. I will not condone a course of action that will lead us to loose the main appeal of RSA (or Rabin) signature schemes: fast and simple verification with modest hardware.
0.888889
An RSA signature scheme with public key $(n,e)$, private exponent $d$, and encoding function $
How do people know what they can get out of trade up contracts?
I hear people say "I can get this or that out of these skins" but how do you know what you can get out of a skin?
The Concept The whole idea of trade-up's are pretty simple. It provides an alternative to simply opening cases or trading weapons with other players. In order to use the trade-up contracts, all you need is 10 weapons of the same grade. Weapon Grades The grades go in the following order: Consumer Grade > Industrial grade > Mil-spec > Restricted > Classified > Covert How it works? Essentially, if you were to use 10 weapons of the Restricted quality, you will get 1 weapon of the Classified quality. If you were to use 10 weapons of Classified quality, you will get a single Covert weapon. Etc. Here is an example: Scrolling over an item in your inventory reveals a list. Something like this: This is called a "Collection". Basically, if I were to trade up 10 M4A1-S| Atomic Alloys, I would have a 50-50 chance of getting either a AK-47| Vulcan or a M4A4| Desert-Strike. What about weapons of different collections? Simple. Having more weapons of different collections in the same contract means that there are more different variations of weapons if you get. If I were to throw in 5 M4A1-S| Atomic Alloys and another 5 M4A4| Dragon Kings: I have a chance of getting the following weapons: AK-47| Vulcan M4A4| Desert-Strike AWP| Man-o'-War Galil AR| Chatterbox To conclude, Basically all you need to remember is that when you place weapons of lets say Collection A into a contract, you will get 1 of any weapon that belongs in Collection A. Just that it will be 1 grade "Better". Extra: Knives, which have the grade Exceedingly Rare ★, CANNOT be used in contracts You can now use Stat-Trak weapons in Trade-ups I am not entirely sure, but I believe that "Wild-Card" skins, are essentially that one or two unwanted skins that have been placed in the contract just so as to fill it up. Since there is only 1 or 2 of them there is a low chance of their collection being picked, but still, it is possible. Hence they are "affectionately" referred to as "Wild-Card" skins.
0.888889
How to use trade-ups?
House rules to make the cloister less of a game winning tile in Carcassonne?
In my experience, cloister tiles in Carcassonne are often "too lucky". If you draw a cloister tile in the beginning of the game, it will typically still require an investment of quite a bit of "meeple" time to obtain the full 9 points, which makes it a fair trade-off. However, after about half of the game, it's relatively likely that you can "parachute" a cloister tile in some spot and get 8 or 9 points immediately. This adds a lot of randomness to the game. What house rules work well to diminish this effect?
I have never had this experience with Carcassonne either - typically in our games it's more likely that a late-game cloister will be wasted because the player doesn't have the meeples to spare for it. Even an 8-point late game cloister will be outpaced by a decent sized field, and it will tie up that meeple too. The other factor that can affect this is experience of the players - experienced folks are wary of creating an easy 9-point-parachute-cloister spot on the board and will avoid it if they can.
1
Carcassonne late game cloisters will be wasted because players don't have meeples to spare .
Recovering files downloaded from IE
A friend of mine has opened a Microsoft Publisher document from an e-mail (in gmail) in IE. They made changes to the file, repeatedly saved the changes, then closed Publisher. I've tried looking in Temporary Internet Files, but no joy. Where else might the file be? Is there anything I can do to get the file back? They're running Windows Vista Home Premium.
It should be somewhere in "C:\Documents and Settings\%%USER%%\Local Settings\Temporary Internet Files\Content.IE5" (on windows xp). On some other windows version you can always try opening another word document the same way through IE, then select "Save As" from the File menu and look where it is going to save that doc.
1
"C:Documents and Settings%%USER%%Local SettingsContent.IE5"
Offline WordPress post editor/creator
I have a WordPress site hosted on my personal server. I will be unavailable by Internet for a little while, and I'd like to write up some posts for my blog. Normally, you need to be connected to WordPress to start writing the blog, and it will do offline-saving automatically. But this is limited to one entry, per tab. I could use Notepad, but it doesn't have spell check built in. I could use Microsoft Word, but the "Paste from Word" leaves a lot to be desired. What I'm looking for is a program that does the following: Start a new post while offline Lets me edit posts I created already with the program Spell check Uploads new posts when I reconnect Has the same features as the online editor (i.e. toolbars, WYSIWYG and code editor) Free (as in beer) Works on either Windows or Mac OSX Bonus features: Edit posts currently on the website (with an offline copy)
For the mac users there's blogo. By the time of this writing, the version 1 has been discontinued and the version 2 hasn't yet been released, but there's a video on the official site showing its capabilities. Those include: WordPress, tumblr and blogger / blogspot support Offline composing Editing of already published posts Visual editor that uses the actual site theme to render the preview Possible drawbacks: Works only on mac Not free Looks like it doesn't offer spell-checking natively, but there will be a plugin system and it's possible that there'll be a speelcheck plugin for blogo: Power Ups are add-ons that will be available via in-app purchase to make your Blogo experience even better.
0.888889
WordPress, tumblr and blogger / blogspot support Blogo
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.
The biggest reason for difference in the two lenses is aperture. The 80-200mm is a constant f/2.8 throughout the focal range and the 18-200mm varies from f/3.5 to f/5.6, so substantially slower, especially at the far end. All this really means is that the 80-200 can let in more light at the same focal length over the other. Also, generally, zooms with constant apertures are higher grade lenses. I hesitate to make this statement a truism, but it pretty much is. Consumer grade lenses are often massive zoom ranges with variable aperture whereas more professional grade variants are smaller zoom ranges and constant apertures. The professional variants tend to be fast, sharper, and better built. There are exceptions, but this is generally the case regardless of brand. So, that is why you might make the choice of the 80-200mm lens. I made such a choice with a Pentax variant not so long ago... Edit To answer your other question, I would probably recommend the super zoom (18-200) for a newcomer if you want a single, general purpose, lens. I would expect the 80-200 to be optically superior, but also more expensive, and it would probably mean a second, equally expensive, lens to fill in the range. Worth it to some of us, but not for everyone.
0.888889
The biggest reason for difference in the two lenses is aperture
Inverse fourier transform of exponentially decaying function in the frequency domain
I want to take the inverse Fourier transform of the following function: $$ \hat{f}(\omega) = \begin{cases}e^{-r \sqrt{\omega}} & \text{for } \omega > 0 \\ 0 & \text{otherwise}\end{cases},$$ such that $$ f(t) = \int_{-\infty}^\infty \hat{f}(w)e^{i\omega t} d\omega= \int_0^\infty e^{-r \sqrt{\omega}} e^{i\omega t} d\omega,$$ where $r$ is a constant. I am having trouble in integrating this. That $ \sqrt{\omega}$ is ruining my day. Any suggestions? Kind regards
Substitute $\omega = u^2$ and consider the resulting expression as $$-2 \frac{\partial}{\partial r} \int_0^{\infty} du \, e^{-r u} \, e^{i t u^2}$$ The integral will end up being some sort of error function of complex argument; the derivative may invoke a more elementary expression, but likely not.
0.666667
Substitute $omega = u2$ and consider the resulting expression as $$-2 frac
Questions about geometric distribution
I have some trouble understanding the record value for a sequence of i.i.d. random variables of geometric distribution. Following quotation is from Univariate discrete distributions By Norman Lloyd Johnson, Adrienne W. Kemp, Samuel Kotz. The lack-of-memory property of the geometric distribution gives it a role comparable to that of the exponential distribution. There are a number of characterizations of the geometric distribution based on record values. For the record time $T_n$, If $X_j$ is observed at time $j$ , then the record time sequence $\{T_n ,n \geq 0\}$ is defined as $T_0 = 1$ with probability $1$ and $T_n = \min\{j : X_j > X_{t_{n−1}} \}$ for $n\geq 1$. Is there a typo in $T_n = \min \{j : X_j > X_{t_{n−1}} \}$? Should it be instead $T_n = \min\{j : X_j > X_{T_{n−1}} \}$? For the record value $R_n$, The record value sequence $\{R_n \}$ is defined as $R_n =X_{T_n} , n = 0, 1, 2, ...$. Suppose that the $X_j$ ’s are iid geometric variables with pmf $$p_x = p(1 − p)^{x−1}, x = 1, 2, ...$$ Then $R_n =X_{T_n} = \sum_{j=0}^{n} X_j$ is distributed as the sum of $n + 1$ iid geometric variables. why does the second equality in "$R_n =X_{T_n} = \sum_{j=0}^{n} X_j$ " hold? For the process of the record values $\{ R_n, n \in \mathbb{N}\}$, Each of the following properties characterizes the geometric distribution: (i) Independence: The rv’s $R_0 , R_1 - R_0 , ... , R_{n+1} - R_n ,...$ are independent. (ii) Same Distribution: $R_{n+1} - R_n$ has the same distribution as $R_0$ . (iii) Constant Regression: $E[R_{n+1}- R_n |R_n ]$ is constant. How to show that the three properties hold? Are they derived from the memoryless property of geometric distribution? What else can we say about the process based on the memoryless property of geometric distribution? Thanks for your advice!
Your second point looks wrong in the book. I think $$R_n = X_{T_n} = X_{T_0} + \sum_{i=1}^n \left(X_{T_i} - X_{T_{i-1}}\right)$$ or $$R_n = X_{T_n} = R_0 + \sum_{i=1}^n (R_i - R_{i-1})$$ might be better (and obvious). Since $T_0 = 1$, $R_0 = X_{T_0} = X_1$, identically distributed as each of the $X_j$. This is where the memorylessness of the geometric distribution applies, because it has the property that $R_n - R_{n-1} = X_{T_n} - X_{T_{n-1}}$ has the same distribution as $X_j$ because if $X_{T_{n-1}} = k$ then $$Pr(X_{T_n} - X_{T_{n-1}} = m) = Pr(X_{T_n} = m+k | X_{T_n} > k) = \frac{p(1 − p)^{m+k−1}}{\sum_{j \ge 1} p(1 − p)^{j+k−1} } = p(1 − p)^{m−1}$$ and is independent of k and of all the $X_j$ for $j < T_{n-1}$ and $j>T_n$ So $R_j - R_{j-1}$ has the same distribution as $X_j$ and combined with independence leads to $R_n$ having the same distribution as $\sum_{j=0}^n X_j$, i.e. as the sum of $n + 1$ iid geometric variables. as the book says. I think the book is wrong with its equals sign: two (sums of) random variables can have the same distribution without being the same. If $A$ is uniformly distributed on $[0,1]$ and $B = 1-A$, then $A$ and $B$ have the same distribution, but they are unlikely to be equal to each other.
0.888889
iid geometric variables are identically distributed as each of the $X_j$
Show tooltip on invalid input in edit control
I have subclassed edit control to accept only floating numbers. I would like to pop a tooltip when user makes an invalid input. The behavior I target is like the one edit control with ES_NUMBER has : So far I was able to implement tracking tooltip and display it when user makes invalid input. However, the tooltip is misplaced. I have tried to use ScreenToClient and ClientToScreen to fix this but have failed. Here are the instructions for creating SCCE : 1) Create default Win32 project in Visual Studio. 2) Add the following includes in your stdafx.h, just under #include <windows.h> : #include <windowsx.h> #include <commctrl.h> #pragma comment( lib, "comctl32.lib") #pragma comment(linker, \ "\"/manifestdependency:type='Win32' "\ "name='Microsoft.Windows.Common-Controls' "\ "version='6.0.0.0' "\ "processorArchitecture='*' "\ "publicKeyToken='6595b64144ccf1df' "\ "language='*'\"") 3) Add these global variables: HWND g_hwndTT; TOOLINFO g_ti; 4) Here is a simple subclass procedure for edit controls ( just for testing purposes ) : LRESULT CALLBACK EditSubProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData ) { switch (message) { case WM_CHAR: { POINT pt; if( ! isdigit( wParam ) ) // if not a number pop a tooltip! { if (GetCaretPos(&pt)) // here comes the problem { // coordinates are not good, so tooltip is misplaced ClientToScreen( hwnd, &pt ); /************************** EDIT #1 ****************************/ /******* If I delete this line x-coordinate is OK *************/ /*** y-coordinate should be little lower, but it is still OK **/ /**************************************************************/ ScreenToClient( GetParent(hwnd), &pt ); /************************* Edit #2 ****************************/ // this adjusts the y-coordinate, see the second edit RECT rcClientRect; Edit_GetRect( hwnd, &rcClientRect ); pt.y = rcClientRect.bottom; /**************************************************************/ SendMessage(g_hwndTT, TTM_TRACKACTIVATE, TRUE, (LPARAM)&g_ti); SendMessage(g_hwndTT, TTM_TRACKPOSITION, 0, MAKELPARAM(pt.x, pt.y)); } return FALSE; } else { SendMessage(g_hwndTT, TTM_TRACKACTIVATE, FALSE, (LPARAM)&g_ti); return ::DefSubclassProc( hwnd, message, wParam, lParam ); } } break; case WM_NCDESTROY: ::RemoveWindowSubclass( hwnd, EditSubProc, 0 ); return DefSubclassProc( hwnd, message, wParam, lParam); break; } return DefSubclassProc( hwnd, message, wParam, lParam); } 5) Add the following WM_CREATE handler : case WM_CREATE: { HWND hEdit = CreateWindowEx( 0, L"EDIT", L"edit", WS_CHILD | WS_VISIBLE | WS_BORDER | ES_CENTER, 150, 150, 100, 30, hWnd, (HMENU)1000, hInst, 0 ); // try with tooltip g_hwndTT = CreateWindow(TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_ALWAYSTIP | TTS_BALLOON, 0, 0, 0, 0, hWnd, NULL, hInst, NULL); if( !g_hwndTT ) MessageBeep(0); // just to signal error somehow g_ti.cbSize = sizeof(TOOLINFO); g_ti.uFlags = TTF_TRACK | TTF_ABSOLUTE; g_ti.hwnd = hWnd; g_ti.hinst = hInst; g_ti.lpszText = TEXT("Hi there"); if( ! SendMessage(g_hwndTT, TTM_ADDTOOL, 0, (LPARAM)&g_ti) ) MessageBeep(0); // just to have some error signal // subclass edit control SetWindowSubclass( hEdit, EditSubProc, 0, 0 ); } return 0L; 6) Initialize common controls in MyRegisterClass ( before return statement ) : // initialize common controls INITCOMMONCONTROLSEX iccex; iccex.dwSize = sizeof(INITCOMMONCONTROLSEX); iccex.dwICC = ICC_BAR_CLASSES | ICC_WIN95_CLASSES | ICC_TAB_CLASSES | ICC_TREEVIEW_CLASSES | ICC_STANDARD_CLASSES ; if( !InitCommonControlsEx(&iccex) ) MessageBeep(0); // signal error That's it, for the SSCCE. My questions are following : How can I properly position tooltip in my main window? How should I manipulate with caret coordinates? Is there a way for tooltip handle and toolinfo structure to not be global? Thank you for your time. Best regards. EDIT #1: I have managed to achieve quite an improvement by deleting ScreenToClient call in the subclass procedure. The x-coordinate is good, y-coordinate could be slightly lower. I still would like to remove global variables somehow... EDIT #2: I was able to adjust y-coordinate by using EM_GETRECT message and setting y-coordinate to the bottom of the formatting rectangle: RECT rcClientRect; Edit_GetRect( hwnd, &rcClientRect ); pt.y = rcClient.bottom; Now the end-result is much better. All that is left is to remove global variables... EDIT #3: It seems that I have cracked it! The solution is in EM_SHOWBALLOONTIP and EM_HIDEBALLOONTIP messages! Tooltip is placed at the caret position, ballon shape is the same as the one on the picture, and it auto-dismisses itself properly. And the best thing is that I do not need global variables! Here is my subclass procedure snippet: case WM_CHAR: { // whatever... This condition is for testing purpose only if( ! IsCharAlpha( wParam ) && IsCharAlphaNumeric( wParam ) ) { SendMessage(hwnd, EM_HIDEBALLOONTIP, 0, 0); return ::DefSubclassProc( hwnd, message, wParam, lParam ); } else { EDITBALLOONTIP ebt; ebt.cbStruct = sizeof( EDITBALLOONTIP ); ebt.pszText = L" Tooltip text! "; ebt.pszTitle = L" Tooltip title!!! "; ebt.ttiIcon = TTI_ERROR_LARGE; // tooltip icon SendMessage(hwnd, EM_SHOWBALLOONTIP, 0, (LPARAM)&ebt); return FALSE; } } break;
I'm giving the comment as an answer (I should have done that earlier) so that it's clear that the question has been answered: MSDN Docs for TTM_TRACKPOSITION says that the x/y values are "in screen coordinates". I'm not totally sure, but the y-coordinate probably corresponds to the top of the caret, you could add half of the edit box height if you want to position your tooltip in the middle of the edit box. EDIT re Global variables, you could bundle all your global variables into a structure, allocate memory for the structure and pass the pointer of the structure using the SetWindowLongPtr API call for the edit window using the GWLP_USERDATA, the window proc can then retrieve the values using GetWindowLongPtr...
0.777778
MSDN Docs for TTM_TRACKPOSITION says that the x/y values are in screen coordinates
Sort lines based on a variable-width number at a fixed position
I'm trying to sort a file using the Sort command but its not working: The file contains lines like: photo1 photo11 photo12 photo13 photo17 photo18 photo19 photo2 photo22 photo23 photo25 photo26 photo27 I'm using the command, sort -k6 Photos so that it start sorting after the string "photo", can someone tell where I'm going wrong??
Define the sort key with the start and stop character position of the key: sort -nk1.6,1.8 file See your friendly sort manpages.
0.888889
Sort key with start and stop character position
Homework with logarithms
I'm stuck on continuing the next exercise: Considering: $\log_{c}a = 3$ $\log_{c}b = 4$ and: $$ y = \frac{a^{3}\sqrt{b \cdot c^{2}}}{2} $$ What's the value of $\log_{c}y$ (integer)? So far, I did all the substitutions that were obvious at my eyes: $$ y = \frac{a^{3}\sqrt{b \cdot c^{2}}}{2}\quad\rightarrow\quad y = \frac{c^{9}\sqrt{c^{4} \cdot c^{2}}}{2}\quad\rightarrow\quad y = \frac{c^{9}\sqrt{c^{6}}}{2}\quad\rightarrow\quad y = \frac{c^{9} c^{3}}{2}\quad\rightarrow\quad y = \frac{c^{12}}{2} $$ The last equality is the same as $c^{12} = 2y$, which could be written as: $$ \log_{c}2y = 12\quad\rightarrow\quad \log_{c}2 + \log_{c}y = 12 $$ I really don't know haw to continue. I've managed to find a $\log_{c}y$, but I don't know what to do with the $\log_{c}2$. Either I took the wrong path, or I'm missing something that prevents me to finish this exercise. Any hints are much welcome! Thanks in advance.
Take $\log_c$ of both sides of the equation: $$ \log_c y=3\log_c a+\frac12\log_c b+1-\log_c 2.$$ And so, $$\log_c y=3(3)+\frac12(4)+1-\log_c 2=12-\log_c 2.$$
1
$log_c$ of both sides of the equation
Is there a way to fill your tires with nitrogen?
I know this is a rather controversial issue. I was skeptical as well before doing this on my car, and I have not refilled my car tires for several months. Before that I needed to adjust the pressure every couple of months at least. Now I think it is a good idea to try this for our bikes. Especially since, when I see I need to fill up my bike tires, I get too lazy and give up the ride altogether. Is there a way to do this at home? EDIT: I thought I'd update the question for people who come and read later: Thanks for all the comments, I drive a lot (30kmiles/year) and I saw (to my surprise) a significant difference with nitrogen. I understand the reasoning with losing oxygen over time and increasing the N2 concentration but in practice that does not happen fast enough. I think I'll look into Helium/Argon and I'll update you if I managed to do something interesting. And I live in a small place I don't like to have a large pump but that is exactly why pumping is such a chore for me,
I can inflate my car tires to proper pressure by checking them once a month or so and inflating them as needed using free air. It takes me maybe 5 minutes per month. I can inflate my bike tires to proper pressure by checking them once a week or so and inflating them as needed using free air. It takes me maybe 2 minutes per week. There is no strategy of using alternative gasses that can even remotely compete with that in terms of economy, time or convenience.
1
I can inflate my car tires to proper pressure using free air
Do you start writing GUI class first or reverse?
I want to write my first Java program, for example Phonebook, and I wonder what to do first. My question is should I write GUI classes first or util classes first? I am database developer and want to know best practice in building program.
In theory, there are at least five possible approaches. Top-Down: Start with UI mock-shots or a paper prototype. Turn them into real dialogs, and work your way from the button handlers and other controls down through the logic and to the database. Bottom-Up: Start with the data structures (probably the database schema). Then add logic (modelling real-world processes); finally, your UI is just an interface to trigger the logic and display the results. Logic first: Start with the program logic, implementing data access and a rudimentary UI as needed. Then formalize and harden the data structures, and finally flesh out the UI properly. Meet in the middle: Start with database schema and UI, and simultaneously work towards the point where they meet. With this approach, the logic comes last. Horizontal expansion: Start by identifying the absolute minimum amount of functionality that would do something interesting, and implement the whole stack (data structures, logic, and UI) for this part. It could be just a basic CRUD cycle with a simple edit dialog for just one entity. Then start adding more features, implementing the whole stack for each feature (hence 'horizontal'). Each of these has pros and cons. Top-down gives you something visible early in the process, and allows you to check your functional design with stakeholders - mock-shots often tell users more about a design than flowcharts or walls of text. Bottom-up gives you a chance to design a rock-solid database schema before you commit to anything; since a database schema is notoriously hard to modify once released, you want to get this part right - the impact of modifying a UI is much smaller and produces fewer and less severe bugs. Logic-first means you can test the logic before spending serious time on the database and the presentation, which is especially interesting if your logic is going to be really complex. Meet-in-the-middle combines the advantages of bottom-up and top-down, but you'll have to jump back and forth between two tasks, and you risk ending up with logic that is more complex than necessary because your two ends don't meet naturally. Horizontal expansion goes well with an iterative workflow, and it has the added advantage that, if you prioritize well, you will have a working application at any given time, so if you don't make a deadline, you will have a version that has fewer features, but is still fully functional, as opposed to a version that has a complete database, but no UI at all. So which one you choose depends on your personal style, and on the circumstances.
1
Start with UI mock-shots or a paper prototype
I'm new in developing responsive Wordpress Theme, so which framework to use or work from scratch?
I'm totally new in developing responsive Wordpress Theme sector. But fortunately, I've heard of Frameworks like: Underscore, child-themes, Genesis !! What speciality each Framework has? I'm much confused about that, are these frameworks suitable for designing latest WP versions or just legacy Wordpress versions? like WP 3.0 or WP 3.3, so need some experts opinions here. I'm actually confused about developing a responsive Wordpress Theme in a short period of time & also compounding that I don't have knowledge of which Wordpress Theme Development Framework goes for which Wordpress versions? so everyone, plz bear with my question & answer me positively... ;-)
The answer to which framework you should use is — no one knows. From code perspective there is certain degree of baseline theme functionality/experience — enforced by formal standards. Those things are recommended/required for inclusion into official theme directory, outside of that people can do things a little more lax. Frameworks exist for different reasons. Roughly I would say that the broad categories are: providing additional functionality helping with code reuse accommodating specific technologies There is no "best" or "right" framework because then we would only need one. Versions are pretty irrelevant. Frameworks tend to be made by intermediate to advanced developers/agencies. They are either decently maintained or discontinued altogether. In a nutshell you'll need to conduct your own research and evaluate frameworks, fitting your requirements, yourself. This is not something someone else can pick for you.
0.888889
Frameworks exist for different reasons
PHP DOMXPath gives empty string for /@ID
Simplified HTML <tr> <td class="orderOverviewAnotherColumn">0177-4066356</td> <a name="orderTableSorted:orderTable:10:j_id504" id="orderTableSorted:orderTable:10:j_id504" href="#"> </tr> <tr> <td class="orderOverviewAnotherColumn">0177-4066357</td> <a name="orderTableSorted:orderTable:11:j_id504" id="orderTableSorted:orderTable:11:j_id504" href="#"> </tr> <tr> <td class="orderOverviewAnotherColumn">0177-4066358</td> <a name="orderTableSorted:orderTable:12:j_id504" id="orderTableSorted:orderTable:12:j_id504" href="#"> </tr> <tr> <td class="orderOverviewAnotherColumn">0177-4066359</td> <a name="orderTableSorted:orderTable:13:j_id504" id="orderTableSorted:orderTable:13:j_id504" href="#"> </tr> Using the following Code in PHP libxml_use_internal_errors(true); $doc = new DOMDocument(); $doc->loadHTMLFile('448713409.html'); $xpath = new DOMXPath($doc); $vRes = $xpath->query(".//*[@id='orderTableSorted:orderTable:tbody_element']/tr[contains(.,'4066356')]//a[contains(@id,':j_id504')]/@ID"); foreach ($vRes as $obj) { $clean[] = $obj->nodeValue; } $clink = implode(" ",$clean); var_dump($clink); returns... string(0) "" Using Firebug Xpath Checker it returns the ID "orderTableSorted:orderTable:10:j_id504" which i need to find. Any Help in the right direction is much appreciated.
XPath is a case-sensitive language. Therefore, id and ID are entirely different things. In your HTML sample, the a elements have an attribute id, but none that is called ID. That's why the query does not yield any results. Lowercase ID at the very end of your path expression: //a[contains(@id,':j_id504')]/@id I doubt that Firebug returns an uppercase ID when in the actual HTML there is none.
0.777778
XPath is a case-sensitive language
Buck converter with op-amp, inductor issues when load changes
I'm looking at the designs for a simple buck converter which has the P mosfet, inductor, capacitor and reverse based diode. Instead of PWM, I'm trying out to use an op-amp to switch the P mosfet but one thing that I notice is that if the load changes from low resistance to high resistance then the inductor spikes the voltage on the load to double what it is until it can re-stablise. (This is all in simulation) Is this happening because I'm using the op-amp? How does using PWM affect the inductor in such a way that if the load would change from say 10 ohms to 100 ohms that the inductor won't spike the voltage? Perhaps PWM / fast switching keeps the inductor with such a low charge that when the load changes, the inductor doesn't have nearly enough voltage to do anything? Cheers.
An OpAmp will not be able to directly control the state of a MOSFET. The OpAmp will be too limited in output impedance, slew rate, and output voltage swing. You are going to want a device that can switch quickly while driving the gate capacitance of a FET. There are different ways to control the on and off time of the FET. PWM is the most used, but there is also constant on time and constant off time. Constant on time and constant off time can be used in a hysteretic regulation approach, using a comparator to sense the output voltage relative to a reference. Whatever control technique you try, you will need to bound the on or off time of the switch somehow to have any reasonable control of output voltage. As to the overshoot you see when the load changes: Did you put resistance in series with the inductor and capacitor in the simulation? Real parts have loss. If you have no loss in the buck inductor and filter capacitor, filter Q will be very high. High Q LC filters will ring to 2 times Vin on application of a step.
0.777778
OpAmp can not directly control the state of a MOSFET
Why is it not dangerous to dissolve NaCl?
$$\ce{H2O~(l) + NaCl~(s) ->[\Delta] Na+~(aq) + Cl^{-}~(aq)}$$ When table salt is placed in water, it dissolves due to the polarity of water molecules. When solvation takes place, negatively polar sides of water molecules attach to $\ce{Na+}$ ions, and positively polar sides of water molecules attach to $\ce{Cl-}$ ions. The ions are then carried away by water molecules through diffusion. Since the sodium is now isolated from the chlorine, what keeps it from violently exploding with water in the following chemical reaction? $$\ce{2Na + 2H2O -> 2 NaOH + H2}$$ Also, since chlorine is poisonous, wouldn't that make drinking salted water extremely lethal?
[A really-good answer to this question should include quantitative evidence, but here is my hand-waving version...] Solvated sodium ions ($\ce{Na+}$) aren't all that reactive. Surrounded by a lot of polar water molecules, they're actually quite stable. What you're thinking of is solid sodium (Na) which will "react violently with water" until it's all dissolved - dissolved that is, into stable sodium ions. Same kind of logic applies to chlorine. Solvated chloride ions ($\ce{Cl-}$) are stable and not nearly as poisonous as chlorine gas. (Note: everything is poisonous at some level, i.e. "the poison is in the dose". In saying chlorine gas is more poison, that really just means it is a more 'potent' poison: it will kill at lower doses compared to chloride ions.) Another way to think of it: Solid sodium and chlorine gas are at high energy states. Since they can reach much lower energy states by ionzing in the presence with water, the WILL break down and ionize in the presence of water
0.666667
Solvated sodium ions are stable and not as poisonous as chlorine gas
How to start working in magento?
I am new in magento and a little confused to how to start work in it. I studied the basics of magento and found its structure really complex. I never worked on a CMS before and I have a little knowledge of php and html but I am not good in css. Should I learn the css before start working in magento or it will not be a big problem. What are the easiest steps for learning magento. Please give me some ideas. Thanks.
I have learned magento here . This is awesome tutorials, but I had a lot of knowledge about wordpress and php then, so it was easy to adapt to magento. Try to learn html and css. That you will always need. Happy coding.
0.888889
How to adapt to magento
What creates this strange flare and how to prevent it?
I shot at a concert for the first time. The pictures were pretty good for the capability of my equipment, but on some shots, the light has a very strange flare. It isn't the usual rays, but some soft, non-symmetric form which I find quite strange, and, on most shots, distracting. On this image, you can see it just above Gino's head and also behind his back, to the right of the mic stand. I am not sure if the slight blue lines on the left side of the picture (they form a triangle aimed at Chris's head, maybe not visible on all monitors) are part of the problem or if they come from a different light source. What makes them appear, and how do I avoid them? I shot with a D90 with a 18-200 lens, no filters or hoods attached. The settings were quite strained (iso 3200, often at max length and max aperture for the length. This specific picture is 1/125, f 5.3, 95 mm).
All cameras contain lenses which are actually comprised of several "lens elements." Lens flare is caused by non-image light which does not pass (refract) directly along its intended path, but instead reflects internally on lens elements any number of times (back and forth) before finally reaching the film or digital sensor A good lens hood can nearly eliminate flare caused by stray light from outside the angle of view. Ensure that this hood has a completely non-reflective inner surface, such as felt, and that there are no regions which have rubbed off. Although using a lens hood may appear to be a simple solution, in reality most lens hoods do not extend far enough to block all stray light. This is particularly problematic when using 35 mm lenses on a digital SLR camera with a "crop factor," because these lens hoods were made for the greater angle of view. In addition, hoods for zoom lenses can only be designed to block all stray light at the widest focal length. Petal lens hoods often protect better than non-petal (round) types. This is because petal-style hoods take into account the aspect ratio of the camera's film or digital sensor, and so the angle of view is greater in one direction than the other.Placing a hand or piece of paper exterior to the side of the lens which is nearest the flare-inducing light source can also mimic the effect of a proper lens hood. Lens flare also depends on the lens used - fixed focal length (or prime) lenses are less susceptible to lens flare than zoom lenses. Other than having an inadequate lens hood at all focal lengths, more complicated zoom lenses often have to contain more lens elements. Zoom lenses therefore have more internal surfaces from which light can reflect. Source- http://www.cambridgeincolour.com/tutorials/lens-flare.htm
0.888889
Lens flare is caused by non-image light which does not pass (refract) directly on lens elements
Fast multi-tag search plus result ordering and paging?
Can somebody explain how StackOverflow search works? I would like to add same features to a project I'm working on. In SO, it's possible to filter the questions by multiple tags (e.g. c#, java) and get results sorted/paged by date or number of votes? I realize that RDBMS with full-text engine can be used to filter and sort the questions but I'm not sure if that's the best solution? Is it possible to somehow get top N ordered results from a full-text index? Maybe Lucene.NET or Redis or something similar is used?
As of April 2011, Stackoverflow uses Lucene.NET. Source: (Jeff Atwood) http://blog.stackoverflow.com/2011/01/stack-overflow-search-now-81-less-crappy/ Their old method was Homebrew + Full Text SQL How to search by tags in Lucene Top N with Lucene Paging with Lucene
0.777778
Stackoverflow uses Lucene.NET
Set natbib options after loading natbib package
Is it possible to set (or change) the natbib package options after its loading (i.e. after the line \usepackage{natbib})? The reason I need it is that I'm using a LaTeX style from a journal and it has a natbib option which means it "...handles reference entries in the author-year system by using the natbib package", according to the journal style documentation, and I need to tune some settings (like 'sort&compress', for example), but I do not know how to do that since I do not load the 'natbib' package directly. I know there is a command \biboptions{} in Elsevier LaTeX style which does exactly what I want. But as far as I understand, this command is specific to their style and does not belong to the natbib package itself, or am I wrong? P.S. I'm working with the Springer's 'SVJour3' document class currently. It is a widely used one, I believe. So, maybe someone can suggest me a way to sort the citations so that they do not look like [2,3,1] instead of [1-3] or at least [1,2,3] in the text? Thank you!
The \biboptions macro would seem to be set up by the elsarticle document class (or one of its subsidiary files), rather than by natbib. If you can use this command to disable sorting/compressing of numerical references, I'd do so. The commands natbib provides to change citation-related defaults are \setcitestyle and \bibpunct. The \bibpunct command is the older of the two, and always takes exactly six arguments. The command \setcitestyle, in contrast, is more flexible and also a bit "wordier". However, neither of these two commands would allow you to undo a package option such as "sort&compress". Finally, I'd say that if you're forced to use a certain document class and bibliography style file for your journal submission, it's generally not productive to try to subvert this requirement. A cover letter, in which you explain to the editor and editorial assistants why one or more settings embedded in their journal's default setup are not chosen optimally and why they should consider accepting a different set of settings, may be the better approach to achieving a satisfactory outcome.
1
biboptions macro set up by elsarticle document class (or one of its subsidiary files)
Orthogonal complement $V^\bot$ of the vector space $V=\langle(1,0,2),(3,-1,0)\rangle$ and $V\cap V^\bot$
Consider the inner product defined by polarizing the quadratic form $$q(x,y,z)=x^2-z^2+4xy-2yz$$ on $\mathbb{R}^3$. Let $V=\langle(1,0,2),(3,-1,0)\rangle$. Could you show me how to find $V^\bot$ and $V\cap V^\bot$? I get $V^\bot=\langle(2,6,1)\rangle$, which doesn't feel right, and don't know how to calculate the intersection. Also, in general, what can we say about the dimension of $W^\bot$ if we know the dimension of $W$?
The symmetric bilinear form that gives rise to your quadratic form $q$ is given by $$ b((x_1,y_1,z_1),(x_2,y_2,z_2))=x_1x_2-z_1z_2+2x_1y_2+2y_1x_2-y_1z_2-z_1y_2 $$ Now the conditions of being orthogonal to $(1,0,2)$ and to $(3,-1,0)$ are respectively given by setting for instance $(x_2,y_2,z_2)$ equal to that vector and equating the resulting expression to$~0$; this respectively gives the equations $$ \begin{align} x-2z+2y-2y&=0,\\ 3x-2x+6y+z&=0, \end{align} $$ or after simplification $$ \begin{align} x\phantom{{}+0y}-2z&=0,\\ x+6y+\phantom0z&=0. \end{align} $$ Then $V^\perp$ is spanned by for instance $(4,-1,2)$. It happens that this vector is also in $V$ (it is the sum of the two given vectors spanning $V$), which shows that you are not dealing with an inner product here (which should be positive definite). Indeed $q(4,-1,2)=0$. (Such a vector orthogonal to itself is called an isotropic vector for the bilinear form.) If $E$ is the whole space, one does have $\dim(V)+\dim(V^\perp)=\dim(E)$ here. But even that is only valid in general provided that that bilinear form is nondegenerate, meaning that no nonzero vector is perpendicular to all vectors. Even though the given bilinear form is indefinite, it is nondegenerate. That can be checked by checking that the Gram matrixof $b$ $$ \begin{pmatrix}1&2&0\\2&0&-1\\0&-1&1\end{pmatrix} $$ has nonzero determinant. So $\dim(V)+\dim(V^\perp)=\dim(E)$ could have been expected here.
0.777778
symmetric bilinear form $q$ is given by $$ b(x_1,y_1,z_1),(x
Learning how to be a good rhythm guitarist before becoming a lead guitarist, where to start?
I have recently been trying to hone in my improvisational skills. I'm stuck in the first position of the Am pentatonic box and can't move away from it. Whenever I try to move out of it, I randomize the next box that I go to, which most of the time leads to bad sounding improvisations. I have narrowed the problem down to it being me having a bad sense of rhythm. I think I've got technique as a rhythm guitarist, but in regards to musicality, I don't. I don't know which chords go together well, what goes after a chord, how minors, majors and 7ths are formed (don't know if this is important to be a good rhythm guitarist though), etc.
I think there's some possibility for confusion of terms because lead and rhythm means different things depending on what precise area you're talking about. In a rock band, there's usually a division between the rhythm guitar whose job is primarily harmony and chords (the left hand of the piano) and the lead guitar whose job is to play little melodies and solos (the right hand of the piano). You don't need to learn rhythm first. Rhythm isn't any less musical than lead playing. And playing lead well requires lots of rhythmic ability. Definitely work on your rhythm-playing even if you don't intend to be a rhythm player. Many lead-guitar effects like syncopation and suspension require a keen rhythmic sense to accomplish. Sometimes a lead can be as simple as copying the rhythm part, replacing full-chords with power-chords, or replacing power-chords with dyads or just the root notes. If you try to view the two guitarists as team whose job it is to play the song, then you can steer away from the view that the lead is more important and the rhythm should be delegated to the junior of the two. Rhythm and lead both have a function to serve and sometimes the rhythm is more important, sometime less important. Sometimes you gotta tell the soloist to chillax a few bars and let this groove breathe. The lead is the driver, but the rhythm is the horsepower. And lead playing can be very rhythmic. Listen to some Louis Armstrong trumpet solos where he's just wailing the hell out of one note. But all the bending and wiggling is in rhythm.
1
Lead and lead playing can be very rhythmic.
Replicate a big, dense Windows volume over a WAN -- too big for DFS-R
I've got a server with a LOT of small files -- many millions files, and over 1.5 TB of data. I need a decent backup strategy. Any filesystem-based backup takes too long -- just enumerating which files need to be copied takes a day. Acronis can do a disk image in 24 hours, but fails when it tries to do a differential backup the next day. DFS-R won't replicate a volume with this many files. I'm starting to look at Double Take, which seems to be able to do continuous replication. Are there other solutions that can do continuous replication at a block or sector level -- not file-by-file over a WAN? Some details: The files are split up into about 75,000 directories. 99% of the daily change comes from adding new directories; existing files are rarely changed. There's some other relevant discussion here.
Check out Shadowprotect. It's not continuous, but it can be set to do an incremental every 15 minutes. It's pretty awesome software. Add on the ImageManager enterprise portion and it also gives you some great replication abilities for offsite backups.
0.833333
Shadowprotect can be set to do incremental every 15 minutes
What is the cardinality of the family of unlabelled bipartite graphs on n vertices?
I have attempted to calculate the number of unlabelled bipartite graphs as follows: Let $G = (V_1, V_2, E)$ be a bipartite graph on $n$ vertices with $|V_1| = m$ and $|V_2| = n-m$. Assume without loss of generality that $|V_1| \leq |V_2|$ so $m \leq \left\lfloor \frac{n}{2} \right\rfloor$. If $G$ is complete bipartite then it has $m(n-m)$ edges since each of the vertices in $V_1$ is connected to each in $V_2$. Thus, the total number of bipartite graphs with parts of size $m$ and $n-m$ is $2^{m(n-m)}$. In order to find the total number of possible bipartite graphs on $n$ vertices we sum over all possible $m$: \begin{align} \sum^{\left\lfloor \frac{n}{2} \right\rfloor}_{m=1} 2^{m(n-m)} \end{align} However, I notice that I have counted labelled bipartite graphs where I need the number of unlabelled graphs. I'm struggling to see how to account for this.
It seems that what Andrew wants to count are what are called in enumerative contexts "bicolored graphs". A bicolored graph is a graph in which the vertices have been colored black and white so that every edge joins two vertices of different colors. A bipartite (or bicolorable) graph is a graph that has a bicoloring. A bicolorable graph with $k$ connected components has $2^k$ bicolorings. (In nonenumerative contexts the distinction between bipartite and bicolored is usually unimportant.) In addition, in counting bicolored graphs one might or might not consider switching the two colors to give an equivalent graph. All of the versions of the enumeration problem have been solved. Counting unlabeled bicolored graphs (with no color-switching equivalence) is a straightforward application of Burnside's lemma; counting unlabeled bipartite graphs is tricky. It's not too hard to find appropriate references by searching MathSciNet. (Hint: "color" is sometimes spelled "colour".) Incidentally, the number of labeled bicolored graphs on $n$ vertices is $$\sum_{m=0}^n 2^{m(n-m)}\binom{n}{m}.$$
0.666667
Counting unlabeled bicolored graphs in enumerative contexts
Does the number of visits matters for SEO?
Considering I have a website and I have millions of direct views (entering directly by URL, not by any other URL) and that there is no links to this site anywhere else (or that this views don't generate any external link to the site), will these visits increase my positioning in search engines such as Google? Are search engines capable of measuring direct visits rather than links from other pages?
Search engines have no way of knowing what traffic your website gets so it can't be used as a ranking metric in their algorithm. (Google has clearly stated that Google Analytics data is not used in their ranking algorithm). Even if they did, the number of visits would not be a good judge of relevance as it is easy to artificially inflate your number of visitors. So even if search engines knew how many visitors your site had it would not be a very useful metric to them. (Now if they had access to your site analytics they could use that to determine the quality of your site visits which could possibly be used to determine quality of content but that is currently not happening).
0.888889
Search engines have no way of knowing what traffic your website gets
Which achievements are missable if sharing Skylanders between multiple profiles?
Since purchasing Skylanders with my son and realizing you can't have different profiles on each character, I've also noticed some achievements are not unlocking depending on who first used the Skylander and who it is tied to. In short, all the Skylanders appears to be tied to my profile, but it's preventing some achievements from unlocking on my son's profile. They aren't just the achievements described with (primary profile), as most have unlocked for both of us while playing separately. So far I've noticed that the following achievements won't unlock once a Skylander is tied to someone: Fashion Stylist - Have your Skylander equip a hat for the first time. (primary profile) Hello!! Skylander - The first time you put your Skylander on the Portal of Power. (primary profile) What other achievements are tied to a Skylander unlocked by a specific person?
In addition to the ones you mentioned, the following achievements may give you trouble.. I Love Shopping - Buy first Upgrade - if all of the Skylanders already have one+ upgrade Climb to the Top - Level Up to 10 - If all Skylanders are already at 10 True Portal Master - all other Achievements - obviously, if you can't get any of the others Note that you can reset a Skylander to level 1, or transfer it to someone else. Look under the Manage option in the Menu.
1
if all Skylanders are already at 10 True Portal Master - all other Achievements
printf is causing a segfault with getlogin()
I'm new to C, so I apologize if the answer is obvious, I've searched elsewhere. the libraries I'm including are: #include <unistd.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/wait.h> #include <fcntl.h> #include <sys/stat.h> the code that is failing is: char *USER = getlogin(); char CWD[128]; if (USER == NULL) printf("cry\n"); getcwd(CWD, sizeof(CWD)); printf("this prints\n"); printf(USER); printf("this does not\n"); printf("%s@myshell:%s> ", USER, CWD); cry does not print, so that should mean that getlogin is successful. the segfault is caused on printf(USER); further testing shows that the folling block prints entirely printf("this prints\n"); printf(USER); printf("this prints\n"); but the folling block will print this prints end then segfault without showing USER printf("this prints\n"); printf(USER); EDIT: Sorry for wasting your time. I accidentally deleted an fgets that was supposed to follow it and that was causing the segfault. I've been on this bug for a couple hours now, I love it when the problem is so small. Thanks
You should check getcwd return value. According to man page of getcwd: If the length of the absolute pathname of the current working directory, including the terminating null byte, exceeds size bytes, NULL is returned, and errno is set to ERANGE; an application should check for this error, and allocate a larger buffer if necessary.
1
Getcwd return value
Enabling aggregate and compress CSS files caused error on site access
I set this tick box in the performance area, and on clicking Save I now cannot access the site, even the performance area to disable this! any one know if I can directly change this in the DatabasE? EDIT: I have refreshed the Database, thankfully no updates since it went live. This does raise the question though as I'm not the only one who has had problems with these performance tick boxes, how do you back out of an error? I would still like the answer cause i'm trying to get to the bottom of these performance settings. thanks for any replies.
If you're looking for a good alternative for core's preprocessing of CSS/JS check out the Advanced CSS/JS Aggregation module
0.777778
Advanced CSS/JS Aggregation module
Eved Knani versus a Woman
In terms of obligation in mitzvos, what is the difference between an Eved Knani and a woman? And if they are the same, why do we have two separate brachos for each in the morning prayers?
The שלמי חגיגה in 6:(4) (starting on page 30) has 2 long pieces discussing this – and from what I understand, women and Eved Knani are incidentally similar in their obligations. (Not completely incidental, as their dispensations have the same source: both the Eved Knani and the Married Woman have another Boss besides for the Torah. He discusses that too.) He brings – based on Rishonim – that an Eved Knani is either a non-Jew with some Jewish obligations or else "2nd class" Jew with limited obligations. Either way, an Eved Knani is not a fully fledged Jew - and is therefore on a higher level than a non-Jew but a lower level than a Jewish woman. As a result, the Bracha for Eved Knani is between the one where we thank for not being non-Jews with no obligations, and the one where we [men] thank for not being women who are fully fledged Jews with certain dispensations.
0.888889
Women and Eved Knani are incidentally similar in their obligations .
What does it mean to interpret the Bible literally?
Here are some common definitions from a dictionary for ‘literal’: Being in accordance with, conforming to, or upholding the exact or primary meaning of a word or words. Word for word; verbatim: a literal translation. Avoiding exaggeration, metaphor, or embellishment; factual; prosaic: a literal description; a literal mind. So what does it mean then to ‘take the Bible literally?’ Which definition are we referring to when we say ‘I take the Bible literally?’
Those who claim to interpret scriptures "literally" will otherwise propose this means to "accept the plain meaning" of the text, rather than seeking a symbolic, allegoric, or otherwise subtle hidden meaning. Of course the "plain meaning" itself can be subjective, causing differences in interpretation based on the "literal" approach.
0.888889
"accept the plain meaning" of the text
COMP_LINE not set despite bash completion being installed
I'm using homebrew's bash completion package on OSX, which is installed in /usr/local/etc/bash_completion. It's working fine, but there are many extensions for it which rely on various environment variables beginning with COMP_, such as COMP_LINE. These environment variables unfortunately aren't being exported into my bash environment, despite the fact that the proper files are being sourced. Here is the applicable area in my .bash_profile: # bash completion if [ -f `brew --prefix`/etc/bash_completion ]; then . `brew --prefix`/etc/bash_completion . /usr/local/etc/bash_completion.d/git-completion.bash fi Yet COMP_LINE isn't set, which is preventing other completion addons from working: > env | grep COMP_LINE > Any ideas why the environment variables aren't set? Thanks in advance for your time.
$COMP_LINE is not an environment variable. It is an internal variable, and it's only visible to the completion functions, not to other shell usage. (Most other internal variables are visible in declare.)
0.888889
$COMP_LINE is not an environment variable
Does "so far, so good" carry a negative connotation?
As a follow up to this etymology question, does "so far, so good" carry a negative connotation? For example, after having her sonogram, my wife asked the technician if everything was okay. The technician replied, "so far, so good." My wife later remarked that she didn't like that the technician used the phrase because it sounded like things will be going wrong later. I always thought this phrase was positive and that it was a replacement for the word "good."
I don't think "so far, so good" implies that something will go wrong later, not nearly as much as it implies it does that something can go wrong later. I might use those words to describe the status of a major project that appears to be on-time, or a to report progress on a long trip that has been without incident. As for applying it to a sonogram, I'll admit, maybe that's not the best choice of words. Then again, maybe the technician interpreted the question differently. By asking, "Is everything okay?" your wife may have meant, "Does the baby look healthy?" but the technician may have interpreted it as "Is all the equipment working fine?" or "Is the image clear?" or even "How has your day gone so far?" After all, after a technician has performed a dozen of these per day, week after week, month after month, he's probably encountered all sorts of technical problems. As I said, maybe not the best choice of words, but I doubt very much that he intended to sound ominous.
1
"so far, so good" implies that something will go wrong later, not nearly as much as it implies it does that something can go
Change Drupal Commerce line item titles
I'm building a webshop with a lot of promotions in. And some articles in the shopping cart, have a linked promotion. And I want to show this promotion in the shopping cart summary (before the order completion). Is there a way to change the title of the product in the shopping cart summary? It's a shop without any visible prices. The total amount of the order is calculated on the servers... (it's a complicated proces). So there is nothing to worry about that... But how can I display the pink text in a proper way? Would it be best to get this data from the database and place it as a field in a table (since the shopping cart summary is a view)? Or what other options do I have?
The answer depends on the nature of your 'linked promotions'. It might be that you should add an entity reference field to your line item type, then add the field to the shopping cart view. If your promotions are based on tagging products with taxonomy terms, it's as simple as adding the field to the cart view. Or, as @Strae said, you could alter the line item's title via hook_commerce_cart_product_add. Yet another way would be to alter the line item's 'label' via Rules and show that in the cart instead.
0.888889
Adding an entity reference field to your line item type to the cart view
Insufficient information to create shipping label(s) Magento Enterprise
I am using Magento Enterprise 1.14.0.1 I have Fedex Shiiping method activated and have entered in the information for production that was provided and confirmed by Fedex to be correct for the account ID, Meter, Password, and the key. I have sandbox set to no since the credentials are for production. I have a Max package weight set packaging set to "Your Packaging" and the "drop off" set to regular pickup as we have a driver that comes everyday. My issue is when I click the button to create a shipment and then enter the total weight and then add the product and click the check box and add the product to the shipment. I then click OK and get an error message that says Insufficient information to create shipping label(s). Please verify your Store Information and Shipping Settings. I do not know what to check to fix this.
Magento requires below data to generate shipping labels. Admin First Name Admin Last Name Store Name Store Phone Origin Street Address Origin City Origin Region/State Origin Zip Origin Country You will see the error if any of the above is missing. Navigate to System -> Configuration -> Shipping Settings to update Origin fields System -> Configuration -> General to update store name & phone
0.888889
Magento requires below data to generate shipping labels
Will installing Ubuntu using Wubi erase Windows?
I have an HP laptop with 2 partitions: C: and D:, with windows 7 installed in the C: drive and D: is the Recovery partition. When I try to install Ubuntu 12.04 LTS using Wubi, it only shows the C: drive for installing and not the D: drive where I wanted to format and install ubuntu. So, if I go ahead and install in the C: drive where windows 7 is already installed, would Wubi erase windows 7? Or it will just install Ubuntu as a program in windows?
or it will just install ubuntu as a program in windows?? Indeed. Wubi will install it as a program in Windows. This will make Ubuntu slower and dependent on Windows. If you don't want to install as a program in Windows, you should follow these instructions.
0.888889
Wubi will install Ubuntu as a program in Windows
Set natbib options after loading natbib package
Is it possible to set (or change) the natbib package options after its loading (i.e. after the line \usepackage{natbib})? The reason I need it is that I'm using a LaTeX style from a journal and it has a natbib option which means it "...handles reference entries in the author-year system by using the natbib package", according to the journal style documentation, and I need to tune some settings (like 'sort&compress', for example), but I do not know how to do that since I do not load the 'natbib' package directly. I know there is a command \biboptions{} in Elsevier LaTeX style which does exactly what I want. But as far as I understand, this command is specific to their style and does not belong to the natbib package itself, or am I wrong? P.S. I'm working with the Springer's 'SVJour3' document class currently. It is a widely used one, I believe. So, maybe someone can suggest me a way to sort the citations so that they do not look like [2,3,1] instead of [1-3] or at least [1,2,3] in the text? Thank you!
I think I have found the answer as far as Elsevier articles are concerned (I am using elsarticle.cls). elsarticle-num.bst requires entries in the BibTeX database to be preceded with a \bibitem tag, e.g. \bibitem{ @article{Bridgman1914, author = {P. W. Bridgman}, title = {A complete collection of thermodynamic formulas}, journal = {Physical Review}, year = {1914}, volume = {3}, issue = {4}, pages = {273--281}, } } If this is done the references should appear sorted in the article.
0.777778
elsarticle-num.bst requires entries in the BibTeX database to be preceded with a bib
Unable to shut down laptop after Logging Out of Ubuntu 12.04
I logged into the Ubuntu 12.04 LTS and instead of installing it... I pressed the Log Out button, thinking of installing it some other time. But then a screen appeared asking for Username and Password. I typed in my name as the User name and a password of my choice..I was halfway through typing my password..just then I remembered that I had to Login as 'root' so I hurriedly pressed the Back button... but instead the user name and half password I typed.. got submitted. Now it is asking for User name and Password and when I type the ones which I had initially typed..its showing Login Error :( But the problem doesn't end here... m unable to shut down my laptop.. its been more than 12 hours and m stuck at this login screen... plzzz help me out!
If you're running from a live CD/DVD/USB and have not yet installed Ubuntu, and you clicked Log Off, that's not part of the installation. It's not asking you what username and password you want to use in the system you're installing. It's asking for the username and password for the live environment. As AliNa says, the username is ubuntu and the password is blank (assuming you have not changed it in the live CD/DVD/USB since you booted from it, which you probably have not). If for some reason you want to shut down on the login screen (for example, if that username and password doesn't work), holding down the power button is not the best way to do it. A very clean way to restart is to press Ctrl+Alt+F1 followed by Ctrl+Alt+Delete. But you should be able to log back in to the live CD/DVD/USB system with the username ubuntu and the blank password. If you're running from a live CD/DVD/USB and you want to install Ubuntu, and the installation is not started, you probably selected Try Ubuntu without installing rather than Install Ubuntu. If that's the case, then when you're ready to install, you can click the Install Ubuntu icon on the Unity launcher, which is the bar of icons on the left side of the desktop.
0.888889
If you're running from a live CD/DVD/USB, click Log Off
Silicone caulk for shower and tub?
I am about to seal the gap between my tub and the wall tile with caulk (it was originally grout which cracked so I chiseled out what I could). I was planning to use silicone caulk (GE II), but a contractor suggested that pure silicone is not ideal since all caulk will eventually need to be removed and replaced and silicone is very difficult to remove. There's some logic to this, so I'm wondering - is he right? If so, what kind of caulk should I use?
That gap is to small. Push really hard with the float to completely fill it with grout, giving it one more shot; next time caulk it. Caulked tub surrounds are one of my pet peeves; I'm the one who gets to scrape that mess out. Whether grout or caulk, I like Some Guy's advice: prestress the tub by filling it with water as you work.
0.888889
Caulked tubs are one of my pet peeves
Show comments fields in two columns
I am using comment_form(); in loop-single.php file to show the comment form. I have the following fields in it: Name, Email, Website, Title, Comment. Currently all these form fields show underneath each other. I tried to modify the form in such a way so that all textbox values appear in left column & only the textarea appears in the right column. I tried to use comment_notes_after, comment_notes_before, comment_form_top, etc. so far but met with no success. So how can I achieve this (Any working code will be greatly appreciated)?
What you need are two new containers: one for the single line fields, one for the textarea. Looking at the default comment form, we can see where their start and end tags should appear. I have added some comments to make that easier to see: <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>"> <?php do_action( 'comment_form_top' ); ?> <?php if ( is_user_logged_in() ) : ?> <?php echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); ?> <?php do_action( 'comment_form_logged_in_after', $commenter, $user_identity ); ?> <?php else : ?> <?php echo $args['comment_notes_before']; ?> <?php do_action( 'comment_form_before_fields' ); // Fields: author, email, url foreach ( (array) $args['fields'] as $name => $field ) { echo apply_filters( "comment_form_field_{$name}", $field ) . "\n"; } do_action( 'comment_form_after_fields' ); ?> <?php endif; ?> <?php // Field: textarea echo apply_filters( 'comment_form_field_comment', $args['comment_field'] ); ?> <?php echo $args['comment_notes_after']; ?> <p class="form-submit"> <input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" /> <?php comment_id_fields( $post_id ); ?> </p> <?php do_action( 'comment_form', $post_id ); ?> </form> We need the first start tag on 'comment_form_top'. Not later because we have to catch the case of a user who is logged in. We close that tag and open the second one on 'comment_form_after_fields'. Finally, we close the last tag after 'comment_form_field_comment'. This one is a filter, not an action. In the following sample code I throw a style element into the markup. In your theme you should put the CSS into the style sheet. And you should use a clearfix handler of your choice, not the markup I used here. :) add_action( 'comment_form_top', 'wpse_67805_open_tag' ); function wpse_67805_open_tag() { ?> <style> @media screen and (min-width: 800px) { .wpse-67805-comment-fields, .logged-in-as { float: left; width: 280px; } .wpse-67805-comment-textarea { float: right; width: 280px; } .wpse-67805-textarea-after { clear: both; } } </style> <div class="wpse-67805-comment-fields"> <?php } add_action( 'comment_form_after_fields', 'wpse_67805_open_close_tag' ); add_action( 'comment_form_logged_in_after', 'wpse_67805_open_close_tag' ); function wpse_67805_open_close_tag() { ?></div><div class="wpse-67805-comment-textarea"><?php } add_filter( 'comment_form_field_comment', 'wpse_67805_close_tag' ); function wpse_67805_close_tag( $textarea ) { return "$textarea</div><div class='wpse-67805-textarea-after'></div>"; } Result in TwentyEleven Not exactly beautiful, you have to adjust the CSS. But the general way should be clear now.
0.777778
Using a clearfix handler in a style sheet
Installation Steps of Oralce Client 11.2
I tried to install Oracle Client in Ubuntu latest version.Got some problem and also unable to resolve it.Please reply asap. Error Msg:libpq.so.57 is empty,not checked
The library libpq is required by Perl DBI. sudo apt-get install libpq5 Next time you can use this command t find the missing package: % apt-file search libpq.so.5 libpq5: /usr/lib/x86_64-linux-gnu/libpq.so.5 libpq5: /usr/lib/x86_64-linux-gnu/libpq.so.5.7
0.777778
Perl DBI apt-get install libpq5
How to change questions to indirect speech if we are asking about personal information?
I want to to know how to change questions to indirect speech if we are asking about personal information? E.g "What's your name?" said John to the man. "How old are you? What's your job?
John asked the man what his name was. John asked the man how old he was. John asked the man what his job was. Inversion as shown (... how old he was) is necessary. The tense changes because the original sentence in the direct speech is past as in "said John to the man." In some cases such as names, "is" may seem correct for it is still current or doesn't change. However, since we're referring back to the time the question was asked, it has to be "was".
1
John asked the man what his name was .
Bootstrap datepicker default date
I'm using Bootstrap datepicker and I'd like to make that when datepicker shows, default date would be set after 14 days from today. I've got this code but it doesn't work, default date is still set to today. Could anyone explain what am I missing? Thanks in advance. JS: var plus14days = new Date(); plus14days.setDate(plus14days.getDate() + 14 ); $(".datepicker").datepicker("setValue", plus14days);
Just a consideration, api changed setValue to setDate (http://bootstrap-datepicker.readthedocs.org/en/release/methods.html#setdate)
1
SetValue to setDate
How to send an email from command line?
How to send an email from command line or script? I want to be able to run the script programmatically by passing the receiver and the message.
There are two programs that I am aware of which will easily allow you to configure your Mac to send email from the command line. I have written up HOWTOs for both of them: mailsend msmtp Of the two, I suggest msmtp. Configuration is complicated enough that I'm not sure if I should replicate all of the steps here, but I will mention that if you use Homebrew you can install msmtp using brew install msmtp --with-macosx-keyring Then the rest is just a matter of setting up the related configuration files The first is /usr/local/etc/msmtprc # Begin msmtprc # Set default values for all following accounts. defaults tls on logfile ~/.msmtp.log # A first gmail address account [email protected] host smtp.gmail.com port 587 protocol smtp auth on from [email protected] user [email protected] tls on tls_starttls on # this next line is crucial: you have to point to the correct security certificate for GMail. # If this doesn't work, check the mstmp documentation # at http://msmtp.sourceforge.net/documentation.html for help # # This next line should all be on one long line: tls_trust_file /path/to/Thawte Roots/Thawte SSLWeb Server Roots/thawte Premium Server CA/Thawte Premium Server CA.pem # Set a default account # You need to set a default account for Mail account default : [email protected] # end msmtprc Note that tls_trust_file line should point to wherever you have downloaded and installed the certificates from https://www.thawte.com/roots/index.html. I put mine in ~/Dropbox/Thawte Roots so that I can have it on all of my Macs. Then you need a ~/.mailrc file to say where the msmtp binary is located. If you use brew it will be /usr/local/bin/msmtp so the file would look like this: set sendmail="/usr/local/bin/msmtp" The last but crucial step is making sure your Keychain has the information exactly in the format that msmtp will expect it: I think that covers most of the details. See http://www.tuaw.com/2010/05/04/msmtp-a-free-tool-to-send-email-from-terminal/ if you want a few more specifics.
0.888889
How to configure your Mac to send email from the command line
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?
In Free for All, all chat is enabled. You should be able to talk to any player in the match.
1
Free for All Chat enabled.
What benefits do "title search companies" have over physically visiting a land records offices?
I am looking into buying my first piece of real property. Basically my question is "why do title search companies even exist?". Who uses them? And why? Are they doing something special apart from going to the local authoritative body and performing a title search on a parcel id number? A) Am I paying them just so they can do my due dilligence and then stamp some big ole company seal on the documents they provided me with? So I feel more confident in the documentation provided? B) Do they exist solely to service large banks and corporations who control thousands of property deeds worldwide and cannot afford to pay a staffer in every single city on earth just to perform title searches? C) Or might they exist for some other reason that I am entirely unaware of? I am not trying to be facetious. I am genuinely curious. As somebody who has never looked into the process of acquiring land in the past, they seem to be redundant as a service. I can't imagine how so many of them are still in business. Take Detroit, MI for example. There is a website called https://www.waynecountylandrecords.com (which is run by the city of Detroit) where I can go and pay them $6 for 15 minutes of access to perform as many property title searches as I can manage in 15 minutes. It costs $2 per page to print (download) documents from that database, up to a maximum of $10 per document. That, or I could physically visit the land records office listed on their website and do the same thing in person. Although it would cost me a bit more money I believe. So again my question is why would I spend more money with a title search company as opposed to performing the title search myself? Is it simply because "performing a title search" requires the ability to circumnavigate a bunch of legal mumbo jumbo or even know where to perform the title search in the first place? I am quite distraught over the (what seem to me to be) unnessary complications involved in purchasing a property. I'll be frank. I create and maintain extremely large computer databases for a living. So the idea of paying somebody $25+ to basically extract data from a database and then pass it on to me seems asinine. The sole fact that a city like Detroit Michigan is placing a pay wall of $6 to even perform an online title search seems ludicrous to me as well. Seeing as it's in their best interest to give potential investors full and complete knowledge of any liens on the literally thousands of properties they are in need of having purchased by tax-paying individuals. For what? A few $100k in annual revenue for the City? But, I digress. I do understand that it's literally a thousand+ year old system, so I carry on in search of knowledge. If I absolutely have to go through a title search company to receive the full benefits of a title search, please explain why below. Thank you for reading.
Title agencies perform several things: Research the title for defects. You may not know what you're looking at, unless you're a real-estate professional, but some titles have strings attached to them (like, conditions for resale, usage, changes, etc). Research title issues (like misrepresentation of ownership, misrepresentation of the actual property titled, misrepresentation of conditions). Again, not being a professional in the domain, you might not understand the text you're looking at. Research liens. Those are usually have to be recorded (i.e.: the title company won't necessarily find a lien if it wasn't recorded with the county). Cover your a$$. And the bank's. They provide title insurance that guarantees your money back if they missed something they were supposed to find. The title insurance is usually required for a mortgaged transaction. While I understand why you would think you can do it, most people cannot. Even if they think they can - they cannot. In many areas this research cannot be done online, for example in California - you have to go to the county recorder office to look things up (for legal reasons, in CA counties are not allowed to provide access to certain information without verification of who's accessing). It may be worth your while to pay someone to do it, even if you can do it yourself, because your time is more valuable. Also, keep in mind that while you may trust your abilities - your bank won't. So you may be able to do your own due diligence - but the bank needs to do its own. Specifically to Detroit - the city is bankrupt. Every $100K counts for them. I'm surprised they only charge $6 per search, but that is probably limited by the State law.
1
Title agencies perform several things: Research the title for defects .
PostGIS to GeoJSON with GDAL: how to get lat/longs?
I'm trying to convert line features from PostGIS to GeoJSON files, as follows: from psycopg2 import * from subprocess import call conn = connect(dbname='gis') cur=conn.cursor() cur.execute("SELECT distinct osm_id,route_name from planet_osm_line where route_name like '%Rail Trail' and network='rcn';") for record in cur: print "%s" % record[1] call (["ogr2ogr", "-f", "GeoJSON", record[1] + ".json", 'PG:dbname=\'gis\'', "-sql", 'SELECT route_name,osm_id,tags::hstore->\'state\' as state,way from planet_osm_line where osm_id=%d' % record[0]]) That is, ultimately ogr2ogr gets called like this: ogr2ogr -f GeoJSON blah.json "PG:dbname='gis'" -sql 'SELECT route_name,osm_id,tags::hstore->\'state\' as state,way from planet_osm_line where osm_id=-12345' The GeoJSON files that get created have coordinates that look like this [ 16153119.78, -4561568.23 ]: { "type": "Feature", "properties": { "route_name": "Waverley Rail Trail", "osm_id": -64660, "state": null }, "geometry": { "type": "LineString", "coordinates": [ [ 16153119.78, -4561568.23 ], [ 16153117.1, -4561567.48 ], [ 16153114.81, -4561565.86 ], [ 16153113.24, -4561563.55 ], [ 16153112.64, -4561561.63 ], [ 16153112.64, -4561558.82 ], [ 16153113.6, -4561556.2 ], [ 16153115.39, -4561554.05 ], [ 16153117.82, -4561552.66 ], [ 16153119.98, -4561552.2 ], [ 16153122.76, -4561552.48 ], [ 16153125.28, -4561553.69 ], [ 16153127.35, -4561555.88 ], [ 16153128.43, -4561558.46 ], [ 16153128.62, -4561560.38 ], [ 16153128.08, -4561563.13 ], [ 16153126.64, -4561565.51 ], [ 16153124.47, -4561567.26 ], [ 16153121.82, -4561568.17 ], [ 16153119.78, -4561568.23 ] ] } } Please forgive my ignorance, but what am I doing wrong here? I assume what is being written is some kind of projected value rather than the raw lat/long - so how do I get those? I've tried using t_srs=ESPG:3857 but that didn't fix it.
OpenLayers uses the EPSG:3857 coordinate system, in meters, and not the WGS84 system, in degrees, look at OpenStreetMap Wiki: EPSG:3857 But why use subprocess and ogr2ogr? 1) you can use directly the PostGIS ST_AsGeoJSON function: import psycopg2 conn = psycopg2.connect("dbname='osm' host='localhost' user='me'") cur = conn.cursor() # srid of the layer sql = """SELECT Find_SRID('public', 'planet_osm_line', 'way');""" cur.execute(sql) print cur.fetchone()[0] 900913 # The srid is 900913 (now ESPG:3857) What is the srid of your layer ? Use of ST_AsGeoJSON: cur = conn.cursor() sql = """SELECT ST_AsGeoJSON(way) from planet_osm_line WHERE osm_id=34587377;""" cur.execute(sql) print cur.fetchone()[0] {"type":"LineString","coordinates":[[286345.320000000006985,6623598.759999999776483],[286086.950000000011642,6623556.240000000223517],[286256.710000000020955,6622864.799999999813735],[286244.340000000025611,6622861.809999999590218],[286248.78000000002794,6622841.459999999962747],[286195.179999999993015,6622784.349999999627471],[286193.900000000023283,6622756.799999999813735],[286201.429999999993015,6622760.429999999701977],[286214.479999999981374,6622746.240000000223517],[286280.869999999995343,6622702.580000000074506],[286315.070000000006985,6622679.21999999973923],[286298.820000000006985,6622638.849999999627471],[286381.39000000001397,6622609.290000000037253],[286408.419999999983702,6622599.429999999701977],[286499.520000000018626,6622396],[286540.380000000004657,6622248.320000000298023],[286491.299999999988358,6622026.139999999664724],[286333.520000000018626,6621847.75],[285781.320000000006985,6621559.429999999701977],[285733.900000000023283,6621542.389999999664724],[285704.659999999974389,6621539.450000000186265],[285580.510000000009313,6621479.200000000186265],[285461.570000000006985,6621473.490000000223517],[285387.659999999974389,6621462.879999999888241],[285204.580000000016298,6621478.320000000298023],[285177.35999999998603,6621476.370000000111759],[285151.14000000001397,6621468.360000000335276],[285092.150000000023283,6621434.330000000074506],[285063.840000000025611,6621405.099999999627471],[285042.570000000006985,6621364.759999999776483],[284963.869999999995343,6621333.660000000149012],[284913.429999999993015,6621318.639999999664724],[284824.5,6621241.110000000335276],[284719,6621002.940000000409782],[284415.020000000018626,6620781.519999999552965],[283894.53000000002794,6620613.259999999776483],[283610.39000000001397,6620628.200000000186265],[283526.669999999983702,6620603.169999999925494]]} 2) or the osgeo.ogrmodule: from osgeo import ogr connString = """PG: host='localhost' dbname='osm' user'=me'""" conn = ogr.Open(connString) for layer in conn: print layer.GetName() planet_osm_point planet_osm_roads planet_osm_line planet_osm_polygon # first layer = planet_osm_point conn = ogr.Open(connString) layer= conn[0] print layer.GetName() planet_osm_point print layer.GetSpatialRef().ExportToWkt() 'PROJCS["Popular Visualisation CRS / Mercator (deprecated)",GEOGCS["Popular Visualisation CRS",DATUM["Popular_Visualisation_Datum",SPHEROID["Popular Visualisation Sphere",6378137,0,AUTHORITY["EPSG","7059"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6055"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4055"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],AUTHORITY["EPSG","3785"],AXIS["X",EAST],AXIS["Y",NORTH]]' for feature in layer: geom = feature.GetGeometryRef() print geom.ExportToJson() { "type": "Point", "coordinates": [ 283528.026815425022505, 6604019.682090770453215 ] } { "type": "Point", "coordinates": [ 283528.026815425022505, 6604019.664439089596272 ] } ....
0.888889
What is the srid of your layer?
Darken gray hair in GraphicConverter?
I use GraphicConverter on a Mac to tweak my photos before uploading to share. Typically, I'll brighten or adjust a shadowed area or contrast, that sort of thing. Sometimes I'll hide a defect (such as a person who walked in front of a shot) by copying adjacent background over the top. Is it possible to darken gray hair with GraphicConverter? I've tried selecting the hair (using either lasso or polygon selector) and then darkening the selection or adjusting the gamma, but this always ends up with a sharp line around the selection.
Graphicconverter for OSX didn't add Dodge/Burn capabilities until version 9.2 this month. This is quite amazing that it was missing until now considering they are trying to compare to Adobe Photo shop. Using this functionality will likely achieve what you are describing, although you could also do it with layers and fine selection of the hair depending on the image. More info on the release: http://fairerplatform.com/2014/05/graphicconverter-9-2-adds-sharpen-burn-dodge-brushes/
1
Graphicconverter for OSX didn't add Dodge/Burn capabilities until version 9.2 this month
Flash Memory Failure Modes - Block Failure
My understanding is that typical flash memory failures, such as those due to erase cycles, occur at the bit level. I have a flash in which entire blocks (actually two blocks) are failing. Is there a common explanation for this? More specifically, I have two blocks in a NAND flash device which are failing. These blocks are separated by one working block. The two failing blocks can be erased (I can confirm by reading by all ones), but after programming with 'random' data all of the bits are shown as all zeros. Both blocks appear to have failed 'simultaneously' I know that the flash part is nowhere near its max erase-cycle spec of 100k cycles.
It could a number of things, you don't say what generation or device type etc. so specific's will be lacking. Some devices are made with extra blocks and during test if a block is found bad the other block is routed into it's place through programmable switches. The routing channels for the substitutional blocks may have gone bad and depending upon the location of the blocks that could also explain why the pattern that you are seeing (2 blocks separated by one). The most likely situation is that the chip died, or was hurt with ESD.
0.777778
if a block is found bad the other block is routed into its place through programmable switches
ASP.NET MVC 2.0 NHibernate Configure() issue
I have installed NHibernate for my ASP.NET web app although I'm getting a problem in real-time on the following line of code: if (_sessionFactory == null) { _sessionFactory = new Configuration().Configure().BuildSessionFactory(); } Looking at the inner exception the problem is this: {"Could not find file 'D:\Websites\Test\Test\Test\bin\hibernate.cfg.xml'.":"D:\Websites\Test\Test\Test\bin\hibernate.cfg.xml"} This makes sense, as the file doesnt exist in that location. This line of code is within my Core project. File hibernate.cfg.xml is currently in my Infrastucture project, not my Core. Should this be? I have copied the file into this location although I still get problems. If I manually copy the file into this location within windows explorer I then get the following error during runtime. {"Could not load file or assembly 'Infrastructure' or one of its dependencies. The system cannot find the file specified.":"Infrastructure"} Also, I'm missing DynamicProxy.dll as I'm using castle and I couldnt see a version of the DynamicProxy in the castle folder that I downloaded from http://sourceforge.net/projects/nhibernate/ any suggestions? I can see LinFu.DynamicProxy.dll within the download although it says I only need one of the folders, Linfu or Castle, and I'm using Castle for this experiment. Not sure if this has anything to do with it, just thought it might help. any ideas? Many thanks, James
About "Could not find hibernate.cfg.xml": you can either set it to "Copy to Output" (see this) or configure it as an embedded resource. About "Could not load assembly Infrastructure": you're missing Infrastructure.dll in your bin, or one of its dependencies, just as the error says. About missing DynamicProxy.dll: if you're using NHibernate 3.x all you need to use the Castle bytecode provider is NHibernate.ByteCode.Castle.dll and Castle.Core.dll
0.666667
"Could not load assembly Infrastructure"
How to stop shell script if curl failed
I have script that used curl when i pass wrong parameters to script curl failed but script continue executing. I have tried use curl -f/--fail parameter but problem does not solved. What is the best way to stop script? I have founded my mistake. I used curl command into another command echo `curl --fail ... || exit 1` After removing echo command curl become working properly. Thank you for answer, it is also useful.
You can check for exit code using $?: exit_status = $? if [ $exit_status != 0 ] then exit $exit_status fi If you want to analyze exit status, take a look at the Exit codes section from man curl page. There are a lot of different codes, depending on why it failed. EDIT : You can use command1 || command2 as well. command2 is executed if and only if command1 has failed: curl .... || exit 1
1
How to check for exit code using $?
Removing blanks from a column in Excel
If you select the column and press F5, click Special, choose Blanks then right click the selected cells and delete - that'll get rid of the empty cells. Not my bag but I also found this.
0.666667
Select the column and press F5 and right click the cells and delete .
Myrrix java.io.IOException upon ingest when following the tutorial
I am attempting to follow the tutorial for evaluating Myrrix for my collaborative filtering needs: http://myrrix.com/quick-start/ On my Windows 7 laptop, I am able to get the stand-alone java binary running. I can load the web interface on port 80. However, when I go to ingest the sample audioscrobber data I get the message: Error 500 : /ingest java.io.IOException: The temporary upload location [C:\Users\XXXXXX\AppData\Local\Temp\1372181071432-0\work\Tomcat\localhost\_\tmp] is not valid at org.apache.catalina.connector.Request.parseParts(Request.java:2698) at org.apache.catalina.connector.Request.getParts(Request.java:2640) at org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:1076) at net.myrrix.web.servlets.IngestServlet.doPost(IngestServlet.java:64) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at net.myrrix.web.servlets.AbstractMyrrixServlet.service(AbstractMyrrixServlet.java:155) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1686) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) I was hoping that it was just a matter of adding a "--localInputDir" directive to the command line would fix things. However, this seems unrelated to where the Tomcat server is trying to upload. How do I modify the stand-alone binary so that I am able to successfully ingest sample data for training?
Odd. If I follow the path in the provided error, the final 'tmp' directory is missing. If I manually add it in windows explorer and attempt to re-ingest, things appear to go as planned. Viewing the log, it appears that the learning process has begun.
0.888889
'tmp' directory is missing if I manually add it in windows explorer
How much water should I expect to be left in a dishwasher?
After every load there is always some water left in the bottom of the drain basket/filter. It's not up into the dishwasher itself, but when I reach into the filter to clean it, there's always water in it. I have a GE QuietPower 3. Is this expected? If not, what can I do about it?
I had exactly the same issue with my dishwasher. Standing water at the bottom after the wash cycle almost every time, yet the dishwasher appeared to be draining correctly. Nevertheless, the first thing to verify is that the dishwasher is indeed draining properly. Start a cycle to partially fill the washer, then manually engage the drain cycle. Does the water drain quickly and completely? If you're so inclined, you can (carefully) leave the door open while the dishwasher is draining and hold down the door lock mechanism with a small screw driver so that you can watch the process. Another option is to disconnect the drain from your disposal and place the end into a bucket to observe how the water is draining. It's also a good opportunity to clean out any sludge that may have formed in drain hose. If the draining appears to be functioning normally (as it was in my case) the next step is to verify the filter, food chopper blade and mesh grate that is in front of the sump pump/pump inlet housing is not clogged - this is slightly more involved, but still fairly easy to do. Here's a video to give you the general idea of the process: http://www.youtube.com/watch?v=lRDbTgBOtIE. This is not for your model specifically, but it should be fairly close. In my case, the mesh grate was almost 100% clogged with debris and hard water deposits, and the food chopper blade had a piece of string wrapped around it that kept it from spinning freely (no idea how that got there). After soaking the grate in a vinegar solution, cleaning the it with a toothpick and unwrapping the string from the blade, I haven't had any more issues with water remaining in the dishwasher. This may not fix your problem, but it's fairly easy to do yourself and may just save you a service call. Good luck.
1
Does the dishwasher drain properly?
Are mutliple database calls really significant with a network call for a web API?
At one of my employers, we worked on a REST (but it also applies to SOAP) API. The client, which is the application UI, would make calls over the web (LAN in typical production deployments) to the API. The API would make calls to the database. One theme that recurs in our discussions is performance: some people on the team believe that you should not have multiple database calls (usually reads) from a single API call because of performance; you should optimize them so that each API call has only (exactly) one database call. But is that really important? Consider that the UI has to make a network call to the API; that's pretty big (order of magnitude of milliseconds). Databases are optimized to keep things in memory and execute reads very, very quickly (eg. SQL Server loads and keeps everything in RAM and consumes almost all your free RAM if it can). TLDR: Is it really significant to worry about multiple database calls when we are already making a network call over the LAN? If so, why? To be clear, I'm talking about order of magnitude -- I know that it depends on specifics (machine hardware, choice of API and DB, etc.) If I have a call that takes O(milliseconds), does optimizing for DB calls that take an order of magnitude less, actually matter? Or is there more to the problem than this? Edit: for posterity, I think it's quite ridiculous to make claims that we need to improve performance by combining database calls under these circumstances -- especially with a lack of profiling. However, it's not my decision whether we do this or not; I want to know what the rationale is behind thinking this is a correct way of optimizing web API calls.
If the database is on a different server than your REST service, each database call will result in a network roundtrip and that can significantly hurt performance: I once observed a single webservice call be translated to about 500 database queries - this was hardly a problem when both the webservice and the database are located on the same machine, but turned into a response time of 6-7 seconds when they were on different machines. Obviously, 500 roundtrips to the database is pretty extreme. I'm not sure what your performance requirements are, but as a rule-of-thumb I would say that if you stay under around 10 database queries per REST-call you should not experience a significant performance hit.
0.555556
if the database is on a different server than your REST service, each roundtrip will result in a network roundtrip.
What to do with old connections when moving outlet to dedicated circuit?
I would like to remove one of the outlets from a circuit, and run a dedicated wire to it from a separate breaker, placing it on it's own circuit. When I disconnect the existing circuit from the receptical, that will leave pigtails for the old circuit. What do I do with the pigtails from the old circuit that the outlet will no longer be wired to? -Do they need to stay in the box(which would mean they would be pigtailed in the box, but not connected to the outlet, and new wiring would also run into the box for the new circuit connected to the outlet)? -Get pushed into the wall? -What seems the safest thing: Remove the outlet, leave the pigtails in the box, and put a blank over it. Then cut a new hole for a new box for the receptacle and new wiring to go into.
Of the three options you mention, the first is fine; leave the wires in the box, spliced. The second, no good at all. Splices must be in an accessible box. Third, also fine. You can certainly blank up the existing box and run new. I prefer a fourth option; Leave the existing receptacle alone and run a new circuit to a new box. WHY do you need the existing one removed?
0.888889
Leave the wires in the box, spliced and no good at all
Privacy of Gmail for business?
Considering the recent litigation in which Google apparently claimed that all the emails, all the data in them, are Google's property and can do with the data whatever they want, I get frequent questions from our employees how does this translate into Gmail for business which we're using. Is the data in our corporate account also Google's property? http://www.theregister.co.uk/2013/08/14/google_cloud_users_have_no_legitimate_expectation_of_privacy/
Send your employees to Google's Gmail for business benefits page. http://www.google.com/enterprise/apps/business/benefits.html?#security It says "When you put your data in Google Apps, you still own it, and it says just that in our contracts."
0.777778
Send your employees to Google's Gmail for business benefits page
Wrong spacing around guillemets
I use UTF-8 encoding to type a document in French, with the following definitions for guillemets: \DeclareUnicodeCharacter{AB}{\og} \DeclareUnicodeCharacter{BB}{\fg\xspace} and the Babel package: \usepackage[francais]{babel} However, when I type a text like ceci cela «~quoted~» ceci cela, the spacing is wrong around the opening guillemet: Notice that the space before the opening guillemet is too small, and the spacing after is too large. The closing guillemet has correct spacing. How could I fix that?
The spacing is already inserted by \og and \fg, so you shouldn't type the ~. You can consider changing the definition of the Unicode character as \DeclareUnicodeCharacter{AB}{\og\ignorespaces} \DeclareUnicodeCharacter{BB}{\unskip\fg} so that inputting Ces simulations «directes» sont ainsi Ces simulations « directes » sont ainsi will be equivalent. Notice that \xspace does nothing. If you insist to type «~directes~», then the definition for the open guillemets character could be \makeatletter \DeclareUnicodeCharacter{AB}{% \og\@ifnextchar~{\@gobble}{}} \makeatother Say what you want, but I find this spacing awful. ;-)
0.888889
og and fg spacing for Unicode characters
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?
Your response of "With 7 points?" makes me think you have some misconceptions about the hands the you ought to preempt on. (As an aside, I am really curious: What do you preempt on?). One normally preempts on highly offensive hands, which when played in any suit other than your long suit will offer very little defense. The position also is relevant, as in third seat you can really be aggressive in your preempts, opposite a passed hand. The vulnerability and scoring also matters: at IMPS going down 3 doubled, non-vul (-500) against a making vul game is (-600) is a great sacrifice. Don't look at the total hcp, but look at your suit length and how offensive your hand is. So a hand like Jxxxxxx, Kx , Qx, Kx (9 hcp) is not a hand to prempt (it offers nice defense and is less offensive oriented), but you should preempt on a hand like KQTxxxx, x, xxx, xx (only 5 hcp). With KQTxxxx as trumps, assuming partner holds 2 small trumps, you rate to take 5-6 tricks on average. If partner also has an outside A, you will take 6-7 tricks, which is a great bargain (going down 2 or 3) against opponents making game/slam, especially when vul. The usual point of preempting is that you rate to take away opponent's bidding space, as well as pointing the way to partner in making a sacrifice over opponents game/slam bid. Ultimately, like with any other bidding situation, it is a risk vs reward + partnership discipline scenario and if you don't go for a number sometimes, you are not preempting enough.
1
What do you preempt on highly offensive hands?
Verify $_POST script will work correctly
can someone read through this script really quick and verify that I didn't miss anything... I'm not getting any errors in my IDE so just have to make sure the structure is correct <?php require_once '/usr/local/cpanel/3rdparty/lib/php/Mail.php'; $db_server = 'localhost'; $db_user = '-----'; $db_pass = '-----'; $dbc = mysql_connect ($db_server, $db_user, $db_pass); if (!$dbc) { die(mysql_error()); header ('Location: /contact'); exit; } if ($_POST['contactsent'] != 'yes') { header ('Location: /contact'); exit; } else { if (is_array($_POST)) { foreach ($_POST as $key => $value) { $_POST[$key] = mysql_real_escape_string(stripslashes($value)); } } $RequestType = $_POST["RequestType"]; $ConsumerBusiness = $_POST["ConsumerBusiness"]; $GlobalLocation = $_POST["GlobalLocation"]; $FirstName = strtolower(str_replace("'","''",$_POST["FirstName"])); $FirstName = strtoupper(substr($FirstName,0,1)).substr($FirstName,1); $LastName = strtolower(str_replace("'","''",$_POST["LastName"])); $LastName = strtoupper(substr($LastName,0,1)).substr($LastName,1); $Email = strtolower(str_replace("'","''",$_POST["Email"])); $Title = strtolower(str_replace("'","''",$_POST["Title"])); $Title = strtoupper(substr($Title,0,1)).substr($Title,1); $Company = strtolower(str_replace("'","''",$_POST["Company"])); $Company = strtoupper(substr($Company,0,1)).substr($Company,1); $Address = strtolower(str_replace("'","''",$_POST["Address"])); $Address = strtoupper(substr($Address,0,1)).substr($Address,1); $City = strtolower(str_replace("'","''",$_POST["City"])); $City = strtoupper(substr($City,0,1)).substr($City,1); $State = $_POST["State"]; $Zip = $_POST["Zip"]; $Phone = $_POST["Phone"]; $F = $_POST["F"]; $ProductDesc = $_POST["ProductDesc"]; $Comment = $_POST["Comment"]; if ($GlobalLocation == "Canada"): $SendTo="[email protected]"; elseif ($GlobalLocation == "Central America"): $SendTo="[email protected]"; elseif ($GlobalLocation == "Europe"): $SendTo="[email protected]"; elseif ($GlobalLocation == "Mexico"): $SendTo="[email protected]"; else: $SendTo="[email protected]"; endif; function dbSet($fields, $source = array()) { $set=''; if (!source) $source = &$_POST; foreach ($fields as $field) { if (isset($source[$field])) { $set.="`$field`='".mysql_real_escape_string($source[$field])."', "; } } return substr($set, 0, -2); } // INSERT INTO DATABASE mysql_select_db("new_contact",$dbc) or die("Could not select new_contact"); $fields = explode(" ", "RequestType ConsumerBusiness GlobalLocation FirstName LastName Email Title Company Address City State Zip Phone F ProductDesc Comment"); $query = "INSERT INTO new_contact SET ".dbSet($fields, $_POST); mysql_query($query); // SETUP EMAIL $Bodycopy = "This information was submitted via the ------.com website and sent to you because of the location identified by the user. <br>If this has reached you in error, please forward this email to [email protected]"; $Bodycopy. "<br>----------------------------------------------------------------------------------------------<br><br>"; if ($RequestType != "") $Bodycopy. "What kind of information do you need? : " .$RequestType. "<br>"; if ($ConsumerBusiness != "") $Bodycopy. "What type of customer or vendor are you? : " .$ConsumerBusiness. "<br>"; if ($GlobalLocation != "") $Bodycopy. "Global Location : " .$GlobalLocation. "<br>"; if ($Company != "") $Bodycopy. "Company : " .$Company. "<br>"; if ($FirstName != "") $Bodycopy. "First Name : " .$FirstName. "<br>"; if ($LastName != "") $Bodycopy. "Last Name : " .$LastName. "<br>"; if ($Title != "") $Bodycopy. "Title : " .$Title. "<br>"; if ($Email != "") $Bodycopy. "Email : " .$Email. "<br>"; if ($Address != "") $Bodycopy. "Address : " .$Address. "<br>"; if ($City != "") $Bodycopy. "City : " .$City. "<br>"; if ($State != "") $Bodycopy. "State : " .$State. "<br>"; if ($Zip != "") $Bodycopy. "Zip/Postal Code : " .$Zip. "<br>"; if ($Phone != "") $Bodycopy. "Phone : " .$Phone. "<br>"; if ($F != "") $Bodycopy. "F : " .$F. "<br>"; if ($ProductDesc != "") $Bodycopy. "UPC or product description : " .$ProductDesc. "<br>"; $Bodycopy. "<br>----------------------------------------------------------------------------------------------<br><br>"; if ($Comment != "") $Bodycopy. "Comments : <br>" .$Comment. "<br>"; $Bodycopy. "<br><br>"; $Bodycopy. $IP = $_SERVER["remote_addr"]; // PROCESS EMAIL // mail server info... $from = $SendTo; $to = "Do Not Reply <donotreply@------>"; $subject = "Website Contact : " . $GlobalLocation; $body = $Bodycopy; $host = "mail.------"; $port = "25"; $username = "donotreply@-------"; $password = "-------"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'port' => $port, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } // MAKE SURE DB CONN IS CLOSED mysql_close($dbc); // REDIRECT TO THANK YOU PAGE header ('Location: /index.php?option'); exit(); } ?>
I don't know about real quick. What you have doesn't really compliment a quick review. First off this is procedural code, which is fine if you are just getting started, don't let anyone tell you otherwise. But procedural code is not "quickly" read. I will suggest that once you have a firm grasp on the language, you should definitely take a look at OOP, but not before. You may notice me throwing this OOP (Object Oriented Programming) term around a lot. I tell a lot of people that I am against pushing OOP. No, not against OOP, just against pushing it. I won't tell you to stop what you are doing and learn OOP and no one else should either. Far from it. You need a solid understanding of the language first. Whenever I mention OOP I am merely pointing out that doing those suggestions now will prepare you for it and will make more sense as you progress into OOP. So take my OOP talk with a grain of salt, follow the suggestions, but don't go out and learn it just because I mentioned it. Now on to the review. I will read your code and write my thoughts as I have them, so you will be able to follow along in your own code. There is only one spot where I jump, but after that it should all be in order. Review The first problem I have with your code is that it is very redundant and inefficient. When you tell a program to die() or exit or go to a different header(), you are telling it to stop immediately, and, if applicable, process the argument between the parenthesis. Yet you have code after that and it will not process because you've already told it to stop. Rewrite your mysql_connect() like so: $dbc = mysql_connect ($db_server, $db_user, $db_pass) or die(mysql_error()); // OR, if you want the header, remove the "or die" from above and use the following if ( ! $dbc) { header ('Location: /contact'); } You'll notice I did not use the mysql_error() in that second instance. That is because if you load the header it will send you to a different page and you will never see it. If you want to see it on the new page, I would suggest passing it as a GET parameter. Also, careful where you throw out those header()'s. Headers can not be called after information has already been sent to the browser. If possible, I would suggest setting up a function to hold all of the statements that set a new header so that it is all in one place. Checking and Sanitizing POST As mikeythemissile said, you should be checking your globals. And not just that they are set. You should be sanitizing them as well. If you have PHP version >= 5.2, check out filter_input(). NEVER trust user input. Always sanitize, scrub, and blast the hell out of it in any way that you can. It is better to be overly cautious than not at all, especially when dealing with SQL. Google SQL injection, its a real thing and can cause all sorts of problems for you. Why are you checking if POST is an array? Of course it is, it should never not be an array. What you really want to check is if it is being used, which, if it isn't, would have thrown errors before this point. You should always check unreliable variables or arrays (GET, POST, etc...) before using them. So I would start by checking my POST like so. if($_SERVER['REQUEST_METHOD'] == "POST") {//could also use isset($_POST) //here's an example of that filter_input method if(filter_input(INPUT_POST, 'contactsent', FILTER_VALIDATE_BOOLEAN) { header(Location: /contact'); } else { $new_array = array();//don't use the POST array after you have already gotten what you need from it, put it in a new array foreach($_POST as $key => $value) { $new_array[$key] = mysql_real_escape_string(stripslashes($value)); } } } I would not crunch through POST blindly like that either. You've provided an array later in your script, $fields, that should serve as a list of items to check. This is where I jump, by the way. Loop over the $fields array to get the keys to search for in the POST array. First, I would change the way you get your $fields array. explode() is an ingenious way to get an array if the data you are trying to convert is dynamic and comes in that form already. However, you have manually typed these fields, so why bother with the extra processing power required to explode it? Just make it an array. $fields = array( 'RequestType', 'ConsumerBusiness', 'GlobalLocation', 'FirstName', 'LastName', 'Email', 'Title', 'Company', 'Address', 'City', 'State', 'Zip', 'Phone', 'F', //What is this, make you variables clear and understandable all the rest are 'ProductDesc', 'Comment' ); Now that you have this array, you can go back and do so many cool things with it. Such as getting only what you need from the POST array and ignoring everything else. $new_array = array(); foreach($fields as $field) { $new_array[$field] = filter_input(INPUT_POST, $field, FILTER_SANITIZE_STRING | FILTER_SANITIZE_STRIPPED);//another example of filter_input } You can also use that same array to clean up your dbSet() function. $set = ''; foreach($new_array as $field => $value) { $set .= "`$field`='" . mysql_real_escape_string($value) . "', "; } Now, I'm not saying this code is 100%, this is just to give you ideas of how to use your code intelligently. Make your code work for you, don't work for your code. Expand upon this and you will see immediate improvement in your coding. Repetitive Code I really dislike this wall of variables. I would see about getting rid of it if you can. If possible try to make these changes while iterating over them with the $fields array or something. There is no reason for there to be this many copies of the same information. Also, why are you not using ucfirst()? That is obviously what you are trying to do with that strtoupper substring mess. Use the functions provided by PHP. In almost all cases they have a function to do what you want, so search for it before you reinvent it. The documentation is, pardon the repitition, well documented and easily navigable. I also would not convert a string to lowercase if not necessary, such as the email address. $FirstName = strtolower(str_replace("'","''",$_POST["FirstName"]));//Not sure what you are doing here so I left it. $FirstName = ucfirst($FirstName); Don't use repetitive if/else statements, use switch statements instead. They are proven faster and are cleaner, not to mention easily extendable. switch($GlobalLocation) { case 'Canada': $SendTo="[email protected]"; break; case 'Central America': $SendTo="[email protected]"; break; etc... } Functions This function,dbSet(), just came out of no where. Because you are doing procedural code, you should make life easier on yourself and others who might eventually take over your code. Make it as easy to read as possible. The first step to this goal is placing your code logically. If you have custom functions, you should group them all together, preferably at the beginning of your program before you start your procedural code. Since you already know about require/include, I would suggest moving them to another file and requiring/including it at the very beginning. That's one of the first steps towards learning OOP, learning to separate your code, albeit in a not so OOP way, but still important... Also, the dbSet() function is redundant. You already did mysql_real_escape_string() and stripslashes to the POST array in the foreach loop earlier. You will find that you repeat yourself a lot while writing procedural code. The best cure for this is to start breaking your procedural code up into functions. Functions are the first step to learning OOP. Concatenating Variables You are not concatenating your variables properly. To append data to the end of a variable use .=. If you just use the concatenate operator . it will not change the variable, it will only add it to the local memory for that instance. In other words, if you were to echo it directly echo $Bodycopy . 'extrastuff'; you would get the desired results, but since you are doing multiple instances, you will need to append it first $Bodycopy .= 'extrastuff';. So change the way you concatenate all of your $Bodycopy variables to .=. Also, check out heredoc, or nowdoc for long strings such as these. If Statements Even if it is only one line. Please, for the love of god, use braces {}. I know it is not necessary. I know it knocks off 2 bits of file size per statement. I know a lot of people do it. But please, DON'T. It makes reading your code so much harder without those braces and doesn't harm anything to add them. I hate that PHP allows this and really wish they would remove it in future releases. It teaches bad coding habits. More Repetition The first two chunks under //mail server info is redundant. Remove all of those variables and just set them in the $headers array. Then, if you don't want to use the array reference ($headers['To']) you can use extract() to convert all of the array references to variables. Exit See comment, you can ignore this section... Lastly, stop using exit. Every single place you have used it, it is unnecessary. If you find yourself needing to stop your code like this, especially this frequently, you are doing something wrong. Mostly this extends from long procedural script and can be cured by OOP, but, in the mean time, if you just clean up your code and write it a bit more logically, you will notice that they are not necessary.
1
How to get an array from a dbSet() function?
Why doesn't my MacBook recognize the original HD any longer?
I replaced the stock hd with a samsung ssd (840) about 18 months ago. It died last week. I tried putting the original HD back in and the computer won't recognize it. Even when I hold down the option key when booting nothing happens. When I remove the disk and connect it via USB it boots up fine as an external hard drive. Any reason why that would be?
If the original drives does work in an external case but not internally than patrix has the right idea. We know the old drive is good as it works in an external case We know the SSD does not work at all because it doesn't work internally or in the Mac. In both of those cases drives are not working internally, one known bad and one known good. Unfortunately that points to a problem with the MacBook itself. It could be a loose connector (at the drive end or the motherboard end) And by connector I mean data and power, check both, end to end. Look for breaks, bends, crimps (that are not part of cable routing). Look for dirty or obstructed contacts. Blow some canned air into the contacts. Ifixit.com has come really great take apart instructions for just about every recent model of Mac/iPad/iPhone. Follow along with there instructions and pictures and look for differences in what theirs looks like and what yours looks like. Logic dictates that the problem is inside your MacBook. the problem now is finding out where and then how to fix it.
1
Logic dictates that the problem is inside your MacBook
What if I have a voltage between ground neutral?
What does it mean when there is voltage between ground and neutral (220V) and between phase and neutral (220V) but no voltage between phase and ground (0V)? What could happen? Is it safe? Is it normal that when I plug in a lamp, it works just fine?
Actually, it sounds like your phase and neutral are swapped. This is shown by seeing full voltage between neutral and ground but no voltage between phase and ground. If you have non-grounded appliances, such as lamps, you will potentially have lethal voltage on the metal case. I recommend calling an electrician immediately and not using the circuit until it has been checked.
1
If you have non-grounded appliances, you will have lethal voltage on the metal case
Another instructor is pushing me out of the classroom right after my class ends
I am a graduate student in math in my final year, and for several years have been teaching at my department as a lecturer. This semester, in the same lecture hall there is another lecture that starts 20 minutes after my class ends. It's taught by another instructor from my department. I usually have many students coming to office hours and there are also students asking questions immediately after lecture. Due to other activities, I cannot have office hours right after the lecture this semester and can only stay for about 15 minutes to answer questions. Many times in the past I had a similar situation and never had any issues with it. This semester the instructor who is teaching right after often arrives 20-15 minutes before her class starts and tells me immediately that I have to go with my students somewhere else. I make sure to leave the blackboard clean and take all my stuff away from the instructor's desk before she arrives, but I do believe that I have a right to stay in the classroom after my lecture for at least 5-10 minutes. There is no vacant classroom around, and I don't have time to go with students to my office, which is in a different building. Last time the instructor told me in front of my students that I don't understand "simple things" and that I am "playing games". When I was talking to one of my students, she stood very close to us and clearly demonstrated that she wanted us out. I tried to explain her that I couldn't go anywhere else due to my time constraints, but she didn't want to listen to me. I really don't understand what "simple" things she meant and what "games" I am playing. We leave the board clean. She doesn't need to set up a projector. She can still talk to her students before her class starts, if she wants to (even though it seems like her students don't ask her any questions before their class). So, I don't see how I cause any disruption. I had met this woman many times before this semester, but we never talked. I didn't see her talking to other instructors/students much, and she seems to be quite reserved and a bit neurotic. She doesn't want to have any conversation with me regarding the issue. I felt really offended after last class when she said those things to me in front of my students. What would you do in my case? Added later: There are no official rules regarding classroom occupancy between classes. Instructors are supposed to use common sense and be reasonable. For me using 50% of the break time seems reasonable to answer questions after lecture seems reasonable. I agree that for some people it may not. I don't block the entrance to the classroom. A few students from the next class who come earlier always go ahead and take their seats as soon as my students start leaving the room. I also had one of the students from the next class listening to my explanation to one of those after-class questions and asking me further questions before their class (which is the same class as I am teaching, just a different section). Maybe the instructor got jealous, I don't know. The entrance to the classroom is from its front (not back), so I do stay in the front. But it is a big lecture hall, and there is a plenty of space in front of the room (the board itself consists of 8 huge panels). Also, during my career as a grad.student who is also teaching for the department, I have had several observations from experienced professors who are considered to be great teachers at the department and are in charge of undergraduate teaching policy. In my evaluations the fact that there are always several students approaching me with questions after class considered as very positive, meaning that students find me approachable. Thank you everyone for answers.
Last time the instructor told me in front of my students that I don't understand "simple things" and that I am "playing games". This is where she lost her argument. You should have simply totally ignored her. Let her make a formal complaint and only respond to such formal complaints. You don't have the duty to respond to insults, or to look up what the guidelines say in response to insults. If you were violating the small print of some guidelines, then it us her job to point that out.
1
Let her make a formal complaint and only respond to formal complaints
Rotating vector3 by a quaternion
I am attempting to rotate a vector3 by a given quaternion. I know that this is true v' = q * v * (q^-1) I know that q^(-1) is the inverse which just -q/magnitude(q), but how do I map the multiplication of the vector to the quaternion to get back a vector? I have found that you can treat v as a matrix, and convert q, and q' to matrices, and then convert v' from a matrix to a vector, but this seems a little over the top just to get a vector. Is there a cleaner implementation that I could use?
Here is an alternative way to transform a vector by a quaternion. It is the way MS does it in the xna framework. http://pastebin.com/fAFp6NnN
1
How to transform a vector by a quaternion
Energy required to break single bond vs double bond vs triple bond of a carbon atom in an organic molecule
Assuming every other conditions are the same, what would be the comparison of energy required to break single bond, double bond and triple bond of a carbon atom in an organic molecule?
Let it be organic or inorganic compound More the no. of bonds between 2 atoms more the energy required to break it. This is because intermolecular force of attraction increases as the no. of bonds increase. So to break the bonds one needs more energy or so called more bond enthalpy.
1
The no. of bonds between 2 atoms
Android Switch Widget: Setting android:track causes thumb and track to not show up
I am having trouble customizing the look of an Android Switch widget. I have custom xml drawables that I want to use for the thumb (the little button part that usually says On or Off) and the track (the background that the thumb slides across). When I set just the thumb using android:thumb, it works fine. When I set the track (whether or not the thumb is set), the switch disappears entirely and I'm left with only the text showing. Here is my code when just the thumb is applied: <com.blahblahblah.blah.CustomSwitch android:id="@+id/switch_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textOff="Off" android:textOn="On" android:text="Something Awesome" android:textColor="@android:color/black" android:thumb="@drawable/custom_switch_thumb" /> Here is what it looks like in the preview window: And with the track applied: <com.blahblahblah.blah.CustomSwitch android:id="@+id/switch_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textOff="Off" android:textOn="On" android:text="Something Awesome" android:textColor="@android:color/black" android:track="@color/track_color" /> Preview window with track applied: For reference I am using Android Studio 0.2.3 on OSX 10.7.5.
I just stumbled upon the same problem and found a fix through on the HoloEverywhere issue tracker. You'll need to set the <size> of the drawable XML shape you are using. Not working (the widget is there and I can interact with it, but I can't see it, it's hidden): <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/black_50" /> </shape> Working (not the added <size>): <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/black_50" /> <size android:width="56dp" android:height="20dp" /> </shape>
0.666667
<size> of drawable XML shape
SonicWall TZ 200 Network bandwidth or usage monitoring
I was using Pfsense for a while and recently replaced it with SonicWall TZ200. What I miss now is a Bandwidth or usage monitoring like BandwidthD to monitor IP wise traffic. How can I do this through SonicWall TZ200 or some other software? I installed BandwidthD on my local machine. It works perfect, but I doubt that it shows only the traffic from and to my system.
I looked up the specs for the SonicWall TZ200 and it says that it can create Netflow accounting packets. Consequently, any netflow collector. Personally, I've used nTop before and I know it does IP based bandwidth usage , but there are tons of alternatives out there if that doesn't fit your requirements.
1
SonicWall TZ200 can create Netflow accounting packets
Adjustment to road bike brakes for high grade downhill
I have a road bike with a front brake that wears a lot of brake pad when I ride downhill every day. I lose 900ft in elevation on steep grades with lots of stop signs and traffic lights. On top of that, it rains a decent amount and the rim brakes are terrible in that weather. I don't trust them downhill in the rain. Sometimes I just walk. I feather the brakes going downhill, because otherwise I'm too fast to stop quickly for an errant car. It'd be nice to not constantly replace pads, and have powerful stopping. How can I make this constant downhill more pleasant? Thanks.
Have a look at installing Cantilever brakes- larger pads so you can retain the same stopping power and increase life, at the expense of a few grams of weight. Cantilever brakes will also help in the wet due large pad (more surface area). These are the preferred brakes for tandems and tourers - you may have trouble getting decent quality ones these days. As I understand, V brakes are not compatible with road bikes without adapters and are not always as successful as you would think. Discs would be the ultimate wet weather improvement and provide the stopping power you want, but I would caution against hydraulics for such big downhills. They have been known overheat and boil the fluid - you get instant total failure when it happens. Apart form this, you need new forks and wheel (minimum of a hub), and probably new levers, so the cost may be prohibitive.
1
Cantilever brakes for tandems and tourers
Are there any differences in how new vs. well-established professors select students?
For any professors out there, do you feel that there are any differences in how you selected and recruited students from the time when you were newly hired, to a well-established stage (i.e. after getting tenure)? I'm asking this out of curiosity. There are oftentimes questions about whether students should choose a new/old advisor, but I haven't seen any that asked about this from the prof's perspective. I would assume there are since the challenges and priorities for the two groups are normally somewhat different, but I'm not sure exactly how it would differ. For instance, it might be more difficult for the new PI to recruit students (especially good ones) when they have to "compete" with older, better funded peers. This would lead one to think that new PIs might be more likely to take on students they might not necessarily love, but just need bodies in the lab. However, on the other hand, new PIs are more likely to have limited funding, and if they are on the tenure-track, would need their few students to succeed in order to establish a name for themselves in the industry. In this case, it would be detrimental if they chose the wrong student(s) in the beginning, especially if they are limited to the number of students they can afford due to funding issues. I realize that this is field and situation specific, but I'm looking to hear stories/insights from people who have gone through/know about the process. Thanks!
This will indeed be highly dependent on field. For instance, in pure mathematics, there's a rather dramatic difference: most faculty don't take on any graduate students at all until after tenure. The American Mathematical Society has written one of their culture statements about this issue. Generally, (pure) mathematicians have no labs and hence no need for bodies to fill them. And in math, on the time scale of a tenure clock, advising grad students is felt to have a net negative effect on research productivity (in the longer run there can be dividends). So the clear incentive is to wait until after tenure, and departments are usually fine with this.
1
The American Mathematical Society has written a culture statement about this issue .
I am not sure whether to put a comma after "so", which is at the beginning of a sentence
Some people say since "so" is a transitional word, it should have a comma after it like all the transitional words have. And some say if "so" is there for logical continuity, then no comma should be used. The particular sentence I am writing is: Moreover, I have completed my senior secondary studies in English and won 1st place at the regional stage of English Olympiad. So, I am confident that I will be able to complete a degree in English.
Some people say since "so" is a transitional word… There aren't traditional words, there are traditional senses. Compare: Mix all of these ingredients together. Next, add the milk. I love Firefly. Next to Twin Peaks it is my favourite programme. I've deliberately picked a different "transitional word" to hopefully make it easier to see the point if you're perhaps over-thinking so. In the first case here, next is indeed in a transitional sense—it serves to introduce the next sentence while also stating they are in a temporal order—and the comma makes sense. In the second case next is not doing this transitional job, but telling us something about how the topic of discussion (Firefly) relates to another thing (Twin Peaks) in the writer's opinion. We don't want to separate it from the to; what would the now separated "to Twin Peaks it is…" even mean? So, back to so. So's transitional sense is "used after a pause for thought to introduce a new topic, question or story." In this sense you can remove it and not really lose much meaning, though might you lose impact. If you want your sentence to mean "I am confident that …" but with so serving this introductory role, then the comma might be a good idea for that reason. (It might also be a good idea to just cut it, but that's another matter). Another sense of so is "therefore" or "with the result that". If you want so to say that the studies you mention in the previous sentence (along, perhaps, with earlier statements) is the reason why you have this confidence, then the comma is probably a bad idea. I imagine you want the second of these two readings, and I'd therefore recommend that you don't use a comma.
1
"so" is a transitional word .
what size can be the nuts holding the front wheel?
I am trying to install a front wheel in a bike - the axle of the wheel is threaded, but I have trouble finding out what size thread it is, and what nut can go on this. The size of the thread on the axle is the same as of a 8 mm screw, but a standard M8 nut (with 13 mm hex) does not fit on it. Do bikes have some special kind of nut there? If I look at the thread, and at a standard M8 screw, the thread on the bike axle is a bit more dense then on the screw, but I am not aware of existence of two kinds of M8 nuts, so far every M8 nut did fit every M8 screw.
It is a M8 1.0 nut. I found out the hard way because all the hardware store has was a M8 1.25, so I bought it and the threads were way too coarse
1
M8 1.0 nut
How does critical strike chance stack?
I was wondering how critical strike chance stacks? Say I buy a Phanton Dancer with its 30% crit chance. Now if I buy another Phanton Dancer, what is my critical chance?
Crit chance caps out at 100% where your basic attacks are just crits. These are other things that stack additively Ability power Armor, Armor penetration, Armor reduction, Attack damage, Attack speed , Cooldown reduction, Critical strike chance, Critical strike damage, Health, Health regeneration, Life steal, Magic penetration, Magic resistance, Magic resistance reduction, Mana, Mana regeneration, and Spell vamp Source: http://leagueoflegends.wikia.com/wiki/Stacking
0.888889
Crit chance caps out at 100% where your basic attacks are just crits
Why did OCP build Robocop?
It seems like building the Robocop was a really stupid business approach: You can't build them on industrial scale (to put it somewhat insensitively, OCP didn't have a ready supply of highly trained and freshly killed police officers) So, Robocop seemed like a prototype that could never have entered production. Total waste of R&D money. And having a police brain (because he already know police procedure) seems not necessary since at the same time OCP could build fully AI robots (from robot chicken, flawed as it was, in Robocop 1, to Ninja Androids in Robocop 3).
The concept of Robocop is not to substitute human police, it is the idea of a super reinforcement for police departments. Of course they won't be able to enter on an industrial production scale, however, maybe one or two of them could be deployed in almost every big city, that would be a huge business as I can assure you that such a project is not a cheap one, although it's results are out of question. I'm sure every city mayor would like to have one or two of them on their police departments. Also... he's a prototype. The I+D research is a continual loop where you evolve your product, getting better functionalities with each iteration and cutting down construction costs. With time the cyborg integration would probably be applied to live volunteers, in fact I supose that's the real objective, however you cannot risk human volunteer lives in such a project withour previous tests, usually you use rats, or monkeys, but for this project they needed a human-like system to build.
1
Robocop is not to substitute human police, it is the idea of a super reinforcement for police departments
Etiquette for closing your own questions
For all of my questions I have received great answers. I have implemented the answers in code and they work. I now feel compelled to close the questions because I don't believe there are more or better answers out there. Should you close your questions that you feel have been answered sufficiently? Would allowing more people to answer dilute the existing, good answers? Return to FAQ index
I definitely agree with Euro Micelli; closing the question seems very drastic. However I'd say an important thing to maintain is to select an answer as the accepted answer to indicate which solution was most appropriate to you; and to vote up good answers and perhaps vote down bad answers. I've seen many questions where there are several very good answers provided but it seems that the questioner has taken the answer and lost interest. That may well make people think an ideal answer hasn't been determined when it has. I think it's vitally important to show your gratitude for good answers and perhaps scorn for bad so votes act as a more accurate measure of answer quality. Apologies if I have veered slightly off-topic here; however I think this point is related and rather important.
1
Voting up good answers and perhaps voting down bad answers
Are DSLRs a dying breed, making now the time to switch to a mirrorless camera system?
I came across this thought provoking article on Stuck in Customs today that makes a strong case to hold off too much investment in DSLR gear, and instead switch to mirror-less cameras like the Sony NEX. The author prefers to call such cameras 3rd generation cameras to prevent any bias. The crux of the argument lies in the smaller size and faster shooting speeds of the new cameras, while the sensor size is an area where they seem to be lacking (Sony & Samsung cameras are APS-C sized though). Currently the big makers - Nikon & Canon - have practically no presence in this market (Nikon seems to be doing something with the V1). However, they seem to have slowed down the introduction of new entry level DSLR models over the last year as well. So, as DSLR users looking to build and enhance their kit (there are many like me who've jumped the bandwagon over the last couple of years, and are just starting to build their kit), what are the advantages of sticking with the DSLR system rather than switching to the 3rd gen cameras? IMO, one point that could cause a massive switch in the DSLR base would be if Nikon & Canon announced mirror-less models compatible with their current lens lineups, but that is a hypothetical scenario. P.S. There is a similar question on mirror-less cameras, but that seems to be from the perspective of a person starting out rather than a person already invested in the DSLR system.
The advantages of DSLR are going to be usage specific as well as product line specific. It depends on what you are doing with your photographing. It also depends on the state of the market in terms of what products will be available, in the new systems that will eventually replace the current DSLR systems (specifically the mount size, focal plane distance, and sensor size). Premium cameras with a larger focal plane exist because there is an advantage to that which mean photographers want and can work with. Others are not even DSLR and are considered high-end Pro. Look at cameras by Hasselblad, Leica, and Mamiya. You can see both formats larger than "full frame" and lens mounts that don't need to make room for a mirror. They have their advantages, too. I think a new format will eventually emerge that does not exist today. It will be larger than the 4/3rds system because of the advantages of a larger sensor regarding noise. But it might not dominate because digital sensors have fairly well leveled the playing field as phone cameras clearly prove. I hope this new format is just the same 35mm based full frame related sizing, with a closer lens mount which can support an extender adapter to accept "older reflex style" lenses.
0.888889
The advantages of DSLR are going to be usage specific as well as product line specific
Mathematics of Ritardando
Beyond feel & experience, is there a rule conductors use for ritardando in terms of (a) its rate, (b) its change in rate, and/or (c) the relationship between the final tempo and the tempo of the piece? (In getting my software to execute a ritardando, I employed over four measures a measure-by-measure decrease in tempo, and what sounded "right" to me ultimately was decreasing the tempo by 4 bpm, then a further 9, then a further 16 (pleasing pattern) to arrive at 127/156 (close to 3/4) the original tempo.)
"...is there a rule conductors use for ritardando in terms of (a) its rate, (b) its change in rate, and/or (c) the relationship between the final tempo and the tempo of the piece?" Not that I'm aware of. Such a rule would be of little value, because -- unless you're practicing with a drum machine, or other device that permits varying tempo -- there's generally no good way (other than feel) to for conductors or performers to accurately measure their tempo during a performance. They're certainly not likely to be thinking "Now this beat has to be played 10% longer than the previous one, and the following beat has to be 17.4% longer than that..." However, if I had to guess a general shape of a tempo curve in a ritard, they generally seem to be monotonically decreasing (you don't speed up again in the middle of a ritard), and concave downward (i.e., the most ritard'ing comes just before the end of the ritard). But to what degree this is true is up to the conductor or performers to decide. On the other hand, about the most prescriptive that I've usually seen music notation get is poco rit. (just a little bit of ritardando), or molto rit. (much ritardando). And of course, the dashed line that Richard mentions, to indicate the duration of the ritard. That said, I am interested in what the tempo curves of actual performances would look like. I know that approximate tempo maps can be created for real performances, and I'd be surprised if someone, somewhere, hasn't researched what these curves look like.
0.888889
How do conductors measure tempo in a ritard?
Spin matrices in Dirac equation
Why in every textbook when deriving Dirac's equation the smallest possible matrices ($2 \times 2$) are used? I wonder why one couldn't use spin 1 matrices ($3 \times 3$) and get relativistic equation for spin 1 particle?
Particles in the standard model are in principle massless and acquire mass through interactions via the Lagrangian. This poses a problem if you want to use the 3x3 matrix generators of angular momentum because massless particles have different lie group representations as particles with mass. The 3x3 generators for particles of spin 1 acts on three states, -1, 0 +1. In the massless case only two states remain. With fermions and the 2x2 SU(2) matrices this issue doesn't exist. The two chiral components $\psi_L$ and $\psi_R$ propagate lightlike and the two states of each chiral component correspond with spin up and down where the spin is parallel or anti parallel to the direction of propagation. Hans
0.666667
Particles in the standard model are in principle massless and acquire mass through interactions via the Lagrangian
Understanding one-way hash functions construction
I understand the needs that lead to the development of cryptography and I am quite familiar with the uses we make of the cryptographic tools. But, as a programmer, I am conditioned to see them as "black boxes" with specific properties. To me, SHA-X (with X being 1, 2 or 3) is some dark magic, even though I understand why I need it and use it. That said, I am eager to find some literature to light this up. From what I have read so far, I have seen that the common mathematical demonstrations consist of games and the evaluation of the winning advantage of an enlightened attacker over a player that would just randomly take decisions. This is exactly the kind of things I am looking for : what mathematical background lead to this construction for this hash function. Learning through an example can be worthy, but the more global this maths background is, the better. To say it in other words, how does a cryptographer prove the essential properties of his design ? In the case of cryptographic hash functions, these properties are one-wayness, collision resistance and preimage resistances. What are the logical steps, starting from the required properties, that lead to the specification of a hash function ? How are these properties translated into mathematical definitions ? Note : I think I needed to ask that last question because for a cryptographic hash function, I feel there is the need to define some thresholds somewhere.
First, it's important to understand that no one knows how to build a practical hash function that is provably secure. The stuff you've read about games and advantage are part of a theory for proving schemes secure, but that theory doesn't help you build a provably secure hash function all that much. Rather, it starts from the assumption that a particular hash function is secure (or a block cipher or stream cipher is secure), and then builds more complicated stuff out of those basic building blocks. So, that theory doesn't help us design the basic building blocks, like hash functions, in the first place. (Sometimes the theory is used to help guide the design of the structure of a hash function, where designers build a hash function out of a building block like a compression function. The designers might use the theoretical analysis to demonstrate that if the compression function is good, then the hash function will be good -- but it doesn't help you with the question of how to design a good compression function.) For more details on how we know that a hash function is secure, see my answer to a similar question (on the IT Security Stack Exchange site). Generally speaking, to learn how to build a secure hash function, you start by learning about all of the various attacks on hash functions. Then, you try to design a hash function that will resist all of those attacks (as well as all others you can imagine). Therefore, a good starting place for you would be to read about attacks on hash functions. You could start by reading Chapter 9 of the Handbook of Applied Cryptography. Also check out Wikipedia's articles on cryptographic hash functions and the Merkle–Damgård construction. Then, you could read all of the submissions to the NIST hash algorithm competition; most of the submissions should provide a design rationale and security analysis, which should give you a chance to read about some of the attacks on hash functions and design strategies. They should also cite related papers in the research literature, so next you could read papers in the research literature on hash function cryptanalysis -- you might start by reading the papers cited in the Wikipedia links mentioned above, then proceed to reading papers that are cited in submissions to the NIST competition or that you find through others means. For instance, it's worth reading about parallel collision search, multicollision attacks, indifferentiability, and the sponge construction. After several years of study, you'll be well on your way to becoming an expert in hash function cryptanalysis, and then you might be ready to start thinking about designing your own hash function.
0.888889
How to build a provably secure hash function?
Black hole collision and the event horizon
Will the event horizons of a two black holes be perturbed or bent before a collision? What will the shape of the event horizon appear to be immediately after first contact?
Yes, Like del piero says, the gravitational field of each one affects the shape of the other, so it's similar to the "metaballs" used in computer graphics. The exact shape will depend on the geometry, but it usually looks like two fingers reaching out to meet, like in Michelangelo's "The Creation of Adam". You can really see it in the first & last videos here, but there are some good videos of death spirals in between. Note that the pulsing at the end of the first video isn't anything real; it's caused by the change in magnitude of the color scale shown in the bottom right corner. There are also a couple of decent still frames (head on collisions of equally massed holes) on these two pages: 1,2. This one has a shot of asymmetrically massed black holes, just after they join (with the original event horizons drawn underneath):
1
pulsing at the end of the first video isn't anything real; it's caused by the change in magnitude of the
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(&rawtime); timeinfo = gmtime(&rawtime); timeinfo->tm_hour = timeinfo->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 & 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?
Here is a cleaner way of doing this (this example gets GMT time including DST bias): struct STimeZoneFromRegistry { long Bias; long StandardBias; long DaylightBias; SYSTEMTIME StandardDate; SYSTEMTIME DaylightDate; }; static SYSTEMTIME GmtNow() { FILETIME UTC; GetSystemTimeAsFileTime(&UTC); SYSTEMTIME GMT; TIME_ZONE_INFORMATION tz = {0}; STimeZoneFromRegistry binary_data; DWORD size = sizeof(binary_data); HKEY hk = NULL; TCHAR zone_key[] = _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones\\GMT Standard Time"); if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, zone_key, 0, KEY_QUERY_VALUE, &hk) == ERROR_SUCCESS) && (RegQueryValueEx(hk, "TZI", NULL, NULL, (BYTE *) &binary_data, &size) == ERROR_SUCCESS)) { tz.Bias = binary_data.Bias; tz.DaylightBias = binary_data.DaylightBias; tz.DaylightDate = binary_data.DaylightDate; tz.StandardBias = binary_data.StandardBias; tz.StandardDate = binary_data.StandardDate; } SystemTimeToTzSpecificLocalTime(&tz, &UTC, &GMT); return GMT; }
1
struct SYSTEMTIME GmtNow()
Get Product Options for each Product in the Catalog
I am trying to build a script that outputs all the product options for each product in the catalog into a CSV file. I have tried using the code on this page: http://www.atwix.com/magento/configurable-product-attributes/ For this code: $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'color'); foreach ($attribute->getSource()->getAllOptions(true) as $option) { echo $option['value'] . ' ' . $option['label'] . "\n"; } I get no output, what-so-ever. For this code: $productAttributeOptions = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product); $attributeOptions = array(); foreach ($productAttributeOptions as $productAttribute) { foreach ($productAttribute['values'] as $attribute) { $attributeOptions[$productAttribute['label']][$attribute['value_index']] = $attribute['store_label']; } } I get this error: Fatal error: Call to undefined method Mage_Catalog_Model_Product_Type_Simple::getConfigurableAttributesAsArray() in /home/tws2/public_html/getopts.php on line 71 Ive been unable to find anything else on the internet for getting at the product options of a product with PHP code. Can someone please explain to me how to use PHP to get at all the product options data for each product in the catalog, so I can output all this data into a CSV file. The purpose of this is to transfer the product options data over to an identical Magento server that has the same catalog, just missing the product options data. Once I have all the CSV file of product options I was going to make another script to write them into the identical Magento server. This is how Ive been advised to do this task in-house, if you have a better suggestion please let me know.
No answer but another option. Use Avs_FastSimpleImport to update product data with the attribute values. In the FastSimpleImport settings you can define missing options should be created Check out the module here
1
Avs_FastSimpleImport to update product data with attribute values
Diff between backups: see permissions, group and owner and sym link differences
Question Using only the command line, is it possible to tell if a rsync backup (on a NAS) and the original folder tree (on a web server) are exactly the same? I mean in terms of file sizes, attributes, and symbolic links? I feat the most for symbolic links. In case of a hard-drive failure – let's say I can solve all the booting issues – will I be able to put back all the files with all the symbolic links done right and their permissions / attributes? Context I am setting up an rsync backup system in which my NAS (arm processor) connects to my dedicated webserver hosted far far away and does a backup of the / partition. In case of a disk crash, I plan on making the exact same partition setup on the new disk, on installing the same operating system (14.04) so I get the MBR / boot loader in place. Then I will rsync back the backup from the NAS to the server, reboot and cross my fingers. The issue is that I will only know if everything works the day I need the backup…. But I can take measures to know if it will work before. One of them is checking that every single file, folder, sym link… in the backup has the same permissions, attributes, whatever than the original. I also need to check that the sym links and similar are correctly done. The options I use with rsync are : rsync -rlptgoDXvxzH --numeric-ids --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} The option A is causing issues. EDIT: ADDITIONAL INFO What I am looking for is a working backup strategy that will allow me: – to perform blazing fast backups. Because I do backup the / system partition, I take most services down on the server (apache, postfix, dovecot, mysql, etc.) so I can have a safe backup. Any solution such as rsync is good, because I can update a mirror directory on the NAS. Then, offline, I can take care of the backup strategy (incremental, etc…) from the updated mirror. – to have fast restore (I don't want to transfer a 100 GB disk image). I have a really really fast connection between the NAS and the server. I mean really fast. Transferring a 10 GB disk image is a matter of minutes. What I can't do: change the physical setup of the hosted server. I have one 500 GB disk. That's all. What I can do: boot the server in a rescue mode in which the disk isn't mounted at all. Rescue mode even works with a dead disk. I use this mode to perform binary images of partitions. Current setup: / 10 GB, 17 % full SWAP 512 Mo /var 80 GB /bkup the rest… to 500 GB.
What you're really asking is: What is a good Backup Strategy for my server and that depends what you want to do when the lightning hits your server... For me, speedy restore is what I want, so what I do is: I have one additional small, old, cheap disk containing 2 additional partitions on the server: a 500GB ext4 partition containing the system back-ups and a 500MB FAT32 boot, diag partition (yep, MegaByte, and it's a bit too big!) containing CloneZilla. Whenever I'm going to do some drastic changes to the server or whenever I feel I can afford a 5 minute down-time, I boot the server into the FAT32 CloneZilla partition, which then backs up my root partition excluding "/home" in 5 minutes! (using disk-to-image) I've had to restore the image only once and it works like a charm: server was set back 1 month (as I wasn't sure when I introduced the problem), installed all its updates and then I had to redo my work from the last month which was basically installing a few utilities. In addition to that, I rsync my /home and the system image backup partition weekly at Monday 03:00 am (which is when the server has its lowest usage). If that's good enough for you, use the same strategy.
0.833333
What is a good Backup Strategy for my server?
How to merge unversioned code into Git repository?
So a friend worked on a bunch of code that he never versioned, and is handing it off to me. He initially gave me version A, even though he had a more recent version B available. I put A into a git repository (on say Team Foundation Service), and then made some commits, resulting in version C. Now he has put up version B in a git repository (on say Bitbucket). How can I compare versions C and B, and merge all diffs between (B,A) and (C,A) to get one final version D which has both his updates and mine? Keep in mind, the repos on Bitbucket and TFS (versions B and C respectively) have no common git commits, although they both come off the same base version A. I can see a couple of ways of doing this, not sure of the cons of each though: 1) Add Bitbucket version B as an upstream to my TFS version C, and fetch upstream/master, then do a git diff. 2) Copy the files from version B into the directory that holds version C, and then commit them as if I changed the files manually. 3) Something else entirely, like rebase. My understanding of git is very basic so please explain like I'm 5 (well, not really, but you know what I mean). Note: It is ok to have all changes made from A to B in one commit in the final repo history, but would be nice to preserve the individual commits between A and C. Also, from version A to version B, the friend has not maintained directory structure, he has moved all the contents to a sub-directory of the root. So if version A had file a.txt, version B has file TRUNK/a.txt.
Simply: checkout A make a new branch from A (from "Git version control and Team Foundation Build") copy B in it add and commit: (from "Create, Connect, and Publish using Visual Studio with Git") merge that branch in your main branch which represents C resolve conflicts:
1
Create a new branch from A copy B in it add and commit
Enabling aggregate and compress CSS files caused error on site access
I set this tick box in the performance area, and on clicking Save I now cannot access the site, even the performance area to disable this! any one know if I can directly change this in the DatabasE? EDIT: I have refreshed the Database, thankfully no updates since it went live. This does raise the question though as I'm not the only one who has had problems with these performance tick boxes, how do you back out of an error? I would still like the answer cause i'm trying to get to the bottom of these performance settings. thanks for any replies.
I believe this setting is stored in the variable table as preprocess_css UPDATE variable SET value = 'i:0;' WHERE name = 'preprocess_css' and then clearing cache should do the trick. I am also pretty certain just deleting that row should do the same thing, as the default value is 0, and variables not in the table take on their default value via variable_get(). I should add, that if you can't clear the caches from the site itself, nor via drush, you can go in any manually clear out these tables.
0.888889
Clearing cache should do the trick if you can't clear caches from the site itself
Why isn't my if/elseif/else working correctly here?
I am using a simple if/elseif/else bit of code to generate a header image for my page, I can't seem to understand why it isn't working properly. It determines the category of the page being displayed and displays a header accordingly. Here's the code in my header.php: <?php if (is_category('dino run') || has_category('dino run')) { ?> <a href="dino-run/"><li><div class="logo splash2">Dino Run</div></li></a> <?php } elseif (is_category('potatoman') || has_category('potatoman')) { ?> <a href="http://www.pixeljam.com/potatoman/"><div class="logo splash4">Potatoman Seeks the Troof</div></a> <?php } elseif (is_category('glorkian' || 'glork') || has_category('glorkian' || 'glork')) { ?> <a href="glorkian"><div class="logo splash3">Glorkian Warrior</div></a> <?php } else { ?> <a href="#"><div class="logo splash1">The Pixeljam Octology</div></a> <?php } ?> The problem I'm having is I click on a post that has a category "Dino Run" and it displays fine... but when I click on a post that doesn't have any of the above 3 defined categories it doesn't fall through to the else statement, it actually displays the third header "Glorkian Warrior". Any ideas what I did wrong here?
I would use: in_category('cat-slug') ) { if you want to display the image on all posts in the category. Here's a working example i wrote and tested. This returns true on both the category archive page and all posts in the category if(is_home()) echo '<div class="home-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>'; elseif(in_category('category-1') ) echo '<div class="category-one-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>'; elseif(in_category('category-2') ) echo '<div class="category-two-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>'; elseif(in_category('category-3') ) echo '<div class="category-three-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>'; elseif(in_category('category-4') ) echo '<div class="category-four-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>'; } Related info Another option would be to use the code from the Twenty Eleven themes header.php file which enables you to use the built in Add Featured Image meta box to display unique headers on different posts and pages without adding any code. Or you could easily add conditionals and else if statements to that code which is a more efficient solution.
0.666667
In_category ('cat-slug')
Ideal location to practice soldering
Sounds like a stupid question, but really hasn't been asked before, or I haven't found a post about it. Either way, here it is: I bought a soldering iron recently and am looking for a place in my house to do my soldering. Of course the first thing in my mind would be to solder in the basement or garage and as close to a window/outdoors with good circulation, however I plan on working with arduino boards and would like to everything in my upstairs "computer room" near my gadgets. Do you think opening up my window in my room and having a fan suck out the fumes aimed at the window would be suffice to be safe, or should I stick with the basement/garage idea. Let me know on your thoughts.
Good circulation and a fume extractor/absorber. I use one of these guys: http://www.amazon.com/Weller-WSA350-Bench-Smoke-Absorber/dp/B000EM74SK/ref=pd_sim_sbs_hi_1 There are also smaller ones available that can be put right above the work area to absorb more: http://www.amazon.com/dp/B00012YSDW/ Carbon activated filter takes a lot of the fumes and chemicals out of the air. Also helps to turn on a ceiling fan, or your HVACs fan and get good air moving around.
1
Carbon activated filter takes a lot of fumes out of the air
How can I span wallpapers over two monitors in Mac OS X?
Is there any way to get a single wide desktop wallpaper to span a dual monitor setup in OS X?
Without splitting the image by hand into two halves (one for each monitor)? Not currently.
1
Without splitting the image by hand into two halves?
1/4 to 1/8 jack problem
I was planning to record months ago, with my electric guitar, and yesterday I got myself a guitar rig software and bought some 1/4 to 1/8 adapter jack so that I can plug in unto my laptop's mic hole. Whenever I plug my guitar cable to the 1/4 to 1/8 adapter then to the laptop I can't hear any sound (past the clicking sound you hear) but when I plug the cable almost halfway of the adapter's body (before the clicking sound) I can hear sound when I play and there's some loud buzzing sound involved. Any explanations as to why this is happening?
If you want to record better sounding guitar tracks, getting an audio interface is the way to go, as others have mentioned. You also want to think about shielding, interference, and turning off electrically noisy overhead lights. However, to say "You can't just use an adapter to plug your guitar directly into your laptop" isn't true. I do this without a problem on my computers, its just not going to give you ideal signal levels. The problem you might be seeing is that there is a mono-stereo mismatch between your mono guitar cable, your 1/4 to 1/8 inch adapter, and your input on the laptop. I have both mono and stereo 1/4 to 1/8 adapters and laptops with both mono and stereo input jacks. Depending on my configuration, the input signal is reduced by half because of the way I've hooked it up, i.e. the incorrect conversion of a mono signal results in half of it being lost. At least, this is the issue that comes to mind when I read your sentence, "when I plug the cable almost halfway of the adapter's body ... I can hear sound when I play and there's some loud buzzing sound involved." There are likely multiple issues at play here.
1
Mono-stereo mismatch between mono guitar cable, 1/4 to 1/8 inch adapter, and input on laptop
What are the advantages/disadvantages of the Rock Band 3 Keyboard?
Vs. a normal midi keyboard and the Midi Pro adapter? In particular, The RB3 Keyboard is not a full-sized keyboard. If we do use a full-sized midi keyboard in Pro mode, can we/do we have to use the entire keyboard, as it's played in the actual song, or can we/do we have to stick to two octaves (like the RB3 Keyboard)? The RB3 Keyboard can also function as a five-button peripheral in non-Pro mode. Can we do the same with a normal midi keyboard? I've read that the RB3 keyboard has velocity-sensitive keys. Does RB3 take this into effect? Will I lose some functionality if my midi keyboard isn't velocity-sensitive? Does the expressions bar also add functionality?
Note: this is from what I've picked up in ready dozens of reviews! All songs are designed to just be played with the right hand, however in Pro Mode, songs on Hard and Expert difficulty require you to use both octaves. This means that there's no use for you to have a full sized keyboard, as it would leave most of it unused. Pure speculation: If you can use a midi controller instead of the keyboard, you should be able to map certain keys to the five buttons. The velocity-sensitivity is probably intended to counter the fact that they're using very 'cheap' keys, which lack the natural resistance of a decent keyboard. My guess would be that you won't notice any difference in game. The lack of the expression bar is only a loss if you like using the whammy bar when playing it as a keytar, although you will lose the ability to gain extra Overdrive like you can with the whammy bar on a guitar. For the rest I don't really see a use case for it anyway.
1
How to map certain keys to the five buttons?
God the Father's possession of a body of flesh and bones
There is a belief out there that God the Father has always possessed a body of flesh and bones. Some of the proponents of this belief don't find it contradictory to John 4:24 ("God is a Spirit") as the verse may be referring only to one part of God without limiting God to being only that one part - just like, for example, in 1 Pet 3:20 ("eight souls were saved by water") Peter called some humans "souls", but he didn't mean by that that they didn't posses bodies. The example of Jesus after His resurrection, Who, while possessing a body of flesh and bones, still retains all the qualities that are usually ascribed only to God, for example, His omnipresence, could go along with this belief. I wonder if Biblical hermeneutics, namely the hermeneutics of the Old Testament, allows for this belief. If not, please, point out those places that speak against the validity of this belief.
Your question is worded a little tricky, but I think you're saying: John 4:24 says that God is a spirit, and you are saying that Mormons respond by saying that it only refers to one part of God (one part is the spirit and the other part is the body), since Mormons believe God has a body. Then you cite 1 Peter as an example. Not to throw your example a little bit, but Mormons believe that 15 ... the spirit and the body are the soul of man.(Doctrine and Covenants 88:15) So, to answer your question: How do / Do Mormons reconcile God the Father's omnipresence with his corporeal / fleshy form? Yes, Mormon doctrine does reconcile it, and it's quite simple: The body houses the spirit. God has a perfect, immortal, and glorified body which houses His spirit. God is not, as an actual being, omnipresent. For example, Jesus couldn't visit the Nephites and other of God's children at the same time: 1 And verily, verily, I say unto you that I have aother sheep, which are not of this land, neither of the land of Jerusalem, neither in any parts of that land round about whither I have been to minister. 2 For they of whom I speak are they who have not as yet heard my voice; neither have I at any time manifested myself unto them. 3 But I have received a commandment of the Father that I shall go unto them, and that they shall hear my voice, and shall be numbered among my sheep, that there may be one fold and one shepherd; therefore I go to show myself unto them. 4 And I command you that ye shall write these sayings after I am gone ... Since the Holy Ghost is both a spirit (no body) and also a god, His influence can be felt anywhere at once. The Holy Ghost is a separate, distinct being from God Himself, but is nonetheless a member of the godhead. In this sense, perhaps, God is "omnipresent."
0.888889
How do Mormons reconcile God's omnipresence with his corporeal / fleshy form?
Similar phrases meaning 'give kudos'
See, in one of our employee evaluation systems, we would like to implement a feature by which any employee can show appreciation to another employee that he has got help from or whom he thinks to be a good performer, mentor etc., and it has to be done every month. So, to give a name to this action, one of the suggestions was the phrase 'give kudos', but we expect to have a better one with a similar meaning. Something interesting!! Update: It is not mandatory that we should use the word 'give' or 'kudos'! when we rephrase it. Can anyone help me on this?
Praise Merriam-Webster: say or write good things about (someone or something): A good teacher praises students when they do well. Macmillan: express strong approval or admiration for someone or something, especially in public: Mayor Dixon praised the efforts of those involved in the rescue.
1
Praise Merriam-Webster: say or write good things about (someone or something)
Can i customize add/edit page for list in sharepoint?
Hi SharePoint Experts, Can use my custom page to add/Edit item from sharepoint list? if yes how? Do i need to do any config changes?
Sure you can! Check Create a custom list article form from Microsoft site. You will use SharePoint Designer 2007 for all the customizations. It also allows you to convert every form to HTML/XSLT and to customize it even further.
0.777778
Create a custom list article form from Microsoft site
Word for someone who finds oil reservoirs
This question may be way too specific, but what is the word for someone who surveys land in search for Oil (for petroleum). I think it might be a scientific word, like one that ends with -ist (like biologist)
Petroleum geologist. A petroleum geologist is a earth scientist who works in the field of petroleum geology, which involves all aspects of oil discovery and production. Petroleum geologists are usually linked to the actual discovery of oil and the identification of possible oil deposits or leads. [Wikipedia] Petrogeologist is used also but it is less common.
0.888889
Petroleum geologist is a earth scientist who works in the field of petroleum geology
1999 Ford pickup starter whining
1999 Ford F150 2wd 6 cylinder - What would cause the starter to make a whining sound when you start the truck and will not quit whining and gets very hot on the starter? The Bendix will not disengage.
From what I remember 1999 F150's use a starter relay/solenoid that is mounted on the firewall or inner fender. If you follow the positive battery cable it should connect to this relay. If the starter spins as soon as the battery cables are connected to the battery then the relay has welded its self in the closed position and is defective. (This does occur but not frequently, they usually fail in the open position) If the problem occurs after the ignition is switched to the "start" position, you need to determine if the ignition switch is still sending the start signal to the solenoid while it is in the "run" position. On the solenoid/relay you will notice two large wires and a small wire. By removing the small wire you will interrupt start signal. If this makes the starter disengage the ignition switch is defective. (Again this doesn't happen often but can occur) If the starter still spins with the small wire removed then as @Paulster has stated the Bendix return spring is not retracting the drive gear and the starter is defective. This the most common reason but the other scenarios have to be eliminated before you ruin the new starter.
0.888889
If starter spins as soon as the battery cables are connected to the battery then the relay has welded its self in the closed position
Linearity of push forward $F_*$
How can I prove the linearity of $F_*$? What does $F_*$ eat? If $N$ is smooth manifolds and $F: M \to N$ is a smooth map, for each $p \in M$ we define a map $F_*: T_pM \to T_{F(p)}N$, called the push-forward associated with $F$, by $$(F_*X)(f) = X(f \circ F).$$
It often times just helps to write out exactly what the formula you are trying to get in the end looks like, and then interpreting that. For example, you are trying to show that $F_\ast(\alpha X)=\alpha F_\ast(X)$. So, what does the left-hand side do to elements of $T_{F(p)}N$? Well, as you pointed out $F_\ast(\alpha X)(f)=(\alpha X)(f\circ F)$ what does the right-hand side look like? $(\alpha F_\ast(X))(f)=\alpha F_\ast(X)(f)=\alpha X(f\circ F)$ Make sense? EDIT(to answer Jellybean's questions in the comment): I am not entirely sure what you mean here. The tangent space of $M$ at $p$ is thought of, or at least the book you're reading thinks of it, as the $\mathbb{R}$-derivations of germs of smooth functions $\mathcal{G}_{M,p}$ at $p$. A smooth map $F:M\to N$ allows one to take a derivation $X$ of $\mathcal{G}_{M,p}$ and "push it forward" to a derivation of $\mathcal{G}_{N,F(p)}$. The way it does this is basically the observation that if you start with an element of $\mathcal{G}_{N,F(p)}$, germs of smooth functions on $N$ at $F(p)$, there is a way to pull this back to an element of $\mathcal{G}_{M,p}$. Namely, if $f\in\mathcal{G}_{N,F(p)}$ then $f\circ F\in\mathcal{G}_{M,p}$. Thus, if you start with a derivation $X$ of $\mathcal{G}_{M,p}$ you want to use this to produce a derivation of $\mathcal{G}_{N,F(p)}$. But, a derivation of $\mathcal{G}_{N,F(p)}$ eats in, well, obviously, elements of $\mathcal{G}_{N,F(p)}$. Thus, $X$ itself doesn't act on $\mathcal{G}_{N,F(p)}$. But, we observed above that we have a method of taking an element of $\mathcal{G}_{N,F(p)}$ and pulling it back to an element of $\mathcal{G}_{M,p}$, which is the set of things that $X$ does eat. So, to create a derivation of $\mathcal{G}_{N,F(p)}$, which let's call $F_\ast(X)$, of $\mathcal{G}_{N,F(p)}$ we merely take an element of $\mathcal{G}_{N,F(p)}$, pull it back to $\mathcal{G}_{M,p}$ by the rule $f\mapsto f\circ F$, and now that we're back on $X$'s diningroom table we feed it to $X$ to get a real number out. Thus, the derivation $F_\ast(X)$ all put together acts as $f\mapsto f\circ F\mapsto X(f\circ F)$. You can check that this definition of $F_\ast(X)$ does, in fact, produce a a derivation of $\mathcal{G}_{N,F(p)}$. Thus, the association $X\mapsto F_\ast(X)$ produces a map $F_\ast:T_p M\to T_{F(p)}N$. This map, the map $F_\ast$, is the pushforward. It is a linear map between tangent spaces. I hope that helps.
0.555556
What does the left-hand side do to elements of $T_F(p)N$?
Maximal ideals of commutative unital C* algebra using Gelfand-Naimark theorem
Let $\mathcal{A}$ be a unital, commutative C*-algebra. The radical of $\mathcal{A}$ is defined as $$\operatorname{Rad}(\mathcal{A}) = \bigcap \{\mathcal{I}\subset \mathcal{A}: \mathcal{I} \text{ is a maximal ideal}\}$$ How can one characterize $\operatorname{Rad}(\mathcal{A})$ using the Gelfand-Naimark theorem only, i.e. without referring to more evolved methods such as representation theory? EDIT: (Gelfand-Naimark theorem) Let $\mathcal{A}$ be a unital commutative C*-algebra. Then the Gelfand transform $\Gamma: \mathcal{A} \rightarrow C(M(\mathcal{A})), \Gamma(A)(m):=m(A)$ is a *-isomorphism.
Hint: For any space $X$ and any $x\in X$, the set of functions vanishing at $x$ is a maximal ideal in $C(X)$.
0.555556
Maximum ideal for space $X$ and any $xin X$