I need to call a function with the prototype:  SomeFunc<T>()   and say I have a class of:  public class Person { }   I would call it as SomeFunc<Person>(). However I only have Person expressed as a string so for instance:  var classString = "Person";   So how do I convert classString so I can pass it for T?

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }


I was solving a question and got struck in a sub-question which is,      If   $$x=\cos1°\cos2°\cos3°\cdots\cos89°$$   Find the value of $x$.   I don't actually have any idea on how to proceed on this question. Any hints are welcome. The answer given in the book is a perfect integer $17$

Evaluate: $$\prod_{i=1}^{89} \sin (i)$$  My attempt:We know that   $\sin \alpha \cdot \sin(90- \alpha)=\sin \alpha \cos \alpha=\frac{1}{2}\sin 2\alpha$  Then we have:  $$ (\sin1\cdot\sin89)(\sin2\cdot\sin88)\cdots (\sin44\cdot\sin46)\sin45 =\left(\frac{1}{2}\sin2\right)\cdots\left(\frac{1}{2}\sin88\right)\frac{\sqrt{2}}{2} $$  Factorize from $\frac{1}{2}$ then do the same thing again You will get:  $$ \frac{\sqrt{2}}{2^{67}}(\sin4\cdot\sin8\cdots\sin88) $$  Now what to do?Any hints?


I want to make my PC as webserver, file server which should be accessible over internet. I have a public IP, how can I use it to make my PC accessible through internet? Any help?

My PC is behind a NAT router that has a public IP address. If I want to host a website then I believe I need a domain name which I can purchase from some site which would pledge to resolve all DNS requests for that domain name and send the IP address of my NAT router (assuming I do not want to host my domain name on their servers). Now I want to host a web server on my computer.   What changes should be done to the NAT router's configuration to forward all HTTP requests for example.com to my PC in the internal network. Is the above strategy correct? Is it commonly used?


I'm analyzing a C program in which I find a strange fucntion call here is the function definition :  static void endSignal (int32_t dummy) {   if (nTerminating) return;   nTerminating=1;   printf("terminating....\n");   terminateDLNAsystem();   sleep(1);   exit (0); }   This function takes an int32_t parameter ! Now this the main function calling "endSignal"  int32_t main (int32_t argc, char **argv) { /*Statements . . */ signal(SIGINT, endSignal); signal(SIGABRT, endSignal); signal(SIGQUIT, endSignal); signal(SIGTERM, endSignal);  return 0; }   the main function call endSignal without any parameter, what happen in this case ?

I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C?


I'm trying to get the difference between two numbers which I have taken from two files. I think my code will make sense:  I've tried to make it work by two different methods, didn't work. What I get as an output is zero (0).  #method 1 difference_btwn_eng_hrs_MX3_122=$(($(sed -n '1p' engine_hours_new_MX3_122.txt)-$(sed -n '1p' engine_hours_old_MX3_122.txt))) echo "$difference_btwn_eng_hrs_MX3_122"  #method 2 new=$(sed -n '1p' engine_hours_new_MX3_122.txt) old=$(sed -n '1p' engine_hours_old_MX3_122.txt) echo "$new $old" | awk '{print $new - $old}'   Eventually I will use the difference to set intervals for email updates.  The values inside the files are 511.786 (new) and 509.768 (old), and the error I get from the terminal is as follows:  line 40: 511.786-509.765: syntax error: invalid arithmetic operator (error token is ".786-509.765")

Using echo "20+5" literally produces the text "20+5".  What command can I use to get the numeric sum, 25 in this case?  Also, what's the easiest way to do it just using bash for floating point? For example, echo $((3224/3807.0)) prints 0 :(.  I am looking for answers using either the basic command shell ('command line') itself or through using languages that are available from the command line.


I am getting following exception when I am going to send the mail with FTL teampate & attaching image with it. Please advice what needs to be done               java.lang.OutOfMemoryError: PermGen space              at sun.security.provider.certpath.UntrustedChecker.check(UntrustedChecker.java:58)              at sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(PKIXMasterCertPathValidator.java:117)              at sun.security.provider.certpath.PKIXCertPathValidator.doValidate(PKIXCertPathValidator.java:330)              at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:178)              at java.security.cert.CertPathValidator.validate(CertPathValidator.java:250)              at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:275)              at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:263)              at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:173)              at sun.security.validator.Validator.validate(Validator.java:218)              at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126)              at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209)              at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249)              at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1185)              at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:136)              at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)              at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)              at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:958)              at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1203)              at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:654)              at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:100)              at com.sun.mail.util.TraceOutputStream.write(TraceOutputStream.java:101)              at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)              at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)              at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1418)              at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1408)              at com.sun.mail.smtp.SMTPTransport.ehlo(SMTPTransport.java:847)              at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:384)              at javax.mail.Service.connect(Service.java:297)              at javax.mail.Service.connect(Service.java:156)              at javax.mail.Service.connect(Service.java:105)              at javax.mail.Transport.send0(Transport.java:168)              at javax.mail.Transport.send(Transport.java:98)             java.lang.OutOfMemoryError: PermGen space             Exception in thread "http-bio-8080-exec-17" java.lang.OutOfMemoryError: PermGen space             Exception in thread "bitronix-scheduler" java.lang.OutOfMemoryError: PermGen space

Recently I ran into this error in my web application:     java.lang.OutOfMemoryError: PermGen space   It's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6. Apparently this can occur after redeploying an application a few times.  What causes it and what can be done to avoid it? How do I fix the problem?


I want to make my paper repository a little more readable, so I like to break sections out into separate .tex documents.  However, this does not seem to play nice with the IEEE format.  How can I get my intro (and subsequent sections) in a separate document and not have a page break before it?  MWE (sorry, just building off their example... super long):  in bare_jrnl.tex:  \documentclass[journal]{IEEEtran}   \begin{document} \title{Bare Demo of IEEEtran.cls for Journals}  \author{Michael~Shell,~\IEEEmembership{Member,~IEEE,}         John~Doe,~\IEEEmembership{Fellow,~OSA,}         and~Jane~Doe,~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space \thanks{M. Shell is with the Department of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, GA, 30332 USA e-mail: (see http://www.michaelshell.org/contact.html).}% <-this % stops a space \thanks{J. Doe and J. Doe are with Anonymous University.}% <-this % stops a space \thanks{Manuscript received April 19, 2005; revised September 17, 2014.}}   \maketitle  \begin{abstract} The abstract goes here. \end{abstract}  \begin{IEEEkeywords} IEEEtran, journal, \LaTeX, paper, template. \end{IEEEkeywords}   \IEEEpeerreviewmaketitle    \include{intro}  \section{Conclusion} The conclusion goes here.    % use section* for acknowledgment \section*{Acknowledgment}   The authors would like to thank...  \begin{thebibliography}{1}  \bibitem{IEEEhowto:kopka} H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus   0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.  \end{thebibliography}  \begin{IEEEbiography}{Michael Shell} Biography text here. \end{IEEEbiography} \end{document}   in intro.tex:  \section{Introduction} \IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file'' for IEEE journal papers produced under \LaTeX\ using IEEEtran.cls version 1.8a and later. I wish you the best of success.  \hfill mds  \hfill September 17, 2014  \subsection{Subsection Heading Here} Subsection text here.  \subsubsection{Subsubsection Heading Here} Subsubsection text here.

There are two different commands to incorporate another file into the source of some document, \input and \include. When should I use one or the other? What are the differences between them? Are there more things like them to be aware of?


I wish to properly accent Hölder's name in LaTeX by using \"{o}, but TeXWorks keeps replacing my double quote with a single quote. My hacky workaround to this is to copy the " unicode character from a browser and directly paste it into TeXWorks, but I would like a more permanent solution. Is there a way to make TeXWorks stop doing this?

Now, my version of TeXworks is 0.4.5r.1280 and I can't have the " character on the keyboard.    I have ``  or '' instead. Why?  And It's the same with Alt+034. I'm very disappointed with that.


As an American, I am used to driving on the right, and that the left lane on a major highway is supposed to be the "fast lane"...  If I attempt to drive in the UK, is the right lane the "fast lane" on major highways?

I've got a question about how to drive the car in Europe on Highways. In the US, I can overtake another car on either side, and I am fine.  In Europe I was told that I have to drive on the right side (Germany), and to overtake on the left side of the other driver.  Now I had following situation, and I did not know how to handle this properly: I was driving along on the right lane, the Autobahn was 3 lanes wide on my side, and was going around 110 km/h. Someone overtook me, but he stayed on the middle lane, and suddenly got slower. He wasn't really in front of me, so I could not change to the left lane, but I was told I may not overtake on the right side.  Would I have to brake in such a situation, or should I just ignore it, and overtake him again on the right side?  (I overtook him, and he was on the phone, so I guess that was why he got distracted and slowed down that much).


In many languages, e.g. Java and JavaScript, the 'static' keyword refers to class methods or class variables.    Why is it called the 'static' method? Why not 'blue' method? Or 'global' method? Where does the keyword come from? What is the origin for that denomination? Is it related to the compiler?

To be specific, I was trying this code:  package hello;  public class Hello {      Clock clock = new Clock();      public static void main(String args[]) {         clock.sayTime();     } }   But it gave the error      Cannot access non-static field in static method main   So I changed the declaration of clock to this:  static Clock clock = new Clock();   And it worked. What does it mean to put that keyword before the declaration? What exactly will it do and/or restrict in terms of what can be done to that object?


The spell sickening radiance states:     Dim, greenish light spreads within a 30-foot-radius sphere centered   on a point you choose within range.   Wall of force states:     An invisible wall of force springs into existence at a point you choose within range.    and      Nothing can physically pass through the wall.   As the wall is "invisible", that means it is permeable to light. So the light of sickening radiance - and thus the effect of the spell - should be allowed to pass through. But the wall also stops anything from physically passing through it; would that apply to the photons of the sickening radiance (if, indeed, "light" in D&D terms is made of photons)? If not, why can the visible spectrum of light pass but the damaging, magic light of "sickening radiance" not?

The spell description of  is silent on the question of whether spell effects can pass through the wall.  The semi-relevant part of the description states:     Nothing can physically pass through the wall.  It is immune to all damage and can't be dispelled by dispel magic.  A disintegrate spell destroys the wall instantly, however.  The wall also extends into the Ethereal Plane, blocking ethereal travel through the wall.   How are folks ruling on the question of spells passing through the wall (in both directions)?  If the answer is that spells cannot pass through the wall, do you rule that it also blocks line of effect (so that you can't target a spell on the other side)?


I am a little bit confused about the object and type classes in Python 3. Maybe someone can clear up my confusion or provide some additional information.  My current understanding is that every class (except object) inherits from a base class called object. But every class (including object) is also an instance of the class type, which is an instance of itself and object and also inherits from object.  My questions are:   Is there a reason/design decision why object is an instance of type and type inherits from object? Has the type/class of an object also to be an object itself? How can a class (type) be an instance of itself?  Which one is the real base class object or type? I always thought object would be the most "fundamental" class, but it seems to be an instance of type, which is an instance of object, which is an instance of type, ... Where does this recursion end? Is there a possibility to illustrate the relation between the object and the type class?   I tried looking up the entries of object and type in the Documentation of the Python Standard Library.  Every class (except object) inherits from object.  >>> for x in object, int, float, str, list, dict: ...     print(f'{x.__name__:6}: {x.__bases__}') ...  object: () int   : (<class 'object'>,) float : (<class 'object'>,) str   : (<class 'object'>,) list  : (<class 'object'>,) dict  : (<class 'object'>,)   Every class is an instance of the class type.  >>> for x in object, int, float, str, list, dict: ...     print(f'{x.__name__:6}: {x.__class__}') ...  object: <class 'type'> int   : <class 'type'> float : <class 'type'> str   : <class 'type'> list  : <class 'type'> dict  : <class 'type'>   type is an instance of itself.  >>> type.__class__ <class 'type'>   type also inherits from object.  >>> type.__bases__ (<class 'object'>,)   Also  >>> isinstance(object, type) True >>> isinstance(type, object) True >>> isinstance(type, type) True >>> isinstance(object, object) True   >>> issubclass(type, object) True >>> issubclass(object, type) False

In Python, what are metaclasses and what do we use them for?


If $T: \mathbb{C} \to \mathbb{C}$ is given by $ T(z)= a z + b \bar z$ where $a,b \in \mathbb{C}$.   Then is it true that, $ |T z|= |z| \,\,\forall z\in \mathbb{C} \implies ab=0 $ ?   If yes, how can I show this? Any help would be appreciated. Thanks in advance.

Let $\lambda , \mu$ $\in$ $\mathbb{C}$. Define $T:$ $\mathbb{C}$ $\to$ $\mathbb{C}$ by $T(z)=\lambda z + \mu \bar{z}$ for every $z \in \mathbb{C}$. Show that if  $\vert T(z) \vert = \vert z \vert$ then $\lambda\mu =0$  I'm doing the first thing that comes to mind:  $\vert \lambda z+\mu\bar{z}\vert ^2=\vert z \vert ^2$ So we have $(\lambda\mu+\mu \bar{z})(\overline \lambda \overline z + \bar{\mu}z)=z\bar{z}$  How can I conclude the proof? Thanks.


Unfortunately all my attempts to connect my OKI MC562dn with the official firmware update tool fail. The hints given here doesn't work for me. The tool can't find any device in the network and usb. My printer network card unfortunately, due to reset settings, the firmware is only required via usb stick - to restore the network card. I was refused support. If someone has it, please upload the firmware. The printer works fine via the usb port but the printer is used on the network.

Unfortunately all my attempts to connect my OKI MC562dn with the official firmware update tool fail. The hints given  doesn't work for me. The tool can't find any device in the network.  The strange thing is: The printer works fine in general. I can print from several windows PCs in the same network without problems, in color, black&white and duplex. I can ping the printer. I can manage the device with the webserver reachable at 192.168.1.21. I can even scan documents and fotos from my OKI MC562 to several different locations in my home network.  To update the firmware I also tried to connect the printer to a laptop and his USB Port. The same thing: I can print, but the update tool doesn't find the printer.  How can I update my OKI MC562 with the  and the use of a USB stick?  The  isn't clear enough for me to find all necessary files and the needed "model specific folder structure" to get it working. Has anyone done this succesfully?


let us continue this discussion in chat   That's what you get when you click the "Would you like to automatically move this discussion to chat?" link. No capitalization. No punctuation. Awkward "let us" phrasing. What's up with this message? Can we get a better one? At the very least, it ought to have proper grammar.

Stack Exchange has a feature to help move extended discussions out of comments and into chat, but when you use it, it automatically writes the following message for you:  let us   Could we get the orthography fixed?  I'd like it to read:  Let us .  That's a capital letter at the beginning and a period at the end.


I have two arrays  Array ( [0] => 1 [1] => 2 [2] => 4 [3] => 5 [4] => 6 [5] => 11 )      Array ( [1] => Zwembad [2] => Airconditioning [3] => Telefoon [4] => Internet [5] => Wi-Fi [6] => TV [11] => food )   Is there an array function to combine this array to form a new array.  Result Array should be:  Array ( [0] => Zwembad  [1] => Airconditioning  [2] => Internet  [3] => Wi-Fi [4] => 6 [5] => TV )   That is, the values of First array have been replaced by the values corresponding to the index of second array.

I've got two arrays of the same size.  I'd like to merge the two so the values of one are the key indexes of the new array, and the values of the new array are the values of the other.  Right now I'm just looping through the arrays and creating the new array manually, but I have a feeling there is a much more elegant way to go about this.  I don't see any array functions for this purpose, but maybe I missed something?  Is there a simple way to this along these lines?  $mapped_array = mapkeys($array_with_keys, $array_with_values);


I'm trying to replace a whole tag with a shortcode, if the tag text equals a value. I'm placing this script into the footer of the page. Here's what I'm trying:  var stockcounter = document.getElementsByClassName("stock in-stock");  if(stockcounter[0].innerHTML=='0 in stock') {     //Displays timer     stockcounter[0].outerHTML = do_shortcode('[fergcorp_cdt_single date="Feb 25 2019 18:45:00"]'); }   This doesn't change the target tag at all. Does anyone know what I'm doing wrong?

Suppose to have this shortcode:  [spu-close class="" text="" align=""]   I want to show this short code when I click on a button this is  my html:   <input class="button b" onclick="openFile(link);"  type="button" value="download" />   and this is my js file:  function openFile(link){ //I want do something like this     do_shortcode('[spu-close class="" text="" align=""]', false );    //    }   I don't know how I can do this, anyone can help me?


I want to find running time of a program (not CPU time). I have written a c++ code as follows.  time_t start,end; time (&start); //code time (&end); double dif = difftime (end,start); cout << dif ;   I got a output for particular instance as 2. what does this means? How can I get more accurate measure for elapse time (wall clock time)

$ time foo real        0m0.003s user        0m0.000s sys         0m0.004s $   What do 'real', 'user' and 'sys' mean in the output of time?  Which one is meaningful when benchmarking my app?


I have this question from an assignment, but the school's resources are inaccessible at the moment, so I need some help. Google is not very helpful for this.  I have only just installed ubuntu, so this is probably basic to some, but not me im afraid. Does anyone know how to 'Check the directory that your shell is currently in'? My assumptions are that terminal is considered my shell, and that I should look for the program file. I have looked around the usr subdirectories using ls. I can't find terminal listed there. If there is a better way to interpret the question I would like to hear about it. :)

I want to have a script that takes the current working directory to a variable. The section that needs the directory is like this dir = pwd. It just prints pwd how do I get the current working directory into a variable?


One or more Member State(s) consider you to be a threat to public policy, internal security or public health as defined in Article 2(19) of Regulations Ec No 562/2006 (Shengen Borders Code) or to the international relations of one or more of the Member States.  will my denmark green card application is prone to decline due to the past schegen visa refusal reasons?   With the above refusal reason, I am not sure whether my name is listed in SIS.  Is there a way to clear the name out of the record.. whom should i contact and what it takes in terms of time and money?  Please advice.

I applied for German Schengen visa as a medical escort to my relative in a different country from  where I reside, but my visa application was refused and the refusal letter  was written in German as the following:        Ein oder mehrere Mitgliedstaaten sind der Auffassung, dass Sie eine Gefahr für die öffentliche Ordnung, die innere Sicherheit, die   öffentliche Gesundheit gemäß Artikel 2 Absatz 19 der Verordnung (EG)   Nr 562/2006 (Schengener Grenzkodex) oder die internationalen   Beziehungen eines oder mehrerer Mitgliedstaaten darstellen.      I was in Germany for nearly a year with my relative during his treatment; I extended my stay there 3 times; and I returned back home two months ago in order to renew my passport. I applied again using the same documents that I used for my extension in Germany.    First, can anyone tell me what the refusal means? Next, is there any possibility that there is a mistake in the assessment?    Note: In English this reason is...     One or more member state(s) consider you to be a threat to public   policy, internal security, public health as defined in Article 2(19)   of Regulation (EC) No 562/2006 (Schengen Borders Code) or the   international relations of one or more of the member states).


Currently, it's not obvious how to obtain a link to a specific comment (there is no obvious share icon on comments).    has a lot of views/upvotes indicating a lot of people have had to go looking for how to link to a comment.   Suggestion  I could suggest changing from the current, e.g.     to something like    (only difference is the small link icon at the end of the comment, next to the edited icon)

I have seen many people share links which go directly to a specific comment. I wanted to do this too today but I couldn't figure out how. I had to search here on Meta to find this Q&A:    It turns out that the timestamp beside each comment is actually a link to that comment.  I have a few problems with the way this works currently:   This was not intuitive to me The timestamp is not formatted like a link, infact it is often greyed-out or otherwise unemphatic The text of this link is contextual ("yesterday" vs. "19 hours ago" vs. "Dec 19 '11 at 17:48") which makes me have to think about where to look for the link   Can we somehow improve the UI of comments so that the perma-link is more intuitive to find?


The chat shorthand that started me thinking on this was oic which represents Oh, I see.  This is not an Acronym or an Initialism, as both of those are based on spelling.  This is not just a shortened form of a word, like “ex.” for “example”.  Though that is just an Abbreviation, neither an acronym nor an initialism, it is still based on spelling.  This is not an Onomatopoeia, a word crafted to be similar to the sound it represents, as pronouncing this would be so close to the sound a pig makes. oink  This is shorthand needing another way of interpretation to be properly understood.  Abbreviation is the closest term that I know for something like this, but it does not seem to fit.  Does anyone know a term for this kind of word?  Just curious.  Perhaps giving it a term would legitimize it too much.

XS sounds like excess, B4 sounds like before, XLNC sounds like excellency, etc.  What are these wordplays called?


Prove that the following statements are equivalent.  1-) The Cartesian product of a non-empty family of non-empty sets is also non-empty, i.e, $\{A_i: i \in I\}, I\neq \emptyset, A_i \neq \emptyset \Rightarrow \Pi _{i \in I} A_i \neq \emptyset$  2-) all non-empty collection of non-empty sets admits function choice, i.e, $\tau \neq \emptyset , \forall A \in \tau , A \neq \emptyset  \Rightarrow \exists f:\tau \to \bigcup \{A: A \in \tau\}$ where $A \to f(A) \in A$  I can not get started

I understand that the axiom of choice, given the axioms of ZF set theory, is equivalent to the statement that "the Cartesian product of any family of nonempty sets is nonempty." I've been unable to find this proof. Could someone sketch it for me? Or provide me with a source at least?


I have not been playing Minecraft very long, and I am having trouble find diamonds. I have looked at a few different articles saying that diamonds are most commonly found on level 8 and lower.  Are these articles true, or am I looking on the wrong level? I still have not found any diamonds. Is there a chance my world might have generated without any diamonds in it?

The durability of iron tools is really starting to annoy me, but in all my hours of playing I've only stumbled across one deposit of diamond ore that provided around 7 Diamonds. What's the best way to locate more in Survival mode? Where is it most commonly found?


I have a strange situation that Windows 7 thinks it was not shut down correctly, and gives me a warning in the system event log like this:    What the KB-article does not tell is how Windows actually determines that situation. Does it parse its own system event log after reboot? Or where does it get that information from?  I am currently investigating an issue where I believe the system fails to write the system event log correctly (it stops having entries, although other logs like the application event log still have entries), and after a reboot, Windows thinks it has not been shut down correctly.  Does anybody have any experience with this? And can you confirm that Windows determines the previous correct system shutdown by parsing its own system event log on start-up?

Actually, this question struck me because of power cuts in my house. When there is a power cut, there is a sudden loss of power from the computer.   How does the computer know that the shutdown was not properly done?


I want to write an emulator for a particulary slow CPU which runs at 600 or so kilohertz. If I were to write an emulator for the CPU in the naïve way (i.e. emulating one instruction at a time without anything else), the emulation would be much faster than 600 kilohertz.  How do I program an emulator to emulate a CPU at the correct speed, regardless of host's speed? What technique is usually used by real-world emulators to do this? How do I avoid jitter slowing down the emulation?

If you had read my other , you'll know I've spent this weekend putting together a 6502 CPU emulator as a programming exercise.  The CPU emulator is mostly complete, and seems to be fairly accurate from my limited testing, however it is running incredibly fast, and I want to throttle it down to the actual clock speed of the machine.  My current test loop is this:      // Just loop infinitely.     while (1 == 1)     {                         CPU.ClockCyclesBeforeNext--;          if (CPU.ClockCyclesBeforeNext <= 0)         {             // Find out how many clock cycles this instruction will take             CPU.ClockCyclesBeforeNext = CPU.OpcodeMapper.Map[CPU.Memory[CPU.PC]].CpuCycles;              // Run the instruction             CPU.ExecuteInstruction(CPU.Memory[CPU.PC]);              // Debugging Info             CPU.DumpDebug();             Console.WriteLine(CPU.OpcodeMapper.Map[CPU.Memory[CPU.PC]].ArgumentLength);              // Move to next instruction             CPU.PC += 1 + CPU.OpcodeMapper.Map[CPU.Memory[CPU.PC]].ArgumentLength;                                                 }     }   As you can tell, each opcode takes a specific amount of time to complete, so I do not run the next instruction until I count down the CPU Cycle clock. This provides proper timing between opcodes, its just that the entire thing runs way to fast.  The targeted CPU speed is 1.79mhz, however I'd like whatever solution to the clock issue to keep the speed at 1.79mhz even as I add complexity, so I don't have to adjust it up.  Any ideas?


Police want to catch me after I accidentally fired a weapon in public. Now, if I meet a police guy standing around he wants to bust me and one blue star appears by the minimap. How do I end the chase?

I engaged with some enemy NPCs, and accidentally shot a civilian in the head (though not sure it would've mattered if I hit them somewhere else or not) as they ran across my screen. As a result of this, I was alerted by the game that the NCPD (the police) were automatically en route to 'investigate', and that I could avoid them by leaving the area and "lying low for a while". How long does it take for the police to stop searching for me, and is there any kind of visual information on the HUD that alerts me to when NCPD is or is no longer looking for me?


I checked the settings of my update manager (cf picture below), but I have received no notification so far for Trusty, I was wondering if this was normal, or if I would have to install it manually?  EDIT If I change my settings to "Any new version" I get a notification for 12.10. I don't really want to run four upgrades to get to the current version though...  EDIT 2  is very useful to understand the upgrade on Ubuntu. The answer is basically that there won't be any notification until the first point release (14.04.1), but users who wish to bypass this and install the new LTS without having to wait can run sudo update-manager -d. Remember to backup your system beforehand to protect your data against screwups.

I'm following the , but on launching the upgrade tool I get this response:  Checking for a new ubuntu release No new release found   Am I doing something wrong? Is there a workaround?


I’ve started using my iPad more and more (especially here on Ask Different) and I’ve found that I can’t find the grave accent character (also known as the "back tick" or "opening single quote"; it's the un-shifted ~ key on the standard US keyboard.  Where can I find this character on the iOS keyboard?

Is there a backquote (backtick `) on the iPhone keyboard, and if so, where is it?  When I'm writing a post on a site in the SE family (especially SO), I want to use the backquote for inline code blocks. Under the single quote key, I've found two curly/angled quotes, but those (’ and ‘) don't seem to do the trick...


What conclusions can we draw if $p>\alpha$? Does not rejecting the $H_0$ mean anything?

A basic limitation of null hypothesis significance testing is that it does not allow a researcher to gather evidence in favor of the null ()   I see this claim repeated in multiple places, but I can't find justification for it. If we perform a large study and we don't find statistically significant evidence against the null hypothesis, isn't that evidence for the null hypothesis?


I am using Ubuntu server. I ran:  chmod -R 700 /   when I was logged in as root. Now when I try to login as my normal user I immediately get kicked out. Is there anyway to log back in to the server whether it is root or whoever so that I can change the permissions? or am I totally screwed? I dont think I have root access enabled in the /etc/ssh/sshd_config file. I do have physical access to the server. I really need some help here.

I recently typed the command  sudo chmod 777 -R /   after that some things like  sudo -i   are not working normally. So I am wondering if there is any way I could reset the folder permissions to their original state?


I was writing an IEEE paper.I wanted to insert some texts like IMAGE_NEW and IMAGE_OLD but when I am writing it is showing me some error.How to solve this issue.

How can I produce the text Word_one_two in LaTeX?  I tried:  Samp\_Dist\_Corr   But, it doesn't quite look right. Also, I want it in the typewriter font, so actually, I'm doing:  \texttt{Samp\_Dist\_Corr}   I find it looks a bit like the underscore is merging in to the bottom of the "D", but maybe it's just because of the typewriter D?


I planed to purchase new mobile. I confused with processor and RAM.    Quad-core 1.2 GHz Cortex-A53 (64 Bit) 1GB RAM Quad-core 1.6 GHz Cortex-A7 (32 Bit) 2GB RAM   Which one will be faster?

Since Android can be installed on wide range of devices, I'm wondering how important RAM and the CPU speed are to the performance of a device.  There are always tradeoffs when something is increased and another one decreased!  Is more RAM or a faster processor better for general browsing and less mulititasking?  What if I'm interested in gaming or doing lots of things at once?  Will more RAM make up for a slower processor or vice-versa?


I am new to jquery and I am trying to make this code works but no way:     <button class="add">Add</button>       When I try adding the following line
<button class="remove">Remove</button>
 after the add button in the initial code, everything works properly. Anytime I add new remove buttons using the JS code, it works but i can not remove those buttons.  Kindly help me fix it.

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.


I need to use the root account - i.e. log on as root from the start.  I'm not interested in sudo or getting temporary root privileges.  And with the greatest of respect- please no warnings about root or it not being best practice! I've seen a few threads on this and the focus seems to be more about not using it rather than a clear set of instructions to enable the root account. Every thing suggested does not work.  I just need to be presented with a root account when I boot up my machine.  I would therefore be grateful for a concise set of instructions without the string of dire warnings. It would be great to pin such a guide as there seems to be so  many versions.  Thank you

I would like to enable the root account on my Ubuntu installation.  I realize the security implications of this.


Got a problem where preg_replace only replaces the first match it finds then jumps to the next line and skips the remaining parts on the same line that I also want to be replaced.  What I do is that I read a CSS file that sometimes have multiple "url(media/pic.gif)" on a row and replace "media/pic.gif" (the file is then saved as a copy with the replaced parts). The content of the CSS file is put into the variable $resource_content:  $resource_content = preg_replace('#(url\((\'|")?)(.*)((\'|")?\))#i', '${1}'.url::base(FALSE).'${3}'.'${4}', $resource_content);   Does anyone know a solution for why it only replaces the first match per line?

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


I am facing a problem as asked in this , I have tried the proposed solution but facing the same issue  When I run locale,  locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=en_US.UTF-8   When I run   sudo locale-gen en_US.UTF-8   I get this error  sudo: unable to resolve host ubuntu /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) Generating locales... en_US.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale:  LC_ALL: cannot change locale (en_US.UTF-8) /usr/sbin/locale-gen: line 243:  8925 Killed localedef $no_archive -i $input -c -f $charset $locale_alias $locale failed Generation complete.   I am running Ubuntu Cloud Image on OpenStack cloud

I want to switch to French locale. So I tried the below command:  myUbundu@myUbundu-desktop:~$ export LC_ALL=fr_FR   But I am getting the warning  -bash: warning: setlocale: LC_ALL: cannot change locale (fr_FR)   How to set the locale to French? Do I need to install additional packages?


I am simply attempting to install Neofetch in Ubuntu 20.04, but the above image shows that I am unable to. What should I do? Any help is appreciated.

I'm trying to run this command in the terminal:  sudo apt install software-properties-common   This is the error message I get:  E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)   E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend),     is another process using it?


I apologize in advance because I don't even know how to describe this best. But, I have 3 2-column ranges in which the left column is a unique identifier (ID) and the right column is quantity I'd like to sum up. There is some overlap between ID's in left columns. I created a column of sorted unique ID's but could not come up with a formula that would check each ID column for a criterion and then sum the values directly to the right of the match. Ideally, the formula would also work with "arrayformula" as the columns may get very lengthy. Here's an example spreadsheet  THANK YOU all

I have a Google Sheets with a long list of names and amounts. Many of the names are duplicates. For example:  John  | 10 Bill  | 2 Susan | 3 Frank | 4 Sally | 10 John  | 2 Susan | 2 John  | 3   Is there any automated way to combine all of the values so I get a list without any duplicate names and a single sum of all of each person's entry?  For example:  John  | 15 Bill  | 2 Susan | 5 Sally | 10


I am trying to access a remote VNC server (say server) via SSH. I am able to do it through one client (say client1):  Client 1 (works fine):  ssh -L  5901:localhost:5900 server` and then `vncviewer localhost:5901    Now, I connect to client1 from another client (say client2), and try to access the server's VNC session.  Client 2:  ssh -L 5901:localhost:5901 client1` and then `vncviewer localhost:5901`   Then I get the following error on the SSH prompt:  channel 4: open failed: connect failed: Connection refused   and the VNC client states that the server closed the connection. (EDIT)  I precise I do not try to connect with 2 clients to an unshared VNC session. I believe the problem to be related to port forwarding or perhaps SSH.  What can I be missing?

Multi-hop tunnel:  I am opening a tunnel to a remote server via a jump server.  ssh ${JUMP_HOST} -l ${JUMP_HOST_USER} -L ${PORT}:localhost:${PORT} \     ssh ${REMOTE_HOST} -l ${REMOTE_HOST_USER} -L ${PORT}:localhost:${PORT}   Now when I open a connection to localhost:port it will forward to  jump:port which in turn will forward to remote:port  Run local tunnel in background:  The problem with this is that it opens a shell on remote, whereas I just want the tunnel to run in the background.  So I add the -f option to my local tunnel to request it run in the background  ssh -f ${JUMP_HOST} -l ${JUMP_HOST_USER} -L ${PORT}:localhost:${PORT} \     ssh ${REMOTE_HOST} -l ${REMOTE_HOST_USER} -L ${PORT}:localhost:${PORT}   This, however, returns an error:  Pseudo-terminal will not be allocated because stdin is not a terminal.   Presumably this error is coming from the tunnel from jump to remote, and is caused because stdin is closed when my local tunnel is daemonized.  Tell remote tunnel I won't be running a command:  I then tried running the jump-> remote tunnel with -N to tell it I'm not going to be running a remote command.  ssh -f ${JUMP_HOST} -l ${JUMP_HOST_USER} -L ${PORT}:localhost:${PORT} \     ssh -N ${REMOTE_HOST} -l ${REMOTE_HOST_USER} -L ${PORT}:localhost:${PORT}   This works great - the tunnel runs in the background and I can connect successfully to remote:port by connecting to localhost:port.  Problem:  The problem I'm having is when I want to close the tunnels.  If I send a kill signal to my local ssh tunnel's pid, it will close, but the ssh tunnel running on jump remains running.  It seems that when I daemonize my local tunnel, the tunnel on jump is also daemonized.  Question:  Is it possible to run my local tunnel in the background, but when I kill it, have it shut down all the tunnels it has spawned on all remote servers?


When I AirDrop a file to my iPad, with no app installed to open the file type, the prompt still appears on the iPad that the file is being transferred. After the transfer completes, nothing happens.  Where does the file go? Is it stored on the iPad? Is it deleted on the spot? If not, how do I locate and delete it?

Where do AirDrop files go when I transfer them between an iPad, iPhone and iPod? I AirDropped some Google Docs from my iPad to my iPhone but nothing happened; where did my files go? The file was a list of tools.


I have a simply doubt about syntax in Java related with Strings. Could some one tell me what is the difference between the strings in the following code?  String[] firstS = {"word1","word2"}; String secondS[] = {"word1","word2"};   I can not realize what is the difference because doing some for loop both String have the same output.  Thank you so much.

I have recently been thinking about the difference between the two ways of defining an array:   int[] array int array[]   Is there a difference?


Aim is to build a function, which takes an array of Objects as first arguments. As a second argument it takes a key and value pair.   function whatIsInAName(collection, source)   Now the function should return an array with all the matching keys and values from the object. For example:  whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" })´    should return   [{ first: "Tybalt", last: "Capulet" }]  And  whatIsInAName([{ "apple": 1, "bat": 2 }, { "bat": 2 }, { "apple": 1, "bat": 2, "cookie": 2 }], { "apple": 1, "bat": 2 })   should return   [{ "apple": 1, "bat": 2 }, { "apple": 1, "bat": 2, "cookie": 2 }]   I tried looping through the collection- and through the source array searching for matches. Like this:  function whatIsInAName(collection, source) {   // What's in a name?   var arr = [];   for (var i = 0; i < Object.keys(collection).length; i++) {     for (var j = 0; j < Object.keys(source).length; j++) {       if (collection[i].last === source.last) {         arr.push(collection[i]);       }     }   }   console.log(arr); }   And in case of this arguments whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" })  It not surprisingly works.   What I don't understand is, why I can't generalize the above solution, so that it also works in other cases.  Why is it not possible to simply give the condition:  if (collection[i] === source)   (Pls notice the missing "Last" key behind collection and source.)  When I console.log(source), console logs it. So imho the conditional statement above should work and should go to push the matches into the arr Array.   How can I build a function which returns an array with all the matching keys and values from the object.   function whatIsInAName(collection, source)   And why does (collection[i] === source) not work?  Thank you.

A strict equality operator will tell you if two object types are equal. However, is there a way to tell if two objects are equal, much like the hash code value in Java?  Stack Overflow question  is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any equivalent solution.


What is the difference inbetween $\leftrightarrow$, $\iff$, and $\equiv$ ? Especially when used in the same text. My thought about that was that it has something to do with object language and meta language, but I'm not sure. I've heard that $\leftrightarrow$ is a connective on a proposition level, whereas $\iff$ is a statement about propositions. But where does $\equiv$ come in? I've seen texts that use either ($\leftrightarrow$ and $\iff$) or ($\iff$ and $\equiv$). But how do those three relate if they are all used at the same time? Whould that imply that there can be a meta language of a meta language? If not, which pairing makes more sense to use?

Some texts and online sources seem to imply that they're interchangeable, while others say that there is at least a small nuanced difference between the two.  For example, I've read that $ \equiv $ can be read as "can be replaced in a logical proof with...", yet I've also seen $ \leftrightarrow $ used in that same vein.  Edit: I'm trying to write my own textbook on this material as a way of forcing me to learn as much as possible before my final in 3 weeks. I'm trying to figure out a way to describe what $ \equiv $ means, while I've described $ \leftrightarrow $ as "If and only if"


I have two Python dictionaries, and I want to write a single expression that returns these two dictionaries, merged (i.e. taking the union).  The update() method would be what I need, if it returned its result instead of modifying a dictionary in-place. >>> x = {'a': 1, 'b': 2} >>> y = {'b': 10, 'c': 11} >>> z = x.update(y) >>> print(z) None >>> x {'a': 1, 'b': 10, 'c': 11}  How can I get that final merged dictionary in z, not x? (To be extra-clear, the last-one-wins conflict-handling of dict.update() is what I'm looking for as well.)


I am searching for the title of short story I have read several years ago. I think it was included in one of the Isaac Asimov Presents The Great SF Stories (or maybe some Nebula or Hugo short stories collections) but I have searched for it in any possible manner and didn't find it, so I'm probably wrong. I remember anyway that I was immensely surprised by this story as it didn't seem to fit in the period it was written: it was just too advanced.  What I recall of the story:   It was a about a super powerful sentient weapon built by aliens eons ago. This machine required a sentient being to operate even if it was fully capable of independent thinking. It was extremely powerful. The machine was extremely evil but needed to be connected to a lifeform to operate. Regardless every race that used the machine ended up fighting for it and being destroyed. During the eons of its existence the machine destroyed several different races (one for each chapter), one of them similar to the usual arachnid style races with different queens and eggs. The POV of the story alternated between the machine and an impartial narrator with some memories of the machines about its previous masters. Humans had just found the machine. I think one of the squad members, a member of the military, was the protagonist of another sci-fi cycle. The machine had to adapt to the humans to be operated and one of the first things she taught was that humans were just too inferior to control her, claiming that "they were just apes"   This story is a jewel!  Thanks for any help!

There's a book that I read several years ago that I'd like to find.  However, I cannot remember enough about it to find it myself.  Neither the title nor author remain in my mind, nor any keyword or phrase that's unique enough for the Grand Google to nail for me.  Hence my desperate plea here.  In the book, there is an interstellar civilization composed of several power blocks.  The entire civilization did not fill the galaxy, but it did span several stellar systems.  Maybe 10s or 100s.  I seem to remember that one of the civilizations was a decentralized group referred to as the Brotherhood and they seemed to have been keen on preserving old learning and political ideals.  A derelict alien spacecraft from outside all of this had been discovered and at least two of the power blocks sent ships to recover it.  I don't recall if they knew at the time about the power the alien ship had, but they must have had some clue since there was some urgency in capturing this ship.  One of the ships sent to capture the Alien craft was commanded by somebody who was rather shaken up, to say the least.  He had had some big trauma in his past (like... the last ship he captained was annihilated with all hands.) so he was kinda bummed out about things and wasn't really putting his heart into getting this done.  He was assisted by the ship's AI who had a lot of soul-to-soul chats with the captain, and at one point almost relieved him of command because he was just not getting the job done.  I think the ship's name was Boaz.  These were the "good guys".  There was at least one other ship sent from the "bad guys."  The alien craft had some remarkable powers.  The interior volume was apparently infinite and the operators could see and manipulate anything in the universe.  There might have been some example given where all the rats somewhere were found and disposed of.  Whoever had control was tempted by the ole absolute power corrupts absolutely problem, but nobody but nobody could stop them because of their power.  They could eat and multiply within the ship and become real bad-asses.  But alas... (or hurray, depending upon which side you're one) everything fails eventually, and whoever controlled the ship would eventually succumb to some horrible end.  Whereupon the ship became derelict again until some other lucky race found it and repeated the cycle.  The ship had an AI that was real interested in taking the power for itself, but there was some mechanical, spring-loaded, mechanism outside of its control that needed to be worked in order to execute power.  The AI apparently never figured out how to "work the spring" and this made him crazy angry.  The ending is equally foggy for me.  I'm pretty sure the good guys got the ship.  They agonized over what to do with it.  Apparently it was indestructable and nobody wanted to taste the temptation of all that power.  In the end they dumped it on the surface of a neutron star.  There it sat forever more, probably with the crazy AI really pissed off about being there.  If you've read this book, you'll recognize it immediately from these clues.  I'm looking forward to finding out the name of this book.  Thanks!


I'm trying to reduce an important list of list in python as I don't need as much data to get where i want to go, ie drawing a route   mylist = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14],            [15, 16], [17, 18], [19, 20], [21, 22], [23, 24]]   I would like to "jump" some item of the list to reduce the size. Example below where i skip 2 items every 3 lists.  mylist = [[1, 2], [7, 8], [13, 14], [19, 20]]   I tried with mylist[1::3] but wasn't successful  Thanks.

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


I wrote a small program in Python. Actually it's not even a program really :p.   It's just this:      print(1+1)   When I saved it, it saved it as py1.py (a python file). And apparently, Python files can be executed, and it executed fine.  Is there anyway to be able to compile it into bytecode? Also is there a way to make it a stand alone application?  I could be getting terms wrong, I'm more of a Java person. I'm new to Python.  Thanks!

Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux.  The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the right direction please?


I'm pretty new to ubuntu and i have no idea on how to go through the process of installing the game. If anyone can help by posting a step by step process, it would be of great help  Thank you

I'm using Ubuntu 14.04 and PlayOnLinux 4.2.2. I managed to get League of Legends almost running perfectly, there are only two problems. The first is that the shop to buy things with IP/RP is just a black screen. Here is a screenshot:    The second problem is that in the game, during the match, some menus are messed up, as if they were in a different resolution from the game's current resolution. For example, the item shop opens a normal window, but this window's contents are all over the screen. Here is a screenshoot:    All the rest is working fine, I even get high FPS. I installed LoL via PlayOnLinux and then I applied TuxLoL patch. I have an Optimus Notebook, Dell Inspiron 14R 5421, it has an Intel integrated video card and Nvidia GeForce 730M dedicated card, which are properly handled by Bumblebee.  How do I fix these two problems? Could somebody help me, please?


I got several devices which send a TCP or POST message each minute. I need to alarm whenever a device stop sending messages after one hour.   I thought about creating one Timer for each device and restarting it whenever a message is received. If the event triggers, call a method with the corresponding ID of the device associated to the timer and generate the alert.  The problem is that I can't find a way to pass fixed parameters to the Timers. Every method I tried somehow the chosen parameter gets replaced the same for every timer.   Is there a better approach? Or which is the correct way to pass parameters to the elapsed event of the timer?  Thanks,  Edit:  This code prints always 5, I need it to print 1 2 3 4 5 (doesn't matter the order)      private Timer[] timers = new Timer[5];     private void button6_Click(object sendera, EventArgs ee)     {         for (int i = 0; i < timers.Length; i++)         {             timers[i] = new Timer(1000);             timers[i].Elapsed += (sender, e) => { HandleTimerElapsed(i); };             timers[i].Start();         }     }      static void HandleTimerElapsed(int i)     {         Console.WriteLine(i);     }

I met an interesting issue about C#. I have code like below.  List<Func<int>> actions = new List<Func<int>>();  int variable = 0; while (variable < 5) {     actions.Add(() => variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable?


I read this story 30+ years ago in grade school. A man crashes on an alien planet. He has a small amount of water and accidentally spills some, and the planet replicates it but it must destroy part of itself to do so.  The man then finds some stale crumbs in his pocket, puts them in a trough, and the planet replicates them as well, but it's disgusting to eat. The man eventually decides that his situation is hopeless, so he lays down to die on a table in a hot room and thinks he can at least give back to the planet some of the nutrients it sacrificed for him. He falls asleep, and when he awakens, he has been transformed into an alien creature that is perfectly suited and adapted to live on the planet without discomfort to himself or damage the planet.

This is a story that was read on BBC radio about thirty years ago, and this is about as right as I can remember it: The human pilot of a spacecraft is doing some reconnaissance on an alien planet. He crashes but survives. For some reason, no one will know where to look for him. He sees something in the distance that looks like a building of some sort. When he gets there, it seems to be a home. Very much like a human home. There's furniture, but it's strange and uncomfortable . There's food, but it's inedible. There's a faucet but what comes out of it seems more like acid. Everything looks as though it should be right, but it's not. He leaves the house, wanders and after a few days is desperate for water. But there isn't any water anywhere. He's close to death, crawling on the ground and then something happens. There are cracks in the soil and there appears to be water bubbling up from perhaps some underground stream. The water revives him. He goes back to the house and tries the food again. It's delicious and he eats enough to gain back his strength. Then he decides to try the water again. It's pure and wonderful. He takes a shower and the last line of the story is how refreshing the water is on his skin and something about him lifting his tail.


I want to resize the home partition to have only 500gb, so then i can make a dual boot setup.

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I was following this question  to try to access my JSON file and pass it as an argument to my fromJSON call, however I get an NPE on my mobileArray initialization because jsonString's value is still null. What's going on here? My problem isn't the NPE itself but with my value not getting initialized.  EDIT: Tried passing InputStreamReader but it still crashes, updated code and added logcat   Event[] myArray; Gson gson = new Gson();  InputStream is = getResources().openRawResource(R.raw.myJSON); InputStreamReader isReader = new InputStreamReader(is);   myArray = gson.fromJson(isReader, Event[].class);   Logcat:      Caused by: java.lang.NullPointerException at com.example.test.testassigment.Event.setDayOfTheWeek(Event.java:36) at com.example.test.testassigment.Event.<init>(Event.java:21) at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:417) at com.google.gson.internal.ConstructorConstructor$3.construct(ConstructorConstructor.java:108) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:210)  at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)  at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)  at com.google.gson.Gson.fromJson(Gson.java:887)  at com.google.gson.Gson.fromJson(Gson.java:825)  at com.example.test.testassigment.MainActivity.onCreate(MainActivity.java:70)  at android.app.Activity.performCreate(Activity.java:4486)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)  at android.app.ActivityThread.access$600(ActivityThread.java:127)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:137)  at android.app.ActivityThread.main(ActivityThread.java:4511)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:511)

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 was reading a trig book in which the author had mentioned a trick to jump from $(\theta+90^\circ)$ to $(\theta-90^\circ)$ formulas. I understood it for Sine and Cosine but couldn't for Tangent.  Here is the $(\theta+90^\circ)$ formula…  $$\tan(\theta+90^\circ)=-\cot\theta$$  He mentioned to replace $\theta$ in the above formula by $(\theta-90^\circ$ to obtain the desired $(\theta-90^\circ)$ formula. I did the same and ended up getting this.  $$\tan(\theta)=-\cot(\theta-90^\circ)$$  which is wrong according to the book.  It says the answer should be…  $$\tan(\theta-90^\circ)=-\cot(\theta)$$  I do not where am I going wrong. What is incorrect in my approach? What is the flaw? Please help me track it down.

