Search Results

Search found 2672 results on 107 pages for 'michael cereda'.

Page 56/107 | < Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >

  • regex , php, preg_match

    - by Michael
    I'm trying to extract the mileage value from different ebay pages but I'm stuck as there seem to be too many patterns because the pages are a bit different . Therefore I would like to know if you can help me with a better pattern . Some examples of items are the following : http://cgi.ebay.com/ebaymotors/1971-Chevy-C10-Shortbed-Truck-/250647101696?cmd=ViewItem&pt=US_Cars_Trucks&hash=item3a5bbb4100 http://cgi.ebay.com/ebaymotors/1987-HANDICAP-LEISURE-VAN-W-WHEEL-CHAIR-LIFT-/250647101712?cmd=ViewItem&pt=US_Cars_Trucks&hash=item3a5bbb4110 http://cgi.ebay.com/ebaymotors/ws/eBayISAPI.dll?ViewItemNext&item=250647101696 Please see the patterns at the following link (I still cannot figure it out how to escape the html here http://pastebin.com/zk4HAY3T However they are not enough many as it seems there are still new patters....

    Read the article

  • How different is python2.x from python3.x

    - by michael
    I'm starting to learn python right this instant. I have the old Dive Into Python book, but I see there's another one for v3. What am I going to learn that I'll have to unlearn later? If you were to start learning Python today which version would you pick?

    Read the article

  • Maintain denormalized data with NHibernate EventListener

    - by Michael Valenty
    I have one bit of denormalized data used for performance reasons and I'm trying to maintain the data with an NHibernate event listener rather than a trigger. I'm not convinced this is the best approach, but I'm neck deep into it and I want to figure this out before moving on. I'm getting following error: System.InvalidOperationException : Collection was modified; enumeration operation may not execute. System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) System.Collections.Generic.List`1.Enumerator.MoveNextRare() System.Collections.Generic.List`1.Enumerator.MoveNext() NHibernate.Engine.ActionQueue.ExecuteActions(IList list) NHibernate.Engine.ActionQueue.ExecuteActions() NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions (IEventSource session) NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) NHibernate.Impl.SessionImpl.Flush() NHibernate.Transaction.AdoTransaction.Commit() Here's the code to make happen: using (var tx = session.BeginTransaction()) { var business = session .Get<Business>(1234) .ChangeZipCodeTo("92011"); session.Update(business); tx.Commit(); // error happens here } and the event listener: public void OnPostUpdate(PostUpdateEvent @event) { var business = @event.Entity as Business; if (business != null) { var links = @event.Session .CreateQuery("select l from BusinessCategoryLink as l where l.Business.BusinessId = :businessId") .SetParameter("businessId", business.BusinessId) .List<BusinessCategoryLink>(); foreach (var link in links) { link.Location = business.Location; @event.Session.Update(link); } } }

    Read the article

  • MakeFiles and dependancies

    - by Michael
    Hello, I'm writing a makefile and I can't figure out how to include all my source files without having to write all source file I want to use. Here is the makefile I'm currently using: GCC= $(GNUARM_HOME)\bin\arm-elf-gcc.exe SOURCES=ShapeApp.cpp Square.cpp Circle.cpp Shape.cpp OBJECTS=$(SOURCES:.cpp=.o) EXECUTABLE=hello all: $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) #$(CC) $(LDFLAGS) $(OBJECTS) -o $@ .cpp.o: $(GCC) -c $< -o $@ How do I automatically add new source file without having to add it to the sources line? Thanks, Mike.

    Read the article

  • How to time-delay email deliveries?

    - by Michael D
    I'm currently learning about the Drupal email functions, such as drupal_mail and hook_mail, and hook_mail_alter, and I have a problem before me where I'll need to be able to queue emails for delayed delivery. For example, an event signup notification that needs to wait for an hour after the event was registered by a user. And that email has user specific data, so can't be just a generic template email... I'm using the MailQ module, mainly for it's logging capabilities, but I wonder if it (or something else) could be modified to add a configurable delay function? Any ideas?

    Read the article

  • How to use XPath to filter elements by TextContent? get parent by axis?

    - by Michael Mao
    Hi all: I've found a similar question on SO, however, that seems not exactly what I wanna achieve: Say, this is a sample XML file: <root> <item> <id isInStock="true">10001</id> <category>Loose Balloon</category> </item> <item> <id isInStock="true">10001</id> <category>Bouquet Balloon</category> </item> <item> <id isInStock="true">10001</id> <category>Loose Balloon</category> </item> </root> If I wanna get a "filtered" subset of the item elements from this XML, how could I use an XPath expression to directly address that? XPathExpression expr = xpath.compile("/root/item/category/text()"); I now know this would evaluate to be the collection of all the TextContent from the categories, however, that means I have to use a collection to store the values, then iterate, then go back to grab other related info such as the item id again. Another question is : how could I refer to the parent node properly? Say, this xpath expression would get me the collection of all the id nodes, right? But what I want is the collection of item nodes: XPathExpression expr = xpath.compile("/root/item/id[@isInStock='true']"); I know I should use the "parent" axis to refer to that, but I just cannot make it right... Is there a better way of doing this sort of thing? Learning the w3cschools tutorials now... Sorry I am new to XPath in Java, and thanks a lot in advance.

    Read the article

  • Need help in using getScrollY() of ListView

    - by michael
    Hi, I have the following code which recording the scroll Y position in my ListView whenever my activity is paused. protected void onSaveInstanceState (Bundle outState) { super.onSaveInstanceState(outState); int scroll = mListView.getScrollY(); System.out.println (" scrollY" + scroll); } But regardless where I scroll my ListView vertically, the value of getScrollY() always return 0. Can anyone please help me? Thank you.

    Read the article

  • Why are primes important in cryptography?

    - by Michael Stum
    One thing that always strikes me as a non-cryptographer: Why is it so important to use Prime numbers? What makes them so special in cryptography? Does anyone have a simple short explanation? (I am aware that there are many primers and that Applied Cryptography is the Bible, but as said: I am not looking to implement my own cryptographic algorithm, and the stuff that I found just made my brain explode - no 10 pages of math formulas please :)) Thanks for all the answers. I've accepted the one that made the actual concept most clear to me.

    Read the article

  • trouble configuring WCF to use session

    - by Michael
    I am having trouble in configuring WCF service to run in session mode. As a test I wrote this simple service : [ServiceContract] public interface IService1 { [OperationContract] string AddData(int value); } [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession)] internal class Service1 : IService1,IDisposable { private int acc; public Service1() { acc = 0; } public string AddData(int value) { acc += value; return string.Format("Accumulator value: {0}", acc); } #region IDisposable Members public void Dispose() { } #endregion } I am using Net.TCP binding with default configuration with reliable session flag enabled. As far as I understand , such service should run with no problems in session mode. But , the service runs as in per call mode - each time I call AddData , constructor gets called before executing AddData and Dispose() is called after the call. Any ideas why this might be happening?

    Read the article

  • How to disable Safari Reader in a web page

    - by michael
    I'm curious to know more about what triggers the Reader option in Safari and what does not. I wouldn't plan to implement anything that would disable it, but curious as a technical exercise. Here is what I've learned so far with some basic playing around: You need at least one H tag It does not go by character count alone but by the number of P tags and length Probably looks for sentence breaks '.' and other criteria Safari will provide the 'Reader' if, with a H tag, and the following: 1 P tag, 2417 chars 4 P tags, 1527 chars 5 P tags, 1150 chars 6 P tags, 862 chars If you subtract 1 character from any of the above, the 'Reader' option is not available. I should note that the character count of the H tag plays a part but sadly did not realize this when I determined the results above. Assume 20+ characters for H tag and fixed throughout the results above. Some other interesting things: Setting <p style="display:none;"> for P tags removes them from the count Setting display to none, and then showing them 230ms later with Javascript avoided the Reader option too I'd be interested if anyone can determine this in full.

    Read the article

  • Rails, JSON Object, jQuery, Auto-Complete

    - by Michael Waxman
    I'm using this jquery autocomplete plug-in with rails: http://docs.jquery.com/Plugins/Autocomplete I can't figure out how to format my results, both in my Rails controller and in my javascript file. I have something like this in my controller... @query = params[:q].downcase @json = User.all(:login => /^#{@query}/) respond_to do |format| format.js { render :json => @json.to_json(:only => "login"), :layout => false } end And then this in my script.js file... $("#form").autocomplete('/url', { width: 320, dataType: 'json', highlight: false, scroll: true, scrollHeight: 300 }) But I can't figure out how to parse the data, so my autocomplete just gets a raw array of all my results at once. How do I process the JSON in the script.js file and/or in my controller for it to work?

    Read the article

  • Microsoft T-SQL to Oracle PL/SQL translation

    - by Michael Prewecki
    I've worked with T-SQL for years but i've just moved to an organisation that is going to require writing some Oracle stuff, probably just simple CRUD operations at least until I find my feet. I'm not going to be migrating databases from one to the other simply interacting with existing Oracle databases from an Application Development perspective. Is there are tool or utility available to easily translate T-SQL into PL/SQL, a keyword mapper is the sort of thing I'm looking for. P.S. I'm too lazy to RTFM, besides it's not going to be a big part of my role so I just want something to get me up to speed a little faster.

    Read the article

  • PyML 0.7.2 - How to prevent accuracy from dropping after storing/loading a classifier?

    - by Michael Aaron Safyan
    This is a followup from "Save PyML.classifiers.multi.OneAgainstRest(SVM()) object?". The solution to that question was close, but not quite right, (the SparseDataSet is broken, so attempting to save/load with that dataset container type will fail, no matter what. Also, PyML is inconsistent in terms of whether labels should be numbers or strings... it turns out that the oneAgainstRest function is actually not good enough, because the labels need to be strings and simultaneously convertible to floats, because there are places where it is assumed to be a string and elsewhere converted to float) and so after a great deal of hacking and such I was finally able to figure out a way to save and load my multi-class classifier without it blowing up with an error.... however, although it is no longer giving me an error message, it is still not quite right as the accuracy of the classifier drops significantly when it is saved and then reloaded (so I'm still missing a piece of the puzzle). I am currently using the following custom mutli-class classifier for training, saving, and loading: class SVM(object): def __init__(self,features_or_filename,labels=None,kernel=None): if isinstance(features_or_filename,str): filename=features_or_filename; if labels!=None: raise ValueError,"Labels must be None if loading from a file."; with open(os.path.join(filename,"uniquelabels.list"),"rb") as uniquelabelsfile: self.uniquelabels=sorted(list(set(pickle.load(uniquelabelsfile)))); self.labeltoindex={}; for idx,label in enumerate(self.uniquelabels): self.labeltoindex[label]=idx; self.classifiers=[]; for classidx, classname in enumerate(self.uniquelabels): self.classifiers.append(PyML.classifiers.svm.loadSVM(os.path.join(filename,str(classname)+".pyml.svm"),datasetClass = PyML.VectorDataSet)); else: features=features_or_filename; if labels==None: raise ValueError,"Labels must not be None when training."; self.uniquelabels=sorted(list(set(labels))); self.labeltoindex={}; for idx,label in enumerate(self.uniquelabels): self.labeltoindex[label]=idx; points = [[float(xij) for xij in xi] for xi in features]; self.classifiers=[PyML.SVM(kernel) for label in self.uniquelabels]; for i in xrange(len(self.uniquelabels)): currentlabel=self.uniquelabels[i]; currentlabels=['+1' if k==currentlabel else '-1' for k in labels]; currentdataset=PyML.VectorDataSet(points,L=currentlabels,positiveClass='+1'); self.classifiers[i].train(currentdataset,saveSpace=False); def accuracy(self,pts,labels): logger=logging.getLogger("ml"); correct=0; total=0; classindexes=[self.labeltoindex[label] for label in labels]; h=self.hypotheses(pts); for idx in xrange(len(pts)): if h[idx]==classindexes[idx]: logger.info("RIGHT: Actual \"%s\" == Predicted \"%s\"" %(self.uniquelabels[ classindexes[idx] ], self.uniquelabels[ h[idx] ])); correct+=1; else: logger.info("WRONG: Actual \"%s\" != Predicted \"%s\"" %(self.uniquelabels[ classindexes[idx] ], self.uniquelabels[ h[idx] ])) total+=1; return float(correct)/float(total); def prediction(self,pt): h=self.hypothesis(pt); if h!=None: return self.uniquelabels[h]; return h; def predictions(self,pts): h=self.hypotheses(self,pts); return [self.uniquelabels[x] if x!=None else None for x in h]; def hypothesis(self,pt): bestvalue=None; bestclass=None; dataset=PyML.VectorDataSet([pt]); for classidx, classifier in enumerate(self.classifiers): val=classifier.decisionFunc(dataset,0); if (bestvalue==None) or (val>bestvalue): bestvalue=val; bestclass=classidx; return bestclass; def hypotheses(self,pts): bestvalues=[None for pt in pts]; bestclasses=[None for pt in pts]; dataset=PyML.VectorDataSet(pts); for classidx, classifier in enumerate(self.classifiers): for ptidx in xrange(len(pts)): val=classifier.decisionFunc(dataset,ptidx); if (bestvalues[ptidx]==None) or (val>bestvalues[ptidx]): bestvalues[ptidx]=val; bestclasses[ptidx]=classidx; return bestclasses; def save(self,filename): if not os.path.exists(filename): os.makedirs(filename); with open(os.path.join(filename,"uniquelabels.list"),"wb") as uniquelabelsfile: pickle.dump(self.uniquelabels,uniquelabelsfile,pickle.HIGHEST_PROTOCOL); for classidx, classname in enumerate(self.uniquelabels): self.classifiers[classidx].save(os.path.join(filename,str(classname)+".pyml.svm")); I am using the latest version of PyML (0.7.2, although PyML.__version__ is 0.7.0). When I construct the classifier with a training dataset, the reported accuracy is ~0.87. When I then save it and reload it, the accuracy is less than 0.001. So, there is something here that I am clearly not persisting correctly, although what that may be is completely non-obvious to me. Would you happen to know what that is?

    Read the article

  • Apache is running but there is no page displayed

    - by Michael Ozeryansky
    I am on a Mac OSX and I am using the built in PHP and Apache2. I have been setting up MySQL and finally when I got MySQL working my local site won't display. Do note that I did have the web server running and delivering PHP enabled pages, just no database connection. But my question is not about MySQL. I have changed various settings in the 'http.conf' file, and I have the line: '127.0.0.1 localhost' in my hosts file. I also have other alias' pointing to 127.0.0.1. I have checked everything I could about Apache and I have made sure that any message in the error_log is ok. I currently have my errorLevel set to debug, so I get all the messages. At this point (HOURS of self fixing) I think I need help. What can I provide for someone to figure this out with me. Thanks.

    Read the article

  • Global Ignores for SVN?

    - by Michael Stum
    Is there a way to setup a global list of Ignores for a SVN Repository or for the SVN Client on the PC? The only reason I'm using tools like Tortoise/Ankh/VisualSVN is because I want to only check in the files I need without all the bin/obj/Resharper stuff. I'm spoiled by .gitignore and .hgignore which I just copy to a repository and then use "git commit -a" without having to care about checking in junk. I know I can manually set it, but that's tedious to do and I think it had to be applied to every new folder that gets created as well. Using SVN under Windows if that matters

    Read the article

  • What vertex shader code should be used for a pixel shader used for simple 2D SpriteBatch drawing in XNA?

    - by Michael
    Preface First of all, why is a vertex shader required for a SilverlightEffect (.slfx file) in Silverlight 5? I'm trying to port a simple 2D XNA game to Silverlight 5 RC, and I would like to use a basic pixel shader. This shader works great in XNA for Windows and Xbox, but I can't get it to compile with Silverlight as a SilverlightEffect. The MS blog for the Silverlight Toolkit says that "there is no difference between .slfx and .fx", but apparently this isn't quite true -- or at least SpriteBatch is working some magic for us in "regular XNA", and it isn't in "Silverlight XNA". If I try to directly copy my pixel shader file into a Silverlight project (and change it to the supported "Effect - Silverlight" importer/processor), when I try to compile I see the following error message: Invalid effect file. Unable to find vertex shader in pass "P0" Indeed, there isn't a vertex shader in my pixel shader file. I haven't needed one with my other 2D XNA apps since I'm just doing basic SpriteBatch drawing. I tried adding a vertex shader to my shader file, using Remi Gillig's comment on this Shawn Hargreaves blog post for guidance, but it doesn't quite work. The shader file successfully compiles, and I see some semblance of my game on screen, but it's tiny, twisted, repeated, and all jumbled up. So clearly something's not quite right. The Real Question So that brings me to my real question: Since a vertex shader is required, is there a basic vertex shader function that works for simple 2D SpriteBatch drawing? And if the vertex shader requires world/view/project matricies as parameters, what values am I supposed to use for a 2D game? Can any shader pros help? Thanks!

    Read the article

  • using PHP to create multidimensional array from simple JSON array

    - by Michael Robinson
    I have a php query the returns the following JSON format from a table. [{"memberid":"18", "useridFK":"30", "loginName":"Johnson", "name":"Frank", "age":"23", "place":"School", }, It needs the following format: [{"memberid":"18" { "useridFK":"30", "loginName":"Johnson", "name":"Frank", "age":"23", "place":"School",} }, I was told in another question that PHP would work and it looks like "Transversing" might be appropriate, I'm looking to find out what to put in the Php before it returns the JASON. My Array.plist will look like the following: Root: Dictionary V Rows: Array V Item 0: Dictionary Title: String 18 V Children Array V Item 0 Dictionary Title String 30 etc. Thanks in advance.

    Read the article

  • matlab ButtonDownFcn

    - by michael
    hello, I have a project in "Optical Character Recognition" in matlab and i need your help: how do i recognize when the user press the mouse on an image? i trying to do this with ButtonDownFcn but even when i just printing message the message is not printed. i want to allow the user to select the license plate from the image. how can i do this and save the Pixels of the selected area? thanks in advance.

    Read the article

  • Firefox extension object instantiating

    - by Michael
    I want my javascript object to be initialized just once, so each new browser window will not create new data items, new functions, etc... usually we initialize the code at the end of main javascript using load window.addEventListener("load", main.onLoad, false); so once the second browser window opened, the initialization code will start from scratch. However, I would like to re-use the existing object on consequent browsers. Any mechanism that I can use?

    Read the article

  • jQuery.ajax success callback function not executed

    - by Frank Michael Kraft
    I have a JavaScript Ajax call (jQuery.ajax), that does not execute the success callback function. $.ajax({ url: target, contentType: 'application/json; charset=utf-8', type: 'POST', // type: 'GET', dataType: 'jsonp', error: function (xhr, status) { alert(status); }, success: function (result) { alert("Callback done!"); // grid.dataBind(result.results); // grid.dataBind(result); } }); I see in firebug, that the request is posted and the correct result in terms of the json is returned as expected. What is wrong?

    Read the article

  • how to close popup using javascript with xml formatting

    - by Michael Robinson
    I bought this program that created a pretty nice imageuploader flash script however I can't get the Javascript function close window to close the popup and redirect the original page. here is the XML piece that defines the url's: <urls urlToUpload="upload.php?" urlOnUploadSuccess="http://www.home.com/purchase.html" urlOnUploadFail="http://www.home.com/tryagain.html" urlUpdateFlashPlayer="http://www.home.com/flashalternative.html" jsFunctionNameOnUpload=""/> This last line calls a javascript function on upload. The problem is I don't know what to call and where to put it. Here is the HTML file that is the popup: <HEAD> <title>Baublet Uploader</title> <script type="text/javascript" src="swfobject.js"></script> </HEAD> <BODY> <!-- Q-ImageUploader www.quadroland.com --> <div id="QImageUploader"> Flash Player stuff here </div> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("q_image_uploader.swf", "imageuploader", "650", "430", "9", "#FFFFFF"); so.addParam("scale", "noscale"); so.addParam("salign", "TL"); so.addVariable("AdditionalStringVariable","pass additional data here"); so.write("QImageUploader"); // ]]> </script> I found this Closing script I thought might work: <script language="javascript"> function close_window(page) { window.opener.location.href=page setTimeout(function(){window.close()},10); } </script> Does this go into the Popup HTML page above or would it be a separate close.js file in the root? Thanks, I'm really confused.

    Read the article

  • Is Annotation in Javascript? If not, how to switch between debug/productive modes in declarative way

    - by Michael Mao
    Hi all: This is but a curious question. I cannot find any useful links from Google so it might be better to ask the gurus here. The point is: is there a way to make "annotation" in javascript source code so that all code snippets for testing purpose can be 'filtered out' when project is deployed from test field into the real environment? I know in Java, C# or some other languages, you can assign an annotation just above the function name, such as : // it is good to remove the annoying warning messages @SuppressWarnings("unchecked") public class Tester extends TestingPackage { ... } Basically I've got a lot of testing code that prints out something into FireBug console. I don't wanna manually "comment out" them because the guy that is going to maintain the code might not be aware of all the testing functions, so he/she might just miss one function and the whole thing can be brought down to its knees. One other thing, we might use a minimizer to "shrink" the source code into "human unreadable" code and boost up performance (just like jQuery.min), so trying to match testing section out of the mess is not possible for plain human eyes in the future. Any suggestion is much appreciated.

    Read the article

< Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >