I need to pass parameters from a Drupal page to a PHP script. There's no way to pass that directly and I need to use SESSIONS. I've searched around and added this at the top of the script:  define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);   With that I can use Drupal's session but I'm getting this error:  Warning: session_start(): Cannot send session cache limiter - headers already sent   It's not so bad since it's just a warning and I can use CSS to make it not visible to the user. But I was wondering if there is a cleaner way to do so.

This is what I have right now:  <?php     define('DRUPAL_ROOT', '/var/www/clients/client1/web15/web');     include_once(DRUPAL_ROOT . '/includes/bootstrap.inc');     drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); //  drupal_flush_all_caches();        $users = views_get_view_result('userlist', 'uid_list');     $i = 0;     foreach ($users as $user) {         $filename = 'sites/default/files/generated_pdfs/individual_pdf_report_' . $user->uid . '.pdf';         generate_employee_pdf($user->uid, $filename);         error_log('Generated ' . $filepath);         $i++;     }     // create object     $zip = new ZipArchive();     // open archive     if ($zip->open("sites/default/files/generated_zips/individual-reports.zip", ZIPARCHIVE::CREATE) !== TRUE) {         die ("Could not open archive");     }     // initialize an iterator     // pass it the directory to be processed     $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator("sites/default/files/generated_pdfs/"));     // iterate over the directory     // add each file found to the archive     foreach ($iterator as $key=>$value) {         $zip->addFile(realpath($key), $value->getFilename()) or die ("ERROR: Could not add file: $key");     }     // close and save archive     $zip->close(); ?>   I'm getting a bunch of errors from the above when run standalone. Works fine in my module. Some of the errors are:  Warning: Invalid argument supplied for foreach() in drupal_depth_first_search() (line 56 of /var/www/clients/client1/web15/web/includes/graph.inc). Warning: Invalid argument supplied for foreach() in _module_build_dependencies() (line 229 of /var/www/clients/client1/web15/web/includes/module.inc). Warning: include_once(sites/all/modules/views_bulk_operations/actions/archive.action.inc): failed to open stream: No such file or directory in views_bulk_operations_load_action_includes() (line 56 of /var/www/clients/client1/web15/web/sites/all/modules/views_bulk_operations/views_bulk_operations.module).


I have a computer with ubuntu 12.04 installed. Unfortunately, when I run a memory taking program, it fills the RAM and uses the SWAP space. Then after the program terminates, the memory is completely released, but a considerable portion of the swap is occupied and I have to restart my computer to release that part.   The program does not have memory leak. Is there any way to clean that swap? Why such thing happens? (I regularly install the updates)

When I open a RAM-intensive app (VirtualBox set at 2GB of RAM), some swap space is generally used, depending on what else I have open at the time.  However, when I quit that last application, the 2GB of RAM is freed up, but the same swap space use remains.  For example, right now, about two hours after having closed VirtualBox, I have 1.6GB free RAM and still 770MB in swap.  How can I tell Ubuntu to stop using that swap and to revert to using the RAM?


App Version: 1.0.85 Device Manufacturer: Huawei Device Model: Nexus 6P   OS Version: 7.0 (3051502)

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


''According to a Gnostic legend, a war broke out in heaven among the angels, in which Michael’s legions defeated those of the Dragon. The nonpartisan angels who had been content to look on were consigned to earth, in order to make there a choice they had not been able to determine on high, one all the more arduous in that they brought with them no memory of the combat or, indeed, of their equivocal attitude.''  E. M. Cioran, Drawn and Quartered   I've got this text from above, and, given the fact that, obviously, I'm not a native, I have quite a hard time comprehending it. I don't understand, precisely, the words in bold, I mean, individually I do understand them all, but in this context I just can't come up with a correlation between them. Could someone explain it to me?

Here is a sample context:     As you might expect, the framework also provides some convenience   classes to make the task of writing custom validators all the more agreeable.   (Emphasis added.)


Mac OS' X11.app uses certain key bindings that I'd rather send to the underlying X app in use. Specifically I'd like to pass Command+W and Command-1 (and -2, etc) to the X app in question.  Is there any way to disable keybindings in an app? I'm aware of the system dialog that allows adding additional keybindings, but that doesn't seem to allow removing them.  Or maybe there's a way that's specific to X11.app?

Is there any way to disable Command+W in the terminal?   On several occasions I have accidentally closed a terminal window containing important information when I meant to close a Safari tab and did not realize that the terminal was the active window.


I received a notification for a comment-reply addressed to me, but when I followed the , the post had been deleted.  At this point I figured I just had a stale view of the page, so I refreshed the page.  The comment notification was still in my inbox, and the link to the deleted post was still there.      If memory serves, refreshing the page would remove comment notifications for deleted posts.  If it's relevant, I first viewed the notification when my ios app alerted me of the comment.  Opening the notification lead to a page that said the question was deleted.  And opening the page in my browser mentions that it "was removed from Meta Stack Overflow for reasons of moderation."    This notification is also sticking around in my SE network inbox.  It stuck around even after syncing my oldest profile.      Is this the intended behavior of notifications?  Or am I just misremembering?

Lets start with a life-like scenario.  User A receives an offensive comment in his inbox from the OP of a question. A then clicks on the notification in order to flag the offending comment. A mod sees the flag and deletes the comment. Shortly after, the question is also deleted. Because A clicked on the notification in the inbox, that notification is still in A's inbox, with the offensive part of the comment still visible. Edit: The flag was marked helpful because the post was deleted, not because the comment was deleted by a mod.  Please note that although the behaviour of the notifications is as it is supposed to be, this does not fix the possible problem of such notifications "hanging around". User A can't get rid of that comment in any way, and it may be a long time before it is flushed out by new messages. This issue is mentioned in  but it is supposed to be that comments on a post that you own can hang around, not on someone else's post.  is speaking about comments which have not been read and this . To me this seem like an important issue. To have to see an offensive message every time you open your inbox is not a good thing. I can think of two ways in which this problem can be avoided:  Make sure notifications for deleted comments don't hang around (this I'm sure is the easier option) Allow users to delete unwanted notifications (this could be useful, as this would also allow users to remove notifications that they are not interested in, or even just to keep their inbox uncluttered. It would most likely be hard to implement, though.)  What are your thoughts on this?


I am going to move a directory and a file  to /dev/null.   What will happen if i move a file to /dev/null and what will happen if i move a directory to /dev/null?

When trying to move a test_dir directory to /dev/null, I get the message  mv: cannot overwrite non-directory ‘/dev/null’ with directory ‘test_dir/’   Then why do people say "Don't run the command sudo mv ~ /dev/null, it will move your home directory to a hole?"    But /home is also a directory.


Usually I have this picture (as on my  now). 4 last events and "view more".        But now in  there on Meta only 3 last events and no "view more".        Could anyone explain me why?

I noticed today that the reputation summary on  is displaying only one line:      Normally, it should display four lines, such as in my Stack Overflow profile:      The bug is reproducible in other profiles of users that also participated in the . Here is a screen shot for one of those participants:      I do have a lead on the cause, but I don't have it pinpointed. It seems to be happening to those users who have hit the rep cap (200 points), and also have other activity that, because of the cap, does not count.  For example, I have 5 events under "yesterday" that do not have any associated points:


New to Python and am having a problem with getting items into individual elements of a list.  I am walking through a subdirectory list and want to write each subdirectory to a separate dimension on a list. So my output would be:  [['roll_274_oe_2014-09-26', ['roll_275_oe_2014-10-03'], ['roll_276_oe_2014-10-10'], ['roll_277_oe_2014-10-17']]   but instead it looks like I'm iterating through the directory tree the number of times I have the output:  [['roll_274_oe_2014-09-26', 'roll_275_oe_2014-10-03', 'roll_276_oe_2014-10-10', 'roll_277_oe_2014-10-17'], [], [], [], []]   my code to do this is at present:  d = 'C:/winPython/WinPython-64bit-3.3.5.5/scripts/portofolio/'       s1 = []  for path, subdirs, files in os.walk(d):      s1.append(subdirs)       print(s1)    I hope someone can give me a hand.  Many thanks

What's the difference between the list methods append() and extend()?


I'm considering using a Solar (INT 25, WIS 25) as a semi-benevolent (but also kind of annoying) come-and-go guide of sorts to 3 high-level PC's in an upcoming campaign. While I would like to imagine that I can match this angelic being wit for wit, I don't think I could.  It's a tough pill to swallow, but I'm probably lucky to fall around 15 INT.    What are some ways in which this puny human GM can convincingly establish a super-intelligent Solar?  My main concern is that the Solar is smarter than me.  How can I hope to play a creature that far exceeds me in this ability which affects it's way of speaking, it's sharpness of mind and other aspects of character that are difficult to emulate?  What kind of prep will I need to do so I can fluidly present this NPC to the PC's?  From your experience, what works when role-playing a Solar NPC as a GM?

What are some strategies and techniques for role playing a character that is more intelligent than you actually are? It's pretty easy to pretend to be someone who is less intelligent, but the reverse seems very difficult.


I'm currently making a text-based strategy game with python, but I've come across a problem, I want to make the user receive 1 gold and lose 5 food every 10 seconds, so I made a loop:  import time  gold = 0 food = 100 while True:     time.sleep(10)     gold += 1     food -= 5   But I can't run the main loop now because the program is stuck running the first one:  while True:     what_to_do = input("What do you want to do?\n")     if what_to_do == 'wood':         wood()     ...   I there any way I can constantly add gold and lose food at the same time as being able to play the game? Such as being able to run a loop in the background while the main loop runs, or am I just being stupid?

I want to repeatedly execute a function in Python every 60 seconds forever (just like an  in Objective C). This code will run as a daemon and is effectively like calling the python script every minute using a cron, but without requiring that to be set up by the user.  In , the solution appears to effectively just  for x seconds. I don't need such advanced functionality so perhaps something like this would work  while True:     # Code executed here     time.sleep(60)   Are there any foreseeable problems with this code?


I had 16.04LTS version installed on by laptop along side the windows 10. I upgraded to 17.04 version but it did not install properly and now I cannot open Ubuntu on the computer but can access windows...  How can I revert back to previous version that is 16.04 LTS version

I've upgraded my LTS version of Ubuntu to Ubuntu 17.04 and from the day I've upgraded I've been struggling to get this thing stable. Sometimes my Wifi adapter doesn't work properly and sometimes I can't even copy things properly.  So I want to revert back to Ubuntu 16.04 LTS.  Is there any way to get this done?


Ever since I can remember, I've used 'to me' and 'for me' interchangeably.  Examples:      To me, writing about the future is too troublesome.     Writing about the future is too troublesome for me.   Note: 'for me' sounds better when put at the end of the sentence. Re-arranging the phrase like that does not alter its meaning and purpose.   Now, does this make a difference? I'd once read somewhere that 'to me' is "right" and it's wrong the other way. I've seen many writers use 'for me', myself included.   Is it...   a myth like many well-known grammatical rules are   or    a fact which many people are not aware of?

I would like someone to explain me how the sense of a sentence changes with using "for me" or "to me":  Some examples:     1a.  She is a good friend to me.   1b.  She is a good friend for me.        2a.  How special you are to me.   2b.  How special you are for me.        3a.  It's an interesting topic to me.   3b.  It's an interesting topic for me.


While modeling an Audi R8 I have the following problem. The thing I want to create is seen in this image:    I want to create a sharp crease (outlined in red) which starts around the first exhaust and then goes to the second.  Is there an efficient way to do this (I also use the Subdivision Surface Modifier for this model).

I frequently come to the problem of having a mesh with parts I would like to render smooth and "hard" edges connecting them.   How can I set the mesh to show the sharp edges but render everything else smooth?  In the example I would like the sides of the individual cylinders render smooth but the intersection between bottom and top to be sharp/flat


So I have a potential sugar daddy and he is asking me for my bank account number and routing number so he can deposit money into my account every week is that safe or is this a scam. Emergency pls answer quickly and real answers only

Someone is offering to pay me in a sort of sugar daddy/sugar baby arrangement. They want to make online deposits to me, and they're asking me for my online banking username and password. Is that information alone enough for them to be able to take my money out of my account, or am I safe?


I did not find the TryParse method for the Guid.  I’m wondering how others handle converting a guid in string format into a guid type.  Guid Id; try {     Id = new Guid(Request.QueryString["id"]); } catch {     Id = Guid.Empty; }

I want to try to convert a string to a Guid, but I don't want to rely on catching exceptions (   for performance reasons - exceptions are expensive for usability reasons - the debugger pops up  for design reasons - the expected is not exceptional   In other words the code:  public static Boolean TryStrToGuid(String s, out Guid value) {     try     {         value = new Guid(s);         return true;     }     catch (FormatException)     {         value = Guid.Empty;         return false;     } }   is not suitable.  I would try using RegEx, but since the guid can be parenthesis wrapped, brace wrapped, none wrapped, makes it hard.   Additionally, I thought certain Guid values are invalid(?)    Update 1   had a good idea to catch only FormatException, rather than all. Changed the question's code sample to include suggestion.    Update 2  Why worry about thrown exceptions? Am I really expecting invalid GUIDs all that often?   The answer is yes. That is why I am using TryStrToGuid - I am expecting bad data.  Example 1 . I might be parsing folder names, checking to see if the text after the final . is a GUID.  c:\Program Files c:\Program Files.old c:\Users c:\Users.old c:\UserManager.{CE7F5AA5-6832-43FE-BAE1-80D14CD8F666} c:\Windows c:\Windows.old   Example 2 I might be running a heavily used web-server wants to check the validity of some posted back data. I don't want invalid data tying up resources 2-3 orders of magnitude higher than it needs to be.  Example 3 I might be parsing a search expression entered by a user.     If they enter GUID's I want to process them specially (such as specifically searching for that object, or highlight and format that specific search term in the response text.)    Update 3 - Performance benchmarks  Test converting 10,000 good Guids, and 10,000 bad Guids.  Catch FormatException:    10,000 good:     63,668 ticks    10,000 bad:   6,435,609 ticks  Regex Pre-Screen with try-catch:    10,000 good:    637,633 ticks    10,000 bad:     717,894 ticks  COM Interop CLSIDFromString    10,000 good:    126,120 ticks    10,000 bad:      23,134 ticks   p.s. I shouldn't have to justify a question.


I am working on creating a material, and have come to a small problem. At some point in my shader I achive this result:    This is basically binary information, either black or white. For my case I am now trying to blur the transition between the black and white areas to achive a softer looking effect in the final result's displacement map. I want to be able to control how large the blur is (thinking of it as the thickness of an outline around the white spots).  I have already researched a fair bit on my own the past few days, but none of the examples I found seemed to apply to my case.

For a Cycles material I need to blur a texture. If the texture where a Texture Image node, I can blur the image before adding it but in my case I need to blur a Voronoi Texture and so I can't do it.  I have searched but I didn't find a blur node. Can this be achieved?


I want to produce big parenthesis like this:  How do I do this with align instead of array? I do not want to use eqnarray though. Thanks.

Consider the following MWE.  \documentclass[preview,border=12pt,varwidth]{standalone} \usepackage{amsmath}  \begin{document} \abovedisplayskip=0pt\relax \begin{equation} \begin{cases} ax + by =c \\ px + qy = r \end{cases} \end{equation} \end{document}   produces an output as follows.    What I want to achieve is as follows.    Is there any idea?  My attempt is as follows, but it does not compile.  \documentclass[preview,border=12pt,varwidth]{standalone} \usepackage{amsmath}  \begin{document} \abovedisplayskip=0pt\relax \begin{equation} \begin{cases} ax + by =c \tag{OK}\\ px + qy = r \tag{Yes} \end{cases} \end{equation} \end{document}


We've just installed an Ubuntu 17.10 server, and during the installation, it was assigned the IP address 192.168.50.84.  We've now reserved the IP address 192.168.50.107 on the DHCP server.  The netplan configuration was a surprise and, in my opinion, /etc/network/interfaces made a lot more sense to do.  Every time the server reboots, it sets the IP address to 192.168.50.84, and it doesn't seem to ask the DHCP for an IP address.  If we execute:     sudo dhclient -r; sudo dhclient   The server gets the intended IP address (192.168.50.107) from the DHCP.  So, what is wrong with netplan? Why doesn't it ask for the IP address on boot or a network restart? On every boot we get this line in the logs: Mar  6 18:48:08 blues-web-proxy systemd-networkd[723]: eth0: DHCPv4 address 192.168.50.84/24 via 192.168.50.140  Thanks for the replies.  We didn't do any configuration, the installation process only asked if it needed to use a proxy server or not - replied no.  /etc/netplan/01-netcfg.yaml  # This file describes the network interfaces available on your system # For more information, see netplan(5). network:   version: 2   renderer: networkd   ethernets:     eth0:       dhcp4: yes   /etc/network/interfaces  # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) # Generated by debian-installer.   # The loopback interface auto lo iface lo inet loopback   /etc/hosts  127.0.0.1       localhost 127.0.1.1       blues-web-proxy.bluescreen.local        blues-web-proxy  # The following lines are desirable for IPv6 capable hosts ::1     localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters

To do this on recent Fedora and Arch, it is necessary to set dhcp-client-identifier = hardware to get DHCP to work. I suspect the same is true on 17.10. However, Artful uses netplan and systemd-networkd.  For the latter I can set  [DHCP] ClientIdentifier=mac  In /etc/systemd/network/(interface name).network, which overrides /run/systemd/network/10-netplan-(ifname).network.  I'd prefer to set this in the file /etc/netplan/01-netcfg.yaml, or something in /etc/netplan/.  These are specifics of how the above might be solved, though. The overall question is how to use the MS Windows Server 2012 DHCP server with MAC reservations with Ubuntu 17.10 server using netplan. I may be able to request reconfiguration of the DHCP server if it won't have a significant effect on other clients, or can be done per-reservation somehow.  (I'd have used the tag windows-server, but it doesn't exist for some reason)


Please help, I'm stuck in this problem:     Find the values of $a$ and $b$:   $$\frac{a(26.273)^b}{a(27.165)^b}=1.0065809$$


How can I permanently erase data on Internal HDD?  I have a laptop which I use Ubuntu as my primary OS. However I am trying to sell it to help towards a new PC. I want to COMPLETELY erase data on the Internal HDD (Such as passwords, banking info, etc...) and use my Windows 10 USB Installer to put a new Windows setup for whoever it gets passed on to. I do have another PC which I can use to help with this process, if needed.   PS: This is only for an INTERNAL hard drive, not a USB or external hdd.

I'm planning on selling a USB external hard drive that currently contains an old Ubuntu installation with stored passwords and banking information.  How can I securely erase the drive before selling it?


I am learning computability theory. I am just interested to know some famous problems (Formally languages) whose decidability is in question.

I am preparing for a talk aimed at undergraduate math majors, and as part of it, I am considering discussing the concept of decidability.  I want to give an example of a problem that we do not currently know to be decidable or undecidable.  There are many such problems, but none seem to stand out as nice examples so far.  What is a simple-to-describe  whose decidability is open?


I know that  manages devices in /dev and I expected to find information about available network cards (hardware) or at least network interfaces (software) there.  ifconfig output shows me eth0 and lo, but /dev/net is empty. Well, almost empty:  $ ls -la /dev/net total 0 drwxr-xr-x  2 root root      60 Dec 13 09:37 . drwxr-xr-x 15 root root    4300 Dec 15 12:12 .. crw-rw-rw-  1 root root 10, 200 Dec 13 09:38 tun   Why there is no info about network interfaces in udev? I'd really like to avoid executing ifconfig in my server process.  It is irrelevant to the question, but I expected to find ids ("lo", "eth0") and IP addresses there.

I'm mostly curious, but why aren't network interfaces in /dev? Are there any other kinds of devices that aren't represented as a node under /dev?


I'm trying to make a simple line connecting the same node. I'm using a simple qtree package. Here is what I have so far. \Tree [.\textit{sign}  [.\textit{syn-sign} \textit{phrase} ] [.\textit{lex-sign}  [.\textit{word} ] [.\textit{lexeme} ]]]  New question for alignment:  Here's the code: \begin{forest} qtree edges [\textit{sign},name=sign [\textit{syn-sign}  [\textit{phrase} ] [\textit{word}, name=word,]]    [\textit{lex-sign}, name=lex-sign  [, no edge ] [\textit{lexeme} ]]]    \draw (lex-sign.south) -- (word.north);  \end{forest}

The qtree package seems to facilitate the drawing of simple trees only. Is there a way to incorporate:   Multiple roots & Nodes with multiple parents   in a tree in LaTeX?


I have been waiting for 16.04.1.  On 22/07/16, I received the email from Adam Conrad, informing that the upgrade was now available.  I opened Software Updater, but it only offered me an upgrade to 15.10.  Why is this?  Garry  The upgrade was offered to me late on Friday 29/07/16 (Australian EST).  Thanks for the comments...

So, today is July 21st and . gives me an option to download 16.04.1 LTS. However, attempting to upgrade gets me this message -  $ sudo do-release-upgrade Checking for a new Ubuntu release No new release found   What is wrong? Does it matter that I am running apt-get update behind apt-cacher-ng?  Note: Commenting out the files in apt.conf.d that used apt-cacher-ng did not make a difference.  Edit: Explanation for possible duplicates:  deals with upgrade from 12.04LTS to 14.04LTS. My question is specific to 14.04 LTS to 16.04.1 LTS upgrade. Old answers, while good for archival purposes are less relevant in a fast changing package like ubuntu. Moreover none of the answers answer what is wrong. The link  pointed out is mentioned in one of the comments. This Q & A is more helpful for people upgrading today than the work around mentioned in "".


I really hope you can answer this simply request.   Nowadays is pretty common to have a new Ultrabook, laptop or notebook for general purposes. A very important feature is to have a healthy battery. We all know that Lithium-batts do a terrific job and are more resistant than ever, but after many years of experience, I've learnt that having a software like "Eco charge, Battery care, Smart charge...etc " is vital feature for long lasting battery good health. Major brands take care of this BUT HP, believe or not. I've just received a new Ultrabook Spectra x360 with windows 8.1, and so far I cannot find any special battery function for this request, even worst nobody can answer in their forum either; I really can't understand this flaw in HP. So, I'd like to know is there any reliable battery software or a way to acccess the battery controller, that can allow me to keep the battery charge to 80% while connected.  I've seen several utilities that keep info about battery and how to optimize but none with the simple function that I need.  Any help will be highly appreciated.

I work on a HP laptop plugged in most of the time, and after a few months the battery went off-duty.  Of course, I could remove the battery each time the laptop is plugged and replace it each time I must move to where no sockets are around. But I think that:   It would be really BORING! The computer would not avail itself of the useful backup power supply a battery can provide in case of black out.   It should simply switch off the battery charging when a safe power level is reached (i.e. 95%) and start recharging it, not every five minutes, but only under a certain safe threshold (i.e. 40% - 50%).  In its energy-saving profiles, Windows 7 only allows for setting up screen brightness, screen fadeout, screen deactivation and the suspension, not managing any charging issue.  Is there a way to accomplish this?


I'm a total rookey in linux, so please I have a question, after reading a tutorial I learned how to install .deb archives using the terminal,so installed Play On Linux, then I tried to install wine:i386 using "sudo apt-get wine:i386" but the terminal didn't donwload the package, instead tells me to use the command sudo apt-get -f install, I want to know what means that -f.  A complete thanks for the person that can answer this

I have seen it before. I am just wondering what exactly does it do?


I knew this question may be not interesting , But I want to use string function in another function. Here is my code:  example.java:  public native String sendMessage(String jid, String message); . . . ImageButton1.setOnClickListener( new OnClickListener() {     @Override     public void onClick(View v) {          final String m_Text = EditText1.getText().toString();          if (m_Text.length() > 0){             notifyMessage (m_Text);                                         String uid = new String ();             uid = sendMessage(final_jid , m_Text);                                         alertDialog.dismiss();         }     } });   example.cpp:  JNIEXPORT jstring JNICALL Java_org_qtproject_example_myapplication_MiniXmppService_sendMessage(         JNIEnv *env, jobject obj, jstring jid, jstring message) { std::string sjid; jstrToStdStr(env, jid, sjid);  if (g_bot) {     CMessageSession *session = g_bot->getOutgoingSessionForJid(sjid);      if (session)     {         std::string smessage;         jstrToStdStr(env, message, smessage);         g_bot->m_mutexClient.lock();         jstring res = env->NewStringUTF(session->session->send(smessage).c_str());         g_bot->m_mutexClient.unlock();         return res;     } }  return env->NewStringUTF("uid-*-*"); }   And I got an error: non-static method sendMessage(String,String) cannot be referenced from a static context  How to fix it?

The very common beginner mistake is when you try to use a class property "statically" without making an instance of that class. It leaves you with the mentioned error message:     You can either make the non static method static or make an instance of that class to use its properties.   Why? I am not asking for solutions. I would be grateful to know what is the reason behind it. The very core reason!  private java.util.List<String> someMethod(){     /* Some Code */     return someList;             }  public static void main(String[] strArgs){                // The following statement causes the error. You know why..     java.util.List<String> someList = someMethod();          }


This would be a person making an edit to that's person's own prior answer that makes a significant improvement. Say it's an algorithm improvement that reduces time complexity (such as from O(log(n)) to O(1)), but that the answer was already accepted and/or upvoted.  I'm thinking that for significant improvement, for the benefit of others reading the asnwer, the improvement should be inserted at the front of the answer, noting the change and using a separator to retain the original answer after the inserted improvement.    I'm updating this question with a specific example, an answer about a Visual Studio 2015 change to std::list::sort. The improvement in this case was a switch from directly accessing nodes (std::list::splice does this), to using iterators. Rather than replace the prior answer, the updated answer has the improved version at the start of the answer, with the prior answer at the end. I left the prior answer there because of comments. However, the prior answer could be considered obsolete, and I'm wondering if I should just remove it, and leave a brief description of the prior answer so that the comments would still make sense.

I was thinking about this issue from time to time but I didn't know whether it really exists or just an speculation on my side until today when I woke up [!], I saw  downvoted (in the meantime I'll leave that answer unedited for the sake of discussion; note that this is just a sample. I'm not asking "how to deal with this specific answer." The question is completely general as it's nearly impossible to keep track of all of your answers to see whether they require updating or not). While the downvoter didn't explain a thing, I suspect the reason is that the answer is no longer applicable (It's one of the new features in iPhone OS 3.0). As we go to celebrate a long sequence of birthdays for Stack Overflow (hopefully!), we're going to see lots of answers become obsolete. How we're going to deal with this issue?


Some (all?) SE sites have a Twitter account.  A selection of questions are tweeted there. Here's an example:    What decides which questions are tweeted?  Is it automatic (done by a bot), or do mods do it manually?  Either way, what are the criteria?   View count? Highly voted question or answer? Evaluation by mods? Unanswered/needs attention? -Other factors?   Are these criteria the same for all SE sites' Twitter, or does it differ?

I heard that there was a twitter bot which automatically posted questions and asked for answers for specific questions on every site. How do they work? Is there an algorithm for doing this or is it purely random? I know that it doesn't tweet closed questions, but that's it.


GR and Newton give almost exactly the same result for the orbits of planets and the acceleration of falling bodies. Is it an incredible coincidence, or does GR have some tiny term (e.g., ict) that accounts for the difference? Is it possible to make GR collapse to Newton's law by ignoring that tiny term?

The Newtonian description of gravity can be formulated in terms of a potential function $\phi$ whose partial derivatives give the acceleration:  $$\frac{d^2\vec{x}}{dt^2}=\vec{g}=-\vec{\nabla}\phi(x)=\left(\frac{\partial\phi}{\partial x}\hat{x}+\frac{\partial\phi}{\partial y}\hat{y}+\frac{\partial\phi}{\partial z}\hat{z}\right)$$  However, in general relativity, we describe gravity by means of the metric. This description is radically different from the Newtonian one, and I don't see how we can recover the latter from the former. Could someone explain how we can obtain the Newtonian potential from general relativity, starting from the metric $g_{\mu\nu}$?


Prove that, for any $a, b, c \in \mathbb{N}$, $\bigl\lfloor \frac{a}{bc} \bigr\rfloor = \Bigl\lfloor \frac{\bigl\lfloor \frac{a}{b} \bigr\rfloor}{c} \Bigr\rfloor$.  I have no idea how to prove this. Can you help me, please? Thanks!

Problem: For positive integers $n,j,k$, prove that the following holds:     $$\left\lfloor\frac 1j\left\lfloor\frac nk\right\rfloor\right\rfloor=\left\lfloor\frac n{jk}\right\rfloor$$     I simply need hints to start on this problem. I have verified that it's indeed true by checking a few examples and I can't seem to find a counter-example, so I'm almost sure that the problem is indeed correct.  However, I can't seem to think of a proper (and rigorous) proof of this. Can someone please help me by giving me a few hints?  I want to prove it myself, so I'd appreciate if people don't directly post the proof themselves. Also, please keep your hints as subtle as possible (there's no fun in proving something if the hint gives out most of the answer) :D


Is is posible to change default decorder of ffmpeg? If I use  ffmpeg -i pipe_video.fifo -i pipe_audio.fifo -c:v copy -f flv file.flv   ffmpeg automatically changes aac(native) into (mp3)libmp3lame (!!!!). I just wanna copy the stream automatically. No more. input pipe_audio.fifo is adts (libfaac)

How to synchronize libfdk_aac and libx264 streams?  ffmpeg -i pipe_libfdk_aac.fifo -i pipe_libx264.fifo -c copy -f flv flv_stream_pipe_or_rtmp.output   I'm always receiving the same asych in all cases: saving file on file system, rtmp-using or raw pipe out. Is it possible to syncronize them?   ffmpeg version N-66924-gaba61b2 Copyright (c) 2000-2014 the FFmpeg developers built on Jan 15 2015 12:50:29 with gcc 4.6 (GCC) 20120106 (prerelease) configuration: --arch=arm --cpu=cortex-a8 --target-os=linux --enable-runtime-cpudetect --prefix=/data/data/info.guardianproject.ffmpeg/app_opt --enable-pic --disable-shared --enable-static --cross-prefix=/home/qwerty/work/android-ndk-r10b86/android-ndk-r10b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi- --sysroot=/home/qwerty/work/android-ndk-r10b86/android-ndk-r10b/platforms/android-3/arch-arm --extra-cflags='-I/home/qwerty/x264 -I/home/qwerty/ffmpeg_build/mp3/build/include -I/home/qwerty/faac/output/include -I/home/qwerty/ffmpeg_sources/fdk-aac/build/include -I/usr/local/include/ -mfloat-abi=softfp -mfpu=neon' --extra-ldflags='-L/home/qwerty/x264 -L/home/qwerty/ffmpeg_build/mp3/build/lib -L/home/qwerty/ffmpeg_sources/fdk-aac/build/lib -L/home/qwerty/faac/output/lib -L/usr/local/lib/ -lrtmp -lpolarssl' --enable-version3 --enable-gpl --enable-nonfree --disable-doc --enable-yasm --enable-decoders --enable-encoders --enable-muxers --enable-demuxers --enable-parsers --enable-protocols --enable-filters --enable-avresample --enable-librtmp --enable-libfaac --enable-libfdk_aac --enable-libmp3lame --disable-indevs --enable-indev=lavfi --disable-outdevs --enable-hwaccels --enable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network --enable-libx264 --enable-zlib --enable-muxer=md5 libavutil      54. 10.100 / 54. 10.100 libavcodec     56.  8.100 / 56.  8.100 libavformat    56.  9.100 / 56.  9.100 libavdevice    56.  1.100 / 56.  1.100 libavfilter     5.  1.106 /  5.  1.106 libavresample   2.  1.  0 /  2.  1.  0 libswscale      3.  1.101 /  3.  1.101 libswresample   1.  1.100 /  1.  1.100 libpostproc    53.  3.100 / 53.  3.100


Lets call the app I need to close A. The problem I have is that A starts an other application, lets call it B.  So if I close A, B is still running.  The reason why I need to also close B is because if I restart A after I closed it, it does not work properly, because a B app is already running because a previous A started it.  I only know the path to the A application.  Sysinternals Procmon can see that they have this starter-started relationship, but how can I?    I'm writing my closer app in Delphi, but I'm open to any alternative solutions.  Thanks.

I'm currently passing the pid on the command line to the child, but is there a way to do this in the Win32 API?  Alternatively, can someone alleviate my fear that the pid I'm passing might belong to another process after some time if the parent has died?


.    I can make CV in LaTeX using the moderncv package. I also saw the . But I don't see yet above type of CV writing in LaTeX. Is there any package on this?

I am looking for a CV template to reproduce (more or less) the following style:


I have a git repository which has several commits into different sub-directories and I want to cut the repository in two in the following way:  /   sub1/   sub2/   sub3/   ->  /   sub1/   The individual subs have evolved to a point where sub1 should be an independent repository. Also there isn't a single commit that touches more than one sub.  So, I'd like to somehow extract a new repository that only takes commits made into sub1 while leaving all other stuff out. But I want to keep the history (but not have the commits related to sub2 nor sub3).  Note: I vaguely remember there to be some command to do this, but I never used it myself and don't remember what it was called, so I cannot search for it.

I have a  repository which contains a number of subdirectories. Now I have found that one of the subdirectories is unrelated to the other and should be detached to a separate repository.  How can I do this while keeping the history of the files within the subdirectory?  I guess I could make a clone and remove the unwanted parts of each clone, but I suppose this would give me the complete tree when checking out an older revision etc. This might be acceptable, but I would prefer to be able to pretend that the two repositories doesn't have a shared history.  Just to make it clear, I have the following structure:  XYZ/     .git/     XY1/     ABC/     XY2/   But I would like this instead:  XYZ/     .git/     XY1/     XY2/ ABC/     .git/     ABC/


I'm getting an error using the method readFile which I used in the class RunProgram.  The error I'm getting is:      RunProgram.java uses unchecked or unsafe operations.   The code of my RunProgram class is:   import java.util.ArrayList;   public class RunProgram{           public static void main(String [] args){      String [] namen = Input.geefInputNamen();      ArrayList<Spelers> spelerDatabase = new ArrayList<Spelers>();     spelerDatabase = FileReader.readFile("Player Database");        }  }   The method readFile is defined in the code below:   import java.io.*;  import java.util.ArrayList;   public class FileReader {    public static ArrayList readFile(String naamvdfile) {     ArrayList<Spelers> spelerDatabase = new ArrayList<Spelers>();       try { int LineNr = 4;          File aFile = new File (naamvdfile+ ".xlsx");     BufferedReader aBr = new BufferedReader(new java.io.FileReader(aFile));                      String aLine ="";       while (aLine !=> null) {             aLine = aBr.readLine();             if (aLine != null) {                 String [] lineParts = aLine.split(";", -1);                 if (lineParts.length == 10) {                      int overall = Integer.parseInt(lineParts[1]);                     int shootMid = Integer.parseInt(lineParts[4]);                     int shootDis = Integer.parseInt(lineParts[5]);                     int defence = Integer.parseInt(lineParts[6]);                     int rebounden = Integer.parseInt(lineParts[7]);                     int playmaker = Integer.parseInt(lineParts[8]);                     int atletisch = Integer.parseInt(lineParts[9]);                      Spelers speler = new Spelers(lineParts[0], overall,                         lineParts[2], lineParts[3], shootMid, shootDis,                         defence, rebounden, playmaker, atletisch);                     spelerDatabase.add(speler);                 }                 else System.out.println("Lijn " + LineNr +" is niet volledig                                         ingevuld!");                 LineNr++;             }            }              System.out.println("Aantal spelers dat we inlazen: " + LineNr);     }          catch (Exception e) { }          return spelerDatabase;          }    }   This last code doesn't give an error while compiling.

For example:  javac Foo.java Note: Foo.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.


Someone else must have asked this but I'm not searching the right phrase or words to get at it/them.  I'm extruding plane edges from a 4 point plane to create a mesh, and I extrude one or more edges at a time.  There is a shrinkwrap and mirror modifier applied to this geometry.  The attached shows my object renders all valid faces in edit mode, but in object mode it looks like some interior faces might be invalid or missing.  Some of the interior edges 'skip'.  I have tried selecting all edges in edit mode and removing doubles (no impact).  Is this something to worry about?  The face count blender shows me in edit is right (24 total faces).  A shows the object mode, B is edit.    Thx

I am newcomer to Blender and modeling in general. Currently, I am working on modeling a cat. I am noticing at times loops are missing from the polygons.  Here is an example:     Is there any easy way to fix/add a line for consistency and what is the best approach to avoid this when modeling in general for consistent topology?


Please tell me what are Graham Cracker Sheets? I live in Australia and have not heard of them but I'm sure we have an equivalent, any advice appreciated.

I'm from Canada (where there are multitudes of graham crackers!), but I'm currently living in Australia. They do not have anything like graham crackers here, and I could really use them for a couple recipes I'm developing.   Does anyone have a close substitute for graham crackers? I'm looking at making my own, but that seems like a tedious task just to crumble them up again.


Badminton in google transalation speak like ba~d~mon but I asked philippines friends they always speak like ba~men~ton which one the US use in normal life?

Does That's very sweet of you  in the US sound like That's very sweef you? the of is only speak f and link with swee


I want to send email before 2 hours in db time. I developed following code to get all email addresses which has time gap equals to 2 hours or less.      include('connection.php'); //get current date and time     $time = date("c");     $timestamp = strtotime($time);        $sendtime = date("Y-m-d H:i:s", $timestamp);       echo $sendtime;   $sql = "SELECT  email FROM confirmed_user WHERE 7200>=TIME_TO_SEC(TIMEDIFF(sendTime, '$sendtime')) diff";     // $sql = "SELECT sendTime FROM confirmed_user WHERE sendTime='$timestamp'";  $result = $conn->query($sql);  if ($result->num_rows > 0) {     // output data of each row     while($row = $result->fetch_assoc()) {     echo "Email: " . $row["email"]. "<br>";     } } else {     echo "0 results"; } $conn->close();     So I think my sql query is wrong. I got following error.       Trying to get property of non-object and 'o results'.    I keep date time values as date time format in db(  2016-05-11 12:00:00 ) in sendTime field. Any suggestions?

So I'm refactoring my code to implement more OOP.  I set up a class to hold page attributes.  class PageAtrributes  {   private $db_connection;   private $page_title;      public function __construct($db_connection)      {         $this->db_connection = $db_connection;         $this->page_title = '';     }      public function get_page_title()     {         return $this->page_title;     }      public function set_page_title($page_title)     {         $this->page_title = $page_title;     } }   Later on I call the set_page_title() function like so  function page_properties($objPortal) {         $objPage->set_page_title($myrow['title']); }   When I do I receive the error message:     Call to a member function set_page_title() on a non-object   So what am I missing?


I am trying to include an image in my document:  \documentclass[a4paper,10pt,twoside]{book} \usepackage{graphicx}  \begin{document}  \def\foo{scale=0.1} \includegraphics[\foo]{fig1.eps}  \end{document}   gives me the error  ERROR: Package xkeyval Error: `scale=0.1' undefined in families `Gin'.   It has something to do with macro expansion, but I was not able to solve it. Then I saw  question with the following answer     Defining a private \includegraphics allows you to call macros as   optional arguments:  \protected\def\newincludegraphics{\@testopt\new@includegraphics{}} \def\new@includegraphics[#1]{%   \begingroup   \@protected@edef\x{\endgroup     \noexpand\includegraphics     \if\relax\detokenize{#1}\relax\else[#1]\fi    }\x }  \newincludegraphics[\scalefactor]{image}    where the new macro \newincludegraphics was defined.  MWE  \documentclass[a4paper,10pt,twoside]{book} \usepackage{graphicx}  \begin{document} \protected\def\newincludegraphics{\@testopt\new@includegraphics{}} \def\new@includegraphics[#1]{%   \begingroup   \@protected@edef\x{\endgroup     \noexpand\includegraphics     \if\relax\detokenize{#1}\relax\else[#1]\fi    }\x }  \def\foo{scale=0.1} \newincludegraphics[\foo]{fig1.eps}  \end{document}   Nevertheless I still get this error:  ERROR: You can't use `\spacefactor' in vertical mode.  --- TeX said --- \@->\spacefactor                   \@m  l.62 \newincludegraphics                         [scale=0.1]{fig1.eps}   What could be the cause of this error, and is there a workaround without defining another macro to include graphics?

\documentclass[a4paper,10pt,twoside]{book} \usepackage[demo]{graphicx}  \begin{document}  \newcommand{\scalefactor}{scale = 0.25}  \begin{figure}[!ht]   \centering   %Next line does not work   \includegraphics[\scalefactor]{image}   % The following line works   %\includegraphics[scale = 0.25]{image} \end{figure}  \end{document}   Output:  ! Package keyval Error: scale = 0.25 undefined.   I need to scale a number of images by the same factor, hence the command.   How to solve this and more importantly Why is this only specific to \includegraphics


I have the following syntax (which I think is correcT?) but it runs the command every minute!  * */4 * * * /cmd.sh

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


In the outside world ...  Let us imagine that we have enough meat to make two stews. Is it best to split meat and cook one today and one tomorrow or cook both today and reheat tomorrow?  Either way, there is no fridge.

If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?


Quite soon, I'm going to select the answer to a question I've posted. I appreciate the way the current system works means I can only choose a single answer. What really struck me about this particular exchange was that every response was expert in its content and drew attention to different aspects of my question. I could not have hoped for a better set of replies (this is not, however, a preface to me saying that I just cannot select an answer).  Here's my question: let's say I pick response X as the answer. Is there any mechanism that would allow me to announce to all those who engaged with this question that their collective contribution was outstanding and will be of great use going forward. Simply put, I want to send a positive response to the 'micro-community' that constituted the people who engaged with my question.  Also, I recently read this on the site but am having trouble refinding it: what does not selecting an answer imply to those who wrote responses and commented?

What does it mean to accept an answer? How do I accept an answer, and what are the rules? Can I accept my own self-answer? What are the reputation benefits? Which answer should I accept? Should I upvote the accepted answer? What should I do if none of the answers are suitable?      For more information, see "" in the .


I am currently doing a little self study on difference sequences and they use the following identity $$\sum_{k=0}^n \binom{k}{p}= \binom{n+1}{p+1}$$ I have never seen this identity without proof as if it is obvious, am I missing something is this an obvious result that perhaps is a consequence of some other theorem, if not could someone provide some intuition as to why this identity is true or even a proof. Any help is appreciated, thanks in advance.

After reading , the most popular answer use the identity $$\sum_{t=0}^n \binom{t}{k} = \binom{n+1}{k+1}.$$  What's the name of this identity? Is it the identity of the  modified.  How can we prove it? I tried by induction, but without success. Can we also prove it algebraically?  Thanks for your help.    EDIT 01 : This identity is known as the  because, on Pascal's triangle, when the addends represented in the summation and the sum itself are highlighted, a hockey-stick shape is revealed.


I'm writing a song, and I'd like to know if the pronoun "you" should always take a plural form. I wrote these two lines: It's You who never lies It's You who purifies I think it sounds wrong to say, "It's You who never lie." The subject "it" is singular, and "You" refers to one person, so maybe the s-form is correct?

Possible Duplicate:          This is a line spoken by the . I always wondered if this is grammatically correct.  Luke says something like "You are mistaken ..." which the Emperor answers with     No, it is you who are mistaken!   Why wouldn't he say     No, it is you who is mistaken!   instead?  I don't know what rules apply here but my stomach tells me the latter is (at least also) correct, although you would say "you are mistaken". It feels as if he should be referring to "you" in the third person.  Could you please shed some light? Are both correct or – if not – which one is correct? And why?


My first post.  Successfully migrated from win 7 to ubuntu 12.04.1 on my samsung netbook. working smoothly.  But I had installed 32 bit version.  Is there any advantage of going in for 64 bit?  What are the risks. Ram Prasad

What is the difference between 32-bit and 64-bit Ubuntu? I've heard the 64-bit platform performs better and can detect more than 4GB of RAM. Also, while some apps haven't ported to 64-bit yet, ia32-libs lets a 64-bit machine run them.  If so, why not promote 64-bit over 32-bit?


I need to find the value of the following integral using residue calculus - $$I = \int_{0}^{\infty} \frac{x^{1/3}}{1+x^2}dx$$  I have used substitution to start with. Let $x = t^3$. Then $I $ changes to $$I = \int_{0}^{\infty} 3\frac{t^3}{1+t^6}dt$$  On further substitution, $u = t^2$, I get $$I = \frac{3}{2} \int_{0}^{\infty} \frac{u}{1+u^3}du $$ At this point I am stuck. Also, I do not have any good idea about the choice of contour. Any kind of help is appreciated.

I am solving the following integral: $$\int_0^\infty \frac{x}{1+x^3}dx$$ I need to solve it using integration and residue theorems. I tried to convert it to complex function, for example $\frac{z}{1+z^3}$, but it is not even, so it is difficult to find the curve for integration.   Any hints are welcome!  Thank you!


I bought a book in the iBookstore to read on my iPad, but the iPad isn't that easy on my eyes. I recently bought a Kindle because my grandson said the e-ink would be better for reading. Is there a way to convert the iBook to a format I can read on my Kindle?

I am thinking of moving my extensive eBook library to iBooks or Kindle. Has anyone done this, and what does it take?  I just don't want book libraries in multiple proprietary formats, and have to look for content across apps.


This is the server-side code for a lightning component. Normally I would return the last line, but its commented out here to test using anon execution  I think I am calling the parent Id in the loop and not the child Id.  How can I get the child Id returned from the query dynamically?  // I will pass in the sObj and rID (record ID).  Specifying here to test. String[] sObj = new String[]{'Test__c'}; String[] rID = new String[]{'a0cr0000000LhhmAAC'}; // Array to pass back to return statement Set<Id> docIDs = new Set<Id>(); // Make the describe call Schema.DescribeSobjectResult[] results = Schema.describeSObjects(sObj); // Loop through the describe for(Schema.DescribeSobjectResult res : results) {     // Holds generated queries     List<String> subqueries = new List<String>();     String query ='';     // Get child relationships     Schema.ChildRelationship[] rels = res.getChildRelationships();     if (rels.size() > 0) {         //System.debug(res.getName() + ' has ' + rels.size() + ' child relationships.');         integer i = 1;         for(Schema.ChildRelationship rel:rels){             if (rel.getChildSObject().getDescribe().fields.getMap().get('Name') != null) {         // I only care if the relationship is a custom object                 if(rel.getChildSObject().getDescribe().isCustom()) {             // Get relationship name and field                     SObjectType childType = rel.getChildSObject();                     SObjectField lookupField = rel.getField();             // build the query or subquery                     subqueries.add('(SELECT Id FROM ' + rel.getRelationshipName() + ')');                     query = 'SELECT ' + String.join(subQueries, ',') + ' FROM '+ sObj[0] + ' where Id = \'' + rId[0] + '\'' ;             // Run the query with subqueries                     List<SObject> ids = Database.query(query);                     System.debug('Size: ' + ids.size() + ' - ' + query);             // I think this is where its wrong, try to loop through the query                     for(SObject idList:ids){             // only returns the parent id                         System.debug(idList.Id);             // only queries the parent id.  I think I am using the wrong field for id.  I need the id returned from the children                         List<ContentDocumentLink> cdl = [select id,contentdocumentid,contentdocument.Title from contentdocumentlink where linkedentityid = :idList.Id];                         for(ContentDocumentLink cdLink:cdl) {                             docIDs.add (cdLink.ContentDocumentID);                         }                 // The following 4 lines would be removed, and I would use the return statement at the end.  Leaving it here for testing                                 List<ContentDocument> q2ids = [Select id, title,fileextension from contentdocument where id in :docIDs];                                 for(ContentDocument cdLink2:q2ids) {                                     System.debug(cdLink2.Title);                                 }                     }                     i++;                 }             }          }     } } // Would normally use this line instead of the 4 above //return [Select id, title,fileextension from contentdocument where id IN :docIDs];

I have a lookup relationship.  If I just do the following query it works fine:  Sobject c = [select field__r.fieldchild__c from custom_obj where Id = :someId]; system.debug('c:' + c);   However with the following I get an error:  Sobject c = [select field__r.fieldchild__c from custom_obj where Id = :someId]; String c2 = (String) r.getSobject('field__r').get('fieldchild__c');   Error message:     FATAL_ERROR System.NullPointerException: Attempt to de-reference a   null object


By "Files", I mean the program Files.  I store the vast majority of my documents on a second hard drive. Suppose I have Files opened up to my documents in this hard drive, except the window is buried below some other ones. On the left panel of icons, I can see an arrow indicating that Files is open. However clicking on the Files icon, instead of taking me to my already open Files window, it instead launches a new one opening to my home folder. This means that I either renavigate to my secondary hard drive, or I have to move/minimize various windows to dig out my already opened Files window.  This behavior does not occur when Files is opened up to something on my primary hard drive (where Ubuntu is installed). Here when I click on the Files icon, it brings up the already opened window.  Is this a known bug? A known feature? I've had trouble searching to see if others have asked about this, and I think that's mostly due to the name "Files".

Whenever I click on Nauitlus (Home) icon    with one opened window, it always opens new rather than showing me opened ones. Is there any tweak for this?


Can someone please explain to me why the surface area of a solid of revolution formula was derived in the way it was? After learning more about disc integration, that formula made perfect since to me. That is   $$\pi \int_{a}^{b} [R(x)]^2 \space dx$$   where $R(x)$ is the distance between the function and the axis of rotation (in this case the horizontal axis).   I understood this intuitively as viewing the integral as the summation of an infinite number of "slices" with infinitesimal width that can be interpreted as radius's. The formula above can then be viewed as the sum of a lot of circle areas to get the volume of the object generated using the function $R(x)$.   This thinking lead me to think that the surface area of a solid of revolution could be thought of in a similar way and I thought that the formula would have the following form:  $$ 2\pi \int_{a}^{b} [R(x)] \space dx$$  Why is this not the case? I understand the derivation explanations online that use frustums and the arc length as a motivation to arrive at the following formula:  $$S = \int_{a}^{b} 2 \pi \space f(x) \space \sqrt{1 + [f'(x)]^2} \space dx$$  I'm just trying to understand why the way I originally thought about the problem is incorrect.

I am using two books for my calculus refresher.   Thomas' Calculus  Higher Math for Beginners by Ya. B. Zeldovich   My question is : When applying Integral Calculus for calculation of volumes of solids, generated by curves revolved around an axis, we use slices of 'cylinders' to approximate the volume of the resulting solid and then integrate the sum of those infinitesimal cylinders. However, when we are using the same techniques to calculate the surface area of the surfaces generated by revolving curves around an axis, we consider the 'slope' of the differential length of curve 'dx', calculate the total length of the curve and derive the required surface area.  Are we not supposed to use the same 'slope' for calculating the volumes of the infinitesimal 'cylinders' for calculation of volumes? Shouldn't we use 'sliced portions of 'cones' as the infinitesimal volumes?? When it come to calculation of volumes of solids of revolution, why are we neglecting the slope of the curve for the differential length and simply assume that it is an infinitesimal cylinder??  Ex: Let us say we want to calculate the surface area and the volume of the solid generated when the parabola y = 10 . x^2 is revolved about the y-axis, with limits of x from 0 to 5.  In such cases, when calculating the volume of the solid, we consider infinitesimal 'cylinders', ignoring the 'slope' of the curve for the differential element 'dx', but when calculating the surface area, we consider the 'slope' of the differential element 'dx'.


Examples:    The first time the link ended with "yaln"  The second time it ended with "Images/"  [link](http://ideas.lang-learn.org/Images/yalnızlarım.png)   This one, if not escaped by spaces, removes both ı from the link.

In  to a question, I posted a link with a special character in.  Originally it was this:  > Q: Why did the chicken cross the [Möbius strip][1]?   > A: To get to the same side.  [1]: http://en.wikipedia.org/wiki/Möbius_strip   But the link didn't show. I have since changed it to /Mobius_strip since that URL works fine for Wikipedia, but just thought you might like to know.  Just testing to see if the link works by posting it raw:


var a=50; var b=20; var c=0,01*a; var d=0,1*b; var s="if(c<d,a,b)"; var result=?;   So how i can get value of string s by using C#?

I can do an eval("something()"); to execute the code dynamically in JavaScript. Is there a way for me to do the same thing in C#?  An example of what I am trying to do is: I have an integer variable (say i) and I have multiple properties by the names: "Property1", "Property2", "Property3", etc. Now, I want to perform some operations on the " Propertyi " property depending on the value of i.   This is really simple with Javascript. Is there any way to do this with C#?


If $(a, b)=1$, prove that$$\gcd\left(\frac{a^n-b^n}{a-b}, a-b\right) = \gcd(n, a-b).$$   So since $a$ and $b$ are relatively prime that means $\gcd(a,b)=1$. Now, my question is, what theorems would I use to prove this statement? I was thinking something along the lines of using Euclidean algorithm but I wasn't quite sure how I would use it to prove this.

How to show that     $$ \gcd\bigg( {a^n-b^n \over a-b} ,a-b\bigg )=\gcd(n d^{n-1},a-b ) $$    $a,b\in \mathbb Z$   where $d=\gcd(a,b)$?    Note $\ $ Some of the answers below were merged from . The answers (and their comments) may depend on context provided in that question.


I have a setInterval which is supposed to alert the amount of incremented a every 1 second only under a condition which is if a <= 5, else it should make return a = 1, which means it should turn a back to 1 and stop the setInterval from executing as initialized, but surprisingly it starts to execute the setInterval over and over again, each round with a = 1 incrementng. I want the setInterval to be executed only if a <= 5 and as soon as this condition isn't true, then stop the setInterval and turn a back to 1, I don't want it to start the functoin over and over again, though it is turning a back to 1. How can I make this happen?   function doSomething() {    let a = 1;    foo = setInterval(() => {      if (a <= 5) {       a++;       console.log(a)     } else {       return a = 1;     }    }, 1000)    return 0;  } setTimeout(doSomething, 5000);

I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event?   I want the user to be able to stop the repeated refresh of data.


As I read is bytecode an intermediate language which is used by a virtual machine which has to be installed on the computer to run the program.  says, that a VM either executes the bytecode directly or generates machine code for better performance. The article also says, that bytecode is a set of instructions. For me it sounds like normal machine code, except that only the VM can understand it (Am I right?).  So what is the purpose of bytecode? If a VM can also compile it to machine code why can't the compiler do it directly and we don't need the VM and have better performance?

It seems like anything you can do with bytecode you can do just as easily and much faster in native code. In theory, you could even retain platform and language independence by distributing programs and libraries in bytecode then compiling to native code at installation, rather than JITing it.  So in general, when would you want to execute bytecode instead of native?


I want to give a player a specified item that makes something when used, but first I need to actually give them the item, and that's where I'm stuck. I am attempting to use the following command: /give @p arrow 1 1 {display:{Name:"Arrow of destiny"}}  However I'm getting the error:  Line 1, Column 2 Missing '}' or object member name  Why is this not working? What am I doing wrong?

This question was recently split into different questions for each workaround. See   meta posts for more information.   Can you use NBT tags in commands? I’ve tried commands that normally work in Java Edition like: give @s minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}} give @s stone_pickaxe{Unbreakable:1b} give @s item_frame{EntityTag:{Invisible:1b}} summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"emerald",Count:5b},sell:{id:"diamond_sword"}}]}} summon tnt ~ ~ ~ {Fuse:20s}


These are two part terms - where the endings are usually left off:  make like a banana make like a tree  The endings though are where the point lies:  (make like a banana) and split (make like a tree) and leave  Wikitonary just tags these as idiomatic. Is there a technical term for these phrases? Edit: does it count as an aposiopesis?

In my area, it's not unusual to hear expressions like     I'm going to make like a banana and split.     ...make like a tree and leave.     ...make like a baby and head out.     ...make like a prom dress and take off.   When they are self-referential, they are humorous partings between friends.  When directed at others, they are insulting.  Are these just simple humorous similes, or is there something more complex going on? Are these only used for parting phrases, or are they constructed for other situations as well? Do these represent some common type of humor?


As a long time gamemaster I have reached a point where I want to create my own system and run players through it but I have noticed that people tend to shy away from systems that are homemade. For example if I decide to run WoD or D&D 5e I'll have 10 recruits minimum ready to play but if I say 'I made a system similar to WoD' then maybe 1 person who will be extremely hesitant. So what I want to ask is that how can I advertise a homebrew game I made in a way that does not make people shy from it as soon as they hear the word 'homebrew'?

I have been working on a short narrativist system for quite some time now. I intend to offer it freely to anyone interested but I'm not sure about a couple of things:  First, how do I package it? One option is to make a website with the rules. In that case, is making lots of small interconnected pages a good idea? Or is it better to keep it linear and on as few pages as possible? Another option is to make a book-like pdf, possibly using LaTeX. Assuming people go as far as the download page, will they be willing to get the pdf? Is it easier to read?   Second, how do I let other people know? I can't just barge into forums spamming about how great my system is. Should I look for contests or challenges, like the 24Hour RPG? Is there any point to posting on social news/bookmarking sites? Is it good form to contact game review sites and ask them to consider my game?  Feel free to ignore the secondary questions if you want to; they're there only to expose my reasoning thus far and to inspire answers.


Is it possible to run a computer without integrated graphics and no dedicated gpu?  If so would it be able to perform basic functions such as browsing the web.  If not then why wouldn't it work?

As I can remember, on old systems (Pentium II or III) it was not possible to boot and run the PC if the graphics card was missing (AGP cards were used in those days).    Many years from then, I'm using motherboards with integrated graphics and I have no experience related to this subject, the "graphics card" always was present.  Currently I intend to build a home/private "server" for my purposes and most of the motherboards I want to buy have no integrated graphics (AMD 870 or 970). I can take a normal graphics card from my friends for a few hours/days and use it when installing the necessary software.    Can I boot and run the PC without problems after I install everything I need and the graphics card is removed?  If a general answer cannot be given, at least some examples of manufacturers/MB series/MB models will be helpful.  I think it's obvious, but for completeness, I mean cheap desktop components and not real servers.


There is an old black and white episode of The Twilight Zone in which a test pilot and a woman in a car find themselves stopped a mere instant before a devastation crash would have surely killed them. They are in separate locations but close enough to eventually meet up. They quickly realize that time has stopped though they are still moving normally.   During this time they explore a small town and marvel at how everything looks while stopped. As I remember, they find the control room for some sort of experiment that was being conducted. This is where the aliens come in. If I remember right you never really clearly see the aliens but their voices can be heard. The man and woman also discover multiple accidents about to occur but they are powerless to stop them. I distinctly remember a little girl on a tricycle riding on the sidewalk in front of a fire station and an unmanned fire engine about to roll over her.

This is a movie I saw on TV in the mid to late sixties, so I’m not sure if it was a made for TV movie or if it was out in theater in the late 50’s or early 60’s.  I only remember bits and pieces of it.  What I remember is a man and a woman accelerated in time.  The rest of the world was either suspended in time or moving very slowly.  The man I believe was either a pilot, or humanoid alien, and his plane, or spaceship, looked like it was about to crash but was suspended in time a few feet above the ground.  I’m not sure if they were trying to do something to save the world or trying to save someone, but whatever they needed to do I think they only had an hour to do it before normal time resumed again.  I also remember a scene where they were going along a street and found a boy running out in front of a truck and would most likely be hit when normal time resumed.  They used the truck’s seat belt to tie the emergency brake on so the truck would stop when normal time resumed.  I have been waiting a long time to see if it would be on TV again, but no luck. I know it’s not much to go on, but I would appreciate any help on this.


I am implementing a class hierarchy and see calls to parent methods that I do not understand why. Using C++11 constructs and this is my first 11 project where I use some features, hence I believe this might be a benign problem.  class A{    void update(){        std::err << "Calling A update " << std::endl;    }  }  class B: public A{    void update(){        std::cout << "In B update! " << std::endl;    }  }  class C: public A{    void update(){        std::cout << "In C update! " << std::endl;    }  }   now somewhere else I have a vector containing either Bs or Cs  std::vector<A> container; container.push_back(B()); container.push_back(C());  for(auto item: container){     item.update(); }   prints   Calling A update Calling A update   Why?

Someone mentioned it in the IRC as the slicing problem.


I am working on an RPG and I've mostly followed formulas from the Dragon Quest series and they've all been fairly simple. (For example, dmg = (Attack/2 - Defense/4), where Attack is Weapon Power+STR.)  Experience points are more complicated though. I want one of the characters to level more slowly compared to the others. I'm not comfortable with the maths, but how would I go about creating a suitable exponential growth formula that is slow from let's say levels 1 through 40 and then speeds up to 99?

I'm trying to create a formula that can be modified simply by changing two values: number_of_levels, and last_level_experience. This is to enable people modding the game to change the levelling requirements.  I've got it so that I can specify the number of XP needed for the last level up, but I want to be able to control the XP needed for the first level up, which in this case can differ wildly. For example, if I have 40 levels, and 1,000,000 XP for the last level, the first level up requirement is then 625. But if I change the levels to 80, the first  level up becomes 156. In both cases, the last level needs 1,000,000.  There must be some way to get the computer to work out a suitable curve given just these two basic values.  #include <iostream>  int main() {     int levels = 40;     if (levels < 2) levels = 2;      int experience_for_last_level = 1e6;     float fraction = 1.0 / levels;      {         int i = 0;         float fraction_counter = fraction;         int counter = levels;         int total = 0;          for (i = 1; i <= levels; ++i, fraction_counter += fraction, --counter)         {             int a = static_cast<int>(fraction_counter * experience_for_last_level / counter);              std::cout <<"Level "<<i<<":  "<<a<<" ("<<counter<<")"<<"\n";              total += a;         }          std::cout << "\nTotal Exp: " << total;     } }   Output:  Level 1:  625   (40)      Level 15: 14423  (26)      Level 29: 60416  (12) Level 2:  1282  (39)      Level 16: 16000  (25)      Level 30: 68181  (11) Level 3:  1973  (38)      Level 17: 17708  (24)      Level 31: 77499  (10) Level 4:  2702  (37)      Level 18: 19565  (23)      Level 32: 88888  (9) Level 5:  3472  (36)      Level 19: 21590  (22)      Level 33: 103124 (8) Level 6:  4285  (35)      Level 20: 23809  (21)      Level 34: 121428 (7) Level 7:  5147  (34)      Level 21: 26250  (20)      Level 35: 145833 (6) Level 8:  6060  (33)      Level 22: 28947  (19)      Level 36: 179999 (5) Level 9:  7031  (32)      Level 23: 31944  (18)      Level 37: 231249 (4) Level 10: 8064  (31)      Level 24: 35294  (17)      Level 38: 316666 (3) Level 11: 9166  (30)      Level 25: 39062  (16)      Level 39: 487499 (2) Level 12: 10344 (29)      Level 26: 43333  (15)      Level 40: 999999 (1) Level 13: 11607 (28)      Level 27: 48214  (14) Level 14: 12962 (27)      Level 28: 53846  (13)


I am following Rob Conery MVC Storefront tutorial series and I get an Inconsistent accessibility error from the following constructor public SqlCatalogRepository(DB dataContext) :  public class SqlCatalogRepository : ICatalogRepository {     DB db;      public SqlCatalogRepository()     {         db = new DB();         //turn off change tracking         db.ObjectTrackingEnabled = false;     }       public SqlCatalogRepository(DB dataContext)     {         //override the current context         //with the one passed in         db = dataContext;     }   Here is the error message : Error   1   Inconsistent accessibility: parameter type 'SqlRepository.DB' is less accessible than method 'Data.SqlCatalogRepository.SqlCatalogRepository(SqlRepository.DB)'

Whats wrong with the following c# code? Compiler reports this error:  Inconsistent accessibility: parameter type 'ClassLibrary1.Interface1' is less accessible than method 'ClassLibrary1.Class1.Class1(ClassLibrary1.Interface1)'  with the following code:  interface Interface1<T> {     bool IsDataValid();     /* Other interfaces */ }  public class Class1<T> {     public Interface1<T> interface1;      public Class1(Interface1<T> interface1)     {         this.interface1 = interface1;     }  }   I've since designed my code differently using inheritence to but if anyone could tell me what the above is wrong I'd greatly appreciate it.


How to retrieve notes and attachments from custom object through vf page.please help me and give me some example code

I want retrieve image from documents in not other notes like pdf,ext... please how to write soql query


I have a circle with a inner loopcut, and would like to be able to scale the ring without affecting the UV texture on the circle. Currently it warps it, as Blender tries to fit the UV to the (now thinner) ring.  I also need the ability to animate the scale of the inner loop.     When scaling the inner ring, I'd like it to simply "crop" the outer UV texture, instead of "squashing" it.

I have a brick wall that I am trying to add a door to. I have already UV mapped it, so when I move the loop cut to the right height, it distorts my UV map. How can I avoid having to unwrap it again?


If I wanted to rank for "Christmas Coffee" does it matter whether my title is   A) 2015's Best Christmas Coffee  or  B) 2015's Best Coffee of Christmas  How much weight is put into this?

Stack Overflow has made a change to their page titles such that the most popular tag for a question appears at the start of the title.  The change is being deployed across the network, so check out the page title for this question.    Compare the question title and the page title for :  Question title:     Is it safe to use ASP.NET MVC3 RC?   Page title:     asp.net mvc - Is it safe to use ASP.NET MVC3 RC? - Stack Overflow   I understand the change to try and stop  on Google.  Adding the most popular tag to the page title seems like a good idea.  However, a side effect that I'm noticing is that with a lot of tabs open, now the only part of the title that I can see is the tag.  Would moving this keyword to later in the page title harm these efforts to improve SEO?  Possible title:     Is it safe to use ASP.NET MVC3 RC? - asp.net mvc - Stack Overflow


I have a 237MB /boot partition which I thought should be enough for normal operation, however, when I do a apt-get upgrade I get the following:  $ sudo apt-get upgrade [sudo] password for ron:  Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... The following packages were automatically installed and are no longer required:   linux-headers-4.2.0-16 linux-headers-4.2.0-16-generic linux-headers-4.2.0-27   linux-headers-4.2.0-27-generic linux-image-4.2.0-16-generic   linux-image-4.2.0-27-generic linux-image-extra-4.2.0-16-generic   linux-image-extra-4.2.0-27-generic linux-signed-image-4.2.0-27-generic Use 'apt-get autoremove' to remove them. Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n]  Setting up initramfs-tools (0.120ubuntu6) ... update-initramfs: deferring update (trigger activated) Processing triggers for initramfs-tools (0.120ubuntu6) ... update-initramfs: Generating /boot/initrd.img-4.2.0-34-generic  gzip: stdout: No space left on device E: mkinitramfs failure cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-4.2.0-34-generic with 1. dpkg: error processing package initramfs-tools (--configure):  subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing:  initramfs-tools E: Sub-process /usr/bin/dpkg returned an error code (1) $   and that while:  $ df -h Filesystem      Size  Used Avail Use% Mounted on udev            1.9G     0  1.9G   0% /dev tmpfs           384M  6.2M  378M   2% /run /dev/dm-0       454G  9.8G  421G   3% / tmpfs           1.9G     0  1.9G   0% /dev/shm tmpfs           5.0M  4.0K  5.0M   1% /run/lock tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup /dev/sda2       237M  209M   16M  93% /boot /dev/sda1       511M  3.4M  508M   1% /boot/efi tmpfs           384M  8.0K  384M   1% /run/user/1000 $

My /boot partition is nearly full and I get a warning every time I reboot my system. I already deleted old kernel packages (linux-headers...), actually I did that to install a newer kernel version that came with the automatic updates.  After installing that new version, the partition is nearly full again. So what else can I delete? Are there some other files associated to the old kernel images?  Here is a list of files that are on my /boot partition:  :~$ ls /boot/ abi-2.6.31-21-generic         lost+found abi-2.6.32-25-generic         memtest86+.bin abi-2.6.38-10-generic         memtest86+_multiboot.bin abi-2.6.38-11-generic         System.map-2.6.31-21-generic abi-2.6.38-12-generic         System.map-2.6.32-25-generic abi-2.6.38-8-generic          System.map-2.6.38-10-generic abi-3.0.0-12-generic          System.map-2.6.38-11-generic abi-3.0.0-13-generic          System.map-2.6.38-12-generic abi-3.0.0-14-generic          System.map-2.6.38-8-generic boot                          System.map-3.0.0-12-generic config-2.6.31-21-generic      System.map-3.0.0-13-generic config-2.6.32-25-generic      System.map-3.0.0-14-generic config-2.6.38-10-generic      vmcoreinfo-2.6.31-21-generic config-2.6.38-11-generic      vmcoreinfo-2.6.32-25-generic config-2.6.38-12-generic      vmcoreinfo-2.6.38-10-generic config-2.6.38-8-generic       vmcoreinfo-2.6.38-11-generic config-3.0.0-12-generic       vmcoreinfo-2.6.38-12-generic config-3.0.0-13-generic       vmcoreinfo-2.6.38-8-generic config-3.0.0-14-generic       vmcoreinfo-3.0.0-12-generic extlinux                      vmcoreinfo-3.0.0-13-generic grub                          vmcoreinfo-3.0.0-14-generic initrd.img-2.6.31-21-generic  vmlinuz-2.6.31-21-generic initrd.img-2.6.32-25-generic  vmlinuz-2.6.32-25-generic initrd.img-2.6.38-10-generic  vmlinuz-2.6.38-10-generic initrd.img-2.6.38-11-generic  vmlinuz-2.6.38-11-generic initrd.img-2.6.38-12-generic  vmlinuz-2.6.38-12-generic initrd.img-2.6.38-8-generic   vmlinuz-2.6.38-8-generic initrd.img-3.0.0-12-generic   vmlinuz-3.0.0-12-generic initrd.img-3.0.0-13-generic   vmlinuz-3.0.0-13-generic initrd.img-3.0.0-14-generic   vmlinuz-3.0.0-14-generic   Currently, I'm using the 3.0.0-14-generic kernel.


Let $f: \mathbb{R} \to \mathbb{R}$ such that $\lim\limits_{x \to \infty} \frac{f(x)}{x} = c$ where $c\neq 0$ or $\infty$.  Is it true that for all such functions $f$, if $\lim\limits_{x \to \infty}(f(x+1)-f(x))$ exists, then it is equal to $c$?  Note : Say if $f(x) = x+\sin(x)$, then the condition is clearly false because the second limit does not exist. But say, we impose another condition that the second limit should exist, then is it necessary that it goes to $c$ as well?

Let $f:\mathbb{R}\to\mathbb{R}$ continuous such that $\lim_{x\to\infty}f(x+1)-f(x)=l$.  How can I prove that $\dfrac{f(x)}x$ converges for $x\to+\infty$ ?  I am just trying to prove the convergence, not that it converges to $l$ (that part be deduced immediately by Stolz-Cesaro and the sequential characterization of limits)


The reason for asking this rather "foolish" question is that I don't really know how to google it or how to search for it here on SO. The question is regarding the '->' operator, which can be used to access methods and variables from references to an object. Ex:  exClass* exObjPtr = new exClass; exObjPtr -> exMethod();   I don't know what this (->) operator is called, and I can't google it or find it whiles searching on SO, because nether will alow searing for the special carachter '>'.  QUESTIONS:   Where can I find more information about this topic? What is the operation called. From what I understand so far, the (->) operation is some sort of "syntactic sugar" for dereferncing an object and accessing it's members. What is the "non suger syntax" for this operation.   Apologize in advance for my rookie english! That you for your time!

What is the arrow operator (->) a synonym for?


I would like to serialize classed what potentially can have properties what's current value is an anonymous function. As far as I knew this does not work out ob the box. However my very first unit test seems to be pass:  [Test] public void AnonymousTest() {     Func<double, double, double> func = (double a, double b) =>     {         if (a > 0) // Dummy if branch to make sure this is a delegate and not expression         {             return a + b;         }         return 0;     };     var persistedFunc = SaveAndLoad(func); // Serialize and deserialize with BinaryFormatter     Assert.AreEqual(7, persistedFunc(3, 4)); // Green }   My question: is this working just because the deserialized delegate is running in the very same assembly, where the anonymous function exist and exist with the very same compiler generated name, or can we expect it will work in the future with the potentially changed and recompiled assembly?  EDIT: To narrow the question: Do we know at all what are the prerequisites of this is working? Say could a simple future recompile render useless the persisted state?

I am trying to determine what issues could be caused by using the following serialization surrogate to enable serialization of anonymous functions/delegate/lambdas.   // see http://msdn.microsoft.com/msdnmag/issues/02/09/net/#S3 class NonSerializableSurrogate : ISerializationSurrogate {     public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)     {         foreach (FieldInfo f in obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))             info.AddValue(f.Name, f.GetValue(obj));     }      public object SetObjectData(object obj, SerializationInfo info, StreamingContext context,                                 ISurrogateSelector selector)     {         foreach (FieldInfo f in obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))             f.SetValue(obj, info.GetValue(f.Name, f.FieldType));         return obj;     } }     Listing 1 adapted from   The main issue I can think of that might be a problem is that the anonymous class is an internal compiler detail and it's structure is not guaranteed to remain constant between revisions to the .NET Framework. I'm fairly certain this is the case based on my research into the similar problem with iterators.  Background  I am investigating the serialization of anonymous functions. I was expecting this not to work, but found it did for some cases. As long as the lambda did *not& force the compiler to generate an anonymous class everything works fine.   A SerializationException is thrown if the compiler requires a generated class to implement the anonymous function. This is because the compiler generated class is not marked as serializable.  Example  namespace Example {     [Serializable]     class Other     {         public int Value;     }      [Serializable]     class Program     {         static void Main(string[] args)         {             MemoryStream m = new MemoryStream();             BinaryFormatter f = new BinaryFormatter();              // Example 1             Func<int> succeeds = () => 5;             f.Serialize(m, succeeds);              // Example 2             Other o = new Other();             Func<int> fails = () => o.Value;             f.Serialize(m, fails); // throws SerializationException - Type 'Example.Program+<>c__DisplayClass3' in Assembly 'Example, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.         }     }   Listing 2  This is similar to the issue of trying to serialize iterators and I had found the following code in a previous search (see ) Using the code from Listing 1 and an ISurrogateSelector I was able to successfully serialize and deserialize the second failing example.  Objective  I have a system that is exposed via a web service. The system has a complex but small state (many objects, not a lot of properties per object). The state is saved in the ASP.NET Cache, but is also serialized to a BLOB in SQL in case of cache expiration. Some objects need to execute arbitrary "events" upon reaching some condition. Hence they have properties accepting Action/Func objects. Contrived example:      class Command     {         public Command(Action action, Func<bool> condition);     }   Somewhere else      void DoSomethingWithThing(Thing thing)     {         state = Store.GetCurrentState();          Command cmd = new Command(() => thing.Foo(), () => thing.IsReady())         state.Add(cmd);          Store.Save(state);     }


I'm installing Pencil and get the following error: xulrunner: not found. XULRunner is a a requirement for Pencil. So how do I install XULRunner and it's dependencies?

I am trying to migrate a virtual machine I use for my classes at the university from 10.04 to 12.04 and in that I am using xulrunner so that   first, I can have SQLiteManager as a stand alone app next,  can provide help for its nodes   I tried adding the the mozilla ppa as described in some posts, e.g.  or , but when I search for xulrunner in Synaptic I get no match.  I read in , that xulrunner was left out intentionally, which, frankly, I think is a bad decision! Anyway, does anyone know a way out of this, i.e. how to get xulrunner?


It is better to let make sure if System can/will be worked effectively & efficiently.  So, before installing Ubuntu, how can I find out if my hardware like motherboard components, graphics card, etc, are supported by Ubuntu?  Can I find through model or chipset or as better as possible?

How can I find out if Ubuntu supports a particular hardware component, that is, if it works in Ubuntu?  I am going to put together a computer and I am choosing components.   How do I know if Ubuntu supports this or that motherboard, or this or that sound card, or this or that graphics card, etc? How do I know that there is no conflict in Ubuntu between this and that hardware component?   What resources are there to help with such situations?  I know that there are computers with Ubuntu pre-installed and that there are  for whole computers but this is not what I'm looking for. I'm looking for resources to find out support for particular hardware components and conflicts among particular hardware components.


My visa to Spain was rejected with the reason that my intention to leave the territory of the member state before the expiry of the visa could not be ascertained.  I'm 17 years old and I finished secondary school in 2017. How do I appeal it? Or what should I do?

Schengen refusal formulae can be difficult to understand sometimes.  Sometimes an applicant receives a refusal with:       Justification for the purpose and conditions of the intended stay was not reliable.     often accompanied by:       Your intention to leave the territory of the Member States before the expiry of the visa applied for could not be ascertained.   What is meant by this refusal reason?  What are they trying to say?


I have a complex Gaussian Integral for my QFT course to solve without looking at the integral table but I don't know how I should do it     The integral is:   $$\int_{-\infty}^{+\infty} \exp\left(\frac{i\cdot x^2}{2}\right) \mathrm{d}x = \left(1+i\right) \sqrt{\pi}.$$   My suggestion would be to take:  $$\exp\left(\frac{i\cdot x^2}{2}\right) = \cos{\left(\frac{x^2}{2}\right)} + i \sin{\left(\frac{x^2}{2}\right)}\,,$$  and solve it as a Fresnel integral. Is that a right Approach or would you do something else?

Although this question is going to seem completely trivial to anyone with any exposure to path integrals, I'm looking to answer this precisely and haven't been able to find any materials after looking for about 40 minutes, which leads me to believe that it makes sense to ask the question here. In particular I'm looking for an answer wherin any mathematical claims are phrased as precisely as possible, with detailed proofs either provided or referenced. Also my search for a solution has led me to think I'm actually looking for a good explenation of Wick rotation, which I can't really claim to understand in detail. Any good references about this would be very welcome as well.  I'm looking to make sense of the following integral identity:  $$\int_{-\infty}^{\infty} dx \ \exp\left(i\frac{a}{2}x^2+iJx\right)=\left(\frac{2\pi i}{a}\right)^{1/2}\exp\left(\frac{-iJ^2}{2a}\right), \qquad a,J\in\mathbb{R}$$   (and various other sources) say that "This result is valid as an integration in the complex plane as long as a has a positive imaginary part." Clearly the left hand side does not exist in Lebesgue sense for real $a, J$. An answer to the question "" claims:      "it is convergent as a Riemann integral, thanks to some rather delicate cancellations. To make the integral well defined -- equivalently to see how these cancellations occur -- we need to supply some additional information.   Wick rotation provides a way of doing this. You observe that the left hand side is analytic in t   , and that the right hand side is well-defined if Im(t)<0. Then you can define the integral for real t by saying that it's analytic continued from complex t with negative imaginary part."   I want to see the gory details and all known motivation for the validity of this procedure for the kinds of applications where such integrals occur. Suggestions such as "include an $i\epsilon$ in order to make it finite" seem arbitrary. In that case one would have to motivate that prescription from the very start, that is within the modeling procedure that ends up giving that integral expression (which is likely the correct way to approach this). I'm also not sure how to interpret the right hand side, since it involves the square root of an imaginary number, which should involve some choice of branch cut, which I have never seen specified in connection to this formula.


I want to write a function writelog() with ellipsis parameters, which should forward the same ellipsis parameters to another function. How to do it?  My function example:  void writetolog(char *format, ...) {     FILE *file;     if ((file = fopen(LOG_FILE, "a")) != NULL)     {         fprintf(file, format, ...);         fclose(file);     } }   Function fprintf() should have the same ellipsis parameters from function writetolog().

In C, is it possible to forward the invocation of a variadic function? As in,  int my_printf(char *fmt, ...) {     fprintf(stderr, "Calling printf with fmt %s", fmt);     return SOMEHOW_INVOKE_LIBC_PRINTF; }   Forwarding the invocation in the manner above obviously isn't strictly necessary in this case (since you could log invocations in other ways, or use vfprintf), but the codebase I'm working on requires the wrapper to do some actual work, and doesn't have (and can't have added) a helper function akin to vfprintf.  [Update: there seems to be some confusion based on the answers that have been supplied so far. To phrase the question another way: in general, can you wrap some arbitrary variadic function without modifying that function's definition.]


Let $\mu$ be the mean and $\sigma$ the standard deviation of a probability distribution defined on the bounded interval $[a,b]$ (that is, the probability that the random variable lies outside $[a,b]$ is zero).  Does the following inequality hold generally for any such probability distribution?  $$\sigma^2 \le (\mu-a)(b-\mu)$$  Motivation: This inequality holds for the Beta distribution (as is obvious from the formulae ).

Suppose that a random variable has a lower and an upper bound [0,1]. How to compute the variance of such a variable?


Recently I've come across the following piece of code:  enum Animals {     DOG("woof"), CAT("meow"), FISH("burble");     String sound;      Animals(String s) {         sound = s;     } }  class TestEnum {     static Animals a;     public static void main(String[] args) {         System.out.println(a.DOG.sound + " " + a.FISH.sound);//Expected compilation failure     } }   I would expect the code to fail to compile because of this a.DOG.sound part. But to my surprise it doesn't. I've searched all around including the  to find out the access level but found nothing. Is it public or default?

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?


Tried to search the forum already for some time, but can't get something working in a script in my blender environment. I want to play an animation based on the content of a label. I am really struggling with the if and elif condition, especially with the content of a label. Can anybody provide a simple example? I have now this, but it doesn't work: import bpy status = bpy.data.objects["Text"] if status == 'GO':     bpy.ops.screen.animation_play() elif status == 'NOGO':     bpy.ops.screen.animation_stop()

That is, can python code replace, for example, a single letter in a Text Object or insert a letter or string into a Text Object.  Note that I'm not talking about replacing a Text Object with some updated string, such as, object.text = "new string". I'm thinking more about having access to the Text cursor (not the mouse cursor) and positioning it on some letter that I'd like to replace.  In other words, I'd like to have the same capability during BGE play that I have when altering a Text Object in the edit mode.


I want to download programs like Cmap tools or Geany to a removable drive, but I don't now how.

When I install a software using apt-get it installs to default locations i.e to /usr/bin, /usr/lib, /usr/share and etc. For example when I install "Meld Diff Viewer" using  sudo apt-get install meld   and use whereis command to find its location, I get the following output  adnan@adnan-laptop:~$ whereis meld meld: /usr/bin/meld /usr/lib/meld /usr/share/meld /usr/share/man/man1/meld.1.gz   Is there any way to change the install location. Lets say if I want to install it in /usr/local/ can I do it using apt-get or aptitude? I know I can compile it from source and specify prefix option to configure script or make install but it would be better (and really easier) if I could do it using apt-get as I would be able to use uninstall, upgrade and other stuff that apt-get offers