Search Results

Search found 43 results on 2 pages for 'masi'.

Page 2/2 | < Previous Page | 1 2 

  • To instantiate BiMap Of google-collections in Java

    - by Masi
    How can you instantiate a Bimap of Google-collections? I know the thread. A sample of my code import com.google.common.collect.BiMap; public class UserSettings { private Map<String, Integer> wordToWordID; UserSettings() { this.wordToWordID = new BiMap<String. Integer>(); I get cannot instantiate the type BiMap<String, Integer>.

    Read the article

  • How extensible is Google Moderator?

    - by Masi
    I am trying to integrate vote-up-buttons similar as in Reddit to Google Moderator. However, Google Moderator does not give me Shell access. This suggests me that the only way is to use Vote-up-buttons from an external server set by iframes. I would like to know How can you can assign Iframe_A to a question in Google Moderator? How can you can show an iframe in Google moderator?

    Read the article

  • To have efficient many-to-many relation in Java

    - by Masi
    How can you make the efficient many-to-many -relation from fileID to Words and from word to fileIDs without database -tools like Postgres in Java? I have the following classes. The relation from fileID to words is cheap, but not the reverse, since I need three for -loops for it. My solution is not apparently efficient. Other options may be to create an extra class that have word as an ID with the ArrayList of fileIDs. Reply to JacobM's answer The relevant part of MyFile's constructors is: /** * Synopsis of data in wordToWordConutInFile.txt: * fileID|wordID|wordCount * * Synopsis of the data in the file wordToWordID.txt: * word|wordID **/ /** * Getting words by getting first wordIDs from wordToWordCountInFile.txt and then words in wordToWordID.txt. */ InputStream in2 = new FileInputStream("/home/dev/wordToWordCountInFile.txt"); BufferedReader fi2 = new BufferedReader(new InputStreamReader(in2)); ArrayList<Integer> wordIDs = new ArrayList<Integer>(); String line = null; while ((line = fi2.readLine()) != null) { if ((new Integer(line.split("|")[0]) == currentFileID)) { wordIDs.add(new Integer(line.split("|")[6])); } } in2.close(); // Getting now the words by wordIDs. InputStream in3 = new FileInputStream("/home/dev/wordToWordID.txt"); BufferedReader fi3 = new BufferedReader(new InputStreamReader(in3)); line = null; while ((line = fi3.readLine()) != null) { for (Integer wordID : wordIDs) { if (wordID == (new Integer(line.split("|")[1]))) { this.words.add(new Word(new String(line.split("|")[0]), fileID)); break; } } } in3.close(); this.words.addAll(words); The constructor of Word is at the paste.

    Read the article

  • Which quotes does a programmer need?

    - by Masi
    My keyboard only has normal quotes, not the smart ones. I have obversed that I need normal ones in cgi development and the backward ones in AWK/SED. Is there any rule when I should use smart quotes, normal ones and backward ones? Obviously, I need to edit my keyboard layout to get the smart quotes.

    Read the article

  • Is Sphinx better than LaTex in writing manuals/books?

    - by Masi
    Only a few people recommended to use Sphinx at the beginning of the year. Sphinx has developed rather fast recently. I noted today that Sage has made a change from direct editing with LaTex to Sphinx. This is evident in William Stein's answer on 2nd April about Sage's tutorial The tutorial is not a latex document anymore. It's an entirely different Sphinx document that can output pdf. It suggests me that Sphinx may be at a level such that it is suitable for me. Is Sphinx better than LaTex in writing manuals/books?

    Read the article

  • Replacing the end of the line by SED in makefile

    - by Masi
    How can you append to the end of a line by SED controlled by makefile? I run paste -d" " t.tex tE.tex | sed 's@$@XXX@' > tM.tex where the problem is in the use of the mark $ for the end of the line. I get #paste -d" " t.tex tE.tex | sed -e s/" "/\\\&/g | sed -r "s/XXX/" > tM.tex sed: -e expression #1, char 10: unterminated `s' command make: *** [all] Error 1 I have the command just after the "all:" tag in my makefile which contains only the two lines. The parameters -n and -e do not help here. The command works as expected run when it is run directly in terminal.

    Read the article

  • Understanding PHP's way of reading if statements

    - by Masi
    How does PHP read if statements? I have the following if statements in this order if ( $number_of_figures_in_email < 6) { -- cut: gives false } if($number_of_emails > 0) { -- cut: gives false } if ( $number_of_emails == 0) { -- cut: gives true } The code behaves randomly. It sometimes goes to the third if clause and gives me a success, while sometimes to the one of the first two if clauses when the input variables are constant. This suggests me that I cannot code only with if statements.

    Read the article

  • Where is Prolog used for traffic control systems?

    - by Masi
    The user Laurent had an interesting reply to the question [Why hasn’t logic programming caught on?]: If you look at the influence logic-programming has had in the field of -- air traffic control -- I don't think it can be said logic-programming has not caught on. A question arises: Where is prolog used for traffic control systems on the roads? Why is it used instead of languages, such as C or Python, in such environments?

    Read the article

  • How to remove MySQL database?

    - by Masi
    You may notice from my last question that a problem caused some more problems here. My database is now unusable partly due to my interest to break things and my inability to look at error messages. I know that I should not reuse primary keys, but I would like to use them again after the removal of the database that I deteriorated. So How can you correctly remove MySQL database?

    Read the article

  • Crontab -e gives me error messages

    - by DNA
    I get a bunch of error messages when I run crontab -e Here are the error messages. And here is my crontab file under `/usr/bin/': # /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) 30 * * * * root rsync /home/dnaneet/Downloads/*.pdf /home/dnaneet/Downloads/pdfs/ # I notice that the last task ('rsync') NEVER RUNS! Why is this happening? What did I do wrong? Running Ubuntu 11.10/Bash. I have read this... Am I missing a shebang? And I don't know if my anacron jobs run. Edit 1 In light of Masi's comment, I commented out lines 17 thru 25 of my crontab file with #. Now when I run sudo crontab -e, all I get is: /usr/bin/crontab: 11: 17: not found /usr/bin/crontab: 12: 25: not found (gedit:4301): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.GOHVBW': No such file or directory (gedit:4301): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory What in the world?

    Read the article

< Previous Page | 1 2