Daily Archives

Articles indexed Thursday October 4 2012

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

  • Extract co-ordinates from a vector of co-ordinates and save to file

    - by barsil sil
    I have a vector which contains a list co-ordinates ...x1,y1 ; x2,y2....xn,yn I am trying to extract each individual element which is a co-ordinate and then save them to file as a nice delineated co-ord pair which can be easily read. Or what would be nice i to save them so I can plot something in excel e.t.c (as cols of x and y values). My original vector size is 31, and was originally constructed as vector<vector<Point> > myvector( previous vector.size() ); Thanks !

    Read the article

  • Object value not getting updated in the database using hibernate

    - by user1662917
    I am using Spring,hibernate,jsf with jquery in my application. I am inserting a Question object in the database through the hibernate save query . The question object contains id ,question,answertype and reference to a form object using form_id. Now I want to alter the values of Question object stored in the database by altering the value stored in the list of Question objects at the specified index position. If I alter the value in the list the value in the database is not getting altered by update query . Could you please advise. Question.java package com.otv.model; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.apache.commons.lang.builder.ToStringBuilder; @Entity @Table(name = "questions") public class Question implements Serializable { @Id @GeneratedValue @Column(name = "id", unique = true, nullable = false) private int id; @Column(name = "question", nullable = false) private String text; @Column(name = "answertype", nullable = false) private String answertype; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "form_id") private Form form; // @JoinColumn(name = "form_id") // private int formId; public Question() { } public Question(String text, String answertype) { this.text = text; this.answertype = answertype; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getQuestion() { return text; } public void setQuestion(String question) { this.text = question; } public String getAnswertype() { return answertype; } public void setAnswertype(String answertype) { this.answertype = answertype; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((answertype == null) ? 0 : answertype.hashCode()); result = prime * result + id; result = prime * result + ((text == null) ? 0 : text.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Question other = (Question) obj; if (answertype == null) { if (other.answertype != null) return false; } else if (!answertype.equals(other.answertype)) return false; if (id != other.id) return false; if (text == null) { if (other.text != null) return false; } else if (!text.equals(other.text)) return false; return true; } public void setForm(Form form) { this.form = form; } @Override public String toString() { return ToStringBuilder.reflectionToString(this); } } Form.java package com.otv.model; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import org.apache.commons.lang.builder.ToStringBuilder; @Entity @Table(name = "FORM") public class Form implements Serializable { @Id @GeneratedValue @Column(name = "id", unique = true, nullable = false) private int id; @Column(name = "name", nullable = false) private String name; @Column(name = "description", nullable = false) private String description; @OneToMany(mappedBy = "form", fetch = FetchType.EAGER, cascade = CascadeType.ALL) List<Question> questions = new ArrayList<Question>(); public Form(String name) { super(); this.name = name; } public Form() { super(); } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public List<Question> getQuestions() { return questions; } public void setQuestions(List<Question> formQuestions) { this.questions = formQuestions; } public void addQuestion(Question question) { questions.add(question); question.setForm(this); } public void removeQuestion(Question question) { questions.remove(question); question.setForm(this); } @Override public String toString() { return ToStringBuilder.reflectionToString(this); } public void replaceQuestion(int index, Question question) { Question prevQuestion = questions.get(index); // prevQuestion.setQuestion(question.getQuestion()); // prevQuestion.setAnswertype(question.getAnswertype()); question.setId(prevQuestion.getId()); question.setForm(this); questions.set(index, question); } } QuestionDAO.java package com.otv.user.dao; import java.util.List; import org.hibernate.SessionFactory; import com.otv.model.Question; public class QuestionDAO implements IQuestionDAO { private SessionFactory sessionFactory; public SessionFactory getSessionFactory() { return sessionFactory; } public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public void addQuestion(Question question) { getSessionFactory().getCurrentSession().save(question); } public void deleteQuestion(Question question) { getSessionFactory().getCurrentSession().delete(question); } public void updateQuestion(Question question) { getSessionFactory().getCurrentSession().update(question); } public Question getQuestionById(int id) { List list = getSessionFactory().getCurrentSession().createQuery("from Questions where id=?") .setParameter(0, id).list(); return (Question) list.get(0); } }

    Read the article

  • Taking screen shot of a SurfaceView in android

    - by Mostafa Imran
    I am using following method to taking screen shot of a particular view which is a SurfaceView. public void takeScreenShot(View surface_view){ // create bitmap screen capture Bitmap bitmap; View v1 = surface_view; v1.setDrawingCacheEnabled(true); bitmap = Bitmap.createBitmap(v1.getDrawingCache()); v1.setDrawingCacheEnabled(false); ByteArrayOutputStream bos = new ByteArrayOutputStream(); bitmap.compress(CompressFormat.PNG, 0, bos); byte[] imageData = bos.toByteArray(); } the problem is its giving me the whole activity screen image. But I need to take screen shot of the particular view. I tried other ways but those give me a black screen as screen shot, some posts says that it requires rooted device. Can any one help me please. I'm in need of this solution. Help me....

    Read the article

  • How do I send an email with HTML with an address the user inputs?

    - by MeganSime
    I have an app i am designing and there is a page for emails. The user inputs their name, email address and message and then clicks 'submit'. this works, but i don't know how to make the user's input be on the email. this is the code so far; <form id="contacts-form" action="mailto:[email protected]"> <ul class = "rounded"> <li style = "color: #FFFFFF">Full Name:<input type="text" placeholder = "J. Doe" name = "signature" id = 'signature' /></li> <li style = "color: #FFFFFF">E-mail:<input type="text" placeholder = "[email protected]" name = "address" id = 'address' /></li> <li style = "color: #FFFFFF">Message:<input type = "text" placeholder = "Message" name = "message" id = 'message' /></li> <a href="mailto:address?subject=subject&body=message" class="button">Submit</a> </ul> </form> does anyone know how to change the code to allow the user input to go onto the email? Thanks a lot in advance x

    Read the article

  • Creating a class Hierarchy for Atoms,neutrons,protons,chemical reationc

    - by Smart Zulu
    I need help to create a program that can show the hierarchy of any Atoms and its components (neutrons,protons,electrons,and chemical reaction) Here is a code of what i have done so far,being a novice at the subject using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Atoms { public class Atoms { protected string name = "Sodium"; protected string element ="Metal"; public virtual void GetInfo() { Console.WriteLine("name: {0}",name); Console.WriteLine("element: {0}", element); } } class Proton : Atoms { public int number = 11 ; public override void GetInfo() { base.GetInfo(); Console.WriteLine("Proton number: {0}",number); } } class Electron : Atoms { public int number = 11; public override void GetInfo() { base.GetInfo(); Console.WriteLine("Electron number: {0}", number); } class Neutrons : Atoms { public int number = 12; public override void GetInfo() { base.GetInfo(); Console.WriteLine("Neutron number: {0}", number); } class TestClass { static void Main() { Proton P = new Proton(); P.GetInfo(); Neutrons N = new Neutrons(); N.GetInfo(); Electron E = new Electron(); E.GetInfo(); Console.WriteLine("click any key to exit"); Console.ReadLine(); } } } } }

    Read the article

  • .htaccess redirect umlaut domain

    - by Christian Engel
    I am trying to redirect requests from a umlaut domain to another domain. My following code works with ANY other domain, but not umlaut: <IfModule mod_rewrite.c> RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^(www\.)?frankfurter-flöhe\.de/$ [NC] RewriteRule ^ http://kinderkultur-frankfurt.de/frankfurter-floehe-theaterprogramm.html [R=301,L] </IfModule> However, when I call the umlaut domain and copy it from google chromes address bar after that, I get this: http://xn--frankfurter-flhe-zwb.de/ Altough, if I use that obfruscated domain in my htaccess instead of the "real" umlaut domain, it doesn't work either. Does anybody have an idea how to match that domain?

    Read the article

  • how to change radio buttons style in h:selectOneRadio

    - by Mahmoud Saleh
    i have h:selectOneRadio as follows: <div id="container" class="container"> <h:selectOneRadio layout="pageDirection" id="sel_radio" value="#{mBean.selectedRadio}"> <f:selectItem id="option1" itemLabel="item1" itemValue="1" /> <f:selectItem id="option2" itemLabel="item2" itemValue="2" /> </h:selectOneRadio> . . . </div> above will be rendered as follows: <div id="container" class="container"> <table> <tbody> <tr> <td> <input type="radio" name="myForm:sel_radio" id="myForm:sel_radio:0" value="1"> ISSUE: the container class gives default width for all inputs, that will affect on my radio button, here's the css class: .container input { width: 200px; } and i can't change this class because it's a template and used in other pages, i want to override this style in this page only. i tried to override it as by adding following style: .container #myForm:sel_radio:0 { width: 50px !important; } but it doesn't work too. please advise how to fix that, thanks.

    Read the article

  • Extjs 3.4 - Button Icon does not show or does not center

    - by Chris
    I want to fill a button with an icon I created but whatever I have tried just seems to put the icon either half cut off and way left, or it doesn't show at all. I've been trying different combinations of CSS and the icon, iconcls, cls button options. I was following the Ext 3 buttons example page but that doesn't seem to display anything for me... This code is an item inside my form panel (I try to replicate this with different buttons in the panel) { xtype: 'container', layout: { type: 'table', columns: 2, tableAttrs: { cellspacing: 5 } }, // padding: 5, pack: 'center', align: 'middle', items: [{ xtype: 'button', width: 40, // scale: 'medium', ref: '../drawToolsBtn', tooltip: 'Drawing Tools', icon: 'img/draw.png', iconAlign: 'top', baseCls: 'x-plain', // iconCls: 'drawBtn', enableToggle: true, // padding: 3, toggleHandler: function(btn, state) { this.showDrawToolsWin(state); }, scope: this },{ xtype: 'label', // columnWidth: 1, // remainder of container padding: 3, text: 'Click button to open Drawing Tools Menu' }] } CSS -------------------- .drawBtn{ background: url(../img/draw.png) !important; } Thank you for any help!

    Read the article

  • Java Function Analysis

    - by khan
    Okay..I am a total Python guy and have very rarely worked with Java and its methods. The condition is that I have a got a Java function that I have to explain to my instructor and I have got no clue about how to do so..so if one of you can read this properly, kindly help me out in breaking it down and explaining it. Also, i need to find out any flaw in its operation (i.e. usage of loops, etc.) if there is any. Finally, what is the difference between 'string' and 'string[]' types? public static void search(String findfrom, String[] thething){ if(thething.length > 5){ System.err.println("The thing is quite long"); } else{ int[] rescount = new int[thething.length]; for(int i = 0; i < thething.length; i++){ String[] characs = findfrom.split("[ \"\'\t\n\b\f\r]", 0); for(int j = 0; j < characs.length; j++){ if(characs[j].compareTo(thething[i]) == 0){ rescount[i]++; } } } for (int j = 0; j < thething.length; j++) { System.out.println(thething[j] + ": " + rescount[j]); } } }

    Read the article

  • Automatically compute variable upon input in SPSS

    - by what
    I have two cells in SPSS, months is a number of months, years_from_months is the number of years, calculated from the months (decimal: months / 12). What I want is that years_from_months is calculated (and updated) automatically, when I finish entering the months in months, i.e. that I don't have to explicitly call compute manually through the menu. I have defined years_from_months to calculate the years, but at the moment the field only updates when I go to the menu option Transform Compute variable ... and click OK in the window that opens. How can I set up the cell to update automatically (like in Excel)?

    Read the article

  • Strings, regexp and files

    - by A Moose
    <?php $iprange = array( "^12\.34\.", "^12\.35\.", ); foreach($iprange as $var) { if (preg_match($var, $_SERVER['REMOTE_ADDR'])) { I'm looking to have a list that will constitute each of the values inside the array. Let's call it iprange.txt, from which I would extract the variable $iprange. I would also be updating the file with new ranges, but I also want to convert those strings to regexp if that's something that's needed in php, as it is in the above example. If you could help me with the two following issues: I understand that somehow I would be using an array include, but I'm not sure how to implement it. I would like to run a cron that would update the text file and turn it into a regexp acceptable for use in the above example, if you think regexp is a good idea and there isn't another option. I know how to apply a cron in a directadmin gui, but I don't know what the cronned file would look like.

    Read the article

  • How to generate two XML files from a single HL7 file and insert both into two different columns as a single record?

    - by Vivek Ratnaparkhi
    I have Source Connector Type as 'File Reader' which is reading HL7 files and Destination Connector Type as 'Database Writer'. My database table has two columns Participant_Information SPR_Information I want to transform a single HL7 file into two XML files one for Participant_Information column and other for SPR_Information column and need to insert both as a single record into the database table. I'm able to insert one XML at a time but not able to find the way to insert both the XMLs as a single record into the database table. Any help is really greatly appreciated!

    Read the article

  • JavaFX 2.0 - How to change legend color of a LineChart dynamically?

    - by marie
    I am trying to style my JavaFX linechart but I have some trouble with the legend. I know how to change the legend color of a line chart in the css file: .default-color0.chart-series-line { -fx-stroke: #FF0000, white; } .default-color1.chart-series-line { -fx-stroke: #00FF00, white; } .default-color2.chart-series-line { -fx-stroke: #0000FF, white; } .default-color0.chart-line-symbol { -fx-background-color: #FF0000, white; } .default-color1.chart-line-symbol { -fx-background-color: #00FF00, white; } .default-color2.chart-line-symbol { -fx-background-color: #0000FF, white; } But this is not enough for my purposes. I have three or more colored toggle buttons and a series of data for every button. The data should be displayed in the same color the button has after I have selected the button. This should be possible with a multiselection of the buttons, so that more than one series of data can be displayed simultaneously. For the chart lines I have managed it by changing the style after I clicked the button: .. dataList.add(series); .. series.getNode().setStyle("-fx-stroke: rgba(" + rgba + ")"); If I deselect the button I remove the data from the list. dataList.remove(series); That is working fine for the strokes, but how can I do the same for the legend? You can see an example below. First I clicked the red button, thus the stroke and the legend is red (default-color0). After that I clicked the blue button. Here you can see the problem. The stroke is blue but the legend is green, because default color1 is used and I do not know how to change the legend color.

    Read the article

  • Ndk-build: CreateProcess: make (e=87): The parameter is incorrect

    - by user1514958
    I get an error when build static lib with NDK on Windows platform: process_begin: CreateProcess( "PATH"\android-ndk-r8b\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ar.exe, "some other commands" ) failed. make (e=87): The parameter is incorrect. make: *** [obj/local/armeabi-v7a/staticlib.a] Error 87 make: *** Waiting for unfinished jobs.... All source files build successfully, and this error occur when compose object files. I don't get this error when build this project in Ubuntu, it occur only on Windows. I suppose I found the issue: second parameter of CreateProcess Win API function lpCommandLine has max length 32,768 characters. But in my case it is more than 32,768 characters. How I can solve this issue?

    Read the article

  • Android app with library can't find the library.apk

    - by Dean Schulze
    I'm trying to get the FinchVideo example from the Programming Android book to work. It uses the FinchWelcome library. I've set up FinchWelcome as a Library and in the FinchVideo application I have checked the FinchWelcome library in Properties - Android. When I try to run FinchVideo in the emulator it complains that it cannot find FinchWelcome.apk (output below). I'm building for Android 4.0.3. While Googling for this problem I've found that a lot of people have this problem with Android apps that use libraries. No one seems to have found a solution that works consistently, though. None of the Android books I've seen even talk about how to download libraries. What is the proper way to handle libraries in Android applications? Is this a bug in the Eclipse ADT? Thanks. [FinchVideo] Installing FinchVideo.apk... [FinchVideo] Success! [FinchWelcome] Could not find FinchWelcome.apk! [FinchVideo] Starting activity com.oreilly.demo.pa.finchvideo.FinchVideoActivity on device emulator-5554

    Read the article

  • Failed to allocate memory: 8

    - by Denis Hoss
    From today, when I tried to run an app in NetBeans on a 2.3.3 Android platform, it shows me that: Failed to allocate memory: 8 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. and the Emulator doesn't want to start. This is for the first time when I see it, and google has no asnwers for this, I tried even with 2 versions of NetBeans 6.9.1 and 7.0.1, still the same error.

    Read the article

  • Working with Tile Notifications in Windows 8 Store Apps – Part I

    - by dwahlin
    One of the features that really makes Windows 8 apps stand out from others is the tile functionality on the start screen. While icons allow a user to start an application, tiles provide a more engaging way to engage the user and draw them into an application. Examples of “live” tiles on part of my current start screen are shown next: I’ll admit that if you get enough of these tiles going the start screen can actually be a bit distracting. Fortunately, a user can easily disable a live tile by right-clicking on it or pressing and holding a tile on a touch device and then selecting Turn live tile off from the AppBar: The can also make a wide tile smaller (into a square tile) or make a square tile bigger assuming the application supports both squares and rectangles. In this post I’ll walk through how to add tile notification functionality into an application. Both XAML/C# and HTML/JavaScript apps support live tiles and I’ll show the code for both options.   Understanding Tile Templates The first thing you need to know if you want to add custom tile functionality (live tiles) into your application is that there is a collection of tile templates available out-of-the-box. Each tile template has XML associated with it that you need to load, update with your custom data, and then feed into a tile update manager. By doing that you can control what shows in your app’s tile on the Windows 8 start screen. So how do you learn more about the different tile templates and their respective XML? Fortunately, Microsoft has a nice documentation page in the Windows 8 Store SDK. Visit http://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx to see a complete list of square and wide/rectangular tile templates that you can use. Looking through the templates you’ll It has the following XML template associated with it:  <tile> <visual> <binding template="TileSquareBlock"> <text id="1">Text Field 1</text> <text id="2">Text Field 2</text> </binding> </visual> </tile> An example of a wide/rectangular tile template is shown next:    <tile> <visual> <binding template="TileWideImageAndText01"> <image id="1" src="image1.png" alt="alt text"/> <text id="1">Text Field 1</text> </binding> </visual> </tile>   To use these tile templates (or others you find interesting), update their content, and get them to show for your app’s tile on the Windows 8 start screen you’ll need to perform the following steps: Define the tile template to use in your app Load the tile template’s XML into memory Modify the children of the <binding> tag Feed the modified tile XML into a new TileNotification instance Feed the TileNotification instance into the Update() method of the TileUpdateManager In the remainder of the post I’ll walk through each of the steps listed above to provide wide and square tile notifications for an application. The wide tile that’s shown will show an image and text while the square tile will only show text. If you’re going to provide custom tile notifications it’s recommended that you provide wide and square tiles since users can switch between the two of them directly on the start screen. Note: When working with tile notifications it’s possible to manipulate and update a tile’s XML template without having to know XML parsing techniques. This can be accomplished using some C# notification extension classes that are available. In this post I’m going to focus on working with tile notifications using an XML parser so that the focus is on the steps required to add notifications to the Windows 8 start screen rather than on external extension classes. You can access the extension classes in the Windows 8 samples gallery if you’re interested.   Steps to Create Custom App Tile Notifications   Step 1: Define the tile template to use in your app Although you can cut-and-paste a tile template’s XML directly into your C# or HTML/JavaScript Windows store app and then parse it using an XML parser, it’s easier to use the built-in TileTemplateType enumeration from the Windows.UI.Notifications namespace. It provides direct access to the XML for the various templates so once you locate a template you like in the documentation (mentioned above), simplify reference it:HTML/JavaScript var notifications = Windows.UI.Notifications; var template = notifications.TileTemplateType.tileWideImageAndText01; .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   XAML/C# var template = TileTemplateType.TileWideImageAndText01;   Step 2: Load the tile template’s XML into memory Once the target template’s XML is identified, load it into memory using the TileUpdateManager’s GetTemplateContent() method. This method parses the template XML and returns an XmlDocument object:   HTML/JavaScript   var tileXml = notifications.TileUpdateManager.getTemplateContent(template); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   XAML/C#  var tileXml = TileUpdateManager.GetTemplateContent(template);   Step 3: Modify the children of the <binding> tag Once the XML for a given template is loaded into memory you need to locate the appropriate <image> and/or <text> elements in the XML and update them with your app data. This can be done using standard XML DOM manipulation techniques. The example code below locates the image folder and loads the path to an image file located in the project into it’s inner text. The code also creates a square tile that consists of text, updates it’s <text> element, and then imports and appends it into the wide tile’s XML.   HTML/JavaScript var image = tileXml.selectSingleNode('//image[@id="1"]'); image.setAttribute('src', 'ms-appx:///images/' + imageFile); image.setAttribute('alt', 'Live Tile'); var squareTemplate = notifications.TileTemplateType.tileSquareText04; var squareTileXml = notifications.TileUpdateManager.getTemplateContent(squareTemplate); var squareTileTextAttributes = squareTileXml.selectSingleNode('//text[@id="1"]'); squareTileTextAttributes.appendChild(squareTileXml.createTextNode(content)); var node = tileXml.importNode(squareTileXml.selectSingleNode('//binding'), true); tileXml.selectSingleNode('//visual').appendChild(node); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   XAML/C#var tileXml = TileUpdateManager.GetTemplateContent(template); var text = tileXml.SelectSingleNode("//text[@id='1']"); text.AppendChild(tileXml.CreateTextNode(content)); var image = (XmlElement)tileXml.SelectSingleNode("//image[@id='1']"); image.SetAttribute("src", "ms-appx:///Assets/" + imageFile); image.SetAttribute("alt", "Live Tile"); Debug.WriteLine(image.GetXml()); var squareTemplate = TileTemplateType.TileSquareText04; var squareTileXml = TileUpdateManager.GetTemplateContent(squareTemplate); var squareTileTextAttributes = squareTileXml.SelectSingleNode("//text[@id='1']"); squareTileTextAttributes.AppendChild(squareTileXml.CreateTextNode(content)); var node = tileXml.ImportNode(squareTileXml.SelectSingleNode("//binding"), true); tileXml.SelectSingleNode("//visual").AppendChild(node);  Step 4: Feed the modified tile XML into a new TileNotification instance Now that the XML data has been updated with the desired text and images, it’s time to load the XmlDocument object into a new TileNotification instance:   HTML/JavaScript var tileNotification = new notifications.TileNotification(tileXml); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   XAML/C#var tileNotification = new TileNotification(tileXml);  Step 5: Feed the TileNotification instance into the Update() method of the TileUpdateManager Once the TileNotification instance has been created and the XmlDocument has been passed to its constructor, it needs to be passed to the Update() method of a TileUpdator in order to be shown on the Windows 8 start screen:   HTML/JavaScript notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   XAML/C#TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);    Once the tile notification is updated it’ll show up on the start screen. An example of the wide and square tiles created with the included demo code are shown next:     Download the HTML/JavaScript and XAML/C# sample application here. In the next post in this series I’ll walk through how to queue multiple tiles and clear a queue.

    Read the article

  • how to block https sites on netgear router?

    - by Karthick88it
    I am using NETGEAR Wireless-N-300 Router Model among couple of peoples to sahre internet connectivity. I have a problem, on my company i blocked facebook.com, but the users are access on protocol https, i blocked some ip´s of facebook but they haves a lot ip, please, how to block facebook on https protocol...?? Can anybody help me for creating the block HTTPS traffic rule. Like I need to block: https://www.facebook.com/ many thanks Karthick

    Read the article

  • How to figure out disks performance in Xen?

    - by cpt.Buggy
    So, I have a Dell R710 with PERC 6/i Integrated and 6 450Gb Seagate 15k SAS disks in RAID10, I have 30 Xen vps working on it. Now I need to deploy second server with same hardware for same tasks and I want to figure out maybe it's a good idea to use RAID5 instead of RAID10 because we have a lot of "free" memory on first server and not so much "free space". How do I find out disks performance on first server and find out could I move it to RAID5 without slowing down of whole system?

    Read the article

  • windows print service

    - by user1631171
    Hi my college has a HP color printer that can be used to print both A3 and A4 size color printouts. It is connected to a windows 2008 print server. The windows event viewer provides the status of printouts using event id 307. I would like to know if it is possible to find out if an A3 page was printed or A4 page was printed. Is this information also logged in windows event viewer. Or is there any other event id that captures this information. Also the number of copies printed should be captured in event id 805. I have read in some forums that sometimes the value is wrong. Please provide me some information on this. Thanks in advance.

    Read the article

  • Can installing URL Rewrite 2.0 on production IIS 7.5 have a negative impact?

    - by Olaf
    We have a Windows 2008 R2 server with IIS 7.5 and a lot of customer websites. Being no sys-admin but a developer, I hate to touch that wonderfully running system. However, I'd like to update the IIS plugin URL Rewrite to version 2.0 via Web Platform Installer. I do not want to do anything that might compromise the server, hence the question: can I expect it to work with at least a 99% chance? I did not find any bug reports or reviews on the web, so I'd like to hear an expert on that.

    Read the article

  • Add a trailing slash mod_rewrite

    - by Conner Stephen McCabe
    just wondering how I add a trailing slash at the end of my URL's using Mod_Rewrite? This is my .htaccess file currently: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]*)$ index.php?pageName=$1 My URL show like so: wwww.**.com/pageName I want it to show like so: wwww.**.com/pageName/ The URL is holding a GET request internally, but I want it to look like a genuine directory.

    Read the article

  • Multi Thread Rsync Transfer

    - by reefine
    For some reason when running a single rsync command I am getting 1 MB/sec to 2 MB/sec even when I connecting 2 servers both connected to 1 Gbps ports. rsync -v --progress -e ssh /backup/mysqldata/mysql-bin.000199 [email protected]:/secondary/mysqldata/mysqldata/mysql-bin.000199 I have over 800 GB of data to transfer split among 500 or so files all starting with: mysql-bin.000* I've found that running 25-30 rsync simultaneously from seperate SSH windows gets me upwards of 25 MB/sec but it will take me hours to run these all manually. Is there anyway to get the 25 MB/sec from a single rsync command?

    Read the article

  • Is there a way to get Apache to blank sensitive data from logs?

    - by i..
    We're trying to clean up one of our systems as much as possible & have found that despite our attempts to block, users are accessing a certain part of our system through a HTTP GET with their password in the URL. This results in our Apache logs recording their password in plain text on the server. Is there an Apache directive or module that can filter out (or replace) certain patterns in its logs?

    Read the article

  • Server slowdown

    - by Clinton Bosch
    I have a GWT application running on Tomcat on a cloud linux(Ubuntu) server, recently I released a new version of the application and suddenly my server response times have gone from 500ms average to 15s average. I have run every monitoring tool I know. iostat says my disks are 0.03% utilised mysqltuner.pl says I am OK other see below top says my processor is 99% idle and load average: 0.20, 0.31, 0.33 memory usage is 50% (-/+ buffers/cache: 3997 3974) mysqltuner output [OK] Logged in using credentials from debian maintenance account. -------- General Statistics -------------------------------------------------- [--] Skipped version check for MySQLTuner script [OK] Currently running supported MySQL version 5.1.63-0ubuntu0.10.04.1-log [OK] Operating on 64-bit architecture -------- Storage Engine Statistics ------------------------------------------- [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster [--] Data in MyISAM tables: 370M (Tables: 52) [--] Data in InnoDB tables: 697M (Tables: 1749) [!!] Total fragmented tables: 1754 -------- Security Recommendations ------------------------------------------- [OK] All database users have passwords assigned -------- Performance Metrics ------------------------------------------------- [--] Up for: 19h 25m 41s (1M q [28.122 qps], 1K conn, TX: 2B, RX: 1B) [--] Reads / Writes: 98% / 2% [--] Total buffers: 1.0G global + 2.7M per thread (500 max threads) [OK] Maximum possible memory usage: 2.4G (30% of installed RAM) [OK] Slow queries: 0% (1/1M) [OK] Highest usage of available connections: 34% (173/500) [OK] Key buffer size / total MyISAM indexes: 16.0M/279.0K [OK] Key buffer hit rate: 99.9% (50K cached / 40 reads) [OK] Query cache efficiency: 61.4% (844K cached / 1M selects) [!!] Query cache prunes per day: 553779 [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 34K sorts) [OK] Temporary tables created on disk: 4% (4K on disk / 102K total) [OK] Thread cache hit rate: 84% (185 created / 1K connections) [!!] Table cache hit rate: 0% (256 open / 27K opened) [OK] Open file limit used: 0% (20/2K) [OK] Table locks acquired immediately: 100% (692K immediate / 692K locks) [OK] InnoDB data size / buffer pool: 697.2M/1.0G -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate Enable the slow query log to troubleshoot bad queries Increase table_cache gradually to avoid file descriptor limits Variables to adjust: query_cache_size (> 16M) table_cache (> 256)

    Read the article

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