Daily Archives

Articles indexed Sunday September 30 2012

Page 7/14 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Returning more than one result

    - by Hairr
    I'm using the following code: def recentchanges(bot=False,rclimit=20): """ @description: Gets the last 20 pages edited on the recent changes and who the user who edited it """ recent_changes_data = { 'action':'query', 'list':'recentchanges', 'rcprop':'user|title', 'rclimit':rclimit, 'format':'json' } if bot is False: recent_changes_data['rcshow'] = '!bot' else: pass data = urllib.urlencode(recent_changes_data) response = opener.open('http://runescape.wikia.com/api.php',data) content = json.load(response) pages = tuple(content['query']['recentchanges']) for title in pages: return title['title'] When I do recentchanges() I only get one result. If I print it though, all the pages are printed. Am I just misunderstanding or is this something relating to python? Also, opener is: cj = CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))

    Read the article

  • Win8: Accessing page elements in default.html outside of default.js

    - by Arvin
    I have the following page elements within default.html: <div id ="content"> <div id="output"></div> </div> And within default.js: ... args.setPromise(WinJS.UI.processAll().done(function() { var theOutput = document.getElementById("output"); theOutput.innerText = "This is the output"; })); .... This successfully produces the app that just has the text "This is the output" But if I move this into a new script script.js: (function () { "use strict"; var theOutput = document.getElementById("output"); theOutput.innerText = "This is the output"; }()); And added script.js as a script reference in default.html: <script src="/js/script.js"></script><script src="/js/script.js"></script> I get the error JavaScript runtime error: Unable to set property 'innerText' of undefined or null reference How do I access the output div in other scripts outside of default.js?

    Read the article

  • How to add or remove a value inside a table cell on selection / de-selection of checkbox of that row, trying to submit the value via Jquery?

    - by Raul
    Here is the table: <%= form_tag '', :id => "costs" do %> <table class="table table-bordered" id="service_cost"> <% @services.each do |service| %> <tbody> <tr> <td><%= check_box_tag :open_service, {}, false, :class => 'checkable' %></td> <td><%= service.phone %></td> <td><%= service.internet %></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td><%= service.house_keeping %> </td> <td>0.0 </td> <td><%= service.laundry %></td> <td><%= text_field_tag "service_cost", service.total, :class => "input-small" %></td> </tr> <% end %> when the form gets submitted, the javascript gets into action: $("#costs").submit(function(){ formData=$("#costs").serializeArray(); processFormData(formData) return false; }); This ensures form submission on selecting the checkbox: $('.checkable').live('change', function() { $(this).parents('form:first').submit(); }); But, what I am looking for is adding or removing a cell value based on checkbox selection/de-selection and submitting it, kindly suggest a way to do it.

    Read the article

  • Having a base class function depend on its child class C#

    - by Junk Junk
    I have a Base class with a method that a child class will almost always override. However, instead of replacing the base class' method entirely, I would like for whatever is derived in the child class to be added to what is already in the base class. For Example: class BaseClass public string str() { var string = "Hello my name is" ; } class ChildClass : BaseClass public override string str(){ var string = "Sam"; } The point is that if I want to access the str() method by creating an instance of the ChildClass, the string will print out as "Hello, my name is Sam". I've been looking around and all I have been finding is that this should NOT happen, as the base class shouldn't even know that it is being inherited. So, if the design is false, how would I go about doing this? Keep in mind that there will be multiple child classes inheriting from BaseClass. Thank you

    Read the article

  • protected internal

    - by adfs
    The C# Language Reference on MSDN defines that protected internal as "Access is limited to the current assembly or types derived from the containing class". But from the semantic point of protected internal" sounds to me like both protected and internal which means the member will accessible only to those derived classes with in the same assembly. Is there any access modified that has a meaning to the same effect?

    Read the article

  • Find all the child node of specific value in C#

    - by sara brown
    <main> <myself> <pid>1</pid> <name>abc</name> </myself> <myself> <pid>2</pid> <name>efg</name> </myself> </main> that is my XML file named simpan. I have two button. next and previous. What i want to do is, all the info will shows off on the TextBox when the user click the button. The searching node will be based on the pid. Next button will adding 1 value of pid (let's say pid=2) and it will search on the node that have the same value of pid=2. it also will show the name for the pid=2. (showing name=abc) Same goes to the previous button where it will reduce 1value of pid (pid=1). Does anybody knows how to do this? //-------------EDIT------------------ thanks to L.B, im trying to use his code. however i got an error. is my implementation of code correct? private void previousList_Click(object sender, EventArgs e) { pid = 14; XDocument xDoc = XDocument.Parse("C:\\Users\\HDAdmin\\Documents\\Fatty\\SliceEngine\\SliceEngine\\bin\\Debug\\simpan.xml"); var name = xDoc.Descendants("myself") .First(m => (int)m.Element("PatientID") == pid) .Value; textETA.Text = name; //////////////////// }

    Read the article

  • Functional Programming - Lots of emphasis on recursion, why?

    - by peakit
    I am getting introduced to Functional Programming [FP] (using Scala). One thing that is coming out from my initial learnings is that FPs rely heavily on recursion. And also it seems like, in pure FPs the only way to do iterative stuff is by writing recursive functions. And because of the heavy usage of recursion seems the next thing that FPs had to worry about were StackoverflowExceptions typically due to long winding recursive calls. This was tackled by introducing some optimizations (tail recursion related optimizations in maintenance of stackframes and @tailrec annotation from Scala v2.8 onwards) Can someone please enlighten me why recursion is so important to functional programming paradigm? Is there something in the specifications of functional programming languages which gets "violated" if we do stuff iteratively? If yes, then I am keen to know that as well. PS: Note that I am newbie to functional programming so feel free to point me to existing resources if they explain/answer my question. Also I do understand that Scala in particular provides support for doing iterative stuff as well.

    Read the article

  • Read line and change the line that not consist of certain words and not end with dot

    - by igo
    I wanna read some text files in a folder line by line. for example of 1 txt : Fast and Effective Text Mining Using Linear-time Document Clustering Bjornar Larsen WORD2 Chinatsu Aone SRA International AK, Inc. 4300 Fair Lakes Cow-l Fairfax, VA 22033 {bjornar-larsen, WORD1 I wanna remove line that does not contain of words = word, word2, word3, and does not end with dot . so. from the example, the result will be : Bjornar Larsen WORD2 Chinatsu Aone SRA International, Inc. {bjornar-larsen, WORD1 I am confused, hw to remove the line? it that possible? or can we replace them with a space? here's the code : $url = glob($savePath.'*.txt'); foreach ($url as $file => $files) { $handle = fopen($files, "r") or die ('can not open file'); $ori_content= file_get_contents($files); foreach(preg_split("/((\r?\n)|(\r\n?))/", $ori_content) as $buffer){ $pos1 = stripos($buffer, $word1); $pos2 = stripos($buffer, $word2); $pos3 = stripos($buffer, $word3); $last = $str[strlen($buffer)-1];//read the las character if (true !== $pos1 OR true !== $pos2 OR true !==$pos3 && $last != '.'){ //how to remove } } } please help me, thank you so much :)

    Read the article

  • SpringMvc Annotations for DAO interface and DAO implementation

    - by dev_darin
    I would like to know if I am annotating these classes correctly, since I am new to the annotations: Country.java @Component public class Country { private int countryId; private String countryName; private String countryCode; /** * No args constructor */ public Country() { } /** * @param countryId * @param countryName * @param countryCode */ public Country(int countryId, String countryName, String countryCode) { this.countryId = countryId; this.countryName = countryName; this.countryCode = countryCode; } //getters and setters } CountryDAO.java @Repository public interface CountryDAO { public List<Country> getCountryList(); public void saveCountry(Country country); public void updateCountry(Country country); } JdbcCountryDAO.java @Component public class JdbcCountryDAO extends JdbcDaoSupport implements CountryDAO{ private final Logger logger = Logger.getLogger(getClass()); @Autowired public List<Country> getCountryList() { int countryId = 6; String countryCode = "AI"; logger.debug("In getCountryList()"); String sql = "SELECT * FROM TBLCOUNTRY WHERE countryId = ? AND countryCode = ?"; logger.debug("Executing getCountryList String "+sql); Object[] parameters = new Object[] {countryId, countryCode}; logger.info(sql); //List<Country> countryList = getJdbcTemplate().query(sql,new CountryMapper()); List<Country> countryList = getJdbcTemplate().query(sql, parameters,new CountryMapper()); return countryList; } CountryManagerIFace.java @Repository public interface CountryManagerIFace extends Serializable{ public void saveCountry(Country country); public List<Country> getCountries(); } CountryManager.java @Component public class CountryManager implements CountryManagerIFace{ @Autowired private CountryDAO countryDao; public void saveCountry(Country country) { countryDao.saveCountry(country); } public List<Country> getCountries() { return countryDao.getCountryList(); } public void setCountryDao(CountryDAO countryDao){ this.countryDao = countryDao; } }

    Read the article

  • Space bar and arrow keys on Radio buttons trigger TypeError: Error #1009

    - by Sr.Richie
    I've just discovered a bug in my app, it looks like a Flash player bug, i would like to know if anyone has found a workaround or something. I've some radio buttons groups in my app. If I press the arrow keys while holding the spacebar pressed, it ends up triggering TypeError: Error #1009: Cannot access a property or method of a null object reference. at fl.controls::LabelButton/drawIcon() at fl.controls::LabelButton/draw() at fl.controls::RadioButton/draw() at fl.core::UIComponent/callLaterDispatcher() If found this thread that describes my same situation. Do you think there's any workaround for this? Is it really a flash bug?

    Read the article

  • Binding lineargradientbrush color with property

    - by user1629894
    I have a problem with color in gradientstop. I want binding offset color with my property that return color (System.Windows.Media), but not working and return defalt color Transparent. If binding same property with Foreground Label is working. This style is in ResourceDictionary. <Style TargetType="{x:Type TabControl}"> <Setter Property="Background"> <Setter.Value> <LinearGradientBrush StartPoint="0 0" EndPoint="0 1"> <LinearGradientBrush.GradientStops> <GradientStop Offset="0.1" Color="Black" /> <GradientStop Offset="1" Color="{Binding Path=MyColor}" /> </LinearGradientBrush.GradientStops> </LinearGradientBrush> </Setter.Value> </Setter> </Style> and it's working: <Style TargetType="{x:Type Label}"> <Setter Property="Foreground" Value="{Binding Path=MyColor, Converter={StaticResource ColorToBrush}}" /> </Style> my property is: public Color MyColor { set { myColor = value; NotifyPropertyChanged("MyColor"); } get { return myColor; } } Thank you everybody for answers

    Read the article

  • Same html file for different topics on Help Files

    - by Gpoy Gwapo
    I have a problem with the help files. For example i have this html file named search.html and there are 2 topics on my table of contents namely Name Search and Account Search. The same search.html will be used for the 2 topics. Now, i want to open the help file and point it to Name Search but instead, the treeview item that is opened on the table of contents is for the Account Search. How can i set it so that the the Name Search will be the one selected on the table of contents?

    Read the article

  • How to disable vertical bounce/scroll on iPhone in a mobile web application

    - by Kasper Skov
    As the title says, i need to disable vertical bounce on iphone on my mobile web form application. Ive tried alot of different things, but most of them disables my form or horizontal scroll and bounce as well. Any ideas? Im using jquery.mobile btw :) Update: I actually managed to get the code from the first answer working somewhat: function stopScrolling( touchEvent ) { touchEvent.preventDefault(); } document.addEventListener( 'touchstart' , stopScrolling , false ); document.addEventListener( 'touchmove' , stopScrolling , false ); The reason why I couldnt get it to work in the first place, was that there actually was some margin on my body (stupid me). But. As the layout is fluid and im using jquery.mobile and have <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> in the header (I think) it doesnt work properly. The page is zoomed out (view from like a desktop browser) and zooming is disabled. Without the code, the page scales perfectly right from an 50" tv to the smallest nokia on the planet. Am I doing something wrong? Im starting to think the problem is caused by the body/content somehow being over 100% of the viewport. No idea how though.

    Read the article

  • ReportServer 2005 Custom Assembly Error

    - by user752083
    We have a reportserver on sql server 2005, it has previously been working on computer X which we are replacing with a computer Y. Computer X only had one default sql instance as our test environment, machine Y is a new machine with 2 sql instances, Y\TEST and Y\DEV. Both machines run Windows Server 2003 and Both have Sql Server 2005 installed together with Report Server We have not currently done any work on the DEV instance, just on the TEST instance. The reportserver is installed for TEST. SSRS previously worked as intended on X machine, and on Y\TEST its working for reports not using any custom code. However for some of the reports we are loading a custom assembly Localization. This assembly currently exists in following folders on server: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin Also in rssrvpolicy.config, the entry for Report_Expressions_Default_Permissions has been changed from Execution to FullTrust (Although this was not necessary on the machine X). When attempting to upload the rdl files through the web interface, we get the following errors: Error while loading code module: ‘Localization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e302ddd55ecd694a’. Details: Could not load file or assembly 'Localization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e302ddd55ecd694a' or one of its dependencies. The system cannot find the file specified. (rsErrorLoadingCodeModule) Get Online Help There is an error on line 14 of custom code: [BC30451] Name 'Localization' is not declared. (rsCompilerErrorInCode) Get Online Help Does anyone know any other places with potential errors?

    Read the article

  • Create a Modal Dialog box containing a form using struts2

    - by Lalitha
    In my application I have a part of form which should allow details of a n number of persons. i.e, Field1 Field2 field3 now a button Details of persons on button click it open a modal dialog box containg a form with 3 fields about person.When I click save. the details of persons sections should update...This should repeat on every button click.. I also need validations for fields on modal dialog box. Th data entered for field1,2,3 should remain same during the process.. How to do this in struts2.I am facing a lot of problems can some one help me with a simple example.. Regards, Lalitha One more problem is to have a date picker on modal dialog box..

    Read the article

  • Does Android XML Layout's 'include' Tag Really Work?

    - by Eric Burke
    I am unable to override attributes when using <include> in my Android layout files. When I searched for bugs, I found Declined Issue 2863: "include tag is broken (overriding layout params never works)" Since Romain indicates this works in the test suites and his examples, I must be doing something wrong. My project is organized like this: res/layout buttons.xml res/layout-land receipt.xml res/layout-port receipt.xml The buttons.xml contains something like this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <Button .../> <Button .../> </LinearLayout> And the portrait and landscape receipt.xml files look something like: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> ... <!-- Overridden attributes never work. Nor do attributes like the red background, which is specified here. --> <include android:id="@+id/buttons_override" android:background="#ff0000" android:layout_width="fill_parent" layout="@layout/buttons"/> </LinearLayout> What am I missing?

    Read the article

  • NetBeans Web-Services Client Project - repeated WSDL parsing

    - by RedGrittyBrick
    I created a new project thus ... File, New Project... Java, Java Application. Right-click project icon in "Projects" tree-view panel. Choose New, Web Service Client... Specify WSDL file e.g. ( ) Project (*) Local file D:\temp\Foo\Bar.wsdl ( ) WSDL URL [Set Proxy...] client-style JAX-WS [ ] Generate Dispatch code It parsed the WSDL and generated lots of java files. I created a main class and used Netbeans to insert a WS client call Now whenever I run my code (Desktop app), it again parses the WSDL (which doesn't ever change) and regenerates about 78 java files and compiles them. How do I stop Netbeans performing this uneccessary and time-consuming action?

    Read the article

  • Is there a way to define a List<> of two elements string array?

    - by Alexander Prokofyev
    I want to build two-dimentional array of strings where length of one dimention is 2. Similar to this string[,] array = new string[,] { {"a", "b"}, {"c", "d"}, {"e", "f"}, {"g", "h"} } Doing List<string[]> list = new List<string[]>(); list.Add(new string[2] {"a", "b"}); list.Add(new string[2] {"c", "d"}); list.Add(new string[2] {"e", "f"}); list.Add(new string[2] {"g", "h"}); list.ToArray(); gives me string[][] but not string[,] array. Just curious, is there some trick to build dynamically string[,] array somehow?

    Read the article

  • Getting Started Building Windows 8 Store Apps with XAML/C#

    - by dwahlin
    Technology is fun isn’t it? As soon as you think you’ve figured out where things are heading a new technology comes onto the scene, changes things up, and offers new opportunities. One of the new technologies I’ve been spending quite a bit of time with lately is Windows 8 store applications. I posted my thoughts about Windows 8 during the BUILD conference in 2011 and still feel excited about the opportunity there. Time will tell how well it ends up being accepted by consumers but I’m hopeful that it’ll take off. I currently have two Windows 8 store application concepts I’m working on with one being built in XAML/C# and another in HTML/JavaScript. I really like that Microsoft supports both options since it caters to a variety of developers and makes it easy to get started regardless if you’re a desktop developer or Web developer. Here’s a quick look at how the technologies are organized in Windows 8: In this post I’ll focus on the basics of Windows 8 store XAML/C# apps by looking at features, files, and code provided by Visual Studio projects. To get started building these types of apps you’ll definitely need to have some knowledge of XAML and C#. Let’s get started by looking at the Windows 8 store project types available in Visual Studio 2012.   Windows 8 Store XAML/C# Project Types When you open Visual Studio 2012 you’ll see a new entry under C# named Windows Store. It includes 6 different project types as shown next.   The Blank App project provides initial starter code and a single page whereas the Grid App and Split App templates provide quite a bit more code as well as multiple pages for your application. The other projects available can be be used to create a class library project that runs in Windows 8 store apps, a WinRT component such as a custom control, and a unit test library project respectively. If you’re building an application that displays data in groups using the “tile” concept then the Grid App or Split App project templates are a good place to start. An example of the initial screens generated by each project is shown next: Grid App Split View App   When a user clicks a tile in a Grid App they can view details about the tile data. With a Split View app groups/categories are shown and when the user clicks on a group they can see a list of all the different items and then drill-down into them:   For the remainder of this post I’ll focus on functionality provided by the Blank App project since it provides a simple way to get started learning the fundamentals of building Windows 8 store apps.   Blank App Project Walkthrough The Blank App project is a great place to start since it’s simple and lets you focus on the basics. In this post I’ll focus on what it provides you out of the box and cover additional details in future posts. Once you have the basics down you can move to the other project types if you need the functionality they provide. The Blank App project template does exactly what it says – you get an empty project with a few starter files added to help get you going. This is a good option if you’ll be building an app that doesn’t fit into the grid layout view that you see a lot of Windows 8 store apps following (such as on the Windows 8 start screen). I ended up starting with the Blank App project template for the app I’m currently working on since I’m not displaying data/image tiles (something the Grid App project does well) or drilling down into lists of data (functionality that the Split App project provides). The Blank App project provides images for the tiles and splash screen (you’ll definitely want to change these), a StandardStyles.xaml resource dictionary that includes a lot of helpful styles such as buttons for the AppBar (a special type of menu in Windows 8 store apps), an App.xaml file, and the app’s main page which is named MainPage.xaml. It also adds a Package.appxmanifest that is used to define functionality that your app requires, app information used in the store, plus more. The App.xaml, App.xaml.cs and StandardStyles.xaml Files The App.xaml file handles loading a resource dictionary named StandardStyles.xaml which has several key styles used throughout the application: <Application x:Class="BlankApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:BlankApp"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <!-- Styles that define common aspects of the platform look and feel Required by Visual Studio project and item templates --> <ResourceDictionary Source="Common/StandardStyles.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>   StandardStyles.xaml has style definitions for different text styles and AppBar buttons. If you scroll down toward the middle of the file you’ll see that many AppBar button styles are included such as one for an edit icon. Button styles like this can be used to quickly and easily add icons/buttons into your application without having to be an expert in design. <Style x:Key="EditAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}"> <Setter Property="AutomationProperties.AutomationId" Value="EditAppBarButton"/> <Setter Property="AutomationProperties.Name" Value="Edit"/> <Setter Property="Content" Value="&#xE104;"/> </Style> Switching over to App.xaml.cs, it includes some code to help get you started. An OnLaunched() method is added to handle creating a Frame that child pages such as MainPage.xaml can be loaded into. The Frame has the same overall purpose as the one found in WPF and Silverlight applications - it’s used to navigate between pages in an application. /// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="args">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs args) { Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter if (!rootFrame.Navigate(typeof(MainPage), args.Arguments)) { throw new Exception("Failed to create initial page"); } } // Ensure the current window is active Window.Current.Activate(); }   Notice that in addition to creating a Frame the code also checks to see if the app was previously terminated so that you can load any state/data that the user may need when the app is launched again. If you’re new to the lifecycle of Windows 8 store apps the following image shows how an app can be running, suspended, and terminated.   If the user switches from an app they’re running the app will be suspended in memory. The app may stay suspended or may be terminated depending on how much memory the OS thinks it needs so it’s important to save state in case the application is ultimately terminated and has to be started fresh. Although I won’t cover saving application state here, additional information can be found at http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh465099.aspx. Another method in App.xaml.cs named OnSuspending() is also included in App.xaml.cs that can be used to store state as the user switches to another application:   /// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); //TODO: Save application state and stop any background activity deferral.Complete(); } The MainPage.xaml and MainPage.xaml.cs Files The Blank App project adds a file named MainPage.xaml that acts as the initial screen for the application. It doesn’t include anything aside from an empty <Grid> XAML element in it. The code-behind class named MainPage.xaml.cs includes a constructor as well as a method named OnNavigatedTo() that is called once the page is displayed in the frame.   /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </summary> public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); } /// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. The Parameter /// property is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { } }   If you’re experienced with XAML you can switch to Design mode and start dragging and dropping XAML controls from the ToolBox in Visual Studio. If you prefer to type XAML you can do that as well in the XAML editor or while in split mode. Many of the controls available in WPF and Silverlight are included such as Canvas, Grid, StackPanel, and Border for layout. Standard input controls are also included such as TextBox, CheckBox, PasswordBox, RadioButton, ComboBox, ListBox, and more. MediaElement is available for rendering video or playing audio files. Some of the “common” XAML controls included out of the box are shown next:   Although XAML/C# Windows 8 store apps don’t include all of the functionality available in Silverlight 5, the core functionality required to build store apps is there with additional functionality available in open source projects such as Callisto (started by Microsoft’s Tim Heuer), Q42.WinRT, and others. Standard XAML data binding can be used to bind C# objects to controls, converters can be used to manipulate data during the data binding process, and custom styles and templates can be applied to controls to modify them. Although Visual Studio 2012 doesn’t support visually creating styles or templates, Expression Blend 5 handles that very well. To get started building the initial screen of a Windows 8 app you can start adding controls as mentioned earlier. Simply place them inside of the <Grid> element that’s included. You can arrange controls in a stacked manner using the StackPanel control, add a border around controls using the Border control, arrange controls in columns and rows using the Grid control, or absolutely position controls using the Canvas control. One of the controls that may be new to you is the AppBar. It can be used to add menu/toolbar functionality into a store app and keep the app clean and focused. You can place an AppBar at the top or bottom of the screen. A user on a touch device can swipe up to display the bottom AppBar or right-click when using a mouse. An example of defining an AppBar that contains an Edit button is shown next. The EditAppBarButtonStyle is available in the StandardStyles.xaml file mentioned earlier. <Page.BottomAppBar> <AppBar x:Name="ApplicationAppBar" Padding="10,0,10,0" AutomationProperties.Name="Bottom App Bar"> <Grid> <StackPanel x:Name="RightPanel" Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right"> <Button x:Name="Edit" Style="{StaticResource EditAppBarButtonStyle}" Tag="Edit" /> </StackPanel> </Grid> </AppBar> </Page.BottomAppBar> Like standard XAML controls, the <Button> control in the AppBar can be wired to an event handler method in the MainPage.Xaml.cs file or even bound to a ViewModel object using “commanding” if your app follows the Model-View-ViewModel (MVVM) pattern (check out the MVVM Light package available through NuGet if you’re using MVVM with Windows 8 store apps). The AppBar can be used to navigate to different screens, show and hide controls, display dialogs, show settings screens, and more.   The Package.appxmanifest File The Package.appxmanifest file contains configuration details about your Windows 8 store app. By double-clicking it in Visual Studio you can define the splash screen image, small and wide logo images used for tiles on the start screen, orientation information, and more. You can also define what capabilities the app has such as if it uses the Internet, supports geolocation functionality, requires a microphone or webcam, etc. App declarations such as background processes, file picker functionality, and sharing can also be defined Finally, information about how the app is packaged for deployment to the store can also be defined. Summary If you already have some experience working with XAML technologies you’ll find that getting started building Windows 8 applications is pretty straightforward. Many of the controls available in Silverlight and WPF are available making it easy to get started without having to relearn a lot of new technologies. In the next post in this series I’ll discuss additional features that can be used in your Windows 8 store apps.

    Read the article

  • Sophos UTM in Hyper-V

    - by TheD
    So, I had a previous thread about this Virtualizing Firewalls/UTM. Essentially, I have configured what I think would work, but networking isn't my strong point! Two Virtual Adapters - with IP addresses 192.168.0.2 (External) and 192.168.0.3 (Internal) respectively. The External Adapater looks at 192.168.0.1 (my Zyxel) for it's default gateway. The Internal Adapter, 192.168.0.3, which is what the Sophos UTM listens on, has it's default gateway set to 192.168.0.2, the IP of the External Lan interface. So, PC (192.168.0.11, DHCP) --> (LAN) --> Switch --> 192.168.0.3 (Internal LAN Interface IP) --> Sophos UTM --> 192.168.0.2 (External LAN Interface IP) --> 192.168.0.1 --> Internet Would this be the correct setup, or am I completely out of the game here? Cheers!

    Read the article

  • HTTP Subdomain Redirect to HTTPS automatically. Why?

    - by user139062
    I have 2 websites deployed in IIS 7.5 Express. The first website is the PRODUCTION website and the second is the TEST website. In the PRODUCTION website, I added an HTTPS binding and Require SSL so it is normal that it will force to redirect from HTTP to HTTPS. In the TEST website, I didn't add HTTPS binding and the Require SSL is disabled but I wonder why it still force to redirect from HTTP to HTTPS. Any idea why this happen? By the way, the PRODUCTION site uses the main domain (www.maindomain.com) and the TEST site uses only sub-domain (test.maindomain.com). I don't want the sub-domain to only use HTTP, not HTTPS. Thank you in advance.

    Read the article

  • How to manage iowait over cifs?

    - by Silvia
    For backup purposes we have Cifs file Server running that contains encrypted containers for backing up the more sensitive data. The container is mounted with cryptsetup and loop as a local filesystem and the rsync is used for backups. Because the Cifs server is not the fastest machine ever built, running the rsync process results in an iowait on the servers running the backup which in turn drives Nagios into an email frenzy. The question is, how do reduce the iowait on the server? Configuring Nagios to not report seems more like a workaround then a solution. Stretching the backups over different time intervals is already done with little effect and spending money is also not an option because apparently, we are talking about a "non-critical system".

    Read the article

  • Do Parallels Plesk Panel 11 have free inbuilt firewall for Debian 6 Linux OS? [closed]

    - by Sampath
    Possible Duplicate: How strong is parallels plesk 11 inbuilt firewall for linux os? I am new to Linux Dedicated server hosting and plesk panel 11 , i am looking for inbuilt firewall module . Is it comes with free in plesk 11 or i need to pay or plesk 11 doesn't support firewall?. I looked at the demo http://www.parallels.com/products/plesk/demos/, but i couldn't find any information about firewall in plesk 11.

    Read the article

  • Route outbound connections from local network through VPN

    - by Sharkos
    I have a server A running OpenVPN, an OpenVPN client B (a rooted Android phone as it happens) and a third party C (a laptop, tablet etc.) tethered to B. B can use the VPN to access the internet via A; C can use the tethered connection WITHOUT the VPN to access the internet via B. However, with the VPN on B active, I cannot load information from the internet on C. A appears to log similar traffic inbound and outbound when B or C attempt to load a webpage, say, but the VPN on device B reports no inbound traffic when the connection originated from C. Where should I look for packets being dropped, and what ip rules should I use to make sure they are passed back through the VPN and into the local network B <- C? (I'll obviously post whatever further information is needed.) Further info Without VPN: root@android:/ # ip route default via [B's External Gateway] dev rmnet0 [B's External Subnet] dev rmnet0 proto kernel scope link src [B's External IP] [B's External Gateway] dev rmnet0 scope link 192.168.43.0/24 dev wlan0 proto kernel scope link src 192.168.43.1 With VPN: root@android:/ # ip route 0.0.0.0/1 dev tun0 scope link default via [B's External Gateway] dev rmnet0 [B's External Subnet] dev rmnet0 proto kernel scope link src [B's External IP] [B's External Gateway] dev rmnet0 scope link [External address of A] dev tun0 scope link 128.0.0.0/1 dev tun0 scope link 172.16.0.0/24 dev tun0 scope link 172.16.0.8/30 dev tun0 proto kernel scope link src 172.16.0.10 192.168.43.0/24 dev wlan0 proto kernel scope link src 192.168.43.1 192.168.168.0/24 dev tun0 scope link

    Read the article

  • Amazon EC2 - Free memory

    - by Damo
    We have an amazon ec2 small instance running and over the past few days we noticed that the memory is going down and down. On the small instance, we are running apache and tomcat6 Tomcat is started with the following JVM parameters -Xms32m -Xmx128m -XX:PermSize=128m -XX:MaxPermSize=256m We use nagios to monitor stuff like updates to apply, free disk space and memory. Everything else is behaving as expected but our memory is going down all the time. Our app receives approx half a million hits a day When I shutdown apache and tomcat, and ran free -m, we had only 594mb of memory free out out of the 1.7gb of memory. Not much else is running on the small instance and when running the top command I cannot see where the memory is going. The app we run on tomcat is a grails webapp. Could there be a possibility that there is a memory leak within our application? I read online and folks say that a small amazon instance is perfect for running apach and tomcat. I found a few posts online that showed how to setup apache and tomcat to limit the memory usage and I have already performed those steps. The memory is not being used up as quick but the memory is still decreasing over time. We have other amazone ec2 small instances running grails apps and the memory is fairly standard on those nodes. But they would not be receiving as much traffic Just to add, when I run the top command on the problem server, I cannot see where all the memory is being used Any help with this is greatly appreciated The output of free -m when run on my server is as follows total used free shared buffers cached Mem: 1657 1380 277 0 158 773 -/+ buffers/cache: 447 1209 Swap: 895 0 895 In your opinion, does this look ok? At what stage would the OS give back memory, would it wait to the memory reaches 0% or is this OS dependent?

    Read the article

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