Daily Archives

Articles indexed Tuesday April 13 2010

Page 8/126 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Generating MySQL UPDATE statements containing BLOB image data

    - by Bob
    I'm trying to write an SQL statement that will generate an SQL script that will update a BLOB field with an IMAGE being selected from the database. This is what I have: select concat( 'UPDATE `IMAGE` SET THUMBNAIL = ', QUOTE( THUMBNAIL ), ' WHERE ID = ', ID, ';' ) as UPDATE_STATEMENT from IMAGE; In the above, THUMBNAIL is a BLOB field containing raw image data. When I run the resulting script I get the following error: ERROR at line 2: Unknown command '\\'. I first tried this without the QUOTE() function, like so: select concat( 'UPDATE `IMAGE` SET THUMBNAIL = \'', THUMBNAIL, '\' WHERE ID = ', ID, ';' ) as UPDATE_STATEMENT from IMAGE; Running the resulting script produces this error: ERROR at line 2: Unknown command '\0'. What is the proper function to apply to this BLOB field in the select, so the UPDATE statements will work? If context is required, I'm looking to migrate thumbnails generated on one server to another server for certain image IDs only. I would use mysqldump, but I don't want to clobber the entire table. Any help is greatly appreciated!

    Read the article

  • creating an executable file without a compiler

    - by Alterlife
    I came across an article a long while ago on how to write out a .com file directly without using any external tools. the method was to basically copy con myfile.com and then hit ctrl+alt+number for each instruction. I've lost the url for the guide... Google isn't helping much either. If you have the link, please could you post it.

    Read the article

  • Wordpress Navigation

    - by James Pellerano
    I am working on a Wordpress Theme, I need to work on the navigation, I am having a little trouble creating it. The navigation I am looking for looks like this: www.neu.edu/humanities. I have gotten this far: if (is_front_page()) { wp_list_pages('title_li=&exclude=12&depth=1'); } else { // display the subpages of the current page while // display all of the main pages and all of the // and display the parent pages while on the subpages }

    Read the article

  • Bad http connection (400) from Simple Native Iphone App to test .net Web Service

    - by leo
    Dear all, I have written a simple hello world .net web service which will accept 2 parameters and return the parameters as a string. The web service is hosted by IIS on a windows xp pc. I am able to access the web service using safari on the iphone simulator, successfully tested the operation using HTTP POST by clicking the "invoke" button. However, when I use the native app on the iphone simulator, I keep getting a bad http connection error 400 on the IIS log. I have tested my native app with http://viium.com/WebService/HelloWorld.asmx and it works. I have already added Does anyone know what is wrong? Is it some settings that have not configured correctly? Thank you very much in advance.

    Read the article

  • Configuring terminal server and Remote desktop

    - by user311130
    I have a WinServer 2008 machine with 8 local users on it. Basically I want to connect all of them remotely and simultaneously. I read that I should use Terminal server. I want to write a c# code (or use some code from the net) that configures the number of possible remotely and simultaneously connected local users to TS to be some N. Is it even possible? Is it limited from the first place to some value? connects the N local users simultaneously to the TS.

    Read the article

  • How to dispose of variables in windows close button

    - by cmrhema
    Hi, I have a windows forms application, where I have declared some static variables. On the click of exit button, I have disposed of some datatable which i have declared static. Many a times the user instead of clicking the exit button, will just exit the windows application by clicking the X button on the left corner top. What should be done to ensure that even if the user clicks the X button, everything is disposed of properly. Thanks Regards Hema

    Read the article

  • backtracking in haskell

    - by dmindreader
    I have to traverse a matrix and say how many "characteristic areas" of each type it has. A characteristic area is defined as a zone where elements of value n or n are adjacent. For example, given the matrix: 0 1 2 2 0 1 1 2 0 3 0 0 There's a single characteristic area of type 1 which is equal to the original matrix: 0 1 2 2 0 1 1 2 0 3 0 0 There are two characteristic areas of type 2: 0 0 2 2 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 3 0 0 And one characteristic area of type 3: 0 0 0 0 0 0 0 0 0 3 0 0 So, for the function call: countAreas [[0,1,2,2],[0,1,1,2],[0,3,0,0]] The result should be [1,2,1] I haven't defined countAreas yet, I'm stuck with my visit function when it has no more possible squares in which to move it gets stuck and doesn't make the proper recursive call. I'm new to functional programming and I'm still scratching my head about how to implement a backtracking algorithm here. Take a look at my code, what can I do to change it? move_right :: (Int,Int) -> [[Int]] -> Int -> Bool move_right (i,j) mat cond | (j + 1) < number_of_columns mat && consult (i,j+1) mat /= cond = True | otherwise = False move_left :: (Int,Int) -> [[Int]] -> Int -> Bool move_left (i,j) mat cond | (j - 1) >= 0 && consult (i,j-1) mat /= cond = True | otherwise = False move_up :: (Int,Int) -> [[Int]] -> Int -> Bool move_up (i,j) mat cond | (i - 1) >= 0 && consult (i-1,j) mat /= cond = True | otherwise = False move_down :: (Int,Int) -> [[Int]] -> Int -> Bool move_down (i,j) mat cond | (i + 1) < number_of_rows mat && consult (i+1,j) mat /= cond = True | otherwise = False imp :: (Int,Int) -> Int imp (i,j) = i number_of_rows :: [[Int]] -> Int number_of_rows i = length i number_of_columns :: [[Int]] -> Int number_of_columns (x:xs) = length x consult :: (Int,Int) -> [[Int]] -> Int consult (i,j) l = (l !! i) !! j visited :: (Int,Int) -> [(Int,Int)] -> Bool visited x y = elem x y add :: (Int,Int) -> [(Int,Int)] -> [(Int,Int)] add x y = x:y visit :: (Int,Int) -> [(Int,Int)] -> [[Int]] -> Int -> [(Int,Int)] visit (i,j) vis mat cond | move_right (i,j) mat cond && not (visited (i,j+1) vis) = visit (i,j+1) (add (i,j+1) vis) mat cond | move_down (i,j) mat cond && not (visited (i+1,j) vis) = visit (i+1,j) (add (i+1,j) vis) mat cond | move_left (i,j) mat cond && not (visited (i,j-1) vis) = visit (i,j-1) (add (i,j-1) vis) mat cond | move_up (i,j) mat cond && not (visited (i-1,j) vis) = visit (i-1,j) (add (i-1,j) vis) mat cond | otherwise = vis

    Read the article

  • How to override a method for a MovieClip Symbol in Flash CS3

    - by php html
    I'm using flash to draw objects, then I export them and use them from flex, and I'm a beginner in flash. I'm trying to do the override a method from the MovieClip I created. The method I'm trying to override is stop() method. I didn't write a single line of code, my movie clip is created using entirely the flash interface. I figured out how to add actions to the movie clip when a frame is reached but I'm stucked now when I'm trying to override a MovieClip method.

    Read the article

  • How do you build a Request-Response service using Asyncore in Python?

    - by Casey
    I have a 3rd-party protocol module (SNMP) that is built on top of asyncore. The asyncore interface is used to process response messages. What is the proper technique to design a client that generate the request-side of the protocol, while the asyncore main loop is running. I can think of two options right now: Use the loop,timeout parameters of asyncore.loop() to allow my client program time to send the appropriate request. Create a client asyncore dispatcher that will be executed in the same asyncore processing loop as the receiver. What is the best option? I'm working on the 2nd solution, cause the protocol API does not give me direct access to the asyncore parameters. Please correct me if I've misunderstood the proper technique for utilizing asyncore.

    Read the article

  • Apache Ant Build command "Access Denied"

    - by Luis Armando
    Hey! I am trying to get ant installed and actually already did following this instructions however, I get this error: Buildfile: build.xml does not exist! Build failed which it says there I might get so I just tried executing the next command it says I should(since I'm under Windows it's this one): build -Ddist.dir=<C:\Ant> dist anyway I get "access denied" when hitting enter and I can't figure out why. I also tried build install and build install-lite but I always get that message =/ any ideas why? or what am I doing wrong? Edit Without the < I get a: 'build' is not recognized as an internal or external command, operable program or batch file. Edit2 Well, my ANT_HOME is in C:\Ant and I'm trying to run the command while placing myself on that folder, isn't that correct?

    Read the article

  • Limit Apache to 1 request per process

    - by Gorilla3D
    I have a few long running processes on apache and when the server gets a bit of a load they all seem to couple into 3-4 processes. I've tried setting the MaxRequestsPerChild to 1 and that works, but spawning new processes all the time is expensive. Here is my current configuration: <IfModule prefork.c> StartServers 25 MinSpareServers 50 MaxSpareServers 50 ServerLimit 512 MaxClients 50 MaxRequestsPerChild 10 </IfModule> <IfModule worker.c> StartServers 25 MaxClients 50 MinSpareThreads 50 MaxSpareThreads 125 ThreadsPerChild 50 MaxRequestsPerChild 10 </IfModule>

    Read the article

  • Cisco VPN endpoints disconnecting from a VLAN

    - by dunxd
    I have a number of Cisco ASA 5505 and PIX 506e around the world acting as VPN endpoints. They connect to a Cisco VPN Concentrator 3000 at HQ. I am using EZVPN to set up the VPN (i.e. most of the config is central on the VPN Concentrator) The majority of endpoints work absolutely fine. However, there are three that do not. 2 ASAs and 1 PIX get disconnected from one of the VLANs on our network. This is the VLAN that my monitoring server runs on - so those endpoints look as if they have gone down. However, I can still ping the endpoints from our user VLAN. If I then SSH onto the endpoint, and do a ping to my monitoring server, the connection comes back. Then after about 10 minutes it stops working again. I've looked at the configuration of my endpoints, and I can't see any significant differences. One common feature is that the affected endpoints are connecting to the internet via retail quality routers. However, I don't see how this could affect traffic within a VPN tunnel. Any ideas or suggestions? I've also got a thread on Cisco's forums at https://supportforums.cisco.com/thread/344638. One other person has reported the same problem.

    Read the article

  • greyed out folder in OS X

    - by vectorizor
    Hi all, I installed the intel compiler on my Mac (10.6), and it installed fine, but the folder in which it is installed (/opt, i.e. at the root) is not visible by default, and when I use the Finder "go to" feature, it appears, but as greyed out. What does it mean? I also checked out the permissions, and the only odd thing is that there is an @ at the end of permissions. Any ideas? I'm asking because while the intel compiler is installed (all the files are there), I cant use it from XCode (3.2), and I'm wondering whether this could be why. Thank in advance A

    Read the article

  • Return a pointer to a char array in C

    - by snitko
    I've seen a lot of questions on that on StackOverflow, but reading the answers did not clear that up for me, probably because I'm a total newbie in C programming. Here's the code: #include <stdio.h> char* squeeze(char s[], char c); main() { printf("%s", squeeze("hello", 'o')); } char* squeeze(char s[], char c) { int i, j; for(i = j = 0; s[i] != '\0'; i++) if(s[i] != c) s[j++] = s[i]; s[j] = '\0'; return s; } It compiles and I get segmentation fault when I run it. I've read this faq about about returning arrays and tried the 'static' technique that is suggested there, but still could not get the program working. Could anyone point out exactly what's wrong with it and what should I be paying attention in the future?

    Read the article

  • Can we sniff packets between 2 machines in a network from a third machine using wireshark or etherea

    - by coolcake
    I have a small network in which there are 2 electronic devices and one desktop connected using a switch. Through the desktop with Ethereal/wireshark installed on it, can I sniff the packets that are being communicated between the 2 electronic devices? I cannot install ethereal or wireshark on either of the electronic devices, but need to monitor the traffic between the 2 devices from my desktop, which is connected via the same switch.

    Read the article

  • Client Web Service call over SSL using Apache Axis

    - by java_pill
    I'm using Apache Axis 1.5.1 to code a web service client connecting to a service over SSL. My application is running in Tomcat with SSL configuration setup in JKS. However, when I connect to the server, the connection is failing because the cert from our client is not being sent to the server. Is this something that has to be set in the client through code? Also note that the server does not need any user name or password authentication. With SSL turned off, everything works fine. Thanks,

    Read the article

  • Problem with custom Equality in Entity Framework

    - by Shimmy
    Hello! I am using Entity Framework in my application. I implemented with the partial class of an entity the IEquatable<T> interface: Partial Class Address : Implements IEquatable(Of Address) 'Other part generated Public Overloads Function Equals(ByVal other As Address) As Boolean _ Implements System.IEquatable(Of Address).Equals If ReferenceEquals(Me, other) Then Return True Return AddressId = other.AddressId End Function Public Overrides Function Equals(ByVal obj As Object) As Boolean If obj Is Nothing Then Return MyBase.Equals(obj) If TypeOf obj Is Address Then Return Equals(DirectCast(obj, Address)) Else Return False End Function Public Overrides Function GetHashCode() As Integer Return AddressId.GetHashCode End Function End Class Now in my code I use it this way: Sub Main() Using e As New CompleteKitchenEntities Dim job = e.Job.FirstOrDefault Dim address As New Address() job.Addresses.Add(address) Dim contains1 = job.Addresses.Contains(address) 'True e.SaveChanges() Dim contains2 = job.Addresses.Contains(address) 'False 'The problem is that I can't remove it: Dim removed = job.Addresses.Remoeve(address) 'False End Using End Sub Note (I checked in the debugger visualizer) that the EntityCollection class stores its entities in HashSet so it has to do with the GetHashCode function, I want it to depend on the ID so entities are compared by their IDs. Please help me find what's wrong in the GetHashCode function (by ID) and what can I change to make it work. Thanks a lot.

    Read the article

  • Spring's JMS Design Question : Decouple processing of messages

    - by java_pill
    I'm using a message listener to process some messages from MQ based on Spring's DefaultMessageListenerContainer. After I receive a message, I have to make a Web Service (WS) call. However, I don't want to do this in the onMessage method because it would block the onMessage method until the invocation of WS is successful and this introduces latency in dequeuing of messages from the queue. How can I decouple the invocation of the Web Service by calling it outside of the onMesage method or without impacting the dequeuing of messages? Thanks,

    Read the article

  • event listeners on plugin in document.onload events in opera

    - by gf
    I am trying to understand an issue where event-listener registration on plugins doesn't work in Opera unless i delay them. In particular, this doesn't work: document.onload = function() { plugin.addEventListener("foo", function() { alert('onFoo'); }, false); } while delaying the addEventListener() call somewhat through e.g. an alert() does: document.onload = function() { alert('onload()'); plugin.addEventListener("foo", function() { alert('onFoo'); }, false); } It seems that plugins are only loaded after document.onload. As a non-web-developer, am i missing something simple here? Or is this a known Opera problem with a common work-around?

    Read the article

  • Placement/Positioning/Alignment of UIScrollView w.r.t. length of Title NSString

    - by Shoaibi
    I have a scenario where i show stuff like: ----------------------------------- titleview (UITextView) ______________ tArea (UIScrollView) ttextview (UITextView) ----------------------------------- Now here is the condition: Length of titleview's text is dynamic, varies based on user input. Because of the condition I have trouble placing tArea e.g. UIScrollView on the screen, it either appears way too below than the titleview, or overlaps it. Previously what i did: Count the number of characters in titleview.text.length and divide them by 27 (e.g. characters in one line when using boldSystemFontOfSize:20) and multiply by 10 to get the starting X of tArea e.g. UIScrollView. But that sucked. Because i had to duplicate code for rotation to landscape. What do i have now? : CGSize titlesize = [title sizeWithFont:[UIFont systemFontOfSize:20] constrainedToSize:CGSizeMake(5, 90) lineBreakMode:UILineBreakModeWordWrap]; ttitleview = [[UITextView alloc] initWithFrame:CGRectMake(5, 5, 310,titlesize.height)]; ttitleview.text = title; ttitleview.font = [UIFont boldSystemFontOfSize:20]; ttitleview.backgroundColor = [UIColor clearColor]; ttitleview.editable = NO; [self.view addSubview:ttitleview]; CGSize textsize = [ttext sizeWithFont:[UIFont systemFontOfSize:20] constrainedToSize:CGSizeMake(5, 350) lineBreakMode:UILineBreakModeWordWrap]; tArea = [[UIScrollView alloc] initWithFrame:CGRectMake(5, titlesize.height, 310, 230)]; tArea.contentSize = CGSizeMake(310, textsize.height+20); tArea.pagingEnabled = FALSE; tArea.scrollEnabled = TRUE; tArea.backgroundColor = [UIColor clearColor]; [self.view addSubview:tArea]; ttextview = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 310, textsize.height + 20)]; ttextview.text = ttext; ttextview.font = [UIFont systemFontOfSize:20]; ttextview.backgroundColor = [UIColor clearColor]; ttextview.editable = NO; [tArea addSubview:ttextview]; But its no use. Looking for an elegant solution than this.

    Read the article

  • winsock receiving incoming data slower than expected.

    - by k80sg
    Hi folks, I have a sender machine which sends bytearray data to my prog at an interval of about 5 miliseconds/per msg, about 6 - 7 bytearray messages per seconds that is. The problem is that the winsock in my program doesn't seem to receive these bytearray fast enough. For every 10 messages sent over, I am only able to receive about 6 to 7. Any advices? Thanks.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >