Posts by jen140
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Hello.
I've been doing a small application that will go (using only unsigned integer values) from 0 to 4026531840 and print them out.
My code is next:
#include <stdio.h>
#include <inttypes.h>
int main(void){
uint64_t cnt;
for(cnt=0;cnt<=4026531840;cnt++){
printf("%d\n",cnt);
}
}
The only problem that i have is the last numbers are negative (the really last one is -268435456).
I also tried using:
#include <stdio.h>
int main(void){
unsigned long long int cnt;
for(cnt=0;cnt<=4026531840;cnt++){
printf("%d\n",cnt);
}
}
but the problem persists.
I'm using gcc:
Target: x86_64-linux-gnu
gcc version 4.6.1 (Debian 4.6.1-4)
on my linux machine:
Linux mysql 3.0.0-1-amd64 #1 SMP Sat Aug 27 16:21:11 UTC 2011 x86_64 GNU/Linux
Any ideas?
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Hello everyone.
I've been googling for a while but couldn't find any complete reference for the next question.
So the question is, what do i need(cables, cards, etc) to connect a Fibre Channel Hard Drive on a normal desktop computer, by that i mostly think about the pci-e slots.
Please don't reply if you don't know what is FC HD is or are just here to say that it would be costly.
PS: Any reference to ebay/amazon would also be appreciated.
Thanks in advance.
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Ok, found the solution, i can get it with:
print $response->header("WWW-Authenticate");
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Sorry if i didnt expleined me well.
I have the next code :
use LWP::UserAgent;
my $browser = LWP::UserAgent->new;
$browser->agent('localbot');
$browser->credentials(
'127.0.0.1:80',
'testing',#<- the $realm
'admin' => 'password');
my $response = $browser->get('http://127.0.0.1/');
if($response->status_line eq '200 OK')
{
print $response->decoded_content;
}
And i want that the $realm be detected automatically.
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Hello again.
I was trying to login to my web server protected with basic auth, and after i understood that it would be nice to automatically detect the realm so now i want to know on how to do so.
Thanks in advance.
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Hello all.
I have a small problem, the next code finds the neden content, but it doenst print it:
$string = "#324423asdd asd 'BecamePosters' ";
if($string =~ m/'[a-zA-Z]{1,40}'/) {
print "ok!\n";
print $1;
} else {
print "not ok!\n";
}
It only prints "ok!\n" but nothing more.
Also triyed m/'*'/ but i get the same result, any sujestions ?
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Thanks for the response, but as no 1 responded i installed the Kerio Mail server (trial version is enought for now).
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Hello again.
Thise time i'm looking for an app, that will do packet sniffing (using pcap) and make a nice statistics by service and by destination showing the ips from local computers and from internet computers, the ideia is to see in with some web browser client.
Example log:
FROM To # of Requests Ports
pc1 www.google.com 100 21,80
pc2 www.google.com 20 80
Thanks in advance.
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Thanks for response, i've found what i was looking for, and it was mysql's replace function =).
What i neded to do was to remove part of the data in a row that repeated itself once for a row and many times for a column.
so i just neded to use next:
update abc set text=replace(text,'lol','NOTLOL') where 1;
and it would do what i neded.
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Dont know why cant i edit the post,
but the querrys arent right, they should be :
insert into abc(id,text) values(1,"hello <b>b</b>lol");
insert into abc(id,text) values(2,"bye <b>a</b>lol");
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Hello all, i would like to know how it is possible to remove for example last 20 characters, or by specifing the string to remove.
For example i have 2 rows (in reality there are more than 100, thats why im not working it out by hand) with the next content:
insert into abc (1,"hello <b>b</b>lol");
insert into abc(2,"bye <b>a</b>lol");
i would like to remove 3 last characters or the string "lol".
Thanks in advance.
Have a good day.
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
I could mark it unsolved if neden =)
Shure, after having the application working, i was rereading the post to learn more.
And I dindt put your post down, i've just upped the cgeier post, if it would make you more glad your post could be upped also =).
And i was thinking on making the calculation first and for future use, create variables for everything and not count the neden number many times.
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
I didnt said that your solution is bad, but the easier for me is the cgeier solution, and it needs fewere variables to work (when number is big).
And I also said "Thanks for all help" it did included your solution, sorry for not making me clear (again).
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Thanks for all the help.
The solution what i was looking for was that cgeier provided.
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
For example you have the number 56231012 , and you want a way to get a certain digit, for example the second, which is 1, or the third, which is 0 ?
Yes, the ideia is to use, or find a better way:
Scanner s_input = new Scanner(System.in);
i_input=s_input.nextInt();
Hmm, now i'm thinking on forgetting about the int and start by reading the number as string, after loop the size and check if all its elements are numeric, but i think it would be considered cheating =)
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
Hello all.
I have a small problem, i need to recieve a 8 digit number for example:
12345678
87654321
and so on.
After i need to devide the value and use the int as a array, something like
int i=123;
System.out.println(i[1]);
It should return 2 (therocially), but obviously the doesnt compile.
I was thinking on making the array of ints, but to read it i will need spaces and that is not acceptable, was already thinking about working with pointers, but found out that java doesnt have pointers.
Any ideias?
jen140
Junior Poster
117 posts since Jan 2009
Reputation Points: 11
Solved Threads: 6
Skill Endorsements: 0
© 2013 DaniWeb® LLC
Page rendered in 0.1322 seconds
using 2.65MB