Daily Archives

Articles indexed Saturday November 26 2011

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

  • Create "INSERT" statements from mySQL database in Java

    - by girdus
    Does anyone know of any good libraries or scripts out there which will allow me to point to any mySQL table and automatically get a list of all the INSERT statements for the data in the table? DdlUtils allows me to create an XML file from a database model but I would like to have it in INSERT statements format and preferably the ability to choose a couple of tables instead of dumping the entire database. Thanks. EDIT: I need it to be a Java API because I want to programatically call it from my Java method.

    Read the article

  • get the row number from table view

    - by Faizan Tanveer
    i am new in iphone development, i am using table view to list name of the student, what i want to do is i want to get the row number of the cell the user pressed , currently i can get the name(string) of the cell, //code in didSelectRowAtIndexPath //the obj.name where is a string, it works fine obj.name=[obj.studentname objectAtIndex:indexPath.row]; //if i try obj.num , where num is nsinteger .i am getting errors of type i dnt understand obj.num=[[obj.studentname objectAtIndex:indexPath.row]count]; i even tried but i cant get the number. example if faizan lies on 12th cell. what i want to do is,is save 12 in a number and show it on the next view label.i cant put it in the variable thanks for your help in advance

    Read the article

  • How to delete unused sequences?

    - by user1023877
    We are using PostgreSQL. My requirement is to delete unused sequences from my database. For example, if I create any table through my application, one sequence will be created, but for deleting the table we are not deleting the sequence, too. If want to create the same table another sequence is being created. Example: table: file; automatically created sequence for id coumn: file_id_seq When I delete the table file and create it with same name again, a new sequence is being created (i.e. file_id_seq1). I have accumulated a huge number of unused sequences in my application database this way. How to delete these unused sequences?

    Read the article

  • Pointer to another classs as a property

    - by arjacsoh
    Why I receive an error when I try to create a property to another class through a pointer like that: #ifndef SQUARE_H #define SQUARE_H #include <string> //using namespace std; #include "Player.h" class Square { public: Square(int); void process(); protected: int ID; Player* PlayerOn; <--- }; #endif and the Player class is : #ifndef PLAYER_H #define PLAYER_H #include <string> //using namespace std; #include "Square.h" class Player { public: Player(int,int); // ~Player(void); int playDice(); private: int ID; int money; }; #endif I receive: syntax error missing ; before * (on the declaration of Player* PlayerOn;) and missing type specifier (on the same line...)

    Read the article

  • How to build a distributable jar with Ant for a java project having external jar dependencies

    - by Nikunj Chauhan
    I have a Java project in Eclipse with class MainClass having main method in package : com.nik.mypackage. The project also references two external libraries, which I copied in the lib folder in Eclipse and then added to build path using ADD JAR function. The libraries being one.jar and two.jar This library is in lib folder in eclipse and added to the build path. I want to create a executable JAR of the application using ant script. So that user can access my application using command: c:>java -jar MyProject-20111126.jar I know about the Eclipse plugin which directly exports a java application as runnable JAR. But I want to learn ant and the build process so manually want to create the build.xm.

    Read the article

  • Rails 3: Link_to :remote => true with JQuery?

    - by Derek
    Question update: I have figured out that importing JQuery (even without using it at all) is causing :remote => true to not work properly. I get the following error in the Chrome console: Uncaught TypeError: Object [object Object] has no method 'dispatchEvent' (prototype.js:5653) And when the link is clicked, it throws the same error again before redirecting. Responder.erb.html <ul> <% @choices.each_with_index do |choice, index| %> <li><%= link_to choice, { :action => "submit_response", :id => @id, :response => index }, :remote => true %></li> <% end %> </ul> Example generated HTML: <ul> <li><a href="/poller/submit_response/yni?response=0" data-remote="true">True</a></li> <li><a href="/poller/submit_response/yni?response=1" data-remote="true">False</a></li> </ul>

    Read the article

  • Jquery - binding click event to a variable

    - by Kayote
    All, I am really stuck/ confused at this point. I have an array with 6 items in it. Each item in the array is dynamically filled with elements using jquery '.html' method. However, I cannot seem to be able to attach/ bind an event to this dynamically created variable. As soon as the browser gets to the problem line (see the area labeled 'PROBLEM AREA'), I get a 'undefined' error, which is really confusing as all the previous code on the very same variable works just fine. var eCreditSystem = document.getElementById("creditSystem"); var i = 0; var eCreditT = new Array(6); // 6 members created which will be recycled function createCreditTransaction () // func called when a transaction occurs, at the mo, attached to onclick() { if (i < 6) { eCreditT[i] = undefined; // to delete the existing data in the index of array addElements (i); } else if (i > 5 || eCreditT[i] != undefined) { ... } } function addElements (arrayIndex) // func called from within the 'createCreditTransaction()' func { eCreditT[i] = $(document.createElement('div')).addClass("cCreditTransaction").appendTo(eCreditSystem); $(eCreditT[i]).attr ('id', ('trans' + i)); $(eCreditT[i]).html ('<div class="cCreditContainer"><span class="cCreditsNo">-50</span>&nbsp;<img class="cCurrency" src="" alt="" /></div><span class="cCloseMsg">Click box to close.</span><div class="dots"></div><div class="dots"></div><div class="dots"></div>'); creditTransactionSlideOut (eCreditT[i], 666); // calling slideOut animation console.log(eCreditT[i]); // this confirms that the variable is not undefined /* ***** THE PROBLEM AREA ***** */ $(eCreditT[i]).on ('click', function () // if user clicks on the transaction box { creditTransactionSlideBackIn (eCreditT[i], 150); // slide back in animation }); return i++; }

    Read the article

  • Archlinux auto-start after I shutdown my computer

    - by madper
    every one. I'm in a big trouble. My computer (HP ProBook 4230s) has two OS----Archlinux and Win 7. When I use Archlinux, after halt my computer, it will start up after a while without press power. And there is an other thing. My computer's clock will be wrong. Many times I change it in bios, but it wrong again. If I turn off the computer from Win 7, it will never start up untill pressing power bottom. And the clock will be right. I also used ubuntu\debian\mageia, and both of them are fine with my notebook. Is there some configure is wrong with my ArchLinux?

    Read the article

  • recursive delete trigger and ON DELETE CASCADE contraints are not deleting everything

    - by bitbonk
    I have a very simple datamodel that represents a tree structure: The RootEntity is the root of such a tree, it can contain children of type ContainerEntity and of type AtomEntity. The type ContainerEntity again can contain children of type ContainerEntity and of type AtomEntity but can not contain children of type RootEntity. Children are referenced in a well known order. The DB model for this is below. My problem now is that when I delete a RootEntity I want all children to be deleted recursively. I have create foreign key with CASCADE DELETE and two delete triggers for this. But it is not deleting everything, it always leaves some items in the ContainerEntity, AtomEntity, ContainerEntity_Children and AtomEntity_Children tables. Seemling beginning with the recursionlevel of 3. CREATE TABLE RootEntity ( Id UNIQUEIDENTIFIER NOT NULL, Name VARCHAR(500) NOT NULL, CONSTRAINT PK_RootEntity PRIMARY KEY NONCLUSTERED (Id), ); CREATE TABLE ContainerEntity ( Id UNIQUEIDENTIFIER NOT NULL, Name VARCHAR(500) NOT NULL, CONSTRAINT PK_ContainerEntity PRIMARY KEY NONCLUSTERED (Id), ); CREATE TABLE AtomEntity ( Id UNIQUEIDENTIFIER NOT NULL, Name VARCHAR(500) NOT NULL, CONSTRAINT PK_AtomEntity PRIMARY KEY NONCLUSTERED (Id), ); CREATE TABLE RootEntity_Children ( ParentId UNIQUEIDENTIFIER NOT NULL, OrderIndex INT NOT NULL, ChildContainerEntityId UNIQUEIDENTIFIER NULL, ChildAtomEntityId UNIQUEIDENTIFIER NULL, ChildIsContainerEntity BIT NOT NULL, CONSTRAINT PK_RootEntity_Children PRIMARY KEY NONCLUSTERED (ParentId, OrderIndex), -- foreign key to parent RootEntity CONSTRAINT FK_RootEntiry_Children__RootEntity FOREIGN KEY (ParentId) REFERENCES RootEntity (Id) ON DELETE CASCADE, -- foreign key to referenced (child) ContainerEntity CONSTRAINT FK_RootEntiry_Children__ContainerEntity FOREIGN KEY (ChildContainerEntityId) REFERENCES ContainerEntity (Id) ON DELETE CASCADE, -- foreign key to referenced (child) AtomEntity CONSTRAINT FK_RootEntiry_Children__AtomEntity FOREIGN KEY (ChildAtomEntityId) REFERENCES AtomEntity (Id) ON DELETE CASCADE, ); CREATE TABLE ContainerEntity_Children ( ParentId UNIQUEIDENTIFIER NOT NULL, OrderIndex INT NOT NULL, ChildContainerEntityId UNIQUEIDENTIFIER NULL, ChildAtomEntityId UNIQUEIDENTIFIER NULL, ChildIsContainerEntity BIT NOT NULL, CONSTRAINT PK_ContainerEntity_Children PRIMARY KEY NONCLUSTERED (ParentId, OrderIndex), -- foreign key to parent ContainerEntity CONSTRAINT FK_ContainerEntity_Children__RootEntity FOREIGN KEY (ParentId) REFERENCES ContainerEntity (Id) ON DELETE CASCADE, -- foreign key to referenced (child) ContainerEntity CONSTRAINT FK_ContainerEntity_Children__ContainerEntity FOREIGN KEY (ChildContainerEntityId) REFERENCES ContainerEntity (Id) ON DELETE CASCADE, -- foreign key to referenced (child) AtomEntity CONSTRAINT FK_ContainerEntity_Children__AtomEntity FOREIGN KEY (ChildAtomEntityId) REFERENCES AtomEntity (Id) ON DELETE CASCADE, ); CREATE TRIGGER Delete_RootEntity_Children ON RootEntity_Children FOR DELETE AS DELETE FROM ContainerEntity WHERE Id IN (SELECT ChildContainerEntityId FROM deleted) DELETE FROM AtomEntity WHERE Id IN (SELECT ChildAtomEntityId FROM deleted) GO CREATE TRIGGER Delete_ContainerEntiy_Children ON ContainerEntity_Children FOR DELETE AS DELETE FROM ContainerEntity WHERE Id IN (SELECT ChildContainerEntityId FROM deleted) DELETE FROM AtomEntity WHERE Id IN (SELECT ChildAtomEntityId FROM deleted) GO

    Read the article

  • Mcafee Auto-update from UNC path problem

    - by Vicky
    I have a network with 50 computers with no internet access. So instead of updating in each of them using dat file individually I tried to create a shared folder in server, and created a UNC in site repository. I downloaded the file DAT Package For Use with Mcafee AutoUpdate Architect & ePO 3.0 from http://www.mcafee.com/apps/downloads/security-updates/security-updates.aspx. When I try to update it is giving an error Error occurred while downloading file SiteStat.xml. So how fix it?

    Read the article

  • Change the order of DNS lookup when connected in the VPN

    - by qwerty2010
    Using Windows 7 Pro here. I have my LAN network adapter with DNS server 8.8.8.8 (Google's DNS). I also have OpenVPN client to connect to my company's network. If I type "nslookup" while disconnected from the VPN, I get 8.8.8.8 (from my LAN network adapter). If I type "nslookup" while connected in the VPN, I get the DNS IP from my company's network. That makes me think that when connected to the VPN all DNS's resolution are routed first to my company's DNS. How can I change this order, and make the DNS resolution be routed to 8.8.8.8 first, when I'm connected to the VPN? Thank you

    Read the article

  • Does nginx auth_basic work over HTTPS?

    - by monde_
    I've been trying to setup a password protected directory in a SSL website as follows: /etc/nginx/sites-available/default server { listen 443: ssl on; ssl_certificate /usr/certs/server.crt; ssl_certificate_key /usr/certs/server.key; server_name server1.example.com; root /var/www/example.com/htdocs/; index index.html; location /secure/ { auth_basic "Restricted"; auth_basic_user_file /var/www/example.com/.htpasswd; } } The problem is when I try to access the URL https://server1.example.com/secure/, I get a "404: Not Found" error page. My error.log shows the following error: 011/11/26 03:09:06 [error] 10913#0: *1 no user/password was provided for basic authentication, client: 192.168.0.24, server: server1.example.com, request: "GET /secure/ HTTP/1.1", host: "server1.example.com" However, I was able to setup password protected directories for a normal HTTP virtual host without any problems. Is it a problem with the config or something else?

    Read the article

  • How to install Oracle's exp / imp binaries

    - by Sotapanna
    I was browsing the net to find a solution, but I had no luck. :( How can I install Oracle's imp / exp binaries to my CentOS box without installing an Oracle Server? I'm accessing an existing Oracle database on another machine, so I only need a client here. I already installed sqlplus and its dependencies (oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm, and oracle-instantclient11.2-odbc-11.2.0.3.0-1.x86_64.rpm), but that didn't provide those tools. Do I really need to fully install Oracle? My aim is to suck a database dump from the Oracle to my CentOS box. If there is another way to do this without using exp I wouldn't feel bad about NOT using it, but it seems to me there is no alternative.

    Read the article

  • How much memory should my rails stack be consuming?

    - by Hamish
    I am running my own webserver on a 384MB VPS from Slicehost to serve two Ruby on Rails applications on separate Virtual Hosts. I am running Phusion Passenger with Apache2. The following is the contents of my Passenger.conf <IfModule passenger_module> PassengerRoot /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/passenger-2.2.11 PassengerLogLevel 0 PassengerRuby /usr/local/bin/ruby PassengerUserSwitching on PassengerDefaultUser nobody PassengerMaxPoolSize 3 PassengerMaxInstancesPerApp 2 PassengerPoolIdleTime 300 # Ruby on Rails Options RailsAutoDetect on RailsSpawnMethod smart NameVirtualHost *:80 If i do a 'top' on my server I have 314MB used on average, this seems like too much? Am I mistaken and if not what possible steps can I take to reduce the Memory usage? Thanks!

    Read the article

  • Send as another user / email address in Exchange 2010

    - by adamo
    In my setup there exist user1, ..., [email protected]. Mail for example.com is handled by Exchange 2010 and all the users user Outlook 2010. There also exists a Standard Distribution list named [email protected]. Is it possible to have some of the users being able to send email with [email protected] as the sender address? Can the sender's GECOS be different too when this happens so that the recipient sees "Offices of Example.com" instead of "User Name X"? Sometimes the secretaries need to send stuff as "the office" and not as theirselves ...

    Read the article

  • Postfix: /usr/sbin/sendmail: No such file or directory - why?

    - by Zed Said
    I am trying to get postfix working, and when I test it using mail user I enter the subject, message, ect and get the following error: mail: /usr/sbin/sendmail: No such file or directory Can't send mail: sendmail process failed Why is it talking about sendmail? I deleted that a long time ago and am using postfix. Is it still hanging around somewhere and the mail command thinks it should be using sendmail?

    Read the article

  • Crontab -- scheduling my backups

    - by Garfonzo
    I want to do a backup every Friday night (no, this is not the whole backup routine, just part of it). Each Friday night's backup will not be overwritten until 4 weeks later. So, essentially, I have a four revolving backups: Week1, week2, week3, and week4. Now, I need the week1 backup script to run every 4 weeks. But I also want week2's script to run every four weeks. I know that I can tell the crontab to execute something every X weeks/days/hours/whatever. However, how do I set it up so that each of these four scripts actually run on different weeks, how do I avoid all 4 scripts running on the same night, then dutifully waiting for weeks only to all run again? Thanks.

    Read the article

  • How do I configure a guest VM's static IP address automatically in Citrix XenServer?

    - by Kev
    To facilitate automation of guest VM provisioning, how do I set (in a script) the IP address on a guest VM's NIC (or NIC's) once a new VM has booted? Is there a way to "inject" netsh commands via the Citrix guest OS tools (for Windows for example) once the host has started? Or can this be done via the Citrix API/SDK or the xe tools? These are windows 2008 servers that have been sysprep'd so when the boot for the first time they have no IP address.

    Read the article

  • soft lockup - CPU#0 stuck for 11s! error with Xen virtual machines

    - by Arun
    Getting a kernel panic with this error on my XEN VPS's. (all on 8.04 LTS) The kernel version on my Dom-0 is 2.6.24-25-xen and the kernel version on the Xen VPS is also 2.6.24-25-xen. I read something about disabling APIC from here http://muffinresearch.co.uk/archives/2008/08/20/ubuntu-bug-soft-lockup-cpu0-stuck-for-11s/ but that doesn't seem to help as well. Anyone experienced this and are there any workarounds? Thanks in advance!

    Read the article

  • Completely remove and freshly install MySql on XP?

    - by Corey Ogburn
    I have read this question and have not found it as a solution and I have even attempted much more. I've uninstalled MySql 5.5.18 and deleted: C:\Program Files\MySql C:\Documents and Settings\All Users\Application Data\MySql After uninstalling, I restart the computer. When I reinstall, in the MySql Server Instance Configuration Wizard I leave everything to their defaults except: I add a firewall exception I check Launch MySQL Server Automatically I check Include BIN directory in windows path Enable root access from remote machines (I'll lock that down later, just debugging for now, I have also tried installing without this option to no avail) I've tried Typical and Complete while installing, as well as with and without strict mode. No combination shows a difference. After all this, it cannot Apply Security Settings and I get a 10061 error (it also said error number 2003) and this article didn't help. I've tried everything I can to completely uninstall and successfully reinstall so I can start from scratch. I've uninstalled and reinstalled about a dozen times with minor changes (including turning off the firewall at times), each time deleting the above folders and any proper registry entries with no success. Note by success, applying security settings and a working remote connection. I can connect locally every time, but it's remotely that counts. I have tried to look for exterior problems such as port forwarding in the router and (even though the installer should add it) I do double check the firewall settings, which have always allowed the default port. I'm out of ideas.

    Read the article

  • Setting up Mail Server (mx.domain.com) using MailEnable in IIS 7.5

    - by Zee Tee
    I have setup MailEnable Standard on my server and have created the PostOffice (domain/mailbox) for the domain which I intend to be using. I have the DNS settings in GoDaddy like this: A (Host) Host: '@' Points To: IP MX Record Priority: 0 Host: 'mx' Points To: @ Is there anything in IIS that needs to be done to make mx.domain.com work as a mail server that can be used in other domain names? Additionally, On the firewall, I have the Outbound port 25 open, not sure, should I be opening port 25 on Inbound as well?

    Read the article

  • How can I diff two Redhat Linux servers?

    - by Stuart Woodward
    I have two servers that have should have the same setup except for known differences. By running: find / \( -path /proc -o -path /sys -o -path /dev \) -prune -o -print | sort > allfiles.txt I can find a list of all the files on one server and compare it against the list of files on the the other server. This will show me the differences in the names of the files that reside on the servers. What I really want to do is run a checksum on all the files on both of the servers and compare them to also find where the contents are different. e.g find / \( -path /proc -o -path /sys -o -path /dev \) -prune -o -print | xargs /usr/bin/sha1sum Is this a sensible way to do this? I was thinking that rysnc already has most of this functionality but can it be used to provide the list of differences?

    Read the article

  • NginxHttpAuthBasicModule with Sinatra & Passenger

    - by scainey
    I'm serving static pages from a Sinatra application using Nginx. I've implemented Basic Authentication for one page on the site using NginxHttpAuthBasicModule, the authentication succeeds but Nginx doesn't resolve the link. Error log gives - 2010/03/22 12:15:19 [error] 7143#0: *2902 open() "/home/me/live/mysite_home/public /mypage" failed (2: No such file or directory), client: 82.71.18.122, server: mysite.com, request: "GET /mypage HTTP/1.1", host: "mysite.com" The actual file is found at: /home/me/live/mysite_home/live/mypage.erb The configuration file is: server { listen 80; server_name mysite.com; root /home/me/live/mysite_home/public; passenger_enabled on; location /mypage { auth_basic "Restricted"; auth_basic_user_file htpasswd; } } server { listen 443; server_name mysite.com; root /home/me/live/mysite_home/public; passenger_enabled on; ssl on; ssl_certificate /etc/nginx/conf/certs/server.crt; ssl_certificate_key /etc/nginx/conf/certs/server.key; keepalive_timeout 70; location /mypage { auth_basic "Restricted"; auth_basic_user_file htpasswd; } } Not sure if this is a Sinatra, Passenger or Nginx thing, or if I'm just missing something.

    Read the article

  • 1K incoming http post requests per second, each with a 10-50K file

    - by Blankman
    I'm trying to figure out what kind of server setup I will need to support: 1K http post requests per second each post will contain a xml file between 5-50K (average of 25 kilobytes) Even if I get a 100 Mb/s connection with my dedicated box (they usually give 10 Mb/s but you can upgrade), from my calculations that is about 12K kb/s which means about 480 25kb files per second. So this means I need around 3 servers then, each with 100 Mb/s connection. Would a single server running HAProxy be able to redirect the requests to other servers or does this mean I need to get something else that can handle more than 100 Mb/s to proxy things out to the other servers? If my math is off I'd appreciate any corrections you may have.

    Read the article

  • FreeBSD Ports: How can I see all dependencies, and all dependencies for those dependencies, for a port?

    - by Stefan Lasiewski
    I'm trying to build a port which depends on apache-ant. I thought I could run make build-depends-list to see all dependencies required by this port: # make build-depends-list /usr/ports/devel/apache-ant /usr/ports/java/jdk16 /usr/ports/math/gmp But after installing everything, the port had a dependency list which was a mile long: apache-ant-1.8.1 desktop-file-utils-0.15_2 gamin-0.1.10_4 gettext-0.18.1.1 gio-fam-backend-2.26.1 glib-2.26.1_1 gmp-5.0.1 inputproto-2.0 javavmwrapper-2.3.5 kbproto-1.0.4 libX11-1.3.3_1,1 libXau-1.0.5 libXdmcp-1.0.3 libXext-1.1.1,1 libXi-1.3,1 libXtst-1.1.0 libiconv-1.13.1_1 libpthread-stubs-0.3_3 libxcb-1.7 pcre-8.12 perl-5.10.1_3 pkg-config-0.25_1 python26-2.6.6 recordproto-1.14 unzip-6.0 xextproto-7.1.1 xproto How can I see all dependencies, and all subdependencies for a port?

    Read the article

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