Daily Archives

Articles indexed Monday September 17 2012

Page 12/17 | < Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Soft delete an entity in Grails with Hibernate Filters Plugin

    - by canotto90
    I was looking for a way to avoid deleting my users from DB, but instead to mark them as deleted and don't bring them back in queries. I found this plugin http://grails.org/plugin/hibernate-filter, which was a great tool for the task. But when I tried to implement my solution, I passed trought same problems whose solutions wheren't (or I was not able to find) on internet. So, next, I describe the way that I solve the problem of soft delete.

    Read the article

  • How to use input type="tel" in a contact form

    - by user1678664
    PHP newbie here trying to use a simple contact form. The fields I have are: "Name", "Email", "Phone", and "Message". I am trying to figure out what to do with the "Phone" field – I want it to output to the same place that "Message" does, so that when the email is received it will output both the message and the phone number to the body of the email. How do I do this? if( isset( $_POST['submit'] ) ) : wp_mail( get_option( 'admin_email' ), 'Website Contact Form', ( isset($_POST['message'] ) ? $_POST['message'] : '(blank)' ), 'From: ' . ( isset( $_POST['from_name'] ) ? $_POST['from_name'] : 'Website Contact Form' ) . ' <' . ( isset( $_POST['from_email'] ) ? $_POST['from_email'] : get_option( 'admin_email' ) ). '>' . "\r\n" ); $output = '<p>Thank you! Your message has been sent.</p>'; else : $output = ' <form action="" method="post"><ul> <li> <label for="from_name">Name</label> <input type="text" name="from_name" id="from_name" /> </li> <li> <label for="from_email">Email</label> <input type="email" name="from_email" id="from_email" /> </li> <li> <label for="from_tel">Phone</label> <input type="tel" name="from_tel" id="from_tel" /> </li> <li> <textarea name="message" id="message"></textarea> </li> <li class="submit"> <input name="submit" type="submit" value="Say Hello!" /> </li> </ul></form>'; endif; return $output;

    Read the article

  • Nesting queries in SQL

    - by ZAX
    The goal of my query is to return the country name and its head of state if it's headofstate has a name starting with A, and the capital of the country has greater than 100,000 people utilizing a nested query. Here is my query: SELECT country.name as country, (SELECT country.headofstate from country where country.headofstate like 'A%') from country, city where city.population > 100000; I've tried reversing it, placing it in the where clause etc. I don't get nested queries. I'm just getting errors back, like subquery returns more than one row and such. If someone could help me out with how to order it, and explain why it needs to be a certain way, that'd be great.

    Read the article

  • Call a C++ constructor from an Objective C class

    - by syvex
    How can I call a C++ constructor from inside an Objective C class? class CppClass { public: CppClass(int arg1, const std::string& arg2): _arg1(arg1), _arg2(arg2) { } // ... private: int _arg1; std::string _arg2; }; @interface ObjC: NSObject { CppClass _cppClass; } @end @implementation ObjC - (id)init { self = [super init]; if ( self ) { // what is the syntax to call CppClass::CppClass(5, "hello") on _cppClass? } return self; } @end

    Read the article

  • Showing all rows for keys with more than one row

    - by Leif Neland
    Table kal id integer primary key init char 4 indexed job char4 id init job --+----+------ 1 | aa | job1 2 | aa | job2 3 | bb | job1 4 | cc | job3 5 | cc | job5 I want to show all rows where init has more than one row id init job --+----+------ 1 | aa | job1 2 | aa | job2 4 | cc | job3 5 | cc | job5 I tried select * from kal where init in (select init from kal group by init having count(init)2); Actually, the table has 60000 rows, and the query was count(init)<40, but it takes humongus time, phpmyadmin and my patience runs out. Both select init from kal group by init having count(init)2) and select * from kal where init in ('aa','bb','cc') runs in "no time", less than 0.02 seconds. I've tried different subqueries, but all takes "infinite" time, more than a few minutes; I've actually never let them finish. Leif

    Read the article

  • Issue with storing items in session in MVC

    - by Sundeep
    I have a customer page on which user can enter multiple locations for customer. I am using telerik ajax grid to display locations, and when a new location is added, I am adding it to session and returning back to the grid. Finally, when user submits, customer and all locations using customerid as reference key gets inserted. I am clearing the session, when user enters create/edit page and on successful commit or any exception occurs. Problem is when user adds the locations for one user and then opens another tab, to create another user then all locations get cleared for previous user. Coz of session, this issue is occuring. Something of viewstate would be page specific. But for ajax grid actions, viewdata/viewbag is not working. Any thoughts on how to implement this. Thanks in advance.

    Read the article

  • REST and links: middle ground?

    - by pbean
    I've been wondering about how far to go with links in REST. Consider books which have authors, but there is obviously a many-to-many relationship between books an authors (a book can be written by multiple authors, and authors can write multiple books). So let's say we have a rest call http://server/book/21, which will return a book XML, containing information about an author. Now since the book is a resource, and the author is a resource, the XML should not straight up include all the author information. It should contain a link to the author information. But which of the below two examples is more widely accepted? (Excuse my crappy formatted XML, I am not that experienced with hand writing XML) <book> <title>Some Book</title> <authors> <author link="http://server/author/82">Some Guy</author> <author link="http://server/author/51">Some Other Guy</author> </authors> </book> Then, an author link would return more information: <author> <name>Some Guy</name> <dateOfBirth>some time</dateOfBirth> </author> Or: <book> <title>Some Book</title> <authors>http://server/book/21/authors</authors> </book> Where http://server/book/21/authors returns: <authors> <author link="http://server/author/82">Some Guy</author> <author link="http://server/author/51">Some Other Guy</author> </authors> And then each of those returns the former <author> example again. The reason I'm asking is basically because at my job they went with the second approach, and it seems to me that clients have to take many more steps to reach where they want to go. Also, for basic information which "you're always going to need" (author's name), you do have to take one additional step. On the other hand, that way the book resource only returns information about the book (nothing else), and to get anything else, you have to access other resources.

    Read the article

  • JAVA: Sort ArrayList<ArrayList<Integer>> on multiple columns

    - by Bob
    First, I did do my homework searching before posting here. My requirement seems to be slightly different compared to questions posted out there. I have a matrix like ArrayList<ArrayList<Integer>> in the following form | id1 | id2 | score | |-----|-----|-------| | 1 | 3 | 95% | | 1 | 2 | 100% | | 1 | 4 | 85% | | 1 | 5 | 95% | | 2 | 10 | 80% | | 2 | 15 | 99% | I want to sort the matrix column-wise (first using score, then the id1). I already have the id1 in a sorted manner. That means I also need to sort all records with the same id1 first by using score, second by the id2. The reason for doing this is to create a ranking of the id2 in each id1. The result for the above example would be: | q_id | d_id | rank | score | |------|------|------|-------| | 1 | 2 | 1 | 100% | | 1 | 3 | 2 | 95% | | 1 | 5 | 3 | 95% | | 1 | 4 | 4 | 85% | | 2 | 15 | 1 | 99% | | 2 | 10 | 2 | 80% | How can I achieve this in Java using some built-in methods of collections?

    Read the article

  • jQuery add class is not working

    - by user1269625
    Hey ya'll I have this code here and it suppose to add the class name "cboxElement" $(".wpcart_gallery a:first").addClass("cboxElement"); but it does not work. I have the proper Jquery file in my header, I have surrounded this in jQuery('document').ready(function($){......}); and it works for all my other Jquery but the add class call. here is what I am trying to add the class to... <div class="wpcart_gallery" style="text-align:center; padding-top:5px;"> <a class="thickbox" href="DSC_0037.jpg" rev="DSC_0037.jpg"></a> </div> Anybody know why this isnt working? I am new to jquery this is also in wordpress hence the jQuery('document')

    Read the article

  • listbox isSelected databinding in DataTemplate

    - by Kinmarui
    I try to simply databind IsSelected property with IsSelected field in my class. But after I change the value in code its doesn't change the property, neither does clicking on ListBoxItem change the field value. XAML: <FlipView ItemsSource="{Binding Source={StaticResource itemsViewSource}}" ... > <FlipView.ItemTemplate> <DataTemplate> <UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates"> <!-- other controls --> <ListBox Grid.Row="1" Grid.ColumnSpan="3" SelectionMode="Multiple" VerticalAlignment="Center" ItemsSource="{Binding Answers}"> <ListBox.Resources> <local:LogicToText x:Key="logToText" /> </ListBox.Resources> <!-- bind IsSelected only in one way from code to content --> <ItemsControl.ItemTemplate> <DataTemplate> <ListBoxItem IsSelected="{Binding IsSelected, Mode=TwoWay, Converter={StaticResource logToText}}" Content="{Binding IsSelected, Mode=TwoWay, Converter={StaticResource logToText}}"> </ListBoxItem> </DataTemplate> </ItemsControl.ItemTemplate> <!-- not working at all <ListBox.Resources> <Style TargetType="ListBoxItem"> <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/> <Setter Property="Content" Value="{Binding IsSelected, Mode=TwoWay}"/> </Style> </ListBox.Resources>--> </ListBox> </UserControl> </DataTemplate> </FlipView.ItemTemplate> </FlipView> Code: Answers private ObservableCollection<PrawoJazdyDataAnswer> _answers = new ObservableCollection<PrawoJazdyDataAnswer>(); public ObservableCollection<PrawoJazdyDataAnswer> Answers { get { return this._answers; } } Single item(Answer) public class PrawoJazdyDataAnswer : NPCHelper// PrawoJazdy.Common.BindableBase { public PrawoJazdyDataAnswer(String ans, bool ansb) { this._ans = ans; this._isSelected = ansb; } public override string ToString() { return _isSelected.ToString(); } //Only For debug purposes normally return _ans; private string _ans; public string Ans { get { return this._ans; } //set { this.SetProperty(ref this._ans, value); } } private bool _isSelected; public bool IsSelected { get { return this._isSelected; } set { _isSelected = value; FirePropertyChanged("IsSelected"); //this.SetProperty(ref this._isSelected, value); } } } FirePropertyChanged public class NPCHelper : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public void FirePropertyChanged(string prop) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(prop)); } } Converter(which sometimes seems to be needed and others not..., I tried ~10 approaches from different tutorials/examples) public class LogicToText : IValueConverter { /// <summary> /// /// </summary> public object Convert(object value, Type targetType, object parameter, string language) { //if (value == null || (bool)value == false) // return "False"; return value.ToString(); } /// <summary> /// /// </summary> public object ConvertBack(object value, Type targetType, object parameter, string language) { return value.ToString().Contains("True") ? true : false; } Thanks in advance, and sorry for my English(still learning). @edit Thanks for quick reply. For test purposes i created a button and text block: It's in other controls part (above list box, but in FlipView) <Button Click="spr" >Sprawdz</Button> <TextBlock Text="{Binding Answers[0].IsSelected, Mode=TwoWay}" > </TextBlock> Click method private void spr(object sender, RoutedEventArgs e) { var ans = ((PrawoJazdyDataQuestion)this.flipView.SelectedItem).Answers; foreach (var item in ans) item.IsSelected = item.IsSelected ? false : true; } As I wrote when i'm changing data from code side its change text, but not appearance of ListBoxItem, and if i just select it on ListBox its doesn't change the date i textblock neither in ListBox itself.

    Read the article

  • what is the event to handle row scrolling in EXTJS Gridpanel?

    - by user1480705
    I am displaying data in a GridPanel. My requirement is to hide some menu items based on the row selections. I have this perfectly working when a user clicks or rightclicks - i am handling the event for rowclick and rowcontextmenu respecitvely. But i am facing issue to locate the event - If the user first clicks on the row and them use up and down arrows to move on to other rows. Thanks in Advance

    Read the article

  • Getting NoClassdef on HMAC_SHA1 in Webpshere

    - by defjab
    We have WAS 6.0 (I know) .2.43 ND running in multiple regions. Our Dev-B region runs fine, but Dev-C throws a java exception when we make web-calls (at least this is what the developer tells me)...Same code in both regions and I checked the obvious suspects (Global security, SSL ciphers etc) and they all seem to match. Here's the stack trace from SystemErr: [8/1/12 4:02:31:758 EDT] 0000005c ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet action. Exception thrown : java.lang.NoClassDefFoundError at javax.crypto.Mac.getInstance(DashoA12275) at net.oauth.signature.HMAC_SHA1.computeSignature(HMAC_SHA1.java:73) at net.oauth.signature.HMAC_SHA1.getSignature(HMAC_SHA1.java:39) at net.oauth.signature.OAuthSignatureMethod.getSignature(OAuthSignatureMethod.java:83) at net.oauth.signature.OAuthSignatureMethod.sign(OAuthSignatureMethod.java:54) at com.harcourt.hsp.utils.LTIUtil.generateSignature(LTIUtil.java:62) at com.harcourt.hsp.web.struts.lti.action.BaseLTIAction.generateSignature(BaseLTIAction.java:238) at com.harcourt.hsp.web.struts.lti.action.BaseLTIAction.execute(BaseLTIAction.java:96) at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1796) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:887) at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1937) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:130) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:434) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:373) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:253) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952) at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498) at javax.crypto.Mac.getInstance(DashoA12275) at net.oauth.signature.HMAC_SHA1.computeSignature(HMAC_SHA1.java:73) at net.oauth.signature.HMAC_SHA1.getSignature(HMAC_SHA1.java:39) at net.oauth.signature.OAuthSignatureMethod.getSignature(OAuthSignatureMethod.java:83) at net.oauth.signature.OAuthSignatureMethod.sign(OAuthSignatureMethod.java:54) at com.harcourt.hsp.utils.LTIUtil.generateSignature(LTIUtil.java:62) at com.harcourt.hsp.web.struts.lti.action.BaseLTIAction.generateSignature(BaseLTIAction.java:238) at com.harcourt.hsp.web.struts.lti.action.BaseLTIAction.execute(BaseLTIAction.java:96) at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1796) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:887) at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1937) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:130) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:434) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:373) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:253) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619) at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952) at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498) Thanks for your help. I'm sure it's a config that I'm missing.

    Read the article

  • Alternative for namespaces in xml

    - by mridul4c
    I have a web-service which gives a xml feed for number of clients of us, our clients consumes the xml in different types of devices. In our XML we have some namespaces also. But one of our clients can't detect namespaces because of some limitation at their end. But I can't provide a new xml for him as well. Please suggest me something so that I can satisfy the needs of namespaces without using that, so that i can change my xml to be usable by all of them. Thanks in advance.

    Read the article

  • Jmesa table page navigation

    - by Sara
    I am new to Jmesa and am trying to use it on my jsp page. I use exactly same JSP and controller code as the example on http://code.google.com/p/jmesa/wiki/JSPTagExample . The table shows up and looks fine. The problem is non of the buttons on the toolbar are working. E.g. page navigation arrows, etc. What might be wrong with my code( As I said it is exactly same as the example). Should I add extra code for page navigation? Thanks, Sara. Update: I found out what the problem is, after I enter toolbar buttons it routes to "localhost:8080/portal/projectTag.run?maxRows=4&projectTag_tr_=true&projectTag_p_=1&projectTag_mr_=4" "Instead of "localhost:8080/portal/page/projects/projectTag.run?maxRows=4&projectTag_tr_=true&projectTag_p_=1&projectTag_mr_=4" So it doesn't include the "/page/projects" in the url. How can I add that?

    Read the article

  • game currency convert: math efficient

    - by Comradsky
    For variables:4 text views named diamondText, goldText, silverText, and bronzeText;money variable unsigned int money;and an NSTimer, every .1 sec,runs function: -(void)updateMoney{ money++; bronzeText.text = [NSString stringWithFormat:@"%d",money]; silverText.text = [NSString stringWithFormat:@"%d",money%10]; goldText.text = [NSString stringWithFormat:@"%d",money%100]; diamondText.text= [NSString stringWithFormat:@"%d",money%1000]; } Given that my currency is diamond = 10 gold = 10 silver = 10 bronze = 1; What would be most efficient way to calculate and display the money labels? How would you store this variable, with GameCenter and NSDictionary or GameCenter and something else? More details are below if you don't understand. To clarify: bronze has the last 2 numbers, silver has the next 2 numbers, and so on. I understand I could use 4 ints or an array, but i would rather try to use this method, unless theres a much more efficient way. Example: When money = 1000;bronzeText = nothing, silverText = 10,goldText = nothing, diamondText = nothing; What other ways would you do this that you think would be more efficient? I will be calling a function (void)collisionDetector that detects if my player.frame crosses with a flyingObject.frame, and if that object is a coin it gives an added value to money and then calls (void)updateMoney. Im just using the timer to test this and spawn these flying objects.

    Read the article

  • Creating multiple markers in Google Maps using XML

    - by Jessica Stanley
    I'm almost sure this question has been asked before, but for the love of me I just can't find the answer anywhere. Basically what I want to do is create multiple markers on a custom Google Map I'm building. I already have an XML file with the coordinates (lat/lng) and title of each item. I'd like to take the data from the XML file and use it to create markers on the map. I've found how to do this using KML files and MySQL/PHP, but I need to know how to do it in Javascript. One more thing: I have a .xml file of my own, so it won't be like I'll be getting the data from a webpage because I believe (from research I've done today) that the code for that may be different. If anyone knows if this has been posted somewhere else before, could you please direct me there? I've literally been searching all day, this is my last resort. Thanks a ton!!!

    Read the article

  • Fixed Position div Vertical Only

    - by user720033
    I have a current web build with a right sidebar that is a fixed position. I have tried to positioning from the right but don't want it overlapping other divs content. What I am looking for is to have the content scrollable horizontally to the right when it is out of the viewport window. Any help would be greatly appreciated. similarly to this: http://demo.rickyh.co.uk/css-position-x-and-position-y/ however I can not get this working. This has been solved by alternative method. Thanks for those who actually considered helping.

    Read the article

  • How to Import a .bak file using MySQL?

    - by user682526
    I have no knowledge on MySQL and I have received a .bak file from one of my customer and he asked me to "import" this file using MySQL. I installed MysQL Community Server free download which installs MySQL Command Line Client. Now I don't know how to Import this .bak file and can't read the necessary data that I need. I tried installation of MySQL EE free trial as well but it doesn't give me anything that I can invoke the DB GUI so I can import the .bak file either. I'm frustrated now and can't go anywhere. Can you please help ? Thanks !

    Read the article

  • Validation of textarea

    - by Hulk
    How to validate a textarea in a form.i.e, it should not be empty or have any new lines and if so raise an alert <script> function val() { //ifnewline found or blank raise an alert } </script> <form> <textarea name = "pt_text" rows = "8" cols = "8" class = "input" WRAP ></textarea> <input type=""button" onclick="val();" </form> Thanks

    Read the article

  • Dartisans ep 12 - Dart and Web Components

    Dartisans ep 12 - Dart and Web Components Ask and vote for questions: developers.google.com Web Components are ushering in the "declarative renaissance" for modern web development. Watch this episode of Dartisans to learn how you can build Web Components with Dart, and compile them into JavaScript to run across the modern web. From: GoogleDevelopers Views: 0 0 ratings Time: 00:00 More in Science & Technology

    Read the article

  • AddThis - contains too many device filters error

    - by Yousef_Jadallah
    When using AddThis service with asp.net, some exceptions will throw like these: The string 'fb:like:layout' contains too many device filters. There can be only one. The string 'g:plusone:size' contains too many device filters. There can be only one. You can solve this by using "In line server code".   Step 1: Implement the following code in your code file:   Protected Function GetFacebookAttribute() As String Return String .Format( "{0}=" "{1}" ""...(read more)

    Read the article

  • Announcing: Great Improvements to Windows Azure Web Sites

    - by ScottGu
    I’m excited to announce some great improvements to the Windows Azure Web Sites capability we first introduced earlier this summer.  Today’s improvements include: a new low-cost shared mode scaling option, support for custom domains with shared and reserved mode web-sites using both CNAME and A-Records (the later enabling naked domains), continuous deployment support using both CodePlex and GitHub, and FastCGI extensibility.  All of these improvements are now live in production and available to start using immediately. New “Shared” Scaling Tier Windows Azure allows you to deploy and host up to 10 web-sites in a free, shared/multi-tenant hosting environment. You can start out developing and testing web sites at no cost using this free shared mode, and it supports the ability to run web sites that serve up to 165MB/day of content (5GB/month).  All of the capabilities we introduced in June with this free tier remain the same with today’s update. Starting with today’s release, you can now elastically scale up your web-site beyond this capability using a new low-cost “shared” option (which we are introducing today) as well as using a “reserved instance” option (which we’ve supported since June).  Scaling to either of these modes is easy.  Simply click on the “scale” tab of your web-site within the Windows Azure Portal, choose the scaling option you want to use with it, and then click the “save” button.  Changes take only seconds to apply and do not require any code to be changed, nor the app to be redeployed: Below are some more details on the new “shared” option, as well as the existing “reserved” option: Shared Mode With today’s release we are introducing a new low-cost “shared” scaling mode for Windows Azure Web Sites.  A web-site running in shared mode is deployed in a shared/multi-tenant hosting environment.  Unlike the free tier, though, a web-site in shared mode has no quotas/upper-limit around the amount of bandwidth it can serve.  The first 5 GB/month of bandwidth you serve with a shared web-site is free, and then you pay the standard “pay as you go” Windows Azure outbound bandwidth rate for outbound bandwidth above 5 GB. A web-site running in shared mode also now supports the ability to map multiple custom DNS domain names, using both CNAMEs and A-records, to it.  The new A-record support we are introducing with today’s release provides the ability for you to support “naked domains” with your web-sites (e.g. http://microsoft.com in addition to http://www.microsoft.com).  We will also in the future enable SNI based SSL as a built-in feature with shared mode web-sites (this functionality isn’t supported with today’s release – but will be coming later this year to both the shared and reserved tiers). You pay for a shared mode web-site using the standard “pay as you go” model that we support with other features of Windows Azure (meaning no up-front costs, and you pay only for the hours that the feature is enabled).  A web-site running in shared mode costs only 1.3 cents/hr during the preview (so on average $9.36/month). Reserved Instance Mode In addition to running sites in shared mode, we also support scaling them to run within a reserved instance mode.  When running in reserved instance mode your sites are guaranteed to run isolated within your own Small, Medium or Large VM (meaning no other customers run within it).  You can run any number of web-sites within a VM, and there are no quotas on CPU or memory limits. You can run your sites using either a single reserved instance VM, or scale up to have multiple instances of them (e.g. 2 medium sized VMs, etc).  Scaling up or down is easy – just select the “reserved” instance VM within the “scale” tab of the Windows Azure Portal, choose the VM size you want, the number of instances of it you want to run, and then click save.  Changes take effect in seconds: Unlike shared mode, there is no per-site cost when running in reserved mode.  Instead you pay only for the reserved instance VMs you use – and you can run any number of web-sites you want within them at no extra cost (e.g. you could run a single site within a reserved instance VM or 100 web-sites within it for the same cost).  Reserved instance VMs start at 8 cents/hr for a small reserved VM.  Elastic Scale-up/down Windows Azure Web Sites allows you to scale-up or down your capacity within seconds.  This allows you to deploy a site using the shared mode option to begin with, and then dynamically scale up to the reserved mode option only when you need to – without you having to change any code or redeploy your application. If your site traffic starts to drop off, you can scale back down the number of reserved instances you are using, or scale down to the shared mode tier – all within seconds and without having to change code, redeploy, or adjust DNS mappings.  You can also use the “Dashboard” view within the Windows Azure Portal to easily monitor your site’s load in real-time (it shows not only requests/sec and bandwidth but also stats like CPU and memory usage). Because of Windows Azure’s “pay as you go” pricing model, you only pay for the compute capacity you use in a given hour.  So if your site is running most of the month in shared mode (at 1.3 cents/hr), but there is a weekend when it gets really popular and you decide to scale it up into reserved mode to have it run in your own dedicated VM (at 8 cents/hr), you only have to pay the additional pennies/hr for the hours it is running in the reserved mode.  There is no upfront cost you need to pay to enable this, and once you scale back down to shared mode you return to the 1.3 cents/hr rate.  This makes it super flexible and cost effective. Improved Custom Domain Support Web sites running in either “shared” or “reserved” mode support the ability to associate custom host names to them (e.g. www.mysitename.com).  You can associate multiple custom domains to each Windows Azure Web Site.  With today’s release we are introducing support for A-Records (a big ask by many users). With the A-Record support, you can now associate ‘naked’ domains to your Windows Azure Web Sites – meaning instead of having to use www.mysitename.com you can instead just have mysitename.com (with no sub-name prefix).  Because you can map multiple domains to a single site, you can optionally enable both a www and naked domain for a site (and then use a URL rewrite rule/redirect to avoid SEO problems). We’ve also enhanced the UI for managing custom domains within the Windows Azure Portal as part of today’s release.  Clicking the “Manage Domains” button in the tray at the bottom of the portal now brings up custom UI that makes it easy to manage/configure them: As part of this update we’ve also made it significantly smoother/easier to validate ownership of custom domains, and made it easier to switch existing sites/domains to Windows Azure Web Sites with no downtime. Continuous Deployment Support with Git and CodePlex or GitHub One of the more popular features we released earlier this summer was support for publishing web sites directly to Windows Azure using source control systems like TFS and Git.  This provides a really powerful way to manage your application deployments using source control.  It is really easy to enable this from a website’s dashboard page: The TFS option we shipped earlier this summer provides a very rich continuous deployment solution that enables you to automate builds and run unit tests every time you check in your web-site, and then if they are successful automatically publish to Azure. With today’s release we are expanding our Git support to also enable continuous deployment scenarios and integrate with projects hosted on CodePlex and GitHub.  This support is enabled with all web-sites (including those using the “free” scaling mode). Starting today, when you choose the “Set up Git publishing” link on a website’s “Dashboard” page you’ll see two additional options show up when Git based publishing is enabled for the web-site: You can click on either the “Deploy from my CodePlex project” link or “Deploy from my GitHub project” link to walkthrough a simple workflow to configure a connection between your website and a source repository you host on CodePlex or GitHub.  Once this connection is established, CodePlex or GitHub will automatically notify Windows Azure every time a checkin occurs.  This will then cause Windows Azure to pull the source and compile/deploy the new version of your app automatically.  The below two videos walkthrough how easy this is to enable this workflow and deploy both an initial app and then make a change to it: Enabling Continuous Deployment with Windows Azure Websites and CodePlex (2 minutes) Enabling Continuous Deployment with Windows Azure Websites and GitHub (2 minutes) This approach enables a really clean continuous deployment workflow, and makes it much easier to support a team development environment using Git: Note: today’s release supports establishing connections with public GitHub/CodePlex repositories.  Support for private repositories will be enabled in a few weeks. Support for multiple branches Previously, we only supported deploying from the git ‘master’ branch.  Often, though, developers want to deploy from alternate branches (e.g. a staging or future branch). This is now a supported scenario – both with standalone git based projects, as well as ones linked to CodePlex or GitHub.  This enables a variety of useful scenarios.  For example, you can now have two web-sites - a “live” and “staging” version – both linked to the same repository on CodePlex or GitHub.  You can configure one of the web-sites to always pull whatever is in the master branch, and the other to pull what is in the staging branch.  This enables a really clean way to enable final testing of your site before it goes live. This 1 minute video demonstrates how to configure which branch to use with a web-site. Summary The above features are all now live in production and available to use immediately.  If you don’t already have a Windows Azure account, you can sign-up for a free trial and start using them today.  Visit the Windows Azure Developer Center to learn more about how to build apps with it. We’ll have even more new features and enhancements coming in the weeks ahead – including support for the recent Windows Server 2012 and .NET 4.5 releases (we will enable new web and worker role images with Windows Server 2012 and .NET 4.5 next month).  Keep an eye out on my blog for details as these new features become available. Hope this helps, Scott P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

    Read the article

  • Using rounded corners in modern websites with CSS3

    - by nikolaosk
    This is going to be the sixth post in a series of posts regarding HTML 5. You can find the other posts here , here, here , here and here.In this post I will provide a hands-on example on how to use rounded corners (rounded corners in CSS3) in your website. I think this is the feature that is most required in the new modern websites.Most websites look great with their lovely round panels and rounded corner tab style menus. We could achieve that effect earlier but we should resort to complex CSS rules and images. I will show you how to accomplish this great feature with the power of CSS 3.We will not use Javascript.Javascript is required for IE 7, IE 8 and the notorious IE 6. The best solution for implementing corners using CSS and Javascript without using images is Nifty corners cube. There are detailed information how to achieve this in the link I provided. This solution is tested in earlier vesrions of IE (IE 6,IE 7,IE 8) and Opera,Firefox,Safari. In order to be absolutely clear this is not (and could not be) a detailed tutorial on HTML 5. There are other great resources for that.Navigate to the excellent interactive tutorials of W3School.Another excellent resource is HTML 5 Doctor.Two very nice sites that show you what features and specifications are implemented by various browsers and their versions are http://caniuse.com/ and http://html5test.com/. At this times Chrome seems to support most of HTML 5 specifications.Another excellent way to find out if the browser supports HTML 5 and CSS 3 features is to use the Javascript lightweight library Modernizr.In this hands-on example I will be using Expression Web 4.0.This application is not a free application. You can use any HTML editor you like.You can use Visual Studio 2012 Express edition. You can download it here.Before I go on with the actual demo I will use the (http://www.caniuse.com) to see the support for web fonts from the latest versions of modern browsers.Please have a look at the picture below. We see that all the latest versions of modern browsers support this feature.We can see that even IE 9 supports this feature.  Let's move on with the actual demo. This is going to be a rather simple demo.I create a simple HTML 5 page. The markup follows and it is very easy to use and understand <!DOCTYPE html><html lang="en">  <head>    <title>HTML 5, CSS3 and JQuery</title>    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >    <link rel="stylesheet" type="text/css" href="style.css">       </head>  <body>      <div id="header">      <h1>Learn cutting edge technologies</h1>    </div>        <div id="main">          <h2>HTML 5</h2>                        <p id="panel1">            HTML5 is the latest version of HTML and XHTML. The HTML standard defines a single language that can be written in HTML and XML. It attempts to solve issues found in previous iterations of HTML and addresses the needs of Web Applications, an area previously not adequately covered by HTML.          </p>      </div>             </body>  </html>Then I need to write the various CSS rules that style this markup. I will name it style.css   body{        line-height: 38px;        width: 1024px;        background-color:#eee;        text-align:center;      }#panel1 { margin:auto; text-align:left; background-color:#77cdef;width:400px; height:250px; padding:15px;font-size:16px;font-family:tahoma;color:#fff;border-radius: 20px;}Have a look below to see what my page looks like in IE 10. This is possible through the border-radious property. The colored panel has all four corners rounded with the same radius.We can add a border to the rounded corner panel by adding this property declaration in the #panel1,  border:4px #000 solid;We can have even better visual effects if we specify a radius for each corner.This is the updated version of the style.css. body{        line-height: 38px;        width: 1024px;        background-color:#eee;        text-align:center;      }#panel1 { margin:auto; text-align:left; background-color:#77cdef;border:4px #000 solid;width:400px; height:250px; padding:15px;font-size:16px;font-family:tahoma;color:#fff;border-top-left-radius: 20px;border-top-right-radius: 70px;border-bottom-right-radius: 20px;border-bottom-left-radius: 70px;} This is how my page looks in Firefox 15.0.1  In this final example I will show you how to style with CSS 3 (rounded corners) a horizontal navigation menu. This is the new version of the HTML markup<!DOCTYPE html><html lang="en">  <head>    <title>HTML 5, CSS3 and JQuery</title>    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >    <link rel="stylesheet" type="text/css" href="style.css">       </head>  <body>      <div id="header">      <h1>Learn cutting edge technologies</h1>    </div>        <div id="nav"><ul><li><a class="mymenu" id="activelink" href="http://weblogs.asp.net/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts§ionid=1153&postid=8934038#">Main</a></li><li><a class="mymenu" href="http://weblogs.asp.net/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts§ionid=1153&postid=8934038#">HTML 5</a></li><li><a class="mymenu" href="http://weblogs.asp.net/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts§ionid=1153&postid=8934038#">CSS 3</a></li><li><a class="mymenu" href="http://weblogs.asp.net/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts§ionid=1153&postid=8934038#">JQuery</a></li></ul></div>        <div id="main">          <h2>HTML 5</h2>                        <p id="panel1">            HTML5 is the latest version of HTML and XHTML. The HTML standard defines a single language that can be written in HTML and XML. It attempts to solve issues found in previous iterations of HTML and addresses the needs of Web Applications, an area previously not adequately covered by HTML.          </p>      </div>             </body>  </html> This is the updated version of style.css body{        line-height: 38px;        width: 1024px;        background-color:#eee;        text-align:center;      }#panel1 { margin:auto; text-align:left; background-color:#77cdef;border:4px #000 solid;width:400px; height:250px; padding:15px;font-size:16px;font-family:tahoma;color:#fff;border-top-left-radius: 20px;border-top-right-radius: 70px;border-bottom-right-radius: 20px;border-bottom-left-radius: 70px;}#nav ul {width:900px; position:relative;top:24px;}ul li { text-decoration:none; display:inline;}ul li a.mymenu { font-family:Tahoma; color:black; font-size:14px;font-weight:bold;background-color:#77cdef; color:#fff;border-top-left-radius:18px; border-top-right-radius:18px; border:1px solid black; padding:15px; padding-bottom:10px;margin :2px; text-decoration:none; border-bottom:none;}.mymenu:hover { background-color:#e3781a; color:black;} The CSS rules are the classic rules that are extensively used for styling menus.The border-radius property is still responsible for the rounded corners in the menu.This is how my page looks in Chrome version 21.  Hope it helps!!!

    Read the article

  • How to disable or tune filesystem cache sharing for OpenVZ?

    - by gertvdijk
    For OpenVZ, an example of container-based virtualization, it seems that host and all guests are sharing the filesystem cache. This sounds paradoxical when talking about virtualization, but this is actually a feature of OpenVZ. It makes sense too. Because only one kernel is running, it's possible to benefit from sharing the same pages of filesystem cache in memory. And while it sounds beneficial, I think a set up here actually suffers in performance from it. Here's why I think why: my machines aren't actually sharing any files on disk so I can't benefit from this feature in OpenVZ. Several OpenVZ machines are running MySQL with MyISAM tables. MyISAM relies on the system's filesystem cache for caching of data files, unlike InnoDB's buffer pool. Also some virtual machines are known to do heavy and large I/O operations on the same filesystem in the host. For example, when running cat *.MYD > /dev/null on some large database in one machine, I saw the filesystem cache lowering in another, monitored by htop. This essentially flushes all the useful filesystem cache in guests (FIFO) and so it flushes the MySQL caches in the guests. Now users are complaining that MySQL is very slow. And it is. Some simple SELECT queries take several seconds on times disk I/O is heavily used by other machines. So, simply put: Is there a way to avoid filesystem cache being wiped out by other virtual machines in container-based virtualization? Some thoughts: Choosing algorithm for flushing filesystem cache in the kernel. (possible? how?) Reserving a certain amount of pages for a single VM. (seems no option for filesystem cache type of pages that reading man vzctl) Will running MySQL on another filesystem get me anywhere? If not, I think my alternatives are: Use KVM for MySQL-MyISAM running VMs. KVM actually assigns memory to the VM and does not allow swapping out caches unless using a balloon driver. Move to InnoDB and tune the buffer pools, dirty pages, etc. This is now considered to be 'nice to have' on the long-term as not everyone responsible for administration of the system understands InnoDB. more suggestions welcome. System software: Proxmox (now 1.9, could be upgraded to 2.x). One big LV assigned for the VMs.

    Read the article

  • Migrate servers and mailboxes?

    - by johnnietheblack
    I am moving a website from one hosting provider to another, and this of course means that I need to migrate all the mailboxes as well. Do I have to manually move all the old emails from one server to another, or will all the email clients "save" a copy of the old emails on each computer? UPDATE Pardon, the naivety - I hope this additional info helps: I'm doing this remotely, so I am not sure which email client(s) people will be using at the office, but I will need to be prepared for both POP and IMAP setups. Also, the server they currently have is on VPS.net (cPanel), and we are migrating to a MediaTemple Dedicated Virtual (Plesk). Both Linux.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >