body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
[![enter image description here][1]][1][![enter image description here][2]][2]Ok, so im currently in a crap house. Can anyone explain why all of a sudden my scene no longer renders properly. It was doing just fine up until last night.. When i rendered a scene it sometimes gives me a black image and other times no image at all. Even when i go back to scenes that rendered successfully before. I get nothing now. Any ideas??
This is meant to solve this problem once and for all. What is every reason an object isn't showing up in a render or viewport in when using the cycles render engine?
How do you call a derived function from an array of the base class? Ex: #include <iostream> #include <string> class a{ public: virtual void prnt(){ std::cout<<"a"<<std::endl; } }; class b: public a{ public: virtual void prnt(){ std::cout<<"B"<<std::endl; } }; int main() { a array[3]; array[0] = a(); array[1] = b(); array[2] = a(); array[1].prnt(); } The output for this example is a. is there anyway to fix this?
Someone mentioned it in the IRC as the slicing problem.
I have a list of records but let's take this for example John Kenneth Lorenz Minnie Niño When i process a Select query to give me all names, it does but the last record shows Ni�o instead of Niño. How should i do it?
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.
I want to set label height according to text. currently it is showing only one line text. I have set constraint leading training and top but its not working.
Consider I have the following text in a UILabel (a long line of dynamic text): Since the alien army vastly outnumbers the team, players must use the post-apocalyptic world to their advantage, such as seeking cover behind dumpsters, pillars, cars, rubble, and other objects. I want to resize the UILabel's height so that the text can fit in. I'm using following properties of UILabel to make the text within to wrap. myUILabel.lineBreakMode = UILineBreakModeWordWrap; myUILabel.numberOfLines = 0; Please let me know if I'm not heading in the right direction. Thanks.
#include<stdio.h> #include<math.h> int main() { int n, num, sum=0, count=0, a, remain=0; printf("Enter a number : "); scanf("%d", &num); a=num; n=num; while(a!=0) { a=a/10; count++; } while(n!=0) { remain=n%10; sum=sum+pow(remain, count); printf("%d\n", sum); n=n/10; } if(sum==num) printf("Armstrong Number"); else printf("Not an Armstrong Number"); return 0; } guys I am trying to make a program of checking if a number is Armstrong number or not. And I am facing this problem with '153' as an input specifically. The program works fine with various inputs but compiler is showing unusual behavior while adding 153. I will also attach the output with different inputs explicitly showing the addition of numbers in the 'sum' variable. OUTPUT: Enter a number : 153 27 151 152 Not an Armstrong Number Enter a number : 371 1 344 371 Armstrong Number
Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen?
Ignore the position i.e whether you are on one or other side of orbit. Does space quantization play any role.
Given the wavefunction, $\psi$ is explained as the flow of probabilities or in other words probability density over a certain region of space. In the case of electrons, say in $s$ orbital, the probability of its existence is distributed over the whole spherical region. Now, when we talk about orbits is it true that the electrons are literally orbiting around the nucleus or are they just chaotically whizzing "around" with no sense of direction unlike we'd classically understand an electron to "orbit" around a positive nucleus.
I'm trying to make this look nicer and more readable (brackets tall enough, fraction large enough to easily read, etc). $((\frac{(x(1-\delta_{1}))}{(z(1-\delta_{3}))}(1-\delta_{4}))(y(1-\delta_{2})))(1-\delta_{5})$
If I have a document like this: \documentclass[landscape, 12pt]{report} \usepackage[landscape]{geometry} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath, amssymb, graphics, setspace} \newcommand{\mathsym}[1]{{}} \newcommand{\unicode}[1]{{}} \newcounter{mathematicapage} \begin{document} \begin{equation}\label{Equation:Naive_Bayes_Classifier} P\left(H_h|E_1,E_2,\ldots ,E_e,\ldots E_{\mathbb{E}}\right)=\frac{P\left(H_h\right) P\left(E_1|H_h\right) P\left(E_2|H_h,E_1\right) \text{$\ldots $P} \left(E_e|H_h,E_1,E_2,\ldots ,E_{e-1},E_{e+1} \ldots, E_{\mathbb{E}}\right) \text{$\ldots $P} \left(E_{\mathbb{E}}|H_h,E_1,E_2,\ldots ,E_{\mathbb{E}-1}\right)}{ P\left(E_1,E_2,\ldots,E_e, \ldots ,E_{\mathbb{E}}\right)} \end{equation} \end{document} How can I auto adjust this equation to appear in the entire page, using all horizontal space? (Without badboxes or smaller than the width of the page?) If is there a kind of scale to use in equations, giving explicity how greater the equation should become, this solver my problem too.
Can someone please explain the difference between: onclick="javascript:fnName(this);" ...and... onclick="fnName(this);" Is there any performance hit? or when to use what?
AFAIK, you never need to specify the protocol in an onclick: onclick="javascript:myFunction()" Bad onclick="myFunction()" Good Today I noticed in on Google Anallytics that they are using it: <a href="http://www.example.com" onClick="javascript: pageTracker._trackPageview('/outgoing/example.com');"> Is this example just plain wrong, or is there ever a reason to specify javascript: in anything other than a href?
My friend is an Indian citizen and will be travelling to London for a business trip. The visa is valid till the date of his return flight. His return flight has a stop over in Paris for more than 12 hours. His flight from London stops at ORY (Orly) and leaves to India from CDG (Charles de Gaulle). Does my friend need a visa for France?
Do I need visa for Paris, if my connecting flight stops at Paris for 24hrs and I want to visit Paris during that 24hrs? I have US B1 visa. I'll be travelling from San Francisco to Bangalore (India) via Paris. I hold Indian passport. If yes, what is the procedure for that visa?
How do I set up the integral to find the surface area if I only have the two shapes a sphere and a cylinder ?
The area of ​​the portion of the sphere $ x^{2} + y^{2} +z^{2} = 1$ located inside of the cylinder $x = x^{2} + y^{2}$, and above the plane $z = 0$. I'm stuck, so any tip will be helpful Thanks in advance!
I'm taking a single-variable calculus course and asked to calculate $$\sum_{k=0}^\infty (-1)^k \frac{\pi^{2k}}{(2k)!}$$ So the $k=0$ term looks like $$(-1)^0 \frac{\pi^{2(0)}}{(2(0)!)}=\frac{1}{0!}$$ but $\frac{1}{0!}$ is not a number, so it appears I've made a mistake in my calculation.
How can I prove from first principles that $0!$ is equal to $1$?
If I right-click an application and click Get Info, a window like in the following image pops up: Then, after unlocking the Sharing & Permissions section, let's say I wish to change the permissions for everyone to No Access. This is fairly simple to do through the GUI, but I was wondering if it was possible to do this through Terminal. I know I could simply use chmod and change the permissions recursively for the application directory like that, but I would prefer a solution that simply changes the permissions in the same way the GUI does such that it is updated accordingly in the Info window for the app. Edit: I do not believe this is a duplicate of because the answer to it only shows how to add access control entries, not how to modify them.
The macOS gui, as shown in the attached image, provides a way to add users and user groups to the permissions of a file system directory. There are also lots of examples of how to create groups from the command line, etc (dscl, and so forth). But I don't see anything on how - from the command line - to add user groups to the permissions of a file system directory. PS: The answers in covers network shares, but don't show how to do what the Finder does (on an unshared folder).
The book is a collection of stories of the protagonist travelling on his scavenged ship between planets and offering bioengineering services. Remember one story with an overpopulated planet he was hired to bioengineer food nutritious enough to solve the food shortage problem. The protagonist is tall (above 7'), bald, aphephobic, misanthropic and has a clowder of cats.
I recall reading a book where the nondescript quirky captain of an independent starship was hired to take a group to a possible lost starship. The ship was a giant ecological repository and contained tech which had since been lost. Everyone tried to board, running afoul of various creatures and defenses. The independent captain (thought least likely to survive) wound up somehow managing to become recognized by the ecological ship as its new captain-owner, and spent the rest of the book providing its services, on his terms. Part of this story also appears as a short story in an Analog magazine. I probably read this in the late 80s, early 90s.
I have a query with a hard coded value which is also hard coded into my application (which has a comment saying that the value should be the same as the value hard coded into the query). What would be considered the best way to make that value discoverable outside of the single query it is being used in? A UDF immediately jumps to mind, but prior to 2019 it kills performance (don’t have 2019 so I can’t verify it, but it seems inlined UDFs should fix the performance problem). A view or TFV might be a good alternative, but both seem overly complex and a misleading. I don’t have a table/view of constants/lookup values. Is there a good solution for this situation or just stick with comments in the relevant code?
I want to know how to efficiently store query-affecting settings in a large analytical database (MS SQL Server). By efficiency I mean no hardcode (1) and fast/optimal query processing (2). My example I've got a massive table of sales orders. Let's simplify it to two columns: SalesOrder OrderID int Primary Key OrderDate date I need to retrieve the list of orders for the last X days and this X should be configurable. That's why I introduce a table of settings where I define it: Admin_Configuration SettingName (PK)| SettingValue ------------------|------------------ DaysBack | 30 It allows me not to hardcode this "30" in query definitions. Then I would run queries like: SELECT OrderId FROM SalesOrder as S JOIN Admin_Configuration as A ON A.SettingName = 'DaysBack' WHERE [OrderDate] > DATEADD(DAY, -A.SettingValue, GETDATE()); Performance It avoids hardcoding, but leads to a performance problem. This query runs much slower than it would've, had I simply hard-coded 30 in the WHERE clause. My understanding is that optimizer doesn't know how large my SettingValue is and assumes the worst - that all rows would be retrieved from the SalesOrders table, thus leading to a suboptimal query plan. Trying a scalar function yielded even worse results. I'm desperate enough to have a separate view which stores these hardcoded settings but I've been refraining from it with hopes for a better solution. Here is the original query plan (with a join): 4 seconds elapsed Here is the plan with subquery, as : SELECT orderid FROM [SalesOrder] as s WHERE s.OrderDate > dateadd(DAY, (SELECT -NumValue FROM Admin_Configuration where SettingName = 'DaysBack' ) , getdate()) 7 seconds elapsed, slightly slower As for the ideal performance: I just hardcoded 20, the query took 2 seconds. It needs mentioning that the Admin_Configuration table contains only 18 rows, hence it shouldn't affect performance. SELECT OrderId FROM SalesOrder as S JOIN Admin_Configuration as A ON A.SettingName = 'DaysBack' WHERE [OrderDate] > DATEADD(DAY, -20, GETDATE()); Using parameters would mean that I'd have to replace views (that I use now) with stored procedures/table-valued functions, which is unacceptable in my case
I know that any bounded function with a finite number of discontinuities is Riemann integrable over some interval. Is vice versa i.e., If a bounded function is Riemann integrable, then it has a finite number of discontinuities? Thanks.
Give example of a function $f: [0,1] \to \mathbb R $ which is integrable ( Lebesgue or Riemann , if possible , both) but whose set of discontinuity points is an uncountable set and dense in $[0,1]$ ?
Is "exposure fusion" distinct from HDR compositing techniques, or is it essentially a marketing term for a specific HDR process. Or is it just a synonym for HDR? Or, to put this in "meta" terms, should exposure fusion be treated as a distinct tag from HDR, or should it get lumped in with ?
I understand that "exposure fusion" is a method for combining different exposures into a single image. How exactly does it work, and how is it related to ?
n=5 for i in {1..$[n]} do echo $i done it gives: {1..5} But I think it should output: 1 2 3 4 5 Why it gives such a strange output?
How do I iterate over a range of numbers in Bash when the range is given by a variable? I know I can do this (called "sequence expression" in the Bash ): for i in {1..5}; do echo $i; done Which gives: 1 2 3 4 5 Yet, how can I replace either of the range endpoints with a variable? This doesn't work: END=5 for i in {1..$END}; do echo $i; done Which prints: {1..5}
I created a custom view field with the hook _views_data and a custom Class who extends FieldPluginBase. With the render method, I can return a sample string : class MyCustomClassViewsField extends FieldPluginBase { ... public function render(ResultRow $values) { $node = $values->_entity; return $node->id(); // My view field shows the nid of the current node } ... Now, I want shows a link with my field. I tried : class MyCustomClassViewsField extends FieldPluginBase { ... public function render(ResultRow $values) { $node = $values->_entity; return "<a href='http://www.test.com'>custom link</a>" } ... But my field in my view shows : <a href='http://www.test.com'>custom link</a> and not How can I show the link as an html element, not a sample text ? Thank you =) UP This code work : return array('#markup' => \Drupal::l("test",\Drupal\Core\Url::fromUri("http://www.example.com"))); ut the l() function is deprecated. If I use Link::fromTextAndUrl instead : return array('#markup' => \Drupal\Core\Link::fromTextAndUrl("test",\Drupal\Core\Url::fromUri("http://www.example.com"))); I get the error : [Sun Sep 18 22:17:59.444188 2016] [:error] [pid 2143] [client 192.168.1.48:53322] Recoverable fatal error: Object of class Drupal\Core\Link could not be converted to string in /var/www/xxxxx/core/lib/Drupal/Component/Utility/Xss.php on line 67, referer: [Sun Sep 18 22:17:59.446098 2016] [:error] [pid 2143] [client 192.168.1.48:53322] PHP Fatal error: Uncaught Error: Call to a member function get() on null in /var/www/xxxxx/core/lib/Drupal/Core/Session/SessionHandler.php:76\nStack trace:\n#0 /var/www/xxxxx/vendor/symfony/http-foundation/Session/Storage/Handler/WriteCheckSessionHandler.php(89): Drupal\Core\Session\SessionHandler->write('BTaHaVF0t-bMk2Z...', '_sf2_attributes...')\n#1 /var/www/xxxxx/core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php(75): Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHandler->write('BTaHaVF0t-bMk2Z...', '_sf2_attributes...')\n#2 /var/www/xxxxx/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php(77): Drupal\Core\Session\WriteSafeSessionHandler->write('BTaHaVF0t-bMk2Z...', '_sf2_attributes...')\n#3 [internal function]: Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy->write('BTaHaVF0t-bMk2Z...', '_sf2_attributes...')\n#4 [internal function]: session_write_close()\n#5 {main}\n thrown in /var/www/xxxxx/core/lib/Drupal/Core/Session/SessionHandler.php on line 76, referer: How can I replace the l deprecated function ?
Say I am extending The blockBase class to create a custom block, and I am implementing the blockBuild method to create some markup for my block. Something like this: class YourModuleBlock extends BlockBase { /** * Implements \Drupal\block\BlockBase::blockBuild(). */ public function build() { return array( '#markup' => 'This is a block!', ); } } If I wanted to provide a link in this markup, in D7 I would have used the l function, but this is no longer available (). So, I need to make available the new D8 method for generating links. I could just use an <a> tag, but this was never best practice in D7. So, what is the right method to use for creating links and how do I make it available to my function?
I want to upgrade my Processor and Motherboard but I want to keep the OS setup(dual boot for Ubuntu and Windows7) intact. Is it possible? What are the problems faced, if any?
I built myself a computer a couple of years ago and run it now with Ubuntu 9.04 under Xen 3.0. I'm not a hardware expert by any means, but I managed to make it all work. However, due to the lack of support for Xen by Ubuntu, I can't easily upgrade to more recent versions of the operating system. I have therefore decided to switch from Xen to KVM, which is supported by Ubuntu. My current CPU, an Intel Pentium 4 Processor 640, is not KVM-compatible (i.e. does not provide VT-x or AMD-V). My motherboard is an ASUS P5LD2. I have looked for other processors which work with the ASUS P5LD2 motherboard, implement VT-x or AMD-V, and are available in shops near me. The Intel E6700 seems to fit the bill. If I switch off my computer, replace the Intel 640 with an Intel E6700, update the BIOS for the E6700, and switch it back on again: will it still work with the existing installed software (Xen 3.0, Ubuntu 9.04 etc.)? Or do I have to reinstall everything from scratch? Steve
I want to do an inline check to see if an object exists or is None. Coming from LUA I'm used to writing print user and 'logged in' or 'not logged in'. However when searching the web, I can't find this method anywhere. Instead people advice you to use print 'logged in' if user else 'not logged in'. Both methods work though, is there a reason why I shouldn't use print var and 'yes' or 'no'?
I just came across this idiom in some open-source Python, and I choked on my drink. Rather than: if isUp: return "Up" else: return "Down" or even: return "Up" if isUp else "Down" the code read: return isUp and "Up" or "Down" I can see this is the same result, but is this a typical idiom in Python? If so, is it some performance hack that runs fast? Or is it just a once-off that needs a code review?
I don't know if this question is suited for superuser or not, but it doesn't seem right for Stack Overflow. Basically I have been hearing a lot about the cloud, but I don't understand what exactly it is. I am familiar with things that I am told are cloud computing, e.g. Amazon EC2, but I don't know what makes EC2 cloud computing as opposed to anything else. Is it just a matter of storing data at a remote location rather than on your own private servers that you physically own? I am not looking for a 2 sentence answer - I'm really looking for a detailed explanation of what the cloud actually is (and is not), because after watching at least ten youtube videos on this I still don't get it.
I hear about "" all the time, but don't know what it is. What is it's purpose? Why do I need it? What problems does it solve? What problems does it create?
Is there a word, or an expression, that describes the act of deceptively offering a person(s) a choice of future possibilities, that mollifies them long enough to complete a task, knowing that the end result is already determined? Example: Mother at grocery offering unruly children a visit to either ice cream shop or candy store afterwards in exchange for calming down. Knowing full well after the grocery they will go straight home.
Is there a simpler or better way of saying "promises that hold no meaning" or "promises without meaning"?
To recover the database from suspect mode executes the following query. EXEC sp_resetstatus ‘yourDBname’; ALTER DATABASE yourDBname SET EMERGENCY DBCC checkdb(’yourDBname’) ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE DBCC CheckDB (’yourDBname’, REPAIR_ALLOW_DATA_LOSS) ALTER DATABASE yourDBname SET MULTI_USER Then getting Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a system table is inconsistent. Check previous errors How to resolve this?
My database in sql server 2008 has marked suspect. How can I fix this problem?
Bohr said that only certain orbits of definite energy are allowed inside the atom. He said that the electrons in their ground state do not emit radiation and that they will emit radiation when they fall from higher energy levels to lower energy levels. My question is what does orbits with definite energy mean? and why do the electron in their ground state not emit radiation?
One of the problems with Bohr's theory to describe the hydrogen atom, was that the electron orbiting around the nucleus has an acceleration. Therefore it radiates and loses energy, until it would collapse with the nucleus. Now Schrödinger describes the electron as a wave function. His theory is able to describe all atoms (in contrast to Bohr's model), but how is the radiation problem solved? I understand that the wave has not an exact position in the time anymore. But the electron still "moves", so it has an acceleration anyway (because of vibrations or so). Why is in this theory the electron not radiating anymore? And if it is, why doesn't the atom collapse?
So this is pretty minor in the grand scheme of things. But, well it's still a bug. The "add comment" link is correctly greyed out, but it is accompanied by a "requires 50 reputation" link that — at 83,921 rep — I've never seen before. Presumably this shows up pre-login? If so, it's now started showing up for everybody on deleted questions.
So I recently saw add comment (requires 50 reputation) on a deleted answer. After looking around a bit, it seems to be on all deleted posts now (only deleted posts, normal posts still say just add comment). I'm sure it wasn't there before (I think it just said add comment (unclickable) or possible nothing). It is also on , presumably the root cause is the same. And yes, I do have more than 50 reputation (in case anyone was wondering). Just to clarify, requires 50 reputation obviously shouldn't be there for users with 50 or more reputation. Choices: Display nothing Unclickable add comment - probably not ideal Unclickable add comment (disabled for deleted posts) or something along those lines FYI - You may be somewhat confused right about now if you can't yet.
I love this article But the comment list is already closed so I need your help guys! How to make this code to a form using submit method? <a class="button" href="#"> <img src="*.png" alt="" />Add to cart</a> This is the sample of my form where I want the css button to be inserted: <form action="http://ww6.aitsafe.com/cf/addmulti.cfm" name="mal" method="post"> <input type="hidden" name="userid" value=""> <input type="hidden" name="return" value=""> <input type="hidden" name="nocart"> <input type="hidden" name="qty1" value="1"> <input type="hidden" name="product1" value=""> <input type="hidden" name="price1" value="150.00"> <input type=submit value="Add to Cart" onclick="alert('Added to cart\n\nThis page will refresh');"> update... yehey! :) Thank You to PCALCAO for the link There I found the answer of CHRIS to be very helfpful & now it's working... Correct answer: <a class="button" href="#" onclick="document.mal.submit(); return false;"> <img src="*.png" alt="" />Add to cart</a> :)
What's the best way to get a regular anchor (<a href="...">) to submit the form it is embedded in when clicked? <form> <ul> <li> <p> The link could be <span>embedded <a href="" onclick="?">at any level</a></span> in the form, so "this.parentNode.parentNode..." is no good. :( </p> </li> </ul> </form> I know that the easiest way using jQuery would be $('#myLink').click(function() { $(this).parents('form:first').submit(); }); ...but I'm trying to find a way to do this without using a library. Edit: I'm really trying to find a method which doesn't require knowledge of the form (eg: its name, id, etc). This would be similar to how you could put this on an input element: <input onclick="this.form.submit()" />
Im a little stuck here. I'm thinking of doing induction on the ordinals $\textbf{On}$, but I can't make it work. Can someone help me?
On Page 64, Set Theory, Jech(2006), define the following, by transfinite induction: $V_0=\emptyset$, $V_{\alpha+1}=P(V_{\alpha})$, $V_{\alpha}=\bigcup_{\beta<\alpha}V_\beta$, if $\alpha$ is a limit ordinal. How can we prove $V_{\alpha}$ is transitive by induction. I tried what if other set, say $\{\{\emptyset\}\}$, is disignated as $V_0$. It turns out the transitive property fails. So somehow I should incoorperate $V_0=\emptyset$ into the induction. But then I stared at it, I stared at it, I just don't know what should I do.
I have seen things like \lessgtr $\lessgtr$ (less on top, greater on bottom;) being used in paper. Can someone give me an example of how a double inequality is used?
I'm reading Papadimitriou & Steiglitz's Combinatorial Optimization and came across notation I'd never seen before and don't know what it means. The $\LaTeX$ markup for it is \gtrless ($\gtrless$), which took me quite a while to find. It arises in the formulation of general linear programs in terms of the constraints on the variables: $$ x_j \geq 0 \;\; j \in N\\ x_j \gtrless 0 \;\; j \in \bar{N} $$ It's not "not equals" because there's places in the text where the authors say $x$ can be zero.
On child meta sites, new users (those who don't have a badge yet) see the message "Take the Tour and earn your first badge" in their profile page. The message is the same as on the normal Q&A sites. However, on meta pages, the tour is linked to their parent site and it's not possible to obtain the informed badge on sub meta sites, so the message is useless on meta. For my user, I saw this message on and
I just joined Sports, and I decided to take a look on Sports Meta. I clicked on my profile there. This is part of what I saw: Yet the profile shouldn't indicate that it is, in theory. . . This seems to be a bug.
I am very new to shell scripting and using CLI all together. However, I want to create a simple program that can collect arguments from a user. Optimally, I want my shell script to get a network name and instance name from the user, and assign the values to variables. I know that $# can be used to gather arguments, but are there any other ways? I often notice when I make a command, there is, for example, something like this: $create --instance_name NAME . Can I gather an argument by using -- to specify the parameter? If so, here is an example of the command: $collect_variable.sh --network NETWORK_NAME --instance_name INSTANCE_ID Once again, thank you for any help. I am very new to stack overflow and unix all together, and any help is appreciated.
Say, I have a script that gets called with this line: ./myscript -vfd ./foo/bar/someFile -o /fizz/someOtherFile or this one: ./myscript -v -f -d -o /fizz/someOtherFile ./foo/bar/someFile What's the accepted way of parsing this such that in each case (or some combination of the two) $v, $f, and $d will all be set to true and $outFile will be equal to /fizz/someOtherFile?
This is what I've tried. Is there any simple way to do this? .minh { min-height:70px; border:1px solid #f00 } .btm { vertical-align:bottom; bottom:0; } <div class="minh"> <center class="btm">This goes to bottom</center> </div>
Say I have the following CSS and HTML code: #header { height: 150px; } <div id="header"> <h1>Header title</h1> Header content (one or multiple lines) </div> The header section is fixed height, but the header content may change. I would like the content of the header to be vertically aligned to the bottom of the header section, so the last line of text "sticks" to the bottom of the header section. So if there is only one line of text, it would be like: ----------------------------- | Header title | | | | header content (resulting in one line) ----------------------------- And if there were three lines: ----------------------------- | Header title | | header content (which is so | much stuff that it perfectly | spans over three lines) ----------------------------- How can this be done in CSS?
I was trying to understand use of slots in Python, so I created two classes, one with slots and one without it, then, I created about a million objects and print the size of both the objects: >>> class Foo(object): pass >>> class Bar(object): __slots__ = () >>> foos = [Foo() for f in xrange(1000000)] >>> bars = [Bar() for b in xrange(1000000)] >>> import sys >>> sys.getsizeof(foos) 4348732 >>> sys.getsizeof(bars) 4348732 Surprisingly both the objects are of same size. So now I am confused why is it said that slots save memory ? P.S. I tried this on Linux, Python 2.7 This is not duplicate of: Here I want to know why the memory consumption in both the scenarios is same?
What is the purpose of in Python — especially with respect to when I would want to use it, and when not?
I always use Google to login to SE websites. Now, I got a message that Google is cancelling GooglePlus, including the login options. Will this affect my ability to login to SE sites? If so, what should I do?
According to , Google+ APIs will shut down on March 7, 2019. Since I am using Google to provide authentication for several web sites (SE sites included), I am wondering if SE network will be affected by this. Question: Will Google+ APIs shutting down affect signing in into Stack Exchange sites?
My Api does not accept special character it thoroughgoing error as access-controller allow origin does not accept My File Name is Hello{#$^%.net}.pdf My Url Format Like This http://localhost:5300/api/Insert/DeleteRec/1-1920-9/36/Hello%7B#$^%.net}/pdf My Angular Code fac.DeleteRecFromTemp = function (EnqId, UId, FileName,exten) { var fixedstring = decodeURIComponent(escape(FileName)); return $http({ url: hostapiUrl + 'Inser/DeleteRec/'+EnqId+"/"+UId+"/" +fixedstring+"/"+exten, method: "DELETE", headers: { 'content-type': 'application/json' } }) } Please Help me how can i convert that url into my browser url
How do you safely encode a URL using JavaScript such that it can be put into a GET string? var myUrl = "http://example.com/index.html?param=1&anotherParam=2"; var myOtherUrl = "http://example.com/index.html?url=" + myUrl; I assume that you need to encode the myUrl variable on that second line?
Which one of these is correct and why? Is there a difference between American English and British English? Or spoken vs written English? To drop the "to" or not? 24-hour access to your Personal Account and the 24-hour Support Desk will help solve every possible online issue. 24-hour access to your Personal Account and the 24-hour Support Desk will help to solve every possible online issue.
What is the correct way to use infinitive after the verb "help": with or without "to"? For example: Please, help me to understand this. or: Please, help me understand this.
I need a query to take the name of the territory to which a user belongs I try with this UserTerritory userT = [SELECT Id, Terrotory.Name FROM UserTerritory WHERE UserId = :currentUser LIMIT 1]; but throws this error SELECT Id, Territory.Name ^ ERROR at Row:1:Column:12 Didn't understand relationship 'Territory' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
I want to get user and user's territory information. After i search, i found that user information in user Table. territory information in Territory Table. but, the relationship in UserTerritory Table. But, from the apex guide,i found that UserTerritory Don’t Support DML Operations. So, i can not get the information. So, Does anyone knows that how to write this soql or would you please give some idea to address this issue. Many thanks
Senator Mike Pencil announced today that the Florida State Senate passed legislation... *Edit: It's a specific example that I don't see an answer for in another post.
He will understand that I was not joking. He will understand I was not joking. Which of the sentences is correct? Are there any specific rules about the use of "that" in the sentences I reported as example?
I am using Unix OS and I want to know how to execute a command that is executable from a different software in Python script. I have this software installed into my system called HAL Tools and it has a command called maf2hal with two arguments which are input and output files. The path for the command is saved in my .bash_profile under PATH variable. I call the command from UNIX likewise: [root ~]$ maf2hal inputfile outputfile I want to call this command from a Python script. What is the statement or function that I need to use.
How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script?
I have recently come up with a proof of 1/0 = ∞. Here is the proof: We will first write 1 and 0 as powers of 10. 1 = 10^0 Since the limit of 10^x as x approaches -∞ is equal to 0, 0 = 10^-∞ Therefore, 1/0 = (10^0)/(10^-∞) = 10^(0-(-∞)) = 10^∞ = ∞ Is this proof correct?
My brother was teaching me the basics of mathematics and we had some confusion about the positive and negative behavior of Zero. After reading a few post on this we came to know that it depends on the context of its use. Why do we take 1/0 as positive infinity rather than negative infinity (we come close to zero from negative axis)?
I have this equation $$ 4y = y $$ If I divide by y in both sides I would get this: $$ 4 = 1$$ And this does not have sense. I know that the solution is 0 but why I get this answer when dividing by y. What's the logic behind?
I'm currently working through an algebra book, and during the chapter about rational expressions and inequalities, the author has a side note in which he states: Never divide both sides of the equation by a variable, even if you're doing it to try to solve a rational equation, because there's a very real danger that you will actually eliminate answers. The reason I'm asking this question is because I didn't understand how answers can be eliminated when dividing both sides of an equation by a variable. Can you show me an example of how this can happen and why?
Consider the irreducible polynomial $g = X^4 + X + 1$ over $F_2$ and let $E$ be the extension of $F_2 =$ {0, 1} with a root $α$ of $g.$ Could $E$ have a subfield of order 8 When working through my work Ive come across this question which has stumped me and I cant get my head aound if this is true of not so any help will be appreciated.
Consider the irreducible polynomial $g = X^4 + X + 1$ over $F_2$ and let $E$ be the extension of $F_2 =$ {0, 1} with a root $α$ of $g.$ Could $X^3 + X + 1$ have a root in $E?$ When working through this sheet Ive come across this question in which im not sure how to answer so any help will be appreciated
In a text book I am following, there is a definition of positive definite matrices, which I did not see before: $x^TAx \geq \alpha x^Tx$ where $\alpha$ is a positive scalar and $x \in \mathbb{R^n}$. The usual definition I know is for every non-zero vector $x \in \mathbb{R^n}$, it is $x^TAx > 0$. These definitions must be equivalent. It is trivial to show that the first definition implies $x^TAx > 0$. But I failed to see a way to show the other way around of the equivalence. I thought of applying SVD to the matrix $A$ and tried to find a way to show that $x^TAx$ is always lower bounded by a $\alpha x^Tx$ with $\alpha$ being positive, using singular values and vectors of $A$ but couldn't move forward. What is the correct way of approach here? (The other question in the board assumes symmetric matrices. This one does not).
Is there a theorem saying ${\bf x^TAx} \ge { a \bf x^Tx}$ for some $a>0$ not dependent on $\bf x$ if $\bf A$ is positive definite matrix? If there is, can some help provide a reference or some explanation? Thank you!
I have the integral: $$\int_{-\infty}^\infty e^{-x^2} \, dx$$ And I’d like to solve it using differentiation under the integral sign. I understand that I must convert $e^{-x^2}$ to $e^{-x^2}g(x,t)$, where $g(x,t)$ is just some term involving a new parameter $t$. I tried multiplying by $e^{-2xt}$, which doesn’t really seem very logical, however, I just do not know what to put. How do I find the appropriate term to make the whole process work?
I stumbled upon on last weekend, it introduces an integral trick that exploits . On its last page, the author, Mr. Anonymous, left several exercises without any hints, one of them is to evaluate the Gaussian integral $$ \int^\infty_0 e^{-x^2} \,dx= \frac{\sqrt{\pi}}{2} $$ using this parametrization trick. I had been evaluating it through trial and error using different paramatrizations, but no luck so far. Here are what I have tried so far: A first instinct would be do something like:$$ I(b) = \int^\infty_0 e^{-f(b)x^2}\,dx $$ for some permissible function $f(\cdot)$, differentiating it will lead to a simple solvable ode: $$ \frac{I'(b)}{I(b)} = -\frac{f'(b)}{2f(b)} $$ which gives: $$ I(b) = \frac{C}{\sqrt{f(b)}}. $$ However, finding this constant $C$ basically is equivalent to evaluating the original integral, we are stuck here without leaving this parametrization trick framework. A second try involves an exercise on the same page: $$ I(b) = \int^\infty_0 e^{-\frac{b^2}{x^2}-x^2}dx. $$ Taking derivative and rescaling the integral using change of variable we have: $$ I'(b) = -2I(b). $$ This gives us another impossible to solve constant $C$ in: $$ I(b) = C e^{-2b} $$ without leaving this framework yet again. The third try is trying modify Américo Tavares's answer in this : $$ I(b) = \int^\infty_0 be^{-b^2x^2}\,dx. $$ It is easy to show that: $$ I'(b) = \int^\infty_0 e^{-b^2x^2}\,dx - \int^\infty_0 2b^2 x^2 e^{-b^2x^2}\,dx = 0 $$ by an integration by parts identity: $$ \int^\infty_0 x^2 e^{- c x^2}\,dx = \frac{1}{2c}\int^\infty_0 e^{- c x^2}\,dx . $$ Then $I(b) = C$, ouch, stuck again at this constant. Notice in that question, Bryan Yocks's answer is somewhat similar to the idea of parametrization, however he has to introduce another parametric integration to produce a definite integral leading to $\arctan$. Is there such a one shot parametrization trick solution like the author Anonymous claimed to be "creative parameterizations and a dose of differentiation under the integral"?
I am working through some problems in Field Theory on Hungerford's Algebra. However I have been struggling to understand the notation in some exercises: 1.14 In the field $k(x)$, let $u = x^3/(x+1)$. Show that $K(x)$ is a simple extension of the field $K(u)$. What is $[K(x):K(u)]$? 2.11 In the extension of $\mathbb{Q}$ by $\mathbb{Q}(x)$, the intermediate field $\mathbb{Q}(x^2)$ is closed but $\mathbb{Q}(x^3)$ is not. I understand for a field $K$ what $K(x)$ means, this is the field of rational functions with indeterminate $x$. However, I do not understand what does $K(f(x))$ means. In class we worked with examples such as $K(u)$ where $u$ is a root of a polynomial in $K[x]$. In the linked questions the answers explain examples such as $\mathbb{Q}(\sqrt 2)$ which is the smallest field extension of $\mathbb{Q}$ that contains $\sqrt 2$. In general, for a field $K$ we have the extension $K(u)$ where $u\in F$ and $F$ is an extension of $K$. None of the linked answers indicates what it means to have $K(f)$ where $f\in K[x]$. To be more precise is $K(f)$ a quotient $k(x)/(f)$ or is it a shorthand notation for $K(u)$ where $f(u)=0$ or is it to replace the indeterminate $x$ for $f(x)$ in the rational function?
I was wondering what the notation $R[a]$ really stands for, if $a\in K$, where $K$ is a ring and $R$ is a subring of $K$. In my book they define $\mathbb{Z}[\sqrt2]=\{a+b\sqrt2|a,b \in \mathbb{Z}\}$. So, my guess is that $R[a] = \{P(a)\mid P \in R[X]\}$. Since for $\mathbb{Z}[\sqrt2]$ this is the case, or is this just a coincidence?
{ int a,b,c,d,e; float percentage; cout<<"marks= "; cin>>a; cin>>b; cin>>c; cin>>d; cin>>e; percentage= (a+b+c+d+e)/5; cout<<"Percentage= "<<percentage<<endl; if (percentage<40) cout<<"fail"; else if (percentage>=40,percentage<=49) cout<<"third division"; else if (percentage>=50,percentage<=59) cout<<"second division"; else if (percentage>=60) cout<<"first division"; } When i submit this to my lecturer, he said that it is theoretically wrong to use comma in the condition, and is suppose to be &&. However, I have successfully run this program. Can anyone explain to me?
What does the , operator do in C?
I just want to ask whether I can recover data from a windows partition after installing ubuntu over it? Thanks in advance.
I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions (C:) Vista (D:) Entertainment (E:) Work (F:) Sources and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB. I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse? I need these data badly as I don't have a backup for them.
I just noticed that got a Famous Question badge for . However, the question has a negative score. How come the badge was awarded for what appears to be a "bad" question?
The Famous Question badge is awarded for question with 10.000 views. I've seen questions with negative scores to be used as a reference to golden Famous Question badges. Why isn't there an additional requirement to have positive score on that question? Is the intention of this badge to indicate helpful and interesting question or just number of views?
During football matches intervals, between halves or before overtime, are the referees able to take a look at the dubious episodes of the first half? Should they be able to?
What do football referees do and where do they go during halftime? Is there a protocol or are there particular rules they have to obey during that time, like restrictions who to communicate with? Is it common to prepare in some way for the second half and review the decisions made in the first half, or do they simply spend the time recovering? I'm mainly asking about the situation in high-profile games (e.g. Champions League).
Recently I received this comment from an Elsevier editor "The manuscript does not reach the required quality standard of this journal.". Since then have been found some answers but also raise additional questions. Like the one I making here. (You can browse the initial question following this link .) One of the criteria for acceptance of a paper is the one of written language throughout the text. Many times is found great published articles on more peripherical journals simply because the article does not comply strictly with the language minimum requirements for any other more reputable* Journals. Spite all the work is properly done, explained, and demonstrated both graphically and mathematically. In my particular case, my written English inherits some of my native language (PT) sentence constructs, which may be confusing to those with native English (UK and US) writing skills. That said, and thinking also in terms of open-data and open-source access to all, how can a researcher, in particular a junior (newbie) research, can learn the language requirements for a specific scientific Journal? EDIT: Yesterday I forgot to add an essential and relevant fact to this conversion, which is: many and many scientific researchers don't have the opportunity to develop their research works in a team or even do it collaboratively. They have to rely on themselves to present their findings and defend their thesis. And everyone here is acquainted with the syndrome of "tunnel effect" when writing. So having someone, that can give a small contribution to unlocking someone else research writing, I see as a welcoming behavior that can only benefit the scientific community at the individual level. EDIT 2: in the midst of all these comments and answers, I found today, this small tutorial with some useful tips for non-native English researchers EDIT 3: since the initial commit, I took the liberty and went requesting quotes online for proofreading and grammar. 400 CAD is quite a lot for a student, imho. It's not feasible.
I just received the following comment from an Elsevier editor "The manuscript does not reach the required quality standard of this journal.". To my mind say just that or nothing is pretty much the same considering the minimum requirements for data openness and transparency. there is already a good explanation of the submission process here: However, as an automated process, is prone to flaws as well as to improvements. And does not explain in detail the received comment stated above. Any thoughts on deciphering the comment stated above are greatly appreciated. thank you EDIT: When I posted this question I forgot to add an essential and relevant fact to this conversion, which is: many and many scientific researchers don't have the opportunity to develop their research works in a team or even do it collaboratively. They have to rely on themselves to present their findings and defend their thesis. And everyone here is acquainted with the syndrome of "tunnel effect" when writing. So having someone, that can give a small contribution to unlocking someone else research writing, I see as a welcoming behavior that can only benefit the scientific community at the individual level.
Let $0 <a <b\ $ let $f >0 $ be continuous and strictly increasing function on $ [a,b]$. Prove that $$\int_{a}^b f \ + \int_{f(a)}^{f(b)} \ f^{-1}=bf(b)-af(a)$$ How to approach this problem . Any Hint? I am suppose to do it without using antiderivatives.
Suppose $f$ is a continuous, strictly increasing function defined on a closed interval $[a,b]$ such that $f^{-1}$ is the inverse function of $f$. Prove that, $$\int_{a}^bf(x)dx+\int_{f(a)}^{f(b)}f^{-1}(x)dx=bf(b)-af(a)$$ A high school student or a Calculus first year student will simply, possibly, apply change of variable technique, then integration by parts and he/she will arrive at the answer without giving much thought into the process. A smarter student would probably compare the integrals with areas and conclude that the equality is immediate. However, I am an undergrad student of Analysis and I would want to solve the problem "carefully". That is, I wouldn't want to forget my definitions, and the conditions of each technique. For example, while applying change of variables technique, I cannot apply it blindly; I must be prudent enough to realize that the criterion to apply it includes continuous differentiability of a function. Simply with $f$ continuous, I cannot apply change of variables technique. Is there any method to solve this problem rigorously? One may apply the techniques of integration (by parts, change of variables, etc.) only after proper justification. The reason I am not adding any work of mine is simply that I could not proceed even one line since I am not given $f$ is differentiable. However, this seems to hold for non-differentiable functions also. I would really want some help. Pictorial proofs and/or area arguments are invalid.
I have been tasked with making a tool, that when you open it you can choose from a list in a dropdown box, which then populates the second dropdown box with a sublist, like so: However I only have a basic understanding of Python and I barely understand GIS, so this is a giant learning experience for me. I have tried using ESRI's site and this community, but alas I am still horribly stuck. Where it goes wrong is at "self.params.filter.list =" I can make it work with if I give it a list like ["Option 1", "Option 2"], however i already have the list "mergedList" where I have the values I want, but I cannot for the life of me make it work. I have tried with: self.params.filter.list = mergedList and self.params.filter.list = sorted(mergedList.keys()) and one other which eludes my brain right now. Current code, it only has one of the params, since I can't get that to work I haven't done the other one. import arcpy class ToolValidator(object): """Class for validating a tool's parameter values and controlling the behavior of the tool's dialog.""" def __init__(self): """Setup arcpy and the list of tool parameters.""" self.params = arcpy.GetParameterInfo() def initializeParameters(self): """Refine the properties of a tool's parameters. This method is called when the tool is opened.""" # Variables for Cursor featureClassName = r'ArcGIS_Drift_Grundkort_DB.GISGRUNDKORT.Jordstykke' cursorNavn = "ELAVSNAVN" cursorNr = "MATRNR" #Generate empty Lists listNavn = [] listNr = [] #Populate lists with arcpy.da.SearchCursor(featureClassName, (cursorNavn,)) as cursor: for row in cursor: listNavn.append(row) with arcpy.da.SearchCursor(featureClassName, (cursorNr,)) as cursor: for row in cursor: listNr.append(row) #Merge lists into a single list with keys mergedList = {} for i, v in enumerate(listNavn): mergedList[v] = mergedList.get(v, []) + [listNr[i]] #toolbox stuff self.params[1].filter.list = mergedList return def updateParameters(self): """Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parameter has been changed.""" return def updateMessages(self): """Modify the messages created by internal validation for each tool parameter. This method is called after internal validation.""" return It is very likely there is a better way of doing this, I just need the unique data from column A (ELAVSNAVN) which is like companies and then a sublist with the numbers (MATRNR) that goes with that. The tool itself is incomplete since i am stuck on just the list part, just need some pointers / tips for that.
I have a python script that checks file path names for corresponding files in a drive location. All of the inputs were originally hard coded, and it works well enough: import arcpy import os shp = r"C:\Users\dotwell\Desktop\Locations.shp" fields = ["ZdriveLoc"] f = open (r"C:\Users\dotwell\Desktop\ValMapsTest.txt", "w") cursor = arcpy.da.SearchCursor (shp, fields) for row in cursor: Roll=str(row[0]) if not os.path.exists(Roll): f.write(Roll + os.linesep) f.close() I'm trying to create an ArcGIS script tool from this, and I've only had partial success. I can use shp = arcpy.GetParameterAsText(0) to allow the user to select the shapefile. I'd like to then have a drop down list of the fields in that shapefile for the user to select the field that contains the path names, but I can't get it to work. Can someone show me how to generate the drop down? Here's my latest try. It works, but requires the user to type in the field name. It would also be nice for the user to designate the output text file name and location. import arcpy import os shapefile = arcpy.GetParameterAsText(0) field = arcpy.GetParameterAsText(1) f = open (r"C:\Users\dotwell\Desktop\ValMapsTemp.txt", "w") cursor = arcpy.da.SearchCursor (shapefile, field) for row in cursor: Roll=str(row[0]) if not os.path.exists(Roll): f.write(Roll + os.linesep) f.close() Here are the parameters in my ArcGIS script tool:
Is it possible for holograms, as in 3D projections of light in midair, to exist? Consider this image. If a projector, placed in the same position as the gray circle in the first image, were to project some sort of light into the air, would it be able to form a three-dimensional image such as this bowl?
Is there some law of physics that strictly prohibits the projection of 2D or 3D images into thin air (such as holograms in movies) or is a solution to achieve this still up for grabs by an eventual discoverer?
İn edit mode: shift + S in object mode: Ctrl + alt + shift + C not helping... In 3dsmax for example there is a button which allows you can play with your widget without interferes with your object. so in short ı wanna do the thing same in the picture Thanks people. ı appreciated. Its solved.
How can I change the local origin of an object, without changing the object location in the world space. This is the object located at position (0,0,0) in the world space This is the same object located at position (0,1,0) in the world space, but with its local origin offset so that the object is in the same place Is there a way to do this in a single step?
$$\lim_{n\rightarrow\infty}\sum\limits_{k=1}^n \frac{k}{k^2+n^2}$$ I was trying to write it as an integral but failed, how to do it here?
I guess it has something to do with Riemann sums but this is new for me. $\displaystyle\lim \limits_{n \to \infty}\sum \limits_{k=n}^{2n}\frac{k}{k^2+n^2}$ How do I start?
I've tried searching for an app or tools that can do this in macOS but I couldn't find any. There seems to be a key repeat setting in system prefs but it seems to have no effect. For example in notes, if I hold a key it would not repeat? Ideally I can have the key repeat behaviour on and off as I only want it during the day for work activities
I just wanted to make some input where I press a key and the auto-repeat function engages so I don't have to press the 0 key many times to make a long number. 10000000000000000000000000000 This has always worked without fail in the past, but it's not something I do often and I'm not sure where to look next to figure out what might be preventing this. I've toggled the sliders to change the delay for key repeat, but the only thing I can hang my hat on is that perhaps Lion disables this with the new feature where you hold down some keys (like the vowels, but also some consonants) to get alternate accented characters. s turns into ß or ś or š and so on.... Am I missing an obvious setting, or is this something that has moved to a hidden setting or is simply a bug that these controls are still around since key repeat is now deprecated? Comments welcome if anyone doesn't have an answer, but can provide specifics where this does work for them. I've checked two Macs so I'm guessing it's not related to keyboard type or connection method.
I have a folder with more than 500 raster (DEM) and I want to reclassify (equal interval method) each of them but number of classes in each case is determined by the number of 100m elevation bands. i.e number of classes =(max elevation- minimum elevation)/100. I have obtained max and minimum elevation of each raster from GetRasterProerties tool. How do I put this custom number of classes for each raster?
I am using ArcMap 10.1 or 10.2. I have a folder with more than 500 raster (DEM) and i want to reclassify (equal interval method) each of them but number of classes in each case is determined by the number of 100m elevation bands. i.e number of classes =(max elevation- minimum elevation)/100. I have obtained max and minimum elevation of each raster from GetRasterProerties tool. How do I put this custom number of classes for each raster using ModelBuilder?
I'm trying to construct a database by using laravel relationships. As far as i know, foreign keys are a good way to ensure data integrity and correctness. Why not? I'd want to use it. My questions are : a)does using foreign keys in mysql really slow the performance at all? if yes, why does it slow? b) If it slows, what should I do? Is it better not to use it at all ?
Suppose I have 2 tables, Products and ProductCategories. Both tables have relationship on CategoryId. And this is the query. SELECT p.ProductId, p.Name, c.CategoryId, c.Name AS Category FROM Products p INNER JOIN ProductCategories c ON p.CategoryId = c.CategoryId WHERE c.CategoryId = 1; When I create execution plan, table ProductCategories performs cluster index seek, which is as expectation. But for table Products, it performs cluster index scan, which make me doubt. Why FK does not help improve query performance? So I have to create index on Products.CategoryId. When I create execution plan again, both tables perform index seek. And estimated subtree cost is reduced a lot. My questions are: Beside FK helps on relationship constraint, does it have any other usefulness? Does it improve query performance? Should I create index on all FK columns (liked Products.CategoryId) in all tables?
Home and Desktop got merged in my system. Means whatever I save in home gets automatically save on Desktop and if I delete anything from the desktop it gets deleted from home as well. How can I get rid from this?
My desktop (not the /home/user/Desktop folder) shows the contents of my /home/user folder. I don't know how I have done it and can I have some help on undoing it? The /home/user/Desktop folder just contains my desktop files which do not appear on my desktop.
I have a shapefile of 1241 dam locations in Washington, if I open the attribute table I have only latitude and longitude. I want to convert this to a raster with counts of the number of dams in each raster cell. I am using QGIS but could also use R.
I have a point layer that shows the distribution of a species. Is it possible in QGIS to convert this point layer to a raster grid in which the value of each cell corresponds with the amount of points within that cell? Until now, I only managed to attach attribute values to the grid cells. I have already added a column in my attribute table that has the value '1' for each point, hoping that there is a way to use a sum of attributes for each grid cell.
I have installed Ubuntu alongside Windows, but now I want to uninstall Windows as it's now corrupted.I don't remember on which partition I have Windows installed.I have the following partitions: 4 ntfs 1 ext4 1 extended 1 linux-swap 2 unallocated How to know on which partitions I have Windows?
I want to keep Ubuntu but remove Windows.
My roasted chicken bled while it rested under foil. I refrigerated it over night. Can I bake it more today to finish it without drying it out?
I cooked some chicken but didn't realise it hadn't completely cooked through. It then went in the fridge and a day later I cut through it to discover the problem. Is it now safe to put that chicken in the oven to finish cooking it or am I risking major health issues?
I am creating a social media website which is expected to have huge traffic. PHP version is 7.3, session_set_save_handler is MYSQL database. cookie_lifetime is set to one year I am concerned about the fact that PHP session_start() could generate duplicate session_id(ie same session_id for multiple users) in high traffic sites, though the probability is too low. I have searched a lot but haven't come across a fool proof algorithm to avoid it. Can anybody here enlighten me about the same?
How unique is the php session id? I got the impression from various things that I've read that I should not rely on two users never getting the same sessionid. Isn't it a GUID?
So even the combined efforts of my professor, my book and the internet have not been able to make me understand the concept of Importance Sampling. I know that it is a way to help with estimating the probability of the occurance of very rare events, however, I have no idea how it works. For instance, let's assume I start a random walk at $x_0=1$ and $x_i = x_{i-1}+y_i$, where $y_i=1$ with chance $p=0.2$ and $y_i=-1$ with chance $1-p=0.8$. Therefore, the random walk will probably go to lower values. I am told that IS is useful if we want to estimate the probability that the random walk will reach a high value (for instance, $100$), before reaching $0$ (the chance for this is of course at most $0.2^{100} \approx 1.27 \cdot 10^{-70}$). How would IS help for a problem like this?
My background is computer science. I am fairly new to monte carlo sampling methods and, although I understand the math, I have hard time coming up with intuitive examples for importance sampling. More precisely, could someone provide examples of: an original distribution one cannot sample from but one can estimate an importance distribution which can be sampled from and adequate for this original distribution.
Why does Ross use Present Perfect here if he's speaking about the past?!
I was told that if an action is completed once in the past, the simple past is used. Ex: I saw that movie. If the action is completed more than once, the present perfect tense must be used. Ex: I have seen that movie twelve times. So, "I have seen that movie twelve times on Tuesday." is correct and "I saw that movie twelve times on Tuesday." is incorrect?
I need to limit this string to max 320 characters but also make it truncate cleanly if it is going to overrun e.g I want Testing Item 1 | Testing Item 2 | Testing Item 3 Instead of Testing Item 1 | Testing Item 2 | Testing Item 3 | Tes Currently I have this function: /** * First filter out any empty values, strip any tags, then join each array item with a pipe | and limit it to 320 characters. * @param $array * @return string */ public function limitStripAndJoin($array) { // Removes any empty strings from the array e.g if there's no caption on an image, we want to remove the empty string $filteredArray = array_filter($array, 'strlen'); return strip_tags(substr(join(" | ", $filteredArray), 0, 320)); } I just need to know how stop going to the next item if it will overrun?
I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage. The original block of text can be a lengthy article or a short sentence or two; but for this widget I can't display more than, say, 200 characters. I could use substr() to chop off the text at 200 chars, but the result would be cutting off in the middle of words-- what I really want is to chop the text at the end of the last word before 200 chars.
I know that many of here can be confused with my question because as we all know, and was also well mentioned in the books, that Voldemort never valued love. But I wonder if why he revenged and killed his father. One of my possible theory of the impossibility for Tom Riddle to love his mother: Voldemort's real intentions for murdering his father was not to give revenge for his mother, Merope, but intended it as a revenge just for himself and just to give way for his horcrux. Is this theory correct? Or there's other reasons contributing to the fact that Voldemort never loved anyone?
We know that Voldemort does not love. He does not understand it, nor (generally) the magic that it possesses. He knows of the sort. [...] "you possess in such quantities and which Voldemort has not at all." [...] "because he could not bear to reside in a body so full of the force he detests. In the end, it mattered not that you could not close your mind. It was your heart that saved you." (Harry Potter and the Order of the Phoenix, page 1075) The above confirms it (although I believe there is a better quote), though reinforces it. The fact that he hugs so awkwardly shows that he does not really know how, due to his lack of love. I realize that Voldemort's appearance started to change after he started to create Horcruxes, but surely he had an ounce of love when he was a child? The hugging scene perhaps shows that he never once loved his whole life (possibly due to the love potion with his parents?). If so, when did Voldemort begin to have no love at all, and why?
I have a SSD 80 gigs disk which I want to use for Ubuntu 12.10 installation and some programs like Libre Office and Firefox, but the new Steam Linux and games would fill up my SSD quickly. How can I install apps on second 2TB HDD? I read few answers but I don't exactly understand them.
I recently got an invitation for Steam. I want to download games but my SSD drive which I have Ubuntu will not be enough. How can I install Steam on a different hard drive? I went into the "Steam Library Folders" but I can't delete the original folder so steam can install on that drive. I have also tried to change the place but it is again on the down side:
I have 0 experience with any 3D application. I was told to start looking into it as I have been looking for a quality hobby. Today I found Blender that seems like it might be a good place to start (and it's free too!). My problem is where do I start? I want to learn the ins and outs of Blender as well as all the terminology that has to do with 3D but I prefer reading books than working through tutorials. So my question is, if I were to get this book: would I be able to learn the basics of blender from scratch while still understanding the terminology involved in 3D applications? Thanks
Since asking for tutorials, videos, resources, links to other content or downloads is considered off topic here, this is a specifically created Community Wiki which gathers resources for Blender and it has been approved by the . Just write in the appropriate answer/section. If you have concerns, questions, post a question, so we don't clutter the comments, but you can link your meta question from the comments. Questions regarding such resources are not allowed anymore, except for very specific and on topic requests (ask on if you're unsure about your question). Follow the instructions made in the question about how to post, what can be posted, etc. Learning Assets (also see: ) Reference Images/Blueprints (also see: ) Tools (also see: ) Other Special Interest () Also see the .
I'm using the style verbose-trad2 in biblatex. I have some bibliographical incollection items which refer to a collection item via the field crossref. The collection item has a shorttitle item which unfortunately is not being used, as you can see in this MWE: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[style=verbose-trad2]{biblatex} \addbibresource{stack2.bib} \begin{document} The first one\footcite{vasquez1998bajo}. \par And then\footcite{negredodelcerro1998}. \end{document} And the items: @collection{MartinezRuiz1998, editor = {Martínez Ruiz, Enrique}, title = {España y Suecia en la época del Barroco (1600-1660)}, shorttitle = {España y Suecia}, year = 1998, location = {Madrid}, } @InCollection{negredodelcerro1998, author = {{Negredo del Cerro}, Fernando}, title = {Contradicciones en la Monarquía Católica}, pages = {667-685}, crossref = {MartinezRuiz1998} } @InCollection{vasquez1998bajo, author = {Vasquez Lopera, Julián}, title = {Bajo el signo de la diplomacia etc.}, crossref = {MartinezRuiz1998}, pages = {761-791} } Is there a way to force biblatex to check whether a collection item has been already cited through an incollection item?
I'm exploring the great possibilities of biblatex ... and there are a few questions I can't resolve. I'll start :) with one (edit !) of them : I'm using "crossref" to cite several chapters in a book. Currently, when a second chapter in the same book is cited, all information about the publisher etc is reprinted. I'd like only the first reference to the book to have the full information, the following chapter could just have "author, chapter, in : bookname, op. cit." Something tells me this should be possible ... would you know how to achieve this ? Thanks in advance, Jos Here's a small code : \documentclass[ngerman,french]{article} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \makeatletter \usepackage{lmodern} \usepackage{perpage} \MakePerPage{footnote} %% Biblatex %% \usepackage[language=french,% autopunct=true,% citestyle=verbose-trad2,% strict,% citepages=suppress,% idemtracker=true,% loccittracker=true,% opcittracker=true,% related=false, bibstyle=reading,entryhead=false,entrykey=false,annotation=false,abstract=false,library=false,file=false,% backend=biber]% {biblatex}% \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @Book{MH_Holzwege, keywords = {MH,D}, author = {Martin Heidegger}, title = {Holzwege}, publisher = {Vittorio Klostermann}, address = {Frankfurt a. M.}, year = 2003, series = {Einzelausgabe des Bd. 5 der Gesamtausgabe}, edition = {8., unver\"{a}nderte Auflage}, addendum = {1. Publikation: 1950}} @InBook{MH_Kunstwerk, keywords = {MH,D}, author = {Martin Heidegger}, title = {Der Ursprung des Kunstwerkes}, pages = {1--74}, crossref = {MH_Holzwege} } @InBook{MH_NietzscheGott, keywords = {MH,D}, author = {Martin Heidegger}, title = {Nietzsches Wort `{Gott} ist tot'\,}, pages = {193--247}, crossref = {MH_Holzwege} } @InBook{MH_Weltbild, keywords = {MH,D}, author = {Martin Heidegger}, title = {Die Zeit des Weltbildes}, pages = {69--104}, crossref = {MH_Holzwege} @Book{MH_SZ, keywords = {MH,D}, author = {Martin Heidegger}, title = {{Sein und Zeit}}, address = {T\"{u}bingen}, publisher = {Max Niemeyer}, year = 2001, edition = {18. Auflage}, addendum = {1. Publikation: 1927}} } \end{filecontents} \addbibresource{\jobname.bib} \makeatother \usepackage{babel} \addto\extrasfrench{\providecommand{\og}{\leavevmode\flqq~}\providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}} \begin{document} \title{Titre} \author{A. Teur} \maketitle Texte\footcite[20]{MH_Kunstwerk}. Plus de texte \footcite{MH_Weltbild}. Et hop \footcite{MH_SZ} Une derni\`ere\footcite{MH_NietzscheGott} \printbibliography[title={Oeuvres de Martin Heidegger},keyword=MH,keyword=D] \end{document}
I have a form that's calculated on the go. (below picture) So that table gets created with jQuery & Ajax working with PHP. I want to implement a PDF library that can print that correctly. The tricky part is that I don't know the best way to send that whole table (along with CSS of it in header) to an another PHP file through POST method so that file takes it in and places it inside where it needs to go to PDF get created correctly. What's the best way to go about this? Process for the table is, first enter dates then select company then click view. At this point, the table gets created, once you click to report it is supposed to create a pdf. Note to whomever marked this question duplicate: Whoever marked this duplicate, did you really read that other ticket? The other one pure HTML + CSS. I am talking here a page created HTML + CSS and manipulated using AJAX and jQuery! I really don't get people who don't read questions and randomly mark them as duplicate, this has nothing to do with that other question!
I have an HTML (not XHTML) document that renders fine in Firefox 3 and IE 7. It uses fairly basic CSS to style it and renders fine in HTML. I'm now after a way of converting it to PDF. I have tried: : it had huge problems with tables. I factored out my large nested tables and it helped (before it was just consuming up to 128M of memory then dying--thats my limit on memory in php.ini) but it makes a complete mess of tables and doesn't seem to get images. The tables were just basic stuff with some border styles to add some lines at various points; : I actually had better luck with this. It rendered some of the images (all the images are Google Chart URLs) and the table formatting was much better but it seemed to have some complexity problem I haven't figured out yet and kept dying with unknown node_type() errors. Not sure where to go from here; and : this seems to work fine on basic HTML but has almost no support for CSS whatsoever so you have to do everything in HTML (I didn't realize it was still 2001 in Htmldoc-land...) so it's useless to me. I tried a Windows app called Html2Pdf Pilot that actually did a pretty decent job but I need something that at a minimum runs on Linux and ideally runs on-demand via PHP on the Webserver. What am I missing, or how can I resolve this issue?
I'll pose this one as a question for an open discussion because the issue really bothers me: Shouldn't there be an appeal process for (wrongly) rejected edits? First I have to give you some background for context: Almost all of my reputation score on SO comes from answering questions related to Bootstrap 4. Also, according to SO, I'm currently in the top 5% of folks who answer questions on that particular topic. In other words, I actually know a few things in regards to this particular topic. Now, I have recently made an edit to an old question concerning this particular topic, Bootstrap 4 (i.e. my area of expertise). I'll link to that at the bottom because I want to keep the question and discussion general here. My edit was rejected by 2 individuals who clearly have NO knowledge in regards to Bootstrap 4. But that's not even the most annoying part. The most annoying part are the justifications they have given for their rejection. Those justifications are completely and utterly 100% WRONG! More context: I as a guy who is in the top 5% of folks answering Bootstrap 4 related questions initially saw that old questions and didn't know what it actually meant (based on its title). So, I clicked the question because I wanted to find out what the asker actually meant. I then read the actual question. Nothing changed, the question was still unclear at that point. I then looked at the comments. And it was only then where I saw a clarification comment from the asker! In the first comment to that question, someone asks: What does "multiple items carousel" mean? That's exactly the question I would have asked because to me (someone who is in the top 5% answering Bootstrap 4 questions and actually KNOWS stuff about this subject) the asker's question was totally unclear. "multiple items carousel" is a term I have never heard before and at best this term/description is very ambiguous. Even to someone like me who is dealing with Bootstrap 4 and Bootstrap 4 related questions every single day. It is, therefore, highly advisable, helpful and recommended to add the necessary clarification at least to the question's title and possibly also to the text of the question which is exactly what I did. So, here are the issues I'd like to start a discussion about: 1) People reviewing edits often don't have any expertise on the topic at hand. 2) It seems that if a question has comments attached to it, those comments are NOT shown to the individuals reviewing the edits! WHY? Those comments were essential for a context in this case and would have shown even to someone who is inexperienced with Bootstrap 4 that my edit was in fact, relevant and correct. 3) There is no appeal process for cases of that nature. So, my question is, once again: Shouldn't there be an appeal process for (wrongly) rejected edits? I'd like this to be an open, general discussion about this issue but for those mods who are interested to look up my particular case, it's my edit to . P.S. I had promised to mods to never post anything on meta ever again but have now decided to make an exception for this issue because it really bothers me when someone accuses me of wrongdoings when it is objectively NOT the case.
When clicking "edit" I see: Your edit will be placed in a queue until it is peer reviewed. We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks. Like: Likewise, when I am not logged in, clicking "improve this question" or "improve this answer" shows: You are not . Your edit will be placed in a queue until it is . And when I click 'Save', I get: Thanks for submitting an edit. It is only visible to you until it's been approved by trusted community members Like: Who can suggest an edit? Where do suggested edits go? Who can vote on a suggested edit? How do suggested edits get reviewed? Can I earn reputation? What about abuse or bad edits? Sometimes the Community user approves or rejects my edit. Why is that? When can I not suggest an edit? Is there a minimum change requirement for a suggested edit? How do I check my suggested edit history? I disagree with the reasons why my suggested edit was rejected. What can I do? How do I know whether there are edits waiting for review? Someone suggested an edit to my own post, and the reviewers took the wrong action. What can I do? Are tag wikis included in this scheme? What do the "Improve Edit" and "Reject and Edit" buttons do? Why are apparently valid links to rejected edits resulting in 404 errors? For more information about editing, see "" in the .
So I'm trying to make a command where you throw a snowball and a trail of lighting bolts follows it. Heres the command: /testfor @e[type=snowball] With a comparator facing into this one, /execute @e[type=snowball] ~ ~ ~ /summon lightning ~ ~1 ~ When I throw the snowball, it says: Failed to execute '/summon lightning ~ ~1 ~' as Snowball Why?
I am trying to make a snowball that triggers a command when it hits a player in 1.15, but I don't know how to do that. When I do execute at @e[type=snowball] run gamemode spectator @a[distance=..2] it only runs the command if it goes right next to them.
I'm currently trying to write an extension method to work out the allowed variance for a decimal. While I was writing it I thought I'd extend it to a generic extension, with restrictions to decimal, float, double. Currently I'm not aware of how (or if it's possible) to restrict a generic to value types. public static bool WithinVariance(this decimal source, decimal allowedVariance, decimal comparisonValue) => WithinVariance<decimal>(source, allowedVariance, comparisonValue); public static bool WithinVariance<T>(T source, T allowedVariance, T comparisonValue) // where T : decimal // where T : double // where T : float { var allowedDifference = (source / 100) * allowedVariance; var difference = source - comparisonValue; return Math.Abs(difference) <= allowedDifference; } The above code doesn't work, it's there purely to show the approach I'm taking. Originally I was just going to a single method, but I changed to the above to try to hack it into working. Also an attempt at restricting the extension methods without using a where t filter (see commented out lines) Does anyone know if it's possible and if so how to do this?
Can anyone tell me if there is a way with generics to limit a generic type argument T to only: Int16 Int32 Int64 UInt16 UInt32 UInt64 I'm aware of the where keyword, but can't find an interface for only these types, Something like: static bool IntegerFunction<T>(T value) where T : INumeric
I have purchased a 300W Modified Sine Wave Inverter. I am also connecting a 12V 18A/hr SLA battery to it. I am using it to power an RFID reader. The input power characteristics of the power block are: 100-250V, 50-60Hz, 0.5A. The output characteristics are: +48V DC, 0.4A. Please note the power block connects to the RFID reader via an ethernet cable only. Hence I cannot just connect a DC supply directly to the RFID reader. How would I calculate how long the battery will last before I need to charge it, do I use the input or output characteristics of the power block? (Is there an equation I could also use). Also, I would also like to connect my laptop charger to the inverter while the inverter is powering the RFID reader. The input characteristics for the laptop charger is: 100-240V, 50-60Hz, 1.2A Output characteristics are for the laptop charger are 19V DC, 2.73A. Will it be okay to connect the laptop charger and the RFID reader at the same time, or will this exceed the limitations of the battery and the inverter? I know how to calculate the duration of a battery given a DC to DC setup. But know I am going from DC to AC to DC again. Do I use the input characteristics of the power supply blocks i.e. the currents or the output characteristics of the power blocks?
How do I calculate the approximated time for the Charging and Discharging of the battery? Is there any equation available for the purpose? If yes, then please provide me.
I am looking to pick 1 person from a list of people where each item in the list has a certain "weighting" to it. Let's assume the Person class has the necessary constructor. public class Person { public string Name { get; set; } public float Weighting { get; set; } } public List<Person> People = new List<Person>(); People.Add(new Person("Tim", 1.0)); People.Add(new Person("John", 2.0)); People.Add(new Person("Michael", 4.0)); Now, I want to choose a person randomly from this list. But on average I want to pick Michael 4 times more often than Tim. And I want to pick John half (2/4) as often as Michael. And of course, I want to pick Michael double as often as John. Does that make any sense? I already have code in place to select people based on percentages. Wouldn't it work if I just multiplied the %chance of them by the weighting provided in this example? Also, my current system only works with chances of up to 100%, nothing above. Any advice on how to overcome this limitation? I would probably have to scale every chance according to the largest factor in the list? public static bool Hit(double pct) { if (rand == null) rand = new Random(); return rand.NextDouble() * 100 <= pct; } Or am I missing something?
Consider the class below that represents a Broker: public class Broker { public string Name = string.Empty; public int Weight = 0; public Broker(string n, int w) { this.Name = n; this.Weight = w; } } I'd like to randomly select a Broker from an array, taking into account their weights. What do you think of the code below? class Program { private static Random _rnd = new Random(); public static Broker GetBroker(List<Broker> brokers, int totalWeight) { // totalWeight is the sum of all brokers' weight int randomNumber = _rnd.Next(0, totalWeight); Broker selectedBroker = null; foreach (Broker broker in brokers) { if (randomNumber <= broker.Weight) { selectedBroker = broker; break; } randomNumber = randomNumber - broker.Weight; } return selectedBroker; } static void Main(string[] args) { List<Broker> brokers = new List<Broker>(); brokers.Add(new Broker("A", 10)); brokers.Add(new Broker("B", 20)); brokers.Add(new Broker("C", 20)); brokers.Add(new Broker("D", 10)); // total the weigth int totalWeight = 0; foreach (Broker broker in brokers) { totalWeight += broker.Weight; } while (true) { Dictionary<string, int> result = new Dictionary<string, int>(); Broker selectedBroker = null; for (int i = 0; i < 1000; i++) { selectedBroker = GetBroker(brokers, totalWeight); if (selectedBroker != null) { if (result.ContainsKey(selectedBroker.Name)) { result[selectedBroker.Name] = result[selectedBroker.Name] + 1; } else { result.Add(selectedBroker.Name, 1); } } } Console.WriteLine("A\t\t" + result["A"]); Console.WriteLine("B\t\t" + result["B"]); Console.WriteLine("C\t\t" + result["C"]); Console.WriteLine("D\t\t" + result["D"]); result.Clear(); Console.WriteLine(); Console.ReadLine(); } } } I'm not so confident. When I run this, Broker A always gets more hits than Broker D, and they have the same weight. Is there a more accurate algorithm? Thanks!
I need an independent QR scanner in my app, so I've added the zxing library to my Android app - I've followed this - I added the dependencies in build.gradle, and this is how I call the method: btnScanQR.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { new IntentIntegrator(MainScreenActivity.this).initiateScan(); // `this` is the current Activity } }); // Get the results: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); if(result != null) { if(result.getContents() == null) { Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show(); } else { Toast.makeText(this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show(); } } else { super.onActivityResult(requestCode, resultCode, data); } } So it's basically exactly like on their github page, so there shouldn't be any problems, right? However, I get this error when I try to open the scanner through my app, and I can't seem to find any solutions online to this exact problem: CameraInstance: Configuring camera W/CameraManager: Failed to set rotation. W/CameraManager: Camera rejected even safe-mode parameters! No configuration E/CameraInstance: Failed to configure camera java.lang.NullPointerException: Attempt to invoke virtual method 'android.hardware.Camera$Parameters android.hardware.Camera.getParameters()' on a null object reference at com.journeyapps.barcodescanner.camera.CameraManager.setParameters(CameraManager.java:353) at com.journeyapps.barcodescanner.camera.CameraManager.configure(CameraManager.java:139) at com.journeyapps.barcodescanner.camera.CameraInstance$4.run(CameraInstance.java:171) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61) D/CameraPreview: pause() D/CameraInstance: Closing camera D/CameraPreview: pause() What is the cause of this (is it because it fails to rotate?) and how could I fix this? I've tried changing the orientation like it says on zxings github page with this: <activity android:name="com.journeyapps.barcodescanner.CaptureActivity" android:screenOrientation="fullSensor" tools:replace="screenOrientation" /> IntentIntegrator integrator = new IntentIntegrator(this); integrator.setOrientationLocked(false); integrator.initiateScan(); But I keep getting the same error! Please help :(
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 using Ubuntu 14.04 (Trusty) I need to install Msn - the Windows version of MSN, but can only find Amsn which is not what I need. Is there a way to install Windows's Msn?
Can .exe and .msi files (Windows software) be installed in Ubuntu?
I am working with Drupal Commerce to create an e-Commerce store. However, I am having some trouble with my client's gateway of choice, First Data. I have everything set up as directed (I believe) but when I try to submit an order the page times out and I am given this error message. (This happens if I am testing a transaction live, test authorized, or test denied) PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6 {s:5:"%type";s:6:"Notice";s:8:"!message";s:27:"Undefined index: order_num";s:9:"%function";s:33:"firstdata_cc_submit_form_submit()";s:5:"%file";s 87:"/home/betads/public_html/sites/all/modules/commerce_firstdata/commerce_firstd ta.module";s:5:"%line";i:380;s:14:"severity_level";i:5;} [:db_insert_placeholder_4] => 5 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => https://beta.designsenseinc.net/checkout/7/review [:db_insert_placeholder_7] => https://beta.designsenseinc.net/checkout/7/review [:db_insert_placeholder_8] => 166.147.79.6 [:db_insert_placeholder_9] => 1330630525 ) in dblog_watchdog() (line 157 of /home/betads/public_html/modules/dblog/dblog.module). Any idea what could be the issue? To test for yourself, you can visit and add the product to cart. Any help appreciated.
Recently I started getting an error every time I try and add a content no matter what type. This is the error that shows up in the browser: Additional uncaught exception thrown while handling exception. Original PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT COUNT(cid) FROM {comment} WHERE status = :status; Array ( [:status] => 0 ) in comment_count_unpublished() (line 313 of /Applications/MAMP/htdocs/modules/comment/comment.module). Additional PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:154:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT COUNT(cid) FROM {comment} WHERE status = :status; Array ( [:status] => 0 ) ";s:9:"%function";s:27:"comment_count_unpublished()";s:5:"%file";s:56:"/Applications/MAMP/htdocs/modules/comment/comment.module";s:5:"%line";i:313;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => ; [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 127.0.0.1 [:db_insert_placeholder_9] => 1338336955 ) in dblog_watchdog() (line 154 of /Applications/MAMP/htdocs/modules/dblog/dblog.module). I also get the following error in my php error file: PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /Applications/MAMP/htdocs/includes/database/database.inc:2136 Stack trace: 0 /Applications/MAMP/htdocs/includes/database/database.inc(2136): PDOStatement->execute(Array) 1 /Applications/MAMP/htdocs/includes/database/database.inc(664): DatabaseStatementBase->execute(Array, Array) 2 /Applications/MAMP/htdocs/includes/database/database.inc(2315): DatabaseConnection->query('SELECT expire, ...', Array, Array) 3 /Applications/MAMP/htdocs/includes/lock.inc(167): db_query('SELECT expire, ...', Array) 4 /Applications/MAMP/htdocs/includes/lock.inc(146): lock_may_be_available('theme_registry:...') 5 /Applications/MAMP/htdocs/includes/theme.inc(447): lock_acquire('theme_registry:...') 6 /Applications/MAMP/htdocs/includes/bootstrap.inc(427): ThemeRegistry->set(Array) 7 [internal function]: DrupalCacheArray->__destruct() 8 {main} thrown in /Applications/MAMP/htdocs/includes/database/database.inc on line 2136 I am having a little trouble deciphering these error messages. Could anyone help me understand what's going on here?
Why does Stack Overflow require a contributor to have 50 reputation points before allowing to comment? I wanted to answer a problem that many have in Visual Studio with performance but I can't add my comment. I find it not only annoying that I can't contribute. Why should I come back and try to help others on this site if I'm not allowed to? Doesn't that defeat the purpose of this site?
Users with less than 50 reputation points cannot write comments on questions and answers that they don't own. Why does this limit exist? But I want to contribute now. What should I do instead? But I can't write a good answer without more information! Shouldn't I be allowed to post comments if I have reputation on a different site? But I saw a new user posting a comment! How did they do it? Why do I need 50 reputation to comment on my own post? See also: in the Help Center
I followed an online tutorial! All I had to do was replace Windows 8 with Ubuntu and the tutorial clearly said that you choose 'Replace OS with Ubuntu' during installation. That option was not available but the installation had one "use entire disk and install Ubuntu, this will delete your files and programs in all your operating systems" Windows is the only Operating System and Ubuntu has wiped my whole disk now on Ubuntu, the command mount on terminal gives me this NAME FSTYPE SIZE MOUNTPOINT LABEL sda 298.1G ├─sda1 ext4 294.2G / ├─sda2 1K └─sda5 swap 3.9G [SWAP] sr0 1024M It only shows one 298 GB partition. I had very very important data on my partitions. Ebooks,Important Pictures I had collected through out the years (I am a self learned programmer). Yes, I know I Should have created a back up but I did not. My system is a laptop. How can I retrieve my Lost data from this partition?
I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions (C:) Vista (D:) Entertainment (E:) Work (F:) Sources and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB. I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse? I need these data badly as I don't have a backup for them.
If all beings, regardless of their good-evil alignment, can find the cause and origin of all things to lie ultimately in Illuvatar, then can it be said that Morgoth - and other Ainur who went rogue - are ultimately acting by Illuvatar's will, and therefore will have a place in the Second Music and in Arda Reborn?
Did Ilúvatar know that Melkor would 'turn bad'? Was it part of his vast design? Tolkien often hints that also Morgoth's evil is part of the grand plan, and that he does the will of Ilúvatar in the long run, despite opposing him. But why did he oppose Ilúvatar in the first place? Why did Ilúvatar make someone who would oppose him? Surely THE God would have complete control and knowledge.
is there such way/method/strategy to detect if the downloading of a file is finished?..my problem is like this. Scenario: when click the report generator button, a loading wheel icon appears because it takes a while to generate the spreadsheet...and now, when the download has finished and the spreadsheet was saved in the client's machine, the loading wheel icon is still there spinning.. the only way that I think of to remove that spinning wheel is by detecting if the downloading is finished and then hide the spinning wheel ..so how ? :confused: PLEASE TAKE NOTE BEFORE MARKING MY QUESTION AS DUPLICATE: when i push the button, I am writing a file in the spreadsheet before it automatically/forcefully gets downloaded. it's not like the typical downloading of a static file
I've got a php page which handles requets for file downloads. I need to be able to detect when a file has been downloaded successfully. How can this be done? Perhaps there's some means of detecting this client-side then sending a confirmation down to the server. Thanks. Edit: By handle, I mean that the page is doing something like this: $file = '/var/www/html/file-to-download.xyz'; header('Content-Type: application/octet-stream'); header('Content-Length: ' . filesize($file)); header('Content-Disposition: attachment; filename=' . basename($file)); readfile($file);
I first saw the idea on a different question. Can't remember where exactly it was. It may even have just been a joke but the idea seems interesting, although there's probably a very delicate border between this being tasteful vs annoying. More specifically, would it be possible to to be a, for example, chaotic evil wizard but have the party convinced that you're a good-aligned bard or other? Assume the DM knows what you're doing. It's the rest of the party you're trying to fool. Also note: this idea is not meant for a long-run campaign. It's for a campaign meant to last two or three sessions max. Another edit: Wizard/Bard is not set in stone. We currently aren't too sure what classes would make this easiest to pull off, but the short nature of the campaign makes us believe that lying about the character's class might be doable.
Basically, my character would be evil in secret until she could do a huge emotional betrayal and try to kill everyone. I'd have to lie to my friends and make up two separate character sheets if I did this - after all, even the least metagame-y people would change their reactions slightly if they knew one of their fellow travelers was evil. But it would be for the sake of the most epic betrayal ever and I'm pretty sure they would appreciate the cunning of it once they found out. Is secretly playing an evil character against D&D etiquette? Are there other ways to play an evil character in a good campaign, to avoid metagaming by the other players?
Please help me out to find the limit of this series $$\lim_{n\to \infty} \sum_{i=0}^n e^{-n} \frac{n^i}{i!} $$ Upper Limit is easy to find , how to find exact limit
I'm supposed to calculate: $$\lim_{n\to\infty} e^{-n} \sum_{k=0}^{n} \frac{n^k}{k!}$$ By using WolframAlpha, I might guess that the limit is $\frac{1}{2}$, which is a pretty interesting and nice result. I wonder in which ways we may approach it.
Check via if condition that variable named "var" contains the contents of variable "value" and "var" must have more than 113,469 characters above described conditions are met, the script must then print last 20 characters of the variable "var". I am stuck at this question from a HTB Academy tutorial and tried out by different ways but still no luck with solution. Any help? #!/bin/bash var="8dm7KsjU28B7v621Jls" value="ERmFRMVZ0U2paTlJYTkxDZz09Cg" for i in {1..40} do var=$(echo $var | base64) #<---- Need to frame an if condition here: done
I have a string in Bash: string="My string" How can I test if it contains another string? if [ $string ?? 'foo' ]; then echo "It's there!" fi Where ?? is my unknown operator. Do I use echo and grep? if echo "$string" | grep 'foo'; then echo "It's there!" fi That looks a bit clumsy.
I understand that the function of melanin is to protect individuals from sunlight, and that people living in sun exposed areas are darker due to increased production of melanin. But why is the melanin pigment black in color? Wouldn't it have been more useful if melanin was white? From my understanding, black absorbs more sunlight than white, so if melanin is black, it will tend to absorb more heat (which isn't a good thing in areas with a lot of sun exposure). This will lead to production of more melanin (tanning). Instead, evolutionarily wouldn't it have made more sense if melanin were white, since not only would the pigment protect the person from sun exposure, but also prevent more sunlight from being absorbed?
I don't understand why darker skin is advantageous in hotter climates. Wouldn't it absorb more of the heat? I have heard that it reduces the incidence of cancer, but I would think absorbing more radiation would increase the risk?
I'm taking a basic topology course, and studying for my exam, I'm stuck with an exercise that I'm not sure how to do it. Says the following: Show that the $ \mathbb{R}^ 2 - {(0,0)} $ plane is a homeomorphism at $ S ^ 1 \times (0, \infty) $ I took the function $f:\mathbb{R}^ 2 - {(0,0)} \rightarrow S ^ 1 \times (0, \infty) $, $f(rcost,rsent)= ((cost, sent), r)$ But I'm not sure if I defined it correctly, even I do not know how to prove it is a homeomorphism. Could you give me a suggestion? Greetings.
Are there any specific 'tricks' or 'techniques' in finding homeomorphisms between topological or metric spaces? I'm trying to construct a homeomorphism between $\mathbb{R} \times S^1 \to \mathbb{R}^2 \setminus \{(0,0)\}$ but I'm having trouble even visualizing how this is going to work. I'm thinking some sort of stereographic projection from the circle and then including the $\mathbb{R}$ somehow but I'm stuck. Any ideas?
Imagine someone who, in every way, always tries to improve things to make them more efficient. Therefore, he loves things such as the automation of work because its more efficient. He loves tinkering with things to make them better and hates when things are being done in a certain way when another way exists that would make things faster, clearer, or in some way perform better. Another example is this person might think the English language should include various proposed punctuation marks such as the irony mark and the authority mark because this would, in his eyes, improve the language. He treats all subjects like this; he always will always look for and advocate for changes in any system to improve it, disregarding traditions or norms as he does so. I'm not looking for 'perfectionist'; this person doesn't strive necessarily for perfection, but rather sees improvement as an obvious goal that should be worked toward. Nor am I looking for a word such as determined, motivated, or go getter. I'm looking for a word that focuses on one's obsession for improvement and efficiency. Any word (noun, verb, or adjective) related to this concept would be appreciated!
I need to find or invent a word that suggests a system might be "adapted or improved to conform to a higher standard". A verb, noun, adjective or even adverb would be acceptable, but so far I haven't found quite what I'm looking for. Context Examples: "We are upgrading the current system for greater Enterprise [conformity to a higher standard]." "I believe we need to change our approach. We need to [adapt to conform to a higher standard]." "It will take some time to write an article that's more [improved to conform to a higher standard] than I've written before."
Let $A$ and $B$ be two closed subsets of the set of real numbers. Define $A+B=\{a+b\in\mathbb{R}:a\in A ,b\in B\}$. Is it true that $A+B$ is closed in $\mathbb{R}$? If not, could you give a counter-example?
Is there a counterexample for the claim in the question subject, that a sum of two closed sets in $\mathbb R$ is closed? If not, how can we prove it? (By sum of sets $X+Y$ I mean the set of all sums $x+y$ where $x$ is in $X$ and $y$ is in $Y$) Thanks!
Using $$(a+b)^{n} = \sum_{i=0}^n {n \choose k} a^{n-k} b^{K}$$ prove that $$n^{1/n} - 1 \le \sqrt{\frac 2n}$$ for n= 2,3,4.... I know the first step is to set $$ n^{\frac 1n} = 1 + x $$ for some x>0 and then raise both sides to the n, but I'm lost after that.
I am having difficulty proving the following inequality: $$ \sqrt[n]{n} < 1 + \sqrt{\frac{2}{n}} \quad \text{for all positive integers}\,\,\, n. $$ I am trying to use mathematical induction but I am having trouble going from the left side to the right side (in the induction step) and vice versa. I also tried to take the power of $n$ on both sides and somehow use the binomial expansion but I am having difficulty with that. Thank you!
There is a file which was already committed and pushed to the repo. Now I want it to be ignored after initialization, which means that everyone can fetch this file from remote but local change will be ignored unless ones force-add it again and will not be shown in git status. It is just like an untraced file except it can be fetch from remote. I have had some try to solve it. git rm --cache theFile. The file will be removed from repo by this command and can't be fetched any more. So it's NOT the correct answer. git update-index --assume-unchanged theFile. The file will disappear from git status, which is what I need. But it's a local command. Others should call it manually. Also, the git index will change after some command so ones should call it again. It not quiet fit my demand. Is there a perfect solution?
Let's say you have a typical web app and with a file configuration.whatever. Every developer working on the project will have one version for their dev boxes, there will be a dev, prod and stage versions. How do you deal with this in source control? Not check in this file at all, check it with different names or do something fancy altogether?
When a person walks (assuming the feet don't slip), the ground is pushed backward by the foot while the force of static friction opposes the force and the foot remains stationary while the upper body moves. - This is what I've understood. However, the upper body moves - I believe, since the foot exerts a force backward and the person moves forwards, the work done by the body must be negative, while, since friction acts along the direction of motion, the work done by it should be positive. These two negative and positive forces must cancel each other out, so the net work done while walking is zero. Could someone please explain if this right or wrong?
While walking, the work done by friction is zero. But who does the work, actually? How someone is getting displaced? This situation also arises when someone climbs without slipping or is climbing a ladder.
Neither did our professor nor book give a proof of this fact, but just in case I need to know that.
Given two square matrices $A$ and $B$, how do you show that $$\det(AB) = \det(A)\det(B)$$ where $\det(\cdot)$ is the determinant of the matrix?
How do I make a link which navigates the user back one page (i.e. same as clicking browser back)? Thanks.
how would one implement a back-button as a commandbutton that works universally? with back button i don't mean the browser-button, but rather a button that sits somewhere on the page. it is not always possible to use the Post-redirect-get pattern. its quite impractial to pass around the information on every single where the button should point to. is there maybe a reserved keyword for a navigation rule that points to the last navigation rule applied?
How to prove the equation below in a simple way? $$\min_{\mu}\sum_{i=1}^n|y_i-\mu|=\text{median}\{y_1,\cdots,y_n\}$$
Suppose we have a set $S$ of real numbers. Show that $$\sum_{s\in S}|s-x| $$ is minimal if $x$ is equal to the median. This is a sample exam question of one of the exams that I need to take and I don't know how to proceed.
As stated, I need to change the spacing between the top of the page, the chapter name and title. I'm currently using \allsectionfont{\centering \fontsize{15}{15}\selectfont} to control the size and where they are placed. There is still a huge gap between where it says "Chapter 1" and the top of the page, as well as a gap between "Chapter 1" and the name of the chapter. How can I make this gap vanish?
I am using LaTeX to write my dissertation, and I have realised that on the table of contents and on every chapter page, LaTeX leaves a lot of empty space. What I mean is that lets say in the page where chapter 1 begins, from the top of the page until the chapter title there is much more vertical space than on any other page. The same goes with chapter 2 etc... and for contents page as well. Can anybody help me to remove that space? Is there any mistake in my code or something like that? Is this a default of LaTeX? the preamble is \documentclass[12pt,twoside]{report} \pagestyle{plain} \usepackage{a4paper} \usepackage{setspace} \doublespacing \usepackage{amssymb} \usepackage{amsmath} I've tried the methods below, but none of them work properly.
I have two list of same length l1=[reboot,revision,disk_space] and l2=[no,12.15,4300] I want to make these two list as key-value map. Output should be like this [reboot:no,revision:12.18,disk_space:4300].. I tried Zip it is not working
Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam'] What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}
Consider the function $f(x,y)=\begin{cases} \frac{xy}{x^2+y^2}, & \text{if $(x,y)\ne(0,0)$}\\ 0, & \text{otherwise} \end{cases}$ Question: Is it differentiable everywhere? Does it have partial derivatives everywhere? My attempt: $f$ is differentiable on $\Bbb R^2\backslash\{(0,0)\}$ because it is the ratio between two differentiable functions and the denominator doesn't vanish. Is it still the case in $(0,0)$? If we write $x=r\cos\theta$ and $y=r\sin\theta$ then the function becomes $\begin{cases} \frac{r^2\cos\theta\sin\theta}{r^2} & \text{if } r\ne0 & \\ 0 &\text{if } r=0 \end{cases}$ = $\begin{cases} \cos\theta\sin\theta & \end{cases}$ We realize that $f$ doesn't depend on the radius, so the fact that $f(1,1)=1/2\ne-1/2=f(-1,1)$ so we can approach zero by decreasing the radius and preserving the values $1/2$ and one hand and $-1/2$ on the other. So the function is discontinuous at zero, so not differentiable. Does it have partial derivatives everywhere? $$\frac{\partial f}{\partial x}=\lim_{h\to\ 0}\frac{f(h,0)}{h}=0$$ $$\frac{\partial f}{\partial y}=\lim_{h\to\ 0}\frac{f(0,h)}{h}=0$$ So the partial derivatives exist in zero and elsewhere.
Let $F:\mathbb{R^2}\rightarrow \mathbb{R}$ be a function, such as : $$F(x,y)=\begin{cases} 0 & (x,y)=(0,0) \\ \frac{xy}{x^2+y^2} & (x,y)\neq (0,0) \end{cases}$$ Is $F$ differentiable at $(0,0)$? My attempt : Consider the limit, $\lim_{(x,y)\rightarrow (0,0)} F(x,y)$ along the line $y=x$. The limit equals to $\frac{1}{2}$. However, $F(0,0)=0$. Hence $F$ is not continuous at $(0,0)$ which implies that $F$ isn't differentiable as well. Is this approach okay ?
Let, $n\in \mathbb{N}$ and $p$ be a prime. If $f(x)=\sum_{i=1}^{r} a_{i} x^{i}$ and $g(x)=\sum_{i=1}^{s} b_{i} x^{i}$ be polynomial in $\mathbb{Z}_{p^{n}}$ such that $f(x)g(x)=0$ , (1) $a_{i} b_{j} =0$,for all $i,j$ (2) $a_{i} b_{j} \neq 0$,for some $i,j$ My try, $a_{1} b_{1}=0 $ Either $a_1=0$ or $b_1=0$ or they are divisor of zero. Then $a_{1} b_{2}+a_{2} b_{1}=0 $ Now, if $a_1=0$, then $a_{2} b_{1}=0 $ After, $a_{1} b_{3}+a_{2} b_{2}+a_{2} b_{3} = 0 $ If, $a_1=0$ then $a_{2} b_{2}+a_{2} b_{3} = 0 $ My thought here, if $\mathbb{Z_{p^n}}$ is $\mathbb{Z_2} $ here, then, I think option (2) is true if we take all of $a_2,b_2,b_3$ non zero. But is option (1) the answer? I am really in doubt here. Please anyone help!
Let $n \in \mathbb{N}$ and $p$ be a prime number. Let $f(x),g(x) \in \mathbb{Z}_{p^n}[x]$ such that, in $\mathbb{Z}_{p^n}[x]$, $f(x)g(x)=0$. Prove that $a_ib_j=0$ for all $i,j$, where $a_i$ and $b_j$ are the coefficients of $f(x)$ and $g(x)$. I have the set of equations (for degree $r$ and degree $s$): $$a_rb_s=0, a_rb_{s-1}+a_{r-1}b_s=0,...,a_0b_0=0.$$ From these, how do I conclude $a_ib_j=0$ for all $i,j$? Also, I found that for $n=1$, the polynomial ring is an integral domain, so the conclusion holds. I had an idea to use induction on $n$, but do not know how to proceed.
On sharelatex.com the Russian em dash works fine in document body, but does not work when used in macros. I tried to ask the support, they sent me here. Code: \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T2A]{fontenc} \usepackage[russian]{babel} \pagestyle{empty} \def\foo{ qwe "--- rty } \begin{document} \foo asd "--- fgh \end{document} Result:
The package babel with the ngerman option (and most other languages as well, but not english) provides the shorthand "|, which prevents a ligature at the given position (see p. 81 of the , e.g. Auf"|lage will result in the word Auflage without an fl-ligature (as is desired because, in German, you don't want ligatures across morpheme borders). However, when placed in a macro, "| doesn't work anymore. Why is this and how can I circumvent it? \documentclass{article} %\usepackage[T1]{fontenc}% doesn't help \usepackage[ngerman]{babel} \newcommand{\foo}{"|} \begin{document} ff f"|f f\foo f \end{document}