Member Avatar

[OH noo, please not that again!](https://www.youtube.com/watch?v=DvShTJKuy2w) Yeah, primes sigh. But they play a minor role here as a perfect victim to explain some other things. Would not advise to use the algorithm here to calculate them in real life. There are languages like Python, F#, Haskell etc. who have list comprehension on board. I was wondering how to do it in C#. Looked up some examples on the net and concoct my own here. See the `factors` method on line 84 and the `primes` method on line 109. What I like about this code is that it is so concise …

Member Avatar
0
17
Member Avatar

A php code sent a query to the database say credentials from login page for verifying and something was returned say TRUE OR FALSE as status. Now my question is, if I do not know the code of the developer who wrote the login form, does there exist any way to find out what query is made to the database OR what has been returned by the database? Since I'm unaware of the developer's code which means I'll need a parallel script working in parallel with the login form. Can I also do that? The reason why I asked this …

Member Avatar
0
10
Member Avatar

i'm having a problem with my project where i should read the inputs from the status port of a DB-25... Input = Inp(&H379S).... whenever i trigger one of the sensor the value of INPUT will be 135 regardless of which sensor i trigger or even if i simultaneously trigger multiple sensors... the problem is i cant distinguish which sensor has been triggered... i'm using one of the output pin as my power supply for the circuit.. are there individual port addresses for each of the status pins??

Member Avatar
0
15
Member Avatar

Hello everyone, I'm having problems grasping some concepts of parallel programming; to be more precise, given some pieces of code, I have to determine which of them can be parallel and which cannot(this was in a test in a parallel programming class): a) a=2; b=3; //yes-variables are independently initialised b) a=3;b=a; //depends on the synchronisation c) a=3;b=a;c=b; //depends on which gets executed first d) b=a;c=b;a=4; //no-because some variables might get init to the new value while other to the old value e) a=2;b=a+3;a=3; //no-it's not clear to which value of 'a' the var. 'b' wil get calculated f) for(i=0;i<100;i++) b[i]=i; …

Member Avatar
1
17
Member Avatar

Hi programmers, I am a c# programmer but I have a very big project in C++ (Which I am not familiar with) and I am facing a big problem. As part of the project, I need to convert the image (any image of any type bmp,jpeg,png...etc) to grayscale using openMP. After doing some research, I got the main method which allows me to do the conversion using openMP, it's as follows: // pDest is an unsigned char array of size width * height // pSrc is an unsigned char array of size width * height * 4 (32-bit) // To …

Member Avatar
0
32
Member Avatar

I need help... I want to parallelize the MD5 algorithm using OpenMP in C++.

Member Avatar
0
4
Member Avatar

Hello, I am currently having an issue with a project I am working on. The rest of my project is fine, I am just having an issue with one logical portion of it, and I was hoping someone could help me. I also have to use 1D arrays to solve this problem, I can also make use of parallel 1D arrays Basically the problem that I am solving is: there are 8 departments within a business and each of the 8 departments have a list of ($/per hour) and the (hours) that each individual within that department worked for the …

Member Avatar
0
3
Member Avatar

Hello, I am having trouble passing a file into parallel arrays. Based on the code below, I get a bunch of jumbled numbers on my cout screen that don't even show up in the input file. I have attached a PNG of the console output. I am at a loss :( Any help would REALLY be appreciated. The input file is as follows: ANDERSON 12 BROWN 4 CLARK 25 DAVIS 7 GARCIA 8 GONZALEZ 23 HARRIS 24 HERNANDEZ 15 JACKSON 18 JOHNSON 2 JONES 5 LEE 22 LOPEZ 21 MARTIN 17 MARTINEZ 11 MILLER 6 MOORE 16 RODRIGUEZ 9 SMITH …

Member Avatar
0
3
Member Avatar

Hi everyone, I'm trying to parallelise a Gram-Schmidt algorithm. Here's the serial code: for( k = 0; k < m; k++ ) { for( i = 0; i < k; i++ ) { s = 0.0; for( j = 0; j < n; j++ ) { s += q[ i ][ j ] * q[ k ][ j ]; } for( j = 0; j < n; j++ ) { q[ k ][ j ] -= s * q[ i ][ j ]; } } s = 0.0; for( j = 0; j < n; j++ ) { s += …

0
1
Member Avatar

I am trying to parallelize the [Guibas Stolfi delaunay triangulation](http://goanna.cs.rmit.edu.au/~gl/research/comp_geom/delaunay/delaunay.html) using openmp. There are two things to parallelize here- the mergesort(),which i did and the divide() where I am stuck. I have tried all possible approaches but in vain. The approach followed(divide n conquer) in divide() is same as that of mergesort(),but applying the same parallelization technique(omp sections) works only for mergesort. I tried the parallelization technique shown [here](http://code.google.com/p/dewall-omp/),but even that doesn't work. I read about nested parallelism somewhere but i am not sure how to implement it. Can anybody explain how this divide and conquer algorithm can be parallelized? …

0
3
Member Avatar

Hey guys, I am playing with the .NET 4.0's new class Parallel. I tried to open files in a directory and calculate the total bytes of them. However when I run the code, I get a different result every time. Can you explain me the problem I have? [CODE]using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Diagnostics; using System.Runtime.Remoting.Messaging; using System.IO; using System.Drawing; namespace LearnCSharp { class Program { static long totalBytes = 0; private static object token = new object(); static void ProcessImages() { string directoryPath = @"C:\files"; string[] fileNames = Directory.GetFiles(directoryPath); if (fileNames …

Member Avatar
0
6
Member Avatar

Hello. I have written my code and I am almost done, but I keep getting LNK2019 errors. I'm not sure what I'm doing wrong. Any suggestions? [CODE]#include <iostream> #include <cmath> #include <iomanip> using namespace std; int getStudentCount(void); double getExamScores (int noStudents); double getLabScores(int noStudents); double calculatePointGrades(double, double); char calculateLetterGrades(double); void showGradeData(double, double, double, double); int i, noStudents, sum=0; double exam[100], labAvg[100], gradePt[100]; double totalLabAvg=0, totalExam=0, classLabAvg, classExamAvg; char letterGrade[100]; int main() { getStudentCount(); getExamScores(noStudents); getLabScores(noStudents); calculatePointGrades(exam[i], labAvg[i]); calculateLetterGrades(gradePt[i]); showGradeData(exam[i], labAvg[i], letterGrade[i], gradePt[i]); system("pause"); } int getStudentCount() { cout<< "Please enter the number of students" << endl; cin>> noStudents; cout<< endl; …

Member Avatar
0
6
Member Avatar

Hi, At the moment I am trying to open a log file with notepad.exe while the original process continues. As I am developing for Windows, fork() is not available for me. I googled alot and found a good reference to opening processes ([url]http://www.yolinux.com/TUTORIALS/ForkExecProcesses.html[/url]), however they all put the original process into a hold. For example: [CODE]exec("notepad.exe", "logs/Log.log", 0);[/CODE] or [CODE]system("notepad.exe logs/Log.log");[/CODE] All stop the original process. Does anyone know the way to fix my problem? I am developing on Windows XP and am using Code::Blocks as IDE. Thanks in advance, ~G

Member Avatar
0
5
Member Avatar

Hi guys. I know this is a long shot, but does anyone know if parallel computing (multiple simultaneous programmers/developers working on the same file) is possible for SQL databases? What I'm wondering if is possible is working on a local database that updates the mdf file in two computers, which have their own local SQL servers. Any thoughts?

Member Avatar
0
3
Member Avatar

Hey everybody. All my Google searches for help led me here so I thought I'd post my actual problem directly. I'm in a 101 programming course and this is only our second Python assignment. What I need to do is use one-dimensional parallel arrays to allow input of four different grades for a single student. I know that I need to use multiple arrays, ex: grade1[], grade2[], etc., but I'm not sure of what subscript to use or how to implement the arrays into the code. Our text doesn't go over the use of more than two one-dimensional arrays and …

Member Avatar
0
6
Member Avatar

Sort of at a dead end, I need to find a way to align an element from Array1 with a specified element from Array 2. I.e. A has the index of 1 and I want it to be aligned with e, How would I go about doing this? I have included two example arrays [CODE]var Array1 = ['A','B','C','D','E','F','G']; var Array2 = ['a','b','c','d','e','f'.'g'];[/CODE] I hope someone can help as been stuck on this for a few days now. Thanks cdes1145

Member Avatar
0
4
Member Avatar

i need a very simple coding of vb6 to control 8 leds connected with parallel port of my on-board parallel port. i need a little description with the coding to understand

Member Avatar
0
4
Member Avatar

Hi there, I have an old Olivetti PR2 Dot printer. This printer was (and nowadays new revisions of this model are) used in bank environment to print on passport books and a4 format sheet. This model in particular has a Parallel port and a serial (25pin) one as well. My question is: how can I print with this printer? I'm not an expert in this sense but the only thing I understod (I hope) is that you can't manage it as a normal end-user printer but you have in some manner "talk" with this printer by using string commands. I've …

Member Avatar
0
3
Member Avatar

I don't fully understand what is wrong with my code, it will read the first lines of any text file but then overloads and keeps displaying "0.00" and then crashes the program. I'm trying to get it to read student's last names and read their GPA scores, and the sentinel value is 99.9, Please help. [CODE]#include <iostream> #include <iomanip> #include <fstream> using namespace std; int main() { //Declare i/o variables ifstream inputFile; //Declare counters int counter = 0; //Declare Arrays char dataFile[20] = {""}; string studentLastName[100] = {""}; float studentGPA[100] = {0.0, }; cout << "Filename: "; cin >> dataFile; …

Member Avatar
0
9
Member Avatar

Hi all, I was just wondering if it is possible to use python to send pulses of 5 v (default) through the parallel port. I have made up a circuit board to interpret the pulses, yet this isn't helpful since there are no pulses to receive. Here's some specs( maybe it will effect the code) Output needed- 5 v ( pins 2,3,4) - any voltage (pins 6,7,8) Thanks in advance Python01

Member Avatar
0
6
Member Avatar

Hi everyone! Just wanted to ask before i begin messing around. Is it possible for two processes to access the parallel port simultaneously? So that if i short circuit Input pins to output pins of the parallel port one process will provide input to another one? I am using Windows XP and C++. The first process is a commercial one which cannot be modified. In my experience with serial port it was impossible to interface it when another process had the access. Thanks in advance!

Member Avatar
0
4
Member Avatar

* This program inputs ten integers and * displays the mode using parallel arrays. * Use a method to calculate the mode. This is my specs. I cannot figure out a solution as to how to find the mode using only two arrays. Help would be gratefully appreciated

Member Avatar
0
6
Member Avatar

[ATTACH=left]17191[/ATTACH]Today at Intel's IDF 2010 was the official launch of the 2011 version of Intel Parallel Studio. Parallel Studio is a set of tools that enhance Visual Studio to support full parallel programming. This is more than just a simple plug-in for Visual Studio. It's an entire set of tools covering the entire development workflow. In terms of parallel development, these steps are design, build and debug, verify, and tune. For designing, you have the Intel Parallel Advisor, which sismplifies the process of adding parallelism to your application. For the build and debug phase, you have the Parallel Composer. Together …

Member Avatar
5
17
Member Avatar

[ATTACH=RIGHT]17350[/ATTACH]Since the release of the second edition of Parallel Studio this month, I've spent a good amount of time with it, trying out the new features. First, what's Parallel Studio? It's an add-in for Microsoft Visual Studio that gives you a large set of features for writing parallel code that targets multiple processor cores. It includes a new C++ compiler that gets run instead of the built-in Visual C++ compiler, allowing you to take advantage of several new features. Parallel Studio integrates with all the recent versions of Visual Studio: 2005, 2008, and 2010. Parallel Studio 2011, which is the …

Member Avatar
4
11
Member Avatar

Could someone please advise me on how to implement fork() in a parallel processing (multiplying) of a 2d array....I have been at this for far too long.. here is my code [code] for (int i = 0; i < rowCol[0]; i++ ) result[i] = (float*)malloc ( rowCol[1] * sizeof(float) ); int i = 0; int j = 0; int k = 0; for(i = 0; i < rowCol[0]; i++) { for( j = 0; j <rowCol[3]; j++) { result[i][j] = 0; for( k = 0; k < rowCol[1]; k++) { result[i][j] += (matrix1[i][k] * matrix2[k][j]); } } } [/code] Any …

Member Avatar
0
9
Member Avatar

Thought you were bleeding edge with your quad-core PC? Think again. A company called Tilera today announced that it's working on a chip containing 100 processor cores, which it says could be seen by 2011. It's part of its new TILE-Gx line of 64-bit multi-core processors, the first of which--a 36-core chip--will be sampling by the end of 2010, the company said today in a [url=http://www.tilera.com/news_&_events/press_release_091026.php]statement[/url]. With its top-end TILE-Gx100, Tilera claims to outstrip Intel's next-generation Westmere processor in performance-per-watt by a factor of 10. Other models will contain 16 and 64 cores, and will sample in early 2011. But …

1
1
Member Avatar

The meaning of parallel is not that of parallel processing. I simply mean that if algorithms A and B are represented by the two sequence of operations (a_1, a_2, ...) and (b_1, b_2, ...), then the executed sequence of operations is (a_1, b_1, a_2, b_2, ...). It is not compulsory to be strictly 1 operation from A followed by 1 operation of B. This number may vary. Nonetheless, this should work on systems with only one thread of execution (without built-in parallelism). The "merged" algorithm that is derived should terminate its execution when either A or B terminates. The two …

Member Avatar
0
4

The End.