how can I disable my unit from entering sleep mode?  Using Ubuntu 14.04 Mini-ISO. Don't have a gui.

I am getting a web server setup at home on an older AMD 2400+ desktop. I have Ubuntu 11.04 installed and running however, after a time, I can no longer browse to the server. When I go to the keyboard and press a key, everything magically works again.   I have looked through the BIOS and I am not seeing any power saving features enabled. Is there anything like that in Ubuntu? Can it be disabled?  I don't have any GUI installed. This is console only.


I am trying to model data that clearly looks like it has seasons. However I only pick up seasonality in very small subsets of the data and only after I add in lagged variables and eliminate trend.   I first found the trend the data is best approximated by, then determined the relevant seasonal dummies (which is none), and then looked at the correlogram of my new model to determine the AR process.  Once I added in my lagged variables my trend was rendered statistically insignificant, so I took the trend out. Additionally, I thought it was weird I got no seasonality. So just on a whim I decided to to input my seasonal dummy variable after I added in my lags. And season 4 was then highly significant!  I then played around with adding in different seasons and found the model with the lowest SIC(Schwarz Information Criterion, as listed in the output below) of all the models I constructed has two lags and one seasonal dummy.     The most important question is about the role of lags in my model. Why would controlling for serial correlation first allow me to see seasonality? Does the order of controlling for certain dynamics matter? Can I control for cycles, then seasons, then trend? Or should I control these dynamics in a specific sequence?

In my logistic regression the sign of coefficients of a variable (location distance of an amenity) changes based on other variables (with time -ve, with travel distance +ve) in the model. When the location distance is the only variable in the model, it has +ve sign.    Should the variable need to maintain the +ve sign no matter what other variables are added in the model? Does changing sign signify a multicollinearity issue? Some IVs are gaining significance while in a bivariate model, they didn't show significance and vice versa. Is it okay to add variables that don't have much significance (ex: travel distance has a significance of 0.33 individually, but 0.05 when added with other variables) but becomes significant in the model? thanks.


It print the list how I want it but I want them next to each other on the same line instead of on different lines. The inputs that I am using are abcdefghi and jklmnopqr  str1 = (input("please enter a string: ")) str2 = (input("please enter a string: "))  for i in range(0, len(str1)):   e = str1[i] + str2[i]   print(e)   I want it to print something like: ajbkclemdnfogphqir  but it prints it like this:  aj  bk  cl  em  dn  fo  gp  hq  ir

I'd like to do it in Python. What I'd like to do in this example in C: #include <stdio.h>  int main() {     int i;     for (i=0; i<10; i++) printf(".");     return 0; }  Output: ..........  In Python: >>> for i in range(10): print('.') . . . . . . . . . . >>> print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . .  In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to "append" strings to stdout.


I just wondering below code ! I had never seen and heard before .Why string date is equal to 0 ? Is there any documentation for that..  <?php $p = "date"; $n = 0; $m = 1; var_dump($p == $n);//true var_dump($p == $m);//false var_dump($n == $m);//false ?>

What is the difference between == and ===?  How exactly does the loosely == comparison work? How exactly does the strict === comparison work?  What would be some useful examples?


The title is pretty descriptive of my question. As an example, say I use the MD5 hash function to create a hash key of the word "hello": 5d41402abc4b2a76b9719d911017c592.  There are two questions I would like to have answered:   How difficult would it be to calculate any new string that would hash to the same key as "hello"?   and    How difficult would it be to calculate a particular new string that would hash to the same key as "hello"?

What's the practical status of  w.r.t. ?  Integrity of a piece of data is protected by an MD5 hash, itself assumed genuine. The data (and thus the hash) is known to the adversary. The adversary can change the data, and wants to do that while leaving the hash identical. Denote the data size as $K$, in 512-bit block increment, and assume that could be sizable (e.g. $K\approx2^{35}$, which is less than one big hard disk). The original data could follow some pattern (e.g. repeated 512-bit blocks). To some degree, the adversary could even choose some data in the original (e.g. embedded in some innocent-looking file); but we must assume that the adversary can't predict some of the data before what it injects, else the      MD5 apply.  A generic second-preimage attack is applicable to  hashes, with cost $2^{129-k}+2^{65}$ hash rounds for MD5, where $k=\log_2K$, but that's not exactly cheap (it is attributed to R. D. Dean in his 1999  sect. 5.3.1, and also exposed by J. Kelsey and B. Schneier in their 2005 ).  Has anything more practical surfaced?


