Search Results

Search found 1457 results on 59 pages for '000'.

Page 13/59 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Advice for Storing and Displaying Dates and Times Across Different Time Zones

    A common question I receive from clients, colleagues, and 4Guys readers is for recommendations on how best to store and display dates and times in a data-driven web application. One of the challenges in storing and displaying dates in a web application is that it is quite likely that the visitors arriving at your site are not in the same time zone as your web server; moreover, it's very likely that your site attracts visitors from many different time zones from around the world. Consider an online messageboard site, like ASPMessageboard.com, where each of 1,000,000+ posts includes the date and time it was made. Imagine a user from New York leaves a post on April 7th at 4:30 PM and that the web server hosting the site is located in Dallas, Texas, which is one hour earlier than New York. When storing that post to the database do you record the post's date and time relative to the visitor (4:30 PM), the relative to the web server (3:30 PM), or some other value? And when displaying this post how do you show that date and time to a reader in San Francisco, which is three hours earlier than New York? Do you show the time relative to the person who made the post (4:30 PM), relative to the web server (3:30 PM), or relative to the user (1:30 PM)? And if you decide to store or display the date based on the poster's or visitor's time zone then how do you know their time zone and its offset? How do you account for daylight savings, and so on? This article provides guidance on how to store and display dates and times for visitors across different time zones and includes a demo that gives a working example of some of these techniques. Read on to learn more! Read More >

    Read the article

  • Repeat use of Schema / Rich Snippets Markup i.e LocalBusiness Data

    - by bybe
    I am unable to find official wording and I'm hoping that some Rich Snippets/Schema Guru can give me some insight into proper usage of repeated content when it comes to using markup. I'm building a site that wants to use Schema as the markup type and the owner would like as much usage as possible. The business name, telephone and address will appear on every page now is it valid or even useful to use Rich Snippets on every page where this information is displayed. For example this information appears in the header, and footer of every page of the site and too give you an example of my current markup see below: <body itemscope itemtype="http://schema.org/LocalBusiness"> <header> <a itemprop="url" href="http://www.domain.co.uk/"> <img itemprop="logo" src="image.png" alt="Company Name Logo" /> </a> <span itemprop="telephone">01202 000 000</span> </header> <div> This is where the content will go</div> <footer> <span itemprop="name">Company Name</span> <span itemprop="description"> A small little bit about this company</span> <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <span itemprop="streetAddress">Address Goes here</span> <span itemprop="addressLocality">Area Here</span>, <span itemprop="addressRegion">Region Here</span> </div> </footer> </body> !-- Local Business Schema Now Closed --> So as you can see above this information will be displayed on every single page.... Is this valid or bad to repeat usage of this information in schema format...

    Read the article

  • Sample domain model for online store

    - by Carel
    We are a group of 4 software development students currently studying at the Cape Peninsula University of Technology. Currently, we are tasked with developing a web application that functions as a online store. We decided to do the back-end in Java while making use of Google Guice for persistence(which is mostly irrelevant for my question). The general idea so far to use PHP to create the website. We decided that we would like to try, after handing in the project, and register a business to actually implement the website. The problem we have been experiencing is with the domain model. These are mostly small issues, however they are starting to impact the schedule of our project. Since we are all young IT students, we have virtually no experience in the business world. As such, we spend quite a significant amount of time planning the domain model in the first place. Now, some of the issues we're picking up is say the reference between the Customer entity and the order entity. Currently, we don't have the customer id in the order entity and we have a list of order entities in the customer entity. Lately, I have wondered if the persistence mechanism will put the client id physically in the order table, even if it's not in the entity? So, I started wondering, if you load a customer object, it will search the entire order table for orders with the customer's id. Now, say you have 10 000 customers and 500 000 orders, won't this take an extremely long time? There are also some business processes that I'm not completely clear on. Finally, my question is: does anyone know of a sample domain model out there that is similar to what we're trying to achieve that will be safe to look at as a reference? I don't want to be accused of stealing anybody's intellectual property, especially since we might implement this as a business.

    Read the article

  • Artists and music - i need help to decide wich cms to use.

    - by infty
    A friend has asked me to build a site with the following options: staff members must be able to add new music and artists to the page a gallery must be provided - it is also good if each artist has the ability to have his/her own, smaller, gallery users must be able to vote for artists users must be able to alter in discussions (forums or comments sections) staff members must be able to blog staff members must be able to write articles I did a small project where i actually implementet all of these features, but i want to use an existing content managment system for all of these features so that future devolpers can, hopefully, more easy extend the website. And also, so that i dont have to provide to much documentation. I have never developed a website using an external cms like drupal or wordpress and after seeing hours of tutorial videos of both systems, i still cant make up my mind on wheter i should : a) use Drupal 7 b) use Wordpress 3 c) create my own cms I can only imagine that staff members would also want to create content using iphone or android based mobile devices. But this is not a required feature. Can someone, with experience, please tell me about their experiences with bigger projects like this? The site will approx. have a total of 400 000 - 500 000 visitors (not daily visitors, based on numbers from last year in a period of 4 months)

    Read the article

  • What technologies are needed to be a freelance web developer / designer targeting small businesses?

    - by Jason Wirth
    First off, I'm not looking for this answer: "learn PHP/MySQL, JQuery, HTML/CSS...." My background, I wear many hats, and do many things. Currently I manage investment accounts with a business partner who is also a friend. He happens to be attending business / law school perusing a joint JD and MBA. As a result, we're putting our into "coast", maintaining our current clients, but not acquiring more. Recently I've picked up some freelance graphic design / web development / online marketing side work (Photoshop, HTML/CSS, WordPress) through some personal networks. The work is enjoyable; now I'm thinking about expanding it into a larger business with these primary goals: augment my finances (I'm shooting for about $1,000-2,000 per mo.), learn new technologies, involve myself with meaningful work. As an entrepreneur I don't mind the aspects of running a business that hassle other freelancers... -- the marketing -- the billing -- etc. I'm considering targeting the small to middle market businesses and organizations where I can contribute in marketing, design, and development building projects from the ground up. Thus I'll have freedom to decide the specific technology (I won't have to work with an existing code base). What kinds of projects should I focus on? What technologies are a good fit for this style of work? For example: It might be fun to develop with Ruby on Rails. However, maybe a lot of projects would be rolling out e-commerce solutions. Thus, I should focus on PHP due to more shopping cart options, skipping ROR entirely.

    Read the article

  • Artists and music - Need Help Deciding on a CMS

    - by infty
    A friend has asked me to build a site with the following options: staff members must be able to add new music and artists to the page a gallery must be provided - it is also good if each artist has the ability to have his/her own smaller gallery users must be able to vote for artists users must be able to alter in discussions (forums or comments sections) staff members must be able to blog staff members must be able to write articles I did a small project where i actually implemented all of these features, but I want to use an existing content management system for all of these features so that future developers can, hopefully, more easy extend the website. And also, so that I don't have to provide too much documentation. I have never developed a website using an external CMS like Drupal or Wordpress and after seeing hours of tutorial videos of both systems, I still can't make up my mind on whether i should : a) use Drupal 7 b) use Wordpress 3 c) create my own cms I can imagine that staff members would also want to create content using iPhone or android based mobile devices, but this is not a required feature. Can someone, with experience, please tell me about their experiences with larger projects like this? The site will have approximately 400 000 - 500 000 visitors (not daily visitors, based on numbers from last year in a period of 4 months)

    Read the article

  • how to recover lost partitions data

    - by TheJoester
    I have a 2TB SATA drive that was being used as file storage on my UBUNTU computer. I was re-imaging my windows box so I used that drive to back up some files to it. I did this by taking the drive from my windows PC and putting it in my UBUNTU PC, mounted it and copied the files over. After the windows refresh I thought it would be easier to take the 2 TB drive and dock it in the external dock my Windows case has built in. Anyway it would recognize in BIOS but windows would not see it (because it was EXT3 or EXT4) so when I went into the disk manager it advised me the drive needed to be initialized. Me not thinking I initialized it as a GUID Partition table. Now it sees it as a blank drive, even in UBUNTU. I have done nothing else to write or change the drive. I was wondering if there is a qay to repair the old partitioning and get access to my files back? many thanks! EDIT: I followed the instructions in the link @kniwor sent me. I used the command sudo gpart -W /dev/sda /dev/sda and here was the result: Guessed primary partition table: Primary partition(1) type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX) size: 0mb #s(1) s(2861671176-2861671176) chs: (1023/254/63)-(1023/254/63)d (178130/202/1)-(178130/202/1)r Primary partition(2) type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX) size: 0mb #s(1) s(3484550160-3484550160) chs: (1023/254/63)-(1023/254/63)d (216903/55/1)-(216903/55/1)r Primary partition(3) type: 000(0x00)(unused) size: 0mb #s(0) s(0-0) chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r Primary partition(4) type: 000(0x00)(unused) size: 0mb #s(0) s(0-0) chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r Not sure it found what I wanted. suggestions?

    Read the article

  • Repurposing CSS Class Selectors

    - by limefartlek
    I don't know what this technique is called, I've only seen it used. It's a way to repurpose the same selectors with CSS. For example if I create h1 { font-size:18px; color:#FFFFFF; font-family:Arial, Helvetica;margin:0; padding:0; } h2 { font-size:18px; color:#000000; font-family:Arial, Helvetica; font-weight:normal;margin:0; padding:0; } I can repurpose the h selectors with something like .whatever h1 { color: #000; font: 2.0em arial, sans-serif; background-color: #fff3ea; margin: 50px 0px 0px 50px; } .whatever h2 { color: #000; font: 1.7em bold arial, sans-serif; background-color: #fff3ea; margin: 25px 0px 25px 75px; } If h1 and h2 appear inside of a div called whatever, then they will assume those properties. You can do this with ID tags and class tags but I can't for the life of me remember how this is done. Any thoughts?

    Read the article

  • PHP behaves weird, mixing up HTML markup.

    - by adardesign
    Thanks for looking on this problem. I have a page that is totally valid page, and there is a PHP loop that brings in a <li> for each entry of the table. When i check this page locally it looks 100% OK, but when veiwing the page online the left side bar (which creates this markup is broken randomly mixing <div>'s and <li>'s and i have no clue what the problem is. See page (problem is on the left side) php code <?php do { ?> <li class="clear-block" id="<?php echo $row_Recordset1['penSKU']; ?>"> <a title="Click to view the <?php echo $row_Recordset1['penName']; ?> collection" rel="<?php echo $row_Recordset1['penSKU']; ?>"> <img src="prodImages/small/<?php echo $row_Recordset1['penSKU']; ?>.png" alt="" /> <div class="prodInfoCntnr"> <div class="basicInfo"> <span class="prodName"><?php echo $row_Recordset1['penName']; ?></span> <span class="prodSku"><?php echo $row_Recordset1['penSKU']; ?></span> </div> <div class="secondaryInfo"> <span>As low as .<?php echo $row_Recordset1['price25000']; ?>¢ <!--<em>(R)</em>--></span> <div class="colorPlacholder" rel="<?php echo $row_Recordset1['penColors']; ?>"></div> </div> </div> <div class="additPenInfo"> <div class="imprintInfo"><span>Imprint area: </span><?php echo $row_Recordset1['imprintArea']; ?></div> <div class="colorInfo"><span>Available in: </span><?php echo $row_Recordset1['penColors']; ?></div> <table border="0" cellspacing="0" cellpadding="0"> <tr> <th>Amount</th> <th>500</th> <th>1,000</th> <th>2,500</th> <th>5,000</th> <th>10,000</th> <th>20,000</th> </tr> <tr> <td>Price <span>(R)</span></td> <td><?php echo $row_Recordset1['price500'];?>¢</td> <td><?php echo $row_Recordset1['price1000'];?>¢</td> <td><?php echo $row_Recordset1['price2500'];?>¢</td> <td><?php echo $row_Recordset1['price5000'];?>¢</td> <td>Please Contact</td> <td>Please Contact</td> </tr> </table> </div> </a> </li> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

    Read the article

  • Explain the Peak and Flag Algorithm

    - by Isaac Levin
    EDIT Just was pointed that the requirements state peaks cannot be ends of Arrays. So I ran across this site http://codility.com/ Which gives you programming problems and gives you certificates if you can solve them in 2 hours. The very first question is one I have seen before, typically called the Peaks and Flags question. If you are not familiar A non-empty zero-indexed array A consisting of N integers is given. A peak is an array element which is larger than its neighbours. More precisely, it is an index P such that 0 < P < N - 1 and A[P - 1] < A[P] A[P + 1] . For example, the following array A: A[0] = 1 A[1] = 5 A[2] = 3 A[3] = 4 A[4] = 3 A[5] = 4 A[6] = 1 A[7] = 2 A[8] = 3 A[9] = 4 A[10] = 6 A[11] = 2 has exactly four peaks: elements 1, 3, 5 and 10. You are going on a trip to a range of mountains whose relative heights are represented by array A. You have to choose how many flags you should take with you. The goal is to set the maximum number of flags on the peaks, according to certain rules. Flags can only be set on peaks. What's more, if you take K flags, then the distance between any two flags should be greater than or equal to K. The distance between indices P and Q is the absolute value |P - Q|. For example, given the mountain range represented by array A, above, with N = 12, if you take: two flags, you can set them on peaks 1 and 5; three flags, you can set them on peaks 1, 5 and 10; four flags, you can set only three flags, on peaks 1, 5 and 10. You can therefore set a maximum of three flags in this case. Write a function that, given a non-empty zero-indexed array A of N integers, returns the maximum number of flags that can be set on the peaks of the array. For example, given the array above the function should return 3, as explained above. Assume that: N is an integer within the range [1..100,000]; each element of array A is an integer within the range [0..1,000,000,000]. Complexity: expected worst-case time complexity is O(N); expected worst-case space complexity is O(N), beyond input storage (not counting the storage required for input arguments). Elements of input arrays can be modified. So this makes sense, but I failed it using this code public int GetFlags(int[] A) { List<int> peakList = new List<int>(); for (int i = 0; i <= A.Length - 1; i++) { if ((A[i] > A[i + 1] && A[i] > A[i - 1])) { peakList.Add(i); } } List<int> flagList = new List<int>(); int distance = peakList.Count; flagList.Add(peakList[0]); for (int i = 1, j = 0, max = peakList.Count; i < max; i++) { if (Math.Abs(Convert.ToDecimal(peakList[j]) - Convert.ToDecimal(peakList[i])) >= distance) { flagList.Add(peakList[i]); j = i; } } return flagList.Count; } EDIT int[] A = new int[] { 7, 10, 4, 5, 7, 4, 6, 1, 4, 3, 3, 7 }; The correct answer is 3, but my application says 2 This I do not get, since there are 4 peaks (indices 1,4,6,8) and from that, you should be able to place a flag at 2 of the peaks (1 and 6) Am I missing something here? Obviously my assumption is that the beginning or end of an Array can be a peak, is this not the case? If this needs to go in Stack Exchange Programmers, I will move it, but thought dialog here would be helpful. EDIT

    Read the article

  • Representing game states in Tic Tac Toe

    - by dacman
    The goal of the assignment that I'm currently working on for my Data Structures class is to create a of Quantum Tic Tac Toe with an AI that plays to win. Currently, I'm having a bit of trouble finding the most efficient way to represent states. Overview of current Structure: AbstractGame Has and manages AbstractPlayers (game.nextPlayer() returns next player by int ID) Has and intializes AbstractBoard at the beginning of the game Has a GameTree (Complete if called in initialization, incomplete otherwise) AbstractBoard Has a State, a Dimension, and a Parent Game Is a mediator between Player and State, (Translates States from collections of rows to a Point representation Is a StateConsumer AbstractPlayer Is a State Producer Has a ConcreteEvaluationStrategy to evaluate the current board StateTransveralPool Precomputes possible transversals of "3-states". Stores them in a HashMap, where the Set contains nextStates for a given "3-state" State Contains 3 Sets -- a Set of X-Moves, O-Moves, and the Board Each Integer in the set is a Row. These Integer values can be used to get the next row-state from the StateTransversalPool SO, the principle is Each row can be represented by the binary numbers 000-111, where 0 implies an open space and 1 implies a closed space. So, for an incomplete TTT board: From the Set<Integer> board perspective: X_X R1 might be: 101 OO_ R2 might be: 110 X_X R3 might be: 101, where 1 is an open space, and 0 is a closed space From the Set<Integer> xMoves perspective: X_X R1 might be: 101 OO_ R2 might be: 000 X_X R3 might be: 101, where 1 is an X and 0 is not From the Set<Integer> oMoves perspective: X_X R1 might be: 000 OO_ R2 might be: 110 X_X R3 might be: 000, where 1 is an O and 0 is not Then we see that x{R1,R2,R3} & o{R1,R2,R3} = board{R1,R2,R3} The problem is quickly generating next states for the GameTree. If I have player Max (x) with board{R1,R2,R3}, then getting the next row-states for R1, R2, and R3 is simple.. Set<Integer> R1nextStates = StateTransversalPool.get(R1); The problem is that I have to combine each one of those states with R1 and R2. Is there a better data structure besides Set that I could use? Is there a more efficient approach in general? I've also found Point<-State mediation cumbersome. Is there another approach that I could try there? Thanks! Here is the code for my ConcretePlayer class. It might help explain how players produce new states via moves, using the StateProducer (which might need to become StateFactory or StateBuilder). public class ConcretePlayerGeneric extends AbstractPlayer { @Override public BinaryState makeMove() { // Given a move and the current state, produce a new state Point playerMove = super.strategy.evaluate(this); BinaryState currentState = super.getInGame().getBoard().getState(); return StateProducer.getState(this, playerMove, currentState); } } EDIT: I'm starting with normal TTT and moving to Quantum TTT. Given the framework, it should be as simple as creating several new Concrete classes and tweaking some things.

    Read the article

  • ie9/CSS: Flyout menu not working in ie9, but looks great in Firefox/Chrome

    - by Brandon
    Please see this flyout menu: http://www.caseen.com/store.html. It looks amazing in both Firefox and Chrome, but not in IE9! Trying to see what is going on =(. It looks like ie9 is completing ignoring the stylesheet, but in error checking and clicking ie9 direct mode, it shows up however VERY ugly with huge nasty white borders around the links! Please see my code: <div class="flyout"> <ul> <!--START: CATEGORIES--> <!--START: CATEGORY_FORMAT--> <li><a href="view_category.asp?cat=CATID">&nbsp;CATEGORY</a> <!--END: CATEGORY_FORMAT--> <ul><!--START: SUB_CATEGORY_FORMAT--> <li><a href="view_category.asp?cat=CATID">&nbsp;CATEGORY</a></li> <!--END: SUB_CATEGORY_FORMAT--></ul> <!--END: CATEGORIES--> </li> </ul> </div> AND CSS .flyout { width: 130px; height: auto; position:relative; margin: -10 0; padding: 0; z-index:10000; } .flyout ul li a { display:block; text-decoration:none; color: #fff; width: 130px; border: solid; border-color: #000; border-width: 0 0 0 5px; text-align:left; font-size:12px; line-height: 25px; } .flyout ul { padding:0px; list-style-type: none; } .flyout ul li { float:left; margin-right:1px; position:relative; } .flyout ul li ul { display: none; } .flyout ul li:hover a { border: solid; border-color: #fff; border-width: 0 2 0 5px; color: #60dfe5; } .flyout ul li:hover ul { display:block; position:absolute; top:0; left:130px; width:10px; } .flyout ul li:hover ul li a.hide { background:#000; color:#fff; } .flyout ul li:hover ul li:hover a.hide {width:180px;} .flyout ul li:hover ul li ul {display: none;} .flyout ul li:hover ul li a { display:block; background:#000; color:#60dfe5; width:200px; } .flyout ul li:hover ul li a:hover { background:#000; color:#fff; } Thanks, Brandon

    Read the article

  • Refactoring a javascript array rotate function

    - by ideotop
    I wrote a rotate function, but I'm not satisfied with it: var pixels=['011','110','000']; var result=new Array(); result=['000','000','000']; for ( y=0; y<(pixels.length); y++ ){ for ( x=0; x<(pixels.length); x++ ){ var newx=0,newy=0; if ( clock ){ if ( x< r.x && y< r.y ) {newx=x+2;newy=y ;}//top left if ( x==r.x && y< r.y ) {newx=x+1;newy=y+1;}//top if ( x> r.x && y< r.y ) {newx=x ;newy=y+2;}//top right if ( x< r.x && y==r.y ) {newx=x+1;newy=y-1;}//left if ( x==r.x && y==r.y ) {newx=x ;newy=y ;}//center if ( x> r.x && y==r.y ) {newx=x-1;newy=y+1;}//right if ( x< r.x && y> r.y ) {newx=x ;newy=y-2;}//bottom left if ( x==r.x && y> r.y ) {newx=x-1;newy=y-1;}//bottom if ( x> r.x && y> r.y ) {newx=x-2;newy=y ;}//bottom right } else { if ( x< r.x && y< r.y ) {newx=x ;newy=y+2;}//top left if ( x==r.x && y< r.y ) {newx=x-1;newy=y+1;}//top if ( x> r.x && y< r.y ) {newx=x-2;newy=y ;}//top right if ( x< r.x && y==r.y ) {newx=x+1;newy=y+1;}//left if ( x==r.x && y==r.y ) {newx=x ;newy=y ;}//center if ( x> r.x && y==r.y ) {newx=x-1;newy=y-1;}//right if ( x< r.x && y> r.y ) {newx=x+2;newy=y ;}//bottom left if ( x==r.x && y> r.y ) {newx=x+1;newy=y-1;}//bottom if ( x> r.x && y> r.y ) {newx=x ;newy=y-2;}//bottom right } //inject(result,newx,newy,pixels[y][x]) } } does someone now how to write a cleaner code for this rotate (clock and counter-clock) function ?

    Read the article

  • How to group and sum values in XSLT

    - by johkar
    For each "agency" node I need to find the "stmt" elements that have the same key1, key2, key3 values and output just one "stmt" node with the "comm" and "prem" values summed together. For any "stmt" elements within that "agency" that don't match any other "stmt" elements based on key1, key2 and key3 I need to output them as is. So after transformation the first "agency" node would only have two "stmt" nodes (one summed) and the second "agency" node would be passed as is because the keys don't match. XSLT 1.0 or 2.0 solutions are ok...though my stylesheet is currently 1.0. Note that the agency nodes could have any number of "stmt" elements that have matching keys which need to be grouped and summed and any number that don't. <statement> <agency> <stmt> <key1>1234</key1> <key2>ABC</key2> <key3>15.000</key3> <comm>75.00</comm> <prem>100.00</prem> </stmt> <stmt> <key1>1234</key1> <key2>ABC</key2> <key3>15.000</key3> <comm>25.00</comm> <prem>200.00</prem> </stmt> <stmt> <key1>1234</key1> <key2>ABC</key2> <key3>17.50</key3> <comm>25.00</comm> <prem>100.00</prem> </stmt> </agency> <agency> <stmt> <key1>5678</key1> <key2>DEF</key2> <key3>15.000</key3> <comm>10.00</comm> <prem>20.00</prem> </stmt> <stmt> <key1>5678</key1> <key2>DEF</key2> <key3>17.000</key3> <comm>15.00</comm> <prem>12.00</prem> </stmt> </agency>

    Read the article

  • Linq To Xml problems using XElement's method Elements(XName)

    - by Dorian McHensie
    Hello everyone. I have a problem using Linq To Xml. A simple code. I have this XML: <?xml version="1.0" encoding="utf-8" ?> <data xmlns="http://www.xxx.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xxx.com/directory file.xsd"> <contact> <name>aaa</name> <email>[email protected]</email> <birthdate>2002-09-22</birthdate> <telephone>000:000000</telephone> <description>Description for this contact</description> </contact> <contact> <name>sss</name> <email>[email protected]</email> <birthdate>2002-09-22</birthdate> <telephone>000:000000</telephone> <description>Description for this contact</description> </contact> <contact> <name>bbb</name> <email>[email protected]</email> <birthdate>2002-09-22</birthdate> <telephone>000:000000</telephone> <description>Description for this contact</description> </contact> <contact> <name>ccc</name> <email>[email protected]</email> <birthdate>2002-09-22</birthdate> <telephone>000:000000</telephone> <description>Description for this contact</description> </contact> I want to get every contact mapping it on an object Contact. To do this I use this fragment of code: XDocument XDoc = XDocument.Load(System.Web.HttpRuntime.AppDomainAppPath + this.filesource); XElement XRoot = XDoc.Root; //XElement XEl = XElement.Load(this.filesource); var results = from e in XRoot.Elements("contact") select new Contact((string)e.Element("name"), (string)e.Element("email"), "1-1-1", null, null); List<Contact> cntcts = new List<Contact>(); foreach (Contact cntct in results) { cntcts.Add(cntct); } Contact[] c = cntcts.ToArray(); // Encapsulating element Elements<Contact> final = new Elements<Contact>(c); Ok just don't mind that all: focus on this: When I get the root node, it is all right, I get it correctly. When I use the select directive I try to get every node saying: from e in XRoot.Elements("contact") OK here's the problem: if I use: from e in XRoot.Elements() I get all contact nodes, but if I use: from e in XRoot.Elements("contact") I GET NOTHING: Empty SET. OK you tell me: Use the other one: OK I DO SO, let's use: from e in XRoot.Elements(), I get all nodes anyway, THAT's RIGHT BUT HERE COMES THE OTHER PROBLEM: When Saying: select new Contact((string)e.Element("name"), (string)e.Element("email"), "1-1-1", null, null); I Try to access <name>, <email>... I HAVE TO USE .Element("name") AND IT DOES NOT WORK TOO!!!!!!!!WHAT THE HELL IS THIS????????????? IT SEEMS THAT I DOES NOT MATCH THE NAME I PASS But how is it possible. I know that Elements() function takes, overloaded, one argument that is an XName which is mapped onto a string. Please consider that the code I wrote come from an example, It should work. Please somebody help me. THANKS IN ADVANCE

    Read the article

  • Rails multiple select box issue for search

    - by Reido
    First off here is my model, controller, view: My model, this is where I have my search code:--------------------------- def self.find_by_lcc(params) where = [] where << "category = 'Land'" unless params[:mls].blank? where << "mls = :mls" end unless params[:county].blank? where << "county = :county" end unless params[:acreage_range].blank? where << "acreage_range = :acreage_range" end unless params[:landtype].blank? where << "landtype = :landtype" end unless params[:price_range].blank? where << "price_range = :price_range" end if where.empty? [] else find(:all, :conditions => [where.join(" AND "), params], :order => "county, price desc") end end My controller:---------------- def land @counties = ['Adams', 'Alcorn', 'Amite', 'Attala'] @title = "Browse" return if params[:commit].nil? @properties = Property.find_by_lcc(params) else 'No properties were found' render :action = 'land_table' end My View: ---------------------- <table width="900"> <tr> <td> <% form_tag({ :action => "land" }, :method => "get") do %> <fieldset> <legend>Search our Land Properties</legend> <div class="form_row"><p>&nbsp;</p></div> <div class="form_row"> <label for="mls">MLS Number:</label>&nbsp; <%= text_field_tag 'mls', params[:mls] %> </div> <div class="form_row"> <label for "county"><font color="#ff0000">*County:</font></label>&nbsp; <%= select_tag "county", options_for_select(@counties), :multiple => true, :size => 6 %> </div> <div class="form_row"> <label for "acreage_range">Acreage:</label>&nbsp; <%= select_tag "acreage_range", options_for_select([['All',''],['1-10','1-10'],['11-25','11-25'],['26-50','26-50'],['51-100','51-100']]) %> </div> <div class="form_row"> <label for "landtype">Type:</label>&nbsp; <%= select_tag "landtype", options_for_select([['All',''],['Waterfront','Waterfront'],['Wooded','Wooded'],['Pasture','Pasture'],['Woods/Pasture','Woods/Pasture'],['Lot','Lot']]) %> </div> <div class="form_row"> <label for="price_range"><font color="#ff0000">*Price:</font></label>&nbsp; <%= select_tag "price_range", options_for_select([['All',''],['0-1,000','0-1,000'],['1,001-10,000','1,001-10,000'],['10,001-50,000','10,001-50,000'],['50,001-100,000','50,001-100,000'],['100,001-150,000']])%> </div> <input type="text" style="display: none;" disabled="disabled" size="1" /> <%= submit_tag "Search", :class => "submit" %> </fieldset> <% end%> </td> </tr> </table> The search works fine until I add ", :multiple = true, :size = 6" to make the county field multiple select. Then I get the error: Processing PublicController#land (for 65.0.81.83 at 2010-04-01 13:11:30) [GET] Parameters: {"acreage_range"=>"", "commit"=>"Search", "county"=>["Adams", "Amite"], "landtype"=>"", "price_range"=>"", "mls"=>""} ActiveRecord::StatementInvalid (Mysql::Error: Operand should contain 1 column(s): SELECT * FROM `properties` WHERE (category = 'Land' AND county = 'Adams','Amite') ORDER BY county, price desc): app/models/property.rb:93:in `find_by_lcc' app/controllers/public_controller.rb:84:in `land' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' fcgi (0.8.7) lib/fcgi.rb:117:in `session' fcgi (0.8.7) lib/fcgi.rb:104:in `each_request' fcgi (0.8.7) lib/fcgi.rb:36:in `each' dispatch.fcgi:24 I've tried to make the county, acreage_range, and price_range fields into multiple select boxes numerous ways, but can not get any method to work correctly. Any help would be greatly appreciated. Thanks,

    Read the article

  • Format numbers with css

    - by Luc M
    Is it possible to format numbers using css ? When I have 7000000.00, I would like it displayed as 7 000 000.00 I know I could write a backend (php, perl...) function or a javascript function that could return the formatted number but... The numbers that I want to format are into a cell. I would like to have something like <td class="myformat">7000000.00</td> or <td><span class="myformat">7000000.00<span></td>

    Read the article

  • How to autoscroll on WPF datagrid

    - by Christian
    Hi, I think I am stupid. I searched now for 15 minutes, and found several different solutions for scrolling on datagrids, but none seems to work for me. I am using WPF with .NET 3.5 and the WPF Toolkit DataGrid. My grid gets updated when my observable collection changes, works perfectly. Now, my DataGrid is located inside a normal Grid and scrollbars appear if the DataGrid gets to big. Also fine... And know, the 1.000.000 $ question: How do I get the datagrid to scroll to the last row. There is: no AutoScroll Property no CurrentRowSelected Index a CurrentCell, but no Collection I could use for CurrentCell = AllCells.Last Any ideas? I feel really stupid, and it seems strange that this question is so hard. What am I missing?

    Read the article

  • web2py or grok (zope) on a big portal,

    - by Robert
    Hi, I am planning to make some big project (1 000 000 users, approximately 500 request pre second - in hot time). For performance I'm going to use no relational dbms (each request could cost lot of instructions in relational dbms like mysql) - so i can't use DAL. My question is: how web2py is working with a big traffic, is it work concurrently? I'm consider to use web2py or Gork - Zope, How is working zodb(Z Object Database) with a lot of data? Is there some comparison with object-relational postgresql? Could you advice me please.

    Read the article

  • Java char literal to C# char literal

    - by Kristoffersen
    Hi. I am maintaining some Java code that I am currently converting to C#. The Java code is doing this: sendString(somedata + '\000'); And in C# I am trying to do the same: sendString(somedata + '\000'); But on the '\000' VS2010 tells me that "Too many characters in character literal". How can I use '\000' in C#? I have tried to find out what the character is, but it seems to be " " or some kind of newline-character. Do you know anything about the issue? Thanks!

    Read the article

  • select only new row in oracle

    - by Hlex
    Hi, I have table with "varchar2" as primary key. Transaction is about 1 000 000 per day. my app wake up every 5 minute to generate text file by query only new record. It will remember last point and do only new record. 1)Do you have idea how query with good performance? I able to add new column if need. 2)what do you think this process should do by? plsql? java?

    Read the article

  • Objective C display money format like Sensible Soccer

    - by worchyld
    I'm wanting to display money like SWOS (or Sensible World of Soccer) used to. IE: Instead of: $10,000,000+ you got $10m, 10.5m, etc. Instead of: $1,000,000 you got $1m Instead of: $1,500,000 you got $1.5m It also worked for both large and smaller figures, say; 1k, 1.25k, 0.75k, 0.25k, etc. I'm wondering, is there a way to display money in a format that is similar to the way SWOS used to do it? Thanks.

    Read the article

  • Formatting datetime values returned in a SELECT..FOR XML statement

    - by TelJanini
    Consider the following table: Orders OrderId Date CustomerId 1000 2012-06-05 20:03:12.000 51 1001 2012-06-16 12:02:31.170 48 1002 2012-06-18 19:45:16.000 33 When I extract the Order data using FOR XML: SELECT OrderId AS 'Order/@Order-Id', Date AS 'Order/ShipDate', CustomerId AS 'Order/Customer' FROM Orders WHERE OrderId = 1000 FOR XML PATH ('') I get the following result: <Order Order-Id="1000"> <ShipDate>2010-02-20T16:03:12</ShipDate> <Customer>51</Customer> </Order> The problem is, the ShipDate value in the XML file needs to be in the format M/DD/YYYY H:mm:ss PM. How can I change the output of the ShipDate in the XML file to the desired format? Any help would be greatly appreciated!

    Read the article

  • MsSQL 2005 query performance

    - by Max
    I have the following query: select ............. from //one table and about 20 left joins// where ( ( this_.driverName like 'blah*' or this_.renterName like 'blah*' ) or exists ( select this0__.id as y0_ from ThirdParty this0__ where this0__.name like 'blah*' and this0__.claim_id=this_.id ) ) order by this_.id asc And I have two environment: One with 175 000 records in table "this_" and second with 25 000 records in table "this_". This query works right on 175k database and it works smth about 2 seconds, but on base with 25k this query freezes. and if drop one the folloing item from where clause: ( this_.driverName like 'blah*' or this_.renterName like 'blah*' ) or exists ( select this0__.id as y0_ from ThirdParty this0__ where this0__.name like 'blah*' and this0__.claim_id=this_.id ) query runs normally. How can I to increase performance of this query?

    Read the article

  • Java add leading zeros to a number....

    - by user69514
    I need to return a string in the form xxx-xxxx where xxx is a number and xxxx is another number, however when i have leading zeros they disappear. I'm trying number formatter, but it's not working. public String toString(){ NumberFormat nf3 = new DecimalFormat("#000"); NumberFormat nf4 = new DecimalFormat("#0000"); if( areaCode != 0) return nf3.format(areaCode) + "-" + nf3.format(exchangeCode) + "-" + nf4.format(number); else return exchangeCode + "-" + number; } } I figured it out: public String toString(){ NumberFormat nf3 = new DecimalFormat("000"); NumberFormat nf4 = new DecimalFormat("0000"); if( areaCode != 0) //myFormat.format(new Integer(someValue)); return nf3.format(new Integer(areaCode)) + "-" + nf3.format(new Integer(exchangeCode)) + "-" + nf4.format(new Integer(number)); else return nf3.format(new Integer(exchangeCode)) + "-" + nf4.format(new Integer(number)); }

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >