Hi,
I am trying to parse an xml file using XmlReader but although I am getting a return from the xml file for the (commission) node for some reason I am getting an empty SimpleXMLElement Object returned as well. I don't know if its something to do with while loop,switch or something I missed in the parse setup.
This is the xml file I am trying to read from, as you can see there is only 1 result returned:
<?xml version="1.0" encoding="UTF-8"?>
<cj-api>
<commissions total-matched="1">
<commission>
<action-status>
new
</action-status>
<action-type>
lead
</action-type>
<aid>
10730981
</aid>
<commission-id>
1021015513
</commission-id>
<country>
</country>
<event-date>
2010-05-08T08:08:55-0700
</event-date>
<locking-date>
2010-06-10
</locking-date>
<order-id>
345007
</order-id>
<original>
true
</original>
<original-action-id>
787692438
</original-action-id>
<posting-date>
2010-05-08T10:01:22-0700
</posting-date>
<website-id>
3201921
</website-id>
<cid>
2815954
</cid>
<advertiser-name>
SPS EurosportBET
</advertiser-name>
<commission-amount>
0
</commission-amount>
<order-discount>
0
</order-discount>
<sid>
0
</sid>
<sale-amount>
0
</sale-amount>
</commission>
</commissions>
</cj-api>
This is my parser:
<?php
// read $response (xml feed)
$file = "datafeed.xml";
$xml = new XMLReader;
$xml->open($file);
// loop to read in data
while ($xml->read()) {
switch ($xml->name) {
// find the parent node for each commission payment
case 'commission':
// initalise xml parser
$dom = new DomDocument();
$dom_node = $xml ->expand();
$element = $dom->appendChild($dom_node);
$dom_string = $dom->saveXML($element);
$commission = new SimpleXMLElement($dom_string);
// read in data
$action_status = $commission->{'action-status'};
$action_type = $commission->{'action-type'};
$aid = $commission->{'aid'};
$commission_id = $commission->{'commission-id'};
$country = $commission->{'country'};
$event_date = $commission->{'event-date'};
$locking_date = $commission->{'locking-date'};
$order_id = $commission->{'order-id'};
$original = $commission->{'original'};
$original_action_id = $commission->{'original_action-id'};
$posting_date = $commission->{'posting-date'};
$website_id = $commission->{'website-id'};
$cid = $commission->{'cid'};
$advertiser_name = $commission->{'advertiser-name'};
$commission_amount = $commission->{'commission-amount'};
$order_discount = $commission->{'order-discount'};
$sid = $commission->{'sid'};
$sale_amount = $commission->{'sale-amount'};
print_r($aid);
break;
}
}
?>
The result is :
SimpleXMLElement Object ( [0] => 10730981 ) SimpleXMLElement Object ( )
Why is it returning the second object: SimpleXMLElement Object ( ) and what do I need to do correct it? Thanks.
So far I used
trap " call function" 2
fucntion
{
./test.sh
exit
}
but it never reaches the exit line and a whole bunch of process piles up any one got any idea?
I tried & (bg) but i need to be able to keep doing it , the bg only allows me to do it once
The point of it is when i type ctrl C it should terminate the original test.sh but it should also call itself before terminating hence create a new process.
I've tried using the following:
:map j 3j
When I do this and reload the .vimperatorrc file, it actually starts zooming in the page I'm on. The funny thing is, if I type 3j on a page without any mapping, it works. I'm using Vimperator 2.3.1 with Firefox 3.6.3.
Am I missing something?
Thanks!
So I got
Host: Hyper-v enabled machine with four NICs, only one enabled.
Network type: External
IP configuration are correct for both host and guest (getting it from the DHCP of the company network)
The same configuration works on a machine with single NIC
But With this other machine, with 4 NICs, there is no Internet in the guest, actually it can't ping any IP expect the host (pings host IP only, not the name)
I searched the Internet and did every solution, more than once, with no success.
How does one judge potential memory and processor needs for linux web servers? Specifically, given:
A Debian or Ubuntu OS
Running a web server (apache2), and
A database (MySQL), and
A DNS server (bind), and
Being used by up to 100 concurrent users, at some points each downloading high-resolution (0.5 to 1 MB) images via a web app.
How much should one budget in terms of RAM, type of processor(s), and number of cores?
Thanks!
My goal is to allow people to upload and download large files through their web browser with a simple user interface and user password/account management. Yousendit offers a service like what I am looking for, but it does not make sense to use their service if I already have a web server.
Is there an open source version of Yousendit that I can run on my own web server?
What is this type of software or service called? (calling it an FTP Server does not seem to fit)
Back in Windows 95 OSR2 (I believe), there was a conversion tool that would take your extant FAT16 partition and change it to FAT32 non-destructively (most of the time).
Are there any tools like that now for going from one file system type to another in situ without destroying the data?
For example, from etx3 to ext4? Or NTFS to XFS?
I am using un-ordered lists that nests some divs to show the desired output on screen. I am using css to style them and they seem to look perfect on chrome and firefox. But in IE(8) it looks there is a problem which I was unable to locate.
I am using the below CSS
<style type="text/css">
.ur_container {width:980px; padding: 0; margin: 0;}
.ur_container ul.bx_grp {list-style-type: none; padding: 0px; margin: 0px; }
.ur_container ul.bx_lnx {list-style-type: none; padding: 5px; margin: 0px; }
.bx_grp {border:1px solid #c5c5c5; background-color: yellow; margin:0; padding:0;}
.bx_grp_header {background-color: #d6d6d6; border-bottom:1px solid #acacac;}
.bx_grp_title {float: left; font: bold 11px Arial; padding:5px;}
.bx_grp_options {float: right; font: 10px Arial; padding: 5px;}
.bx_grp_options a{color: #125B93; text-decoration: none; }
.bx_lnx {padding:0px; background-color: red;}
.bx_lnx_header {font:11px Arial; color:#333;}
.bx_lnx_title {float: left;}
.bx_lnx_refno {background-color:#333; color: fff; padding: 1px; margin-right: 5px; }
.bx_lnx_options {float: right;}
.bx_lnx_options a {color: #258CF4; text-decoration: none;}
.bx_lnx_url {font: 9px Arial; color: #999; margin-top: 4px; }
.bx_lnx_notes {}
.bx_lnx_notes span {background-color: #FDFFCC; color: #666; font: 9px Arial; padding:2px;}
.bx_lnx_tags {}
.bx_lnx_tags span {background-color: #efefef; border-bottom: 1px solid #ccc; color: #666; font: 9px Arial; padding: 1px 2px 1px 2px; margin-right: 5px;}
</style>
Against the following HTML
<div class="ur_container">
<ul class="bx_grp" id="grp_1">
<li>
<div class="bx_grp_header">
<span class="bx_grp_title">Personal File</span>
<span class="bx_grp_options"><a href="#">rename</a> • <a href="#">make private</a> • <a href="#">hide</a href="#"> • <a href="#">delete</a></span>
<div style="clear: both;"></div>
</div>
</li>
<li>
<ul class="bx_lnx" id="lnx_1">
<li>
<div class="bx_lnx_header">
<span class="bx_linx_title"><span class="bx_lnx_refno">#3103</span>How to file personal files</span>
<span class="bx_lnx_options"><a href="#">edit</a> • <a href="#">move</a> • <a href="#">delete</a></span>
</div>
</li>
<li class="bx_lnx_url">http://www.google.com</li>
<li class="bx_lnx_notes"><span>search google for this</span></li>
<li class="bx_lnx_tags"><span>personal</span><span>file</span><span>google</span></li>
</ul>
</li>
</ul>
</div>
Which produces this output in Chrome and Fireworks
and the following in IE
The yellow and red colors was used in order to show that is being going wrong. The yellow part is the undesired one.
Can anyone point me in the right direction please ?
Regards
Using 'dd' to clone a USB drive
-cfdisk:
resized the destination partition to be of same size
made the partition bootable
same 'type' ext3
ran 'mkfs.ext3' after exit cfdisk
then
dd if=dev/sda1 of=/dev/sdb1
result booting: Missing operating system.
The source USB device boots on multiple laptops
USB destination filesystem looks the same....
Any idears?
In Ubuntu, when we right-click a icon and use "open with", there is an option to remember that application for that file's type.
For some reason, my system is no more memorizing the application (I think it was aftare some update).
And, even when I have already used the "open with" command, the application is not showing in the "open with" list, so I have, everytime, to go to "open with"-"Other Application".
Any hint to solve this?
Is it possible to do web searches for ROT13 text?
I guess you could type in the literal ROT13'd text you're after, but that'd only cover exact matches.
Background: Became curious once I did a ROT13 tweet about a tv program being a mockumentary.
Does anyone know of a utility (any OS or online) that, with a string input, identifies the encoding type (checksum, base64, etc) and if possible (and appropriate) decodes the string?
What is the best way to create apple iPhone/iPod shaped icons, ideally there should be a website that you can upload images to and have an them shaped to the default shape, etc.
Does this exists? What is the best way to great these icons?
I did find this: http://elitebydesign.com/design-the-itunes-icon-for-the-iphone-and-ipod-touch/
But there should be a batch type program out there somewhere...
The Mac OS X Server homepage tells of a feature "Mobile Access Server":
http://www.apple.com/server/macosx/features/mobile-access.html
But the text is very marketingy and doesn't actually say what it does? Is it a type of VPN or a remote desktop thingy or what?
I recently started learning and using Bootstrap 3. I figured I would start with something simple- a header and a dropdown bar. I used the code from the Bootstrap website.
I started out with the basic Bootstrap template, then added the bootstrap navbar. This is my code so far.
<!DOCTYPE html>
<html>
<head>
<title>WEBSITE NAME</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../../assets/js/html5shiv.js"></script>
<script src="../../assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<h1>WEBSITE NAME</h1>
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Tutorials</a></li>
<li><a href="#">Software</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://twitter.com/"><span class="glyphicon glyphicon-comment"></span> Twitter</a></li>
<li><a href="https://youtube.com/"><span class="glyphicon glyphicon-facetime-video"></span> YouTube</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="//code.jquery.com/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
The dropdown menu is absolutely not working at all- hovering or clicking it. What do I need to do?
I need to download from an FTP site.
It has limits such as 1000 files per hour.
Is there FTP software where you can create rules that will download to these type of specifications? So the FTP software will stop downloading and wait an hour, then keep downloading?
When I open a bash terminal in OSX and then type Alt + F to got back one word it instead opens the find dialog? many of the other key-bindings have similar problems. How can I change this?
I have a bootable .img file that I want to convert to a bootable .iso file. I downloaded poweriso for Mac and used this command: poweriso convert MyOS.img -o MyOS.iso -ot iso which returned this output:
PowerISO Copyright(C) 2004-2008 PowerISO Computing, Inc
Type poweriso -? for help
MyOS.img: The file format is invalid or unsupported.
I thought PowerISO could convert .img to .iso. Was I incorrect, or did I use the wrong commands or something like that?
Hi, I am using tcsh and define an environmental variable as follows:
setenv mycomp [email protected]
so that when I need to copy files from the remote my.computer.com, I type the following:
scp $mycomp:sourcepath destpath
But when I do this, I get the following error: "Bad : modifier in $ (m)." where (m) is the first character after the colon.
What is this error telling me, and how can I fix it?
I'm using CentOS and when type the command:
iptables -L -v
The output is as follows:
Chain INPUT (policy ACCEPT 19614 packets, 2312K bytes) pkts bytes
target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target
prot opt in out source destination
Chain OUTPUT (policy ACCEPT 13881 packets, 32M bytes) pkts bytes
target prot opt in out source destination
What does this means
I'm able to connect using SSH. Where can I see that rule?
I have managed to leave the make default option ticked when using the "open with" option in windows 7. I ideally want this removed so the OS can manage the file type as before. I can't find the menu to remove this anywhere, I'm sure it used to be in the folder options panel in XP.
Thanks
I want to reduce the brightness of my monitor as per my wish .
But ubuntu System-Prefernce-Monitor doesn't have options and I think that coz it uses generic drivers . How do I fix this problem ?
Model is Acer One Zg5 , Ubuntu 10.10 OS . Do I load the LCD driver ? I think it has a intel based inbuilt GFX card .
/proc/acpi/video/OVGA/LCD$ cat *
device_id: 0x0400
type: UNKNOWN
known by bios: no
state: 0x1d
query: 0x00