samsons17 -4 Posting Whiz in Training

I have this XML data which basically to add/minus/multiply the two numbers. And I have this Xquery function that suppose to convert this XML data into a readable string format.

For example, let say XML file has in this form :

<expr>
    <add> 
     <number>2</number>
     <number>3</number> 
    </add>
</expr>
<expr>
    <divide>
        <number>7</number>
        <times>
            <number>1</number>
            <number>6</number>
        </times>
    </divide>
</expr>

the Xquery function will be able to convert this into "2 + 3" and 7 / (1 * 6) respectively through the local:convertExpr function

Below is the sample of the Xquery that I am working right now :

Xquery File :

declare function local:convertExpr($expr) {
    (: function to convert XML into a readable string format :)

    let $number := data($expr[1])

    let $x := $number
    return $x
};

validate{<html>
    <head>
        <title>{/*/q:title/text()}</title>
        <script type="text/javascript" src="miniformvalidator.js"/>
    </head>
    <body>
        <h1>{/*/q:title/text()}</h1>
        <form>
            <ol>
            {
                let $exprs := /*/q:expr, 
                    $count := count($exprs)
                 for $i in (1 to $count)
                 let $expr := $exprs[$i]
                 return <li>{local:convertExpr($expr)}</li>
            }
            </ol>
        </form>

    </body>
</html>}

I am able to pull all the numbers within the tags right now, but I am not sure how I can connect these numbers to become one readable string.

Please help. Thanks! :)

samsons17 -4

Hi watael,

I finally figured out whats wrong and the correct way to do that,

actually when we are using sed, i noticed that we need to echo out the data first before we could modify them.So i ended up writing the code like this which turns out to be working correctly like what i wanted :

#!/bin/sh

error=`sed 's/<record//g' HSBB_voice_20120925_0000000182.cdr.bc_lerr.xml`

save_error=`echo "$error"|cat > $msg`

anyways, thanks for your helps and suggestions :)

samsons17 -4

or maybe even to make it simpler, i decide to just make the ouput become just like below :

record_no = "62" error_code="100">D20|000000063|56604960 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579536|1348579538|3|0|IDD|Flat Rate

record_no = "63" error_code="100">D20|000000064|7A257C4E 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579572|1348579620|48|0|IDD|Flat Rate

this means, now i just have to figure out how to remove "<record" from the beginning of each line.

i cannot use sed, so i dont know why and dont know what else i could try to do this..I have tried using grep, but thats only working if i just have one line, and not multiple lines like this case.

any help?thanks..

samsons17 -4

hi watael,

thanks for your help..but still the same errors occur after i follow exactly like what you said :

#!/bin/sh

msg=/var/Batch/UEL_Data/uel/test/msg.log
sed -n '/^<record/{s/"\|<//g; s/>\|_/ /g;p}' HSBB_voice_20120925_0000000182.cdr.bc_lerr.xml > "$msg"

i still got this :

sed: Function /^<record/{s/"|<//g; s/>|_/ /g;p} cannot be parsed.

samsons17 -4

HI Watael,

yeah, i just learned shell script via the internet and very new to this..
anyways, i wrote the line like this :

file="sed -n '/^<record/{s/"|<//g; s/>|_/ /g;p}' HSBB_voice_20120925_0000000182.cdr.bc_lerr.xml"

test_out=echo "$file" |cat > $msg

but get the error below :

sed: Function /^<record/{s/"|<//g; s/>|_/ /g;p} cannot be parsed.

what problem could it be? thankss for your help..

samsons17 -4

or the output could be like below if it make this any simpler :

record_no = "62" error_code="100" D20|000000063|56604960 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579536|1348579538|3|0|IDD|Flat Rate

record_no = "63" error_code="100" D20|000000064|7A257C4E 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579572|1348579620|48|0|IDD|Flat Rate

record_no = "64" error_code="100" D20|000000065|5661A576 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579556|1348579559|3|0|IDD|Flat Rate

samsons17 -4 Posting Whiz in Training

Hi there,

I have the xml file (HSBB_voice_20120925_0000000182.cdr.bc_lerr.xml) that contains data between tags that i want to extract.

The sample data from the xml file that i have etracted is like below :
D20|000000063|56604960 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579536|1348579538|3|0|IDD|Flat Rate D20|000000064|7A257C4E 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579572|1348579620|48|0|IDD|Flat Rate D20|000000065|5661A576 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579556|1348579559|3|0|IDD|Flat Rate --------------------------------------------------------------------------------- but from those data i extracted, i wanted to create the outpurt like : --------------------------------------------------------------------------------- record no: 62, error code: 100, D20|000000063|56604960 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579536|1348579538|3|0|IDD|Flat Rate record no: 63, error code: 100, D20|000000064|7A257C4E 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579572|1348579620|48|0|IDD|Flat Rate record no: 64, error code: 100, D20|000000065|5661A576 071411E2 BC9D24B6 FDB63DEA|6088342010|0166662635|DEFAULT|1348579556|1348579559|3|0|IDD|Flat Rate --------------------------------------------------------------------------------- what i have done so far is here : #!/bin/sh tmp=grep.log output=output.log file=`cat HSBB_voice_20120925_0000000182.cdr.bc_lerr.xml|grep "

samsons17 -4

I am sorry. Its actually have three column, which is account number, customer name and also the amount pay by cutomer. So the program will only assume the line is duplicate if all of these three column are the same.

Please refer to the sample below :

duplicate3

Thanks :)

samsons17 -4 Posting Whiz in Training

Hi, let say that i have this excel file that contains column of account number and the name of the customer. And I want to extract any of the data that have duplicate. And the script should be able to get the duplicate only if the both of the account number and the name of the person have been duplicated. If let say only acocunt number is duplicated, then it is not considered duplicate. Please refer the screenshot below :

duplicate

So, how suppose i do this? thanks.

samsons17 -4 Posting Whiz in Training

Im reading a code for enhancement right now, but have little bit problem in understanding this portion of code in a file :

my $dateAndtime = `date`;
$dateAndtime =~ tr// /;
print "Start : ".$dateAndtime."\n";

As far as i know the "tr" code is for deleting or replacing something in a string..but what actually it does here?
help please,, thanks :)

samsons17 -4

thank you for your suggestion..
I'll try my luck there :)

samsons17 -4 Posting Whiz in Training

Hello,,

I am not sure if this whether is this a correct page to post my question.Sorry if i am wrong.

Anyways, I am trying to use this 7zip software which i have made a batch script and integrate the script with it.
I tried to make all the files that i want being zipped after i run the script. And below is the code :

@echo off

  FOR /F "delims=*" %%D IN (excel.txt) DO (
    echo "%%D"
    C:\Users\rizal.yusoff\Desktop\RAS\7-ZipPortable\App\7-Zip\7z.exe u -tzip "%%D".zip "%%D" && del "%%D" -y 
  )

PAUSE

and the file of excel.txt contains this directory :

C:\Users\rizal.yusoff\Desktop\test
C:\Users\rizal.yusoff\Desktop\test2
C:\Users\rizal.yusoff\Desktop\test3

So as you can guess, after i run the batch script, the script will create me zipped file of the folder of test, test2 and also test 3.

But the problem is that each time i the script wanted to zipped the folder, it will promt out a question and asked whether or not i am sure about that.See the screenshot below :

cmd

So, it is okay for this case which i only have three folders, but imagine if i have 1000 of files to be zipped like that, and that will be pretty tiring and also annoying to just answer "yes" for a thousand of time.

Thus, my question is that could i make the script answer "yes" or "no" automatically for me?
I have looked onto the documentation, but found nothing that i want.

really appreaciate if you could give any help with this.Thank you..

samsons17 -4

ssuet , i am using oracle database

samsons17 -4 Posting Whiz in Training

HI there,

I am doing my internship with accenture and i got my first assignment.

Basically i first thing with this task is i need to find way to modify the query so that it will pull only the data that has existed/activated more than one hour. This is the complete query :

select account_no, unixts_to_date(created_t), poid_id0, state_flag from
(
SELECT a.account_no, m.poid_id0, m.state_flag, c.created_t, row_number() OVER (PARTITION BY c.account_obj_id0 ORDER BY c.created_t DESC) rnk
FROM pone_bt_prod_inst_t m, pone_act_inst_t c, account_t a
WHERE m.state_flag IN ('0', '4', '5', '6', '7')
AND a.poid_id0 = m.account_obj_id0
AND c.prod_inst_id_id0 = m.poid_id0
AND m.service_type = '/service/ip/wimax'
AND m.entity_type = 'Plan'
AND c.state_flag NOT IN ('1', '2', '14')
ORDER BY created_t ASC
)
WHERE rnk = 1
UNION ALL
SELECT account_no, unixts_to_date(created_t), poid_id0, state_flag FROM
(
SELECT a.account_no, m.poid_id0, m.state_flag, c.created_t, row_number() OVER (PARTITION BY c.account_obj_id0 ORDER BY c.created_t DESC) rnk
FROM pone_bt_prod_inst_t m, pone_act_inst_t c, account_t a
WHERE m.state_flag IN ('16', '17', '18')
AND a.poid_id0 = m.account_obj_id0
AND c.prod_inst_id_id0 = m.poid_id0
AND m.service_type = '/service/ip/wimax'
AND m.entity_type = 'Deal'
AND c.state_flag NOT IN ('1', '2', '14')
ORDER BY created_t ASC
)
WHERE rnk = 1;

I show you the query so that you could grab the whole figure how the database looks like just in case you want to.
Anyway, from that query, I tr to play with it and I am trying to get the difference between the current time with the time in the created_t column.
As far as i got, this ...

samsons17 -4

hye, somehow my friend have gotten the actual source code from the first executable there by using somesoftware available :

size32 global10 = 0;// 4 bytes
size32 LoadStringA = 0x2198;// 4 bytes
size32 SendMessageA = 0x217c;// 4 bytes
size32 LoadIconA = 0x218c;// 4 bytes
size32 GetModuleHandleA = 0x20c8;// 4 bytes
int global33 = 0xbb40e64e;
unsigned int global11 = 0;
size32 global2 = 0;// 4 bytes
__size32 global0 = 0;// 4 bytes

size32 proc2(size32 param1, size32 param2);
size32 proc3(size32 param1);
size32 proc4(__size32 param1);
void _start(unsigned short param1);
INT_PTR proc5(HWND hwndDlg, UINT ??, WPARAM ??, LPARAM lParam);
void proc6();
void proc7(int
param1, unsigned char param2, unsigned int param3);
__size32 proc8(int param1, int param2);

// address: 0x401256
void proc1() {
__size32 eax; // r24

global0 = 32;
eax = proc8(32, 4);
global2 = eax;
return;

}

// address: 0x40123c
size32 proc2(size32 param1, size32 param2) {
size32 eax; // r24
__size32
esi; // r30
void esp; // r28
__size32
esp_1; // r28{32}
size32 esp_2; // r28{2}
__size32
esp_3; // r28{25}
size32 esp_4; // r28{12}
size32 local0; // m[esp - 4]
size32
local1; // m[esp + 4]
size32 local10; // esp_1{32}
size32 local11; // local5{39}
size32
local12; // local2{41}
size32 *local2; // m[esp + 4]{41}
size32 local3; // m[esp + 4]{40}
size32 local4; // m[esp - 4]{1}
size32 local5; // m[esp - 4]{39}
size32 local6; // m[esp - 4]{38}
size32
local7; // esp_3{25}
size32 local8; // local6{38}
__size32 *local9; // local3{40}

local4 = param2;
esp_2 = esp - 4;
esi = param1;
local10 = esp_2; ...

samsons17 -4

hye BobS0327 , thank you for your prompt reply..I have uploaded the files on mediafire, so perhaps you could download and try it now, this is the link : http://www.mediafire.com/?cruaoh9lzr9np9z

Now, i will try to do like what you said first..but i hope you will help me also in finding the answer ya :D

thank you so much..

samsons17 -4

no..dont worry about the files, nothing suspicious there..The reason those files are within the 24 hours is because i got
those file from the hacking competition that i just joined before..I couldnt finish or solve it in that competition, so
that I am thinking of finding the answer when I got home, just as my lesson and reference for the future..
I just hope that somebody could teach me this..Thank you :)

samsons17 -4

when i run it with Textpad, it display me just the same info, but this time it provided me together with the hex value..

samsons17 -4

yes..
binary mode? anyways i got many random wierd text with some code like this :

when i open up the exe file with my notepad..I couldnt find any of the reasonable word there to be as an answer, thats what confusing me right now..

samsons17 -4

okay, sofar i have tried the unextractor and also the dot net reflector.. but unfortunately,
the files that have been extracted bring ni meanings to me, which no clue or whatsoever..any other ideas?

samsons17 -4

ouh, is that means this is the .NET file?

samsons17 -4 Posting Whiz in Training

hi there,

I got a software hacking questions which I guess the files were written in C# ..Each of the files will pop out a dialog box which will ask us to enter a string or something..if the string we entered is correct, then the status will be changed into Corecct!..But i really have no idea on how to get the right one..

So, could u guys help me?giving me a hint or something or the way how i could solve this?
U could download all the files from here : ryzalyusoff.coml/Reverse Engineering.zip

thank you in advanced :)

www.ryzalyusoff.coml/Reverse Engineering.zip

samsons17 -4

seriously no one ever know bout this?i need help please...

samsons17 -4 Posting Whiz in Training

Hi,

i am working on this project that using wordpress cms platform..

I am really frustrated right now to find way to remove the default avatar of wordpress site that being set up to user during registration process.

As u know, when we are registering to a site which working on the wordpress platform, the website will automatically chose for us any of the default avatar.

The problem is that the avatar is not good in look, which could be either a monster picture or any other that i dont know what they are.

So, i want to remove them and want to replace them with my own avatar picture.
What i am saying is that, i am not talking on removing and replacing only one avatar, but i want to remove all of the wordpress avatar and replace them all with my own several avatar.

I am really stress right now as i cannot find any solution on the net, so hope u guys could help me out.
Thank you..

samsons17 -4

oouh2...i am so sorry...
actually getXMLHTTP() is the function that being made...
haha..sory for this...
anyway thanks :)

samsons17 -4 Posting Whiz in Training

I am confused right now, and there will be test about ajax tommorrow..

And i bumped into this getXMLHTTP() function in one of the code that my professor gave me and i not sure what it does exactly.I mean because i also see in the other code, that people are using getXMLHttpRequest() in their ajax code and this make me more confused.

I have tried finding it on the net but theres no one yet given explanation on this. So i hope someone could give me explanation on this.

By the way, below this is the example of code that using this function :

[CODE]
function getInfo(strURL)
{
var req = getXMLHTTP();
if (req)
{
req.onreadystatechange = function()
{
if (req.readyState == 4)
{
if (req.status == 200)
{
document.getElementById("lect").innerHTML=req.responseText;
}
else
{
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL , true);
req.send(null);
}
}
[/CODE]

thank you in advance :)

samsons17 -4

[QUOTE=aquilax;1609883]Got it :)

contrcuct() should be construct()[/QUOTE]

hey........thank youuuu so much :D
i didnt realize that one is the problem.. >.<

hoho..must be really careful next time..
thanks again for ur time..

samsons17 -4

oh wait actually my code for db.php is like this :

[CODE]
<?php
require 'db.php';
$db = new Db();
$query = "SELECT*FROM list ORDER BY id asc";
$results = $db->mysql->query($query);

              if($results->num_rows){
                  while($row = $results->fetch_object()) {
                      $title = $row->title;
                      $description = $row->description;
                      $id = $row->id;

                      //the rest of the code go here...
                  }
              }

?>
[/CODE]

samsons17 -4

could anyone try my code onto your computer and find out if the u got the same error?
i wonder if it is just me that having this problem..

samsons17 -4

ya i login to mysql server using the same user and password i wrote for the connection to the db..and everything is okay..

hurm..