Search Results

Search found 6 results on 1 pages for 'sokun'.

Page 1/1 | 1 

  • A problem with Bash script

    - by c.sokun
    I want to write a simple script to detect a file created by Windows virus, usually it create an .exe file with the same name as the directory it drop. Here is the script it only work if the path name doesn't contain \n. Can someone help me fix this script please! #!/bin/bash if [ $# == 0 ]; then echo "" echo "==== Give me a directory to begin with! ====" echo "" exit fi for f in `find $1 -name '*.exe'` | do filename=`basename "$f" .exe` dir_name=`dirname "$f"` current_dir_name=`basename "$dir_name"` if [ $filename == $current_dir_name ]; then rm -f "$f" # It can't remove file where path contain space or \n ??!! fi done

    Read the article

  • How do I know my laptop is 64 bit compatible?

    - by c.sokun
    I recently plan to buy a new laptop to run 64 bit OS, but I friend told me that my current laptop is 64 bit but I am not sure how do I verify if my laptop is ready to load 64 bit OS? Here is the result from cpuz edit: come say something at less if you want to vote this down :)

    Read the article

  • read file in C++

    - by Amm Sokun
    I am trying to read a list of words from a file in C++. However, the last word is read twice. I cannot understand why it is so. Can someone help me out? int main () { ifstream fin, finn; vector<string> vin; vector<string> typo; string word; fin.open("F:\\coursework\\pz\\gattaca\\breathanalyzer\\file.in"); if (!fin.is_open()) cout<<"Not open\n"; while (fin) { fin >> word; cout<<word<<endl; vin.push_back(word); } fin.close(); }

    Read the article

  • How do I know my laptop is 64 bit compatible?

    - by c.sokun
    I recently plan to buy a new laptop to run 64 bit OS, but I friend told me that my current laptop is 64 bit but I am not sure how do I verify if my laptop is ready to load 64 bit OS? Here is the result from cpuz edit: come say something at less if you want to vote this down :)

    Read the article

  • return first non repeating character in a string

    - by Amm Sokun
    I had to solve this question in which given a string, i had to return the first non repeating character present in the string. I solved it using hashtable and wrote a method which takes a constant reference to the string and returns the first non repeating character. However, when there is no non repeating character present in the string, i return -1 and in the main program i check as follows char c = firstNonRepeating( word ); if (static_cast<int> (c) == -1) cout<<"no non repeating character present\n"; else cout<<c<<endl; is that the correct way to return -1 when required character is not present?

    Read the article

1