Search Results

Search found 86 results on 4 pages for 'venkat shiva'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Windows 7 Create Folder in "Program Files" failing in C# code even thought I have admin rights!

    - by Shiva
    Hi, I am unable to create a file under "program files" folder on my Windows 7 64-bit machine in VS 2008 WPF C# code. The error I get on the following code myFile = File.Create(logFile); is the following. (this is the innerException stack trace). at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.File.Create(String path) at MyFirm.MyPricingApp.UI.App.InitializeLogging() in C:\Projects\MyPricingApp\App.xaml.cs:line 150 at MyFirm.MyPricingApp.UI.App.Application_Startup(Object sender, StartupEventArgs e) in C:\Projects\MyPricingApp\App.xaml.cs:line 38 at System.Windows.Application.OnStartup(StartupEventArgs e) at System.Windows.Application.<.ctor>b__0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) this seems like it has something to do with UAC in Windows 7, because why else would I get this since my user is already Admin on the machine ?! Also since the WinIOError has SECURITY_ATTRIBUTES, I am thinking this has something to do with a "new way" security is handled in Windows 7. I tried to browse to the "Program Files" folder, under which the log folder and file were to be created. I can create the folder by hand, but when i try to create the file, I get the similar "Access Denied" exception.

    Read the article

  • File.Exists("SDF File Path") returns a FALSE when run through Unit tests even though it exists in th

    - by shiva-hv
    I am writing Unit tests for a Windows Project. The Executable project on the Client Side of this Windows Project has a code File.Exists("LanguageLookups.sdf") which is used to check and return a Bool if the sdf file exists in the Execution Directory or not. But when i execute the same piece of Code through a Unit test; The code File.Exists("LanguageLookups.sdf") returns a FALSE. Its not able to find this SDF File. Can anybody help me on this?

    Read the article

  • Can the Sequence of RecordSets in a Multiple RecordSet ADO.Net resultset be determined, controlled?

    - by Shiva
    I am using code similar to this Support / KB article to return multiple recordsets to my C# program. But I don't want C# code to be dependant on the physical sequence of the recordsets returned, in order to do it's job. So my question is, "Is there a way to determine which set of records from a multiplerecordset resultset am I currently processing?" I know I could probably decipher this indirectly by looking for a unique column name or something per resultset, but I think/hope there is a better way. P.S. I am using Visual Studio 2008 Pro & SQL Server 2008 Express Edition.

    Read the article

  • JavaOne 2012 - Java Generics

    - by Sharon Zakhour
    At JavaOne 2012, Venkat Subramaniam of Agile Developer, Inc, presented a conference session titled "The Good, The Bad, and the Ugly of Java Generics." Dr Subramaniam discussed the use of generics, what to watch out for when using generics, and best practices. To learn more about working with generics, see the Generics trail in the Java Tutorials. The trail was recently expanded and coverage added for the following topics: Generics, Inheritance, and Subtypes Guidelines for Wildcard Use Restrictions on Generics Wildcard Capture and Helper Methods Effects of Type Erasure and Bridge Methods

    Read the article

  • export to csv using fastercsv and CSV::Writer (Ruby on Rails)

    - by Venkat
    What am I trying to do: export data to csv. I have a form which allows user to select the format (from a drop down menu). So based on the selection of the format the ouput is displayed using a ajax call. Works fine for html but when I select the format as csv I don't see any pop up on the screen (asking to save or open the file) and neither any file gets downloaded directly. I tried using Fastercsv (but the problem is that I don't see any pop up asking me whether I want to save or open the file) and CSV::Writer where I get this error message on the console. NoMethodError (You have a nil object when you didn't expect it! The error occurred while evaluating nil.bytesize): actionpack (2.3.4) lib/action_controller/streaming.rb:142:in `send_data' Code using Fastercsv: def export_to_csv csv_string = FasterCSV.generate(:col_sep => ",") do |csv| members = ["Versions / Project Members"] members_selected.each {|member| members << Stat.member_name(member)} Stat.project_members(project).each {|user| members << user.name} csv << ["some text", "text 2", "text 3"] end return csv_string end and this is how I am sending the data: send_data(export_to_csv,:type => 'text/csv; charset=iso-8859-1; header=present', :disposition => "attachment", :filename => "filename.csv") I see the response as "some text, text 2, text 3" in the firebug console but no pop up asking whether I want to save or open the file. This is what I am doing using CSV::Writer: def export_to_csv report = StringIO.new CSV::Writer.generate(report, ',') do |csv| csv << ['c1', 'c2'] end end and call it as: send_data(export_to_csv,:type => 'text/csv; charset=iso-8859-1; header=present', :disposition => "attachment", :filename => "filename.csv") This is the error which is thrown on the console: NoMethodError (You have a nil object when you didn't expect it! The error occurred while evaluating nil.bytesize): actionpack (2.3.4) lib/action_controller/streaming.rb:142:in `send_data'

    Read the article

  • Help with boost::lambda expression

    - by Venkat Shivanandan
    I tried to write a function that calculates a hamming distance between two codewords using the boost lambda library. I have the following code: #include <iostream> #include <numeric> #include <boost/function.hpp> #include <boost/lambda/lambda.hpp> #include <boost/lambda/if.hpp> #include <boost/bind.hpp> #include <boost/array.hpp> template<typename Container> int hammingDistance(Container & a, Container & b) { return std::inner_product( a.begin(), a.end(), b.begin(), (_1 + _2), boost::lambda::if_then_else_return(_1 != _2, 1, 0) ); } int main() { boost::array<int, 3> a = {1, 0, 1}, b = {0, 1, 1}; std::cout << hammingDistance(a, b) << std::endl; } And the error I am getting is: HammingDistance.cpp: In function ‘int hammingDistance(Container&, Container&)’: HammingDistance.cpp:15: error: no match for ‘operator+’ in ‘<unnamed>::_1 + <unnamed>::_2’ HammingDistance.cpp:17: error: no match for ‘operator!=’ in ‘<unnamed>::_1 != <unnamed>::_2’ /usr/include/c++/4.3/boost/function/function_base.hpp:757: note: candidates are: bool boost::operator!=(boost::detail::function::useless_clear_type*, const boost::function_base&) /usr/include/c++/4.3/boost/function/function_base.hpp:745: note: bool boost::operator!=(const boost::function_base&, boost::detail::function::useless_clear_type*) This is the first time I am playing with boost lambda. Please tell me where I am going wrong. Thanks.

    Read the article

  • TableView SwipeGesture

    - by venkat
    hi every one.i am using TableView having edit button to delete a row.when i swipe in the row it shows a default "Delete" button. But i dont need it.The Content of the cell must be deleted by means of edit button not by default one.how to disable that "Swipe to Delete" Button.

    Read the article

  • Cache in iphone

    - by venkat
    hello friends i am new to networking in iphone.i would like to see some sample code for cache its not based on image.i need for complete url. thanks in advance.

    Read the article

  • CryptoExcercise Encryption/Decryption Problem

    - by venkat
    I am using apples "cryptoexcercise" (Security.Framework) in my application to encrypt and decrypt a data of numeric value. When I give the input 950,128 the values got encrypted, but it is not getting decrypted and exists with the encrypted value only. This happens only with the mentioned numeric values. Could you please check this issue and give the solution to solve this problem? here is my code (void)testAsymmetricEncryptionAndDecryption { uint8_t *plainBuffer; uint8_t *cipherBuffer; uint8_t *decryptedBuffer; const char inputString[] = "950"; int len = strlen(inputString); if (len > BUFFER_SIZE) len = BUFFER_SIZE-1; plainBuffer = (uint8_t *)calloc(BUFFER_SIZE, sizeof(uint8_t)); cipherBuffer = (uint8_t *)calloc(CIPHER_BUFFER_SIZE, sizeof(uint8_t)); decryptedBuffer = (uint8_t *)calloc(BUFFER_SIZE, sizeof(uint8_t)); strncpy( (char *)plainBuffer, inputString, len); NSLog(@"plain text : %s", plainBuffer); [self encryptWithPublicKey:(UInt8 *)plainBuffer cipherBuffer:cipherBuffer]; NSLog(@"encrypted data: %s", cipherBuffer); [self decryptWithPrivateKey:cipherBuffer plainBuffer:decryptedBuffer]; NSLog(@"decrypted data: %s", decryptedBuffer); free(plainBuffer); free(cipherBuffer); free(decryptedBuffer); } (void)encryptWithPublicKey:(uint8_t *)plainBuffer cipherBuffer:(uint8_t *)cipherBuffer { OSStatus status = noErr; size_t plainBufferSize = strlen((char *)plainBuffer); size_t cipherBufferSize = CIPHER_BUFFER_SIZE; NSLog(@"SecKeyGetBlockSize() public = %d", SecKeyGetBlockSize([self getPublicKeyRef])); // Error handling // Encrypt using the public. status = SecKeyEncrypt([self getPublicKeyRef], PADDING, plainBuffer, plainBufferSize, &cipherBuffer[0], &cipherBufferSize ); NSLog(@"encryption result code: %d (size: %d)", status, cipherBufferSize); NSLog(@"encrypted text: %s", cipherBuffer); } (void)decryptWithPrivateKey:(uint8_t *)cipherBuffer plainBuffer:(uint8_t *)plainBuffer { OSStatus status = noErr; size_t cipherBufferSize = strlen((char *)cipherBuffer); NSLog(@"decryptWithPrivateKey: length of buffer: %d", BUFFER_SIZE); NSLog(@"decryptWithPrivateKey: length of input: %d", cipherBufferSize); // DECRYPTION size_t plainBufferSize = BUFFER_SIZE; // Error handling status = SecKeyDecrypt([self getPrivateKeyRef], PADDING, &cipherBuffer[0], cipherBufferSize, &plainBuffer[0], &plainBufferSize ); NSLog(@"decryption result code: %d (size: %d)", status, plainBufferSize); NSLog(@"FINAL decrypted text: %s", plainBuffer); } (SecKeyRef)getPublicKeyRef { OSStatus sanityCheck = noErr; SecKeyRef publicKeyReference = NULL; if (publicKeyRef == NULL) { NSMutableDictionary *queryPublicKey = [[NSMutableDictionary alloc] init]; // Set the public key query dictionary. [queryPublicKey setObject:(id)kSecClassKey forKey:(id)kSecClass]; [queryPublicKey setObject:publicTag forKey:(id)kSecAttrApplicationTag]; [queryPublicKey setObject:(id)kSecAttrKeyTypeRSA forKey:(id)kSecAttrKeyType]; [queryPublicKey setObject:[NSNumber numberWithBool:YES] forKey:(id)kSecReturnRef]; // Get the key. sanityCheck = SecItemCopyMatching((CFDictionaryRef)queryPublicKey, (CFTypeRef *)&publicKeyReference); if (sanityCheck != noErr) { publicKeyReference = NULL; } [queryPublicKey release]; } else { publicKeyReference = publicKeyRef; } return publicKeyReference; } (SecKeyRef)getPrivateKeyRef { OSStatus resultCode = noErr; SecKeyRef privateKeyReference = NULL; if(privateKeyRef == NULL) { NSMutableDictionary * queryPrivateKey = [[NSMutableDictionary alloc] init]; // Set the private key query dictionary. [queryPrivateKey setObject:(id)kSecClassKey forKey:(id)kSecClass]; [queryPrivateKey setObject:privateTag forKey:(id)kSecAttrApplicationTag]; [queryPrivateKey setObject:(id)kSecAttrKeyTypeRSA forKey:(id)kSecAttrKeyType]; [queryPrivateKey setObject:[NSNumber numberWithBool:YES] forKey:(id)kSecReturnRef]; // Get the key. resultCode = SecItemCopyMatching((CFDictionaryRef)queryPrivateKey, (CFTypeRef *)&privateKeyReference); NSLog(@"getPrivateKey: result code: %d", resultCode); if(resultCode != noErr) { privateKeyReference = NULL; } [queryPrivateKey release]; } else { privateKeyReference = privateKeyRef; } return privateKeyReference; }

    Read the article

  • RightBarButtonItem in iphone

    - by venkat
    hello all. i am using navigation control with left and right bar buttons.my right side bar button contains length of 10 chars. And my title contains 12 chars. when i press the right bar button my title is moving.how can i stop moving the title when clicking button.

    Read the article

  • Session Management in Axis1.2

    - by venkat
    Hi, In our application we are using Axis1.2. Our service has one instance variable profileDataManager which is responsible to return set of profiles. The application has pagination to display only 25 profiles at a time. My requirement is the profileDataManager should be instantiated only once for respective client. On subsequent calls, it should use the existing object. For this i need the one service object should be created for user session.If a client sends another request, the service object created in previous call should be returned. On client side i am using Flex. In CXF webserice, my requirement is fulfilled with an annotation '@HttpSessionScope'. Is there away that i can get the abovementioned behavior in Axis? I have given the following trials. but no success added and modified the java client stub.setMaintainSession(true); The above didn't work for me.

    Read the article

  • UITextFields firstResponder problem

    - by venkat
    hello all i am working with multiple uitextfields.i have a problem in cursor placing while changing firstResponder. i would like to do "Cursor placement in 2nd field once we entered the 3rd character in the 1st field." but the cursor stays in 3rd place.here i am restricting my first text field length to 3.

    Read the article

  • How to create Custom action project with WIX 2.0

    - by Venkat
    Hi, I have installed WIX 2.0 (and Votive). I need to create user defined custom actions using the Custom action project. I found the custom action project template in VS2008 when WIX 3.0 is installed. Now, i couldnt find any template in VS2005 with WIX 2.0. Can anyone plz let me know how can i create a custom action project( class with some custom action)..like this [CustomAction] public static ActionResult InstallItem1(Session session) I think Microsoft.WindowsInstaller and Microsoft.Deployment.WindowsInstaller are the references required (not sure) to create such methods but i couldnt find them in my machine.

    Read the article

  • Differentiate VMware network adapter from physical network adapters

    - by Venkat
    I have to differentiate between the real addresses and the VM addresses using any Windows API. I'm using Getadaptersaddresses API to populate a list of ipaddresses for the local machine. I need to extract only the "real" addresses apart from the addresses associated with the VMware network adapter and other addresses(auto-configuration and tunnel adapter addresses) I've not been able to find any API or any flag to differentiate this. Is there any way this can be done? PS:The IfType flag in the IP_ADAPTER_ADDRESSES structure returned by Getadaptersaddresses doesn't help me differentiate between VMware addresses and the real addresses

    Read the article

< Previous Page | 1 2 3 4  | Next Page >