Let $n , m \in \mathbb{N}$ and let $k = \gcd(n , m)$. Then there exist $p , q \in \mathbb{N}$ coprime such that $n = p k$ and $m = q k$. And it is easy to see that $$ \frac{X^n - 1}{X^k - 1} = \sum_{i = 0}^{p - 1} X^{k i} = f(X) \qquad \mbox{ and } \qquad \frac{X^m - 1}{X^k - 1} = \sum_{j = 0}^{q - 1} X^{k j} = g(X)\mbox{,} $$ being $X$ an indeterminate. How can I show that $\gcd(f(X) , g(X)) = 1$?

Let $F$ be a field, let $p , q$ be two coprime natural numbers and we consider the two polynomials $$ f(X) = \sum_{i = 0}^{p - 1} X^{k i} \qquad \mbox{ and } \qquad g(X) = \sum_{j = 0}^{q - 1} X^{k j} $$ in $F[X]$, where $k \in \mathbb{N}$. If $x$ is an arbitrary element in $F$, how can I show that $\gcd(f(x) , g(x)) = 1$?


First time posting a question here so if I fail, please excuse me and of course notify me about my mistake.  My situation is that currently I'm on holiday in Spain and I installed Ubuntu 13.04 alongside my Windows 8 install.  Both are 64 bit and my Ubuntu also has 32bit libs installed for convenience and running programs like XAMPP for Linux etc.  So my issue is not really big or very interesting but it bugs me...  When I first logged in, all the icons in the top right (e.g. login / WiFi / Ubuntu One / sound / power) were all nicely lined up how they are supposed to be.  HOWEVER the second time I logged in... the Power icon was somewhere in-between.    I am not an experienced Linux user but I do use it for speed and ease of use (hence Ubuntu) and I know my way a little with the sudoing but nothing special.  The only thing I really want is the power button most right.  However, I have no clue how to fix this.  Any help would be much appreciated and sorry for the probably 'stupid' question.

Is it possible to change the order of icons shown in the indicator applet? With Tomboy indicator, Weather indicator, Clipboard-manager indicator, Ubuntu One and Dropbox indicators and a Battery Status indicator in addition to the classic Messages indicator and Sound Menu indicator my Indicator Applet becomes a little bit messed up, sorting the icons would help a lot...


How can I prove $\arctan\ x \lt x$ for x $> 0$?  I have tried different stuff without success.

I have got some trouble with proving that for $x\neq 0$: $$ \frac{\arctan x}{x }< 1 $$ I tried doing something like $x = \tan t$ and playing with this with no success.


Im novice in java coding. Could someone tell how to make this code work. I'm trying to a simple guessing game for string variable (as an exercise). I know how to do it with numbers but with words it seems to go differently. I'm trying to make the program ask word until it's correct (java).  public class DoWhile2 {     public static void main(String[] args) {      String word;      do {         System.out.println("Guess the right word.");         word = In.readString();          if (word != "java")              System.out.println("Try again.");          else              System.out.println("Good.");      }while (word != "java");  }}

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


I have a problem activating my wifi on ubuntu 16.04, I used a debug script and the result is on this link:  .. any help with this?

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


I have a simple invocable method  that I'm calling from a Flow when certain criteria are met. I'm getting good results from the code as evidenced by reviewing data in the UI, but I'm not sure how to write a test class for an @InvocableMethod. Here is the invocable method: @InvocableMethod     public static void invocableUpdateAgentCache(List<List<String>> resultList) {         ContactCentreCache__c cache = getUserCache();         cache.Caller_Type__c = resultList[0][0];         cache.ID_Check_Result__c = resultList[0][1];         cache.Parent_ID__c = resultList[0][2];                  update cache;     }

I have a simple invocable method (thanks, Rakesh Gupta!) that I'm calling from a Process Builder when certain criteria are met.  I'm getting good results from the code as evidenced by reviewing data in the UI, but I'm not sure how to write a test class for an @InvocableMethod.  Here is the invocable method:  public class AssignLeadsUsingAssignmentRules  {     @InvocableMethod     public static void LeadAssign(List<Id> LeadIds)     {         Database.DMLOptions dmo = new Database.DMLOptions();         dmo.assignmentRuleHeader.useDefaultRule= true;                   Lead Leads=[select id from lead where lead.id in :LeadIds];         Leads.setOptions(dmo);         update Leads;     }  }   Here is test class that I've written:  @isTest private class AssignLeadsUsingAssignmentRulesTest {      private static testMethod void doTest() {          Test.startTest();         Lead l = new Lead(LastName = 'Test Lead',                      Company = 'Test Company',                      IsRecruitmentLead__c = True);         insert l;         Test.stopTest();      } }   The test class creates data that meets the criteria for the Process Builder, and the test class executes to completion in the Developer Console, but I'm still getting 0% code coverage for the invocable class.  Thanks in advance for your advice - Tom


Is it possible to make BibTeX sort bibliography entries by date? The best I have found to date is to add a \nocite command at the top of my document listing all citations in the order I want them. This works when the bibliography is small, but becomes tedious very fast. Is there a better way of doing this? \documentclass{article} \begin{document}  \nocite{li_2020}\nocite{schmidt_2018}\nocite{ribeiro_2017}  Ratione dolores totam magnam fugit commodi \cite{ribeiro_2017}.  Aliquam commodi voluptatibus culpa voluptatem sed odio.  Ut ipsum et ipsam non \cite{li_2020}.  Deserunt laudantium non nihil fuga possimus suscipit \cite{schmidt_2018}.  Omnis similique et tempora quaerat occaecati sint mollitia.  \bibliographystyle{unsrt} \bibliography{biblio} \end{document}

I am trying to get my list of publications to display in reverse chronological order.  I can use \bibliographystyle{unsrt} as a workaround, and just order the entries manually, but I would naturally prefer if BibTeX did that for me.  What tools or approaches can I take to sort the bibliography in reverse chronological order?


Question : Is it considered ОК to copy-paste someone else's answer to an earlier question as your own, as long as you provide a link back to the original answer?  Background : A  has been posted this morning that happened to be a duplicate of  with a rather detailed code in the .  Within minutes, two answers ( and ) showed up, containing the exact copy of the code from the answer to the old question. The only difference between the two answers has been that the first one linked the source question, while the second one copy-pasted someone else's answer with no further explanations.  I flagged both answers for moderator's attention. The "plain" copy-paste flag got accepted, but the flag for the answer with the link got rejected. The only difference between the accepted and rejected flags was a link back to the copied original, prompting my question about the fair use.

This one leaves me with a bad taste in my mouth, but I defer to others as to whether it is appropriate or not. In , I wrote an answer to a question based on my experiences; it was upvoted and accepted, woo.  Now, today, in response to a different — but related — , someone has pasted my answer nearly verbatim (awkward English intact, I may add) as an answer.  Is that really okay? Is it a behavior that should be encouraged? Discouraged?


I want to remove occurrence of a string from a given string. Like /hello: from a string like /yo:/sup:/hello:/yo:/hello:/yup. And one thing for sure if string contains a colon in end then it must be removed.  There can be anything between /hello and colon (:) so I want to strip all from /hello to first colon (:).

Replacing strings in files based on certain search criteria is a very common task. How can I    replace string foo with bar in all files in the current directory? do the same recursively for sub directories? replace only if the file name matches another string? replace only if the string is found in a certain context? replace if the string is on a certain line number? replace multiple strings with the same replacement replace multiple strings with different replacements


I have a question that I was asked at an interview recently for an IT support job. I wanted to ask the same question somewhere on Stack Overflow but the answers will be completely opinionated and there will be no right or wrong answer.     I'm simply curious to see what other professionals would have suggested in the same situation. Is there a place on Stack Overflow for this?

Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.


$ lshw -class network   *-network                         description: Ethernet interface        product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:02:00.0        logical name: eno1        version: 15        serial: 38:22:e2:e7:80:06        size: 100Mbit/s        capacity: 1Gbit/s        width: 64 bits        clock: 33MHz        capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.1.16 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s        resources: irq:51 ioport:f000(size=256) memory:fce04000-fce04fff memory:fce00000-fce03fff   *-network UNCLAIMED        description: Network controller        product: RTL8821CE 802.11ac PCIe Wireless Network Adapter        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:03:00.0        version: 00        width: 64 bits        clock: 33MHz        capabilities: cap_list        configuration: latency=0        resources: ioport:e000(size=256) memory:fcd00000-fcd0ffff  Cable network is sound, wireless is "No Wi-Fi Adapter Found". Suspicious bits are "*-network UNCLAIMED", and no driver under wireless configuration. Also there's no driver for ubuntu at realtek web page (). The laptop originally had Windows 10 on it, and wifi was working fine. The answer to  didn't help. Where can I get the driver for this, and how to configure the adapter to use it?

We just bought a Lenovo  (which is supposed to have the Intel 8265 for wireless). This laptop was bought in part because it is certified to run Ubuntu and as such to me at least it would make sense for things to work out of the box... but no such luck.  First, I installed Ubuntu 17.10 and after installation realised Wi-Fi was not working. I also tried Ubuntu 16.04 from a USB drive since that is the version of Ubuntu it is certified for, but no luck there either.  The wireless chip is not detected by lshw (or even lspci by the looks of it), ip link does not show a wireless interface, and the iwlwifi kernel module is not loaded at boot (I can load this myself using modprobe iwlwifi but this does not make Wi-Fi work). I think it is a combined Wi-Fi/Bluetooth chip, and Bluetooth does appear to work (or at least Bluetooth shows up in Gnome and rfkill list).  modinfo iwlwifi | grep 8265 shows me a file ending in -34 is supposedly loaded but only a file ending in -33 (and some other lower numbers) is present in /lib/firmware, if that helps).  I have also installed the Linux 4.14.9 kernel in an attempt to get things to work, but this did not resolve the issue either.  Further information  root@ThinkPad-E570:~# modinfo iwlwifi | grep 8265 firmware:       iwlwifi-8265-34.ucode root@ThinkPad-E570:~# rfkill list all 0: tpacpi_bluetooth_sw: Bluetooth     Soft blocked: no     Hard blocked: no 1: hci0: Bluetooth     Soft blocked: no     Hard blocked: no root@ThinkPad-E570:~# dmesg | grep iwl root@ThinkPad-E570:~# lspci -nnk | grep 0280 -A3 05:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:c821]     Subsystem: Lenovo Device [17aa:c024]   Update  I just noticed that the laptop does not have an Intel wireless chip at all, but in fact has a Realtek one... which means that the  of the shop I bought this laptop at were not accurate... Sigh. Same problem stands, however, just with a crappier wireless chip.


