Search Results

Search found 511 results on 21 pages for 'sean h'.

Page 12/21 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • What is Ruby's analog to Python Metaclasses?

    - by Sean Copenhaver
    Python has the idea of metaclasses that, if I understand correctly, allow you to modify an object of a class at the moment of construction. You are not modifying the class, but instead the object that is to be created then initialized. Python (at least as of 3.0 I believe) also has the idea of class decorators. Again if I understand correctly, class decorators allow the modifying of the class definition at the moment it is being declared. Now I believe there is an equivalent feature or features to the class decorator in Ruby, but I'm currently unaware of something equivalent to metaclasses. I'm sure you can easily pump any Ruby object through some functions and do what you will to it, but is there a feature in the language that sets that up like metaclasses do? So again, Does Ruby have something similar to Python's metaclasses? Edit I was off on the metaclasses for Python. A metaclass and a class decorator do very similar things it appears. They both modify the class when it is defined but in different manners. Hopefully a Python guru will come in and explain better on these features in Python. But a class or the parent of a class can implement a __new__(cls[,..]) function that does customize the construction of the object before it is initialized with __init__(self[,..]).

    Read the article

  • Changing Name Associated With Past Commits In Mercurial

    - by Sean M
    A friend recently had the occasion for a legal name change, which made me wonder about how to cope with that in a development environment, especially in regards to source control. Their legal name changed, so naturally their login name and associated identity stuff changed. If they were a team member of mine, I'd like to change the record of their past commits to the project to be consistent with their new name. Is that possible in Mercurial? In other version control systems?

    Read the article

  • Why doesn't the F# Set implement ISet<T>?

    - by Sean Devlin
    The .NET Framework is adding an ISet<T> interface with the 4.0 release. In the same release, F# is being added as a first-class language. F# provides an immutable Set<'T> class. It would seem logical to me that the immutable set provided would implement the ISet<T> interface, but it doesn't. Does anyone know why? My guess is that they didn't want to implement an interface intended to be mutable, but I don't think this explanation holds up. After all, their Map<'Key, 'Value> class implements IDictionary, which is mutable. And there are examples elsewhere in the framework of classes implementing interfaces that are only partially appropriate. My other thought is that ISet<T> is new, so maybe they didn't get around to it. But that seems kind of thin. Does the fact that ISet<T> is generic (v. IDictionary, which is not) have anything to do with it? Any thoughts on the matter would be appreciated.

    Read the article

  • C# - Angle between two 2d vectors, diff between two methods?

    - by Sean Ochoa
    Hey all. I've got this code snippet, and I'm wondering why the results of the first method differ from the results of the second method, given the same input? public double AngleBetween_1(vector a, vector b) { var dotProd = a.Dot(b); var lenProd = Len*b.Len; var divOperation = dotProd/lenProd; return Math.Acos(divOperation) * (180.0 / Math.PI); } public double AngleBetween_2(vector a, vector b) { var dotProd = a.Dot(b); var lenProd = Len*b.Len; var divOperation = dotProd/lenProd; return (1/Math.Cos(divOperation)) * (180.0 / Math.PI); }

    Read the article

  • YUI "Get" utility to parse JSON response?

    - by Sean
    The documentation page for the YUI "Get" utility says: Get Utility is ideal for loading your own scripts or CSS progressively (lazy-loading) or for retrieving cross-domain JSON data from sources in which you have total trust. ...but doesn't have any actual examples for how to do so. Their one example doesn't actually request a JSON document from a remote server, but instead a document containing actual JavaScript along with the JSON data. I'm just interested in the JSON response from the Google Maps API HTTP (REST) interface. Because I can't do cross-site scripting with the "Connect" utility, I am trying the "Get" utility. But merely inserting some JSON data into the page isn't going to do anything, of course. I have to assign it to a variable. But how? Also, just inserting JSON data into the page makes Firefox complain that there's a JavaScript error. And understandably! Plain ol' JSON data isn't going to parse as valid JavaScript. Any ideas?

    Read the article

  • Formatted text encoding in binary plist

    - by Sean
    I'm trying to do some scripting that edits a binary plist file. The plist describes the objects contained in a DVD studio pro file. It appears that a text box in DVD studio pro is encoded in the plist as hex data that describes the text string along with its formatting. I can't seem to figure out how to understand this data. Ideally, I'd like to be able to alter the text string but not the formatting. The following seems to describe a text box that says "Menu title here". There are two hex strings, one with the key called "dictionary" and the other called "string"; both are CFData. Any ideas how I can parse this or convert this into a format that I can edit directly? I've been playing around with writing a little converter in cocoa, but no luck yet. <dict> <key>Dictionary</key> <data> BAtzdHJlYW10 eXBlZIHoA4QB QISEhAxOU0Rp Y3Rpb25hcnkA hIQITlNPYmpl Y3QAhYQBaQaS hISECE5TU3Ry aW5nAZSEASsG TlNGb250hpKE hIQGTlNGb250 HpSVJIQFWzM2 Y10GAAAAGgAA AP/+TAB1AGMA aQBkAGEARwBy AGEAbgBkAGUA AACEAWYVhAFj AJsBmwCbAIaS hJaXB05TQ29s b3KGkoSEhAdO U0NvbG9yAJSb AYQEZmZmZoPz 8nI/g/Dvbz+D 7OtrPwGGkoSW lwtOU0V4cGFu c2lvboaShISE CE5TTnVtYmVy AISEB05TVmFs dWUAlIQBKoSa moNHx9c9hpKE lpcNTlNPYmxp cXVlbmVzc4aS hJ6ghIQBZKEA hpKElpcQTlNQ YXJhZ3JhcGhT dHlsZYaShISE EE5TUGFyYWdy YXBoU3R5bGUA lIQEQ0NAUwAA hQCGkoSWlxFO U0JhY2tncm91 bmRDb2xvcoaS hJubA4QCZmYA AIaG </data> <key>String</key> <data> BAtzdHJlYW10 eXBlZIHoA4QB QISEhBJOU0F0 dHJpYnV0ZWRT dHJpbmcAhIQI TlNPYmplY3QA hZKEhIQITlNT dHJpbmcBlIQB Kw9OZW51IFRp dGxlIEhlcmWG hAJpSQEPkoSE hAxOU0RpY3Rp b25hcnkAlIQB aQWShJaWDU5T T2JsaXF1ZW5l c3OGkoSEhAhO U051bWJlcgCE hAdOU1ZhbHVl AJSEASqEhAFk nQCGkoSWlgtO U0V4cGFuc2lv boaShJuchIQB Zp6DR8fXPYaS hJaWEE5TUGFy YWdyYXBoU3R5 bGWGkoSEhBBO U1BhcmFncmFw aFN0eWxlAJSE BENDQFMAAIUA hpKElpYGTlNG b250hpKEhIQG TlNGb250HpSZ JIQFWzM2Y10G AAAAGgAAAP/+ TAB1AGMAaQBk AGEARwByAGEA bgBkAGUAAACe FYQBYwCjAaMA owCGkoSWlgdO U0NvbG9yhpKE hIQHTlNDb2xv cgCUowGEBGZm ZmaD8/JyP4Pw 728/g+zraz8B hoaG </data> </dict>

    Read the article

  • How to override the behavior of Input type="file" Browse button?

    - by jay sean
    Hi All, I need to change the locale/language of the browse button in input type="file" We have a special function to change the locale of any text to the browser language such as en-US es-MX etc. Say changeLang("Test"); // This will display test in Spanish if the browser // locale is es-MX What I need to do is to change the language of the browse button. Since it is not displayed, I can't code it like changeLang("Browse..."); That's why I need to get the code of this input type and override so that I can apply my function to Browse text. It will be appreciated if you can give a solution for this. Thanks! Jay...

    Read the article

  • WCF service with 2 Bindings and 2 Base Addresses

    - by Sean
    I have written a WCF service (I am a newb) that I want to provide 2 endpoints for (net.tcp & basicHttp) The problem comes when I try to configure the endpoints. If I configure them as seperate services, then my service names are the same which causes a problem. I have seen recomended creating shim classes (classA : MyService, and ClassB : MyService) but that seems smelly. <services> <service name="MyWcfService.MyService" behaviorConfiguration="MyWcfService.HttpBehavior"> <endpoint name="ApplicationHttp" address="Application" binding="basicHttpBinding" bindingConfiguration="HttpBinding" contract="MyWcfService.Interfaces.IMyService" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://localhost:8731/MyWcfService/" /> </baseAddresses> </host> </service> <service name="MyWcfService.MyService" behaviorConfiguration="MyWcfService.MyBehavior"> <endpoint name="Application" address="Application" binding="netTcpBinding" bindingConfiguration="SecuredByWindows" contract="EmsHistorianService.Interfaces.IApplicationHistorianService" /> <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:49153/MyWcfService" /> </baseAddresses> </host> </service> </services> I have tried using a single service with the base address integrated into the address, but that gives me errors as well <services> <service name="MyWcfService.MyService" behaviorConfiguration="MyWcfService.HttpBehavior"> <endpoint name="ApplicationHttp" address="http://localhost:8731/MyWcfService/Application" binding="basicHttpBinding" bindingConfiguration="HttpBinding" contract="MyWcfService.Interfaces.IMyService" /> <endpoint address="http://localhost:8731/MyWcfService/mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <endpoint name="Application" address="net.tcp://localhost:49153/MyWcfService/Application" binding="netTcpBinding" bindingConfiguration="SecuredByWindows" contract="EmsHistorianService.Interfaces.IApplicationHistorianService" /> <endpoint address="net.tcp://localhost:49153/MyWcfService/mex" binding="mexTcpBinding" contract="IMetadataExchange" /> </service> </services> Any ideas?

    Read the article

  • .net framework execution aborted while executing CLR sproc?

    - by Sean Ochoa
    I constructed a sproc that does the equivalent of FOR XML AUTO in SQL 2008. Now that I'm testing it, it gives me a really unhelpful error msg. Any idea what this error means? Msg 10329, Level 16, State 49, Procedure ForXML, Line 0 .Net Framework execution was aborted. System.Threading.ThreadAbortException: Thread was being aborted. System.Threading.ThreadAbortException: at System.Runtime.InteropServices.Marshal.PtrToStringUni(IntPtr ptr, Int32 len) at System.Data.SqlServer.Internal.CXVariantBase.WSTRToString() at System.Data.SqlServer.Internal.SqlWSTRLimitedBuffer.GetString(SmiEventSink sink) at System.Data.SqlServer.Internal.RowData.GetString(SmiEventSink sink, Int32 i) at Microsoft.SqlServer.Server.ValueUtilsSmi.GetValue(SmiEventSink_Default sink, ITypedGettersV3 getters, Int32 ordinal, SmiMetaData metaData, SmiContext context) at Microsoft.SqlServer.Server.ValueUtilsSmi.GetValue200(SmiEventSink_Default sink, SmiTypedGetterSetter getters, Int32 ordinal, SmiMetaData metaData, SmiContext context) at System.Data.SqlClient.SqlDataReaderSmi.GetValue(Int32 ordinal) at System.Data.SqlClient.SqlDataReaderSmi.GetValues(Object[] values) at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values) at System.Data.ProviderBase.SchemaMapping.LoadDataRow() at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at ForXML.GetXML...

    Read the article

  • Should I use PHP or PHP + J2EE?

    - by Sean Xiong
    I'm going to start a new project with instant message support. I find that there is no good long polling solution in PHP, but there is some good ones in J2EE. I'm wondering if I can integrate PHP and J2EE to get the function? Or should I just use J2EE instead of PHP? Thanks.

    Read the article

  • Does disabling third party cookies also disable cookies created by third party javasript?

    - by Sean
    When a page includes third party javascript (via script src=...) and that javascript that sets a cookie, that cookie "becomes" a first party cookie, even though it's originally set by a third party source. My question is this. If someone has disabled third party cookies in their browser, does that also apply cookies set by third party javascript? Or does it only block cookies that are explicitly set in the headers for requests to the third party domain? And either way, do all browsers handle this the exact same way or do some block javascript cookies but others allow it?

    Read the article

  • Creating stub objects that can be "claimed"

    - by Sean Johnson
    I'm working with a client on a rails project that wants to have a user model with 'stub' accounts that are created by an administrator, but that can later be claimed by the actual user, with authentication enabled on that user once the owner has claimed it. Was wondering if anyone has done this before, and what the best approach would be. We're currently using Authlogic to handle authentication.

    Read the article

  • Facebook Connect Publish to Stream: how do I tag a user?

    - by Sean Cannon
    I have an application that allows martial arts trickers to 'battle' each other by initiating challenges and submitting videos and whatnot. When user A challenges user B, the application posts to the user's wall (the one who initiated the challenge). My question is how do I tag user B in the wall post? It essentially says "challenged John Do to a battle". I'd like "John Do" to link to his profile just like when you manually post something on your wall and use the @ symbol. I hope this makes sense. I've tried standard html for a link, and I've tried FBML. Neither are parsed and only render as plain text on the wall post. Thanks for any help!

    Read the article

  • Web Application within a Web Site in Visual Studio?

    - by Sean
    Visual Studio allows you to make "Web Sites" and "Web Applications", but, inside a project, can you have one within the other? Say I have my website "www.mysite.com" and I have an application called "BudgetCalculator". One the production server, this is supposed to be located at: www.mysite.com/BudgetCalculator And the BudgetCalculator app contains links back to other parts of the website, like "/page1" and "/page2". However in Visual Studio, when they're listed as two different projects, they're on the same level. When I fire up the debugger for the BudgetCalculator app, those links aren't going to point back to the main website, like they should. Is there a way around this?

    Read the article

  • Flex: Can I assign propertiy of multi-layer object to Chart's xField or yField?

    - by Sean Chen
    Hi, I have a question about how to assign property of a multi-layer object to Chart's xField or yField. For example: var obj:Object = new Object(); var store:Object = new Object(); store.store1 = 300; store.store2 = 200; store.store3 = 250; obj.date = "2010/04/26"; obj.count = 2; obj.store = store; Because I have to draw multiple LineSeries, the yField on different series must be assigned to obj.store.store1~store3. How can I set yField in different layer of object?

    Read the article

  • Multiple complete HTTP requests stuck in TCP CLOSE_WAIT state

    - by Sean Owen
    I have a Java and Tomcat-based server application which initiates many outbound HTTP requests to other web sites. We use Jakarta's HTTP Core/Client libraries, very latest versions. The server locks up at some point since all its worker threads are stuck trying to close completed HTTP connections. Using 'lsof' reveals a bunch of sockets stuck in TCP CLOSE_WAIT state. This doesn't happen for all, or even most connections. In fact, I saw it before and resolved it by making sure to set the Connection: Close response header. So that makes me think it may be bad behavior of remote servers. It may have come up again since I moved the app to a totally new service provider -- different OS, network situation. But, I am still at a loss as to what I could do, if anything, to work around this. Some poking around on the internet didn't turn up anything I'm not already doing. Just thought I'd ask if anyone has seen and solved this?

    Read the article

  • Dragging a copy of all selected elements from a select box--possible?

    - by Sean
    I have a picklist web interface: a pair of select elements with a pair of buttons (a left-pointing arrow and a right-pointing arrow) between them. Users can move items between the two columns by, eg, selecting one of options in the left column and clicking on the right-pointing arrow. Now I have an enhancement request: someone wants to be able to drag-and-drop items between the two columns instead of clicking a button. The problem with my initial two-select-box setup is that as soon as I click one of the highlighted options to initiate a drag, all of the other selected options are deselected. Using jQuery, I've attached mousedown event handlers to both the select boxes and each individual option that just call preventDefault() on the event object, but this isn't sufficient. On Firefox 3 the clicked-on option loses focus immediately, but all other options are still deseleted, and on IE6 (which I regrettably still have to support) it makes no difference at all. So I thought I could maybe create a reasonable facsimile of a select box using list elements or divs or something. I can create something reasonable-looking that works on Firefox, but on IE6, if I shift-click on an element of my pseudo-select object (in order to select a range of options), IE selects all of the text between where I click and the last place I clicked. Again, I've attached preventDefault-ing mousedown, mouseup, and click handlers to all of the elements involved, but it doesn't help. I've even tried overlaying transparent divs over both my original select boxes and my pseudo-select objects, thinking to intercept mouse clicks and manage the selections manually, but I can't make it work on IE. If I use a select box, I can't prevent clicks from changing the selection, and if I use text that just looks like a select element, I can't prevent it from selecting a range of text on a shift-click. Is there some general solution, or am I just out of luck?

    Read the article

  • Splitting string on probable English word boundaries

    - by Sean
    I recently used Adobe Acrobat Pro's OCR feature to process a Japanese kanji dictionary. The overall quality of the output is generally quite a bit better than I'd hoped, but word boundaries in the English portions of the text have often been lost. For example, here's one line from my file: softening;weakening(ofthemarket)8 CHANGE [transform] oneselfINTO,takethe form of; disguise oneself I could go around and insert the missing word boundaries everywhere, but this would be adding to what is already a substantial task. I'm hoping that there might exist software which can analyze text like this, where some of the words run together, and split the text on probable word boundaries. Is there such a package? I'm using Emacs, so it'd be extra-sweet if the package in question were already an Emacs package or could be readily integrated into Emacs, so that I could simply put my cursor on a line like the above and repeatedly invoke some command that splits the line on word boundaries in decreasing order of probable correctness.

    Read the article

  • Double confirmation on exit

    - by Sean
    I am trying to make it so that the user is prompted to confirm exiting my program in c#, but for some reason, if they say "yes" they would like to exit, the confirmation box would pop up again. I can't figure out why. if (MessageBox.Show("Are you sure you want to exit?", "Confirm exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { e.Cancel = true; } else { Application.Exit(); }

    Read the article

  • How to achieve a photo "stack" border effect with CSS?

    - by Sean Gough
    I'd like to be able to add a class to images that adds a border that makes them look like a stack of photos. Anyone know how to do this? Clarifications: Ideally something like the stack shown here but it doesn't need to be interactive and only needs to work for a single photo. I also don't mind using javascript if needed (jQuery would be preferred though).

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >