Daily Archives

Articles indexed Monday March 8 2010

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

  • SQLConnection.Open(); throwing exception

    - by flavour404
    Hi, Updating an old piece of software but in order to maintain backward compatibility I need to connect to a .mdb (access) database. I am using the following connection but keep getting an exception, why? I have validated the path, database existence etc. and that is all correct. string Server = "localhost"; string Database = drive + "\\btc2\\state\\states.mdb"; string Username = ""; string Password = "Lhotse"; string ConnectionString = "Data Source = " + Server + ";" + "Initial Catalog = " + Database + ";" + "User Id = '';" + "Password = " + Password + ";"; SqlConnection SQLConnection = new SqlConnection(); try { SQLConnection.ConnectionString = ConnectionString; SQLConnection.Open(); } catch (Exception Ex) { // Try to close the connection if (SQLConnection != null) SQLConnection.Dispose(); // //can't connect // // Stop here return false; }

    Read the article

  • How to organize modules for PyPI to support 2.x and 3.x

    - by Craig McQueen
    I have a Python module that I would like to upload to PyPI. So far, it is working for Python 2.x. It shouldn't be too hard to write a version for 3.x now. But, after following guidelines for making modules in these places: Distributing Python Modules The Hitchhiker’s Guide to Packaging it's not clear to me how to support multiple source distributions for different versions of Python, and it's not clear if/how PyPI could support it. I envisage I would have separate code for: 2.x 2.6 (maybe, as a special case to use the new buffer API) 3.x How is it possible to set up a Python module in PyPI so that someone can do: easy_install modulename and it will install the right thing whether the user is using 2.x or 3.x?

    Read the article

  • custom validation does not seem to get registered.

    - by viet pham
    Hi, Inside a tab, I have a form that is dynamically loaded via ajax. Since the name of the field is dynamic too (e.g. ), I write a custom validation method inside the "on complete" like this. However, the custom code does not get executed (bolded alert never pops up) no matter what i try. $.ajax ( { url: 'index.php?func=trainingmgr&aAction=displayAddForm', type: 'GET', dataType: 'html', complete: function(req, err) { //Append response to the tab's body $(href, '#trainingTabs').append(req.responseText); $.validator.addMethod ( 'tRequired', function(value, element) { if(value == '') { **alert('I am empty');** return true; } else return false; }, '<br>Required field' ); $('#upload' + index).click ( function() { $('#addForm' + index).validate().numberOfInvalids(); } ); } } );

    Read the article

  • Add a contact to android emulator

    - by Sephy
    Hi, My issue is quite simple I think : I would like to be able to add a contact to the contact list by a simple click on a button (and be able to test it on the emulator). The data of this contact would be stored in the source code of the application. is there an easy way of doing that? thank you for your answers

    Read the article

  • How to extend an 'unloadable' Rails plugin?

    - by Vitaly Kushner
    I'm trying to write a plugin that will extend InheritedResources. Specifically I want to rewrite some default helpers. And I'd like it to "just work" once installed, w/o any changes to application code. The functionality is provided in a module which needs to be included in a right place. The question is where? :) The first attempt was to do it in my plugin's init.rb: InheritedResources::Base.send :include, MyModule It works in production, but fails miserably in development since InheritedResource::Base declared as unloadable and so its code is reloaded on each request. So my module is there for the first request, and then its gone. InheritedResource::Base is 'pulled' in again by any controller that uses it: Class SomeController < InheritedResource::Base But no code is 'pulling in' my extension module since it is not referenced anywhere except init.rb which is not re-loaded on each request So right now I'm just including the module manually in every controller that needs it which sucks. I can't even include it once in ApplicationController because InheritedResources inherites from it and so it will override any changes back.

    Read the article

  • LINQ how to add an order by to this statement?

    - by JL
    I have the following LINQ that I would like to also order by file creation date, how is this done? taskFiles = taskDirectory.GetFiles(Id + "*.xml") .Where(fi => !fi.Name.EndsWith("_update.xml", StringComparison.CurrentCultureIgnoreCase)) .ToArray();

    Read the article

  • Hashtable comparator problem

    - by user288245
    Hi guys i've never written a comparator b4 and im having a real problem. I've created a hashtable. Hashtable <String, Objects> ht; Could someone show how you'd write a comparator for a Hashtable? the examples i've seen overide equals and everything but i simply dont have a clue. The code below is not mine but an example i found, the key thing in hashtables means i cant do it like this i guess. public class Comparator implements Comparable<Name> { private final String firstName, lastName; public void Name(String firstName, String lastName) { if (firstName == null || lastName == null) throw new NullPointerException(); this.firstName = firstName; this.lastName = lastName; } public String firstName() { return firstName; } public String lastName() { return lastName; } public boolean equals(Object o) { if (!(o instanceof Name)) return false; Name n = (Name)o; return n.firstName.equals(firstName) && n.lastName.equals(lastName); } public int hashCode() { return 31*firstName.hashCode() + lastName.hashCode(); } public String toString() { return firstName + " " + lastName; } public int compareTo(Name n) { int lastCmp = lastName.compareTo(n.lastName); return (lastCmp != 0 ? lastCmp : firstName.compareTo(n.firstName)); } }

    Read the article

  • Find all words containing characters in UNIX

    - by fahdshariff
    Given a word W, I want to find all words containing the letters in W from /usr/dict/words. For example, "bat" should return "bat" and "tab" (but not "table"). Here is one solution which involves sorting the input word and matching: word=$1 sortedWord=`echo $word | grep -o . | sort | tr -d '\n'` while read line do sortedLine=`echo $line | grep -o . | sort | tr -d '\n'` if [ "$sortedWord" == "$sortedLine" ] then echo $line fi done < /usr/dict/words Is there a better way? I'd prefer using basic commands (instead of perl/awk etc), but all solutions are welcome! To clarify, I want to find all permutations of the original word. Addition or deletion of characters is not allowed.

    Read the article

  • Books for experienced .NET developer learning PHP/MySQL

    - by webworm
    Hi All, I am an experienced .NET developer (C#/ASP.NET) looking to broaden my skills to the PHP/MySQL arena. I would like get recommendations on books for learning PHP/MySQL that are geared towards someone who is already familiar with object oriented programming and web development. I do realize that there are lots of online material out there but I am looking for an actual print book I can read. Thanks a bunch.

    Read the article

  • How do I allow users to dial numbers in my tableView cells?

    - by Griffo
    Hi all, I have a table containing cells with phone numbers. How can I allow the user to dial these numbers by tapping the row? It's not working by default and there's no option in interface builder like there is for uiwebviews so I imagine I need to programmatically tell the app to dial the number when the cell is tapped.

    Read the article

  • ASP.NET XML as Datasource error

    - by nekko
    Hello I am trying to use an XML as a datasource in ASP and then display it as a datagrid. The XML has the following format: <?xml version="1.0" encoding="UTF-8"?> <people type="array"> <person> <id type="integer"></id> <first_name></first_name> <last_name></last_name> <title></title> <company></company> <tags> </tags> <locations> <location primary="false" label="work"> <email></email> <website></website> <phone></phone> <cell></cell> <fax></fax> <street_1/> <street_2/> <city/> <state/> <postal_code/> <country/> </location> </locations> <notes></notes> <created_at></created_at> <updated_at></updated_at> </person> </people> When I try to run the simple page I receive the following error Server Error in '/' Application. The data source for GridView with id 'GridView1' did not have any properties or attributes from which to generate columns. Ensure that your data source has content. Here is my page code <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="shout._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/people.xml" XPath="people/person"></asp:XmlDataSource> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" DataSourceID="XmlDataSource1"> </asp:GridView> </div> </form> </body> </html> Please help. Thanks in advance.

    Read the article

  • SpamAssassin 2010 Bug still active on my mailserver despite the offending rule being fixed - where t

    - by Ibrahim
    The SpamAssassin 2010 bug was supposed to be fixed not long after the bug became widely known, and indeed the offending rule in my /usr/share/spamassassin/72_active.cf has been updated. However, incoming messages are still being tagged by this eg: X-Spam-Status: No, score=3.188 tagged_above=-999 required=6.31 tests=[BAYES_50=0.001, FH_DATE_PAST_20XX=3.188, SPF_PASS=-0.001] Here is the relevant rule: ##{ FH_DATE_PAST_20XX header FH_DATE_PAST_20XX Date =~ /20[2-9][0-9]/ [if-unset: 2006] describe FH_DATE_PAST_20XX The date is grossly in the future. ##} FH_DATE_PAST_20XX I'm on spamassassin/3.2.5-2+lenny1.1~volatile1 on Debian Lenny, completely up to date. Any pointers on where to look to figure out what's going on? I don't know anything about SpamAssassin; someone else usually manages this but I'm free right now and am trying to figure out what the problem is because it's been annoying us for a while and we only just realized this bug was still affecting us. Update: I've lowered the score for the FH_DATE_PAST20XX rule to 0.1, both in /etc/spamassassin/local.cf and /usr/share/spamassassin/50_scores.cf and it's still giving 3.188 points for this rule. Any idea what's going on? This really has me stumped. Update 2: It seems that after restarting amavisd, it's been fixed. What's the difference between amavisd and spamd? It seems like both should not be running, or something.

    Read the article

  • MySQL equivalent to .pgpass, or automatic authentication in a cron job for mySQL

    - by Ibrahim
    I'm writing a bash script to back up my databases. Most are postgresql, and in postgres there's a way to avoid having to authenticate by creating a ~/.pgpass file which contains the postgres password. I put this in root's home directory and made it chmod 0600, so that root could dump the postgres databases without having to authenticate. Now I want to do something similar for mysql, although I only have one mysql database. How can I do this? I don't want to specify the password on the command line for mysqldump because this is part of a script that might be somewhat visible to other users. Is there a better way (i.e. built in to mysql) to do this than make a file that only root can read and then read that to get the mysql password, and then use that in the bash script as a variable?

    Read the article

  • What are the differences between google app mail, and plain ol' [email protected] forwarding to gmail ac

    - by Chris Adams
    I currently have an email address, [email protected], that I currently use to forward to a gmail account that I've used for years. I currently have it set, so I can send email from my [email protected] instead of [email protected]. This is done through the web ui on my current domain name, provider, gandi.net. What are the main differences between this arrangement, and setting up a Google Apps for your domain setup, where I'm explicitly listing in the dns records to point records to point to Google's app mail server?

    Read the article

  • Wireless AP Placement and Digramming

    - by Matt Simmons
    I'm trying to research the best placement of wireless APs in a given space, and I'm running into problems in gathering information. I found (what I thought was) a great source in this tech republic article: http://techrepublic.com.com/5206-6230-0.html?forumID=82&threadID=163120 While this diagram seems detailed and overall very informative, there were a lot of comments talking about how it was lacking in things like "wire racks, microwaves, concrete walls, motors..." etc. Maybe I'm rash, but I just sort of looked around my office (which is, albeit, somewhat smaller than the one diagrammed), and went "uhhh, there", and hooked up the AP. It seems to cover everywhere. I imagine if my office quadrupled in size, I'd logically divide it up and put four APs in, with a similar amount of thought devoted to each. So, suppose I had a much more complex office. What tools (both diagramming and surveying) do you use to plan your AP placement?

    Read the article

  • Google images sometimes terribly slow when using dnsmasq

    - by Joril
    Hi everyone! I am the admin of a small LAN of 10+ computers. I've set up a dnsmasq server for DHCP and DNS resolution, and it's working almost fine.. My problem is that when I try to use Google images, sometimes it takes ages to show the actual images. I get just the textual part of the page (menus and so on) while the images themselves are shown as the still-loading-white boxes.. When I use the DSL router directly as DNS, the site works fine all the time. The problem sometimes presents itself with Google maps too.. The map takes ages to load. Any idea on what I could try to troubleshoot this? (dnsmasq 2.47 on CentOS 5.2 64bit, our outside connection is an asymmetrical 4Mbps DSL)

    Read the article

  • Networking issues with Linux server (CentOS 5.3)

    - by sxanness
    I have a Linux server hosting our bug tracking software (CentOS 5.2 Kernel 2.6.18-128.4.1.el5) that I have having some strange network problems with. The machine is configured with two NICS, one for the public interface and the other for our server back end network. The problem is that after doing a service network restart I can ping the public interface and it sends anywhere from 200-500 ICMP packets and then all of a sudden I start getting a request timed out error. Strange but as soon as I connect to the private interface the ping starts working again to the public interface. I clearly have a routing issue somewhere. I have a Juniper Router with the following configuration. Interface 0/0 -- Connect subnet to the ISP at our co-location Interface 0/2 -- For our DRAC network Interface 0/3 -- The Server-backend network (plugs directly into a switch that feeds to all the NICs that are on the 10.3.20.x network. Interface 0/4 -- Plugs directly into another switch that feeds our public interfaces, that interface as all the gateways from our public ip rangs as secondary IP addresses. I hope that someone can ask the right questions that can lead me to check things and figure out what is going on. Has anyone had similar problems and what kind of things should I be checking? Routing issue or something even more complicated? [root@fogbugz ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 # Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ DEVICE=eth0 BOOTPROTO=static IPADDR=72.249.134.98 NETMASK=255.255.255.248 BROADCAST=72.249.134.103 HWADDR=00:16:3E:AA:BB:EE ONBOOT=yes [root@fogbugz ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 # Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ DEVICE=eth1 BOOTPROTO=static BROADCAST=10.3.20.255 HWADDR=00:17:3E:AA:BB:EE IPADDR=10.3.20.25 NETMASK=255.255.255.0 NETWORK=10.3.20.0 ONBOOT=yes [root@fogbugz ~]# cat /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=fogbugz.dfw.hisg-it.net GATEWAY=72.249.134.97 [root@fogbugz ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 72.249.134.96 0.0.0.0 255.255.255.248 U 0 0 0 eth0 10.3.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 10.0.0.0 10.3.20.1 255.0.0.0 UG 0 0 0 eth1 0.0.0.0 72.249.134.97 0.0.0.0 UG 0 0 0 eth0

    Read the article

  • Welcome files are not loaded! Need help with Railo, mappings and J2EE configuration!

    - by mrt181
    I have installed a J2EE Server (tried it with Glassfish3, Tomcat6 and Resin4) on Win7 64bit and deployed Railo3.1. I have then added a virtual host to the J2EE server, i.e. Resin: <host host-name="railo"> C:/resin/webapps/railo In the Railo Admin i have added this mapping: Virtual Physical / C:/webapps/ When i access http://railo:8080/ my index.cfm welcome file in C:/webapps/ is loaded (index.cfm is definded in Railos web.xml). When i try to access http://railo:8080/test which contains the same index.cfm i get an 500 Servlet Exception java.io.FileNotFoundException: C:\webapps\test (access denied) (on all J2EE Servers i tried so far). http://railo:8080/test/index.cfm works fine. I already tried to add index.cfm to Resins welcome-file-list in app-default.xml to no avail. I want to be able to access deployed apps without this url: http://localhost:8080/app/ Instead i want to use this: http://app:8080/

    Read the article

  • What possible events could cause a MySQL database to revert to a previous state?

    - by justkevin
    A client of mine recently had a strange event with their MySQL database. Several days ago, one database suddenly "went back in time". All the data was in the state it was in several months ago. Even most of the .MYD and .MYI files had timestamps from November. Fortunately, the server is not in production yet, but we need to understand how it happened so it doesn't happen again. I'm not a MySQL guru, but I couldn't think of a scenario that could cause the database to rewind like that short of restoring from a backup. What could have happened here? Where should I look for clues? (Server is FreeBSD 6.4)

    Read the article

  • Mono Project: How to install Mono framework on Red Hat Linux which is compiled on centOS ?

    - by funwithcoding
    We have Red Hat Enterprise Linux servers at work place. However we dont have Red Hat Linux desktops. So I used CentOS 5.4 to compile the Mono sources and generated the Mono framework for CentOS and tested with some sample codes and I am satisfied. I want to transfer this compiled framework to Red Hat Enterprise Linux 5. How Can I do that? Do I have to compile the Mono framework statically or do I have to copy the linked libraries as well? I am not familiar with linux much. Any help is highly appreciated.

    Read the article

  • Tomcat 6 HTTPS connector: keep alive timeout not being respected

    - by sehugg
    I'm using Tomcat 6.0.24 on Ubuntu (JDK 1.6) with an app that does Comet-style requests on an HTTPS connector (directly against Tomcat, not using APR). I'd like to set the keep-alive to 5 minutes so I don't have to refresh my long-polling connections. Here is my config: <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="1000" keepAliveTimeout="330000" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" /> Unfortunately it seems that the server closes the connection after 65 seconds. The pcap from a sample session goes something like this: T=0 Client sends SYN to server, handshake etc. T=65 Server sends FIN to client T=307 Client sends FIN to server (I'm guessing the 5 minute timeout on the client is due to the HTTP lib not detecting the socket close on the server end, but in any case -- the server shouldn't be closing the connection that early) (edit: this works as expected when using the standard HTTP connector)

    Read the article

  • Windows Server: specifying the default IP address when NIC has multiple addresses

    - by Cédric Boivin
    I have a Windows Server which has ~10 IP addresses statically bound. The problem is I don't know how to specify the default IP address. Sometimes when I assign a new address to the NIC, the default IP address changes with the last IP entered in the advanced IP configuration on the NIC. This has the effect (since I use NAT) that the outgoing public IP changes too. Even though this problem is currently on Windows Server 2008, I've had the same problem with a Windows Server 2003. How can you set the default IP address on a NIC when it has multiple IP addresses bound? I remark something. When i check route print i see is it there the problem ? 0.0.0.0 0.0.0.0 192.168.x.x 192.168.99.49 261 if i want the default ip be example : 192.168.99.100 There is my route. Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.99.1 192.168.99.49 261 10.10.10.0 255.255.255.0 On-link 10.10.10.10 261 10.10.10.10 255.255.255.255 On-link 10.10.10.10 261 10.10.10.255 255.255.255.255 On-link 10.10.10.10 261 192.168.99.0 255.255.255.0 On-link 192.168.99.49 261 192.168.99.49 255.255.255.255 On-link 192.168.99.49 261 192.168.99.51 255.255.255.255 On-link 192.168.99.49 261 192.168.99.52 255.255.255.255 On-link 192.168.99.49 261 192.168.99.53 255.255.255.255 On-link 192.168.99.49 261 192.168.99.54 255.255.255.255 On-link 192.168.99.49 261 192.168.99.55 255.255.255.255 On-link 192.168.99.49 261 192.168.99.56 255.255.255.255 On-link 192.168.99.49 261 192.168.99.57 255.255.255.255 On-link 192.168.99.49 261 192.168.99.58 255.255.255.255 On-link 192.168.99.49 261 192.168.99.59 255.255.255.255 On-link 192.168.99.49 261 192.168.99.60 255.255.255.255 On-link 192.168.99.49 261 192.168.99.61 255.255.255.255 On-link 192.168.99.49 261 192.168.99.62 255.255.255.255 On-link 192.168.99.49 261 192.168.99.64 255.255.255.255 On-link 192.168.99.49 261 192.168.99.65 255.255.255.255 On-link 192.168.99.49 261 192.168.99.66 255.255.255.255 On-link 192.168.99.49 261 192.168.99.67 255.255.255.255 On-link 192.168.99.49 261 192.168.99.68 255.255.255.255 On-link 192.168.99.49 261 192.168.99.70 255.255.255.255 On-link 192.168.99.49 261 192.168.99.71 255.255.255.255 On-link 192.168.99.49 261 192.168.99.100 255.255.255.255 On-link 192.168.99.49 261 192.168.99.108 255.255.255.255 On-link 192.168.99.49 261 192.168.99.109 255.255.255.255 On-link 192.168.99.49 261 192.168.99.112 255.255.255.255 On-link 192.168.99.49 261 192.168.99.255 255.255.255.255 On-link 192.168.99.49 261 224.0.0.0 240.0.0.0 On-link 192.168.99.49 261 224.0.0.0 240.0.0.0 On-link 10.10.10.10 261 255.255.255.255 255.255.255.255 On-link 192.168.99.49 261 255.255.255.255 255.255.255.255 On-link 10.10.10.10 261 I need to be certain, when i go on internet i go with the 192.168.99.100 how i do that ?

    Read the article

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