This is a bit of a security tinfoil-hat question:  Is there any sort of validation (checksum etc...) that our users are receiving the exact iOS apps we submit to Apple?  The thought experiment is: We are making a security iOS app.  Is it possible for Apple to change the apps we make to include backdoors, etc...  How can we validate that when our users download our apps, they are getting the same apps we made, devoid of any changes?  Regardless of the plausibility of this thought experiment, I'm just curious about the technology: Can we validate?

If I write an app for iOS and it's accepted by the AppStore, how do I know if the app is actually the app I compiled and has not being substituted/altered by, say, a "Man in the middle" style interception/attack? Is there a way to do a checksum either after the fact or from inside the app itself?


I have a search input, I want a clear button at the end of the input. A button is a separate element, tell me how to use CSS correctly to place this button vertically in the center. Here is an example of the markup itself  <form class="search">     <input type="search" class="search-input">     <button class="search-delete-button">         x     </button> </form>   I have this option:  .search {     position: relative; }  .search-delete-button {     position: absolute;     top: 50%;     right: 10px;     transform: translate(-50%, -50%); }   tell me how much is the solution right or is there a better option?

I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support.
Div to be aligned vertically
   How can I center a div vertically in all major browsers, including Internet Explorer 6?


I just read , but I do not have the options mentioned.     These are my options under Add Layer... Can't seem to find Add ArcGIS Map Server Layer. I'm running 2.18 on a Mac. There must be a difference between mac and pc versions? Is there a way to add ArcGIS Map Server Layer on a Mac??

Looking for info on how to add web mapping services from the Ohio Department of Natural Resources website to QGIS.  I've tried nearly a dozen different things online and still can't get results.  Don't normally ask for help in places like this, but decided to attempt this route for fear that it was impossible (permissions issues, etc.). Link to data I want to add is posted below:


