Programming :: Get Different Result Of Matrix Op On Hw Rtw Book?

Jul 31, 2011

Dear Linux/c++/g++ programmers: the run result on my system, ubuntuLinux10.04(kernel2.6.35-25), gcc4.5.2 is not what book predict

source code
http://examples.oreilly.com/9780596007614/
11-28
11-29
11-24
#include "matrix.hpp"

[Code]...

View 13 Replies


ADVERTISEMENT

Programming :: Parallel Matrix - Matrix Multiplication Seg-faults?

Apr 13, 2011

I just can't find... why is my code seg-faulting?

PHP Code:
/*
Code name: Assignment #7.
File name: slice.c
Program name: Matrix multiplication (parallel version).
Version: 1.

[Code]...

Is giving my a seg-fault right at the ending point where I do the final gather from the MASTER processor.

View 9 Replies View Related

Programming :: C - Create 2 Vectors From 1 Matrix?

Mar 20, 2011

i did this code:

reads 1 matrix 2x2 and print!

Code:
# include <stdio.h>
int main()
{
int t, i, M[2][2];
int big[2];

[Code]....

Now i want to create 2 vectors:

1 vector: has the biggest number of every line on the matrix

2 vector: has the lowest number of every column on the matrix

View 1 Replies View Related

Programming :: Python: Storing A Matrix For Later Use?

Apr 30, 2010

I'm writing a command-line flash card program in Python. I've tried many existing applications, but none fit my specialized needs.

All of the words I'd like to study are manually added to a text file (study.txt). Each time the software is loaded, it checks for new words in that file and also compares them to a dictionary (a tab-separated file, dictionary.txt), and adds that to a matrix. The flash cards are thus automatically generated from study.txt and dictionary.txt.

Now, the software must manage lots of information about each word I'd like to study and add new information made while interacting with the program (such as when that word should be studied next).

That seems easy to put into a matrix. But what is the best way to put that information in a place where I can pull it back when I run the software tomorrow? Do I need to save the matrix to a CSV file, then convert the CSV file back to a matrix the next time the application is run?

View 1 Replies View Related

Programming :: C - One Value In The Matrix Drops To Zero When Passed In As Pointer?

Dec 8, 2010

This is one of the strangest problems I've run into while programming. Maybe there's just something wrong with my version of gcc or something.

The main problem comes at this point in the code:

Code:
po = makePoFromScorbotXYZPR(X, Y, Z, P, R);
h = makeHB2GFromPo(po);
printf("%le", *h[1][0]); //##################################### Here it has the right value
printf("%s", "

[Code].....

View 2 Replies View Related

Programming :: Implementing Matrix Based Keypad On X86 Processor Using GPIO's?

Feb 5, 2010

I need to control matrix 5x4 keypad, on a processor

i am doing by making one row low at a time, and keeping all other rows high,

by scaning coloums, the corresponding key value becomes low.

my problems is that it is taking much time to respond, like to make gpio

low to high and high to low...

View 1 Replies View Related

Programming :: Double Pointers / Matrix GCC (fill It One Column With Zeros And The Other With Ones)

May 26, 2011

I have a 10x2 matrix, I create said matrix and fill it one column with zeros and the other with ones, now when I print the matrix I get this:

column 1:
0,0,0,0,0,0,0,0,1,1
column 2:
1,1,1,1,1,1,1,1,1,1

The first two rows of the second column are being replaced into the last two rows of the first column, now I even checked in visual studio and it works fine there. A friend tried my code and he gets it even worse:
column 1:

0,0,0,0,1,1,1,1,1,1
column 2:
1,1,1,1,1,1,1,1,1,1

As far as I've seen it must be a problem with GCC, unfortunately I need to have this up and running in GCC no matter what.

[Code].....

View 6 Replies View Related

Programming :: Headers From Richard Stevens Network Programming Book Not Installing

Oct 27, 2010

I am learning network programming via a book of Richard Stevens.The sample source codes are given here
http://www.unpbook.com/unpv13e.tar.gz
I downloaded and unzipped the file in /usr/src folder.As per the instructions given in README of downloaded archive I did.

View 5 Replies View Related

Programming :: ASM - Making A Multimedia Library To Speedup Vector And Matrix Computation

Sep 2, 2010

I'm making a multimedia library to speedup vector and matrix computation. But I'm getting a strange error, in this code

[Code]....

View 4 Replies View Related

Programming :: Octave - Load A Text File With Floating Point Values Into A Matrix?

Jan 29, 2011

I have a .txt file with the format

0.01
0.04
0.07
...
0.83

I am wanting to load this into octave and perform operations on the data.

[Code]...

View 2 Replies View Related

Programming :: Book To Learn Programming In C ANSI?

Jul 11, 2011

What book you recommend to learn programming in C ANSI ?

View 1 Replies View Related

Debian Programming :: Generate SQL Result Into XML

Dec 2, 2014

How do I generate sql result into xml ? Tried this way (shown below), but it generates all data into single column.

Code: Select allgenerate_xml()
{
        f1=_tmp1
        f2=_tmp2
        cat $SQL_QUERY_OUT |sed -e 's/^"//g;s/"$//g;s/","/|/g'|tr '|' ' ' > $f1
        [ -e $SQL_QUERY_OUT ] && rm $SQL_QUERY_OUT

[code]....

View 2 Replies View Related

Programming :: Cut The String In The Result Generated By AWK?

Aug 5, 2010

I wanted to get the ORACLE_HOME of the listener's running on the server.I have been using the following to get the reult. /opt/oracle/admin/PHYPE/bdump> ps -ef|grep /bin/tnslsnr|grep -v grep|awk '{print $9}'

Result is as follows

/opt/oracle/product/10.2/bin/tnslsnr
/opt/oracle/product/9.2.0/bin/tnslsnr
/opt/oracle/product/10.2/bin/tnslsnr
/opt/oracle/product/10.2/bin/tnslsnr
/opt/oracle/product/9.2.0/bin/tnslsnr
/opt/oracle/product/10.2/bin/tnslsnr

Now i wanted to cut the /bin/tnslsnr part and the remaining should write to the file.

View 4 Replies View Related

Programming :: Setting The Final $result

May 18, 2010

I have a variable (call it $valAS) that gets calculated . Also, i have a files Bassu3. if $valAS= 45368 (2nd part of 2nd line in Bassu3) after calculation, then $result=45368, but if $valAS != 45368 then $result= $valAS

Bassu3:

Quote:

name.srv
name 45368 (value always changing)
name 99999
name 88888

how can i do this in Bash?

View 14 Replies View Related

Programming :: Specific Result Of Awk Script

Jan 24, 2010

I'm using the following awk command to find out the users home directory from /etc/passwd file.#grep jeesun /etc/passwd |awk 'BEGIN {FS=":"};{print $6}'But problem is when there are two name like "jeesun" and "jeesunadm" exist the script shows both result not specific one.

View 3 Replies View Related

Programming :: Show Images From A Database Result?

Jun 17, 2010

I was wondering if I can show an image on our php site if we store the path to it. For example if we get the result form my sql as:

images/example1.png and the handle the result as common html.

< img src="databaseresult" width="173" height="188" border="1" / >

is this possible? do you think theres a better way to do it?

we need to store the images locally we cant use a blob space on the table.

View 2 Replies View Related

Programming :: PHP / MySQL Statement - Query Result

Jan 29, 2011

It is under PHP/MySQL
$queryresult = $conn->query("INSERT INTO normalrequests VALUES($finalkey, 1234, 5678, FALSE)");
It is connected to the database successfully but I feel there is something wrong with the statement up there.

View 6 Replies View Related

Programming :: Pass An Expect Command Result Into A Variable And Then Use It Again?

May 4, 2010

I'm trying to create a program that would locate the oldest file of a certain type on a server. Here's the commands:

OLDEST_PATH=`find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1`
OLDEST_FILE=`find -L $OLDEST_PATH | grep .mp3 | sort -f | head -1`
ls -al $OLDEST_FILE

I'm writing this all in expect but I'm having problems. The main problem I have is whenever I try to run the first command, I can't seem to isolate the result of the OLDEST_PATH so that the 2nd command will work. There always seems to be a newline in the variable and the result is only "find -L" command running and it bypasses the variable. If I can just figure out how to get the 1st and 2nd command to work, then I can figure out the 3rd. Here's some code:

Code:
send "find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1
"
sleep 20
expect -re "(.*)

[Code]....

I know there is a better way to write this. I've tried multiple ways and this just happens to be the last way I've tried it. If you try running this, you'll notice that there is still carriage returns after the result of OLDEST_PATH and it prevents the 2nd "find" command from working properly.

View 2 Replies View Related

Programming :: Print Cgi Result (loan Calculator) Using Popup

Jan 7, 2010

I am using the script below but need to make it to show the result in a html popup window. The script is Free and I don't think Kristina will complaint by making it more versatile.

The problem I have is that the script moves to a standalone window to show the results. I am interested in making it "popup' a window with the results.

Code:
#!/usr/bin/perl
# NOTE: You must change the line above to point to the path to Perl
# on your system.
#########################################################################
##### AffordaBilly v1.0#
##### Copyright 2001, Kristina L. Pfaff-Harris, scripts@tesol.net#

[Code]....

View 1 Replies View Related

Programming :: String Concatenation In Perl Result In Two Lines - Not One?

Jan 11, 2010

I am new to perl and am having trouble adding some strings together.

My full code is below:

The problem is $NewCommandB is always split into two lines, where the second line contains the "/atlas2/<blah>/<etc>/..." string. Since I am generating a .sh file to execute a lot of similar commands I need the string to all be on one line. Any idea why I get this behaviour and any suggestion on how to tell perl to make $NewCommandB a one line string?

Btw for completeness finalFileList.txt contains just file names one line after another:

View 5 Replies View Related

Programming :: Book Recommendation For C++ GUI Programming?

Apr 13, 2011

I am not new to PC programming. I have been able to write C++ console programs. They are not too hard to write.Now, I want to move up to the Linux C++ Graphical User Interface (GUI) programming.Can an experienced member of the Linux community recommend a good reference book for programming the GUI windows?

View 14 Replies View Related

Programming :: Change A Mysql Query Result Prior To Display?

Oct 17, 2010

I am not sure if this is possible. I have IP's stored in a mysql database. When I query the database, it returns the IP. I would like to replace the IP with something else prior to displaying the results. Is it possible even though I have not stored it in the database?

I have the following in a while loop (mysql_fetch_array).

Code:
<td align="left">' . $row[IP] . '</td>

Instead of displaying $row[IP] from the database, I would like it to display something else which I define in the PHP code but based on the IP.

ie. aaa.bbb.ccc.ddd = hostnameABC

View 4 Replies View Related

Programming :: Splitting A Parent Process Into 2 Child And Then Merging Result?

Sep 15, 2010

What i am trying to do is i want to add numbers from 1 to 100. but that too using multiprocessing. So i made a c programme and using fork() command made two child processes. Now in one child process i am adding from 1 to 50. and in another i am adding 51 to 100. and then in the parent process adding the two results to get the final one. Now the result from the two function i am getting correctly. But after the wait() call the value returned is lost : See the programme below for reference

# include<stdio.h>
# include<unistd.h>
# include<sys/wait.h>
# include<stdlib.h>

[code].....

View 6 Replies View Related

Programming :: The Perfect Javascript Tutorial Or Book?

Jul 30, 2011

I'm looking for javascript tutorials or books that meets the following criteria:

1. Very thorough: Starts with the most fundamental concepts and progresses logically from basic to advanced concepts, without skipping over important ideas for the sake of expediency.

2. Lots of small practice exercises that parallel the concepts and syntax being learned.

I've looked at a lot of tutorials, but they all tend to be lacking in one of these areas or the other.

View 1 Replies View Related

Programming :: Good Book To Learn About Threads In C / C++?

Oct 30, 2010

A good book to learn about threads in C/C++?

View 3 Replies View Related

Programming :: ARPACK++ - Error "Matrix Data Contains Inconsistencies"

Jun 26, 2011

In the following code, I am trying to define a matrix in CCS (which is equivalent to CSR for a symmetric matrix, right ?) in ARPACK++.
I have installed and patched ARPACK++. (The matrix is not sparse, but still it should not give an error)

[code]...

Why is this so ? I have checked the values of ia and ja by running intel MKl on the matrix to find the CSR (again, CSR=CCS for symmetric matrix, right ?--I am asking this because ARPACK++ uses CCS, not CSR), and the values are the same. Is this some problem of 0 and 1 indexing ? Does ARPACK++ use 1 indexing?

View 1 Replies View Related

Programming :: Certain Book Search - Checking Of Case Insensitive

Jan 19, 2010

I am trying to do a search for the certain books, and I am trying to make it case insensitive. what I have come up with so far is this :

Code:
Database.txt
RETARDED MONKEY:RACHEAL ABRAHAML:30:30:20
GOLD:FATIN:23.20:12:3
StUPiD:JERLYN:20:40:3

Code:
echo -n "Title: "
read Title
echo -n "Author:"
read Author
echo ""
valuecheck='grep -i "$Title" Database.txt | grep -i "$Author" | awk -F":" '{ print $1}''
echo $valuecheck
if [ $Title = $valuecheck ] ; then
echo "HOHOHO"
else
echo "too bad"
fi

The issue which I am having is that, when it does the search for the correct row to be inputted into valuecheck, it will input the value as written in the database, which is in Uppercase. For this case, if I type in stupid for $Title and jerlyn for $Author, it searches the correct row, but the awk will print "STUPID" into the variable as that is what is written in the database. So how can I make my if statement case insensitive? Currently it reads like this:

Code:
if [ $Title = $valuecheck ] ; then
which means
if [stupid = StUPiD ] ; then

How can I make the if statement it case insensitive to allow it to display "HOHOHO"

View 5 Replies View Related

Programming :: Book Which Explains System Library Structure In Depth?

Sep 7, 2010

Has any one ever come across a book on Linux programming which explains a Library structure in depth?

View 3 Replies View Related

Programming :: Book Example Of Own Type Variable Initialization Wont Work?

Nov 8, 2010

Its an example froom a book... and it does not work...

Code:
#include <stdio.h>
int main ( int argc, const char * argv[] ) {

[code]....

View 4 Replies View Related

Programming :: Make An Online PHP Contact / Phone Book With Simple PHP (no Database)?

Jul 5, 2011

I would like to unzip a simple PHP code files, to have a online PHP contact / phone book. Simply, slow, and not database oriented over complicated setups into settings. I have a PHP / web provider (free), not apache. WITHOUT SQL (like before it may exists) something like this [URL]

View 14 Replies View Related







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