Search Results

Search found 10930 results on 438 pages for 'self signed'.

Page 22/438 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Self-hosted browser-based remote desktop script?

    - by rlsaj
    I need a self-hosted browser based remote desktop script that will connect me from any PC to my work PC. I need to either host this script within my own dedicated hosting or on my work PC. The PC that I need to remote into is always the one PC (Win7) and the IP never changes, and I have access to the Router/Firewall within. I have tried many remote desktop services and applications - LogMeIn, Team Viewer, (Ultra/Tight) VNC, GoToMyPC and iTeleport Connect and even Windows Remote Desktop - and the web services (or ports) are blocked at whatever free wi-fi/hotel/coffee shop I am at. Note that I will need to be able to access this from any PC, so I won't be able to install any applications (or use any portable software) - hence my thinking that it will need to be browser based on a standard (not blocked) port. If I can set up a web based remote desktop application - really a homebrew LogMeIn - then I should solve my problem. What is the best option here?

    Read the article

  • how to stop a driver from running - it self protected and rootkit hidden

    - by Aristos
    I have this serous problem For the first time I can not stop a program from running. Something is on one laptop computer that is run as system legacy driver, and self protected and hidden on service as rootkit. Anything I try to remove fails. When a program or anti toolkit try to remove the hidden registry setting for make it stop I get this error : "a device attached to the system is not functioning" So any idea that can help me stop it from running, or even delete it on start up ? My one limitation is that the hard drive is on a laptop and I can not remove it and attact it to somewhere else. This program not let me, touch the registry, do not let me touch the file, do not let me touch the file, The move on boot fail to delete it, the rootrepeal fail to delete it, the rootkiet reveal from sysinternals fail to reveal it ! everything fails. Do how have any experience on this, or do you have any suggestion how to stop this driver from run ?

    Read the article

  • Password Self-serve Active Directory via LAMP environment

    - by keithosu
    I would like to be able to change active directory passwords via a Linux/Apache based webpage. This would be a self serve web page for the user. I have SSL-LDAP setup on the Active Directory to make this happen. Is there any project or code out there that will do this? I've looked at this phpadadmin and I cannot get it to work. I think this is for IIS/php/mySQL Another thing to note is I would like the user to authenticate to change their own password. The product/service should not need a privileged account to run. Thanks Keith

    Read the article

  • Self Hosted Dropbox Alternative?

    - by Hutch
    Does anyone know of any self-hosted Dropbox alternatives? We have a need to share files/folders between staff and partners (small scale) and for various reasons we'd prefer to host it ourselves. Sharepoint seems a little too focussed on "check in/check out" and things like webdav/ftp seem a little kludgy. In an ideal world something where you (as an IT person) can setup an area, make a user "owner" and from there they can add their customers would be great. Windows or Virtual Appliance would be ideal.

    Read the article

  • (Possibly) Corrupted DDCrypt self-decrypting file

    - by sca
    I recently discovered some files I had encrypted and archived on a CD using DDCrypt 2.0, which is a small encryption utility from back in the day. One of its functions is to create self-decrypting files, which are essentially EXE files that you can enter a password and then have the file extracted onto your filesystem. Unfortunately, I can't seem to get them to do this properly. They appear to be decrypting and then at the last moment I get the error: Error opening encrypted file C:\users\username\Temp\dde3cfa.tmp Reason: Success and then another dialog immediately says Error extracting ddc file. I'm not really sure what this means (certainly not success), but I've checked out the temporary file and it appears to be garbage data (although of the right file size). I don't know if anyone has an idea what might be done here to extract the files, or has dealt with a similar situation before. Any ideas are appreciated! Thank you in advance for your time and any help you can provide.

    Read the article

  • Hard drive self monitoring system

    - by Hoorayo
    I have a 500GB HDD on my desktop, and there are two partitions as C and D. The computer would not start and shows me a error message. Notice - Hard drive self monitoring system has reported that a parameter has exceeded its normal operating range. Dell recommends you that you back up your data regularly. A parameter out of range may or may not indicate a potential hard. So I took the hdd out of the desktop and made a USB external HDD. My laptop recognizes the hard drive as “I” drive and “J” drive. I am able to click “J” and see folders and files. But there is no response when I click “I” while it makes weird clicking sound. Can anyone explain why I drive doesn't work while J drive works on same physical hard drive? Is there anyway that I can fix?

    Read the article

  • Cross Domain access of self hosted WCF services?

    - by Macnique
    I have developed a WPF application which communicates with a set of self hosted WCF services which are under same domain and I use the following setup in the config files. <security mode="Transport"> <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" /> <message clientCredentialType="Windows" /> </security> I hosted the services on a server in different domain .I can achieve the communication by setting the security mode to "None" which is not ideal. Is there any other setting i can user for cross domain communication or i have to do with some trusted certificates ? I would be glad if some one can guide me because all the searches on google directed me to silverlight applications +Crossdomain.xml+WCF but i have't seen any combination of WPF on crossdomain environment.

    Read the article

  • How do I trust a self signed cert using https?

    - by dave
    Edit: I originally thought the server's certificate was self signed. Turns out it was signed by a self-signed CA certificate. I'm trying to write a Node.js application that accesses an HTTPS site that's protected using a self-signed certificate certificate signed by a private, self-signed CA certificate. I'd also like to not completely disable certificate checking. I tried putting the self signed certificate server's certificate in the request options, but that doesn't seem to be working. Anyone know how to do this? I expect the following code to print statusCode 200, but instead it prints [Error: SELF_SIGNED_CERT_IN_CHAIN]. I've tried similar code with request with the same results. var https = require('https'); var fs = require('fs'); var opts = { hostname: host, port: 443, path: '/', method: 'GET', ca: fs.readFileSync(serverCertificateFile, 'utf-8') }; var req = https.request(opts, function (res) { console.log('statusCode', res.statusCode); }); req.end(); req.on('error', function (err) { console.error(err); });

    Read the article

  • setDelegate:self, how does it work?

    - by fuzzygoat
    I have a query regarding how delegates work. My understanding was that delegates take responsibility for doing certain tasks on behalf of another object. locationManager = [[CLLocationManager alloc] init]; [locationManager setDelegate:self]; [locationManager setDistanceFilter:kCLDistanceFilterNone]; [locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; [locationManager startUpdatingLocation]; Am I right in thinking that in the example code above that the instance of CLLocationManager is created on a new thread so that it can get on with trying to find the location information it needs. When it completes its task (or encounters an error) it calls-back using the appropriate methods located in self e.g. locationManager:didUpdateToLocation:fromLocation: Essentially locationManager sends messages to self (which conforms to the correct delegate protocol) when things happen cheers gary

    Read the article

  • EXC_BAD_ACCESS when not using self.

    - by chris
    I got nabbed by the following bug again and would like some clarification to exactly why it is a bug. I have a simple UITableView that loads some data: // myclass.h @property (nonatomic, retain) NSArray *myData // myclass.m @synthesize myData; - (void) viewDidLoad { ... myData = someDataSource // note the lack of self } - (UITableViewCell *) cellForRowAtIndexPath ... { ... cell.textLabel.text = [self.myData objectAtIndex:indexPath.row]; // EXC_BAD_ACCESS } The table first loads fine, but when scrolling up enough that one of the cells is totally out of the view I then get the EXC_BAD_ACCESS error. Am I missing something in regards to @property retain. My understanding is that it releases anything that the pointer was previously pointing to before the reassignment. If I am correct then why would not using self. cause any problems? Thanks for the help.

    Read the article

  • iPhone memory management: a release after setting self.someProperty = nil

    - by ddawber
    I am reading the LazyTableImages code that Apple have released and they do something to this effect (in an NSOperation subclass): - (void)dealloc { [myProperty release]; [myProperty2 release]; } - (void)main { // // Parse operation undertaken here // self.myProperty = nil; self.myProperty2 = nil; } My thinking is that they do this in case dealloc is called before setting properties to nil. Is my thinking correct here? Are the releases unnecessary, as self.myProperty = nil effectively releases myProperty? One thing I have noticed in this code is that they don't release all retained objects in dealloc, only some of them, which is really the cause for my confusion. Cheers

    Read the article

  • How do I use setFilmSize in panda3d to achieve the correct view?

    - by lhk
    I'm working with Panda3d and recently switched my game to isometric rendering. I moved the virtual camera accordingly and set an orthographic lens. Then I implemented the classes "Map" and "Canvas". A canvas is a dynamically generated mesh: a flat quad. I'm using it to render the ingame graphics. Since the game itself is still set in a 3d coordinate system I'm planning to rely on these canvases to draw sprites. I could have named this class "Tile" but as I'd like to use it for non-tile sketches (enemies, environment) as well I thought canvas would describe it's function better. Map does exactly what it's name suggests. Its constructor receives the number of rows and columns and then creates a standard isometric map. It uses the canvas class for tiles. I'm planning to write a map importer that reads a file to create maps on the fly. Here's the canvas implementation: class Canvas: def __init__(self, texture, vertical=False, width=1,height=1): # create the mesh format=GeomVertexFormat.getV3t2() format = GeomVertexFormat.registerFormat(format) vdata=GeomVertexData("node-vertices", format, Geom.UHStatic) vertex = GeomVertexWriter(vdata, 'vertex') texcoord = GeomVertexWriter(vdata, 'texcoord') # add the vertices for a flat quad vertex.addData3f(1, 0, 0) texcoord.addData2f(1, 0) vertex.addData3f(1, 1, 0) texcoord.addData2f(1, 1) vertex.addData3f(0, 1, 0) texcoord.addData2f(0, 1) vertex.addData3f(0, 0, 0) texcoord.addData2f(0, 0) prim = GeomTriangles(Geom.UHStatic) prim.addVertices(0, 1, 2) prim.addVertices(2, 3, 0) self.geom = Geom(vdata) self.geom.addPrimitive(prim) self.node = GeomNode('node') self.node.addGeom(self.geom) # this is the handle for the canvas self.nodePath=NodePath(self.node) self.nodePath.setSx(width) self.nodePath.setSy(height) if vertical: self.nodePath.setP(90) # the most important part: "Drawing" the image self.texture=loader.loadTexture(""+texture+".png") self.nodePath.setTexture(self.texture) Now the code for the Map class class Map: def __init__(self,rows,columns,size): self.grid=[] for i in range(rows): self.grid.append([]) for j in range(columns): # create a canvas for the tile. For testing the texture is preset tile=Canvas(texture="../assets/textures/flat_concrete",width=size,height=size) x=(i-1)*size y=(j-1)*size # set the tile up for rendering tile.nodePath.reparentTo(render) tile.nodePath.setX(x) tile.nodePath.setY(y) # and store it for later access self.grid[i].append(tile) And finally the usage def loadMap(self): self.map=Map(10, 10, 1) this function is called within the constructor of the World class. The instantiation of world is the entry point to the execution. The code is pretty straightforward and runs good. Sadly the output is not as expected: Please note: The problem is not the white rectangle, it's my player object. The problem is that although the map should have equal width and height it's stretched weirdly. With orthographic rendering I expected the map to be a perfect square. What did I do wrong ? UPDATE: I've changed the viewport. This is how I set up the orthographic camera: lens = OrthographicLens() lens.setFilmSize(40, 20) base.cam.node().setLens(lens) You can change the "aspect" by modifying the parameters of setFilmSize. I don't know exactly how they are related to window size and screen resolution but after testing a little the values above seem to work for me. Now everything is rendered correctly as long as I don't resize the window. Every change of the window's size as well as switching to fullscreen destroys the correct rendering. I know that implementing a listener for resize events is not in the scope of this question. However I wonder why I need to make the Film's height two times bigger than its width. My window is quadratic ! Can you tell me how to find out correct setting for the FilmSize ? UPDATE 2: I can imagine that it's hard to envision the behaviour of the game. At first glance the obvious solution is to pass the window's width and height in pixels to setFilmSize. There are two problems with that approach. The parameters for setFilmSize are ingame units. You'll get a way to big view if you pass the pixel size For some strange reason the image is distorted if you pass equal values for width and height. Here's the output for setFilmSize(800,800) You'll have to stress your eyes but you'll see what I mean

    Read the article

  • SELF-SOLVED AutoHotkey Function GetMouseTaskbutton need to adapt for 64-bit OS

    - by auntyEEK
    SOLVED VIA SELF-HELP, HAIR-PULLING, AND TEETH-GRINDING. THANKS ANYWAY....... I'm using the GetMouseTaskbutton function from this thread on AHK forum. [http://www.autohotkey.com/forum/topic22763.html&highlight=getmousetaskbutton][1] ; Gets the index+1 of the taskbar button which the mouse is hovering over. ; Returns an empty string if the mouse is not over the taskbar's task toolbar. ; ; Some code and inspiration from Sean's TaskButton.ahk GetMouseTaskButton(ByRef hwnd) { MouseGetPos, x, y, win, ctl, 2 ; Check if hovering over taskbar. WinGetClass, cl, ahk_id %win% if (cl != "Shell_TrayWnd") return ; Check if hovering over a Toolbar. WinGetClass, cl, ahk_id %ctl% if (cl != "ToolbarWindow32") return ; Check if hovering over task-switching buttons (specific toolbar). hParent := DllCall("GetParent", "Uint", ctl) WinGetClass, cl, ahk_id %hParent% if (cl != "MSTaskSwWClass") return WinGet, pidTaskbar, PID, ahk_class Shell_TrayWnd hProc := DllCall("OpenProcess", "Uint", 0x38, "int", 0, "Uint", pidTaskbar) pRB := DllCall("VirtualAllocEx", "Uint", hProc , "Uint", 0, "Uint", 20, "Uint", 0x1000, "Uint", 0x4) VarSetCapacity(pt, 8, 0) NumPut(x, pt, 0, "int") NumPut(y, pt, 4, "int") ; Convert screen coords to toolbar-client-area coords. DllCall("ScreenToClient", "uint", ctl, "uint", &pt) ; Write POINT into explorer.exe. DllCall("WriteProcessMemory", "uint", hProc, "uint", pRB+0, "uint", &pt, "uint", 8, "uint", 0) ; SendMessage, 0x447,,,, ahk_id %ctl% ; TB_GETHOTITEM SendMessage, 0x445, 0, pRB,, ahk_id %ctl% ; TB_HITTEST btn_index := ErrorLevel ; Convert btn_index to a signed int, since result may be -1 if no 'hot' item. if btn_index 0x7FFFFFFF btn_index := -(~btn_index) - 1 if (btn_index > -1) { ; Get button info. SendMessage, 0x417, btn_index, pRB,, ahk_id %ctl% ; TB_GETBUTTON VarSetCapacity(btn, 20) DllCall("ReadProcessMemory", "Uint", hProc , "Uint", pRB, "Uint", &btn, "Uint", 20, "Uint", 0) state := NumGet(btn, 8, "UChar") ; fsState pdata := NumGet(btn, 12, "UInt") ; dwData ret := DllCall("ReadProcessMemory", "Uint", hProc , "Uint", pdata, "UintP", hwnd, "Uint", 4, "Uint", 0) } else hwnd = 0 DllCall("VirtualFreeEx", "Uint", hProc, "Uint", pRB, "Uint", 0, "Uint", 0x8000) DllCall("CloseHandle", "Uint", hProc) ; Negative values indicate seperator items. (abs(btn_index) is the index) return btn_index > -1 ? btn_index+1 : 0 } It identifies the owner of the hovered taskbar button. I'm using it in a routine to auto-activate window by hovering its taskbar button, and also a routine to close inactive window by middle-click on its taskbar button. Works great on my XP machine. The author had stated that the function does work in Vista, but it refuses to work for me in Vista 64-bit, so apparently it is only valid in 32-bit. And I am very new to AHK, and don't know how to adapt it. Unfortunately, my queries at the site sank without a trace. Does anyone have advice for me? I will be most grateful. Thanks.

    Read the article

  • Self-connecting printers

    - by Martin Cerny
    Hello, I work as an administrator in a small company using XP Professional on all computers and two servers with Win 2003 Server. Recently a very unusual problam occured one of the computers keeps connecting to all the printers on the network it doesn't matter if it's an administrator or Domain User as soon as somebody logs in the commputer connects all the printers. The printers are either installed on local computers or on the server and shared. There is no log-on script connecting the printers, I install them manualy and none of the other computers shows such behaviour. We have a printer which is installed on two computers and both of them share it (I'm moving it to Server from a small PC which shared it up to now, but some computers still use the old connection), meaning this specific computer connects to one of the printer two times and it can't use either of the connections. How to prevent this self-connecting to all printers (none of the other computers has this problem). If I delte them from the "Printers" folder everything works fine untill I reconnect and the Folder is once again full of all the printers we have. I solved the smaller problem, computer is now capable of printing on all of the printers (it seems there have been some registry issues), after cleaning the registry and reinstalling the printer it seems to work just fine. But the second thing prevails, the computer connects to all the printers in the network (when I remove one/multiple it is reconnected right after the next log-in by any user).

    Read the article

  • Python Tkinter Tix: How to use ScrolledWindow with grid in Tix NoteBook

    - by Sano98
    Hi guys, I'm adding several widgets to a Frame which is located in a tix.NoteBook. When there are too much widgets to fit in the window, I want to use a scrollbar, so I put tix.ScrolledWindow inside that Frame and add my widgets to this ScrolledWindow instead. The problem is that when using the grid() geometry manager, the scrollbar appears, but it is not working (The drag bar occupies the whole scroll bar). from Tkinter import * import Tix class Window: def __init__(self, root): self.labelList = [] self.notebook = Tix.NoteBook(root, ipadx=3, ipady=3) self.notebook.add('sheet_1', label="Sheet 1", underline=0) self.notebook.add('sheet_2', label="Sheet 2", underline=0) self.notebook.add('sheet_3', label="Sheet 3", underline=0) self.notebook.pack() #self.notebook.grid(row=0, column=0) tab1=self.notebook.sheet_1 tab2=self.notebook.sheet_2 tab3=self.notebook.sheet_3 self.myMainContainer = Frame(tab1) self.myMainContainer.pack() #self.myMainContainer.grid(row=0, column=0) scrwin = Tix.ScrolledWindow(self.myMainContainer, scrollbar='y') scrwin.pack() #scrwin.grid(row=0, column=0) self.win = scrwin.window for i in range (100): self.labelList.append((Label(self.win))) self.labelList[-1].config(text= "Bla", relief = SUNKEN) self.labelList[-1].grid(row=i, column=0, sticky=W+E) root = Tix.Tk() myWindow = Window(root) root.mainloop() Whenever I change at least one of the geometry managers from pack() to grid(), the problem occurs. (Actually, I'd prefer using grid() for all containers.) When I don't use the NoteBook widget, the problem does not occur either. The other examples here all seem to rely on pack(). Any ideas? Many thanks, Sano

    Read the article

  • Picker view wont rotate- iPhone

    - by lotuseater
    hi, I am making a booking page. I have included 3 pickers in it. I have included all the delegates required for the pickers to work but it wont rotate. I have enabled user interaction and multitouch in the nib file. Here is my code. Please help me. :( @interface ChooseContactsFrom : UIViewController { IBOutlet UIPickerView *statePickup; IBOutlet UIPickerView *paymentMethodPickup; IBOutlet UIDatePicker *expiryDatePickup; IBOutlet UIView *statePickupView; IBOutlet UIView *paymentMethodPickupView; IBOutlet UIView *expiryDatePickupView; } (void)viewDidLoad { self.title = @"Choose Contacts"; //Fill in the states name/ stateArray = [[NSArray alloc]initWithObjects:@"",nil]; paymentModeArray = [[NSArray alloc] initWithObjects:@"Credit Card", @"Cash",@"Account",@"Voucher",@"Debit Card", nil]; paymentMethodPickup.frame = CGRectMake(0.0, 44.0, paymentMethodPickup.frame.size.width, paymentMethodPickup.frame.size.height); paymentMethodPickup.userInteractionEnabled = YES; paymentMethodPickup.multipleTouchEnabled = YES; paymentMethodPickupView.frame = CGRectMake(0.0, 210.0, paymentMethodPickupView.frame.size.width, paymentMethodPickupView.frame.size.height); statePickup.frame = CGRectMake(0.0, 44.0,statePickup.frame.size.width, statePickup.frame.size.height); statePickupView.frame = CGRectMake(0.0, 210.0, statePickupView.frame.size.width, statePickupView.frame.size.height); stateArray = [[NSArray alloc] initWithObjects:@"state1", @"state2", @"state3", @"state4", @"state5", @"state6", @"state7", @"state8", @"state9", @"state10", nil]; expiryDatePickup.frame = CGRectMake(0.0, 44.0, expiryDatePickup.frame.size.width, expiryDatePickup.frame.size.height); expiryDatePickupView.frame = CGRectMake(0.0, 210.0, expiryDatePickupView.frame.size.width, expiryDatePickupView.frame.size.height); [super viewDidLoad]; } -(IBAction)back:(id)sender { [self dismissModalViewControllerAnimated:YES]; } pragma mark pickerView delegates (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { return 1; } (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component { if( thePickerView == statePickup) { return [stateArray count]; } else if(thePickerView == paymentMethodPickup) { return [paymentModeArray count]; } else { return 0; } } (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { if(thePickerView == statePickup) { return [stateArray objectAtIndex:row]; } else if(thePickerView == paymentMethodPickup) { return [paymentModeArray objectAtIndex:row]; } else { return @" "; } } (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component{ return 50; } (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component { return 250; } (void)pickerView:(UIPickerView *)thepickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { if(thepickerView == statePickup) { state.text=[stateArray objectAtIndex:row]; } if(thepickerView == paymentMethodPickup) { payment.text=[paymentModeArray objectAtIndex:row]; } } (void)ClearSubviews { //[firstName resignFirstResponder]; // [lastName resignFirstResponder]; // [email resignFirstResponder]; // [address1 resignFirstResponder]; // [address2 resignFirstResponder]; // [city resignFirstResponder]; // //[state resignFirstResponder]; // [payment resignFirstResponder]; // [creditCard resignFirstResponder]; // [expirydate removeFromSuperview]; // [statePickup removeFromSuperview]; // [paymentMethodPickup removeFromSuperview]; } (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { // [self showPicker:textField]; //[self setViewMovedUp]; if(textField == firstName || textField == lastName || textField == email || textField == address1 || textField == address2 ||textField == city) { [self ClearSubviews]; //pickerToolbar.hidden = TRUE; return YES; } else if(textField == payment) { [self ClearSubviews]; [self setViewMovedUp]; [payment setText:[paymentModeArray objectAtIndex:0]]; [self.view insertSubview:paymentMethodPickupView aboveSubview:self.view]; return NO; } else if(textField == state) { [self ClearSubviews]; [self setViewMovedUp]; [state setText:[stateArray objectAtIndex:0]]; [self.view insertSubview:statePickupView aboveSubview:self.view]; return NO; } else if(textField == expirydate) { [self setViewMovedUp]; expiryDatePickup.date = [NSDate date]; NSDate *date1 = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; NSString *strDate=[dateFormatter stringFromDate:date1]; NSString *str=[[NSString alloc] initWithString: strDate]; [expirydate setText:str]; [self.view insertSubview:expiryDatePickupView aboveSubview:self.view]; return NO; } else if(textField == creditCard) { [self ClearSubviews]; [self setViewMovedUp]; return YES; } else { [self ClearSubviews]; return YES; } } -(BOOL)textFieldShouldEndEditing:(UITextField *)textField { return YES; } (void)textFieldDidEndEditing:(UITextField *)textField { if(textField == creditCard) { [self moveDown]; } } (BOOL)textFieldShouldReturn:(UITextField *)textField { [firstName resignFirstResponder]; [lastName resignFirstResponder]; [email resignFirstResponder]; [address1 resignFirstResponder]; [address2 resignFirstResponder]; [city resignFirstResponder]; [creditCard resignFirstResponder]; return YES; } -(IBAction)textFieldDoneEditing:(id)sender { [sender resignFirstResponder]; } ////////----------------------------------------------------------------------- pragma mark move screen (void)setViewMovedUp { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.3]; // Make changes to the view's frame inside the animation block. They will be animated instead // of taking place immediately. CGRect rect = [self.view frame]; // If moving up, not only decrease the origin but increase the height so the view // covers the entire screen behind the keyboard. rect.origin.y -= 50.0f; rect.size.height -= 80.0f; [self.view setFrame:rect]; [UIView commitAnimations]; } -(void)moveDown { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.3]; // Make changes to the view's frame inside the animation block. They will be animated instead // of taking place immediately. CGRect rect = [self.view frame]; rect.origin.y += 50.0f; rect.size.height += 80.0f; [self.view setFrame:rect]; // [UIView setBackgroundColor:[UIColor darkGrayColor]]; [UIView commitAnimations]; } pragma mark Method to show pickers -(void)showPicker:(UITextField *)textField { if(textField == expirydate) { expiryDatePickup .date = [NSDate date]; NSDate *date1 = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; NSString *strDate=[dateFormatter stringFromDate:date1]; NSString *str=[[NSString alloc] initWithString: strDate]; [expirydate setText:str]; [self.view insertSubview:expiryDatePickup aboveSubview:self.view]; } else if(textField == payment) { [payment setText:[paymentModeArray objectAtIndex:0]]; [self.view insertSubview:paymentMethodPickupView aboveSubview:self.view]; } else if(textField == state) { [state setText:[stateArray objectAtIndex:0]]; [self.view insertSubview:statePickupView aboveSubview:self.view]; } } (IBAction)datePickerChanged:(id)sender { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; NSDate *date=expiryDatePickup.date; formattedDateString1 = [dateFormatter stringFromDate:date]; [expirydate setText:formattedDateString1]; NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; unsigned int unitFlags = NSMonthCalendarUnit | NSDayCalendarUnit; components = [gregorian components:unitFlags fromDate:date]; [gregorian release]; } pragma mark done and cancel methods -(IBAction) btnCancelExpiryDate:(id)sender { [self moveDown]; [expirydate setText:@" "]; [expiryDatePickupView removeFromSuperview]; } -(IBAction) btnDoneExpiryDate:(id)sender { [self moveDown]; [expiryDatePickupView removeFromSuperview]; expiryDatePickup .date = [NSDate date]; } -(IBAction)cancelPaymentType:(id)sender { [self moveDown]; [payment setText:@" "]; [paymentMethodPickupView removeFromSuperview]; } -(IBAction)donePaymentType:(id)sender { [self moveDown]; [paymentMethodPickupView removeFromSuperview]; } -(IBAction)doneState:(id)sender { [self moveDown]; [statePickupView removeFromSuperview]; } (IBAction)cancelState:(id)sender; { [self moveDown]; [state setText:@" "]; [statePickupView removeFromSuperview]; }

    Read the article

  • Generated signed X.509 client certificate is invalid (no certificate chain to its CA)

    - by Genady
    I use Bouncy Castle for generation of X.509 client certificates and sing them using a known CA. First I read the CA certificate from the certificate store, generate the client certificate, sign it using the CA. Validation of the certificate is failed doe to the following issue A certificate chain could not be built to a trusted root authority. As I understand this is due to the certificate not being related to the CA. Here is a code sample: public static X509Certificate2 GenerateCertificate(X509Certificate2 caCert, string certSubjectName) { // Generate Certificate var cerKp = kpgen.GenerateKeyPair(); var certName = new X509Name(true,certSubjectName); // subjectName = user var serialNo = BigInteger.ProbablePrime(120, new Random()); X509V3CertificateGenerator gen2 = new X509V3CertificateGenerator(); gen2.SetSerialNumber(serialNo); gen2.SetSubjectDN(certName); gen2.SetIssuerDN(new X509Name(true,caCert.Subject)); gen2.SetNotAfter(DateTime.Now.AddDays(100)); gen2.SetNotBefore(DateTime.Now.Subtract(new TimeSpan(7, 0, 0, 0))); gen2.SetSignatureAlgorithm("SHA1WithRSA"); gen2.SetPublicKey(cerKp.Public); AsymmetricCipherKeyPair akp = DotNetUtilities.GetKeyPair(caCert.PrivateKey); Org.BouncyCastle.X509.X509Certificate newCert = gen2.Generate(caKp.Private); // used for getting a private key X509Certificate2 userCert = ConvertToWindows(newCert,cerKp); if (caCert22.Verify()) // works well for CA { if (userCert.Verify()) // fails for client certificate { return userCert; } } return null; } private static X509Certificate2 ConvertToWindows(Org.BouncyCastle.X509.X509Certificate newCert, AsymmetricCipherKeyPair kp) { string tempStorePwd = "abcd1234"; var tempStoreFile = new FileInfo(Path.GetTempFileName()); try { // store key { var newStore = new Pkcs12Store(); var certEntry = new X509CertificateEntry(newCert); newStore.SetCertificateEntry( newCert.SubjectDN.ToString(), certEntry ); newStore.SetKeyEntry( newCert.SubjectDN.ToString(), new AsymmetricKeyEntry(kp.Private), new[] { certEntry } ); using (var s = tempStoreFile.Create()) { newStore.Save( s, tempStorePwd.ToCharArray(), new SecureRandom(new CryptoApiRandomGenerator()) ); } } // reload key return new X509Certificate2(tempStoreFile.FullName, tempStorePwd); } finally { tempStoreFile.Delete(); } }

    Read the article

  • UIToolBar and iPhone Interface Orientation Problem

    - by Leo
    I am developing an application in iPhone. One view support orientation in portrait and landscape. I have two separate views for both orientation. This view has a UIToolbar at the top. Problem is when I change view back from landscape to portrait, UIToolbar at the top disappears. I want toolbar to come back in its original position when it is rotated back to portrait. This is what I am doing in my program. - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation duration:(NSTimeInterval)duration { if (interfaceOrientation == UIInterfaceOrientationPortrait) { self.view = self.portrait; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(0)); self.view.bounds = CGRectMake(0.0, 0.0, 300.0, 480.0); } else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) { self.view = self.landscape; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(-90)); self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0); } else if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { self.view = self.portrait; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(180)); self.view.bounds = CGRectMake(0.0, 0.0, 300.0, 480.0); } else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) { self.view = self.landscape; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90)); self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0); } } I don't know what am I missing here? Any help would be really appreciated.

    Read the article

  • Check if root ca certificate is installed

    - by Zulakis
    We are having a custom CA for our local-domains. The Root CA certificate is installed on all the corporate machines by default, but sometimes it happens that we have someone here who doesn't have it installed. If the user a) accesses our intranet using http or b) accepts the server-certificate I would like to redirect the user to a site which tells it what happened and how they can install the root CA. The only solution I found was the following: <img src="https://the_site/the_image" onerror="redirectToCertPage()"> This is barely a work-around and not really a solution. It can be triggered by other problems then the missing certificate. Are there any better solutions on how to solve this problem?

    Read the article

  • Help calling def from class.

    - by wtzolt
    Hello, Noob question... class msgbox: def __init__(self, lbl_msg = '', dlg_title = ''): self.wTree = gtk.glade.XML('msgbox.glade') self.wTree.get_widget('dialog1').set_title(dlg_title) self.wTree.get_widget('label1').set_text(lbl_msg) self.wTree.signal_autoconnect( {'on_okbutton1_clicked':self.done} ) def done(self,w): self.wTree.get_widget('dialog1').destroy() class Fun(object): wTree = None def __init__(self): self.wTree = gtk.glade.XML( "main.glade" ) self.wTree.signal_autoconnect( {'on_buttonOne' : self.one,} ) gtk.main() @yieldsleep def one(self, widget, data=None): self.msg = msgbox('Please wait...','') yield 500 self.msg = msgbox().done() # <----------------??? self.msg = msgbox('Done!','') With this i get an error: messageBox().done() TypeError: done() takes exactly 2 arguments (1 given) How can i make the dialog box with "please wait" to close before the second dialog box with "done" appears?? Thank you.

    Read the article

  • Saturated addition of two signed Java 'long' values

    - by finnw
    How can one add two long values (call them x and y) in Java so that if the result overflows then it is clamped to the range Long.MIN_VALUE..Long.MAX_VALUE? For adding ints one can perform the arithmetic in long precision and cast the result back to an int, e.g.: int saturatedAdd(int x, int y) { long sum = (long) x + (long) y; long clampedSum = Math.max((long) Integer.MIN_VALUE, Math.min(sum, (long) Integer.MAX_VALUE)); return (int) clampedSum; } or import com.google.common.primitives.Ints; int saturatedAdd(int x, int y) { long sum = (long) x + (long) y; return Ints.saturatedCast(sum); } but in the case of long there is no larger primitive type that can hold the intermediate (unclamped) sum. Since this is Java, I cannot use inline assembly (in particular SSE's saturated add instructions.) It can be implemented using BigInteger, e.g. static final BigInteger bigMin = BigInteger.valueOf(Long.MIN_VALUE); static final BigInteger bigMax = BigInteger.valueOf(Long.MAX_VALUE); long saturatedAdd(long x, long y) { BigInteger sum = BigInteger.valueOf(x).add(BigInteger.valueOf(y)); return bigMin.max(sum).min(bigMax).longValue(); } however performance is important so this method is not ideal (though useful for testing.) I don't know whether avoiding branching can significantly affect performance in Java. I assume it can, but I would like to benchmark methods both with and without branching. Related: http://stackoverflow.com/questions/121240/saturating-addition-in-c

    Read the article

  • Marquee style progressbar in wxPython

    - by Mridang Agarwalla
    Hi, Could anyone tell me how to implement a marquee style progress bar in wxPython? As stated on MSDN: you can animate it in a way that shows activity but does not indicate what proportion of the task is complete. Thank you. I tried this but it doesn't seem to work. The timer ticks but the gauge doesn't scroll. Any help? import wx import time class MyForm(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, wx.ID_ANY, "Timer Tutorial 1", size=(500,500)) # Add a panel so it looks the correct on all platforms panel = wx.Panel(self, wx.ID_ANY) self.timer = wx.Timer(self) self.Bind(wx.EVT_TIMER, self.update, self.timer) self.gauProgress = wx.Gauge(panel, range=1000, pos=(30, 50), size=(440, 20)) self.toggleBtn = wx.Button(panel, wx.ID_ANY, "Start") self.toggleBtn.Bind(wx.EVT_BUTTON, self.onToggle) def onToggle(self, event): btnLabel = self.toggleBtn.GetLabel() if btnLabel == "Start": print "starting timer..." self.timer.Start(1000) self.toggleBtn.SetLabel("Stop") else: print "timer stopped!" self.timer.Stop() self.toggleBtn.SetLabel("Start") def update(self, event): print "\nupdated: ", print time.ctime() self.gauProgress.Pulse() # Run the program if __name__ == "__main__": app = wx.PySimpleApp() frame = MyForm().Show() app.MainLoop()

    Read the article

  • [self autorelease] not doing dealloc

    - by jonydep
    i have this in the superview: mySubView = [[MySubView alloc] init]; [self addSubview:mySubView]; [mySubView release]; then at some point later, in the sub view, this: [self removeFromSuperview]; when i debug it, i notice that the dealloc for the subview is never called, even though i'm fairly sure the reference count should be 0. any ideas why this might be? thanks.

    Read the article

  • Implicitly invoking parent class initializer

    - by Matt Joiner
    class A(object): def __init__(self, a, b, c): #super(A, self).__init__() super(self.__class__, self).__init__() class B(A): def __init__(self, b, c): print super(B, self) print super(self.__class__, self) #super(B, self).__init__(1, b, c) super(self.__class__, self).__init__(1, b, c) class C(B): def __init__(self, c): #super(C, self).__init__(2, c) super(self.__class__, self).__init__(2, c) C(3) In the above code, the commented out __init__ calls appear to the be the commonly accepted "smart" way to do super class initialization. However in the event that the class hierarchy is likely to change, I have been using the uncommented form, until recently. It appears that in the call to the super constructor for B in the above hierarchy, that B.__init__ is called again, self.__class__ is actually C, not B as I had always assumed. Is there some way in Python-2.x that I can overcome this, and maintain proper MRO when calling super constructors without actually naming the current class?

    Read the article

  • Create signed urls for CloudFront with Ruby

    - by wiseleyb
    History: I created a key and pem file on Amazon. I created a private bucket I created a public distribution and used origin id to connect to the private bucket: works I created a private distribution and connected it the same as #3 - now I get access denied: expected I'm having a really hard time generating a url that will work. I've been trying to follow the directions described here: http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?PrivateContent.html This is what I've got so far... doesn't work though - still getting access denied: def url_safe(s) s.gsub('+','-').gsub('=','_').gsub('/','~').gsub(/\n/,'').gsub(' ','') end def policy_for_resource(resource, expires = Time.now + 1.hour) %({"Statement":[{"Resource":"#{resource}","Condition":{"DateLessThan":{"AWS:EpochTime":#{expires.to_i}}}}]}) end def signature_for_resource(resource, key_id, private_key_file_name, expires = Time.now + 1.hour) policy = url_safe(policy_for_resource(resource, expires)) key = OpenSSL::PKey::RSA.new(File.readlines(private_key_file_name).join("")) url_safe(Base64.encode64(key.sign(OpenSSL::Digest::SHA1.new, (policy)))) end def expiring_url_for_private_resource(resource, key_id, private_key_file_name, expires = Time.now + 1.hour) sig = signature_for_resource(resource, key_id, private_key_file_name, expires) "#{resource}?Expires=#{expires.to_i}&Signature=#{sig}&Key-Pair-Id=#{key_id}" end resource = "http://d27ss180g8tp83.cloudfront.net/iwantu.jpeg" key_id = "APKAIS6OBYQ253QOURZA" pk_file = "doc/pk-APKAIS6OBYQ253QOURZA.pem" puts expiring_url_for_private_resource(resource, key_id, pk_file) Can anyone tell me what I'm doing wrong here?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >