Search Results

Search found 35 results on 2 pages for 'dmitri chubarov'.

Page 2/2 | < Previous Page | 1 2 

  • Ruby on Rails with_option cannot call class method

    - by Dmitri
    I have a problem calling class method from the with_option block with validations: Model: class Model < ActiveRecord::Base attr_accessible :field with_options :if => "<not important>" do |step| ... bunch of validations step.validates :field, :inclusion => {:within => Model.field} end private self.field (1..10) end end And it returns: undefined method `field' for #Class:0x5f394a8 self.class.field also doesn't work. What is wrong with it ? How to fix it ? Big big thanks!

    Read the article

  • How to find out style of NSUserNotification during run-time? Or force close an alert?

    - by Dmitri Shuralyov
    According to "OS X Mountain Lion Release Notes" (https://developer.apple.com/library/mac/#releasenotes/Cocoa/Foundation.html), "The user has ultimate control over what notifications are displayed, and the style (banner, alert, etc). There is no mechanism to override the user preferences." Even though all I want to do is "downgrade" from alert style to banner style... Fine. But can I at least find out whether a notification is of alert or banner style inside the didActivateNotification method? The reason I want to do that is to respond differently according to notification.activationType. When the alert is a banner (which is what I want), clicking its contents is the only possible action, and this both triggers didActivateNotification method and closes the notification banner. When the user chooses alert-style notifications, clicking the alert contents also generates didActivateNotification with the same value of notification.activationType, but it stays on screen instead of going away (it only goes away when the Action button is pressed). I don't want my app to trigger an action repeatedly for the same alert notification, in case the user clicks the content area of an alert notification. An alternative solution would be to force the alert notification bubble to dismiss when the user clicks its contents. Is this possible?

    Read the article

  • Energy Firms Targetted for Sensitive Documents

    - by martin.abrahams
    Numerous multinational energy companies have been targeted by hackers who have been focusing on financial documents related to oil and gas field exploration, bidding contracts, and drilling rights, as well as proprietary industrial process documents, according to a new McAfee report. "It ... speaks to quite a sad state of our critical infrastructure security. These were not sophisticated attacks ... yet they were very successful in achieving their goals," said Dmitri Alperovitch, McAfee's vice president for threat research. Apparently, the attacks can be traced back over several years, creating a sustained security compromise that has provided access to highly sensitive information that is of huge financial value to competitors. The value of IRM as an additional layer of protection is clear. Whether your infrastructure security is in a sad state or is state of the art, breaches are always a possibility - and in any case, a lot of sensitive information is shared with third parties whose infrastructure security might not be as good as yours. IRM protects the individual information assets directly so that, even if infrastructure security is compromised, your critical information is enrypted and trackable and only accessible to authenticated, authorised, audited users. The full McAfee report is available here.

    Read the article

  • DotNetOpenAuth DesktopConsumer with GData help needed

    - by DBa
    Hi folks, I am trying to get DotNetOpenAuth's DesktopConsumer to work with Google, with not much success actually... Here is what I am doing (reduced to essential code parts): myApp = new DesktopConsumer(google, tm); var extraParameters = new Dictionary<string, string> { { "scope", GetScopeUri(Applications.Calendar) }, }; AuthorizeForm af = new AuthorizeForm(); af.setAuthUrl(myApp.RequestUserAuthorization(extraParameters, null, out requestToken)); // This makes a webbrowser control in the AuthorizeForm navigate to the google page //which asks for login and authorization af.ShowDialog(); // Open the form, as modal var accessTokenResponse = myApp.ProcessUserAuthorization(requestToken, af.getVerifier()); // af.getVerifier gets the verificatino code which the user has to copy from the // webbrowser control to a textbox (if he grants the authorization, of course :D) HttpWebRequest req = myApp.PrepareAuthorizedRequest( new MessageReceivingEndpoint( "http://www.google.com/calendar/feeds/default/owncalendars/full", HttpDeliveryMethods.GetRequest ), accessTokenResponse.AccessToken); WebResponse rsp = req.GetResponse(); // Here I get the "401 Unauthorized" exception Any idea what I am doing wrong? Thanks in advance, Dmitri

    Read the article

  • Force freeing memory in PHP

    - by DBa
    Hi everybody, in a PHP program, I sequentially read a bunch of files (with file_get_contents), gzdecode them, json_decode the result, analyze the contents, throw the most of it away, and store about 1% in an array. Unfortunately, with each iteration (I traverse over an array containing the filenames), there seems to be some memory lost (according to memory_get_peak_usage, about 2-10 MB each time). I have double- and triplechecked my code, I am not storing unneded data in the loop (and the needed data hardly exceeds about 10MB overall), but I am frequently rewriting (actually, strings in an array). Apparently, PHP does not free the memory correctly, thus using more and more RAM until it hits the limit. Is there any way to do a forced garbage collection? Or, at least, to find out where the memory is used? Thanks in advance, Dmitri

    Read the article

< Previous Page | 1 2