Search Results

Search: Posts Made By: robin_simple
3,833
Posted By robin_simple
The problem was with the data types. Unsigned...
The problem was with the data types. Unsigned long on my laptop is 8 bytes and I was assuming a 4 byte size. Also, some coding was incorrect.
3,833
Posted By robin_simple
[SOLVED] blowfish algorithm: encrypting the p-array.
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:
I am trying to...
2,216
Posted By robin_simple
#include <iostream> #include <stdlib.h> using...
#include <iostream>
#include <stdlib.h>
using namespace std;

int main()
{
char *hex_key = "abcdef012345678";
long long key = strtoll( hex_key, NULL, 16 );

cout <<...
2,216
Posted By robin_simple
The long long int knowledge seems like it will be...
The long long int knowledge seems like it will be very helpful along with the unsigned math you showed. The strtoll() I am sure is helpful, I am just not too sure yet what to do with it. Thanks.
2,216
Posted By robin_simple
Splitting a numbers binary representation for a double.
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:
Split a 64bit...
Forum: Programming 04-16-2012
6,414
Posted By robin_simple
I am trying to use a bit vector to determine if a...
I am trying to use a bit vector to determine if a number generated by rand()%8 has been generated yet. I'll mess with it some more in a bit. Thanks.
Forum: Programming 04-16-2012
6,414
Posted By robin_simple
#include <stdio.h> int main() { ...
#include <stdio.h>
int main()
{
unsigned char a,b;
a = 1 + 2 + 4 + 16 + 32 + 64 + 128;
b=1;

while(b<=128)
{
if(a & b)
printf("%d\n", b);

...
Forum: Programming 04-16-2012
6,414
Posted By robin_simple
This isn't making sense to me. What is a good...
This isn't making sense to me. What is a good book or site that explains this?
Forum: Programming 04-15-2012
6,414
Posted By robin_simple
00001001 ---------- Post updated at 03:34 PM...
00001001

---------- Post updated at 03:34 PM ---------- Previous update was at 03:30 PM ----------

How could I translate each binary position in an unsigned char to a corresponding number 1 - 8?
Forum: Programming 04-15-2012
6,414
Posted By robin_simple
If I enter 9, the output is Enter an...
If I enter 9, the output is

Enter an unsigned character: 9
?
9 = 00111001

So, the question mark is because 128 is too big for 1 byte and I am not expecting 00111001 because that is 2^5...
Forum: Programming 04-15-2012
4,035
Posted By robin_simple
ok, very cool. the ob command is great i'm glad...
ok, very cool. the ob command is great i'm glad you showed it. i haven't done anything yet, but am feeling better since i saw that the file was empty. i guess i used a write flag when opening at...
Forum: Programming 04-15-2012
6,414
Posted By robin_simple
Comparing unsigned char bits.
/******************************************************************************/
/* Printing an unsigned character in bits */

#include <stdio.h>

void...
Forum: Programming 04-14-2012
4,035
Posted By robin_simple
I've set fseek to 0, 4, 7, 8 trying to pull one...
I've set fseek to 0, 4, 7, 8 trying to pull one of the first two ints and I've set it as sizeof(acct_info_t), sizeof(acct_info_t) + 7 . . .
I was able to pull info from a txt file I made, but not...
Forum: Programming 04-14-2012
4,035
Posted By robin_simple
The file is a file of structs and two integers at...
The file is a file of structs and two integers at the beginning. I am trying to pull something from the file, but have not been able to.
Forum: Programming 04-14-2012
4,035
Posted By robin_simple
reading binary files
#include <stdio.h>
/*
typedef struct
{
char name[40];
int number;
float balance;
} acct_info_t;
*/
int main()
{
FILE *fptr;
fptr = fopen("acct_info",...
2,563
Posted By robin_simple
ls -l | awk '{ print $6 }' - this command...
ls -l | awk '{ print $6 }'
- this command separates the month column from the ls -l output.
- you could always read that output in to some sort of selection scenario of if statements. i guess that...
2,121
Posted By robin_simple
-q[rev] quiet mode; diagnostic output...
-q[rev]
quiet mode; diagnostic output is not printed. A revi-
sion that is not different from the preceding one is
not deposited, unless -f is given.

I...
1,262
Posted By robin_simple
yeah, its not doing that either. ----------...
yeah, its not doing that either.

---------- Post updated at 03:50 PM ---------- Previous update was at 03:49 PM ----------

It displays when used at command prompt, not when in the program.
...
1,262
Posted By robin_simple
ksh code
#!/bin/ksh
PATH=/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb:/usr/local/bin:. #BEGIN Find public_html directory.
pub_html_num=`find ~$USER -type d | grep public_html | wc...
1,262
Posted By robin_simple
adding text with sed
sed 's/<\/body>/<A HREF='"$index"'>'"$description"'<\/A>\
<\/body>/' "$index"


This will work from the command prompt, but not from my ksh script.
Why not?


sed: command garbled:...
2,504
Posted By robin_simple
Assigning zero to element of ksh array.
set -A matched #find referenced files.
for i in ${file_names_html }
do
counter_j=0
for j in...
2,121
Posted By robin_simple
suppress RCS messages
ci filename

This command displays a message. I don't want it to. How can I keep RCS from doing so?
1,430
Posted By robin_simple
ksh view std err state
I would like to know if a command works.

"command" 2>/dev/null

When I issue the command, the error is suppressed. How can I tell whether there was an error?
3,075
Posted By robin_simple
yes. i'll try it out. ---------- Post...
yes. i'll try it out.

---------- Post updated at 10:28 PM ---------- Previous update was at 10:22 PM ----------

very cool.
3,075
Posted By robin_simple
cat $reference | awk -v ref=$reference -v...
cat $reference | awk -v ref=$reference -v desc=$description '/<\/body.*>/ { print "<A HREF="ref">"desc"</A>" } { print }' $reference > tmp && mv tmp $reference

$reference = file location...
Showing results 1 to 25 of 32

 
All times are GMT -4. The time now is 02:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy