Search Results

Search found 815 results on 33 pages for 'hell awaits'.

Page 4/33 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Using `.index()` on repeating letters

    - by Yarden
    I'm building a function that builds a dictionary with words, such as: {'b': ['b', 'bi', 'bir', 'birt', 'birth', 'birthd', 'birthda', 'birthday'], 'bi': ['bi', 'bir', 'birt', 'birth', 'birthd', 'birthda', 'birthday'], 'birt': ['birt', 'birth', 'birthd', 'birthda', 'birthday'], 'birthda': ['birthda', 'birthday'], 'birthday': ['birthday'], 'birth': ['birth', 'birthd', 'birthda', 'birthday'], 'birthd': ['birthd', 'birthda', 'birthday'], 'bir': ['bir', 'birt', 'birth', 'birthd', 'birthda', 'birthday']} This is what it looks like: def add_prefixs(word, prefix_dict): lst=[] for letter in word: n=word.index(letter) if n==0: lst.append(word[0]) else: lst.append(word[0:n]) lst.append(word) lst.remove(lst[0]) for elem in lst: b=lst.index(elem) prefix_dict[elem]=lst[b:] return prefix_dict It works great for words like "birthday", but when I have a letter that repeats itself, I have a problem... for example, "hello". {'h': ['h', 'he', 'he', 'hell', 'hello'], 'hell': ['hell', 'hello'], 'hello': ['hello'], 'he': ['he', 'he', 'hell', 'hello']} I know it's because of the index (python chooses the index of the first time the letter appears) but I do not know how to solve it. Yes, this is my homework and I'm really trying to learn from you guys :)

    Read the article

  • Eclipse Hell . . . Failed to read the project description file (.project)

    - by Kobojunkie
    I think Eclipse is trying to make me miserable. A couple of hours ago, my project was working and compiling well. Suddenly that all changed. Eclipse somehow wipes out all changes I have made to my files(activity, manifest etc.) I make sure to save often but when I go to run the project, I get the error that I have a build error. I checked and there was none, so I go to close Eclipse, so I can reopen and see if the errors will go away. Instead what happens is Eclipse wipes clean all my files and I end up with a project on disk with lots of blank code files. I try to run anyway, and I get the error message below. Failed to read the project description file (.project) for 'com.example.android.nfc.simulator.FakeTagsActivity.FakeTagsActivity'. The file has been changed on disk, and it now contains invalid information. The project will not function properly until the description file is restored to a valid state. Anyone have an idea what in the world this is about and how I can rectify this?

    Read the article

  • How to correctly add daemon in MacOS 10.6.6 via launchd?

    - by Eye of Hell
    Hello. I have a very simple task to accomplish: to start tomcat application server on latest MacOS as a daemon. I have performed following steps: Installed Tomcat in /Library/Tomcat/Home Validated that it runs fine by executed /Library/Tomcat/Home/bin/startup.sh Added org.apache.tomcat.plist file to /Library/LaunchDaemons as found on internet (http://blog.i18n.ro/complete-guide-for-installing-hudson-ci-on-os-x-10-6/) Instructed MacOS to load a daemon description via sudo launchctl load org.apache.tomcat.plist. It succeeded (issuing this command second time outputs "already loaded"). Instructed MacOS to start a daeon via sudo launchctl start org.apache.tomcat.plist At this point MacOS shows an error "launchctl start error: No such process". I have checked the logfile for launchd - it have no record for this error. Google says nothing. And from error text i can't figure out what is the "process" and why it is "wrong" :(. Any hints what i'm doing wrong?

    Read the article

  • innodb recovery from .ibd files

    - by mr heLL
    My website has crashed a few days ago. The hosting company says some innodb database crashed. They sent a MySql data folder. I tried to restore the database, but phpmyadmin is only showing MyISAM tables. I checked the database with navicat. When I click innodb table, I got this error table 'xyz.wp_posts' doesn't exist. is there anyway to fix this on windows? Feel free to download db: www.degisimanaliz.com/xyzdb.tar.gz Very old backup: www.degisimanaliz.com/29_Ocak_Yedek_deganaliz.sql.gz

    Read the article

  • What is the simplest possible configuration of Apache2 mod_proxy?

    - by Eye of Hell
    Hello. I have an apache2 running and i have a service available as http://www.domain.com:8080/sitename What will be a simplest apache2 configuration so entering "http://www.domain.com" in browser will show "http://www.domain.com:8080/sitename"? I have added: <VirtualHost *:80> ProxyPass / http://www.domain.com:8080/sitename/ ProxyPassReverse / http://www.domain.com:8080/sitename/ </VirtualHost> But, of course, this is not workig. Is it some simple configuration i can use for such redirect or i'm doomed to copy-paste a 100+ line configs from tutorials?

    Read the article

  • How to check sshd log?

    - by Eye of Hell
    Hello. I have Ubuntu 9.10 installed with sshd and i can successfully connect to it using login and password. I have configured an RSA key login and now have "Server refused our key" as expected. Ok, now i want to check sshd log in order to fingure out a problem. I have examined /etc/ssh/sshd_config and it have SyslogFacility AUTH LogLevel INFO Ok. I'm looking at /var/log/auth.log and... it's empty O_O. Changing Loglevel to VERBOSE helps nothing - auth.log is still empty. Any hints how i can check sshd log?

    Read the article

  • Weird problem with connection from putty to ubuntu server via SSH

    - by Eye of Hell
    Hello. I have an Ubuntu Server 9.10 box with sshd configured. I have two computers with Windows 7 professional and putty installed. Day ago, both computers was able to connect ubuntu server both via putty and plink. I have installed sun-java6-jre on ubuntu server, and now have a weird problem. First Windows 7 computer can still connect with both putty GUI and command-line plink. Second computer can connect via putty gui, but if i issue plink command that works perfectly on first computer: plink www.hostname.tk -i c:\users\username\documents\key\private.ppk I get login prompt, enter same username as on first computer, and receive following weird error message: bash: www.hostname.tk: command not found I can't see any difference between my Windows 7 computers :(. The ppk key used is same (i copied it multiple times both ways). hostname and username are same. Anyone have any ideas why such thing happens and what can i do in order to troubleshoot and fix it?

    Read the article

  • Parsing Strings ( .crt files )

    - by user1661521
    Base Knowledge : I have a .crt file ( certification authoritie file ) and he is composed of many fields but in one line that resumes this question i have this : Certificate: ...(alot of stuff before)... Subject: C=US, ST=Maryland, L=Pasadena, O=Brent Baccala, OU=FreeSoft, CN=www.freesoft.org/[email protected] Subject Public Key Info: ...(alot of stuff after) and i need to parse the file to populate a .csv file and i have that done the problem that i need help is, i need to get the field: CN=www.fresoft.org but when i get this kind of CN=...(Value instead of the ...) with alot of slashes i get a error in the parsing like the raw string is: CN=foo/bar/the/hell/emailAddress=blablabla and i need only: foo/bar/the/hell and for a moment i got that in the correct column but when i dont have the emailAddress something just fail in my parsing and i then get in my CN .csv column the information wrong instead of |CN| foo/bar/the/hell i get: |CN| OU=FreeSoft, foo/bar/the/hell. I have this code doing the CN parsing: #!/bin/bash subject_line=$(echo $cert | grep -o "Subject:.*Subject Public Key Info") cn=$(echo $subject_line | grep -o "CN=.*" ) if [ $(echo $cn | grep -c ".*email.*") -gt 0 ]; then end_cn=$(echo $cn | grep -b -o emailAddress) end_cn_idx=$(echo $end_cn | grep -o .*:) final_end_cn=${end_cn_idx:0:-1} common_name=${cn:3:$final_end_cn-4} echo $common_name else end_cn=$(echo $cn | grep -b -o "Subject Public Key Info") end_cn_idx=$(echo $end_cn | grep -o .*:) final_end_cn=${end_cn_idx:0:-1} common_name=${cn:3:$final_end_cn-5} echo $common_name fi

    Read the article

  • Download file from vbscript?

    - by Eye of Hell
    I need a script that can be run on freshly installed windows xp+ and download specified files from internet, like http://www.python.org/ftp/python/2.6.2/python-2.6.2.msi Is it any easy way to do it without hand-crafting HTTP/FTP requests or using third-party programs like wget? I can suggest that WScript.CreateObject("internetexplorer.application") will do the magic, but documentation on it is extremely huge and Google is silent, as always :).

    Read the article

  • Mac OS X: Change $PATH from within python script

    - by Eye of Hell
    I have a bunch of python scripts. One of them installs software (subversion) that requires it's path to be added to $PATH. After it is installed, I want the next script to use the software. If I run export PATH=/opt/subversion/bin:$PATH in bash between the first and second script, all is ok. But if I add os.system( 'export PATH=/opt/subversion/bin:$PATH' ) as the last command of the first script (that installs subversion), $PATH remains unaltered after it exits. Is it any way to change $PATH from within python script so it will remain changed after the script finishes (inside single bash session, of course, I know about /etc/profile).

    Read the article

  • How to download big file with chrome on Mac OSX?

    - by Eye of Hell
    If I try to download a big file on unstable connection/server (XCode 4) Google chrome simply "stops" downloading on first network error so I have a first 1-2-3 gigabytes of file and chrome thinks that download is finished. Unfortunately, I need to download an entire file, so I need a more advanced download tool like a wget. But there comes a problem: most URL's currently on the web is not a direct URL but multiple "redicrect" pages that utilize complex javascript in order to generate next url and redirect browser to it. Chrome handles such things ok, but if I try to supply such URL to wget it will download some "intermediate" page as a file - not a file itself but an HTML page with complex redirect javascript. is it any way to get a direct URL from chrome or to somehow discover it so I can use it with wget? Maybe it's some avanced download manager integrated in chrome that I just need to install? I use MacOS X 10.6.6 and latest Google chrome.

    Read the article

  • Windows 8: How to Lock (not sleep) laptop on lid close?

    - by Eye of Hell
    If my laptop is connected to power source and is not configured to sleep on lid close (it is connected to power source and is working, i don't want it to sleep. It's compiling my code) if i close the lid, laptop will do nothing. This works as expected, but actually if i have my laptop connected to power source in the office it will be good to lock it if i close a lid. So no one can just open the lid and see my unlocked desktop. I searched google and it says thet correct use case is to manually lock laptop via Win + L every time before lid is closed. This is ok, but not very secure - after all, i can forget Win + L. Is t any easy way (maybe some registry value or app) to configure windows laptop so it will lock on lid close even without sleep? Of course i can write app / powershell script for this task, but this is not suitable for non-programmers end users.

    Read the article

  • Any tutorial on Qt SOAP

    - by Eye of Hell
    Hello. Qt library provides a classes to work with SOAP in qt components. Unfortunately, it's not a part of 'core' Qt and is not well documented. Is it any tutorials / guides/ examples awailable i can use as starting point to learn QtSoap? I want to create a very simple SOAP client for JIRA.

    Read the article

  • do-while loop in Python?

    - by Eye of Hell
    I need to emulate a do-while loop in a python. But, unfortunately, following straightforward code does not work: l = [ 1, 2, 3 ] i = l.__iter__() s = None while True : if s : print s try : s = i.next() except StopIteration : break print "done" Instead of "1,2,3,done" I have the following output: [stdout:]1 [stdout:]2 [stdout:]3 None['Traceback (most recent call last): ', ' File "test_python.py", line 8, in <module> s = i.next() ', 'StopIteration '] What can I do in order to catch 'stop iteration' excepton and break a while loop properly? Example why such thing may be needed. State machine: s = "" while True : if state is STATE_CODE : if "//" in s : tokens.add( TOKEN_COMMENT, s.split( "//" )[1] ) state = STATE_COMMENT else : tokens.add( TOKEN_CODE, s ) if state is STATE_COMMENT : if "//" in s : tokens.append( TOKEN_COMMENT, s.split( "//" )[1] ) else state = STATE_CODE # re-evaluate same line continue try : s = i.next() except StopIteration : break

    Read the article

  • Qt, unit testing and mock objects.

    - by Eye of Hell
    Hello. Qt framework has internal support for testing via QtTest package. Unfortunately, i didn't find any facilities in it that can assist in creating mock objects. Qt signals and slots offers a natural way to create a unit-testing friendly units with input (slots) and output (signals). But is it any easy way to test that calling specified slot in object will result in emitting correct signals with correct arguments? Of course i can manually create a mock objects and connect them to objects being tested, but it's a lot of code. Maybe it's some techniques exists that allows to somehow automate mock objects creation while unit-testing Qt-based applications?

    Read the article

  • Good patterns for loose coupling in Java?

    - by Eye of Hell
    Hello. I'm new to java, and while reading documentation so far i can't find any good ways for programming with loose coupling between objects. For majority of languages i know (C++, C#, python, javascript) i can manage objects as having 'signals' (notification about something happens/something needed) and 'slots' (method that can be connected to signal and process notification/do some work). In all mentioned languages i can write something like this: Object1 = new Object1Class(); Object2 = new Object2Class(); Connect( Object1.ItemAdded, Object2.OnItemAdded ); Now if object1 calls/emits ItemAdded, the OnItemAdded method of Object2 will be called. Such loose coupling technique is often referred as 'delegates', 'signal-slot' or 'inversion of control'. Compared to interface pattern, technique mentioned don't need to group signals into some interfaces. Any object's methods can be connected to any delegate as long as signatures match ( C++Qt even extends this by allowing only partial signature match ). So i don't need to write additional interface code for each methods / groups of methods, provide default implementation for interface methods not used etc. And i can't see anything like this in Java :(. Maybe i'm looking a wrong way?

    Read the article

  • virtualbox ose windows binaries

    - by Eye of Hell
    Hello Sun's virtualbox windows binaries are under 'non-commercial' license so can't be used in any company. But source code is GPL. Is it any resource on the network that has a virtualbox compiled binaries for windows? Added a bounty to see if I can get a little more feedback.

    Read the article

  • LINQ-to-SQL and SQL Compact - database file sharing problem

    - by Eye of Hell
    Hello. I'm learing LINQ-to-SQL right now and i have wrote a simple application that define SQL data: [Table( Name = "items" )] public class Item { [ Column( IsPrimaryKey = true, IsDbGenerated = true ) ] public int Id; [ Column ] public string Name; } I have launched 2 copy of application connected to the same .sdf file and tested if all database modifications in one application affects another application. But strange thing arise. If i use InsertOnSubmit() and DeleteOnSubmit() in one application, added/removed items are instantly visible in other application via 'select' LINQ queue. But if i try to modify 'Name' field in one application, it is NOT visible in other applicaton until it reconnects the database :(. The test code i use: var Items = from c in db.Items where Id == c.Id select c; foreach( var Item in Items ) { Item.Name = "new name"; break; } db.SubmitChanges(); Can anyone suggest what i'm doing wrong and why InsertOnSubmit()/DeleteOnSubmit works and SubmitChanges() don't?

    Read the article

  • QTreeView memory consumption

    - by Eye of Hell
    Hello. I'm testing QTreeView functionality right now, and i was amazed by one thing. It seems that QTreeView memory consumption depends on items count O_O. This is highly unusual, since model-view containers of such type only keeps track for items being displayed, and rest of items are in the model. I have written a following code with a simple model that holds no data and just reports that it has 10 millions items. With MFC, Windows API or .NET tree / list with such model will take no memory, since it will display only 10-20 visible elements and will request model for more upon scrolling / expanding items. But with Qt, such simple model results in ~300Mb memory consumtion. Increasing number of items will increase memory consumption. Maybe anyone can hint me what i'm doing wrong? :) #include <QtGui/QApplication> #include <QTreeView> #include <QAbstractItemModel> class CModel : public QAbstractItemModel { public: QModelIndex index ( int i_nRow, int i_nCol, const QModelIndex& i_oParent = QModelIndex() ) const { return createIndex( i_nRow, i_nCol, 0 ); } public: QModelIndex parent ( const QModelIndex& i_oInex ) const { return QModelIndex(); } public: int rowCount ( const QModelIndex& i_oParent = QModelIndex() ) const { return i_oParent.isValid() ? 0 : 1000 * 1000 * 10; } public: int columnCount ( const QModelIndex& i_oParent = QModelIndex() ) const { return 1; } public: QVariant data ( const QModelIndex& i_oIndex, int i_nRole = Qt::DisplayRole ) const { return Qt::DisplayRole == i_nRole ? QVariant( "1" ) : QVariant(); } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); QTreeView oWnd; CModel oModel; oWnd.setUniformRowHeights( true ); oWnd.setModel( & oModel ); oWnd.show(); return a.exec(); }

    Read the article

  • Is it any desktop wysiwyg editors for mediawiki / wiki available?

    - by Eye of Hell
    Hello. Mediawiki is very good, but for programming tasks editing it via web is not very handy since wysiwyg is very limited, pressing 'edit' + 'publish' on any small change and waiting for page loading kins of annoying. I have seen alot of desktop wikis (personal wikis) that are free from such problems. The best example is a 'wikidpad' that has a usage patter of 'focus, edit wiki in-place, minimize'. This is very handy for programming work where you need to make small changes to wiki and documentation during development, and documentation is written much more often than readed :). But all such desktops wikies are personal - they don't have any wiki sharing (or marginally limited support for it). So, maybe it's a desktop application exists that can connect to mediawiki and allows to view and edit it via a rich wysiwyg editor? Any hints are welcomed.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >