body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
I'm kind of starting off with the culinary world and one of the dishes i'll be making soon is French toast with caramelized strawberries. However i'd like to know how to make caramel thin, because i'll be drizzling it over the dish and the strawberries, many thanks ^^ | I want to make a caramel coating for cheesecake, or other cakes, that stays fluid in the fridge, and doesn't become hard/solid. I don't mind if the caramel sauce/syrup contains any butter/milk or not; if it's only made by sugar and water is OK. I made a caramel sauce, which was fluid for some time, but when I coated the cheesecake and put in the fridge, it became solid and I just sticked this out and threw it away. If you have a recipe for this I would be glad to hear about, just as long as it is caramelized sugar, not clear syrup (slightly heated water plus sugar). |
Is there any way how to code recursive function containing if with lamba? Is possible to rewrite this using lambda. def factorial(x): if x <= 1: return 1 return x * factorial(x - 1) print(factorial(5)) | A regular function can contain a call to itself in its definition, no problem. I can't figure out how to do it with a lambda function though for the simple reason that the lambda function has no name to refer back to. Is there a way to do it? How? |
I want to match all these using 1 single regex code. I wrote this ([a-z]{2})(\w+)?\1 but its not working anallagmatic bassarisk abba chorioallantois coccomyces commotive engrammatic glossoscopia hexacoralla hippogriffin inflammableness otto overattached saffarid sarraceniaceae scillipicrin tlapallan trillion unclassably unfitting unsmelled warrandice | I don't really understand regular expressions. Can you explain them to me in an easy-to-follow manner? If there are any online tools or books, could you also link to them? |
I have such string: "172.17.0.030". I should return False cuz it's not a valid ip address. How can I check that last octet contains not valid value (not in base of 10)? | What's the best way to validate that an IP entered by the user is valid? It comes in as a string. |
Every time I go to any website in the UK it asks me if I accept cookies or not. Is there a way to disable this question and accept all cookies universally? | What might be an effective way to universally block or auto-accept common cookie warning banners before the web browser shows them to the user? Eg. does a userscript (Greasefire/Tampermonkey) exist to find and thwart most cookie-warning implementations, perhaps via a regex search? Or at least can this be accomplished with an extension? (Trying not to bloat the browser with yet another extension, though.) This applies to many outdated UK and EU websites, especially now that the . |
I'm learning how to use Ubuntu Server, and after making my first install i realized that my partitions weren't correctly set up. It's way to complicated to fix now, and I regret not using my entire disk, so I want to reinstall everything from scratch. I don't care about saving any data or settings or anything. This might sound silly, but the problem I am having now is simply accessing the live disk again. Now that I have successfully installed Ubuntu Server, every time I try to boot the Live USB, it redirects me to the installed version on my disk. How do i bypass this and simply reinstall Ubuntu Server again? | How do I make an Bootable Ubuntu USB containing the the latest version of Ubuntu? For completeness, how would I be able to do this on Ubuntu, Windows, OS X or another Linux distro? |
I am currently trying to figure out how to use Unicode in a regex in Python. The regex I want to get to work is the following: r"([A-ZÜÖÄß]+\s)+" This should include all occurences of multiple capitalized words, that may or may not have Umlauts in them. Funnily enouth it will do nearly what I wanted, but it still ignores Umlauts. For example, in FUßBALL AND MORE only BALL AND MORE should be detected. I already tried to simply use the Unicode representations (Ü becomes \u00DC etc.), as it was advised in another thread, but that does not work too. Instead I might try to use the "regex" library instead of "re", but I kindoff want to know what I am doing wrong right now. If you are able to enlighten me, please feel free to do so. | I need to delete some Unicode symbols from the string 'بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ' I know they exist here for sure. I tried: re.sub('([\u064B-\u0652\u06D4\u0670\u0674\u06D5-\u06ED]+)', '', 'بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ') but it doesn't work. String stays the same. What am I doing wrong? |
In the android app, I'd love for pinch-zoom text to be supported, but that's a . Rather than gripe about that, I just went to increase the system text size. Alas, this only makes the comment text easier to read, not the question or answer text. Running ICS 4.0.4 on a Samsung Galaxy tab 7. Screen captures With all system text set to normal size, the app looks like this: After setting system text to large, the comment text gets bigger but not the question or answer text: | Why can we not adjust the size of the text in the Stack Exchange app? The tiny size text may be unhealthy to my eyes. Can the ability to adjust the text size be added? |
What is the max possible level in Rogue Legacy? I don't see any sort of experience bar, is level gain based on your generation or the number of monsters slain? | I'm pretty sure when I started the game, my guy was level 1. After playing a while, all my guys seem to be level 8. Do later generations level up at a fixed rate, making the game easier the more you play, or is it tied to upgrades I've purchased (such as upgrading knight to paladin)? |
Basically, I'm looking for a word for "wearables". Example: Mary put on the __ she wasn't wearing yet: panties, pants, pumps. Maybe accessories? | I'm looking for a word that applies to all the things a person can wear, e.g. clothes, shoes, accessories, etc. It musn't be too generic, e.g. product, item, etc. |
I have always tried to improve my test coverage as a black-box tester. Still, I believe that I need to improve my ability to generate practical and highly-usable ideas to test better so that I find serious bugs easily. What are some models, theories, heuristics that have really helped you to find any kind of bug in any web-application. Kindly share some black-box testing heuristics for an enterprise web application. | I'm trying to learn more about software testing, so I want to know which books you would recommend on this topic |
I'm using Windows 7 64-bit (x64) Infection date and initial symptoms: Last week, I noticed when I right click on a red flag in "Window Security Alert" icon, it pop out a message "Security Center Service is turned off", So, I tried to click turn on now but the error message keep showing"Security Center service can't be started". I think that the reason is my browser is infected with some malicious software. My antivirus scanned for two malicious software and I had deleted it. So I open the window defender and click on full scan but nothing was found. Then, I type on services.msc to check for security center of its status type and I found it was disabled. So, I click on properties and select automatic delayed start. However the problem haven't solved after I reboot my computer. Here is the result after I type the command for System File Checker (SFC) Can you please help? | What should I do if my Windows computer seems to be infected with a virus or malware? What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware? This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits. |
<h2>hello world</h2> Here, i want to styling first word "hello" without using any span or b tag or any JavaScript. just using style like h2:first-word{color:red}. Is it possible? If possible how can i solve it? | This one has me kind of stumped. I want to make the first word of all the paragraphs in my #content div at 14pt instead of the default for the paragraphs (12pt). Is there a way to do this in straight CSS or am I left wrapping the first word in a span to accomplish this? |
What does "otherwise than" mean in this sentence? [...]a very extensive territory cannot be governed on the principles of freedom, otherwise than by a confederacy of republics[...] Is is saying that an extensive territory can be governed on principles of freedom by a confederacy of republics? Or is it saying that an extensive territory cannot be governed on principles of freedom by a confederacy of republics? If it helps here is a snapshot of the document: | Please explain the meaning of the second part and explain "otherwise than" in part b a person’s UK property business consists of: (a) every business which the person carries on for generating income from land in the United Kingdom; and (b) every transaction which the person enters into for that purpose otherwise than in the course of such a business. |
I am a beginner programmer and I was trying to create a random code involving scanner and objects, but I came into a problem involving scanner. Here was my code: package jrJava.objectPracticeHome; import java.util.Scanner; public class Coordinator { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); GroceryStore groceryStore = new GroceryStore(); System.out.println("Welcome to the Zhenda Grocery Store! We sell pears, apples, and oranges!"); System.out.println("Type in 'apple', 'orange' or 'pear' to view the number of each fruit. "); String fruit = scanner.next(); if(fruit == "apple"){ System.out.println(groceryStore.getAppleInv()); } else if(fruit == "orange"){ System.out.println(groceryStore.getOrangeInv()); } else if(fruit == "pear"){ System.out.println(groceryStore.getPearInv()); } } } I'm sure I called the methods correctly, and no errors pop up when I run it. Please help! :P Thanks! | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
I'd like to show that if $n$ is a composite number, then so is $2^n-1$. When $n$ is an even number, this is simple. Let $n$ = 2k. Then, $2^n -1 = (2^k)^2- 1 = (2^k -1)(2^k + 1)$. For the case where $3|n$, this is also not too hard. For $n = 6$, we have $2^6 -1 = 63 = 7 \cdot 9$. Assume $7|(2^{3k} -1)$. Then, $2^{3(k +1)} -1 = 7\cdot2^{3k} + (2^{3k} -1) $ which is divisible by 7. So, we can show that this case also leads to a composite number via induction. However, I can't seem to generalize it for an arbitrary $n$. Any hints to the right direction is much appreciated. | Not sure if I'm doing this correctly but this is what I've done: Assume that $n$ is composite and suppose $2^n-1$ is a prime for $n \gt 2$. Then, $2^n-1 = 2k$ for some $k \in \Bbb Z $, $\forall n$. But this would be a contradiction since $n \gt 2$. I'm not sure if this a correct proof. EDIT: I realized that it's to prove $2^n - 1$ NOT $2^{n-1}$ so my attempt above is completely wrong. |
I want if Status column = 1 Check If there are rows in another table return 'Check' and If no rows return 'In DB' SELECT ID, UserName, CASE [Status] WHEN 1 THEN if ((Select Count(*) From Logs_TB Where Logs_TB.UserName = Users_TB.UserName) > 0) 'Check' Else 'In DB' WHEN 2 THEN 'Revision' WHEN 3 THEN 'Sent' END AS StatusName FROM Users_TB CROSS JOIN Logs_TB Edit 1: I have Two Tables in First Table. I want to get the following result for Column [Status] if FirstTable.ColumnStatus = 1 if SecondTable.ColumnA = FirstTable.ColumnB Has Rows 'Check' else 'In DB' else if FirstTable.ColumnStatus = 2 'Revision' else if FirstTable.ColumnStatus = 3 'Sent' Edit 2 This is an example I want Select All Rows From Employment Table and I want to parse column Status to Column As "StatusName" if Status = 1 It has two values First value Check if QualificationID and SpecializationID Has Rows in Table 'Vacancies' return 'Check' and if no rows in Table 'Vacancies' return 'In DB' if Status = 2 'Revision' if Status = 3 'Sent' | How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product |
Let $f\in C^2 [0,1]$ and $f(0)=0=f(1)$ and for all $x\in (0,1)$ we have $f(x)>0$. Prove that $$ \int_0^1 \dfrac{|f''(x)|}{f(x)}dx>4.$$ I want to prove this problem with elementary math tools. It is given to the first year university students as a calculus exercise. It is noticed that: Hint: Use average value theorem in suitable intervals. | Let $f$ be a $C^2$ function in $[0,1]$ such that $f(0)=f(1)=0$ and $f(x)\neq 0\,\forall x\in(0,1).$ Prove that $$\int_0^1 \left|\frac{f{''}(x)}{f(x)}\right|dx\ge4$$ |
I know this can vary, but in the standard setup, when calculating principal components (PCs), we begin by subtracting the means of each feature (dimension), but we do not divide by the standard deviation. Why is the zero-centering necessary, but setting standard deviations to $1$ not necessary? A follow-up question: suppose I calculate the the PCs offline, and then use these hard-coded coefficients for noise reduction on streaming (live) data. What is the mean I should use on the live data? The one from the historical data that was used to derive the coefficients in the first place, or the mean of the live (online) data? | What are the main differences between performing principal component analysis (PCA) on the correlation matrix and on the covariance matrix? Do they give the same results? |
$n,m \in \mathbb{N}$ and $D_n$ is the set that contains all divisors of $n$, including $1$ and $n$. My Claim: if $\mid D_n \mid=$ an odd number $\iff n$ is a perfect square. and indeed Using Ordinal Numbers.the number $$\frac{\mid D_n \mid+1}{2}.$$ in the set $D_n$: is the $\sqrt{n}$. I didn't found a counterexample so far. if it exists just post it and I will delete the question. Thank You. | Is this proof that $m$ is a perfect square iff $m$ has an odd number of divisors correct? $\Rightarrow)$ If $m$ is a perfect square there is an $x$ such that $x = m/x$. The rest of the divisors come in pairs $d, m/d$, so $m$ has an odd number of divisors. $\Leftarrow)$ Again, divisors come in pairs $m, m/d$ If there are an odd number of divisors, then necessarily $m/d = d$ for some divisor $d$, so $m$ is a square. |
I have a geojson file, but it's way too heavy for the app I need to develop I'd like to know what alternative do I have to make it lighter. I was thinking about simplifying it's shapes, and also turning to topojson. Could you recommend me some tool to achieve this? -- Edit: I saw the other thread stating how to convert to topojson, but I'd also like to simplify the shapes, they are much too detailed for the visualization I'm working on. | How can data to be converted? TopoJSON files are often smaller than GeoJSON and the conversion allows you to incrementally simplify a dataset, if you wish. |
49 to power of 7 to the power of 0 Now ${(49^{7})}^0=1$ since $x^0 =1$ However ${(49)}^{(7^0)}=(49)^1=49$. Hence ${(49^{7})}^0 \neq {(49)}^{7^0}$ Why don't these agree? When I see ${49^{7}}^{0}$ in questions / texts which meaning should I take? I am aware of power towers but have not studied them before. I have a Maths Degree (UK). | Does $x^{y^z}$ equal $x^{(y^z)}$? If so, why? Why not simply apply the order of the operation from left to right? Meaning $x^{y^z}$ equals $(x^y)^z$? I always get confused with this and I don't understand the underlying rule. Any help would be appreciated! |
I am facing the common problem of adapter not found on Ubuntu 18 while trying to connect wifi. I followed this These steps: sudo modprobe -r rtl8723de sudo modprobe rtl8723de give me "module not found error". So, I ran: lspci -nn and got 00:00.0 Host bridge [0600]: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub [8086:2a00] (rev 0c) 00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) [8086:2a02] (rev 0c) 00:02.1 Display controller [0380]: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (secondary) [8086:2a03] (rev 0c) 00:1a.0 USB controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 [8086:2834] (rev 03) 00:1a.1 USB controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 [8086:2835] (rev 03) 00:1a.7 USB controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 [8086:283a] (rev 03) 00:1b.0 Audio device [0403]: Intel Corporation 82801H (ICH8 Family) HD Audio Controller [8086:284b] (rev 03) 00:1c.0 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 [8086:283f] (rev 03) 00:1c.1 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 [8086:2841] (rev 03) 00:1c.2 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 [8086:2843] (rev 03) 00:1c.3 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 [8086:2845] (rev 03) 00:1d.0 USB controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 [8086:2830] (rev 03) 00:1d.1 USB controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 [8086:2831] (rev 03) 00:1d.2 USB controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 [8086:2832] (rev 03) 00:1d.7 USB controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 [8086:2836] (rev 03) 00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev f3) 00:1f.0 ISA bridge [0601]: Intel Corporation 82801HM (ICH8M) LPC Interface Controller [8086:2815] (rev 03) 00:1f.1 IDE interface [0101]: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) IDE Controller [8086:2850] (rev 03) 00:1f.2 SATA controller [0106]: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] [8086:2829] (rev 03) 00:1f.3 SMBus [0c05]: Intel Corporation 82801H (ICH8 Family) SMBus Controller [8086:283e] (rev 03) 05:00.0 Ethernet controller [0200]: Marvell Technology Group Ltd. 88E8039 PCI-E Fast Ethernet Controller [11ab:4353] (rev 14) 07:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01) 08:09.0 FireWire (IEEE 1394) [0c00]: Ricoh Co Ltd R5C832 IEEE 1394 Controller [1180:0832] (rev 05) 08:09.1 SD Host controller [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter [1180:0822] (rev 22) 08:09.2 System peripheral [0880]: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter [1180:0592] (rev 12) 08:09.3 System peripheral [0880]: Ricoh Co Ltd xD-Picture Card Controller [1180:0852] (rev 12) Now which driver do I require? What steps do I have to follow? | 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 am struggling with this problem. I couldn't obtain anything from an arbitrary open covering of the space. I couldn't think of any counterexample. I tried googling it, but there were no results. The problem is: Is a topological space $X$ compact if every nontrivial closed subset of $X$ is compact? | Let $X$ be a topological space. It is that, if $X$ is compact, then every proper closed subset $Y \subset X$ is compact. Out of curiosity, I would like to explore the converse of this statement: Let $X$ be a topological space with the property that every proper closed subset is compact. Is $X$ itself compact? Of course, this question is only interesting when $X$ is infinite. We can further restrict ourselves to spaces that have infinitely many open sets since every closed set, and indeed the space itself, would be compact otherwise. If this result is false in general, what hypotheses can be added to make it so? Should this not hold, I'm interested in finding concrete examples of when it does. For instance, we can take any infinite set endowed with the , which works because every closed set is finite and thus compact, and the space itself would be compact. Another example is an interval $[a, b] \subset \mathbb{R}$, wherein closed subsets of this are closed and bounded in $\mathbb{R}$; as such, they are compact per . Update: Zardo's answer reveals that such a topological space is indeed compact. For further discussion on the and its relevance to compactness, see Munkres' : Chapter $3$, theorem $26.9$. |
is for installing drivers for my WiFi adapter, but I haven't got an gcc installed yet and I haven't got an internet access. I tried manualy dpkg build-essentials but I have an error: dpkg: error processing package build-essential (--install): dependency problems - leaving unconfirmed I think it is problem with this that I won't have apt-get update && apt-get upgrade done, but I can't perform it cause as I told, I haven't got an internet connection. | I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily? |
Let $G$ be a group. Prove that $g^2 = e$ for all $g \in G$, then $G$ is abelian. ($e$ is the identity element.) My Solution: Let $a,b \in G$. Then $a(ab)b = a^2b^2 = e^2 =e$. Now I tried to reverse $ab$ in the brackets to get the same solution to show that the group is also commutative but I was not able to do so. | Prove that if $g^2=e$ for all $g$ in $G$ then $G$ is Abelian. This question is from group theory in Abstract Algebra and no matter how many times my lecturer teaches it for some reason I can't seem to crack it. (Please note that $e$ in the question is the group's identity.) Here's my attempt though... First I understand Abelian means that if $g_1$ and $g_2$ are elements of a group $G$ then they are Abelian if $g_1g_2=g_2g_1$... So, I begin by trying to play around with the elements of the group based on their definition... $$(g_2g_1)^r=e$$ $$(g_2g_1g_2g_2^{-1})^r=e$$ $$(g_2g_1g_2g_2^{-1}g_2g_1g_2g_2^{-1}...g_2g_1g_2g_2^{-1})=e$$ I assume that the $g_2^{-1}$'s and the $g_2$'s cancel out so that we end up with something like, $$g_2(g_1g_2)^rg_2^{-1}=e$$ $$g_2^{-1}g_2(g_1g_2)^r=g_2^{-1}g_2$$ Then ultimately... $$g_1g_2=e$$ I figure this is the answer. But I'm not totally sure. I always feel like I do too much in the pursuit of an answer when there's a simpler way. Reference: Fraleigh p. 49 Question 4.38 in A First Course in Abstract Algebra. |
I want to install Linux on a disk that currently contains Windows 7. I want to remove the current Windows. I have not tried anything yet because I am new to this. | My laptop is filled with viruses and Windows XP is just becoming impossible to work with. I've been interested in Ubuntu for a while, so, would I be able to use something like Debian to clear my HDD and OS and then install Ubuntu and start fresh? |
How do I tell GRUB to boot Ubuntu in command-line and not to load any AMD graphics drivers? It seems that my laptop's Graphics card is broken - there are . I am able to get to the GRUB menu with these blue stripes. However, once I chose "recovery mode" the screen just freezes and cursor keeps blinking forever. My goal is to somehow boot into system and copy all personal files to a remote host, but I can't do that presumably because Ubuntu tries to load AMD GPU driver and switches graphics mode. The same issue happens also If I try to boot my system with USB flash drive. | Is it possible to disable X at boot time? I'm setting up a server so it would be nice if it wouldn't load the graphical interface every time I boot. |
Is apt-file part of apt? I have apt installed by default, but no apt-file. How about apt-cache? I don't remember whether mine was installed by default or me. | Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is. Bonus question: what if it's a file that isn't installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it? |
I did a mission for the Dawnguard where I was to kill a vampire at Half-Moon Mill. And now later in the game, I can't buy sawn logs for my house. | You can buy land / build houses in Dawnstar, Falkrath and Morthal. At each house, there are sources for clay and stone, but where can you buy the sawn logs for each plot? I know only the source for Falkrath, which is Riverwood. |
I have a requirement to show an apex page message "XX YY" if the selected template id to email is "Update Status". (This message needs to be displayed when they make the selection not when they click the "Send" button.) Please find my page here: <apex:page standardController="Incident_abv__c" recordSetVar="Incidents" extensions="IncidentListActionController" tabStyle="Incident_abv__c"> <apex:form > <apex:pageBlock title="Selected Incidents to Include in Attachment" id="Pb1"> <apex:pageMessages /> <apex:commandButton value="Back" action="{!cancel}" rendered="{!SelectedSize == 0}"/> <apex:pageBlockTable value="{!selected}" var="inc" rendered="{!SelectedSize > 0}"> <apex:column value="{!inc.name}"/> <apex:column value="{!inc.Rep_abv__c}"/> <apex:column value="{!inc.Incident_Loaded_Date_abv__c}"/> <apex:column value="{!inc.No_Of_Transactions_abv__c}"/> <apex:column value="{!inc.Status_abv__c}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:actionFunction name="rerenderEmailFields" action="{!ApplyTemplate}" rerender="PB2" > <apex:param name="firstParam" assignTo="{!selectedTemplateId}" value="" /> </apex:actionFunction> <apex:pageBlock title="Email" id="PB2" rendered="{!SelectedSize > 0}"> <apex:pageBlockButtons > <apex:commandButton value="Send" action="{!send}" reRender="Pb1"/> </apex:pageBlockButtons> <apex:pageBlockSection columns="1"> <apex:selectList id="chooseTempalte" label="Choose Template" value="{!selectedTemplateId}" size="1" onChange="rerenderEmailFields(this.value)"> <apex:selectOptions value="{!TemplateOptions}"/> </apex:selectList> <apex:InputText value="{!ToEmailAddrs}" label="To Addresses" style="width:100%"/> <apex:InputText value="{!CCEmailAddrs}" label="CC Addresses" style="width:100%"/> <apex:InputText value="{!Subject}" label="Subject" style="width:100%"/> <apex:InputTextArea value="{!Body}" label="Body" style="width:100%;height:300px;" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> | I have a requirement to show page message for a particular selected template. The template selection done here. But render is always returning true in this case. Can someone help me here? <apex:selectList id="chooseTempalte" label="Choose Template" title="Select your Template" value="{!selectedTemplateId}" size="1" onChange="rerenderEmailFields(this.value)"> <apex:selectOptions value="{!TemplateOptions}"/> </apex:selectList> <apex:outputLabel style="color:red;" rendered="{!IF(selectedTemplateId='Update Status - Send to ABSM', false, true)}" > Please note this selected option will set the status value to Under Review <br/><br/> </apex:outputLabel> Please find the apex controller snippet here. public List<SelectOption> getTemplateOptions() { options = new List<SelectOption>(); for (EmailTemplate t : etMap.values()) { options.add(new SelectOption(t.Id,t.Name)); if((selectedTemplateId == '' || selectedTemplateId == null) && t.Name == 'Update Status - Send to ABSM') { selectedTemplateId = t.Id; ApplyTemplate(); } } return options; } |
I want to argue that $$\lim_{n\rightarrow\infty} \frac{1}{n}\sum_{k=1}^n f(k)=0~~~~~~~ {\rm if}~~~~~ \lim_{k\rightarrow\infty}f(k)=0.$$ This identity does not seem to hold always, but seems to hold in practice based on my experience. I guess there should be some conditions to make this identity hold. For example, I think $f(k)$ may have to converge to zero uniformly, not pointwise. Or $f(k)$ may have to be an uniformly continuous function of $k$. Can anyone help me set up the conditions and prove the identity? | Prove that if $\lim_{n \to \infty}z_{n}=A$ then: $$\lim_{n \to \infty}\frac{z_{1}+z_{2}+\cdots + z_{n}}{n}=A$$ I was thinking spliting it in: $$(z_{1}+z_{2}+\cdots+z_{N-1})+(z_{N}+z_{N+1}+\cdots+z_{n})$$ where $N$ is value of $n$ for which $|A-z_{n}|<\epsilon$ then taking the limit of this sum devided by $n$ , and noting that the second sum is as close as you wish to $nA$ while the first is as close as you wish to $0$. Not sure if this helps.... |
Is it safe to assume that python module is calculated once? If module A contains CONST_A = json.load(...) and is imported multiple times in different files of the same program and different threads, will it be calculated/executed just once? If not, when the CONST_A be recalculated? And would the next structure fix it? module CALCULATE_CONST_A import json CONST_A = json.load(open(...)) module A from CALCULATE_CONST_A import CONST_A further imports of A... Final question: What are the best practices for creating precalculated constants? | If a large module is loaded by some submodule of your code, is there any benefit to referencing the module from that namespace instead of importing it again? For example: I have a module MyLib, which makes extensive use of ReallyBigLib. If I have code that imports MyLib, should I dig the module out like so import MyLib ReallyBigLib = MyLib.SomeModule.ReallyBigLib or just import MyLib import ReallyBigLib |
Is there any way to list which scripts and styles have been enqueued, while within wp-admin? For example this code works, but only if you are on the frontend. How could I get the same list while staying in wp-admin? function dc_list_scripts() { global $wp_scripts; $enqueued_scripts = array(); foreach ( $wp_scripts->queue as $handle ) { $enqueued_scripts[ $handle ]['handle'] = $wp_scripts->registered[ $handle ]->handle; $enqueued_scripts[ $handle ]['src'] = $wp_scripts->registered[ $handle ]->src; } print_r( $enqueued_scripts ); } add_action( 'wp_print_scripts', 'dc_list_scripts' ); If I run the above code in wp-admin then I get a list of scripts and styles enqueued within wp-admin. That's not what I want, I need to know which resources are enqueued for the frontend. | I'm creating a plugin and I want to get the list of all scripts and CSS used by other plugins. This is my function: function crunchify_print_scripts_styles() { $result = []; $result['scripts'] = []; $result['styles'] = []; // Print all loaded Scripts global $wp_scripts; foreach( $wp_scripts->queue as $script ) : $result['scripts'][] = $wp_scripts->registered[$script]->src . ";"; endforeach; // Print all loaded Styles (CSS) global $wp_styles; foreach( $wp_styles->queue as $style ) : $result['styles'][] = $wp_styles->registered[$style]->src . ";"; endforeach; return $result; } add_action( 'wp_enqueue_scripts', 'crunchify_print_scripts_styles'); I want to get the returned value inside a variable. I tried this: $toto = do_action( 'crunchify_print_scripts_styles' ); var_dump( $toto ); And this is my result: NULL If I write echo inside every foreach loop, I get the correct results, but how to store these values inside a variable? [edit] My code inside a pluginm which is not working too /** * Get all scripts and styles from Wordpress */ function print_scripts_styles() { $result = []; $result['scripts'] = []; $result['styles'] = []; // Print all loaded Scripts global $wp_scripts; foreach( $wp_scripts->queue as $script ) : $result['scripts'][] = $wp_scripts->registered[$script]->src . ";"; endforeach; // Print all loaded Styles (CSS) global $wp_styles; foreach( $wp_styles->queue as $style ) : $result['styles'][] = $wp_styles->registered[$style]->src . ";"; endforeach; return $result; } add_action( 'wp_head', 'wp_rest_assets_init'); /** * Init JSON REST API Assets routes. * * @since 1.0.0 */ function wp_rest_assets_init() { $all_the_scripts_and_styles = print_scripts_styles(); if ( ! defined( 'JSON_API_VERSION' ) && ! in_array( 'json-rest-api/plugin.php', get_option( 'active_plugins' ) ) ) { $class = new WP_REST_Assets(); $class::$scriptsAndStyles = $all_the_scripts_and_styles; add_filter( 'rest_api_init', array( $class, 'register_routes' ) ); } else { $class = new WP_JSON_Menus(); add_filter( 'json_endpoints', array( $class, 'register_routes' ) ); } } add_action( 'init', 'wp_rest_assets_init' ); |
This is a strange situation that I don't really know why it's happening. Let's say I have these directories (names are fake but the structure is real): a +- b | + file1 | + file2 | +- c + file3 + file4 I can navigate to all three directories without problems in the explorer. However when I try to cd into b and c, I got this C:\PathToUser\a> cd "b" The system cannot find the path specified. This is strange because they are clearly there: Volume in drive C is OS Volume Serial Number is SOME-NUMS Directory of C:\PathToUser\a 12/12/2017 11:56 PM <DIR> . 12/12/2017 11:56 PM <DIR> .. 01/29/2012 10:54 PM <DIR> b 01/29/2012 10:32 PM <DIR> c 0 File(s) 0 bytes 4 Dir(s) SOME bytes free What I wanted to do is to remove those two directories, but I couldn't remove them with both cmd and explorer. Are the directories corrupted? Any suggestion is appreciated, thanks. | I have created a folder via , but I made a mistake since I forgot to clear spaces. Now I cannot delete this folder. I have found a similar issue here - (Quoted below), but I don't know how to rename a folder with . I had the same problem, in Windows 7 x64, and none of the command-line solutions worked here. What fixed it for me: Rename the folder using 7-Zip Delete, either using 7-Zip or (both work). Note that deleting the folder in 7-Zip before renaming it was impossible. I also tried the command line, but it does not work. My folder is named " 1 ". I downloaded 7-Zip, and Google does not provide the help I need. |
I am trying to create a short and simple animation. I have 2 scenes, one a coin with a logo on it, and the other with an abstract background. When I go into the compositor to render it, the coin with the logo is transparent and I don't know to to fix it. | I have multiple scenes each with different objects. I want to combine all these scenes in the compositor but when they render, all the objects from each scene overlap each other and are all transparent, so I can see all the objects when some should be hidden behind others. To join my scenes I'm using a mix node with add. |
I have created 3d model of a little boy but when I render it there are small points on the model what can cause it? There is a plane with material of emission. | I know that this question is a bit old or maybe overdone, but I'm running the latest edition of Blender and when I use the Cycles engine I get really fuzzy results and I can't find a simple, non-compromising solution to the quality. I don't know exactly what I'm doing wrong here, but I'm sure others share my frustration. Leaving everything in default settings, I started a new project and switched to the Cycles render. I duplicated the cube and set colors for two Diffuse BSDF shaders, then went ahead and made walls and a floor all sharing the same diffuse shader. I made two windows to emit blue light. The screenshot has gaps between the walls because of the setup: I'm aware that it's considered very incomplete and many have come to terms with some amount of noise, but is this normal? Furthermore, with default settings or not, I can't change the amount of noise produced. Supposedly, using "progressively refine" in the rendering tab should make it refine itself indefinitely, however Cycles only counts to 10 refines and then stops, creating a render which is a pixel-perfect match of the ordinary rendering method when it's completed. I understand that there are tricks that can be used to reduce noise, but at the cost of extra processing time and usually small quality conflicts, like blurring. My question essentially boils down to is this Cycles' current limit? |
Since U1's being axed and the desktop client can't connect, how should I about downloading large numbers of files in nested folders from the web client? I'd prefer to not install Chrome. | I just installed Ubuntu 14.04, and Ubuntu One isn't installed by default and their download page says it comes pre installed, which doesn't help with anything. I wanna move all my files from Ubuntu One to Dropbox, but downloading one file at a time from the browser and upload it again to dropbox will take way too long. Is there any way to get Ubuntu One on Ubuntu 14.04? or somehow download all files from the Ubuntu One website? I see they updated their site: |
I am looking for some solution to my problem, here is what i need, just an example i have phrase "ProgrammingIsIntresting" i need it to split and make a string like "Programming Is Intresting". CultureInfo.CurrentCulture.TextInfo.ToTitleCase work here but how can i put space literal here. here is what i have and it seems i am stuck here. var UpperChars = mystring.Where(c => Char.IsUpper(c)); foreach (var ch in UpperChars) { if (mystring.IndexOf(ch) == 0) continue; } | What is the best way to convert from Pascal Case (upper Camel Case) to a sentence. For example starting with "AwaitingFeedback" and converting that to "Awaiting feedback" C# preferable but I could convert it from Java or similar. |
when I build my app it shows this error message: Caused by: com.sun.tools.javac.util.ClientCodeException: java.lang.NullPointerException | 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 am currently working on a project, and i've hit an impasse. I was modeling a tree, and just finished. Then I went and made another one. However the two trees that I made are for some reason the same object. It would be greatly appreciated if I could get help on this matter. Thx! | I've just made a set of armor by using a male body mesh model I downloaded and selecting certain faces from the model and duplicating them to create viable armor pieces. Since the pieces are just duplicated from the same mesh male model, then it's still part of the same object. How do I separate the armor piece from the model to make the pieces separate? |
When I am changing the value of a copy of the original variable the original variable is getting changed. The code below function test(){ var original= ['','','','1','']; var copyy=original; copyy[3]="2"; console.log(original); } The console output is ["", "", "", "2", ""] Not able to wrap my head around this. | The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself). Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this? |
to prove that, is it correct to proceed by contradicion and try to reach some conclusion like "if the order = size - 1 there can't be any cycles"? In that case, can you give me a hint of where to start? EDIT: Sorry for not providing enough details. I am considering simple graphs. the definition of tree I use is "connected and acyclic graph", so an equivalent thing to prove would be if G has n - 1 edges, it has no cycles. thanks! | Let $G=(V,E)$ a graph. Prove that $G$ has no cycles if and only if $G$ has $n-m$ connected components where $n$ is the number of vertices of $G$ and $m$ is the number of edges of $G$. The thing I did is that since $G$ has no cycles then $ \frac{m}{n} <1$. Can someone give me some hints-ideas? Thank's in advance! |
I have the following string : some_string = "%envvar1%\location\execution.exe" envvar1 is an environment variable with value of "c:\", and I would like some function as following: some_string = "%envvar1%\location\execution.exe" inject_env_variable(some_string) print(some_string) "c:\location\execution.exe" Creating a function like this wouldnt be to difficult with regular expressions and os.environ but I was wondering if there was some kind of built in module that treats these kind of things. Note: google searching anything with the word 'path' and 'python' is really tedious since all the searches are related to pythonpath :P | I have a string representing a path. Because this application is used on Windows, OSX and Linux, we've defined environment variables to properly map volumes from the different file systems. The result is: "$C/test/testing" What I want to do is evaluate the environment variables in the string so that they're replaced by their respective volume names. Is there a specific command I'm missing, or do I have to take os.environ.keys() and manually replace the strings? |
Let $m$ be a positive integer and let $\alpha$ be a real number. Show that $$\left[\alpha\right]+\left[\alpha+\frac{1}{m}\right]+\cdots + \left[\alpha+\frac{m-1}{m}\right] = \left[m\alpha\right]$$ where $\left[\ \ \right]$ is the integral part function. Remark: Attempt to prove this result by induction but I failed in the inductive step, I have been unable use the induction hypothesis. | I'm doing some exercises on Apostol's calculus, on the floor function. Now, he doesn't give an explicit definition of $[x]$, so I'm going with this one: DEFINITION Given $x\in \Bbb R$, the integer part of $x$ is the unique $z\in \Bbb Z$ such that $$z\leq x < z+1$$ and we denote it by $[x]$. Now he asks to prove some basic things about it, such as: if $n\in \Bbb Z$, then $[x+n]=[x]+n$ So I proved it like this: Let $z=[x+n]$ and $z'=[x]$. Then we have that $$z\leq x+n<z+1$$ $$z'\leq x<z'+1$$ Then $$z'+n\leq x+n<z'+n+1$$ But since $z'$ is an integer, so is $z'+n$. Since $z$ is unique, it must be that $z'+n=z$. However, this doesn't seem to get me anywhere to prove that $$\left[ {2x} \right] = \left[ x \right] + \left[ {x + \frac{1}{2}} \right]$$ in and in general that $$\left[ {nx} \right] = \sum\limits_{k = 0}^{n - 1} {\left[ {x + \frac{k}{n}} \right]} $$ Obviously one could do an informal proof thinking about "the carries", but that's not the idea, let alone how tedious it would be. Maybe there is some easier or clearer characterization of $[x]$ in terms of $x$ to work this out. Another property is $$[-x]=\begin{cases}-[x]\text{ ; if }x\in \Bbb Z \cr-[x]-1 \text{ ; otherwise}\end{cases}$$ I argue: if $x\in\Bbb Z$, it is clear $[x]=x$. Then $-[x]=-x$, and $-[x]\in \Bbb Z$ so $[-[x]]=-[x]=[-x]$. For the other, I guess one could say: $$n \leqslant x < n + 1 \Rightarrow - n - 1 < x \leqslant -n$$ and since $x$ is not an integer, this should be the same as $$ - n - 1 \leqslant -x < -n$$ $$ - n - 1 \leqslant -x < (-n-1)+1$$ So $[-x]=-[x]-1$ |
How can one prove that for any $x>1$: $$\lim\limits_{n\to \infty }\left(\frac{n^x \Gamma \left(n+1\right)}{\Gamma \left(x+n+1\right)}\right)=1$$ It is easy to show this for $x$ a natural number since we can write the gamma function as a factorial but I would like some ideas on how to prove this for $x$ not a natural number. | here on math.SE have used as an intermediate step the following inequality that is due to Walter Gautschi: $$x^{1-s} < \frac{\Gamma(x+1)}{\Gamma(x+s)} < (x+1)^{1-s},\qquad x > 0,\; 0 < s < 1$$ Unfortunately, that the is pointing to is not easily accessible. How might this inequality be proven? |
Is $(\mathbb R^2,+,\cdot )$ a field where $(a,b)\cdot (c,d)=(ac-bd, ad+bc)$ ? I think it is because $\varphi :\mathbb R^2\to \mathbb C$ defined by $\varphi (a,b)=a+ib$ is a ring isomorphism, but my teacher says it's not, and I don't understand why. Any idea ? | I'm new to this very interesting world of mathematics, and I'm trying to learn some linear algebra from Khan academy. In the world of vector spaces and fields, I keep coming across the definition of $\mathbb R^2$ as a vector space ontop of the field $\mathbb R$. This makes me think, Why can't $\mathbb R^2$ be a field of its own? Would that make $\mathbb R^2$ a field and a vector space? Thanks |
An innocuous question. Is there a way to combine Latex and IntelliJ Idea 15.2 I am astonished by realization on this as it was shown in this | Since I'm here for the first time as a registered user, I'll introduce myself. I am a developer that have created a Gitignore plugin last time for . It was fun to develop something that others use. After that I was thinking about a new product that I can release and I've checked wishlist on JetBrain's plugins page - there is a request for LaTeX plugin (there are not too much voices in general, but I supose it's because of page's low viewership). Before I'll start anything I'd like to ask you - does LaTeX plugin for JetBrains' IDEs makes any sense ? I'd like to hear, what do you think about it - will you use it ? Are there many IntelliJ, etc users ? What would you like to see in initial releases ? Thanks for the answers and I believe that this non-latex-problem question will not be banished. Best regards, hsz Edit: As @Joseph Wright pointed me out - not everyone know what IntelliJ is. IntelliJ is an IDE for programming in Java, PHP, NodeJS, Android, etc.. It allows programmer to write in barely every language that he needs. JetBrains provides adapted for various environments (Python/Perl, C#, iOS, Ruby, databases...). As soon as LaTeX is (sorry for that!) just a minor tool in programming, they didn't provide anything to cover it. That's why I got this idea - I am a programmer that needs to write documments in TeX - should I install external software that does not provide version controlling or should I try to create something integrated with powerful IDE that will give me more options, not just writing TeX documents.. I do not know if there are many programmers here and whet do you do in your work, what IDE do you use, but I give a shoot. Edit 16.01.2014 I've started development some time ago. Now it supports syntax coloring (BNF and JFlex rules created). The source code is available on my GitHub: IntelliJ plugin for LaTeX support will be released soon. Keep it in your minds that it'll be very simple version for now. |
I am currently trying to implement a very fast and simple encryption algorithm in Lua for the purpose of using it with ComputerCraft. The main problem is that bitwise operations in Lua (5.2 at least) are very slow and the implementation ComputerCraft can only handle 32 bit integers in their bit-library, so implementing standard algorithms isn't easy. On the other hand this is only a game and encryption is merely used to keep others from simply controlling your devices or reading your messages. There is no critical data associated with this, so the encryption can be very weak. I currently implemented a combination of XOR and random in the following form (pseudo-code): random.seed( hash(key) ) -- 32 bit seed for i = 1 to str.length do result[i] = str[i] XOR random.nextByte() end The good thing about this is that it only uses a single bit-operation and is guaranteed to never exceed 32 bit. Also this is very fast. Aside from external problems like random entropy, what is an approximate time someone would need to decrypt this using a standard desktop PC? (sophisticated guess is ok, I just want to get an idea) And if this is just too weak, is there any other algorithm that is more secure, but fast and can be implemented with a minimum amount of bit operations fitting in 32-bit? | I am very new to cryptography (so be kind), but I have a question that may seem silly. If the one-time pad is the perfect cipher and impossible to crack, why would the following algorithm not be one of the strongest: To encrypt: generate a random bit array using a pseudo number generator with the key as the seed The generated bit array is the size of the data use a simple XOR to encrypt using the generated bit array To decrypt: pseudo-random number generator will generate the same bit array with the same seed (the key) generate bit array the same size of the encrypted data run XOR on encrypted data using bit array that's generated This is very simplified, but you can imagine how for larger encryption you could break down the data into blocks, and in order to ensure that the block bit arrays are random a new seed for each can be derived from the key. So, if $f(k)$ is the pseudo random number generator, and b is the block number, you can encrypt each block with $f(k+b)$. ($k$ is key) Instead of using a pseudo-random number generator, you could use some hash algorithm to generate the pad. (assuming you can use equivalently strong keys) would this not be a very strong cipher method? Perhaps it may be strong and heavy on memory since the pad needs to be the size of the data. So during encryption and decryption you need to generate a pad that's equivalent to the size of the data. Is there a flaw in this algorithm, or would something like this not be practical and much slower than current standards? |
MySQL 5.5 I have a simple InnoDB table: CREATE TABLE `T` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `deleted` bigint(20) unsigned NOT NULL DEFAULT '0', `other` varchar(32) DEFAULT NULL, PRIMARY KEY (`id`,`deleted`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; And another table that encodes relationships among entries from the first table: CREATE TABLE `T_T` ( `id1` bigint(20) unsigned NOT NULL, `deleted1` bigint(20) unsigned NOT NULL, `id2` bigint(20) unsigned NOT NULL, `deleted2` bigint(20) unsigned NOT NULL, PRIMARY KEY (`id1`,`deleted1`,`id2`,`deleted2`), KEY `fk_T_T_2_idx` (`id2`,`deleted2`), CONSTRAINT `fk_T_T_2` FOREIGN KEY (`id2`, `deleted2`) REFERENCES `T` (`id`, `deleted`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_T_T_1` FOREIGN KEY (`id1`, `deleted1`) REFERENCES `T` (`id`, `deleted`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Creation of tables and population works perfectly fine. INSERT INTO T (id, deleted, other) VALUES (1, 0, 'whatever'); INSERT INTO T_T (id1, deleted1, id2, deleted2) VALUES (1, 0, 1, 0); Updating an entry in T, however, with something like this: UPDATE T SET deleted = 1 WHERE id = 1; leads to the following error: ERROR 1452: 1452: Cannot add or update a child row: a foreign key constraint fails (`test`.`T_T`, CONSTRAINT `fk_T_T_1` FOREIGN KEY (`id1`, `deleted1`) REFERENCES `T` (`id`, `deleted`) ON DELETE CASCADE ON UPDATE CASCADE) As noted by others, this works if the entries in T_T don't refer to self (id1 != id2). But an UPDATE will fail when a row in T_T refers with both ids to the same row in T. Is there a problem in MySQL with foreign keys that refer to another table's column(s) twice? Is there a work around for something like this? | I don't have much experience with DB design, and having a hard time figuring out what's wrong with the following: Table father has a composite PK (col1, col2) Table closure has ancestor(a-col1, a-col2), descendant(d-col1, d-col2) and length. Ancestor and Descendant are composite FKs, each pointing to the PK of father. The 4 columns (a-col1, a-col2,d-col1, d-col2) are a composite PK. Look at the following fiddle: I am working with MySQL. I have constraints in CASCADE, but when I try to update the father table, the constraints give me errors. I can't do the following update to father table row: UPDATE father SET `col1` = "UPDATE_MY_ID_PLEASE" WHERE `col1` = 'A' AND `col2` = 1; Is the design wrong? How should this be done? |
So it looks like part of my house had the door trim installed after the carpet. I'm currently in the process of ripping the carpet up and installing vinyl plank flooring, and noticed the huge gaps. Are my only options replacing all of the trim or caulking the bottom? Are there other options/products available? I also noticed gaps in this corner of drywall, as well as the drywall sheets touching the slab. I assume the only reason you don't do this is so that moisture isn't wicked up (given the gypsum does look soft). I figure I can throw some drywall tape on it and mud it up. Lastly, how do you account for the flooring around a curved fireplace? Is there a way to flush-cut the bottom of the brick, or do you install quarter-round trim at slight angles? I also assume all of the minor holes/gaps from tearing out the tack-board won't be an issue. | So it looks like part of my house had the door trim installed after the carpet. I'm currently in the process of ripping the carpet up and installing vinyl plank flooring, and noticed the huge gaps. Are my only options replacing all of the trim or caulking the bottom? Are there other options/products available? I also noticed gaps in this corner of drywall, as well as the drywall sheets touching the slab. I assume the only reason you don't do this is so that moisture isn't wicked up (given the gypsum does look soft). I figure I can throw some drywall tape on it and mud it up. Lastly, how do you account for the flooring around a curved fireplace? Is there a way to flush-cut the bottom of the brick, or do you install quarter-round trim at slight angles? I also assume all of the minor holes/gaps from tearing out the tack-board won't be an issue. |
I am aware that you can initialize an array during instantiation as follows: String[] names = new String[] {"Ryan", "Julie", "Bob"}; Is there a way to do the same thing with an ArrayList? Or must I add the contents individually with array.add()? | I have an array that is initialized like: Element[] array = {new Element(1), new Element(2), new Element(3)}; I would like to convert this array into an object of the class. ArrayList<Element> arraylist = ???; |
I'm trying to get used to Java. Been programming with C++ for about a year. I know the basic parts of programming Right now, I'm making a simple game, you select a number, two random numbers are being generated, if selected number is equal to one of the random numbers, you win and you receive some money. Casual game. Sadly, I'm not sure how to change variables value using a method. Could someone maybe improve my Java code and tell why my value is being recovered every time I keep playing the game? Sometimes, it doesn't even reduces my score value. It is hard to move to different programming language. Sorry for my language mistakes.. public static void main(String[] args) { int array[] = {1,2,3,4,5,6,7,8,9,10}; int money = 100; int moneyBet; int selectedNumber; int keepPlaying; boolean game = true; while(game) { System.out.println("Choose a number between 1 and 10:"); Scanner input = new Scanner(System.in); selectedNumber = input.nextInt(); System.out.println("Make a bet:"); moneyBet = input.nextInt(); foo(money, moneyBet, selectedNumber, array); System.out.println("Keep playing? YES - 1, NO - 2"); keepPlaying = input.nextInt(); if(keepPlaying == 1) { game = true; } else { game = false; System.out.println("Game over"); } } } public static void foo(int money, int moneyBet, int selectedNumber, int array[]) { Random random = new Random(); int randArray[]; int randomNumber; randArray = new int[2]; Scanner input = new Scanner(System.in); if(money < moneyBet) { System.out.print("Not enough money. Try again:"); moneyBet = input.nextInt(); }else { money -= moneyBet; } boolean checkWin = false; for(int i = 0; i < randArray.length; i++) { randomNumber = random.nextInt(array.length); randArray[i] = randomNumber; } for(int i = 0; i < randArray.length; i++) { System.out.print(randArray[i] + " "); } for(int i = 0; i < randArray.length; i++) { if(randArray[i] == selectedNumber) { checkWin = true; } else { checkWin = false; } } System.out.println(); if(checkWin) { System.out.println("You won. You receive " + moneyBet * 2 + " money!"); System.out.println("Your money:" + money); System.out.println("Keep playing? Y/N"); } else { System.out.println("Try your luck next time.."); System.out.println("Your money:" + money); } } | 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? |
I am a Ph.D. student, close to finishing up. I am looking for a post doc position and have been in talks with multiple professors in various universities. However, most of them want me to visit their lab for a talk or a presentation, without having directly confirmed anything. Although they sound positive about me, there is no confirmation yet. Moreover, this being a relatively early stage of my post-doc job hunt, I haven't truly made up my mind yet. I would like to know if it is unethical to accept reimbursement for travel and stay to these labs and subsequently refuse the offer, since obviously I can't accept all of them (if they happen to confirm me). Please share your opinion on this. | I am being considered for a very nice industry scientist position but this involves many interviews and assessments and can take some time. However I have also accepted an invitation to the US (I'm in Australia) to give a presentation in relation to high likelihood of employment as a postdoc in a research institute. The postdoc supervisor has arranged for sightseeing and lab visits and hotels. I feel bad if somehow I wish to pursue the industry position. Has anyone had a similar experience and have you turned down something like that before? |
I would like the output of \url{} and \href{} displayed identically. I have changed the color for both to be blue, but it appears as if a different for is being used as well: Code: \documentclass{book} \usepackage{xcolor} \usepackage{hyperref} \hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue} \begin{document} url: \url{www.yahoo.com} href: \href{http://www.yahoo.com}{www.yahoo.com} \end{document} | I want to set color, font and similar style attributes for the text in a \url from the hyperref package. How do I go about doing it? All I have found are . I want to because I am using ttf fonts for my texts and I want my urls to be in that ttf and not the default (typewriter font?) that the hyperref package gives me. I started with just trying to get it in italics but didn't even succeed with that: \documentclass{memoir} \usepackage{hyperref} \begin{document} Lala \url{\itshape www.example.com}. \end{document} I am guessing there is some hook or something but I just can't find it. Maybe I have gone blind? |
It must display "Correct" when the button text = "de" but when I click the button it says wrong but my button text is "de". Why (if) statement does not work despite of the button text is "de"? public void bot1(View v) { Button choice1 = (Button) findViewById(R.id.button1); if(choice1.getText() == "de") Toast.makeText(this, "Correct", Toast.LENGTH_SHORT).show(); else Toast.makeText(this, "Wrong", Toast.LENGTH_SHORT).show(); } | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
$$\int_{-\pi}^{\pi} \frac{2x(1+\sin(x))}{1+\cos^2(x)} \ \mathrm dx$$ My attempt: $$\int_{-\pi}^{\pi} \frac{2x(1+\sin(x))}{1+\cos^2(x)} \ \mathrm dx =\int_{-\pi}^{\pi} \frac{2x}{1+\cos^2(x)} \ \mathrm dx+\int_{-\pi}^{\pi} \frac{2x\sin(x)}{1+\cos^2(x)} \mathrm dx$$ $$=0+\int_{-\pi}^{\pi} \frac{2x\sin(x)}{1+\cos^2(x)} \ \mathrm dx$$ I'm not sure how to proceed further. Integration by parts doesn't seem promising. Neither does any substitution. Any suggestions? | Find the integral $$ \int_0^{\pi} \frac{x \sin x}{1+(\cos x)^2}$$ |
I'm looking for the title of a book where somebody created the ability to make small wormholes. These wormholes were so small, they wouldn't be seen by the naked eye. They were one directional, meaning light could only travel through in one direction, allowing only viewing, like a telescope, through the wormhole. Later in the book it was discovered that these wormholes could also connect to times in the past (not future) revealing any and all secrets. | Read it in the 90's. I remember one specific part where the inventor of the peeking mechanic has his Eureka moment, and has the presence of mind to give a thumbs-up/wave to the future, when they look back on his Eureka moment. I also remember that they had computer screens that were like plastic cloth that they would just unfold on whatever surface was handy. Sorry I don't have much more to go on. Please and thank you! |
My Apple ID has been locked because of security problems. Now I can't access or recover it. When will Apple delete this account? I want to re-create it after it is deleted. | I'm going thru a phone swap, and I now realize that I have multiple ID's "codename" "[email protected]" "[email protected]" I've tested all three, and they all have different login passwords. Not sure how I got here but I'd like to clean the mess up. Is there any way to delete / remove / erase unwanted ID's so they don't exist anymore? (Note: their existence creates total havoc with any type of ID edit...) I see from that I can't merge the apple ID's, but can I simply delete the unwanted ID's? |
I'm writing a function in Python that greets the person selected but a automatic space is added. I coded this: greetingsetted=input("Enter greet (optional): ") namesetted=input("Enter name: ") msgsetted=input("Enter message (optional): ") def greet (greeting,name,msg): if namesetted=="": print("Name cannot be blank. Please run the program again and put a new name.") else: if (msgsetted==""): if greetingsetted=="": print ("Hello,", namesetted, ". Good morning!") else: print (greetingsetted, namesetted, ". Good morning!") else: print (greetingsetted, namesetted, ".", msgsetted) greet(greetingsetted, namesetted, msgsetted) The output of my code is Enter greet (optional): Hello Enter name: name Enter message (optional): Good morning! Hello name . Good morning! And this is the output I want Enter greet (optional): Hello Enter name: name Enter message (optional): Good morning! Hello name. Good morning! | I'd like to do it in Python. What I'd like to do in this example in C: #include <stdio.h> int main() { int i; for (i=0; i<10; i++) printf("."); return 0; } Output: .......... In Python: >>> for i in range(10): print('.') . . . . . . . . . . >>> print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . . In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to "append" strings to stdout. |
I was playing around with a TreeMap and decided to do a simple performance test by comparing System.currentTimeMillis(). The results were quite unexpected: after some more testing I found out that a TreeMap with a Comparator took very long to be created. I have the following code: public static void main(String[] args) { final long millis1 = System.currentTimeMillis(); final TreeMap<Integer,Integer> natural = new TreeMap<>(); final long millis2 = System.currentTimeMillis(); System.out.println(millis2 - millis1); final TreeMap<Integer,Integer> compare = new TreeMap<>(Integer::compare); System.out.println(System.currentTimeMillis() - millis2); } Output: 0 114 Is this normal? Why does this happen? | How do you write (and run) a correct micro-benchmark in Java? I'm looking for some code samples and comments illustrating various things to think about. Example: Should the benchmark measure time/iteration or iterations/time, and why? Related: |
I recently found out about , which appears to be a normal beta Stack Exchange site (I was able to sign up immediately and receive the standard Association Bonus, etc.), but I noticed that it neither appears on the list nor the Communities list that appears when you click the SE hamburger menu logo. At first, I assumed that CS50 was probably a private beta, but there is no corresponding proposal on Area 51 for anything called CS50. The site also seems to have questions dating back to at least 2014, which is a very long time indeed for a site to stay in private beta. What publicly accessible Stack Exchange sites currently exist in the Stack Exchange network, but do not appear in the standard listings? That is, these are sites that anyone can, in theory, sign up for, but which are not normally disclosed to users via the standard methods for informing users about available sites. This could be because they are highly niche, controversial, or have been explicitly removed from the listings for some other reason. | I wanted a list of sub-domains of Stack Exchange that are not mentioned over here Some of the sub-domains I found which were not mentioned are Are there any other which are not mentioned? Mentions by , , Other mentions below which are not mentioned in "All Sites" but are mentioned in the drop down menu on the top left of the Stack Exchange website Any other website that's left out ? |
bit computer in java and i have run into a weird problem. i have a binary number stored as an integer and i needed to convert it to a string but when i do the Integer.toString() returns 9 when i gave it 00000011 but it should have returned 3 right? here's the function i was making static int binToInt(int bin) { String binary = Integer.toString(bin); return Integer.parseInt(binary, 2); } Can someone explain? i have been trying for over an hour to find a solution. either i find a page with something else or a tutorial of how to use Integer.toString() | This prints 83 System.out.println(0123) However this prints 123 System.out.println(123) Why does it work that way? |
I am currently reading $\textit{Scientific Computing: An Introductory Survey}$ by Michael Heath. In Section 5.2.1 when talking about the Bisection Method it is said that the number of iterations $n$ required to achieve a tolerance $tol$ is $$ n = \left\lceil log_{2}\left( \frac{b-a}{tol} \right)\right\rceil $$ where the starting interval is $[ a, b]$. $\textbf{I would like to prove this claim but can't figure out where to start}$. I know I need to prove that $$n - 1< log_{2}\left( \frac{b-a}{tol} \right) \leq n $$ and I also know that the length of the interval after $k$ iterations is $\frac{b-a}{2^{k}}$ but I don't know where to go from there. Could anyone please give me a hint? | For the bisection method, determine the formula $$n \geq \frac{\log(b_0-a_0)-\log(\epsilon)}{\log(2)}-1$$ for the number of steps to guarantee that $|{r-c_n}| < \epsilon.$ This is one of the questions from my numerical analysis class. I understand how to use the bisection method, but I don't understand the analysis of the method or how to start deriving an answer. |
$C$ is a square matrix and $\operatorname{tr}(C)=0$ are there matrices $A$ and $B$ in which $C=AB-BA$? I was thinking about the skew-symmetric matrix definition in which $A^T=-A$ so $a_{ij} = -a_{ji}$ .Anyways, I cannot sketch any sort of proof on a paper. | Suppose $C$ is an $n\times n$ matrix over complex numbers, with trace $0$. Are there always $n\times n$ matrices $A,B$ such that $AB - BA = C$? (Inspired by a recent question which asked for a trace free proof of non-existence of solutions for $C=I$). |
I'm running a fairly bare-bones X11 environment on Ubuntu 14.10. I use the i3 window manager and try not to install anything X-related that isn't strictly necessary. But it seems I've gone a little too far in uninstalling things, as my osd-notifications are now really ugly. The command notify-send "test" yields a blue rectangle with white letter instead of the nice, round-cornered alert box I'm used to. The problem is, I can't seem to find the package I have to install to make this look like it does on a fresh desktop install again. I've tried comparing the list of packages I've got installed with the list from the 14.10 LiveCD, but can't find any obvious candidates. Anyone have any ideas? | Problem I recently upgraded from 13.04 to 13.10, and suddenly notification bubbles don't appear themed as usual in the upper right corner, but they appear as white text on blue background in the upper-left corner. It looks like this: Unsuccesful attempts to fix it I tried reinstalling unity, notify-osd, ubuntu-desktop removed notification-daemon which was installed, none of that fixes it. In fact running ps aux | grep notify-osd shows that notify-osd isn't even running. But when I try to start it manually by running /usr/lib/x86_64-linux-gnu/notify-osd I get: ** (notify-osd:4618): WARNING **: Another instance has already registered org.freedesktop.Notifications ** (notify-osd:4618): WARNING **: Could not register instance If I understand well, the instance is registered by the /usr/share/dbus-1/services/org.freedesktop.Notifications.service file, which right now contains: [D-BUS Service] Name=org.freedesktop.Notifications Exec=/usr/lib/x86_64-linux-gnu/notify-osd Renaming or deleting that file (and rebooting) has no effect whatsoever (and it is not recreated automatically). This is not a duplicate of (and by the way I purged gnome-flashback-session along with notification-daemon) Question(s) How can I debug this? How can I get notifications to come back to normal? If additional debug information is needed, I'll be happy to add it (just that I can't find any more). |
My question is really simple: Is there any performance penalization if I use a (VAR)CHAR (let's say 5) instead of an INT in a MySQL + InnoDB database. If there is, why? Extra question: If I had to use (VAR)CHAR as PK, what should I use: CHAR or VARCHAR? And why? | Is there a measurable performance difference between using INT vs. VARCHAR as a primary key in MySQL? I'd like to use VARCHAR as the primary key for reference lists (think US States, Country Codes) and a coworker won't budge on the INT AUTO_INCREMENT as a primary key for all tables. My argument, as detailed , is that the performance difference between INT and VARCHAR is negligible, since every INT foreign key reference will require a JOIN to make sense of the reference, a VARCHAR key will directly present the information. So, does anyone have experience with this particular use-case and the performance concerns associated with it? |
I am traveling abroad and I was wondering if I can take my 2 power banks with me in my carry on. They are both identical power banks with 10000 mAh | When flying, are you allowed to bring battery packs / power banks? I'd like to bring my ACC 10400mAh Power Bank on several flights. |
I remember reading, in the 80s, an English-language teen-SF novel involving two teen protagonists (1 male, 1 female) on a planet (not Earth) that might have had some history of slavery (or inter-caste strife) and had dragons. Almost every character had a double KK in their name, though that might have been a caste marker. That's literally all I remember, except that the author might have been female. (My head keeps suggesting Marion Zimmer Bradley, but I'm pretty sure it's not her.) If I read it in the 1980s, it was almost certainly written in the 1970s or 1980s. | I'm trying to remember the name of a series of books about a boy who works with dragons. Dragon's blood (or maybe it was slobber?) is acidic, and the children who wrangle these dragons often end up with deep pock marks. On this world, days are like ours but nights get very cold, requiring anyone stuck outside to find a shelter until dawn (not the false dawn) The other thing I remember is that in one of the books by slicing open a dragon and spending the night, the character emerged with special dragon powers. |
I use Grammarly Chrome extension to validate my texts in English. And with some sentences I keep seeing the error message "Infinitive instead of gerund". I'm not sure if this is an appropriate error message, and whether I should I adopt the suggested correction or not. Example: The initial installation requires to have a certain expertise. Correction suggested by Grammarly: Initial installation requires having a certain expertise. For some reason, I don't like how the suggestion sounds. And I think I met with a similar use of an infinitive used after a verb before. | Some verbs are followed by ing, e.g. I enjoy swimming. We can't say I enjoy to swim. Likewise, some verbs are followed by to, e.g. I decided to make a plan. Which particular verbs are followed by ing and to? Can you please provide a list for that? Moreover, which verbs can be followed by both without having the meaning changed? |
question of mine has a bounty of 50 points and received a single answer so far. However the answer is already part of the original quesiton. Additionally the answer also does not solve the question at all and does not include a jsfiddle as outlined in the bounty description. What can be done now? Left a comment on the answer explaining why the answer is not valid. So far no reaction from the person that posted the answer. Dont mind loosing the bounty, however I come here to learn form great answers, hence I thought putting a bounty might give me an answer that solves the problem and teaches me how to solve such a problem applicable to similar scenarios in the future. Should I close the question altogether and go back to study this myself? Is the question too specific? What happens if the question does not receive another answer or an edit after 7 days, meaning will the bounty automatically be given to the single answer despite not being valid? | I don't care if the bounty disappears as what I want is a working answer. Since it's unlikely that the question will/can be answered, how can I indicate that the only answer that is on the question is wrong. I've put a comment on it, but that sort of disappears in "add / show more comments" collapsed area. The primary problem is that's it's been upvoted despite being wrong. What I'm concerned about is that the answer will have automatically have a marker on it as having gained the bounty (by default) and that may mislead future readers into thinking that it's a correct answer. The irony is that the answer is a good one, but not to my question. Update: the question got a couple of answers that though don't work in my use case, could work for others (i.e. they are not 100% answers) so the question of awarding is now resolved. |
So let's say we have this code: a=$(echo -e "a\n\n\n") echo "_${a}_" the output is: _a_ which is kind of a surprise to me. Any ideas why this is happening? | As per the following example, and as in In bash, where has the trailing newline char gone?, I want to know "why" it happens x="$(echo -ne "a\nb\n")" ; echo -n "$x" | xxd -p # Output is: 610a62 # The trailing newline from the 'echo' command # has been "deleted" by Command Substitution I assume there must be some very significant reason for a shell action, namely Command Substitution, to actually delete some data from the command output it is substituting... but I can't get my head around this one, as it seems to be the antithesis of what it is supposed to do.. ie. to pass the output of a command back into the script process... Holding back one character seems weird to me, but I suppose there is a sensible reason for it... I'm keen to find out what that reason is... |
After trying to upgrade from 17.04 to 18.0 this message appears: E: The repository 'http://ppa.launchpad.net/jonathonf/vlc/ubuntu zesty Release' does not have a Release file. W: Updating from such a repository can't be done securely, and is therefore disabled by default. W: See apt-secure(8) manpage for repository creation and user configuration details. W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/videolan-ubuntu-master-daily-zesty.list:2 and /etc/apt/sources.list.d/videolan-ubuntu-master-daily-zesty.list:3 E: The repository 'http://ppa.launchpad.net/videolan/stable-daily/ubuntu zesty Release' does not have a Release file. W: Updating from such a repository can't be done securely, and is therefore disabled by default. W: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu zesty Release' does not have a Release file. W: Updating from such a repository can't be done securely, and is therefore disabled by default. W: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu zesty-updates Release' does not have a Release file. W: Updating from such a repository can't be done securely, and is therefore disabled by default. W: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu zesty-backports Release' does not have a Release file. W: Updating from such a repository can't be done securely, and is therefore disabled by default. W: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu zesty-security Release' does not have a Release file. W: Updating from such a repository can't be done securely, and is therefore disabled by default. W: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu zesty-proposed Release' does not have a Release file. I have a netbook eMachines E350, Intel Atom processor, and 2GB RAM memory. Is it necessary to download the 18.04 ISO image? | Recently I have installed an older version of Ubuntu on my old machine. Whenever I try to install any software, I get an error saying it couldn't be found: $ sudo apt-get install vlc Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package vlc |
Let $f: R → R $ be a function such that $f'(x)$ is continuous and $|f'(x)| ≤ |f(x)|$ for all $x ∈ R$ , if $f(0)=0$ the maximum value of $f(5)$ is My Attempt: I proved that $f'(x)=0$ for $x ∈ [0,1]$ through LMVT but i am not able to prove anything further I also thought of a real life analogy of this that if magnitude of acceleration is always less than magnitude of velocity and initially the particle was at rest then it won't move for every $t>0$ and hence concluding $f(x)=0$ for every $x ∈ R$ Help Please. | Let $f:\mathbb{R}\to\mathbb{R}$ be a function such that $f(0)=0$ for all real numbers $x$, $\left|f^\prime(x)\right|\leq\left|f(x)\right|$. Can $f$ be a function other than the constant zero function? I coudn't find any other function satisfying the property. The bound on $f^\prime(x)$ may mean that $f(x)$ may not change too much but does it mean that $f$ is constant? I thought for a while and found that $f^\prime(0)=0$ and by using mean value theorem, if $x\neq0$ then there's a real number $y$ between $0$ and $x$ such that $\left|f(x)\right|=\left|xf^\prime(y)\right|\leq\left|xf(y)\right|$. Anything further? |
The possessive form of who is whose. What is the equivalent possessive form of which? which has the same purpose as who as a placeholder in a secondary sentence, with the difference that who is for people and living beings while which is for inanimate objects (please correct me if wrong). Example: An image is read and sent to the function, which's output is displayed. Here I have used an obscure word invention: which's in place of the word I am looking for. What is the correct word to plug in, if any? Compare with a similar who-sentence: An gift is wrapped and sent to the Peter, whose reaction is recorded. The equivalent word in my mother tongue Danish is hvis: Et billede læses og sendes til funktionen, hvis output vises på skærmen. | I would appreciate your help phrasing the following: I am looking for elements which/whose/... size/sizes is/are relatively large. |
My Europe-based company has offered to allow me to work during my holidays in New Zealand which would really help out. I go there the 1st June. Do I need a special visa or is a tourist one OK? | I found several questions about inbound travelers to the US in this scenario, but little about other countries: I work for a company in my home country (USA) who are open to me working remotely while traveling. Which countries allow me to legally work remotely for a company in my home country (USA) while traveling in their country? The work has absolutely no connection to the destination country, it would take place identically entirely within the USA if I weren't traveling. |
I have multiple a elements. I'm trying to handle the click event to display on alert the id of the clicked link but nothing is happening. Please help! $(".sites").click(function() { alert('handlin'); alert($(this).attr("id")); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <a href="#" class="sites" id="1">test1</a> <a href="#" class="sites" id="2">test2</a> Links are generated here: $.getJSON(categoriesURL, { term: request }, function(data) { var iHtml = ''; $.each(data, function(i, item) { if (10 <= i) return false; iHtml += '<li><a href="#" class="sites" id="'+item.id+'">' + (item.title || '') + '</a></li>'; }); $('#categories').append(iHtml); }); | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
So I'm currently making a tic tack toe game where you play against the computer, and I can't seem to figure this part out. I want the computer to select a random variable from a list of positions that haven't been used yet, and make that variable's value O. Here is what I have currently. #positions is a list of variables that start off = '' positions = [ul, uc, ur, cl, cc, cr, ll, lc, lr] comchoice = randrange(0, len(positions)) while positions[comchoice] != '': comchoice = randrange(0, len(positions)) else: positions[comchoice] = 'O' EDIT: This question is different than the one that it is said to be a duplicate of. It is different because it is asking about changing the value of a variable in a list. It's clear in my post that I understood the duplicate post's question with my code. | Assume I have the following list: foo = ['a', 'b', 'c', 'd', 'e'] What is the simplest way to retrieve an item at random from this list? |
Everytime I make a new project, I end up in having troubles because I forgot to create the database collation by UTF-8 or there are some characters that slipped trough that I didn't see like é/à/.. but also the double .. or tripple ... seem to be very nasty. I usually use mysqli_real_escape_string to make sure he writes the characters away, and when i print them i use htlmentities. But that doesn't work for all characters, and defenitly not for double .. or tripple ... . Is there a general rule / guideline that I should keep in mind when setting up a project, so I don't have troubles with these special characters? | I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur? This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2. |
The usual return ticket path is: AMS -> LHR -> ICN and back: ICN -> LHR -> AMS However now I'd like to do this: AMS -> LHR -> ICN ICN -> LHR, done That way I'll end up in the UK and can take a RyanAir flight to my actual destination in Europe. I don't believe it's possible to book these "sorta-return" tickets, but booking return would still be cheaper. I don't know why airlines can't book flexibly, but whatever. What'll happen if I not take my last transfer? What will BA do? What will the border guards do? | Say I want to book a flight from Fort Lauderdale to Chicago. Say the airline also flies to St. Louis from Fort Launderdale but has a connecting flight through Chicago. If I book that flights from FLL->ORD->STL and just get off in Chicago, what possible problems can I run into, assuming I didn't check any bags and only have carry on? This scenario exist for Southwest, but I wanted this be more of a general question that would apply to all airlines. |
Prove that $A-(B\cap C)=(A-B)\cup (A-C)$. I have tried to prove it but I can't get precious proof. I am grateful if anyone give correct proof. | I am asked to prove that, if $A, B$ and $C$ are sets, then $$A-(B\cap C)=(A-B)\cap(A-C).$$ However, I think that either I have made an error in my working, or the wording of the problem contains a typographical error. My working so far is as follows: $$\begin{align}x\in(A-(B\cap C)) &\iff (x\in A)\wedge(x\not\in(B\cap C))\\ &\iff(x\in A)\wedge((x\not\in B)\vee(x\not\in C))\\ &\iff((x\in A)\wedge(x\not\in B))\vee((x\in A)\wedge(x\not\in C))\\ &\iff(x\in(A-B))\vee(x\in(A-C))\\ &\iff x\in((A-B)\cup(A-C)) \end{align}$$ First line to second line: by De Morgan's Law. Second line to third line: by distributivity of set intersection over set union. Third line to fourth line: by definitions of intersection and set difference. If my working is correct, then I have shown that $$A-(B\cap C)=(A-B)\cup(A-C).$$ Am I correct? |
My latex code is give below : \documentclass{beamer} \begin{document} \title{Simple Beamer Class} \author{Sascha Frank} \date{\today} \begin{definition} Two graphs $G=(V,E_1)$ and $H= (V,E_2)$ are said to be isomorphic if there exist a bijective map $\phi : V \mapsto V$ that preserve edges and non-edges \end{definition} } I have seen this answer but its code is not working in a beamer class. I want boxes like . | I've been trying to figure out what beamer template this presentation is in, but none of my tries (and searches) have come to a success. What I'm really interested in this template is actually the block types that they have used. These blocks have rounded edges, and their titles don't start at the beginning of the left border, but a bit forward. Can you guys help me figure out what theme that is, or maybe how to replicate it? |
my case: I try to get a value from my MySQL database. This data is defined as a VARCHAR. This is done in java with a prepared statement and resultset. String add1 =rs.getString("include"); according to website table 5.1 states "Can always be converted to these Java types". therefore a VARCHAR should be able to be converted in a java.lang.string. When i check the data type in java it indeed gives java.lang.string. So for so good. My issue is when i try to compare this obtained "String" value to a in java defined String value they don't seem to be equal. Let's give a simple example. I get the (VARCHAR) value "1" from the database and store in in String add1 I want to check if this value is indeed "1" and therefore I use the following statement if(add1=="1") { /* do something */ } Only the values are , according to java, not the same. So I was curious about why this is. I started searching why those two "Strings" are not equal. First of I checked the length of both strings. Both came out to be 1 in length as expected. Afterwards I checked the value of both. To see if both values where indeed the same i wanted to check their hexadecimal representance. Both came out with the value 0x31. Still as expected. But then why isn't my if statement accepted by java if both seem to represent the same string-hex-bin-you name it value. In short: Why is my VARCHAR "String" obtained from a MySQL databse in java not the same as a String defined in java. | I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference? |
sorry, but i'm a little bit convused... The properties of the simpleXMLElement, created by the simplexml_load_string method, returns always an one-dimensional array with exactly one . It's no matter if i use one, more or no index - it's all the same result... the only exception is echo: $xml = simplexml_load_string("<main><name>Alfred</name></main>"); echo $xml->name; //-> Alfred print_r($xml2->name); // -> SimpleXMLElement Object ( [0] => Alfred ) print_r($xml2->name[0]); // -> SimpleXMLElement Object ( [0] => Alfred ) print_r($xml2->name[0][0]); // -> SimpleXMLElement Object ( [0] => Alfred ) $arr['name'] = $xml2->name; echo(json_encode($arr)); //-> {"name":{"0":"Alfred"}} And if i use the attribute notation, i get null: $arr['name'] = $xml2['name']; echo(json_encode($arr)); //-> {"name":null} But if i use any string method, i get a clear string: $arr['name'] = $xml2->name.""; echo(json_encode($arr)); //-> {"name":"Alfred"} $arr['name'] = strtolower($xml2->name); echo(json_encode($arr)); //-> {"name":"alfred"} So, can me anybody explain this behavior? Should i just use strval() or what's the correct or most beautyfull way to get the property as string? | Let's say I have some XML like this <channel> <item> <title>This is title 1</title> </item> </channel> The code below does what I want in that it outputs the title as a string $xml = simplexml_load_string($xmlstring); echo $xml->channel->item->title; Here's my problem. The code below doesn't treat the title as a string in that context so I end up with a SimpleXML object in the array instead of a string. $foo = array( $xml->channel->item->title ); I've been working around it like this $foo = array( sprintf("%s",$xml->channel->item->title) ); but that seems ugly. What's the best way to force a SimpleXML object to a string, regardless of context? |
i have not created the array name then why this C program is working.` #include<stdio.h> int main() { printf("%c",7["sundaram"]); return 0; } | As Joel points out in , in (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a] Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a]? |
Is there a LaTeX parameter (e.g., a penalty parameter) or any complex solution that can be setup maximum length of the last line in the all paragraphs throughout the text? Let's say, 2 em horizontal white space at the end of a paragraph? Manual addition of horizontal space at the end of the paragraph is not appropriate. Thank you. | Old school typesetters never allowed the last line of a paragraph to be just nearly filled. Either it would be clearly shorter than the other lines or it would be stretched to align with the right margin. (I assume the standard value where they decided to stretch the line was the depth of the indentation.) If you have the time the same result can be achieved by checking all pages and manually adding \parfillskip=0pt to all offending paragraphs. For example, this document: \documentclass{article} \usepackage[paperwidth=3in,paperheight=3in]{geometry} \begin{document} \thispagestyle{empty} asdfjk adsf af dsasdf f dasf fdsa fds afsd fdsaf asdfsdafdsa asdf dsaf asdf sadf asdfjk adsf af dsasdf f dasf fdsa fds afsd fdsaf asdfsdafdsa asdf dsaf asdf sadf sasdfjk adsf af dsasdf f dasf fdsa fds afsd fdsaf asdfsdafdsa asdf dsaf asdf sadf asdfjk adsf af dsasdf f dasf fdsa fds afsd fdsaf asdfsdafdsa asdf dsaf asdf sadf asdfjk adsf af dsasdf f dasf fdsa fds afsd fdsaf asdfsdafdsa asdf dsaf asdfxx \end{document} renders to a paragraph with an almost-full last line: I've earlier been told that it would most probably be impossible to get pdfLaTeX to do this automatically. If this is true -- could it be done with LuaTeX? |
Show that if $a, b$, and $c$ are integers with $(a,b)=(a,c)=1$, then $(a,bc)=1$ I don't know exactly that I should use the division algorithm or $(a,b)=d$, $(a/d,b/d)=1$. This is my first time to study number theory... it's very hard...T^T I can't understand basic thms in this study... | How do I go about proving this? If $\gcd(a,b)=1$ and $\gcd(a,c)=1$, then $\gcd(a,bc)=1$. I'm very confused with gcd proofs. |
I am trying to run this SQL script on a SQL Server instance to restore a test database to a newer copy of the live database. RESTORE FILELISTONLY FROM disk = '\\staging_server\path\to\db_backup.bak' -- Restore the files for RESTORE DATABASE Test_DB FROM disk = '\\staging_server\path\to\db_backup.bak' WITH replace, MOVE 'Test_DB' TO 'D:\R2_BIN\Test_DB.mdf', MOVE 'Test_DB_log' TO 'D:\R2_BIN\Test_DB_log.ldf', stats = 5 GO However, on running the script I receive the following error. Msg 3101, Level 16, State 1, Line 5 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1, Line 5 RESTORE DATABASE is terminating abnormally. Is there some way I can force this operation to go through, and kill any connections it needs to to get it done? I tried to close down any applications that may connections to the DB, but some of the connections I simply cannot identify. There are several from my username and yet I only have one instance of SQL Server Management Studio open. Anyway, is there some way to kill all connections to a specific database? There are quite a few databases running on this instance, so I don't want to just shutdown and restart the instance all together if I can help it. | --first command use master Go -- second command ALTER DATABASE MyDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE Go -- Third command RESTORE DATABASE [MyDB] FROM DISK = N'D:\Restore_Backup\Restore_05042015\AcctDB.bak' WITH FILE = 1, MOVE N' AcctDB ' TO N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\WFStageAcct.mdf', MOVE N' AcctDB _log' TO N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\WFStageAcct_log.ldf', NOUNLOAD, REPLACE, STATS = 10 GO --forth command ALTER DATABASE MyDB SET MULTI_USER Go I run the above commands, one by one to restore database in different server. But sometime I cannot restore the database after changed to single user mode, because it is accessed by other connection. If I run the whole script except the last part together would that block other connection so I will be the only user? |
Nothing happens after I connect to the 5GHz Wifi network. Please show me how I can connect. This question is a follow up to a previous question which was posted on SO as well. Looks like there is no support for my wifi card on 16.04 . Should I just ditch 16.04 and take 14.04 instead ? Thanks. | I am running Ubuntu Gnome 16.04, and this morning the Network Manager suddenly stopped showing any WiFi networks at all. One moment I was connected to a local wireless network, and the next I was not. Even worse, although the system recognises the wifi adapter, no wifi networks appear to show up. "enp0s29u1u4c4i2" is an iPhone I am using as an access point to post this question, but usually there are only three devices (eno1, lo, wlp2s0). I am attaching the outputs of ifconfig, iwconfig and iwlist scan, all ran as sudo. ifconfig eno1 Link encap:Ethernet HWaddr 24:b6:fd:fc:9b:06 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:20 Memory:e1c00000-e1c20000 enp0s29u1u4c4i2 Link encap:Ethernet HWaddr da:cf:9c:c6:b7:a0 inet addr:172.20.10.2 Bcast:172.20.10.15 Mask:255.255.255.240 inet6 addr: fe80::6eaa:eff8:b247:91b4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6422 errors:0 dropped:0 overruns:0 frame:0 TX packets:5985 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4361666 (4.3 MB) TX bytes:964896 (964.8 KB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:2653 errors:0 dropped:0 overruns:0 frame:0 TX packets:2653 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:209742 (209.7 KB) TX bytes:209742 (209.7 KB) wlp2s0 Link encap:Ethernet HWaddr e0:06:e6:02:40:ae UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:7 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:17 iwconfig lo no wireless extensions. enp0s29u1u4c4i2 no wireless extensions. eno1 no wireless extensions. wlp2s0 IEEE 802.11abg ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=200 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:off iwlist scan lo Interface doesn't support scanning. enp0s29u1u4c4i2 Interface doesn't support scanning. eno1 Interface doesn't support scanning. wlp2s0 No scan results According to lspci, my network controller is a "Broadcom Corporation BCM43228 802.11a/b/g/n". I had some issues getting the OS to recognise it right after installing 16.04, but I solved them long ago by switching the default drivers. What can I do to start seeing wifi networks again? Thanks! Gonzalo EDIT As per Pilot6's suggestion, I am adding the output of lspci -knn | grep Net -A2 00:19.0 Ethernet controller [0200]: Intel Corporation 82579LM Gigabit Network Connection [8086:1502] (rev 04) DeviceName: Onboard LAN Subsystem: Dell 82579LM Gigabit Network Connection [1028:04a9] Kernel driver in use: e1000e Kernel modules: e1000e -- 02:00.0 Network controller [0280]: Broadcom Corporation BCM43228 802.11a/b/g/n [14e4:4359] Subsystem: Dell Wireless 1530 Half-size Mini PCIe Card [1028:0011] Kernel driver in use: wl Also, here's the result of running the mentioned by @eldergeek: |
I have two computers set up next to each other - one Mac and one PC. Is there a mouse out there (Bluetooth, perhaps?) that I can use on both - one computer at a time - without linking the desktops? I'm thinking maybe a mouse that has a side toggle that switches which machine it's hooked up to at any given time. Doable? | How can I control two computers (with seperate monitors) with the same keyboard and mouse? Is there a software solution to this? Can the computers be running different OSs? |
What is the name and what are the properties of the smallest integer divisible by all integers $1\ldots n$? Clearly, $n!$ would do the trick, but it is generally not the smallest such number. So far, I only came up with a recursive definition, i.e. $f(n)=\frac{n\,f(n-1)}{\mathrm{gcd}(n,f(n-1)}$ starting with $f(1)=1$. This nicely gives e.g. the first 12 such numbers: 1, 2, 6, 12, 60, 60, 420, 840, 2520, 2520, 27720, 27720. Someone must have come across this before... Thanks. | What's the smallest positive integer which is divisible by all integers $1, 2, \dots, n$? Is there a simple way to represent the answer? Call it $f(n)$ here. Clearly factorial ($n!$) satisfies the condition of divisibility. But once you get to $f(4)$ (which is $12$), factorial ($24$) is too large, because it includes as factors both $4$ and $2$, which are redundant. Multiplying all the prime numbers up to $n$ gives you another estimate, which is this time too low, because you need to include primes multiple times when they're repeated in the factorization of the inputs. So the answer is somewhere between factorial, and the product of primes. Is there a simple answer? |
I have a FAT32 partition in windows server 2008 machine. How can I convert the partition to NTFS without formatting? My intention is to resize the partition and add some P.S. exits with errors on server 2008. | How to easily convert fat32 local disk to ntfs? Can I do it without formatting the local disk? |
I am trying to force publish 'future' or 'scheduled' posts, and I am having trouble The reason I am asking is because I am creating a site that allows users to do the editing on the front of the site, so I need a button that will allow users to force publish scheduled posts. Right now I am just trying to find a process or idea that works consistently, and all I have come up with is this: 1) Adjust the scheduled time to the past 2) Changing post status from future to draft 3) Change draft back to scheduled 4) Server realizes the scheduled post time has past and marks it published Needless to say this isn't ideal. For other status changes I was able to use the status button seen here: . I am at a loss on this one because I can't even get the process working on the backend I have looked around a great deal and see that others have had similar problems (e.g. ) but cannot find a solution. Asking the community for any ideas? | Use case: I have a post type that relates to a music show. The 'show time' is grabbed through the post publish date which is set to some time in the future. I've found a function that takes future dated blog posts and leaves the date but marks the post as published on save but haven't been able to figure how to customize it for a custom post type. The function is below. <?php function setup_future_hook() { // Replace native future_post function with replacement remove_action('future_post','show', '_future_post_hook'); add_action('future_post', 'show', 'publish_future_post_now'); } function publish_future_post_now($id) { // Set new post's post_status to "publish" rather than "future." wp_publish_post($id); } add_action('init', 'setup_future_hook'); ?> |
Show that a finite-dimensional vector space $V$ is complete. I'm not sure on how to start with this problem. I kind of think that one should use the fact that any two norms on the finite vector space are equivalent, but I don't know how to proceed forward. What would be a way to solve the problem? Thanks for the help. | Can you read my proof and tell me if it's correct? Thanks. Let $V$ be a vector space over a complete topological field say $\mathbb R$ (or $\mathbb C$) with $\dim(V) = n$, base $e_i$ and norm $\|\cdot\|$. Let $v_k$ be a Cauchy sequence w.r.t. $\|\cdot\|$. Since any two norms on a finite dimensional space are equivalent, $\|\cdot\|$ is equivalent to the $l^1$-norm $\|\cdot\|_1$ which means that for some constant $C$, $\varepsilon > 0$, $k,j$ large enough, $$ \varepsilon > \|v_j - v_k\| \geq C \|v_j - v_k\|_1 e_i= C \sum_{i=1}^n |v_{ji} - v_{ki}| \geq |v_{ji} - v_{ki}|$$ for each $1 \leq i \leq n$. Hence $v_{ki}$ is a Cauchy sequence in $\mathbb R$ (or $\mathbb C$) for each $i$. $\mathbb R$ (or $\mathbb C$) is complete hence $v_i = \lim_{k \to \infty} v_{ki} $ is in $\mathbb R$ (or $\Bbb C$) for each $i$. Let $v = (v_1, \dots , v_n) = \sum_i v_i e_i$. Then $v$ is in $V$ and $\|v_k - v\| \to 0$: Let $\varepsilon > 0$. Then $$ \|v_k - v\| \leq C \|v_k - v\|_1 = C \sum_{i=1}^n |v_{ki} - v_i| \leq C^{'}n \varepsilon$$ for $k$ large enough. |
I'm designing an API for a web service and I can't decide between using XML attributes, elements or a mixed architecture. Let me show you an example. Let's assume I have an object called Domain. This model has 3 properties (tld, sld, trd and the name itself) and a method valid? that returns true if the domain is valid. # I'm using ruby but # consider this as pseudo-code class Domain attr_accessor :tld, :sld, :trd, :name def valid? true # force true end end My api called /domain/parser takes a domain in input and returns the parsed response. The first possibility is to use an element for every domain attribute. <result> <domain> <name>www.google.it</name> <tld>it</tld> ... <valid>true</true> </domain> </result> But some interfaces use attributes. <result> <domain tld="it" sld="google.com" trd="www" rule="*.foo" name="www.google.it" valid="true" /> </result> And don't forget attributes and value. <result> <domain tld="it" sld="google.com" trd="www" rule="*.foo" name="www.google.it" valid="true"> www.google.it </domain> </result> In your opinion, which is the more powerful, flexible and expressive choice? Also, consider the response will be served in XML and JSON (soon). | At work we are being asked to create XML files to pass data to another offline application that will then create a second XML file to pass back in order to update some of our data. During the process we have been discussing with the team of the other application about the structure of the XML file. The sample I came up with is essentially something like: <INVENTORY> <ITEM serialNumber="something" location="something" barcode="something"> <TYPE modelNumber="something" vendor="something"/> </ITEM> </INVENTORY> The other team said that this was not industry standard and that attributes should only be used for meta data. They suggested: <INVENTORY> <ITEM> <SERIALNUMBER>something</SERIALNUMBER> <LOCATION>something</LOCATION> <BARCODE>something</BARCODE> <TYPE> <MODELNUMBER>something</MODELNUMBER> <VENDOR>something</VENDOR> </TYPE> </ITEM> </INVENTORY> The reason I suggested the first is that the size of the file created is much smaller. There will be roughly 80000 items that will be in the file during transfer. Their suggestion in reality turns out to be three times larger than the one I suggested. I searched for the mysterious "Industry Standard" that was mentioned, but the closest I could find was that XML attributes should only be used for meta data, but said the debate was about what was actually meta data. After the long winded explanation (sorry) how do you determine what is meta data, and when designing the structure of an XML document how should you decide when to use an attribute or an element? |
When we draw a ROC curve, how can we determine the optimal threshold? I think, the point that is closest to (0,1) vector is the best threshold. However, if we cannot calculate the distance, how can we determine the best threshold? Is there any other way to know that? Also, I think eyeballing is a pretty good way. How do you guys think about the eyeballing method? | I want to find the cut-off point for gender based on an anthropological measurement. I can draw the curves and I know that in case sensitivity and specificity are both similarly important, the point closest to the upper left corner of the frame (or if the curve is negative, the closest point to the lower right corner) should be determined as cut-off. However, I don't know whether there is any already implemented function in R or any other programs for determining this, simply? I just know SPSS doesn't have such a function. Do you know any programs, or R which can do it via an already implemented function? |
Prove that the following is true for every $n∈ℕ$: $$7\mid(3^{2n+1}+2^{n+2}).$$ I've noticed $$3^{2n+1}+2^{n+2} =3^{2n} \cdot 3+2^{n} \cdot 4.$$ Any suggestions how to continue from there to get something like $7k$ for $k\in\mathbb{N}$. Thank you in advance! | Expanding the equation out gives $(3^{2n}\times3)+(2^n\times2^2) \equiv 0\pmod{7}$ Is this correct? I'm a little hazy on my index laws. Not sure if this is what I need to do? Am I on the right track? |
I want to match everything starting from the line /Subtype /Widget until the line << With this code nothing is matched preg_match('#/Subtype /Widget([.\s]*)<<#', $pdf, $matches); subject 522 0 obj << /Subtype /Widget /V (some text) /T (Kreditor) /Rect [54.6 359.16 296.4 531.84] /P 414 0 R /DA (/Helv 8 Tf 0 g) /Ff 8392704 /Type /Annot /F 4 /TU (Kreditor:) /AP << /N 534 0 R | For example, this regex (.*)<FooBar> will match: abcde<FooBar> But how do I get it to match across multiple lines? abcde fghij<FooBar> |
I'm writing a matrix library in c++. After some debugging I found that a simple double difference is not zero for two "equals" numbers. This is due how double are represented in a computer of course. So my question is, what I could use to improve the numeric stability? I tried to use long double but I have the same problem. The same algorithm in MATLAB works so MATLAB must use some trick about internal number representation. | Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen? |
Let $\{X_i\}_{i=1}^n$ be a family of i.i.d. random variables taking values in $[0,1]$, having a mean $\mu$ and variance $\sigma^2$. A simple confidence interval for the mean, using $\sigma$ whenever it is known, is given by $$ P( | \bar X - \mu| > \varepsilon) \le \frac{\sigma^2}{n\varepsilon^2} \le\frac{1}{n \varepsilon^2} \qquad (1). $$ Also, because $\frac{\bar X- \mu}{\sigma/\sqrt{n}}$ is asymptotically distributed as a standard normal random variable, the normal distribution is sometimes used to "construct" an approximate confidence interval. In multiple-choice answer statistics exams, I've had to use this approximation instead of $(1)$ whenever $n \geq 30$. I've always felt very uncomfortable with this (more than you can imagine), as the approximation error is not quantified. Why use the normal approximation rather than $(1)$? I don't want, ever again, to blindly apply the rule $n \geq 30$. Are there good references that can support me in a refusal to do so and provide appropriate alternatives? ($(1)$ is an example of what I consider an appropriate alternative.) Here, while $\sigma$ and $E[ |X|^3]$ are unknown, they are easily bounded. Please note that my question is a reference request particularly about confidence intervals and therefore is distinct from the differs from the questions that were suggested as partial duplicates and . It is not answered there. | I have read/heard many times that the sample size of at least 30 units is considered as "large sample" (normality assumptions of means usually approximately holds due to the CLT, ...). Therefore, in my experiments, I usually generate samples of 30 units. Can you please give me some reference which should be cited when using sample size 30? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.