Search Results

Search found 4214 results on 169 pages for 'binary serializer'.

Page 46/169 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • Last byte missing when casting from varbinary to varchar

    - by xaxie
    I got the last byte losing when converting varbinary to varchar in some case. For example: DECLARE @binary varbinary(8000), @char varchar(8000) set @binary = 0x000082 set @char = CAST(@binary as varchar(8000)) select BinaryLength=DATALENGTH(@binary), CharLength=DATALENGTH(@char) The result is BinaryLength CharLength 3 2 The affected byte value is from 0x81 - 0xFE. The stranger thing is that if I use varchar(MAX) instead varchar(8000) when casting, there is no any problem. Could someone tell me the root cause of the issue? PS: I run the sql in MS SQL server 2008. Thanks!

    Read the article

  • editing a file with vim that has no EOL marker on the last line but has CRLF line endings

    - by rmeador
    I often have to edit script files, the interpreter for which treats files that have an EOL marker on the last line of the file as an error (i.e. the file is treating CRLF as "newlines", not as "line endings"). Currently, I open these files in Vim using binary mode (-b on the command line). It autodetects the lack of EOL on the final line and sets the "noeol" option appropriately, which prevents it from writing an EOL on the last line. Because the file has CRLF line endings, I get lots of ^Ms at the end of my lines (because it interprets only Unix-style line endings in binary mode, it seems). I can't open it in text mode because the "noeol" option is ignored for non-binary files. This is very annoying, and I always have to remember to manually type the ^M at the end of each line! Is there some way I can force it to accept DOS-style line endings in binary mode, or force it to listen to the EOL option in text mode?

    Read the article

  • partial entity loading and management in silverlight / wcf ria

    - by Dan Wray
    I have a Silverlight 4 app which pulls entities down from a database using WCF RIA services. These data objects are fairly simple, just a few fields but one of those fields contains binary data of an arbitrarily size. The application needs access to this data basically asap after a user has logged in, to display in a list, enable selection etc. My problem is because of the size of this data, the load times are not acceptable and can approach the default timeout of the RIA service. I'd like to somehow partially load the objects into my local data context so that I have the IDs, names etc but not the binary data. I could then at a later point (ie when it's actually needed) populate the binary fields of those objects I need to display. Any suggestions on how to accomplish this would be welcome. Another approach which has occurred to me whilst writing this question (how often does that happen?!) is that I could move the binary data into a seperate database table joined to the original record 1:1 which would allow me to make use of RIA's lazy loading on that binary data. again.. comments welcome! Thanks.

    Read the article

  • How does this method give me a -61 Error?

    - by prestonmarshall
    This is in an application I am using called Mirth, but it appears to be coming from inside an Apache Commons library from a method that checks if something is indeed Base64 encoded or not. All of the docs say the only return is true or false, so how am I getting -61? -61 org.apache.commons.codec.binary.Base64.isBase64(Base64.java:137) org.apache.commons.codec.binary.Base64.discardNonBase64(Base64.java:478) org.apache.commons.codec.binary.Base64.decodeBase64(Base64.java:374) org.apache.commons.codec.binary.Base64.decode(Base64.java:220) com.webreach.mirth.plugins.pdfviewer.PDFViewer.viewAttachments(PDFViewer.java:51) com.webreach.mirth.client.ui.browsers.message.MessageBrowser$16.doInBackground(MessageBrowser.java:1429) com.webreach.mirth.client.ui.browsers.message.MessageBrowser$16.doInBackground(MessageBrowser.java:1426) org.jdesktop.swingworker.SwingWorker$1.call(SwingWorker.java:276) java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) java.util.concurrent.FutureTask.run(FutureTask.java:138) org.jdesktop.swingworker.SwingWorker.run(SwingWorker.java:315) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) java.lang.Thread.run(Thread.java:637)

    Read the article

  • Algorithms to find longest common prefix in a sliding window.

    - by nn
    Hi, I have written a Lempel Ziv compressor and decompressor. I am seeking to improve the time to search the dictionary for a phrase. I have considered K-M-P and Boyer-Moore, but I think an algorithm that adapts to changes in the dictionary would be faster. I've been reading that binary search trees (AVL or with splays) improve the performance of compression time considerably. What I fail to understand is how to bootstrap the binary search tree and insert/remove data. I'm not actually quite sure the significance of each node in the binary search. I am searching for phrases so will each character be considered a node? Also how and what is inserted/removed from the search tree as new data enters the dictionary and old data is removed? The binary search tree sounds like a good payoff since it can adapt to the dictionary, but I'm just not quite sure of how it's used.

    Read the article

  • Autoconf, Libtool shared and static library

    - by siddhusingh
    I am using autoconf gnu tools to build my product. It generates both the shared as well as static library for any library where *.la is mentioned. The issue is if you use .la to link your binary in Makefile.am. It links with the dynamic library but when you use ldd to the binary, it says "not a dynamic executable" although it links with shared library. I proved it by removing the shared library after the binary is built and then tried to run the binary. It didn't find the shared library and couldn't run. Another question is how to put library in a specified location using Makefile.am direction ?

    Read the article

  • Zend Framework: How to download file from mySql Blob field.

    - by Awan
    I am uploading files(any type) in MySql tables's blob field. Now I am able to get binary data from that field and when I print it, it shows binary data in firbug console. But I want to download that file as it was uploaded. How can I convert this binary data into orignal file? How to do it in zend? Thanks

    Read the article

  • ack misses results (vs. grep)

    - by techpeace
    I'm sure I'm misunderstanding something about ack's file/directory ignore defaults, but perhaps somebody could shed some light on this for me: mbuck$ grep logout -R app/views/ Binary file app/views/shared/._header.html.erb.bak.swp matches Binary file app/views/shared/._header.html.erb.swp matches app/views/shared/_header.html.erb.bak: <%= link_to logout_text, logout_path, { :title => logout_text, :class => 'login-menuitem' } %> mbuck$ ack logout app/views/ mbuck$ Whereas... mbuck$ ack -u logout app/views/ Binary file app/views/shared/._header.html.erb.bak.swp matches Binary file app/views/shared/._header.html.erb.swp matches app/views/shared/_header.html.erb.bak 98:<%= link_to logout_text, logout_path, { :title => logout_text, :class => 'login-menuitem' } %> Simply calling ack without options can't find the result within a .bak file, but calling with the --unrestricted option can find the result. As far as I can tell, though, ack does not ignore .bak files by default.

    Read the article

  • Semicolon in object variable name

    - by milkfilk
    There's a common LDAP attribute called userCertificate;binary. It actually has a semi-colon in the attribute name. In ruby, I turn an LDAP entry into a OpenStruct object called 'struct'. struct.class = OpenStruct But of course ruby thinks it's an end-of-line character. ? struct.userCertificate;binary NameError: undefined local variable or method `binary' for main:Object from (irb):52 from :0 IRB knows that the local variable is there, because it gives me struct.userCertificate;binary from the tab auto-completion. I can also see the class variable when calling struct.methods on it. struct.methods = ... "send", "methods", "userCertificate;binary=", "hash", ... It's definitely there, I can see the contents if I print the whole variable to_s(). But how can I access the local variable when it has a semicolon in it? I have workarounds for this but I thought it was an interesting problem to post.

    Read the article

  • How do I upload a file, process it and return a result file in a single request to a REST WCF service?

    - by sharptooth
    I need to implement the following scenario in a REST service implemented in WCF: the user submits a binary file and a set of parameters the server consumes the file, does some clever work and generates a binary output file the user retrieves that binary result file and all that is done in a single operation from the client perspective. It's pretty easy in a non-REST service. How do I do that in a REST service? Where do I get started?

    Read the article

  • Faster way to dump mysql

    - by japancheese
    This may be a dumb question, but I was just watching a screencast on MySQL replication, and I learned that a master database doesn't send SQL over to a slave for replication, it actually sends data over in binary, which makes importing extremely fast. I started wondering, "if a database can export and import binary, why do mysqldumps / imports take so long?" Is there a way to get mysql to dump a database in binary in a similar fashion to speed up that process as well?

    Read the article

  • In an AVL tree, at what condition the balancing is to be done? proper code in c languge

    - by bachchan
    Binary search follows Divide and Conquer method where as linear Search doesn't follw.The time complexity of Binary Search in O(log n) but incase of linear search the time complexity is O(n). Thats way Binary search is having bettr prior than linear search. But it is true when the list of items is large incase of smaller list linear is best(i.e.- it is only when the Best Case concern)

    Read the article

  • Debugging metaprograms [C++]

    - by atch
    Hi, Is there any way to check step by step what's going on in let's say template? I mean how it is instantiated step by step and so on? In book I've mentioned here , I found (2 minutes ago) quite interesting example of how binary could be implemented as a metafunction. template <unsigned long N> struct binary { static unsigned const value = binary<N/10>::value << 1 // prepend higher bits | N%10; // to lowest bit }; template <> // specialization struct binary<0> // terminates recursion { static unsigned const value = 0; }; and I think it could be quite useful to be able to see step by step what's been done during the instantiation of this template. Thanks for your replies.

    Read the article

  • Bit-Twiddling in SQL

    - by Mike C
    Someone posted a question to the SQL Server forum the other day asking how to count runs of zero bits in an integer using SQL. Basically the poster wanted to know how to efficiently determine the longest contiguous string of zero-bits (known as a run of bits) in any given 32-bit integer. Here are a couple of examples to demonstrate the idea: Decimal = Binary = Zero Run 999,999,999 decimal = 00 111011 1 00 11010 11 00 1 00 1 11111111 binary = 2 contiguous zero bits 666,666,666 decimal = 00100111 10111100...(read more)

    Read the article

  • SortedDictionary and SortedList

    - by Simon Cooper
    Apart from Dictionary<TKey, TValue>, there's two other dictionaries in the BCL - SortedDictionary<TKey, TValue> and SortedList<TKey, TValue>. On the face of it, these two classes do the same thing - provide an IDictionary<TKey, TValue> interface where the iterator returns the items sorted by the key. So what's the difference between them, and when should you use one rather than the other? (as in my previous post, I'll assume you have some basic algorithm & datastructure knowledge) SortedDictionary We'll first cover SortedDictionary. This is implemented as a special sort of binary tree called a red-black tree. Essentially, it's a binary tree that uses various constraints on how the nodes of the tree can be arranged to ensure the tree is always roughly balanced (for more gory algorithmical details, see the wikipedia link above). What I'm concerned about in this post is how the .NET SortedDictionary is actually implemented. In .NET 4, behind the scenes, the actual implementation of the tree is delegated to a SortedSet<KeyValuePair<TKey, TValue>>. One example tree might look like this: Each node in the above tree is stored as a separate SortedSet<T>.Node object (remember, in a SortedDictionary, T is instantiated to KeyValuePair<TKey, TValue>): class Node { public bool IsRed; public T Item; public SortedSet<T>.Node Left; public SortedSet<T>.Node Right; } The SortedSet only stores a reference to the root node; all the data in the tree is accessed by traversing the Left and Right node references until you reach the node you're looking for. Each individual node can be physically stored anywhere in memory; what's important is the relationship between the nodes. This is also why there is no constructor to SortedDictionary or SortedSet that takes an integer representing the capacity; there are no internal arrays that need to be created and resized. This may seen trivial, but it's an important distinction between SortedDictionary and SortedList that I'll cover later on. And that's pretty much it; it's a standard red-black tree. Plenty of webpages and datastructure books cover the algorithms behind the tree itself far better than I could. What's interesting is the comparions between SortedDictionary and SortedList, which I'll cover at the end. As a side point, SortedDictionary has existed in the BCL ever since .NET 2. That means that, all through .NET 2, 3, and 3.5, there has been a bona-fide sorted set class in the BCL (called TreeSet). However, it was internal, so it couldn't be used outside System.dll. Only in .NET 4 was this class exposed as SortedSet. SortedList Whereas SortedDictionary didn't use any backing arrays, SortedList does. It is implemented just as the name suggests; two arrays, one containing the keys, and one the values (I've just used random letters for the values): The items in the keys array are always guarenteed to be stored in sorted order, and the value corresponding to each key is stored in the same index as the key in the values array. In this example, the value for key item 5 is 'z', and for key item 8 is 'm'. Whenever an item is inserted or removed from the SortedList, a binary search is run on the keys array to find the correct index, then all the items in the arrays are shifted to accomodate the new or removed item. For example, if the key 3 was removed, a binary search would be run to find the array index the item was at, then everything above that index would be moved down by one: and then if the key/value pair {7, 'f'} was added, a binary search would be run on the keys to find the index to insert the new item, and everything above that index would be moved up to accomodate the new item: If another item was then added, both arrays would be resized (to a length of 10) before the new item was added to the arrays. As you can see, any insertions or removals in the middle of the list require a proportion of the array contents to be moved; an O(n) operation. However, if the insertion or removal is at the end of the array (ie the largest key), then it's only O(log n); the cost of the binary search to determine it does actually need to be added to the end (excluding the occasional O(n) cost of resizing the arrays to fit more items). As a side effect of using backing arrays, SortedList offers IList Keys and Values views that simply use the backing keys or values arrays, as well as various methods utilising the array index of stored items, which SortedDictionary does not (and cannot) offer. The Comparison So, when should you use one and not the other? Well, here's the important differences: Memory usage SortedDictionary and SortedList have got very different memory profiles. SortedDictionary... has a memory overhead of one object instance, a bool, and two references per item. On 64-bit systems, this adds up to ~40 bytes, not including the stored item and the reference to it from the Node object. stores the items in separate objects that can be spread all over the heap. This helps to keep memory fragmentation low, as the individual node objects can be allocated wherever there's a spare 60 bytes. In contrast, SortedList... has no additional overhead per item (only the reference to it in the array entries), however the backing arrays can be significantly larger than you need; every time the arrays are resized they double in size. That means that if you add 513 items to a SortedList, the backing arrays will each have a length of 1024. To conteract this, the TrimExcess method resizes the arrays back down to the actual size needed, or you can simply assign list.Capacity = list.Count. stores its items in a continuous block in memory. If the list stores thousands of items, this can cause significant problems with Large Object Heap memory fragmentation as the array resizes, which SortedDictionary doesn't have. Performance Operations on a SortedDictionary always have O(log n) performance, regardless of where in the collection you're adding or removing items. In contrast, SortedList has O(n) performance when you're altering the middle of the collection. If you're adding or removing from the end (ie the largest item), then performance is O(log n), same as SortedDictionary (in practice, it will likely be slightly faster, due to the array items all being in the same area in memory, also called locality of reference). So, when should you use one and not the other? As always with these sort of things, there are no hard-and-fast rules. But generally, if you: need to access items using their index within the collection are populating the dictionary all at once from sorted data aren't adding or removing keys once it's populated then use a SortedList. But if you: don't know how many items are going to be in the dictionary are populating the dictionary from random, unsorted data are adding & removing items randomly then use a SortedDictionary. The default (again, there's no definite rules on these sort of things!) should be to use SortedDictionary, unless there's a good reason to use SortedList, due to the bad performance of SortedList when altering the middle of the collection.

    Read the article

  • How to 'reproduce copyright` in an app?

    - by ohho
    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The above is quoted from a BSD licensed COPYING file. How can I "reproduce the above copyright" when I distribute my app in binary form? Should I put the COPYING file content in some Credit/About screen of my app or what? Thanks!

    Read the article

  • ERROR in Installing a Theme in ubuntu 13.10

    - by Badar 'Prince' Ismail
    I just upgraded to Ubuntu 13.10 3 days ago and since then I've been trying to install a couple of themes for example i tried MOKA theme and many more.whenever i try to install a theme when ever i add the PPA: and after that i type sudo apt-get update its shows this: W: Failed to fetch http://ppa.launchpad.net/jolicloud-team/ppa/ubuntu/dists/saucy/main/binary-i386/Packages 404 Not Found W: Failed to fetch http://ppa.launchpad.net/webupd8team/jupiter/ubuntu/dists/saucy/main/binary-i386/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.

    Read the article

  • Has any hobbyist attempted to make a simple VGA-graphics based operating system in machine code?

    - by Bigyellow Bastion
    I mean real bare bones, bare machine here(no Linux kernel, pre-existing kernel, or any bootloader). I mean honestly write the bootloading software in direct microarchitecture-specific machine opcode, host the operating system, interrupts, I/O, services, and graphical software and all hardware interaction, computation, and design entirely in binary. I know this is quite the leap here, but I was thinking to practice first in x86 assembly (not binary) 16-bit style. Any ideas?

    Read the article

  • Compiling for T4

    - by Darryl Gove
    I've recently had quite a few queries about compiling for T4 based systems. So it's probably a good time to review what I consider to be the best practices. Always use the latest compiler. Being in the compiler team, this is bound to be something I'd recommend But the serious points are that (a) Every release the tools get better and better, so you are going to be much more effective using the latest release (b) Every release we improve the generated code, so you will see things get better (c) Old releases cannot know about new hardware. Always use optimisation. You should use at least -O to get some amount of optimisation. -xO4 is typically even better as this will add within-file inlining. Always generate debug information, using -g. This allows the tools to attribute information to lines of source. This is particularly important when profiling an application. The default target of -xtarget=generic is often sufficient. This setting is designed to produce a binary that runs well across all supported platforms. If the binary is going to be deployed on only a subset of architectures, then it is possible to produce a binary that only uses the instructions supported on these architectures, which may lead to some performance gains. I've previously discussed which chips support which architectures, and I'd recommend that you take a look at the chart that goes with the discussion. Crossfile optimisation (-xipo) can be very useful - particularly when the hot source code is distributed across multiple source files. If you're allowed to have something as geeky as favourite compiler optimisations, then this is mine! Profile feedback (-xprofile=[collect: | use:]) will help the compiler make the best code layout decisions, and is particularly effective with crossfile optimisations. But what makes this optimisation really useful is that codes that are dominated by branch instructions don't typically improve much with "traditional" compiler optimisation, but often do respond well to being built with profile feedback. The macro flag -fast aims to provide a one-stop "give me a fast application" flag. This usually gives a best performing binary, but with a few caveats. It assumes the build platform is also the deployment platform, it enables floating point optimisations, and it makes some relatively weak assumptions about pointer aliasing. It's worth investigating. SPARC64 processor, T3, and T4 implement floating point multiply accumulate instructions. These can substantially improve floating point performance. To generate them the compiler needs the flag -fma=fused and also needs an architecture that supports the instruction (at least -xarch=sparcfmaf). The most critical advise is that anyone doing performance work should profile their application. I cannot overstate how important it is to look at where the time is going in order to determine what can be done to improve it. I also presented at Oracle OpenWorld on this topic, so it might be helpful to review those slides.

    Read the article

  • Can't install Ubuntu one

    - by Yehonatan Tsirolnik
    While trying to install Ubuntu one it throwes me this error - W:Failed to fetch http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu/dists/DISTIBUTION/main/binary-amd64/PAckages 404 Not Found, W:Failed to fetch http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu/dists/DISTRIBUTION/main/binary-i386/Packages 404 Not Found, E:Some index files failed to download. They have been ignored, or old ones used instead. and I can't install it Thanks.

    Read the article

  • When and why are certain data structures used in the context of web development?

    - by Ein Doofus
    While browsing around the MSDN I came across: http://msdn.microsoft.com/en-us/library/aa287104%28v=vs.71%29 which lists various data structures such as: Queues Stacks Hashtables Binary Trees Binary Search Trees Graphs (I believe there are also Lists) and I was hoping to get a high-level overview of when these various data structures can be used in the broad context of web development, and when used, why one data structure is generally used instead of any other one.

    Read the article

  • What are some good examples of Powernap scripts and its use?

    - by shootingstars
    I would like to use powernap for putting my media server into suspend mode, and I haven't been able to find any example /etc/powernap/action scripts out there, except these: one two three Does anybody have a good script or recommend particular techniques with its use? From the comments of the default /etc/powernap/action script: # You may do one of: # 1) Write your own custom script below and make this file executable, # calling some specific action, such as: # /usr/sbin/pm-suspend # /usr/sbin/pm-hibernate # /sbin/poweroff # echo 'I am wasting electricity' | mail [email protected] # 2) Replace this file with an executable script or binary # 3) Symlink this file to some other executable script or binary

    Read the article

  • Failed to download repository information in update manager

    - by user95092
    Details W:Failed to fetch *http://ppa.launchpad.net/jonls/redshift-ppa/ubuntu/dists/precise/main/source/Sources 404 Not Found , W:Failed to fetch *http://ppa.launchpad.net/jonls/redshift-ppa/ubuntu/dists/precise/main/binary-amd64/Packages 404 Not Found , W:Failed to fetch *http://ppa.launchpad.net/jonls/redshift-ppa/ubuntu/dists/precise/main/binary-i386/Packages 404 Not Found , E:Some index files failed to download. They have been ignored, or old ones used instead. Whats causing this and how to fix it? Ty Regards

    Read the article

  • Scrambler in C#

    This program has two section of scrambling. First section, it transfers text into binary code. I was able to use bitArray, but I couldn't find a simple way to reverse it, so I added "character" and "binary" lists instead.

    Read the article

  • XmlSerializer Deserialize failures

    - by smvlad
    I have wsdl from third party server. Method that i'm interested in returns XmlNode. My thought was wrap web methods and use XmlSerializer to return strongly typed objects. Returned xml looks like this (i removed soap headers): <Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ResponseExt" xmlns="http://www.thirdparty.com/lr/"> <Code>0</Code> <Message>SUCCESS</Message> <SessionId>session_token</SessionId> </Response> Looked simple. Created a class: [XmlRoot("Response")] public class MyClass { public string Code {get; set;} public string Message {get; set;} public string SessionId {get; set;} } Processing time: //XmlNode node = xml from above XmlSerializer serializer = new XmlSerializer(typeof(MyClass)); XmlNodeReader reader = new XmlNodeReader(node); Myclass myclass = serializer.Deserialize(reader) as MyClass Last line is where it blows up with inner exception message: The specified type was not recognized: name='ResponseExt', namespace='http://www.thirdparty.com/lr/', at . I can't figure out how to make Serializer happy and what exactly these two mean xsi:type="ResponseExt" xmlns="http://www.thirdparty.com/lr/ As always any advice and pointer are appreciated

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >