Search Results

Search found 1786 results on 72 pages for 'jack brown'.

Page 12/72 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Joining the previous and next sentence using python

    - by JudoWill
    I'm trying to join a set of sentences contained in a list. I have a function which determines whether a sentence in worth saving. However, in order to keep the context of the sentence I need to also keep the sentence before and after it. In the edge cases, where its either the first or last sentence then, I'll just keep the sentence and its only neighbor. An example is best: ex_paragraph = ['The quick brown fox jumps over the fence.', 'Where there is another red fox.', 'They run off together.', 'They live hapily ever after.'] t1 = lambda x: x.startswith('Where') t2 = lambda x: x'startswith('The ') The result for t1 should be: ['The quick brown fox jumps over the fence. Where there is another red fox. They run off together.'] The result for t2 should be: ['The quick brown fox jumps over the fence. Where there is another red fox.'] My solution is: def YieldContext(sent_list, cont_fun): def JoinSent(sent_list, ind): if ind == 0: return sent_list[ind]+sent_list[ind+1] elif ind == len(sent_list)-1: return sent_list[ind-1]+sent_list[ind] else: return ' '.join(sent_list[ind-1:ind+1]) for sent, sentnum in izip(sent_list, count(0)): if cont_fun(sent): yield JoinSent(sent_list, sent_num) Does anyone know a "cleaner" or more pythonic way to do something like this. The if-elif-else seems a little forced. Thanks, Will PS. I'm obviously doing this with a more complicated "context-function" but this is just for a simple example.

    Read the article

  • How to store dynamic references to parts of a text

    - by Antoine L
    In fact, my question concerns an algorithm. I need to be able to attach annotations to certain parts of a text, like a word or a group of words. The first thing that came to me to do so is to store the position of this part (indexes) in the text. For instance, in the text 'The quick brown fox jumps over the lazy dog', I'd like to attach an annotation to 'quick brown fox', so the indexes of the annotation would be 4 - 14. But since the text is editable (other annotations could provoke a modification from text's author), the annoted part is likely to move (the indexes could change). In fact, I don't know how to update the indexes of the annoted part. What if the text becomes 'Everyday, the quick brown fox jumps over the lazy dog' ? I guess I have to watch every change of the text in the front-end application ? The front-end part of the application will be HTML with Javascript. I will be using PHP to develop the back-end part and every text and annotation will be stored in a database.

    Read the article

  • Why does the following Toggle function perform four different operations instead of two?

    - by marcamillion
    You can see the implementation here: http://jsfiddle.net/BMWZd/8/ What I am trying to do, when you click on 'John Brown', you see the first element at top turn black. When you click it again, the border of the dotted circle disappears, then when you click 'John Brown' again, you see something else, then finally once again it all disappears. What I am trying to achieve is when you click it once, everything turns black (like it does now), then you click it again, everything disappears and goes back to the original state. Important distinction, what I mean is...when one of the names in the box are not clicked. So if you clicked John Brown then moved to Jack Dorsey, the #1 at top should stay black. But if you were to click Jack Dorsey again, i.e. you 'unclicked' it, then it should disappear. Also, how do I tighten it up, so that it responds quicker. Now when you click it, it feels like there is a little bit of a lag between when it was clicked and when it responds. Edit1: If anyone is interested...the UI that this will be used in is for my webapp - http://www.compversions.com

    Read the article

  • Browser dependent problem rendering WMD with Showdown.js?

    - by CMPalmer
    This should be easy (at least no one else seems to be having a similar problem), but I can't see where it is breaking. I'm storing Markdown'ed text in a database that is entered on a page in my app. The text is entered using WMD and the live preview looks correct. On another page, I'm retrieving the markdown text and using Showdown.js to convert it back to HTML client-side for display. Let's say I have this text: The quick **brown** fox jumped over the *lazy* dogs. 1. one 1. two 4. three 17. four I'm using this snippet of Javascript in my jQuery document ready event to convert it: var sd = new Attacklab.showdown.converter(); $(".ClassOfThingsIWantConverted").each(function() { this.innerHTML = sd.makeHtml($(this).html()); } I suspect this is where my problem is, but it almost works. In FireFox, I get what I expected: The quick brown fox jumped over the lazy dogs. one two three four But in IE (7 and 6), I get this: The quick brown fox jumped over the lazy dogs. 1. one 1. two 4. three 17. four So apparently, IE is stripping the breaks in my markdown code and just converting them to spaces. When I do a view source of the original code (prior to the script running), the breaks are there inside the container DIV. What am I doing wrong? UPDATE It is caused by the IE innerHTML/innerText "quirk" and I should have mentioned before that this one on an ASP.Net page using data bound controls - there are obviously a lot of different workarounds otherwise.

    Read the article

  • Name resolution for the name <name> timed out after none of the configured DNS servers responded.

    - by Paul Brown
    Installed Windows 7 (previously ran XP and Vista with no problems) a couple of weeks ago and I'm at least once a day getting the above error show up in the event logs and losing all internet connection. The only current way to resolve it is to reboot my cable modem. My ISP have been running diagnostics on it and tell me there is no problem whatsoever. I've configured my router (and PC on occasion) to point at OpenDNS - still occurs. I've had the PC directly connected to the modem - still occurs. If I can give more info that might of use please ask thanks Update: After moaning at my ISP for a couple of weeks (VirginMedia) they agreed to send me out a new cable modem ... and I've not had the issue since.

    Read the article

  • With Ubuntu Linux (10+), how do I connect to remote to my machine from Windows

    - by Berlin Brown
    I tried to to remote into my Ubuntu machine. I enabled the setting on Ubuntu and that side seems to work. But I get a connection time out when I use RealVNC on the Windows box. I believe it is a firewall issue. I disabled the firewall for that application on Windows but I don't know how to check if the firewall is enabled on the windows machine. I am on a local network with a router. Ideally, I would want to block that remote control port at the Internet level/router level but "enable" that port on the Windows box and the Ubuntu box. How do I check those settings.

    Read the article

  • Validating SSL clients using a list of authorised certificates instead of a Certificate Authority

    - by Gavin Brown
    Is it possible to configure Apache (or any other SSL-aware server) to only accept connections from clients presenting a certificate from a pre-defined list? These certificates may be signed by any CA (and may be self-signed). A while back I tried to get client certificate validation working in the EPP system of the domain registry I work for. The EPP protocol spec mandates use of "mutual strong client-server authentication". In practice, this means that both the client and the server must validate the certificate of the other peer in the session. We created a private certificate authority and asked registrars to submit CSRs, which we then signed. This seemed to us to be the simplest solution, but many of our registrars objected: they were used to obtaining a client certificate from a CA, and submitting that certificate to the registry. So we had to scrap the system. I have been trying to find a way of implementing this system in our server, which is based on the mod_epp module for Apache.

    Read the article

  • Experience with MooseFS?

    - by brown.2179
    Anyone have any experience using MooseFS? I want an easy distributed storage platform to store static data archive of about 10 TB and serve it to 20-40 nodes. Also I want to be able to add storage as the archive grows without having to rebuild the filesystem. I don't care if it's a bit slow. I just want it to be simple and stable. Basically from what I can see for OS X it's between MooseFS and Gluster. Any other suggestions?

    Read the article

  • Can I talk while playing music?

    - by Zachary Brown
    I have taken the advice of some people on here to use Shoutcast for my online radio station, but I have run into a problem. I need to be able to talk while the music is playing. Not through the entire song of course, just to tell what the song is and stuff like that. I know this is possible, a little Googling told me that but what I wasn't able to find is how to do that!

    Read the article

  • How do I use the iPhone Calculator's modulus function?

    - by Josh Brown
    I've tried several ways and can't get the iPhone Calculator's modulus function. If I want to compute, say, 5 % 3, what buttons do I press to get it to work? When I try pressing 5, then %, Calculator immediately displays 0.05. Is the mod function broken or am I pressing the buttons in the wrong order? I'm running iPhone OS 3.1.3.

    Read the article

  • Improving Performance of RDP Over LAN

    - by Jared Brown
    Architecture: A deployment of 6 new HP thin clients (Windows XP Embedded) with TCP/IP access to several new HP servers (Windows 2003 Server). Each thin client is connected over fiber optic to a Gigabit Cisco switch, which the servers are connected to. There are 10/100 Ethernet to fiber converter boxes on each end of the fiber cables. Problem: Noticeable lag over RDP while using the Unigraphics CAD package. 3D models take .5 to 1 second to respond to mouse actions. Other Details: Network throughput on each thin client's RDP session is 7288 kbps. RDP connection settings - color setting: 15k, all themes, etc. turned off. Local and remote system performance stats are well within norms (CPU, Memory, and Network). Question: Are there newer versions of terminal services or RDP I can use on my existing OSes? Are there compression algorithms, etc. that are well suited for a high-bandwidth LAN? Are there valid alternatives that will yield higher performance (i.e. UltraVNC with drivers installed)? Are there TCP/IP tuning options I can exploit?

    Read the article

  • Apache and mod_authn_dbd DBDPrepareSQL error

    - by David Brown
    I am running Apache 2.2.17 on Suse Linux 11. I have installed the mod_authn_dbd module to allow authentication using a MySQL database. Simple digest authentication works absolutely fine using the following directive: AuthDBDUserRealmQuery "SELECT loginPassword FROM login WHERE loginUser = %s and loginRealm = %s" However, I would like to both generalize this statement and prepare it for performance and security reasons. Thus, I used the following directives instead: DBDPrepareSQL "SELECT loginPassword FROM login WHERE loginUser = %s and loginRealm = %s" digestLogin AuthDBDUserRealmQuery digestLogin These directives generate the following errors: [...] [error] (20014)Internal error: DBD: failed to prepare SQL statements: [...] [error] (20014)Internal error: DBD: failed to initialise Why does my actual SQL statement work when used directly, but not when I try to prepare it? (Note I have tried using '?' and '%%' in place of '%', to no effect.)

    Read the article

  • Running SSL locally on a hosts redirected domain name with Ubuntu and Apache

    - by Matthew Brown
    I recently made some changes to my Ubuntu computer so that a domain name resolved to my local copy of Apache. I edited /etc/hosts and added 127.0.0.1 thisbit.example.com Then set up a VirtualHost for the responses I wishes to create. That all works fine and my testing is now shooting on ahead without harm or risk tot he production server. Now for my next trick I need to test the authentication and so need to do this with HTTPS Basically https://auth.example.com needs to work on my PC without the SSL causing an issue which I imagine would be the case as I am clearly not the true https://auth.example.com but for the basis of this exercise I need to pretend that I am. Now it might be that the Apps I'm testing don't worry about checking the certificate. (Many are in Java which I'm no expert with). What gotchas am I likely to encounter and what is the best way of not letting my own hacks spoil my testing? I'm guessing the place to start is to enable SSL with Apcahe... I've never done that before as it has never come up before.

    Read the article

  • Apache virtual host proxy to nginx for ruby

    - by Kevin Brown
    I'm running a few php sites off apache and want to start rails dev. I've installed rvm/nginx and can get my ruby site by going to websiteroot.com:8000... How do I pass ruby.websiteroot.com to websiteroot.com:8000? What's the best way for me to route a subdomain for ruby dev?? I'd switch to nginx completely if it weren't for all my php sites--seems like it's easier to just proxy for ruby. Advice? My nginx config looks like this: server{ listen 8000; server_name website.com; root /home/me/sites/ruby_folder/public; ... } My apache config looks like this: <VirtualHost> ServerName ruby.website.com ProxyPreserveHost on ProxyPass / http://127.0.0.1:8000 ProxyPassReverse / http://127.0.0.1:8000 </VirtualHost>

    Read the article

  • What usb-bootable utility should I use to copy SATA hard drives?

    - by Steve Brown
    I have a computer that only has two SATA connections and I need to copy one SATA hard drive to another. Since I have to unplug the CD drive to copy the drives I need a USB-bootable utility. I have an old school copy of Norton Ghost (CD based): Ghost has always worked well for me in the past - I see there is a new "version 15" out but I'm not sure if it is worth buying. A friend has Acronis True Image on a USB drive: We tried to use that on the computer but it was unable to copy both partitions (restore partition and main partition). Of course there may be some problem with the drive that is keeping Acronis from working (it is just exiting with a lame error about not being able to copy the disks and no error code or detailed information), but I'm interested in knowing if there is a better, more solid, or widely used solution that I should invest in. What usb-bootable utilities can I use to copy SATA hard drives?

    Read the article

  • Can't detect wireless networks, running ubuntu 9.10 on eeepc 1000he

    - by David Brown
    Hi, I am running Ubuntu 9.10 on an ASUS eeepc 1000HE, and my wireless card, RaLink RT 2860, is failing to recognize any wireless networks. It was working fine this morning, until I accidentally hit Fn F2, disabling the wireless card. I hit Fn F2 again to reenable it, but it no longer will detect any wireless networks (and other computers in the household do recognize them). Any help at all will be greatly appreciated! I googled quite a bit and talked to a human about this but could not fix it. We tried dhclient ra0, which returned There is already a pid file /var/run/dhclient.pid with pid 2438 killed old client process, removed PID file Internet Systems Consortium DHCP Client V3.1.2 Copyright 2004-2008 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/sw/dhcp/ Listening on LPF/ra0/00:25:d3:13:f4:20 Sending on LPF/ra0/00:25:d3:13:f4:20 Sending on Socket/fallback DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 6 DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 9 DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 12 DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 8 DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 10 DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 10 DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 6 No DHCPOFFERS received. No working leases in persistent database - sleeping. Other data: iwconfig returns (other stuff here...) ra0 RT2860 Wireless ESSID:"" Nickname:"RT2860STA" Mode:Auto Frequency=2.412 GHz Bit Rate=1 Mb/s RTS thr:off Fragment thr:off Link Quality=10/100 Signal level:0 dBm Noise level:-87 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 ifconfig returns (other stuff here...) ra0 Link encap:Ethernet HWaddr 00:25:d3:13:f4:20 inet6 addr: fe80::225:d3ff:fe13:f420/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:583 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:19 ra0:avahi Link encap:Ethernet HWaddr 00:25:d3:13:f4:20 inet addr:169.254.7.117 Bcast:169.254.255.255 Mask:255.255.0.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 Interrupt:19

    Read the article

  • Tool to copy IMAP folders from one server to another

    - by Barry Brown
    I need a Unix-based tool, such as a shell script or command-line program, to copy IMAP folders from one server to another. Ideally, the tool should copy all the folders for a single account (Inbox, Sent, Trash, and user-created folders) at once, rather than one folder at a time. It should preserve message dates. As an option, I'd like to be able to copy just a single IMAP folder. Alternatively, is there a tool to copy an mbox file to an IMAP server? I have direct access to the mbox files in the filesystem, but not to the filesystem of the remote IMAP server. Edit: Is there a way for a user to migrate their own questions to Server Fault?

    Read the article

  • Confused about the Windows 7 Preinstallation Kit

    - by David Brown
    I build custom PCs and would like to use the Windows 7 Preinstallation Kit to make installation go a little quicker and customize the Windows image. However, since each PC is built to a particular customer's specifications, the hardware will rarely be the same. So, I would like to have a single answer file that will work for everything. I'm not sure if that's possible, however. What I mostly want to do for now is add my support information as well as pre-set anything that I would normally change after each installation completes. I have a Windows 7 Professional Upgrade DVD set (both 32-bit and 64-bit), but no OEM disks. I copied the Install.wim file to my local drive and opened it in the Windows System Image Manager, but it asks me to choose a catalog file specifically for each edition of Windows 7. Will this limit the answer file to whichever edition I choose? I would think choosing Starter would give me the most basic settings, which would apply to all other editions, but I'm not entirely sure of this. I don't intend to install any extra applications or drivers. I merely want to insert an OEM disk, my OPK USB drive, and have it work for whatever edition of Windows 7 I'm installing. If a large number of similarly-configured PCs need to be built, I'll go ahead and create a custom answer file in that case, but for a single machine order, that seems like overkill. In addition, do I need a separate answer file for 32-bit and 64-bit versions of Windows 7? Or will it work for both, even though I copied the Install.wim file from the 32-bit disk? Thanks!

    Read the article

  • Can't avoid starting macbook in safe mode

    - by Aaron Brown
    I recently spilled some water on my MacBook (mid-2010) keyboard and it shorted out several of the keys. Notably, control and left option don't work, and the system thinks that the left shift is permanently held down. I plugged in an external USB keyboard and all keys work fine; there's only one problem: The computer always starts in safe mode because the shift key is held down. I've tried holding down other keys (escape, space, c to name a few) and the control key doesn't work so I can't try that. I also tried KeyRemap4Macbook but it doesn't work in safe mode and it doesn't seem to help on startup for me. I can log in to Windows with no problems (with rEFIt) and I can browse the internet with no problems, but I can't program on the Mac OS side in safe mode (it's really slow). Which is mainly what I use this Macbook for. Any ideas out there on how to avoid starting in safe mode?

    Read the article

  • Protect Gnome Screen Saver Settings

    - by Jared Brown
    By default in Gnome standard users can access their screensaver preferences and change settings such as the idle time and whether or not it locks the screen. I desire to set the screensaver settings as the root user for each user and only allow the root user to adjust them. What is the best (read: simplest + fool proof) way to accomplish this?

    Read the article

  • Windows Scheduled Tasks losing password configuration

    - by E Brown
    I have a couple of jobs scheduled to run daily on a customer server running Windows Server 2003 Standard Edition, SP1 using Windows Scheduled Tasks. The tasks are set to run as a user that is in the Administrators group, and were scheduled as that same user. The password of that user is set to never expire. These tasks fail to run pretty much every day. Going into Scheduled Tasks and attempting to run the tasks manually indicates that the password is incorrect. I go into the task properties, retype the password into the appropriate fields, click OK, and attempt to run the task manually again. Now it works fine. What might be the cause of the password being lost like this? These same tasks are running on other customers servers with no problems. Thanks in advance for any thoughts.

    Read the article

  • Hosted Kerio Mailserver vs. Hosted Exchange

    - by Dayton Brown
    Hi all, I'm in the beginning stages of migrating from an internal exchange server (2003) to external hosted services. We don't have a huge user base, less than 100, but we need to support BlackBerries, iPhones, Outlook RPC/HTTP, etc. I really like exchange hosted providers (I've used intermedia in the past) but pricing is a bit high. Does anyone have any experience with Kerio? It looks great, but I'd like to hear some unbiased opinions. Or biased if you are really happy working for a particular hosting company ;-)

    Read the article

  • Close all Mac Terminal windows, but the one running a script

    - by Greg Brown
    I am trying to create a shell script that runs a python simulation programing in 4 terminal windows. I have the script that launches the program four times in four separate terminal windows(total of 5 windows, 4 for the python programs, and one to control the other terminal windows). I want to now create a script that I can run in the control terminal window that closes and kills the programs of the other four terminal windows, but still have the control one open. What I have so far is something like this #!/bin/sh osascript -e 'tell app "Terminal" do script "killall python" end tell' osascript -e 'tell app "Terminal" to quit' osascript -e 'tell app "Terminal" to open' The problem is that the last line doesn't work because it closes all the windows including the one the script is executing in. I am not really familiar with shell or apple script so any help would be welcomed. I posted on Stack, but I think this might be a better place for an automation type question. Thanks

    Read the article

  • Arguments passed on by shell to command in Unix

    - by Ryan Brown
    I've been going over this question and I can't for the life of me figure out why the answer is what it is. How many arguments are passed to the command by the shell on this command line:<pig pig -x " " -z -r" " >pig pig pig a. 8 b. 6 c. 5 d. 7 e. 9 The first symbol is supposed to be the symbol for redirected input but the site isn't letting me use it. [Fixed.] I looked at this question and said ok...arguments...not options so 2nd pig, then " ", then -r" ", 4th pig and 5th pig...-z and -x are options, so I count 5. The answer is b. 6. Where is the 6th argument that's being passed on?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >