body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
I know it has been answered here that you can travel as a tourist on a business stream of subclass 600. But another online source suggested otherwise that the purpose of your trip must be that of the stream you've been granted a visa for. Also on my grant, it is stating clearly it is on a "Tourist" stream. So I'm a little worried if I should be applying for another one of a "correct" stream or not. Anyone on a similar situation recently or got any official quote from the Aussie immigration?
I have a two years Australian business visitor visa with multiple entry option. This visa lets me attend business related workshops for a project undertaken by our parent company which is located in Sydney. Now I want to explore this country and was hoping to spend my next holiday in Australia. For this purpose, do I need to re-apply for a new tourist visa or my business visitor visa will suffice all requirements?
I am running on Windows 7 and I have the habit of not turning off my computer at all. This is due to me hosting some services on my pc that have external users. The question here is, how do I lower CPU usage and power consumption to its minimum yet keep the services working? Things such as screen rendering should not need to run when i am sleeping or not using the computer. How to I tell the PC to turn off Display on the press of a button? Additionally, what else can I do to lower power consumption?
I watch a lot of movie's on my computer which is connected to my TV. Problem is i built the pc to be a gaming computer and it has the power supply to match (1200w). Is there a way to set it into a "Low power mode" whilst i am playing a movie to use as little power as possible. I am running - Windows 7 Ultimate 64bit VLC for playing movies Connect to my TV via a standard HDMI cable
I made three case that $2$ is at extreme right then we have $9\times 10 = 90$ numbers, $2$ in middle has $81$ numbers,and with $2$ in beginning has $90$ numbers. This makes $90+90+81=261$ numbers and we add the numbers with no $2$ in them, that is $8\times 9 \times 9= 648$. Thus total will be $909$. What will be the common numbers counted multiple times and how to eliminate them?
There is a number of three digits, 1 is never immediate right of 2 is? (A)771 (B) 791 (C) 881 (D)891. I faced this Question in Aptitude Competitive exam and don't know what the question actually means. Please anyone help me answering this question.
Say I have an image tag such as this: <img src="smiley.gif" alt="Smiley face" height="42" width="42"> I know I can get the src by using myImageEl.src. However, how do I get the type of the src (.gif in this case)? Basically, my end goal is to pass the file type to window.URL.createObjectUrl() let src = imageEl.src; let srcType = src.type; // Here I need to get the type let videoFile = new Blob([src], {type: srcType}); let videoSrc = window.URL.createObjectURL(videoFile);
See code: var file1 = "50.xsl"; var file2 = "30.doc"; getFileExtension(file1); //returns xsl getFileExtension(file2); //returns doc function getFileExtension(filename) { /*TODO*/ }
I have an equation y = ab + cb' How would I implement this with only NOR Gates? Thanks
I'm having some trouble understanding how I can convert a boolean expression to a NOR-gate only expression. What I'm working with looks like \$T = A B' C + A' B C' + A B\$. How would I go into implementing it with NOR gates?
I have a ProBook HP laptop with 12.04 (PB-1), it connects to the WIFI and works fine. Now, I have just installed another ProBook (PB-2) with 14.04 (not 12.04), also connected to the WIFI, and sometimes this second computer loses or slows down dramatically its connectivity. The router is configure with DHCP, and, as I can see with ifconfig, they have different IP addresses (192.168.1.41 and 192.168.1.34). Eventually, other computers/mobile devices get connected to the network, but always with different numbers, so it doesn't seem to be a collision problem. The laptop has a fresh installation, didn't change anything in its configuration. I've checked that there's an interaction between both laptops. Most of the times, PB-2 can't access if PB-1 is connected (but once I could do a speed test of both connected at the same time, and yielded similar results). Verified with firefox and chrome. (Of course, PB-1 is not heavy-downloading anything, this lasts for a week, since I first installed 14.04.) Edit: 00:19.0 Ethernet controller [0200]: Intel Corporation 82579V Gigabit Network Connection [8086:1503] (rev 04) Subsystem: Hewlett-Packard Company Device [103c:1621] Kernel driver in use: e1000e -- 24:00.0 Network controller [0280]: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter [14e4:4727] (rev 01) Subsystem: Hewlett-Packard Company Device [103c:145c] Kernel driver in use: wl The only difference is at the very end of the message: wl for the first ProBook (the one working fine), and bcma-pci-bridge for the second one (slow). Edit: The Broadcom Wireless Card indentified for both laptops is [14e4:4727] (rev 01) corresponding to this entry in the PCI.ID table: PCI.ID 12.04 LTS 14.040 / 14.10 LTS ------------------------------------------------------------------------------------ 14e4:4727 Special Case #3 Special Case #1 which reads as: Special Case #1 - This device uses the driver combination bcma and brcmsmac. It shouldn't be necessary to install anything at all. Required firmware is installed by default in the package linux-firmware. Wireless script for PB-1. Wireless script for PB-2. Wireless script for PB-1 after removing the STA driver. Edit: HW configuration of both ProBooks: 7,7GiB memory Intel Core i5-2410M CPU @ 2.30GHz x 4 Intel Sandybridge Mobile 64-bit plenty of disk in PB-2, same HD in PB-1, but here there's only some 1GB left (sharing with Windows).
I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible. What are the steps to install Broadcom wireless drivers for a BCM43xx card? I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc. lspci -vnn | grep Network showed: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b] iwconfig showed: lo no wireless extensions. eth0 no wireless extensions. NOTE: Answer below is updated every time new information is added and confirmed working.
I got a notification email that stated: The following items were added to your inbox since you last checked it on 2015-04-19: I know that is not true given that I have been checking it all throughout the year. Here is the screenshot of before clicking on the red "2" here: So I am considering this as a bug, as the expected behavior is that notifications are sent, but not with the incorrect dates as to when I have checked the inbox. Here are some of the email headers from the message. See the Date field for when this was received: From: Stack Exchange <[email protected]> To: [email protected] Reply-To: [email protected] Subject: 2 new items in your Stack Exchange inbox Date: Sun, 04 Dec 2016 03:12:49 +0000 Message-ID: <2.615c3af0158722959802@NY-WEB05> Here is a screenshot of the gmail interface view of the message:
I am subscribed to get my unread inbox items every 3 hours. It's working well, but today I noticed something quite weird: For sake of future search, adding the text: The following item was added to your Stack Exchange global inbox since you last checked it on 2015-05-18 But that's just not true, I checked my inbox yesterday. Not 7 months ago. Can it be fixed, or did I miss something? Even going to my did not "fix" this, got today another email with the same date as yesterday.
I created a site where the guest users can edit their personal information. the operation should be on the Account object.so I created a extentsion submit which will save the edited info by a user. It worked fine in the developer mode when I put that page in sites it's not updating the information on the lead record. when I went to public access settings and checked there are no modify permission for accounts on sites. how can I achieve this task through sites? I want to update the record not insert the record. public Without Sharing class ExtensionExample{ public String currentRecordId {get;set;} public String parameterValue {get;set;} List<Account> accRecords = new List<Account>(); public Account acc{get;set;} public string accountName; public id accID; public ExtensionExample(ApexPages.StandardController controller) { currentRecordId = ApexPages.CurrentPage().getparameters().get('id'); acc = [select id ,name, AccountNumber, Type, Industry from Account where id =: currentRecordId ]; parameterValue = ApexPages.CurrentPage().getparameters().get('nameParam'); } public void doSubmit() { accountName = acc.name; accID = acc.id; accRecords.add(new Account(id= accID, name=accountName)); update accRecords; } } // vf page <apex:page standardController="Account" extensions="ExtensionExample"> <apex:form > <apex:pageBlock > <apex:pageBlockSection title="Current account record Id is : {!currentRecordId}" collapsible="false"> <apex:InputField value="{!acc.name}"/> <apex:InputField value="{!acc.AccountNumber}"/> <apex:outputField value="{!acc.Type}"/> <apex:outputField value="{!acc.Industry}"/> </apex:pageBlockSection> <apex:commandButton value="Submit" action="{!doSubmit}"/> </apex:pageBlock> </apex:form> </apex:page>
I have a client who wants external users to submit data via a Sites VF page and update Opportunity records. Of course the Sites profile doesn't have permissions to update standard objects. Also, the client does not want to purchase portal licenses for these external users. I am considering two workarounds and am wondering if they are possible: 1 -- Write some Apex webservices and call them from the Sites page Visualforce controller. Is it even possible to call your own webservices from a controller? I presume the webservices would be running in system context? 2 -- Have the Sites page create a custom object record instead, and then write a trigger to update the opp record using the custom object. Will the trigger be running in the system context and be able to update the opp? Thanks David
One source of light is, IIRC my high school physics, when an excited electron jumps back to its normal position. This jump generates a photon. How can an event like that shoot of a particle at the speed of light? Why isn't it this photon moving much slower? Other particles can move at almost the speed of light but typically is much slower..
An excited electron loses energy in the form of radiation. The radiation constitutes photons which move at a speed $c$. But is the process of conversion of the energy of the electron into the kinetic energy of the photon instantaneous? Is there a a simple way to visualize this process rather than math?
I have an array of words and and I would like to remove all words that contain any unusual characters like umlauts, accents, etc. (I know there are ways to normalize them to regular characters instead, but I specifically want to remove them). My idea so far is to create an array of accepted characters (letters a-z), because this is easier than making a blacklist accounting for all possible combinations of letters and accents, and go through my array of words checking if the word has any characters other than the accepted ones. I've found article that describes the opposite, removing all words that do contain a certain characters: filtered_tokens = [w for w in tokens if all(ch not in w for ch in accepted_characters)] unfortunately a simple negation doesn't make this work for my problem. I'm open to suggestions and new approaches altogether, but ideally I would like to get this to work with no additional packages besides maybe nltk, which I am using to extract my words from a text.
I want to I check whether a string is in ASCII or not. I am aware of ord(), however when I try ord('é'), I have TypeError: ord() expected a character, but string of length 2 found. I understood it is caused by the way I built Python (as explained in ). Is there another way to check?
My company's website ranks highly for many relevant queries, and it ranks #1 for an exact domain match. So, that's going well. But for some reason, I can't seem to get Google sitelinks in the SERP. My competitors seem to get sitelinks for EDM, and often times they get sitelinks (and I don't) even when they rank below me in the SERP. The injustice! What am I doing wrong? I have a theory that it might be because my site blog (which has globally relevant content) uses a different navigational structure, is written in Wordpress (the rest of the site isn't), and is only loosely coupled to the rest of my site. On top of that, according to GA impressions and clicks for my blog posts exceed the hits on my local content by several orders of magnitude. So, my theory is this: Google considers my blog to be the meat and potatoes of my site. My blog follows a completely different navigational structure from the content that I want to drive (local) traffic to. The local content is deemed not relevant for sitelinks, because it isn't linked to in the nav menu of the blog. Sad puppies But if this is the case, why don't I even get a sitelink for my blog? TL;DR: I can get it up (in the SERP), but I can't deliver (sitelinks).
My website used to have sitelinks and now it doesn't. It's very possible that it's due to changing the website to a sidebar design instead of having an "interstitial" type landing page which limited the number of choices, but I'm not sure. Here is how sitelinks might look for a site: What are some things that I can do to improve my chances of getting sitelinks?
How do I judge a professor's quality while choosing a PhD? I have completed my Masters in Pure Mathematics. I want to work in fields which involve Algebra,Functional Analysis,Complex Variables. I also have my own funding to pursue my research.I have passed a qualification exam which will fund my studies for 4 years. But I have the following questions: Most of the questions asked here for example asks to visit the labs. In Mathematics we don't have any labs. I searched some Professors working in the areas I have mentioned. Some of the Professors had great citations in the period 2005-2010 but now they don't get enough citations hardly 1 or 2. Also should I try to join a reputed University as I believe all professors will have great publications there? Or should I not judge a Professor on where he/she teaches? Also it is not possible to visit every Professor personally In other words I am confused. I don't understand what to see and what not. Can you kindly say how I should judge a professor or what factors should be taken into account ?
I am planning my PhD and am applying to various labs and professors. I am getting positive responses, but I am having trouble making a decision as to which lab to go for. How can I judge the quality of research of a group? What parameters shall be kept in mind while making a decision? I usually look for relevant research interests.
I want to call a method whose name (with or without parentheses and parameters) is stored in a string variable and call this method using this variable. Until now I have found that in Java if you do this: String str = "func();"; System.out.println(str); This would call method func(). But I don't think this is recommended. So, my question is: Is it okay to do this? Is there any other way to do this? Thanks.
If I have two variables: Object obj; String methodName = "getName"; Without knowing the class of obj, how can I call the method identified by methodName on it? The method being called has no parameters, and a String return value. It's a getter for a Java bean.
I am trying to prove $|e^z - e^\omega| \leq |z - \omega|$ for $z,\omega\in\{z\in\mathbb{C}\;:\;\Re(z)<0\}$ and I get stuck in an inequality of the stated in the title : $|e^x + e^y| \leq |x - y|$ for $x,y<0$. This is what I have tried: \begin{equation}\left|e^z - e^\omega\right| = \left|e^{i\Im(z)}\right|\left|e^{\Re(z)} - e^{\Re(\omega)}e^{i(\Im(\omega) - \Im(z))}\right| \leq \left|e^{\Re(z)} + e^{\Re(\omega)}\right| \end{equation} Is it true that $|e^x + e^y| \leq |x - y|$ for $x,y<0$? If yes, any help will be appreciated. Thank you!
Came across this problem on an old qualifying exam: Let $a$ and $b$ be complex numbers whose real parts are negative or 0. Prove the inequality $|e^a-e^b| \leq |a-b|$. If $f(z)=e^z$ and $z=x+iy$, then $|f'(z)|=e^x\leq 1$ given that $x \leq 0$. I played around with the limit definition of the derivative, but wasn't able to get anywhere. Not sure what else to try; a hint would be very helpful!
I used to just add some blocks inside the water and once removing them again the water would drain away. But since 1.2 (or at least since i last played) this does not work anymore, the water just reappears behind the block. I currently just want to make a shaft downwards without water in it.
I'm trying to figure out how tunnel, both horizontally and vertically, through large bodies of water — preferably a method which can be used early in the game and which can be done with on-hand materials rather than a lot of setup. In earlier versions of the game, water was permanently destroyed by blocks placed in it, allowing tunnels to be easily created by placing blocks, then hollowing them out. As of Terraria 1.1, however, blocks seem to "store" the water they were placed in, which is then released when they are mined. The doesn't yet describe any techniques for dealing with this change.
In various episodes (such as ) 'transporter sites' appear to be used for transporting people to and from planets. Is there any particular explanation for this? From other series, and other episodes of the same series, it appears as if site-to-site transport had been perfected by that point and was no longer a formal requirement. Based on the linked question/answers, seems that the most likely relevant explanation is one of time efficiency? Within the context of the specific episode, the (large) away team was not in immediate danger. Emergency transporting each individual would have led to a slower total transport time (since locking on each signal and performing the transport would be slower), probably be more energy-expensive, and also riskier (since all calculations for the designated transport site would have had time to be optimized in advance). [Still seems rather a convenient plot device for the episode, but maybe not as terrible as it seemed on first pass]
I hope this isn't a silly question but I've been watching TNG and this bothers me. The transporter 'pad' area is relatively small. As a guess, maybe 12 people can fit on it. But the vast majority of times it's being used by 2-3 people. However, the transporter is able to beam people from anywhere on the ship to anywhere (within some distance I presume). It's fairly common for them to perform a transport directly to the bridge. So, why is there an actual room? If a three man away team is to beam down to the surface of a planet - why do they have to walk all the way to the transporter room, then stand on the pad to get down there? Why not simply beam them from where they are, to the surface. The ship's computer is able to locate anyone on board.
I am relatively new to CSS. I am trying to create a normal page layout using HTML & CSS, but I am facing an issue. Here is my HTML. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Jquery</title> <link rel="stylesheet" type="text/css" href="../css/StyleSheet1.css"> <script type="text/javascript" src="../javascript/jQuery.js""></script> </head> <body> <div class="container"> <div class="header"></div> <div class="content"></div> <div class="footer"></div> </div> </body> </html> Here is my CSS script html,body { padding: 0px; margin: 0px; color: #555; font-size: 20px; font-family: "Open Sans","lucida grande","Segoe UI",arial,verdana,"lucida sans unicode",tahoma,sans-serif; height: 100%; } .container { height: 100%; background-color: Green; position: relative; } .header { height: 300px; width: 100%; background-color: Red; } .content { width: 100%; background-color: Black; } .footer { height: 500px; width: 100%; background-color: Violet; position: absolute; bottom: 0px; } I am trying to create a header, footer and a content div. But my content div should automatically change it's height. If there is nothing inside content div then my page should at least have content height equal to (page height - (header height + footer height)).
I am working on a web application where I want the content to fill the height of the entire screen. The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom. I have a header div and a content div. At the moment I am using a table for the layout like so: CSS and HTML #page { height: 100%; width: 100% } #tdcontent { height: 100%; } #content { overflow: auto; /* or overflow: hidden; */ } <table id="page"> <tr> <td id="tdheader"> <div id="header">...</div> </td> </tr> <tr> <td id="tdcontent"> <div id="content">...</div> </td> </tr> </table> The entire height of the page is filled, and no scrolling is required. For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work. Is there a way to achieve the same effect without using the table? Update: Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%. Update 2: For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works.
How can i list all the files (and their future locations) which will be installed by invoking 'dpkg -i' on a .deb file? Which makefile target of the source package determines those (is it the default 'install' target?) (The second part of the question concerns the package creation process. I want the list of files installed by 'make install' and the list of files installed by the .deb package to be the same)
I want to see the contents of a debian package, especially if the package is properly cleaning up whatever it installs. I want to also see how it goes about installing the software, what directories it creates, symbolic links etc.
I'm using mysqli_query() with a dynamic variable $categoryName, where $categoryName will be dynamic where the category name will be fetch based on user submission from a form. Within my category name submission form there are Food, Vintage clothing, Leisure, Angel's etc... I'm still quite new to querying content from database, currently managed to come out with using mysqli_query() for querying from the database, like so: $sqlCommand = mysqli_query($conn, "SELECT * FROM products WHERE category='$categoryName'"); Everything works great and I managed to query the db with my existing category names, however there's only one which doesn't work is the Angel's category with ' apostrophe symbol in it. Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in....... I suspect there is some sort of method like filter that need to be called before mysqli_query()?
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?
How does wind cause a wind turbine (pictured) to spin? I cant find a good source on google to explain this to me. This question should help me understand better how a turbine is spun in a jet engine.
The rotor blades of a lift based wind turbine are shaped like airfoils, so the wind flowing around them creates a lift force which in turn moves them around. From a thermodynamic viewpoint and like answered in kinetic energy is extracted from the wind during this. But what goes on from a mechanical perspective? How exactly is the kinetic energy of air particles transferred onto the rotor blades via lift? None of the sites I read gave an elaboration on the how.
I am experiencing a lot of issues with the topology of a specific object I am modelling. Currently I have an issue with 'non-manifold vertices on it as shown by the screen shot below: The mesh issue I have highlighted is found by operating Select>Select all by Trait>non-manifold and checking only the 'vertices' option in options menu as pictured in the bottom left of my screenshot. I would specifically like to be able to identify what the tool Select all by Trait looks for when the 'vertices' option is selected, so I can better address my topology problem I have read a fair bit about what can cause non-manifold geometry but simply non-manifold 'vertices' doesn't really mean a whole lot to me, can anyone shed any light Here is the blend file: N.B: I have recalculated internal and external normals as well as 'merged by distance' multiple times which doesn't seem to do anything
I am not quite sure what non-manifold geometry is. I thought non-manifold geometry was just floating vertices and hole in a mesh. From my experience this is not always the case however. What is non-manifold geometry and what are the types of it and how do I avoid it? Is there a case where it is acceptable?
I am new to C++ and got this error for hours and I hope someone can help me with this. So basically I have got 2 classes: Matrix,DenseMatrix with DenseMatrix being the subclass of Matrix. For some simple mathematical operations like adding two matrices which are always the same for any type of matrix, I wanted to implement a function in the class Matrix. T &mul(const Matrix &other); The idea is that calling mul on a subclass (e.g DenseMatrix), the result will also be a DenseMatrix. However the other matrix does not need to be the same class, just any subclass of Matrix. That's why I use generic types and my classes are defined like this: class DenseMatrix : public Matrix<DenseMatrix> class OtherMatrix: public Matrix<OtherMatrix> class OtherMatrix2: public Matrix<OtherMatrix2> ... So that calling mul will return a matrix of the same type and the argument is simply a Matrix without diamond-brackets. Now the Problem is that I am getting the following error: DenseMatrix mat{6,6}; DenseMatrix mat2{6,6}; mat.add(mat2); >>> undefined reference to `Matrix<DenseMatrix>::add(Matrix<DenseMatrix> const&, int)' I was thinking that maybe I need to introduce a second generic type for the argument of the function but I am not sure how to do this. I am very happy if someone could help me with this one. Matrix.h: template <typename T> class Matrix { T &add(const Matrix &other, int threads = 1); } Matrix.cpp: #include "Matrix.h" template<typename T> T &Matrix<T>::add(const Matrix &other, int threads) { std::cout << "ADDING"; return *this; } DenseMatrix.h: class DenseMatrix : public Matrix<DenseMatrix> { }
Quote from : The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this? (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
Given a matrix $A$ over $\mathbb{R}$, define the operator norm as $\|A\|: = \sup\{\|A\mathbf{x}\| : \|\mathbf{x}\|=1\}$. If $A$ is invertible, I realize that in general we have $\|A^{-1}\|\|A\|\geq 1$. My question: What is a concrete example where this inequality is strict? I can't think of one.
I am a beginner of funcional analysis. I have a simple question when I study this subject. Let $L(X)$ denote the Banach algebra of all bounded linear operators on Banach space X, $T\in X$ is invertible, then $||T^{-1}||=||T||^{-1}$? Is this result correct?
Let $\left (a_n \right )_{n=1}^{\infty}$ be an infinite sequence. $\left (a_n \right )_{n=1}^{\infty}$ is defined by: $a_1 = 0$ $\; \; \; a_{n+1} = \frac{1}{1+ a_n}\; \; \forall n \in \mathbb{N}$ I need to show that $\left (a_n \right )_{n=1}^{\infty}$ converges and find it's limit. I want to do it by finding a formula for both $a_{2k}$ and $a_{2k-1}$ and then use some basic limit arithmetics rules, however I didn't manage to find a formula for both sub-sequences. I would love to get some recommendations on how to find such formula and how to approach these kind of questions. Thanks!
I have had big problems finding the limit of the sequence $x_1=0 , x_{n+1}=\frac{1}{1+x_n}$. So far I've only succeeded in proving that for $n\geq2$: $x_n>0\Rightarrow x_{n+1}>0$ (Hopefully that much is correct: It is true for $n=2$, and for $x_{n+1}>0$ exactly when $\frac{1}{1+x_n}>0$, which leads to the inequality $x_n>-1$ which is true by the induction assumption that $x_n>0$.) On everything else I failed to come up with answers that make sense (such as proving that $x_{n+1}>x_n \forall n\geq1$). I'm new to recursive sequences, so it all seems like a world behind the mirror right now. I'd appreciate any help, thanks!
Let V be a finite set and let $\Omega \subseteq 2^{V}$ be a nested family of odd subsets of V, where subset $A\subseteq V$ is odd if |V(A)| is odd (if A has an odd amount of nodes). Question: How do I show that $|\Omega| \leq \frac{3}{2}\cdot|V|$? I have no clue on how I should tackle this problem, thanks in advance!
Hi I have to proof that for $\Omega$ a nested family of odd subsets of $V$ with $V$ finite, we have that $|\Omega|\leq\frac{3}{2}|V|$. I can prove that for certain constructions of $\Omega$, it is satisfies $|\Omega|\leq \frac{3}{2} |V|$, the problem I encounter is that I have to proof that my construction of $\Omega$ is optimal. (Since I have to prove that this holds for every family of odd subsets) Can anyone give me a hint on how to proof that every $\Omega$ satisfies this equation. $\Omega$ is nested if for all $A,B\in\Omega$ either $A\subseteq B$, $B\subseteq A$, or $A\cap B=\varnothing$; a set is odd if its cardinality is odd.
You can make a black hole with only matter, but Hawking radiation involves the emission of both matter and antimatter. If a star made out of matter (including baryons) collapses into a black hole, and then the black hole evaporates, will Baryon number conservation be violated? Can this process be played in reverse to turn equal parts matter and antimatter into mostly matter?
The says that a black hole can be characterized by a small number of parameters that are visible from distance - mass, angular momentum and electric charge. For me it is puzzling why local quantities are not included, i.e. quantum numbers different from electrical charge. Lack of such parameters means breaking of the conservations laws (for a black hole made of baryons, Hawking radiation then is 50% baryonic and 50% anti-baryonic). The question is: If lack of baryonic number as a black hole parameter is a well established relation? OR It is (or may be) only an artifact of lack of unification between QFT and GR?
If 2 players toss a fair die, one tosses it 999 times and the other tosses it 1000 times, what is the probability that one gets more even numbers than the other? It's clearly comparing binomial distributions but I'm not sure how to do it.
First player rolls a 6-sided die 100 times and the second player 101 times. What are the odds of the second player getting more odd numbers than the first one? I tried solving this via listing the options which led to a nasty sum that I wasn't able to solve neither by hand nor by using wolfram alpha. Clearly there has to be a more clever solution using the properties of a binomial distribution, but so far I haven't come across anything useful.
My sister is using a kindle fire and I am using an IPad. How do I let her into my world and how do I go into hers? I know this question has already been answered but where do I go to find the answer to this question?
I want to invite my girlfriend to my world so she could visit my fun-fair, how can I accomplish this?
I know how to do synthetic division, but I do not understand why it works.
Synthethic division is commonly taught, but I have never actually had a proof/explanation shown to me. Why does it work? Work So Far I related the "$x$" to powers to 10, and then proceeded to relate synthetic division to non-polynomial division, but couldn't seem to find the correlation. Research So Far My teacher doesn't seem to have a valid explanation for why it works. A doesn't provide any good results either. All I seem to get is a Yahoo answers link with a badly formatted proof that makes it hard to understand and a physics forum link that links synthetic division to "normal division" by relating the "x" to 10, a conclusion I have already arrived at.
I'm trying to figure out how to update my number in a method even though I predefined a static value before it and aim to update it inside the method. Any help would be greatly appreciated. I know that I set result to 0 but my question is how would I update it? import javax.swing.*; public class Arithmetic2 { public static void main(String args[]) { double numberOne, numberTwo; String numberOneString, numberTwoString; String operation; double result; numberOneString = JOptionPane.showInputDialog("Enter the first number: "); numberOne = Double.parseDouble(numberOneString); numberTwoString = JOptionPane.showInputDialog("Enter the second number: "); numberTwo = Double.parseDouble(numberTwoString); operation = JOptionPane.showInputDialog("Enter an operator (+.-.*,/,%): "); // Call performOperation method here result = 0; performOperation(numberOne, numberTwo, operation, result); System.out.format("%.2f",numberOne); System.out.print(" " + operation + " "); System.out.format("%.2f", numberTwo); System.out.print(" = "); System.out.format("%.2f", result); System.exit(0); } // End of main() method. // Write performOperation method here. private static double result; public static void performOperation(double numberOne, double numberTwo, String operation, double result) { System.out.println("Res Equals the default 0: " + result); switch(operation) { case "+" : result = numberOne+numberTwo; break; case "-" : result = numberOne-numberTwo; break; case "*" : result = numberOne*numberTwo; break; case "/" : result = numberOne/numberTwo; break; case "%" : result = numberOne%numberTwo; break; default : System.out.println("Invalid operator!"); } System.out.println("Result New: " + result); } }
I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
If we consider two static charges in the space we know that they will experience a repulsion force according to Coulomb. If the two particles are moving along the same direction at a fixed speed (like in a particle accelerator) the charges will start to produce a magnetic field that will attract each other. When the speed is relativistic enough, the two forces are almost compensated. This is true in the frame of the lab, but what happens in the frame of the particles? Two particles traveling at a fixed speed one next to the other do not see any magnetic field, only the electric, so how they justify the fact that the force disappear? In their frame the force is still present and they will not see it disappearing, but they will simply experience the usual Coulombian force. But when we do the change of coordinates between the laboratory frame and the particles frame the time will change according to the Lorentz transformations and it will slow down, slowing down also the effect of the electric force. It is amazing that the time slows down at the same rate required by the magnetic field to compensate the electric field in the laboratory frame. In other words we could say that the magnetic field is the expression of the time dilatation applied to the electric field. What do you think?
As an exercise I sat down and derived the magnetic field produced by moving charges for a few contrived situations. I started out with Coulomb's Law and Special Relativity. For example, I derived the magnetic field produced by a current $I$ in an infinite wire. It's a relativistic effect; in the frame of a test charge, the electron density increases or decreases relative to the proton density in the wire due to relativistic length contraction, depending on the test charge's movement. The net effect is a frame-dependent Coulomb field whose effect on a test charge is exactly equivalent to that of a magnetic field according to the Biot–Savart Law. My question is: Can be derived using only and Special Relativity? If so, and the $B$-field is in all cases a purely relativistic effect, then Maxwell's equations can be re-written without reference to a $B$-field. Does this still leave room for magnetic monopoles?
For the life of me I cannot figure out how to move this partition so I can add it onto my ubuntu partition. I need to move it down two partitions so it is next to sda8, then I can add those partitions together. I cannot edit it in anyway unless I make it into a partition, But even when I do that and try to "resize/move" It only allows me to re size it. I have no clue, I have been trying to do this for over an hour. I have tried with gparted, gparted booted from a USB, the windows drive editor, and even another drive editor I downloaded onto my windows drive. Please help, thanks :)
I have some free disk space on the left of my ubuntu (sda5) What is best solution to extend sda5 ? I can copy sda3 or sda5 with dd to bigger disk. delete sda3,5,swap create sda3,5,swap dd original partition. Not sure how to do it properly. May be there is a simpler solution.
I have written the following piece of latex (ignore the formulas, don't make sense) \begin{gather} \min \quad \sum_{i=1}^{n} a_i b_i, \nonumber \\ \begin{align} \sum_{i=1}^{n} a_{i} \geq i&, & \forall i &= 1, \ldots, m, \label{eqn1} \\ \sum_{i=1}^{n} b_{i} \geq i&, & \forall i &= 1, \ldots, m, \label{eqn2} \\ a_{ij} \in \{0,1\}&, & \forall i &= 1, \ldots, n, \; \forall j = 1, \ldots, n \nonumber \end{align} \end{gather} and I get the error: ! Package amsmath Error: Multiple \label's: label 'eqn1' will be lost. From what I have found online this happens when more than one labels refers to the same equation, but I don't know how to solve it. P.S., side questions: what's the best way to align the stuff inside the align block? does not work in my case: I need to \label two lines/equations inside the inner align environment, whereas the linked answer works only if you have one label inside the align environment and the other one outside.
I have nested gather and align according to \begin{gather} \sum\limits_{i=1}^n i + \text{expression} = \dfrac{n(n-1)}{2} \label{l1}\\ \begin{align} a+\text{expression}&=b \\ %\label{l2} doesnt work c&=d+\text{expression} \\ e+\text{long expression}&=f-\text{expression} \end{align} \end{gather} to get an output looking like this: The problem is that it is not possible to label all equations separately. The problem is identical to that discussed in , except that in my problem the first line needs to be centered. Thanks for any help.
For my MAC laptop, I only have 250GB and out of this 250GB MAC is taking up 129GB in the other section. I looked everywhere to the best of my knowledge. Please note my home directories is only 45GB. Can you somehow please help me?
Every few days I get notices on my MacBook that it's running or run out of hard drive space. Curiously, restarting the computer will enable me to recover gigabytes of space (this past time, it was able to recover about 2.2GB). However, I can't identify anything in my personal activity that consumed that space. It's possible that it's a rogue iTunes podcast or a huge software update that my Mac is automatically downloading - would either of these reclaim the space upon a restart? One possibility that I can think of is that FileVault has some sort of disk leak, allocating but not freeing files. Does this make sense? Is there a tool that I can run to determine where this space is going? Assuming it is FileVault, should I try to disable it? What's the best way to turn of FileVault on a nearly full computer?
If an integral domain $R$ doesn't satisfy the ascending chain condition for principal ideals, then factorization of an element of $R$ (into irreducible elements) might fail: if you choose the wrong elements, the factorization process might not terminate. However, can it be the case, that in some such domain, a factorization still exists for all elements (or at least for some element where the factorization can fail)? It could be that maybe if you choose the correct divisors then the factorization terminates. The only example i know of a integral domain that doesn't satisfy ACCPI is $P/I$ where $P$ is the ring of polynomials of countable many variables $(x_k)$ over an integral domain $R$ and $I$ is the ideal generated by the relations $x_{k+1}^2 = x^k$. I thought of maybe trying to adjoin some new elements $y_k$ such that $x_k = y_k^{p(k)}$ where $p(k)$ is the kth prime starting at $3$ and hope those $y_k$'s turn out to be irreducible and that the result still doesn't satisfy ACCPI, as then an element $x_i$ would maybe have non-terminating factorization if you choose $x_k$'s to factorize it but would terminate if you factor by $y_i$. However this ring seems very complicated to work with and i don't have strong reasons to believe it will work.
I recently just completed an exercise which states an atomic domain $A$ is a UFD $\iff$ it satisfies the ascending chain condition on principal ideals. This is all well and good, but because this is an if and only if statement, that seems to suggest there are atomic domains that DON'T satisfy the ACCP. Does anyone know of such an example? I would imagine you need something like the algebraic numbers but I am unsure.
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: youtube-dl 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Need to get 237 kB of archives. After this operation, 1,106 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty/universe youtube-dl all 2014.02.17-1 [237 kB] Fetched 5,080 B in 3s (1,450 B/s) E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/universe/y/youtube-dl/youtube-dl_2014.02.17-1_all.deb Size mismatch E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
When I try to install updates from the update manager it says: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-3.0.0-13-generic_3.0.0-13.22_i386.deb Size mismatch I have tried several times and through terminal too but the size mismatch repeats itself there too. What is this size mismatch error? I also tried sudo apt-get update and sudo apt-get upgrade, but the error comes again. Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/x/xserver-xorg-video-intel/xserver-xorg-video-intel_2.15.901-1ubuntu2.1_i386.deb Size mismatch E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Long story short, my oldie MBP 2011' battery started bloating, I've contacted a repair service center and they advised me to remove the battery and use it on AC power, while they get a new battery for a replacement. What I've noticed a few days back, that my MBP starts extremely lagging from time to time. After a restart, it works fine for 12 - 20 hours and then the problem appears again. I've noticed that when the lagging starts, kernel_task begins consuming up to 500% CPU. So I bet that the problem's source is kernel_task, but what causes its extreme rise? Could it be a removed battery?
I'm trying to solve the mystery of a crazy high cpu usage on kernel_task. MacBook Pro (Retina, Mid 2012), 2.7 GHz Intel Core i7, Yosemite 10.10.2 I saw some advice to download the Intel Power Gadget. That showed me that the my CPU is slowing way down. How do I fix this? When this happens, I can sometimes cycle the power on the MBP. But this is driving me crazy.
The planets in the Solar System revolve around the Sun in almost circular paths called orbits. The Sun pulls the planets with the gravitational force,but the planets do not get drawn to the Sun but remain at certain distance because of the centrifugal force which acts in the outward direction (as the planets are revolving around the Sun). How did the planets start to revolve around the sun if they were attracted towards it (via the gravitational force)?
The origin of spin is some what a puzzle to me, everything spin from galaxies to planets to weather to electrons. Where has all the angular momentum come from? Why is it so natural? I was also thinking do photons spin? we always think of the wave as a standard 2d sin wave but could this rotate in 3d? What implications would this have? And what about spacetime how does all the spinning effect? This has always been avoided in all lectures and classes I ever went to.
I am a systems administrator and for many years I worked with *nix servers. My main experience programming is with Perl and shell scripting, but in my new job I've been told to learn Java and well... I'm not even interested in it. But what I am interested in is in game development, so while I don't have any interest in Java, I was wondering if I could use it to develop games? I was wondering whether this is viable and if so, what approach should I take?
I have scoured the internet, but there are not very many resources for Java game development, not nearly as many as C++. In fact, most engines are written in C++. I tried to play a game made with jMonkeyEngine, but the game was terribly slow, to the point where my computer froze. I had no other Java applications running, and nothing too resource intensive. In contrast, my computer can play most modern 3D games with ease. If I continue to learn and improve Java now, and it turns out that later I am required to learn C++, making the switch might be difficult. Is Java an acceptable language for serious game development? By serious, I mean high quality graphics, without much lag on modern computers. I also want to consider making games for consoles.
I have a 1 year Indian business visa which expires 3rd December. My international departing flight was at 2am on the 4, but has now been changed by 4 hours to 6am on the 4th meaning I will not be able to check into the flight and pass through immigration early enough to make it before midnight on the 3rd. I would now leave through immigration one day late. Can I apply for a 1-day extension to allow for this situation without any repercussions for future business visa applications. PS I am trying to cancel the flight through the airline, but in the meantime want to know my options.
I'm an Egyptian girl from Cairo. I'm planning a six-month trip to India in December for training purposes, but getting a six-month visa is so hard from my country. If I can only get 3 months instead of 6 months, is it possible to extend the business visa in India?
I have to draw texture with transparent areas on square. But I don't want this transparencies to take color from this polygon, but from the background. Do you have any good tutorial to achieve it? --EDIT-- glColor4f(1,0,0,1); glBegin(GL_QUADS); glTexCoord2f(0,0); glVertex3f(-0.5, -0.5, -1); glTexCoord2f(1,0); glVertex3f(1, -1, -1); glTexCoord2f(1,1); glVertex3f(0.5, 0.5, -1); glTexCoord2f(0,1); glVertex3f(-0.5, 0.5, -1); glEnd(); I just takes color from polygon. How to make this polygon transparent.
Good Morning StackOverflow, I'm having a bit of a problem right now as I can't seem to find a way to render part of a texture transparently with openGL. Here is my setting : I have a quad, representing a wall, covered with (converted to PNG for uploading purposes). Obviously, I want the wall to be opaque, except for the panes of glass. There is another plane behind the wall which is supposed to show a landscape. I want to see the landscape from behind the window. Each texture is a TGA with alpha channel. The "landscape" is rendered first, then the wall. I thought it would be sufficient to achieve this effect but apparently it's not the case. The part of the window supposed to be transparent is black and the landscape only appears when I move past the wall. I tried to fiddle with GLBlendFunc() after having enabled it but it doesn't seem to do the trick. Am i forgetting an important step ? Thank you :)
What is the origin of the weird phrase 'many a [singular noun]'? It's extremely odd: for one thing, 'many' here is a predeterminer (very unusual), for another, it goes with a singular noun. What is the explanation for this bizarre structure? additional question you may not answer: Is it stylistically neutral? How would it sound to a native speaker's ear? Isn't it something literary?
Can someone please elucidate the difference between "many" and "many a"? In what context of usage should we add an extra "a" beside the word "many"? For example: Many times, I had seen that . . . . Many a times, I had seen that . . . . I do not know if the example is accurate enough to support my question, but I would like to know the difference between how they are used.
MTP (Miserable Transfer Protocol) failed once again. After moving a directory to a different path, it is still on the same path as before according to MTP. I already tried re-plugging the USB port and reading it from a different computer. Same result. Why is MTP so bogus that it shows a moved folder on its previous path?
I am using HuaWeiNova device, and I tried to access it with aft-mtp-cli. $ aft-mtp-cli $ ls DCIM/ I got folders listed here: |-photos |-Camera .... When I tried to list or download my photos in the Camera/ folder, I got nothing. Only the empty folders are listed and the folders that contains files are not shown at all. I am quite sure my photos are stored in the Camera folder in my cell phone. How come I could not access my photos with my computer ?
For an F(2, 237) distribution, how should I determine a critical F value from a statistical table? Would I look up (2, 150) or (2, 300)? Should it simply be the closest degrees of freedom?
Often people use programs to obtain p-values, but sometimes - for whatever reason - it may be necessary to obtain a critical value from a set of tables. Given a statistical table with a limited number of significance levels, and a limited number of degrees of freedom, how do I obtain approximate critical values at other significance levels or degrees of freedom (such as with $t$, chi-square, or $F$ tables)? That is, how do I find the values "in between" the values in a table?
I need to start the execution of a function foo() every 10 seconds, and the foo() function takes a random time between 1 and 3 seconds to be executed. import time import datetime def foo(): # ... code which takes a random time between 1 and 3 seconds to be executed while True: foo() time.sleep(10) of course in the above example the function foo() is not executed every 10 seconds but every 10 + random seconds. Is there a way to start executing foo() each exactly 10 seconds? I'm sure it's something related with threading but can't find a proper example.
I want to repeatedly execute a function in Python every 60 seconds forever (just like an in Objective C). This code will run as a daemon and is effectively like calling the python script every minute using a cron, but without requiring that to be set up by the user. In , the solution appears to effectively just for x seconds. I don't need such advanced functionality so perhaps something like this would work while True: # Code executed here time.sleep(60) Are there any foreseeable problems with this code?
I'm trying to make a door that searches a player's inventory for a golden nugget named "Golden Leaf". I have all of the redstone working, but for some reason the command block that tests for the item stays active, so I have a different command block hooked up to replace it and deactivate it. However, it wont work. This is the command I'm currently using: /setblock -9456 83 10214 command_block 0 replace {Command:"/testfor @p {Inventory:[{id:"minecraft:gold_nugget",tag:{display:{Name:"Golden Leaf"}}}]}"} And it keeps saying "Invalid character at "m" in minecraft. I changed it and took out the 'minecraft' part but it still won't work. What is wrong?
I need help with a specific command that I am using in a new game that I am creating inside of Minecraft. The command is: /give @p sign 1 0 {BlockEntityTag:{Text1:"{"text":" [MF2]","color":"gold","clickEvent": {"action":"run_command","value":"tellraw @a [""{"text":"[MF2] ","color":"gold"},{"selector":"@p","color":"dark_aqua"},{"text":" is now an admin of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}"},display: {Name:"Custom Sign"}} If I take out the /tellraw command then the command works fine, but I need the command in there to announce to the game that a new admin has joined. With the tellraw command, the error message is the following: Data tag parsing failed: Unexpected token 't' at: text":" [MF2]","color":"gold","clickEvent":{"action":"run_command","value":"tellraw @a [""{"text":"[MF2] ","color":"gold"}, {"selector":"@p","color":"dark_aqua"},{"text":" is now an admin of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}" If anyone knows how to fix this, please let me know.
I've been reading up on FreeNAS and RAID Z, and one of the things is that you shouldn't use ZFS (or more specifically, RAID Z) on a machine without ECC RAM. I'm wondering what the reasoning behind this is. Is this an issue with RAID Z specifically? Is there any particularly heightened risk from not using ECC RAM with ZFS vs other file systems? Or is this just a general concern about corrupt memory spreading to a filesystem which would otherwise have corrected the error thanks to its ?
I have a new server and am planning to upgrade the paltry 2 GB of memory to the maximum of 16 GB. (Theoretically 8 GB is the limit, but empirically 16 GB has been shown to work.) advise that ECC memory is not that important, but I'm not so sure I believe this. I've installed and am planning to add ZFS volumes as soon as my new hard drives arrive. Would it be stupid to skimp and get non-ECC memory for a ZFS-based NAS? If it's necessary, then I'll bite the bullet, but if it's just paranoia, then I'll probably skip it. Is there any reason ZFS or FeeeNAS specifically would require ECC memory, or suffer especially when running on a system using non-ECC memory?
Is it possible to take a web page that lets say has CSS that makes the header position:fixed, then use php and use either cURL or file_get_contents, and apply my own CSS file to change that header to position:absolut?
I have a simple page that has some iframe sections (to display RSS links). How can I apply the same CSS format from the main page to the page displayed in the iframe?
I have an unlocked Android 6.0.1 device, and I've installed a couple of banking apps. For obvious security and paper trail reasons, I'd like to take some screenshots of my interaction with my bank. However, somehow the low-volume+power buttons no longer takes any screenshots whilst in either of the banking apps. Why? How do I disable such a nuisance?
Some apps don't allow screenshots so how can I still take a screenshot? It is my phone and I should be able to do whatever I want with it so why is there even a feature to disallow screenshots? Android 5.0.1
I have two samples of data each estimates of a position x, y with Gaussian noise. One source has a larger variance than the other. Is this source in any way useful in providing a better estimate of the true position than the source with lower variance or should it just be discounted?
I have a large set of data points of the form (mean, stdev). I wish to reduce this to a single (better) mean, and a (hopefully) smaller standard deviation. Clearly I could simply compute $\frac{\sum data_{mean}}{N}$, however this does not take in to account the fact that some of the data points are significantly more accurate than others. To put it simply, I wish to preform a weighted average of these data points, but do not know what the weighting function should be in terms of the standard deviation.
I wanted to compile a task using SDL in C++ and I wanted to run the generated executable on another Linux that does not have this library installed, so how can I compile it in a way that I can include dependencies of SDL for running on another computer with Linux without the SDL installed?
I have been trying to produce a statically linked "single binary" version of my game for windows. I want to link with sdl, sdl_image and sdl_mixer which in turn pull in a few support libraries. Unfortunately I haven't found a way to get them all to compile and link using cygwin/mingw/gcc. As far as I can tell all existing public versions are only shared libraries / dlls. Please note that I'm not talking about licencing here. The source will be open thus the GPL/LGPLness of sdl is not relevant.
I'm trying to find good ways to disinfect and reuse N95 respirators at home. From this article it's apparently possible to disinfect in a microwave, using steam to kill viruses. My question is, would a food steamer also work?
Please forgive the obvious question. H2O2 vapor sterilization is deadly for the layperson but should be workable for hospitals. I can't find the small Chinese study I read the other day about it. Here are two more quickly googled sources. 2.
The heading/category of the topic above the question is not visible. It is overlapped by the bar. App Version: 1.0.85 Device Manufacturer: samsung Device Model: i9500 OS Version: 5.1.1 (N920CXXU1AOH2)
I have subscribed to many sites, but have no feed. I checked online, and I gathered this is not how it should normally look. Buggy layout with empty feed Fixed after having activity (e.g. reputation change, badge, etc) Phone: HTC Desire 526G+ Android: 4.4.2 SE app: 1.0.77
I am using the post to display attorney verdicts and case details. The post title is the verdict amount entered as a string. (no $ "," or ".") I am formatting the title using PHP number format: EX: User enters 360137 in the post title. $number = get_the_title(); $ammount = number_format($number); echo '<h1>$'. $ammount . '</h3>'; Returns $360,137 This is working as expected. Using get_posts() I can 'orderby' => 'title' and 'order' => 'DESC' or 'ASC' $args = array( 'category' => 64, 'orderby' => 'title', 'order' => 'DESC' ); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); While this is working it does not recognize the length of the value. For example it will display 30,000 before 2,100,000. How do I get this list sorted by ASC or DESC AND by string length? I want to show the largest verdicts first. 9,000,000 2,100,000 90,00 3,000
I have post titles which begin with a price, eg: $199,900 - 123 Street. I am using the code below, and I'm unable to get the order by title ascending to work properly. Any suggestions please. <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'cat' =>21, 'posts_per_page' => 999999, 'paged' => $paged, 'orderby' => 'title', 'order' => 'ASC', ); $the_query = new WP_Query($args); ?> <div id="listings"> <?php if ($the_query->have_posts()) : ?> <?php while ($the_query->have_posts()): $the_query->the_post(); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <div class="title1 active_listing"> <?php if (in_category('6')) { the_title(); } else { ?> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a> <?php } ?> </div> <div class="alignleft thumb"><?php the_post_thumbnail('thumbnail'); ?> <br /> </div> <div class="content"><?php the_excerpt(); ?> </div> <?php if (in_category('6')) { ?> <br /> <?php } else { ?> <a href="<?php the_permalink() ?>" rel="bookmark"> View Details</a> <br /> <?php } ?> </div> <?php endwhile; wp_reset_postdata();?> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php get_search_form(); ?> <?php endif; ?> </div>
Just installed Ubuntu 15. Completely deleted Ubuntu 14. However, running a 3GHz with 1 gigabyte of RAM, I'd think Ubuntu would 'fly'. Ubuntu 15 is much slower than Ubuntu 14 was and I wouldn't begin to know why. Any advice?
For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and such as: with a lighter desktop than the usual Gnome and Unity with the even lighter LXDE desktop Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?
For example: "transparent" can mean both "obvious" and "hidden" "aught" can mean both "all" and "nothing" Is there a term for a word which has multiple definitions that are antonyms?
I am looking for a list of all English words that are their own antonyms. Off the top of my head, I can only think of "either", "fast", "to dust" and "to lease", but there must be dozens more. Can you provide a link to a comprehensive list, if such exists? Also, what are such words most commonly called? I like the term "Janus word" I once heard, but is that widely understood? Edited by popular demand to make it absolutely clear that this is not a community wiki poll.
Use the method of ascent to prove there are infinitely many solutions to the Diophantine equation: $$x^2 − 3y^2 = 1$$ We can do this by showing how, given one solution $(u, v)$, we can compute another solution $(w, z)$ that is larger is some suitable sense. Then my proof will involve finding a pair of formulas, something like: $w = x + y$ and $z = x − y$. However I tried these formulas and they don't work. So I asked my teacher and she said that there is a pair of second degree formulas which do work; one of them has a cross term and one of them involves the number 3.
I have seen the Pell's equation wiki page but I need to prove this from scratch without mentioning any formula. I have also seen multiple answers on this site but the answers tend to skip over and assume formulas. This is what people do -> $x^2 - 3y^2 = 1$ has solution 1, 0. Next they say we "observe" that $$(x',y') = (2x + 3y, x + 2y)$$ is also a solution. What I'm asking is how they get this value. Can someone help?
my canon LBP 2900 printer is connected to another pc in the network. It is possible to connect if it were a usb printer. How to connect to a network printer in ununtu 16.04?
I seen many times how people describe how to's about LBP-2900, and 10-12 steps from start to end of how to download, unpack, build driver, fix driver, make it work... Could be there some .deb package with ready-to-go driver for Ubuntu? This printer is very popular...
I'm trying to prevent SQL Injection using PHP with PDO. I've used this as a reference. . My code doesn't give me any error but the values that are getting in are all null. The vlaues I'm trying to insert are not null. I know this because I've echo'ed them out: echo "\nDate: ".$date." Name: ".$name." mail: ".$mail."Comment: ".$comment." website: ".$website; $sql = "INSERT post SET timeDate = :timeDate and name = :name and mail = :mail and comment = :comment and website = :website"; $stmt = $db->prepare($sql); $stmt->bindParam(":timeDate", $date); $stmt->bindParam(":name", $name); $stmt->bindParam(":mail", $mail); $stmt->bindParam(":comment", $comment); $stmt->bindParam(":website", $website); $stmt->execute();
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?
How is "worthiness" defined in the context of lifting the Mjolnir? What makes Thor worthy to lift the Mjolnir?
Consistently across the Marvel version of Thor's various incarnations only the 'worthy' may lift Mjolnir, his enchanted hammer. The inscription reads, "Whosoever holds this hammer, be he worthy, shall posses the power of Thor." In the movie, of course, a large part of the story is centered upon Thor becoming worthy. In the comics and crossovers, many people have been able to wield Mjolnir, including Storm, Captain America, Beta-Ray Bill, Conan, a random paramedic (who hands it to an astonished Thor, laying on a stretcher), and Wonder Woman. However, Superman wields it briefly in one crossover, but then can't lift it. Thor says Odin had briefly lifted the enchantment to allow Big Blue to use it. So what determines one's 'worth' to the hammer? I know and all, but that is hardly canon.
I asked a question regarding the design choices made in the Haskell language and got slammed. Is there a Stack Exchange community for the philosophy of computer science?
Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.
I currently use formatPlural() to translate comment (not comments) and return its value to the Twig template. \Drupal::translation()->formatPlural('', '1 comment', '@count comments'); Is there any way to use code similar to the following one in a Twig template to translate this word? {{ 'comment'|trans }} {{ 'comment'|t }} {% trans %}comment{% endtrans %}
I am working on a (my first) Drupal 8 project witch is a multilingual site. Drupal 8 really delivers in terms of native support for content translation. However, I have a few strings set directly in some if the theme .Twig template files printed out like ex. {{ 'Read more'|trans }} I am really stuck on where to handle the translation for strings like these within the Drupal 8 installation. What steps do I need to take to be able to translate these strings into the language currently selected for on the site? Do I need any additional modules other than the ones included in Drupal 8 core? Steps I have taken: Activated the Content Translation & Interface Translation modules Added Twig strings like {{ 'Read more'|trans }} Flushed cache and refreshed pages containing the strings Checked admin/config/regional/translate for the strings with no result
I saw that when I checked the size of struct it took 36 bytes, but the same variables (without the struct) took 33 bytes. Why?
Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?
I'm new to Ubuntu and having some trouble after installing Atom. First time I failed and removed it. Second time I succeeded and got it running. But now when I run sudo apt-get update I get the following error: W: GPG error: https://packagecloud.io/AtomEditor/atom/any any InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4C6E74D6C0A35108 W: The repository 'https://packagecloud.io/AtomEditor/atom/any any InRelease' is not signed. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. How can I fix this problem?
I added some extra repositories with the Software Sources program. But when I reload the package database, I get an error like the following: W: GPG error: trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8BAF9A6F I know I can fix it using apt-key in a terminal, according to the official Ubuntu documentation. But I would have liked to do it graphically. Is there a way to do this without using a terminal?
In a discussion, one claimed that because gender has only two categories, he can correlate it with a continuous variable. Is it acceptable to use Pearson correlation between one continuous and another binary variable?
I am trying to find the correlation between a dichotomous and a continuous variable. From my ground work on this I found that I have to use independent t-test and the precondition for it is that the distribution of the variable has to be normal. I performed Kolmogorov-Smirnov test for testing the normality and found that the continuous variable is non-normal and is skewed (for about 4,000 data points). I did the Kolmogorov-Smirnov test for the entire range of variables. Should I split them into groups and do the test? I.e., say if I have risk level (0 = Not risky, 1 = Risky) and cholesterol levels, then should I: Divide them into two groups, like Risk level =0 (Cholestrol level) -> Apply KS Risk level =1 (Cholestrol level) -> Apply KS Take them together and apply the test? (I performed it on the whole dataset only.) After that, what test should I do if it is still non-normal? EDIT: The above scenario was just a description I tried to provide for my problem. I have a dataset which contains more than 1000 variables and about 4000 samples. They are either continuous or categorical in nature. My task is to predict a dichotomous variable based on these variables (maybe come up with a logistic regression model). So I thought the initial investigation would involve finding the correlation between dichotomous and a continuous variable. I was trying to see how the distribution of the variables are and hence tried to go to t-test. Here I found the normality as an issue. The Kolmogorov-Smirnov test gave a significance value of 0.00 in most of these variables. Should I assume normality here? The skewness and kurtosis of these variables also show that the data is skewed (>0) in almost all cases. As per the note given below I will investigate the point-biserial correlation further. But about the distribution of variables I am still unsure.
I don't know where to start on this proof. I know that a linearly independent set is a set where c1v1+c2v2+⋯+cnvn=0 has no non-trivial solutions other than c1=c2=...=cn=0. How can I use that to figure out this proof?
Is the above statement true? If I have already proven that the set is linearly independent, is it automatically given that the subset is also linearly independent? If so, how would I go about showing that as a proof.
How to solve this nonlinear difference equation $$a_{n+1} = 2a_n + \frac{1}{a_n},\quad a_1 = 1.$$
For $n\in\mathbb N$, $$a_{n+1}=2a_n+\frac{1}{a_n},\quad a_1=1. $$ Can any one give an explicit formula for all $a_n$? If such an explicit general formula doesn't exist, please explain it. I've tried to figure out the $n$-iterated function $f^{(n)}$ where $f(x)=2x+1/x$ or even $f(\tan(t))$. But in either cases, I failed.Since the recurrence isn't linear nor homogeneous,the generating function method doesn't apply here.
I am working with a multi language program, for that reason I must use strings.xml values to create a Questionnaire. No matter the way that I try to assign the strings to an arraylist always I have the error: "Unable to instantiate activity ComponentInfo ... java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference" "Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference". In a class called form.java I have the following declaration: ArrayList<String> listapreguntas =new ArrayList<String>(){{ getString(R.string.HY) ; getString(R.string.MDC); getString(R.string.CLMDC); getString(R.string.TRSN); getString(R.string.NTNDD); getString(R.string.LCHLRCT); getString(R.string.MLSTGN); getString(R.string.SPRN); getString(R.string.FBRSFRC); getString(R.string.CX); getString(R.string.CLCX); getString(R.string.NTRN); getString(R.string.TRNSF); getString(R.string.TRNSP); getString(R.string.TT); getString(R.string.DRGS); getString(R.string.MRDD); getString(R.string.EDTS); getString(R.string.DRR); getString(R.string.MDPS); getString(R.string.DND); getString(R.string.DNDUD); getString(R.string.DNDDSM); getString(R.string.HPT); getString(R.string.PLD); getString(R.string.MLR); getString(R.string.CHNCH); getString(R.string.TBR); getString(R.string.PLP); getString(R.string.CNCR); getString(R.string.CNCRTP); getString(R.string.QT); getString(R.string.SM); getString(R.string.DBT); getString(R.string.DBTNSL); getString(R.string.PRSN); getString(R.string.CRZN); getString(R.string.SNGRDS); getString(R.string.VH); getString(R.string.VHRSL); getString(R.string.NFRMP); getString(R.string.TRNFRM); getString(R.string.TRNFRMCL); getString(R.string.CHG); getString(R.string.DNG); getString(R.string.CLR); getString(R.string.HMRRG); getString(R.string.LCHL);getString(R.string.XTRCCNDTL); getString(R.string.TRTMTM); getString(R.string.VCNRCT); getString(R.string.MNSTRD);}}; Besides, the strings.xml for example have the following: <string name= "HY">Do you feel good in healt?</string> <string name= "MDC">Are you taking any medication?</string> <string name= "CLMDC">If your answer is Yes, indicate which</string> <string name= "TRSN">is he out of date?</string> <string name= "NTNDD">Have you read and understood the informational material?</string>... Wich one is the problem?
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 want to prove $\exp : \mathfrak{gl}(n, \mathbb{C}) \longrightarrow GL(n,\mathbb{C})$ is surjective. The textbook gives hint as "using Jordan canonical form" So my guess is expressing matrix in terms of similarity transformation, but how does it guarantee that the exponential map is surjective? Can you give me some proof of above statement.
Let $M_n(\mathbb{F})$ be the set of all $n\times n$ with entries in $\mathbb{F}$ and let $\exp:M_n(\mathbb{C})\to M_n(\mathbb{C})$ be defined by $$ \exp(A)=\sum_{k=0}^{\infty}\frac{A^k}{k!},$$ for all $A\in M_n(\mathbb{C}).$ I want to prove that $\exp$ is a surjective map from $M_n(\mathbb{C})$ to $GL(n,\mathbb{C})=\left\{A\in M_n(\mathbb{C})\,\middle| \det(A)\neq0\right\}$, how do I go about that? I mean saying that $\exp:M_n(\mathbb{R})\to GL(n,\mathbb{R})$ is an analogous to saying $\exp:\mathbb{R}\to \mathbb{R}_{>0}$ and this is also pretty intuitive, since, in analogy with the case of numbers, $A^0=I\;\forall A$, so $\exp(0)=I+0+\frac{0^2}{2!}+\dots=I$, so even for $A=0$ we get $\det\left(\exp(A)\right)\neq0$ and so because of the first term we can never get a zero determinant. But I have no idea how to prove the subjectiveness. Thanks in advance.
Let's consider the set consisting of $8$ elements $\{\pm1, \pm i,\pm j, \pm k\}$ with the following multiplication table: We see that $1$ commutes with any of the $\{i,j,k\}$. For example, we want to consider the product $(-1)\cdot j$, since $i^2=-1$ then we can rewrite it as: $(-1)\cdot j=(i\cdot i)\cdot j=i\cdot(i\cdot j)=i\cdot k=-j$. In this example and in many others in order to multiply elements we need to use associativity property. How to prove that associativity is true in this set? In similar I have seen approach using automorphism. However, I was not able to comprehend it. Can anyone explain it please? Would be grateful if somebody can demonstrate some elementary approach. In my opinion it is definitely important to know.
Consider the eight objects $\pm 1, \pm i, \pm j, \pm k$ with multiplication rules: $ij=k,jk=i,ki=j,ji=-k,kj=-i,ik=-j,i^2=j^2=k^2=-1$, where the minus signs behave as expected and $1$ and $-1$ multiply as expected. Show that these objects form a group containing exactly one involution. Well, it is easy to determine closure from the definition. $1$ is clearly the identity, and the inverses can also be determined $(i,-i),(j,-j),(k,-k)$, $-1$ with itself, and $1$ with itself. The only involution is $-1$. Is there an easy way to check associativity of this group? There are too many possible combinations $(ab)c=a(bc)$ to check directly. ($8^3$ possible combinations)
In a multiplayer game one of my opponents has a and is at 39 life and I am at 2 life. He attacks me with a 2/2 lifelink creature, but before damage is dealt I concede. Does the lifelink still gain my opponent enough life to win with felidar sovereign at the beginning of his upkeep, thereby letting my other opponent lose the game or do I only lose and do my opponents still need to continue the game to determine who wins?
In Magic: The Gathering, the rules for a player losing in a multiplayer game are quite complex, so I'd like to try to understand them by example. I would be happy to ask each of these situations as a separate question if that is preferred, but they all seem related, and I would love to have one place to look up all of these answers. Let's say I'm playing with two friends, Bob and Chloe, in a simple free for all. Unfortunately, I lose. When I lose, suppose the following: I controlled an which has exiled Bob's , does he get his bear back? I have a on the stack targeting Chloe, does Chloe take the 2 damage still? Earlier in the turn I cast to prevent damage to one of Bob's . If it later takes 3 damage, will that damage be prevented? Something I controlled gave Bob a 1/1 soldier token. What happens to the token? Something Chloe controlled gave me a 1/1 soldier token. What happens to the token? I had a enchanting one of Bob's army of . What happens to the bear? I had also played on Bob's final . What happens to the last bear? Chloe had my . What happens to the Clone? Are there any other situations specifically addressed by the rules?
is a disease of having abnormally large size. Is there a grammatical rule that says that it should be called "gigantism" and not "giantism"?
A little look through an etymology dictionary shows that the root is Latin gigas with adjective form gigant. So in its derivation to English, why did the second "g" get retained in gigantic but was dropped from giant? I have an inkling that the word giant may have travelled through French on its way to English, where it may have been pronounced "gee-yant" or "jee-yant" with a change to the second "g" that was then dropped when taken into English. However, the "g" is retained as a hard "g" in gigantic.
In Mordenkainen's Tome of Foes (pg. 189), the Duergar Mind Master has the following Mind Mastery action: Mind Mastery. The duergar targets one creature it can see within 60 feet. The target must succeed on a DC 12 Intelligence saving throw, or the duergar causes it to use its reaction either to make one weapon attack against another creature the duergar can see or to move up to 10 feet in a direction of the duergar's choice. Creatures that can't be charmed are immune to this effect. An elf has the Fey Ancestry racial feature, listed in the PHB (pg. 23): Fey Ancestry. You have advantage on saving throws against being charmed, and magic can't put you to sleep. Mind Mastery does not specifically say that it charms its target, which is to say, imposes the "charmed" condition. However, it does call out that creatures who are immune to charm effects are immune to this effect as well. So what of elves, or other creatures who have advantage against saving throws to charm effects? Would this apply here due to the fact that creatures immune to charm effects aren't affected, or does it not apply because it's not specifically "being charmed"?
My first instinct is to say no, Fey Ancestry does not grant an elf advantage on the save against this spell, because the spell does not say that it bestows the charmed condition upon its target; instead it seems to merely restrict the list of possible targets to creatures that are not immune to being charmed. At first I was tempted to add the rules-as-written tag to this question, but I'm also curious to see if there is any significant evidence that Fey Ancestry was intended to apply to this spell but perhaps the language was simply never updated by the developers. Good answers should provide both a rules-as-written viewpoint as well as a rules-as-intended viewpoint. This question is sufficiently distinct from . While the RAW answers to these two questions might be the same, the RAI answer (which I specifically asked for as well) is not considered by any of the answers to the existing question. I'm not limiting responses to a strict Yes/No RAW determination of whether or not to grant elves advantage on the save. Rather, I'm asking if there is a reasonable argument to be made whether or not to grant them advantage on the save regardless. Relevant Player's Handbook Excerpts Elf Racial Traits, Fey Ancestry, PHB page 23 You have advantage on saving throws against being charmed, and magic can't put you to sleep. Spell Descriptions, Otto's Irresistible Dance, PHB page 264 Choose one creature that you can see within range. The target begins a comic dance in place: shuffling, tapping its feet, and capering for the duration. Creatures that can't be charmed are immune to this spell. A dancing creature must use all its movement to dance without leaving its space and has disadvantage on Dexterity saving throws and attack rolls. While the target is affected by this spell, other creatures have advantage on attack rolls against it. As an action, a dancing creature makes a Wisdom saving throw to regain control of itself. On a successful save. the spell ends. Conditions, Charmed, PHB page 290 A charmed creature can't attack the charmer or target the charmer with harmful abilities or magical effects. The charmer has advantage on any ability check to interact socially with the creature.
I would like to know which is stronger filter_var or mysqli_real_escape_string. To be more specific. Option1: //Course Title $ctitle = trim($_POST['courseTitle']); $clean_ctitle = filter_var($ctitle, FILTER_SANITIZE_STRING); Option2: //Course Title $ctitle = trim($_POST['courseTitle']); $clean_ctitle = mysqli_real_escape_string($con, $ctitle); I also know about prepared statements but I want to filter the data coming in before hand. If there is an alternative, let me know.
Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags?
After I installed ubuntu I tried to install windows back, around 3 weeks after. Now every time I try to reinstall Windows it says: "Please insert proper boot device" After uninstalling ubuntu it is still a boot partition in the bios. Does anyone know how I could install Windows back? The only reason why I want to do this is because Ubuntu can't play many games and I am a PC gamer.
I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows. How do I remove Ubuntu and reinstall Windows? Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.
I got this text file I need to parse, and I am looking for the more efficient way to do it. The file structure is known and looks like this : [section] key=value key=value [section] key=value [section] key=value I have no way to know in advance how many [section] I will read, nor how much key & value there is in each section. I am trying to find the best way to store this file in a collection. So far, I figured that the best collection tu use would be a Map>, so that each [section] would have its associated key-value attached. The problems I am having is mostly to handle blank lines, as I am looking for new sections with a simple : if(line.charAt(0) == '[') and obviously, with blank lines this returns null. Can anyone just give me heads up on this ?
I am writing a drop-in replacement for a legacy application in Java. One of the requirements is that the ini files that the older application used have to be read as-is into the new Java Application. The format of this ini files is the common windows style, with header sections and key=value pairs, using # as the character for commenting. I tried using the Properties class from Java, but of course that won't work if there is name clashes between different headers. So the question is, what would be the easiest way to read in this INI file and access the keys?
As i know,a Java object contains object header,reference and it's data. //jdk 1.7 public final class String{ private final char value[]; private int hash; //... } For new String("abc") ,how many bytes will it take if we just think about 32-bit system? totleBytes = 8//String Object header +4 //value reference +4 //hash +12 //char[] object header +3*1//value[] data does it right,or miss something?
I have an application that reads a CSV file with piles of data rows. I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause OutOfMemoryErrors. Each row translates into an object. Is there an easy way to find out the size of that object programmatically? Is there a reference that defines how large primitive types and object references are for a VM? Right now, I have code that says read up to 32,000 rows, but I'd also like to have code that says read as many rows as possible until I've used 32MB of memory. Maybe that is a different question, but I'd still like to know.
I have a file, and several processes which can operate on it. For simplicity let us assume that each process runs the same script: with open("file.txt", "r+") as file: data = file.read() data = data + "Hello\n" file.seek(0) file.write(data) I assume that such a way of file access allows several processes to modify the same file, what results in improper writing (for instance, three processes could get "HeHello\nHello\nllo" as a result). Is there any way to forbid access to the file for some time and still be able to read and write from there from the current process?
What is the most elegant way to solve this: open a file for reading, but only if it is not already opened for writing open a file for writing, but only if it is not already opened for reading or writing The built-in functions work like this >>> path = r"c:\scr.txt" >>> file1 = open(path, "w") >>> print file1 <open file 'c:\scr.txt', mode 'w' at 0x019F88D8> >>> file2 = open(path, "w") >>> print file2 <open file 'c:\scr.txt', mode 'w' at 0x02332188> >>> file1.write("111") >>> file2.write("222") >>> file1.close() scr.txt now contains '111'. >>> file2.close() scr.txt was overwritten and now contains '222' (on Windows, Python 2.4). The solution should work inside the same process (like in the example above) as well as when another process has opened the file. It is preferred, if a crashing program will not keep the lock open.
I'm trying to make a scene like this: But no matter how I mess with the bounce settings in cycles; the light just isn't coming out of the other side of the prism: What am i doing wrong?
I'm trying to achieve the effect where a beam of light sent through a prism or other refractive object, separates out into the light spectrum. (See image below) This effect is especially useful to have when modeling gemstones, since the 'sparkle' of colors produced by this effect adds a lot of realism to the model. It does not seem possible to get Cycles to produce this effect, since Cycles handles each ray of light as only a single, one-colored ray. Is there any way to coax Cycles (or any other render engine) into treating light as a full spectrum? Is this kind of treatment of light even possible in Blender?
I'm trying to use tikzit, and I created a shape (basically a new kind of node). The shape is located into /home/user/.config/tikzit/shapes/shape1 but tikzit (and pdflatex as well, obviously) doesn't seem to find it. I have tried both with debian8 and fedora21, but the problem seems to persist. \documentclass{article} \usepackage[svgnames]{xcolor} \usepackage{tikz} \usetikzlibrary{decorations.markings} \usetikzlibrary{shapes.geometric} \pagestyle{empty} \pgfdeclarelayer{edgelayer} \pgfdeclarelayer{nodelayer} \pgfsetlayers{edgelayer,nodelayer,main} \tikzstyle{none}=[inner sep=0pt] \tikzstyle{node1}=[shape1,fill=White,draw=Black] \usepackage[graphics,tightpage,active]{preview} \PreviewEnvironment{tikzpicture} \newlength{\imagewidth} \newlength{\imagescale} \begin{document} \begin{tikzpicture} \begin{pgfonlayer}{nodelayer} \node [style=node1] (0) at (-1.75, 1) {}; \end{pgfonlayer} \end{tikzpicture} \end{document}
I'm trying to include a file with a specific shape (cup) into another TikZ image, in order to use the cup as a "stamp" to draw more complex figure. The file is located in /usr/share/tikzit/shapes/cap.tikz \documentclass{article} \usepackage[svgnames]{xcolor} \usepackage{tikz} \usetikzlibrary{decorations.markings} \usetikzlibrary{shapes.geometric} \pagestyle{empty} \pgfdeclarelayer{edgelayer} \pgfdeclarelayer{nodelayer} \pgfsetlayers{edgelayer,nodelayer,main} \tikzstyle{none}=[inner sep=0pt] \tikzstyle{node1}=[cap,fill=White,draw=Black] \tikzstyle{simple}=[-,draw=Black,line width=2.000] \tikzstyle{arrow}=[-,draw=Black,postaction={decorate},decoration={markings,mark=at position .5 with {\arrow{>}}},line width=2.000] \tikzstyle{tick}=[-,draw=Black,postaction={decorate},decoration={markings,mark=at position .5 with {\draw (0,-0.1) -- (0,0.1);}},line width=2.000] \usepackage[graphics,tightpage,active]{preview} \PreviewEnvironment{tikzpicture} \newlength{\imagewidth} \newlength{\imagescale} \begin{document} \begin{tikzpicture} \begin{pgfonlayer}{nodelayer} \node [style=node1] (0) at (-2.5, 1.5) {}; \end{pgfonlayer} \end{tikzpicture} \end{document} The code i want to include is the following: \begin{tikzpicture} \path [use as bounding box] (-2,-2) rectangle (2,2); \begin{pgfonlayer}{nodelayer} \node [style=none] (0) at (0, 0.75) {}; \node [style=none] (1) at (-0.5, 0) {}; \node [style=none] (2) at (0.5, 0) {}; \end{pgfonlayer} \begin{pgfonlayer}{edgelayer} \draw [in=0, out=90] (2.center) to (0.center); \draw [in=270, out=-90, looseness=0.75] (1.center) to (2.center); \draw [in=90, out=180] (0.center) to (1.center); \end{pgfonlayer} \end{tikzpicture} But it seems I miss how to specify the directory of cup. I get this error: Package pgfkeys Error: The key '/tikz/cap' requires a value. I am going to ignore this key. It seems like I have to deal with tikzstyle or pgfkey, but I don't know how to specify an external file.
So here I've created, or at least tried to create an alias for a command that accepts a command-line argument, makes a new directory with that name, and goes to it. alias newfolder='mkdir $2 ; cd "$(history | tail -2 | awk '\''NR == 1'\'' | awk '\''{print $3}'\'')"' The alias created successfully, but when I want to run the command with a command-line argument, I get this error message. username:~/workspace (master) $ newfolder a mkdir: missing operand Try 'mkdir --help' for more information. bash: cd: newfolder='mkdir: No such file or directory
I find myself repeating a lot of: mkdir longtitleproject cd longtitleproject Is there a way of doing it in one line without repeating the directory name? I'm on bash here.
I have to following classes: public class NominalValue { public int Id {get; set;} public string ElementName {get; set;} public decimal From {get; set;} public decimal To {get; set;} public bool Enable {get; set;} public DateTime CreationDate {get; set;} public int StandardValueId {get; set;} //FK for StandardValue } public class StandardValue { public int Id {get; set;} public string ElementName {get; set;} public decimal From {get; set;} public decimal To {get; set;} public bool Enable {get; set;} public DateTime CreationDate {get; set;} } User wants to fill nominalValue object properties. filling the nominalValue properties can performed in 2 way: User fill values for nominalValue manually. User Load values for nominalValue from a standardValue object and then change some values or not. sometimes I need to know if some property of nominalValue objects for a specified Element are equal to corresponding standardValue or not? I don't want to load standardValue from Db for checking this equality, so I decided to define a HashValue property in NominalValue class: public class NominalValue { public int Id {get; set;} public string ElementName {get; set;} public decimal From {get; set;} //<-- 1st parameter for generating hash value public decimal To {get; set;} //<-- 2nd parameter for generating hash value public bool Enable {get; set;} //<-- 3rd parameter for generating hash value public DateTime CreationDate {get; set;} public int StandardValueId {get; set;} public string HashValue {get;set;} //<-- this property added } when user fill nominalValue properties using standardValue properties, I calculate its value based on 3 properties(From, To, Enable) and save it with other properties, and when I check if that nominalValue fill with standardValue or not, I calculate hash code for From, To, Enable and compare the result with HashValue (instead loading standardValue from Db). Is there any mechanism to calculate a unique hash code based on 3 property values(From, To, Enable)?
In .NET, the is used in a lot of places throughout the .NET base class libraries. Implementing it properly is especially important to find items quickly in a collection or when determining equality. Is there a standard algorithm or best practice on how to implement GetHashCode for my custom classes so I don't degrade performance?
Is “ignoring me the whole day” grammatically correct?
Skyscrapers are of various shapes. Skyscrapers are various shapes. Why do we use of in the sentence above? Is there any difference in meaning between the two sentences?
How can I install Netflix on my device? I have already tried opening the Ubuntu terminal and pasting this : sudo apt-add-repository ppa:pipelight/stable -y && sudo apt-get update && sudo apt-get install pipelight-multi -y. sudo pipelight-plugin --enable silverlight. sudo apt-get install netflix-desktop but it is not working and I still have to install silverlight.
Is there a way to stream Netflix content to my Ubuntu machine?
Here's what happened: I made the maximum contribution to a Roth IRA this year. I thought about how my marginal tax rate now is a lot higher than I expect it to be in retirement, so I decided a traditional IRA would have been a better idea. I recharacterized this year's contributions to a traditional IRA. I realized my income is too high to qualify for a traditional IRA deduction. Here's what I did not do, and why this question is not a duplicate of similar questions already asked: I have not made any conversions at all. I have not taken any distributions, and thus have not received a 1099-R. I did not previously go from a traditional to a Roth, and now want to go back to a traditional. I am not rolling over any 401k or other non-IRA account. seems like a good duplicate, but alas it's very old and has no answers. My understanding is that (for married, filing jointly taxpayers for 2015) that someone with a MAGI above $118,000 is not eligible for a traditional IRA deduction. Below $183,000, the full Roth IRA contribution is still allowed. I'm in this range (between $118,000 and $183,000), so a Roth IRA seems like the only rational choice. Please correct me if I'm wrong. So, I would like to unrecharacterize (rerecharacterize?) this year's IRA contribution back to a Roth IRA. I've not yet filed a return for the contribution year, so I'm hoping I can do that. Can I? Would I report to the IRA two recharacterizations? Or would I file as if no recharacterization ever happened?
I made a $5500 contribution to my Roth IRA in 2015 (T1). Later I recharacterized this contribution. The market had gone down and I only got $5090 in my TIRA when the recharacterization happened (T2). Then after sometime I converted the amount in my TIRA back to a Roth IRA. This time the market had gone up and I got $5146 in my Roth IRA (T3). Now I am trying to figure out how to file form 8606. thread helped me a lot but it took a while to parse all of it and I think it would be useful to have this topic as a concise Q&A on this site. So given the facts above, are the forms below filled out correctly? What is purpose of line 14 (the basis) in form 8606? Form 8606: Form 1040: Also these are the 1099-R forms I got from my custodian (vanguard). Are these correct? 1099-R when I did recharacterization: 1099-R when I did conversion:
I tried to install apt-get install virtualbox. it fails due to dependencies issues. to fix it - i tried sudo dpkg --configure -a, and get stucked after a while. now when I'm trying to install other ( git ), it goes back to same problem: guy@desktop:~$ sudo apt-get -f install [sudo] password for guy: E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. guy@desktop:~$ sudo dpkg --configure -a Setting up virtualbox-dkms (5.2.10-dfsg-6ubuntu18.04.1) ... Removing old virtualbox-5.2.10 DKMS files... -------- Uninstall Beginning -------- Module: virtualbox Version: 5.2.10 Kernel: 4.15.0-23-generic (x86_64) ------------------------------------- Status: This module version was INACTIVE for this kernel. depmod... DKMS: uninstall completed. ------------------------------ Deleting module version: 5.2.10 completely from the DKMS tree. ------------------------------ Done. Loading new virtualbox-5.2.10 DKMS files... Building for 4.15.0-23-generic Building initial module for 4.15.0-23-generic
I get this error when trying to use apt-get: E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it? How can I fix this?
Say you pulled out your Hogwarts robe for your 20 year reunion and found a hair on it. If you used a hair from 10-20 years ago in the Polyjuice Potion would you be a younger version of yourself? Would the potion work at all? Could this be a temporary youth potion?
Suppose you cut a five year old's hair, save it for 10 years, and then use it for a Polyjuice transformation. What age do you turn into: The toddler or the teenager?
Find the maximum and minimum values of the expression: $$\frac x{x^2+1} + \frac y{y^2+1} + \frac z{z^2+1}$$where $x,y,z$ are real numbers satisfying the condition $x+y+z=1$. And what is the minimum? I thought the maximum value occurs when x, y and z are real positive, since if a solution is negative, there would be lesser than a positive symmetric. So, it's correct to use AM >= GM dividing by x, y and z all fractions?
Find the maximum value of the expression : $${\frac {x}{1+x^2}} + {\frac {y}{1+y^2}}+{\frac {z}{1+z^2}}$$ where $x,y,z$ are real numbers satisfying the condition that $x+y+z=1$. Taking $x=y=z=\frac {1}{3}$, I get the expression as $\frac {3x}{1+x^2}$, which is equal to $\frac {1}{1+{\frac{1}{9}}}$ or $\frac {9}{10}$. How can I actually solve the problem without making unnecessary assumptions ?
I have this program which draws the Mandelbrot sets onto a canvas, and even does some creative things with the concept of it. I want this program to automatically save this canvas to my downloads folder once it's done as a .PNG file. I tried looking around this website for some help and the best thing I was able to find and somewhat understand enough to apply to my program is this: var image = c.toDataURL("image/png").replace("image/png", "image/octet-stream"); window.location.href = image; Where 'c' is the canvas. While this does save the image to my downloads folder, it doesn't actually store it as a PNG file. As far as I'm able to grasp it doesn't specify a filetype at all since properties of these files tell me the filetype is 'Bestand' which I'm sure is just the Dutch translation for 'file'. Does anyone know how to directly store this as a PNG file? Note: I tried opening the images in Paint and that does seem to be able to read the file. It seems to me the image is correctly saved but no filetype is specified, nor is a name of the file given at all.
If for example you follow the link: data:application/octet-stream;base64,SGVsbG8= The browser will prompt you to download a file consisting of the data held as base64 in the hyperlink itself. Is there any way of suggesting a default name in the markup? If not, is there a JavaScript solution?
For a REST api, that has no dependencies between requests and is using ASP.NET Core DI. I have heard conflicting arguments when choosing the most appropriate: Prefer transient and then scoped and avoid singleton due to memory and multi-threading issues and also because singletons should not be injected with other lifetimes due to captive dependencies Prefer singletons to save time instantiating objects and prevent opening multiple connections I understand they work differently but is there a 'go-to' lifetime? Should it start with 'transient' and move to others as required? Are there any investigations proving the instantiation time saved by singleton is actually relevant?
The is a fully paid up member of the 's , but it lately seems rather orphaned by the developer world. I still use quite a lot of singletons, especially for , and while you have to be a bit careful about multithreading issues (like any class actually), I fail to see why they are so awful. Stack Overflow especially seems to assume that everyone agrees that Singletons are evil. Why? Please support your answers with "facts, references, or specific expertise"
Theorem : For every natural number $p$: $$\sum^p_{i=0} 2^i = 2^{p+1}-1$$ I trieed to demonstrate the theorem using induction Demonstration : $1)$ If we have $p=0$ then we get $2^0=2^{0+1}-1$ that is always true. $2)$ Supposing that the first statement is true then we get that $$\sum^{p+1}_{i=0} 2^i = 2^{p+2}-1$$ Now we know that: $$\sum^{p+1}_{i=0} 2^i - \sum^p_{i=0} 2^i = 2^{p+1}$$ and if that is true, must be also true that: $$2^{p+2}-1-(2^{p+1}-1) = 2^{p+1}$$ $$2^{p+2}-1-(2^{p+1}-1)=2^{p+2}-2^{p+1}=2^{p+1}(2^1-2^0)=2^{p+1}$$ QED Is this a valid demonstration?
$$\sum_{k=0}^nq^k = \frac{1-q^{n+1}}{1-q}$$ I want to prove this by induction. Here's what I have. $$\frac{1-q^{n+1}}{1-q} + q^{n+1} = \frac{1-q^{n+1}+q^{n+1}(1-q)}{1-q}$$ I wanted to factor a $q^{n+1}$ out of the second expression but that 1- is screwing it up...
I have two classes Test_1 and Test_2 where test_2 includes the method setValues. class Test_1(): def __init__(self): self.dim = float self.list = Test_2() def init(self, dim, valuesT, valuesW): self.dim = dim self.list = [Test_2()] * dim for i in range(self.dim): self.list[i].setValues(mean[i], valuesT[i], valuesW[i]) class Test_2(): def __init__(self): self.mean = float self.T = float self.W = float def setValues(self, mean, T, W): self.mean = mean self.T = abs(mean - T) self.W = abs(W - mean) When I create an instance of Test_1 and call the init method of this class passing the params (3,[1,2,3],[3,4,5], [6,7,8]) I am expecting the creation of 3 instances of Test_2 class and for the T and W values to be initialised in the list objects. However this is not the case and the T and W values seem to be overwritten for all 3 Test_2 objects to the latest T and W values. The below code produces the values: 1 3 6 6 6 6 for i in range(self.dim): self.list[i].setValues(mean[i], T[i], W[i]) print("List while in loop: ", self.list[i].mean) for i in range(self.dim): print("List after loop: ", self.list[i].mean) Could anyone help shed some light on why this may be? I'm fairly new to OOP.
I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?
Can anyone please explain how to know whether a vector field has or not by seeing its diagram? I have read that a vector field must change for having divergence but why is divergence zero in middle of electric field between dipole?
What is ? I was learning about Maxwells equations and don't understand the divergence part of it. Can someone give an intuition of what divergence is in relation to maxwells equation. To give you a sense of language to use I'm 17 and don't do maths or physics at school (I've just recently started loving the two.)
I know I am missing something and this question is probably very silly, but I would like to understand. Quoting an article: If one photon is measured to be in a +1 state, the other must be in a -1 state. Since the outcome of one photon affects the outcome of the other, the two are said to be entangled.......when you measure the state of one photon you immediately know the state of the other....If we’re light years apart, we each know the other’s outcome for entangled pairs of photons, but the outcome of each entangled pair is random (what with quantum uncertainty and all), and we can’t force our photon to have a particular outcome. I just cannot see the "magic" here. Using a stupid analogy: There are two balls, black and white, wrapped in a piece of cloth. You take one and I take the other. Whenever and wherever I unwrap the one I took, I will immediately know which one you have. What is so special about that in the world of particles, how does the outcome of the first affect the other?
I'm struggling to understand the concept of quantum entanglement. I've distilled my understanding into an analogy, and I need your help to validate it. Here it is: Let's say I receive two envelopes. Both envelopes have this written on them: Hello! Open this letter... If the paper inside is red, then other envelope has blue paper. If the paper inside is blue, then other envelope has red paper. So, if I open one letter, and the paper inside is red, then I know the other letter contains the blue paper. Is this equivalent to quantum entanglement? The fact that I will know the color of the other paper when I open (i.e. observe) one envelope? In theory, if one of the letters "appeared" in a different galaxy, I would still know the color of the paper inside that letter, just by opening my letter, instantly, correct? Before I open the letter, is the paper inside each envelope in superposition (??), i.e. 50/50, red or blue? In this analogy, I am assuming that what's written on the letters is true. Is this a correct assumption in quantum physics? I think so yes? In real quantum physics, would I be able to change the color of one paper, so that I change the color of the other one? No right?
Do immature fruits perform photosynthesis? Yes they have chlorophyll bodies. But do they have stomata through which they can absorb carbondioxide like the green leaves? Sincerely Ulrik
Most immature fruits are green: peppers, pine cones, plums, lots of them. I want to know if the green is from chlorophyll in the cells. Do the fruit cells perform photosynthesis? When you cover a green stem or leaf, it will turn pale and stretch. That is because the stems have little need for chlorophyll in the dark, which is why they are pale. They stretch because the auxins in the stems are not destroyed by the photons, and the stems stretch out and topple over. If a green fruit is covered, will it turn pale and stretch like that?
After I removed an app with purge, I cannot use sudo or apt-get any more and get this error. -bash: /usr/bin/sudo: No such file or directory Do you have any suggestions? version: Ubuntu 16.04
This seems to be a chicken-egg problem. The most common task using sudo is installing and removing software. sudo apt-get purge <appname> But sudo itself can be removed. sudo apt-get purge sudo # Do not run this command on production computers! This is where the fun comes ubuntu@ubuntu:~$ sudo bash: /usr/bin/sudo: No such file or directory Although it's obvious that no person in his right mind will purge sudo (other than me), someone can be fooled to run this command (not directly, in its hex mode, or whatever it's called) or a person could SSH in disguised as tech guru and do the mess. So is there a way of reinstalling sudo?
This is a continuation of my , but now I want to use pgfplots. In an axis environment, I add a node using the axes coordinate system. I would like to use let to retrieve the coordinates of a node in the axes coordinate system. In the example below: \documentclass{standalone} \usepackage{tikz,pgfplots} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \begin{axis}[xmin=0,xmax=10,ymin=0,ymax=10] \node [circle,fill,inner sep=2pt] (d1) at (axis cs:4,2) {}; \draw let \p1=(d1) in (d1) coordinate[label=below:\x1]{} ; \end{axis} \end{tikzpicture} \end{document} The label, which should give me the horizontal coordinate of the node, currently reads: 77.999988pt. Where does that number come from? Since the node is placed at (4,2), I would like instead get the label as 4 times 28.45274pt = 113.81096pt. (I would then transform it for display.)
I am unable to get the right coordinate values for (A) and (B) in the following axis. Did I misunderstand some conversion step or is it because of the data? Picture MWE \documentclass[ a4paper ]{scrartcl} \usepackage{ newtxtext, amsmath, tikz, pgfplots } \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usetikzlibrary{ calc } \listfiles \begin{document} \begin{center} \begin{tikzpicture}[font=\small] \begin{axis}[ height=6cm, width=14cm, % scale only axis=true, xlabel={Distance in mm}, ylabel={Voltage in volt}, ] \addplot [sharp plot, no marks, x=Wegnormiert] table [col sep=tab] {data.txt} coordinate [pos=0.5] (A) coordinate [pos=0.6] (B); \draw (A) -| (B); \filldraw let \p1= (A) in (\x1,\y1) circle [radius=1pt] node[pin={[pin distance=1.1cm]270:{{\pgfmathparse{\x1}\pgfmathprintnumber[fixed,precision=2]{\pgfmathresult}\,pt}}}] {}; \filldraw let \p2= (B) in (\x2,\y2) circle (1pt) node[yshift=-0.5cm, pin=270:{{\pgfmathparse{\x2/2.845274}\pgfmathprintnumber[fixed,precision=2]{\pgfmathresult}\,mm}}] {}; \end{axis} \end{tikzpicture} \end{center} \end{document} Data Additional code for y-coordinate \documentclass[ a4paper ]{scrartcl} \usepackage{ newtxtext, amsmath, subcaption, biblatex } \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{ tikz, pgfplots } \usetikzlibrary{ calc } \listfiles \begin{document} \begin{center} \centering \begin{tikzpicture}[font=\small] \begin{axis}[ height=6cm, width=14cm, % scale only axis=true, xlabel={Distance in mm}, ylabel={Voltage in volt}, ] \addplot [sharp plot, no marks, x=Wegnormiert] table [col sep=tab] {data.txt} coordinate [pos=0.5] (A) coordinate [pos=0.6] (B); \draw (A) -| (B); % \filldraw let \p1= (A) in (\x1,\y1) circle [radius=1pt] node[pin={[pin distance=1.1cm]270:{{\pgfmathparse{\x1}\pgfmathprintnumber[fixed,precision=2]{\pgfmathresult}\,pt}}}] {}; \filldraw let \p2= (B) in (\x2,\y2) circle (1pt) node[yshift=-0.5cm, pin=270:{{\pgfplotsconvertunittocoordinate{x}{\x2}\pgfmathprintnumber[fixed,precision=1]{\pgfmathresult}}}] {} node[yshift=0.5cm, pin={355:{{\pgfplotsconvertunittocoordinate{y}{\y2}\pgfmathprintnumber[fixed,precision=1]{\pgfmathresult}}}}] {}; \end{axis} \end{tikzpicture} \end{center} \end{document}
Say I have a Point: public class Point { double X, Y; } I want to get the index of the element inside List<Point> that satisfy a condition, for example, with the maximum Point.X value inside List<Point>. How would I do that with a LINQ expression?
I have an array of doubles and I want the index of the highest value. These are the solutions that I've come up with so far but I think that there must be a more elegant solution. Ideas? double[] score = new double[] { 12.2, 13.3, 5, 17.2, 2.2, 4.5 }; int topScoreIndex = score.Select((item, indx) => new {Item = item, Index = indx}).OrderByDescending(x => x.Item).Select(x => x.Index).First(); topScoreIndex = score.Select((item, indx) => new {Item = item, Index = indx}).OrderBy(x => x.Item).Select(x => x.Index).Last(); double maxVal = score.Max(); topScoreIndex = score.Select((item, indx) => new {Item = item, Index = indx}).Where(x => x.Item == maxVal).Select(x => x.Index).Single();
I heard some sentences with this form from English speakers: "what I do know is that..." or " We do share the same..." The question is: what is the applicant of do in these sentences? Why they use it before main verbs?
Possible Duplicate: What is the difference between "I understand you" and "I do understand you", and what kind of grammatical structure is the last one?
I was solving some multiple choice C codes from a book. Two of the questions involve pre decrementing, post decrementing a char variable initialised at 0. The output for both these is very different. I dont understand whats going on there. Code 1 char i=0; do { printf("%d ",i); }while(i--); return 0; The output for this snippet is 0. Code 2 char i=0; do { printf("%d ",i); }while(--i); return 0; The output is for this one is 0,-1,-2,.....-128,127,126,......1 . Can anyone explain why this is happening?
In C, what is the difference between using ++i and i++, and which should be used in the incrementation block of a for loop?