Search Results

Search found 2682 results on 108 pages for 'michael rut'.

Page 66/108 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • CSS [custom?] attributes

    - by Michael
    radio[pane] { list-style-image: url("jar:resource:///chrome/classic.jar! /skin/classic/browser/preferences/Options.png"); } radio[pane="prefpane-appearance"] { -moz-image-region: rect(0px, 32px, 32px, 0px); } radio[pane="prefpane-appearance"]:hover, radio[pane="prefpane-appearance"][selected="true"] { -moz-image-region: rect(32px, 32px, 64px, 0px); } Can anyone explain a syntax of this css, particularly what is pane.. I couldn't find such attribute for radio element in context of XUL. So I guess it's some custom attribute? If it is, then how it is evolving through the lines, first declaration, then several assignments? It has also selected, which means can have multiple custom attributes? How can those attributes be used later?

    Read the article

  • When does post-update get called (GIT)

    - by Michael
    My git setup was working beautifully, then stopped cooperating today. Right now, I can git-pull, git commit just fine from my local machine. When I git push, the push goes through, but the server files don't actually get updated. Now I wonder, is my post-update file even getting called anymore? I've checked the permissions, and they are all group +x, and I'm a part of the group... any other suggestions?

    Read the article

  • Add blank cell at end of UITable

    - by Michael
    I'm trying to add an additional cell for custom content as the last cell in a tableView, without altering the dictionary that creates the other content of the table. I think the place to add it is in cellForRowAtIndexPath rather than adding one to the numberOfRowsInSection, which just crashes if I do. I get a cellCount from the dictionary that creates the data for the table, then in cellForRowAtIndexPath, I have: if (indexPath.row == cellCount) { ... stuff goes here return cell; } of course, this never gets called. If I do if (indexPath.row == cellCount -1) it overwrites the last cell with content. I can get this to work if I add a blank entry into the xml from which I am populating the dictionary, but that's ugly. Example code would be neat!

    Read the article

  • What's a clean way to break up a DataTable into chunks of a fixed size with Linq?

    - by Michael Haren
    Update: Here's a similar question Suppose I have a DataTable with a few thousand DataRows in it. I'd like to break up the table into chunks of smaller rows for processing. I thought C#3's improved ability to work with data might help. This is the skeleton I have so far: DataTable Table = GetTonsOfData(); // Chunks should be any IEnumerable<Chunk> type var Chunks = ChunkifyTableIntoSmallerChunksSomehow; // ** help here! ** foreach(var Chunk in Chunks) { // Chunk should be any IEnumerable<DataRow> type ProcessChunk(Chunk); } Any suggestions on what should replace ChunkifyTableIntoSmallerChunksSomehow? I'm really interested in how someone would do this with access C#3 tools. If attempting to apply these tools is inappropriate, please explain! Update 3 (revised chunking as I really want tables, not ienumerables; going with an extension method--thanks Jacob): Final implementation: Extension method to handle the chunking: public static class HarenExtensions { public static IEnumerable<DataTable> Chunkify(this DataTable table, int chunkSize) { for (int i = 0; i < table.Rows.Count; i += chunkSize) { DataTable Chunk = table.Clone(); foreach (DataRow Row in table.Select().Skip(i).Take(chunkSize)) { Chunk.ImportRow(Row); } yield return Chunk; } } } Example consumer of that extension method, with sample output from an ad hoc test: class Program { static void Main(string[] args) { DataTable Table = GetTonsOfData(); foreach (DataTable Chunk in Table.Chunkify(100)) { Console.WriteLine("{0} - {1}", Chunk.Rows[0][0], Chunk.Rows[Chunk.Rows.Count - 1][0]); } Console.ReadLine(); } static DataTable GetTonsOfData() { DataTable Table = new DataTable(); Table.Columns.Add(new DataColumn()); for (int i = 0; i < 1000; i++) { DataRow Row = Table.NewRow(); Row[0] = i; Table.Rows.Add(Row); } return Table; } }

    Read the article

  • Firefox extension dev: observing preferences, avoid multiple notifications

    - by Michael
    Let's say my Firefox extension has multiple preferences, but some of them are grouped, like check interval, fail retry interval, destination url. Those are used in just single function. When I subscribe to preference service and add observer, the observe callback will be called for each changed preference, so if by chance user changed all of the settings in group, then I will have to do the same routine for the same subsystem as many times as I have items in that preferences group. It's a great redundancy! What I want is observe to be called just once for group of preferences. Say extensions.myextension.interval1 extensions.myextension.site extensions.myextension.retry so if one or all of those preferences are changed, I receive only 1 notification about it. In other words, no matter how many preferences changed in branch, I want the observe callback to called once.

    Read the article

  • php preg_match pattern to extract a specific information, regex

    - by Michael
    I need to extract a specific Id from a html document but the problem is that the id must not "be used". Here is the html content http://pastebin.com/wF2dx8JZ As you may see there are different html blocks . Some of them contain the "Used" word so I need to extract only the first id which is not used. Basically I can write a simple pattern like : $pattern = "/javascript:tw(.*))/"; preg_match_all($pattern, $content, $matches); $id = $matches[1][0]; However in this case I'm also getting the "ids" which are used so I don't know how to exclude them from the equation . Any idea would be highly appreciated.

    Read the article

  • JBoss Clustered Service that sends emails from txt file

    - by michael lucas
    I need a little push in the right direction. Here's my problem: I have to create an ultra-reliable service that sends email messages to clients whose addresses are stored in txt file on FTP server. Single txt file may contain unlimited number of entries. Most often the file contains about 300,000 entries. Service exposes interface with just two simple methods: TaskHandle sendEmails(String ftpFilePath); ProcessStatus checkProcessStatus(TaskHandle taskHandle); Method sendEmails() returns TaskHandle by which we can ask for ProcessStatus. For such a service to be reliable clustering is necessary. Processing single txt file might take a long time. Restarting one node in a cluster should have no impact on sending emails. We use JBoss AS 4.2.0 which comes with a nice HASingletonController that ensure one instance of service is running at given time. But once a fail-over happens, the second service should continue work from where the first one stopped. How can I share state between nodes in a cluster in such a way that leaves no possibility of sending some emails twice?

    Read the article

  • How can I create a MethodInfo from an Action delegate

    - by Michael Meadows
    I am trying to develop an NUnit addin that dynamically adds test methods to a suite from an object that contains a list of Action delegates. The problem is that NUnit appears to be leaning heavily on reflection to get the job done. Consequently, it looks like there's no simple way to add my Actions directly to the suite. I must, instead, add MethodInfo objects. This would normally work, but the Action delegates are anonymous, so I would have to build the types and methods to accomplish this. I need to find an easier way to do this, without resorting to using Emit. Does anyone know how to easily create MethodInfo instances from Action delegates?

    Read the article

  • Best way to implement refusing a value change by the user in Swing?

    - by Michael Borgwardt
    I have a JCheckBox that should not be checked by the user when a certain other field is empty. So now I want to have an error popup and then reset the checkbox (I've considered disabling the checkbox, but the connection to the other field is non-obvious, and a tooltip text IMO not visible enough). What's the correct way to do that in Swing? Through a PropertyVetoException? Where do I throw it and where do I catch it? My first (probably ugly) idea would be to add a ChangeListener that itself shows the popup and resets the value.

    Read the article

  • declarative authorization and has_and_belongs_to_many

    - by Michael Balsiger
    Hi, I have a little problem with declarative-authorization. I have a User and Role Model with a has_and_belongs_to_many association. I've created a Role named :moderator in my authorization_rules.rb Is it possible that a User with the Role Moderator only gets the Users that have the Moderator Role assigned to it?? -- User.with_permissions_to(:index) I thought it would be possible like that: role :moderator do has_permission_on :users, :to => :index do if_attribute :roles => contains { ????? } end end I also created a named_scope in my User Model because I thought it would help... class User has_and_belongs_to_many :roles named_scope :by_role, lambda { |role| { :include => :roles, :conditions => {"roles.name" => role} } } end Does anyone knows if it's possible to do this with declarative_authorization? Thanks for your help!

    Read the article

  • Can Visual Studio 2010 Test .net 3.5 SP1 Projects?

    - by Michael Stum
    I have some projects in a solution that are running on .net 3.5 SP1 (and can never ever be updated to 4.0 as they are SharePoint projects). When I try to create a new Visual C# Test Project in VS2010 Premium, I have to choose .net 4.0 which is apparently intended. Now I don't care about what my Unit Test project is (don't have to care about VS2008 users), but I do care if I can safely test 3.5 Projects in it due to the different CLRs and slight C# language differences?

    Read the article

  • Is there a way to use the OSX cocoa NSApplication method activateIgnoringOtherApps: to activate an a

    - by Michael Minerva
    This may be a dumb question but it seems like activateIgnoringOtherApps: may be the only way to activate an app using Cocoa. I have a java app that loads up a Cocoa app and I want the Cocoa app to be activated when this happens. The problem is I do not want to have to launch an intermediate app (some sort of controller) and use this app to activateIgnoringOtherApps: my other Cocoa app. Is there some way to use activateIgnoringOtherApps: to force my Cocoa app to become active?

    Read the article

  • Javascript : assign variable in if condition statement, good practice or not?

    - by Michael Mao
    Hi all: I moved one years ago from classic OO languages such like Java to Javascript. The following code is definitely not recommended (or even not correct) in Java: if(dayNumber = getClickedDayNumber(dayInfo)) { alert("day number found"); } function getClickedDayNumber(dayInfo) { dayNumber = dayInfo.indexOf("fc-day"); if(dayNumber != -1) //substring found { //normally any calendar month consists of "40" days, so this will definitely pick up its day number. return parseInt(dayInfo.substring(dayNumber+6, dayNumber+8)); } else return false; } Basically I just found out that I can assign a variable to a value in an if condition statement, and immediately check the assigned value as if it is boolean. For a safer bet, I usually separate that into two lines of code, assign first then check the variable, but now that I found this, I am just wondering whether is it good practice or not in the eyes of experienced javascript developers? Many thanks in advance.

    Read the article

  • Puzzled with nib files...

    - by Michael
    I know nib files are serialized objects and they have owner, outlets to make connections. Using XCode Navigation window template I created application, which in its order created 2 nib files - MainWindow and SecondView. I can't understand how MainWindow is referring to SecondView, there is no connection between those two as far as I can see. SecondView's owner is UIViewController and in MainWindow there is a navigation tab which is also UIViewController. But how they are connected in IB I can't understand... Also I don't understand who is instanciating MainWindow's owner object and where that object is being kept, where is the variable which is UIApplication myApp = [[UIApplication alloc] init]. If I create 10 nib files with UIViewController owner, who will trigger their deserialization? If some class is nib file's owner, what is the essential responsibilities of that class? Is it deserializing nib file into memory? Sorry for unorganized questions, I've been reading numerous articles and docs about nib files, but it is still confusing.

    Read the article

  • Yes, another thread question...

    - by Michael
    I can't understand why I am loosing control of my GUI even though I am implementing a thread to play a .wav file. Can someone pin point what is incorrect? #!/usr/bin/env python import wx, pyaudio, wave, easygui, thread, time, os, sys, traceback, threading import wx.lib.delayedresult as inbg isPaused = False isStopped = False class Frame(wx.Frame): def __init__(self): print 'Frame' wx.Frame.__init__(self, parent=None, id=-1, title="Jasmine", size=(720, 300)) #initialize panel panel = wx.Panel(self, -1) #initialize grid bag sizer = wx.GridBagSizer(hgap=20, vgap=20) #initialize buttons exitButton = wx.Button(panel, wx.ID_ANY, "Exit") pauseButton = wx.Button(panel, wx.ID_ANY, 'Pause') prevButton = wx.Button(panel, wx.ID_ANY, 'Prev') nextButton = wx.Button(panel, wx.ID_ANY, 'Next') stopButton = wx.Button(panel, wx.ID_ANY, 'Stop') #add widgets to sizer sizer.Add(pauseButton, pos=(1,10)) sizer.Add(prevButton, pos=(1,11)) sizer.Add(nextButton, pos=(1,12)) sizer.Add(stopButton, pos=(1,13)) sizer.Add(exitButton, pos=(5,13)) #initialize song time gauge #timeGauge = wx.Gauge(panel, 20) #sizer.Add(timeGauge, pos=(3,10), span=(0, 0)) #initialize menuFile widget menuFile = wx.Menu() menuFile.Append(0, "L&oad") menuFile.Append(1, "E&xit") menuBar = wx.MenuBar() menuBar.Append(menuFile, "&File") menuAbout = wx.Menu() menuAbout.Append(2, "A&bout...") menuAbout.AppendSeparator() menuBar.Append(menuAbout, "Help") self.SetMenuBar(menuBar) self.CreateStatusBar() self.SetStatusText("Welcome to Jasime!") #place sizer on panel panel.SetSizer(sizer) #initialize icon self.cd_image = wx.Image('cd_icon.png', wx.BITMAP_TYPE_PNG) self.temp = self.cd_image.ConvertToBitmap() self.size = self.temp.GetWidth(), self.temp.GetHeight() wx.StaticBitmap(parent=panel, bitmap=self.temp) #set binding self.Bind(wx.EVT_BUTTON, self.OnQuit, id=exitButton.GetId()) self.Bind(wx.EVT_BUTTON, self.pause, id=pauseButton.GetId()) self.Bind(wx.EVT_BUTTON, self.stop, id=stopButton.GetId()) self.Bind(wx.EVT_MENU, self.loadFile, id=0) self.Bind(wx.EVT_MENU, self.OnQuit, id=1) self.Bind(wx.EVT_MENU, self.OnAbout, id=2) #Load file usiing FileDialog, and create a thread for user control while running the file def loadFile(self, event): foo = wx.FileDialog(self, message="Open a .wav file...", defaultDir=os.getcwd(), defaultFile="", style=wx.FD_MULTIPLE) foo.ShowModal() self.queue = foo.GetPaths() self.threadID = 1 while len(self.queue) != 0: self.song = myThread(self.threadID, self.queue[0]) self.song.start() while self.song.isAlive(): time.sleep(2) self.queue.pop(0) self.threadID += 1 def OnQuit(self, event): self.Close() def OnAbout(self, event): wx.MessageBox("This is a great cup of tea.", "About Jasmine", wx.OK | wx.ICON_INFORMATION, self) def pause(self, event): global isPaused isPaused = not isPaused def stop(self, event): global isStopped isStopped = not isStopped class myThread (threading.Thread): def __init__(self, threadID, wf): self.threadID = threadID self.wf = wf threading.Thread.__init__(self) def run(self): global isPaused global isStopped self.waveFile = wave.open(self.wf, 'rb') #initialize stream self.p = pyaudio.PyAudio() self.stream = self.p.open(format = self.p.get_format_from_width(self.waveFile.getsampwidth()), channels = self.waveFile.getnchannels(), rate = self.waveFile.getframerate(), output = True) self.data = self.waveFile.readframes(1024) isPaused = False isStopped = False #main play loop, with pause event checking while self.data != '': # while isPaused != True: # if isStopped == False: self.stream.write(self.data) self.data = self.waveFile.readframes(1024) # elif isStopped == True: # self.stream.close() # self.p.terminate() self.stream.close() self.p.terminate() class App(wx.App): def OnInit(self): self.frame = Frame() self.frame.Show() self.SetTopWindow(self.frame) return True def main(): app = App() app.MainLoop() if __name__=='__main__': main()

    Read the article

  • Private Java class properties mysteriously reset between method calls....

    - by Michael Jones
    I have a very odd problem. A class property is mysteriously reset between method calls. The following code is executed so the constructor is called, then the parseConfiguration method is called. Finally, processData is called. The parseConfiguration method sets the "recursive" property to "true". However, as soon as it enters "processData", "recursive" becomes "false". This problem isn't isolated to a single class -- I have several examples of this in my code. How can this possibly be happening? I've tried initialising properties when they're declared outside any methods, I've tried initialising them in constructors... nothing works. The only complication I can think of here is that this class is invoked by an object that runs in a thread -- but here is one instance per thread, so surely no chance that threads are interfering. I've tried setting both methods to "synchronized", but this still happens. Please help! /** * This class or its superclasses are NOT threaded and don't extend Thread */ public class DirectoryAcquirer extends Manipulator { /** * @var Whether to recursively scan directories */ private boolean recursive = false; /** * Constructor */ public DirectoryAcquirer() { } /** * Constructor that initialises the configuration * * @param config * @throws InvalidConfigurationException */ public DirectoryAcquirer(HierarchicalConfiguration config) throws InvalidConfigurationException { super(config); } @Override protected void parseConfiguration() throws InvalidConfigurationException { // set whether to recurse into directories or not if (this.config.containsKey("recursive")) { // this.recursive gets set to "true" here this.recursive = this.config.getBoolean("recursive"); } } @Override public EntityCollection processData(EntityCollection data) { // here this.recursive is "false" this.logger.debug("processData: Entered method"); } }

    Read the article

  • How to scale an Image in ImageView to keep the aspect ratio

    - by michael
    Hi, In android, I defined an ImageView's layoutWidth to be 'fill_parent' (which takes up the full width of the phone). My question is if the Image i put to ImageView is bigger than the layoutWidth, android will scale it, right? But what about the height? when android scale it, will it keeps the aspect ratio? What I find out is, there is some 'white space' at the top/bottom of the ImageView when android scales an image which is bigger than the ImageView. Is that true? If yes, how can I eliminate that white spaces? Thank you.

    Read the article

  • Easy way to add multiple existing .csproj to a Visual Studio Solution?

    - by Michael J Swart
    I've checked out a branch of C# code from source control. It contains maybe 50 projects in various folders. There's no existing .sln file to be found. I intended to create a blank solution to add existing solutions. The UI only lets me do this one project at a time. Is there something I'm missing? I'd like to specify a list of *.csproj files and somehow come up with a .sln file that contains all the projects.

    Read the article

  • A popup button with a static image (Cocoa OSX)

    - by Michael Minerva
    I am trying to make a popup button that always displays a + as its image and when you click on it, a context menu pops up that will allow you to decide what type of object you want to add. Is there anyway to do this using an NSPopupButton? I saw in the specs for NSPopupButotn that the method SetImage has no effect so it seems that this is likely not going to work using this class. Is this correct?

    Read the article

  • MySQL Select statement Where table1.id != table2.id

    - by Michael
    I have a table of data which has posts, then I have a separate table of data which has deleted posts. What happens when a post is deleted is that it's ID get's added to the deleted table rather than removing the post entry. What is a clean efficient way of selecting all the posts from the posts table without selecting the ones that have their ID in the deleted table

    Read the article

  • Perl : get substring which matches refex error

    - by Michael Mao
    Hi all: I am very new to Perl, so please bear with my simple question: Here is the sample output: Most successful agents in the Emarket climate are (in order of success): 1. agent10896761 ($-8008) 2. flightsandroomsonly ($-10102) 3. agent10479475hv ($-10663) Most successful agents in the Emarket climate are (in order of success): 1. agent10896761 ($-7142) 2. agent10479475hv ($-8982) 3. flightsandroomsonly ($-9124) I am interested only in agent names as well as their corresponding balances, so I am hoping to get the following output: agent10896761 -8008 flightsandroomsonly -10102 agent10479475hv -10663 agent10896761 -7142 agent10479475hv -8982 flightsandroomsonly -9124 For later processes. This is the code I've got so far: #!/usr/bin/perl -w open(MYINPUTFILE, $ARGV[0]); while(<MYINPUTFILE>) { my($line) = $_; chomp($line); # regex match test if($line =~ m/agent10479475/) { if($line =~ m/($-[0-9]+)/) { print "$1\n"; } } if($line =~ m/flightsandroomsonly/) { print "$line\n"; } } The second regex match has nothing wrong, 'cause that is printing out the whole line. However, for the first regex match, I've got some other output such like: $ ./compareResults.pl 3.txt 2. flightsandroomsonly ($-10102) 0479475 0479475 3. flightsandroomsonly ($-9124) 1. flightsandroomsonly ($-8053) 0479475 1. flightsandroomsonly ($-6126) 0479475 If I "escape" the braces like this if($line =~ m/\($-[0-9]+\)/) { print "$1\n"; } Then there is never a match for the first regex... So I stuck with a problem of making that particular regex work. Any hints for this? Many thanks in advance.

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >