Search Results

Search found 10 results on 1 pages for 'patricia'.

Page 1/1 | 1 

  • Implementing a Patricia Trie for use as a dictionary

    - by Regis Frey
    I'm attempting to implement a Patricia Trie with the methods addWord(), isWord(), and isPrefix() as a means to store a large dictionary of words for quick retrieval (including prefix search). I've read up on the concepts but they just aren't clarifying into an implementation. I want to know (in Java or Python code) how to implement the Trie, particularly the nodes (or should I implement it recursively). I saw one person who implemented it with an array of 26 child nodes set to null/None. Is there a better strategy (such as treating the letters as bits) and how would you implement it?

    Read the article

  • Are there any radix/patricia/critbit trees for Python?

    - by Andrew Dalke
    I have about 10,000 words used as a set of inverted indices to about 500,000 documents. Both are normalized so the index is a mapping of integers (word id) to a set of integers (ids of documents which contain the word). My prototype uses Python's set as the obvious data type. When I do a search for a document I find the list of N search words and their corresponding N sets. I want to return the set of documents in the intersection of those N sets. Python's "intersect" method is implemented as a pairwise reduction. I think I can do better with a parallel search of sorted sets, so long as the library offers a fast way to get the next entry after i. I've been looking for something like that for some time. Years ago I wrote PyJudy but I no longer maintain it and I know how much work it would take to get it to a stage where I'm comfortable with it again. I would rather use someone else's well-tested code, and I would like one which supports fast serialization/deserialization. I can't find any, or at least not any with Python bindings. There is avltree which does what I want, but since even the pair-wise set merge take longer than I want, I suspect I want to have all my operations done in C/C++. Do you know of any radix/patricia/critbit tree libraries written as C/C++ extensions for Python? Failing that, what is the most appropriate library which I should wrap? The Judy Array site hasn't been updated in 6 years, with 1.0.5 released in May 2007. (Although it does build cleanly so perhaps It Just Works.)

    Read the article

  • Are my iptables secure?

    - by Patricia
    I have this in my rc.local on my new Ubuntu server: iptables -F iptables -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --dport 9418 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 9418 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --dport 5000 -m state --state NEW,ESTABLISHED -j ACCEPT # Heroku iptables -A INPUT -i eth0 -p tcp --sport 5000 -m state --state ESTABLISHED -j ACCEPT # Heroku iptables -A INPUT -p udp -s 74.207.242.5/32 --source-port 53 -d 0/0 --destination-port 1024:65535 -j ACCEPT iptables -A INPUT -p udp -s 74.207.241.5/32 --source-port 53 -d 0/0 --destination-port 1024:65535 -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT iptables -P INPUT DROP iptables -P FORWARD DROP 9418 is Git's port. 5000 is a port used to manage Heroku apps. And 74.207.242.5 and 74.207.241.5 are our DNS servers. Do you think that this is secure? Can you see any holes here? Update: Why is it important to block OUTPUT? This machine will be used only by me.

    Read the article

  • Firefox and TinyMCE 3.4.9 won't play nice together

    - by Patricia
    I've submitted a bug to the tinyMCE people, but i'm hoping someone else has come across this and has a suitable workaround. Here's the situation: I've got a form with a tinyMCE control that i load into a jquery dialog. it works great the first time, then after they close it, and open a new one. any interaction with the tinyMCE control gives: "Node cannot be used in a document other than the one in which it was created" it also doesn't fill the control with the text it's supposed to be prepopulated with. In my jquery dialogs i have the following scripts in my beforeClose handler: if (typeof tinyMCE != 'undefined') { $(this).find(':tinymce').each(function () { var theMce = $(this); tinyMCE.execCommand('mceFocus', false, theMce.attr('id')); tinyMCE.execCommand('mceRemoveControl', false, theMce.attr('id')); $(this).remove(); }); } and here's my tinyMCE setup script: $('#' + controlId).tinymce({ script_url: v2ScriptPaths.TinyMCEPath, mode: "none", elements: controlId, theme: "advanced", plugins: "paste", paste_retain_style_properties: "*", theme_advanced_toolbar_location: "top", theme_advanced_buttons1: "bold, italic, underline, strikethrough, separator, justifyleft, justifycenter, justifyright, justifyfull, indent, outdent, separator, undo, redo, separator, numlist, bullist, hr, link, unlink,removeformat", theme_advanced_buttons2: "fontsizeselect, forecolor, backcolor, charmap, pastetext,pasteword,selectall, sub, sup", theme_advanced_buttons3: "", language: v2LocalizedSettings.languageCode, gecko_spellcheck : true, onchange_callback: function (editor) { tinyMCE.triggerSave(); }, setup: function (editor) { editor.onInit.add(function (editor, event) { if (typeof v2SetInitialContent == 'function') { v2SetInitialContent(); } }) } }); is there anything obvious here? i've got all that complicated removal stuff in the close b/c tinymce doesn't like having it's html removed without it being removed. the setInitialContent() stuff is just so i can pre-load it with their email signature if they have one. it's broken with or without that code so that's not the problem. i was forced to update to 3.4.9 because of this issue: http://www.tinymce.com/forum/viewtopic.php?id=28400 so if someone can solve that, it would help this situation to. I have tried the suggestion from aknosis with no luck. EDIT: I originally thought this only affected firefox 11, but i have downloaded 10, and it is also affected. EDIT: Ok, i've trimmed down all my convoluted dynamic forms and links that cause this into a fairly simple example. the code for the base page: <a href="<%=Url.Action(MVC.Temp.GetRTEDialogContent)%>" id="TestSendEmailDialog">Get Dialog</a> <div id="TestDialog"></div> <script type="text/javascript"> $('#TestSendEmailDialog').click(function (e) { e.preventDefault(); var theDialog = buildADialog('Test', 500, 800, 'TestDialog'); theDialog.dialog('open'); theDialog.empty().load($(this).attr('href'), function () { }); }); function buildADialog(title, height, width, dialogId, maxHeight) { var customDialog = $('#' + dialogId); customDialog.dialog('destory'); customDialog.dialog({ title: title, autoOpen: false, height: height, modal: true, width: width, close: function (ev, ui) { $(this).dialog("destroy"); $(this).empty(); }, beforeClose: function (event, ui) { if (typeof tinyMCE != 'undefined') { $(this).find(':tinymce').each(function () { var theMce = $(this); tinyMCE.execCommand('mceFocus', false, theMce.attr('id')); tinyMCE.execCommand('mceRemoveControl', false, theMce.attr('id')); $(this).remove(); }); } } }); return customDialog; } </script> and the code for the page that is loaded into the dialog: <form id="SendAnEmailForm" name="SendAnEmailForm" enctype="multipart/form-data" method="post"> <textarea cols="50" id="MessageBody" name="MessageBody" rows="10" style="width: 710px; height:200px;"></textarea> </form> <script type="text/javascript"> $(function () { $('#MessageBody').tinymce({ script_url: v2ScriptPaths.TinyMCEPath, mode: "exact", elements: 'MessageBody', theme: "advanced", plugins: "paste, preview", paste_retain_style_properties: "*", theme_advanced_toolbar_location: "top", theme_advanced_buttons1: "bold, italic, underline, strikethrough, separator, justifyleft, justifycenter, justifyright, justifyfull, indent, outdent, separator, undo, redo, separator, numlist, bullist, hr, link, unlink,removeformat", theme_advanced_buttons2: "fontsizeselect, forecolor, backcolor, charmap, pastetext,pasteword,selectall, sub, sup, preview", theme_advanced_buttons3: "", language: 'EN', gecko_spellcheck: true, onchange_callback: function (editor) { tinyMCE.triggerSave(); } }); }); </script> a very interesting thing i noticed, if i move the tinyMCE setup into the load callback, it seems to work. this isn't really a solution though, because when i'm loading dialogs, i don't know in the code ahead of time if it has tinyMCE controls or not!

    Read the article

  • dismissViewControllerAnimated completion block presenter view and modal view flow

    - by Patricia LaRue
    I did find an answer to this title and I did do a little research but I'm still not getting the flow. Here is what I want to happen: 1) click a button on the presenter view to open a modal view. 2) retrieve some value and click a button to close the modal view....sending the value to the presentor view and execute a method. I get that this works like a callback but I still can't figure out where to put the callback stuff. So, how exactly do I do this? A) In the presentViewController completion block, should I include the presenter view method to execute when modal view is completed? Or: B) In the modal view's dismissViewControllerAnimated completion block, should I include the presenter view method to execute when modal view is completed? Can somebody help me with some sample code? Or at least help me get the flow of which block to put the code in? Thank you, P

    Read the article

  • Hi, i want to implement a small routing table for my learning? I know it is implemented using radix/

    - by aks
    Hi, i want to implement a small routing table for my learning? I know it is implemented using radix/patricia tree in routers? Can someone give me an idea on how to go about implementing the same? The major issue i feel is storing IP ADDRESS. For example : 10.1.1.0 network next hop 20.1.1.1 10.1.0.0 network next hop 40.1.1.1 Can someone give me a declaration of the struct from which i can have an idea?

    Read the article

  • Compare date fields in SQL server

    - by huslayer
    Hi all, I've a flat file that I cleaned the data out using SSIS, the output looks like that : MEDICAL ADMIT PATIENT PATIENT DATE OF DX REC NO DATE NUMBER NAME DISCHARGE Code DRG # 123613 02/16/09 12413209 MORIBALDI ,GEMMA 02/19/09 428.20 988 130897 01/23/09 12407193 TINLEY ,PATRICIA 01/23/09 535.10 392 139367 02/27/09 36262509 THARPE ,GLORIA 03/05/09 562.10 392 141954 02/25/09 72779499 SHUMATE ,VALERIA 02/25/09 112.84 370 141954 03/07/09 36271732 SHUMATE ,VALERIA 03/10/09 493.92 203 145299 01/21/09 12406294 BAUGH ,MARIA 01/21/09 366.17 117 and the report (final results) attached in the screen shot from the final excel report. so what's happening is IF the same name or same account number is duplicate, that means the patient has entered the hospital again and needs to be included in the report. ![alt text][1] what I need to do is... Eliminate any rows that is NOT duplicate (not everybody in this file has been admitted again) and compare the dates to get the ReAdmitdate and ReDischargedate I dumped the data into a SQL table and trying to compare the dates to figure out "ReAdmitdate" and "ReDischargedate" any help is appreciated. Thanks [link text][1]

    Read the article

  • Oracle OpenWorld Update: Oracle GoldenGate for High Availability

    - by Doug Reid
    0 false 18 pt 18 pt 0 0 false false false /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-ascii-font-family:Cambria; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Cambria; mso-hansi-theme-font:minor-latin;} One of our primary themes this year for the Oracle OpenWorld Sessions featuring Oracle GoldenGate is High Availability. This is a pretty wide theme, but the focus will be on ways of maximizing uptime for critical systems during planned and unplanned events. We have a number of very informative sessions dedicated to exploring this theme in detail; from deep product implementation strategies up to lessons learned by our customers when using Oracle GoldenGate to meet strict SLAs. We kick this track off with our Customer Panel on Zero Downtime Operations on Monday, which I overviewed in my last posting. This is followed by Comcast, who will be hosting a sessions at 1:45PM in Moscone West 3014. Their session will discuss using Oracle GoldenGate to reduce downtime during a database upgrade. Here’s an overview: CON8571 - Oracle Database Upgrade with Oracle GoldenGate: Best Practices from Comcast Does your business demand high availability? In this session, Comcast, among the largest telecom firms in the world, shares tips on how to achieve zero downtime while upgrading to Oracle Database 11g Release 2, using a combination of Oracle technologies: Oracle Real Application Clusters (Oracle RAC), Oracle Database’s Grid Infrastructure and Oracle Recovery Manager (Oracle RMAN) features, Oracle GoldenGate, and Oracle Active Data Guard. This successful upgrade took place on a mission-critical system that handles more than 60 million business requests and service calls a day. You’ll also hear how Comcast leverages Oracle Advanced Customer Support Services, including an Oracle Solution Support Center, to maximize performance and availability of its Oracle technologies. On Tuesday, Joydip Kundu (Director of Software Development) will be presenting “Oracle GoldenGate and Oracle Data Guard: Working Together Seamlessly” at 10:15AM in Moscone South 3005. This session focuses on how both modes of Oracle GoldenGate extract (Classic and Integrated Capture) can be used with Oracle Data Guard for disaster recovery purposes or to offload extract processing. That afternoon at 1:15PM Comcast takes the stage again to discuss firsthand lessons learned implementing Oracle GoldenGate in a heterogeneous, highly available environment. Here’s a rundown of their session: CON8750 - High-Volume OLTP with Oracle GoldenGate: Best Practices from Comcast Does your business demand high availability in a mission-critical environment? In this session, Comcast, one of the largest telecom firms, shares best practices for leveraging Oracle GoldenGate to replicate high-volume online transaction processing data from Tandem NSK SQL/MX to Teradata. Hear critical success factors from Comcast for overall platform and component architectures as well as configuration and tuning techniques. Learn how it met the challenges of replication in a complex heterogeneous environment. You’ll also hear how Comcast leverages Oracle Advanced Customer Support Services, including an Oracle Solution Support Center, to provide mission-critical support for maximized performance and availability of its Oracle environment. The final session on the high availability track will be hosted by Patricia Mcelroy (Distinguished Product Manager) and Stephan Haisly (Principle Member of Technical Staff). Their session (CON8401 - Tuning and Troubleshooting Oracle GoldenGate on Oracle Database) covers techniques for performance tuning and troubleshooting of Oracle GoldenGate on Oracle Database. Using various types of workloads (OLTP, batch, Oracle’s PeopleSoft Enterprise), the presentation steps through the process of monitoring and troubleshooting the configuration to maximize performance and replication throughput within and between Oracle clouds. Join us at our sessions or stop by our demo pods in Moscone south and meet the product management and development teams.

    Read the article

  • SUDS rendering a duplicate node and wrapping everything in it

    - by PylonsN00b
    Here is my code: #Make the SOAP connection url = "https://api.channeladvisor.com/ChannelAdvisorAPI/v1/InventoryService.asmx?WSDL" headers = {'Content-Type': 'text/xml; charset=utf-8'} ca_client_inventory = Client(url, location="https://api.channeladvisor.com/ChannelAdvisorAPI/v1/InventoryService.asmx", headers=headers) #Make the SOAP headers login = ca_client_inventory.factory.create('APICredentials') login.DeveloperKey = 'REMOVED' login.Password = 'REMOVED' #Attach the headers ca_client_inventory.set_options(soapheaders=login) synch_inventory_item_list = ca_client_inventory.factory.create('SynchInventoryItemList') synch_inventory_item_list.accountID = "REMOVED" array_of_inventory_item_submit = ca_client_inventory.factory.create('ArrayOfInventoryItemSubmit') for product in products: inventory_item_submit = ca_client_inventory.factory.create('InventoryItemSubmit') inventory_item_list = get_item_list(product) inventory_item_submit = [inventory_item_list] array_of_inventory_item_submit.InventoryItemSubmit.append(inventory_item_submit) synch_inventory_item_list.itemList = array_of_inventory_item_submit #Call that service baby! ca_client_inventory.service.SynchInventoryItemList(synch_inventory_item_list) Here is what it outputs: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:ns0="http://api.channeladvisor.com/webservices/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://api.channeladvisor.com/webservices/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <tns:APICredentials> <tns:DeveloperKey>REMOVED</tns:DeveloperKey> <tns:Password>REMOVED</tns:Password> </tns:APICredentials> </SOAP-ENV:Header> <ns1:Body> <ns0:SynchInventoryItemList> <ns0:accountID> <ns0:accountID>REMOVED</ns0:accountID> <ns0:itemList> <ns0:InventoryItemSubmit> <ns0:Sku>1872</ns0:Sku> <ns0:Title>The Big Book Of Crazy Quilt Stitches</ns0:Title> <ns0:Subtitle></ns0:Subtitle> <ns0:Description>Embellish the seams and patches of crazy quilt projects with over 75 embroidery stitches and floral motifs. You&apos;ll use this handy reference book again and again to dress up wall hangings, pillows, sachets, clothing, and other nostalgic creations.</ns0:Description> <ns0:Weight>4</ns0:Weight> <ns0:FlagStyle/> <ns0:IsBlocked xsi:nil="true"/> <ns0:ISBN></ns0:ISBN> <ns0:UPC>028906018721</ns0:UPC> <ns0:EAN></ns0:EAN> <ns0:QuantityInfo> <ns0:UpdateType>UnShipped</ns0:UpdateType> <ns0:Total>0</ns0:Total> </ns0:QuantityInfo> <ns0:PriceInfo> <ns0:Cost>0.575</ns0:Cost> <ns0:RetailPrice xsi:nil="true"/> <ns0:StartingPrice xsi:nil="true"/> <ns0:ReservePrice xsi:nil="true"/> <ns0:TakeItPrice>6.95</ns0:TakeItPrice> <ns0:SecondChanceOfferPrice xsi:nil="true"/> <ns0:StorePrice>6.95</ns0:StorePrice> </ns0:PriceInfo> <ns0:ClassificationInfo> <ns0:Name>Books</ns0:Name> <ns0:AttributeList> <ns0:ClassificationAttributeInfo> <ns0:Name>Designer/Author</ns0:Name> <ns0:Value>Patricia Eaton</ns0:Value> </ns0:ClassificationAttributeInfo> <ns0:ClassificationAttributeInfo> <ns0:Name>Trim Size</ns0:Name> <ns0:Value></ns0:Value> </ns0:ClassificationAttributeInfo> <ns0:ClassificationAttributeInfo> <ns0:Name>Binding</ns0:Name> <ns0:Value>Leaflet</ns0:Value> </ns0:ClassificationAttributeInfo> <ns0:ClassificationAttributeInfo> <ns0:Name>Release Date</ns0:Name> <ns0:Value>11/1/1999 0:00:00</ns0:Value> </ns0:ClassificationAttributeInfo> <ns0:ClassificationAttributeInfo> <ns0:Name>Skill Level</ns0:Name> <ns0:Value></ns0:Value> </ns0:ClassificationAttributeInfo> <ns0:ClassificationAttributeInfo> <ns0:Name>Pages</ns0:Name> <ns0:Value>20</ns0:Value> </ns0:ClassificationAttributeInfo> <ns0:ClassificationAttributeInfo> <ns0:Name>Projects</ns0:Name> <ns0:Value></ns0:Value> </ns0:ClassificationAttributeInfo> </ns0:AttributeList> </ns0:ClassificationInfo> <ns0:ImageList> <ns0:ImageInfoSubmit> <ns0:PlacementName>ITEMIMAGEURL1</ns0:PlacementName> <ns0:FilenameOrUrl>1872.jpg</ns0:FilenameOrUrl> </ns0:ImageInfoSubmit> </ns0:ImageList> </ns0:InventoryItemSubmit> </ns0:itemList> </ns0:accountID> </ns0:SynchInventoryItemList> </ns1:Body> </SOAP-ENV:Envelope> See how it creates the accountID node twice and wraps the whole thing in it? WHY? How do I make it stop that?!

    Read the article

1