Hi,
I am looking for a C++ library for image processing. I need the library to threshold a PPM photo (color photo). Should I write my own code? what do you guys think? Thanks in advance.
Hi guys
I have grid size of size 8x8 , total of 64 Tiles.
i'm using this Grid to implement java search algorithms such as BFS and DFS.
The Grid has given forbidden Tiles (meaning they can't be traversed or be neighbour of any other tile) and Goal and Start tile. for example Tile 19,20,21,22 and 35, 39 are forbidden and 14 an 43 are the Goal and start node when the program runs.
My question is , How can i double the size of the grid, to 16x16 whilst keeping the Relative position of forbidden tiles as well as the Relative position of start and goal Tiles intact?
On paper i know i can do this by adding 4 rows and columns to all size but in coding terms i don't know how to make it work? Can someone please give any sort of hints?
hi i have a file having svn diff i wish to extract the filenames form the diff.
How to write the parser for that..
Index: libs/constant.php
===================================================================
--- libs/constant.php (revision 1243)
+++ libs/constant.php (revision 1244)
@@ -26,5 +26,5 @@
// changesss
-
+// test 2
?>
\ No newline at end of file
Index: libs/Tools.php
===================================================================
--- libs/Tools.php (revision 1243)
+++ libs/Tools.php (revision 1244)
@@ -34,5 +34,5 @@
// another file an change
-
+// test
?>
\ No newline at end of file
Sample output.
libs/constant.php
libs/Tools.php
How to write parser in PHP and C.
Hello,
Is there significant problem, if I write the code for embedded linux system using C++ language programming ?.
Actually, I have intention to port some code to arm linux, with arm-uclibc compiler.
Thanks
I am a student at University so my experience is limited, hence the question.
If someone says to you, here is a task to code, what are you looking at in order to choose the language or paradigm in which you will do it in?
Hope the question makes sense?
This is my DrawSomethingCmd:
#import "Command.h";
@interface DrawSomethingCmd : Command {
}
-(void)doSomething;
-(void)execute;
@end
and the DrawSomethingCmd.m's doSomething method is like that:
-(void)doSomething{
NSLog(@"did");
}
The Command.h:
#import <Foundation/Foundation.h>
@interface Command : NSObject {
}
-(void)execute;
And the Command.m:
#import "Command.h"
@implementation Command
-(id)init{
return self;
}
-(void)execute{
}
@end
And I have the method like this:
DrawSomethingCmd *tempCmd = [[DrawSomethingCmd alloc] init];
[tempCmd doSomething];
But my Console did't show any things on that, what's going on?
#include "stdio.h"
main()
{
int i=3,*x;
float j=1.5,*y;
char k='c',*z;
x=&i;
y=&j;
z=&k;
printf("\nAddress of x= %u",x);
printf("\nAddress of y= %u",y);
printf("\nAddress of z= %u",z);
x++;
y++;y++;y++;y++;
z++;
printf("\nNew Address of x= %u",x);
printf("\nNew Address of y= %u",y);
printf("\nNew Address of z= %u",z);
printf("\nNew Value of i= %d",i);
printf("\nNew Value of j= %f",j);
printf("\nNew Value of k= %c\n",k);
}
Output:
Address of x= 3219901868
Address of y= 3219901860
Address of z= 3219901875
New Address of x= 3219901872
New Address of y= 3219901876
New Address of z= 3219901876
New Value of i= 3
New Value of j= 1.500000
New Value of k= c
The new address of variable y and z are same. How can two variables have same address and et have different values?
Note: I used gcc compiler on Ubuntu 9.04
I have a few questions about python
I've seen many pages like these on Google
http://mail.google.com/support/bin/answer.py?answer=6583
https://www.google.com/adsense/support/bin/topic.py?topic=13488
...that have .py extensions. 1: Are pages like these built on pure python code, but printing out html like print "<div etc..." or like the typical asp,jsp,php type of pages with html pages and embedded python code like:
<html>
<% some python code %>
</html>
2: What is python mainly used for making? windows apps or web or .. ?
3: Are ruby and perl also similar to python?
I would like to know about JavaScipt. Is Javascipt is available only for web browsers? Because I used some JavaScript code for Firefox Plugin development and Thunderbird.
Help me to find out more about this: where can I use JavaScript other than web browsers, and how?
Hi,
Many a times in blogs and books, i have seen conditions in if statements like this:
if(0 == a.size()){...}
or
if(-1 == str.indexOf(ch)){...}
Is there any performance advantage in using integer literals on left hand side in conditions or is it just a style that some programmers prefer?
I am interested in knowing Debugging setup that'll allow me to be most productive.
I am mainly interested in knowing how and where you place different windows like the variables window, code window, the stack. Also possibly the relative size of different windows.
I'd prefer if there are screenshots attached and a description of why the setup works for you.
I mainly use Eclipse and Netbeans.
PS: I am open to making this community wiki if needed.
Proprietary software is about as good as open-source software. There are so many problems with proprietary technologies, however, that I'm beginning to think it's best to avoid them:
The software will only be maintained as long as the company exists (and profits).
The level of security of the application is as unknowable as the source code.
Alterations and derivative works, however necessary and beneficial, are disallowed.
I simply don't see any point in even learning to use such systems as those created by Microsoft and Apple. Of course I don't pretend that ignorance is the superior option: one has to have a certain working knowledge simply because of the ubiquity of these things. I just don't see any reason why, as an independent developer, I should ever consider it a remotely good idea to actually use them.
So that's the question, or discussion topic, or what have you:
In what ways do developers benefit at all from using closed-source development software?
UPDATE: Perhaps this wasn't clear from my original post, but I'm mainly interested in knowing a best practice for how to structure javascript code while building a solution, not simply learning how to use APIs (though that is certainly important).
I need to add functionality to a web site and our team has decided to approach the solution using a web service that receives a call from a JSON-formatted AJAX request from within the web site. The web service has been created and works great. Now I have been tasked with writing the javascript/html side of the solution.
If I were solving this problem in C#, I would create separate classes for formatting the request, handling the AJAX request/response, parsing the response, and finally inserting the response somehow into the DOM. I would build properties and methods appropriately into each class, doing my best to separate functionality and structure where appropriate.
However, I have to solve this problem in javascript. Firstly, how could I approach my solution in javascript in the way I would approach it from C# as described above? Or more importantly, what's a better way to approach structuring code in javascript?
Any advice or links to helpful material on the web would be greatly appreciated.
NOTE: Though perhaps not immediately relevant to this question, it may be worth noting that we will be using jQuery in our solution.
I have the following code:
$sql = "SELECT name, address, city FROM tableA, tableB WHERE tableA.id = tableB.id";
if (isset($price) ) {
$sql = $sql . ' AND price = :price ';
}
if (isset($sqft) ) {
$sql = $sql . ' AND sqft >= :sqft ';
}
if (isset($bedrooms) ) {
$sql = $sql . ' AND bedrooms >= :bedrooms ';
}
$stmt = $dbh->prepare($sql);
if (isset($price) ) {
$stmt->bindParam(':price', $price);
}
if (isset($sqft) ) {
$stmt->bindParam(':price', $price);
}
if (isset($bedrooms) ) {
$stmt->bindParam(':bedrooms', $bedrooms);
}
$stmt->execute();
$result_set = $stmt->fetchAll(PDO::FETCH_ASSOC);
What I notice is the redundant multiple IF statements I have.
Question: is there any way to clean up my code so that I don't have these multiple IF statements for prepared statements?
Hi,
considering I have experience with Java SE: which language should I learn(and is best for that purpose) in order to build web applications some day with it? I have been contemplating PHP and Java EE. The latter does indeed seems as an obvious choice given my Java SE knowledge. But how does it fares in comparison with PHP and how good is it for the aforementioned purpose?
If there is a better language for this purpose, feel free to recommend it.
Thank you.
We all hear that math at least helps a little bit with programming. My question though, does English or other natural language skills help with programming? I know it has to help with technical documentation, but what about actual programming? Are certain constructs in a programming language also there in natural languages? Does knowing how to write a 20 page research paper help with writing a 20k loc programming project?
Suppose I have this program, I want to compare 2 input lists. Assume array A and array B. How do I determine the best case and worst case of the function?
Here is my code in [php]:
foreach($array_1 as $k){
if(!in_array($k, $array_2)){
array_push($array_2, $k);
}
}
What is the best case and worst case of the for loop? Please include some explaination, thank you :)
I would like to write a Skype like software which allows P2P video/audio streaming. What language is better suited for that?
There are several requirements:
Software should be easy to install.
It should be easy to program.
I want to have access to video information. For example to make a face expression recognition on the fly.
It should be free.
I am thinking of Python and Java. Which one would be better? Or may be there is a third choice which is better?
ADDED
Flash is an attractive option since users can use their browser in which flash is installed by default and if not, it's easy to install flash. But I do not know if I can have access to video (if I want to do some processing). Moreover, Flash is not free.
I'm a junior VB.net developer with little application design knowledge. I've been reading a lot of material online regarding different design patterns, frameworks, and methodologies. It's become a bit confusing for me.
Right now I'm trying to decide on what language would be best suited to convert an existing VB6 application (with SQL server backend.) I need to update the UI and add more user functionality and reporting capabilities. Initially I was thinking of using WPF and attempting the MVVM model for this big project. Reports would be generated from SSRS.
A peer suggested using ASP.net and I don't have enough experience to determine what would be better. The senior programmers here are stuck on using VB6 and don't have any input on what to use. They are encouraging me to use the latest technologies.
This application would be for ~20 users in a central location. Ideally I would stick to a Microsoft .net language. Current interface is similar to a datagrid table where the user would click in to see the detail of each record. They would need to have multiple records open at any given time.
I look forward to all the advice I can get.
EDIT 2010/04/22 2:47 PM EST
What is your audience? Internal clients within an intranet
How complex are the interactions you expect to implement? not very... displaying data from SQL server to UI. Allow user updates to said data. Typically just one user modifying a record.
Do you require near real-time data updates? no
How often do you expect to update the application after the first release? twice/year
Do you expect a well-defined set of client platforms? Yes, windows xp environment, potentially upgrading to Win7. Currently in IE.6 moving to IE7 or 8 within a couple of months.
Do users need access from anywhere? No, just from their PC.
Well i got this job offer and they expect alot i say. i know most of this but, i would like to know what type of pay i should expect. I dont well to sell short you know.
with Web Designer: Dreamweaver, HTML, JavaScript, Graphic Design/Manipulation, Templates, Layouts, Navigation, Flash/Multimedia Objects. Programmer: PHP, Web Application Development, MVC, Joomla, AJAX, JQuery, My SQL (SQL, Database).
I found myself confronted with an interview question where the goal was to write a sorting algorithm that sorts an array of unsorted int values:
int[] unsortedArray = { 9, 6, 3, 1, 5, 8, 4, 2, 7, 0 };
Now I googled and found out that there are so many sorting algorithms out there!
Finally I could motivate myself to dig into Bubble Sort because it seemed pretty simple to start with.
I read the sample code and came to a solution looking like this:
static int[] BubbleSort(ref int[] array)
{
long lastItemLocation = array.Length - 1;
int temp;
bool swapped;
do
{
swapped = false;
for (int itemLocationCounter = 0; itemLocationCounter < lastItemLocation; itemLocationCounter++)
{
if (array[itemLocationCounter] > array[itemLocationCounter + 1])
{
temp = array[itemLocationCounter];
array[itemLocationCounter] = array[itemLocationCounter + 1];
array[itemLocationCounter + 1] = temp;
swapped = true;
}
}
} while (swapped);
return array;
}
I clearly see that this is a situation where the do { //work } while(cond) statement is a great help to be and prevents the use of another helper variable.
But is this the only case that this is more useful or do you know any other application where this condition has been used?
I have an idea to start a Open Source Software using Java and PHP, I am so sure
that software will help many individuals in their daily routine.
Can Any one suggest me how to start the process ?
Do we need to register some where and submit our idea for an approval before we start development?
Any license that we need to get?
How to invite the people for the open source development community, if they are interested?
If any people who contributes Do we need to get any agreement signed off?
once the Open Source product is stabilized who will have the ownership?
My application is a non-relational database application with a tcl interface to retrieve data. I would like to add SQL programming interface to my application.
Is there any library that converts SQL/PLSQL statements to API calls? It should also support stored procedures.
SQLite(Embedded) has 'virtual table' mechanism that suits my requirement but it lacks stored procedure feature.
-Gopala