Search Results

Search found 15316 results on 613 pages for 'coding style'.

Page 96/613 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • New "delay" keyword for JavaScript

    - by Van Coding
    I had a great idea for a new javascript keyword "delay", but I don't know what I can do to bring it to the new specification. Also I want to know what you guys think about it and if it's even realistic. What does the delay keyword ? The delay keyword does nothing more than stop the execution of the current stack and immediately continues to the next "job" in the queue. But that's not all! Instead of discarding the stack, it adds it to the end of the queue. After all "jobs" before it are done, the stack continues to execute. What is it good for? delay could help make blocking code non-blocking while it still looks like synchronous code. A short example: setTimeout(function(){ console.log("two"); },0); console.log("one"); delay; //since there is currently another task in the queue, do this task first before continuing console.log("three"); //Outputs: one, two, three This simple keyword would allow us to create a synchronous-looking code wich is asynchronous behind the scenes. Using node.js modules, for example, would no longer be impossible to use in the browser without trickery. There would be so many possibilites with such a keyword! Is this pattern useful? What can I do to bring this into the new ECMAscript specification? Note: I asked this previously on Stack Overflow, where it was closed.

    Read the article

  • Changing DisplayMode seems not to update Input&Graphic Dimension

    - by coding.mof
    I'm writing a small game using Slick and Nifty-GUI. At the program startup I set the DisplayMode using the following lines: AppGameContainer app = new ... app.setDisplayMode( 800, 600, false ); app.start(); I wrote a Nifty-ScreenController for my settings dialog in which the user can select the desired DisplayMode. When I try to set the new DisplayMode within this controller class the game window gets resized correctly but the Graphics and Input objects aren't updated accordingly. Therefore my rendering code just uses a part of the new window. I tried to set different DisplayModes in the main method to test if it's generally possible to invoke this method multiple times. It seems that changing the DisplayMode only works before I call app.start(). Furthermore I tried to update the Graphics & Input object manually but the init and setDimensions methods are package private. :( Does someone know what I'm doing wrong and how to change the DisplayMode correctly?

    Read the article

  • How would I go about setting a CSS gradient background in JavaScript?

    - by Dan
    The CSS gradient is described here, but I have no idea how to select for these properties in JavaScript. I would rather not use jQuery for this if at all possible. EDIT: Just doing the following doesn't seem to work... document.getElementById("selected-tab").style.background = "#860432"; document.getElementById("selected-tab").style.background = "-moz-linear-gradient(#b8042f, #860432)"; document.getElementById("selected-tab").style.background = "-o-linear-gradient(#b8042f, #860432)"; document.getElementById("selected-tab").style.background = "-webkit-gradient(linear, 0% 0%, 0% 100%, from(#b8042f), to(#860432))"; document.getElementById("selected-tab").style.background = "-webkit-linear-gradient(#b8042f, #860432)";

    Read the article

  • Free ASP.NET MVC 3 Training Videos from Pluralsight

    - by Vincent Maverick Durano
    Normal 0 false false false EN-PH X-NONE X-NONE MicrosoftInternetExplorer4 /* 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-priority:99; 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:10.0pt; font-family:"Times New Roman","serif";} For those who are interested: The course looks at the features of the ASP.NET MVC 3 framework, including the new Razor View Engine, the new unobtrusive AJAX features, NuGet Package Management and more.. http://www.asp.net/mvc/pluralsight

    Read the article

  • Styles for XAML (Silverlight &amp; WPF)

    - by GeekAgilistMercenary
    This is a quick walk through of how to setup things for skinning within a XAML Application.  First thing, find the App.xaml file within the WPF or Silverlight Project. Within the App.xaml file set some default styles for your controls.  I set the following for a button, label, and border control for an application I am creating. Button Control <Style x:Key="ButtonStyle" TargetType="Button"> <Setter Property="FontFamily" Value="Arial" /> <Setter Property="FontWeight" Value="Bold" /> <Setter Property="FontSize" Value="14" /> <Setter Property="Width" Value="180" /> <Setter Property="Height" Value="Auto" /> <Setter Property="Margin" Value="8" /> <Setter Property="Padding" Value="8" /> <Setter Property="Foreground" Value="AliceBlue" /> <Setter Property="Background" > <Setter.Value> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="Black" Offset="0" /> <GradientStop Color="#FF5B5757" Offset="1" /> </LinearGradientBrush> </Setter.Value> </Setter> </Style> Label Control <Style x:Key="LabelStyle" TargetType="Label"> <Setter Property="Width" Value="Auto"/> <Setter Property="Height" Value="28" /> <Setter Property="Foreground" Value="Black"/> <Setter Property="Margin" Value="8"/> </Style> Border Control <Style x:Key="BorderStyle" TargetType="Border"> <Setter Property="BorderThickness" Value="4"/> <Setter Property="Width" Value="Auto"/> <Setter Property="Height" Value="Auto" /> <Setter Property="Margin" Value="0,8,0,0"/> <Setter Property="CornerRadius" Value="18"/> <Setter Property="BorderBrush"> <Setter.Value> <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"> <GradientStop Color="CornflowerBlue" Offset="0" /> <GradientStop Color="White" Offset="1" /> </LinearGradientBrush> </Setter.Value> </Setter> </Style> These provide good examples of setting individual properties to a default, such as; <Setter Property="Width" Value="Auto"/> <Setter Property="Height" Value="Auto" /> Also for settings a more complex property, such as with a LinearGradientBrush; <Setter Property="BorderBrush"> <Setter.Value> <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"> <GradientStop Color="CornflowerBlue" Offset="0" /> <GradientStop Color="White" Offset="1" /> </LinearGradientBrush> </Setter.Value> </Setter> These property setters should be located between the opening and closing <Application.Resources></Application.Resources> tags. <Application x:Class="ScorecardAndDashboard.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> <Application.Resources> </Application.Resources> </Application> Now in the pages, user controls, or whatever you are marking up with XAML, for the Style Property just set a StaticResource such as shown below. <!-- Border Control --> <Border Name="borderPollingFrequency" Style="{StaticResource BorderStyle}"> <!-- Label Control --> <Label Content="Trigger Name:" Style="{StaticResource LabelStyle}"></Label> <!-- Button Control --> <Button Content="Save Schedule" Name="buttonSaveSchedule" Style="{StaticResource ButtonStyle}" HorizontalAlignment="Right"/> That's it.  Simple as that.  There are other ways to setup resource files that are separate from the App.xaml, but the App.xaml file is always a good quick place to start.  As moving the styles to a specific resource file later is a mere copy and paste. Original post is available along with other technical ramblings.

    Read the article

  • How to automatically restart Tomcat7 on system reboots?

    - by coding crow
    I have installed Tomcat 7 on Ubuntu 12.04 LTS which run on an Amzon EC2 instance. Now I wish tomcat should restart automatically on system reboot. I read this blog which suggest adding below script to /etc/init.d/tomcat7 # Tomcat auto-start # # description: Auto-starts tomcat # processname: tomcat # pidfile: /var/run/tomcat.pid case $1 in start) sh /usr/share/tomcat7/bin/startup.sh ;; stop) sh /usr/share/tomcat7/bin/shutdown.sh ;; restart) sh /usr/share/tomcat7/bin/shutdown.sh sh /usr/share/tomcat7/bin/startup.sh ;; esac exit 0 and issue the following commands sudo chmod 755 /etc/init.d/tomcat7 sudo ln -s /etc/init.d/tomcat7 /etc/rc1.d/K99tomcat sudo ln -s /etc/init.d/tomcat7 /etc/rc2.d/S99tomcat sudo /etc/init.d/tomcat7 restart My Questions The tomcat7 already has script in it, where do we have to paste the suggested script? Is the suggested procedure correct?

    Read the article

  • Find Label Control in Repeater Asp.net

    - by user2769165
    I am using repeater and I want to find the label control in my repeater. here is my code <asp:Repeater ID="friendRepeater" runat="server"> <table cellpadding="0" cellspacing="0"> <ItemTemplate> <tr style=" width:700px; height:120px;"> <td> <div style=" padding-left:180px;"> <div id="leftHandPost" style="float:left; width:120px; height:120px; border: medium solid #cdaf95; padding-top:5px;"> <div id="childLeft" style=" padding-left:5px;"> <div id="photo" style=" border: thin solid black; width:100px;height:100px;"> <asp:Image id="photoImage" runat="server" ImageUrl='<%# String.Concat("Images/", Eval("Picture")) %>' Width="100px" Height="100px" /> </div> </div><!--childLeft--> </div><!--leftHandPost--> </div> </td> <td> <div id="rightHandPost" style=" float:right; padding-right:260px;"> <div id="childRight" style="width:400px; height:120px; border: medium solid #cdaf95; padding-top:5px; padding-left:10px;"> <strong><asp:Label id="lblName" runat="server"><%# Eval("PersonName") %></asp:Label></strong><br /> <div style=" float:right; padding-right:10px;"><asp:Button runat="server" Text="Add" onClick="add" /></div><br /> <asp:Label id="lblID" runat="server"><%# Eval("PersonID") %></asp:Label><br /> <asp:Label id="lblEmail" runat="server"><%# Eval("Email") %></asp:Label> </div><!--childRight--> </div><!--rightHandPost--> </td> </tr> </ItemTemplate> <AlternatingItemTemplate> <tr style=" width:700px; height:120px;"> <td> <div style=" padding-left:180px;"> <div id="Div1" style="float:left; width:120px; height:120px; border: medium solid #cdaf95; padding-top:5px;"> <div id="Div2" style="padding-left:5px;"> <div id="Div3" style=" border: thin solid black; width:100px;height:100px;"> <asp:Image id="photoImage" runat="server" ImageUrl='<%# String.Concat("Images/", Eval("Picture")) %>' Width="100px" Height="100px" /> </div> </div><!--childLeft--> </div><!--leftHandPost--> </div> </td> <td> <div id="Div4" style=" float:right; padding-right:260px;"> <div id="Div5" style="width:400px; height:120px; border: medium solid #cdaf95; padding-top:5px; padding-left:10px;"> <strong><asp:Label id="lblName" runat="server"><%# Eval("PersonName")%></asp:Label></strong> <div style=" float:right; padding-right:10px;"><asp:Button id="btnAdd" runat="server" Text="Add" onClick="add"></asp:Button></div><br /> <br /> <asp:Label id="lblID" runat="server"><%# Eval("PersonID") %></asp:Label><br /> <asp:Label id="lblEmail" runat="server"><%# Eval("Email") %></asp:Label> </div><!--childRight--> </div><!--rightHandPost--> </td> </tr> </AlternatingItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> Here is the code behind for the add button. protected void add(object sender, EventArgs e) { DateTime date = DateTime.Now; System.Web.UI.WebControls.Label la = (System.Web.UI.WebControls.Label)friendRepeater.FindControl("PersonID"); String id = la.Text; try { MySqlConnection connStr = new MySqlConnection(); connStr.ConnectionString = "Server = localhost; Database = healthlivin; Uid = root; Pwd = khei92;"; String insertFriend = "INSERT INTO contactFriend(friendID, PersonID, PersonIDB, date) values (@id, @personIDA, @personIDB, @date)"; MySqlCommand cmdInsertStaff = new MySqlCommand(insertFriend, connStr); cmdInsertStaff.Parameters.AddWithValue("@id", "F000004"); cmdInsertStaff.Parameters.AddWithValue("@personIDA", "M000001"); cmdInsertStaff.Parameters.AddWithValue("@personIDB", id); cmdInsertStaff.Parameters.AddWithValue("@date", date); connStr.Open(); cmdInsertStaff.ExecuteNonQuery(); MessageBox.Show("inserted"); connStr.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } I have get the error of Object reference not set to an instance of an object. I think is because there are no value in the Label. The Find Control are not working. May I know how can fix this problem? Thank you very much

    Read the article

  • Silverlight with using of DependencyProperty and ControlTemplate

    - by Taras
    Hello everyone, I'm starting to study Silverlight 3 and Visual Studio 2008. I've been trying to create Windows sidebar gadget with button controls that look like circles (I have couple of "roundish" png images). The behavior, I want, is the following: when the mouse hovers over the image it gets larger a bit. When we click on it, then it goes down and up. When we leave the button's image it becomes normal sized again. Cause I'm going to have couple of such controls I decided to implement custom control: like a button but with image and no content text. My problem is that I'm not able to set my custom properties in my template and style. What am I doing wrong? My teamplate control with three additional properties: namespace SilverlightGadgetDocked { public class ActionButton : Button { /// <summary> /// Gets or sets the image source of the button. /// </summary> public String ImageSource { get { return (String)GetValue(ImageSourceProperty); } set { SetValue(ImageSourceProperty, value); } } /// <summary> /// Gets or sets the ratio that is applied to the button's size /// when the mouse control is over the control. /// </summary> public Double ActiveRatio { get { return (Double)GetValue(ActiveRatioProperty); } set { SetValue(ActiveRatioProperty, value); } } /// <summary> /// Gets or sets the offset - the amount of pixels the button /// is shifted when the the mouse control is over the control. /// </summary> public Double ActiveOffset { get { return (Double)GetValue(ActiveOffsetProperty); } set { SetValue(ActiveOffsetProperty, value); } } public static readonly DependencyProperty ImageSourceProperty = DependencyProperty.Register("ImageSource", typeof(String), typeof(ActionButton), new PropertyMetadata(String.Empty)); public static readonly DependencyProperty ActiveRatioProperty = DependencyProperty.Register("ActiveRatio", typeof(Double), typeof(ActionButton), new PropertyMetadata(1.0)); public static readonly DependencyProperty ActiveOffsetProperty = DependencyProperty.Register("ActiveOffset", typeof(Double), typeof(ActionButton), new PropertyMetadata(0)); public ActionButton() { this.DefaultStyleKey = typeof(ActionButton); } } } And XAML with styles: <UserControl x:Class="SilverlightGadgetDocked.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:SilverlightGadgetDocked="clr-namespace:SilverlightGadgetDocked" Width="130" Height="150" SizeChanged="UserControl_SizeChanged" MouseEnter="UserControl_MouseEnter" MouseLeave="UserControl_MouseLeave"> <Canvas> <Canvas.Resources> <Style x:Name="ActionButtonStyle" TargetType="SilverlightGadgetDocked:ActionButton"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="SilverlightGadgetDocked:ActionButton"> <Grid> <Image Source="{TemplateBinding ImageSource}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="DockedActionButtonStyle" TargetType="SilverlightGadgetDocked:ActionButton" BasedOn="{StaticResource ActionButtonStyle}"> <Setter Property="Canvas.ZIndex" Value="2"/> <Setter Property="Canvas.Top" Value="10"/> <Setter Property="Width" Value="30"/> <Setter Property="Height" Value="30"/> <Setter Property="ActiveRatio" Value="1.15"/> <Setter Property="ActiveOffset" Value="5"/> </Style> <Style x:Key="InfoActionButtonStyle" TargetType="SilverlightGadgetDocked:ActionButton" BasedOn="{StaticResource DockedActionButtonStyle}"> <Setter Property="ImageSource" Value="images/action_button_info.png"/> </Style> <Style x:Key="ReadActionButtonStyle" TargetType="SilverlightGadgetDocked:ActionButton" BasedOn="{StaticResource DockedActionButtonStyle}"> <Setter Property="ImageSource" Value="images/action_button_read.png"/> </Style> <Style x:Key="WriteActionButtonStyle" TargetType="SilverlightGadgetDocked:ActionButton" BasedOn="{StaticResource DockedActionButtonStyle}"> <Setter Property="ImageSource" Value="images/action_button_write.png"/> </Style> </Canvas.Resources> <StackPanel> <Image Source="images/background_docked.png" Stretch="None"/> <TextBlock Foreground="White" MaxWidth="130" HorizontalAlignment="Right" VerticalAlignment="Top" Padding="0,0,5,0" Text="Name" FontSize="13"/> </StackPanel> <SilverlightGadgetDocked:ActionButton Canvas.Left="15" Style="{StaticResource InfoActionButtonStyle}" MouseLeftButtonDown="imgActionInfo_MouseLeftButtonDown"/> <SilverlightGadgetDocked:ActionButton Canvas.Left="45" Style="{StaticResource ReadActionButtonStyle}" MouseLeftButtonDown="imgActionRead_MouseLeftButtonDown"/> <SilverlightGadgetDocked:ActionButton Canvas.Left="75" Style="{StaticResource WriteAtionButtonStyle}" MouseLeftButtonDown="imgActionWrite_MouseLeftButtonDown"/> </Canvas> </UserControl> And Visual Studio reports that "Invalid attribute value ActiveRatio for property Property" in line 27 <Setter Property="ActiveRatio" Value="1.15"/> VERY BIG THANKS!!!

    Read the article

  • Howto: Configure Spring-WS to publish WSDL files with a '?WSDL' style URL?

    - by Darren
    I am trying to configure web service proxying using Mule ESB. I am attempting to do this using Mule's WSProxyService, but after stepping through the corresponding code (with the debugger), it is clear that this class replaces endpoint addresses. The problem is Spring-WS WSDL addresses are of the style http://xxxx/xxxx.wsdl, but WSProxyService expects http://xxxx/xxxx?wsdl or http://xxxx/xxxx&wsdl. It replaces the remote endpoint addresses with the local WSDL address; it cuts the remote WSDL address at the question mark i.e. '?WSDL' is intended to be chopped off, so to create the search term. But because of Spring-WS, this does not work. To break it down: WSProxyService ends up trying to use http://xxxx/xxxx.wsdl to replace http://xxxx/xxxx with http://yyyy/yyyy which fails... leading to actual web service call going direct and not through the proxy. Has anyone ever noticed/solved this problem?? Cheers, Darren

    Read the article

  • Is there a Drupal module for Forms with powerful CRUD style behaviour?

    - by Petras
    We are building a website that contains a large number of database tables that need to be edited by the CMS administrator. Some of the tables are fed by form submissions from users on the front end of the website. Some of the tables are purely in the CMS and are used to create custom modules on the front end of the website. Although there is a forms module in Drupal, I think our requirements cannot be met by it. Does anyone know of a system that allows forms to be saved to a CRUD style database with the following features? Export of all database fields. View a summary of the records in a filterable table. With paging You can have one to many relationships in records eg To code this manually for 10 forms is A LOT of work. Particularly the one to many relationships. If there is a powerful module available it would save us writing one.

    Read the article

  • How do I blur (ios7 style) a section of an image in a UITableViewCell?

    - by George McKibbin
    I've got a UIImageView that takes up the whole cell and shows an image. I'd like to blur the bottom third of the view in the iOS7 style (we're targeting iOS7). There will be a label over the blurred part. The issue seems to be that I can't "screenshot" the UIImageView right as I am setting up the cell in tableView:cellForRowAtIndexPath: as it hasn't loaded yet. Although i've even tried setting up a timer for a 0.1 second delay and that also doesn't work. I've tried the stuff on http://damir.me/posts/ios7-blurring-techniques I've tried https://github.com/justinmfischer/7blur I'd like to use the new screenshotting API drawViewHierarchyInRect:afterScreenUpdates: I'd also like to use apple's sample code UIImage+ImageEffects The only thing that has worked so far has been to just put a UIToolbar in but the performance is really slow. I don't need dynamic updates. I've managed to get the following effect a few times but it has just tinted the view and hasn't actually blurred anything so I'm a bit confused.

    Read the article

  • How to Add Css style sheet on DevExpress Gridview?

    - by Phsika
    i have big problem about CssFilePath property in ASPXGridView . also used Theme Deployer. i created ASPXGRidView that is goog in 9.3.4 version not problem is occured but i upgrated my system to 2010.2 version (Last version) but GridView CssFilePath not working my GridView looks html table. How can i solve it : i converted my project devexpress 9.3.4 to 2010.2 but My Working gridView look like this:TEST.ASCX has got a DevExpress GridView. <Styles CssFilePath="../../App_Themes/Aqua/GridView/styles.css" CssPostfix="Aqua"></Styles> i see asp.net design mode Aqua mode every thing ok. But press f5 my Gridview look above! how can i see aqua style...

    Read the article

  • How can I set the line style of a specific cell in a QTableView?

    - by Bob Nelson
    I am working with a QT GUI. I am implementing a simple hex edit control using a QTableView. My initial idea is to use a table with seventeen columns. Each row of the table will have 16 hex bytes and then an ASCII representation of that data in the seventeenth column. Ideally, I would like to edit/set the style of the seventeenth column to have no lines on the top and bottom of each cell to give the text a free flowing appearance. What is the best way to approach this using the QTableView?

    Read the article

  • Does Amazon S3's HTTP Uploads feature support web-hook style callbacks?

    - by Gabe Hollombe
    When uploading files to Amazon S3 using the browser http upload feature, I know I can specify a success_action_redirect field/value that will tell my browser where to go when the upload is done. I'm wondering: is it possible to ask Amazon to make a web hook style POST request to my web server whenever a file gets uploaded? Basically, I want a way of being notified whenever a client uploads a new file, so that my server can process the upload. I'd like to do this without relying on the client to make the request to my server to tell me the file has been uploaded (never trust the client, right?).

    Read the article

  • dynamic grid style form that lets you update multiple rows in a single post in asp.net mvc

    - by Charlie Bear
    I'm starting out with MVC but not sure it's the best option. I need to create a form that is based upon a collection. Eg it might look like this: product Price Item 1 [textbox] Item 2 [textbox] [submit button] where "item" is pulled from the database and textbox allows users to update the price. essentially this is a type of datagrid but i don't want webforms style update each row one at a time i need to update the entire set of text boxes in one post. Ideally I don't want a javascript based solution as it has to work without javascript. Is this possible in MVC or should I stick to webforms (where I could do this in a repeater by iterating through he repeater items on postback)

    Read the article

  • WPF - How do I style a row based on a binding property value?

    - by Nick
    Hey! So I am trying to bind a collection of objects (IList<) to a WPF datagrid. I would like to make the row background a different color if the 'artist' property is null or empty. I am checking the value stored at the property on the LoadingRow datagrid event. Currently my implementation seems to style all of the rows with an empty or null 'artist' property correctly. The problem is that is also styles the rows where the property is not null or empty in some cases. So some rows are given the red background even though the rows 'artist' property is not null. Can anyone tell me why this could be?? Here is the LoadingRow event: private void trackGrid_LoadingRow(object sender, DataGridRowEventArgs e) { Track t = e.Row.DataContext as Track; if (String.IsNullOrEmpty(t.Artist)) { e.Row.Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 125, 125)); } }

    Read the article

  • What is the best way to clear the CSS style "float"?

    - by Sam Saffron
    I'm pretty accustomed to clearing my floats by using <br style="clear:both"/> but stuff keeps on changing and I am not sure if this is the best practice. There is a CSS hack (from positioneverything) available that lets you achieve the same result without the clearing div. But... they claim the hack is a little out of date and instead you perhaps should look at this hack. But.. after reading through 700 pages of comments :) it seems there may be some places the latter hack does not work. I would like to avoid any javascript hacks cause I would like my clearing to work regardless of javascript being enabled. What is the current best practice for clearing divs in a browser independent way?

    Read the article

  • WPF - How to style the menu control to remove the left margin?

    - by BrianLy
    I have added a default menu control into my user control. It is being combined with some other controls as part of a custom Window chrome. I need to style the menu to make it appear simpler. The main thing I need to do is to remove the left margin containing the space for the icon or checkbox. How can I do this? XAML: <Menu> <MenuItem Header="MyMeny" FontSize="10"> <MenuItem Header="Options..." /> <MenuItem Header="About" /> </MenuItem> </Menu>

    Read the article

  • How do i style a JSON feed in my view?

    - by stephenmurdoch
    My rails app gets the following JSON feed from mixcloud and sticks the results into my index page At the moment when I do this, the entire contents of my feed are displayed unformatted in one big blob of scary looking text (without the curly JSON brackets) I only want to display specific values from the feed in the view. From the feed in question lets say for simplicity that I just wanted to display all values with a key of "url" In case I'm doing something wrong here's my code: # podcast controller def index # I'm using a class method to get the feed @feed = Podcast.feed end # podcast model def self.feed feed = JSON.parse(open("http://api.mixcloud.com/alivefrommaryhill/feed").read) end # index.html.haml .feed = @feed I can't figure out how to style the results and display only certain items from the feed. Is my approach wrong?

    Read the article

  • Echo mysql results in a loop?

    - by Roy D. Porter
    I am using turn.js to make a book. Every div within the 'deathnote' div becomes a new page. <div id="deathnote"> //starts book <div style="background-image:url(images/coverpage.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page </div> //ends book What I am doing is trying to get 3 'content' (content being a name and cause of death) divs onto 1 page, and then generate a new page. So here is what i want: <div id="deathnote"> //starts book <div style="background-image:url(images/coverpage.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"> //creates new page but leaves it open <div> CONTENT </div> <div> CONTENT </div> <div> CONTENT </div> </div> //ends the page </div> //ends book Seems simple enough, however the content is data from a MySQL DB, so i have to echo it in using PHP. Here is what i have so far <div id="deathnote"> <div style="background-image:url(images/coverpage.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <?php $pagecount = 0; $db = new mysqli('localhost', 'username', 'passw', 'DB'); if($db->connect_errno > 0){ die('Unable to connect to database [' . $db->connect_error . ']'); } $sql = <<<SQL SELECT * FROM `TABLE` SQL; if(!$result = $db->query($sql)){ die('There was an error running the query [' . $db->error . ']'); } //IGNORE ALL OF THE GARBAGE ABOVE. IT IS SIMPLE CONNECTING SCRIPT THAT I KNOW WORKS //THE METHOD I AM HAVING TROUBLE WITH IS BELOW $pagecount = 0; while($row = $result->fetch_assoc()){ //GETS THE VALUE (and makes sure it isn't nothing echo '<div style="background-image:url(images/paper.jpg);">'; //THIS OPENS A NEW PAGE while ($pagecount !== 3) { //KEEPS COUNT OF HOW MUCH CONTENT DIVS IS ON THE PAGE while($row = $result->fetch_assoc()){ //START A CONTENT DIV echo '<div class="content"><div class="name">' . $row['victim'] . '</div><div class="cod">' . $row['cod'] . '</div></div>'; //END A CONTENT DIV $pagecount++; //UP THE PAGE COUNT } } $pagecount=0; //PUT IT BACK TO 0 echo '</div>'; //END PAGE } $db->close(); ?> <div style="background-image:url(images/backpage.jpg);"></div> //BACK PAGE </div> At the moment i seem to be causing and infinite loop so the page won't load. The problem resides within the while loops. Any help is greatly appreciated. Thanks in advance guys. :)

    Read the article

  • Query in sql involving joins of two table

    - by Satish
    I have two tables reports and holidays. reports: (username varchar(30),activity varchar(30),hours int(3),report_date date) holidays: (holiday_name varchar(30), holiday_date date) select * from reports gives +----------+-----------+---------+------------+ | username | activity | hours | date | +----------+-----------+---------+------------+ | prasoon | testing | 3 | 2009-01-01 | | prasoon | coding | 4 | 2009-01-03 | | prasoon | coding | 4 | 2009-01-06 | | prasoon | coding | 4 | 2009-01-10 | +----------+-----------+---------+------------+ select * from holidays gives +--------------+---------------+ | holiday_name | holiday_date | +--------------+---------------+ | Diwali | 2009-01-02 | | Holi | 2009-01-05 | +--------------+---------------+ Is there any way by which I can output the following? +-------------+-----------+---------+-------------------+ | date | activity | hours | holiday_name | +-------------+-----------+---------+-------------------+ | 2009-01-01 | testing | 3 | | | 2009-01-02 | | | Diwali | | 2009-01-03 | coding | 4 | | | 2009-01-04 | Absent | Absent | | | 2009-01-05 | | | Holi | | 2009-01-06 | coding | 4 | | | 2009-01-07 | Absent | Absent | | | 2009-01-08 | Absent | Absent | | | 2009-01-09 | Absent | Absent | | | 2009-01-10 | coding | 4 | | +-------------+-----------+---------+-------------------+ In other words I want to fill the activity and hours columns with "Absent" on the dates which are neither in table reports nor in table holidays. How can I write a specific query for it. The query should give the output between two specific dates.

    Read the article

  • CSS - How to Style a Selected Radio Buttons Label?

    - by AnApprentice
    Hello, I want to add a style to a radio button's selected label: HTML: <div class="radio-toolbar"> <label><input type="radio" value="all" checked>All</label> <label><input type="radio" value="false">Open</label> <label><input type="radio" value="true">Archived</label> </div> CSS .radio-toolbar input[type="radio"] {display:none;} .radio-toolbar label { background:Red; border:1px solid green; padding:2px 10px; } .radio-toolbar label + input[type="radio"]:checked { background:pink !important; } Any ideas what I'm doing wrong?

    Read the article

  • What's the most straightforward way to typeset MLA-style college essays in LaTeX?

    - by bcat
    I've been using LaTeX for a little while now to typeset my algorithms homework, and I really like the quality of the output as well as the ease-of-use. I'd like to starting using LaTeX in other classes as well, but non–computer-science subjects have more stringent formatting requirements than I've come across in CS. Most classes that require essays want them to be formatted in MLA style, but I'm not sure what to best way to do that using LaTeX is. I've tried Googling "latex mla" and other similar things, but I've found many different MLA templates, and my LaTeX skills aren't good enough to determine which is the best. Is anyone else using LaTeX for "normal" essays, and, if so, how are you doing it?

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >