Search Results

Search found 309 results on 13 pages for 'igor clark'.

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

  • Good articles to read on SSL and HTTPS?

    - by Igor Romanov
    I had a problem with accepting invalid SSL certificate in my iPhone program. That problem is solved now, however I came to understanding that I have very abstract idea on how exactly the whole thing is working: how web browser is verifying that received certificate is really for host it communicates to and not faked by same party in the middle? if browser talks to some 3rd party (CA?) to do certificate check? and many other questions... Would someone please recommend good source of information with in-depth enough description of how all parts click together?

    Read the article

  • How to do UDP without port forwarding

    - by igor
    Hi all, I am creating an application in C#, It should send data with UDP. Everything works fine until, I try to communicate with a PC that is on the internet behind a router. How do I fix this so that I can use UDP without port forwarding?

    Read the article

  • Play and record streaming audio

    - by Igor
    I'm working on an iPhone app that should be able to play and record audio streaming data simultaneously. Is it actually possible? I'm trying to mix SpeakHere and AudioRecorder samples and getting an empty file with no audio data... Here is my .m code: import "AzRadioViewController.h" @implementation azRadioViewController static const CFOptionFlags kNetworkEvents = kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable | kCFStreamEventEndEncountered | kCFStreamEventErrorOccurred; void MyAudioQueueOutputCallback( void* inClientData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer, const AudioTimeStamp inStartTime, UInt32 inNumberPacketDescriptions, const AudioStreamPacketDescription inPacketDesc ) { NSLog(@"start MyAudioQueueOutputCallback"); MyData* myData = (MyData*)inClientData; NSLog(@"--- %i", inNumberPacketDescriptions); if(inNumberPacketDescriptions == 0 && myData-dataFormat.mBytesPerPacket != 0) { inNumberPacketDescriptions = inBuffer-mAudioDataByteSize / myData-dataFormat.mBytesPerPacket; } OSStatus status = AudioFileWritePackets(myData-audioFile, FALSE, inBuffer-mAudioDataByteSize, inPacketDesc, myData-currentPacket, &inNumberPacketDescriptions, inBuffer-mAudioData); if(status == 0) { myData-currentPacket += inNumberPacketDescriptions; } NSLog(@"status:%i curpac:%i pcdesct: %i", status, myData-currentPacket, inNumberPacketDescriptions); unsigned int bufIndex = MyFindQueueBuffer(myData, inBuffer); pthread_mutex_lock(&myData-mutex); myData-inuse[bufIndex] = false; pthread_cond_signal(&myData-cond); pthread_mutex_unlock(&myData-mutex); } OSStatus StartQueueIfNeeded(MyData* myData) { NSLog(@"start StartQueueIfNeeded"); OSStatus err = noErr; if (!myData-started) { err = AudioQueueStart(myData-queue, NULL); if (err) { PRINTERROR("AudioQueueStart"); myData-failed = true; return err; } myData-started = true; printf("started\n"); } return err; } OSStatus MyEnqueueBuffer(MyData* myData) { NSLog(@"start MyEnqueueBuffer"); OSStatus err = noErr; myData-inuse[myData-fillBufferIndex] = true; AudioQueueBufferRef fillBuf = myData-audioQueueBuffer[myData-fillBufferIndex]; fillBuf-mAudioDataByteSize = myData-bytesFilled; err = AudioQueueEnqueueBuffer(myData-queue, fillBuf, myData-packetsFilled, myData-packetDescs); if (err) { PRINTERROR("AudioQueueEnqueueBuffer"); myData-failed = true; return err; } StartQueueIfNeeded(myData); return err; } void WaitForFreeBuffer(MyData* myData) { NSLog(@"start WaitForFreeBuffer"); if (++myData-fillBufferIndex = kNumAQBufs) myData-fillBufferIndex = 0; myData-bytesFilled = 0; myData-packetsFilled = 0; printf("-lock\n"); pthread_mutex_lock(&myData-mutex); while (myData-inuse[myData-fillBufferIndex]) { printf("... WAITING ...\n"); pthread_cond_wait(&myData-cond, &myData-mutex); } pthread_mutex_unlock(&myData-mutex); printf("<-unlock\n"); } int MyFindQueueBuffer(MyData* myData, AudioQueueBufferRef inBuffer) { NSLog(@"start MyFindQueueBuffer"); for (unsigned int i = 0; i < kNumAQBufs; ++i) { if (inBuffer == myData-audioQueueBuffer[i]) return i; } return -1; } void MyAudioQueueIsRunningCallback( void* inClientData, AudioQueueRef inAQ, AudioQueuePropertyID inID) { NSLog(@"start MyAudioQueueIsRunningCallback"); MyData* myData = (MyData*)inClientData; UInt32 running; UInt32 size; OSStatus err = AudioQueueGetProperty(inAQ, kAudioQueueProperty_IsRunning, &running, &size); if (err) { PRINTERROR("get kAudioQueueProperty_IsRunning"); return; } if (!running) { pthread_mutex_lock(&myData-mutex); pthread_cond_signal(&myData-done); pthread_mutex_unlock(&myData-mutex); } } void MyPropertyListenerProc( void * inClientData, AudioFileStreamID inAudioFileStream, AudioFileStreamPropertyID inPropertyID, UInt32 * ioFlags) { NSLog(@"start MyPropertyListenerProc"); MyData* myData = (MyData*)inClientData; OSStatus err = noErr; printf("found property '%c%c%c%c'\n", (inPropertyID24)&255, (inPropertyID16)&255, (inPropertyID8)&255, inPropertyID&255); switch (inPropertyID) { case kAudioFileStreamProperty_ReadyToProducePackets : { AudioStreamBasicDescription asbd; UInt32 asbdSize = sizeof(asbd); err = AudioFileStreamGetProperty(inAudioFileStream, kAudioFileStreamProperty_DataFormat, &asbdSize, &asbd); if (err) { PRINTERROR("get kAudioFileStreamProperty_DataFormat"); myData-failed = true; break; } err = AudioQueueNewOutput(&asbd, MyAudioQueueOutputCallback, myData, NULL, NULL, 0, &myData-queue); if (err) { PRINTERROR("AudioQueueNewOutput"); myData-failed = true; break; } for (unsigned int i = 0; i < kNumAQBufs; ++i) { err = AudioQueueAllocateBuffer(myData-queue, kAQBufSize, &myData-audioQueueBuffer[i]); if (err) { PRINTERROR("AudioQueueAllocateBuffer"); myData-failed = true; break; } } UInt32 cookieSize; Boolean writable; err = AudioFileStreamGetPropertyInfo(inAudioFileStream, kAudioFileStreamProperty_MagicCookieData, &cookieSize, &writable); if (err) { PRINTERROR("info kAudioFileStreamProperty_MagicCookieData"); break; } printf("cookieSize %d\n", cookieSize); void* cookieData = calloc(1, cookieSize); err = AudioFileStreamGetProperty(inAudioFileStream, kAudioFileStreamProperty_MagicCookieData, &cookieSize, cookieData); if (err) { PRINTERROR("get kAudioFileStreamProperty_MagicCookieData"); free(cookieData); break; } err = AudioQueueSetProperty(myData-queue, kAudioQueueProperty_MagicCookie, cookieData, cookieSize); free(cookieData); if (err) { PRINTERROR("set kAudioQueueProperty_MagicCookie"); break; } err = AudioQueueAddPropertyListener(myData-queue, kAudioQueueProperty_IsRunning, MyAudioQueueIsRunningCallback, myData); if (err) { PRINTERROR("AudioQueueAddPropertyListener"); myData-failed = true; break; } break; } } } static void ReadStreamClientCallBack(CFReadStreamRef stream, CFStreamEventType type, void *clientCallBackInfo) { NSLog(@"start ReadStreamClientCallBack"); if(type == kCFStreamEventHasBytesAvailable) { UInt8 buffer[2048]; CFIndex bytesRead = CFReadStreamRead(stream, buffer, sizeof(buffer)); if (bytesRead < 0) { } else if (bytesRead) { OSStatus err = AudioFileStreamParseBytes(globalMyData-audioFileStream, bytesRead, buffer, 0); if (err) { PRINTERROR("AudioFileStreamParseBytes"); } } } } void MyPacketsProc(void * inClientData, UInt32 inNumberBytes, UInt32 inNumberPackets, const void * inInputData, AudioStreamPacketDescription inPacketDescriptions) { NSLog(@"start MyPacketsProc"); MyData myData = (MyData*)inClientData; printf("got data. bytes: %d packets: %d\n", inNumberBytes, inNumberPackets); for (int i = 0; i < inNumberPackets; ++i) { SInt64 packetOffset = inPacketDescriptions[i].mStartOffset; SInt64 packetSize = inPacketDescriptions[i].mDataByteSize; size_t bufSpaceRemaining = kAQBufSize - myData-bytesFilled; if (bufSpaceRemaining < packetSize) { MyEnqueueBuffer(myData); WaitForFreeBuffer(myData); } AudioQueueBufferRef fillBuf = myData-audioQueueBuffer[myData-fillBufferIndex]; memcpy((char*)fillBuf-mAudioData + myData-bytesFilled, (const char*)inInputData + packetOffset, packetSize); myData-packetDescs[myData-packetsFilled] = inPacketDescriptions[i]; myData-packetDescs[myData-packetsFilled].mStartOffset = myData-bytesFilled; myData-bytesFilled += packetSize; myData-packetsFilled += 1; size_t packetsDescsRemaining = kAQMaxPacketDescs - myData-packetsFilled; if (packetsDescsRemaining == 0) { MyEnqueueBuffer(myData); WaitForFreeBuffer(myData); } } } (IBAction)buttonPlayPressedid)sender { label.text = @"Buffering"; [self connectionStart]; } (IBAction)buttonSavePressedid)sender { NSLog(@"save"); AudioFileClose(myData.audioFile); AudioQueueDispose(myData.queue, TRUE); } bool getFilename(char* buffer,int maxBufferLength) { NSArray paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString docDir = [paths objectAtIndex:0]; NSString* file = [docDir stringByAppendingString:@"/rec.caf"]; return [file getCString:buffer maxLength:maxBufferLength encoding:NSUTF8StringEncoding]; } -(void)connectionStart { @try { MyData* myData = (MyData*)calloc(1, sizeof(MyData)); globalMyData = myData; pthread_mutex_init(&myData-mutex, NULL); pthread_cond_init(&myData-cond, NULL); pthread_cond_init(&myData-done, NULL); NSLog(@"Start"); myData-dataFormat.mSampleRate = 16000.0f; myData-dataFormat.mFormatID = kAudioFormatLinearPCM; myData-dataFormat.mFramesPerPacket = 1; myData-dataFormat.mChannelsPerFrame = 1; myData-dataFormat.mBytesPerFrame = 2; myData-dataFormat.mBytesPerPacket = 2; myData-dataFormat.mBitsPerChannel = 16; myData-dataFormat.mReserved = 0; myData-dataFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked; int i, bufferByteSize; UInt32 size; AudioQueueNewInput( &myData-dataFormat, MyAudioQueueOutputCallback, &myData, NULL /* run loop /, kCFRunLoopCommonModes / run loop mode /, 0 / flags */, &myData-queue); size = sizeof(&myData-dataFormat); AudioQueueGetProperty(&myData-queue, kAudioQueueProperty_StreamDescription, &myData-dataFormat, &size); CFURLRef fileURL; char path[256]; memset(path,0,sizeof(path)); getFilename(path,256); fileURL = CFURLCreateFromFileSystemRepresentation(NULL, (UInt8*)path, strlen(path), FALSE); AudioFileCreateWithURL(fileURL, kAudioFileCAFType, &myData-dataFormat, kAudioFileFlags_EraseFile, &myData-audioFile); OSStatus err = AudioFileStreamOpen(myData, MyPropertyListenerProc, MyPacketsProc, kAudioFileMP3Type, &myData-audioFileStream); if (err) { PRINTERROR("AudioFileStreamOpen"); return 1; } CFStreamClientContext ctxt = {0, self, NULL, NULL, NULL}; CFStringRef bodyData = CFSTR(""); // Usually used for POST data CFStringRef headerFieldName = CFSTR("X-My-Favorite-Field"); CFStringRef headerFieldValue = CFSTR("Dreams"); CFStringRef url = CFSTR(RADIO_LOCATION); CFURLRef myURL = CFURLCreateWithString(kCFAllocatorDefault, url, NULL); CFStringRef requestMethod = CFSTR("GET"); CFHTTPMessageRef myRequest = CFHTTPMessageCreateRequest(kCFAllocatorDefault, requestMethod, myURL, kCFHTTPVersion1_1); CFHTTPMessageSetBody(myRequest, bodyData); CFHTTPMessageSetHeaderFieldValue(myRequest, headerFieldName, headerFieldValue); CFReadStreamRef stream = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, myRequest); if (!stream) { NSLog(@"Creating the stream failed"); return; } if (!CFReadStreamSetClient(stream, kNetworkEvents, ReadStreamClientCallBack, &ctxt)) { CFRelease(stream); NSLog(@"Setting the stream's client failed."); return; } CFReadStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); if (!CFReadStreamOpen(stream)) { CFReadStreamSetClient(stream, 0, NULL, NULL); CFReadStreamUnscheduleFromRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); CFRelease(stream); NSLog(@"Opening the stream failed."); return; } } @catch (NSException *exception) { NSLog(@"main: Caught %@: %@", [exception name], [exception reason]); } } (void)viewDidLoad { [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; [super viewDidLoad]; } (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } (void)viewDidUnload { } (void)dealloc { [super dealloc]; } @end

    Read the article

  • How to fit page to Silverlight WebBrowser control?

    - by Igor V Savchenko
    Hello. I use WebBrowser Silverlight 4 control to load some page: <WebBrowser Height="350" Name="webBrowser" Width="400" /> ... webBrowser.Navigate(new Uri("http://mail.live.com")); But page loads with horizontal and vertical scroll bars. So I'm trying to find some ways to get actual size of loaded page (then I can change Height/Width of control) OR change scale of loaded page (to fit it to the actual WebControl control). Is it possible to do with standard WebControl methods?

    Read the article

  • class header+ implementation

    - by igor
    what am I doing wrong here? I keep on getting a compilation error when I try to run this in codelab (turings craft) Instructions: Write the implementation (.cpp file) of the GasTank class of the previous exercise. The full specification of the class is: A data member named amount of type double. A constructor that no parameters. The constructor initializes the data member amount to 0. A function named addGas that accepts a parameter of type double . The value of the amount instance variable is increased by the value of the parameter. A function named useGas that accepts a parameter of type double . The value of the amount data member is decreased by the value of the parameter. A function named getGasLevel that accepts no parameters. getGasLevel returns the value of the amount data member. class GasTank{ double amount; GasTank(); void addGas(double); void useGas(double); double getGasLevel();}; GasTank::GasTank(){ amount=0;} double GasTank::addGas(double a){ amount+=a;} double GasTank::useGas(double a){ amount+=a;} double GasTank::getGasLevel(){ return amount;}

    Read the article

  • Delphi disable warnings fails

    - by Alan Clark
    I have the following code in a Delphi 2007 application: function TBaseCriteriaObject.RecursiveCount( ObjType: TBaseCriteriaObjectClass): integer; var CurObj: TBaseCriteriaObject; begin result := 0; {$WARNINGS OFF} for CurObj in RecursiveChildren(ObjType) do Inc(Result); {$WARNINGS ON} end; Which produces this warning: [DCC Warning] BaseCriteriaObject.pas(255): H2077 Value assigned to 'CurObj' never used I understand the warning but don't want to change the code, so how do I get rid of the warning because {$WARNINGS OFF} does not seem to work in this case?

    Read the article

  • XNA 4.0 - What happens when the window is minimized?

    - by Conrad Clark
    Hello. I'm learning F#, and decided to try making simple XNA games for windows using F# (pure enthusiasm) , and got a window with some images showing up. Here's the code: (*Methods*) member self.DrawSprites() = _spriteBatch.Begin() for i = 0 to _list.Length-1 do let spentity = _list.List.ElementAt(i) _spriteBatch.Draw(spentity.ImageTexture,new Rectangle(100,100,(int)spentity.Width,(int)spentity.Height),Color.White) _spriteBatch.End() (*Overriding*) override self.Initialize() = ChangeGraphicsProfile() _graphicsDevice <- _graphics.GraphicsDevice _list.AddSprite(0,"NagatoYuki",992.0,990.0) base.Initialize() override self.LoadContent() = _spriteBatch <- new SpriteBatch(_graphicsDevice) base.LoadContent() override self.Draw(gameTime : GameTime) = base.Draw(gameTime) _graphics.GraphicsDevice.Clear(Color.CornflowerBlue) self.DrawSprites() And the AddSprite Method: member self.AddSprite(ID : int,imageTexture : string , width : float, height : float) = let texture = content.Load<Texture2D>(imageTexture) list <- list @ [new SpriteEntity(ID,list.Length, texture,Vector2.Zero,width,height)] The _list object has a ContentManager, here's the constructor: type SpriteList(_content : ContentManager byref) = let mutable content = _content let mutable list = [] But I can't minimize the window, since when it regains its focus, i get this error: ObjectDisposedException Cannot access a disposed object. Object name: 'GraphicsDevice'. What is happening?

    Read the article

  • RESTful services and update operations

    - by Igor Brejc
    I know REST is meant to be resource-oriented, which roughly translates to CRUD operations on these resources using standard HTTP methods. But what I just wanted to update a part of a resource? For example, let's say I have Payment resource and I wanted to mark its status as "paid". I don't want to POST the whole Payment object through HTTP (sometimes I don't even have all the data). What would be the RESTful way of doing this? I've seen that Twitter uses the following approach for updating Twitter statuses: http://api.twitter.com/1/statuses/update.xml?status=playing with cURL and the Twitter API Is this approach in "the spirit" of REST? UPDATE: PUT - POST Some links I found in the meantime: PUT or POST: The REST of the Story PUT is not UPDATE PATCH Method for HTTP

    Read the article

  • clearing cin input? cin.ignore not a good way?

    - by igor
    What's a better way to clear cin input? I thought cin.clear and cin.ignore was a good way...? code: void clearInput() { cin.clear(); cin.ignore(1000,'\n'); //cin.ignore( std::numeric_limits<streamsize>::max(), '\n' ); } My teacher gave me this reply... this is basically saying that your clearInput doesn't work FYI: ignore is NEVER a good idea as a way of getting rid of all that remains on a line and your failing this test is exactly the reason why now go clear it the correct way

    Read the article

  • MSI Installer start auto-repair when service starts

    - by Josh Clark
    I have a WiX based MSI that installs a service and some shortcuts (and lots of other files that don't). The shortcut is created as described in the WiX docs with a registry key under HKCU as the key file. This is an all users install, but to get past ICE38, this registry key has to be under the current user. When the service starts (it runs under the SYSTEM account) it notices that that registry key isn't valid (at least of that user) and runs the install again to "repair". In the Event Log I get MsiInstaller Events 1001 and 1004 showing that "The resource 'HKEY_CURRENT_USER\SOFTWARE\MyInstaller\Foo' does not exist." This isn't surprising since the SYSTEM user wouldn't have this key. I turned on system wide MSI logging and the auto-repair created its log file in the C:\Windows\Temp folder rather than a specific user's TEMP folder which seems to imply the current user was SYSTEM (plus the log file shows the "Calling process" to be my service). Is there something I can do to disable the auto-repair functionality? Am I doing something wrong or breaking some MSI rule? Any hints on where to look next?

    Read the article

  • Creating a Bazaar branch from an offline SVN working copy?

    - by Igor Brejc
    I'm doing some offline development on my SVN working copy. Since I won't have access to the SVN repository for a while, I wanted to use Bazaar as a helper version control to keep the intermediate commit history before I commit everything back to the SVN repository. Is this possible? When I try to create a branch using TortoiseBZR from the SVN working copy, it wants to access the SVN repository, which is a problem.

    Read the article

  • Fill figure with JSFL

    - by Igor
    I draw figure in Flsh ID with JSFL methods, for example // draw rectangle doc.addNewLine({x:0, y:0}, {x:2000, y:0}); doc.addNewLine({x:2000, y:0}, {x:2000, y:500}); doc.addNewLine({x:2000, y:500}, {x:0, y:500}); doc.addNewLine({x:0, y:500}, {x:0, y:0}); // how can I fill it, because this way doesn't work doc.setFillColor('#0000ff');

    Read the article

  • How to make iPhone application accept incorrect server certificate but only specific one?

    - by Igor Romanov
    I need to work with private HTTPS API and client has incorrect certificate on the host. Certificate is for www.clienthost.com and I'm working with api.clienthost.com. So I need to connect via HTTPS to api.clienthost.com ignoring incorrect certificate but still make sure it is the one for www.clienthost.com and not something else. I found this answer: http://stackoverflow.com/questions/933331/how-to-use-nsurlconnection-to-connect-with-ssl-for-an-untrusted-cert and it seems to solve half of my problem but I'm trying to figure out how to still check certificate for host is one I expect to see and not different.

    Read the article

  • Rails route, show all elements on the same page

    - by Igor Oliveira Antonio
    I need to show all my elements on the same page. In routes: namespace :nourishment do resources :diets do resources :nourishment_meals, :controller => 'meals' get 'nourishment_meals/show_all_meals' => 'meals#show_all_meals', as: "show_all_meals" end end which will generate: nourishment_diet_nourishment_meals_path GET /nourishment/diets/:diet_id/nourishment_meals(.:format) nourishment/meals#index POST /nourishment/diets/:diet_id/nourishment_meals(.:format) nourishment/meals#create new_nourishment_diet_nourishment_meal_path GET /nourishment/diets/:diet_id/nourishment_meals/new(.:format) nourishment/meals#new edit_nourishment_diet_nourishment_meal_path GET /nourishment/diets/:diet_id/nourishment_meals/:id/edit(.:format) nourishment/meals#edit nourishment_diet_nourishment_meal_path GET /nourishment/diets/:diet_id/nourishment_meals/:id(.:format) nourishment/meals#show PATCH /nourishment/diets/:diet_id/nourishment_meals/:id(.:format) nourishment/meals#update PUT /nourishment/diets/:diet_id/nourishment_meals/:id(.:format) nourishment/meals#update DELETE /nourishment/diets/:diet_id/nourishment_meals/:id(.:format) nourishment/meals#destroy [**THIS**] nourishment_diet_show_all_meals_path GET /nourishment/diets/:diet_id/nourishment_meals/show_all_meals(.:format) nourishment/meals#show_all_meals The problem, when I do this: <%= link_to "Show all meals", nourishment_diet_show_all_meals_path, :class=>"button green" %> This error raise: Problem: Document(s) not found for class NourishmentMeal with id(s) show_all. Summary: When calling NourishmentMeal.find with an id or array of ids, each parameter must match a document Can someone help me?

    Read the article

  • Cocoa multiple threads, locks don't work

    - by Igor
    I have a threadMethod which shows in console robotMotorsStatus every 0.5 sec. But when I try to change robotMotorsStatus in changeRobotStatus method I receive an exception. Where I need to put locks in that program. #import "AppController.h" @implementation AppController extern char *robotMotorsStatus; - (IBAction)runThread:(id)sender { [self performSelectorInBackground:@selector(threadMethod) withObject:nil]; } - (void)threadMethod { char string_to_send[]="QFF001100\r"; //String prepared to the port sending (first inintialization) string_to_send[7] = robotMotorsStatus[0]; string_to_send[8] = robotMotorsStatus[1]; while(1){ [theLock lock]; usleep(500000); NSLog (@"Robot status %s", robotMotorsStatus); [theLock unlock]; } } - (IBAction)changeRobotStatus:(id)sender { robotMotorsStatus[0]='1'; }

    Read the article

  • Didn't load images when I test version on Iphone

    - by Igor
    I use images from resources like that: UIImage *image = [ UIImage imageNamed:@"example.jpg" ]; UIImageView *imageView = [ [UIImageView alloc] initWithImage:image ]; When I test it on semulator it's works. But on Iphone no. Also image with size about 10Kb loaded, with size about 100Kb no. Whats wrong?

    Read the article

  • How do I make a script that properly introduces hstore in both 9.0 and 9.1?

    - by Igor Zinov'yev
    I am trying to introduce the hstore type into the database of a project I'm developing. But the problem is that I have a slightly newer version of the Postgres server installed on my development machine than there is on the production machine. While I can simply execute the CREATE EXTENSION command locally, this command is unavailable on the production machine. Is there a way to create a script that will install hstore both on 9.1 and 9.0?

    Read the article

  • Any difference in performance/compatibility of different languages in PostgreSQL?

    - by Igor
    In nowadays the PostgreSQL offers plenty of procedural languages: pl/pgsql, pl/perl, etc Are there any difference in the speed/memory consumption in procedures written in different languages? Does anybody have done any test? Is it true that to use the native pl/pgsql is the most correct choice? How the procedure written in C++ and compiled into loadable module differs in all parameter w.r.t. the user function written with pl/* languages?

    Read the article

  • finding "distance" between two pixel's colors.

    - by igor
    Once more something relatively simple, but confused as to what they want. the method to find distance on cartesian coordinate system is distance=sqrt[(x2-x1)^2 + (y2-y1)^2] but how do i apply it here? //Requires: testColor to be a valid Color //Effects: returns the "distance" between the current Pixel's color and // the passed color // uses the standard method to calculate "distance" // uses the same formula as finding distance on a // Cartesian coordinate system double colorDistance(Color testColor) const;

    Read the article

  • Can "\Device\NamedPipe\\Win32Pipes" handles cause "Too many open files" error?

    - by Igor Oks
    Continuing from this question: When I am trying to do fopen on Windows, I get a "Too many open files" error. I tried to analyze, how many open files I have, and seems like not too much. But when I executed Process Explorer, I noticed that I have many open handles with similar names: "\Device\NamedPipe\Win32Pipes.00000590.000000e2", "\Device\NamedPipe\Win32Pipes.00000590.000000e3", etc. I see that the number of these handles is exactly equal to the number of the iterations that my program executed, before it returned "Too many open files" and stopped. I am looking for an answer, what are these handles, and could they actually cause the "Too many open files" error? In my program I am loading files from remote drive, and I am creating TCP/IP connections. Could one of these operations create these handles?

    Read the article

  • DataContractSerializer and XSLT

    - by Russ Clark
    I've got a simple Employee class that I'm trying to serialize to an XDocument and then use XSLT to transform the document to a page that displays both the properties (Name and ID) from the Employee class, and an html form with 2 radio buttons (Approve and Reject) and a submit button. Here is the Employee class: [Serializable, DataContract(Namespace="XSLT_MVC.Controllers/")] public class Employee { [DataMember] public string Name { get; set; } [DataMember] public int ID { get; set; } public Employee() { } public Employee(string name, int id) { Name = name; ID = id; } public XDocument GetDoc() { XDocument doc = new XDocument(); var serializer = new DataContractSerializer(typeof(Employee)); using (var writer = doc.CreateWriter()) { serializer.WriteObject(writer, this); writer.Close(); } return doc; } } And here is the XSLT file: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <html> <body> <xsl:value-of select="Employee/Name"/> <br /> <xsl:value-of select="Employee/ID"/> <br /> <form method="post" action="/Home/ProcessRequest?id={Employee/ID}"> <input id="Action" name="Action" type="radio" value="Approved"></input> Approved <br /> <input id="Action" name="Action" type="radio" value="Rejected"></input> Rejected <br /> <input type="submit" value="Submit"></input> </form> </body> </html> </xsl:template> </xsl:stylesheet> When I run this, all I get is the html form with the 2 radio buttons and the submit button, but not the properties from the Employee class. I saw a separate StackOverflow post that said I need to change the <xsl:template match="/"> to match on the namespace of my Employee class like this: <xsl:template match="/XSLT_MVC.Controllers">, but when I do that, now all I get are the Employee properties, and not the html form with the 2 radio buttons and the submit button. Does anyone know what needs to be done so that my transform will select and display both the Employee properties and the html form?

    Read the article

  • How to debug and detect hang issue

    - by igor
    I am testing my application (Windows 7, WinForms, Infragistics controls, C#, .Net 3.5). I have two monitors and my application saves and restores forms' position on the first or second monitors. So I physically switched off second monitor and disabled it at Screen Resolution on the windows display settings form. I need to know it is possible for my application to restore windows positions (for those windows that were saved on the second monitor) to the first one. I switched off second monitor and press Detect to apply hardware changes. Then Windows switched OFF the first monitor for a few seconds to apply new settings. When the first monitor screen came back, my application became unresponsive. My application was launched in debug mode, so I tried to navigate via stack and threads (Visual Studio 2008), paused application, started and did not find any thing that help me to understand why my application is not responsive. Could somebody help my how to detect the source of issue.

    Read the article

  • WITH statement in Java

    - by Mike Clark
    In VB.NET there is the WITH command that lets you omit an object name and only access the methods and properties needed. For example: With foo .bar() .reset(true) myVar = .getName() End With Is there any such syntax within Java? Thanks!

    Read the article

  • Disable animation when moving CALayers

    - by Sean Clark Hess
    The following code animates the movement, even though I didn't use beginAnimations:context. How do I get it to move without animating? This is a new iphone view project, and these are the only updates to it. // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; sublayer = [CALayer new]; sublayer.backgroundColor = [[UIColor redColor] CGColor]; sublayer.frame = CGRectMake(0, 0, 100, 100); [self.view.layer addSublayer:sublayer]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { sublayer.position = [[touches anyObject] locationInView:self.view]; }

    Read the article

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