How can I create a smooth looping animation for cloth simulation?

I have created a waving flag simulation by pinning a set of points, adding cloth physics, and setting up wind forcefields. The result is just fine when I render the scene except that I want the resulting png files to be a continuously looping animation.  The resulting animation is currently jumping when the loop transitions from the last frame to the first frame.  I have tried exporting to lightwave format, importing it back in and inserting appropriate shapekeys to get an interpolation between the last and first frame, (as described ), but it seems the export-import step messes up both the orientation and the basis for the shape keys. I tried  twice and I also tried using a custom plug-in that ,  but my shape keys at 1.0 value are always stretched out and rotated compared to the same shape key at 0.0.  The result is that after interpolation, the flag not only waves, but also rotates and stretches.  I am thinking about trying one of the following routes:   Somehow edit the necessary shapekeys at value 1.0 so that it matches the orientation and rotation at 0.0.  Look into the export-orientation problem and see if I can fix it myself. Try to morph from last frame to first frame of the rendered result using some other tool.   What do you think is the easiest and best way to go to get a nice loop transition?  Edit:  After trying sambler's suggestion using two modifiers with varying influence in the transition between last and first frame, the mesh seems to be rotated and scaled in the frames where the modifier influence is interpolated.


How do I know what service is running on a particular port in linux?

I am trying to run weblogic server on my linux machine and I am getting the following error :  ERROR: transport error 202: bind failed: Address already in use ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690] FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)   I think that the error means that the debugger port which by default is 8453 is already held by some other service . How can I find out what service is runnning in a partcular port number ?  P.S: I used netstat command but that shows all the services occupying all ports ..here I am interested in a particular port only.


Let $X$ be a separable normed space. Is it true that every subspace is separable? If it was Hilbert space I would take the dense set and then their projections.  It sounds trivial but I cannot prove or disprove it...  Thank you.


Advantages and disadvantages of Logical Volume Manager (LVM)? And LVM vs encrypted LVM?

In my situation, it's for a local build/staging server running ubuntu server. Things I'd like to know are:  Why I should/shouldn't use LVM?  What problems might it cause in terms of either regular server operation or things I might want to do later? (ex. partitioning)  Why I should/shouldn't use encrypted LVM instead of LVM?  What problems might encrypted LVM cause in terms of either regular server operation or things I might want to do later? (ex. partitioning)


How do i concatenate these two arrays to get the expected output?  let bidder= [   [1,2,3,4],   [5,6,7,8] ]  let arr1 = [9,10,11,12]    expected result  [ (4) [...], (4) [...], (4) [...], ]


What's the easiest way to play a sound file (.wav) in Python? By easiest I mean both most platform independent and requiring the least dependencies. pygame is certainly an option, but it seems overkill for just sound.


How to construct a proof of $A = (A\cap B)\cup (A-B)$?

Constructing a Venn diagram is not enough as a proof, how would I go about actually proving $A = (A\cap B)\cup(A−B)$?


What advantage do I get by evolving my Pokemon?

I know that if I postpone my Pokemon's evolution, I can learn certain moves earlier. For example, Mareep learns Thunder at level 55 while its fully evolved form, Ampharos, only gets it at level 79.  Obviously, Pokemon who change types by evolving get the benefits of their new type, but for everything else, why should I evolve early as opposed to waiting for good attacks?


What spell slot count formula can I use to base my homebrew mechanic on?

I've noticed that for full table magic users (spells going up to 9th level), a new level spell slot opens up every two levels, it goes like this up until level 17 where it caps off at that point assumedly since there are no 10th level spell slots to be gained on levels 19 and 20.  It looks like there's some math going on behind the scenes here so I was wondering if anyone has had a crack at this and figured how similar tables could be constructed for homebrew content?  Context: I'm brewing together a system for a sorcerer which requires them to keep using spells to discharge their inner magic on a daily basis or risk their magic overflowing and potentially causing hilarious terrible things to happen to them and/or their party. I've got the capacity and mechanics down I just now need to figure out a way to keep the discharge effort consistent with the sorcerer gaining more and higher level spells as they level up.  To clear up some confusion I'll give an example situation.  Let's make it relatively simple and say I want a sorcerer to spend half of his magic every day or else he catches fire.  For 1st and 2nd level it's pretty straightforward:   1st level - player has two 1st level slots, has to use one to achieve 50% 2nd level - player has three 1st level slots, has to use two to achieve at least 50% 3rd level - this is where the problems start, player now has four 1st level slots and two 2nd level slots, using two 1st level spells and one 2nd level spell would be 50%, but what if they cast four 1st level spells, would that be the same? Is a 2nd level spell slot really twice as good as a 1st level spell slot? What about 3rd level spell slot?   I was looking for a mathematical formula which would detail the growth in slot amount and level to then perhaps somehow be able to extract an intrinsic value of a spell slot level, which would then allow me to assign a numerical figure to a casters spell budget, which I would be able to then apply percentage based goals upon.


I want to ask a question on the music stack exchange about my voice and I'd like to upload and MP3? Is this possible?


I  have a Lenovo IdeaPad 100s that  came  with  win 10 installed. That  os occupies the  majority  of  the ssd  drive. Constant persistant  ridiculous  harrassment  to  upgrade  win10 which  requires  8 gigs when there is  only  1.8 gigs  free space despite  no  significant  files has  led  me to  want to  eliminate  win10 in favour of  Linux. But despite  having a verified  usb iso  win10  seems  to  overide  any attempt at an external boot. I would like  someone  to point  me to a download os  wiper that is  simple to use.


How do I do a case-insensitive string comparison?

How can I do case insensitive string comparison in Python?  I would like to encapsulate comparison of a regular strings to a repository string using in a very simple and Pythonic way. I also would like to have ability to look up values in a dict hashed by strings using regular python strings.


Can a 2 mp camera produce a 2 mb sized file?

Yesterday I was taking some photos with my old phone, the Nokia C3-00. It has a 2 megapixel camera and usually creates images somewhere between 400kb - 800kb in size. Yesterday, though, it produced an image with more than 2 mb size of image, not just one but 4-5 images. Although all the images are corrupted and didn't open properly, the size of the images are 4-5 mb.  Is this possible? What could have happened here?


why is DNA antiparallel? Can it be parallel?

My biology textbook mentions that DNA is antiparallel and it got me wondering... Can DNA be parallel? What would happen if it was parallel? could DNA still replicate right?


When to use LinkedList over ArrayList in Java?

I've always been one to simply use:  List<String> names = new ArrayList<>();   I use the interface as the type name for portability, so that when I ask questions such as these I can rework my code.    When should  be used over  and vice-versa?


Tasksel removed everything in my Ubuntu - how can I recover it?

I accidentally removed Lubuntu in tasksel. How do I recover it through login shell?  My problem is I can't connect to a network to be able to download the Ubuntu desktop.


Regular Expression search of a PCAP file

We have been given a PCAP file and my job is to find:   The user of the host PC tried to access some suspected website whose domain name ends with .top. Use Python (with the help of Regular Expression) to find the susceptible website.  By opening the PCAP file on notepad and doing a Ctrl + F search through it I have already found the correct answer to be:   However this is obviously not the purpose of the assignment as I have to use Python and Regular Expression to return that website  The code I have tried so far is:  import re  pcapfile = open('CyberSecurity2019.pcap', 'rb')  mypattern = re.compile(rb"\S+\.top\b")  x = mypattern.findall(pcapfile.read())  print("x = ", x)   However this is what it returns:  x =  [b"c('_SS','R','20',0,'/');f=_w.top", b'g_triggerElems!==e&&(g_triggerElems[i].isHotSpotDisabled=!1);v=i+1,r=s[i],a=_ge("sc_hst"+v),a.style.left=r.locx+"%",a.style.top', b't=u.getBoundingClientRect(),o=t.width?Math.abs(t.right-t.left):t.width,a=s(u,"paddingLeft");o=o-(a?parseInt(a):0);v=t.height?Math.abs(t.bottom-t.top', b'n=document.getElementById(keyMap.Notification),t;n&&(n.parentNode.removeChild(n),t=document.getElementById("id_h"),t&&(t.style.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top', b'http://p27dokhpz2n7nvgr.1jw2lx.top', b'p27dokhpz2n7nvgr.1jw2lx.top']   and that goes on and on for a while.  Any help in setting me on the right track would be appreciated.  Thank you


How do we know that $SU(3)$'s generators are Gell-Mann matrices?

The textbook told us the $SU(3)$'s generators are Gell-Mann Matrices, but it didn't show me where   these eight generators come from?


Will adding more recruitment beacons make settlers come more often?

In a settlement, if I have one recruitment beacon, settlers don't come very often. If I add another one, will settlers come more often than if I have one?  .  NOTE:  I'm not sure if you actually can do more than one. I am asking this question to see if I should make another, or if it will be pointless.


I tried to add driver to Sphere's RotateX and link it with Cube's LocationX.  However, as shown in the image below, the driver value is 4.651, but the Sphere RotateY is 266.    The value of the driver will be regarded as radians without permission.   I created and tried the following Expression and it worked correctly, is this method recommended by Blender?  var * (3.1415/180)


I destroyed all the cultists near the tablet but the lunatic cultist won't spawn. I have checked everywhere to see if there are any left (including down the hole). I have provided a screenshot of it to show what I mean...    I need help because I would like to be able to use this world for pillar destroying as I prepped it for use on the pillars. I even made an AFK Moon Lord area so I could focus on just the pillars.


What is ~/core and why does it use ~2gbs of space?

I have recently noticed that my Ubuntu system has been slowly filling up a file called ~/core  -rw-------  1 tom  tom  2.4G Feb  1 18:08 core   It has recently reached 2.4G in size.  It contains many lines like this:  ��9��6����6�I��6�Cu���~I:��e���x86_64/snap/pycharm-professional/179/jbr/bin/java-classpath/snap/pycharm-professional/179/lib/bootstrap.jar:/snap/pycharm-professional/179/lib/extensions.jar:/snap/pycharm-professional/179/lib/util.jar:/snap/pycharm-professional/179/lib/jdom.jar:/snap/pycharm-professional/179/lib/log4j.jar:/snap/pycharm-professional/179/lib/trove4j.jar:/snap/pycharm-professional/179/lib/jna.jar-Xms128m-Xmx1995m-XX:ReservedCodeCacheSize=240m-XX:+UseConcMarkSweepGC-XX:SoftRefLRUPolicyMSPerMB=50-ea-XX:CICompilerCount=2-Dsun.io.useCanonPrefixCache=false-Djava.net.preferIPv4Stack=true-Djdk.http.auth.tunneling.disabledSchemes=""-XX:+HeapDumpOnOutOfMemoryError-XX:-OmitStackTraceInFastThrow-Djdk.attach.allowAttachSelf=true-Dkotlinx.coroutines.debug=off-   I can't seem to find any information about this file online.  Is it safe to delete this file or symlink it to /dev/null?


Is it OK to put a sleeping MacBook pro (Mid 2015) in your backpack and carry around?

Is it OK to put this MacBook Pro in my backpack to carry around?   Appreciate hardware analysis.


I have to do the following question:  Given a unital ring $R$ and a natural number $n$ $\geq 1$, identify (with proof) the prime ideals of the matrix ring $\mathbb{M}_{n}(R)$.  I understand the theory, but putting it all together is proving difficult.   I understand that the prime ideals of $\mathbb{M}_{n}(R)$ should be $\mathbb{M}_{n}(\mathbb{P})$.  Can anyone suggest any steps as to how to prove this?


Dont know where to connect HD AUDIO or AC-97, & USB

I'll provide pictures so you guys can see,  but basically I recently bought a new case for my pre built . I cannot find how I'm supposed to position the connectors.   Do I need to get an entirely new motherboard? Is there any adapter I can buy?  Any help is welcome.


What is the best way to open a file for exclusive access in Python?

What is the most elegant way to solve this:   open a file for reading, but only if it is not already opened for writing open a file for writing, but only if it is not already opened for reading or writing   The built-in functions work like this  >>> path = r"c:\scr.txt" >>> file1 = open(path, "w") >>> print file1 <open file 'c:\scr.txt', mode 'w' at 0x019F88D8> >>> file2 = open(path, "w") >>> print file2 <open file 'c:\scr.txt', mode 'w' at 0x02332188> >>> file1.write("111") >>> file2.write("222") >>> file1.close()   scr.txt now contains '111'.  >>> file2.close()   scr.txt was overwritten and now contains '222' (on Windows, Python 2.4).  The solution should work inside the same process (like in the example above) as well as when another process has opened the file. It is preferred, if a crashing program will not keep the lock open.


Who delivered Amidala's body back to Naboo?

In Revenge of the Sith, after first being Force-choked by Anakin and then given births to Luke and Leia, Padme Amidala eventually lost her life on Polis Massa. We later, however, see her in the funeral procession on Naboo. The question is, how did she get there?    I mean, whoever delivered her there must have faced a lot of difficult questions, not just from her family but also from both the people and the authorities, since she was the former queen of the planet. Whoever it was, he could not have been just somebody, because it most certainly must not have been an easy task. It most likely was not any of the Jedi, since the world was probably half full of Palpatine's collaborators who would have immediately given them away.  So, who was it? And how was it carried out, in practice?


Can I remove the useless click when switching monitors?

I have 2 monitors on a Mac Mini (El Capitan) both plugged via HDMI.  Whenever I move the mouse from one monitor to the other, I cannot directly interact with the applications on the screen where the mouse is. I must first click on the mouse.  Weirder still, this does not apply for right-clicks. If I move the mouse to another monitor, I can for instance right-click on a Finder window and create a new folder. But I will not be able to type the folder name.  I would like to be able to use both monitors seamlessly: is it possible?  Edit  This question was incorrectly flagged as a duplicate of .  I am not trying to "bring a window topmost" when I move the mouse over it.  I would like to be able to interact with any graphical interface on any of my monitors in a normal fashion, without the extraneous click currently required when moving the mouse to a different monitor.  Doing the following has no effect (as far as I can tell)  defaults write com.apple.Terminal FocusFollowsMouse -string YES defaults write com.apple.x11 wm_ffm true   Note  I am currently using El Capitan but I am able to upgrade to Sierra. I could also install a third-party app, though I would prefer a native solution.


How does virtualizing differ from emulation, in terms of structure?

Someone told me that a virtualizing program like VirtualBox does not work like an emulator does in the sense that it doesn't emulate registers and uses the actual ones for the virtualized data that are on the CPU. Emulators must emulate the registers since they are mostly to execute software that depends on a foreign environment (e.g. a Genesis emulator needs Motorola 68000's registers and memory addresses, so developer must make these resources available as emulated registers).  My main question is, how is virtualization developed? How do we enable an entire OS to run as a process in a virtual machine, but get it to run independently while still making use of the actual CPU? I only know emulation, not virtualization, so if anyone could help that'd be nice!  PS: I am not asking solely what the difference is, but differences in how they run software.


Are if and whether equivalent in sentences like the ones below?     How to determine if my saddle is too high?   How to determine whether my saddle is too high?         We should check if everything is okay now.   We should check whether everything is okay now.


Show that $\prod_{1\le p\le n}p\le4^n$ using the fact that $\prod_{m+1\le p\le 2m}p\le {2m\choose m}$ where $p$ are prime.  I managed to show that $\prod_{m+1\le p\le 2m}p\le {2m\choose m}$, and I sort of know how this $4^n$ is achieved by similar processes, but I am having a problem making my way to those expressions exactly.  Attempt(which I hope you could relate to): Let us denote the set of prime numbers in $[m,n]$ as $\pi(m,n)$. Then: $\pi(1,n)=(\pi(\lfloor{n\over 2}\rfloor+1,2\lfloor{n\over 2}\rfloor)\cup\pi(2\lfloor{n\over 2}\rfloor+1,n))\cup(\pi(\lfloor{n\over 4}\rfloor+1,2\lfloor{n\over 2}\rfloor)\cup\pi(2\lfloor{n\over 4}\rfloor+1,\lfloor{n\over 2}\rfloor))\cup...\cup(\pi(\lfloor{n\over 2^i}\rfloor+1,2\lfloor{n\over 2^i}\rfloor)\cup\pi(2\lfloor{n\over 2^i}\rfloor+1,\lfloor{n\over 2^{i-1}}\rfloor))\cup...$.  Where $\pi(2\lfloor{n\over 2^i}\rfloor+1,\lfloor{n\over 2^{i-1}}\rfloor))$ is a singleton: for $i=1$ it is clear because if $a=2b+1$ then $2\lfloor{a\over 2}\rfloor+1=a=\lfloor{a\over 2^0=1}\rfloor$, and it keeps that way inductively.   First, let us agree that for a set $S$ with no prime numbers,  $\prod_{p\in S}p=1$, so as to enable partitioning the intervals. Then $\prod_{1\le p\le n}p=\prod_{p\in\pi(\lfloor{n\over 2}\rfloor+1,2\lfloor{n\over 2}\rfloor)}p\prod_{p\in \pi(\lfloor{n\over 4}\rfloor+1,2\lfloor{n\over 4}\rfloor)}p...\le{2\lfloor {n\over 2}\rfloor\choose \lfloor {n\over 2}\rfloor}\cdot {2\lfloor {n\over 4}\rfloor\choose \lfloor {n\over 4}\rfloor}\cdot {2\lfloor {n\over 8}\rfloor\choose \lfloor {n\over 8}\rfloor}\cdot...$.   Here, I am kinda stuck, and not being fully sure of what I have done so far, I am going to need some guidance, thank you in advance.


Can I see a list of questions that I have favourited?

I have been favouring questions using my phone for a few weeks thinking that I would look at them later, but I don't think there is any way I can see questions that I  favourite. Or is there?   If it is not possible, then what is the point of marking a question as a favourite?  If you can see them, than how? I am using my android phone.


Apache webserver: How to redirect all requests to domain.com to www.domain.com

Something like this works for the index page:  <VirtualHost *:80> ServerName example.com Redirect permanent / http://www.example.com </VirtualHost>  <VirtualHost *:80> ServerName http://www.example.com </VirtualHost>   So a url like this:  http://example.com gets forwarded to  http://www.example.com   but this doesn't work:  http://example.com/robots.txt   I have also tried the following in .htaccess with the same results:  RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]   Please help me resolve this.  Full configuration:  LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so LoadModule proxy_balancer_module /usr/lib/apache2/modules/mod_proxy_balancer.so LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so  <VirtualHost *:80> ServerName example.com Redirect permanent / http://www.example.com </VirtualHost>  <VirtualHost *:80> ServerName http://www.example.com  ProxyPass / balancer://example/ stickysession=JSESSIONID|jsessionid ProxyPassReverse / balancer://example/ stickysession=JSESSIONID|jsessionid ProxyPreserveHost On  <Proxy balancer://example> BalancerMember http://host1.example.com:8080/ route=tomcat1 BalancerMember http://host2.example.com:8080/ route=tomcat2 </Proxy> </VirtualHost>   robots.txt is located on each of the tomcat servers.


How can I see the labels of equations in the pdf format?

I would like to see the labels for every equations in pdf format? this is easier to refere later by looking for the labels in pdf format not in text file.


how can i calculate big O for this loop?

I want to ask you how can I calculate big o for this loop?' the x++ is clearly O(1) right? I don't understand the i*2 part... I watched videos on YouTube but i can't solve this. I will be thankful if you guys can help me understand this. for(int i{3} ; i<=n ; i*=2){       x++;    }


Windows EFS encryption but (somehow) with password?

Windows (10) Professional users on NTFS-formatted drives can benefit from a built-in security option in the context menu to encrypt files and folders, . This would be much more comfortable and elegant than any third party encryption software, which installs additional software, opens unneccessary application windows and shows encrypted folders not as folders, but as drives in new pop-up Windows Explorer windows instead (like e.g. Cryptomator does). Plus such a specifically installed encryption software might raise a flag all by itself. And Windows Bitlocker, on the other hand, "only" encrypts whole drives and partitions, but how should I know beforehand how big that drive or rather partition should be(come) in light of limited SSD memory? So I'd prefer Window's built-in EFS encryption of single folders with flexible, dynamic sizes. The only problem with Microsoft's EFS encryption is that it's useless if someone else but yourself gets access to your Windows profile, because this very user can simply open (and change) the encrypted files and folders just like yourself and without the need of entering a password, as long as (s)he just uses the same user account (which can't be avoided under all thinkable circumstances). I tried the command line cipher /k command to issue another EFS password (that no other person using my Windows profile knows), but this doesn't seem to work this way? But I've also read that under some circumstances, like when an administrator changes a user's (my?) password (I'm my own administrator), the (original) Windows profile user (me) loses access to his/her EFS-encrypted files, but if that user had created a recovery key before, (s)he should nevertheless retain access to the files. Maybe I could also somehow play along Microsoft's strange EFS game rules and create another user account and activate EFS encryption there (so that an adversary with access to my own Windows profile would have no access to (actually but then not officially) my own files, but how could I avoid having the same problem as the adversary then)? Maybe somehow through shared folder access rights with my 'accomplice' user? I'm not sure. I just can't think of a smart, simple way to put this into practice so that I can quicly add confidential files on the go to an EFS-encrypted folder in my own Windows profile, but in a way that only myself and not e.g. my boss who (hypothetically) also has access to my Windows profile has access. Just like encryption was meant to work. Can you? :-)


I have booked a flight from the USA to China and am a dual national. How do I avoid China getting to know this?

I have two passports, both US and China. I want to visit China with my Chinese passport for its convenience. Therefore, when I book my round-trip ticket to China, I have to enter my Chinese passport info and show them to the airline staff. So here comes the questions:   Since it was a round-trip ticket, my returning ticket also shows my Chinese passport info, if I show my green card to the airline staff, will they be able to verify the validity of my green card? (Since my green card automatically becomes invalid after I became a US citizen) In other words, will the APIS system verify visa/green card info other than just return a security clearance (check 'no-fly list' etc)? Since I already entered my Chinese passport info as the APIS record, when I enter the US immigration, I have to use my US passport, but obviously the passport information won't match with the APIS record, will CBP consider this as a big problem?   I know somebody will ask me to enter my US passport info for APIS record for both departure and arrival flights, but I'm worried that the airline will submit these information to Chinese authorities, then they will know I have a US passport, but I don't have Chinese visa on it, also they may confiscate my Chinese passport.


Concurrent Modification Exception while updating JSONObject

I have a JSONObject where I need to rename some keys if a value exists in a map. This keeps throwing ConcurrentModificationException. Any way to achieve this instead of going through multiple loops?  JSONObject jsonObject = new JSONObject(result); jsonObject.keySet().stream().forEach(key -> {     if (someMap.containsKey(key)) {          jsonObject.put(someMap.get(key), jsonObject.get(key)); //Update the key in jsonObject with same value         jsonObject.remove(key);     } });


How to set material underneath a texture?

I am have this image and I'm trying to set the black background color to match the rest of the extinguisher. I tried messing around with some settings like Emission and subsurface color, but that messes with the image. Any help with my personal project would be greatly appreciated. Thank you :)


How to prove that the difference of squares of two natural numbers can't be a perfect square if their sum is a perfect square?

I came across the following problem and wrote up the following proof a few years ago - what do you think?    It is required to demonstrate the truth of Statement S1: "If $a^2 + b^2$ is a perfect square, then $a^2 - b^2$ can't be one.  Assume that S1 is false and that $a^2 - b^2$ is a perfect square. Then there exists $m < a$ such that $a^2 - b^2 = m^2$. This implies that $b^2 + m^2$ is a perfect square. Again, with S1 assumed false, the difference between $b^2$ and $m^2$ would be a perfect square $n^2$ smaller than at least one of them. We should be able to continue this process, getting smaller and smaller perfect squares $m^2$, $n^2$...ending at $3^2$, corresponding to $5^2 - 4^2 = 3^2$. However, $5^2 + 4^2 = 41$ is not a perfect square. Hence S1 must be true. QED?  PS: The above argument seems to be Fermat's method of infinite descent. I wonder if Fermat's method of infinite descent can be used to prove his last theorem. Incidentally, I think the following "proof" of Fermat's Last Theorem holds only for Pythagorean triples:


kwargs reserved word in python. What does it mean?

I am using Python trying to figure out a key word and I see the word, "kwargs", which I know is some kind of argument in the called function but I can not find what it means or stands for anywhere.    For example, this entry in the Python documents says...  read_holding_registers(address, count=1, **kwargs)   Parameters:  address – The starting address to read from count – The number of registers to read unit – The slave unit this request is targeting   It looks like a reference to a pointer to pointer but that is all I can tell...  This does NOT even use "**kwargs"  in the parameters list   It uses what looks to me like, "unit" instead of "kwargs".  I can NOT seem to find anywhere what kwargs means.  Maybe it is "Key Word arguments" ?  What am I missing here ?  Any ideas on help here ? thank you ! boB


Is the latest version of Pantheon desktop compatible on Ubuntu 18.04.2?  I haven't seen anything posted about anyone trying it yet.


How can I learn to make my own packages?

I can say I know how to create documents in LaTeX. However, I want to learn more. I would like to know how to learn to create my own packages. It may be a bit presumptuous for a beginner, but at least I would like to learn to do some of my own things! For instance, make beautiful designs for chapters, write codes (macros), etc. What language is used?  I would be grateful if you can recommend some good book.


Why is Congress used without the definite article the?


I use the following method to connect vSphere API with .NET C#. I am able to connect but the constructor for new VimService() takes too much time to be initialized.  I have two questions regarding this?   What can be the possible reason for this latency(servers are in the same network)? How can I make this initialization faster?     public void Connect(string url, string username, string password) {      if (_service != null) {         Disconnect();      }      _service = new VimService(); // it takes almost 1 minute to respond      _service.Url = url;      _service.Timeout = 600000;       _service.CookieContainer = new System.Net.CookieContainer();       _sic = _service.RetrieveServiceContent(_svcRef);       if (_sic.sessionManager != null) {         _service.Login(_sic.sessionManager, username, password, null);      }       _state = ConnectionState.Connected;      if (AfterConnect != null) {         AfterConnect(this, new ConnectionEventArgs());      }   }


Unable to boot Ubuntu 19.04 from USB on HP ENVY x360 with AMD Quad Core Ryzen 5 3500U Processor

I get a blank screen when trying to install Ubuntu 19.04 from usb. Does anyone have any idea how to fix this?  Secure boot is off.


Are there 10 numbers with this property?

I came across a problem that required finding the first 10 numbers (n > 2) with the following property:  all positive numbers x less than n that have GCD(x, n) = 1 should be prime  example:  12 is such a number because all x that have GCD(x, 12) = 1 are prime (those being 5, 7 and 11)  15 isn't such a number because GCD(4, 15) = 1 for instance, but 4 isn't a prime number  I wrote a simple program that tries to look after such numbers, the first eight being:  3, 4, 6, 8, 12, 18, 24 and 30 being the last found (either because the next one is a really big number or because there isn't another one).  So my guess right now is that there aren't more than 8, which brings me to my question. Is there a way you can prove there aren't more than 8 using math? (or work some sort of logic that tries to find out how big would the next one be if there is)


Now that it's clear , there is an associated concept that I use all the time without knowing what it really means.   I suppose everybody made once a mistake with parenthesis, resulting  in an "object is not callable" exception. What's more, using __init__ and __new__ lead to wonder what this bloody __call__ can be used for.  Could you give me some explanations, including examples with the magic method ?


Parameterless constructor when using XmlSerializer

I'm currently trying to copy (by use of code) a .xml file and have approached it many different ways. This way however seems to be the one I get the most as i have I've it before but to create a console.writeline output. I can't seem to get it to work for a console.out when producing the .xml layout. It gives me the following error      "cannot be serialized because it does not have a parameterless constructor"      please could anyone help me with this.  using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; using System.Xml.Serialization;  namespace ConsoleApplication1 { class Program {     const string FILENAME = @"SmallResults.xml";     static void Main(string[] args)     {         List<BasicEvent> NewBasicEvent = new List<BasicEvent>();         XmlTextReader fileReader = new XmlTextReader("SmallResults.xml");         XmlDocument xml = new XmlDocument();         xml.Load(fileReader);         XmlNodeList BasicEvents = xml.SelectNodes("/HiP-HOPS_Results/FaultTrees/FMEA/Component/Events/BasicEvent");         if (BasicEvents != null)         {             XmlNode[] nodearray = BasicEvents.Cast<XmlNode>().ToArray();             for (int i = 0; i < BasicEvents.Count; i++)             {                 NewBasicEvent.Add(new BasicEvent(nodearray[i].FirstChild.NextSibling.InnerText, nodearray[i].FirstChild.NextSibling.NextSibling.InnerText, nodearray[i].FirstChild.NextSibling.NextSibling.InnerText, nodearray[i].FirstChild.NextSibling.NextSibling.NextSibling.InnerText));                 new XmlSerializer(typeof(BasicEvent)).Serialize(Console.Out, nodearray );             }         }       } } public class FMEA {     public List<Component> components { get; set; } } public class Component {     public string CompName { get; set; }     public string BasicEventID { get; set; }     public List<BasicEvent> basicevents { get; set; } } public class Events { } public class BasicEvent {     public string BasicEventName { get; set; }     public string BasicEventShortName { get; set; }     public string BasicEventDescription { get; set; }     public string BasicEventUnavalability { get; set; }     public List<Effects> effects { get; set; }      public BasicEvent( string basiceventname, string basiceventshortname, string basiceventdescription, string basiceventunavalability )     {         BasicEventName = basiceventname;         BasicEventShortName = basiceventshortname;         BasicEventDescription = basiceventdescription;         BasicEventUnavalability = basiceventdescription;     }


Why the galaxies form 2D planes (or spiral-like) instead of 3D balls (or spherical-like)?

Question: As we know, (1) the macroscopic spatial dimension of our universe is 3 dimension, and (2) gravity attracts massive objects together and the gravitational force is isotropic without directional preferences. Why do we have the spiral 2D plane-like Galaxy(galaxies), instead of spherical or elliptic-like galaxies?   Input: Gravity is (at least, seems to be) isotropic from its force law (Newtonian gravity). It should show no directional preferences from the form of force vector $\vec{F}=\frac{GM(r_1)m(r_2)}{(\vec{r_1}-\vec{r_2})^2} \hat{r_{12}}$. The Einstein gravity also does not show directional dependence at least microscopically.  If the gravity attracts massive objects together isotropically, and the macroscopic space dimension is 3-dimensional, it seems to be natural to have a spherical shape of massive objects gather together. Such as the globular clusters, or GC, are roughly spherical groupings , as shown in the Wiki picture:     However, my impression is that, even if we have observed some more spherical or more-ball-like , it is more common to find more-planar  such as our ? (Is this statement correct? Let me know if I am wrong.)  Also, such have a look at this more-planar Spiral "galaxy" as this NGC 4414 galaxy:    Is there some physics or math theory explains why the  turns out to be planar-like (or spiral-like) instead of spherical-like?  See also a   p.s. Other than the classical stability of a 2D plane perpendicular to a classical angular momentum, is there an interpretation in terms of the quantum theory of vortices in a macroscopic manner (just my personal speculation)?  Thank you for your comments/answers!


Manage passwords in Chromium --> security risk?

I realized that in Chromium (and also Chrome) for Linux it is possible to see all saved passwords in clear text. That seems a bit strange to me... after a short research I found out that    it is not like that in the Windows edition of Chrome where you need your Windows password to see your saved passwords in clear text.  in Firefox you need a master password to see your saved passwords.   Soo, my questions are the following ones:   If nobody else but me has physical access to my PC, it is a security risk not to have a master password for my saved passwords in Chromium? Why does Google not implement that same feature for Linux while it exists for Windows??? How save is it in general to save my passwords in Chromium? I set a synchronisation password in Chromium. Does that mean that my passwords are saved on a google server in ENCRYPTED form so that not even google can read them, even if they wanted? I mean, do they have a key for it in this case?   I am curious for your answers!  Best Thomas


Allowed memory size exhausted after importing PO file

I have a problem after importing the PO of the Drupal core 7.28 (I tried with French and Arabic), whenever I try to create a new feature or open the modules page, I will get an error:     Allowed memory size of 268435456 bytes exhausted (tried to allocate   5126472 bytes) in .../includes/form.inc on line 3906   After the import, it is consuming a lot of memory and time I tried debugging, this is the path I could trace:  menu_execute_active_handler -> drupal_get_form -> drupal_build_form -> features_export_form -> _features_export_form_components -> _features_export_build   This is as far as I could get while debugging. The last function _features_export_build takes a lot of time but I couldn’t know what is wrong inside.


How to construct finite fields of any prime power order?

For a prime $p$, I know that $\mathbb Z_p$ is a field. To construct a field with four elements, I know I can just take $\frac{\mathbb Z_2[x]}{(x^2+x+1)}$. Similarly, to construct a field of order $p^n$, do I just need to take $\mathbb Z_p[x]$ and quotient out an irreducible polynomial of degree $n$? Is there any pattern to these irreducible polynomials, or do I just have to find one by brute force?


Isomorphism of linear map with conditions

Suppose $V$ is a 3 -dimensional vector space and let $T: V \rightarrow V$ be a linear map such that $T^{3}=0$ and $T^{2} \neq 0$. Show that ${Id }-T$ is an isomorphism. Express its inverse in terms of powers of $T$. So if I come up with its inverse is it true that it is an isomorphism. Otherwise how to show this.


Problem with camera orientation in motion tracking

sorry for my English, I write from Italy. I'll try to explain my problem. I'm tracking a footage with a solver error 0.2973. When I try to set the floor, the orientation of the camera is wrong (see screenshot).  So I tried to manually orient the camera, but even if well oriented respect to the xyz axes, geometry is incorrect as you can see from the screenshots below (the selected marker appears to be on the same plane but it is lower).  The video was recorded by a roof of a house so much higher than the road. It seems that Blender is not able to recognize this height and set the floor in a wrong point of view. Can someone help me solve this problem? Thank you


Google is indexing wrong page for search terms not on that page

I’m having a problem … the wrong page is indexing with Google, for search phrases “not on that page”.   Explained … On a website I developed, I have four products. For example sake, we’ll say these four products are:   Sneakers  (search phrase:  sneakers) Boots  (search phrase:  boots) Sandals  (search phrase:  sandals) High heels  (search phrase:  high heels)   Error:  What is going “wrong” is … When the search phrase “high heels” is indexed by Google, my “Sneakers” page is being indexed instead (and ranking very well, like #2). The page that SHOULD be indexing, is the “High heels” page (not the sneakers page – this is the wrong search phrase, and it’s not even on that product page – not in URL, not in H1 tags, not in title, not in page text – nowhere, except for in the top navigation link).  Clue #1 … this same error is ALSO happening for my other search phrases, in exactly the same manner. i.e. … the search phrase “sandals” is ALSO resulting in my “Sneakers” page being indexed, by Google.  Clue #2 … this error is NOT happening with Bing (the proper pages are correctly indexing with the proper search phrases, in Bing).  Note 1:  MOZ has given all my product pages an “A” ranking, for optimization.   Note 2:  This is a WordPress website.  Note 3:  I had recently migrated (3 months ago) most of this new website’s page content (but not the “Sneakers” page – this page is new) from an old, existing website (not mine), which had been indexing OK for these search phrases.  Note 4:  301 redirects were used, for all of the OLD website pages, to the new website.  I have tried everything I can think of to fix this, over a period of more than 30 days. Nothing has worked. I think the “clues” (it indexes properly in Bing) are useful, but I need help.  Thoughts?


'  #include <stdio.h> #include <math.h>  int main(){           int i;           float num = 4.700;            for(i=1;i<5;i++){                printf("%0.3f\tx%d\t\t=%d\n",num,(int)pow(10,i),(int)(num*pow(10,i)));         }           return 0; }   ' This code prints the following to the console: '    4.7000   x10        =46   4.7000   x100       =469   4.7000   x1000      =4699   4.7000   x10000     =46999   ' This result is not consistent with all floating point values    1.2000 prints out ...120...1200 etc 1.8000 is strange again  I am working in Codeblocks and my question is why do some floats react this way?I there something fundamental to C or the mingw compiler that I am missing? Or is there something wrong with my code? Thanks for the help and sorry if it's a repeat question


While going through some problems of Linear algebra, I found the statement: "There exists an infinite subset S of $\mathbb{R}^3$ such that any three vectors in S are linearly independent." What I know that not more than 3 vectors of the given vector space can be linearly independent and there exists infinite basis for this vector space, but the existence of an infinite subset in which any three vectors are linearly independent is not justified to me. Please help me what I am missing to reach the conclusion. Thanks in advance.


Is every real valued function on an interval a sum of two functions with Intermediate Value Property?

If $I$ is an interval of real numbers , then is it true that any function $f:I \to \mathbb R$ can be written as $f=f_1+f_2$ , where $f_1 , f_2 : I \to \mathbb R$ have the Intermediate value property?


Suppose $f_{n}$ in $C[0,1]$ all have Lipschitz constant $L$. Show that if $f_{n}$ converges pointwise to $f$, then the convergence is uniform and $f$ is Lipschitz with constant $L$.   Attempt  Want to show:  $\forall \epsilon$ there exists a $N > 0$ s.t. $\|f_n - f\| < \epsilon$ for all $x \in [0,1]$ and for all $n \geq N$. Also that $\|f(x) - f(y)\| \leq L\|x-y\|$ for all $x,y \in [0,1]$  What we know  $f_n$ Lipschitz means $\|f(x) - f(y)\| \leq L\|x-y\|$ for all $x,y \in [0,1]$.  By Pointwise convergence: For all $\epsilon > 0$ and for all $x \in [0,1]$, there exists $N > 0$ s.t. $\lim_{n \rightarrow \infty} f(x_{0})= f(x_{0})$ for fixed $x_{0}$. Which also means $\|f_{n}(x_{0}) - f(x_{0})\| < \epsilon$ for all $n \geq N$ (maybe I should use different notation for absolute value bars here).  Proof Attempt: Let $\epsilon > 0$ and take $n \geq N$ to satisfy the sequence condition.  $$\|f_{n}(x) - f(x)\| = \|f_{n}(x) - f_{n}(x_{0}) + f_{n}(x_{0}) - f(x_{0}) + f(x_{0}) - f(x)\| \leq \|f_{n}(x) - f_{n}(x_{0})\| + \|f_{n}(x_{0}) - f(x_{0})\| + \|f(x_{0}) - f(x)\|$$.  I feel  that the first and second expression I could control by the Lipschitz constant and pointwise continuity respectively, so the next line would look something like:  $$\leq L\|x-x_{0}\| +\frac{\epsilon}{3} + something $$  I also feel that if I could show all three expressions in the form of a Lipschitz constant I could take each of their limits and I would get zero which could show uniform continuity. Am I on the right track and what hints could you give me to continue solving?


How do I make 'X-Axis Mirror' available in Pose Mode?

More often that not, while posing an armature, I want to mirror the pose across the X-axis, so that when I move "brow.L", "brow.R" also moves in the same way.  You can copy and paste a mirrored pose, or select both bones prior to performing a transform, but both of these options aren't particularly good workflow wise.  In edit mode, in the tools panel, under options you can enable "X-Axis Mirror" to copy all transforms across the X-axis in real time, but this option is not available in pose mode.  I'm not very experienced with python, but edit source reveals:  col.prop(ob.data, "use_mirror_x")   My understanding is that "use_mirror_x" refers to a boolean property, but I have no idea how to find where that boolean property is defined or if it would be possible to modify it to get the same result in pose mode.  Any advice on this is appreciated. Maybe there's a better way to achieve this?  Thanks.


What is the appropriate question tag for the following sentence?      A man like you shouldn't do this , _________ ? ("should you" or "should he")   I think it should be "should you" after reading about question tags from my textbooks and conversations with my online friends. This question was in my English 2nd paper (Grammar) exam. My teacher said "should you" is incorrect and the answer is "should he" because "like" is a preposition in the sentence therefore "a man" is the subject.


I noticed that ability scores and the modifiers are different, but I know they relate to each other. How are ability modifiers calculated?


Is there a ring such that the nilradical of it is not nilpotent?

Example of a ring such that the nilradical of it is not nilpotent. Please help me.


Word for person unwilling to share information

What do you call a person who is unwilling to share information?


Original Post  I have been using Wine 1.6 for running several old Windows XP applications. Last night I tried to install a old win98 app and seem to have broken something.  I changed the "default" compatibility mode to "win98" in the Configure Wine window and exited out. The n tried to right click on the .exe file to use install wine application from the pop-up menu. Wine never launched the install.  When I tried to go back to "Configure Wine" it even failed to open and then to my shock I found that my other three windows XP applications that worked prior to this all failed to launch.  Doing some research I tried launching winecfg from the command line and it failed with an error with something about .idt failed to invoke.  So my question is how can I undo or fix my horrible mistake? Is there a way to force the wine mode back to winXP?  Edit to add following  Per a suggestion I tried winetricks winxp but nothing happened, it just hung & I got the following:  gerald@gerald-Vostro-200:~$ winetricks winxp wine cmd.exe /c echo '%ProgramFiles%' returned empty string   When i run winecfg, I got:  gerald@gerald-Vostro-200:~$ winecfg  modify_ldt: Invalid argument  modify_ldt: Invalid argument  modify_ldt: Invalid argument  modify_ldt: Invalid argument  modify_ldt: Invalid argument  ^C (I tried to cancle / close the hung up process)  err:ntdll:RtlpWaitForCriticalSection section 0x7bcc7be0 "loader.c: loader_section" wait timed out in thread 0024, blocked by 0009, retrying (60 sec)  ^C  err:ntdll:RtlpWaitForCriticalSection section 0x7bcc7be0 "loader.c: loader_section" wait timed out in thread 0025, blocked by 0009, retrying (60 sec)  ^C  err:ntdll:RtlpWaitForCriticalSection section 0x7bcc7be0 "loader.c: loader_section" wait timed out in thread 0026, blocked by 0009, retrying (60 sec)  err:seh:raise_exception Unhandled exception code c0000194 flags 0 addr 0x7bc367d1  err:ntdll:RtlpWaitForCriticalSection section 0x7bcc7be0 "loader.c: loader_section" wait timed out in thread 0024, blocked by 0009, retrying (60 sec)  ^C  err:seh:raise_exception Unhandled exception code c000013a flags 0 addr 0xf77d3430  gerald@gerald-Vostro-200:~$    UPDATE  Looking around in the FAQ I found "10.6. Every app I try to start crashes"    I was not able to recover my wine installation and had to remove it then reinstall.  All is good now.


What is better to say in the following context "You 'could' / 'would' achieve"?

How is it better to say      Sometimes it's hard to believe that you could ever achieve your   goal...   Or     Sometimes it's hard to believe that you would ever achieve your   goal...


$f(x)=x\cdot \ln(x)$ uniformly continuous in $(0, \infty)$

I have to decide if the function $f(x)=x\cdot \ln(x)$  in the interval $(0,+\infty)$ is uniformly cotinuous .


I was writing a query on SEDE, when I noticed there was no "Days Visited" value.    I have circled the available user metrics, alas there is no Days Visited  While there is a CreationDate, this can't be used as accuretly in queries as me (and other people) create accounts on sites but then rarely visit the site.  I'd use this to weight user "scores" but they are probably a lot more uses for this.


How to execute two jquery events at once

How can I execute two event at same time ? I do as following way. But it doesn't work properly. If I execute single at once, both work fine.      $(document).on('click', '#menu', function(){     if($(this).is(':checked'))           $(this).parent().find('ul').slideDown('slow');     else     // these two events         $(this).parent().find('input[type="checkbox"]').prop('checked', false);         $(this).parent().find('ul').hide('slow'); });


Choosing variables to include in a multiple linear regression model

I am currently working to build a model using a multiple linear regression. After fiddling around with my model, I am unsure how to best determine which variables to keep and which to remove.  My model started with 10 predictors for the DV. When using all 10 predictors, four were considered significant. If I remove only some of the obviously-incorrect predictors, some of my predictors that were not initially significant become significant. Which leads me to my question: How does one go about determining which predictors to include in their model? It seemed to me you should run the model once with all predictors, remove those that are not significant, and then rerun. But if removing only some of those predictors makes others significant, I am left wondering if I am taking the wrong approach to all this.  I believe that  thread is similar to my question, but I am unsure I am interpreting the discussion correctly. Perhaps this is more of an experimental design topic, but maybe someone has some experience they can share.


Expected value of sock pairs from k choices

Suppose you have N pairs of socks in a drawer and you pick out K socks. What is the average number of pairs of socks that you will have if you repeat this experiment a large number of times? I know the answer is $\frac{K \choose 2}{2N-1}$ but I am unsure of the proof. This question is different from  because the proof I am looking for is taken as a given in that question.


Every time I save a file (having previewed it) in TeXShop, it saves five different files (.aux, .log, .pdf, .synctex.gz, and .tex). Is there a way to change the setting so that it only saves the .tex file? Or the .tex file and .pdf file?


how soon after unprotected sex can side effects of getting pregnant occur?

a person, lets call him bob had unprotected sex with jane on friday night lets say saturday morning at like 4 am. Monday evening at around 11 pm the girl feels like throwing up and bad generally.  Can it be because she is pregnant?


Predicting the number of decimal digits needed to express a rational number

The number $1/6$ can be expressed with only two digits (and a repeat sign denoted as $^\overline{}$), $$ \frac{1}{6} = \,.1\overline{6}$$  Meanwhile, it takes 49 digits to express the number $1/221$, since a string of 49 digits repeats: $$\frac{1}{221} = .\overline{004524886877828054298642533936651583710407239819}$$ Yet for $1/223$, 222 digits repeat, giving a total of 224 digits needed to express the number.  If $f:\mathbb{Q}\rightarrow\mathbb{N}$ is a function that gives the smallest number of digits needed to express a rational number in decimal notation, what can we say about $f$?  For example, if we do not consider the negative sign to be a digit, then $f$ is an odd function.  Other than that, is there any pattern to it at all?


What would you call a person being coached?

I am looking for an intuitive one word description for somebody that is being coached, as in enjoying the services of a coach.  I am thinking of something analogous to the oft used mentee as somebody being mentored, or enjoying the services of a mentor.


How can you have a non-significant multiple regression model w/ significant predictors?

Possible Duplicate:                If in a multiple linear regression (enter method) the general model isn't significant (F>.05) but one of the predictors is significant (β<.05), should I consider it as a significant result?


I need help with creating a Shulker Box with enchanted items?

/give @p chest 1 0 {BlockEntityTag:{Items:[{display:{Name:"SHADOW_GUARD_SWORD",Lore:["SHADOWS_JUDGMENT!"]},AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:100,Operation:0,UUIDMost:15145,UUIDLeast:331544}],ench:[{id:0,lvl:1000},{id:1,lvl:1000},{id:2,lvl:1000},{id:3,lvl:1000},{id:4,lvl:1000},{id:5,lvl:1000},{id:6,lvl:1000},{id:7,lvl:1000},{id:8,lvl:1000},{id:16,lvl:1000},{id:17,lvl:1000},{id:18,lvl:1000},{id:19,lvl:1000},{id:20,lvl:1000},{id:21,lvl:10},{id:32,lvl:1000},{id:33,lvl:1000},{id:34,lvl:10000},{id:35,lvl:100},{id:48,lvl:1000},{id:49,lvl:1000},{id:50,lvl:1000},{id:51,lvl:1000},{id:61,lvl:100},{id:62,lvl:100}],HideFlags:5,id:diamond_sword,Slot:0,Count:64},{display:{Name:"SHADOW_GUARD_SWORD",Lore:["SHADOWS_JUDGMENT!"]}   This is a smaller version of the code my goal is to have it give me a shulker box with these enchanted items.


HashMap with key as Generic Type object returns false in containsKey

I have the following generic class which has the equals and hashcode method properly implemented  class Node<T> { private T data; private Node<T> previous; private Node<T> next;  public Node(T data) {     if (data != null) {         this.data = data;     } else {         throw new RuntimeException("Null not allowed");     } }  public T getData() {     return data; }  public Node<T> getPrevious() {     return previous; }  public void setPrevious(Node<T> previous) {     this.previous = previous; }  public Node<T> getNext() {     return next; }  public void setNext(Node<T> next) {     this.next = next; }  public int hashCode() {     return data.hashCode(); }  public boolean equals(Node<T> that) {     return this.data.equals(that.getData()); }}   This Node object is used as a key in a HashMap which keeps the count and its surrounding class is a different generic type.  class Struct<T> {     private Map<Node<T>, Integer> counter = new HashMap<>();     public boolean contains(Node<T> val) {          return counter.containsKey(val);     }     public void add(Node<T> val) {         if (contains(val)) {              int count = counter.get(val);              counter.put(val, ++count);         } else {              counter.put(val, 1);         }     } }   This is called from my main method as  Struct<String> str = new Struct<String>(); str.add(new Node<String>("test1")); System.out.println(str.contains(new Node<String>("test1")));   The println prints false even though the hashCode matches. Not sure where exactly I am going wrong in understanding the flow. I tried to debug the code by using loggers on hashCode and equals. But every time when I call contains key, the hashCode gets called which prints the same hashcode but the equals method is never called. Hence I do not think it's a duplicate of the linked issue.  Update Node's equals method changed to the following which worked like a charm.   public boolean equals(Object that) {     if (that == null) return false;     if (that == this) return true;     if (!(that instanceof Node))return false;     Node thatVal = (Node) that;     return this.data.equals(thatVal.getData()); }


Is "connected, simply connected" Redundant?

Here are my definitions of "connected" and "simply connected."  A topological space $X$ is connected if and only if it is not the union of two nonempty disjoint open sets. A topological space $X$ is simply connected if and only if it is path-connected and has trivial fundamental group (i.e. $\pi_1(X)\simeq\{\mathrm{e}\}$ and $|\pi_0(X)|=1$).  It is a classic and elementary exercise in topology to show that, if a space is path-connected, then it is connected. Thus, if a space is simply connected, then it is connected. Yet, despite this implication, I've read several cases where the words "connected, simply connected" appear together. For example, in Kobayashi and Nomizu's Foundations of Differential Geometry, Volume 1, page 252, the following is written: "Let $M$ be a connected, simply connected analytic manifold with an analytic linear connection." In  and  (Links to Journal Storage, also known as JSTOR), they use "connected, simply connected" on their first page. The first of these takes it a step further, referring to "closed, compact, connected, simply connected $4$-manifolds," where a closed manifold (unfortunate terminology) is defined as a compact manifold without boundary. My question is simple: Why use the words "connected, simply connected" when being simply connected implies connectedness? Thank you.


Prove: $a\equiv b\pmod{n} \implies \gcd(a,n)=\gcd(b,n)$

Proof: If $a\equiv b\pmod{n}$, then $n$ divides $a-b$. So $a-b=ni$ for some integer $i$. Then, $b=ni-a$. Since $\gcd(a,n)$ divides both $a$ and $n$, it also divides $b$. Similarly, $a=ni+b$, and since $\gcd(b,n)$ divides both $b$ and $n$, it also divides $a$.  Since $\gcd(a,n)$ is a divisor of both $b$ and $n$, we know $\gcd(a,n)\leq\gcd(b,n)$. Similarly, since $\gcd(b,n)$ is a divisor of both $a$ and $n$, we know $\gcd(b,n)\leq\gcd(a,n)$. Therefore, $\gcd(a,n)=\gcd(b,n)$.  Thanks for helping me through this one!


Can we derive most fundamental laws from the Action Principle?

It is said in the book Fearful Symmetry - The Search for Beauty in Modern Physics that we can derive all basic laws in physics from a simple principle called Least Action Principle (although it may be better called Stationary Action Principle). I am very excited at the following statements that: (cite page 109):     The reader should understand that the entire physical world    is described by one single action. As physicists master a new area of physics, such as electromagnetism, they add to the formula for the action of the world an extra piece describing that area of physics. Thus, at any stage in the development of physics, the action is a ragtag sum of disparate terms.    A picture taken from the book would best illustrate the point:     Question:   As the author (A.Zee, from UCSB) is a particle physicist, I have confidence that this is true. But no further detail is given in the book. With Google I could not find any book about Action Principle. Nor could I find any reference to the action shown in the book. Most physics book I read use Action Principle to describe the dynamics of a specific system in that field (e.g action of a free particle or action of the string etc) and then compute the equation of motion. But few of them use the Principle to derive the fundamental law in that area (Except the classic: Mechanics by Landau, in which The Newton's three law was shown to be implied by the Action Principle).  Can anyone explain that how each of the magic terms in the above Fig.7.4 B may turn into the fundamental laws in Gravity, Electromagnetism, Strong and Weak forces? Or are there books I haven't found yet to describe this exciting law?    Very sorry for my late response. After spending some days devouring in the books recommended by @hft , I realized that tje difficulty in understanding them. But still I am pleased to find that satisfying answers lie in those books.  Some more books could be added to the list by @hft For classical mechanics and classical field theory(treating relativistic motion), Landau's books are always my favourite: Mechanics, third edition, Landau ( The Classical Theory of  Fields, fourth edition, Landau (), where I found good derivation of the Maxwell's equation.


I'm really new to the whole Ubuntu thing, I've been and still am a windows user, for my windows server I would just use RDC (remote desktop connection) and be done with it, as in apps are still running when I close RDC.  For Ubuntu I've been using SSH but as soon as I close it anything I've started ends. Also while I prefer a GUI it seems that most stuff in the Ubuntu is terminal based and I'm ok learning this.   I'm currently running the standard version of Ubuntu 16.04 LTS


I'm trying to get TikZ to make a sort of experience bar command where I can just call it and enter a number out of say, 6, and it will return that many "filled" dots, and 6 minus that many "unfilled" dots. Problem is, something with the way the "foreach" command counts sizes makes it mess up, either by adding too many dots or not enough or not in the right spot or something (depending on what specifically I do with the index bounds)  For example:   \newcommand{\dotexp}[1]{     \tikz{\foreach \x in {1,...,#1}     \draw[cyan,fill=cyan] (\x/2.5,0) circle (.5ex);     \ifnum#1<6 \foreach \y in {#1,...,6} \draw[lightgray,fill=lightgray] (\y/2.5,0) circle (.5 ex);\fi}     }      gives me    where each line is supposed to be a call for 0, 1, 2,....6 dots, in order.   Any suggestions for a fix? Maybe some way to pre-allocate the dot positioning but just change the color?


Why Excel sometimes changes cell formats after reopening file?

My System: MS Office Excel 2013 on Win7 64bit. I have an excel xlsx-file with different cell formats like General, Currency_USD, Currency_EUR, Number (no decimal places), Number (2 decimal places).  When opening the file at another time, Excel corrupts my number and currency cell formats. Curiously this does not happen directly after saving and opening again. This problem exists at several files.  I recognized, that the cells changes to that format, which I changed one of the last times. And the format is applied to other cells (which I didn't format) after reopening the file some time later. I.e. if I have some EUR cells, and afterthen I also add some USD cells... when I close and open the file, also the EUR cells are formatted in USD (and also the "number" formatted cells). This also happpens with cells on other sheets. The problem occurs with format "currency" and also with "accounting". Solving the problem by create custom formats is not a solution - Excel should be able to handle different cell format - also without creating styles for every single format!  In Options/Advanced I already unchecked "Extend data range formats and formulas", but problem still exists.  The question is NOT answered by : I've tested it and created custom styles and updated the cells, but these cells were overwritten with "normal" style at re-opening!  EDIT 2017-04-11: What I recognized: In most cases the "Normal" style is changed from number format "General" to another format by mistake, after opening the file on another time. Any idea, why this happens?


Experience: Lessons-Learned as it pertains to a specific question

I have noticed that my specific questions that are capped with a request for any lessons-learned are often met with resistance from moderators.  The request for lessons-learned as it pertains to a specific topic / question is often used solicit relevant facts and answers to questions that one can not ask, unless one has experience.  Why is there resistance to lessons-learned / experience?  This is the only question with regard to this thread  For example, I might ask the question, when is the best time of year to visit the Paris' Arc De Triophe as a tourist?  Any lessons learned are appreciated.  The answer may be in November because that is when there are the fewest tourist and the companion lesson-learned is that the elevator is out-of-service for the next 6 months.  So if you are go with your 70 year old mother mother, then you need to ensure that she is able and willing to walk up many flights of stairs and back down again.  Maybe this is not the best example, there can be other permanent pitfalls / obstacles that can / should be avoided, but hopefully the gist is there.  The ability to ask a question and gain the knowledge-based experience is  priceless.  Not every question has a quantifiable answer that can be Googled and more often than not the original specific question needs to be refined through the lessons-learned mechanism.  In every industry I have worked in, this is a common mechanism for learning.  That being said, I would (respectfully) suggest that the leadership at stackexchange re-examine policy / culture with regard to lessons-learned.  From my observations: it seems that there too many that are too quick to unnecessarily police (censor) questions, instead of providing useful insight.   I do not believe that incentive (points) should be awarded for modifying / correcting questions and that question moderators should be those that have a history of providing accepted answers and not necessarily points (i.e. credibility)


How can my friend who lost her French residence permit card before exiting the Schengen Area return to France?

My friend got stuck in Morocco and is not allowed to come back France as she lost her residence permit card.   She has a long stay visa and residence permit card (carte de séjour, type: student) in France. Unfortunately, it was stolen in France just a couple days before her departure to Morocco (Chinese are able to travel to Morocco visa-free). She filed a police complaint of the loss (Récipicé de déclaration) and hadn't obtained the new permit card before her departure.   When she tried to come back, the airline staff declined her at check-in, as she doesn't have a visa for France. Now, she's stuck in Morocco.  She tried to ask for a return visa (visa de retour) from the French Embassy in Casablanca, but they declined her request. They also suggested that she return to China to apply for a new visa.   Instead of going back to China, are there other solutions to allow her to return to France?     Update:  Finally, I suggested my friend buy a combined ticket, Morocco --> France --> China, and try to go through French customs. Luckily, the officials in Paris passed her through customs. She is on the way to the Pink City:-)


Dummit and Foote 4.3.13: Find all the finite groups which have exactly two conjugacy classes.

Task: Find all the finite groups which have exactly two conjugacy classes. Ideas: I have been show the class equation and the orbit stabilizer formula and I wonder if I can put them to use. My general intuition so far is such;  Given $$|G|=\Sigma_{i=1}^{r}|\mathcal{O}_a|+|Z(G)|,$$ we need $\Sigma|\mathcal{O}_a|=2$ and $|Z(G)|\geq 1$ because the identity is always in the center. It could be that either each of the orbits are size 1 or a single order is size 2.  My other idea is to use the orbit stabilizer formula: $|G:G_a|=|\mathcal{O}_a|=2.$  Maybe split the possibilities into $G$ abelian and $G$ not abelian.   I'm new to this material so please let me know if either or these ideas are on the right track! Pointers are appreciated.


Find the volume bounded by the $xy$ plane, cylinder $x^2 + y^2 = 1$ and sphere $x^2 + y^2 +z^2 = 4$.   I am struggling with setting up the bounds of integration.  First, I will calculate the 'first-quadrant' piece of the volume.  $z$  will traverse from $0$ to $2$.  $x$ should start from the cylinder and go to the edge of the current circle of the sphere: $$\sqrt{1-y^2} \le x \le \sqrt{4-x^2-z^2}$$ However, the same applies to $y$: (I am only calculating half of the volume right now, where the smaller circle is the lower bound):  $$\sqrt{1-x^2} \le y \le \sqrt{4-y^2-z^2}$$  However, this cannot work as both $x$ and $y$ are dependent.  What is the error?


Photons nay be emitted from hydrogen at, say 656.28 nm but, I guess in accordance with time-frequency uncertainty, the emission spectrum has a small finite width. This finite width can be wider for emission spectra with shorter decay times, if my understanding is correct.  Spectral emissions are usually given as very precise frequencies. Are these approximations?


Choosing the best or second best secretary

We have a hall with $N$ secretaries.  We choose randomly one secretary at a time and interview them.  After the interview either we hire the secretary (and all others go home) or move to the next one (we can't go back and hire them later).  The interviewer wants to hire either the best or second best secretary with the highest probability    My approach:  I know we should use this strategy: after we interview the first $aN$ candidates (which we don't hire), then we choose the first one that's better than the previous $aN$ candidates. I am just stuck knowing what is the value of $a$.  What is the probability of this value? and how we get to it?  I have seen the "Secretary Problem" where we want to choose the best one, the difference here is that we are satisfied with the best or second best one equally


Is it possible to rename the wp-admin folder?  I know I could just rename it, but unless it's supported by the code lots of things would break.  If I use a custom folder name, it will make it slightly more secure, security by obscurity and all that.


Showing that the norm of the canonical projection $X\to X/M$ is $1$

How do I show that given $M$ a closed subspace of a normed space $X$, and let $\pi$ be the canonical projection of X onto $X/M$. Prove that $\|\pi\| = 1$.  I figure I could use Riesz' lemma and set $\|\pi\| = 1$, that's as far as I got.  I could also use the fact that the canonical map is a contraction so I would have $\|\pi(x)\| \leq \|x\| \Rightarrow \frac{\|\pi(x)\|}{\|x\|} \leq 1$ and taking a supremum then we get the desired result. This doesn't seem as rigorous.


How do I respond to chatroom flags for a site in non English language?

I was faced today with a bunch of flags from Stack Overflow на русском. I don't speak or read Russian.  So... am I supposed to dig up Google Translate to evaluate the flag? Or wait for some users who understand the langauge to deal with the flags?  The same applies to any non-English Stack Exchange site.


I am reading about degrees of freedom and came across the formula  Degrees of freedom = (number of categories) - 1 - (Number of parameters estimated from the data)  I can not get the "Number of parameters estimated from the data" part. What does it mean?


The Radon-Nikodym derivative of a measure such that $|\int f'\,d\mu|\le \|f\|_{L^2}$ for $f\in C^1$

Suppose that $\mu$ is a measure on the Borel $\sigma$-algebra on $[0,1]$ and for every $f$ that is real-valued and continuously differentiable we have  $$ \left|\int f'(x)~\mu(\text{d}x)\right|  \leqslant \left(\int_0^1 f^2(x) ~\text{d}x\right) ^{1/2}. $$  (1) Show that $\mu$ is absolutely continuous with respect to Lebesgue measure on [0,1].  (2) If $g$ is the Radon-Nikodym derivative of $\mu$ with respect to Lebesgue measure, prove that there exists a constant $c>0$ such that $$ \left|g(x)-g(y)\right|\le c\left|x-y\right|^{1/2},~~~~~~x,y\in[0,1]. $$  Attempt  The inequality given reminds me of Jensen's inequality but I've no idea how to use it on (1).


What value does the infinite sum $\sum_{k=1}^{\infty} \frac{1}{k^4} $ converge to? I know that $\sum_{k=1}^{\infty} \frac{1}{k^2} $ converges to $\frac{\pi^2}{6}$ but I simply do not have a clue as to where to start in order to find the value to which the first sum converges. (Sorry. I had to edit the question; my problem did not involve $\frac{1}{k^3}$ but rather $\frac{1}{k^4}$.)


Turn epoch datetime textbox value to a 24h human date?

I have a first textbox that contains an epoch datetime stamp.  Because this format is not human readable, i decided to set it as readonly and hidden.  From that first textbox value, i would like to mirror its epoch value to a 24h human date that will be visible into a 2sd textbox.  Here is what i did so far, but it does not work :  ( ~gpio_actual_schedule_event~ is automatically replaced by a datetime stamp by the server when the page loads )  HTML  <input type="hidden" value="~gpio_actual_schedule_event~" id="epoch_stamp" readonly > <input type="text" id="converted_set_next_event" readonly >   At page load, i convert datetime stamp to human readable format with Javascript :  <script> function epoch_to_24h_date(){     var epochdate = new Date(~gpio_actual_schedule_event~ * 1); // multiply by 1000 for milliseconds var date_string = epochdate.toLocaleString('en-GB');  // 24 hour format              }    </script>  <script>     window.onload= function(){            epoch_to_24h_date();             document.getElementById('converted_set_next_event').value = date_string;            }    </script>


Arrive in the US with a Tourist Visa before Student Visa starts

My girlfriend will be starting college in the US in January. Is it possible for her to get a tourist visa so that she can be here more than 30 days before the start of her classes?


I saw a very tiny black bug crawling over my computer screen the other day. Having recently acquired a "" for smartphone, I started investigating. On a white paper it seemed like a small black dot. I think its in the 0.3 - 0.8 millimeter range. It would have been fairly unnoticeable if it weren't for it to crawl over my screen. What could it be? I was thinking about dust mites, but they say it should appear as white. So I'm not entirely sure. I live in Western Europe. Note: don't look at the scale. It is wrong.


Split a string into a vector delimited by new line

How can I turn std::string str = "My String\nhas multiple\nlines in it.";  into a std::vector<std::string> that looks like {"My String", "has multiple", "lines in it."};  This post here  only seems to work for spaces, not new lines.


Why isn't there a bronze badge for 10 people favoriting a question?

There are currently two badges for questions favorited by a certain number of users:     Favorite Question Question favorited by 25 users   Stellar Question Question favorited by 100 users   Why isn't there a bronze badge for a question favorited by 10 users? This would fit with the pattern of Nice/Good/Great badges for questions/answers, which require 10/25/100 votes. Thanks!


I keep hearing people who do not ordinarily stutter or stammer say "is is" when they mean "is".  Is this a known mental disorder?


I am working on math engine in C# for my teacher, and I don't know how to parse something like this string needToBeCalculated = "1/2 + (2 + 3 /2 * (3+1))";, To an int or long. I know thatlong Calculated = long.Parse(needToBeCalculated ); this doesn't work. But is there a build in method or some kind of a design pattern that i must use ?


In the book I am reading the author left some excersises for the reader, I happend to be stuck at this sum $$\sum_{n=1}^k{n!(n^2+n+1)}$$ So far I have tried to factorize the polynomial, and also tried to split the  sum. I know how to compute $n\ n!$, but I have no idea on the other terms, any help is accepted!


Here is what I get  Ign http://ppa.launchpad.net trusty InRelease Ign http://archive.ubuntu.com trusty InRelease Ign http://ppa.launchpad.net trusty InRelease Get:1 http://archive.ubuntu.com trusty Release.gpg [933 B] Get:2 http://dl.google.com stable InRelease [1.487 B] Get:3 http://archive.ubuntu.com trusty Release [58,5 kB] 42% [2 InRelease gpgv 1.487 B] [3 Release 23,0 kB/58,5 kB 39%]  [Waiting for heaSplitting up /var/lib/apt/lists/partial/dl.google.com_linux_chrome_deb_dists_stabIgn http://dl.google.com stable InRelease        E: GPG error: http://dl.google.com stable InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)   I tried to remove chrome and reinstall it again but the problem does not seem to be from there.


Book about an amphibian race at the centre of the Earth

I’m after a book about an amphibian race, a guy found a creature, there was a scientist involved, the thing learnt English and lives in an advanced civilisation under the Earth that can be accessed through a cave under the sea. Something about peanut butter and jelly sandwiches and down there you press a button on a machine that makes a pill that tastes like the food you wish for or something like that my memory is fuzzy I read this cover less book when I was 9 (it was like .50c from a thrift store) and I think it was 60’s or 70’s maybe earlier again not sure.


I preferentially use  for writing scientific papers and appendix.   I'm borrowing \ell from kpfonst.sty, following , because \ell in mathpazo.sty is a bit less fitted with other symbols with mathpazo.  Question: how can I borrow \varg from pxfonts.sty to use it with mathpazo.sty?


Solving multiple congruences by CRT = Chinese Remainder Theorem

How do I get the solution given by CRT to match another solution, e.g. the least positive? For example say I have X = 1234. I choose mi as 5, 7, 11, 13. This satisfies the simple requirements of . More precisely given in my example k = n = 4, and the product of any k - 1 is smaller then X how come simply computing the remainder of each won't give equations that solve to X = 1234. In the case of the example, x = 4 mod 5 x = 2 mod 7 x = 2 mod 11 x = 12 mod 13  Which resolves to  (won't CRT produce the smallest?) Any hints?  Below is the solution linked to on "Math Celebrity" (cached to avoid link rot).


Is this password hashing and credentials validation correct from security/practicallity point of view?

i had a suggestion to learn PDO api instead of mysqli.  So i wrote php segment for login page the way i understood the guides i looked up. Wanted to know if my code and understanding is correct and the app is secure from sql injections.  Also i was reading about using salt when hashing passwords. So in this example i just append my date of birth to users password, then hash it with sha512 and store it. I know that my date of birth is not the best choice since it can be social engineered etc, but is the general principle right?  Heres is the code.  connect.php creates database connection as $con and set default fetch atribute as OBJ.         include "assets/php/connect.php";       if((isset($_POST["username"]))&&(isset($_POST["password"]))){          $cName = $_POST["username"];          $hashLink = $_POST["password"]. "19920423";          $cPass = hash('sha512', $hashLink);          $sql = "SELECT id,username,password FROM users WHERE username = ?";          $stmt = $con->prepare($sql);          $stmt->execute([$_POST['username']]);          $logs = $stmt->fetchAll();          foreach($logs as $log){            if(($cName == $log->username)&&($cPass == $log->password)){              $_SESSION["username"]=$_POST["username"];              header("Location: home.php");            }          }          echo "
Wrong credentials
";     }


Why does the below code not generate an error and print the value stored in arr then followed by a junk value ?  int main() {     int arr[1]={10};     printf("%d %d\n",0[arr], 1[arr] );     return 0; }


Why didn't Thanos go after the orb personally?

In Guardians of the Galaxy, if Thanos knew the orb contained an Infinity Stone (one of the most powerful artefacts in the galaxy), why did he send Ronan to retrieve it?  It was pretty clear from their short exchanges that Thanos and Ronan pretty much hated each other. Why would Thanos trust Ronan with such a hugely important task?  I know initially, Ronan didn't know that the orb contained an infinity stone, but Thanos was still taking a pretty big risk sending him to retrieve it.   Even with two of Thanos' daughters on board Ronan's ship, the orb would ultimately pass through Ronan's hands before it reached Thanos, so there was always the possibility he would discover it's contents.  Is there any reason established as to why Thanos doesn't go after the infinity stone personally?


Converting old python script to work in Blender 2.80

I'm trying to convert a python script to work in Blender 2.8   I've made the changes to line 27 to say  "blender": (2, 80, 0),  but I'm getting errors in line 384 in addon_utils.py which this file doesn't exist on my system (I have 2.79 and 2.80 snap blender Ubuntu 18.04 64bit neither have this file).   and I'm getting errors in line 1480 in attractor.py  def register():   bpy.utils.register_module(__name__)   bpy.types.INFO_MT_curve_add.append(menu_func)


Catching an exception while using a Python 'with' statement

To my shame, I can't figure out how to handle exception for python 'with' statement. If I have a code:  with open("a.txt") as f:     print f.readlines()   I really want to handle 'file not found exception' in order to do somehing. But I can't write  with open("a.txt") as f:     print f.readlines() except:     print 'oops'   and can't write  with open("a.txt") as f:     print f.readlines() else:     print 'oops'   enclosing 'with' in a try/except statement doesn't work else: exception is not raised. What can I do in order to process failure inside 'with' statement in a Pythonic way?


Why ConcurrentHashMap read performance is better than HashMap in concurrent environment?

In the concurrent environment, and only get object from map, no put. The HashMap and ConcurrentHashMap, Whose performance is better in jdk 1.6.  In my limited experience with these two map, ConcurrentHashMap consists of segments. And when get an object from it, it needs at least two locate action. First is to find the correct segment and next is to find the correct table  while HashMap only needs locate once. Further more, in my opinion when we just get object from map, there is no race of lock. So I think in jdk 1.6, there is no doubt that HashMap will performance better than  ConcurrentHashMap in concurrent environment when just get object from it.  But unfortunately, The test result doesn't support my argument.   Here is my test code.  public static void main(String[] args) throws InterruptedException {         final Map<Integer, Integer> hashMap = new HashMap<Integer, Integer>();         final Map<Integer, Integer> concurrentHashMap = new ConcurrentHashMap<Integer, Integer>();         init(hashMap);         init(concurrentHashMap);         final Random random = new Random(System.currentTimeMillis());         final CountDownLatch latch1 = new CountDownLatch(100);         long start1 = System.nanoTime();         for (int i = 0; i < 100; i++) {             new Thread(new Runnable() {                 @Override                 public void run() {                     for (int count = 0; count < 10000; count++) {                         hashMap.get(random.nextInt(100));                     }                     latch1.countDown();                 }             }).start();         }         latch1.await();         long end1 = System.nanoTime();         System.out.println("hashMap : " + (end1 - start1));           final CountDownLatch count2 = new CountDownLatch(100);         long start2 = System.nanoTime();         for (int i = 0; i < 100; i++) {             new Thread(new Runnable() {                 @Override                 public void run() {                     for (int count = 0; count < 10000; count++) {                         concurrentHashMap.get(random.nextInt(100));                     }                     count2.countDown();                 }             }).start();         }         count2.await();         long end2 = System.nanoTime();         System.out.println("concurrentHashMap : " + (end2 - start2));      }      private static void init(Map<Integer, Integer> map) {         for (int i = 0; i < 100; i++) {             map.put(i, i);         }     }   The last three outputs are:  hashMap : 78448168 concurrentHashMap : 68820282  hashMap : 87819463 concurrentHashMap : 76098734  hashMap : 87901572 concurrentHashMap : 71385562   Then I test the performance in single thread environment.(Repeat random get object from map 10000 times.)  Here is my test result.    The average time of HashMap is 4982047 ns while ConcurrentHashMap is 3150367 ns.  The result indicates that ConcurrentHashMap performance better than HashMap even in single thread environment.   I'm really confused.Is there something that I understand wrong? Or just my test code isn't rigorous?


I am working on a tiled map editor, and I need to choose tiles automatically, based on the adjacent tiles. For example, when placing a road tile, next to another road tile, the two need to be oriented so that they form a continuous road. If there are other roads around them, we may need to use corner or intersection tiles.  Can anyone recommend some algorithms for doing this? The game uses an 8-directional square tiled map.


Macros with \fi for showing and hiding proofs

I would like to be able to globally showing and hiding proofs on a document, and be able to use macros to open and close the proof environments. Here is my current MWE:  \documentclass{article} \usepackage{amsmath} \usepackage{amsthm} \newif\ifshowproof \newcommand{\bp}{\ifshowproof\begin{proof}} \newcommand{\ep}{\end{proof}} \showprooffalse  \begin{document} Goodbye. \bp Hello. \ep\fi Test. \end{document}   As explored here: , I cannot simply add \fi to the definition of \ep, however, I would like to have a "catch-all" macro so to say, that is, ideally something that would execute as \end{proof}\fi. Is there an easy way to do this?


I have an application which will produce a large amount of data which I do not wish to store onto the disk. The application mostly outputs data which I do not wish to use, but a set of useful information that must be split into separate files. For example, given the following output:  JUNK JUNK JUNK JUNK A 1 JUNK B 5 C 1 JUNK   I could run the application three times like so:  ./app | grep A > A.out ./app | grep B > B.out ./app | grep C > C.out   This would get me what I want, but it would take too long. I also don't want to dump all the outputs to a single file and parse through that.  Is there any way to combine the three operations shown above in such a way that I only need to run the application once and still get three separate output files?


Prove that $$\sum_{i=1}^{\infty} \frac{1}{i(2i+3)} = \frac89 -\frac23\ln2$$  I tried using integration but failed miserably. Hints please.


Simple Regression: Which parameter follows the t-distribution

In simple linear regression for the problem Y=aX+b; the "goodness" of the coefficient a can be estimated through a hypothesis test which computes the statistic, $t=\frac{a'-0}{SE(a')}$.   Which of the following follows a t distribution:  1- Is it t?  2- Is it a?  3- Is it both?  If one computed some other measure such as $t_2=\frac{2a'-0}{8SE(a')}$, would it also follow a t-distribution as long as it is computed on a sample? why/why not?


How can I redirect the user from one page to another using jQuery or pure JavaScript?


plus/minus (\pm) sign appears misaligned with unicode-math

Consider the following minimal example  \documentclass{article} % \usepackage{unicode-math} \begin{document} $1\pm2$ \end{document}   Compiling with lualatex (texlive 2018) without unicode-math yields    whereas compiling with unicode-math (uncommenting the corresponding line) yields    Clearly, the \pm sign is too low in the second case.  I observe the same phenomenon with xelatex, and with e.g. \setmathfont{TeX Gyre Pagella Math}.  Any hint to fix the issue would be welcome.


Odd behavior with classes in separate files

I have some classes that look like this:    World.h:  #ifndef WORLD_H_ #define WORLD_H_ #include "GameObject.h" #include <vector>  class World { public: std::vector<GameObject*> objects;  World(); virtual ~World(); void add(GameObject*); void initialize(); void update(); void render(); };  #endif /* WORLD_H_ */   GameObject.h:  #ifndef GAMEOBJECT_H_ #define GAMEOBJECT_H_ #include "util/Point.h" #include "World.h"  class GameObject { public: World *world; Point *position; GameObject(); virtual ~GameObject();  virtual void update(); virtual void render(); };  #endif /* GAMEOBJECT_H_ */   Why does it give an error: "World.h, line 9 - 'GameObject' has not been declared " and "World.h, line 13 - 'GameObject' was not declared in this scope"?    I am using Linux GCC 4.8.1 compiler.


Undefined reference to PQfinish even though libraries etc. are included

I'm trying to compile a C++ application using libpq. On my Debian it compiles fine with the following command:  g++ -I /usr/include/postgresql/ -L /usr/lib/postgresql/9.3/lib/ -lpq -o test test.cpp   On my Ubuntu I get the following error:  undefined reference to 'PQfinish'   I've included link to postgresql headers and libraries and used the -lpq. What am I missing?


Do I need to begin from the first game for the story of Assassin's Creed?

I've got the original Assassin's Creed game somewhere in my house. When I finish a game I then intend to play it, but it seems to "move" and so I begin another game instead. Been going on for two years+.  My question is, should I bother with the first Assassin's Creed game? I know there are a lot more out there now. Will I miss a lot of the story if I were to jump straight to the second game? Or Unity?  Should I begin from the first game or are the later ones so much better that missing some of the story does not matter?


Windows says RAM ran out while there is still 4 GB of physical memory available

This System Information is from Process Explorer. There is still physical memory available but the system shows nearly no RAM left.  Task Manager also shows that about 74% of total RAM is used.  Since installing Windows 8.1, the computer had 4+8=12 GB of RAM. I upgraded it by changing the 4 GB to an 8 GB module. Could that be the problem? Or is this behavior normal and I've just misunderstood the meaning of available physical memory?


I have 14.04. I read on the pip readthedocs that pip is included by default with Python 3. When I installed Python 3 on Windows it was there, but I'm getting pip command not found on Ubuntu. I checked dpkg and it is not there. I also looked at the Ubuntu Python 3 port page and did not see anything. If pip is here, where do I find it and get it working? If it is not here, why and what else is missing from the default Python 3 that I should know about so I don't waste time looking for it?


Could you tell what are all the four points in following? Two circles intersect at two points maximum when we want to draw intersecting circles. But there we are solving quadratic equations, what is the argument about the other two missing points ?


Property set/get example for operator needed

Still trying to wrap a property into my Addon where I can dynamically control the values of the resulting variable.  Take the default operator_mesh_add example and alter the  definition of the width FloatProperty to be:   def get_func(self):     print('get_')     return self.actual_width  def set_func(self, value):     print('set_')     self.actual_width = value  class AddBox(bpy.types.Operator):     """Add a simple box mesh"""     bl_idname = "mesh.primitive_box_add"     bl_label = "Add Box"     bl_options = {'REGISTER', 'UNDO'}      actual_width: 1.0      width: FloatProperty(         name="Width",         description="Box Width",         min=0.01, max=100.0,         default=1.0,         set=set_func,         get=get_func,     )   this gives:   AttributeError: 'MESH_OT_primitive_box_add' object has no attribute 'actual_width'   if the get/set functions access the self.width member, there is an infinite recursion.  We really need a tangible example of how to use get/set within an operator setting.  Following  and making set/get:  def get_func(self):     print('get_')     return self['width']  def set_func(self, value):     print('set_')     self['width'] = value   results in:  KeyError: 'bpy_struct[key]: key "width" not found'   What is the right way?


Loading Wi-Fi Drivers by Configuring the Kernel

I am new to Linux *using Ubuntu 14.04) and am having issues getting my wi-fi drivers to install. I found the appropriate files online and pasted them into the /lib/firmware directory as the install notes say. However, I am at a loss of words on how to load those drivers in the kernel. I've Googled and not come up with much at all. This is what the install notes say:      The iwlwifi driver will look for the file iwlwifi-8000C-13.ucode using   the kernel's firmware_class infrastructure. More information can be   found under Documentation/firmware_class in kernel source. In order to   function correctly, you need to have this support enabled in your   kernel.  When you configure the kernel, you can find this option in   the following location:      Device Drivers ->                   Generic Driver Options ->                           Userspace firmware loading support      You can determine if your kernel currently has firmware loader support   by looking for the CONFIG_FW_LOADER definition on your kernel's   .config.      In addition to having the firmware_class support in your kernel, you   must also have a working udev and uevent infrastructure configured.   The steps for installing and configuring udev are very distribution   specific.      Once you have the firmware loader in place (or if you aren't sure and   you just want to try things to see if it works), you need to install   the microcode file into the appropriate location.      Where that appropriate location is depends (again) on your system   distribution.  You can typically find this location by looking in the   udev scripts of your distro, the default is /lib/firmware."   How do I do this?   Thanks for your help!  Edit: I used this in hte terminal   lspci -knn | grep Net -A2; uname -a   And I got the following information:   Network controller [0280]: Intel Corporation Wireless 8260 [8086:24f3] (rev 3a)     Subsystem: Intel Corporation Device [8086:1130] 05:00.0 PCI bridge [0604]: Intel Corporation Device [8086:1576]   From uname -a  Linux jeff-ThinkPad-P50 3.19.0-69-generic #77~14.04.1-Ubuntu SMP Tue Aug 30 01:29:21 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


Short story where a man stranded on Mars finds an abandoned Martian civilization with machines that try to provide him with food

It's an old story (maybe from the fifties?) about a man stranded on Mars, and about to die. He finds the remains of an ancient Martian civilization, now extinct. But the machines are still working, and provide him with food. But the problem is that the food is made for Martians, so he can't eat it. The story ends with the machines somehow turning him into a Martian, so that he can eat the food and survive.


SQL Server Error 8632 due to over 100,000 entries in WHERE clause

My problem (or at least the error message) is very similar to .  My customer is working with an SQL select-query, containing a where-clause with exactly 100,000 entries.  The query is failing with error 8632 and error message      Internal error: An expression services limit has been reached. Please look for potentially complex expressions in your query, and try to simplify them.)   I find it very peculiar that this error message is thrown, exactly at 100,000 entries, so I wonder if this is a configurable value. Is this the case and in case yes, how can I increase this value to a higher one?  On , there is the proposal to re-rewrite the query, but I'd like to avoid this.  Meanwhile I've found out that the list of entries I'm talking about contains natural numbers, quite some of them seem to be sequential (something like (1,2,3,6,7,8,9,10,12,13,15,16,17,18,19,20).  This makes the SQL where-clause something like:  where entry in (1,2,3,6,7,8,9,10,12,13,15,16,17,18,19,20)   I could transform this into:  where (entry between 1 and 3) OR       (entry between 6 and 10) OR       (entry between 12 and 13) OR       (entry between 15 and 20)   Can this be shortened by:  where entry in (1,...,3,6,...,10,12,13,15,...,20)   ...or something similar? (I know it's a long shot, but it would make software updates easier and more readable)  For your information: the data in the where-clause are the result of a calculation, done on another table: first the entries of that table are read and filtered at the beginning, then some extra processing is done (which is impossible to do using SQL), the result of that extra processing is more filtering and the result of that is used in the where-clause. As it was impossible to write the complete filtering in SQL, the mentioned method has been used. Obviously the content of the where-clause might change at every processing, hence the need of a dynamic solution.


Is "Happy Birthday!" a complete sentence? And if it is, what role are the words happy and birthday playing? Where is the verb? Can "happy" be a verb? I know in a sentence like "Go get the milk" there is an implied "You" at the beginning that makes it complete. Is there an implied verb?