I was reading a trig book in which the author had deduced the following formulas from a drawing. I am mentioning those as follows...     By looking at the above drawing the author deduced these formulas for $(\theta+90^\circ)$...  1. $\sin (\theta + 90^\circ)=\cos\theta$  2. $\cos (\theta + 90^\circ)=-\sin\theta$  3. $\tan (\theta + 90^\circ)=-\cot\theta$  I understood how did he conclude above formulas from the drawing.  As you can see the drawing depicts author's approach to derive the $(\theta+90^\circ)$ formulas by taking a similar triangle in the second quadrant, in the same way, to derive $(\theta-90^\circ)$ formulas, he advised to take a similar triangle (as in the drawing) in quadrant 4 as well. But, to the contrary he mentioned a trick to get those formulas which I do not understand.   The author told to replace $\theta$ in formulas 1,2 and 3 by $(\theta-90^\circ)$. So what I got by doing that is...  1. $\sin ((\theta-90^\circ) + 90^\circ)=\cos(\theta-90^\circ)$  2. $\cos ((\theta-90^\circ) + 90^\circ)=-\sin(\theta-90^\circ)$  3. $\tan ((\theta-90^\circ) + 90^\circ)=-\cot(\theta-90^\circ)$  By evaluating them further I get...  1. $\sin (\theta)=\cos(\theta-90^\circ)$ (I got this one correct)  2. $\cos (\theta)=-\sin(\theta-90^\circ)$ (wrong)  3. $\tan (\theta)=-\cot(\theta-90^\circ)$ (wrong)  But the author says that the outcome of the formulas should be...  1.$\sin (\theta)=\cos(\theta-90^\circ)$ (correct.)  2. $-\cos (\theta)=\sin(\theta-90^\circ)$   3. $\tan (\theta-90^\circ) =-\cot(\theta)$   I don't know where am I going wrong. The author told to replace $\theta$ by $(\theta-90^\circ)$ then why am I getting my answers incorrect? Where is the flaw? Please help me to track it down.


I'm connected to a remote shell and many keys aren't working properly such as arrows and the escape key. This answer  suggested I might be in the wrong shell, so I referenced .  Using the methods described, I get strange results.  echo $SHELL  /bin/bash   but   echo $0 sh   Which shell am I using?

I read that terminal is nothing but shell, and Unix provides different flavors of shells:   Bourne shell (sh) C shell (csh) TC shell (tcsh) Korn shell (ksh) Bourne Again shell (bash)   Questions:   When I open a terminal window, which shell is opened by default? How do I check how many shells are installed? How do I change the shell used from my account?


I've a custom field, and I'm trying to write the validation for the field values. however when a particular field causes the failure, the whole fielset is marked in red. I only want the specific field element to be highlighted, and in the case of Unlimited I only want the specific entry highlighted.   here is the code I have so far. but the whole fieldset is marked in red when ever a validation fails.      function prodlist_field_widget_form(&$form, &$form_state, $field, $instance, $langtype, $items, $delta, $element) {       $base = $element;        if ($instance['widget']['type'] == 'prodlist_text') {         $element['#element_validate'] = array('_prodlist_text_validate');           $element['prod_type'] = array(           '#type' => 'select',           '#title' => t('Product Type'),           '#default_value' => isset($items[$delta]['prod_type']) ? $items[$delta]['prod_type'] : NULL,           '#options' => type_options(),           ) + $base;          $element['prod_description'] = array(           '#type' => 'select',           '#title' => t('Description'),           '#default_value' => isset($items[$delta]['prod_description']) ? $items[$delta]['prod_description'] : NULL,           '#options' => description_options(),           ) + $base;          $element['order_amount'] = array(           '#type' => 'textfield',           '#title' => t('Amount'),           '#default_value' => isset($items[$delta]['order_amount']) ? $items[$delta]['order_amount'] : NULL) + $base;       }       return $element;      }   function _prodlist_text_validate($element, &$form_state) {    if ($form_state['complete form']['#form_id'] == 'field_ui_field_edit_form') {     return ;   }    $values = $form_state['values'];   $language = $values['language'];   $field_name = $element['#field_name'];   $field_name_error_box = $field_name;    foreach ($values[$field_name][$language] as $delta => $item) {      if (isset($item['order_amount'])) {        if (is_numeric($item['order_amount'])) {         if($item['prod_description'] != 'no order' && $item['order_amount'] <= 0 ){           form_set_error($field_name_error_box, t('Order amount has to be more then 0'));         } else if ($item['prod_description'] == 'no order' && $item['order_amount'] > 0) {           form_set_error($field_name_error_box, t('You have created an order amount without selecting a product.'));         }         } else {         form_set_error($field_name_error_box, t('Order amount has to be numeric'));       }    }    }  }   I'm trying to set the variable $field_name_error_box = $field_name; to the correct value but it either lights up the whole form section or nothing at all.   I've tried the following, and lots of other variants without luck.  $field_name_error_box = $field_name . 'order_amount';

When validating a field manually from my form a error is displayed but the field doesn't get red. For the first parameter i used the name of the input element. DRUPAL 7  if($form_state['values']['panes']['webform_nid31'][0]['contact_person'] == '') {     form_set_error('panes[webform_nid31][0][contact_person]', t('You must select a name for this group of settings.'));   }


How can I find out why my all Oracle database schema packages gets in the invalid status suddenly? When I recompile its, invalid objects compile successfully.  I created trigger "before ddl" but it didn't help me. Also, I query from user_errors to see what the problem is, but there are no errors in that view. Are there any suggestions?  Here is my table audit and the trigger:       create table invalidations (   operation           varchar2(30),   invalidating_object varchar2(30),   invalidating_owner  varchar2(30),   invalidated_object  varchar2(30),   invalidated_owner   varchar2(30),   invalidation_date   date,   ipaddr varchar2(30),   host varchar2(30),   curruser varchar2(30),   currschema varchar2(30),   fgjob number,   bgjob number );  create or replace trigger befddl_trg before ddl on schema declare begin   insert into invalidations   select ora_sysevent, ora_dict_obj_name, ora_dict_obj_owner, d.name, d.owner, sysdate,   SYS_CONTEXT('USERENV', 'IP_ADDRESS', 15)    ,SYS_CONTEXT('USERENV', 'HOST', 16)    ,SYS_CONTEXT('USERENV', 'CURRENT_USER', 8)    ,SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA', 8)    ,SYS_CONTEXT('USERENV', 'FG_JOB_ID', 4)    ,SYS_CONTEXT('USERENV', 'BG_JOB_ID', 4)    from   all_dependencies d    where  referenced_name = ora_dict_obj_name    and    referenced_owner = ora_dict_obj_owner; end befddl_trg;

The scenario that created this question:    We have a package that is a dependency of another package, sometimes making changes to the "parent" package causes the dependent package to become invalid, but sometimes it doesn't.    It has caught us by surprise before.  It would be very useful to simply understand what causes invalidation so I could predict/plan for it.


I am currently trying to understand the formation or indeed the explanation as to why the hexagonal north polar vortex on Saturn is exactly that: Hexagonal.  I understand that the most prominent explanation are due to very large longitudinal gradients in the velocity of atmospheric winds.  To that end, I wonder if anyone could point me to recent advances in reseasrch in this area, or references to other pdfs on the web would be most welcome.

NASA has just shown a more detailed picture of the hexagonal vortex/storm on Saturn:           Is that theoretically understood what is the cause behind this eye-catching nontrivial, regular yet not circular, shape? If so, what is the cause? I expect some explanation in terms of "nonlinear equations" of "mathematical physics" and "solitons".  P.S. (added a day after this question and the first answer was posted): On  where I posted the same question, people came up with some articles and phrases like "Rossby waves" and "resonance of latitude-dependence Coriolis frequency".


I am building a binary logistic regression model. I am not sure if using the variables as interactions is a better choice than building separate models for level of a categorical variable. Is there a way to determine this? For ex, there are 2 categorical variable with 2 levels each - 1.Regions - East and West 2.AGI - High and Low The response variable behaves differently for each level i.e. East has higher number of positives response and so does high AGI. here is my question - Is it good to build separate models for each level i.e. have 4 models East and high, East and Low, etc.? Or use the 2 as categorical variables in one model? How do you determine when to split the data into separate models? I have built separate models when i knew the behaviour of the data (independent variables) are different in each level of a categorical variable.

I have customer data from 2 brands. The data structure are the same, but I expected the customer behaviour to be different in different brand.  So I could train 2 models, 1 for each brand, or I could train one model on both brands, but flag which brand the customers belongs to within the data.  So my question is, would training on both brands with flags be too much more work for the Machine Learning (I'm using neural network), and therefore be harder to achieve good accuracy than to have dedicated models for each brand?


here is my MainActivty I discard some method to be pasted here that makes my code shorter for u guys  public class MainActivity extends Activity {  private Button btn1,btn2; private Binder binder; @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);      setContentView(R.layout.activity_main);     btn1 = (Button)findViewById(R.id.btn1);     btn2 = (Button)findViewById(R.id.btn2);     btn1.setOnClickListener(new OnClickListener() {          @Override         public void onClick(View v) {             // TODO Auto-generated method stub             Intent intent = new Intent();             intent.setClass(MainActivity.this, SecondService.class);             bindService(intent, connection, BIND_AUTO_CREATE);         }     });      btn2.setOnClickListener(new OnClickListener() {          @Override         public void onClick(View arg0) {             // TODO Auto-generated method stub              Parcel data = Parcel.obtain();             Parcel reply = Parcel.obtain();              data.writeString("from activity: data");              try {                 //something wrong here?                 binder.transact(0, data, reply, 0);                  String string = reply.readString();                  System.out.println("actvity   --->"+string);             } catch (RemoteException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             }         }     }); } ServiceConnection connection = new ServiceConnection() {       @Override     public void onServiceDisconnected(ComponentName componentName) {         // TODO Auto-generated method stub      }      @Override     public void onServiceConnected(ComponentName componentName, IBinder binder) {         // TODO Auto-generated method stub          MainActivity.this.binder = (Binder)binder;     } };     and here's my service  public class SecondService extends Service{  @Override public IBinder onBind(Intent intent) {     // TODO Auto-generated method stub      return  new Mybinder(); }  class Mybinder extends Binder{     @Override     protected boolean onTransact(int code, Parcel data, Parcel reply,             int flags) throws RemoteException {         // TODO Auto-generated method stub          System.out.println("code---->"+code);          String string = data.readString();         System.out.println("s---->"+string);          reply.writeString("reply from :-->service");         return super.onTransact(code, data, reply, flags);     } }}     Logcat below:     it says line55: binder.transact(0, data, reply, 0); has some problems but I dont know why   any answer appreciate !


The notorious updates keep showing up in Ubuntu 20.04. Is there any way to disable them?

I would like to disable automatic updates in kubuntu 20.04. I disabled it on Muon package manager, but Discover still getting updates and showing notifications. Thank you.


What exactly is the difference between between a Window Manager and a Desktop Environment? E.g.:  vs. .

I posted a  and noticed people weren't distinguishing correctly between many of these things: Windows Managers vs Login Managers Vs Display Managers Vs Desktop Environment.  Can someone please clear this up, i.e. tell us the difference between them and how they are related perhaps?  What category does Xorg fall under?  What about Gdm/Kdm/Xdm?  People also talk about X.  What is X?


I'm not very confident or familiar with the use of semicolons. Hopefully someone here could help me out. I'm wondering is this sentence uses the semicolon properly:     Leadership communication skills, on the other hand, focus on the psychological aspects of communication; inspiring and motivating stakeholders with the confident delivery of mission, vision and values.    Any help would be much appreciated.

How does one correctly use a semicolon?  It is probably one of the more difficult punctuation marks to master in my opinion.


I wanted to ditch GNOME DE and install KDE Plasma (more likely Kubuntu), I did it with tasksel but I fell asleep beacuse it took so much and when I woke up my laptop was turned off.  When I booted it the DE woudln't load, so I switched to other desktop (Ctrl + Alt + F2) I uninstalled KDE, and when I rebooted of course it redirected me to tty1 with no DE.  The problem is that I have no internet interface, I'm in loopback, I connected it with wired ethernet and there is no amber light blinking, just the status light that i have something in the port.  I tried to enable networking with recovery and still nothing.  How can I activate networking and finally install KDE Plasma correctly?  I'm on Ubuntu 18.04

I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?


I have tried many different things to try to format my USB drive, but none of them work... how might I do this using the mformat commands? thanks!

Using Ubuntu 11.10, how do I format an external or USB drive? I don't find an option to 'format' when I right click. In the new version, the drives don't come up on the desktop, but instead come on the Launcher.


Recently in my undergraduate graph theory course we started learning about planar graphs. Now, the concept is very easy to me - However, in the homework, we are asked to redraw a certain graph as planar (not usually too hard), but then, redraw it in such a way that every edge is completely straight. I find this fairly difficult myself.  Are there any methods to help get a straight edge graph from one with curved edges? Do you have any tips? Anything you do to help yourself would be appreciated! Thanks so much  EDIT: Basically, how would I go from left to right without brute forcing/guessing? (Dont have 10 rep so can't post images, here is a link to the image):

I want to prove that every normal planar graph has a straight-line embedding.   First, I assume that the planar graph $G$ is maximal planar, i.e the number of edges is $3n-6$ for $|G|=|V(G)|\ge3$. If the graph is not maximal planar I simply add some edges until it is maximal. I also know that all faces form triangles.  Now I want to prove the result with induction with respect to $n$.  $n=3:$ This case is trivial, it is just a triangle.   $n-1\rightarrow n$. I assume I know that the embedding works for a graph with $n-1$ vertices. I do not know hot to conclude. Intuitively it is clear to me because it is nothing more than some triangles which I clue together.  Maybe you can help me.


I have some MP3 music tracks (written, performed, and recorded by me and some friends a few years ago, so no copyright issues) that I'd like to post onto facebook and share with my friends (and ideally not too easy for the web in general to get at them).  What is the easiest way to do this? I know with pictures and videos, you can just upload them to your account and share to friends/groups but I don't think I've seen a similar feature for music?

I know it's possible to upload videos to Facebook. Is it possible to upload an mp3 to Facebook using their user interface?


There is some "type of commutativity" between specifiers, as in:  int const arr[5] = { /*initial (and only) values*/}; const int arr[5] = { /* -//-*/};   where regardless of the sequence of the type name int and const specifier in the definition, the interpretation is the same: an array of const ints. Similarly, when accessing an predefined array element:  int a = arr[4]; int a = 4[arr];   there is equivalence between both ways of access.  Are there any other frequently used* similar cases?  *highly used expressions that exhibit similar behaviour and could be possibly misunderstood

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]?


In dynamics when doing collisions from the centre of masses' frame of reference we use . What is is it and why do we use it?

I hear people say that , $\mu$, is used for two body problems, but what sort of problems? Is it so that the two body system can be treated as one body or is it to simplify calculations regarding how the two bodies act upon each other?  I can follow the derivation (which I shall go through shortly) in a mathematical sense but I can seem to be able to grasp the ideas behind why the steps were taken.  Derivation:  Step [1] - From Newton's laws of motion: $$F_{12}=-F_{21}$$ It follows that: $$m_1a_1=-m_2a_2$$ Step [2] - Simple rearrangement of the result from step 1 to make $a_1$ the subject (it seems a reasonable thing to do but I don't know why it's done). $$a_1=-\frac{m_2}{m_1}a_2$$ Step [3] - The relative acceleration, $a_{rel}$, can be found by subtracting the acceleration of one body from the other (I get how this is done and get that it would give the relative acceleration BUT I don't know why you would need the relative acceleration). $$a_{rel}=a_1-a_2=(1+\frac{m_1}{m_2})a_1=\frac{m_2+m_1}{m_1m_2}m_1a_1=\frac{m_2+m_1}{m_1m_2}F_{12}$$ Step [4] - According to Wikipedia the result from the last step can be used thus (I have no idea what's going on in this step): $$\frac{m_2+m_1}{m_1m_2}F_{12}=\frac{F_{12}}{\mu}$$ Thus: $$\mu=\frac{m_1m_2}{m_2+m_1}$$  Again, I can do the maths but my problem here is conceptual I believe. I have included the derivation in my question because I believe that it's possible that if you were able to shed some light on why particular steps were taken that this may help.


I know the following question has been asked by the following link:   But my question is more about computing the final result: expected value of the maximum of 500 IID random variables, and I highlighted my doubt in bold in the following:  Question:  500 ants are randomly put on a 1-foot string(independent uniform distribution for each ant between 0 and 1). Each ant randomly moves toward one end of the string (equal probability to the left and right) at constant speed of 1 foot/minute until it falls off at one end of the string. Also assume that the size of the ant is infinitely small. When two ants collide head-on, they both immediately change directions and keep on moving at 1 foot/min. What is the expected time for all ants to fall off the string?  Solution:   When two ants collide head-on, both immediately change directions. What does it mean? When an ant A collides with another ant B, both switch direction. But if we exchange the ants' labels, it's like that the collision never happens. A continues to move to the right and B moves to the left. Since the labels are randomly assigned anyway, collisions make no difference to the result. So we can assume that the two ants meet, each just keeps on going in its original direction. What about the random direction that each ant chooses? Once the collision is removed, we can use symmetry to argue that it makes no difference which direction that an ant goes either. That means if an ant is put a the $x$th foot, the expected value for it to fall is just x min. If it goes in the other direction, simply set $x$ to $1-x$. So, the original problem just becomes what is the expected value of the maximum of 500 IID random variables with a Uniform Distribution between 0 and 1. Clearly the answer is $499/500$. So my question is: how do we know the answer is $499/500$? What is the theorem or formula to get this number?

What is the expected value of the maximum of 500 IID random variables   with uniform distribution between 0 and 1?   I'm not quite sure of the technique to go about solving something like this. Could anyone point me the right direction?  Thanks


I am trying to disable SSL2 on our IIS/SMTP server.  We are using a Windows Server 2008 R2 Enterprise (64bit).  We use the IIS6 Manager to manage the SMTP virtual servers.  I have attempted numerous methods but have been unsuccessful in all.  I have fully rebooted after every change too.   I am testing from another server with the following command, but still show as connected via SSL2:  $ openssl s_client -debug -connect servername:25 -ssl2  CONNECTED(00000003)  write to 0x600078840 [0x600181951] (45 bytes => 45 (0x2D))  0000 - 80 2b 01 00 02 00 12 00-00 00 10 03 00 80 01 00   .+..............  0010 - 80 07 00 c0 06 00 40 04-00 80 02 00 80 ba 66 21   ......@.......f!  0020 - fe 2d 4c 49 44 b9 23 e5-f9 10 a5 21 7f            .-LID.#....!.  read from 0x600078840 [0x600070790] (2 bytes => 2 (0x2))  0000 - 32 32                                             22  read from 0x600078840 [0x600070792] (12851 bytes => 123 (0x7B))  0000 - 30 20 6d 61 69 6c 2e 65-67 32 2e 66 69 65 6c 64   0 mail.ourdomain  0010 - 67 6c 61 73 73 2e 6e 65-74 20 4d 69 63 72 6f 73   name.net Micros  0020 - 6f 66 74 20 45 53 4d 54-50 20 4d 41 49 4c 20 53   oft ESMTP MAIL S  0030 - 65 72 76 69 63 65 2c 20-56 65 72 73 69 6f 6e 3a   ervice, Version:  0040 - 20 37 2e 35 2e 37 36 30-31 2e 31 37 35 31 34 20    7.5.7601.17514  0050 - 72 65 61 64 79 20 61 74-20 20 57 65 64 2c 20 38   ready at  Wed, 8  0060 - 20 4a 75 6c 20 32 30 31-35 20 31 34 3a 32 36 3a    Jul 2015 14:26:  0070 - 31 35 20 2b 30 30 30 30-20 0d 0a                  15 +0000 ..   I started with Microsoft’s recommendation:   Instead of PCT 1.0, I used SSL 2.0:  To disable the PCT 1.0 protocol so that IIS does not try to negotiate using the PCT 1.0 protocol, follow these steps:  Click Start, click Run, type regedt32 or type regedit, and then click OK. In Registry Editor, locate the following registry key: HKey_Local_Machine\System\CurrentControlSet\Control\SecurityProviders \SCHANNEL\Protocols\PCT 1.0\Server  On the Edit menu, click Add Value. In the Data Type list, click DWORD. In the Value Name box, type Enabled, and then click OK.   Note If this value is present, double-click the value to edit its current value. Type 00000000 in Binary Editor to set the value of the new key equal to "0". Click OK. Restart the computer.  I have also tried this method:   I even tried using IIS Crypto and still show as connecting via SSL2.

I have reviewed both related posts on this site:      The issue I am having is that I have implemented the registry change, rescanned my websites, and I am still being told that IIS 6 is allowing SSL 2.0 connections.  Here's the verbage from the scanning site:     Synopsis : The remote service encrypts traffic using a protocol with known weaknesses. Description : The remote service accepts connections encrypted using SSL 2.0, which reportedly suffers from several cryptographic flaws and has been deprecated for several years. An attacker may be able to exploit these issues to conduct man-in-the-middle attacks or decrypt communications between the affected service and clients.   QUESTIONS:   How do I test this myself so I can continue to troubleshoot the issue? Is there a tool out there that I can use to test? Would I need to disable other connection methods? [PCT 1.0 / TLS 1.0]   Thanks


I have a personal geodatabase with a polygon feature class with a one-to-many relationship to a table.   What I want to do is to export to a shapefile with all the infornation associated in every polygon.   I use ArcGis 10.2.1

I need to create duplicate features (in this case parcels), using a related table to populate ID fields.  In essence, I need to use a related table of parcel owners to create duplicate parcels, each with its own unique ID from the related owner table.  The related table already contains the many-to-one link to parcels, I just want to force a one-to-one relationship between the owners and parcels, by creating a duplicate parcel for each owner record.  I'm using ArcGIS Desktop 9.3.1.


Hi Ive just downloaded the magic launcher, but when I enter my username and password (entering email address) it says incorrect details. But when I log into my mojang account, its right. Any ideas?

We just got a new laptop (ASUS) though we did have a mac.  We are trying to log onto Mojang to download Minecraft and it keeps saying, "The username and password are not recognized."   We have done all the usual procedures; we have reset the password, we are using the email, not the username to sign in, and it looks like the minecraft login servers are working etc. etc.  We quit Minecraft on the old computer and shut off that computer thinking that was the issue.   Still, we can't get onto Mojang.  We are accessing mincraft through firefox and trying to download it to the new computer but we can't get into the account to do that!  What in the world could be the issue?


The title of the show is Magic Kaito 1412. It is based on a character from Detective Conan, Kaito Kid. In Detective Conan he is called Kaito Kid, Phantom Thief, but no 1412. If it is read in Japanese it would be Ichi Yon Ichi Ni (One Four One Two) or Sen Yon Hyaku Juu Ni (One Thousand Four Hundred Twelve). The real name of the first Kaito Kid is Kuroba Touichi. The current Kaito Kid is Kuroba Kaito, doesn't sounds like 1412 at all. So, what is this 1412 means?

I am currently watching . Should I watch the other  anime films?  What's the difference between this version and the 1412 version?  And another question, what's the meaning of 1412?


I've decided to uninstall Mac OS from my MacBook Pro.  How do I remove the OSX partition after installing it with rEFInd?

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I have a SQL Server table that has a datetime column. What I need to do with a SELECT statement is return (I think) a calculated column that takes the time from the datetime column and puts it together with the current date.  So in the table I may have...  [TargetPlot].[TargetDate] 2015-12-09 10:15:00 2015-12-09 10:30:00 2015-12-09 10:45:00 2015-12-09 11:00:00 2015-12-09 11:15:00   But what I need the SELECT statement to return is (assuming the current date is December 11th)...  [SomeCalculatedField] 2015-12-11 10:15:00 2015-12-11 10:30:00 2015-12-11 10:45:00 2015-12-11 11:00:00 2015-12-11 11:15:00   Thanks for any advice.  Andy

In an extract I am dealing with, I have 2 datetime columns. One column stores the dates and another the times as shown.  How can I query the table to combine these two fields into 1 column of type datetime?  Dates  2009-03-12 00:00:00.000 2009-03-26 00:00:00.000 2009-03-26 00:00:00.000   Times  1899-12-30 12:30:00.000 1899-12-30 10:00:00.000 1899-12-30 10:00:00.000


My function getUser() does a databse select of user info. In this function, I call a another function called calcPercentage() which takes the received values from the database stored in $result, then removes some values(indexes) and do a calculation. Once complete, the second function returns a value to the first function.  My issue is that the values removed in calcPercentage(), the second function, are effecting the original values received from the database.  See code  function getUser() {   $result = DB::select(); // say $result = name, surname, email, telephone    $percentage = $this->calcPercentage($result);  var_dump($result) // now $result = name, surname }  function calcPercentage($data) {  $u_data = $data;  unset($u_data->email);  unset($u_data->telephone);  // the above values are not needed for the calculations,  // thus they are being removed.   ... do calculation  return $percentage  //$percentage would be = 100 || >100; }    I would like to remove the values from the object with out affecting the original variable in function getUser(); Expected outcome.  function getUser() {   $result = DB::select(); // say $result = name, surname, email, telephone    $percentage = $this->calcPercentage($result);  var_dump($result) // now $result = name, surname, email, telephone }    Should I rather do a another query here to the database?

It appears that in PHP objects are passed by reference. Even assignment operators do not appear to be creating a copy of the Object.  Here's a simple, contrived proof:  <?php  class A {     public $b; }   function set_b($obj) { $obj->b = "after"; }  $a = new A(); $a->b = "before"; $c = $a; //i would especially expect this to create a copy.  set_b($a);  print $a->b; //i would expect this to show 'before' print $c->b; //i would ESPECIALLY expect this to show 'before'  ?>   In both print cases I am getting 'after'  So, how do I pass $a to set_b() by value, not by reference?


Inside my file I need to swap places of all instances of :  grep 'search string'   and   sed '/string of text/,/string of text/{//!d}'   In VI I have tried a regex with no luck - it says something about trailing characters.   :%s/grep 'search string'/sed '/string of text/,/string of text/{//!d}'/g   I have also tried with sed outside the file: which says event not found  sed -i 's/grep 'search string'/sed '/search string/,/search string/{//!d}'/g' filename.    What am I doing wrong and how can I get this to work? I have too many instances I need to change and doing it manually is not an option.   I want to change this line of code:  succ_1st=`grep 'resulted in successful answer' $path_tmp/named.stats.tmp | sed '/localhost.localdomain/,/testdns.net/{//!d}' | awk '{ print $1 }' | grep -m1 ''`   to this:  succ_1st=`sed '/localhost.localdomain/,/testdns.net/{//!d}' $path_tmp/named.stats.tmp | grep 'resulted in successful answer' | awk '{ print $1 }' | grep -m1 ''`   THese are lines of code from a script BTW

Suppose I have a file that contains multiple occurrences of both StringA and StringB. I want to replace all occurrences of StringA with StringB, and (simultaneously) all occurrences of StringB with StringA.  Right now, I'm doing something like  cat file.txt | sed 's/StringB/StringC/g' | sed 's/StringA/StringB/g' | sed 's/StringC/StringA/g'   The problem with this approach is that it assumes StringC doesn't occur in the file. While this isn't an issue in practice, this solution still feels dirty -- that is, it feels like an opportunity to learn more unix magic. :)


Say a question has 8 answers to it, with 3 deleted.  On the main page users with over 10,000 rep see the question labeled with 5 answers, however when they enter the question, it is labeled with 8 answers.  Is this a bug?  Shouldn't this be consistent?

I occasionally notice that a posts answer count is different on /questions as it is inside the actual post, and until now I just ignored it assuming that it was either something in cache, a deleted/ added post since I last looked, etc.  But I finally found an example of one that I believe the count to truly be wrong on:    Here's a screenshot of /questions   And here's on from inside the post. Mind you depending on your rep, you may only see that there are 2 answers inside the post because 2 others were deleted by owner.     Anyway, on to my proof! I first noticed this post when it contained four answers and none of them had been deleted. As it seemed that the current answers solved the problem I exited the post, only to see /questions refresh and show that the post now contained 3 answers.  Intrigued I reentered the post curious to see who deleted their post, and found as expected that the answer count was still 4. Left the post again and the same thing happened!  I'm not arguing that the posts internal answer count shouldn't reflect deleted posts because I like the feature. But, is there a reason that a posts answer count in /questions doesn't reflect deleted posts as well?