Daily Archives

Articles indexed Wednesday June 2 2010

Page 16/120 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • How to merge arraylist element ?

    - by tiendv
    I have a string example = " Can somebody provide an algorithm sample code in your reply ", after token and do some i want on string example i have arraylist like : ArrayList <token > arl = " "Can somebody provide ", "code in your ", "somebody provide an algorith", " in your reply" ) "Can somebody provide ", i know position start and end in string test : star = 1 end = 3 " code in your ", i know position stat = 7 end = 10, "somebody provide an algorith", i know position stat = 7 end = 10, "in your reply" i know position stat = 11 end = 14, we can see,some element in arl overlaping :"Can somebody provide "," code in your ","somebody provide an algorith". The problem here is how can i merge overlaping element to recived arraylist like ArrayList result ="" Can somebody provide an algorithm sample code","" in your reply""; Here my code : but it only merge fist elecment if check is overloaping public ArrayList<TextChunks> finalTextChunks(ArrayList<TextChunks> textchunkswithkeyword) { ArrayList<TextChunks > result = (ArrayList<TextChunks>) textchunkswithkeyword.clone(); //System.out.print(result.size()); int j; for(int i=0;i< result.size() ;i++) { int index = i; if(i+1>=result.size()){ break; } j=i+1; if(result.get(i).checkOverlapingTwoTextchunks(result.get(j))== true) { TextChunks temp = new TextChunks(); temp = handleOverlaping(textchunkswithkeyword.get(i),textchunkswithkeyword.get(j),resultSearchEngine); result.set(i, temp); result.remove(j); i = index; continue; } } return result; } Thanks in avadce

    Read the article

  • MDM 2010 Summit in San Francisco

    - by Tony Ouk
    Since 2006, the MDM Global Summit Series has brought master data expertise to more than 5,000 delegates worldwide. The Series is designed to reinforce the importance of data governance as a key factor to your MDM program's success while providing real-world experience and all-in-one access to solutions providers. Come join us June 2-3, 2010 at the Hyatt Regency in San Francisco.  For more information including registration details, visit the MDM Global Summit Series website.

    Read the article

  • Criteria for selecting software for embedded device

    - by Suresh Kumar
    We are currently evaluating Web servers for an embedded device. We have laid down the evaluation criteria for things like HTTP version, Security, Compression etc. On the embeddable side, we have identified the following criteria: Memory footprint Memory management (support for plugging in a custom memory manager) CPU usage Thread usage (support for thread pool) Portability What I want inputs on is: Are there any other criteria that an embeddable software should meet? What exactly does it mean when someone says that a software is designed for embeddable use? We currently have zeroed in on two Web servers: AppWeb Lighttpd (lighty) Feature wise, both the above Web servers seem to be on par. However, it is claimed that AppWeb is designed for embedded use while Lighttpd is not. To choose between the above two Web servers, what criteria should I be looking at?

    Read the article

  • Help with css selector for jquery

    - by NachoF
    I have this wordpress blog that has many pages with subpages that dropdown on hover.... the thing is, I dont want the pages that you hover to link to anything unless they dont have any ul with many anchors inside so just the subpages will have a href different than "#" So basically Im hacking my way through this with some simple javascript. jQuery(document).ready(function(){ jQuery("#menus li > a").attr("href","#"); }); This is selecting every a.. and I dont want that... I just want the anchors that are main pages, not subpages... heres the html so maybe you can think of a better way to select this. Ill explain first the structure is an ul with many li that have an anchor inside if the li also has a ul inside then those are subpages that will appear on hover. hence the initial anchor should have href="#" if there is no ul inside the li then the li a should keep its href. <ul id="menus"> <li> <a href="somelink">Main Page</a> //href should be changed to # <ul> <li> <a href="somelink2/">Subpage1</a> </li> <li> <a href="somelink3">Subpage2</a> </li> </ul> </li> <li> <a href="somelink">MainPage-with-no-subpages</a> //href should not be changed </li> <li> <a href="somelink4">MainPage</a> //href should be changed to # <ul> <li> <a href="somelink5">Subpage</a> </li> <li> <a href="somelink6">Subpage</a> </li> </ul> </li> </ul>

    Read the article

  • Reading a Windows 'binary' float into a ASP jscript variable

    - by user89691
    I need to read files produced by a legacy Windows app that stores real numbers (the 8-byte "double" type) in binary - i.e. as a packed array of 8 bytes. I can read the 8 byte group OK but how can I present it to my ASP JScript code such I can get the real number back again. Or to put it another way: Say a file was produced by a Windows (Delphi) program: Assign (f, 'test.bin') ; rewrite (f, 1) ; r := 1234.56E78 ; BlockWrite (f, r, SizeOf (Double)) ; Close (f) ; Inspection of the file will show it contains 8 bytes, being: 94 0E 4C CA C2 97 AD 53 which is the real number in IEEE format. Assuming I can read these 8 bytes back in ASP, is there a simple way of getting the real number back again?

    Read the article

  • Easiest way to plot values as symbols in scatter plot?

    - by AllenH
    In an answer to an earlier question of mine regarding fixing the colorspace for scatter images of 4D data, Tom10 suggested plotting values as symbols in order to double-check my data. An excellent idea. I've run some similar demos in the past, but I can't for the life of me find the demo I remember being quite simple. So, what's the easiest way to plot numerical values as the symbol in a scatter plot instead of 'o' for example? Tom10 suggested plt.txt(x,y,value)- and that is the implementation used in a number of examples. I however wonder if there's an easy way to evaluate "value" from my array of numbers? Can one simply say: str(valuearray) ? Do you need a loop to evaluate the values for plotting as suggested in the matplotlib demo section for 3D text scatter plots? Their example produces: However, they're doing something fairly complex in evaluating the locations as well as changing text direction based on data. So, is there a cute way to plot x,y,C data (where C is a value often taken as the color in the plot data- but instead I wish to make the symbol)? Again, I think we have a fair answer to this- I just wonder if there's an easier way?

    Read the article

  • Best way to handle Integer overflow in C#?

    - by byte
    Handling integer overflow is a common task, but what's the best way to handle it in C#? Is there some syntactic sugar to make it simpler than with other languages? Or is this really the best way? int x = foo(); int test = x * common; if(test / common != x) Console.WriteLine("oh noes!"); else Console.WriteLine("safe!");

    Read the article

  • Delete / Remove node from XPathNodeIterator, given an XPath

    - by RymdPung
    First of all, if someone has a different, perhaps shorter (or better), solution to the problem, it's welcome as well. I'm trying to "simply" remove (almost) duplicate elements in XSLT. There's some (metadata) nodes i don't want to include when comparing, and i couldn't figure out how do do that in XSLT so thought i'd extend it with a function removing these nodes. Like so: <xsl:for-each select="abx:removeNodes(d/df600|d/df610|d/df611|d/df630|d/df650|d/df651|d/df655, '*[@key=&quot;i1&quot; or @key=&quot;i2&quot; or key=&quot;db&quot;]')"> <xsl:if test="not(node()=preceding-sibling::*)"> blah </xsl:if> </xsl:for-each> And the extension, which doesn't work so well... (C#) public XPathNodeIterator removeNodes(XPathNodeIterator p_NodeIterator, String removeXPath) { Logger Logger = new Logger("xslt"); Logger.Log("removeNodes(removeXPath={0}):", removeXPath); foreach (XPathNavigator CurrentNode in p_NodeIterator) { Logger.Log("removeNodes(): CurrentNode.OuterXml={0}.", CurrentNode.OuterXml); foreach (XPathNavigator CurrentSubNode in CurrentNode.Select(removeXPath)) { Logger.Log("removeNodes(): CurrentSubNode.OuterXml={0}.", CurrentSubNode.OuterXml); // How do i delete this node!? //CurrentSubNode.DeleteSelf(); } } return p_NodeIterator; } My initial approach using 'CurrentSubNode.DeleteSelf();' doesn't work because it gets confused and loses its position in the XPathNavigator, causing it to only delete the first item it finds using "removeXPath". Something like a DeleteAndMoveNext() would be nice but there seems to be no such method... Example data: <df650> <df650 key="i1"> </df650> <df650 key="i2">0</df650> <df650 key="a">foo</df650> <df650 key="x">bar</df650> <df650 key="db">someDB</df650> <df650 key="id">b2</df650> <df650 key="dsname">someDS</df650> </df650> ..and then another identical node (if you ignore the meta fields; db,id,dsname). <df650> <df650 key="i1"> </df650> <df650 key="i2">0</df650> <df650 key="a">foo</df650> <df650 key="x">bar</df650> <df650 key="db">someOtherDB</df650> <df650 key="id">b2</df650> <df650 key="dsname">someOtherDS</df650> </df650> The result should be... <df650> <df650 key="i1"> </df650> <df650 key="i2">0</df650> <df650 key="a">foo</df650> <df650 key="x">bar</df650> </df650>

    Read the article

  • High concurrent request server in ruby

    - by WedTM
    I'm trying to write a simple server that will grab an mp3 file from rackspace cloudfiles, and stream it to a client over HTTP. The server must be able to stream to multiple clients simultaneously, however, I'm finding it difficult to come up with a viable solution. Anyone have some ideas?

    Read the article

  • iphone Memory gets freed in debug mode but not in release mode

    - by gdr
    I have been testing my iPhone debug build on both my device and simulator with activity monitor, leaks, and object allocations. The code is pretty well optimized so I have decided to test the release build. I went into the project Menu and set the target build to be release, I then added the necessary header paths that my app is using to the headers search paths and ran the release build on the device with the above mentioned instruments. What I have noticed now is that memory that was freed when I used the debug build does not get freed when using release version. There is one place in my App that I remove a scroll view with some images which frees up a significant amount of memory when I use the debug build, but no memory is freed up in that place when I use the release version. Does someone have any ideas where I need to start looking at? did I setup my release build wrong?

    Read the article

  • Difference between "traditional" COM and COM+ (in Component Services)

    - by kizzx2
    By the "traditional" way I mean registering the DLL in registry. There seems to be another method to set up it by going to mmc-Component Services-COM+ Applications and adding the .tlb file. I have a COM library that supports both methods. When it installs, it registers itself in the registry as a COM component and it works fine. However, when I added the .tlb file using the Component Services method, the behavior seems to be different and it starts giving out errors. I suspect it has something to do with marshaling and inter-process object transfer? (Sorry, I'm really a noob in the COM area) Can anyone point me to a good resource to clear my understanding?

    Read the article

  • Windows Server 2008 - RAID 5 Fails on Reboot

    - by Adam
    Hey, I've got an install of Windows Server 2008 Enterprise. It's running software RAID-5 with five disks. The disks were originally formatted under Windows Server 2003, but came up fine once I installed Windows Server 2008. The issue I'm having is that every time I reboot the server, the RAID comes up with a "Failed Redundancy" - the data stays available. I have 4 disks on a PCI SATA controller, and one of the disks connected to the motherboard's on-board SATA ports. (The other on-board port has the system disk connected.) I was having Disk #4 fail consistently, so I tried swapping the cables on the controller end. I swapped the on-board RAID disk with one on the PCI controller. Same issue now, expect with disk #1. Once the system's up, I can reactivate the RAID, it will resync for a while, then go to "Healthy", and will stay that way for an indefinite amount of time - until I reboot. As soon as I reboot, the disk drops again. I've ruled out disk + cable with the recabling. I don't believe it would be the controller as it seems to work fine most of the time - only failing on reboot, and the other port on the same controller connects the system disk - which is clearly working. I did look in the event log, but didn't see anything particularly relevant (although I didn't know what I was looking for - just looked for anything with a "Warning" or "Error" symbol that looked disk-related :)). I'm not particularly familiar with RAID on Windows, does anyone have any idea why this might be doing this? Any idea how to fix it? Any suggestions appreciated! -- Adam

    Read the article

  • AjaxControlToolkit JavaScript is not pointing correctly on IIS7 running behind Apache mod_proxy

    - by sohum
    So here's my setup. I've got a DynDNS account since I have a dynamic IP. I have Apache listening on port 80 and IIS7 on port 8080. I don't want users to have to enter in mydyndns.dyndns.com:8080 to get to IIS7, so I've added the following code to my Apache httpd.conf file to enable a proxy/reverse proxy: <VirtualHost *:80> ProxyPass / http://localhost:8080/myASPSite/ ProxyPassReverse / http://localhost:8080/myASPSite/ ServerName myaspsite.mydomain.com </VirtualHost> I've got a CNAME record set up on my DNS so that myaspsite.mydomain.com redirects to mydyndns.dyndns.com. When I type in myaspsite.mydomain.com into my browser, everything works beautifully... mostly. IIS7 serves up the ASPX pages and visitors to the site don't know any better. A problem arises, however, when I add Ajax Control Toolkit controls into my ASPX website, because these generate JavaScript and apparently mod_proxy_html isn't geared to handle the JS URIs properly. Sure enough, when I open up the source of my ASPX page, it has script elements as follows: <script src="/myASPSite/WebResource.axd?xyz" type="text/javascript"></script> <script src="/myASPSite/ScriptResource.axd?xyz" type="text/javascript"></script> Sure enough, these scripts are attempting to be resolved at http://myaspsite.mydomain.com/myASPSite/WebResource..., which through the proxy translates to localhost:8080/myASPSite/myASPSite/.... How can I solve this problem. The couple of websites I found suggested turning on ProxyHTMLExtended but when I tried doing that, the server did not start. I'm guessing I didn't know how to do it properly. Anyone has a handy couple of config lines that I can add to my Apache conf file to get this working as I need? I'm using Apache 2.2.11. Thanks!

    Read the article

  • Howto extract text from a file where date -time is the index

    - by Soham
    I have got around 800 files of maximum 55KB-100KB each where the data is in this format Date/Time/Float1/Float2/Float3/Float4/Integer Date is in DD/MM/YYYY format and Time is in the format of HH:MM Here the date ranges from say 1st May to 1June and each day, the Time varies from 09:00 to 15:30. I want to run a program so that, for each file, it extracts the data pertaining to a particular given date and writes to a file. I will not face any problem in writing into directory operations. I am trying to get around, to form a to do a search and extract operation. I dont know, how to do it, would like to have some idea. Thanks Soham

    Read the article

  • Should all the using directives for namespaces be inside the namespace?

    - by Sajeev SL
    Microsoft StyleCop provided a warning when the using directives for namespaces are provided outside of the namespace. Is this really required as my view on this is that using dircetives for namespaces is for providing a alias name for namespace and for removing the need for providing the namespace name when a class/interface is used. I dont think it will be used for loading the assembly.

    Read the article

  • Can you set a gradient brush for a listboxitem background in silverlight?

    - by Michael
    I am looking for a way to set a gradientbrush as the background for a listbox item. I have a DataTemplate defined and have specified a gradient brush but it always appears as the listbox background (i.e. it never shows as a gradient brush). I have been able to set the background of the listbox itself, and I can set the listboxitem's background to a standard color using the "setter" object....but none of these are what I am after. I really want the background on each list item to be a gradient brush. Below is the datatemplate that I have constructed. <ListBox Name="MyListBox" Margin="12,67,12,169"> <ListBox.ItemTemplate> <DataTemplate> <Grid Height="51" VerticalAlignment="Bottom"> <Grid.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFC9F4D0"/> <GradientStop Color="#FF2AC12A" Offset="0.333"/> <GradientStop Color="#FF35DE35" Offset="1"/> </LinearGradientBrush> </Grid.Background> <Canvas > <dataInput:Label Width="227" Foreground="Yellow" Canvas.Left="158" Canvas.Top="8" Content="{Binding Place}"/> <dataInput:Label Width="146" Foreground="Yellow" Canvas.Left="8" Canvas.Top="8" Content="{Binding Date}"/> <dataInput:Label Content="{Binding People}" Width="346" FontSize="9.333" Foreground="Black" Canvas.Left="166" Canvas.Top="28"/> <!-- <dataInput:Label Width="45" Content="Accept" Foreground="White" Canvas.Left="8" Canvas.Top="28"/> <dataInput:Label Width="45" Content="Decline" Foreground="White" Canvas.Left="57" Canvas.Top="28"/> --> <dataInput:Label Content="SomeText" Width="101" FontSize="9.333" Foreground="White" Canvas.Left="389" Canvas.Top="10"/> <Image Height="21" Width="21" Canvas.Left="500" Canvas.Top="8" Source="Green Button.png"/> </Canvas> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> Any Thoughts?

    Read the article

  • Website: Make printable version with footnotes?

    - by DavidR
    I have a website that uses editable divs so that a user can modify or make notes to a text. Is there a way I can have the website generate a pdf or some printable document with footnotes, such that if a user has this: <div class="text" id="text_1"> <div class="bodyTest">This is the body text</div> <div class="notes">These are the notes</div> </div> <div class="text" id="text_2"> <div class="bodyTest">This is the body text</div> <div class="notes">These are the notes</div> </div> the website will generate a printable version (or document) in such a way thatdiv.notes will appear as a footnote on the same page on which div#text_1 appears? I don't need a full answer, just a shove in the general direction will be amazing. Thanks.

    Read the article

  • Get a list of Android phone contacts only on Eclair and above?

    - by Rob Kent
    I want to show the user a flattened pick list of all their contacts phone numbers and it must work from versions 1.6 up. I have read the related questions on SO and the Android documentation for Eclair (http://developer.android.com/resources/articles/contacts.html#legacy). The problem is, even splitting my code into a factory class and specific implementations does not work for me because using Contacts.CONTENT_URI only shows contacts not individual numbers. What I need is this for version 1.6 Intent intent = new Intent(Intent.ACTION_PICK, Phones.CONTENT_URI); startActivityForResult(intent, REQUEST_PICK_CONTACT); And the equivalent for 2.0 and above. Even if I get their example to work, by building against the 2.1 API am I not stopping my app being visible on the Market to users with earlier versions of the OS? I can't launch it against a 1.6 emulator, for example.

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >