Daily Archives

Articles indexed Sunday January 2 2011

Page 16/27 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • How to configure Xchat and IRC server to transfer files?

    - by takeshin
    How do I configure Xchat to send files? My setup: hardware router: xxx.xxx.xxx.xxx example.com | Ubuntu Server with IRC server: 192.168.1.2 Local machines: 192.168.1.x My aim is to allow to send files between the local machines. By now, they are able to talk on the local IRC channel. which ports do I need to open on the router? what do I need to configure on the server? how to configure XChat on the clients? how to troubleshoot/debug the problems?

    Read the article

  • Create attribute in XML

    - by user560411
    Hello. I have the following php code that adds data into XML and works correctly. However, in my second step I will create a form that deletes some of the elements. The problem is that I want to add an ID number and then the PHP file will search for it and delete entire node. My question is how can i add an ID into CD for this to work ? For example ( <cd id="xxxx"> ) Also, any ideas or examples of a code that deletes CD having the ID would be appreciate. insert.php ( my index file with the form ) <h1>Playlist</h1> <form action="insert2.php" method="post"> <fieldset> <label for="TITLE">TITLE:</label><input type="text" id="title" name="title" /><br /> <label for="title">BAND:</label> <input type="text" id="band" name="band"/><br /> <label for="path">YEAR:</label> <input type="text" id="year" name="year" /> <br /> <input type="submit" /> </fieldset> </form> <h2>Current entries:</h2> <p>TITLE - BAND - YEAR</p> <?php $doc = new DOMDocument(); $doc->load( 'insert.xml' ); $CATEGORIES = $doc->getElementsByTagName( "CD" ); foreach( $CATEGORIES as $CD ) { $TITLES = $CD->getElementsByTagName( "TITLE" ); $TITLE = $TITLES->item(0)->nodeValue; $BANDS= $CD->getElementsByTagName( "BAND" ); $BAND= $BANDS->item(0)->nodeValue; $YEARS = $CD->getElementsByTagName( "YEAR" ); $YEAR = $YEARS->item(0)->nodeValue; echo "<b>$TITLE - $BAND - $YEAR\n</b><br>"; } ?> inser2.php ( the main code ) <?php $CD = array( 'TITLE' => $_POST['title'], 'BAND' => $_POST['band'], 'YEAR' => $_POST['year'], ); $doc = new DOMDocument(); $doc->load( 'insert.xml' ); $doc->formatOutput = true; $r = $doc->getElementsByTagName("CATEGORIES")->item(0); $b = $doc->createElement("CD"); $TITLE = $doc->createElement("TITLE"); $TITLE->appendChild( $doc->createTextNode( $CD["TITLE"] ) ); $b->appendChild( $TITLE ); $BAND = $doc->createElement("BAND"); $BAND->appendChild( $doc->createTextNode( $CD["BAND"] ) ); $b->appendChild( $BAND ); $YEAR = $doc->createElement("YEAR"); $YEAR->appendChild( $doc->createTextNode( $CD["YEAR"] ) ); $b->appendChild( $YEAR ); $r->appendChild( $b ); $doc->save("insert.xml"); ?> the XML file <?xml version="1.0" encoding="utf-8"?> <MY_CD> <CATEGORIES> <CD> <TITLE>NEVER MIND THE BOLLOCKS</TITLE> <BAND>SEX PISTOLS</BAND> <YEAR>1977</YEAR> </CD> <CD> <TITLE>NEVERMIND</TITLE> <BAND>NIRVANA</BAND> <YEAR>1991</YEAR> </CD> </CATEGORIES> </MY_CD>

    Read the article

  • crowd website simulation on localhost for a php/mysql project

    - by Mac Taylor
    hey guys I searched for a while on how to find a benchmarking software that can simulate crowd website with more than 1000 users online to find out leaks in my php/mysql script . as long as i ran my script for a huge community and it wasn't successful enough and lots of RAM usage happened , now I need a way to simulate that much usage to benchmark my script and optimize it . I am using XAMMP Local Server and my project written in PHP&MYSQL. thanks in advance

    Read the article

  • Base class -> Derived class and vice-versa conversions in C++

    - by Ivan Nikolaev
    Hi! I have the following example code: #include <iostream> #include <string> using namespace std; class Event { public: string type; string source; }; class KeyEvent : public Event { public: string key; string modifier; }; class MouseEvent : public Event { public: string button; int x; int y; }; void handleEvent(KeyEvent e) { if(e.key == "ENTER") cout << "Hello world! The Enter key was pressed ;)" << endl; } Event generateEvent() { KeyEvent e; e.type = "KEYBOARD_EVENT"; e.source = "Keyboard0"; e.key = "SPACEBAR"; e.modifier = "none"; return e; } int main() { KeyEvent e = generateEvent(); return 0; } I can't compile it, G++ throws an error of kind: main.cpp: In function 'int main()': main.cpp:47:29: error: conversion from 'Event' to non-scalar type 'KeyEvent' requested I know that the error is obvious for C++ guru's, but I can't understand why I can't do the conversion from base class object to derived one. Can someone suggest me the solution of the problem that I have? Thx in advice

    Read the article

  • How can I get a Dialog style activity window to fill the screen?

    - by Matthias
    I am using an activity with the dialog theme set, and I want it to be full screen. I tried all sorts of things, even going through the WindowManager to expand the window to full width and height manually, but nothing works. Apparently, a dialog window (or an activity with the dialog theme) will only expand according to its contents, but even that doesn't always work. For instance, I show a progress bar circle which has width and height set to FILL_PARENT (so does its layout container), but still, the dialog wraps around the much smaller progress bar instead of filling the screen. There must be a way of displaying something small inside a dialog window but have it expand to full screen size without its content resizing as well?

    Read the article

  • Given a word, how do I get the list of all words, that differ by one letter?

    - by user187809
    Let's say I have the word "CAT". These words differ from "CAT" by one letter (not the full list) CUT CAP PAT FAT COT etc. Is there an elegant way to generate this? Obviously, one way to do it is through brute force. pseduo code: while (0 to length of word) while (A to Z) replace one letter at a time, and check if the resulting word is a valid word If I had a 10 letter word, the loop would run 26 * 10 = 260 times. Is there a better, elegant way to do this?

    Read the article

  • Is there an Objective-C algorithm like `transform` of the C++ STL?

    - by pesche
    My goal is to have an array that contains all filenames of a specific extension, but without the extension. There's an elegant solution to get all filenames of a specific extension using a predicate filter and instructions on how to split a path into filename and extension, but to combine them I would have to write a loop (not terrible, but not elegant either). Is there a way with Objective-C (may be similar to the predicate mechanism) to apply some function to every element of an array and put the results in a second array, like the transform algorithm of the C++ STL does?

    Read the article

  • Constructor Injection and when to use a Service Locator

    - by Simon
    I'm struggling to understand parts of StructureMap's usage. In particular, in the documentation a statement is made regarding a common anti-pattern, the use of StructureMap as a Service Locator only instead of constructor injection (code samples straight from Structuremap documentation): public ShippingScreenPresenter() { _service = ObjectFactory.GetInstance<IShippingService>(); _repository = ObjectFactory.GetInstance<IRepository>(); } instead of: public ShippingScreenPresenter(IShippingService service, IRepository repository) { _service = service; _repository = repository; } This is fine for a very short object graph, but when dealing with objects many levels deep, does this imply that you should pass down all the dependencies required by the deeper objects right from the top? Surely this breaks encapsulation and exposes too much information about the implementation of deeper objects. Let's say I'm using the Active Record pattern, so my record needs access to a data repository to be able to save and load itself. If this record is loaded inside an object, does that object call ObjectFactory.CreateInstance() and pass it into the active record's constructor? What if that object is inside another object. Does it take the IRepository in as its own parameter from further up? That would expose to the parent object the fact that we're access the data repository at this point, something the outer object probably shouldn't know. public class OuterClass { public OuterClass(IRepository repository) { // Why should I know that ThingThatNeedsRecord needs a repository? // that smells like exposed implementation to me, especially since // ThingThatNeedsRecord doesn't use the repo itself, but passes it // to the record. // Also where do I create repository? Have to instantiate it somewhere // up the chain of objects ThingThatNeedsRecord thing = new ThingThatNeedsRecord(repository); thing.GetAnswer("question"); } } public class ThingThatNeedsRecord { public ThingThatNeedsRecord(IRepository repository) { this.repository = repository; } public string GetAnswer(string someParam) { // create activeRecord(s) and process, returning some result // part of which contains: ActiveRecord record = new ActiveRecord(repository, key); } private IRepository repository; } public class ActiveRecord { public ActiveRecord(IRepository repository) { this.repository = repository; } public ActiveRecord(IRepository repository, int primaryKey); { this.repositry = repository; Load(primaryKey); } public void Save(); private void Load(int primaryKey) { this.primaryKey = primaryKey; // access the database via the repository and set someData } private IRepository repository; private int primaryKey; private string someData; } Any thoughts would be appreciated. Simon

    Read the article

  • How to use HSQLDB in Oracle query syntax mode?

    - by Jan Algermissen
    I am trying to use HSQLDB as an embedded database in a spring application (for testing). As the target production database is Oracle, I would like to use HSQLDBs Oracle syntax mode feature. In the Spring config I use <jdbc:embedded-database type="HSQL" id="dataSource"> </jdbc:embedded-database> <jdbc:initialize-database data-source="dataSource" enabled="true"> <jdbc:script location="classpath:schema.sql"/> </jdbc:initialize-database> And in schema.sql at the top I wrote: SET DATABASE SQL SYNTAX ORA TRUE; However, when running my test, I get the following error: java.sql.SQLException: Unexpected token: DATABASE in statement [SET DATABASE SQL SYNTAX ORA TRUE] Is this a syntax error or a permissions error or something entirely different? Thanks - also for any pointers that might lead to the answer. Given that HSQL is the Spring default for jdbc:embedded-database and given the target is Oracle, this scenario should actually be very common. However, I found nothing on the Web even touching the issue.

    Read the article

  • passing session id via url

    I'm trying to get my script to use url session id instead of cookies. The following page is not picking up the variable in the url as the session id. I must be missing something. First page http://www.website.com/start.php ini_set("session.use_cookies",0); ini_set("session.use_trans_sid",1); session_start(); $session_id = session_id(); header("location: target.php?session_id=". $session_id ); Following page - http://www.website.com/target.php?session_id=rj3ids98dhpa0mcf3jc89mq1t0 ini_set("session.use_cookies",0); ini_set("session.use_trans_sid",1); print_r($_SESSION); print(session_id()) Result is a different session id and the session is blank. Array ( [debug] = no ) pt1t38347bs6jc9ruv2ecpv7o2

    Read the article

  • find out the origin of function calls

    - by user560343
    Hi all, I wonder if there is a software that can help us determine all possible origins of a function call. For example: /* in file f1.c */ int f1() { x_func(); } /* in file f2.c */ int f2() { x_func(); } If we want to trace the origin of all function calls to x_func(), the output will be: f1.c:f1() f2.c:f2() This is very useful when reading the source code. All answers are appreciated. Thank in advance :D

    Read the article

  • erlang node not responding

    - by vinnitu
    I received such message in erlang condose at first@localhost node =ERROR REPORT==== 1-Jan-2011::23:19:28 === ** Node 'second@localhost' not responding ** ** Removing (timedout) connection ** My question is - what is timeout in this case? How much time before causes this event? Howto prevent this "horror"? I can restore\recover to normal work only by restart node... But what is the right way? Thank you, and Happy New Year!

    Read the article

  • How do you crop a specific area with paperclip in Rails (3)?

    - by Smickie
    Hi, I have paperclip in Rails (3) working with simple cropping, for example the blow code makes a simple crop of the thumbnail: has_attached_file :image, :styles => { :thumb => "90x90#" }, :default_style => :thumb However I was wondering how do you crop a very specific area of an image; lets say you have an x and y coordinate to start from and then a width and height of the crop. How do you go about passing a complex style like this in? Thanks very much.

    Read the article

  • (iphone) can i give different intervals between images when animating?

    - by Eugene
    Hi, I'm animating several image as follows. UIImageView* animationView = [[UIImageView alloc] initWithFrame: self.animationViewContainer.bounds]; animationView.animationImages = animationArray; animationView.animationDuration = 0.5; animationView.animationRepeatCount = 5; [animationView startAnimating]; What I'd like to do is, controlling duration between animationImages. For instance, show image1 for 0.3 sec image2 for 0.5 sec.. There must be some way to do this, but hard to find an answer. I've asked the same question here before, but wording of the question wasn't so clear. Thank you

    Read the article

  • ASP.Net Gridview, How to activate Edit Mode based on ID (DataKey)

    - by Jon P
    I have a page, lets call it SourceTypes.aspx, that has a a GridView that is displaying a list of Source Types. Part of the GridView is a DataKey, SourceTypeID. If source TypeID is passed to the page via a query sting, how to I put the Gridview into Edit mode for the appropriate row based on the SourceTypeID? The GridView is bound to a SQlDataSource object. I have a feeling I am going to kick myself when the answer appears!! I have looked at Putting a gridview row in edit mode programmatically but it is some what lacking in specifics

    Read the article

  • Survey statistic diagram ideas

    - by Nort
    Hey everyone, I've got some homework tasks in topic surveys and diagrams. The first task is to normalize the input of a survey, because the structure of the data is changing from time-to-time. So there are three types of surveys: static fields, where text is stored dynamic ones, where the user can select one option and multiselect fields, where the user can select multiple options So I'm not really a statistics guy, so I have really no idea what I can do with that incomming data. So the data I have is stored in an orbital XML file from there I can easily get how man times a survey was filled, and how many times a field was filled, so I can (for eg on a pie chart show the relation of filled or not filled). The second idea is to show the relation between the content of a multi option element using a bar chart or so. In case of the multi option elements I've got the idea to show data in implication of one option. But the question is, what could be shown? The other problem are the static elements (text fields and so). What data could be represented from a single field? The data in the XML field is collected from 2001 to 2005 So maybe I can work with the dates of the surveys, but as I said, i don't really know how to process the data, to collect as much data as possible.

    Read the article

  • Jquery live() vs delegate()

    - by PeeHaa
    I've read some posts here and on the web about the differences of live() and delegate(). However I haven't found the answer I'm looking for (if this is a dupe please tell me). I know the difference between live and delegate is that live can not be used in a chain. As I also read somewhere delegate is in some case faster (better performance). So I am wondering is there a situation where you would use live instead of delegate?

    Read the article

  • Portfolio problem on a flash template

    - by Nikko
    Hi guys! I have another question about the same template as before. in my website. (www.nikstudio.cl) I need to show in the webpage's portfolio (menu "trabajos") show a few pictures. If you click the thumbnail picture you can see the full size version of that thumbnail. My problem are two: First the picture one and two are the same as five a six ( and i can't change it cause i don't find the place to do this.) And the second is when I copy and paste (in a new layer) of the movieclip "sprite 656" i get in the swf a new picture on the portfolio but i can't click it. Can you help me why is that??? pd: the full template is here. (the .fla an all the files) http://www.2shared.com/file/xbGOYnzC/TM20653ByWMForce.html thanks

    Read the article

  • What is the easiest way to get XtraDB for MySQL running on CentOS 5

    - by Jeremy Clarke
    I'm having a lot of issues with a dedicated MySQL server and it seems like upgrading to the XtraDB version of InnoDB will probably have a positive effect, but I'm hesitant to get involved with it since I am not really a sysadmin and prefer to stick with things that start with "yum update". What is the easiest way to get XtraDB installed? Should I use the Percona server? MariaDB? OurDelta? Is there a way to avoid using custom RPMs and sticking to a repo instead? The current yum version of MySQL is 5.0.xx, whereas a lot of the alternate MySQL builds are based on 5.1.xx. How does this factor in? Do I need to figure out 5.1 on CentOS before working on getting XtraDB in? For bonus points: Do I need to seriously test XtraDB with my server before implementing it, or is it relatively safe to have the brief downtime for switching servers followed by putting the site back online with XtraDB?

    Read the article

  • Not able to installl mysql-server ubuntu

    - by makdotgnu
    I'm not able to install mysql-server on ubuntu 10.04 I had installed mysql but it was giving this error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) So I removed mysql-server completely from synaptic but after this i'm not able to reinstall it. When I try to reinstall it synaptic fridges. how to do remove each file of mysql and install it ?

    Read the article

  • Samba users not added untill they logon first? Edit: How do I add users to tdbsam without a password prompt?

    - by glisignoli
    I add users to my server with the command useradd -m -p PASS_HASH -s /usr/sbin/nologin USERNAME Then I try to access their samba home share, but it never shows up until I login with the user: root:~$sudo login failtest Password:###### Added user failtest. Is there some way of added the user without logging in? Edit: The problem is that the user is added with the useradd command, but ubuntu seems to run an initalisation script when the user logs on for the first time. This script then adds that user to the tdbsam user database. Finding the initalisation script or the method it uses to add a user to the tdbsam database without requiring any user input (as smbpasswd -a USER prompts the user for a password). So all I need is a way to add a user+pass to the tdbsam database without prompting a user for a password (eg: samaba-add-user.sh USERNAME PASSWORD).

    Read the article

  • Router with Wake On LAN

    - by Jaroslav Záruba
    I'm looking for a new WiFi router, and one key feature for me is WOL. Seems like many routers won't do this w/ factory firmware. Given my last router (Asus WL-520g) turned into a disco-brick couple hours after flashed DD-WRT I'd prefer if the new one supported WOL (Wake on LAN) out of the box. Other required features would be: DynDNS service support Port forwarding NAT loopback so I can access services running in my own network using dyndns hostname or public IP w/o getting too old (for example DIR-615 with factory firmware lets you wait literally minutes)

    Read the article

  • MD5 and SHA1 checksum uses for downloading

    - by Zac
    I notice that when downloading a lot of open source tools (Eclipse, etc.) there are links for MD5 and SHA1 checksums, and didn't know what these were or what their purpose was. I know these are hashing algorithms, and I do understand hashing, so my only guess is that these are used for hashing some component of the download targets, and to compare them with "official" hash strings stored server-side. Perhaps that way it can be determined whether or not the targets have been modified from their correct version (for security and other purposes). Am I close or completely wrong, and if wrong, what are they?!?! Thanks!

    Read the article

  • Accessing two networks connected to gateway from behind the gateway

    - by Babar
    I have a Windows XP machine acting as internet gateway. It is connected to two different networks, one, say LAN1, connects to internet and other, say LAN2, to outside LAN. My machine is sitting behind the gateway. I have set up internet connection sharing on LAN1 and can access internet on my machine but i can't access anything from LAN2. Is it possible to access internet from LAN1 and yet be able to access PC's on LAN2? -------------- --------- | Lan 1 | | Lan 2 | | (Internet) | --------- -------------- ^ ^ | | | -------------------------- | Win XP Gateway | -------------------------- ^ | -------------- | My Machine | -------------- EDIT: Gateway is equipped with 3 lan sockets, two are connected to Lan 1 & 2, third one is connected to switch. And my machine also connects to that same switch.

    Read the article

  • portfolio building, working for closed-source vs open-source?

    - by jondavidjohn
    I've currently graduated from my first run at higher education, landed my first full-time gig as a web application developer, and absolutely love it. My question is that in looking for jobs I ran across many jobs that require a certain level of experience and code examples. Much of the work I am doing is both protected by a login, and closed source. How does someone, that is just starting out and needs to be building a resume, go about preparing for the next job. (no matter how much i love my current job, i feel like it's only responsible to always be preparing)

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >