Search Results

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

Page 125/169 | < Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >

  • Converting files to blob to save in database

    - by jimbo
    I have an old user site that we are currently updating. The site's users have previously uploaded profile pics that are stored in a directory. I am now wanting to keep these profile images in the database, (easy to backup all data) but am having trouble working out how to do it. There are a lot of tutorials talking about do ing this from files that have just been uploaded and using the tmp name etc, but how can I re-create with files that have already been uploaded? I have looked into $data = file_get_contents($filename); Which seems to create a binary file, but doesn't seem to save in database with: mysql_query("UPDATE profiles SET company_logo = mysql_real_escape_string('".$data."') WHERE id = 1 ") or die(mysql_error());

    Read the article

  • Last element not getting insert in Tree

    - by rdk1992
    So I was asked to make a Binary Tree in Haskell taking as input a list of Integers. Below is my code. My problem is that the last element of the list is not getting inserted in the Tree. For example [1,2,3,4] it only inserts to the tree until "3" and 4 is not inserted in the Tree. data ArbolBinario a = Node a (ArbolBinario a) (ArbolBinario a) | EmptyNode deriving(Show) insert(x) EmptyNode= insert(tail x) (Node (head x) EmptyNode EmptyNode) insert(x) (Node e izq der) |x == [] = EmptyNode --I added this line to fix the Prelude.Head Empty List error, after I added this line the last element started to be ignored and not inserted in the tree |head x == e = (Node e izq der) |head x < e = (Node e (insert x izq) der) |head x > e = (Node e izq (insert x der)) Any ideas on whats going on here? Help is much appreciated

    Read the article

  • git is very very slow

    - by dorelal
    My project is six months old and git is very very slow. We track around 30 files which are of size 5 MB to 50 MB. Those are binary files and we keep them in git. I believe those files are making git slow. Is there a way to kill all files of size 5MB from the repository. I know I would lose all of these files and that is okay with me. Ideally I would like a command that would list all the big files ( 5MB) . I can see the list and then I say okay go ahead and delete those files and make git faster.

    Read the article

  • What is the most efficient way to pass data (list of pairs of [Integer + Double]) between two Google App Engine instances?

    - by ruslan
    What is the most efficient way to pass data (list of pairs of [Integer, Double]) between two Google App Engine instances ? Currently I use Java binary serialization. Frontend servlet receives data from the client in JSON format. I convert it to byte[] using ObjectOutput.writeObject and then send it to backend servlet via HTTP POST. It's not in production yet. Should I just pass client's JSON as it is to backend? It seems more logical. But it's bigger in size. Or should I use Google Protocol Buffers as stated in this benchmark article ? Thank you!!!

    Read the article

  • Small questions on data structure

    - by John Graveston
    Hi, I'm trying to search the parent of a node with Kruskal's algorithm. My program works just fine, but I think I have heard of a method to improve the speed of the algorithm by reconstructing the tree while searching for the parent node and connecting it to the parent node. I'm pretty sure that I've heard of this somewhere, maybe in a lecture. Can anyone refresh my memory? And also, given a number of arrays, when searching for the minimum and the maximum value from a certain section of an array, what is the name of the tree that can calculate the minimum/maximum value from the array by making a binary tree that has the minimum/maximum value of each array in O(log N)?

    Read the article

  • Erlang bit syntax variable issue

    - by Jimmy Ruska
    Is there any way to format this so it's a valid expression, without adding another step? <<One:8,_:(One*8)>> = <<1,9>>. * 1: illegal bit size These work <<One:8,_:(1*8)>> = <<1,9>>. <<1,9>> <<Eight:8,_:Eight>> = <<8,9>>. <<8,9>> I'm trying to parse a binary with nested data with list comprehensions instead of stacking accumulators.

    Read the article

  • How to identify/handle text file newlines in Java?

    - by rafrafUk
    Hi Everyone! I get files in different formats coming from different systems that I need to import into our database. Part of the import process it to check the line length to make sure the format is correct. We seem to be having issues with files coming from UNIX systems where one character is added. I suspect this is due to the return carriage being encoded differently on UNIX and windows platform. Is there a way to detect on which file system a file was created, other than checking the last character on the line? Or maybe a way of reading the files as text and not binary which I suspect is the issue? Thanks Guys !

    Read the article

  • fastest method for minimum of two numbers

    - by user85030
    I was going through mit's opencourseware related to performance engineering. The quickest method (requiring least number of clock cycles) for finding the minimum of two numbers(say x and y) is stated as: min= y^((x^y) & -(x<y)) The output of the expression x < y can be 0 or 1 (assuming C is being used) which then changes to -0 or -1. I understand that xor can be used to swap two numbers. Questions: 1. How is -0 different from 0 and -1 in terms of binary? 2. How is that result used with the and operator to get the minimum? Thanks in advance.

    Read the article

  • DLL Load Failed: %1 is not a valid win32 application

    - by glittershark
    So I have a situation where I need to make binary patches and then be able to apply them from within python. I found bsdiff which looks like a great algorithm and has a python extension module, but that extension module doesn't have a windows installer past Python 2.5 Alright, so having never even written C seriously, let alone attempted a python extension module, I set out to compile it myself. After a few hours of bashing my head against a DLL load error with MinGW32, I managed to get it compiled and built using the setup.py provided in the source of the project. However, upon importing the resulting bsdiff module, I get: ImportError: DLL load failed: %1 is not a valid Win32 application. Any advice?

    Read the article

  • Customizing compare in bsearch()

    - by Richard Smith
    I have an array of addresses that point to integers ( these integers are sorted in ascending order). They have duplicate values. Ex: 1, 2, 2, 3, 3, 3, 3, 4, 4...... I am trying to get hold of all the values that are greater than a certain value(key). Currently trying to implement it using binary search algo - void *bsearch( const void *key, const void *base, size_t num, size_t width, int ( __cdecl *compare ) ( const void *, const void *) ); I am not able to achieve this completely, but for some of them. Would there be any other way to get hold of all the values of the array, with out changing the algorithm I am using?

    Read the article

  • How to restart Linux from inside a C++ program?

    - by Dave K
    I have a Qt 4 GUI where I need to have a option in a drop-down menu that allows the user to choose to restart the computer. I realize this might seem redunant with the ability to restart the computer in other ways, but the choice needs to stay there. I've tried using system() to call the following: a suid-root shell script a non-suid shell script a suid-root binary program and all of them just cause reboot: must be superuser to be printed. Using system() to call reboot directly does the same thing. I'm not especially attached to using system() to do this, but it seemed like the most direct choice. How can I reboot the system from the GUI?

    Read the article

  • inputMismatchException Java reading doubles from plain text file

    - by user939287
    Using double variable = inputFile.nextDouble(); Gives the mismatch error and I can't figure out why... Anyone know what's up? The input file is just a bunch of doubles like 5.0... Okay here is the code snippet String fileName; Scanner scanner = new Scanner(System.in); System.out.println("\nEnter file name that contains the matrix and vector: "); fileName = scanner.nextLine(); Scanner inputFile = new Scanner(fileName); double a1 = inputFile.nextDouble(); the input file is a plain text document .txt in this format 5.0 4.0 -3.0 4.0 2.0 5.0 6.0 5.0 -2.0 -13.0 4.0 12.0 I don't understand why it wouldn't take those as doubles... As far as what its expecting the format of the file to be... I suppose binary? isn't that the default? I didn't specify in the code...

    Read the article

  • python array.array with strings as data type

    - by Gladius
    Is there an object that acts like array.array, yet can handle strings (or character arrays) as its data type? It should be able to convert the string array to binary and back again, preferably with null terminated strings, however fixed length strings would be acceptable. >>> my_array = stringarray(['foo', 'bar']) >>> my_array.tostring() 'foo\0bar\0' >>> re_read = stringarray('foo\0bar\0') >>> re_read[:] ['foo', 'bar'] I will be using it with arrays that contain a couple million strings.

    Read the article

  • How to check for a file's authenticity ?

    - by Ale_x
    Let's say I write a game application. I want the level of the player to be stored in an external file. How can I prevent a hacker from writing and modifying the file to put another level ? I want the file to be modified by my application only. I can sign the file's content with a key, but then this key will be stored in the application, therefore it would be possible for a hacker to decompile the binary and find the key. Is there any way to do this ?

    Read the article

  • Sending two servlet responses per request

    - by sangi
    Hi, I write, because I can not solve the following problem. I have a servlet that processes some information. In response I put both text and binary content. How do I get two response, then two html page, starting from the same request? is a thing possible? The first response should continue to do what he does now, while the second would appear to make a popup window to save an image. There are easier ways to achieve the same result? Many thanks in advance

    Read the article

  • How to pass multiple params to function in python?

    - by user1322731
    I am implementing 8bit adder in python. Here is the adder function definition: def add8(a0,a1,a2,a3,a4,a5,a6,a7,b0,b1,b2,b3,b4,b5,b6,b7,c0): All function parameters are boolean. I have implemented function that converts int into binary: def intTObin8(num): bits = [False]*8 i = 7 while num >= 1: if num % 2 == 1: bits[i] = True else: bits[i] = False i = i - 1 num /= 2 print bits return [bits[x] for x in range(0,8)] I want this function to return 8 bits. And to use this two functions as follows: add8(intTObin8(1),intTObin8(1),0) So the question is: How to pass 8 parameters using one function?

    Read the article

  • [biztalk2006]can not decode base64 to xml plain text

    - by user622851
    I use biz2006 + rosettaNet as our EDI solution. Now I meet a issue that, when a partner send pip to us, the content(base64 encoded) could not been converted to XML plain text. Here're content of the pip we received. MIME-Version: 1.0 Content-Type: application/xml; charset="UTF-8"; RNSubType=service-header` Content-Transfer-Encoding: base64 Content-ID: 3e10e7db96b84cafbee51e66e020729f Content-Description: body Content-Disposition: attachment; filename="Attachment1" PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgU2VydmljZUhl ...== I find a working format as below Content-Transfer-Encoding: binary <?xml version="1.0" encoding="UTF-8"?> Anyone could tell we how to solve the issue? Any suggestion is appreciated. Thanks.

    Read the article

  • File upload with tdo-miniforms not working

    - by user338109
    I am using the TDO-miniforms plugin for wordpress. I have a form set up that lets the user submit files. The files are successfully uploaded to the tmp-folder, but once the post is created they are not copied into the allocated post folder. The only thing that is created in the folder with a post id is a file called array. It seems like the file holds the binary data of the uploaded files. The “correct” urls are appended to the post content I am running wordpress 2.9.2 on snow leopard using Mamp.

    Read the article

  • I have submitted app to app store and app status came like 'Metadata Rejected' and following review status. I do not have login page

    - by user3717465
    We began the review of your app but are not able to continue because we need a demo account to fully access your app features. Please provide demo account details in the Review Notes section of the Version Information for your app. Please ensure that the information you provide includes any data necessary to demonstrate the functionality of your app features. You can provide demo account information, including passwords, in the Review Notes section of your iTunes Connect App Information. While your iTunes Connect Application State shows as Metadata Rejected, we don't require a new binary to correct this issue. Please visit iTunes Connect, Manage Your Applications. Select your app, then click View Details of the desired version. Click the Edit button next to Version Information to edit the Review Notes for your app, then click "Save". how to correct the meta data. because i do not have login account.

    Read the article

  • Why does Apple use Objective-C for iPhone development? (App Store)

    - by Luca Matteis
    I'm interested to know your opinion on why Apple uses a language such as Objective-C for app development. Does Apple's app store allow apps written only in this language? Does apple even look at your source-code or does it just care of the binary output? I learned that most of their app rejection (in the app store) is based upon apps crashing (probably memory leaks in which Objective-c is not very efficient unless you use a GC). Why not let developers use a safer language, like a scripting language? I think these are important questions for a developer (I don't even use Apple's products) because it seems like Apple's app store is the MOST successful app sale place on the web.

    Read the article

  • Persisting Serializable Objects in Hibernate

    - by VeeArr
    I am attempting to persist objects that contain some large Serializable types. I want Hibernate to automatically generate my DDL (using Hibernate annotations). For the most part, this works, but the default database column type used by Hibernate when persisting these types is tinyblob. Unfortunately, this causes crashes when attempting to persist my class, because these types will not fit within the length of tinyblob. However, if I manually set the type (using @Column(columnDefinition="longblob")), it works fine. Is there any way to make the default binary type longblob instead of tinyblob, so that I don't need to manually specify the @Column annotation on each field?

    Read the article

  • Read from socket

    - by Alberto
    I need to read from an AF_UNIX socket to a buffer using the function read from C, but I don't know the buffer size. I think the best way is to read N bytes until the read returns 0 (no more writers in the socket). Is this correct? Is there a way to guess the size of the buffer being written on the socket? I was thinking that a socket is a special file. Opening the file in binary mode and getting the size would help me in knowing the correct size to give to the buffer? I'm a very new to C, so please keep that in mind.

    Read the article

  • What is this VB6 method doing?

    - by Craig
    We are converting a VB6 application to C# (4.0). and have come across a method in VB6 that we're battling to understand. Public Sub SaveToField(fldAttach As ADODB.Field) Dim bData() As Byte Dim nSize As Long nSize = Len(m_sEmail) bData = LngToByteArray(nSize) fldAttach.AppendChunk bData If nSize > 0 Then bData = StringToByteArray(m_sEmail) fldAttach.AppendChunk bData End If nSize = Len(m_sName) bData = LngToByteArray(nSize) fldAttach.AppendChunk bData If nSize > 0 Then bData = StringToByteArray(m_sName) fldAttach.AppendChunk bData End If bData = LngToByteArray(m_nContactID) fldAttach.AppendChunk bData End Sub It seems like it's doing some binary file copy type thing, but I'm not quite understanding. Could someone explain so that we can rewrite it?

    Read the article

  • iPhone:Can binaries developed in Xcode 3.1.3 be deployable on iPhone 3.1.3 device?

    - by user187532
    Hi, Sorry to ask you such a basic question. I am facing some problem here, so that is why asking this question. I have Xcode 3.1.3 and developed an application. I am trying to install this binary with proper provisional profile onto iPhone 3G 3.1.3 device on another windows computer. But i'm unable to install on the device through iTunes. Can binaries developed using Xcode 3.1.3 be able to install on iPhone 3.1.3 version devices right? Please advise. Thanks.

    Read the article

  • Java deserialization speed

    - by celicni
    I am writing a Java application that among other things needs to read a dictionary text file (each line is one word) and store it in a HashSet. Each time I start the application this same file is being read all over again (6 Megabytes unicode file). That seemed expensive, so I decided to serialize resulting HashSet and store it to a binary file. I expected my application to run faster after this. Instead it got slower: from ~2,5 seconds before to ~5 seconds after serialization. Is this expected result? I thought that in similar cases serialization should increase speed.

    Read the article

< Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >