Mr.M 89 Future Programmers

Does this file always located in one path? Does the server have this file too? Is the path to this file the same on the server?

Mr.M 89 Future Programmers

Well it seems as if you just want to check if the controls do not contains identical data. Because you not specific to either time or date you can do it like this:

If DateTimePicker1.ToString IsNot ListBox1.Text.ToString Then
' Do what ever you want here

End If

Sorry for not formatting the code I'm using the mobile phone. The code is not tested either but that how you could do it.

Mr.M 89 Future Programmers

What is you problem exactly? You want to load all the images of geographic while the page is loading or?

Mr.M 89 Future Programmers

Hi Dw.

I'm developing a system using c++ for the XFS. I've followed the documentation on how to install the SDK but the problem is that I've successfully installed the SDK but when I start to create the sample, when I try to put the required includes they are not located where the rest of the Visual C++ include files are located but the XFS is installed as follows: "C:\Program Files\XFS" where as the rest of the VC++ are located here: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include"

If I try to call #include <xfsadm.h> it doesn't find it.

I'm not a pro with C++ I'm good in VB.

Any help in solving this problem? Thanks

Mr.M 89 Future Programmers

Yes that what I'm trying to achieve here. A client (one client) can get access and write but what about the other let's just say 600 clients who are also trying or writing to this file at the same time? How do I make sure that the data that is written by the first client that got access remains on a file while other clients are also writing to this file and also keep these clients data that they wrote. I think it will be better if we forgot a little bit about the number of file a server has but just focus on one file for simplicity. Let say the file is test1.txt and I have a multi-thread server and as many clients as possible which writes data to this test1.txt file at the same time how will that be solved?

I've read about the lock but I didn't know where about I will put a lock on my server.

Thank you.

Mr.M 89 Future Programmers

@JamesCherrill about the 60 files those are text files in one folder but when I combine all 10 folders gives me 600 but there are other files which are on the year folder which are almost 400 so that gives 1000. Sorry for not clearing that at first but all my samples focus on just one folder to get idea and also for simplicity.

Mr.M 89 Future Programmers

@Taywin. I meant I'm viewing the daniweb using a mobile phone but the program is computer based. The clients sends a message to the server, the server is currently multi-thread and I've just created two clients using Visual Basic 5.0 and I made each client winsock to be able to receive the incoming response from server which is currently the client send a message the server receive the message and it forward back to that client sends it as a feedback at the moment. I think that gives me a clue on how I will make it put on pause that particular client when the "Producer Customer" is full, now the problem that still there is solving the split loop or should I say "For" so that I will be able to load to memory the message data so that I will be able to call it just like Arrays "something[0], something[1], and so on".

Ow and @Taywin about that 3rd post of yours which I responded with something with cell phone or mobile phone, where you said you not certain with the design of my system, I just looked at it using a computer and to answer that question the system is as the first one where the clients are connected to threads and the threads should connect with Producer Customer.

Mr.M 89 Future Programmers

I'm not clear with that as I'm using a mobile at the moment, your post is a mixture characters. To simplify at the moment I haven't added the "Producer Customer" at the moment. I've used your code to split the messages and I've also used "JamesCherrill's" code for multi-threading I haven't made any changes at the moment because I'm not sure where to add the "Producer Customer" because I'm also not too familiar with java the only thing that forced me to change from VB.NET to Java was the ability to support multi-threading then I was forced to try and use java. But I think it would be better if the server do receive the data from clients and if for instance 10 clients sends the same message at the same time the server will receive the data and sort it in memory by adding all the related data like this:
1
1
1
1
1
1
1
1
1
1
And once that has been sorted it can be written to the file, while it write data to the file the memory receive another data, as the data is being sorted or once the sorting and writing to file is done the server will send "done" to each and every client that it data that it has sent has been processed (sorted) and written to the file. But if any suggestion which may simplify this and also allow …

Mr.M 89 Future Programmers