Here is my LaTex code:   \documentclass{article} \usepackage{amsmath} \usepackage{color} \pagestyle{empty} \begin{document} \definecolor{blu}{RGB}{31,111,130} \definecolor{gren}{RGB}{39,110,13} \definecolor{gra}{RGB}{92,102,88}  \scriptsize{\textbf{{\color{blu} \noindent{\color{gren}Fyysinen} malli k\"{a}ytt\"{a}\"{a}\\ fysiikan lakeja jonkin\\ suureen ennustamisessa. }}}  \end{document}   Here is my result:    I don't want the first line to be indented...Why is this happening?  Thnx for any help! =)   P.S. This LaTex is generated by using IguanaTex Add-In for Microsoft Powerpoint 2010 =)

I would like to have my whole document showing a blank line (or space) between paragraphs and no indentation. I know how to do it line by line, but is there a way to change that with just one or a few lines at the beginning of the document? Like a package you can install, or a new command?


I was wondering if there was any way to remove a firmware password from a mid 2012 MacBook pro with USB or something. I just bought it off of Craigslist (sketchy i know but....) When it comes up all i get is a screen with blinking file with a "?" On it. And if i try and do recovery mode it goes to firmware lock, im wanting to get this unlocked and usable again but preferably without taking it halfway apart. Btw i have checked with Apple, unless i have the original proof of purchase (i don't), then they can't fix the issue for me. Any help is appreciated

I am considering setting a firmware password on my Retina MacBook Pro for security reasons. If I do this and later lose the password (or other such extenuating circumstances), how can the data be recovered? Is it even possible?


Where'd everything go? I'm just starting with Blender and I thought I was doing everything as in tutorial i watched yesterday, i mean there are like three steps, but clearly something's wrong.

I have added a sphere and I was able to add material and give it a color. Now when I add a second sphere (separate object), the material panel is just blank.


I’m in a situation where I have an ADSL connection over Ethernet and I can use an open Wi‑Fi access point of my neighbour, who has fiber.  I can connect to both networks at the same time, but because of the default gateway rules, all outgoing Internet connections are performed using only one adapter at time. The aim is not only to perform load balancing but to really merge the two bandwidths for a single data stream.  How to perform Multipath TCP for bandwidth on Windows® 10 ?   explicitly asks for a hardware solution, whereas I need a software one especially due to Wi‑Fi.

We have a broadband line coming into our building which delivers around 8-10Mbps, which is okay but not great. Fiber is available in our area (30-100Mbps) but it's not available where we are just yet.   Is there some way we could connect two lines (which we would take from two different providers so we would have redundancy if one failed) and merge them into one signal which we could distribute?  Is there some sort of setup that can do this?  Of course we have the option of a leased line but for 12Mbps symmetrical upload/download we'd be looking at around £500 per month compared to £15 per month for normal or fiber broadband.  I made a small pseudo flow chat of the setup below:


Do clocks still work when in item frames?

In Minecraft can you make a clock and then place it? I want to have it as an "Alarm clock" for my mansion.


On start-up I get the error:  The disk drive for /dev/mapper/cryptswap1 is not ready yet or not present   but then Ubuntu starts normally.  I recently installed Ubuntu 14.04 in dual boot with Windows 7 using a pendrive. I used rufus to burn the iso on the pendrive.  I was going to try what was written  but I checked the various files before actually running any commands or doing any edits and found a few differences. Also the file resume does not exist in /etc/initramfs-tools/conf.d.  I attached a screenshot of fstab, crypttab, gparted of sda and the contents of conf.d. (I have only one physical hard drive).  This is the gparted screen shot:   This is /etc/crypttab:   This is /etc/fstab:   This is /etc/initramfs-tools/conf.d folder:   How should I enable swap on an encrypted volume?

How can I produce an encrypted Swap Partition for 14.04 ? All the advices I saw here are for versions <14.04 and do not work for me.  I tried a lot but nothing lasted longer than a reboot.  On installation I decided to encrypt my home and 9 GiB partition for swap but this swap was never used by Kubuntu. Gparted finds an "unknown filesystem".  I many times formated it as swap, edited fstab and crypttab and used all the tricks mentioned in different answers here. The often mentioned PunyGeek letter does not work for me probably because /etc/initramfs-tools/conf.d/resume does not even exist on my system.


Caps Shield can withstand most projectiles and absorb quite a bit of force (Hulks fist, Thors Hammer to name two of the tougher ones). Wouldn't it make sense for Stark to use the same material for his suit?  If this was already answered somewhere, I am sorry, but I didn't find it...

In the movie Iron Man 2, Tony Stark figured out how to synthesize Vibranium. Why didn't he use it to make a new Iron Man armor?


Help me pls  if(value == ""){ // do anything }   but I need to check space " " (2,3,... space is include) is the same way of empty String  ps. sorry in my English

I saw , but I didn't see a JavaScript specific example. Is there a simple string.Empty available in JavaScript, or is it just a case of checking for ""?


Imagine trillions upon trillions of electrons are squeezed into a tiny region of space creating a blackhole, how do this charged blackhole emit electromagnetic field? Hawking radiation do not count and assume no materials are falling in.

By the "No Hair Theorem", three quantities "define" a black hole; Mass, Angular Momentum, and Charge. The first is easy enough to determine, look at the radius of the event horizon and you can use the Schwarzschild formula to compute the mass. Angular Momentum can be found using the cool little ergosphere Penrose "discovered". However, I don't know how to determine the charge of the black hole.   How can an electromagnetic field escape the event horizon of a Reissner-Nordström black hole? Is there any experiment we could theoretically do to a black hole to determine its charge?


I am new to Linux. I found people use ./ to execute programs, such as ./hello.sh. Why do Linux designers just let us type in hello.sh instead? In other words, why not set the current directory as default? Does anyone know? I appreciate it.

Why do we use ./filename to execute a file in linux?  Why not just enter it like other commands gcc, ls etc...


My step son is 5 years old and spends most of his time with his biological mom. We don't agree with a lot of the things she does but I have never though there was anything not good going on. However, a few weeks ago he was watching my hubby play a video game. He said he liked the girl characters boobs and that he wanted to put his wiener on them. More recently he told me that after his dad went to work he wanted me to pull my pants down and sit on his head. I feel like this is not normal for his age and I'm wondering if he is being exposed to something inappropriate at his mom's. Am I wrong? Is this normal for a 5 year old?

I am a 20 year old female student and I have a 5 year old son who is really sexually active. For instance, he kisses girls by force, he forces them to lick his penis, he "fingers" them, he speaks about sex openly with everyone except me, his father and my family.  There is a whole lot more that he does and the most frustrating part is that when teachers ask him where he saw those things, he says he learned it from me.  We do not even live together.  Currently I am in Cape Town doing my degree and he is in KZN with my mother.  Since he was 8 months old, he went to live with his father because I had to finish high school.  We never lived together. We have tried talking to him and it hasn't helped.  We've punished him but still he keeps on getting worse. What should I do?  I am really angry, embarrassed and confused. If I am not mistaken, this is his third year acting like this.


, I started a bounty to try to get the bug fixed. Answers were added, and one that I disagreed with and downvoted got the bounty. This is wrong. Don't award bounties to answers I've downvoted.

Sometimes you start a bounty and, since the problem is difficult and people try to reach the bounty, there is higher probability than usual that you get very low quality answers. Sometimes these answers even get some upvotes, thanks to a lot of people viewing it. When the problem is so difficult that no one solves it, the investor does not award the bounty and implicit bounty award takes place. It would be extremely humiliating for the investor to see that one of the bad answers is getting the bounty. Therefore I propose to add the following rule:     Do not implicitly award bounty to an answer that has been downvoted by the investor.   I agree this will not probably happen often, but I have actually seen bad answers taking two or more votes. And I think it doesn't make any sense to award an answer which is bad according to the investor, so I think this case is worth handling.  EDIT: I wouldn't mind because someone will gain rep. What bothers me is that answer which is apparently wrong (possibly have been too quick in the urge to win the bounty) will be marked as bounty winner and thus confuse the visitor, giving the feeling that this is a good solution and the question is answered and OP satisfied.. This would be sick! In case of the accept button you have it under control but this can become really weird especially for 200+ bounty.


Is a DVD or USB required to install regardless of download method? I've downloaded via torrent.  What is the next step?

I would like to see a full how-to guide on how to install Ubuntu.


When using multiple files in C++, for example: main.cpp, definition.cpp, declaration.h // declaration.h int Myfunc();  //definition.cpp #include "declaration.h"  int MyFunc() {return 5;};  // main.cpp #include <iostream> #include "declaration.h"  int main() {     std::cout << Myfunc() << std::endl; }  Why do I not need to include the definition file into the main file? How can the program know the definition of Myfunc() when I only have included the declaration?

Why does C++ have header files and .cpp files?


I've been having trouble with a debian system's file system going into read-only mode.  The short solution was to turn it off and back on again, but it keeps switching over to read only mode.  The debian machine is a VM on an ESXi hypervisor, and the volume is exported in /etc/exports so that other VMs can mount its subfolders in their own /etc/fstab configurations.    Client /etc/fstab configs:  # Remember NFS isn't secured over the network.. it probably wouldn't matter but is still considered non-secure storage-host-vm:/storage/drv_a/workpro_backups_samba  /mnt/workpro_backups_samba  nfs      rw,sync,hard,intr  0     0 storage-host-vm:/storage/drv_b/temporary     /mnt/temporary               nfs      rw,sync,hard,intr  0     0 storage-host-vm:/storage/drv_a/staff_pc_file_backups  /mnt/staff_pc_file_backups        nfs      rw,sync,hard,intr  0     0   I just ran fsck and it gave the below output  $ sudo fsck /storage/drv_a fsck from util-linux 2.20.1 e2fsck 1.42.5 (29-Jul-2012) /dev/sdd1 contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sdd1: 264980/134217728 files (0.2% non-contiguous), 18092864/536870655 blocks   So did I just fix the fluke problem?  Or should I be shopping out a new hdd and deciding a data migration strategy since the drive is dieing?  Or is the fact that I'm exporting  The hard drive is "on" a 2TB 5400RPM Green Western Digital.  I think it must have worked fine originally when it was first integrated into the system...  It's purpose was for storing clonezilla HDD images (I DON'T make those often for obvious reasons ;) and holds a bunch of ISOs.  It also has a git repo that is committed to nightly for a legacy machine's backup purposes.  The drive wasn't by any means 'high end', but I'm still a bit frustrated because I've only used about 2% of this drive's capacity so far and would expect slightly better performance.  Is there a way I can "shut down" all the sectors that I've written to so far since I've apparently used them up?  Or what kind of a failure is this?  Its in a very well vented chasis with limited vibration and interferance.    Here's some highlights from /var/log/messages  [105762.692329] EXT4-fs warning (device sdd1): ext4_clear_journal_err:4365: Filesystem error recorded from previous mount: IO failure [105762.692334] EXT4-fs warning (device sdd1): ext4_clear_journal_err:4366: Marking fs in need of filesystem check. [105762.695164] EXT4-fs (sdd1): warning: mounting fs with errors, running e2fsck is recommended [105762.793436] EXT4-fs (sdd1): recovery complete  [119886.884295] sd 0:0:3:0: [sdd] Unhandled error code [119886.884299] sd 0:0:3:0: [sdd]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK [119886.884304] sd 0:0:3:0: [sdd] CDB: Read(10): 28 00 72 8c 40 e0 00 00 90 00 [119886.884340] sd 0:0:3:0: [sdd] Unhandled sense code [119886.884342] sd 0:0:3:0: [sdd]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE [119886.884345] sd 0:0:3:0: [sdd]  Sense Key : Medium Error [current]  [119886.884349] sd 0:0:3:0: [sdd]  Add. Sense: Unrecovered read error - auto reallocate failed [119886.884354] sd 0:0:3:0: [sdd] CDB: Read(10): 28 00 72 8c 3f e0 00 01 00 00 [119890.019089] sd 0:0:3:0: [sdd] Unhandled sense code [119890.019096] sd 0:0:3:0: [sdd]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE [119890.019102] sd 0:0:3:0: [sdd]  Sense Key : Medium Error [current]  [119890.019108] sd 0:0:3:0: [sdd]  Add. Sense: Unrecovered read error - auto reallocate failed

I just rebooted my monitoring server for the first time in a while, and the following starting filling the screen:  Jul 11 23:52:30 monit kernel: [   25.255908] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 Jul 11 23:52:30 monit kernel: [   25.256170] ata1.00: BMDMA stat 0x24 Jul 11 23:52:30 monit kernel: [   25.256278] ata1.00: failed command: READ DMA Jul 11 23:52:30 monit kernel: [   25.256410] ata1.00: cmd c8/00:c0:20:68:35/00:00:00:00:00/e0 tag 0 dma 98304 in Jul 11 23:52:30 monit kernel: [   25.256416]          res 51/40:9f:41:68:35/00:00:00:00:00/e0 Emask 0x9 (media error) Jul 11 23:52:30 monit kernel: [   25.256809] ata1.00: status: { DRDY ERR } Jul 11 23:52:30 monit kernel: [   25.256933] ata1.00: error: { UNC } Jul 11 23:52:30 monit kernel: [   25.304388] ata1.00: configured for UDMA/66 Jul 11 23:52:30 monit kernel: [   25.304430] ata1: EH complete  . . .   Jul 11 23:52:30 monit kernel: [   25.552451] sd 0:0:0:0: [sda] Unhandled sense code Jul 11 23:52:30 monit kernel: [   25.552462] sd 0:0:0:0: [sda]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Jul 11 23:52:30 monit kernel: [   25.552475] sd 0:0:0:0: [sda]  Sense Key : Medium Error [current] [descriptor] Jul 11 23:52:30 monit kernel: [   25.552490] Descriptor sense data with sense descriptors (in hex): Jul 11 23:52:30 monit kernel: [   25.552498]         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00  Jul 11 23:52:30 monit kernel: [   25.552529]         00 35 68 41  Jul 11 23:52:30 monit kernel: [   25.552543] sd 0:0:0:0: [sda]  Add. Sense: Unrecovered read error - auto reallocate failed Jul 11 23:52:30 monit kernel: [   25.552559] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 35 68 20 00 00 c0 00 Jul 11 23:52:30 monit kernel: [   25.552587] end_request: I/O error, dev sda, sector 3500097 Jul 11 23:52:30 monit kernel: [   25.556607] ata1: EH complete   I already know I need to replace the HDD (Cost of Data > Cost of HDD), but I want to know for my own knowledge what's actually wrong with it.  Yes, our monitoring server has no RAID, just one HDD...  Don't look at me...


why does one give a different end result than the other in python. When I type in print(25/10) the result is 2.5. Yet when I type print(25//10) it is 2. Could anyone tell me why?

Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:  >>> 6/3 2 >>> 6//3 2


kali@kali:~$ sudo apt update Get:1 http://kali.download/kali kali-rolling InRelease [30.5 kB] Get:2 http://kali.download/kali kali-rolling/main amd64 Packages [16.6 MB] Err:2 http://kali.download/kali kali-rolling/main amd64 Packages                                                                                Hash Sum mismatch   Hashes of expected file:    - Filesize:16634563 [weak]    - SHA256:fbb326970ca4e9cdb4fef1aa9a8be44356dc8d9fdab37069e9a19e65ee3ae952    - SHA1:cea7b3e7681b2f1a8070ea788ad7779e5f178fb3 [weak]    - MD5Sum:e6fc65db75d4b81ea72b4f35e18d3b18 [weak]   Hashes of received file:    - SHA256:a2b234d6a45e017ca97ce9d720a0ca4f79fe6b4956692bef2864e75d845291bc    - SHA1:e7e682ffe978727c54f671b2424df435b48c26ca [weak]    - MD5Sum:e6fc65db75d4b81ea72b4f35e18d3b18 [weak]    - Filesize:16634563 [weak]   Last modification reported: Wed, 14 Oct 2020 12:07:19 +0000   Release file created at: Wed, 14 Oct 2020 12:08:13 +0000 Get:3 http://kali.download/kali kali-rolling/contrib amd64 Packages [100 kB]                                                                                Get:3 http://kali.download/kali kali-rolling/contrib amd64 Packages [100 kB]                                                                                Fetched 16.8 MB in 14s (1,219 kB/s)                                                                                Reading package lists... Done E: Failed to fetch http://kali.download/kali/dists/kali-rolling/main/binary-amd64/Packages.gz  Hash Sum mismatch    Hashes of expected file:     - Filesize:16634563 [weak]     - SHA256:fbb326970ca4e9cdb4fef1aa9a8be44356dc8d9fdab37069e9a19e65ee3ae952     - SHA1:cea7b3e7681b2f1a8070ea788ad7779e5f178fb3 [weak]     - MD5Sum:e6fc65db75d4b81ea72b4f35e18d3b18 [weak]    Hashes of received file:     - SHA256:a2b234d6a45e017ca97ce9d720a0ca4f79fe6b4956692bef2864e75d845291bc     - SHA1:e7e682ffe978727c54f671b2424df435b48c26ca [weak]     - MD5Sum:e6fc65db75d4b81ea72b4f35e18d3b18 [weak]     - Filesize:16634563 [weak]    Last modification reported: Wed, 14 Oct 2020 12:07:19 +0000    Release file created at: Wed, 14 Oct 2020 12:08:13 +0000 E: Some index files failed to download. They have been ignored, or old ones used instead.  The os is kali linux version 2020.3 . I just installed the operating system on virtualbox but when I use apt to install any package it doesn’t work and it gives me "Unable to locate packege". So I tried to use apt update but the result is the one above. can you help me to re-call apt?

I'm experiencing exactly the same issue as described in this question: . Before you mark this as a duplicate however, I have tried the solutions posted there, as well as on numerous other sites, including:  sudo apt-get clean sudo rm -rf /var/lib/apt/lists/* sudo apt-get update   Editing /etc/apt/sources.list with alternate official mirrors, such as  deb http://mirrors.ocf.berkeley.edu/kali kali-rolling main non-free contrib or deb https://http.kali.org/kali kali-rolling main non-free contrib  Everything worked after I first imported the VM. I ran sudo apt update and it found some ~650 packages to upgrade. I ran sudo apt upgrade and it encountered an error partway through. That error was solved using sudo apt --fix-broken install, but that is when this hash sum error began. Unfortunately due to hours of troubleshooting I no longer have the details of the earlier error, but I believe it was an error extracting a package due to corrupt data.  I've tried multiple official mirrors, but I get the same error. Additionally, when I downloaded the Packages.gz file  on my Windows machine (VM host) and computed the SHA256 hash, I got the exact hash that apt printed as the expected value. This led me to believe that the error was not with the mirror but with my VM.  The next thing I tried was wget https://mirrors.ocf.berkeley.edu/kali/dists/kali-rolling/main/binary-amd64/Packages.gz followed by sha256sum Packages.gz, which provided yet another different hash output.  To be clear, I have seen 3 different hashes for the same file:   The "correct" hash shown by apt as expected, which is the one that windows also produced after downloading the file using a browser The incorrect hash calculated by apt, which led to the error A different hash calculated by sha256sum after downloading the file using wget using the same URL as for the browser download   I should also note that I have only been referencing the SHA256 hash in each step. The other hash functions are also mismatched when I run sudo apt update, but the file size is the same. I had considered that downloads might be failing due to limited disk space (it is a VM after all) but I don't think that's the case.  What am I missing?


I am currently working on a Checkers game using Unity ( human vs computer ) I am done with the base architecture of the game ie defining the rules, moves, jumps etc.  I am currently stuck in implementation of MinMax for computer AI. I know how it works but I am confused on two things. Firstly, the heuristics ( I am using simple red checker count - black checker count ) but I am not sure if its correct. Secondly, outputting the final path of nodes for my AI to make its next turn.  Below is my MinMax implementation so far.  int MiniMax(TreeNode node)     {         int depth = 2;         List<TreeNode> pathNodes = new List<TreeNode>();         int final = MaxMove(node, depth, pathNodes);         return final;     }  int MaxMove(TreeNode currNode, int depth, List<TreeNode> pathNodes) {     if (depth == 0)     {         return currNode.getPriority();     }     else     {         depth--;         int v = -10000;         List<TreeNode> allPossRedMoveNodes = gameBoardScript.createNewRedBoardsFromCurrent(currNode.getCurrentBoard());         foreach (TreeNode RedNode in allPossRedMoveNodes)         {             int v1 = MinMove(RedNode, depth,pathNodes);             if(v1 > v)             {                                  v = v1;             }         }         return v;     } }  int MinMove(TreeNode currNode, int depth, List<TreeNode> pathNodes) {     if (depth == 0)     {         return currNode.getPriority();     }     else     {         depth--;         int v = 10000;         List<TreeNode> allPossBlackMoveNodes = gameBoardScript.createNewBlackBoardsFromCurrent(currNode.getCurrentBoard());           foreach (TreeNode BlackNode in allPossBlackMoveNodes)         {             int v1 = MaxMove(BlackNode, depth,pathNodes);             if (v1 < v)             {                 v = v1;             }         }         return v;     }           }   Max in this case would be Black Checkers ( Computer AI ) and Min is Red Checker, the human player  Let me briefly explain what I am trying to do with my code above. I have a TreeNode structure that stores the GameBoard, next possible move and also the Heuristic value  In My Max Move, I get all the possible Red Move Nodes from the current board. Logic for finding all possible moves is working absolutely fine. And for my Min Move which would be the human player, I get all its possible black nodes.  I am currently testing the code with depths 2 to 3 for my game tree. Please correct me if my current implementation is wrong. And finally how or where do I trace the final path of all my final Tree Nodes based on Min and Max values generated and get the next move for the Black Checker?

I am sorry...as there are too many articles about it.But I can't simple get this.  I am confused in the implementation of AI. I have generated all possible moves of computer's type pieces. Now I can't decide the flow. Whether I need to start a loop for the possible moves of each piece and assign score to it.... or something else is to be done.  Kindly tell me the proper flow/algorithm for this. Thanks    UPDATE:    Now I coded the algorithm but not getting correct moves. Please help me find out the logical error.


I have a acer aspire one 751 machince. which is runing on Intel Celeron 1.3GHz processor. it is old machine. I like to install Ubuntu 18.04 in this machince.   my machine details:   Processor: intel celeron M743 Graphics: Intel GMA  Memory: 2GB (planning to add another 2GB)  Motherboard: Intel GS45 Sound card: Intel 82801IB ICH9 HD Audio Controller Wifi: Intel WiFi Link 1000 BGN (b/g/n)  kindly let me know if i can install Ubuntu 18.04 LTS or not.   thanks in advance.   regards Sayeed

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


I am trying export all the overloaded functions of a js file. So that I can reuse them in other js files. But, whenever I am trying to call any function.then the highest parameterized function is getting called every time.  reusefun.js  exports.getMessage = function(val1) {    return val1; } exports.getMessage = function(val1,val2) {    return val1+ " " +val2; } exports.getMessage = function(val1,val2,val3) {    return val1+ " " +val2+ " " +val3; }   Suppose I am using this file like below  myfile.js  const re = require('./reusefun); console.log(re.getMessage("a"));   Then getMessage(val1,val2,val3) is getting called instead of getMessage(val1) .

What is the best way(s) to fake function overloading in Javascript?   I know it is not possible to overload functions in Javascript as in other languages.  If I needed a function with two uses foo(x) and foo(x,y,z) which is the best / preferred way:   Using different names in the first place Using optional arguments like y = y || 'default' Using number of arguments Checking types of arguments Or how?


Suppose there is a sequence $\{x_n\}_{n\in\Bbb N}$ s.t.    $$0\le x_{n+m} \le x_n\cdot x_m\quad\forall m,n\in\Bbb N$$   show that    $$\lim_{n\to\infty}\left(x_n\right)^{1/n}=\xi\in\Bbb R$$   Seeing the "$\forall n,m\in\Bbb N$", the first thing to pop into my mind is Cauchy's criterion for sequential convergence, but this approach has got me nowhere, because there seems to be nothing I can do to control $|(x_n)^{1/n}-(x_m)^{1/m}|$.  Another thing to be noticed is that in my text book this exercise belongs to the "infinite sum" category instead of "sequence", thus it is my notion that maybe there is a very tricky method to connect this sequence to a certain infinite sum and finish the proof? Any help or hint will be appreciated. Best regards!

Let $(x_n)_{n \ge 1}$ be a sequence of real numbers satisfying  $$x_{m+n} \le x_n+x_m$$  $m,n \ge 1$. Show that $\lim \limits_{n \to \infty} \dfrac{x_n}{n}$ exists and is equal to $\inf  \left \{\dfrac{x_n}{n}; n\ge 1 \right \}$.


I know there are many questions on physics stack exchange devoted to the question of quantum gravity and reconciling GR and QFT, but don't mark this as a duplicate because my question is a bit more specific.   In the PSE page  it was explained that the crucial problem in uniting general relativity and quantum mechanics comes when probing high-energy conditions at the Planck scale. However, this answer was not quite detailed enough for me, for I still do not fully understand why the theoretical frameworks clash at these conditions.  Can someone explain thoroughly (preferably conceptually and with minimal math) why general relativity and quantum mechanics implicitly do not work together to describe these high-energy interactions and a few examples of them.  I have a good conceptual understanding of both theories, but have little formal mathematical training.

(I found this related Phys.SE post: )  I want to know explicitly how it comes that Einstein-Hilbert action in 3+1 dimensions is not renormalizable  at two loops or more from a QFT point of view, i.e., by counting the power of perturbation terms. I tried to find notes on this, but yet not anything constructive. Could anybody give an explanation with some details, or a link to some paper or notes on it?


Problem:  Determine the number of positive integers such that:  $$\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big] = a$$  (where [x] is the greatest integer function)  Attempted solution:  The greatest integer function is essentially the floor function. The largest integer that is less than x.  In order for three numbers to sum up to an integer, they can:   all be integers one of them are integers and the remaining two add up to become an integer   If a is even, then  $$\Big[\frac{a}{2}\Big]$$  is also even and we could remove the floor function, since the result is an even integer. This is not possible of a is odd. Similar method can be used for the others, assuming they are divisible by 3 and divisible by 5.  I am not entirely sure how to continue. I thought about replacing a with $2n$ or $2n+1$ in the two different scenarios, but I am not sure that will work since it looks like it just reduces to $a = 0$.  There does not seem to be a general solution methodology for floor functions in the same way that there are for the absolute value function?  The number of positive integers turns out to be 30 according to Wolfram Alpha, which is suspiciously identical to $5*3*2 = 30$ This would perhaps indicate that one should put the left-hand side together on the same fraction, but I am not entirely clear how this is done with floor functions.


Is there some functional difference between using:  var Hello = function() {     this.a = 1;     this.b = 2; };  hello = new Hello(); hello.a; // 1 hello.b; // 2   and the most used way where you use:  function Hello() {   this.a = 1;   this.b = 2; }  hello = new Hello(); hello.a; // 1 hello.b; // 2   As far as I understand, the code inside function() is a constructor, and nothing more. Both have Hello.prototype created upon their definition, the only difference is hoising. Is there something I'm missing?  EDIT: In , one person pointed that using the function expression version, one.constructor.name will not be defined which I validated is true. Another person pointed that __proto__ of the newly created object in the function expression points to Object.prototype but I can't verify this in Chrome. Maybe it's true for earlier versions of IE etc.?

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other?


Find $E[X_1|X_1 + \cdots +X_n=x] $  This is pretty new concept for me so any help would be very helpful.

I don't really know how to start proving this question.  Let $\xi$ and $\eta$ be independent, identically distributed random variables with $E(|\xi|)$ finite.  Show that $E(\xi\mid\xi+\eta)=E(\eta\mid\xi+\eta)=\frac{\xi+\eta}{2}$  Does anyone here have any idea for starting this question?


Why doesn't all the current flow down the path with the weaker resistance instead of dividing and going through both resistors (in a parallel setup with 2 unequal resistors)?

Electricity takes the path of least resistance!   Is this statement correct?    If so, why is it the case?  If there are two paths available, and one, for example, has a resistor, why would the current run through the other path only, and not both?


I am making a distro. I have tried using. Cubic to customize the ISO. I go into settings, and the os name is Ubuntu 20.04, not primeOS. What do I do?

I want that applications like System Monitor and Conky display the name MYOS instead of Ubuntu 11.10.  Also, I want lsb_release -a and etc. to show MYOS only.


I was wondering if anyone can help me:  I need to turn the output of the system command : whoami into a variable.  Example:   char *a; a = system("whoami"); printf("username = %s",a);   I have tried a few methods such as printing the commands output to a text file like: whoami >> output.txt and than making the program read from that file, however i am encountering errors through that method. I also consider that method to be a little messy and unnecessary as im positive that there must be a way within C to let me do this.  This question may be a duplicate so please label as necessary(but also answer if capable)  Thanks a lot :)

I am looking for a way to get the output of a command when it is run from within a C++ program.  I have looked at using the system() function, but that will just execute a command. Here's an example of what I'm looking for:  std::string result = system("./some_command");   I need to run an arbitrary command and get its output. I've looked at , but I have not found anything that will give me what I need.


Why the central concepts of classical mechanics, viz. Lagrangian and Hamiltonian formalisms cannot address constraint forces like friction and others in dissipative systems?

I am trying to write the Lagrangian and Hamiltonian for the forced Harmonic oscillator before quantizing it to get to the quantum picture. For EOM $$m\ddot{q}+\beta\dot{q}+kq=f(t),$$ I write the Lagrangian  $$ L=\frac{1}{2}m\dot{q}^{2}-\frac{1}{2}kq^{2}+f(t)q$$ with Rayleigh dissipation function as   $$ D=\frac{1}{2}\beta\dot{q}^{2}$$ to put in Lagrangian EOM $$0 = \frac{\mathrm{d}}{\mathrm{d}t} \left ( \frac {\partial L}{\partial \dot{q}_j} \right ) - \frac {\partial L}{\partial q_j} + \frac {\partial D}{\partial \dot{q}_j}. $$  On Legendre transform of $L$, I get $$H=\frac{1}{2m}{p}^{2}+\frac{1}{2}kq^{2}-f(t)q.$$  How do I include the dissipative term to get the correct EOM from the Hamiltonian's EOM?


I've opened a downloaded file that does not have a properties panel where you can change materials etc. and I don't know how to reopen it. This is the panel I mean:

When I open a a Stock 3D model I downloaded, the entire interface changes. I see a "Default" layout option, but I don't see the stand "Layout" option at top of page. Is it possible that the model I have was created pre 2.8 & needs to be converted?  The model also does not have a Camera, & I can't see to find the "Add Camera" option that I see in basic tutorials.  I have attached screenshot of the UI as it appears with my stock model. Total Noob thanks you


I would like to know how to convert the following  simple alias to a desktop launcher:   cat ~/info1.txt

I would like to know how to write the Exec command of a .desktop file to open a new terminal and execute a shell script in it. The shell script is working and accessible by all users. When launching the script from the terminal everything works, but it doesn't when trying to launch the script from a .desktop file.  Here are some combinations I have already tried:  Exec=gnome-terminal -x sh -c 'echo hello' Exec=sh -c 'gnome-terminal echo hello' Exec=sh -c 'echo hello' Exec=echo hello   The .desktop terminal option is set to true.


I was just curious that is it okay to say/write "Listening Music" if we are not writing the whole sentence.   For example, if I have to write "Listening Music" under my Hobbies sections somewhere. Should I write "Listening to Music" or, "Listening music" will do?

Maximum time I face this problem by saying listening music. Is there any traditional cause behind this?  Can we use listen music or listening music?  Seems there is only a slight difference, but why is listen to music the right way to say it?


I have started to learn about WP. I was asking myself the other day : should I use, in my custom template, the wp_footer() to call my scripts or should I go with static script? I can't seem to understand how wp_footer works, tho I know it is a do_action but I actually don't want to change the "core" for wp_footer, I just want to add my own scripts in the footer.  Should I go to the function that call wp_head and add my scripts there or should I write it down in a static footer.php like   Thx!

I've already added my scripts, but I wanted to know the preferred way. I just put a <script> tag directly in the header.php of my template.  Is there a preferred method of inserting external or custom js files? How would I bind a js file to a single page? (I have the home page in mind)


How many associative rings(with unity) of order 35 are there upto isomorphism? I think the answer is one. This is because there is just one abelian group of order 35. Is my reasoning right. Note that I have read  but it did not serve my purpose as no proof was given there. Thanks beforehand

Let $R$ be a ring of order $n$ and suppose $n$ has no square in its prime decomposition. How do I see that $R$ is isomorphic to $\Bbb Z/n\Bbb Z$?   I bet that the map $\Bbb Z  \to R, \, 1\mapsto 1_R$ descends to an iso $\Bbb Z/n\Bbb Z \to R$ but I don't see how $n$ having no squares implies the desired descent.


Since this is a uniform distribution, can we just use symmetry for this, and say that our four numbers will be spaced apart, so they will be on the number line at the following locations: $\frac{1}{5}$, $\frac{2}{5}$, $\frac{3}{5}$, $\frac{4}{5}$ Therefore, the smallest number is expected to be $\frac{1}{5}$.

$X_1, X_2, \ldots, X_n$ are $n$ i.i.d. uniform random variables. Let $Y = \min(X_1, X_2,\ldots, X_n)$. Then, what's the expectation of $Y$(i.e., $E(Y)$)?  I have conducted some simulations by Matlab, and the results show that $E(Y)$ may equal to $\frac{1}{n+1}$. Can anyone give a rigorous proof or some hints? Thanks!


A friend of mine give me this problem for fun:  Given $\frac {n(n+1)}{2}$ balls, first we divide arbitrarily these balls in baskets, after that we make another basket with one ball of each basket e do this procedure infinitely.  I want to prove that one time this stabilizes with 1 ball in one basket, 2 balls in another basket, ..., n balls in another basket.  It seems easy to solve, he says we can use some concept of energy (???), I'm trying with some concepts of combinatorics without any success.  Thanks in advance.

Let we have $n\cdot(n+1)/2$ stones grouped by piles. We can pick up 1 stone from each pile and put them as a new pile. Show that after doing it some times we will get the following piles: $1, 2, \ldots n$ stones.  Example: $n = 3$  Let we have 2 piles with 3 stones of each.  $$3 3 \to 2 2 2 \to 1 1 1 3 \to  2 4 \to 1 3 2$$


Considering that the following statements return 4, what is the difference between the int and long types in C++?  sizeof(int) sizeof(long)

Correct me if I am wrong,  int is 4 bytes, with a range of values from -2,147,483,648 to 2,147,483,647 (2^31) long is 4 bytes, with a range of values from -2,147,483,648 to 2,147,483,647 (2^31)  What is the difference in C++?  Can they be used interchangeably?


I'm trying to calcule the distance and travel time between origins and destinations using the distance matrix API.  I used the following code :    public class read_csv_file {  public static ArrayList<String> getTownList(String fileName) {     try {         ArrayList<String> towns = new ArrayList<String>();         File csvFile = new File(fileName);         BufferedReader br = new BufferedReader(new FileReader(csvFile));         String line = "";         while ((line = br.readLine()) != null) {             String[] arr = line.split(",");             towns.add(arr[0]);         }         return towns;     } catch (IOException ex) {         ex.printStackTrace();         System.out.println("Failed: could not find file.");     }     return null; } public static String getTown(ArrayList<String> towns) {     int townsLen = towns.size();     int rand = (int) (Math.random() * townsLen + 1);     return towns.get(rand); } public static long getDriveDist(String origins, String destination) throws ApiException, InterruptedException, IOException {     GeoApiContext distCalcer = new GeoApiContext.Builder()             .apiKey("key")             .build();     DistanceMatrixApiRequest req = DistanceMatrixApi.newRequest(distCalcer);     DistanceMatrix result = req.origins(origins)             .destinations(destination)             .mode(TravelMode.DRIVING)             .avoid(DirectionsApi.RouteRestriction.TOLLS)             .language("en-US")             .await();    long dist = result.rows[0].elements[0].distance.inMeters;   return dist; } public static void main(String[] args) throws ApiException, InterruptedException, IOException {      ArrayList<String> towns = getTownList("src/main/java/test_three.csv");      if (towns != null) {         // get 2 specific towns from the file         // remove the first from ArrayList before getting the second         String town1 = getTown(towns);         towns.remove(towns.indexOf(town1));         String town2 = getTown(towns);          long dist = getDriveDist(town1, town2);          // totalMinutes is based on walking at a speed of 10.6 minutes per km         long totalMinutes = (long) (((dist / 1000) * 10.6));          // calculate the days, hours and minutes from total minutes         int days = (int) (totalMinutes / 24 / 60);         int hours = (int) (totalMinutes / 60 % 24 );         int minutes = (int) (totalMinutes / 60);          // print         System.out.println("It will take" + days + "days" + hours + "hours and" + minutes + "minutesto walk from"                 + town1 + "to"                 + town2 + ".");      } else {         System.out.println("Failed: null ArrayList for towns");     }    }}   But that throws :   Exception in thread "main" java.lang.NullPointerException at line  "long dist = result.rows[0].elements[0].distance.inMeters;")   Example of My csv file :   Rochdale,Greater Manchester,North West Lowestoft,Suffolk,South East Kingston-upon-Thames,Greater London,London Horley,Surrey,South East   I did some research and I found that the reason for this is that I am trying to access a table cell that does not exist for example tab [4] while the size of the table is 4 ,but I don't see here where the problem comes from. If you have any idea ,help me   Thank you.

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


I need to generate a PDF/A format with TexStudio, is it possible ? Should I use other ide to do that ?

I have heard about PDF  PDF/A (for archival) and PDF/X (for printing). How to generate LaTeX documents like that?  I'm also interested in answers with plain TeX and ConTeXt, and hopefully with both pdfTeX and XeTeX engines.


How would you find out how long a running process took to complete?   Example:    date; dd bs=1m if=/foo of=bar; date   ^This example only has 1 second of resolution.   Any shell is acceptable.

(The linux equivalent of TimeThis.exe)  Something like:  timethis wget foo.com Receiving foo.com   ...  wget foo.com took 3 seconds.


I work at a company that's still using mysqli connection. I know that PDO is better and we should be using that but changing to that would require a lot of work that we don't have time for. Our goal is to switch the company website to Laravel sometime in the future.  I know the mysqli class also has a prepare function but it doesn't really fit into the class we made to work with mysqli.  Until then, is mysql going to convert $_POST string variables into INT or DECIMAL types or do I need to use real_escape_string on ALL variables in the sql string regardless of whether or not it's being saved to a string or INT column.  Addon question: Is real_escape_string going to protect me from injections?  Example code:  $sql = "     INSERT INTO table     (          column     )     VALUE     (          " . $mysqli_connection->real_escape_string($_POST['number']) . "     )"; $mysqli_connection->query($sql);

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


it seems ubuntu doesn't support hybrid technology for graphics card. Is there any solution to install AMD/Intel and active AMD graphics card?

On Ubuntu 12.04 my Sony Vaio VPCSE with Intel® HD Graphics 3000 and AMD Radeon™ HD 6630M worked fine with the Catalyst Control Center version 12.6. Also the switching between integrated and discrete graphic card was working.  In both cases, I followed this .  But it is not working on Ubuntu 12.10.   I tested the tutorial with the Catalyst Control Center from the Ubuntu Software Center, the version 12.8 and version 12.9. Always the same problem: After installation process I am able to boot in the login-screen. But after entering the password for my username, only the background-image appears. Unity seems not to be starting. I am only able to reach the context-menu by right clicking the mouse button.  I also tried , but is also does not work for me.  Any ideas what to do to fix this problem?   Update: Same problem on Ubuntu 13.04!  Update: Solution for 13.04 ist not working on Ubuntu 13.10!


In electromagnetic induction, what force is actually doing the work? what physical force actually drives the electrons around the circuit?  Let's say we have a coil and an increasing magnetic field through the loop. The electrons start to flow by faraday's law. Is there a very real electric field that is induced around the wire which does the work? because magnetic fields can most certainly not do work.  Also, why do the charges even start moving in the first place? At each instant in time, there is some instantaneous value for the magnetic field. The magnetic field cannot cause the electrons to start moving because it doesn't affect stationary charges

I've got a few questions on induction and electromagnetic fields. My current understanding of induction and electromagnetic fields is that, when electricity/current flows through a wire, it creates an electromagnetic field. If you twist that wire into a coil then you can concentrate that field. You can then induce current into a different coil by placing it inside of the electromagnetic field created by the first coil.  So here are my questions:  Q1. Does the electromagnetic field contain any energy?  EDITED QUESTION  Q2. Electromagnetic fields are the same as waves, so does that mean that when current is induced, they get the energy from electromagnetic waves being exchanged, or do they induce current directly from the electromagnetic field?   Q3. If electromagnetic fields and waves are the same, then doesn't that mean that you can induce current from waves? Therefore transferring electricity over long distances?  Q4. What spectrum of light are the electromagnetic waves that are in a field created by electricity?  Q5. Finally, why is it not possible to induce current from the Earth's magnetic field? I thought Maxwell said that electric fields and magnetic fields were the same thing.   Thank you to anyone who answers.  Edited Q2: So my original question (although asked poorly) still stands. Where does the current that gets induced in the secondary coil come from? How does the electricity transfer from the primary coil to the secondary? For example, is it taken from the stored energy in the e.m field? Does the field just act as a bridge between the 2 coils? Or do the 2 coils exchange e.m waves which carry the electricity that is being transferred from coil 1 to coil 2? Or is it none of these things and something completely different?


Assume $a$, $b$, and $c$ are positive integers such that $(a+b+c)$ divides $abc$.  Show that $a+b+c$ is composite  I have that so far,  If $a+b+c$ is prime, then letting $a = xd$, $b = yd$, and $c = zd$ we have that $d(x+y+z)$ is prime. This means that $d = 1$ and thus $a,b,c$ are relatively prime. Therefore, $\dfrac{xyz}{x+y+z}$ is supposed to be an integer. What next?

I have seen another post for this same question but it never got an answer. Since I am fairly new, I can't comment on other's posts, therefore I am creating a new one. The question states:  If a, b, and c are positive integers, prove that if $(a + b + c) | (a*b*c)$, then $a+b+c$ is composite.  I do not really know how to approach this.  The link to the post with the same question is:


I am working on an imbalanced binary classification and wondering in what step I should find the best optimal threshold cut-off point. When I tried classifying the dataset with the normal probability threshold, I couldn't see any true positives(failures) but when I lowered the probability threshold, the model started showing me some true positives.  What I am really confused about finding the optimal threshold cut-off is in what step I should find the optimal threshold cut-off point. The following questions I have in mind:   Do I need to find the optimal threshold cut-off point before the model development? Do I use cross-validation for it? Do I need separated procedures for finding the optimal threshold cut-off point from model developments? So I run two procedures, one for the optimal probability threshold and the other for the model development.   I hope to hear some advice or answers.

I have a question regarding classification in general. Let $f$ be a classifier, which outputs a set of probabilities given some data D. Normally, one would say: well, if $P(c|D) > 0.5$, we will assign a class 1, otherwise 0 (let this be a binary classification).   My question is, what if I find out, that if I classify the class as 1 also when the probabilities are larger than, for instance 0.2, and the classifier performs better. Is it legitimate to then use this new threshold when doing classification?  I would interpret the necessity for lower classification bound in the context of the data emitting a smaller signal; yet still significant for the classification problem.  I realize this is one way to do it. However, if this is not correct thinking of reducing the threshold, what would be some data transformations, which emphasize individual features in a similar manner, so that the threshold can remain at 0.5?


Let $T:V→V$ be a linear map over a finite dimensional vector space V with $dim$ $V=n$.  Prove that if every linear operator which commutes with $T$ is a polynomial in $T$, then T has a cyclic vector $v$ in $V$.  Let $S$ = the set of all polynomials in $T$. Then $S=C(T)$ as every polynomial in $T$ commutes with $T$ and we are told the converse is also true.  Suppose we do not have a cyclic vector $v$ i.e the set $A$ = {$v,Tv,...,T^{n−1}v$} is not a basis for V. Then $A$ is either linearly dependent, or it does not span $V$.  Suppose A is linearly dependent but it spans V. Then we can get rid of one element in A and have a spanning set of size $< n$ which is impossible.  Suppose A is linearly independent and it does not span $V$. This is impossible as $dim$ $V =n$.  Suppose $A$ is linearly dependent and does not span V. Now in order to arrive at a contradiction, I need to somehow construct a linear operator which commutes with $A$ and is not a polynomial in $T$.  Any help would be great.  Edit: The question really has not been answered in the other link. The answer only refers to a different website in which the text is incredibly difficult to read. Having another answer on stackexchange in clear text would make it much more accessible for the average reader.

Let $V$ be a finite dimensional vector space over $F$. Let $T:V \to V$ be a linear operator. Prove that if every linear operator $U$ which commutes with $T$ is a polynomial of $T$, than $T$ has a $T$-cyclic vector.  I don't really know where to start... can someone please point me in the right direction?


Here's a problem I've been banging my head against for months: Every night at a specific time (probably not significant, but it's 23:03 CET) the Guest account on my Windows 2008 R2 server gets reenabled by the SYSTEM user.  The server is running Windows 2008 R2 Standard SP1 (64bit). Its primary function is that it runs SQL Server 2012. It's recently had a large number of malware infections (Bitcoins miners mostly, but also attacks using EternalBlue that triggered reboots on the server for unclear purposes, so the scope isn't entirely clear). Through Windows updates, manual cleaning, nailing down firewall settings and running some anti-malware tools I've been able to get these off the system and prevent them from reappearing, but the Guest account problem persists. I'm fairly certain they're related, as previously the malware used to appear at the same time through the same mechanic, and the Guest account seemed to have a part in all of it.   Every night this shows up in the Event Log (under Microsoft-Windows-WMI-Activity/Operational):  ActiveScriptEventConsumer provider started with result code 0x0. HostProcess = wmiprvse.exe; ProcessID = 188; ProviderPath = %SystemRoot%\system32\wbem\scrcons.exe   And a few seconds later (under the Security log):  A user account was enabled.  Subject:     Security ID:        SYSTEM     Account Name:       MYSERVERNAME$     Account Domain:     MYADDOMAINNAME     Logon ID:       0x3e7  Target Account:     Security ID:        MYSERVERNAME\Guest     Account Name:       Guest     Account Domain:     MYSERVERNAME   What I know:   The effective Guest account policy on the server (determined by using rsop.msc), Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options\Guest account status, is set to Disabled. scrcons.exe then launches cmd.exe, which in turn launches powershell which executes some code (in a file-less manner) the end result of which is the Guest account gets enabled. I've determined this (or at least think I have) by using Process Monitor. How, through various methods, to limit and mitigate the effects of all this.   What I don't know:   Why this is happening. I have no idea what is actually triggering WMI to do all this, and that's what I need to find out. There's something malicious left on my server, be it a backdoor or whatever, and I don't know how to find it. This is the part I'm looking for help with (while trying to remain aware that my focus might be completely wrong and I could be barking up the wrong tree).    Obviously, the safest and simplest option would be to just wipe the server and reinstall Windows. Equally obviously, at least to me, the safest option would be to use a more modern version of Windows than 2008 R2. However, this is a production server and the reality of the situation is that these options are unviable in the short term (in the long term, the entire solution the server is part of is to be phased out, but right now it's absolutely business critical). And either way I feel highly uncomfortable not knowing what's hitting me.  I should also mention that my downtime windows for this server are extremely limited, and the average reboot time for the server is obscenely long. Troubleshooting that involves rebooting is not impossible, but highly impractical.  EDIT: With regards to this being labeled a duplicate, I understand on a conceptual level that wiping the server is an advisable option, and I agree, but I still think the question of how to find what the WMI provider server is doing is worth looking at. It has implications beyond this specific server, and probably beyond just forensics.

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


How can TeX (whether it is in its own terms or in those of LaTeX2e) be told to typeset the text spread out vertically and evenly inside a parbox or a minipage that has been defined with a given vertical size through the optional arguments of the parbox command or the minipage environment?   Please, consider that I'm talking about running text that is to be divided into vertical boxes (lines) automatically by TeX, as opposed to being broken into different lines manually by the author (in the latter case, I already know I could issue \vfill commands).   Pointing to a package that does this would be acceptable as an answer.  I  believe this question does not require an MWE, but if so required I'd provide one.

I'm having some difficulty on how to use the "stretch" optional argument of \parbox. Is it supposed to equally interspace lines of text inside a box of determined size?  If I code it like:   \documentclass{article} \begin{document}   Text   \fbox{\parbox[c][15cm][s]{5cm}{I want to stretch this text inside this box}} \end{document}   This is the outcome I get:   I also experimented with \parbox and got some unexpected outcomes. In the following code, I merely deleted the alignment optional argument (default is center) from the previous test:  \documentclass{article} \begin{document} Text \fbox{\parbox[15cm][s]{5cm}{I want to stretch this text inside this box}} \end{document}   As a result, this came out:   Which confused me, because I thought deleting the first optional argument would simply put it in default. I also didn't get why the text from the mandatory argument was substituted by the letter "s", a shortcut for "stretch" in the third optional argument.  Another test:   \documentclass{article} \begin{document} Text \fbox{\parbox[15cm]{5cm}{I want to stretch this text inside this box}} \end{document}   Which yielded me:   In this last one, I deleted the stretch optional argument, but the height of the box was not drawn.  Why did I get those results? I'm barely a starter at TeX, so might me missing obvious points on the use of optional arguments.


I'm using robot world for an assignment. we have to get to robot to go north 8 places then east 6 places. when we get to the point the robot has a choice to make. if there is an even number of beepers in that see the robot should face north and move one cell. if there is an odd number of beepers then it should face south and move one. I don't know what command to give the robot in the source code. my program runs when i just have              if(beeperPresent)) {     turnLeft();     move(); } else {     turnRight();     move(); }

How can I check if a given number is even or odd in C?


The scenario: I have a problem Z that I’m tasked with solving by my boss. However, before I can complete Z, I must first finish tasks Y and X. However, X depends on tasks W, V, U, and T. And so on, ad infinitum.  There is a term in either the field of computer science or just in English in general that describes this situation and I, for the life of me, cannot remember it. Any help?

Example sentence - This problem is a _____ which gets complicated every time you try to solve it.   Is there such a word that represents a problem which will become worse if/when one tries to solve it?  Note - After seeing the comments and answers I'd like to add that this is not a can of worms or Pandora's box because it doesn't create a new problem but just worsens.   Example: Magic leaves protecting a fruit by enclosing it. Every time a leaf is touched, all the leaves close together further, that is more tight than before.


I once discovered a word with a fascinating description but have forgotten it.  The word refers to nouns that at one time meant something very specific, but would now be ambiguous and needs an accompanying word to specify further. The best example is 'guitar'. Once, the word unequivocally referred to an acoustic guitar, but would now need 'acoustic' added, lest it be confused with electric guitar, bass guitar, etc.

Usually a new term emerges and it becomes necessary to add a qualification to an old word for disambiguation.  examples:  "mono sound" versus "stereo sound" "analog watch" versus "digital watch" "acoustic guitar" versus "electric guitar" "slow food" versus "fast food"


Why are we teaching an outdated theory when the math in general relativity isn't that hard? I really don't see a reason why we should teach a highly oversimplified theory in our schools. For me, it's like teaching that atoms are small balls that cannot be divided any further.

Did Einstein completely prove Newton wrong? If so, why we apply Newtonian mechanics even today? Because Newton said that time is absolute and Einstein suggested it ?   So, if fundamentals are conflicting, how can both of them be true at a time?


I have a dict like the following: d = {"string0": 0, "string2": 2, "string1": 1}  I want to sort this by int values so that it would like: d = {"string0": 0, "string1": 1, "string2": 2}  I know that I can sort lists with the help of built-in function sorted() specifying key argument with lambda function like the following: sorted_d = {k: v for k, v in sorted(d.items(), key=lambda i: i[1])}          But for some reason it seems to not work, the dict remains as original.

I have a dictionary of values read from two fields in a database: a string field and a numeric field. The string field is unique, so that is the key of the dictionary.  I can sort on the keys, but how can I sort based on the values?  Note: I have read Stack Overflow question here  and probably could change my code to have a list of dictionaries, but since I do not really need a list of dictionaries I wanted to know if there is a simpler solution to sort either in ascending or descending order.


This is based on a design I found somewhere , I just wanted to know whether this is a good idea ,I intend to use this to power a microcontroller  and a 70 ohm 5 V relay . The cap c1 limits the current to about 200 mA , well below the 500 mA rating of my zener diode  . Without the zener diode , it looks like there would be about 7 volts across r1 which the zener should regulate . Ripples might be a problem though but I don't think it should affect switching that much , I'll also add a flyback diode to this .  Also , I get it that no insulation is a bad idea in general but I need this to be cheap and small .  If anyone has got any better idea , I'll be happy to hear  .  edit: C1 should be 3 uF

Is there any IC which converts 230V AC to 5V DC? As lossless as possible. I want to connect my microcontroller to an ordinary electrical socket and I don't have enough space available. Thanks.


I was trying to link the Stack Exchange data together from the  as my college database subject project, but I can't understand how to link the Post and its answer. I tried to link using postlinks relation, but it didn't work that way...  Any kind of help is appreciated.

Stack Exchange releases "data dumps" of all its publicly available content roughly every three months , and also makes that information queryable over the Internet at the  (SEDE) (updated weekly, on Sunday). Over time, as new features and other bits of data are introduced to Stack Exchange sites, the "anatomy" of the data dump is likely to change.


within workdir I have many filles with the names in the following format: 7000_grid12_10_lig_cne_767_lig.dlg  I need one line sed (or other shell utility) expression suitable to substitute _grid12_ to _ , so the filename become 7000_10_lig_cne_767_lig.dlg  I've tried to use rename for all filles but it did not work (verbose found nothing) rename -v 's/_grid12_/_/' *.dlg

How can I recursively replace a string in all folders and files' name with a different string? I am running Red Hat 6 and I can find them with:  find . -name \*string\*   I've managed to do it for strings within files:  find . -type f -exec sed -i 's/string1/string2/g' {} +   but how could I replace in a similar way all file names?


Laser fires single particles of light, called photons, through the slits. Even though only single photons of light are being fired through the slits and They create three pattern again. How single particles of light can create this wave pattern?

In a double-slit experiment, interference patterns are shown when light passes through the slits and illuminate the screen. So the question is, if one shoots a single photon, does the screen show interference pattern? Or does the screen show only one location that the single photon particle is at?


I am using the function below to QUERY an IMPORTRANGE range based on IS NOT NULL conditions:  =query(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1O5DeZ9LFLpGbp8b2aGst57XLEP7ZiOnc-2b552sQLz0","Referrals!A1:AB1080"),"SELECT Col2, Col3, Col4, Col6, Col8, Col22, COL28 WHERE COL28 is not null")   I get:     #VALUE! Unable to parse query string for Function QUERY parameter 2: NO_COLUMN" COL28   I cannot find where I went wrong with the code.  COL28 is Col AB in the IMPORTRANGE sheet.  Could someone please assist?

This is the problem I'm seeing:      Error - Unable to parse query string for function QUERY parameter 2: NO_COLUMND     The formula is of the form:  =query(importange("...", "Sheet!A:V"), "select D where V = 1", 1)   I imported data from another sheet, I want this current sheet to display column D when Column V is 1.  Is there a different way rather than my current formula?


There are many apps which says you can root in single click, like framaroot, one click root, kingo root. I'm not sure whether everythings works, but, YouTube videos claim that. How these apps root a phone with just a single click? If a app can root a phone with a click, it can also do that without the knowledge of a user. So, How do these apps work?

A couple years ago, it was easy to root any device: Install KingRoot, KingoRoot, or a similar app, hit the large ROOT button, and let it do the rest. After 5 minutes or so, a green "Root Succeeded!" prompt will pop up, and we can choose to keep the root app, or uninstall it and install a clean root manager app like SuperSU/Superuser.  How do they work? Why aren't they working anymore? And if they work, should I use them or not?


My linux laptop has changed into command mode and I want it back to GUI mode. I tried pressing Alt+Ctrl+ (F2 to F10) but nothing happened. Also it does not have a sudo command. Please help me to solve this problem. Its a 64 bit machine and Ubuntu 18. 04 LTS It shows a black screen with a text:  BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3) built in shell (ash) (intramfs) _   I have tried every possible commands but it's not going back to the normal GUI.. It shows the following on the screen:  [1056.234913] print_req_error: I/O error, dev sda, sector 981375008 fsck exited with status code 4  The root file system on /dev/sda3 requires manual fsck UBUNTU: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY

I dual boot Ubuntu and Windows 7. I was browsing on FireFox in Ubuntu and all of a sudden I get some error message, so I rebooted.  Now when I try to boot into Ubuntu I get this message:  fsck from util-linux 2.26.2 /dev/sda6 contains a file system with errors, check forced. /dev/sda6: Inodes that were part of a corrupted orphan linked list found.  /dev/sda6: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.         (i.e., without -a or -p options) fsck exited with status code 4 The root filesystem on /dev/sda6 requires a manual fsck  Busybox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built in shell (ash) Enter 'help' for a list of built-in commands.  (initramfs) _   How can I fix this?


In order to parse some args via cmd line, I've a "switch case" written with if .. elif  if arg == 1:     ..something... elif arg >= 2 and arg < 4:     ..something else ... elif arg < 6:     ..something else ... else:     ..something else ...   above, elif arg < 6: could be replaced by:    elif arg == 4 or arg == 5:  this get's a bit messy when there are more argument values to check.  What could be the most efficient and easy way to read the code?

I want to write a function in Python that returns different fixed values based on the value of an input index.    In other languages I would use a switch or case statement, but Python does not appear to have a switch statement.  What are the recommended Python solutions in this scenario?


I want that a server sends an object to a client, then the client answer the server with another message and so on.  I have following code but I get exception message. I think I did not understand the logic of sending and receiving object over socket.  Server code:  public class Server implements Runnable {  int MAX_NUM_CLIENT = 5; int clientNum = 0; boolean isStart = false; // if ranking algorithm starts it is true Socket csocket; Server(Socket csocket) {     this.csocket = csocket; } BufferedReader reader = new BufferedReader(new InputStreamReader         (getClass().getClassLoader().getResourceAsStream("questions.txt"))); ArrayList<String> questions = new ArrayList<String>();   public static void main(String args[])          throws Exception {     ServerSocket ssock = new ServerSocket(9654);     System.out.println("Listening");      //wait connection     while (true) {         Socket sock = ssock.accept();         System.out.println("Connected");         new Thread(new Server(sock)).start();     }  }  public void run() {      try {          if(questions.isEmpty()){             String line = null;             while((line = reader.readLine()) != null){                 questions.add(line);             }         }          ObjectOutputStream objectOutput = new ObjectOutputStream(csocket.getOutputStream());         ObjectInputStream objectInput = new ObjectInputStream(csocket.getInputStream());          //InetAddress host = InetAddress.getLocalHost();                      objectOutput.writeObject(questions);          P0Computation comp = new P0Computation();  //some calculations         P0Sending send1 = comp.P1Calculation1(); //some calculations          objectOutput.writeObject(send1);          int [] pjans = new int[2];         pjans[0] = objectInput.readInt(); // read client's answer         pjans[1] = objectInput.readInt(); // read client's answer                    objectOutput.writeInt(comp.P0Calculation2(pjans));          csocket.close();     }     catch (IOException e) {         System.err.println("Client left...");;     } }   }  Client code:  public class Client {  public static void main(String args[]) throws UnknownHostException, IOException, ClassNotFoundException {     Socket ssocket = null;     ssocket = new Socket("192.7.1.6", 9654);      ObjectOutputStream objectOutput = new ObjectOutputStream(ssocket.getOutputStream());     ObjectInputStream objectInput = new ObjectInputStream(ssocket.getInputStream());      ArrayList<String> questions = (ArrayList<String>) objectInput.readObject();     P0Sending p0ans = (P0Sending) objectInput.readObject();      PjComputation comp = new PjComputation();      objectOutput.writeInt(comp.PjComputation1(p0ans.QX, p0ans.c, p0ans.g)[0]);     objectOutput.writeInt(comp.PjComputation1(p0ans.QX, p0ans.c, p0ans.g)[1]);      int beta = objectInput.readInt();    }   }  Here is exception message:  Exception in thread "main" java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.io.ObjectInputStream$PeekInputStream.read(Unknown Source) at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source) at java.io.ObjectInputStream.readStreamHeader(Unknown Source) at java.io.ObjectInputStream.<init>(Unknown Source) at Client.main(Client.java:16)

I am getting the following error trying to read from a socket. I'm doing a readInt() on that InputStream, and I am getting this error. Perusing the documentation this suggests that the client part of the connection closed the connection. In this scenario, I am the server.  I have access to the client log files and it is not closing the connection, and in fact its log files suggest I am closing the connection. So does anybody have an idea why this is happening? What else to check for? Does this arise when there are local resources that are perhaps reaching thresholds?    I do note that I have the following line:  socket.setSoTimeout(10000);   just prior to the readInt(). There is a reason for this (long story), but just curious, are there circumstances under which this might lead to the indicated error? I have the server running in my IDE, and I happened to leave my IDE stuck on a breakpoint, and I then noticed the exact same errors begin appearing in my own logs in my IDE.  Anyway, just mentioning it, hopefully not a red herring. :-(


I am looking for the simplest solution to have a div positioned sticky and always rendered at the bottom of the viewport. I don't want to use position: fixed because the element will be out of the document flow and when I have more content on the page it will hide part of it without triggering overflow. Sticky on the other hand is problematic when I have too little content on the page then it renders immediately after that content and not all the way on the bottom of the viewport. Is there a simple way to make sticky always be on the bottom of the viewport by using only HTML/CSS?

I have the following page (deadlink: http://www.workingstorage.com/Sample.htm ) that has a footer which I can't make sit at the bottom of the page. I want the footer to  stick to the window bottom when the page is short and the screen is not filled, and stay at the document end and move down as normal when there is more than a screenful of content (instead of overlapping the content).  The CSS is inherited and befuddles me. I can't seem to change it properly to put a minimum height on the content or make the footer go to the bottom.


I want to install a drum type ceiling fan to the dining room ceiling of a new condominium I just bought. The drum type fan with a light weighs 24 lbs, as per the Home Depot website. How can I tell if the junction box will support this fan?   I would like not to have the electrician come twice i.e, first to look at the installation and then again, to install or maybe just tell me the fan unit is too heavy for the junction box.  The management cannot seem to tell me what the box will support.Thanks

My new home is almost done being built, and one of the extras I asked for was for two of the rooms to have junction boxes in the ceiling suitable for hanging a ceiling fan in the future.  The light fixtures haven't been installed yet so I can see inside the junction boxes but can't really distinguish between the braced boxes and the regular boxes.  The attic is extremely limited access so I want to avoid crawling around up there to look for a brace.  Is there a quick or easy way to distinguish between a junction box that is able to carry the weight of a ceiling fan safely versus one that is not?  I could just take their word for it but they haven't had a very reliable track record so far when it comes to following through with my requests even when they tell me they will do it.


I had a look in many different answers, but none of them solve my problem.  I'm writing a python script to run an external software (written in fortran and compiled) that thakes itself some arguments.  This is the structure of the folder:  a.out (-> the compiled and running software) zbtest.lst zbtest.bud zbtest.nam   In a normal shell session, when running ./a.out the program starts and ask me in sequence the zbtest.lst, zbtest.bud, zbtest.nam files.  Now, how can I concatenate the command that runs the compiled software and give in sequence the file asked?  Once in the correct directory and after reading many answers, I tried with:  import subprocess subprocess.Popen('./a.out ; zbtest.lst ; zbtest.bud ; zbtest.nam', shell = True)   but it seems that only the first argument is taken (./a.out). The prompt of the software runs well, but it keeps asking me the 3 files listed.  I have no idea how to do that..   Thanks!

If I do the following:  import subprocess from cStringIO import StringIO subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=StringIO('one\ntwo\nthree\nfour\nfive\nsix\n')).communicate()[0]   I get:  Traceback (most recent call last):   File "<stdin>", line 1, in ?   File "/build/toolchain/mac32/python-2.4.3/lib/python2.4/subprocess.py", line 533, in __init__     (p2cread, p2cwrite,   File "/build/toolchain/mac32/python-2.4.3/lib/python2.4/subprocess.py", line 830, in _get_handles     p2cread = stdin.fileno() AttributeError: 'cStringIO.StringI' object has no attribute 'fileno'   Apparently a cStringIO.StringIO object doesn't quack close enough to a file duck to suit subprocess.Popen.  How do I work around this?


I need to prove that if i multiply 2 diagonal matrixes i get a diagonal matrix. I understand the logic behind it but find it difficult to prove on paper.  I started with saying that a diagonal matrix Aij = 0 when i != j. Then I declared 2 diagonal matrixes A,B of size n*n.         n           i - 1           n   (AB)ij = Σ (Aik * Bkj) = Σ (Aik * Bkj) + Σ (Aik * Bkj)       k = 1         k = 1         k=j+1   so the first part equals zero because Aik will be 0 becasuse k is bigger than i. im stuck on the second part, how to show that the second part is also equal to 0, meaning what ranges to use on the sums.   thanks

Let $A [a_{i,j}]$  and $B =[b_{ij}]$   be two diagonal matrices in   $M_n(F)$. Let $i \ne j \in \left\{1, \ldots, n \right\}$. Using the   product rule, we obtain      $$(AB)_{ij} = \sum_{k=1}^{n} a_{ik}b_{kj}$$      We claim that $a_{ik}b_{kj} =0$ for all $k \in \left\{1, \ldots, n \right\}$ thus $(AB)_{ij}=0$ for all $i \ne j$ and $AB$ is diagonal. To    prove the claim, note that since $i \ne j$ , we have $i \ne k$ or $    k\ne j$. Thus either $a_{ik} = 0$ (since $A$ is diagonal) or $b_{kj} =  0$ (since $B$ is diagonal), thus in all cases $a_{ik}b_{kj}=0$ and the   claim is proved.   Where does the bit "we have $i \ne k$ or $k\ne j$" come from? I understand that since $i \ne j$, and $k$ and $j$ run over the same set of natural numbers, we also have $i \ne k$. But the "or $k \ne j$" baffles me. I understand that $k \ne j$ implies that we can have $i=k$. But that's from the other direction ($\Longleftarrow).$  Also, when it says $a_{ik}=0$ or $b_{kj}=0$ it's talking about when $i \ne k$ or $k \ne j$ right? Many thanks.


Is it possible to close browsers, using JavaScript, PHP, or HTML without a prompt?  I was using this answer:   I was using Internet Explorer but it has since been updated to version 10 (soon to be updated to 11) and this exploit does not work.  If there is a solution in a different (but updated) browser, that could work as well.

How can I close a browser window without receiving the Do you want to close this window prompt?  The prompt occurs when I use the window.close(); function.


How can I draw (and paint) Voronoi regions of a series of points in plane using Tikz? How about if the points are in 3d space?