-
Posts
1903 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by fiveworlds
-
Python code to extract specific lines in a textfile
fiveworlds replied to Jo27's topic in Computer Science
I haven't installed python because I have a few versions. From what I can see from the ops example he/she wants lines that are separated by a number of lines not the lines without numbers.But I can see where you are going to just regex out the numbers. This does depend on the lines he/she wants because they can't contain numbers like that. fixedStep chrom=chr3 start=56424 step=1 0.000 0.001 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.007 fixedStep chrom=chr3 start=56425 step=1 Ie each line is after a fixed number of lines. My code retrieves the first line s[0]=fixedStep chrom=chr3 start=56424 step=1 the last line s[11]=fixedStep chrom=chr3 start=56425 step=1 I didn't want to either he\she still needs to output the data to a new file. -
Python code to extract specific lines in a textfile
fiveworlds replied to Jo27's topic in Computer Science
like this? #!/pubserver/python27/python print "Content-type: text/html" print print "<html><head>" print "</head><body>" print "This was written in Python." txt = open("test.txt", "r") s=txt.readlines() print s[0],s[11]; file.close() print "</body></html>" -
Here's the thing. You don't have any product yet. Massive corporations like Sony, Google, Microsoft and Philips would love to have a nerve gear. They have been researching VR tech for decades. They make MRI machines and electroencephalograms but they still haven't made a nerve gear. What they do have is things like the occulus rift ,google glass or samsung gear vr. What I do know is that we know very little about the human brain. That doing something wrong with the brain can lead to death or serious degenerative disabilities,
-
It was about 600 mb free when I first turned it on. But then it updated google play etc. Then it installed google play games. Yeah but when I ran it. It said I had the latest version but it is dated back in early 2014.
-
Who is we? Is this a new company or are you a corporation/ already established business? Ok assuming this is a new business you have two options. 1. You pay somebody to host you 2, You host yourself In order to sell something you need a product and it has to be a good one nowadays with amazon etc you can buy anything online. You can't sell a product that doesn't look good or has potential faults, It also has to be easily mass producible. Anybody can make a logo. Making Virtual Reality World of Warcraft would be more difficult.
-
Pressure of course. Some materials are too soft and will give under too much pressure. Not just metals but plastics and bones etc. Water as well under high pressure can cut.
-
Android 4.4.2 Firmware Version v2.0 Model v100 The option isn't there
-
I did but I couldn't find anything. It allows me to move the apps onto the sd card once they have already been installed and they can run from there. However google play installs the app to internal memory first.
-
I recently got a present of an android tablet from my big brother for my birthday. The tablet came with an inbuilt sd-card which had 5GB of free space. However the tablet itself only has about 300mb of free space. Now when I try downloading apps it fails because there isn't any free space on the tablet. Is there any way to change the default install location of apps to the sd card??
-
No I am not. That's the finished code. You could add support for russian numbers etc if you want <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <?php function unichr($i){return iconv('UCS-4LE', 'UTF-8', pack('V', $i));} function add($string,$delimeter1,$delimeter2){ if(isset($string)&&("{$string}"!="")){ if((isset($delimeter1)&&("{$delimeter1}"!=""))&&(isset($delimeter2)&&("{$delimeter2}"!=""))) { $string=preg_replace("/\\\\n/", "\n", $string); $delimeter1=preg_replace("/\\\\n/", "\n", $delimeter1); $delimeter2=preg_replace("/\\\\n/", "\n", $delimeter2); if((!(preg_match("/^[0-9]+$/", $delimeter1)))&&(!(preg_match("/^[0-9]+$/", $delimeter1)))){ if (strpos($string,"\\\\[{$delimeter1}][{$delimeter2}]\n") !== false) { $string=str_replace("\\\\[{$delimeter1}][{$delimeter2}]\n","",$string); $string=str_replace("{$delimeter2}","{$delimeter1}",$string); if (str_replace("{$delimeter1}\n","{$delimeter}", $string)!="{$string}") { $syntax=" --> syntax error"; } $string=explode($delimeter1,$string); $answer=0; $negatives=""; $codeunits = array(); for ($i = 0; $i<0xD800; $i++)$codeunits[] = unichr($i); for ($i = 0xE000; $i<0xFFFF; $i++)$codeunits[] = unichr($i); $letters = implode($codeunits); $numbers = array("0","1","2","3","4","5","6","7","8","9","-"); $letters = str_replace($numbers,"",$numbers); foreach($string as $value){ if(str_replace($letters, "", $value)<1000){ if(str_replace($letters, "", $value)<0) { $negatives=$negatives.$value; $value=str_replace($letters, "", $value)*-1; }; $answer=$answer+str_replace($letters, "", $value); } else{} } echo $answer; if($negatives!=""){echo " ---> Error Negative Number Array ".$negatives;} if(isset($syntax)){echo $syntax;} } else{echo "invalid string syntax";} } else{echo "Invalid Delimeter Syntax, Delimeter cannot only contain numbers";} } elseif(isset($delimeter1)&&("{$delimeter1}"!="")) { $string=preg_replace("/\\\\n/", "\n", $string); $delimeter1=preg_replace("/\\\\n/", "\n", $delimeter1); if((!(preg_match("/^[0-9]+$/", $delimeter1)))){ if (strpos($string,"\\\\[{$delimeter1}]\n") !== false) { $string=str_replace("\\\\[{$delimeter1}]\n","",$string); if (str_replace("{$delimeter1}\n","{$delimeter}", $string)!="{$string}") { $syntax=" --> syntax error"; } $string=explode($delimeter1,$string); $negatives=""; $answer=0; for ($i = 0; $i<0xD800; $i++)$codeunits[] = unichr($i); for ($i = 0xE000; $i<0xFFFF; $i++)$codeunits[] = unichr($i); $letters = implode($codeunits); $numbers = array("0","1","2","3","4","5","6","7","8","9","-"); $letters = str_replace($numbers,"",$numbers); foreach($string as $value){ if(str_replace($letters, "", $value)<1000){ if(str_replace($letters, "", $value)<0) { $negatives=$negatives.$value.","; $value=str_replace($letters, "", $value)*-1; }; $answer=$answer+str_replace($letters, "", $value); } else {} } echo $answer; if($negatives!=""){echo " ---> Error Negative Number Array ".$negatives;} if(isset($syntax)){echo $syntax;} } else{echo "Invalid Delimeter Syntax, Delimeter cannot only contain numbers";} } } elseif($string!="") { $string=preg_replace("/\\\\n/", "\n", $string); $delimeter1=","; $string=str_replace("\\\\[{$delimeter1}]\n","",$string); if (str_replace("{$delimeter1}\n","{$delimeter}", $string)!="{$string}") { $syntax=" --> syntax error"; } $string=explode($delimeter1,$string); $negatives=""; $answer=0; for ($i = 0; $i<0xD800; $i++)$codeunits[] = unichr($i); for ($i = 0xE000; $i<0xFFFF; $i++)$codeunits[] = unichr($i); $letters = implode($codeunits); $numbers = array("0","1","2","3","4","5","6","7","8","9","-"); $letters = str_replace($numbers,"",$numbers); foreach($string as $value){ if(str_replace($letters, "", $value)<1000){ if(str_replace($letters, "", $value)<0) { $negatives=$negatives.$value.","; $value=str_replace($letters, "", $value)*-1; }; $answer=$answer+str_replace($letters, "", $value); } else {} } echo $answer; if($negatives!=""){echo " ---> Error Negative Number Array ".$negatives;} if(isset($syntax)){echo $syntax;} } else{echo "0";} } else{echo "0";} } if(isset($_REQUEST['delimeter1'])&&("{$_REQUEST['delimeter1']}"!="")&&isset($_REQUEST['delimeter2'])&&("{$_REQUEST['delimeter2']}"!="")) { add($_REQUEST['string'],$_REQUEST['delimeter1'],$_REQUEST['delimeter2']); } elseif(isset($_REQUEST['delimeter1'])&&("{$_REQUEST['delimeter1']}"!="")) { add($_REQUEST['string'],$_REQUEST['delimeter1']); } elseif(isset($_REQUEST['string'])){ add($_REQUEST['string']); } ?> <form> String<input type="text" name="string"></br> Delimeter1<input type="text" name="delimeter1"></br> Delimeter2<input type="text" name="delimeter2"></br> <input type="submit"> </form>
-
How difficult or easy is it to work as a Computer Science
fiveworlds replied to James3221's topic in Computer Science
Just use apache. Alternatively if you use windows 7 + you can use microsoft iis -
Gravitation constant G can vary 0.1% in 6 years
fiveworlds replied to acsinuk's topic in Astronomy and Cosmology
None they could be anyone.I suppose it depends on who they were. If it were barack obama I might read it -
You don't need the ground. In England using the ground is mandatory but it isn't in other countries. 27 *2 =54
-
Is the TV show Law and Order: SVU really morally acceptable todays world?
fiveworlds replied to nec209's topic in The Lounge
But pedophilia isn't always caught. Catholic priests here who cannot marry sexually assaulted loads of children and it wasn't noticed until recently. It would be hard to believe somebody well respected in the community would be capable of such attrocities. Also note south park had an episode about pedophilia in the catholic church. -
Or if you married somebody of different religious denomination
-
Thats the thing it was a strange outlook message which added him to my people contacts but gave me no contact info other than an address
-
The only thing I know is an old man born in 1944 with my family name contacted me last year claiming to have known my grandfather. From Wiggan Uk but I haven't heard anything from him since.
-
The problem with that is my family like many at the time found work as farm labourers. The landlords would pick people up at hiring fairs and they would work and be buried where the landlord lived. It was while my greatgrandfather was working for one such landlord that the house was burned down by the IRA and the landlord was shot. My family would have lived in the servants quarters of the landlord's house. Of course they would have used to have land of their own because my great grandfather fought in ww1 but the english took his land off him because he married an english woman.
-
I don't have a family tree. We had a copy of our family tree in my grandad's time and the house they were living in burned down. The public records office holding information about my family was destroyed during a battle on 30th June 1922
-
Gravitation constant G can vary 0.1% in 6 years
fiveworlds replied to acsinuk's topic in Astronomy and Cosmology
Had to find it his name is Rupert Sheldrake this is the video -
Gravitation constant G can vary 0.1% in 6 years
fiveworlds replied to acsinuk's topic in Astronomy and Cosmology
I actually saw the lecture on facebook. He takes the absolute piss because he has a load of old physics books and preety much everything has changed over time. He also said that the speed of light has dropped by 20 metres per second. -
Anyway here is a simple script to accept 0>3 command line arguments in c++. Which will just output what you type in command prompt ConsoleApplication1.exe dga a b #include "stdafx.h" #include <iostream> int main(int argc, char *argv[]) { using std::cout; using std::endl; if (argc > 1) { std::cout << argv[1] << std::endl;; } if (argc > 2) { std::cout << argv[2] << std::endl;; } if (argc > 3) { std::cout << argv[3] << std::endl;; } }
-
You can learn off microsoft http://www.microsoftvirtualacademy.com/
-
You should also know the difference between builds. For istance x86 is for windows 32 bit, x64 is for windows 64 bit
-
Then learn c++ you will probably be using either visual studio or codeblocks Conditional and iterative statements. --> if statements and for loops Data types --> int, string, array, multidimensional array etc String functions---> anything to do with manipulating strings Sorting and Searching --> sorting arrays or strings for example in alphabetical/numerical order Basic file applications--> can you read and write to a file Pointer http://www.cplusplus.com/doc/tutorial/pointers/ Stack http://www.cplusplus.com/reference/stack/stack/ Queue, http://www.cplusplus.com/reference/queue/queue/ Linked list http://www.cplusplus.com/reference/list/list/ Also make sure your built exe can run command line arguments. Know the difference between release version and debugged versions. Know where visual studio saves your projects by default. Be able to run your exe without error. Know what a windows environment variable is.