And also what I'm not sure or clear about here is that when I use the "Producer Customer" which is "LinkedBlockingQueue" if you will remember on my server the client send one message which has to messages and taking in to account that I couldn't manage to take the data that was split from each message potion and assign it to its own unique variable like fyear for the first potion year, what I did was I took an advantage of the split and while it had split the first potion message data I assign the data to the associated variables and I save the data to their corresponding files and the system loops and once it done split of the first potion it then move to second potion as it loops it uses the same variable that it used in the first message potion but it now save the second message potion data to the variables correctly and save it to the corresponding files. So what not clear now is that how will I save or use the "Producer Customer" in this situation and if it happens to be able to load data to the memory how will I retrieve it because it loops it? Please refer to this: http://www.daniweb.com/software-development/java/threads/481619/server-split-message-and-save-data-on-a-text-file

Thank you.

Mr.M 89 Future Programmers

When you say "Create a LinkedBlockingQueue for each file" you mean as I have almost 1000 files I have to create that for each file or?

Mr.M 89 Future Programmers

Ok thanks but I'm way lost on how I will go about doing this.

Mr.M 89 Future Programmers

Well I don't think it will be slow because it only writes 3bytes data to a text file, it just write 1 nothing else is written to the text file but each 1 is written on it own line.

Mr.M 89 Future Programmers

Hi Dw

I have a multi-threaded server that connects thousands of clients. The clients sends in data that the server must write to a text file. As there are a thousands of clients sending in data the server has about 60 texts files but the data sent by the client to the server gives a server a clue on which text file to write to. Suppose in the server side I have these two text files: "test1.txt" and "test2.txt"

Let's say the client sends <test2, testing> the server knows that it should write "testing" on test2.txt so now as there are a thousand clients it can happen that maybe 50 clients sends the same data to the server at the same time that means the threads will write to the same file simultaneously.

So how can I make it handle this all the data written by all the threads at the same time be saved to a file meaning allowing multi-threads to write to the same file simultaneously without overriding the existing text?

Thanks in advance.

Sample code of this server: www.daniweb.com/software-development/java/threads/481619/server-split-message-and-save-data-on-a-text-file

Mr.M 89 Future Programmers

Thanks that helped a lot. I was going to ask this question later but then since you have brought this forward I will just ask straight away.

What I wanted to do was since it a multiple thread and multiple clients are connected simultaneously I wanted the client to get a certain number on a text file which will be generated by another program and that text file is an unlocker of a client system, meaning the components on a client side are hidden so that no user(human) can use the system at the moment till a this text file is created and once it has been created the client will take the text(it a number but I don't treat it as numbers I treat it as text) and it will look on another text file to see if the text(numbers) in the text unlock.txt do match any text(number) in text verify.txt

The text verify.txt get the texts in two ways.
1) The client it self write the text from a text file unlock.txt if the unlock.txt texts doesn't have a match and the client will send out this texts as echo so that all the clients connected will also receive this text and write it on their verify.txt so that this number will not be used twice in any client connected.
2) The client gets the echo from other clients and first it check if the echoed text hasn't already been written to the file verify.txt if …

Mr.M 89 Future Programmers

I've just took an advantage of it and written the value to the corresponding file while the fChoice variable holds the values. One variable is able to locate two different folders that contains the same file and write to it. Thanks it working fine now.

The problem is that when ever the client closes it connection to the server the server shutsdown. Any idea how can I solve that?

Mr.M 89 Future Programmers

Oops another problem arise.
I've used "fChoice = data[1];" to pick the first potion users Choice, but the problem is that its a loop so the variable "fChoice" only holds the value for the first potion while the loop is there or while the system is reading there once the system moves on to read the second potion, this fChoice variable clears the first potion value and holds the second potion value.

Note that the values or data on array[1] in both potions are not the same. The first potion data[1] holds the users choice, and the second portion data[1] holds the province

I have fChoice variable which should only holds the first potion data[1] value and the sProvince variable should only holds the second potion data[1] value.

Any suggestion on how I can solve this?

Thanks again

Mr.M 89 Future Programmers

Thanks I've sorted it out. Thanks to each and everyone of you who participated.

Mr.M 89 Future Programmers

Wow!!! That was awesome. Thank you in a million ways. Excellent and I doubt I was goner be able to write that. Impressive.

Thank you soo much that was purely clean and excellent. Now how will I initialize these values to each variable?

Also I've added trim at "String[] data = message.split("\s,\s"); because the last value of the second potion was having a space at th end like this ~~1 ~~ after I've added trim before "split()" like this message.trim().split ".

Thanks again

Mr.M 89 Future Programmers

Ok thanks but I haven't tried those suggestions yet. I can see that I didn't fully mentioned the message format now by looking on both of your posts I can see that if I don't state now the changes I made to the message format I will have a serious problem.

Well I will only show how I formatted the message or how it is displayed on the server before we get to the part of separating or splitting it into pieces.

First of all let me clear out about the message it self. The client sends a two messages not two separate messages but it one message which has 2 messages. This may not be clear till I show you the message, I won't show the client but I will show the output. Here is the message

Suppose the client is at Moscow, the client's first choice is Cow and also his/her second choice is Cow and the year is 2014. The messages are as follow note that the client make two choices before the socket sends the message to the server.

The message display as shown below:

< 2014 , N , Cow , 1 > < 2014 , Moscow , Cow , 1 >

As you can see above this is a 1 message received and it contains two messages.
The first message is < 2014 , N , Cow , 1 > which when being split the server will use it to locate the folder …

Mr.M 89 Future Programmers

Thank you, but I couldn't get it working using that link, it had bugs and I didn't understand some parts like the "KnockKnockProtocol" so I just started by making a single thread or app to accept the connection from a VB 5.0 app client which it does accept connection but now the problem is that if the client send the data to the server the server does not print it out until on the client I close the Winsock connection (Winsock1.Close) then the server prints the data that was sent by a client. Any idea why it can't print immediately just like my other server I created using VB5.0?

I used the tutorial on the following post:
<a href="http://www.dreamincode.net/forums/topic/38672-creating-a-server-to-serve-clients/">here is it</a>

And also about splitting the received message so that I can put the correct data into their corresponding files can you give me a sample suppose the client sends:
(Cow, 1, Moscow)

Cow as the name of the file and
1 as the value which will be written to the file and
Moscow as the place which will also the name of a folder containing the file Cow.

Thanks again.

Mr.M 89 Future Programmers

Hi Dw

I'm trying to create a server that will handle simultaneous connections from clients and for simplicity I've decided to save data to the text files, it not one text file but there are many text files which will be located on the server.

The clients (written in VB5.0) will connect to the server only when a user has clicked join button. I have almost more then 57 buttons which are choices a user will select only one button. I will make an example with the first two buttons. Button1 'Cow' , Button2 'Dog'.

Now the client will send this info to the server suppose the user clicked Button1 which is Dog so the message that will be sent to the server will be "Cow, 1, Area"

'Cow' is to tell the server the name of a text file to write in the '1' and the 'Area' will be retrieved by the client on a configuration file which will be located on each client computer but the area will also be used too. Now that I've said that let me break it down to what I have and what I'm trying to do.

On the server I will have folders that will be located in drive 'C:\' the folder structure will be as follows "Date&Year "-> inside I will have two folders: first; on this folder inside it I will have empty text files which will be updated by the server as clients make their selections and each text …

Mr.M 89 Future Programmers

True, I've just managed to open daniweb on RIM browser and everything is fine as if I'm using a computer including the mark and stop buttons are not attached to each other, I think the problem is with my Opera Min browser as I eexperience this problem only on it. I will have to change to another better browser which will support my phone. I will then mark this question solved. Thanks again to everyone who had an input and helped solve the problems that were stated.

Mr.M 89 Future Programmers

Thanks both of you for your suggestion but I won't be able to do the way I've planned if I buy/download other products unless it a library. I found out this and now the problem is pointing it to look in to directory where there is a list of images like 'C:\test'. Here is the link to what I've found: stackoverflow.com/questions/10899828/vb-net-check-if-image-existing-in-another-image

But this is checking if a certain part or image exist on another image 'checking the existence of an image within image'

Mr.M 89 Future Programmers

I'm glad if that problem has been solved. I also tried to look at the 'Mark Question solved' and 'Stop watching this thread' button to figure out why on BlackBerry the buttons are attached to each other which makes it really hard to mark the post solved sometimes when I try to mark the question solve it just select the stop watching, but then as I was more into the up/down voting buttons I ended up couldn't check properly on why this is happening.

I've spotted this problem on BlackBerry 9300 with Opera Min, I tried to use the RIM browser but it just crash while I try to login because it says the page is too large.

Mr.M 89 Future Programmers

Ok I've just checked the voting buttons and I think you should find a way to make these buttons images and go with the old HTML approach not the entire site but only these buttons.

1) Force these to be the links by that way it will be enable to all the devices but the "vote on post with comment that will depend on the browser the client is using and also his/her phone if it support the javascript so that the comment box will popup but the alternative way is to use the <href> technique so that those pictures will turnout to be links which will be visible to any phone as I've stated.

2) Or you can code it exactely as how you've coded the Mark Question Solved and Stop Watching this Article, the same thing i think will apply which is the the browser dependence of vote post with comment which will also depends on the clients phone if it support javascripting or not.

This is what I've thought after a closer look on these components on this site.

Mr.M 89 Future Programmers

Hi Dw

I've create a program to capture the images using the webcam and now what I want is that before the image is saved the program verifies if that image has already been taken and saved. Suppose the I have captured my picture and then if I recapture my picture the face it will capture but search if the matching image has been already taken and if the image exist the system will display the message stating that the image has already been taken.

My problem is looping through the saved images and check if the image has already been taken.

Thanks.

Mr.M 89 Future Programmers

I will check it tomorrow because that when I will be able to get access to a computer with an internet connection then I will post back my findings

<M/> commented: Then... what are you using to write that message? +0
Mr.M 89 Future Programmers

Ok thanks. So I'm not sure if this "dev.mysql.com/doc/refman/5.7/en/introduction.html" MYSQL will be suitable for this. But I can feel this will be way complicated.

Mr.M 89 Future Programmers

Forgot to mention that I will also have another text file named barcode.txt on the server when the user scans his/her barcode the system will connect to the server and check on the text file if this barcode do exist or not if not then it will be registered and the system will be enabled else if the system finds that the barcode exist it will deny the access and beep so that controllers will be aware of that person trying to miss-use the system.

Mr.M 89 Future Programmers

Ok thanks, but according to your suggestion
1) php
The problem is that it won't be much easy for me to control the access of the system if I use a website or (php) in the following reasons:
a) I wanted to plug a barcode scanner which will scan a users barcode then if the user hasn't used the system before the system can be enable and the user can make his/her choices once he/she click ok then the data will be sent to the server database straight away and his/her barcode will be captured on a server database under usedcodes table so that the user does not use twice the system.

b) the system can't be hosted elsewhere because we will need the geographic province for that user because it will also be used at a later stage so I think with a php we will be forced to create thousands of php or a file where it can read its geographic province it is being installed in.

C) it can be hacked easily.

Same problems with ASP.NET as above and the main problem with ASP.NET
Is hosting. This system will be used once after a certain years so we can't waist money and pay for domain, hosting while the system will be used once only.

So as towards you just said I just thought of then using a text files then instead of database. On the server I will have 2 folders in on …

Mr.M 89 Future Programmers

Hi Dw

I'm planing on creating a system that will share the same database over internet. There will be one core server where the database will be located and there will be a thousands of client programs that will modify the database simultaneously over internet. I've never done something like this before and I'm seeking for advice because I'm not too sure if this won't affect the system. The database has 10 tables and each table has almost 60 fields which will be empty but be filled by the clients as they access the data base.

How can I create this kind of server program and also how can I make sure that all the data that is sent by all the clients program are saved to the correct table and fields. I must say the clients will be installed in different places and there is 100% chance that these clients can send in data at the same time to a one table and field so how can I make a server program that can be able to handle all the sent in data at the same time so that the process can be faster and be 100% accurate. I think it will be wise to crypt the data on the client side before it is sent for security purposes but I think that will slower down the process because the server will be forced to decrypt before saving.

Any resources, suggestion, guide will be appreciated

Thank you.

Mr.M 89 Future Programmers

Ok. But if we will put jpos aside and just speak pure java, how to get or control peripherals because that what jpos doing but they have a more advanced method, or perhaps how to make a device interface that communicate with the device connected on a usb port.

Mr.M 89 Future Programmers

Mmm once I get access to a computer with an internet I will try to trace the post voting buttons so that I can confirm my suggestion that can be done because I've thought of something but first I need to find out how the current post voting buttons are made. I will post back with my findings.

Mr.M 89 Future Programmers

Hi Dw

I'm making a pos app and I would like to know if the jpos can control the device which is controlled by xfs written software. The xfs has commands in this format: AFD000 CDMOpenSafeDoor which is for opening the safe door when dispensing or should I also convert mine to xfs command?

1) I don't clearly understand about the creation of jpos.xml file the Logical name is it the Logical name for the device or firmware?

There is also something class that is also required if you will open JposEntry file and scroll down you will see constants that where these info is required and also if I put these there do I still need to create the jpos.xml file?

My program is currently running fine it just that when I choose the amount to withdraw it produce this error "Control not Opened" and I'm sure it is done by that I don't have correct configuration. The code for dispensing is "cashDispenser.dispenseCash(amount);"

Anyone who can help me correctly configure this according to JposEntry I'm using Opteva cashdispenser v 2.0.0.0 I know the Manufacture, and their address.

Thank you

Mr.M 89 Future Programmers

Ok take your time. Please do keep me updated when you have find a way of solving those problems.

Mr.M 89 Future Programmers

Thank you princess.

Mr.M 89 Future Programmers

Hi DW

I know I'm nothing but a member of this greatest community, but I would like to point out some of the thing I've experienced I won't talk for everyone because I maybe the only one experiencing it.

1) Can you guys please find a way to separate the two buttons which is 'Mark thread solved' and 'Stop watching this thread' I personally find it hard to select on as they are combined 'I think you will see this if you are using a BlackBerry to select one of these buttons.

2) The code formatting panel is not visible at all I'm not sure if it is visible to other mobile phones but on BlackBerry it is not visible.

3) The vote post up or down they are visible but can't be selected.

I'm not trying to make you change your style or anything just letting you know of these issues.

I didn't know where or how could I get hold of the Dani development team, I know someone knows will see this post and forward the message to the right people.

I thank you.

Mr.M 89 Future Programmers

Ok thank you. I guess in that case I will mark this thread solved.

Mr.M 89 Future Programmers

If you have 2 forms on you can create the variables that will hold the connection, data and pass it to the second form and perform the edit method from there, or simple on the first form if you click the record you want to edit and click your edit button you can pass the record to the second form and on the second form you will need to open connection and use the record info to edit the correct record.

Mr.M 89 Future Programmers

Sorry for the duplication of posts, I had a problem when I was posting. Thanks that help in deleting the registry key but now the problem is that if I put the program on the same path that was registered meaning "C:\test" if I just put my app on that folder after I've deleted the registry and restart the computer the program still execute automatically I don't know why.

Mr.M 89 Future Programmers

Jea that's how I did with double \ I don't know what happened when I posted, I will try out it as you suggested and see how it does.

Mr.M 89 Future Programmers

Jea that's how I did with double \ I don't know what happened when I posted, I will try out it as you suggested and see how it does.

Mr.M 89 Future Programmers

Here is my code.

Process g = new ProcessBuilder("reg.exe", "REG", "DELETE", "HKLM\Software\Microsoft\Windows\CurrentVersion\Test", "/f").start();

I tried it without the "/f" which is force the deletion without asking for confirmation but still it doesn't work. I also tried combining the code but still nothing. Sorry for not formatting the code snip I'm using Cell phone and the panel is not visible that enable me to format the code.

Mr.M 89 Future Programmers

It doesn't work

Mr.M 89 Future Programmers

Hi Dw

How can I delete a registry key for other program, I just checked my registry and the virus was registered under the same registry key of my other program and now I want to use java as also part of learning java and the method of accessing and deleting a particular registry.

Any suggestion, link, structure code will be appreciated.

Thank you

Mr.M 89 Future Programmers

Ok now I've manage to put it all together and now if I run it now it produce an exceptional error that the control is not open.

Mr.M 89 Future Programmers

Starting by the BillDispenser.java file under Capabilities, Properties, and Methods each of it has an error on it "catch(JposException je)" line and if I place a mouse over it a pop up message with a message "exception JposException is never thrown in body of corresponding try statement" but if I comment out the try and all the catch the errors are removed so I can't go that way since I'm not a master and also new in inter-reacting with real hardware so it will be good practice to catch any error so that I can see if everything goes as per my instruction or if there was difficulties in performing the task.

Moving to all those files Service111 and Control111 which have just one error which is in 29 if I look at BillDispenserControl111 which is as follows
Public interface BillDispenserControl111 extends BaseControl

That is the only line with an error and error message is as follows:
Duplicate class:jpos.BillDispenserControl111

So what I did is that I created another project called test1 and on jpos I took the files as follows first I took those files I think they are capable of inter-reacting with the device then I took all those required or linked files to my test1 project to prevent the error file not found errors now the test1 project is fine with no error because I only loaded the selected files from jpos. Files I've loaded in A-Z order are:

AbstractRegPopulator
BaseControl
BaseJposControl
BaseService

Mr.M 89 Future Programmers

Hi Dw

I've been cracking my head trying to figure out the best way I can use to inter-react or send direct action commands to the device. Starting by stating what I'm trying to do here. I'm trying to create a POS system I've looked at jpos library packages but I get confused but I've noticed just by looking on a file BillDispenser in the jpos files I can see that it have links to file called BaseJposControl which is extended by a file called BaseControl.

My main problem is that I can't for instance use jpos because file BillDispenser, BillDispenserService111, and all files with Service111 have errors on their public line which is the first line below the imports so I've created my own main menu and validation now the problem is how can I make my for instance transaction class let say be able to send the cashDispenser.dispenseCash(amount); to the cashdispenser device. Just need the skeleton or structure because I get lost in jpos on how I will do this because jpos have many files but I've loaded those files I think they are required to perform this task.

Any help, link, recommendation, and reference will be appreciated.

Thank you.

Mr.M 89 Future Programmers

Thanks.

Mr.M 89 Future Programmers

Hi Dw

I'm not a master in java and I'm kinder new to it even though I can do certain things in java.

I'm developing an object oriented project and I've done with the object class now I want to make the device be able to listen and execute the class commands, the device has to do what the class is doing so now I want to create that connection between the two, so now I just take some parts of jpos to make this easy but now when using jpos it require to either add all the jpos classes or , but its a lots of classes that need to be added to prevent the errors. Now since I'm using Netbeans 7.3 and there is a file on jpos called XercesProfileFactory which imports "org.apache.xerces.parsers.DOMParser" which seems as if my IDE doesn't have it located or installed so I was wandering if anyone can help me get this package and properly install it so that this error will be solved.

Thank you.