body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
I am new to python. It might seem little obvious but would like to know if there is any easier way in python to do this. I am trying to count number entries to a function. Requirement is as below: Every 5 sec a timer event is triggered through which callback (ev_5ms()) is inturn triggered Wait until 20 secods and then clear the counter and start again I am using the following code counter = 0 "Callback" def ev_5s(): if counter < 4: counter += 1 else counter = 0 print('Send Message') t = EventGenerator.TimerEventGenerator(1, ev_1s()) t.start() Error Traceback: Traceback (most recent call last): File "C:/Users/i8479/Desktop/Python/HPP_SM.py", line 28, in <module> t = EventGenerator.TimerEventGenerator(1, ev_1s()) File "C:/Users/i8479/Desktop/Python/HPP_SM.py", line 21, in ev_1s if counter < 4: UnboundLocalError: local variable 'counter' referenced before assignment I am coding as I would do in c or cpp. How can I do this in python?
What is the idiomatic Python equivalent of this C/C++ code? void foo() { static int counter = 0; counter++; printf("counter is %d\n", counter); } specifically, how does one implement the static member at the function level, as opposed to the class level? And does placing the function into a class change anything?
I just got an upvote on a question here on meta to push my daily total reputation to +15. This is shown correctly on the reputation tab on my profile page… …as well as the reputation list… However, the achievements dropdown does not show this, preserving the +10 that I received (before the recent scheduled read-only time—possible cause?). It's also not showing the green +[rep] badge on the button. Also, I've got 66 reputation today on Ask Different, but it still shows 70 in the achievements dropdown, shown above. The actual list of reputation received/lost in the achievements dropdown has not updated either.
This was asked before too. . Currently I am facing the issue of appearance of reputation notification in above toolbar. I can see the reputation notification, for every page refresh even after clicking and viewing the notification. current browser: Chrome Version 36.0.1985.143 m
So one day I opened my MacBook Pro, only to find that none of the keys were registering. A few seconds later, it gave me a popup that there was no bluetooth keyboard detected. My trackpad was also not registering. The only button that seemed to be working was the power button. When I pressed the power button, it brought up the usual popup dialog about whether I wanted to sleep, restart, or shut down. I had no way to click on any of the options, so I just held down the power button to force shut down. (Opening and closing the laptop didn't do anything). When the computer booted back up, everything was working fine. I used my computer like normal, until a few days later, it happened again. o I did the same thing. This was maybe 5 days ago. And today, it happened again. So it's not happening every time I use my computer, not even close, but it's still annoying, and I'd rather it didn't happen. I didn't do anything to my keyboard before this happened, so I have no idea what could be causing it. Anyone have any ideas? EDIT: This question is not a duplicate of the linked question because in that question, the asker is having issues with specific buttons being stuck down. This seems like a physical issue with the hardware. In my issue, my computer is not registering my keyboard, and it telling me there is no keyboard attached. I haven't spilled anything on my keyboard or done anything else to it, so it seems like a software issue. I would share screenshots, but when this happens, I have no way to take screenshots.
This is an attempt to write a canonical QA for this issue, as per the Meta post: I expect it to be periodically edited with the goal of becoming a comprehensive information resource. I have a MacBook Pro that has a key(Shift, Return, Command, P, etc.) that doesn’t respond when pressed or is stuck in the down position. It's possible that my favorite beverage was spilled (or some other liquid damage). It's also possible that I have no idea what happened. It was working yesterday and suddenly today it's no longer working. Is there any way to bypass or remap the key? Can I have the system ignore it completely? (This question can also apply to external USB keyboards or the Bluetooth keyboards)
I'm on italian keyboard, accessing ` and ~ is so frustrating (I have to enter alt 96 and alt 126), but I have also a useless § key (shift + ù). What I'd like to do is to "add a layer" to \ key so pressing altgr + \ will produce ~ and altgr + ' will make ` Another nice thing to add is support for "dead key", what I'd like is to have single pressure to behaving as usual and (altgr + shift) + pressure let it behave as dead key. So to put e' I just enter e + ', to enter é I enter altgr + shift + ' then e. Can someone please suggest me a solution? NOTE: switching to IT-104 is not an option as it remaps ~ to ] so I'll gain the gliphs but at cost of losing another that was well memorized.
Here is what the layout of an Italian keyboard looks like: As you can see, the curly braces, which are absolutely necessary to write code in any of C, C++, JavaScript, Java, Objective-C, and others, appear in purple in this picture. This is because while the other characters can be seen visually as printed characters on most Italian keyboards, these purple characters are actually usually not printed on the keyboard's keys. These characters, found in the upper right corners of the given keys, can usually be generated with the following key combinations: (RIGHT SHIFT or LEFT SHIFT) + (RIGHT CTRL or LEFT CTRL) + (Alt or AltGR) + ([ or ]) (Actually as the MSKLC application shows, SHIFT + AltGr + [ and SHIFT + AltGr + ] are enough to generate the curly braces.) Characters such as the at (@) sign (called 'chiocciola' in Italian) and the hash (#) key (called 'cancelletto' in Italian) found in the lower right hand corner of the keyboard can be generated easily as follows (AltGr + @) or (AltGr + #). Such characters are also fundamental to programming as they can, for instance, be found in CSS, namely with media queries and with selectors referring to the id html attribute. Upon further inspection, we can see that all of the US ASCII keyboard / programmer's keyboard are covered by the keys of the Italian keyboard, except for the following, which are the tilde, which is especially useful on the Linux command line and is used to refer to a user's home directory on such system, as well as the back-tick (`), also known as the back-quote, which is also very useful on the Linux shell when we want to turn the output of a command into a command-line input. So, here comes the question: With all those empty upper-right hand corners of keys, why isn't there a better way of generating these characters, perhaps through a CTRL-ALT-SHIFT modifier key combination? All I've been able to find regarding generation of these characters are the following ALT-codes: ALT code 96 corresponds to ` ALT code 123 corresponds to { ALT code 125 corresponds to } ALT code 126 corresponds to ~ and to generate a character via an ALT code, you make sure that the NumLock key on your keypad is toggled on, hold down the ALT key, enter the keycode, and release the ALT key. ALT code are documented at: If someone knows of a better way of inserting these characters from an Italian keyboard without switching the keyboard layout in the Control Panel, then please let me know. Thanks.
I've attached some and here. It shows the window as soon as I boot up. There also appears a (-) red minus sign which tells me that a problem occured while checking updates, and when I click "Show updates" it tells me that the Software Updater has crashed unexpectedly. I am unable to update it (I wish to upgrade to 16.04 LTS), nor solve the problem. Any solutions?
This red icon.... It showed up after I upgraded to Ubuntu 12.04LTS; I can't figure out how to ditch it. It seems to be a notification thing. I am at a loss. The icon is this one: I clicked it and read this: An error occurred, please run Package Manager from the right-click menu or apt-get in a terminal to see what is wrong. The error message was: 'Error: BrokenCount>0'. This usually means that your installed packages have unmet dependencies.
If $H$ is a ring and it has a finite non-zero characteristic $p$ then ring is finite. I couldn’t any counter example for this claim. Can anyone help me please?
For curiosity: can a ring of positive characteristic ever have infinite number of distinct elements? (For example, in $\mathbb{Z}/7\mathbb{Z}$, there are really only seven elements.) We know that any field/ring of characterisitc zero must have infinite elements, but I am not sure what happens above.
Can an Android phone make phone calls in order to send fax? I mean, is it technically possible with Android? Without using 3rd party servers.
Is there a way to send or receive faxes directly to/from the phone without routing through a web-based service? There are times when I've needed to send or receive a document image without going through e-mail or a third-party service. It may be a recipient without an e-mail option for a document I need to submit (e.g., a particular government agency) or it may contain sensitive information that I do not want going through other hands. When I checked the app store, everything I found seemed to involve a web-based service (I could've missed one, though). With a device that can take images and make phone calls, it seems like a natural extension of the capabilities to be able to communicate with a fax machine directly.
from datetime import datetime datetime(2018,01,01,10,08,00) The above code produces an error >>> datetime(2018,01,01,10,08,0) SyntaxError: invalid token If i change 08 to any value between 01 and 07 then the error will not show and also the error will unshown if i change 08 to 8. What is the reason behind it?
Some of you may recognize this as Project Euler's problem number 11. The one with the grid. I'm trying to replicate the grid in a large multidimensional array, But it's giving me a syntax error and i'm not sure why grid = [ [ 08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91, 08 ], [ 49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 04, 56, 62, 00 ], [ 81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 03, 49, 13, 36, 65 ], ... And I get this error: File "D:\development\Python\ProjectEuler\p11.py", line 3 [ 08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91 , 08 ], ^ SyntaxError: invalid token Why is it throwing an error before the comma?
In the final episode of Game of Thrones, a pivoting moment resides in A gathering where all greatest remaining Lords & Ladies of Westeros are presented Tyrion and Jon Snow by Grey Worm, in order for them to be judged. I don't understand how the Council made up by the remaining Lords & Ladies was so merciful with Tyrion and so harsh for Jon Snow. First, it seems that Grey Worm and the Unsullied (which for some reason have not executed the two prisoners the moment they found out they successfully conspired to kill their queen, and waited for a trial gathering Lords of the kingdom to be assembled) hold a lot of authority on the prospects of the prisoners, and almost hold as hostages the Lords & Ladies. However, as the scene unfolds, it seems they decide to fall in with the Council's authority on its own lands. As such, they accept to see Tyrion go from allegedly sentenced to death for treason to choosing the future of Westeros and becoming the Hand of the new king, as it's what the new king and the rest of the Council wants. However, Jon Snow is most severely punished by a life-long exile in the Night's Watch (taking the black being often represented in the series as an ultimate choice with death). But most of the Lords & Ladies at the table are in fact on Jon's side, or, if not exactly, are at least expected to have been horrified by Daenerys's slaughter and wishful for her cruel reign to end. In fact, we're very much in the same situation as with the Mad King prior to Robert's Rebellion. When Jaime Lannister killed this king, judged by most as a tyrant, he was pardoned by the new king and remained a King's Guard knight. At the gathering, except for Grey Worm which seems to respect the Council's decisions, only Yara Greyjoy seems to be unhappy about Daenarys's death. Though, her opinion is of light importance as, as opposed to a lot of others present in the Council and particularly Jon's allies, she has played a very little role in the Long Night and the attack against Cersei. How come Jon was punished for killing a queen almost everybody judged as a tyran deserving to die, and not honoured for having accomplished the only move leading to potential peace in Westeros? All the more so when the two persons that can truly decide his fate – the King and his Hand – are his brother and the man that convinced him to kill the queen to save the Realm? Finally, as discussed in comments for this , Jon is at this moment the true heir to the throne, and an important part of the Council is aware of it. In fact, the plot insists heavily on that Daenerys decided to reign by fear because she was afraid that the people of Westeros would turn to Jon, who they like better and who has a better claim to the throne. But when she is ruled out, this much advertised turn of events strangely doesn't take place. Edit: I don't believe it's a duplicate of , as my question asks why the judgement for Jon is so harsh, while the other one asks why Tyrion judgement ends up freeing him. Those are two different characters, and I can't see the answer to the other question that would apply to this one.
In the season 8 episode finale of Game of Thrones the highest important lords met with Grey Worm to free Tyrion and Jon. While it was pretty clear why they wanted to free Jon it was unclear to me why they also asked for Tyrion. To make things even more strange, they asked about his opinion of a potential solution which becomes the actual final one in the end (choose king and nominate someone). I thought they (besides Sansa and Bran) don't like him and wanted to judge him? Or am I missing something?
I have been testing Ubuntu 17.10. I like it, but when I turn on my PC (with Ubuntu 17.10), the login screen uses Wayland, and my GPU doesn’t support it. After login, it automatically change to Xorg and it works normally. How can I change from using Wayland to Xorg on the login screen permanently?
Some of my applications don't work on Ubuntu 17.10 Wayland. How can I switch back to Xorg?
I have a VPS with Ubuntu 14.04. I need to login as root to my server over SSH. I set a password for root: sudo passwd root then enabled it: sudo passwd -u root then rebooted my vps: sudo reboot But I still can't connect with the root user. How can i enable ssh login as root?
I'm using the default installation of openssh-server for my Ubuntu 14.04 server. I can connect through the console as root like normal, with my username and password. When I try to SSH with the same username/password, however, I repeatedly get Access Denied errors. /var/log/auth.log reports Failed password for root from <ip address> port <port> ssh2, but I'm entering the correct password. Why can't I connect to the server via SSH, even though the username and password ARE correct?
I am having trouble proving that for all integers $n,\ 3$ does not divide $n^2-5$ using modular arithmetic. I know that $3\not\mid n^2-5$ means $n^2\not\equiv 5\pmod 3$. But I'm not sure how to start the proof.
Prove or disprove: For every integer a, if a is not congruent to 0 (mod 3), the a^2 is congruent to 1 (mod 3) SO this is for abstract algebra and I am really struggling with this. Here are some of the definitions and theorems I think would apply. -an integer a divides and integer b if there is an integer q such that b=aq -Let a and b be integers, with a>0. Then there exist unique integers q and r such that b= aq+r and 0<=r The question says hint: use 2 cases but I'm not really sure what that means. I'm guessing it wants me to look at it when a is congruent to 0 and when it's not? so i tried to do that but just ended up stuck. below is as far as i got with that attempt Proof: Case 1 There should be some information about letting variables exist in certain number sets here assume a is not congruent to 0 mod 3, then 3 does not divide a-0, therefore a-0 does not equal 3q for some q in the integers I was trying to get this to wind down to thus 3 divides a^2-1 but even tho it seems true (I couldn't find a counter example) I couldn't figure out how to prove it with what I have. Next i tried reversing it thinking I could contradict it or something. I think this would be case 2? assume a is congruent to 0 mod 3, then 3 divides a-0 and a-0=3q for some q in the integers, then 3q=a since 0 is the additive identity, therefore 3 divides a, and again stuck and my brain hurts a little.. Can anyone help me figure out how to work this.
Define $u_n$ as : $$u_n=\displaystyle\sum_{k=1}^n \dfrac{1}{\sqrt{n^2+k}}$$ From first values, $(u_n)$ seems to be increasing. From squeezing, its limit is $1$. $$ \dfrac{1}{\sqrt{n^2+n}} \le \dfrac{1}{\sqrt{n^2+k}} \le \dfrac{1}{\sqrt{n^2+1}}$$ (summing from $k=1$ to $k=n$) How can one show that it's indeed increasing (if it is) because no terms cancel out when setting $u_{n+1}-u_n$. thanks.
Let $ \{s_m\}_{m=1}^\infty$ be the sequence defined: $s_m = \sum_{k=1}^{m} \frac{1}{\sqrt{m^2 + k}}$ I have already proven that $s_m\to 1$ as $m\to \infty $ but i'm having trouble to show that $s_m$ is a monotonic sequence. Would appreciate any help or advice, thanks in advance.
I made a method to click on the calendar field and then choose the date, but when I move the parameters, is returning error. My method def select_current_date(self, *locator1, *locator2): self.driver.find_element(*locator1).click() WebDriverWait(self.driver, AUTOCOMPLETE_TIMEOUT).until( EC.visibility_of_element_located((By.CSS_SELECTOR, ".ui-icon.ui-icon-circle-triangle-w"))) self.driver.find_element(*locator2).click() WebDriverWait(self.driver, AUTOCOMPLETE_TIMEOUT).until( EC.invisibility_of_element_located((By.CSS_SELECTOR, ".ui-datepicker-title"))) Passing the parameters self.select_current_date(*EventsLocators.RECEIVED, *EventsLocators.CURRENT_DATE) My error E File "/Users/rafael/Desktop/projects/automated_tests/base.py", line 23 E def select_current_date(self, *locator1, *locator2): E ^ E SyntaxError: invalid syntax Any idea? Cheers!
In the following method definitions, what does the * and ** do for param2? def foo(param1, *param2): def bar(param1, **param2):
Is there any way to remove the italic from the words bits in the code below? That is, change the \text output to represent the normal font when an align is used inside a theorem-like environment. \begin{proposition} The memory requirements for the keys are \begin{align} m_{\text{pk}}&= 2r \,\,\,\text{bits}\\ m_{\text{sk}}&= r \end{align} \end{proposition}
\documentclass[11pt,a4paper]{article} \title{Title} \author{Author} \begin{document} \maketitle $\{ n \mid n\ \mbox{is\ even} \}$ \end{document} Since it is a relatively rare occasion for me to display upright letters in math mode, I kind of ignored this problem for a long time. But recently, when I prepared my tutoring notes, I found manually creating space is annoying. I thus wonder if there is any way out? I would also like to know if it is possible to display upright letters without commands such as "\mbox" or "\textup" in math mode?
I am applying for a job that my friend has told me about. He spoke with the employer about me and then told me I should send that employer an email. Because this will be is my first contact with the owner, I thought of composing a formal letter. As the title says, I want to put the subject of my letter as: Michael’s Referee(?): Job Application What is the correct word instead of referee?
When a referrer (noun) gives a referral (noun) to another person, what is the term (noun) used for the recipient of the referral? "The referred" may work, but am I missing another term? "Referred" indicates past-tense, but I intend to use the term in future and present tense as well.
I've lost my follower I told her to wait and forgot about her it said "Follower tired from waiting and left" I've checked the shrine of Azura where I found her, both my homes, the bannered mare, winking Skeever, and where I left her I still cant find her
I had parked my follower at an inn with a bunch of valuable items that I didn't want to carry. I guess I have been out a bit too long as this message appears: Your follower tires of waiting and leaves. There have been other situations where my follower has mysteriously disappeared as well. How can I find my follower when they get up and leave or disappear into thin air?
I can check for OR condition in regex like so: import re string = "abc ank won xyz" print(re.findall("ank|won", string)) But how do I check for AND condition? I couldn't find anything for python regex. EDIT: I want to check if both ank and won (in any order) exists in the string or not.
Obviously, you can use the | (pipe?) to represent OR, but is there a way to represent AND as well? Specifically, I'd like to match paragraphs of text that contain ALL of a certain phrase, but in no particular order.
I have some abstracted code, which at the end of some process will create a homogeneous list of SObjects. It could be a list of Accounts, it could be a list of contacts, it could be a list of some custom SObject. It doesn't matter, every record in the list will be an instance of the same type of SObject. upsert resultSObjectList I can't simply do an because it results in: System.TypeException: DML on generic List only allowed for insert, update or delete If I send the list back to whatever method called my abstraction and then try to cast it back into whatever type it should be, e.g.: List<Account> accountList = (List<Account>) resultSObjectList; upsert accountList; It still results in: System.TypeException: DML on generic List only allowed for insert, update or delete I can make this work with: List<Account> accountList = new List<Account>(); for (SObject sObj : resultSObjectList) { accountList.add((Account) sObj); } upsert accountList; But that is ugly and I will need to make a similar implementation for every consumer of my process. Likewise, I'd prefer not to create two separate lists (for insert and for update) and then do two separate DML operations. Any ideas?
The upsert() DML operation requires a specific List based on a specific sObject type, for instance:List<Account> lstAccount = new List<Account>(); However, we are trying to generate a generic method which allows us to pass by an sObject list containing all data records to be upserted for a specific sObject. An insert() operation allows us to use a List<sObject> to be inserted but the upsert() function is rejecting it: List<sObject> listWRecords = new List<sObject>(); listWRecords.add(new Foo__c(Name="Record1")); listWRecords.add(new Foo__c(Name="Record2")); upsert(listWRecords, 'ExternalIdFieldFrom_Foo__c', false); Which will result in an error saying that the upsert must be performed on a concrete entity type. Dynamically casting an sObject list is also not possible; I've seen solutions to 'hard code' or create Wrapper classes for each sObject on your org. But we would like to create a generic option here. Another possibility would be to create some logic mimicking an upsert by splitting it into an update() and an insert() operation. Keeping in mind Salesforce limits, I do not see an option to go this way.
Edited the pdf in PDFelement & when you try to view a document in Adobe Reader or Acrobat, you receive the error, "There was a problem reading this document (131)." Why is this happening?
I'm generating a PDF document with pdflatex (more precisely, latexmk invoked from TexMaker 3.4. My LaTeX install is TeXLive 20120719). I can read the document fine in Okular and Gmail's attachment preview, but a colleague that runs Acrobat Reader on Windows reports: "There was a problem reading this document (131)". EDIT: The error disappears when using \usepackage[demo]{graphicx}, which puts black boxes instead of the real images. They are all PDFs, PNGs and JPGs. Instead of using demo, I added the code for a \demoincludegraphics command, which makes the file work in Reader when using it to replace the logo in the headers, as shown below. But enabling it (using \includegraphics instead of \demoincludegraphics) and removing everything else also works in Reader! There is some strange global interaction that makes the file appear broken to Reader when enabling all the graphics... My code compiles fine, reason why I only attach the preamble and a simple text for a Minimal Working Example: \documentclass[12pt,lettersize,twoside]{article} \usepackage[utf8]{inputenc} \usepackage[spanish,es-tabla]{babel} \usepackage[fixlanguage]{babelbib} \usepackage{amssymb,amsmath} \usepackage{graphicx} \usepackage{array} \usepackage{caption} \usepackage{subfig} \usepackage{rotating} \usepackage{booktabs} \usepackage{multirow} \usepackage{calc} \usepackage{stfloats} \usepackage{fixltx2e} \usepackage{url} \usepackage[colorlinks=true,linkcolor=blue,citecolor=red]{hyperref} \usepackage[all]{hypcap} % Margins \usepackage[top=2cm, bottom=2cm, left=3cm, right=2cm]{geometry} % Make header show up in the first page \makeatletter \renewcommand\maketitle{\par \begingroup \renewcommand\thefootnote{\@fnsymbol\c@footnote}% \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% \long\def\@makefntext##1{\parindent 1em\noindent \hb@[email protected]{% \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% \if@twocolumn \ifnum \col@number=\@ne \@maketitle \else \twocolumn[\@maketitle]% \fi \else \newpage \global\@topnum\z@ % Prevents figures from going at top of page. \@maketitle \fi \thispagestyle{fancy}\@thanks % was {empty} \endgroup \setcounter{footnote}{0}% \global\let\thanks\relax \global\let\maketitle\relax \global\let\@maketitle\relax \global\let\@thanks\@empty \global\let\@author\@empty \global\let\@date\@empty \global\let\@title\@empty \global\let\title\relax \global\let\author\relax \global\let\date\relax \global\let\and\relax } \makeatother % Remove date field in title; Remove preceding vertical space \makeatletter \renewcommand{\@maketitle}{ \vspace{-3cm} \begin{center}% {\LARGE \@title}\\ \vspace{2mm}% {\@author} \end{center}% \par} \makeatother \makeatletter % Demo includegraphic boxes \newcommand{\demoincludegraphics}[2][]{% \setlength{\fboxsep}{-\fboxrule}% Remove frame separator/gap \framebox{\rule{0pt}{100pt}\rule{150pt}{0pt}}% Framed box of 150pt x 100pt } % Headers Config \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead{} \renewcommand{\headrulewidth}{0.4pt} \setlength{\headheight}{2.2cm} \addtolength{\textheight}{-1.62cm} \fancyhead[LO,RE]{\demoincludegraphics[height=1.6cm]{logo-slogan}} \fancyhead[LE,RO]{} % Footers Config \fancyfoot{} \renewcommand{\footrulewidth}{0pt} \fancyfoot[C]{\thepage} % Notas al pie etiquetadas por simbolos \renewcommand{\thefootnote}{\fnsymbol{footnote}} \title{Doc Title} \author{My name} \begin{document} \maketitle This is a test. It includes graphics and other floats. \end{document} EDIT: I found a workaround: Processing the generated pdf file through Ghostscript, as follows: gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf where input.pdf is the file generated by pdfLaTeX, and output.pdf the one that will be readable by Adobe Reader and the rest of the PDF readers.
I'm trying to calculate a risk ratio with the following 2x2 contingency table, where the rows are exposure groups and the columns are disease status. The first row of the matrix shows that 1/38 exposed participants developed the disease. Disease + Disease - Total ----------- ----------- ----------- ------- Exposed 1 37 38 Unexposed 26 120 146 (Example code using R) library(epitools) study_results <- matrix(c(120, 37, 26, 1), ncol = 2) epitools::riskratio(study_results) This gives a risk ratio of 0.15 (95% CI 0.02-1.05). The p-value (null hypothesis is risk ratio = 1) is about 0.01, depending on the method. Why is the p-value clearly lower than 0.05, when the 95% confidence interval crosses 1?
I have run proc freq to test association between two binary variables using the Fisher's exact test. However, the outputs seem contradict to each other as Two-sided Pr <= P 0.0355 whereas the OR and the 95% Confidence Limits 0.1097 [0.0022, 1.1380] includes 1. This means that p-value shows that they are significantly associated while the 95% CI does not indicate that. My question is that based on the output from SAS, what should I use: p-value or CI?
So I have been trying to figure out the problem of when to call for a Perception check vs. an Investigation check. I have read over extensively, but there is no accepted answer, and the most upvoted answer states that both perception or investigation could be used. I am looking for a simple RAW way to decide whether the player is rolling Perception of Investigation, i.e., exactly when does the perception apply and when does the investigation apply? An example of the kind of answer I'm looking for is: "Investigation is only used when the PC has a clue about whatever they are looking for. Perception is used when the PCs don't know what they're looking for." The goal of this answer is to allow me, the DM, to quickly decide whether Perception or Investigation is being used AND to be able to explain my reasoning to my players. Bonus points if the uses of Investigation don't paint it into an obscure corner or rely on first making a perception check.
This actually a number of questions that conform to the title question, and which all stem from a bit of rules confusion. Let's start with the rules confusion. On pg 178, under the skill Investigation the rules says the following; You might deduce the location of a hidden object,... On the same page, directly to the right of the investigation skill, is a green box titled Finding a hidden object. In the box the rules says the following; When your character searches for an hidden object such as a secret door or trap, the DM typically ask you to make a Wisdom (Perception) check. Now here we have two skills that clearly does the same thing. So my first question is: Are the skills interchangeable or mutually exclusive? That is: can you use either skill to search for traps in any situation, or do you use Investigation only in specific situations you can't use Perception in, and Perception only in specific situations you can't use Investigation in? My second question is: What do you use to make passive checks to spot a trap? Do you only use Perception, as you would if a character did not have proficiency in either skill? Or, if a character is proficient in Investigation but not Perception, would you then use Investigation instead? Which leads me to my last question: What if a character is alert to the possibility of hidden objects like traps, but isn't actively searching for them? In other words, what happens if a player utters the oh so familiar words: "I'm prepared for the possibility that there might be traps in here." He/she isn't actively searching, but it isn't exactly passive either. If the character has proficiency in Investigation, do you then use that skill, or do you stay with Perception checks? In other words: when do you use what skill?
Note: This has been posted as to the . Earlier when I used to cast a close vote, the dialog would look like this: That is, the radio buttons used to disappear. But now since the redesign of the close vote dialog, the radio buttons don't disappear: Or at least make test distinguishable like that of flags:
This week we rolled out a series of changes to of the question close workflow. You can read more about the details of these changes . For context, the overall effort to improve the question close experience will be optimized for Stack Overflow. Given Stack Overflow’s scale, many of the pain points we hear about with question closing and reopening are unique to Stack Overflow and won’t make sense for other network sites. However some changes are general improvements that should improve usability and guidance overall. Wherever possible, we plan to roll these changes out network wide as well. Any time we roll out a change network wide, we’ll make sure to cross-post here. This first phase is being rolled out to the network and is why I’m posting today. Let us know if you run into any issues or have questions regarding the network here.
In the beginning of each section in the moderncv package there is a horizontal line. I cannot figure out where to find the code to modify/ get rid of it. e.g.
I want to write my cv with moderncv-Classic style. Can you tell me, how I can remove the horizontal line in the left of each section?
So I have two flash drives in, one is running Ubuntu as a live cd and I'm using that to install Ubuntu on the other. I've gone through the download process, clicked on "something else" and now I have to partition my flash drive. I don't know how to do this. What exactly do I do now? Thank you guys so much! That link helped a lot, I'm just not sure if I have quite the right amount of space partitioned to each thing(I'm using a 14gig flashdrive) but I think I'm close enough. Does it matter if the colors that show how much space is is used are swapped with the ones in the link?
I'd like to see the full How-To on how to use manual partitioning during Ubuntu installation. The existing guides (at least those I found here) cover only automatic part and leave untouched the manual part (or extremely short and contain no pictures). I'd like to cover such situations: If your disk contains other systems:
I have a stored procedure which returns a weekly result from input parameters start date and end date. I am getting multiple rows in the result. Requirement: I want to add the results of columns in a single column. Below is my final query. From this I want to concatenate the result: SET @sqlText = N'SELECT ['+REPLACE(@columns,',','],[') + ']' + ' FROM dbo.timesheet WHERE month ='''+ @strMonth+''' AND [Task ID] IN ( SELECT TaskID FROM ManageTasks WHERE TeamMemberUserID ='+ Cast(@UserID AS VARCHAR(max)) + ')' --Here I want to add the columns result and need to show as single column PRINT @sqlText EXEC (@sqlText)
I have this code: DECLARE @MyTable AS TABLE ( [Month] INT, Salary INT ); INSERT INTO @MyTable VALUES (1,2000), (1,3100); SELECT [Month], Salary FROM @MyTable; Output: I want to concat the Salary (grouping by month) so that it will be NVARCHAR like this: '2000,3100' How would I do this efficiently?
As I understand it, a file has 3 sets of permissions: owner permissions, group permissions, and everybody else permissions. Moreover, the file has is assigned to a owner, and a group. How linux combines all this information, to actually determine the permissions a given user has over the file? For example, say a file is: --- rw- --x That is, the owner has no permissions, the group can read/write, and everybody else can only execute. Now user "Joe" comes to this file. Depending on which groups Joe belongs to, and whether Joe is or not the owner of this file, what can he do with it? He could execute the file, because x is set for everybody. But if "Joe" is the owner, x is forbidden for the owner. What takes precedence?
I just ran into something unexpected (for me) regarding file permissions on Linux (Arch Linux). Basically I have: userX in groupX fileX userX:groupX ---rwx---- What puzzles me: I cannot perform any action (rwx) on fileX. Is this right? Can someone please confirm this is indeed the expected behaviour? The only actions I can perform are mv and rm because I have write permissions on the parent directory. The thing is, I always thought these permissions collapse on each other, starting with the most general one (other -> group -> user). In other words, if o=rwx who cares what the persmissions for group and user are? Apparently this is not the case but it doesn't make much sense to me; it seems counterintuitive. The only thing this approach seems to be useful at, is to easily exclude a very specific person / group, which doesn't seem like a smart way to go at it (imho). Besides, the owner (and group?) should be able to chmod anyway right? Any thoughts on this matter?
I'm new to AJAX, jQuery, and JavaScript, so I'm sure I'm missing something simple here. This is a hard problem for me to describe, but I'll do my best. I have two html files, index.html and news.html. I'm using AJAX to update a div that I have declared in the index.html file (its name is contentDiv). I'm using the class attribute on several tags to pass information into my jQuery script. When I click the link on the index.html page to load news.html into the contentDiv, it loads properly. I then click a link to a .pdf file that is on the news.html file and nothing happens. I'm trying to replace news.html with the .pdf requested. I have the following in index.html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <script src="js/site.js"> </script> <script src="js/bootstrap.min.js"></script> <script> // Hide the "hideContent" link when the page loads $(document).ready(function(){ $('.hideContent').hide(); // hide the hideContent button // AJAX to load pdfs into the contentDiv when the link is clicked var text; $('.pdf').click(function(){ text = $(this).attr('text'); var first = "'<object type="; var last = ' width="900" height="450"></object>'; first = first.concat('"application/pdf" data='); first = first.concat(text); first = first.concat(last); first = first.concat("'"); var pdfDiv = document.getElementById("contentDiv"); pdfDiv.innerHTML=first; contentDivViewHelper(); return false; }) var url; $('.html').click(function(){ url = $(this).attr('text'); processContentDivRequest(url); return false; }) });//end of document.ready </script> Here is an <a> tag in index.html that is working properly: <a id="termsAndConditions" class="pdf" href="#" text="pdf/TermsAndConditions.pdf">Terms and Conditions</a> Here is the news.html link that also works (this link is also located on index.html): <a id="recentnewslink" class="html" href="#" text="news.html">Current News/Announcements</a> The problem is when I click this link that is located in the news.html file, nothing happens: <a id="pdf" class="pdf" href="#" text="Announcements/PriceAnnouncement20151201.pdf"> I've tried this both with and without importing the same .js files that I do in the index.html file and both with and without the same document.ready script that is in index.html. I would think that the . js imports and document.ready code would not be necessary in news.html because I'm using ajax to load news.html into index.html, but that's just a guess. Does anyone have any ideas on where I'm going wrong? Thanks
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
I have recently compiled a .CPP file with Geany. The result file is a .o file. How can I run this .o program?
I wrote a simple program to print "hello world". The compiler shows a message "Compilation finished successfully". But the out put of the program, I can't see anywhere. As using codeblocks a new terminal comes out with the program output. How can I see the program output using geany compiler.
Well, I do know that one of the consequences of the Special Theory of Relativity is increase in relativistic mass. But physically, why does it happen? Do more fundamental particles get added, or do their own masses increase? (that sounds strange,I know ,but that was only to explain the kind of answer I am looking for) Thanks in advance, and sorry if the question was stupid. My curiosity sometimes forces me to ask such foolish questions.
Some people say that mass increases with speed, some people say that the mass of an object is independent of its speed. I understand how some (though not many) things in physics are a matter of interpretation based on one's definitions. But I can't get my head around how both can be 'true' is any sense of the word. Either mass increases or it doesn't, right? Can't we just measure it, and find out which 'interpretation' is right? e.g.: (in some sophisticated way) heat up some particles in a box and measure their weight? ------------------------------ UPDATE Right, so I've got two identical containers, each with identical amounts of water, each on identical weighing scales, and each in the same g field. If one container has hotter water, will the reading on its scale be larger than the other? If the answer is yes, and g is constant, does this mean that the m in w=mg has got bigger?
I've tried many ways, but it seems that it didn't work: $$ \int_1^{+\infty}\frac{\mathrm dx}{x(x+1)(x+2)\cdots(x+n)} = \int_0^1\frac{x^{n-1}}{(x+1)(2x+1)\cdots(nx+1)}\mathrm dx = \cdots $$ Any help would be appreciated!
I would like to compute: $$\int_0^\infty\frac1{(x+1)(x+2)\cdots(x+n)}\mathrm dx $$ $$ n\geq 2$$ So my question is how can I find the partial fraction expansion of $$\frac1{(x+1)(x+2)\cdots(x+n)}\ ?$$
Let $E = \mathbb{Q}(\sqrt{4+\sqrt{7}})$. Prove that $E$ is a normal extension of $\mathbb{Q}$ and find the Galois group $Gal(E/\mathbb{Q})$. My attempt: Let $\alpha = \sqrt{4+\sqrt{7}}$. $\alpha$ is a root of the polynomial $(x^2 - 4)^2 - 7$. 1) How can I show $f(x) = (x^2 - 4)^2 - 7 = x^4 - 8x^2 + 9$ is irreducible over $\mathbb{Q}$ because I can't apply Eisenstein condition? If $f(x)$ is irreducible, $[E:\mathbb{Q}] = 4 = |Gal(E/\mathbb{Q})|$ and I have shown that all roots of $f(x)$, say $\alpha_{1} = \sqrt{4+\sqrt{7}}, \alpha_{2} = -\sqrt{4+\sqrt{7}}, \alpha_{3} = \sqrt{4-\sqrt{7}}, \alpha_{4} = -\sqrt{4-\sqrt{7}}$ are in $E$ and hence $E$ is a normal extension of $\mathbb{Q}$. Let $Gal(E/\mathbb{Q}) = \{ e,\sigma,\tau,\sigma\tau \}$ 2) How can I find the order of $\sigma,\tau$ to find $Gal(E/\mathbb{Q})$? Thanks.
Let $\alpha =\sqrt{4+\sqrt 7}$ and $\beta =\sqrt{4-\sqrt 7 }$. I have to compute $Gal(\mathbb Q(\alpha )/\mathbb Q)$. So, I found that $Gal(\mathbb Q(\alpha )/\mathbb Q)=\mathbb Z/2\mathbb Z\times \mathbb Z/2\mathbb Z$, that $\mathbb Q(\beta^2)= \mathbb Q(\alpha^2)$. I show that the roots of the minimal polynomial of $\alpha $ are $\{\alpha ,-\alpha ,\beta ,-\beta \}$. But now that ask me to enumerate the element of the galois group. I did it's $\{id, \sigma ,\tau,\sigma \tau\}$ where \begin{align*} \sigma : \alpha &\longmapsto -\alpha \\ \beta &\longmapsto -\beta \end{align*} and \begin{align*} \tau : \alpha &\longmapsto \beta \\ \beta &\longmapsto \alpha \end{align*} But in my correction they wrote \begin{align*} \sigma : \alpha &\longmapsto -\alpha \\ \beta &\longmapsto \beta \end{align*} Question : Who is right ? me or the correction ? The problem it's that this group is abelian, so if they are right, $$\sigma \tau(\alpha )=\beta \neq -\beta =\tau\sigma (\alpha )$$ so I think I'm right, but in the doubt I prefer to ask you.
I've made a static model of a mannequin to do some tests. My problem is that whenever I scale a part of the model, or the entire mesh, then every time I move the time-line a bit (or Alt middle mouse. I'm used to zooming that way from maya) the scaled meshes return to previous scale, along individual centers. Here's a image sample of the problem: 1 Before the scale 2 After the scale (note the time-line) 3 After moving the time-line* This effect would also happen if I'd scale the mesh, and then export it as a FBX (without moving the time-line). I've tried to apply the scale onto the model. In effect the elements of the model get incredibly small, when the time-line moves/I export it. I would be very grateful for any help with this issue. *I know it wasn't exactly by 5. My mistake. But it's visible that the current time has changed.
On my current .blend file, when I edit a particular object's origin point and save it, opening the file again resets the origin back to where it was before. I'm unable to save the object with a new origin location. I tried doing CtrlA to set to apply location, rotation, and scale, and then saving it, but upon reopening the object was scaled strangely and the origin once again not in the right location.
I have the output from a command in gnome-terminal, but there is too much text currently so it is wrapping, but the wrapping means that it is much harder for me to read the output because of the nature of it. So I was wondering if there is any way to make the output, or perhaps even all the text, not wrap in gnome-terminal? I am running Ubuntu GNOME 16.04 with GNOME 3.20.
Is there a way to tell the terminal not to wrap long lines. I wish to see a line in the same space without wrapping to the next one. I do not care if I can not see the end of the line just as long as the line stays in one. A horizontal scroll would be good for this also but for the moment the removal of the wrapping is what I need.
While reading a paper, I encountered the symbol $\gtrless$, which I had not seen before: Please point me to a reference or tell me what the symbol and associated symbols above and below means.
I'm reading Papadimitriou & Steiglitz's Combinatorial Optimization and came across notation I'd never seen before and don't know what it means. The $\LaTeX$ markup for it is \gtrless ($\gtrless$), which took me quite a while to find. It arises in the formulation of general linear programs in terms of the constraints on the variables: $$ x_j \geq 0 \;\; j \in N\\ x_j \gtrless 0 \;\; j \in \bar{N} $$ It's not "not equals" because there's places in the text where the authors say $x$ can be zero.
Suppose I push a book with my hand. I am applying force on it in the process. My question is: What is the carrier of the force I am applying?
If you've ever been annoyingly poked by a geek, you might be familiar with the semi-nerdy obnoxious response of "I'm not actually touching you! The electrons in the atoms of my skin are just getting really close to yours!" Expanding on this a little bit, it seems the obnoxious geek is right. After all, consider Zeno's paradox. Every time you try to touch two objects together, you have to get them halfway there, then quarter-way, etc. In other words, there's always a infinitesimal distance in between the two objects. Atoms don't "touch" each other; even the protons and neutrons in the nucleus of an atom aren't "touching" each other. So what does it mean for two objects to touch each other? Are atoms that join to form a molecule "touching"? I suppose the atoms are touching, because their is some overlap, but the subatomic particles are just whizzing around avoiding each other. If this is the case, should "touching" just be defined relative to some context? I.e, if I touch your hand, our hands are touching, but unless you pick up some of my DNA, the molecules in our hands aren't touching? And since the molecules aren't changing, the atoms aren't touching either? Is there really no such thing as "touching"?
This question is number 6 of 3.1 of wayne patty topology. Let T be finite complement topology on $\mathbb{R}$. Is ($\mathbb{R} , T)$ connected? Attempt: I took $\mathbb{R}=U \bigcup V$ , U ,V both open. Now I have to see if $\bar U \bigcap {V } = \bar {V} \bigcap U = \phi $ . But I am not able to undestand what closure of U will be in Finite complement topology. Can you please help in that?
what i had done :let X be a infinite set and there be open sets $A,B$ on it. such that $A\cap B =\varnothing$ or $A\cap B\ne\varnothing$then $X-A\cap X-B \ne \varnothing $ .which means there doesn't exist $X-A\cap X-B = \varnothing $ ,which implies that there is no separation of X in finite complement topology. is this proof correct.
Let us consider the following scenario. This is the partial code in the main.tex file and which includes code from other tex files like certificate.tex, abstract.tex etc., .................... \include{certificate} \include{abstract} \include{introduction} ................... Now I want to incorporate separate font size and font style to each one of the above. For example let us say I want certificate to be of font size 12pt with font family Arial, abstract to be of font size 11pt with font family Courier. And finally the abstract should follow font size and font family, which I declare globally for whole document. Is it possible to change for particular chapters without changing remaining document. I am expecting some code like this .................... \font{12pt}{Arial}{\include{certificate}} \font{11pt}{Courier}{\include{abstract}} \include{introduction} ...................
The standard font packages make global changes to the fonts in my document. What if I want to use a particular font for just a portion of my text? How do I find the right name of the font? How do I select the font? How do I restrict the scope of the font change? There are separate answers for different flavors of TeX (quick links):
The claim is that, for a regression task, the conditional regression function $f(x) = \mathbb{E}[\mathbf{Y}|\mathbf{X}=x]$ minimizes the L2 loss $\arg\min(\mathbb{E}[\mathbf{Y} - f(\mathbf{X})]^2)$. I can see why it's true for a normal distribution. But why is it true in general?
I want to understand the importance of optimizing the correct loss function. Say that I am building a linear regression model $p$ for predicting some values $y_1,\ldots,y_n$. I choose to fit my linear model such that it minimizes the mean squared errors. Now I send my model off to a statistical prediction competition, where they instead of using MSE as an error metric uses mean absolute error (so no squares). How will this affect my models predictive power? In general, what can be said about the importance of optimizing the "correct" loss function? Edit: If one should put the question in a more specific context, then that context would be predictive modelling competitions like those featured on . I want to understand the importance of choosing models and loss functions which correspond to the evaluation metric for the competition. One reason for this is .
Suppose $f:\left[0,1\right]\rightarrow R$ is continuous on $\left(0,1\right)$. Prove there is a sequence of step functions $\left\{f_{n}\right\}$ which converge pointwise to $f$ on $\left[0,1\right]$. John Franks - A (Terse) Introduction to Lebesgue Integration 2009 - 1.5.6 (7), page 13. But, consider $f=\sin\frac{1}{x}$, with $f=a$ when $x=0$, is continuous on $\left(0,1\right)$. Suppose that, a step function $f_{n}$, is constant on $\left[0,k\right]$, $k<1$. Since, $-1\leq\sin\frac{1}{x}\leq1$ on $\left(0,k\right)$, so $\lim_{n\rightarrow\infty}f_{n}\neq f$ I can't believe this book is wrong. Is my example correct? If it's not, how to prove this problem? Thanks.
Question: Suppose $f: [0,1] \rightarrow \mathbb{R}$ is continuous on $(0,1)$. Prove there is a sequence of step functions $\left\{f_{n}\right\}$ which converges pointwise to $f$ on $[0,1]$. I saw the same question was asked but I was still confused regarding the solution to the question. I had attempted a solution but I now realize this solution is wrong: Proof: Since $f$ is continuous on $(0,1)$, then for every $x \in (0,1)$ and for every $\epsilon>0$, there exists a $\delta(x)$ such that $|f(x)-f(y)|<\epsilon$ whenever $y \in (0,1)$ and $|y-x|<\delta(x)$. In particular, let $\epsilon_{n} = 1/2^{n}$ and let $\delta_{n}(x)$ be the corresponding $\delta$ which is guaranteed by the continuity of $f$. Fix a value of $n$ and choose a partition $x_{0}=0 < x_{1} < x_{2} < \ldots < x_{m} = 1$ such that $x_{i}-x_{i-1} < \delta_{n}(x)$. Let $f_{n}(x):= f(x_{i-1})$ for all $x \in (x_{i-1}, x_{i})$. Clearly $f_{n}(x)$ is a step function and hence $\left\{f_{n}\right\}$ is a sequence of step functions. Observe that $f_{n}(x)=f_{n}(x_{i-1})=f(x_{i-1})$. Finally, by the continuity of $f$ and by the fact that $x_{i}-x_{i-1} < \delta_{n}(x)$, we may conclude that \begin{align*} |f(x)-f_{n}(x)| \leq |f(x)-f(x_{i-1})| < \epsilon_{n} \end{align*} and so the sequence converges pointwise to $f$. End of proof. I was hoping someone can shed some light on the correct solution to this problem. Any hints would be appreciated. Thanks!
Can someone find $x$ in the figure? I tried to solve it, but failed.
The following is a geometry puzzle from a math school book. Even though it has been a long time since I finished school, I remember this puzzle quite well, and I don't have a nice solution to it. So here is the puzzle: The triangle $ABC$ is known to be isosceles, that is, $AC=BC$. The labelled angles are known to be $\alpha=\gamma=20°$, $\beta=30°$. The task is to find the angle labelled "?". The only solution that I know of is to use the sine formula and cosine formula several times. From this one can obtain a numerical solution. Moreover this number can be algebraically shown to be correct (all sines and cosines are contained in the real subfield of the 36th cyclotomic field). So in this sense I solved the problem, but the solution is kind of a brute force attack (for example, some of the polynomials that show up in the computation have coefficients > 1000000). Since the puzzle originates from a book that deals only with elemetary geometry (and not even trigonometry if I remember correctly) there has to be a more elegant solution.
I know that we use protons in the LHC. So my question is, how is the proton separated from the electron in the hydrogen?
I heard that the LHC smashes two protons together to research the universe. But how does it create the protons for collision? If we strip off the electrons won't there be neutrons along with protons? A is used by the LHC, it ionises atoms into negative or positive ions but how is the proton separated from that?
Did it ever really make a difference? I haven't restarted after an install in nearly 15 years if I'm honest. What have I been missing out on? Keep in mind I mean simple software, not huge drivers, operating system updates, or major downloads like that.
Even the smallest update of one package or security patch makes Windows need to restart. Why? If an anti-virus application doesn't need it after patch update, why Windows need it after updating Security Essentials' virus-signature files? On the other hand, Linux mostly doesn't need it except when it upgrades its kernel. Note: I am talking especially about Windows 7. I don't know much about Windows 8, or the Server editions.
I need to use the host to build a URL with a different port. For example, if the host is example.com, I need to generate a URL like I need it to be portable, so when I'm in my local enviroment it shows instead. Any ideas?
I'm in the process of maintaining a Ruby on Rails app and am looking for an easy way to find the hostname or IP address of the box I'm on (since it's a VM and new instances may have different hostnames or IP addresses). Is there a quick and easy way to do this in Ruby on Rails? Edit: The answer below is correct but the clarification Craig provided is useful (see also provided link in answer): The [below] code does NOT make a connection or send any packets (to 64.233.187.99 which is google). Since UDP is a stateless protocol connect() merely makes a system call which figures out how to route the packets based on the address and what interface (and therefore IP address) it should bind to. addr() returns an array containing the family (AF_INET), local port, and local address (which is what we want) of the socket.
Is the usage of 2 consecutive 'that' in the following sentence correct, because it looks a bit odd? Should these be separated by comma perhaps? "While I agree that strength and size definitely gives an advantage but I don't believe that that advantage holds up against a highly skilled fighter!"
Have you ever had a case where you felt compelled to include strange things like a double that in a sentence? If so, then what did you do to resolve this? For me, I never knew whether it was acceptable grammar. However, what I did learn was that it was a logic distractor, could lead to confusion, and therefore should be reworded to avoid this.
I am reading Roger Scruton's Kant, A Very Short Introduction. The following sentence, in the first page, makes me pretty confused (I include the context to make it clearer): (The greatest modern philosopher was moved by nothing more than by duty. His life, in consequence, was unremarkable.) For Kant, the virtuous man is so much the master of his passions as scarcely to be prompted by them, and so far indifferent to power and reputation as to regard their significance as nothing beside that of duty itself. (Having confined his life so that he could act without strain according to this ideal, Kant devoted himself to scholarship, entirely governed by congenial routines.) I need an analysis for this sentence. I don't understand the phrase "so much ... as (scarcely) to do ...". I wonder the meaning and the usage of this kind of construction, explained in the context, not merely a translation, and I don't understand "so far ... as to do ...". Incidentally, what's the meaning of "itself" here in the phrase "beside that of duty itself". I need your help to understand this sentence well. EDIT: Related:
First of all, this is not a duplicate... E.g., have a look at these posts: Anytime people on those posts talked about the use of 'so...as...', they said either that it can be used 'only in negative context' or that it can be used 'only with negative comparatives'. Well, it is not clear to me at all what is meant by 'negative context/comparatives'... I am quite sure there was something significant omitted in the explanations. E.g., look at the following sentences: Like the coordinating conjunctions, it is perfectly fine to begin sentences with because, so long as you keep in mind that the goal is to avoid fragments. (Source: ). This sentence does not seem to contain any 'negative context/comparatives'. So foolish, unreasonable, or out of place as to be amusing. (Source: ). This sentence does not seem to contain any 'negative context/comparatives' either. And this post was not meant to be derogative in any way... I am sorry if anyone got offended. I have also left the exact URLs of most of the websites I have linked to (without having used the hyperlink function) so as to let the users see some information about the links given before having them clicked on the link. (additionally, is 'before having them clicked on the link' grammatical? I am not a native English speaker and I'm trying to get a hang of some more advanced kind of structures). Some justifications of the uses of 'so...as...' in the two given sentences would be appreciated (as well as some other grammar corrections present in this post, if possible). Thanks!
Why this python code print 888888803. == 8888888.03*100. prints False?
Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen?
I am looking to calculate the distance from a main point to multiple points WITHIN shapefile. In other words: I have a main point at the mouth of a creek. I have about 1,200 points at various distances upstream from the mouth. I would like to calculate the distance from the mouth to each individual point. (aka, mouth to point 1, mouth to point 2, mouth to point 3, etc.) So, in the end, I would end up with 1,200 measurements, all starting at the mouth of the creek. I can only find tools that measure Euclidean distance or measure distance BETWEEN two consecutive points along a line, which will not work. I am looking for something that measures distance ALONG the route of the creek from one main point to multiple other points. Any tips? Screenshot image: want to find individual measurements from mouth point (red) to each blue point. I'm using ArcGIS 10.3.1. I have no experience with Python.
I'm using ArcGIS 10.3 (Desktop), and I'm trying to measure the distance between points following a path determined by a set of polylines. Hand measurement is not a viable option-- there are ~7500 points, and my polyline set is the global coastline. The ultimate goal is to get the spacing of these points along the polylines, so that I can analyze this with respect to a few other variables. I can read python-- with a bit of effort-- but not write or edit it, so code-based solutions will not be particularly useful to me. I have tried using the linear referencing tools-- I snapped the points to the lines, then transformed the polylines to routes and used 'locate features'-- but because my points are not (entirely) ordered along the path, using the difference between linear reference locations of subsequent points yields some fairly unlikely answers. In addition, spot checks of (hand-measured, using the built-in path length measuring tool) point-to-point along-polyline distance yield different answers than given by the corresponding linear references for the point pair. (Some of the answers were close enough that they could very well be measurement error on my part, but others were nearly 20%, despite my having zoomed in and snapped the measurement cursor to the polyline, proceeding vertex-to-vertex.) Sorting first by linear distance seems to fix the first problem, but in light of the second one, I remain skeptical of this process. I then tried simply splitting the polylines into segments ('split line at point') using the (snapped) points as the dividers, with the eventual goal of finding the segment length with the calculate geometry feature. This produced gibberish. I'm not sure what criteria ArcGIS used to split the lines, but it wasn't the point set I provided. Segments in the resulting shapefile ran right through tens of points, only to terminate at a place with no point. (Also, there were segments utterly empty of points...you get the gist.) I reiterate that the pointset was specifically snapped to the polylines, so this problem shouldn't be caused by excessive distance between the point and the polyline. I'm at a bit of a loss, here: could someone point out where I might have gone astray and/or suggest a solution? Or, failing that, a new method that I could try? It seems like a fairly basic (not necessarily simple, but fundamental) analysis to do with geographic data, and I don't understand why it has presented so many difficulties.
Please help me... I saw a news titile like this: INDONESIA TO REVIEW CHINA’S BELT AND ROAD PROJECTS IF PRABOWO BEATS WIDODO IN PRESIDENTIAL ELECTION Here where i saw it Is the meaning of "to review" is the same as "will review"?
What does to mean in a newspaper headline, for example: Airline XY to cut cost of pilots' wages Is it a shorter form of "Is going to" or "Is planning to"?
I'm writing an app that has different functionality depending on the model of iPhone. Is there a way to distinguish between iPhone 5, and 5c 5s? I can not do a check on the display because it is identical. Thanks in advance.
Is there a way to determine the device running an application. I want to distinguish between iPhone and iPod Touch, if possible.
My main site is . I'm not sure how many tag wikis I've edited, but probably not many more than it took to get the shiny silver badge for editing 50 tag wikis that's also been earned by twelve other users on our site. Good tag wikis are important and I know I should be writing them, but inevitably I put it off in favour of some other work... a badge would make the difference between getting round to it and not getting round to it. I know writing and improving tag wikis is a slog and most people won't do it even though there are badges, but that's ok. A site only needs a few badge-pursuers enthusiastic wiki-makers to make a big difference. So I think there should be a gold badge for making, say, 200 tag wiki edits. It could be called Doctorate (because of the research required), for example.
Citing from when "Research Assistant" badge was created Looking through the data, it seemed to me that excerpts are handled fairly well by the community. I wanted to add a push to wiki editing, not excerpt editing (which is forced anyway). So... the badge counts distinct tag wikis you edit excluding excerpts." 17 months after its creation, the "Research Assistant" badge has certainly helped to improve Stack Overflow's tag wikis (103 badges awarded * 50 tag wiki edits = at least 5150 improvements made). Yet, many tags there still do not have tag wiki or wiki excerpt. Examples of the latter: models - 1150 questions, show - 1148 questions, alertdialog, 1070 questions, reload - 997 questions, send - 958 questions. New examples (28-Nov-14): - 1162 questions. - 1047 questions. - 985 questions. - 938 questions. BTW, it's odd that the "learn more" page doesn't show the wiki when it exist, but the excerpt. E.g.: see tags layer and matching. Reported this . There are some broad tags where it is useful to have excerpt with: the tag meaning information about when to use the tag, and when not to use it Tag wiki excerpts are very helpful to keep SE websites organized and new users well-informed. If SO's situation is still not perfect (comfortable, though) smaller SE sites struggle a lot to get certain resilience, with respect to this matter. Thesis statement Although "Research Assistant" creation was a leap of improvement to the completion of SO's tag wikis, many SO tags still don't have tag excerpts/wikis, and much less smaller SE sites (which could greatly benefit from this proposal too). Proposal Improve the current incentive for creation/edition of tag wikis and tag excerpts. Note that this is a rough draft. Make tag excerpts count for "Research Assistant" (silver) badge. Research Assistant (silver): 50 edits on tag wiki and/or tag excerpts. Create a new gold badge for tag wikis Librarian (gold): 100 tag wikis edited (not valid for tag excerpts). These (new/modified) badges should be awarded retroactively. Tag Editor (bronze) can stay as it is. These suggestions would further incentivize the completion and improvement of tag wiki and tag excerpts beyond what the original "Research Assistant" already does. I am fine with the +2 reputation gain for tag edits – not suggesting any changes to that.
How to install and configure ansible on Ubuntu 16.04?
I'm following this document to install ansible: I'm try to add ansible to my ubuntu repositories list but this is what happens: me@mydev:~/Documents$ sudo apt-add-repository ppa:ansible/ansible Cannot add PPA: 'ppa:~ansible/ubuntu/ansible'. ERROR: '~ansible' user or team does not exist. me@mydev:~/Documents$ I've also tried to just clone the repo (following these instructions: ) But that fails with the following: me@mydev:~/Documents/ansible$ git clone git://github.com/ansible/ansible.git --recursive Cloning into 'ansible'... fatal: unable to connect to github.com: github.com[0: 192.30.252.131]: errno=Connection timed out me@mydev:~/Documents/ansible$ ping 192.30.252.131 PING 192.30.252.131 (192.30.252.131) 56(84) bytes of data. 64 bytes from 192.30.252.131: icmp_seq=1 ttl=56 time=23.4 ms 64 bytes from 192.30.252.131: icmp_seq=2 ttl=56 time=23.5 ms ^C --- 192.30.252.131 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 23.466/23.511/23.557/0.159 ms me@mydev:~/Documents/ansible$ As you can see, I'm getting a connection timeout error. I tried pinging the server and it seems to be able to communicate with my box. Not sure what else I could try. thanks. EDIT 1 I am behind a proxy. I ran this command to identify my proxy server: me@mydev:~/Documents/ansible$ export http_proxy=http://10.20.30.40:8080 and then to test, I ran: sudo apt-get update and it ran fine.
I'm interested to find out the options and best practices for allowing the client-side to identify an object in the server-side database, without the client being aware of the true primary key of that object. For example, a form that updates the person #3 record: <form method="POST" action="/people/3/update"> <input type="text" name="first_name"/> <input type="text" name="last_name"/> <input type="submit"/> </form> What I'd like to avoid is the client side becoming aware of the number 3 specifically, as it points directly to a database record for this user, and I figure it's better if there is not glimpse of server-side data on the client-side. I'm already aware of a few options: 1) Encrypt all primary keys before they are sent to the client, decrypt them when they come back. I'd imagine this has non-negligible overhead. 2) Perform some sort of non-cryptographic modification of every key before sending it to the client, and perform the reverse on the server-side (like adding 11 and then later subtracting 11 again). While this doesn't truly hide values, it barely has any overhead. Da Questions 1) Should I worry about this in the first place? 2) What are considered to be effective ways of doing this? 3) Are there any good sources I can consult for further reading? Thanks in advance for any help!
I've heard that exposing database IDs (in URLs, for example) is a security risk, but I'm having trouble understanding why. Any opinions or links on why it's a risk, or why it isn't? EDIT: of course the access is scoped, e.g. if you can't see resource foo?id=123 you'll get an error page. Otherwise the URL itself should be secret. EDIT: if the URL is secret, it will probably contain a generated token that has a limited lifetime, e.g. valid for 1 hour and can only be used once. EDIT (months later): my current preferred practice for this is to use UUIDS for IDs and expose them. If I'm using sequential numbers (usually for performance on some DBs) as IDs I like generating a UUID token for each entry as an alternate key, and expose that.
I went to review some close questions. The first question I was given for my filter was I clicked on the title to view the full question and edit it ( I wanted to remove one of the tags), but the link went to a page not found page Why am I being asked to review a question that seems to have already been removed?
I was reviewing some stuff today, and I came across a rather ridiculous answer (see screenshot). I wanted to see the question and other answers, so I clicked on the link, and found that the answer I was reviewing was in fact deleted. Could someone take a look at it?
I want to access the url that is printed on the command line. For example, if I see the man pages for dropbox, there are some url links with underlines (i.e. https://www.dropbox.com/)-- The only way to access this url is to do right click and copy the link. Is there anyway I can access it using a single click?
I'm using irssi hosted on a remote computer for IRC, and it'd be super helpful not to have to hold Control or right-click every single link (so I can avoid multiple clicks or multiple hands). At this point I'm willing to download gnome-terminal's source and manually patch it and rebuild the package.
C++ / Win32. As shown in the popup menu pic, there's a large space at the right side of the menu. This is common to all popup menu's I've seen, probably there as a placeholder for a shortcut key combination. I was asked to clip the width to the menu text, but couldn't find any way to do it using the standard menu API or window repositioning API. Is there any simple method to do it without going into owner-drawn?
I'm creating a custom control in wxWidgets that displays a menu as part of it, and currently working on the Windows side of things. wxWidgets doesn't have a way of setting the width of a menu. It just makes the window as wide as the longest string plus a few pixels on either side. In the API, there is a way to get the actual Windows API menu handle. Does the Windows API have a method of setting the width of a menu other than just calculating it on its own based on the width of the string?
I tried to install RStudio after installing R in Ubuntu. When I clicked to install via Ubuntu software, clicking the install button does nothing. But sometimes when I click it, it starts loading and after a while it says rstudio installed. But it's not really installed. So I installed it via terminal using: $ sudo dpkg -i rstudio-0.99.902-i386.deb Selecting previously unselected package rstudio. (Reading database ... 175645 files and directories currently installed.) Preparing to unpack rstudio-0.99.902-i386.deb ... Unpacking rstudio (0.99.902) ... dpkg: dependency problems prevent configuration of rstudio: rstudio depends on libjpeg62; however: Package libjpeg62 is not installed. rstudio depends on libgstreamer0.10-0; however: Package libgstreamer0.10-0 is not installed. rstudio depends on libgstreamer-plugins-base0.10-0; however: Package libgstreamer-plugins-base0.10-0 is not installed. dpkg: error processing package rstudio (--install): dependency problems - leaving unconfigured Processing triggers for shared-mime-info (1.5-2) ... Processing triggers for gnome-menus (3.13.3-6ubuntu3) ... Processing triggers for desktop-file-utils (0.22-1ubuntu5) ... Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for mime-support (3.59ubuntu1) ... Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ... Errors were encountered while processing: rstudio What are the steps to rectify this error?
I'm trying to install on my Ubuntu box (11.04). The website has a Ubuntu .deb available for download (for 10.10 and 10.04 so I chose 10.10). However, sudo dpkg -i mysql-workbench-gpl-5.2.34-1ubu1010-amd64.deb yields: (Reading database ... 194069 files and directories currently installed.) Preparing to replace mysql-workbench-gpl 5.2.34-1ubu1010 (using mysql-workbench-gpl-5.2.34-1ubu1010-amd64.deb) ... Unpacking replacement mysql-workbench-gpl ... dpkg: dependency problems prevent configuration of mysql-workbench-gpl: mysql-workbench-gpl depends on libctemplate0; however: Package libctemplate0 is not installed. mysql-workbench-gpl depends on libpython2.6 (>= 2.6); however: Package libpython2.6 is not installed. mysql-workbench-gpl depends on libzip1 (>= 0.8); however: Package libzip1 is not installed. mysql-workbench-gpl depends on python-paramiko; however: Package python-paramiko is not installed. mysql-workbench-gpl depends on python-pysqlite2; however: Package python-pysqlite2 is not installed. dpkg: error processing mysql-workbench-gpl (--install): dependency problems - leaving unconfigured Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for desktop-file-utils ... Processing triggers for python-gmenu ... Rebuilding /usr/share/applications/desktop.en_US.utf8.cache... Processing triggers for python-support ... Errors were encountered while processing: mysql-workbench-gpl My question is, is there a way to tell dpkg to automatically fetch missing dependencies, or do I need to manually apt-get install missing packages like libctemplate0 and libpython2.6? (Or alternatively, is there some other way to get MySQL Workbench easily up & running?)
I made a huge base from bottom to the top I also made walls it almost finished I need water to protect it from TNT but how do I stop it from freezing the water? Someone did there's duplicate of this question IT'S NOT there's nothing about on faction bases like on walls
In one of my worlds I built a house on the top of a mountain. When starting to build a wheat farm, I found out that the water keeps freezing, and I have to break the ice blocks: Does wheat grow even if it is near ice instead of water? If not, how can I prevent the water from freezing?
I am using bibtex, with the bibliography style ieeetr to create my references. I have read the IEEE style manual, and I know that I should leave citations in separate sets of brackets, e.g., [3], [4]. However, I know that they should be hyphenated when consecutive, in groups of 3 or more, e.g., [5]-[10] but the ieetr style doesn't seem to do this automatically. Any ideas? I have already tried using the cite package. MWE: \documentclass{article} \usepackage{cite} \begin{document} This is my text, and here are some citations \cite{article1}, \cite{article2}, \cite{article3}. \bibliography{examplebib} \bibliographystyle{ieeetr} \end{document} And the bib file "examplebib.bib" @article{article1, author = {Doe, John}, title = {Title of article}, journal = {journal of article}, year = {2017}, volume = {11}, number = {1}, pages = {11--13}, publisher = {Journal Publisher}, } @article{article2, author = {Doe, John}, title = {Title of article}, journal = {journal of article}, year = {2017}, volume = {11}, number = {1}, pages = {11--13}, publisher = {Journal Publisher}, } @article{article3, author = {Doe, John}, title = {Title of article}, journal = {journal of article}, year = {2017}, volume = {11}, number = {1}, pages = {11--13}, publisher = {Journal Publisher}, }
I have been trying to display the in-text citations in the following format: [1-3], or [1, 6-8] which looks like it is the default one inside the cite package, but what I get is: [1]-[3] Specifically, I'm using the IEEEtran template (bare_jrnl to be more precise) and the bibliography is built in the following way: \bibliographystyle{IEEEtran} \bibliography{IEEEabrv,mybib} The cite package is obviously loaded. I have looked the documentation of both IEEEtran and cite, but I have not been able to find a solution.
I want to create object like this: How can I achieve this?
I'm trying to figure out the best way to model the sphere-spiral here: Is it possible to make this shape directly? Or do you have to make it as a cylinder and wrap it to a sphere?
I am trying to remove all of the older computers that AD stores that have not been active for 60 days. I just started working with AD recently and noticed that the AD has not had a proper cleanup in a long time. I only have about 120 computers/servers but ad has over 300 registered. Does anyone have any advice or solutions for this? Thanks in advanced!
The Windows Domain I manage has hundreds of computer names which I don't recognise and I'd like to remove old ones which aren't in use before trying to track down the misnamed ones. Is there someway to see when the last time a machine logged onto the network? Either via dhcpd or a user login event or something else.
I want to delete var/log files due to low disk space, but I cannot find out how.
( deals with a similar issue, but it talks about a rotated log file.) Today I got a system message regarding very low /var space. As usual I executed the commands in the line of sudo apt-get clean which improved the scenario only slightly. Then I deleted the rotated log files which again provided very little improvement. Upon examination I find that some log files in the /var/log has grown up to be very huge ones. To be specific, ls -lSh /var/log gives, total 28G -rw-r----- 1 syslog adm 14G Aug 23 21:56 kern.log -rw-r----- 1 syslog adm 14G Aug 23 21:56 syslog -rw-rw-r-- 1 root utmp 390K Aug 23 21:47 wtmp -rw-r--r-- 1 root root 287K Aug 23 21:42 dpkg.log -rw-rw-r-- 1 root utmp 287K Aug 23 20:43 lastlog As we can see, the first two are the offending ones. I am mildly surprised why such large files have not been rotated. So, what should I do? Simply delete these files and then reboot? Or go for some more prudent steps? I am using Ubuntu 14.04. UPDATE 1 To begin with, the system is only several months old. I had to install the system from scratch couple of months back after a hard disk crash. Now, as advised in , I first checked the offending log files using tail, no surprise there. Then, for deeper inspection, I executed this script from the . for log in /var/log/{syslog,kern.log}; do echo "${log} :" sed -e 's/\[[^]]\+\]//' -e 's/.*[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}//' ${log} \ | sort | uniq -c | sort -hr | head -10 done The process took several hours. The output was in the line of, /var/log/syslog : 71209229 Rafid-Hamiz-Dell kernel: sda3: rw=1, want=7638104968240336200, limit=1681522688 53929977 Rafid-Hamiz-Dell kernel: attempt to access beyond end of device 17280298 Rafid-Hamiz-Dell kernel: attempt to access beyond end of device 1639 Rafid-Hamiz-Dell kernel: EXT4-fs warning (device sda3): ext4_end_bio:317: I/O error -5 writing to inode 6819258 (offset 0 size 4096 starting block 54763121030042024) <snipped> /var/log/kern.log.1 : 71210257 Rafid-Hamiz-Dell kernel: attempt to access beyond end of device 71209212 Rafid-Hamiz-Dell kernel: sda3: rw=1, want=7638104968240336200, limit=1681522688 1639 Rafid-Hamiz-Dell kernel: EXT4-fs warning (device sda3): ext4_end_bio:317: I/O error -5 writing to inode 6819258 (offset 0 size 4096 starting block 954763121030042024) (/dev/sda3 is my home directory. As we can find, lsblk /dev/sda NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931.5G 0 disk ├─sda1 8:1 0 122.1G 0 part / ├─sda2 8:2 0 7.6G 0 part [SWAP] └─sda3 8:3 0 801.8G 0 part /home Why a process will want to write beyond the limit is actually outside the scope of my comprehension. Perhaps I will want to ask a different question in this forum if this continues even after a system update.) Then, from (you may want to check for a deeper understanding), I executed, sudo su - > kern.log > syslog Now, these files have zero sizes. The system is running fine before and after a reboot. I will watch these files (along with others) in the next few days and report back should they behave out-of-line. As a final note, both the offending files (kern.log and syslog), are set to be rotated, as inspection of the files (grep helped) inside /etc/logrotate.d/ shows. UPDATE 2 The log files are actually rotated. Looks like the large sizes were attained on a single day.
i have made an Qr-Scanner now the activity has button. if i click the button it opens the scanner so i'm doing good with it, but if i go back to the previous activity without clicking the button i get the NullPointerException from the onPause() . @Override public void onPause() { super.onPause(); mScannerView.stopCamera(); } if i go to previous activity without opening the camera then it is giving the error. someone help me
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I'm trying to insert data into a Webmin MySQL Database, but every time I hit submit on my form, It doesn't put the information in the MySQL database. I ran a test and it's running all the way to the INSERT part but it still didn't put anything in the DB. I can read from it just fine, but I can't write to it. I have all the permissions, but it still doesn't work. It also get all of the variables ($tblusername, $tblemail, $tblpassword). Here's my PHP (I'm using PDO.) Please help! <?php if(isset($_POST['submit'])) { try { $tblusername = $_POST['Username']; $tblemail = $_POST['Email']; $tblpassword = $_POST['Password']; $conn = new PDO("mysql:host=$servername;dbname=mealplan", $username, $password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $conn->prepare("SELECT UserName FROM tblUsers"); $stmt->bindParam(1, $tblusername, PDO::PARAM_STR); $stmt->execute(); if($stmt->rowCount() > 0){ die("Username already in use!"); }else{ $sql = "INSERT INTO `tblUsers` (`UserName`, `Email`, `UserPassword`) VALUES ($tblusername, $tblemail, $tblpassword)"; $stmt = $conn->prepare($sql); $stmt->execute(); } } catch(PDOException $e) { echo "<style>.hidden { visibility: visible; } .shown { visibility: hidden; font-size: 0px }</style>"; } } ?>
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example: $unsafe_variable = $_POST['user_input']; mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')"); That's because the user can input something like value'); DROP TABLE table;--, and the query becomes: INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--') What can be done to prevent this from happening?
I have 3 classes, 2 service layer classes are calling a utility class. Is it possible to find the name of the class that is calling my static method from within the method or is it too late at that point? I don't want to pass the class when I call it because I feel like I should be able to infer that and want to ensure that there is no room for error. Like if the wrong class is passed or if null is passed instead. Is this possible? // ClassA.java public void doSomething(){ // Logic ... ClassC.invoke(); } // ClassB.java public void doSomethingElse(){ ClassC.invoke(); // Logic ... } // ClassC.java private static final Logger LOGGER = LoggerFactory.getLogger(ClassC.class); public static void invoke(){ String callingClass = // findClassingClassName LOGGER.info("ClassC::invoke was called by: {} @ {}", callingClass, LocalDateTime.now()); }
I need to find the caller of a method. Is it possible using stacktrace or reflection?
I know that we can call a C# method from a Java program. I want to know if it will affect the performance of the Java program. Also, do you recommend using it or not?
Does anyone have a good solution for integrating some C# code into a java application? The code is small, so I could re-write in java, but I would rather reuse the code if possible. Don't repeat yourself, etc. Also, I know I can expose the C# as a web service or whatever, but it has some security/encryption stuff in there, so I would rather keep it tightly integrated if possible. Edit: It's going to be on a server-based app, so "downloading" another runtime is irrelevant.
It's so easy to do in a chat room. I just do this: . I want to capture that same benign, eye rolling, gently mocking disdain - but I have to stick to small words. An example of an actual circumstance (true story) after which I might want to use such a phrase or word is when he ever-so-patiently explained to me that "rocket surgery" was an incorrect use of idiom. Perhaps a quote? I realize that this question is at least borderline for the site. If you feel I've crossed that line please edit if you feel that the question is salvageable. EDIT: He's 56. Perhaps an instantly recognizable (to an American of his age) quote from pop-culture? Kind of like the way I might say, "Laugh it up, Fuzzball" to someone my age (46) who is very much enjoying the fact he's winning a card game?
I occasionally use "retarded" when chastising myself or other friends. I know it's not Politically Correct, but am I only allowed to say stupid? How long before we can't say that anymore? Other words like "ignorant" don't work well because well, I don't like that word because it's misunderstood (even though it works well for how I say retarded . . for me it's like if you don't know something you should know).
Can someone PLEASE help me with this. Thank you The solutions of the equation $z^{100}=1$ are $1, w_1, w_2, w_3, \ldots, w_{99}$. Prove $1\times w_1\times w_2\times ...\times w_{99} = -1$.
I need to show that the product of all the $n$th roots of unity is $(−1)^{n+1}$. Is there a way to do this by induction? If there is, I can't seem to figure it out. Are there other, perhaps more efficient, methods of proof?
Why did Dumbledore drink the potion? How did that help to find the horcrux?
When Albus Dumbledore finally reaches the island with Harry Potter and finds out that you can't get near the potion, he made a cup and drank it. Why couldn't he just have poured the potion on the "floor"? Why couldn't he have made a big cup to hold almost everything inside the basin?
Recently we had a baby and planning to buy a home. Is now a good time to buy a home? In my area houses are around 650K. I have the following questions. Is it good time to buy a home? Interest rate mortgage companies are charging @ 5-5.25%. Is it high? Is it really worth it or stay in a rented home? Mortgage company asking us to put 72K down payment but we have only 20K. What should I do now?
I am currently renting, but am considering buying a house in the future (1-3 years). I want to know if I should even consider waiting for a future recession to buy a home at a better price. Some would argue that we are due for a recession (seems common enough to not need a reference), though none of us can know this is imminent with certainty. I would not mind waiting to buy if it means my money would go further. However, if I wait and the market does not come down, I risk the inverse as the cost of homes in my area is rising faster than inflation. All other considerations aside, should I wait for a recession to buy a home and what other risks does this carry?
I am trying to evaluate the following integral using the residue theorem: $$\int_0^{2\pi} e^{ \cos(\theta)} \cos(n\theta) d\theta$$ I have already evaluated $\int_0^{2\pi} e^{e^{-i\theta}} e^{i n\theta} d\theta$ using the residue theorem by making the substitution $z = e^{i\theta}$ and then finding the coefficient of the $z^{-1}$ term in the Laurent series expansion. Now, however, this no longer works, so any help would be appreciated. Thank you.
The following integral should be doable using the residue theorum: $$\frac1{2\pi}\int_{0}^{2\pi}e^{\cos\theta}\cos(n\theta) \,d\theta$$
I am preparing a bilingual document and using the to distinguish between the two languages. When I use the special character ß in a comment environment then I get an error message (Undefined control sequence.) although I use \usepackage[latin1]{inputenc} correctly. Outside of the comment environment the character works fine. The document class seems not to matter - I have the problem with scrbook and book. \documentclass[]{scrbook} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[ english, ngerman] {babel} \usepackage{comment} \includecomment{Version-DE} \excludecomment{Version-EN} \begin{document} ß % <-- no problem here \begin{Version-DE} Version-DE ß % <-- big problem here! \end{Version-DE} \begin{Version-EN} Version-EN \end{Version-EN} \end{document} I am not sure what tags to use here... For Future Reference I have found some other packages that maybe could be an alternative: (recommended by the author of the tagging package Brent Longborough, see ) --> seems to be pretty robust and flexible so far (extra "s") Here's all the packages of this kind (con­di­tional type­set­ting) on CTAN:
I noted that if I use comment.sty and a there is a block of text containing UTF8 characters inside a comment environment, the compilation aborts! Minimal Example \documentclass{article} \usepackage[T1]{fontenc} \RequirePackage[utf8]{inputenc}%this file is stored as UTF8 file! \RequirePackage{comment} \specialcomment{privateSolution} {\begingroup\itshape\noindent\textbf{Solution}\\} {\endgroup} %\excludecomment{privateSolution}%Use it to remove solutions! \begin{document} \title{Comment.sty and UTF8 test file} \maketitle \section{UTF8 character test} In which alphabet characters àìùòè are common? \begin{privateSolution} The Italian alphabet contains àìùòè. \end{privateSolution} \begin{comment} The Italian one! It contains àìùòè. \end{comment} \end{document} Has anyone the same problem? Any workaround? Thanks in advance.
I'm looking for aerial LiDAR or terrestrial laser scanner data in laz or las format preferably from an FTP site. Does anyone know which countries have that data available to the public? From my research it doesn't seem to be easy to come by.
Is there any freely available pointcloud data? I'm especially interested in dense clouds of small areas(5m to 100m radius) but anything else would be fine too. I've found that these pages have very nice and easy to access point cloud data.
So I was walking on some subset of a spherical metric, when I came across an idea that I haven't yet been able to disprove or shake. It goes as follows: Let the rational numbers be countable an lie dense in the real numbers. Then the irrational numbers must also lay dense in the reals. Proof: Suppose $x,y$ real numbers and $x\neq y$, assume without loss of generality that $x<y$. Then there exists a rational number $q$ such that $x+\pi<q<y+\pi$, so $x<q-\pi<y$, which is irrational. $\blacksquare$ Take any arbitrary 2 elements $x,y$ from the irrational numbers. Then because the denseness of the rationals, there lies a rational $c$ inbetween. Take any arbitrary 2 elements $p,q$ from the rational numbers. Then because of the denseness of the irrationals, there lies a rational $c$ inbetween. On a first glance, this would suggest that the cardinality of the irrationals is equal to the cardinality of the rationals. This is obviously not true. The question is, why not? For this I have been unable to find a rigorous argument that does not use the fact that the reals are uncountable. PS: I'm aware of: . This question does however not have any satisfactory answers because they are all either built on intuition (This question specifically looks at rigorous ways to prove this.) or use the uncountability of the reals (I already know this proof. I'm looking for an alternative.)
I've been told that the rational numbers from zero to one form a countable infinity, while the irrational ones form an uncountable infinity, which is in some sense "larger". But how could that be? There is always a rational between two irrationals, and always an irrational between two rationals, so it seems like it should be split pretty evenly.
What is the fastest way to count all set bits? The number from which I am counting bits is from 1<=n<2^63, only positive values. For now I use bitset from the library and it is pretty fast, but if there is any faster option I would like to know. In the worst case scenario I have over 1 billion iterations, so I am looking a way to speed it up. This is the part of my loop where I am counting the setted bits: if (std::bitset<64>(currentNumber).count() == numofOnes) ++counter;
8 bits representing the number 7 look like this: 00000111 Three bits are set. What are algorithms to determine the number of set bits in a 32-bit integer?
As my further preparation to Putnam competition, I came across such inequality to prove: $$\forall n \in \mathbb{N}: \int_{0}^{\pi} \left|\frac{\sin(nx)}{x}\right|dx \geq \frac{2}{\pi}\sum_{k=1}^{n}\frac{1}{k}$$ The problem is that I got stuck in spite of spending by far 6 days on this problem! Because I got really stuck, I am very determined to see how to prove such inequality. Help very, very appreciated!
Show that,$$\int_0^\pi \bigg|\dfrac{\sin nx}{x}\bigg|\mathrm{d}x \ge \dfrac{2}{\pi}\bigg(1+\dfrac12+\cdots+\dfrac{1}{n}\bigg)$$ I could not approach the problem at all. Please help.
Can some one please help me write an ls command to list files starting with abc (abc*.txt) and exclude the ones containing _DEL_ in the name (abc*_DEL*.txt) I am trying something like this: ls abc*.txt --ignore "abc*_DEL_*.xt"
There are plenty of situations where the use of a * is virtually inevitable - e.g. rm -rf * in a folder that holds thousands of subfolders and files. But what if you want to exclude just one or two files or folders from the rm command? I've googled my way around and only found quite complicated solutions like find . -depth -not \( -name 'one' -o -name 'two' \ -o -name 'three' \) -exec rm {} \; as stated . Is there a possibility to do this in an easier way - without that detour to find? E.g. rm -rf --exclude='one' --exclude='two' --exclude='three' * like in rsync or just rm -rf -e 'one','two','three' *? Maybe even a general possibility to exclude things from * (so other commands like cp, mv, ... don't have to implement their own)? Something like *{'one','two','three'} or so?
Good afternoon, we are in process of renovating a small apartment that has been gut renovated in 2000. We want to move a door position 40" to the right and install a pocket door instead. The metal studs we need to remove are not layed directly on the floor but have some kind of wood support at the bottom. we do not know if the wall is load bearing or not. Attached are the pictures. thank you [![door to be moved][1]][1] [![JOIST FRAMINGJOIST FRAMING SECOND FLOOR][![LEGEND][2]][2]2]
Other than looking up blue prints, which many homeowners may not have, are there ways to determine if a wall is load bearing? Methods I can think of might include: Going up in the attic to check if ceiling trusses run perpendicular to the wall If the wall is an exterior wall Any others?
Why do a candle's flame always point upwards opposite to gravitational force? Why does not it point sideways or upwards?
I was watching today, and noticed this: in some moment the space station changed orbit and the people inside experienced zero-gravity. At that moment, a candlestick passed floating in the air, with the candles burning (). But in our environment the flames go upward because the hot air is less dense, and that effect should disappear when no gravity is present, am I right? How would a candle flame look then?
I need an echo server on my Linux/Debian for debugging purposes , I realized that there is an assigned port shown in '/etc/services' to do that already and it's port 7 TCP/UDP. Is it possible to open this port on Linux (Debian)? if not, what are alternatives?
in order to enable the echo service we need to add the echo lines as the following example : more /etc/inetd.conf echo stream tcp nowait root internal echo dgram udp wait root internal the question is about security issues that can be regarding that echo service is enables is there any security problem on my linux machine when we open the echo service? If yes please explain what security problems can appears when the echo service is open?
I see this post and I am stunned. I think this is fallacious but I can't figure where is the fallacy? If you know the fallacy. Please post a answer.
What is wrong with this proof? Is $\pi=4?$
In my physics textbook there is a chapter on waves. Now there is a topic on interference. I don't understand why I get additional energy there. Suppose two waves presented as $Y_1=3\sin(\omega t)$ and $Y_2=3\sin(\omega t)$ now if I add their energy I get total $\text{intensity}=\frac{k}{2}\cdot 3^2+\frac{k}{2}\cdot 3^2$. but again these waves are superimposed if F see this from another viewpoint then I get total $\text{amplitude}=6$. So $\text{energy}=\frac{k}{2}\cdot 6^2$ where $k$ is constant. So where does the energy go? and I tried Googling it, there t found that it's simply rearrangement of energy. But I think that doesn't explain this. And terribly sorry for my bad english
What happens to the energy when waves perfectly cancel each other (destructive interference)? It appears that the energy "disappear" but the law of conservation of energy states that it can't be destructed. My guess is that the kinetic energy is transformed into potential energy. Or maybe it depends on the context of the waves where do the energy goes? Can someone elaborate on that or correct me if I'm wrong?
I forgot my password on a Windows 10 machine. So I tried the offline nt password registry editor to clear it. But whenever I start the cd, it cannot find the partion: Does someone know how to fix this?
I accidentally disabled my admin account. After I login to another account I found I can not get admin rights, because all admin accounts on my computer are disabled. I clicked on 'run as administrator' but only see a smart card choice (all the admin accounts are disabled so no choice provided) I don't want to re-install my OS, help! Details: I have account A on my computer. I got a new computer so I want to give the old one to my mother. Creating a new user account B for her and disable account A. Logout and restart. Successfully login B, now I found I could not get admin rights because no account choice is provided. More informations about my machine: OS is Windows 10 and my admin account is a Microsoft Account. I have an arch-linux installed on my computer and dual-boot it using GRUB, so maybe I can not use safe mode.
I saw it's been answered before but I could not understand the answers as it delved into material that I did not study yet. My question is as follows: Suppose $p \in F[x]$ is the minimal polynomial of some matrix $A \in M_n(F)$ and $F \subseteq K$ I need to show that $p$ is also the minimal polynomial of $A$ over the field $K$. In other words: Show that the minimal polynomial remains the same when we move to a bigger field. What I thought of: Obviously $p$ is irreducible in $F$, suppose it is reducible in $K$, which means there are $q,t \in K, q,t \notin F$ such that $p=qt$, now we just need to show that $q(A) \neq 0$ and $t(A) \neq 0$...But why is that so? Edit: Another way of presenting this question is "Show that if $p$ is the minimal polynomial of $A$ over the field $K$ while the entries of$~A$ are contained in a subfield $F \subseteq K$, then all the coefficients of $p$ are elements of $F$".
I think I have heard that the following is true before, but I don't know how to prove it: Let $A$ be a matrix with real entries. Then the minimal polynomial of $A$ over $\mathbb{C}$ is the same as the minimal polynomial of $A$ over $\mathbb{R}$. Is this true? Would anyone be willing to provide a proof? Attempt at a proof: Let $M(t)$ be the minimal polynomial over the reals, and $P(t)$ over the complex numbers. We can look at $M$ as a polynomial over $\Bbb C$, in which case it will fulfil $M(A)=0$, and therefore $P(t)$ divides it. In addition, we can look at $P(t)$ as the sum of two polynomials: $R(t)+iK(t)$. Plugging $A$ we get that $R(A)+iK(A)=P(A)=0$, but this forces both $R(A)=0$ and $K(A)=0$. Looking at both $K$ and $R$ as real polynomials, we get that $M(t)$ divides them both, and therefore divides $R+iK=P$. Now $M$ and $P$ are monic polynomials, and they divide each other, therefore $M=P$. Does this look to be correct? More generally, one might prove the following Let $A$ be any square matrix with entries in a field$~K$, and let $F$ be an extension field of$~K$. Then the minimal polynomial of$~A$ over$~F$ is the same as the minimal polynomial of $A$ over$~K$.
$$\int_0^{\sqrt{5}} \sqrt{4x^4 + 16 x^2} dx$$ The square root really got me confused here. I've tried using the standard trick with $x = x + \sqrt{x^2+4}$ but failed. That might still be the best approach. What's the best way to solve this and how to do it?
$\displaystyle \int\nolimits_0^8 \sqrt{x^4+4x^2}\,dx$. Alright, so I thought I had this figured out. Here's what I did: I factor out an $x^2$ to get $\sqrt{x^2(x^2+4)}$. I let $x = 2\tan(\theta)$, therefore the integrand is $\sqrt{4\tan^2(\theta) (4\tan^2(\theta) + 4)}$. Factor out a 4 and it becomes $\sqrt{(16\tan^2(\theta) (\tan^2(\theta) + 1))}$ Which equals $\sqrt{16\tan^2(\theta) \sec^2(\theta)}$ This is easy to take the sqrt of. The integrand becomes $4\tan(\theta)\sec(\theta)$. Now, the integral of this is $4\sec(\theta)$ And it's evaluated from $0$ to $\arctan(4)$ right? Because as $x$ goes to $0$, so does $\theta$, and as $x$ goes to $8$, $\theta$ goes to $\arctan(4)$... But the end result $(4 (\sec(\arctan(4)) - 1) )$ isn't the correct answer I put it into WolframAlpha and I get $(8/3) (17\sqrt{17} - 1)$, which is the right answer. How did they get that? (there's no "show steps" option) Any help is greatly appreciated! PS, what's the syntax for doing sqrts and exponentials?
I first experienced this today, when I flagged a question for the first time on the StackApps Q&A. When I had flagged the question, I went back to my profile where I couldn't find a link to my flag summary. There is no "helpful flags" link Then I went to my StackOverflow profile, on which the "helpful flags" link was already present. I copied the link http://stackoverflow.com/users/flag-summary/1419007 and changed the site and userId (http://stackapps.com/users/flag-summary/12680. At this page, I was able to see that my flag had not been processed yet. However, the "helpful flags" link did not appear on my profile until the flag got approved (about 6 hours later). I think it's unnecessarily confusing that you can't see* which posts you've flagged until at least one of your flags gets approved. I'm not sure if this is by design (although it appears to be ), but in my opinion users should be able to figure out where their flags went, especially if they are new to a site (meaning they didn't flag anything before). TL;DR: The "helpful flags" link doesn't appear until at least one of your flags gets approved. IMO, this should be changed so the link will be displayed if you've got any pending flags as well. * Okay, technically you can see it. But new users don't even know where to find it, and even more experienced users will have to dig to get there.
The Problem Currently if I flag a post, I cannot check the status of the flag unless I have prior helpful flags. This means, for example, that a new user who wants to check the status of his first flag cannot do so while it is pending (active). This feature request is based on my experience on MSO, where I wanted to check the status of my flag but could not get to the summary page without cheating (tweaking my SO link to work with MSO). It also stems from this question, where the OP indicates he had the same issue: My Proposal If I have flagged any post, then show me a "flags" link (red arrow in image below). If I have any helpful flags, then the number of helpful flags should be displayed (blue arrow). If I have not flagged anything, then neither should be displayed (as with current site functionality).
If we have two positive compact , self adjoint operators; $A$, $B$. Is the product $AB$ a positive operator?
I want to show that for $S,T\in B(H)$ bounded operators on Hilbertspace with $S\geq 0,T\geq 0$ and $ST=TS$, we have $S+T\geq 0$, and $ST\geq 0$. $T\geq 0$ means $(Tx,x)\geq 0$. To me it seems that $((S+T)x,x) = (Sx,x)+(Tx,x)\geq 0$. But for $ST$ i like some help. There is a theorem in Rudin (12.32) that says that for every $T\in B(H)$ we have an equivalence: $T$ is positive $\Leftrightarrow$ $T$ is self adjoint, i.e. $T=T^*$ and $\sigma(T)\subset [0,\infty)$. Since $S, T$ are self adjoint we know that $ST=TS = S^*T^* = T^*S^*$ ($ST$ is selfadjoint since $S,T$ commute). Also I read somewhere that if $S,T $ commute then $\sigma(ST)\subset \sigma(S)\sigma(T)$, but I am not sure if this is true. Clearly I cant prove it, but if it were true by this ''Theorem'' it would follow that $ST \geq 0$. Is there a more straightforward way?
Im appending an input to my html markup but my event listener not working on this input here is my code: $('button').click(function(){ $('body').append('<input>') }) $('input').on('keydown',function(e){ if(e.keyCode==13){ alert('ok') } }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button>Click me</button>
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
I am trying to build a calendar using this which uses backbone and the jquery FullCalendar plugin. I want to attach a click event handler to a cell(weekday view) of the calendar-this is the code I tried for testing: $(document).ready(function() { $('.fc-event-time').click(function() { alert('test'); }); }); The above does not work.fc-event-time is the class associated with the cell that contains the time.Here is an image of the cell with some notes in it. The whole calendar is created with JS.The only HTML required is a div named calendar.Can that be the reason why the event handler cannot be attached. Look at some code to see what I am talking about: <script type='text/javascript' src='js/fcalendar/fullcalendar.js'></script> <script type="text/javascript" src="js/underscore.js"></script> <script type="text/javascript" src="js/backbone.js"></script> <script type="text/javascript" src="js/fcalendar/apllication.js"></script> <script type="text/javascript" src="js/fcalendar/custom_cal_code.js"></script> <div id='calendar'></div> fullcalendar.js is the file the created the calendar inside div#calendar.Application.js is the backbone code(REST,render functions,models etc) which adds some functionality to the calendar and custom_cal_code.js is my code you see above-which tries to attach the event handler.Jquery dependencies are not shown above for the sake of brevity.
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
I'm working on an Earth model and when I apply its textures I get them repeating instead of being applied only once. Im still new to Blender, I would appreciate some help
I'm trying to unwrap a UV Sphere and I can't seem to get a perfect projection. What process should I follow to get a perfect UV unwrap that looks like the black grid lines in this image?:
I have notepad opened and added as a game, while having its name changed to "with your feelings.." so my message is "Playing with your feelings..". Whenever I play another game, it will instantly change my custom message and it will say "Playing Counter-Strike: Global Offensive" instead. I want to make it so my custom message, "Playing with your feelings..", is shown no matter what other game is on. I don't want my custom message to get changed to "Playing Counter-Strike:Global Offensive" nor any other message. Is there any way of doing this?
I've been looking for the solution to this for a while and even tried my own. I'm trying to change Discord to always show my custom message, but when I play games like Rocket league and LoL the game's name goes over my message. Those are verified games so I can't change the name for those, I also can't change the file now for league because then the client won't work and idk what other files to change if I do change that. If you could help I would appreciate it but seems like there's no solution.
I thought I would share with the community my somewhat unique spin on targeting elements that contain keywords of text, yet ignoring capital letters, then finishing off with a little CSS to the element. I don't every proclaim my code I use is ever perfect, but please if you see improving, feel free, enjoy.
Is there a case insensitive version of the jQuery selector or should I do the work manually by looping over all elements and comparing their .text() to my string?
Let's consider values $z_1, \dots, z_m$ and the minimizer of the function: $$ \min_q (1-\tau) \sum_{z_i<q} (q-z_i) + \tau \sum_{z_i \geq q}(z_i -q)$$ Why does minimizing this function gives the $\tau \%$ quantile? If I plug $\tau=0$ or $\tau=1$, the formula makes sense. But for $\tau \in (0,1)$, how can we prove that the formula gives indeed the $\tau\%$ quantile?
I am trying to understand the quantile regression, but one thing that makes me suffer is the choice of the loss function. $\rho_\tau(u) = u(\tau-1_{\{u<0\}})$ I know that the minimum of the expectation of $\rho_\tau(y-u)$ is equal to the $\tau\%$-quantile, but what is the intuitive reason to start off with this function? I don't see the relation between minimizing this function and the quantile. Can somebody explain it to me?
I'm beginning with the regression analysis and I'm quite confused with the generalized linear regression. I understand, that the ordinary linear models can be described with a formula $$ y_i = \beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_n x_n + \epsilon_i $$ and when using generalized linear regression I'd expect it to be something like this $$ g\left(y_i\right) = \beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_n x_n + \epsilon_i, $$ $g$ being the link function. But, instead I came across this formula $$ g\left(E[\mathbf{y}]\right) = \mathbf{x'}\mathbf{\beta} $$ and I don't get, what's the expected value in the left doing there. Could you, please, explain it a little?
I have scoured around, reading posts on Cross Validated () and also looking at references including Dobson and McCullagh and Nelder, e.g. so I am aware that this topic is well trodden. Nevertheless, I am trying to articulate and formalize my understanding of GLM and while several posts have helped me with that, I am conscious of gaps and the possibility of an unsound foundation of my understanding. In simple linear regression we have some set of observations $(x_i, y_i)$ pairs and treat $y_i$ as a realization of a random variable, $Y_i$, distributed as $Y_i \sim N(\mu_i, \sigma^2)$. The means ($\mu_i$) depend on the predictor but the variance is constant. We model $\mu_i = \beta_0 + (\beta_1 \times x_i)$ (or matrix equivalent ) which I believe is the same as saying $Y_i = \mu_i + \epsilon_i$ with $\epsilon_i \sim N(0,\sigma^2)$. I am not sure but I think a correct way to state $\mu$ is $\mu_i = E[Y_i|X=x]$. Can someone confirm that? Anyway, we might transform the response to achieve linearity (maybe taking logs) and in that case we are modelling $log(Y_i) = \alpha_0 + (\alpha_1 \times x_i) + \epsilon_i$ where $\epsilon_i$ now is assumed to have a log normal distribution. We generalize by decomposing the model into: A structural component ($\beta_0 + (\beta_1 \times x_i)$) A link g(.) A response distribution (or random component) (member of the exponential family - Guassian, bin,gamma etc) Let's say that the observations are assumed to come from a distribution in the exponential family and to keep things simple assume that it is the Gaussian distribution. Again, the expected value comes out as $E[Y_i|X=x] = \mu_i$, but does so from the first derivative of the b(theta) term in the exponential family form () (pg 29). In the case where we assume a binomial distribution, the expected value comes out at np but it still comes from the first derivative of the b(theta) term when the distribution is expressed in the exponential family form. Note, I don't fully appreciate or understand the derivation of the mean or variance at this stage, perhaps someone could provide a layman's explanation? Instead of modelling the mean as was done for simple linear regression, we now model a transformation of the mean so instead of saying $\mu_i = \beta_0 + (\beta_1 \times x_i)$ we are saying $g(\mu_i) = \eta_i = \beta_0 + (\beta_1 \times x_i)$ where g is some link function (invertible and differentiable). I think this is a key (yet still somewhat confusing to me) distinction between SLR and GLM. In SLR we transform the response ($y_i$) and model that, in GLM we transform the expected value ($\mu_i$ in the case of the Gaussian example) and model that. Another way of saying it is that in the SLR case we model $E[g(Y_i|X=x)] = \beta_0 + (\beta_1 \times x_i)$ but in the GLM world we are modelling $\eta_i = g[E(Y_i|X=x)] = \beta_0 + (\beta_1 \times x_i)$. My question is around verifying my understanding and statement of the essence of the foundations of GLM and the differences between GLM and the traditional linear model. Thanks.
I see many examples that attach custom properties to objects eg. bpy.types.Object.mytype = bpy.props.StringProperty() What are the other useful places to put custom properties. In particular I want to store a global to the blend file itself? len(dir(bpy.types)) # -> 3282! I see there is a type BlendData
I need to store additional information in a .blend file, that occurs only once per file. So, attaching it to, for example, bpy.types.Scene doesn't help. Since bpy.data is an instance of bpy.types.BlendData, I tried attaching properties to bpy.types.BlendData. This failed: >>> bpy.types.BlendData.testProp = bpy.props.StringProperty() >>> bpy.data.testProp (<built-in function StringProperty>, {}) Here, bpy.data.testProp is not a string, but some tuple, So it looks like registering properties on bpy.types.BlendData is not supported, like it is for bpy.types.Object: >>> bpy.types.Object.testProp = bpy.props.StringProperty() >>> bpy.data.objects['Camera'].testProp '' Is it somehow possible to attach properties to bpy.types.BlendData? Are there other ways to register global data in a .blend file?
First I've checked it by putting $n=3$. Then, I've assumed it to be true for $n=k$ to get $k!>k^{\frac k2}$. Then, putting $n=k+1$, I get $(k+1)!=k!(k+1)>k^{\frac k2}(k+1)$. Now, I'm stuck and couldn't proceed further.
Show that if $n>2$, then $(n!)^2>n^n$. My work: I tried to apply induction. So, at the induction step, I need to prove, $n^n>(n+1)^{n-1}$ Here, I tried to use induction again without any luck. I also took log of both sides, but I did not get anything. Please help!
I manage an application that has multiple users entering data through a web front-end into an MSSQL database. Each individual 'record' can have around 100 database columns across multiple tables (sometime multiple rows in the same table). It is relatively trivial to write SQL queries that will output 1 row per 'record' with all the columns we require for reporting purposes, for example: Assessor Date Length Colour Weight Steve 2/4/17 23.4 NULL 45 John 4/4/17 NULL Blue NULL Brenda 4/4/17 NULL NULL NULL I want to produce a simple output that lists everything where data was not recorded i.e fields that remain NULL. For example: Assessor Date Field Steve 2/4/17 Colour John 4/4/17 Length John 4/4/17 Weight Brenda 4/4/17 Length Brenda 4/4/17 Length Brenda 4/4/17 Colour Brenda 4/4/17 Weight Currently I've tried something along these lines: select assessor ,date ,Field = 'Length' from dbo.table1 where [Length] is NULL UNION ALL select assessor ,date ,Field = 'Colour' from dbo.table1 where [Colour] is NULL UNION ALL ... Is there any way to produce my required output without building such a long list of unions? I've looked into UNPIVOT however this appears to exclude NULLs.
Consider the following table: id title genre1 genre2 genre3 genre4 genre5 1 Movie1 Thriller Crime NULL NULL NULL 2 Movie2 Fantasy NULL NULL NULL NULL 3 Movie3 Political Philosophical Historical NULL NULL 4 Movie4 Science Fiction NULL NULL NULL NULL When I unpivot genre1, genre2, ... the NULL values are removed, so that, for example, the rows for Movie1 would be: id title genre original_column 1 Movie1 Thriller genre1 1 Movie1 Crime genre2 Is there a way to include NULL values, for example: id title genre original_column 1 Movie1 Thriller genre1 1 Movie1 Crime genre2 1 Movie1 NULL genre3 1 Movie1 NULL genre4 1 Movie1 NULL genre5 I can SELECT ISNULL(genre1, '*'), ISNULL(genre2, '*') ..., but suppose I want the values to appear as NULL? Is there a better way than: WITH -- SELECT that unpivots table AS unpivoted SELECT unpivoted.id, unpivoted.title, ,CASE unpivoted.genre WHEN '*' THEN NULL ELSE unpivoted.genre END ,unpivoted.original_transaction FROM unpivoted Also, I notice that the query that returns the source data to be unpivoted MUST have an alias. For example: SELECT ... FROM -- *must* give it an alias or it's a syntax error (SELECT ... FROM) AS source UNPIVOT(genre for original_column IN (genre1,genre2, genre3,genre4,genre5)) Does anyone know why? I have not found a way to refer to the alias anywhere in the query.
How can I safely upgrade an Ubuntu installation from one release to another? What should I do before upgrading to ensure it goes smoothly, and is there any clean-up I need to do afterwards? In particular, do I need to do anything special if I am using packages from PPAs, if I have a graphics card that needs drivers, or if I'm running a custom Linux kernel? This is a general question , but as example we take Ubuntu 12.04 and Ubuntu 12.10
What are the different ways I can use to upgrade Ubuntu from one release to another?
I'm using MCP4725 () module, VCC is connected to a 4096V reference voltage. there's a steady 23mV offset: 0 - 23mV 50 - 73mV 100 - 123mV ... How can I zero this offset error? From the datasheet:
This DAC has an output range of 1-3 volts. Here's the datasheet: I'm getting pulses with different amplitudes, frequencies, duty cycles and widths varying from 0.2 ms to 2 s from the DAC. I want an output range of 0-4 volts instead (Vcc=5v). I tried a high-pass RC filter, and then amplified it with an op-amp, but the output doesn't look like a pulse anymore. Also, I tried the circuit suggested in the datasheet (page 8) with no luck. I'm not sure what values I should assign to this circuit, since I don't understand how it functions. How should I go about this?
I want to recreate the following: What I have is this: \begin{equation} \label{eq1} \begin{split} \nabla f(x_i) = \nabla f(x_i, y_j, z_k) & \approx ( \dfrac{1}{2} \left( f(x_{i+1}, y_j, z_k) - f(x_{i-1}, y_j, z_k) \right), \\ & \phantom{abc} \dfrac{1}{2} \left( f(x_{i}, y_{j+1}, z_k) - f(x_{i}, y_{j-1}, z_k) \right), \\ & \phantom{abc} \dfrac{1}{2} \left( f(x_{i}, y_j, z_{k+1}) - f(x_{i}, y_j, z_{k-1}) \right) ) \end{split} \end{equation} Which produces this: When I try to change the size of the first and last bracket with \left and \right I get an error. How else could I adjust the sizes of the first and last bracket?
I have a multi-line equation that I want to have matching sized parentheses. The advice I read online was to use \left( equation \right. \\ left. rest-of-equation \right) . However, this syntax leaves first half of the equation unaware of what is in the second half. For example, if you include a square root term after the break, the second parenthesis will be larger than the opening parenthesis. When you are using the aligned environment to split a long equation this can look somewhat offputting. Compare the top equation to the bottom one. The parentheses match in size for the bottom equation, but the left hand parentheses for the top one is noticeably smaller. Top Code: \begin{aligned}[t] \gamma_{\text{u}} + \frac{1}{108} \left(57\gamma_{\text{er}} \right. &+ 38\gamma_{\text{se}}\\ & {}\pm \left.\sqrt{2601 \gamma_{\text{er}}^2 + 3648 \gamma_{\text{er}}\gamma_{\text{se}} + 1444 \gamma_{\text{se}}^2} \right) \end{aligned} Bottom Code: \begin{aligned}[t] \gamma_{\text{u}} + \frac{1}{16} \left(9\gamma_{\text{er}} + 6\gamma_{\text{se}} \pm \sqrt{49 \gamma_{\text{er}}^2 + 76 \gamma_{\text{er}}\gamma_{\text{se}} + 36 \gamma_{\text{se}}^2} \right) \end{aligned}