|
One thing you have to realize : building an OS isn't a noob task at all.
It would be as willing to cross Atlantic Sea by swimming without knowing how to swim...
No memory stick has been harmed during establishment of this signature.
|
|
|
|
|
james midget wrote: Time i do not have, and i cannot spend more than day on tis project.
You are like kidding right? Operating Systems are not something you can build in a day, a week, or even longer. There is a lot that is involved, just to start File I/O, GUI, Memory Management, etc. Give this food for thought, think about how long all of the major OS manufacturers have been in business and the time it takes to roll out a new product.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
It takes them so long because they have to do marketing. The programming usually only takes a month or so
|
|
|
|
|
Shhhhhhhh don't tell the troll that
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
james midget wrote: HI, James my name is, india i am from.
How come you talk like Yoda?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Article[^] this, help you it might.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Obvious troll.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Try COSMOS, but if that's not enough, your a troll.
|
|
|
|
|
My comment to your post is like others: Your message is funny!
Anyway, to develop an operating system, it takes time. Talking about years. So do plan you need several years to do so.
Secondly, usually I see people using C or C++ to program for an operating system. VB? I am not sure.
|
|
|
|
|
Hello:
I´m using TCP client socket in my app. In this case I need to receive data from a device (that is working as TCP server) that is continuosly sending messages without specifying the lenght of the sent data before sending it, it´s like a streaming of binary data. I need to read this data and process some specific parts of the message. The most common references I found about receiving TCP data is using the Stream Read method, but this method requires to define a buffer of defined size. Please read my code below:
Imports System.IO
Imports System.Net.Sockets
Imports System.Threading
Imports System.Net
Imports System.Text
Public Class Write
Public Event DataRecieved(ByVal data As String)
Private Stm As Stream
Private tcpThd As Thread
Public Sub ConnectToServer()
Try
Dim tcpClnt As New TcpClient
tcpClnt.Connect(IPAddress.Parse("192.168.1.50"), 2111)
Stm = tcpClnt.GetStream()
tcpThd = New Thread(AddressOf ReadSocket)
tcpThd.Start()
Catch ex As Exception
MsgBox(ex.Message)
Exit Sub
End Try
End Sub
#Region "Private Methods"
Private Sub ReadSocket()
Dim Buffer() As Byte
While True
Buffer = New Byte(4000) {}
Stm.Read(Buffer, 0, Buffer.Length)
DataRecieved(Encoding.ASCII.GetString(Buffer))
End While
End Sub
#End Region
End Class
You can figure that if I define a buffer of 4000 bytes, I read just 4000 bytes of data sent by the device, but the device keep sending data all the time and I need to keep reading data all the time too, not just 4000 bytes... Is there a way to read data all the time and process this data at the very moment it is received?
Thanks in advance.
Eric Márquez
|
|
|
|
|
comiteco wrote: Please read my code below
There's a comparable example on MSDN[^]. It shows how to receive a variable-length message, which could be a single byte.
comiteco wrote: You can figure that if I define a buffer of 4000 bytes, I read just 4000 bytes of data sent by the device, but the device keep sending data all the time and I need to keep reading data all the time too, not just 4000 bytes...
You don't have to wait until the buffer is full, in order to use it. From the page on MSDN that I just linked to;
MSDN wrote: This method reads data into the buffer parameter and returns the number of bytes successfully read. If no data is available for reading, the Read method returns 0. The Read operation reads as much data as is available, up to the number of bytes specified by the size parameter. If the remote host shuts down the connection, and all available data has been received, the Read method completes immediately and return zero bytes.
That means that it receives a complete block at once, and it doesn't wait until the buffer is full. It grabs what's there, and it moves on (doesn't arrive a byte at a time, so you'll need to grab multiple). The buffer won't be completely filled, and you have to make sure to get the entire message - how that's done is shown in the example.
Bastard Programmer from Hell
|
|
|
|
|
Hi,
I am trying to populate access database with a small program in VB; however, getting the syntax error "Syntax Error (missing Operator) in query expression '07/08/2011 12:00:00 PM'." If I remove the date filed in the database, the program works fine. Therefore, the problem seems in the date field.
In access database, the format of the date field is General
Here is the code:
Dim mdate As Date
mdate = "07/08/2011 12:00:00"
Dim cmd As String = "insert into rawClimateData VALUES (" & mdate & ", 12:50 , " & TippingBucket & " , " & Precip & " , " & AirTemp & " , " & SolarRad & " , " & Evap & " , " & windSpeed & " , " & windDirection & " , " & SoilTemp & " , " & SnowDepth & " , " & RH & " , " & BaroPressure & " , " & BatteryVoltage & " , " & SoilMoisture & ")"
MsgBox("cmd= " & cmd)
dbCmd = New OleDbCommand(cmd, myConnection)
dbCmd.ExecuteScalar()
Any help would be greatly appreciated.
Thanks,
Amanjot
|
|
|
|
|
For the love of Bobby Tables, don't create a query by incorporating the parameters using string concatenation. Use the Parameters collection. That will also solve your date issue (I am NOT going to tell you how to fix this without the parameters collection).
Also, in any INSERT statement, you should specify which parameters you are inserting, in case the table changes.
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
Thanks very much for the quick reply. I believe you could sense that I am a rusted programmer. Could you explain little bit on what you mean by parameters collection!!
|
|
|
|
|
The link I sent you to shows examples of how to use parameters.
Basically, a SQL query can have parameters. Just like a function with parameters, you pass values to the SQL query... these are parameters. Rather than create the entire query including the values, you can put placeholders where the values go and then pass the command that was created with that parameterized query the parameter values. The link above shows how do do that. Google should be able to answer any more questions you have.
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
Thanks for the link. It was good to get updated with the parameter collection stuff. You are right, now it makes the code more flexible. However, I still have issues with the date. The program works fine if I don't "insert into" dataTime field but when I include this field, I get syntax error. Any tips for that?
Dim mdate As Date
mdate = Convert.ToDateTime("07/08/2011 12:00:00")
Dim dbCmd As OleDbCommand = New OleDbCommand
Dim parameter As New OleDbParameter()
dbCmd.Parameters.Add("@dateTime", OleDbType.Date).Value = mdate
dbCmd.Parameters.Add("@TippingBucket", OleDbType.Integer).Value = TippingBucket
Dim cmd As String = "insert into rawClimateData (dateTime, TippingBucket) VALUES (" & mdate & " , " & TippingBucket & ")"
dbCmd = New OleDbCommand(cmd, myConnection)
dbCmd.ExecuteScalar()
|
|
|
|
|
Amanjot wrote: Dim dbCmd As OleDbCommand = New OleDbCommand
Amanjot wrote: dbCmd = New OleDbCommand(cmd, myConnection)
You are creating the command twice. You are starting to create the command the right way, but then you create it again the wrong way.
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
Thanks for catching that. I have improved code further, however, still no success. The same error is popping up:
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
Additional information: Syntax error (missing operator) in query expression '07/07/2011 11:00:00 AM'.
Here is how the code looks now:
accessDataFile = AccessFileTextBox.Text
Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & accessDataFile
Dim myConnection As OleDbConnection = New OleDbConnection
myConnection.ConnectionString = connString
myConnection.Open()
Dim mdateTime As Date = "07/07/2011 11:00:00"
Dim Precip As Single = 3.2
Dim TippingBucket As Integer = 2
Dim cmd As String = "insert into rawClimateData (mdateTime, TippingBucket, Precip) VALUES (" & mdateTime & " , " & TippingBucket & " , " & Precip & ")"
Dim dbCmd As OleDbCommand = New OleDbCommand(cmd, myConnection)
MsgBox(cmd)
' Parameter collection
dbCmd.Parameters.Add("@Precip", OleDbType.Single).Value = Precip
dbCmd.Parameters.Add("@TippingBucket", OleDbType.Integer).Value = TippingBucket
dbCmd.Parameters.Add("@mdateTime", OleDbType.DBDate).Value = mdateTime
dbCmd.ExecuteScalar()
|
|
|
|
|
You still aren't getting the point of parameters. You are 1) adding the parameters and 2) adding the values into the command string. You are duplicating your effort, and if you looked at that Bobby Tables example or Googled "SQL injection" you'd know why you shouldn't be adding values to the command string using string concatenation.
Look at another example. Read that article. Also, pay close attention to what is placed in the command string... you'll notice it isn't the actual values. You should also notice from the reading material that Access accepts 2 different formats for parameters in the command string that you can choose from.
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
Thanks for your help. The program finally works. The last surprise I had was that when the parameters are added, they need to be in the same sequence as they are in the dataBase. Here is the final code:
accessDataFile = AccessFileTextBox.Text
Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & accessDataFile
Try
Dim myConnection As OleDbConnection = New OleDbConnection
myConnection.ConnectionString = connString
myConnection.Open()
Dim mdateTime As Date = "07/07/2011 11:00:00"
Dim Precip As Single = 3.2
Dim TippingBucket As Integer = 2
Dim cmd As String = "insert into rawClimateData (mdateTime,TippingBucket, Precip) VALUES(@mdateTime, @TippingBucket, @Precip)"
Dim dbCmd As OleDbCommand = New OleDbCommand(cmd, myConnection)
MsgBox(cmd)
' Parameter collection
dbCmd.Parameters.Add("@mdateTime", OleDbType.Date).Value = mdateTime 'Convert.ToDateTime(mdateTime)
dbCmd.Parameters.Add("@TippingBucket", OleDbType.Integer).Value = TippingBucket
dbCmd.Parameters.Add("@Precip", OleDbType.Single).Value = Precip
dbCmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
|
|
|
|
|
Looks much better, I'm glad to see you figured it out!
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
The only reason I've continued building SQL strings instead of using parameters is because I have often found it helpful, when having a problem, to put a breakpoint after the SQL is built but before it's executed. Then I'll cut the fully built SQL string and plop it in my database window so the database can give me a clearer understanding of what is going wrong. I presume there's a way to do this with parameters... to see what the whole SQL statement is and attempt execution in the database... but I've never had time to dig up how to do it. So now with this thread, I just thought I'd ask how that can be done. Thanks.
Hypermommy
|
|
|
|
|
Yep, SQL Server Profiler can intercept all calls to a SQL database. It can either show them on screen in a table or it can store them into a file or database table (which you can then query against). There is all kinds of filtering available to only intercept the calls you are interested in. It's one of the tools that gets installed with SQL Server Management Studio.
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
Aiiieeee! I've seen that, now that you mention it. Guess I need to make myself a note to use it more often. Now if you'll excuse me I'm off to investigate it some more. Thanks!
Hypermommy
|
|
|
|
|
Really dumb question time here.... we're using SQL Server Management Studio Express here. My guess is the reason I'm not seeing Profiler is because this is Express and as such is not as complete as the full SSMS? Would you figure that's what it is or maybe I'm just not seeing it?
Hypermommy
|
|
|
|
|