Search Results

Search found 2264 results on 91 pages for 'odd rationale'.

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

  • LINQ and the use of Repeat and Range operator

    - by vik20000in
    LINQ is also very useful when it comes to generation of range or repetition of data.  We can generate a range of data with the help of the range method.     var numbers =         from n in Enumerable.Range(100, 50)         select new {Number = n, OddEven = n % 2 == 1 ? "odd" : "even"}; The above query will generate 50 records where the record will start from 100 till 149. The query also determines if the number is odd or even. But if we want to generate the same number for multiple times then we can use the Repeat method.     var numbers = Enumerable.Repeat(7, 10); The above query will produce a list with 10 items having the value 7. Vikram

    Read the article

  • Desktop top is lower than it should be

    - by Idan Arye
    I have a very odd problem with Ubuntu 11.10. Here is a picture of it: The window in the picture is maximized, but for some odd reason it does not cover the entire desktop area. That area of the desktop the window does not cover is a dead area - I also can't drag desktop items to there, though I can drag not-maximized windows to that area. Rebooting doesn't help. The problem started after I configured some windows partitions to automount on startup(though I don't see how that could cause the problem...) Does anyone know a way to fix this?

    Read the article

  • Book: Dependency Injection in .NET

    - by CoffeeAddict
    Does anyone find this odd that this is a book from mid 2010 on a pretty popular topic and there is no "see inside" but even worse no reviews!?!?! I want to buy it but this extremely odd that for such a popular topic there isn't at least 2 or more reviews. I'd expect a ton of reviews on a book on a subject such as this. Dependency Injection in .NET (Manning) Anyone have this book that can tell me if it's worth my money? the date incorrectly states 2001 on Amazon and I've notified the author on that.

    Read the article

  • Google I/O 2012 - Dart - A Modern Web Language

    Google I/O 2012 - Dart - A Modern Web Language Lars Bak, Kasper Lund The two creators of Dart will discuss the rationale behind Dart's design and its impact on web scalability and performance. They'll also present how Dart helps developers innovate by increasing their productivity without breaking backwards compatibility. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 2066 36 ratings Time: 01:03:40 More in Science & Technology

    Read the article

  • Google I/O 2010 - A JIT Compiler for Android's Dalvik VM

    Google I/O 2010 - A JIT Compiler for Android's Dalvik VM Google I/O 2010 - A JIT Compiler for Android's Dalvik VM Android 301 Ben Cheng, Bill Buzbee In this session we will outline the design of a JIT Compiler suitable for embedded Android devices. Topics will include an architectural overview, the rationale for design decisions and the special support for JIT verification, testing and tuning. For all I/O 2010 sessions, please go to code.google.com From: GoogleDevelopers Views: 3 0 ratings Time: 01:00:14 More in Science & Technology

    Read the article

  • Conecting bash script with a txt file

    - by cathy
    I have a txt file with 100+ lines called page1.txt; odd lines are urls and even lines are url names. I have a bash file already created that checks urls for completion. Except right now, the process is really manual because I have to modify the bash every time I need to check a url. So I need to connect the bash to the txt using the variable url. $url should get all the odd lines from page1.txt and check if the link is complete or not. Also, how would I write a variable called name that derives from the url the 7 digits? bash file manually: url=http://www.-------------/-/8200233/1/ name=8200233 lynx -dump $url > $name.txt I would prefer if the bash file could add "Complete/In-Complete " at the beginning of every even line in the page1.txt file but a new text file could be also created to keep track of the Completes/In-completes.

    Read the article

  • Rendering output to arbitary quadrilateral

    - by Trainee4Life
    I want to render output on a device to an arbitary quadirlateral, i.e. project texture on to a quad. What are the possible ways I could implement it? Till now, I have investigated: Drawing textured quadrilateral - Quads look odd as they are composed of triangles, and the distortion looks odd. The issue I'm facing has been discussed here and here as well. Setting transformation on device - Need help in getting this implemented. Pixel shaders - Not able to implement the desired effect. Any help would be much appreciated.

    Read the article

  • Include latest searches in search engines index

    - by drcelus
    My websites generally include a page with the (user input) latest searches. I know it's not a good security practice to allow this since you can find undesired content. On the other hand it boosts the number of pages indexed since every new search can provide a link on google and people can find you with related keywords that you are not using on your web page. What is the rationale behinf including or excludingthis results in search engines index ?

    Read the article

  • How to solve this problem without the use of if-else statements?

    - by kira
    I have just started my C++ lecture class. And the teacher has given us the following assignment. Write a program that determines whether a number is even or odd. The logic I would use for the program is. Get input a. Store a % 2 as b. If b is 0, then b is even, else b is odd. The catch though, is that we have to write the program without the use of a if-else statement. I have been thinking on how to approach the problem for the past few hours, but I have no clue what to do. Any hints or suggestions?

    Read the article

  • Not able to access Silverlight.net and ONLY Silverlight.net - All other domains work!

    - by Sootah
    Alrighty folks, I have an extremely odd problem. I am able to surf the web fine with one odd (and really annoying at the moment) exception: Microsoft's Silverlight.net. Every other site that I go to works just fine. This is quite frustrating because I'm in the middle of programming a web app in Silverlight 4.0, and whenever I do a search for any code examples, tutorials, or whatnot at least 50% of the results are hosted in the silverlight.net forums. The error message that I get is: Oops! Google Chrome could not find www.silverlight.net It doesn't work in my other browsers either (both IE and FireFox). What's odd, is that while the error message would lead me to assume it's a DNS error, I can ping the URL just fine. C:\Users\The Doot>ping silverlight.net Reply from 206.72.125.201: bytes=32 time=106ms TTL=106 Reply from 206.72.125.201: bytes=32 time=106ms TTL=106 Reply from 206.72.125.201: bytes=32 time=106ms TTL=106 Reply from 206.72.125.201: bytes=32 time=106ms TTL=106 Ping statistics for 206.72.125.201: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 103ms, Maximum = 110ms, Average = 106ms I've checked my HOSTS file, and there's nothing that refers to ANY Microsoft URL in there. What could be causing this!?? More importantly, how do I fix it? Just for kicks, I've even included the results of a traceroute here for your enjoyment. OS: Windows 7 Ultimate Thanks in advance! -Sootah

    Read the article

  • USB Drive that simultaneously connects to more than one computer

    - by user2499
    Background: I have a portable USB drive that I use to make sure I have access to common files whenever at home, work, travel etc for cases when I may not have Internet/Network access of any kind. There are some cases when I have to work simultaneously on a laptop and a desktop computer, and for those cases I usually have to unplug this USB hard drive and move it between the two. Question: dual-computer USB drive? Is there a USB-based solution that would enable me to use this portable drive between two computers simultaneously? If there is not a USB-based solution, does anyone have alternative suggestions, consistent with the underlying rationale? Rationale: Sometimes I have to work on a desktop computer with locked-down networking capabilities (such as at the local photocopy shop) and it can be difficult to get a network configuration that allows dual-computer access without breaking things, or accidentally making my USB drive visible to the entire network. Basically what I need is a very simply LAN that is guaranteed to work regardless of the rules or constraints set by the network administrator for wherever I happen to be at the time. See also: http://superuser.com/questions/99274/how-to-connect-two-computers-with-usb

    Read the article

  • Making Latex typeset given text on two facing pages

    - by Charles Stewart
    How do I encourage/make Latex typeset some portion of text so that it will all appear on a consecutive even-page, odd-page pair of pages? With trial and error, \nopagebreak can be coaxed into doing this, but is there a strategy that Just Works? Something like a samepage environment would be ideal, but one that: Will force a pagebreak on odd pages if that is needed to get all the text on facing pages; Allows up to one page break anywhere in the environment body, and fails noisily if that can't be ensured.

    Read the article

  • Where to find free-to-use, complex test databases?

    - by Jay
    I need a database for testing a data masking solution. Any database would do (Oracle/MSSQL flavor). I just need the schema / db definition. I have tools to generate data records. The magnitude of database I am looking should have 30 odd tables with 30 odd columns in each table - a HUGE database. Do freely available complex database /schema definitions exist on the internet? If yes, where do I find them?

    Read the article

  • Calling a function within a class

    - by JM4
    I am having trouble calling a specific function within a class. The call is made: case "Mod10": if (!validateCreditCard($fields[$field_name])) $errors[] = $error_message; break; and the class code is: class CreditCardValidationSolution { var $CCVSNumber = ''; var $CCVSNumberLeft = ''; var $CCVSNumberRight = ''; var $CCVSType = ''; var $CCVSError = ''; function validateCreditCard($Number) { $this->CCVSNumber = ''; $this->CCVSNumberLeft = ''; $this->CCVSNumberRight = ''; $this->CCVSType = ''; $this->CCVSError = ''; // Catch malformed input. if (empty($Number) || !is_string($Number)) { $this->CCVSError = $CCVSErrNumberString; return FALSE; } // Ensure number doesn't overrun. $Number = substr($Number, 0, 20); // Remove non-numeric characters. $this->CCVSNumber = preg_replace('/[^0-9]/', '', $Number); // Set up variables. $this->CCVSNumberLeft = substr($this->CCVSNumber, 0, 4); $this->CCVSNumberRight = substr($this->CCVSNumber, -4); $NumberLength = strlen($this->CCVSNumber); $DoChecksum = 'Y'; // Mod10 checksum process... if ($DoChecksum == 'Y') { $Checksum = 0; // Add even digits in even length strings or odd digits in odd length strings. for ($Location = 1 - ($NumberLength % 2); $Location < $NumberLength; $Location += 2) { $Checksum += substr($this->CCVSNumber, $Location, 1); } // Analyze odd digits in even length strings or even digits in odd length strings. for ($Location = ($NumberLength % 2); $Location < $NumberLength; $Location += 2) { $Digit = substr($this->CCVSNumber, $Location, 1) * 2; if ($Digit < 10) { $Checksum += $Digit; } else { $Checksum += $Digit - 9; } } // Checksums not divisible by 10 are bad. if ($Checksum % 10 != 0) { $this->CCVSError = $CCVSErrChecksum; return FALSE; } } return TRUE; } } When I run the application - I get the following message: Fatal error: Call to undefined function validateCreditCard() in C:\xampp\htdocs\validation.php on line 339 any ideas?

    Read the article

  • How to get LSB bit in MIPS?

    - by israkir
    Is there a short way to check/get for least significant bit in a 32-bit integer, in MIPS? It is obviously set for the odd numbers and an algorithm which checks for the whole number is odd or even can decide for this. But I just wonder is there a better way to do this...

    Read the article

  • how to pass a variable value from one class to another

    - by Arunabha
    I have two packages one is com.firstBooks.series.db.parser which have a java file XMLParser.java, I have another package com.firstBooks.series79 which have a class called AppMain.NW I want to send the value of a variable called _xmlFileName frm AppMain class to the xmlFile variable in XMLParser class, I am posting the code for both the class, kindly help me. package com.firstBooks.series.db.parser; import java.io.IOException; import java.io.InputStream; import java.util.Vector; import net.rim.device.api.xml.parsers.DocumentBuilder; import net.rim.device.api.xml.parsers.DocumentBuilderFactory; import net.rim.device.api.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import com.firstBooks.series.db.Question; public class XMLParser { private Document document; public static Vector questionList; public static String xmlFile; public XMLParser() { questionList = new Vector(); } public void parseXMl() throws SAXException, IOException, ParserConfigurationException { // Build a document based on the XML file. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); InputStream inputStream = getClass().getResourceAsStream(xmlFile); document = builder.parse(inputStream); } public void parseDocument() { Element element = document.getDocumentElement(); NodeList nl = element.getElementsByTagName("question"); if (nl != null && nl.getLength() > 0) { for (int i = 0; i < nl.getLength(); i++) { Element ele = (Element) nl.item(i); Question question = getQuestions(ele); questionList.addElement(question); } } } private Question getQuestions(Element element) { String title = getTextValue(element, "title"); String choice1 = getTextValue(element, "choice1"); String choice2 = getTextValue(element, "choice2"); String choice3 = getTextValue(element, "choice3"); String choice4 = getTextValue(element, "choice4"); String answer = getTextValue(element, "answer"); String rationale = getTextValue(element, "rationale"); Question Questions = new Question(title, choice1, choice2, choice3, choice4, answer, rationale); return Questions; } private String getTextValue(Element ele, String tagName) { String textVal = null; NodeList nl = ele.getElementsByTagName(tagName); if (nl != null && nl.getLength() > 0) { Element el = (Element) nl.item(0); textVal = el.getFirstChild().getNodeValue(); } return textVal; } } Nw the code for AppMain class //#preprocess package com.firstBooks.series79; import net.rim.device.api.ui.UiApplication; import com.firstBooks.series.ui.screens.HomeScreen; public class AppMain extends UiApplication { public static String _xmlFileName; public static boolean _Lite; public static int _totalNumofQuestions; public static void initialize(){ //#ifndef FULL /* //#endif _xmlFileName = "/res/Series79_FULL.xml"; _totalNumofQuestions = 50; _Lite = false; //#ifndef FULL */ //#endif //#ifndef LITE /* //#endif _xmlFileName = "/res/Series79_LITE.xml"; _totalNumofQuestions = 10; _Lite = true; //#ifndef LITE */ //#endif } private AppMain() { initialize(); pushScreen(new HomeScreen()); } public static void main(String args[]) { new AppMain().enterEventDispatcher(); } }

    Read the article

  • how to pass one variable value frm one class to the oder

    - by Arunabha
    i hav two packages one is com.firstBooks.series.db.parser which hav a java file XMLParser.java,i hav another package com.firstBooks.series79 which hav a class called AppMain.NW i want to send the value of a variable called _xmlFileName frm AppMain class to the xmlFile variable in XMLParser class,i am posting the codes for both the class,kindly help me. package com.firstBooks.series.db.parser; import java.io.IOException; import java.io.InputStream; import java.util.Vector; import net.rim.device.api.xml.parsers.DocumentBuilder; import net.rim.device.api.xml.parsers.DocumentBuilderFactory; import net.rim.device.api.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import com.firstBooks.series.db.Question; public class XMLParser { private Document document; public static Vector questionList; public static String xmlFile; public XMLParser() { questionList = new Vector(); } public void parseXMl() throws SAXException, IOException, ParserConfigurationException { // Build a document based on the XML file. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); InputStream inputStream = getClass().getResourceAsStream(xmlFile); document = builder.parse(inputStream); } public void parseDocument() { Element element = document.getDocumentElement(); NodeList nl = element.getElementsByTagName("question"); if (nl != null && nl.getLength() > 0) { for (int i = 0; i < nl.getLength(); i++) { Element ele = (Element) nl.item(i); Question question = getQuestions(ele); questionList.addElement(question); } } } private Question getQuestions(Element element) { String title = getTextValue(element, "title"); String choice1 = getTextValue(element, "choice1"); String choice2 = getTextValue(element, "choice2"); String choice3 = getTextValue(element, "choice3"); String choice4 = getTextValue(element, "choice4"); String answer = getTextValue(element, "answer"); String rationale = getTextValue(element, "rationale"); Question Questions = new Question(title, choice1, choice2, choice3, choice4, answer, rationale); return Questions; } private String getTextValue(Element ele, String tagName) { String textVal = null; NodeList nl = ele.getElementsByTagName(tagName); if (nl != null && nl.getLength() > 0) { Element el = (Element) nl.item(0); textVal = el.getFirstChild().getNodeValue(); } return textVal; } } Nw the code for AppMain class //#preprocess package com.firstBooks.series79; import net.rim.device.api.ui.UiApplication; import com.firstBooks.series.ui.screens.HomeScreen; public class AppMain extends UiApplication { public static String _xmlFileName; public static boolean _Lite; public static int _totalNumofQuestions; public static void initialize(){ //#ifndef FULL /* //#endif _xmlFileName = "/res/Series79_FULL.xml"; _totalNumofQuestions = 50; _Lite = false; //#ifndef FULL */ //#endif //#ifndef LITE /* //#endif _xmlFileName = "/res/Series79_LITE.xml"; _totalNumofQuestions = 10; _Lite = true; //#ifndef LITE */ //#endif } private AppMain() { initialize(); pushScreen(new HomeScreen()); } public static void main(String args[]) { new AppMain().enterEventDispatcher(); } }

    Read the article

  • Implicit conversion : const reference vs non-const reference vs non-reference

    - by Nawaz
    Consider this code, struct A {}; struct B { B(const A&) {} }; void f(B) { cout << "f()"<<endl; } void g(A &a) { cout << "g()" <<endl; f(a); //a is implicitly converted into B. } int main() { A a; g(a); } This compiles fine, runs fine. But if I change f(B) to f(B&), it doesn't compile. If I write f(const B&), it again compiles fine, runs fine. Why is the reason and rationale? Summary: void f(B); //okay void f(B&); //error void f(const B&); //okay I would like to hear reasons, rationale and reference(s) from the language specification, for each of these cases. Of course, the function signatures themselves are not incorrect. Rather A implicitly converts into B and const B&, but not into B&, and that causes the compilation error.

    Read the article

  • java recursion on array

    - by user69514
    I have to create a program that finds all the possible ways of filling a board of size 3xN You place a domino which takes up 2 spaces to completely fill the board. So far, this is my thought process on how it should be done based on what the teacher has said as well as my own thoughts. Get input and check if its even or odd If it's odd, the board can't be filled all the way and the program ends If it's even, place a domino horizontally in the top right corner of the board Test if you can place a domino vertically in that spot. Repeat those two steps as many times as possible. The problem is I don't know how to code it to the point where you can remember the placements of each domino. I can get it to where it fills the board completely once and maybe twice, but nothing past that. I also know that I'm supposed to use recursion to figure this out fwiw. Here is the code I started on so far. There is also a main method and I have the initial even/odd check working fine. This is the part I have no idea on. public void recurDomino(int row, int column) { if (Board[2][x - 1] != false) { } else if(Board[1][x-1]!=false) { } else { for (int n=0; n < x - 1; n++) { Board[row][column] = true; Board[row][column+1] = true; column++; counter++; } recurDomino(1, 0); recurDomino(2, 0); } } Thank you for any help you guys can give me.

    Read the article

  • jqGrid zebra striping problem

    - by ShiVik
    Hello all I have just started with jQuery. I am trying to implement zebra striping in my jqGrid class. I am having the problem when user clicks on sort column, all rows get rearranged and the zebra striping is blown away. Zebra Striping code $("#item_table tbody tr:odd").addClass("alt"); $("#item_table tbody tr").mouseover(function() { $(this).addClass("over"); }); $("#item_table tbody tr").mouseout(function() { $(this).removeClass("over"); }); jqGrid code jQuery.extend(jQuery.jgrid.defaults, { autowidth: true, hidegrid: false, colModel:[ { name: 'icon', index: 'icon', width: 0, resizable: false }, { name: 'name', index: 'name', width: 0, resizable: false }, { name: 'price', index: 'price', width: 0, sorttype: "int", resizable: false } ], onSortCol: function(index, iCol, sortorder) { // This doesn't work - IT SHOULDN'T EITHER, since event is called // just after clicking to sort but before actual sorting jQuery("#item_table tbody tr:odd").addClass("odd"); }, caption: "Item Table" }); I also tried loadComplete, gridComplete events, but to no avail. How should I proceed with this? Have I even started this right? Regards Vikram

    Read the article

  • CSS: "float:left" doesn't work as expected

    - by Patrick
    hi, I want to display 2 columns of images using "float:left", and I dunno why the 3rd image is on the right. See screenshot:http://dl.dropbox.com/u/72686/imagesFloat.png See HTML: <div class="field-item odd"> <img alt="" class="filefield-imagecache-galleryImage" src="http://localhost/bernardi/sites/default/files/Picture%202.png" title=""><br> <span>description1</span> </div> <div class="field-item even"> <img alt="" class="filefield-imagecache-galleryImage" src="http://localhost/bernardi/sites/default/files/Picture%203.png" title=""><br> <span>description2</span> </div> <div class="field-item odd"> <img alt="" class="filefield-imagecache-galleryImage" src="http://localhost/bernardi/sites/default/files/Picture%204.png" title=""><br> <span>description3</span> </div> <div class="field-item even"> <img alt="" class="filefield-imagecache-galleryImage" src="http://localhost/bernardi/sites/default/files/Picture%205.png" title=""><br> <span></span> </div> see CSS: .field-field-image .odd { padding-right:20px; } .field-field-image .even { padding-left:20px; } .field-field-image .field-item { float:left; } thanks

    Read the article

  • Lazy Sequences that "Look Ahead" for Project Euler Problem 14

    - by ivar
    I'm trying to solve Project Euler Problem 14 in a lazy way. Unfortunately, I may be trying to do the impossible: create a lazy sequence that is both lazy, yet also somehow 'looks ahead' for values it hasn't computed yet. The non-lazy version I wrote to test correctness was: (defn chain-length [num] (loop [len 1 n num] (cond (= n 1) len (odd? n) (recur (inc len) (+ 1 (* 3 n))) true (recur (inc len) (/ n 2))))) Which works, but is really slow. Of course I could memoize that: (def memoized-chain (memoize (fn [n] (cond (= n 1) 1 (odd? n) (+ 1 (memoized-chain (+ 1 (* 3 n)))) true (+ 1 (memoized-chain (/ n 2))))))) However, what I really wanted to do was scratch my itch for understanding the limits of lazy sequences, and write a function like this: (def lazy-chain (letfn [(chain [n] (lazy-seq (cons (if (odd? n) (+ 1 (nth lazy-chain (dec (+ 1 (* 3 n))))) (+ 1 (nth lazy-chain (dec (/ n 2))))) (chain (+ n 1)))))] (chain 1))) Pulling elements from this will cause a stack overflow for n2, which is understandable if you think about why it needs to look 'into the future' at n=3 to know the value of the tenth element in the lazy list because (+ 1 (* 3 n)) = 10. Since lazy lists have much less overhead than memoization, I would like to know if this kind of thing is possible somehow via even more delayed evaluation or queuing?

    Read the article

  • jQuery class selectors with nested div's

    - by mboles57
    This is part of some HTML from which I need to retrieve a piece of data. The HTML is assigned to a variable called fullDescription. <p>testing</p> <div class="field field-type-text field-field-video-short-desc"> <div class="field-label">Short Description:&nbsp;</div> <div class="field-items"> <div class="field-item odd"> Demonstrates the basics of using the Content section of App Cloud Studio </div> </div> </div> <div class="field field-type-text field-field-video-id"> <div class="field-label">Video ID:&nbsp;</div> <div class="field-items"> <div class="field-item odd"> 1251462871001 </div> </div> </div> I wish to retrieve the video ID number (1251462871001). I was thinking something like this: var videoID = $(fullDescription).find(".field.field-type-text.field-field-video-id").find(".field-item.odd").html(); Although it does not generate any syntax errors, it does not retrieve the number. Thanks for helping out a jQuery noob! -Matt

    Read the article

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