Programming :: Make A Binary Tree From An External File?

Dec 7, 2010

My assessment is making a tree from a text file as follows: -reading a file line by line

-making a binary tree from it
- traverse by level the binary tree
- posting the traversal result to the same file without overwriting the text file- it is required to be append to the bottom of the text file (i have to do this in 4 languages: c#,PHP from Xampp,java, python)

i read the file with this script in java:
public class FileToStringArray {
privateString strLine;
privateString[] stringArray;
privateFileInputStream in;

[Code]...

View 9 Replies


ADVERTISEMENT

Programming :: Sort A Binary Min-heap Tree

Mar 23, 2011

I'm searching for an algorithm to sort a binary min heap tree. That's when in root i have the smallest value in the tree. The only restriction it has, is that the parent must be smaller the its two children. i think something like quick-sort, but i don't know how to implement it.

View 8 Replies View Related

Programming :: Finding A Utility To Combine Two Or More Binary Files Into A Single Binary File?

May 5, 2011

Is there any Linux utility to combine two or more binary files into a single binary file ?

View 7 Replies View Related

Ubuntu :: Make With Make File Yields Error - /usr/bin/javac: Cannot Execute Binary File

Nov 17, 2010

When I try to compile some Java code on Ubuntu 10.10 (kernel 2.6+) using make and a Makefile.

I get an error indicating that the make utility cannot execute the java compile command (javac).

The error reads: /bin/bash: line 6: .: /usr/local/jdk1.5.0_18/bin/javac: cannot execute binary file

I am executing make as root. I have enabled permissions on all directories in the path /usr/local/jdk1.5.0_18/bin/javac and on javac itself.

I get this error whether using a jdk installed via ubuntu apt-get, or whether I install the jdk myself. And I get it using either Java 1.5 or 1.6

My machine has an 80386 processor. I notice the make utility is built for i686-pc-linux-gnu

However, I can manually compile using javac.

I can compile calling javac from within a bash script.

I can compile using the java compiler gcj from the command line: gcj --main=HelloWorld HelloWorld.java -o HelloWorld.exe

But I cannot compile java code from the makefile. Any reasons why I might be getting this error?

View 4 Replies View Related

Programming :: Sms Server Tools Cross Compiling Sms Server Tool For An Embedded Computer And Make Just One Binary File For It?

Mar 27, 2010

I wanted to know how can I cross compile SMS SERVER TOOL for an embedded computer and make just one binary file for it or how can I change all of its default files places like its demon and object file and gather all of them to one directory to execute and use and run.let me explain it better for you : I have an embedded computer with Linux OS that its file system is read only and I can not add any file to /usr /lib and ..... and I can just mount a SD memory card to it and copy all of my programs to it and run them from there as you understand I have two choices to choose, first make one big binary file for each program that I am doing it now and it is not a suitable solution and the second is finding the way to change default place of shared object file of my program.now you tell me what can I do to solving this problem.

View 1 Replies View Related

General :: Using Fork() To Create A Binary Tree?

Sep 26, 2010

I am working on a project where I need to use the C language to generate a tree of processes. I understand how fork() works but I cant seem to get fork() to create two children from one parent and then have the two children create two more children.

Right now what i am seeing is a chain...where the parent creates one child...and that child creates another ONE child..etc.

Here is what I have so far:

for (i=0; i<n;i++){
if (childpid = fork()) break;
}
if (childpid == -1){
perror ("

[Code]....

View 3 Replies View Related

Ubuntu :: Make A Script That Makes A Tree Of All Folders And Subfolders And Outputs It To Either A .txt File Or .pdf?

Feb 25, 2011

Is it possible to make a script that makes a tree of all folders and subfolders and outputs it to either a .txt file or .pdf? All folders except from one shall list 2 levels. The except folder all the way.

View 3 Replies View Related

Programming :: Expandable File Tree For Uploads?

Aug 18, 2010

I am working on a PHP enabled webpage that will allow a user to select multiple files and directories to upload from a local machine to an ftp server. I am comfortable with uploading the files from the machine to the server. The problem is making it easy to select all the desired files. What I would like to do is create an expandable file tree that lists all the directories and files on the local filesystem. From there, the user should be able to select directories and files using checkboxes. Upon clicking submit, all of the selected files should be fed into an array of files that can be sequentially uploaded to the ftp server.

View 1 Replies View Related

Programming :: Convert An Arbitrary Binary File Into A Executable File?

Feb 18, 2010

In a project I'm working on with a few other people, I got the task of writing an assembler. The last thing I do is convert the commands into a binary representation, and jam it into a file. Now one of my teammates said he'd like to be able to "reference" the code within another program. He said he'd be able to do this if the file I output is a Linux object file. I'm thinking it'd also work as an executable. Anyway, he said he'd like to be able to grab the file and reference the binary by address. I'm still fuzzy on this, and if you're confused with what I said here, please tell me so I can ask him for better details.Anyway, I'm aware that gcc can compile files to ".o", but that's only for C/C++, and my file is just binary. I'm also aware of "ld", but I haven't seen any use of it to help me. I'm happy to hear suggestions as to what I can do. If anything, I think I'll implement a few functions to grab the bits and hand them to him in an array or something.

View 8 Replies View Related

Programming :: Binary File Cannot Be Found?

Jan 28, 2010

I get this error when I run the program that i created using eclipse.How to fix this?

View 3 Replies View Related

Programming :: Cannot Execute Binary File

Feb 11, 2011

I'm trying to compile a simple script for a ar71xx (bleeding edge /from snapshots) Openwrt router.I have previously compiled scripts for Kamikaze 8.09. I just copied the gcc file inside the SDK dir and used it without problems.

View 4 Replies View Related

Programming :: Version Info Coded Into ELF Binary / Author And Company Name Into ELF Binary?

Nov 30, 2010

How to coded version info and other information likes author and company name into the ELF binary?

I prefer the put the version info during build step.

View 5 Replies View Related

Programming :: Search And Replace In A Binary File?

Aug 11, 2010

i need to change a binary file, let's say to find and replace username:

find string: "/home/name/bla-bla-bla/ "
new string: "/home/anewname/bla-bla-bla/ "

i can do it, for example, in emacs (hexl-mode), but interesting in writing a script instead. it will be much more better for me if i could do it automatically. is there an analog of: sed 's/string1/string2/g' ? P.S. the best way is to recompile the binary files i have, but there are no sources available.

View 5 Replies View Related

Programming :: Unable To Disassemble A Binary File?

Apr 15, 2011

I want to be able to disassemble a binary file, modify the assembly source, then assemble the modified assembly source back into a modified binary file. Purpose for this is pretty much just to play around with the Crackmes (www.crackmes.de) game.

Now, disassembly is easy, there are several tools that do it, including the standard objdump with the -d argument. However, how would you assemble an assembly source file created with objdump -d? GCC for sure doesn't want to assemble it in that format. What program, script, or arguments to GCC (none that I can think of) can be used to accomplish this? If someone also has some good tips for tools in general for Crackmes beyond what is standard in GNU/Linux I'd love to hear about it.

View 10 Replies View Related

Programming :: Reading A Binary File Which Is In Hexadecimal

Jan 9, 2011

I have a binary file, which I need to process using my C++ application. Only thing I know is first chunk of the file is long, second chunk is int, third chunk is char etc... The binary file actually contains something like below. (which is represented in hex base).

D7 07 00 00 00 00 00 00 37 18 00 00 DE 07 ............ so on.....

I need to procees the file in the following way.

* I know the first data segment in my file is long. So it takes 4 bytes.
* so I need to read the first four bytes. That is D7 07 00 00.
* Then I need to reverse this as 00 00 07 D7.
* Finally I need to get the decimal value of above hexa decimal line. ( 00 00 07 D7)
* i.e. 00 00 07 D7 (in hex) = 7D7 (in hex- after removing leading 0 s) = 2007 (in decimal)

Like wise I need to process the whole file.

View 14 Replies View Related

Programming :: Removing Symbols From Binary Executable File

Aug 21, 2010

Arm-linux-strip for removing the symbols from binary executable file after compilation. What exactly the symbols means.

View 1 Replies View Related

Programming :: Copying A Binary Image File To The Framebuffer?

Jul 14, 2010

I'm running Linux version 2.6.33.4 on an ARM9 and can successfully copy directly into the framebuffer using the command:

Code:
cat /usr/myfile.bin >/dev/fb0

I converted myfile.bin from a 640 x 480 x 24 bmp.

What I'd like to do is to have the ability to dump .bin image files directly into the framebuffer from a C program without shelling out to a cat command.

View 3 Replies View Related

Programming :: What Is The Terminology Called Of A Binary Using A File That Is Not Part Of It's Self

Feb 14, 2011

What is the Terminology called of a Binary using a file that is not part of it's self? An example would be when a browser uses a HTML file for it's interface. The binaries code has to know how to find it and so on. I imagine that the applications binary uses a system call and that another application takes over.

View 1 Replies View Related

Programming :: Reading A Binary File (Ignoring Null Terminator)

Jan 12, 2011

I need to read a binary file using my C++ application. That binary file may contain arbitary characters and it also contains 0 at some places. I need to read the file without considering null terminating character. (i.e. considering 0 as a normal byte and not as the end of the string)Can some one suggest me a method to read the buffer while ignoring the null terminated character.

View 4 Replies View Related

Programming :: Saving A PPM File - Binary Representation Of Unsigned Chars On The Harddrive

Apr 7, 2010

I am accessing a firewire camera using the libdc1394 library and saving the image as a PPM file, using the code below:

[Code].....

My question is whether the above code is portable. I presume it is, since the result is a binary PPM file which should be capable of being read across multiple computers with different architectures and different operating systems. But at the same time, all that the above code is doing is just saving the binary representation of unsigned chars on the harddrive, and there does not seem to be any reason why the binary representations of the unsigned chars will be identical across multiple computers.

View 1 Replies View Related

Programming :: Make A Folder For Each File In A Directory Then Move The File Into It

Nov 29, 2010

Initially I thought - use a for loop with ls in it:

Code:

However this causes lots of problems (folders have extensions, I have duplicate folders, the names with spaces create a folder for each element of the name).

The contents of the folder is basically movies (some with subtitles). Some of the names have things like (original) or CD1 CD2 in them.

View 15 Replies View Related

Programming :: Printing Text From An External File In C?

May 24, 2010

I was reading through the source code of adventure in the bsdgames package and I had noticed that most of the text is read from a file called glorkz. I'm wondering about what function/technique the author used to print from the file; I've been looking through the code for a while (particularly io.c) and I haven't been able to figure it out.

View 3 Replies View Related

Programming :: BASH Scripting - Creating A Map Tree?

May 7, 2011

looking to write a dependency map tree that creates a tree structure of object names . This tree will be written to a file and read back to create the tree structure of files . how to write this using bash ?

View 1 Replies View Related

Programming :: Store 2 , 4 Tree In A Single Array?

Oct 30, 2010

I am working on an structure program and i have to represent a 2,4 tree in a class in Java using single int array and make the insert and delete functions .

View 1 Replies View Related

Programming :: Getting List Of Shell Scripts - Flow Tree

Apr 1, 2011

I am working on a build-test system of a set of codes. The system (large enough) is such that one shell script does some work and calls another shell script. This inturn calls a third shell script and so on. How to get the list of all such shell scripts according to the way they are called.? More like a shell script flow tree?

Ex.
Code:
#./1.sh
|
`--> 2.sh
|
`--> 3.sh
|
`--> 4.sh
|
`--> 5.sh ....
.
.
.
etc.

View 7 Replies View Related

Programming :: Bash Script: Order And Display On External File

Mar 12, 2010

I'd like to create a script which allows me to order its data (let's say: Name, age, department and work start date) by date. And display the result in another file.

View 1 Replies View Related

Programming :: Correct / Common Directory Tree For Software Packages?

Mar 16, 2011

I found it easiest to embed narp into the gtk+-2.0 installation because all I needed to do was tweak the Makefile.am and Makefile.in files and let configure do the rest.This is a hack. I've failed at getting my own makefiles to work.

Would anyone point me in the right direction on how to properly make an installer for Linux? Also, what is the correct/common directory tree for Linux software packages? Any more suggestions on proceeding with this project using community standards?

View 2 Replies View Related

Ubuntu :: Safe Way To Clean Up /lib File Tree?

Jan 3, 2011

Is there a safe way to cleanup the /lib file tree? Mines gotten too large for the filesystem it's on (/), and I've already shot myself in the foot a few times trying to delete things.

View 7 Replies View Related

Programming :: Sort Oldest 5 Files In A Directory Tree Recursively Based On Timestamp?

Jun 3, 2010

I have a directory listing with many subdirectories having many files. I want to recursively search for the oldest 5 files starting from the base directory and not 5 from each subdirectory. I am writing a shell script which sorts them using ls -lRtur|egrep "txt|jpg" > /tmp/file1 Now from this /tmp/file1 file I want to sort the files same as what the ls -ltr command does that is oldest file time to newest file time first. How do I sort based on Linux time stamp? The files itself also have Linux timestamps embedded in them So I can sort based after extracting them as well if it is easier.
My /tmp/file1 has entries like below.

-rw-rw-r--. 1 usr1 usr1 705 2010-01-22 17:25 sample20100603173659.jpg

I want to get the 5 oldest files and then delete them.

View 1 Replies View Related

Programming :: Make Own File As A Running Log?

Apr 1, 2011

I have written a small script from that iam appending the output to a file.If multiple users invoke the same script or if i invoke the same script n number of times (using &), the output file(ZZ/OUT) contains messup information.

++++++++++++++++++++++++++++++++
#!/bin/bash
#

[code]...

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved