|
There are custom build actions you can add. From here you can launch forms, perform setup etc.
|
|
|
|
|
Hi!
I am using this BackTrack procedure that Fills a map.
Private Sub Fill(ByVal i As Integer, ByVal j As Integer)
If (i < 1) Or (j < 1) Or (i > FillM.Width) Or (j > FillM.Height) Then
Exit Sub
End If
If FillM.Pixel(i, j) = 1 Then
FillM.Pixel(i, j) = -1
Fill(i, j - 1)
Fill(i, j + 1)
Fill(i - 1, j - 1)
Fill(i - 1, j)
Fill(i - 1, j + 1)
Fill(i + 1, j)
Fill(i + 1, j - 1)
Fill(i + 1, j + 1)
End If
End Sub
When The Map has a few pixels that have value 1, It works correctly. but when the map has many pixels that has value 1, It cause an StackOverflowException. How Can I resolve this problem and why .Net Framework 3.5 throw this invalid Exception????
Regards.
Mehdi Ghiasi
|
|
|
|
|
Mehdi Ghiasi wrote: why .Net Framework 3.5 throw this invalid Exception
There probably isn't anything invalid here, your algorithm is such that a lot of recursion may occur.
Here is an example: assume an N*N map, all elements are -1 except for row 2, there they are all +1.
Now somehow you start at (2,N-1), the rightmost +1. Your Fill will call Fill(i, j - 1), which is +1 again, so it calls Fill(i, j - 1) which is +1 again, etc. You are basically pushing all elements of that row onto the stack, resulting in a nesting of N and that has used one dimension only.
There will be patterns that put big chunks of your N*N map on the stack, therefore it is either a bad algorithm or a bad implementation. A better algorithm would perform more work in the function itself, resulting in fewer stack pushes. You really need a stack push only when there are multiple ways to go and you can proceed on only one of them right away, then the others need pushed somehow. But then, a width first approach would be better than a depth first one.
Have a look at the "A* algorithm", or search for flood fill.
|
|
|
|
|
It may be interesting and illustrative to adapt the algorithm to use a queue rather than a stack. If you do that, you will observe the behavior looks as though the filled area "spreads". People who remember BASICA from way back when may recognize the queue-fill behavior as being something like what BASICA did, except that it scanned horizontal line segments directly rather than enqueueing each pixel thereon.
Note that the total number of queue entries required will be proportional to the smaller dimension of the area being filled, whereas a stack-based implementation will require stack depth proportional to the number of pixels.
|
|
|
|
|
|
Hi,
I have a problem with HTML code interpretation in Crystal Report Basic report when exporting it to pdf, each text object has the Text interpretation Setting set to HTML, but the text is not rendering as HTML and still looks like plain text, I know for sure that problem is not in *.rpt file
(for example, when exporting this report using CR 10 it works well), but with report engine.
Just wanted to ask is that the limitation of Crystal Report Basic for Visual Studio 2008?
Thanks in advance
|
|
|
|
|
I have an ActiveX control for web created in .net 3.5. When upgrading the framework to 4.0 it stops working. I have tried to create a hello world activeX control with 4.0 and it wouldn't work either. Is it not possible to create ActiveX controls with .net framework 4.0? I have also tried to create windows form control for web but again it doesn't work.
|
|
|
|
|
awu25 wrote: I have also tried to create windows form control for web but again it doesn't work.
Of course it doesn't work why would you expect it to.
ActiveX has been depreciated for several years, its time to update.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have also tried to use Windows Form control but still doesn't work. If both of them are obsolete what should I use to get client printer information through browser in an intranet environment?
|
|
|
|
|
Windows controls are not obsolete. You can't use Windows controls in a Web environment
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I meant windows form control and it actually does work with web environment. I can get it to work with .net framework 3.5 or earlier, but not .net framework 4, not even a simple hello world control.
What are my choices? I am willing to try anything.
|
|
|
|
|
You shouldn't actually run a .NET windows control in a web page - this would place a requirement on the end user having the correct version of .NET installed.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
They aren't really obsolete - they've been deprecated, but you can still write ActiveX controls in C++. Can you say "Ouch"...
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
awu25 wrote: ActiveX control for web created in .net 3.5
No you don't. None of the managed code compilers target building an ActiveX control. You can build something that exposes interfaces through COM, but it's not an "ActiveX control".
|
|
|
|
|
Hi all,
I'm attempting to load an xml document from an XML column in MSSQL 2008, into an XmlDocument (see code below).
Sometimes the code will break at the <b>xdoc.Load(xr)</b> line with the error "Unexpected end of file and occurred". After breaking, the XmlReader has a value of "None".
While researching the problem, I saw posts that referred to a 4Kb limit on StreamReaders and figured this may be related somehow. So I cut down the size of my document (to around 4Kb) and everything worked fine.
On average, the XML documents I'm importing from the database are 20Kb and thanks to validation on INSERT by MSSQL, we can assume(?) the document is well-formed.
Does anyone know how to get 'large' amounts of XML from the database into my XmlDocument?
Dim xr As XmlReader = ExportAdapter.GetEditedCheckXML(chkId)
Dim xdoc As New XmlDocument
xdoc.Load(xr)
Here's the GetEditedCheck fn:
Public Shared Function GetEditedCheckXML(ByVal checkId As Integer) As XmlReader
Dim conn As SqlConnection = New SqlConnection(CONNECTION_STRING)
Dim comm As New SqlCommand("PS_GetModifiedXmlByCheckId", conn)
Dim adap As New SqlDataAdapter
comm.CommandType = CommandType.StoredProcedure
comm.Parameters.Add("@checkId", SqlDbType.Int).Value = CInt(checkId)
conn.Open()
Dim xml = comm.ExecuteXmlReader()
xml.Read()
conn.Close()
Return xml
End Function
|
|
|
|
|
Dear all,
Please help me ...
I want to add two datatable in dataset. I did as below code. when adatapter fill to 2nd table. It fill with first query statement.
So both table get same result.
Want to know how to get different result.
Dim acon As New SqlConnection(ConfigurationManager.ConnectionStrings("DOCDBDWHConnectionString").ConnectionString)
Dim acmd As New SqlCommand()
Dim sSql As String
acon.Open()
sSql = "select distinct vessel_code,vessel_desc from D4A_RAW_BLP"
acmd.Connection = acon
acmd.CommandText = sSql
'Pull vessel code
Dim dataset As New DataSet
Dim adpvsl As New SqlDataAdapter
Dim adpvoy As New SqlDataAdapter
adpvsl.SelectCommand = acmd
adpvsl.Fill(dataset, "Vessel")
'Pull voyageno
sSql = ""
sSql = "select distinct voyage_no,vessel_code from D4A_RAW_BLP where vessel_code in (select distinct vessel_code from D4A_RAW_BLP where vessel_code<>'') order by vessel_code"
adpvoy.Fill(dataset, "voyage")
Thanks and best Regards
|
|
|
|
|
I bet if you look again, you'll spot what's wrong, and that the problem is that you've been staring at this too long. As you are aware, a string is an immutable object, so setting acmd.CommandText = sSql means that you get the value of sSql at the time you assign it. As you have only changed sSql for the voyageno, you will get the same results because you have issued the original query again. What you need to do is set the SelectCommand again, but this time to the new value of sSql.
BTW - you don't need the line sSql = "" .
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thank you!
Get result as your reply.
|
|
|
|
|
You're welcome.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi
In my page i write like this:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Msg","<script>alert('Employee information is not valid...');</script>",true);
But no popup window open ..is this right code?
|
|
|
|
|
Try following code.
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"Msg","<script>alert('Employee information is not valid...');</script>",false);
You were supplied last argument as true, which denotes that it will add script tag automatically.
While you already provided script tag.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
I tried making last argument false as well but it still not giving the popup block
|
|
|
|
|
Are you trying to get that script executed when the page is sent back to the browser??
This question should really be asked in the ASP.NET forum.
|
|
|
|
|
Do You have AJAX Script Manager in your web page. If you then you need to use ScriptManager.RegisterClientScriptBlock .
|
|
|
|
|
ScriptManager is not necessary to inject script blocks into the page, even if you are using Ajax.
I know the language. I've read a book. - _Madmatt
|
|
|
|