Daily Archives

Articles indexed Thursday April 22 2010

Page 5/123 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • jQuery adding a row to a table with click() handler for tr

    - by Dave
    I'm having an issue with a control I'm building that contains a table where the body is scrollable. The rows have a click() function handler established like: /** * This function is called when the user clicks the mouse on a row in * our scrolling table. */ $('.innerTable tr').click (function (e) { // // Only react to the click if the mouse was clicked in the DIV or // the TD. // if (event.target.nodeName == 'DIV' || event.target.nodeName == 'TD' ) { // // If the user wasn't holding down the control key, then deselect // any previously selected columns. // if (e.ctrlKey == false) { $('.innerTable tr').removeClass ('selected'); } // // Toggle the selected state of the row that was clicked. // $(this).toggleClass ('selected'); } }); There is a button that adds rows to the table like: $('#innerTable > tbody:last').append('<tr>...some information...</tr>'); While the rows ARE added successfully, for some reason, the static rows work with the click handler, but the newly added rows do not. Is there something I'm missing? Thanks in advance!

    Read the article

  • Doxygen ignoring inherited functions, when class inherits privately but the functions declared publi

    - by MichaelM
    Sorry for long winded title, this makes a lot more sense with an example. Suppose we have a class A: class A { public: void someFunction(); void someOtherFunction(); }; And another class that privately inherits from A. However, we re-declare one of the inherited functions as public: class B : private A { public: A::someFunction; } When this code is processed by Doxygen, it does not recognise the public declaration of someFunction in class B. Instead, it shows someFunction as a privately inherited function. This is incorrect. Is anybody aware of how to fix this? Cheers

    Read the article

  • Java - How to find count of items in a list in another list

    - by David Buckley
    Say I have two lists: List<String>products = new ArrayList<String>(); products.add("computer"); products.add("phone"); products.add("mouse"); products.add("keyboard"); List<String>cart = new ArrayList<String>(); cart.add("phone"); cart.add("monitor"); I need to find how many items in the cart list exist in the products list. For the lists above, the answer would be 1 (as phone is in products and cart). If the cart list was: List<String>cart = new ArrayList<String>(); cart.add("desk"); cart.add("chair"); The result would be 0. If cart contained computer, mouse, desk, chair, the result would be 2 (for computer and mouse). Is there something in the Apache Commons Collections or the Google Collections API? I've looked through them and see ways to get a bag count, but not from another list, although it's possible I'm missing something. Right now, the only way I can think of is to iterate over the cart items and see if products contains the individual item and keep a count. I can't use containsAll as I need the count (not a boolean), and that would fail if all items in cart didn't exist in the product list (which can happen). I'm using Java 1.6 if that matters.

    Read the article

  • help me to understand viewstate

    - by EquinoX
    I was just reading this article here to understand about how view state and ASP.NET page cycle works. I just don't understand this part here: If this were the case, then in step 3 the Label's Text property would be assigned to "Hello, World!" in the instantiation stage, but would not be reassigned to "Goodbye, Everyone!" in the load view state stage. Therefore, from the end user's perspective, the Label's Text property would be "Goodbye, Everyone!" in step 2, but would seemingly be reset to its original value ("Hello, World!") in step 3, after clicking the Empty Postback button. This paragraph is after the three step 1, step 2, step 3 boxes. Why wouldn't the label's text property be reassigned to "Goodbye, Everyone" in the load view state?

    Read the article

  • How do you deserialize a collection with child collections?

    - by Stuart Helwig
    I have a collection of custom entity objects one property of which is an ArrayList of byte arrays. The custom entity is serializable and the collection property is marked with the following attributes: [XmlArray("Images"), XmlArrayItem("Image",typeof(byte[]))] So I serialize a collection of these custom entities and pass them to a web service, as a string. The web service receives the string and byte array in tact, The following code then attempts to deserialize the collection - back into custom entities for processing... XmlSerializer ser = new XmlSerializer(typeof(List<myCustomEntity>)); StringReader reader = new StringReader(xmlStringPassedToWS); List<myCustomEntity> entities = (List<myCustomEntity>)ser.Deserialize(reader); foreach (myCustomEntity e in entities) { // ...do some stuff... foreach (myChildCollection c in entities.ChildCollection { // .. do some more stuff.... } } I've checked the XML resulting from the initial serialization and it does contain byte array - the child collection, as does the StringReader built above. After the deserialization process, the resulting collection of custom entites is fine, except that each object in the collection does not contain any items in its child collection. (i.e. it doesn't get to "...do some more stuff..." above. Can someone please explain what I am doing wrong? Is it possible to serialize ArrayLists within a generic collection of custom entities?

    Read the article

  • How can I add an Items-like property to my User Control?

    - by Dan Tao
    It's pretty straightforward to add simple properties to a User Control that will appear in the desired categories in the Windows Forms designer, e.g.: [Category("Appearance")] public Color BackColor { get { return _textBox.BackColor; } set { _textBox.BackColor = value; } } What if I want to expose a more complex property, such as a collection of items of a type I define? I'm thinking something along the lines of the ListView.Items property, or the DataGridView.Columns property -- where the user of the control can access this complex property via a more specialized pop-up form (as opposed to a simple TextBox or ComboBox). Even a simple nudge in the right direction would be much appreciated.

    Read the article

  • Can rdiff do incremental backups

    - by Mirage
    I am new to ubuntu , i have installed rdiff-backup. I have folder called sqlfiles on remote ftp server.The sql filesa are stored for last three days and then deleted. But i want to download the all copies to local computers I want to have incremental backups on my local server so that 1)If file is same then it should not be copied 2)if different , then overwrite it 3)If file is in local directory and not in FTP , then leave as it is How can i apply those rules to r-diff

    Read the article

  • Recover files after unsuccessful partitioning

    - by arsan
    I wanted to install another Linux on my computer, so I tried to resize one of my NTFS partitions with Norton Partition Magic. It didn't complete successfully, showed some errors, said that the partition is not resized and that it's the same size like before. But when I rebooted my computer I couldn't open that partition anymore and I am also not able to mount it from Linux. So this is my question: I had very important data on that partition - can I recover it? I guess nothing's deleted; it's just something messed up so it's not usable, but can I get it back? Please reply if there's any possible way of doing this, thank you.

    Read the article

  • Writing a blocking wrapper around twisted's IRC client

    - by Andrey Fedorov
    I'm trying to write a dead-simple interface for an IRC library, like so: import simpleirc connection = simpleirc.Connect('irc.freenode.net', 6667) channel = connection.join('foo') find_command = re.compile(r'google ([a-z]+)').findall for msg in channel: for t in find_command(msg): channel.say("http://google.com/search?q=%s" % t) Working from their example, I'm running into trouble (code is a bit lengthy, so I pasted it here). Since the call to channel.__next__ needs to be returned when the callback <IRCClient instance>.privmsg is called, there doesn't seem to be a clean option. Using exceptions or threads seems like the wrong thing here, is there a simpler (blocking?) way of using twisted that would make this possible?

    Read the article

  • SQL Server 2008: Using Multiple dts Ranges to Build a Set of Dates

    - by raoulcousins
    I'm trying to build a query for a medical database that counts the number of patients that were on at least one medication from a class of medications (the medications listed below in the FAST_MEDS CTE) and had either: 1) A diagnosis of myopathy (the list of diagnoses in the FAST_DX CTE) 2) A CPK lab value above 1000 (the lab value in the FAST_LABS CTE) and this diagnosis or lab happened AFTER a patient was on a statin. The query I've included below does that under the assumption that once a patient is on a statin, they're on a statin forever. The first CTE collects the ids of patients that were on a statin along with the first date of their diagnosis, the second those with a diagnosis, and the third those with a high lab value. After this I count those that match the above criteria. What I would like to do is drop the assumption that once a patient is on a statin, they're on it for life. The table edw_dm.patient_medications has a column called start_dts and end_dts. This table has one row for each prescription written, with start_dts and end_dts denoting the start and end date of the prescription. End_dts could be null, which I'll take to assume that the patient is currently on this medication (it could be a missing record, but I can't do anything about this). If a patient is on two different statins, the start and ends dates can overlap, and there may be multiple records of the same medication for a patient, as in a record showing 3-11-2000 to 4-5-2003 and another for the same patient showing 5-6-2007 to 7-8-2009. I would like to use these two columns to build a query where I'm only counting the patients that had a lab value or diagnosis done during a time when they were already on a statin, or in the first n (say 3) months after they stopped taking a statin. I'm really not sure how to go about rewriting the first CTE to get this information and how to do the comparison after the CTEs are built. I know this is a vague question, but I'm really stumped. Any ideas? As always, thank you in advance. Here's the current query: WITH FAST_MEDS AS ( select distinct statins.mrd_pt_id, min(year(statins.order_dts)) as statin_yr from edw_dm.patient_medications as statins inner join mrd.medications as mrd on statins.mrd_med_id = mrd.mrd_med_id WHERE mrd.generic_nm in ( 'Lovastatin (9664708500)', 'lovastatin-niacin', 'Lovastatin/Niacin', 'Lovastatin', 'Simvastatin (9678583966)', 'ezetimibe-simvastatin', 'niacin-simvastatin', 'ezetimibe/Simvastatin', 'Niacin/Simvastatin', 'Simvastatin', 'Aspirin Buffered-Pravastatin', 'aspirin-pravastatin', 'Aspirin/Pravastatin', 'Pravastatin', 'amlodipine-atorvastatin', 'Amlodipine/atorvastatin', 'atorvastatin', 'fluvastatin', 'rosuvastatin' ) and YEAR(statins.order_dts) IS NOT NULL and statins.mrd_pt_id IS NOT NULL group by statins.mrd_pt_id ) select * into #meds from FAST_MEDS ; --return patients who had a diagnosis in the list and the year that --diagnosis was given with FAST_DX AS ( SELECT pd.mrd_pt_id, YEAR(pd.init_noted_dts) as init_yr FROM edw_dm.patient_diagnoses as pd inner join mrd.diagnoses as mrd on pd.mrd_dx_id = mrd.mrd_dx_id and mrd.icd9_cd in ('728.89','729.1','710.4','728.3','729.0','728.81','781.0','791.3') ) select * into #dx from FAST_DX; --return patients who had a high cpk value along with the year the cpk --value was taken with FAST_LABS AS ( SELECT pl.mrd_pt_id, YEAR(pl.order_dts) as lab_yr FROM edw_dm.patient_labs as pl inner join mrd.labs as mrd on pl.mrd_lab_id = mrd.mrd_lab_id and mrd.lab_nm = 'CK (CPK)' WHERE pl.lab_val between 1000 AND 999998 ) select * into #labs from FAST_LABS; -- count the number of patients who had a lab value or a medication -- value taken sometime AFTER their initial statin diagnosis select count(distinct p.mrd_pt_id) as ct from mrd.patient_demographics as p join #meds as m on p.mrd_pt_id = m.mrd_pt_id AND ( EXISTS ( SELECT 'A' FROM #labs l WHERE p.mrd_pt_id = l.mrd_pt_id and l.lab_yr >= m.statin_yr ) OR EXISTS( SELECT 'A' FROM #dx d WHERE p.mrd_pt_id = d.mrd_pt_id AND d.init_yr >= m.statin_yr ) )

    Read the article

  • Return nested alias for linq expression

    - by Schotime
    I have the following Linq Expression var tooDeep = shoppers .Where(x => x.Cart.CartSuppliers.First().Name == "Supplier1") .ToList(); I need to turn the name part into the following string. x.Cart.CartSuppliers.Name As part of this I turned the Expression into a string and then split on the . and removed the First() argument. However, when I get to CartSuppliers this returns a Suppliers[] array. Is there a way to get the single type from this. eg. I need to get a Supplier back. Thanks

    Read the article

  • How do I strip multiple (optional) parts of a SQL string using .NET Regular Expressions?

    - by Luc
    I've been working on this for a few hours now and can't find any help on it. Basically, I'm trying to strip a SQL string into various parts (fields, from, where, having, groupBy, orderBy). I refuse to believe that I'm the first person to ever try to do this, so I'd like to ask for some advise from the StackOverflow community. :) To understand what I need, assume the following SQL string: select * from table1 inner join table2 on table1.id = table2.id where field1 = 'sam' having table1.field3 > 0 group by table1.field4 order by table1.field5 I created a regular expression to group the parts accordingly: select\s+(?<fields>.+)\s+from\s+(?<from>.+)\s+where\s+(?<where>.+)\s+having\s+(?<having>.+)\s+group\sby\s+(?<groupby>.+)\s+order\sby\s+(?<orderby>.+) This gives me the following results: fields => * from => table1 inner join table2 on table1.id = table2.id where => field1 = 'sam' having => table1.field3 > 0 groupby => table1.field4 orderby => table1.field5 The problem that I'm faced with is that if any part of the SQL string is missing after the 'from' clause, the regular expression doesn't match. To fix that, I've tried putting each optional part in it's own (...)? group but that doesn't work. It simply put all the optional parts (where, having, groupBy, and orderBy) into the 'from' group. Any ideas?

    Read the article

  • CSS float column extending over footer

    - by JD
    Hi, I am having a problem with my CSS whereby the right hand column in a 2 column layout is extending beyond the footer. I have tried playing with the clear: both; property but I cannot get it to work.. the second column has the id column2 both columns use the class column. The footer html has the id footerWrapper Both columns and footer are div tags. My CSS (abridged): .column { width: 49%; } #column2 { width: 50%; position: absolute; top: 0px; margin-left: 50%; float: left; } #footerWrapper { background-color: #333333; border-top: 2px #FF6600 solid; color: #666; }

    Read the article

  • ASP.NET MVC - Javascript array always passed to controller as null

    - by Xuan Vu
    I'm having some problem with passing a javascript array to the controller. I have several checkboxes on my View, when a checkbox is checked, its ID will be saved to an array and then I need to use that array in the controller. Here are the code: VIEW: var selectedSearchUsers = new Array(); $(document).ready(function () { $("#userSearch").click(function () { selectedSearchUsers.length = 0; ShowLoading(); $.ajax({ type: "POST", url: '/manage/searchusers', dataType: "json", data: $("#userSearchForm").serialize(), success: function (result) { UserSearchSuccess(result); }, cache: false, complete: function () { HideLoading(); } }); }); $(".userSearchOption").live("change", function () { var box = $(this); var id = box.attr("dataId"); var checked = box.attr("checked"); if (checked) { selectedSearchUsers.push(id); } else { selectedSearchUsers.splice(selectedSearchUsers.indexOf(id), 1); } }); $("#Send").click(function () { var postUserIDs = { values: selectedSearchUsers }; ShowLoading(); $.post("/Manage/ComposeMessage", postUserIDs, function (data) { }, "json"); }); }); When the "Send" button is clicked, I want to pass the selectedSearchUsers to the "ComposeMessage" action. Here is the Action code: public JsonResult ComposeMessage(List values) { //int count = selectedSearchUsers.Length; string count = values.Count.ToString(); return Json(count); } However, the List values is always null. Any idea why? Thank you very much.

    Read the article

  • C#: Drag & Drop with right mouse button

    - by stefan.at.wpf
    Hello, I'd like to do Drag & Drop with the right mouse button instead with the left one. However calling DragDrop.DoDragDrop() from MouseRightButtonDown instead of MouseLeftButtonDown doesn't do the job - DragDrop.DoDragDrop looks for mouse movements while holding down the left mouse button. Any idea how to realise Drag & Drop using the right mouse button? Thanks for any hint!

    Read the article

  • Project design / FS layout for large django projects

    - by rcreswick
    What is the best way to layout a large django project? The tutuorials provide simple instructions for setting up apps, models, and views, but there is less information about how apps and projects should be broken down, how much sharing is allowable/necessary between apps in a typical project (obviously that is largely dependent on the project) and how/where general templates should be kept. Does anyone have examples, suggestions, and explanations as to why a certain project layout is better than another? I am particularly interested in the incorporation of large numbers of unit tests (2-5x the size of the actual code base) and string externalization / templates.

    Read the article

  • When are Private Clouds a Good Idea?

    This article is taken from the book "The Cloud at Your Service." The authors define the term private cloud and discuss issues to consider before opting for private clouds and concerns about deploying a private cloud.

    Read the article

  • Un-table a cell range in Excel 2007

    - by Joe
    In Excel 2007, if you highlight a block of cells and then "Format as Table", it doesn't just apply colors and formatting, it somehow marks those cells as being a table. Now I want to get rid of the table, but keep all the cells (i.e. keep the data). So I tried clearing the table style and formatting, but Excel still recognizes those cells as being a table. I can tell because: When I select a cell that was in the table, Excel still displays the "Table Tools / Design" tab I cannot merge cells that were in the table <- this is what's annoying me So, how do I un-table those cells? I want to keep all the cell data and formatting, but have Excel not recognize them as a table.

    Read the article

  • new Facebook Like button for Blogger

    - by David
    I want to add the new facebook like button to my blogger website. http://developers.facebook.com/docs/reference/plugins/like I have to pass the url to the blog posts in the iframe src tag. I can get the blogger posts url from <data:post.url/> but I can't put that in a src string because Bloggers template system is weird. I want to do this:<iframe allowTransparency='true' frameborder='0' scrolling='no' src='http://www.facebook.com/plugins/like.php?href=<data:post.url/>&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;colorscheme=light' style='border:none; overflow:hidden; width:450px; height:px'/>but blogger complains: "Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: The value of attribute "src" associated with an element type "null" must not contain the '<' character." Anybody have this working yet?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >