Search Results

Search found 9 results on 1 pages for 'mariki'.

Page 1/1 | 1 

  • Algorithm for perfect non-binary graph layout

    - by mariki
    I have a complex non-binary graph model. Each tree node can have multiple children&parents (a node can also have a connection to it's "brother"). A node is represented as square on screen with lines to the connected nodes. For that I want to use Draw2D and GEF libraries. The problem I am facing is the graph layout. I need a nice algorithm that can reposition the square nodes and the connections with minimum intersections and also make it symmetric as possible.

    Read the article

  • SQL's Rownumber with Linq-to-entities

    - by mariki
    I am converting my project to use EF and also want to covert stored procedures into Linq-to-entities queries. This my SQL query (simple version) that I have trouble to convert: SELECT CategoryID, Title as CategoryTitle,Description, LastProductTitle,LastProductAddedDate FROM ( SELECT C.CategoryID, C.Title,C.Description, C.Section, P.Title as LastProductTitle, P.AddedDate as LastProductAddedDate, ROW_NUMBER() OVER (PARTITION BY P.CategoryID ORDER BY P.AddedDate DESC) AS Num FROM Categories C LEFT JOIN Products P ON P.CategoryID = C.CategoryID ) OuterSelect WHERE OuterSelect.Num = 1 In words: I want to return all Categories (from Categories table) and title and date of addition of the product (from Products table) that was added last to this category. How can I achieve this using Entity frame work query? In most efficient way.

    Read the article

  • Slide div inside another div effect

    - by mariki
    I am trying to create sliding images effect: Online demolink text. The problem is when you click rapidly and randomly on the buttons and not wait for animation to finish causing unpredicted results and even stopping the functionality to work. (and once it stopped in the middle of 2 images...) How Can I make it work without bugs? I know that there are some other tools for that sliding like jquery and other approaches like changing the position attribute and not the scrollLeft attribute. But I want to do it as it is, with scrollLeft, if it possible of course. The Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> body { padding:0px; margin:0px; } #imageContainer { width: 500px; position: relative; } #div { overflow: hidden; white-space: nowrap; } #div img { cursor: pointer; vertical-align: bottom; width: 500px; padding:0px; margin:0px; display:inline; } </style> <script type="text/javascript"> var scrollIntervalID; var currentIndex=0; function Scroll(ind){ var dir = ind ==currentIndex?0:ind<currentIndex?-1:1; var steps = Math.abs(ind-currentIndex); scrollIntervalID = setInterval(function(){ var i=(steps*10)-1; return function(){ if (i <= 0) clearInterval(scrollIntervalID); var elm = document.getElementById("div"); elm.scrollLeft +=dir * 50; i--; document.getElementById("span").innerHTML=elm.scrollLeft; } }(), 15); currentIndex=ind; } </script> </head> <body> <div id="imageContainer"> <div id="div"> <img id="image1" src="Images/pic1.jpg" width="500px"/><img id="image2" src="Images/pic2.jpg" width="500px"/><img id="image3" src="Images/pic3.jpg" width="500px"/><img id="image4" src="Images/pic4.jpg" width="500px"/> </div> </div> <div> <input type="button" value="1" onclick="Scroll(0);"/> <input type="button" value="2" onclick="Scroll(1);"/> <input type="button" value="3" onclick="Scroll(2);"/> <input type="button" value="4" onclick="Scroll(3);"/> </div> <span id="span"></span> </body> </html>

    Read the article

  • SQL Query with conditional JOIN

    - by mariki
    The scenario: Table1 CatId|Name|Description Table2 ItId|Title|Date|CatId (foreign key) I want to return all rows from Table1 and Title,Date from Table2, where The returned from Table 2 must be the Latest one by the date column. (in second table there many items with same CatId and I need just the latest) I have 2 queries but can't merge them together: Query 1: SELECT Table1.Name, Table1.Description, Table2.Title, Table2.Date FROM Table1 LEFT JOIN Table2 ON Table1.CatId=Table2.CatId Query2: SELECT TOP 1 Table2.Title, Table2.Date FROM Table2 WHERE Table2.CatId = @inputParam ORDER BY Table2.Date DESC

    Read the article

  • Setting id to a panel control in gridview

    - by mariki
    I have a panel control in gridview's template. I need to hide/unhide panel in javascript function, for that i need to pass panel's id to the javascript. The problem is that all panels have the same id in gridview, so I need to set unique id to each panel. I tried to do: <asp:Panel id= "Panel_<%# Eval("ID")%>" and some other variations but always get an error. The panel contains some other controls, I need it to be server side because I need to set at code-behind (after checking if user is authenticated) What can I do? p.s. It doesn't have to be Panel, any other control that I can find with Findcontrol and can hold other controls.

    Read the article

  • Dynamic content in a Gridview

    - by mariki
    I have a gridview with couple of columns,I want to achieve the following: If user is NOT authorized display normal columns. If user IS authorized: set mouseover event for first column text and display some buttons (that are not available for NOT authorized users) in a second column when user hover over(using javascript) the first column. I am have 2 difficulties: The first one where and when should I create the buttons? I have 2 options, I can create those button on design time, in gridviews template and just set Visible value to false and then in codebehind set it to true if user is authorized. The second option would be creating this buttons dynamically in gridview_RowCreated event (or any other event) if user is authorized. The Second difficulty is setting the javascript event to show the buttons, the event should be added only if user is authorized! Note that event and buttons should have some kind of id match for Javascript function to know what should it hide/unhide when event is triggered. What should I do, what is the best practice? I know this is a long question, but please try to help :)

    Read the article

  • Prevent bubbling without Jquery

    - by mariki
    When I move mouse over the container panel, the child panel is displayed but as soon as i move mouse over the child panel, the mouseout event is triggered and panel get hidden. This is simplified version of my code because panels are located inside gridview and therefore i can't use document.getElementById("panelchild") as it is (the js will get the specific id latter), but for now i want to make it work for this simple case. This is the partial script: <script type="text/javascript"> function ShowPanel(e) { // e = e || window.event; // var evtSrc = e.target || e.srcElement; var panel = document.getElementById("panelchild") if (panel.style.display == "none") panel.style.display = ""; else panel.style.display = "none"; } </script> This is the markup: <asp:Panel id="panelContainer" runat="server" onmouseover="ShowPanel(event)" onmouseout="ShowPanel(event)" > <asp:HyperLink ID="lnkTitle" runat="server" style="float:left;margin-right:10px;" Text="This is title" NavigateUrl="www" /> <asp:Panel id="panelchild" runat="server" style="display:none" > <a id="A1" href="javascript: void(0);" style="text-decoration: none;"> <img src="mylocalsite/images/Misc_Edit.gif" style="border:0px;float:left;" /> </a> </asp:Panel> </asp:Panel>

    Read the article

1