iirc -- you want SetDIBitsToDevice and not BitBlt. You are using a Device Independent Bitmap and those do not automatically translate to Device Dependent Bitmaps.
jinzai
Posts
-
Process USB camera output -
How to make a font height equal to "tmHeight"?The information -- is correct. There is internal leading (rhymes with sledding) and external leading. They are there to pad the character within its space and to provide space between lines for things like ascenders and descenders, which exceed the character's space.
-
Performance issue in XSL processingI feel for this poster.... The issue is most likely poor XML and XSLT design. Too many people refuse to take the time to understand their data and XML and in the rush to 'get something working' they create a schema that is bloated, incomplete and that requires a lot of resources to even attempt to use. Six days for 100MB? Yes - I can say that the schema does not represent the data well and the XSL is probably even worse because it must translate this rickety XML into something that might be even more poorly designed and implemented and it is apparent that the XSL has been where all of the changes and fixes have been applied. For starters -- do not avoid using attributes simply because elements seem 'easier' -- they are not. Things that describe a thing -- are attributes. Things that own things -- are usually elements. I post here because -- when you try to engineer a system and write the entire application at the same time -- all the while saying -- just get it running, we'll fill in the details later -- and also you take alot of shortcuts ('it will be easier if we do ....')....all you are doing is moving the work further down the line and making it more difficult.... There is a definite amount of work that must be done -- never assume that you can avoid it and do as much up front as you can.
-
XSD.EXE array, would like listThat is precisely what Collections are for -- to address the limitations imposed by fixed length arrays. The limitation is not on arrays -- it appears to be on how willing programmers are to writing proper code, IMHO. In C++, the standard library has some things for that, like vectors and maps, and in C# there are collections.
-
Xml generating from XSD schemaIf there is no root, you do not have a valid document. I think you are confusing the XML declaration with the root -- the root is the first element that is NOT the XML declaration...what you have posted -- is an XML schema fragment.
-
How to retrieve data from XLS/TXT file and DB?XML is the data container; XSLT is the document that transforms the XML into some other data container -- its purpose is to do what you are asking. XSD is the schema -- it defines the format of the XML so that consumers can correctly instantiate objects that are contained in the XML document. People are not seeming to understand the difference or the purpose of XML/XSD/XSLT -- and that is somewhat tragic because it is the best way to do things and maintain validity of data through disparate systems.
-
How to do curd operations on XML Which Shown BelowThis is not the document you want for figuring out CRUD. You need the XSD to do that properly. You could guess and as long as the database column names matched you *might* be able to guess correctly, but...I would not be helping you if I recommended that you do that. If you can write your own query to select a row and if you also had access to ADO.NET -- you could have the table tell you its schema and then the query could be written properly. This method that you are using -- is not a great idea -- you can have some success in doing it, but not for long and it is very likely that you will manage to put a row in the database that will be junk data because you do not know the schema -- you are just making blind CRUD operations. A better choice might be stored procedures because you can just provide the parameters from the client side. At any rate, the less you count on being smart on the client side, the better off you will be.
-
Empty node when data specified in xsdIt is valid -- but, the creator of the XSD did not indicate that it was required -- and you have assumed that it is required. If your code cannot tolerate that -- then modify the XSD to make it required and have whoever produces the XML give it a default value.... However, this is simply pushing it off to the side. This is an issue that does not relate to XML per se -- it relates to best practices about defining and validating data. The XSD defines the structure and rules of XML -- so the designer of the schema must describe the data perfectly and consumers must not make assumptions that are not supported by the XSD.
-
Good book about Windows programming wantedThe main core of Windows is spread out among three DLLs -- for 32 bit Windows, they are called kernel32.dll, user32.dll and gdi32.dll. You are likely wanting to use them in a managed manner and those DLLs -- by default do not provide an unmanaged to managed interface, so -- you have a lot to learn -- not only about these three DLLs, but also about managed and unmanaged memory. You have selected a very challenging task, but -- the Windows SDK is a great source for studying the componetry of Windows and .NET documentation will help some. There is a website pinvoke.net that is a wiki about Interop -- the way to manage an unmanaged to managed application. To ease the process -- I suggest that you procure an older version of Windows and first learn those DLLs in an unmanaged manner. XP is good for that.
-
Window Service installed but EndPointNotFoundException was caughtWhen you self-host, the endpoint must be created by the code that is running the service. The configuration is not used because you are not running your WCF code within ASP.NET or IIS then -- it is standalone.
-
unable to get property 'childnodes' of undefined or null referenceAs the previous reply indicated -- this is Javascript -- and it is using -- most likely jQuery. I am responding because -- this snippet is accessing the DOM and making assumptions that are causing it to fail -- without grace and without any real way to provide much information, but -- the exception seems to indicate that the node being accessed is not present. This is not a good way to find the element in question and the code has been written in an odd manner because the author has not taken the time to understand nodes -- if you do not do this, your only options moving forward are to write code like this and hope for the best, or abdicate the responsibility by using a 3rd party client side library for that. To make matters worse, this issue of textContent vs. innerText -- is a well known difference between browsers and how they view whitespace in documents -- particularly XML documents. It behooves a developer to take the responsibility of learning how to walk the DOM themselves and to check for null -- at least once. How do you know where you are in the DOM otherwise? This script -- needs a lot of work to be robust --
-
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dllGreetings. I would like to see your code, too but -- I can offer you some help anyway. Always use try/catch for network communications and db access and ignore anyone that tells you not to -- unless it is your boss, but even then -- you should use it. I am saying this -- not to chastise you or puff myself up -- I am saying it because if you do you will not only learn how to fix this yourself -- you will learn to write code that can handle issues and also it will perform better. Generally, I will wrap most all of a function in try/catch if it involves communications or database access. You do not need it everywhere, just in key areas that warrant it. If you ignore it altogether -- your application will halt because you did not use try/catch-- not good for anyone and not good for you. If you use try/catch -- at least you know that an error occurred and at least the code can exit gracefully instead of spitting out that page that tells your users that your code just died on them. You said -- continuously -- but, the exception seems to be telling a different story. I suspect that your buffer read is either missing data that is in the buffer, or you are not servicing it often enough or -- your buffer is too small to begin with. TCP has some built-in defense against many errors, but it cannot force you to service the socket properly, so -- it is the buffer, the socket properties or your read code. How large is the expected data? Mostly, guessing buffer sizes is a bad idea -- either you get one too small or you waste resources by making it too large. This is not a career where guessing is a good strategy and asynchronous communications demands that we code properly and not make assumptions.
-
The Operation Has time out problme while sending SMSI would advise you to examine very carefuly your use of the streams and the WebResponse -- also avoid trying to reuse them -- this is an inherently asynchronous process and trying to create an SMS bulk texting application is not what those classes are intended to do -- it is one thing to use them to mimic browser fetches, but quite another to use them statically for multiple texts. At the very least, close them and get them each time -- the Response -- are you reading to the end and closing the response?
-
The Operation Has time out problme while sending SMSPerhaps the OP obfuscated it for posting -- since this is about an SMS. If it were not valid the second time, it would not have been valid the first time either -- and OP stated -- it worked the first time -- but not the second time.
-
How third party templates can help in developing new applicationIf you look at other large scale efforts that are intended to be used in a variety of situations you will find a common 'template' already -- XML. SQL Report Definition Language = XML Microsoft XPS = XML SOAP = XML ADO.NET DataSets and DataTables both can serialize as XML and XML Schema. XML is the world's best glue because it is self-describing and completely system, network and transport agnostic. It can carry any type, the objects created from it are automatically native and correct and its support is widespread -- XSLT can output just about any object you care to -- HTML, XML, JSON, etc. If you begin with XML -- you can always replace it easily with something more specific -- but if you start with something specific and your design is not frozen -- you will struggle to complete it at all, much less on time.
-
Uploaded files are excluded from the folderGreetings. I think I see what the issue is here. The Solution Explorer does not work like Windows Explorer -- it looks like Windows Explorer -- BUT.... It is only going to show you files that you put there using Visual Studio. Try right clicking on that folder and select Refresh Folder. If those uploads worked -- the files will show up after you refresh. You cannot expect Visual Studio to include a file in your project just because it is in a folder in your project -- you must explicitly do that -- either by adding them using the Solution Explorer -- or, by refreshing the folder after this upload process. Also -- look at your try/catch again. You might just as well not use try/catch if you cannot tell that you threw an exception -- the catch block does nothing -- it returns in the same manner that the normal path does -- so all you have gained by using try/catch -- is that your function runs a little more slowly and .NET thinks that you handled the exception which makes it silent -- and likewise undetected. EDIT: Having read through the entire thread -- let me say a few things -- that are my opinion from many years of experience -- not all of it was wise, either. This is your project -- you do what makes sense to you -- but -- be very careful about assumptions that you make. I can see you possibly watching the process...looking at Solution Explorer -- and geting frustrated because your files are disappearing -- but, they are not disappearing -- they are simply not part of your project -- so they are not being displayed. That is why you are getting blowback from others about it -- they are not part of the project being built by Solution Explorer -- they are probably best described as input/output -- a product of the project, I suppose. So...I do not disagree with your folder structure -- it looks well thought out. However, you are making the assumption that Solution Explorer will list the content of the folder with no assistance from you -- and I learned that you must refresh that folder by making the same assumption -- so, I am telling you what I learned so that you can have your question answered and move on to writing your code. About the catch thing -- I also tend to litter my try/catch blocks and sometimes don't have much in the catch, but at a minimum I will put a breakpoint on a line of code in the catch, so that I still know that an exception occured. I am sure that you know -- if the permissions were not proper, and exception would have occurred -- access denied, I think -- right? Are yo
-
Problem to displaying hindi fonts in servlet?Aye...I do not envy you at all here. Some things that might be going on and to help you get a 'handle' on this... The StringWriter -- make sure it is UTF-8 and about Firefox -- when all you have been told is that an encoding is Unicode -- it is usually UTF-16 by default (At least that is the case for VisualStudio here in the US, perhaps for FF it is UTF-8, but who knows? Maybe look deeper in the settings for FF to see if it is specified somewhere.) For example I have encountered a case where a TextWriter defaults to UTF-16 and you have to make that UTF-8 if you want to write valid XML for a schema that is already UTF-8. The class that your StringWriter is derived from might need to be coerced to be UTF-8, for example. Could there be BOMs in the text? What are the NUMERIC values of the bytes in that string? BOMs in documents usually get interpreted as strange sequences, like this one:  . The values for a BOM would be 0xef 0xbb 0xbf and they would be the first 3 bytes of a document. Java uses modified UTF-8 for some things (object serialization and literal strings in classes) and was that string serialized using Java? If so, it is not UTF-8 -- it is modified UTF-8. Modified UTF-8 does not use 0x00 as the null terminator -- it uses 0xc0 0x80. UTF-8 can be guaranteed by using an OutputStreamWriter for serialization into your request stream.
-
Problem to displaying hindi fonts in servlet?I think that you are using an incorrect encoding. UTF-8/ISO-8859-1 are only capable of encoding 256 characters. How many characters are in the Hindi character set? I assume that there are more than 256 and that you are not aware of the fact that those encodings are for character sets like ASCII -- not for language with many characters, glyphs, ligatures, etc. So -- they work for English, but not much else. XML uses UTF-8 because it uses ASCII, for example. I would recommend that you use UTF-16, but...let me research this for you. I assume that this notion is new to you -- is Hindi your native language? Mine is English of course and you know we use ASCII and UTF-8 because we only have 26 letters to use and punctuation and our character set fits into the UTF-8 encoding and many of us are unaware of any other encoding, either. Most of the rest of the world use UTF-16 and UTF-32 -- so this issue is unknown to people that only write code that is in one encoding. I will research the encoding that you need and come back and edit this reply -- we can get you fixed without much trouble, I think.
-
Which technology to use for website development for a shoe manufacturer and sellerYour question --- has little guidance for answering it properly and -- although it might seem to you that is is easily answerable -- it does not contain enough information for us to help you and it appears that you are wanting widespead browser support -- that is a self-defeating goal when you go that far back. You appear to be at the very beginning of the process -- so that explains your post to me enough that I can recommend some things that should help you along the way. You are developing a site for a shoe maufacturer -- let's start with that. What aspects of the business will the site be responsible for implementing? Production? Inventory? Worker hours/pay/training/evaluation? Will the administrative staff want to use it? Will it have eCommerce? A catalog? Buyer information? Vendors? As you can see -- what you need to use depends on what you seek from the code...so -- be detailed about what you expect and where you want to go with it. You will undoubtedly get tripped up if you fail to mention some major functionality and start in a direction that will not support that functionality. It is very difficult to implement major functionality and integrate that into the system after the fact. Engineering is a far more demanding discipline than many developers know and a system that is 'shot from the hip' will not make it to the end of the SDLC intact -- no amount of managerial voodoo will fix poor engineering -- not Agile -- not anything. I use ASP.NET and SQL Server alot, however...start with some HTML pages and get a sense of what types of operations you want to do -- that will tell you which technologies will support that and -- you are going to need a lot of HTML/CSS/Javascript infrastructure anyway. ASP.NET is an excellent and extensible framework -- you will not encounter much that it cannot do already, so -- if you are insisting on a recommendation -- that is my opinion -- use ASP.NET and SQL Server to begin. If you need services -- and you likely will very soon -- there are a few service types that ASP.NET supports with little effort and even some that will require a lot -- but...WCF, for example can handle them all and is highly configurable -- I doubt you will be doing anything using services that WCF cannot be made to support. It is possible to implement simple services with no more than an HTTP Handler in ASP.NET. (ASHX) Besides, there are many developers and lots of documentation already and also -- Microsoft implements most of the technologies you will need either 'out of the box' or thro
-
WEB DEVELOPMENT USING ORACLE & DOTNETADO.NET supports Oracle databases already and LINQ is very useful at several levels of abstraction -- DataSets/DataTables/XML/etc. Oracle probably has a console for DB administration, but I do not use Oracle -- but there is an Oracle Provider native to the .NET system.