We have a barcode scanner that we use to track student assignments. I am trying to create a Google Spreadsheet that tracks the assignments for each subject.  I have been using the following script:  function onEdit() {   var s = SpreadsheetApp.getActiveSheet();   if( s.getName() == "Sheet1" ) { //checks that we're on the correct sheet     var r = s.getActiveCell();     if( r.getColumn() == 13 ) { //checks the column       var nextCell = r.offset(0, 1);       if( nextCell.getValue() === '' ) //is empty?         var time = new Date();         time = Utilities.formatDate(time, "GMT", "HH:mm:ss");         nextCell.setValue(time);       }     }   } }   However I do not know how to modify the script so that it works in multiple columns on the same spreadsheet. For example a subject may have 2 assignments: Assignment 1 and assignment 2  For assignment 1 I need to scan into column A and have the date stamp added to column B.  For assignment 2 I would scan into column D on the same spreadsheet and have the date stamp added to column E.

Need help in adding another function using the below script. I would like to have a timestamp "start" and "end" on two different columns, whenever the other two separate columns are edited. Based on the below script, I could only have one time stamp, from one column which is the column 2 and time stamp on column 10.  function onEdit()  {  var s = SpreadsheetApp.getActiveSheet();  if( s.getName() == "Sheet1" ) { //checks that we're on the correct sheet    var x = s.getActiveCell();    if( x.getColumn() == 2 ) { //checks the column      var nextCell = x.offset(0, +8);      if( nextCell.getValue() === '' ) //is empty?        var time = new Date();      time = Utilities.formatDate(time, "GMT", "hh:mm");        nextCell.setValue(time);    };  }; }


int main(){     int array[] = [10,20,30,40,50] ;     printf("%d\n",-2[array -2]);     return 0 ; }   Can anyone explain how -2[array-2] is working and Why are [ ] used here? This was a question in my assignment it gives the output " -10  " but I don't understand why?

As Joel points out in , in  (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a]  Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a]?


Sometimes I put a comment on a post for a problem that is then fixed and the OP gives a comment to tell me so.  It seems strange to delete the comment and leave his comment hanging there, but since my comment is no longer applicable, shouldn't it go?  Is there something else I should do?

In  it says that flagged comments can be handled automatically if flagged repeatedly (3 + (score / 3) flags = deletion). Which is great; mods are busy people.  In , the venerable Bill the Lizard says that if all comments on a post are obsolete, you can flag the post (or one of the comments) with a custom flag saying that they're all obsolete, and the mod can remove them with one fell swoop. Problem is, that requires a mod.  What should I do when some of the obsolete comments are mine? I can't flag my own comments, and I don't like raising custom flags if I can avoid it.  You're wondering why I don't just delete them. There are two scenarios where I don't, at least not immediately:   Someone has commented with incorrect information. In that situation, I reply to the comment telling them how they've got it wrong. (Sometimes, of course, they quite correctly reply telling me how I got it wrong, which is neither here nor there — we still end up with obsolete comments. :-) ) Frequently, they reply saying "you're right" but (near universally) leave the comment lying around. I can (and do) then comment again saying "Let's clean these up" and flag their comments as obsolete. But I can't flag mine. Nor do I want to remove mine while the incorrect comment is still there; it leaves a confusing situation for anyone coming to the post later. Someone has commented with correct information. In that situation, if appropriate (e.g., the post author isn't busily editing at the same time and I know enough to do it properly), I'll edit the comment into the post and reply with "You're right, edited that in." and flag their comment as obsolete. These are rarely removed by the commenter. And again I can't flag mine.   The first scenario is the more problematic, since I can go back 10-20 minutes later and remove my "edited that in" comment and there's no harm if their comment is still there.  I currently bookmark and check back periodically, but that's labor-intensive and I'd like a better way.  Ideally, I'd want to tie my comment to one I've flagged so that it's deleted automatically if the other one is (by flagging, or by the commenter). That's a fair bit of development, though, I'm guessing.  What should I do? Go with a custom flag saying "The conversation between X and me is now obsolete," even though that means dumping it on a mod?


Find the smallest value of $a\in\mathbb{N}$ such that $7^{21}\cdot 2^{50}+a$ divisible by $9$. The only thing I know is that an integer is divisible by $9$ is the sum of its digits is divisible by $9$.

I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.


So basically I have butter but not oil and need 100 ml of oil .Is it okay if use 100 g of butter?If not whats the best thing to do?

Just a moment ago, I was making muffins. The recipe calls for 125ml oil. As a footnote, it says that you can replace the oil with 125g butter.  Can you do so in every recipe (not just muffins or pastry)?  I've found , but the amounts aren't the same (while my recipe says to use the same amount).


Input to textarea :(These 3 lines)   <textarea id="preM" rows="3" cols="10" style="resize: none; width:100%;"> </textarea>
      This is example of textarea   This is new Line   Hello All   In JSP page I am retrieving the value of Text Area  String variableString = request.getParameter("preM"); System.out.println(variableString);   Output is coming as:     This is example of textarea This is new Line Hello All   Expected output:     This is example of textarea   This is new Line   Hello All   I have already tried   StringBuffer preM = new StringBuffer(request.getParameter("preM")); int loc = (new String(preM)).indexOf('\n'); while(loc > 0){   text.replace(loc, loc+1, "
");   loc = (new String(preM)).indexOf('\n'); } out.println(preM);   But getting loc=-1.

How do I get a platform-dependent newline in Java? I can’t use "\n" everywhere.


While sleeping, some people may leave the light on or dim it down, so that perhaps it is equal to a 35W or 20W regular light bulb.  In this case, is it true that the pineal gland in our brain won't secrete melatonin during the sleep, and therefore have harmful effects to the human body?  What if we occasionally cover our body and even the head temporarily using the quilt during our sleep, so that there is close to no light that gets to our skin (as it is said that even light on the skin can affect the pineal gland to not secrete melatonin).  There are some variations to this, and I wonder if it is similar:   If there is a street light or community light post outside of the window, so throughout the night there is as if a 10W or 20W light bulb inside the room. If the light in the room is turned off, but the hallway has a ceiling light and it is on, while the bedroom door is about 80% closed but some light in the hallway can come in. Some people may leave the TV on (and possibly turning the volume to quite low) while sleeping. It is said that blue light might have the biggest effect out of the light spectrum on our pineal gland to not secrete melatonin, as most electronic devices do, such as a smartphone screen or LCD/LED TV screen). So if we turn off the light but leave the TV on, then it might still be the same issue or even more so.

Many articles on the internet write about melatonin and its effects, making you tired. A lot of articles also point out how the use of devices before going to bed in modern days likely decrease melatonin production. Therefore, making it harder to fall asleep. But this information is only about the process of getting to sleep, before we are actually sleeping.  A recent Harvard Medical article 1 states:     High exposure to bright, artificial outdoor lights during the night may result in sleepless nights for older adults.   Referring to a publication on Nov. 15, 2018, in the Journal of Clinical Sleep Medicine.  Considering that:    many people nowadays, use their mobile devices in bed prior to going to sleep; modern cities or houses have (street) lights that are always enabled at night; ignoring the phase of falling sleep; focusing only on the time we are asleep already, so during the actual sleep cycles.   Does a darker room with less or no (artificial) light pollution improve sleep quality, with all associated health benefits as a result? In other words: Does light pollution, while asleep decrease the sleep quality or does light pollution only negatively affect the phase of “falling asleep”?  I wasn't able to find any studies or information regarding sleep quality in relation to light pollution during sleep. Were such studies performed? Are there specific moments when light pollution affects sleep quality the most, for example during REM-sleep or in a specific sleeping phase?    1


Problem: USB not recognized during boot  Installed Ubuntu Release: 18.04  Platform: Compaq Hp 1910b notebook  USB file layout: As shown below  dr-xr-xr-x 1 sqladmin sqladmin  2048 Oct 17 08:52 boot dr-xr-xr-x 1 sqladmin sqladmin  2048 Oct 17 08:52 casper dr-xr-xr-x 1 sqladmin sqladmin  2048 Oct 17 08:50 dists dr-xr-xr-x 1 sqladmin sqladmin  2048 Oct 17 08:52 EFI dr-xr-xr-x 1 sqladmin sqladmin  2048 Oct 17 08:52 install dr-xr-xr-x 1 sqladmin sqladmin 34816 Oct 17 08:52 isolinux -r--r--r-- 1 sqladmin sqladmin 34802 Oct 17 08:53 md5sum.txt dr-xr-xr-x 1 sqladmin sqladmin  2048 Oct 17 08:50 pics dr-xr-xr-x 1 sqladmin sqladmin  2048 Oct 17 08:50 pool dr-xr-xr-x 1 sqladmin sqladmin  2048 Oct 17 08:50 preseed -r--r--r-- 1 sqladmin sqladmin   225 Oct 17 08:50 README.diskdefines lr-xr-xr-x 1 sqladmin sqladmin     1 Oct 17 08:50 ubuntu -> .   Is the problem with the file layout? The boot sequence is CD, USB, Disk  Thanks;  Sherman

I have a laptop with Ubuntu installed as the only OS. I also have a USB stick with a Windows 7 installation on it. I want to install Windows from the USB stick on my laptop but when I try to restart the laptop to get access to BIOS, I can't seem to find the command for it, its like it skips everything and just says Ubuntu and then takes me to the login screen.  How do I change the boot priority to USB in Ubuntu?


I have been looking everywhere online trying to find a way to make the Blender interface bigger. I have a lot of trouble seeing the text in the default theme. I have tried adjusting the fonts, which makes some of it easier to read, but then the fields the words are in are not big enough and seem to be getting cut off. I am not sure if there is a fix for this. Maybe there’s a theme called Old Guy Special? If anyone can help I would be grateful.

I've downloaded a .blend file recently and all of the interface elements look very small. I remember that there were an easy trick to make everything bigger (or smaller) when I was using Blender 2.49 long time ago. My question is how to do it increase or decrease the size of the buttons within the panels using User Preferences and without using it?


I have a class A as mentioned below:-  class A{      int iData; };   I neither want to create member function nor inherit the above class A nor change the specifier of iData.  My doubts:-   How to access iData of an object say obj1 which is an instance of class A? How to change or manipulate the iData of an object obj1?   Note: Don't use friend.

Disclaimer Yes, I am fully aware that what I am asking about is totally stupid and that anyone who would wish to try such a thing in production code should be fired and/or shot.  I'm mainly looking to see if can be done. Now that that's out of the way, is there any way to access private class members in C++ from outside the class?  For example, is there any way to do this with pointer offsets? (Naive and otherwise non-production-ready techniques welcome) Update As noted in the comments, I asked this question because I wanted to write a blog post on over-encapsulation (and how it affects TDD).  I wanted to see if there was a way to say "using private variables isn't a 100% reliable way to enforce encapsulation, even in C++."  At the end, I decided to focus more on how to solve the problem rather than why it's a problem, so I didn't feature some of the stuff brought up here as prominently as I had planned, but I still left a link. At any rate, if anyone's interested in how it came out, here it is:   (I suggest reading it before you decide that I'm crazy).


The macOS gui, as shown in the attached image, provides a way to add users and user groups to the permissions of a file system directory.  There are also lots of examples of how to create groups from the command line, etc (dscl, and so forth).  But I don't see anything on how - from the command line - to add user groups to the permissions of a file system directory.    PS: The answers in  covers network shares, but don't show how to do what the Finder does (on an unshared folder).

Using the sharing or dscl commands I can not figure out how to add users associated to shares. The current local-admin account has access to all shares, but I'd like to add a different user account the ability to access some of the AFP shares.   Strangely, I can't even figure out how to list who currently has access to each of the AFP SharePoints.   So, looking for command line solution to the following two questions:  1) how to list current users associated to a particular sharepoint? 2) how to add a user to a sharepoint?


So I have Ubuntu and Windows 7 on a 500GB hard drive setup for dual boot. Recently some of the sectors on the Windows 7 partition of the drive went bad. I want to upgrade the hard drive I have now to a 2TB one and also get rid of the sector issue at the same time.   What would be the best (and safest) way to go about transferring the whole system to a new, larger hard drive?

The HDD I have my Ubuntu installed is about to fail. I would rather not lose 3 years worth of data, customisation and apps. I am looking for a way to move the complete system (SWAP included, because I'm not sure if I can relink the system to a new SWAP partition) to another HDD. But not the complete HDD< only the partition containing Ubuntu, to a partition on a different HDD. Basically I'd like to do what I've been able to do with Norton Ghost for my Windows install. I thought about using Clonezilla but I think I would have issues with GRUB (Especially trying to boot from a different UUID than what is in the conf file). do you know of any way this could be done?  PS, my home directory is encrypted but that's not really an issue, because I can work around that.  EDIT: changed the explanation to make it clearer


I'm confused on how to get the data usage information into the variables to determine if the file size are acceptable. How do I make the variable and direct it to the rest of the script?  Write a script (called passwd_size.sh) that does these tasks:   Find the size of the /etc/passwd file If the size is greater than 2000 bytes, display a message that the file exceeds size, otherwise, display message that the file is within the size limit.     du -c "/etc/passwd" num=0 if [ $num -gt 2000 ]; then echo "File exceeds size limit." fi if [ $num -lt 2000 && -eq 2000  ]; then echo "File is within size limit." fi   Any help is greatly appreciated!!!

I'm writing a script and I would like to pass the results from bc into a variable. I've declared 2 variables (var1 and var2) and have given them values.  In my script I want to pass the results from bc into another variable say var3 so that I can work with var3 for other calculations.  So far I have been able write the result to a file which is not what I'm looking for and also I've been able to echo the result in the terminal but I just want to pass the result to a variable at moment so that I can work with that variable.  echo "scale=2;$var1/var2" | bc


I am a Vietnamese national, who is studying in Nicosia, Cyprus since June 2016, in a four-year Bachelor's degree program in business administration. My application for UK tourist visa was submitted on 13 December 2016 and was refused on 20 December 2016.  Submitted document list:    Student residence permit (valid until 05 June 2017)  College registration letter  College holiday letter  Student card  Six months bank statements (including 3 receipts of money transfers from mother in Vietnam)  House contract (for 2 years until June 2018)  Air ticket reservation  Hotel reservation Travel insurance    Included mother's documents as follows:    Business license  Tax for the last three month Annual tax  Sponsor letter   Property in mother's name   Bank letter with balance equal to 12,000 Pounds (which issued from 01/03/2016-01/03/2017)  My birth certificate      The decision: You have applied for an entry clearance as a General Visitor to the United Kingdom for 6 days and propose tourism.       You have declared that you are a student and not employed. Whilst you have   included customer credit transfers these do not evidence the original source of the funds, I am therefore not satisfied that your circumstances are such that you would leave the UK if admitted.       You state that you spend between 600-650 pounds per month on living costs, you have not demonstrated how you support yourself and the source of the funds. You state that you will have 2500 pounds available for your trip. Given your financial circumstances, balanced against your proposed expenditure I am not satisfied that you would leave the UK if admitted.      The financial documents you have submitted do not show the origin of the funds and therefore I am not satisfied that they are genuinely available to you. From the information declared on your application form and the documents submitted, you have not shown that you will be able to maintain and accommodate yourself during your proposed visit in the UK your application has therefore been refused under paragraph V4.2（e)   The customer credit receipts reflected on my bank statement are transfers from my mother for living expenses. Why was the ECO confused about where the funds originate? What should I do in the next application？

I have applied recently for a general visitor visa to the UK to spend 10 days during Christmas with my British unmarried partner and it has been turned down.   The Entry Clearance Officer stated on his refusal notice the following:     I note that you have never previously travelled to the UK or any country with similar immigration requirements and you therefore do not have a history of travel and compliance to consider.      You have submitted an employment letter to confirm your occupation in KSA but I am required to also assess your personal, domestic and economic circumstances in determining whether you are genuine visitor travelling to the UK for the period and purpose you state.      You claim an income of SAR ........ per month which equal ........ GBP and from the evidence submitted this appears to be your sole source of income.   I note that this monthly income is reflected on your bank statements. However, the bank statement you have presented show a recent large deposit that are in excess of your stated income and inconsistent with the account history. You haven't provided evidence toward the origin of this recent deposit and in the absence of reasonable evidence I am not satisfied that these bank statements accurately reflect your personal circumstances.      In view of the above, I am not satisfied you have demonstrated that your circumstances are as you claim and therefore I am not satisfied that you're travelling to the UK for the period and purpose you stated. 41(i)and(ii).   Its true that I have deposited that sum of money right before I apply and it was a commission I received from work earlier this month.   So, could you please give me your advice on the above as I am planning to apply again soon. and how to avoid my application being refused again?


#include <stdio.h> int main() { int a=3, b = 6; printf(&a["Hi!Hello! %s\n"], &b["Mnnit/Softathalon"]); printf(&a["WHAT%c%c%c %c%c %c !\n"], 1["this"], 2["beauty"],0["tool"],0["is"],3["sensitive"],4["CCCCCC"]); return 0; }  output:  Hello! Softathalon That is C !  Why is this the output? Can anyone explain different format specifier in it?

As Joel points out in , in  (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a]  Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a]?


Currently reading The Hobbit to my daughter, and we came to the Barrels out of Bond chapter where the Dwarves are captured and imprisoned by the Wood Elves. Bilbo sneaks in with his magic ring of invisibility and eventually sets them all free.  But here's what piqued my curiosity: in the chapter it makes clear that Bilbo wore the one ring constantly for a very extended period of time: it specifically states he was down there at least two weeks and then - it's much less clear - possibly for even longer while he came up with and implemented his plan to rescue the Dwarves.  However in The Lord of the Rings, Frodo is constantly terrified of putting on the ring lest he (and the ring) should be located by Sauron. So why does Bilbo, wearing the ring for several weeks, escape detection?  The obvious thought is that Sauron was simply not powerful enough at this time. But that seems a pretty thin claim in many ways. Sauron was powerful enough to be "recognised" as a dangerous sorcerer in his guise as the Necromancer, and to start to gather his followers together. You'd have thought that simply locating the Ring would require a pitiful amount of comparative effort.  Furthermore I believe it's implied in The Lord of the Rings that it becomes increasingly dangerous to use the Ring the closer it gets to its maker (I don't have a reference for this - might be my imagination). If so, things become even more inexplicable since Thranduil's palace wasn't actually all that far from Dol Guldur, where Sauron was holed up.  Any explanation? Or do we have to chalk it up to the poetic license due to a world in development?

When Frodo put on the One Ring, both the Nazgul and Sauron himself found Frodo. However when Bilbo had the ring and possibly used it many times, Sauron sought Gollum to get a hint on where to look for the ring and send the Nazgul after it.   Sauron sought Gollum before Bilbo wore the ring at his birthday party, slightly after that time, he was very effective at locating Frodo when Frodo put on the ring. So I guess it's not a matter of Sauron gaining any extra powers with time.  Also Bilbo seemed to use the ring without it bothering him at any point, unlike Frodo who seemed to be very troubled when using the ring. How is that possible?


In Feeds section,  the content is not getting displayed properly. Plz refer image. Mostly starting content is not displayed   App Version: 1.0.85 Device Manufacturer: Xiaomi Device Model: 2014818   OS Version: 4.4.4 (V7.1.1.0.KHJMICK)

SE Android App Version: 1.0.84  There is a display issue in the Feed section. The Earlier today, the below sections and the post title are not visible.  There is no exact steps to reproduce. It doesn't happen when the app is initializing. But if you open the Stack Exchange app, navigate to some other apps, then come back after few minutes, I can see this issue (but not all the time).  When the issue is there, if I manually click the Feed option in the navigation sidebar, the display issue is fixed.  I have recorded the issue:


I have been playing this game for awhile now. I have done worlds with Corruption, and worlds with Crimson. I understand the differences between the shadow orbs and crimson hearts. I have destroyed Crimson hearts in one world, fought the associated boss..and then farmed him.  Now, I am ready to enter hard mode. After doing some research I find out that Corruption and Crimson cannot exist in the same world. WIth that being said, you are required to destroy "The Eater of Worlds" in order to enter hard mode, and he only spawns via Corruption shadow orbs.    Since I am stuck in a world with only Crimson, I can destroy crimson hearts all day, but not shadow orbs.    Does this mean that I am never able to turn this world into hardmode? Are worlds only able to be turned into Hardmode when they have Corruption and Shadow orbs?  Thanks!

What items do I need to make my world Hard Mode?


Consider the following C struct:  struct person {     char *name;     unsigned int age; };   In many samples of C code that I have recently come across, I have seen structs instead declared in the following manner:  typedef struct {     char *name;     unsigned int age; } person_t;   Other than brevity in that a declaration can then be made as person_t bob rather than struct person bob, is there any advantage to doing this? Furthermore, what is the standard convention within the C community for when do declare a struct the normal way versus when to declare it within a typedef?

I have seen many programs consisting of structures like the one below  typedef struct  {     int i;     char k; } elem;  elem user;   Why is it needed so often? Any specific reason or applicable area?


The  spell description says:  Starting with the creature that has the lowest current hit points, each creature affected by this spell falls unconscious until the spell ends [...]  So an  creature has penalties, and these two in particular are why I am confused:   The creature drops whatever it’s holding and falls prone.  [...]  Attack rolls against the creature have advantage.   But when you look at the rules for the  condition:  An attack roll against the creature has advantage if the attacker is within 5 feet of the creature. Otherwise, the attack roll has disadvantage.  The unconscious condition says that attack rolls against my target have advantage, but the prone condition says that if I'm not within 5 feet I have disadvantage on my attack. Do these cancel out?

The unconscious condition states the following two effects (PHB 292):      The creature drops whatever it's holding and falls prone.     Attack rolls against the creature have advantage    Under the prone condition it says (ibid):      An attack roll against the creature has advantage if the attacker is   within 5 feet of the creature. Otherwise, the attack roll has   disadvantage.    The rules of advantage/disadvantage include the following paragraph (PHB 171):      If circumstances cause a roll to have both advantage and disadvantage,   you are considered to have neither of them, and you roll one d20. This   is true even if multiple circumstances impose disadvantage and only   one grants advantage or vice versa. In such a situation, you have   neither advantage nor disadvantage.    The question then is, does one receive advantage for a non-adjacent attack against an unconscious foe?  Are the effects of unconsciousness written to define the condition as it is, or are we meant to "calculate" the full truth by recognizing that the unconscious advantage and prone disadvantage (of non-adjacent attacks) should cancel out?


Hi there so i am new to java and am learning it, so i put together this little script, so i was wondering why it dosent work:  public class Main {      public static void main(String[] args) {         String text;          try (Scanner input = new Scanner(System.in)) {              System.out.println("Input");              text = input.nextLine();              while (text == "sampleText") {                 System.out.println("outputText");             }         }         System.out.println("Your input " + text);      } }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I am trying to import a file that has 2 versions (which are identical). Inside the file I have a class, lets say, "X", which I need to create 2 instances of. One from the first version of the file and another from the other version. I tried to do something like: sys.path.append(os.path.dirname(<version1>)) from <version1> import X as class_of_version1  sys.path.pop()  sys.path.append(os.path.dirname(<version2>)) from <version2> import X as class_of_version2  but I do not get the requied result.  It just uses "version1" on both cases. I do not want to add any  __ init __.py files, as I do not have permissions to change "version2". Any ideas? Thank you in advance

How can I load a Python module given its full path? Note that the file can be anywhere in the filesystem, as it is a configuration option.


I recently had this problem upgrading Google Chrome in 18.04. I noticed my version had was stuck at 70.x, even though the most stable version was 77.x. I tried re-adding the PPA a bunch of times, but that just caused more errors, because it was now "configured multiple times." This obscured the one crucial error I missed, whenever I ran sudo apt-get update:  E: Repository 'http://dl.google.com/linux/chrome/deb stable Release' changed its 'Origin' value from 'Google, Inc.' to 'Google LLC' N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

I have Google Chrome Version 70.0.3538.77 (Official Build) (64-bit).  Today, after running sudo apt update and sudo apt full-upgrade, I saw:  E: Repository 'http://dl.google.com/linux/chrome/deb stable Release' changed its 'Origin' value from 'Google, Inc.' to 'Google LLC' N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.   I looked at the man page for apt-secure but it's pretty technical and difficult, at least for me, to follow.  So how do I fix this issue?    Edit: for now, I've removed the existing Google Chrome ppa from Software Sources and then ran sudo apt update and sudo apt full-upgrade successfully with the following being installed/upgraded successfully:  The following NEW packages will be installed:   python3-netifaces The following packages will be upgraded:   netplan.io nplan ppp 3 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.


Ubuntu 14.04. I have 2 user accounts. This problems appears only for one of it. I have no more icons on my desktop, neither the launcher, just the desktop picture. Right click still works, so I can access system settings. When using gnome, everything works perfect.

When I login, nothing happens.   I am presented with my desktop wallpaper.    No Dash, no Launcher, nothing.


How do I add Trash to my GNOME shell favorites (and thus to Ubuntu dock)?  Ubuntu 16.04 Unity - Trash Bin

I just installed Ubuntu 18.04 and don't like having the trash icon on the desktop rather that in the launcher (Ubuntu dock).   How can I move it back to the launcher? Can other icons be moved from the desktop to the launcher?


Those prefixes "Anti", "bi" etc would look odd as separate words, but then, even complete words like "country" or "state" ending with a dangling hyphen look odd. So what is the correct rule for this? Should I play safe and use it like "Anti-American and pro-American"? Please suggest the correct way to do it. Wikipedia article on English hyphens was of little help over this.

Assuming that these two words  off-topic on-topic  must be hyphenated, which of the punctuations in the following sentences is correct? (crucial part emphasized)  Regardless of whether it is an off or on-topic example, it is a brilliant consideration in the definition of this proposal. Regardless of whether it is an off- or on-topic example, it is a brilliant consideration in the definition of this proposal.  I know you can get around this with a verbose constuction like off-topic or on-topic, or by not hyphenating either and treating off and on and topic as separate words, but neither suggestion really does anything to answer my question.


I tried to search for the best way to add classes to default Gutenberg blocks and was unable to find anything. What I need to do is add a class that I can target on each default block that Gutenberg comes preinstalled with. So for the blocks that are just paragraph text, headings, etc. I would need to add the same class to all of those blocks.

I'm trying to add an extra class name to all the blocks by extending them. Documentation:    I'm using blocks.BlockEdit to modify the edit component. I want to add a custom class name.  So far I have this  const withClass = createHigherOrderComponent( ( BlockListBlock ) => {     return ( props ) => {         let wrapperProps = props.wrapperProps;         wrapperProps = {             ...wrapperProps,             className: 'my-custom-class',         };          return <BlockListBlock { ...props } wrapperProps={ wrapperProps } />;     }; }, 'withClass' );   It's working by adding the custom class to the wrapper but it is overwriting the default block class. Is it possible to append to the current classes without overriding?


My sons MacBook Pro 13" Retina (Early 2015) has a problem with the built-in screen. It will very shortly look OK, followed by what to me looks like a HW  issue, with strange patterns and lines.  But the odd thing is that whenever I plug in the HDMI, to an external screen - both the built-in, and the external screens look fine.  Sometimes I can also run the machine without the problem happening. I have tried to work the hinge on the screen, but there is no flicker or any reaction.  Is this still a HW issue, or could it be something else?

My MacBook Pro was displaying normally until recently. Now when I boot it up it  displays different colors, sometimes white on the screen, but when I hook it up to a TV screen it displays normally.  I need help as to what could be causing this problem and how to fix it?  So far I've tried resetting NVRAM and reseating the RAM, but this didn't help. I also haven't upgraded any software nor added any new items of hardware, so this change in behaviour cannot be attributed to any known actions on my behalf.


I have very tenuous memories of this movie, watched on VHS in the mid-eighties.  The hero, a young man, had to rescue a young woman (princess?) from a massive number of obsidian, or at least shiny black, robots or golems or something.  Something significant about their hearts, maybe hearts were transplanted from living creatures into the robots?  The cover depicted a bunch of the robots in a wedge advancing across a featureless plain, the lead robot holding the woman in its arms.  The hero and his friends (mutants/aliens/monsters?) are standing on a cliff ledge overlooking the robots.

It was a weird sci-fi animated movie I saw only a little bit of it. This is what I recall:   It was old but had color, so I assume it was late 1960s to early 1970s. The animation and style reminded me of  but it wasn't as psychedelic. The setting was an alien planet with all sorts of bizarre creatures. The tech was advanced but not a dominant aspect of the planet's culture. The people lived simple and peaceful. The protagonist is a man with bluish skin like the others. The antagonists were humanoid shaped black robots that shot a beam that would turn people into stone.


I am facing this issue while i am trying to make use of abstraction concepts for my tests.  My SignIn page class:  public class SigninPage {  protected AndroidDriver driver;  String app_package_name = "com.xyz.abc:id/"; By signInBtn = By.id(app_package_name + "btn_sign_in"); By enterEmail = By.id(app_package_name + "et_email"); By enterPassword = By.id(app_package_name + "et_password");  public void signInProcess(String username, String password) {     System.out.println("Clicking on Sign in button");     driver.findElement(signInBtn).click();     System.out.println("Enter valid Email");     driver.findElement(enterEmail).sendKeys(username);     System.out.println("Enter password");     driver.findElement(enterPassword).sendKeys(password);     System.out.println("SignIn");     driver.findElement(signInBtn).click();   } }   My Test Class:   public class SignIn extends LaunchEmulatorAndDeployAPK {  SigninPage sp = new SigninPage();  @Test public void signInByRegisteredUser() throws Exception {     sp.signInProcess("xyz@test.com", "testpassword");     //Launch Page     Thread.sleep(3000);     By successMessage = By.id("testpath");     Thread.sleep(3000);     boolean result = driver.findElement(successMessage).isDisplayed();     System.out.println("The success message is displayed: " + result);     String text = driver.findElement(successMessage).getText();     System.out.println("The success message text is : " + text);    } }   My Base Class:    public class LaunchEmulatorAndDeployAPK {   protected AndroidDriver driver;  @BeforeTest protected void prepareAndroidForAppium() throws MalformedURLException {     File appDir = new File("E://path");     File app = new File(appDir, "test.apk");     DesiredCapabilities capabilities = new DesiredCapabilities();     capabilities.setCapability("device", "emulator-5554");      // mandatory capabilities     capabilities.setCapability("deviceName", "emulator-5554");     capabilities.setCapability("platformName", "Android");      // other caps     capabilities.setCapability("app", app.getAbsolutePath());     driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); }  @AfterTest public void teardown() {     driver.quit();   } }   I am getting nullpointer exception while running my test class  Clicking on Sign in button FAILED: signInByRegisteredUser java.lang.NullPointerException at com.xyz.abc.pages.SigninPage.signInProcess(SigninPage.java:20) at com.xyz.abc.scenarios.SignIn.signInByRegisteredUser(SignIn.java:17)

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I would like to open the terminal from the login screen. In previous Ubuntu releases I just used Ctrl+Alt+F1. However, when I press Ctrl+Alt+F1 in 18.04, nothing happens, the login screen just stays as it is. All other combinations with F-keys (F2 to F12) also have no effect whatsoever.  What key shortcut do I have to press to open the terminal from the login screen?

After upgrading to 17.10 like a true pioneer, I found the old CtrlAltF1 no longer switches between console mode and GUI, and a quick Google search brought up nothing useful. Was this feature removed entirely?


I would like to draw these following diagram (table or graphix) in latex (i attached them), is it possible?

I am creating a block-diagonal matrix and want to use boxes along the diagonal but the boxes don't touch each other, so it looks funny.  What's a workaround for this?  Here's my code:  \documentclass{article} \usepackage{amsmath} \begin{document} \[   \begin{bmatrix}            \fbox{$B_1$} & 0 & 0  \\      0 & \fbox{$B_2$} & 0 \\      0 & 0 & \fbox{$B_3$} \\    \end{bmatrix} \] \end{document}   something like the matrix in the middle ...of this answer (but without the red and color filling)    Thanks,


If I want to fly from departure location and return to departure location on specified date but no specific destination.   Is there a flight booking site that allows no specific destination?

Several airline and trip planning sites will allow you to check "I am flexible with my dates" or a similar option.  Is there any way to also search more broadly for location?  For example, if you wanted to leave from YYZ or YKF and arrive at any airport in California, can a search for such flights be done somehow?  I ask because when I plan plane trips, I want the lowest price.  I'm OK with leaving a day or two later if I save $200 (same with the return trip).  There are 3 airports within 80 km of me, I'll leave from the one with the cheapest flight. And I'm also OK with changing the trip to spend time exploring San Francisco instead of lying on the beach near San Diego, and that sort of thing.  Normally this would take dozens of searches, but I'd like to see it all at once.


Matrix multiplication is not commutative. If however $$ AB = BA $$for the matrices A and B with $$A, B \in M_{nn}(\mathbb{K})$$  Can I conclude that A has to be of the form $$A = B^{Ad} = det(B)B^{-1}$$? Or when is $$ AB = BA $$

I know that matrix multiplication in general is not commutative. So, in general:  $A, B \in \mathbb{R}^{n \times n}: A \cdot B \neq B \cdot A$  But for some matrices, this equations holds, e.g. A = Identity or A = Null-matrix $\forall B \in \mathbb{R}^{n \times n}$.  I think I remember that a group of special matrices (was it $O(n)$, the ?) exist, for which matrix multiplication is commutative.  For which matrices $A, B \in \mathbb{R}^{n \times n}$ is $A\cdot B = B \cdot A$?


I receive the weekly Pinterest newsletter. When I click on an image or the Available on Google Play logo inside, a built-in popup comes up on my phone offering me to open the link with Chrome or Pinterest. The key here is the Pinterest app. On my laptop it brings up a pinterest.com link.  So I was working on our newsletter and decided to do this. All I did was to set the google play link of our app in the  section, but it opens Google Play instead of offering me the option to open the app on my phone.     How can I do this?  SOLUTION  I would like to answer this question for those who don't understand how it works, like me, but unfortunately stackoverflow doesn't let me do it.  This is what I did:  Manifest:  <intent-filter>    <action android:name="android.intent.action.VIEW" />    <category android:name="android.intent.category.DEFAULT" />    <category android:name="android.intent.category.BROWSABLE" />    <data android:scheme="http" android:host="yolify.net"      android:pathPrefix="/"/> </intent-filter>   Link:  LINK   Your website (just before the  tag)     What's happening here?   You point your link to your website, not your google play URL.  In the manifest you set your app to listen to links pointing to your website. You send your mobile users to the Google Play URL, but this only happens when they don't have your app on their phones. Otherwise, your browser will offer you to open your app from the email.   I would like to highlight that even though there are about 5 similar questions on stackoverflow, none of them gives a real explanation on the background. I hope I could help others suffering with this question.

I want my intent to be launched when the user goes to a certain url: for example, the android market does this with  urls. so does youtube. I want mine to do that too.


I'm pretty sure the title was "T".  It's about an alien race at war with humans. They decide to end the human race by destroying Earth before humans evolve. They send some humans through space and back in time to do the job.  I think the humans have single letter names (A, B, C, etc) They have raised/cloned the humans just for the job and to save space in their ships they have only a head, a body and one arm. Most don't make it.   The aliens don't know that there were 2 more planets in the past and they count the planets in from Pluto. One human hits a planet and completely destroys it and T hits a glancing blow and just breaks up his target forming the asteroid belt.

Trying to recall a short story I read decades ago. As best I recall, in an desperate effort to defeat humanity in a war they are losing, aliens send piloted bombs back in time to destroy the Earth before life has started. Miscalculation causes destruction of planet into asteroid belt and creates conditions for life on Earth.  The story was from perspective of a genetically engineered pilot of the bomb as it flew back in time to its suicidal goal.   I think the title was simply 'T' - the name of the pilot of the bomb - but trying to search internet for a title like that is not working out too well. Even tried 'shortest title for a story'.


Are there any other methods to integrate the following integral than the ones cited on the ? Maybe with a more elementary tool set?     $$\int_0^\infty e^{-x^2}\,dx$$     Addendum: I am not looking for proofs that involve double or triple integration.

How to prove  $$\int_{0}^{\infty} \mathrm{e}^{-x^2}\, dx = \frac{\sqrt \pi}{2}$$


I am trying to install Image Scan! bundle from Epson for my GT-1500 scanner. When I run ./install.sh I get the error: W: GPG error: https://downloads.plex.tv/repo/deb public InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 97203C7B3ADCA79D E: The repository 'https://downloads.plex.tv/repo/deb public InRelease' is not signed.  I looked into --allow-unauthenticated but doesn't seem to work for my case.

I added some extra repositories with the Software Sources program. But when I reload the package database, I get an error like the following:     W: GPG error:  trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8BAF9A6F   I know I can fix it using apt-key in a terminal, according to the official Ubuntu documentation. But I would have liked to do it graphically. Is there a way to do this without using a terminal?


Is it triggered after a number of comments within a short timeframe, or is there a moderator button you have to click on?

I have answered two questions:       On the first one we've posted 12 comments, and on the second one only 7.   But - Why am I only getting the Please avoid extended discussions in comments. Would you like to automatically move this discussion to chat? notice in the SECOND answer, while the first one has more comments?


I remember reading an anthology/collection of sci/fi and fantasy stories sometime between 1990-1996 which had as its first(?) story one called 'Kraken' or 'The Kraken' maybe.  It was about a post apocalyptic water world where the only surviving people were living on floating islands of junk and seaweed. The most interesting theme to me was that the protagonist rediscovered ways of resynthesising metals and chemicals from the sea and the sun using crude chemistry principles.

I read a book a while ago ( read many years, maybe a decade ago, it was at least 20 years old then) about a watery planet ruled over by a monstrous overlord sea monster thing.   The hero rallies some of the floating villages to fight the monster and they make iron weaponry out of iron from blood as far as I can remember.   Beyond this I can't remember much about the book, but I'm sure at least one other person out there must have read it.  Edit for more potential details: I think the village folk were reluctant to trust the hero, he was maybe a stranger to them and a lot of them didn't want to upset the status quo.    The iron weapons were maybe to pierce the hide? A harpoon seems familiar, something to trap him with the aid of nets.


I'm an Indian national and I will be travelling from US to India with a 23-hour layover in Zurich.   I have a valid US F-1 visa student visa and might be interested in leaving the airport for some sightseeing.   If I do need a visa, what type and documents, and how long would it take to get?

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


I have a URL like so:  http://example.com/var1/var2   What I'd like to is get VAR 1 from the querystring. I've tried using a regex but I'm not really very familiar with them. Is there an easier way?

Given the URL (single line):   How can I extract the following parts using regular expressions:   The Subdomain (test) The Domain (example.com) The path without the file (/dir/subdir/) The file (file.html) The path with the file (/dir/subdir/file.html) The URL without the path () (add any other that you think would be useful)   The regex should work correctly even if I enter the following URL:    http://example.example.com/example/example/example.html


I saw a question that was tagged improperly.  I went to edit it, only to discover that another user had submitted the exact same edit and it was needing approval.  I approved the edit, only to discover that it needs a second approval.  Now, I am locked from editing it at all, and this content is sitting there, wrong, with nothing I can do about it.  I understand that I should have picked the "Improve the Edit" option and then it would have gone thorugh immediately.  This doesn't help me now, though.  Could we still offer the option to "Improve the Edit", even after you have Approved it and it's waiting for the second approval?  This would make it really easy for people to fix this problem when it happens that they've made a mistake like this.

I like the addition of the "Improve" button in the review edits page. However, sometimes I only think of improving a post after choosing to accept/reject. Currently there is no way to do this other than waiting for the edit to be accepted/rejected and when there are <5 edits in the queue this can take a while.  Is there a workaround for this, or can this be added?


I can't seem to find a proper way to combine these two functions into one. Both functions work, but when combined/or loaded together...it doesn't work.  Function:1 (standard toggle function)  $(document).ready(function(){    $("#myButton").click(function(){       $("#myDiv").toggle();    }); });   Function:2 (click anywhere, except on the div, to hide it)  $(document).click(function(event) {     if(!$(event.target).closest('#myDiv').length) {       if($('#myDiv').is(":visible")) {          $("#myDiv").hide();       }    }         })   What I want to achieve is this:    if div hidden --> show div when clicked on button if div visible --> hide div when clicked anywhere, except on the div

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area.  Is something like this possible with jQuery?  $("#menuscontainer").clickOutsideThisElement(function() {     // Hide the menus });


Quick question:  In this sentence, should there be a comma? I've seen it both ways and both sound correct to me, but an English book I recently looked at (Erica Meltzer) said that the sentence was more proper without the comma.      This period of prosperity from 1950 to 1973 brought upon the world a plethora of technological advances, which revolutionized society and allowed for significant scientific development.

In this sentence      Green tea contains the vitamins and healthy properties of the green tea leaf, which makes green tea popular among health-conscious people.    what is the "which" referring to?? Is it referring to the green tea leaf or the vitamins and healthy properties?


Is it possible to prove that if $f\in L^2(\mathbb {R}) $ then $\exists\lim_{x\to\pm\infty}\lvert f\rvert^2$ and $\lim_{x\to\pm\infty}\lvert f\rvert^2=0$? If not, is it easy to find a counterexample?

1) Construct a continuous function $f$ on $\mathbb{R}$ that is integrable on $\mathbb{R}$ but $\displaystyle\limsup_{x \to \infty} f(x)  = \infty$.  I took the function that is equal to $n$ on $[n, n + 1/n^{3})$ and made it continuous by saying that $f$ is the line segment joining $n$ and $n+1$ on $[n + 1/n^{3}, n+1)$. But I am failing to prove this integrable. For this, $\lim f(x) = \infty$ but how do you prove in general, if limit does not exist that $\limsup$ is infinity?  2) Prove that if $f$ is uniformly continuous and integrable on $\mathbb{R}$ we have $\displaystyle\lim_{|x| \to \infty} f(x) = 0$.  Any help is appreciated.  Thanks


I've create a model and a rig by myself to understand how it's working but i'm stuck with one thing : some vertex are related to a bone and I don't want it. Obviously to avoid that kind of result : (look at the pelvis which move withe the hand controller)    I tried to delete the relation but it's impossible to see the relation of a group of vertex, it's not listed anywhere because it's not an object but some vertex of this object.  Do you know how to solve that ?  Many thanks in advance, François

I have an armature set up, but the bones aren't moving the mesh properly  The mesh and armature:    The vertex group of the bone I am going to move:    As you can see, the circled region doesn't belong to the vertex group. But, when I move the bone look what happens:    That part of the mesh has moved with the bone.. Why?


I need name of the selected tab and pass it to the controller. My code is below: VF page:                                                       Summary

             Incident-Problem

             Availability-Performance

             Service-Finance

         <apex:outputPanel >
                 <apex:repeat value="{!allQuestions}" var="qPreview" id="aQPreview">

                                                                  {!qPreview.orderNumber + ': ' + qPreview.question}
                         <apex:outputPanel >                             <apex:selectRadio layout="pageDirection" value="{!qPreview.selectedOption}" >                                 <apex:selectOptions value="{!qPreview.singleOptions}"/>                             </apex:selectRadio>                         </apex:outputPanel>
                 </apex:repeat>
         </apex:outputPanel>

         Item Three Content

      </apex:form>

I got some references for Visualforce tab creation but unable to find the issue. onclick function is not passing control to controller. Any help will be appreciated.  Visualforce Page  <apex:page id="Registration" showHeader="false" controller="SolutionLibraryTabController"  title="Solution Library" standardStylesheets="false">     <style>         .activeTab {background-color: #236FBD; color:white; background-image:none}         .inactiveTab { background-color: lightgrey; color:black; background-image:none}     </style>     <apex:tabPanel switchType="client" tabClass="activeTab"  inactiveTabClass="inactiveTab" value="{!var}" >         <apex:tab label="Search" name="srch" id="srch" onclick="setActiveTab('srch')">             <apex:include pageName="SolutionLibrarySearch"/>                     </apex:tab>         <apex:tab label="Insert" name="insrt" id="insrt" onclick="setActiveTab('insrt')">             <apex:include pageName="SolutionLibraryInsert"/>                                                </apex:tab>     </apex:tabPanel>     <apex:form>         <apex:actionFunction name='setActiveTab' action='{!setActiveTab}' reRender="none">             <apex:param id='tabname'  assignTo="{!var}" value=""/>         </apex:actionFunction>     </apex:form> </apex:page>   Cotroller  public class SolutionLibraryTabController {     /*Tab var*/     public String var{get;set;}      public SolutionLibraryTabController(){         var = 'srch';     }      public PageReference setActiveTab() {         if(var=='srch'){             var='insrt';         }         else {             var = 'srch';         }         return null;     } }


I saw that particles can be paired and that no matter the distance what one does so does the other. Now, can we put each particle into a magnetic field where we could manipulate the spin? If you make the particle spin up zero or down for one and the other field detects the spin change you could have an instant communication device for probes and astronauts.

According to the special theory of relativity, distant simultaneity depends on the observer's reference frame.  And, according to the quantum theory, in the case of two entangled particles, a measure on one of the particles simultaneously affects the second one. Under which reference frame is this simultaneous?


Im trying to understand how implement Dining Savages using monitors. I have three classes, and im using the kitchen class to act as the monitor for when the pot is empty or not.   For some reason i keep getting a null pointer exception at thread two in my example below.  class Kitchen {   Kitchen k;   int c;   boolean empty;   Cook chef;   Kitchen() {     this.c = 0;     this.empty = true;     chef = new Cook(k);    }   synchronized void putServingsInPot(int servings) {     if (empty) {         this.c = servings;     }     empty = false;      notify();   } synchronized void getServingsFromPot() {     while (empty) {         try {             System.out.println("Bout to wait");             wait();         } catch (InterruptedException e) {             // TODO Auto-generated catch block             System.out.println("In Catch");             e.printStackTrace();         }if (c == 0) {             empty = true;             chef.run();         }else if(c > 0 && empty == false){             c--;         }     } }  }  class Savage extends Thread {   Kitchen k;   Savage(Kitchen k) {     this.k = k;   }   public void run() {     while (true) {         k.getServingsFromPot();         try {Thread.sleep(500); // eat         } catch (Exception e) { return;}     }   }   } class Cook extends Thread {   Kitchen k;   Cook(Kitchen k) {     this.k = k;    }   public void run() {     while (true) {         try {Thread.sleep(500); // sleep         } catch (Exception e) {return;}         k.putServingsInPot(10); // 10 servings     }   } }      public class main {    public static void main(String Args[]) {     // Kitchen testing     Kitchen k = new Kitchen();     Cook c = new Cook(k);     c.start();     Savage sc[] = new Savage[9];     for (int i = 0; i < 9; i++) {         sc[i] = new Savage(k);          sc[i].start();     }     try {         Thread.sleep(5000);     } catch (Exception e) {     }     for (int i = 0; i < 9; i++) {         sc[i].interrupt();     }     c.interrupt();     System.out.println("Done\n");   }  }   Is it possible to synchronized these events without using a semaphore within the monitor ?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have this script  Javascript:  $('#generateEditWindow').on('click', function () {     var $el = $(this);     var id = $el.data('id');     alert(id) });   and this HTML:  <a id="generateEditWindow" data-id="10">        Click to show the data id </a>   And this works, but only if the page loads with THIS HTML already as part of the page. I need this script to react to new elements that are added to the DOM after page load. When I generate the HTML you see here after the DOM has loaded this function will not fire.  I have put this function in a document ready function but that doesn’t seem to make sense nor work and have tried outside of document ready. I feel like I need to make this function to fire “on change” and have it listen for calls but I don’t even know the terminology to be able to google that correctly. Any help would be great, thanks community.

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


File1  Sergio Lionel Luis Andreas Gerard   I want my stdout to have just  Sergio Gerard   How can I do this using the tail command and piping?

I have text file. Task - get first and last line from file after   $ cat file | grep -E "1|2|3|4" | commandtoprint  $ cat file 1 2 3 4 5   Need this without cat output (only 1 and 5).  ~$ cat file | tee >(head -n 1) >(wc -l) 1 2 3 4 5 5 1   Maybe awk and more shorter solution exist...


why is the distance of a body equal to the area of its speed-time graph?  the general formula of speed(v) is  v=distance(s)÷time taken(t) so the formula of distance(s) should be s=v×t so if the speed-time graph of a body is a triangle, the distance covered by the body should be equal to twice of the area of the graph because area of a triangle is -  1/2×base×height where base=t and height =v so it becomes 1/2×t×v and the formula of "s" is v×t so if v×t is distance, 1/2×v×t should be equal to 1/2 of  the distance and not the distance?

I understand that if the velocity is constant (acceleration=$0$) throughout the course of motion (where graph shows a rectangle) then it would simply be like playing with equation:  (1). velocity=displacement/time  (2). displacement=velocity $\times$ time                                =area of rectangle                                =Velocity-axis $\times$ time-axis,   putting the value of velocity and time, then getting out the displacement.  But what if the acceleration is constant instead of $0$ (where graph shows a triangle) ? I know it would be $\frac{1}{2}$ velocity $\times$ time, but how we can put a value of velocity in (1) displacement=velocity $\times$ time When velocity is changing all time due to uniformly accelerated motion?


How do I put my named range of a list of values into one cell?   i've tried going into a cell and naming the range like so =namedrange  sample data in my named range:  +---+----------+ |   |    A     | +---+----------+ | 1 | 'stack', | | 2 | 'over',  | | 3 | 'flow',  | +---+----------+   =OFFSET(Nodes!$B$2,0,0,COUNTA(Nodes!$B:$B),1)  expected output, i would like a formula to do this:

I have the task of creating a simple Excel sheet that takes an unspecified number of rows in Column A like this:  1234 123461 123151 11321   And make them into a comma-separated list in another cell that the user can easily copy and paste into another program like so:  1234,123461,123151,11321   What is the easiest way to do this?


I need to find a good configuration for my computational kernel, which forces me to find some integer solutions to the following simple equation:  $a \cdot x - b \cdot y = c$,  where $a$, $b$ and $c$ are constant positive integers, and $x$ and $y$ are my unknown, that I need to also be positive integers.  I thought I could solve this using the Diophantine solution, but I'm not sure how to proceed due to one of the addends to be negative.  What is the best way to find all solutions to such an equation?

I want to find a set of integer solutions of Diophantine equation: $ax + by = c$, and apparently $\gcd(a,b)|c$. Then by what formula can I use to find $x$ and $y$ ?   I tried to play around with it: $x = (c - by)/a$, hence $a|(c - by)$.     $a$, $c$ and $b$ are known. So to obtain integer solution for $a$, then $c - by = ak$, and I lost from here, because $y = (c - ak)/b$. I kept repeating this routine and could not find a way to get rid of it? Any hint?  Thanks, Chan


i am busy creating a simple blackjack game in C#.  Now for my cards i want to use an Entity Class "Kaart" because when i want to create other cardgames then Blackjack i can use this again.  So my Objects would consist of : kleur (aces,spades,..) , naam (A,K,J,10,...) and bjvalue (blackjackvalue).  I use this code for this :      class Kaart {     public Kaart()     {     }       public Kaart(string kleur, string naam, int bjwaarde)     {          this.Kleur = kleur;         this.Naam = naam;         this.Bjwaarde = bjwaarde;      }     public string Kleur { get; set; } // AutoProperty      public string Naam { get; set; } // AutoProperty      public int Bjwaarde { get; set; } // AutoProperty   Now my question is :  For use in my game i want to create an array which contains 52 items (0-51), all cards , which represent a full stack of cards. How should my method be to fill the array with all these objects .. i started like this :  public Kaart[] Vulstapel(Kaart[] Stapel) {   now the fastest way to add all these values to this array would be?  (the reason why i put them in an array is simple : because i want to be able to copy the array and than delete each card after its already thrown in game)

I'm trying to make a simple blackjack program. Sadly, I'm having problems right off the bat with generating a deck of cards.  #include <iostream> #include <vector>  using namespace std;  int main() {     vector<char> deck;     char suit[] = {'h','d','c','s'};     char card[] = {'2','3','4','5','6','7','8','9','10','J','Q','K','A'};     for (int j=0; j<13; j++) {         for (int i=0; i<4; i++) {             deck.push_back(card[j] suit[i]);         }            }      return 0; }   I know my problem begins with me trying to assign the value '10' to a char. Obviously I couldn't get this to compile but I'm sure when I try to assign the card values to the vector deck I'll also get an error since I used variable type 'char'. Knowing what kind of variable type to use seems to be killing me. Also, would 'deck.push_back(card[j] suit[i]);' be the correct code to combine the card and suit, or do you have to put something between card[j] and suit[i]? I'd appreciate it if any of you could lead me in the right direction. Also as a little side note, this is part of a homework assignment so please don't just give me entire blocks of code. Thanks for your help.


Some cards require players to have taken damage for a bonus effect to take place. Does loss of life count as being dealt damage?     These are the two cards in specific that I am talking about.

From reading the rules it would appear there are two kinds of damage and then straight loss of life:     118.3 If an effect causes a player to gain or lose life, that player's life total is adjusted accordingly.   From reading that I would guess that effects like Extort are not sources of damage. You simply lose the life.      119.2a Damage may be dealt as a result of combat. Each attacking and blocking creature deals combat damage equal to its power during the combat damage step.   So damage from creatures during combat is combat damage.     119.2b Damage may be dealt as an effect of a spell or ability. The spell or ability will specify which object deals that damage.   And that is direct damage from an object.  So the arguments are these:  Does loss of life as outlined by rule 118.3 (at top) count as being dealt damage? Do triggered abilities that redirect or reduce damage effect loss of life?  My second related question: You put  on a  and tap her to deal one damage to your opponent. Am I right in saying that because the damage was direct damage (not dealt during combat) then the triggered ability of preventing the combat phase of the damaged player is not triggered?


I want to create image box(with image). It's ugly when text is in the top of box.  How can I align text to middle? I tried to use vertical-align, but it seems, that it don't works    EDIT: Your solution works fine with short messages. But if they will be multi-lined, it is ugly again. Is it possible to not increase size of line If we don't need it?

Best way to center a <div> element on a page both vertically and horizontally?  I know that margin-left: auto; margin-right: auto; will center on the horizontal, but what is the best way to do it vertically, too?


We recently bought an Android Shopping App for Smartphones (supporting 2.2 to current version). Sadly, the app ist not available for tablets.  Is it just a button in the IDE to create a tablet version (not tablet optimized) or is there much more to do?  For example: every iOS iPhone App is running on an iPad (looks ugly, but works)

I have a brand new Galaxy Tab 2 that is apparently not compatible with my bank's tablet app. Someone on another forum mentioned that they just use the phone version on their tablet, but they don't say how they got it. When I go to the google play store, I only see one version. I do have the app on my phone; is there any way to transfer it?


Do ubuntu 16 will work on my laptop which has  4gb ram 64 bit processr 2 gb intel and nvidia graphics   I think that it won t' work on 4gb ram

I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use?  This is an attempt of a canonical answer. My answers have the "official  requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below.


How to make a white number inside a black circle (the picture below)? I want to change numbers inside the black circle, of course.  I use Share LaTeX. I have read some articles here but anyone are not what I would like to get. I would like to get this  (the picture below) - the sixth answer.   Thanks for help.

This question led to a new package:      I'm trying to make some good-looking numbers in a circle, using the simple command:  \textcircled{1}   However, the circle is misaligned vertically with the number, and look a bit sloppy:    Any suggestions how can I adjust the vertical alignment so that the numbers look more centered w.r.t to the circles? Or, if that's not an option, what other ways to achieve the same results are possible?  I will use those only for numbers, and in very few places, so manual adjustment per glyph is an option.  I'm using pdfLaTeX with Computer Modern, if that matters.


I have a acer aspire 5315, recently put ubuntu 16 on there for development. The fan comes on on start up and going through the bios but once it boots ubuntu the fan turns off, this then causes the pc to get hot and switch off.   I have installed and ran lm-sensors and the fan isn't even listed, I have also tried sensors-detect and still nothing. I then tried installing fan control and still no joy.  Any advice would be greatly appreciated!   Thank you

I have recently installed lubuntu 11.10 on my old laptop (acer aspire 5315 celeron) and observed that fan is not working properly on lubuntu side.I find it strange that it is working perfectly under window vista.   How could I solve this problem?


Earlier today (or at least ) the review queues had numbers showing up indicating how many reviews were pending in each. Those are now missing, and there's no indication of which queues have how many reviews:    (This screenshot was taken with all userscripts disabled.)  Some of these queues have reviews pending in them for me to act on, but no indicator is showing up at all. I clicked this menu because its icon was orange, and I visited all queues and there were two queues with one review each in them.  I could not tell from this dropdown which queues needed my attention though, and if it's trying to get my attention to the review queues, it really should tell me which of them actually need my attention.  Also from meta.se just now (icon orange):    (There's some earlier discussion of the review indicators being removed in , but this doesn't appear to describe a bug about the indicators going missing even when there's reviews.)

The review queue counters have disappeared:        Where are they?  When I did screenshot the Close Votes queue was not empty, if someone think so.


I am wondering whether there is another method to show that $\sqrt{118}$ is irrational. I have always been taught to use proof by contradiction for showing irrationality. Can anyone think of other methods? Please help.

Per now, I have basically come upon proofs of the irrationality of $\sqrt{2}$ (and so on) and the proof of the irrationality of $e$. However, both proofs were by contradiction.  When thinking about it, it seems like the definition of irrationality itself demands proofs by contradiction. An irrational number is a number that is not a rational number. It seems then that if we were to find direct irrationality proofs, this would rely on some equivalent definition of irrational numbers, not involving rational numbers themselves.   Are there any irrationality proofs not using contradiction?


I am looking for CSR Documentation.  If I Google something from the Server-Side API, I get the documentation right away.       For example, Googling SPWeb, the first result is the documentation: .   However, when I try the same thing with CSR functions, I get examples but no documentation.   A couple of things that I hope documentation will clear up: In the following code I have 2 issues:   SPClientTemplates.TemplateManager.RegisterTemplateOverrides() expects an object.  Where can I find a complete list of the keys and what I can expect them to do? Where did RenderItemTemplate come from?  After sifting through a number of examples, I just happened to come across RenderItemTemplate.   It isn't associated with an object, so there could be a whole bunch of helpful global functions that I know nothing about.  function () {    var itemCtx = {};   itemCtx.Templates = {};      itemCtx.Templates.Header = HeaderOverrideFunc;     itemCtx.Templates.Item = ItemOverrideFun;     itemCtx.Templates.Footer = FooterOverrideFunc;    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(itemCtx);  })();   function ItemOverrideFun(ctx) {   if (ctx.ListTitle != "My List") {      return RenderItemTemplate(ctx);   }   return "
" + ctx.CurrentItem.Title + "
";      }

Has there been any sort of documentation or anything like that released for SharePoint 2013 Client-Side Rendering/JS Link?  Anthing unofficial? Any dates for when documentation might be released?


How real is it to become a "formal" researcher (that is someone holding some research position) after earning a PhD at the age of 40? Sometimes it so happens that people discover their true interest only later in life. But because society is used to follow certain established patterns, it may be difficult for such people to readjust their lives. I believe there exist certain biases or prejudices about what people are supposed to do at a certain age, which may hinder one's path socially, emotionally, as well as professionally.

Currently, I am applying for PhD positions at United States and Canadian Universities. I will be 35 when I start my PhD in Computer Science/Machine Learning, and probably I will finish it around the age of 40.  Will I be banished from academic positions considering a possible PostDoc time and what about industry positions ? Should I plan my study towards industry or academia from the research perspective ?


I am interested if there's a more elegant solution to the one posted below.  []$ find ./abc -type f -exec sed -n 's/test/best/pg' {} + ; find ./abc -type f -exec sed -i 's/test/best/g' {} +   The first find sed command prints all found patterns to console. The second find sed command actually substitutes the patterns within file.   The problems I have encountered:   sed -n -i (cannot have multiple command line modifier/arguments) -? someone confirm?  sed does not have a native modifier to print results prior to substitution -? had trouble finding a solution, maybe it exists, and the command can be modified (i.e. below will output nothing, and substitute behind your back!).  find ./abc -type f -exec sed -i 's/test/best/pg' {} +

When using sed to replace strings in-place, is there a way to make it report the changes it does (without relying on a diff of old and new files)?  For instance, how can I change the command line  find . -type f | xargs sed -i 's/abc/def/g'   so I can see the changes that are made on the fly?


I have a file with the content shown below:  ***************Encrypted String***************  ezF7LcHO0Zlb+8kkBeIwtA==  **********************************************   I need to get only encrypted password from above. I used Google to search for an answer, and I got this example (below), but it didn't work:  sed -n '/***************Encrypted String***************/,/**********************************************/p' $file   I tried but it didn't work

I'm going to submit form using cURL, where some of the contents is come from other file, selected using sed  If param1 is line matching pattern from other file using sed, below command will works fine:  curl -d param1="$(sed -n '/matchpattern/p' file.txt)" -d param2=value2 http://example.com/submit   Now, go to the problem. I want show only text between 2 matching pattern excluding the matching pattern itself.  Lets say file.txt contains:  Bla bla bla firstmatch It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. secondmatch The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.   Currently, lots of "beetween 2 matching pattern" sed command won't remove firstmatch and secondmatch.  I want the result to become:  It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.


Let $X$ be a random variable following the Binomial Distribution with parameters $n$ and $p$. Show that $$ \mathbb{E}\left[\frac{1}{1+X}\right]=\frac{1-\left(1-p\right)^{n+1}}{p(n+1)}, $$ where $\mathbb{E}[\cdot]$ is the mean value funtion.  My textbook had this exercise and I found it very interesting, but i can't solve it because I suck at infinite sums with the binomial coefficient. Any suggestion is appreciated. Thank you very much in advance.

The problem:  X is a binomial random variable, find $E[\frac{1}{X+1}]$ n and p are not given  PDF for a binomial distribution is $\binom{n}{k}p^k(1-p)^{n-k}$  Expected value is $\sum{x_ip(x_i)}$  But this is where I get stuck, I'm really rusty on my statistics and I'm not sure exactly how to structure it in the next step? I think I want to get the form of the following out of the summation  $\sum _{k=0}^{n} \binom{n}{k}p^k(1-p)^{n-k} = (p + 1 - p)^n = 1$  But I'm not sure if it should look like  $\sum \frac{1}{xp(x)+1} $  and if it should where to go from here?


We have an Apple Thunderbolt Display and a HP Pavilion Desktop 590. I was wondering whether there is anyway to connect the Thunderbolt Display with a Desktop using some adapters?  Any help on this matter would be greatly appreciated.

I have .  it works fine with my Macbook Pro. I also want to connect it to my Windows laptop via HDMI. I bought this , which converts the HDMI signal to DisplayPort. Everything plugs in just fine, but the display just does not turn on. I tried a variety of resolution settings.  Note: this display does not have a power button. It just turns on when I plug it into a Mac. There is no activity when I plug it into the DisplayPort converter.


Sometimes I take photos of my computer monitor with a smartphone. Then, when I try to zoom in to the picture of the monitor in the gallery of my phone, I start to see this pattern. I am not sure if this is really just moire pattern. I mean, after I have taken the picture, I go to the gallery, look at the picture and change the zoom. As I start to change the zoom, I start to see random contouring pattern changing rapidly and changing shape, they look like something like below.  Can someone explain why?

I am not entirely sure this is an appropriate question for PSE, however since many of you have such diverse backgrounds, I'll give it a shot.  I have noticed that when one takes a picture of a computer, TV screen with a phone, you can "see" what looks like a saddle phase portrait.     Why does this happen? Does it have any relevance to differential equations or other areas of math?


I know how they are different syntactically, and that C++ uses new, and C uses malloc.  But how do they work, in a high-level explanation?  See

What is the difference between new/delete and malloc/free?  Related (duplicate?):


I faced the following question while prove the proposition "the group of automorphisms of a finite field is cyclic"- Let $F$ be a finite field with $p^n$ elements where $\operatorname{char}(F)=p$. Then how to show that any automorphism of $F$ fixes $F_p$ pointwise i.e. if $f\in \operatorname{Aut}(F)$ then $f(x)=x \forall x\in F_p$ where $F_p\simeq \Bbb{Z}_p$. Can anybody clear up query? Thanks for assistance in advance.

Suppose $K$ is a prime subfield of $E$, then if $\phi$ is an automorphism from $E$ to $E$, we have for all $x \in K$, $\phi(x) = x$.   I feel like this is just the definition of a field automorphism, but my book says this should be proven as an exercise.


I've got some basic code in Mvc Core 2 that is attempting to take advantage of the implicit conversion between T and ActionResult<T>.      public ActionResult<IEnumerable<FrequentlyAskedQuestion>> Test()     {         IEnumerable<FrequentlyAskedQuestion> x = new FrequentlyAskedQuestion[0];         return x;     }   I get this error  2>Controllers\FaqsController.cs(57,20,57,21): error CS0029: Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<Models.FrequentlyAskedQuestion>' to 'Microsoft.AspNetCore.Mvc.ActionResult<System.Collections.Generic.IEnumerable<Models.FrequentlyAskedQuestion>>'   If I allow it to remain as an array it works.      public ActionResult<IEnumerable<FrequentlyAskedQuestion>> Test()     {         var x = new FrequentlyAskedQuestion[0];         return x;     }   I can see the code of AspNetCore has this static implicit operator that would be nice for this to work      public static implicit operator ActionResult<TValue>(TValue value)     {         return new ActionResult<TValue>(value);     }

I have a generic class that I'm trying to implement implicit type casting for.  While it mostly works, it won't work for interface casting.  Upon further investigation, I found that there is a compiler error: "User-defined conversion from interface" that applies.  While I understand that this should be enforced in some cases, what I'm trying to do does seem like a legitimate case.  Here's an example:  public class Foo<T> where T : IBar {     private readonly T instance;      public Foo(T instance)     {         this.instance = instance;     }     public T Instance     {         get { return instance; }     }     public static implicit operator Foo<T>(T instance)     {         return new Foo<T>(instance);     } }   Code to use it:  var concreteReferenceToBar = new ConcreteBar(); IBar intefaceReferenceToBar = concreteReferenceToBar; Foo<ConcreteBar> concreteFooFromConcreteBar = concreteReferenceToBar; Foo<IBar> fooFromConcreteBar = concreteReferenceToBar; Foo<IBar> fooFromInterfaceBar = intefaceReferenceToBar; // doesn't work   Does anyone know a workaround, or can anyone explain in a satisfactory way why I shuouldn't be able to cast interfaceReferenceToBar implicitly to Foo<IBar>, since in my case it is not being converted, but only contained within Foo?  EDIT: It looks like covariance might offer salvation.  Let's hope the C# 4.0 specification allows for implicit casting of interface types using covariance.


Identify the following ring:   $$\mathbb{Z}[x]/(x^2 − 3, 2x + 4).$$   I am very confused on how to go about solving this problem, and mainly about ideals in general. I know that $x^2-3=0$ and $2x+4=0$ in this ring. But how do I use these ideals to be able to identify the ring. Thank you.

This problem is from a practice exam I was working on.     What is the cardinality of the quotient $\mathbb{Z}[x]/(x^2-3,2x+4)$ ?   Thoughts. If I find a ring that is easier to handle then this then I can go from there. So I think this is isomorphic to $\mathbb{Z}_2[x]/(x^2-3,x+2)$. And then I am stuck.  Am I correct so far? What should I be looking to do from here?  Thanks for your time and your answers.


Recently I added to iptables a rule which was supposed to allow incoming traffic through port 993. The rule I used is the one shown below:  sudo iptables -A INPUT -p tcp --dport 993 -j ACCEPT   After I entered the rule, I ran "iptables-save > /etc/iptables/rules.v4" and rebooted the server. However when I use the telnet command to check the port I am getting following error.  telnet localhost 993  it tells me the connection is refused by the host (my server). This is not only happening to this port but to other ports I try to open. Am I doing something wrong, running a wrong command, etc? Please help me.

This is a  about Connection Refused    We see a lot of questions to the effect      When I try to connect to a system I get a message      Connection refused      Why is this ?


sql database in suspect mode when we upgrade from developer to standard edition 2012 version. in log file there is two error occurred 933 and error 905. following error occurred when we try to get back online the db     Msg 5069, Level 16, State 1, Line 1 ALTER DATABASE statement failed.   Msg 905, Level 21, State 1, Line 1 Database 'VTSDB' cannot be started   in this edition of SQL Server because it contains a partition function   'FNprocessedrawdata'. Only Enterprise edition of SQL Server supports   partitioning. Msg 933, Level 21, State 1, Line 1 Database 'VTSDB'   cannot be started because some of the database functionality is not   available in the current edition of SQL Server.

SQL Server database is in suspect mode after an upgrade from developer to standard edition 2012 version. In the log file there are two errors: 933 and error 905. Following error occurred when we tried to get the database back online.     Msg 5069, Level 16, State 1, Line 1 ALTER DATABASE statement failed. Msg 905, Level 21, State 1, Line 1 Database 'VTSDB' cannot be started in this edition of SQL Server because it contains a partition function 'FNprocessedrawdata'. Only Enterprise edition of SQL Server supports partitioning. Msg 933, Level 21, State 1, Line 1 Database 'VTSDB' cannot be started because some of the database functionality is not available in the current edition of SQL Server.


I'm trying to get the difference between 2 locations of which i have taken from the gps, Whenever i click on a button to go to my MapsActivity i get crashed with this error  Attempt to invoke virtual method 'com.google.android.gms.maps.model.Marker com.google.android.gms.maps.GoogleMap.addMarker(com.google.android.gms.maps.model.MarkerOptions)' on a null object reference   And When i comment the code which checks difference in distance it works just fine, i don't understand the connection between the Marker options and the DistanceTo  Here's my Code (Keep in mind that all works fine it's just the DistanceTo which doesn't work)  locationListener = new LocationListener() {         @Override         public void onLocationChanged(Location location) {             //get the latitude and longitude from the location             double latitude = location.getLatitude();             double longitude = location.getLongitude();             //get the location name from latitude and longitude             Geocoder geocoder = new Geocoder(getApplicationContext());             try {                 if(location != null)  // this gives address list from the maps, not important and commented                  {                     List<Address> addresses =                             geocoder.getFromLocation(latitude, longitude, 1); // Marker options where the issue occurs                     //String result = addresses.get(0).getSubLocality()+":";                     //result += addresses.get(0).getLocality()+":";                     // result += addresses.get(0).getCountryCode();                     LatLng latLng = new LatLng(latitude, longitude);                     mMap.addMarker(new MarkerOptions().position(latLng).title("Marker Title"));                     mMap.setMaxZoomPreference(20);                     mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));                 }              } catch (IOException e) {                 e.printStackTrace();             } //Where it checks for the locations and the distance between them             if(LocationA == null) {                 LocationA = location;             }              LocationB = location;               LocationA = LocationB;              DiffernceInDistance = LocationA.distanceTo(LocationB);          }   Code where i made the Map    public void onMapReady(GoogleMap googleMap) {     mMap = googleMap;         if(ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {               buildGoogleApiClient();             mMap.setMyLocationEnabled(true);          }         else {             buildGoogleApiClient();             mMap.setMyLocationEnabled(true);           } }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I have the following piece of code, and I have no idea what the ? means in the construct.  What is it doing?      myObj_Request r = new myObj_Request(); //instantiate intial object r.Channels = new ChannelSequence();    //initial object has another object in channels r.Channels.ChannelType = new ChannelType?[5] { .. } // ok so we have 5 channeltypes...                                                     // but  that ? infront of [5] ?

I am reading a .NET book, and in one of the code examples there is a class definition with this field:  private DateTime? startdate   What does DateTime? mean?


went first time beginning of feb 2015, then again in march, up until aug 2015 for a total of 86 days, then went elsewhere. question is it has been 180 days since first visit in feb.  so can i go back to netherlands now ?

I have searched the web a lot and could not find an answer that fits my situation. Here are two links that are quite contradictory:       My situation:  I've visited Portugal in December 2012 for 29 days on a Schengen visa valid from December 1st, 2012 to February 1st, 2013 for research purposes (I am a Ph.D. student). I want to visit Sweden from February 10th, 2013 to May 10th, 2013 (89 days). I have applied for a Schengen visa again (for research). How will the 90/180 rule work in my situation?


I need to show that there exists a homeomorphism between $S^1\times \Bbb{R}$ and $\Bbb{R}^2\setminus\{(0,0)\}$   If we map $(\cos x, \sin x,y) \to (y\cos x,y\sin x)$ then only problem is that it is taking value $(0,0)$. Can we modify this or will any other map work?

Are there any specific 'tricks' or 'techniques' in finding homeomorphisms between topological or metric spaces?  I'm trying to construct a homeomorphism between $\mathbb{R} \times S^1 \to \mathbb{R}^2 \setminus \{(0,0)\}$ but I'm having trouble even visualizing how this is going to work. I'm thinking some sort of stereographic projection from the circle and then including the $\mathbb{R}$ somehow but I'm stuck. Any ideas?


How can one write a meta-macro that adds a starred version to a command?  Intended use would be along the lines of  \newcommand\foo[1]{foo is #1} \addstarred\foo[2]{foo is #1, bar is #2}

I would like to define a *'d version of a command, something like \newcommand{\foo}{blah} \newcommand{\foo*}{blahblah}  If I try to do this, LaTeX complains that I'm trying to redefine \foo, so I guess I need to do something special to handle *s. But what?


I have moved a tar.bz2 from my Downloads to /usr/src, which is where I like to put all things that I install on my system. Now I extracted the file and I want to move its contents to /usr/share/icons. But I do not want to move the tar.bz2 itself:  # ls -l | grep Comix -rw-rw-r--  1 guarddog guarddog   2190951 May 26 11:03 ComixCursors-0.8.2.tar.bz2 drwxr-xr-x  3 root     root          4096 Oct 23  2013 ComixCursors-Black drwxr-xr-x  3 root     root          4096 Oct 23  2013 ComixCursors-Blue drwxr-xr-x  3 root     root          4096 Oct 23  2013 ComixCursors-Green drwxr-xr-x  3 root     root          4096 Oct 23  2013 ComixCursors-Orange   In the output command I want to move everything besides the tar.bz2, within the terminal.  I tried the following but unfortunately it moves the tar.bz2 as well:   mv Comix*[!tar.bz] /usr/local/share   I expected the negation operator to exclude the file ending wit tar.bz. The solution below is what I was looking for, didn't want to use find with complicated flags.

I have a directory that contains the following:  x.pdf y.zip z.mp3 a.pdf   I want to delete all files apart from x.pdf and a.pdf. How do I do this from the terminal? There are no subdirectories so no need for any recursion.