Search Results

Search found 1525 results on 61 pages for 'pair'.

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

  • Which languages are more conducive to telecommuting, and also less concerned with pairing?

    - by Dirk
    I don't know that it may even make a difference, and I reckon if it did the differences would be cultural rather than technical, but if one were going to set out today (2011) to learn a language, and specifically wanted to telecommute (so they could live in two different places during the year), are there any languages whose culture looks more favorably upon telecommuting than other languages / cultures? For example, I get the impression (and I am probably completely wrong) that in the Ruby community, you are more likely to be expected to be on-site and doing pair programming (though I suppose you can do pairing remotely too). As a corollary question, are there languages / communities where pair programming is less important, for people who wanted to program in part because they aren't social butterflies?

    Read the article

  • ps3 controller failed to pair

    - by Michael Ropy
    I'm trying to pair my ps3 controller with trusty. I've tried this so far: $ sudo sixpair Current Bluetooth master: xx:xx:xx:xx:xx:xx Setting master bd_addr to xx:xx:xx:xx:xx:xx And then I unplug my controller and run this command: $ sixad --start D-Bus setup failed: Name already in use sixad-bin[4843]: started sixad-bin[4843]: sixad started, press the PS button now But when I press the PS button, nothing happens! I've searched a lot in Google and this process works everywhere, but I don't know it doesn't work here...thanks for your help...

    Read the article

  • Workflow Adapter/Connector Pair

    The Workflow Adapter/Connector pair are custom WF Activities for a Business-To-Business Logical Connectivity based on the Interface Contract. The connectivity handles the invoking and consuming of Workflows, Remoting objects, WCF Services in the transparent manner based on the configuration.

    Read the article

  • Highlighting duplicate column-pair and counting the rows Excel

    - by pleasehelpme
    Given the data below, the column-pair with the same values for at least 4 consecutive rows should be highlighted. image here for better visualization: http://i49.tinypic.com/2jeshtt.jpg 2 2 3 4 3 4 3 4 3 4 2 3 1 2 2 2 3 3 3 3 3 3 3 3 2 3 2 3 2 3 2 3 2 2 3 4 3 4 3 4 3 4 3 4 The output should be something like this, where the column-pair values that are the same for at least 4 consecutive rows are highlighted. image here for better visualization: http://i48.tinypic.com/i2lzc8.jpg 2 2 3 4 3 4 3 4 3 4 2 3 1 2 2 2 3 3 3 3 3 3 3 3 2 3 2 3 2 3 2 3 2 2 3 4 3 4 3 4 3 4 3 4 Then, I need to know the number of instances of the N-consecutive equal column-pair. Considering the data above, N=4 should be 3 and N=5 should be 1, where N is the number of rows that the column-pair is consecutively equal.

    Read the article

  • Ubuntu 14.04 Bluetooth Magic Mouse doesn't pair (No agent available)

    - by Rafael Xavier
    Mouse gets discovered. Although, it doesn't pair. /var/log/syslog: Apr 23 10:05:15 xavier bluetoothd[9873]: No agent available for request type 0 Apr 23 10:05:15 xavier bluetoothd[9873]: btd_event_request_pin: Operation not permitted Apr 23 10:05:15 xavier bluetoothd[9873]: Connection refused (111) It's worth saying that: Keyboard has paired and it's working just fine though; Mouse used to work just fine in Ubuntu 12.04, and 13, and it works when I reboot on Mac; This is the hci device. $ hcitool dev Devices: hci0 E0:F8:47:3A:3F:47 How to get it working?

    Read the article

  • How to read pair in freemarker

    - by Lukasz Rys
    Ok i'm having little trouble with reading pair. So I'm creating my pair private Pair<Integer, Integer> count(somethink) { int c1 = 2; int c2 = 4; return new Pair<Integer, Integer>(c1, c2); } And 'sending' it to ftl via java mv.addObject("counted", count(somethink)); I won't write everythink how it sends because I dont think it really matters with my issue. So i'm recieving it in "ftl". Then i was trying to 'read' it <#list counted?keys as key> <a href="#offerOrderTab"><@spring.message "someMsg"/>(${key}/${counted[key]})</a> </#list> After then i'm getting error Expecting a string, date or number here, Expression x is instead a freemarker.ext.beans.SimpleMethodModel As i suppose you dont iterate pairs (or I'm wrong?) i know its pair that contains only one key and one value but still i have to do send it that way and I thought its goin be to similar to iterating through map, in java i would use pair.first() and pair.second() but it doesn't work in ftl (ye i know it shouldnt work). I also tried to cast it to String by using ?string but it didnt work too

    Read the article

  • How do you find local fellow programmers?

    - by Pepijn
    I'm a self-tought programmer living in a small town. Except for the occasional meetups at the other end of the country, I rarely talk face-to-face with other programmers. I'm well aware of the merits of pair programming, feedback, discussion with other programmers and all... What do you do to get in contact with other local programmers? p.s. If you live near Loenen (gld), Netherlands, I'd like to have contact ;)

    Read the article

  • How do you demonstrate performance in paired-programming environments?

    - by NT3RP
    Performance reviews have come up recently at my work, and I was put in an interesting position. Our team does a lot of pair programming, which has a tendency of averaging out the skill differences between team members (especially considering we rotate pairs). Generally, when doing performance reviews, you look back at the work you've done, and demonstrate what you've accomplished, and how you've exceeded expectations to try to negotiate a raise or other benefits. How do you demonstrate (or even measure) individual performance in an environment like this?

    Read the article

  • How to increase the bus factor and specialize at the same time?

    - by bizso09
    In agile pair programming it is recommended to switch pairs every now and then so as to increase the bus factor of the team. That means, most people in the team should work on different parts of the system at different times so that everyone has an understanding of it. Now it is impssible that everyone has an expert level of understanding of each part of the system. That's because people are urged to specialize in one area of expertise. If you are an expert database admin, what's the point of working on the user interface of the system when you switch pairs? You will not be able to do such a high quality job as someone who has extensive experience in UI design. How can you increase the bus factor and make sure that you have specialization in your team?

    Read the article

  • Pair-wise iteration in C# or sliding window enumerator

    - by f3lix
    If I have an IEnumerable like: string[] items = new string[] { "a", "b", "c", "d" }; I would like to loop thru all the pairs of consecutive items (sliding window of size 2). Which would be ("a","b"), ("b", "c"), ("c", "d") My solution was is this public static IEnumerable<Pair<T, T>> Pairs(IEnumerable<T> enumerable) { IEnumerator<T> e = enumerable.GetEnumerator(); e.MoveNext(); T current = e.Current; while ( e.MoveNext() ) { T next = e.Current; yield return new Pair<T, T>(current, next); current = next; } } // used like this : foreach (Pair<String,String> pair in IterTools<String>.Pairs(items)) { System.Out.PrintLine("{0}, {1}", pair.First, pair.Second) } When I wrote this code, I wondered if there are already functions in the .NET framework that do the same thing and do it not just for pairs but for any size tuples. IMHO there should be a nice way to do this kind of sliding window operations. I use C# 2.0 and I can imagine that with C# 3.0 (w/ LINQ) there are more (and nicer) ways to do this, but I'm primarily interested in C# 2.0 solutions. Though, I will also appreciate C# 3.0 solutions.

    Read the article

  • What is a great tool for remote pair development?

    - by Haim Bender
    I'm looking for something like VNC, but with some extra features: The server should send only the part of the screen the client is looking at. It would be great if we could have 2 mice on the client's desktop. Or at least if the client could point to somthing without interrupting the server's mouse. A shared whiteboard would be great. Some extra notes: My friend lives far away, and we are using WinXP.

    Read the article

  • I have a KVP Key value pair Table, Need sql to make it relational structure...!

    - by Muthuveerappan
    I have a KVP Table and the structure is ID, Key, Value and below are the sample values.... Table with values ID , Key, Value 1 , STATUS, TRUE 1, AGE GROUP, 10 1, TRAVEL, Y 2 , STATUS, FALSE 2, AGE GROUP, 20 2, TRAVEL, N I want these date to transform as below (Output) ID , STATUS, AGE GROUP, TRAVEL 1, TRUE , 10, Y 2, FALSE, 20, N I have read about crosstab/pivot - but not able to make a query which can give me the above output. The table structure cant be changed...! My bad. Is there any way in sql, to make my output look like above ?

    Read the article

  • Somewhere to get inspiration - Pair up the creative with the tech

    - by Morten Bergfall
    I am a somewhat green developer; some work experience, last year of school. As most of you, I am constantly working on an assortment of personal projects. Since my mind often has a somewhat drifting characteristic; I am not always able to keep the projects in check. After some time they all exhibit the moral fiber of Vikings, harlots and chain-letter-knitters. This includes constant forking, round-abouting, eating of school assignments of rather mundane, and hence pretty yawn-inducing, specifications, and of course quite a bit of gathering of folder dust. Well, on to my question....is there a place, forum... or something with the purpose of linking people with ideas to the people actually being able to bring said ideas to life? Of course, I know of the professional ones, like rent-a-coder and such. And there seem to be a lot of open source projects available for participation. What I'm looking for doesn't really fit into any of those categories....the form would be somewhat like rent-a-coder, but this is ideas&inspiration, not bubble-sort-my-quarterly-for-a-buck. The possibilities for developing bonds, spicy code, and plain old fun seem quite possible.As I see it, the main benefit would be that we (that is the tech-flipside of the proverbial eCoin) get something worthwhile to do, rather than squeeze the last creative grain out of our code-heavy brains.To give it some perspective...: My last project consists of an absurd jQuery-plugin that includes animated png-robots migrating from Google Earth to drag a html-element of your choosing onto the map, where it gets color, for so to be dragged back by this poorly animated robot.... Often, the line between the creative and the tech is blurred, to say the least. I wouldn't think that would be a problem. Think someone who has developed a nifty little windows application, then sees possibility for a broader use, perhaps some sort of networking functionality. This fellow sadly lacks the skill to implememet this. So he, she or it would then seek a developer with the know-how and they could complete this project together. So, do any of you know of such a place, or can nudge in the right direction? And yes, I understand completely that I should be dedicating myself to doing school work, or applying for mundane developer positions, so please.... :-) UPDATE Sadly, I'm situated in Oslo, Norway, and the number of developers are somewhat limited...and I have had quite some ahem personality issues with the ones who are available ;-) So I feel I must go deeper; search the multitude of the web...

    Read the article

  • CakePHP pair programming practise

    - by The-Di-Lab
    We are on the stage of planning a CakePHP project. It is a relatively a big project for us, as a developer+project manager, I want to hire someone to work with me. But what I really want is to spend less time on actual coding, without losing control of the code quality. What I want to do is that I will design all the functions of the project in CakePHP, at least all the model's functions, and leave the implementation part to the coder who I am going to hire. But my worry is still if I am going to lose control of the code quality using this approach? is it feasible to do so or it is going to turn this project to a chaos. Thank you all in advanced for reading my question and give me answers.

    Read the article

  • How Can I Improve This Algorithm (LCS)

    - by superguay
    (define (lcs lst1 lst2) (define (except-last-pair list) (if (pair? (cdr list)) (cons (car list) (except-last-pair (cdr list))) '())) (define (car-last-pair list) (if (pair? (cdr list)) (car-last-pair (cdr list)) (car list))) (if (or (null? lst1) (null? lst2)) null (if (= (car-last-pair lst1) (car-last-pair lst2)) (append (lcs (except-last-pair lst1) (except-last-pair lst2)) (cons (car-last-pair lst1) '())) **(if (> (length (lcs lst1 (except-last-pair lst2))) (length (lcs lst2 (except-last-pair lst1)))) (lcs lst1 (except-last-pair lst2)) (lcs lst2 (except-last-pair lst1)))))) I dont want it to run over and over.. Regards, Superguay

    Read the article

  • Access Violation in std::pair

    - by sameer karjatkar
    I have an application which is trying to populate a pair. Out of nowhere the application crashes. The Windbg analysis on the crash dump suggests: PRIMARY_PROBLEM_CLASS: INVALID_POINTER_READ DEFAULT_BUCKET_ID: INVALID_POINTER_READ STACK_TEXT: 0389f1dc EPFilter32!std::vector<std::pair<unsigned int,unsigned int>,std::allocator<std::pair<unsigned int,unsigned int> > >::size+0xc INVALID_POINTER_READ_c0000005_Test.DLL!std::vector_std::pair_unsigned_int, unsigned_int_,std::allocator_std::pair_unsigned_int,unsigned_int_____::size Following is the code snap in the code where it fails: for (unsigned i1 = 0; i1 < size1; ++i1) { for (unsigned i2 = 0; i2 < size2; ++i2) { const branch_info& b1 = en1.m_branches[i1]; //Exception here :crash const branch_info& b2 = en2.m_branches[i2]; } } where branch_info is std::pair<unsigned int,unsigned int> and the en1.m_branches[i1] fetches me a pair value.

    Read the article

  • Access Voilation in std::pair

    - by sameer karjatkar
    I have an application which is trying to populate a pair . Out of no where the application crashes . The Windbg analysis on the crash dump suggest PRIMARY_PROBLEM_CLASS: INVALID_POINTER_READ DEFAULT_BUCKET_ID: INVALID_POINTER_READ STACK_TEXT: 0389f1dc EPFilter32!std::vector,std::allocator ::size+0xc INVALID_POINTER_READ_c0000005_Test.DLL!std::vector_std::pair_unsigned_int, unsigned_int_,std::allocator_std::pair_unsigned_int,unsigned_int___::size Following is the statement in the code where it fails const branch_info& b1 = en1.m_branches[i1]; where branch_info is std::pair and the en1.m_branches[i1] fetches me a pair value

    Read the article

  • How do I write test code to exercise a C# generic Pair<TKey, TValue> ?

    - by Scott Davies
    Hi, I am reading through Jon Skeet's "C# in Depth", first edition (which is a great book). I'm in section 3.3.3, page 84, "Implementing Generics". Generics always confuse me, so I wrote some code to exercise the sample. The code provided is: using System; using System.Collections.Generic; public sealed class Pair<TFirst, TSecond> : IEquatable<Pair<TFirst, TSecond>> { private readonly TFirst first; private readonly TSecond second; public Pair(TFirst first, TSecond second) { this.first = first; this.second = second; } ...property getters... public bool Equals(Pair<TFirst, TSecond> other) { if (other == null) { return false; } return EqualityComparer<TFirst>.Default.Equals(this.First, other.First) && EqualityComparer<TSecond>.Default.Equals(this.Second, other.Second); } My code is: class MyClass { public static void Main (string[] args) { // Create new pair. Pair thePair = new Pair(new String("1"), new String("1")); // Compare a new pair to previous pair by generating a second pair. if (thePair.Equals(new Pair(new string("1"), new string("1")))) System.Console.WriteLine("Equal"); else System.Console.WriteLine("Not equal"); } } The compiler complains: "Using the generic type 'ManningListing36.Paie' requires 2 type argument(s) CS0305" What am I doing wrong ? Thanks, Scott

    Read the article

  • ssh authentication with public-private key pair

    - by Rui Gonçalves
    Hi! I'm wonder if is possible to authenticate the same user with different public-private keys pairs on the same remote host. For all production servers, the public-private key pair has been generated for the same user and then exported to the backup server for allowing ssh authentication without human intervention. However, I'm having problems on some production servers, once the password prompt is always displayed. Thanks in advance for the help, Best regards!

    Read the article

  • Racket: change dotted pair to list

    - by user2963128
    I have a program that recursively calls a hashtable and prints out data from it. Unfortunately my hashtable seems to be saving data as dotted pairs so when I call the hashtable I get an error saying that there is no data for it because its tryign to search the hashtable for a dotted pair instead of a list. Is there an easy way to make the dotted pair into a regular list? IE im getting '("was" . "beginning") instead of '("was" "beginning") Is there a way to change this without re-writing how my hashtable store stuff? im using the let function to set a variable to this and then calling another function based on this variable (let ((data ( list-ref(hash-ref Ngram-table key) (random (length (hash-ref Ngram-table key)))))) is there a way to make the value stored in data just a list like this '("var1" "var2") instead of a dotted pair? edit: im getting dotted pairs because im using let to set data to the part of the hashtable's key and one of the elements in that hash.

    Read the article

  • how to validate all but not single pair of input box in jQuery

    - by I Like PHP
    i have a form which have 45 input boxes, i applied jquery validation for all input boxes , but there is two pair of input boxes which have either oneof them should be filled up, not both. so how do i change jquery so that if anyone fill up first pair then jquery does not check second pair of input box and if any one is fill up second pair then not check for fisrt one's and also i have used radio box for showing one pair at a time i show code below: jQuery Code <script type="text/javascript"> $j=jQuery.noConflict(); $j(document).ready(function() { function validate() { return $j("input:text,textarea,select,radio").removeClass('rdb').filter(function() { return !/\S+/.test($j(this).val()); }).addClass('rdb').size() == 0; } $j('#myForm').submit(validate); $j(":input:text,textarea,select").blur(function() { if(this.value.length > 0) { $j(this).removeClass('rdb'); } }); $j("input:radio").click(function(){ if($j(this).val()=='o'){ $j("#rcpt").css("display","none"); $j("#notRcpt").css("display","inline"); } if($j(this).val()=='r'){ $j("#notRcpt").css("display","none"); $j("#rcpt").css("display","inline"); } }); }); </script> PHP Code <form name="myForm" action="somepage.php" method="post" id="myForm"> <table width="100%" border="0" cellspacing="4" cellpadding="0"> <tr> <td class="boxtitle">Delivery Pick up Station/Place</td> <tr> <td style="font:bold 11px verdana;"> <input type="radio" name="receipt" value="r" >Receipt <input type="radio" name="receipt" value="o" >Other </td> </tr> <tr> <td> <table width="100%" border="0" cellspacing="3" cellpadding="0"> <tr id="rcpt" style="display:none"> <td width="12%" align="left">Receipt:</td> <td width="30%" align="left"<input type="text" name="deliveryNo" id="deliveryNo" /></td> <td width="25%" align="right">Pick up Date:</td> <td width="35%" align="left"><input name="deliveryDate" type="text" id="deliveryDate" /></td> </tr> <tr id="notRcpt" style="display:none"> <td>Other:</td> <td><input name="deliveryNo" type="text" id="deliveryNo" /></td> <td align="right">Pick up Date:</td> <td><input name="otherDeliveryDate" type="text" id="otherDeliveryDate" /></td> </tr> </table> </td> </tr> </table> </form>

    Read the article

  • Big Data – Operational Databases Supporting Big Data – Key-Value Pair Databases and Document Databases – Day 13 of 21

    - by Pinal Dave
    In yesterday’s blog post we learned the importance of the Relational Database and NoSQL database in the Big Data Story. In this article we will understand the role of Key-Value Pair Databases and Document Databases Supporting Big Data Story. Now we will see a few of the examples of the operational databases. Relational Databases (Yesterday’s post) NoSQL Databases (Yesterday’s post) Key-Value Pair Databases (This post) Document Databases (This post) Columnar Databases (Tomorrow’s post) Graph Databases (Tomorrow’s post) Spatial Databases (Tomorrow’s post) Key Value Pair Databases Key Value Pair Databases are also known as KVP databases. A key is a field name and attribute, an identifier. The content of that field is its value, the data that is being identified and stored. They have a very simple implementation of NoSQL database concepts. They do not have schema hence they are very flexible as well as scalable. The disadvantages of Key Value Pair (KVP) database are that they do not follow ACID (Atomicity, Consistency, Isolation, Durability) properties. Additionally, it will require data architects to plan for data placement, replication as well as high availability. In KVP databases the data is stored as strings. Here is a simple example of how Key Value Database will look like: Key Value Name Pinal Dave Color Blue Twitter @pinaldave Name Nupur Dave Movie The Hero As the number of users grow in Key Value Pair databases it starts getting difficult to manage the entire database. As there is no specific schema or rules associated with the database, there are chances that database grows exponentially as well. It is very crucial to select the right Key Value Pair Database which offers an additional set of tools to manage the data and provides finer control over various business aspects of the same. Riak Rick is one of the most popular Key Value Database. It is known for its scalability and performance in high volume and velocity database. Additionally, it implements a mechanism for collection key and values which further helps to build manageable system. We will further discuss Riak in future blog posts. Key Value Databases are a good choice for social media, communities, caching layers for connecting other databases. In simpler words, whenever we required flexibility of the data storage keeping scalability in mind – KVP databases are good options to consider. Document Database There are two different kinds of document databases. 1) Full document Content (web pages, word docs etc) and 2) Storing Document Components for storage. The second types of the document database we are talking about over here. They use Javascript Object Notation (JSON) and Binary JSON for the structure of the documents. JSON is very easy to understand language and it is very easy to write for applications. There are two major structures of JSON used for Document Database – 1) Name Value Pairs and 2) Ordered List. MongoDB and CouchDB are two of the most popular Open Source NonRelational Document Database. MongoDB MongoDB databases are called collections. Each collection is build of documents and each document is composed of fields. MongoDB collections can be indexed for optimal performance. MongoDB ecosystem is highly available, supports query services as well as MapReduce. It is often used in high volume content management system. CouchDB CouchDB databases are composed of documents which consists fields and attachments (known as description). It supports ACID properties. The main attraction points of CouchDB are that it will continue to operate even though network connectivity is sketchy. Due to this nature CouchDB prefers local data storage. Document Database is a good choice of the database when users have to generate dynamic reports from elements which are changing very frequently. A good example of document usages is in real time analytics in social networking or content management system. Tomorrow In tomorrow’s blog post we will discuss about various other Operational Databases supporting Big Data. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Big Data, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL

    Read the article

  • MapReduce in DryadLINQ and PLINQ

    - by JoshReuben
    MapReduce See http://en.wikipedia.org/wiki/Mapreduce The MapReduce pattern aims to handle large-scale computations across a cluster of servers, often involving massive amounts of data. "The computation takes a set of input key/value pairs, and produces a set of output key/value pairs. The developer expresses the computation as two Func delegates: Map and Reduce. Map - takes a single input pair and produces a set of intermediate key/value pairs. The MapReduce function groups results by key and passes them to the Reduce function. Reduce - accepts an intermediate key I and a set of values for that key. It merges together these values to form a possibly smaller set of values. Typically just zero or one output value is produced per Reduce invocation. The intermediate values are supplied to the user's Reduce function via an iterator." the canonical MapReduce example: counting word frequency in a text file.     MapReduce using DryadLINQ see http://research.microsoft.com/en-us/projects/dryadlinq/ and http://connect.microsoft.com/Dryad DryadLINQ provides a simple and straightforward way to implement MapReduce operations. This The implementation has two primary components: A Pair structure, which serves as a data container. A MapReduce method, which counts word frequency and returns the top five words. The Pair Structure - Pair has two properties: Word is a string that holds a word or key. Count is an int that holds the word count. The structure also overrides ToString to simplify printing the results. The following example shows the Pair implementation. public struct Pair { private string word; private int count; public Pair(string w, int c) { word = w; count = c; } public int Count { get { return count; } } public string Word { get { return word; } } public override string ToString() { return word + ":" + count.ToString(); } } The MapReduce function  that gets the results. the input data could be partitioned and distributed across the cluster. 1. Creates a DryadTable<LineRecord> object, inputTable, to represent the lines of input text. For partitioned data, use GetPartitionedTable<T> instead of GetTable<T> and pass the method a metadata file. 2. Applies the SelectMany operator to inputTable to transform the collection of lines into collection of words. The String.Split method converts the line into a collection of words. SelectMany concatenates the collections created by Split into a single IQueryable<string> collection named words, which represents all the words in the file. 3. Performs the Map part of the operation by applying GroupBy to the words object. The GroupBy operation groups elements with the same key, which is defined by the selector delegate. This creates a higher order collection, whose elements are groups. In this case, the delegate is an identity function, so the key is the word itself and the operation creates a groups collection that consists of groups of identical words. 4. Performs the Reduce part of the operation by applying Select to groups. This operation reduces the groups of words from Step 3 to an IQueryable<Pair> collection named counts that represents the unique words in the file and how many instances there are of each word. Each key value in groups represents a unique word, so Select creates one Pair object for each unique word. IGrouping.Count returns the number of items in the group, so each Pair object's Count member is set to the number of instances of the word. 5. Applies OrderByDescending to counts. This operation sorts the input collection in descending order of frequency and creates an ordered collection named ordered. 6. Applies Take to ordered to create an IQueryable<Pair> collection named top, which contains the 100 most common words in the input file, and their frequency. Test then uses the Pair object's ToString implementation to print the top one hundred words, and their frequency.   public static IQueryable<Pair> MapReduce( string directory, string fileName, int k) { DryadDataContext ddc = new DryadDataContext("file://" + directory); DryadTable<LineRecord> inputTable = ddc.GetTable<LineRecord>(fileName); IQueryable<string> words = inputTable.SelectMany(x => x.line.Split(' ')); IQueryable<IGrouping<string, string>> groups = words.GroupBy(x => x); IQueryable<Pair> counts = groups.Select(x => new Pair(x.Key, x.Count())); IQueryable<Pair> ordered = counts.OrderByDescending(x => x.Count); IQueryable<Pair> top = ordered.Take(k);   return top; }   To Test: IQueryable<Pair> results = MapReduce(@"c:\DryadData\input", "TestFile.txt", 100); foreach (Pair words in results) Debug.Print(words.ToString());   Note: DryadLINQ applications can use a more compact way to represent the query: return inputTable         .SelectMany(x => x.line.Split(' '))         .GroupBy(x => x)         .Select(x => new Pair(x.Key, x.Count()))         .OrderByDescending(x => x.Count)         .Take(k);     MapReduce using PLINQ The pattern is relevant even for a single multi-core machine, however. We can write our own PLINQ MapReduce in a few lines. the Map function takes a single input value and returns a set of mapped values àLINQ's SelectMany operator. These are then grouped according to an intermediate key à LINQ GroupBy operator. The Reduce function takes each intermediate key and a set of values for that key, and produces any number of outputs per key à LINQ SelectMany again. We can put all of this together to implement MapReduce in PLINQ that returns a ParallelQuery<T> public static ParallelQuery<TResult> MapReduce<TSource, TMapped, TKey, TResult>( this ParallelQuery<TSource> source, Func<TSource, IEnumerable<TMapped>> map, Func<TMapped, TKey> keySelector, Func<IGrouping<TKey, TMapped>, IEnumerable<TResult>> reduce) { return source .SelectMany(map) .GroupBy(keySelector) .SelectMany(reduce); } the map function takes in an input document and outputs all of the words in that document. The grouping phase groups all of the identical words together, such that the reduce phase can then count the words in each group and output a word/count pair for each grouping: var files = Directory.EnumerateFiles(dirPath, "*.txt").AsParallel(); var counts = files.MapReduce( path => File.ReadLines(path).SelectMany(line => line.Split(delimiters)), word => word, group => new[] { new KeyValuePair<string, int>(group.Key, group.Count()) });

    Read the article

  • Twisted pair cable twists and unwanted signals issue

    - by ziaharipur
    I am confused about one point I have read the following paragraph from the networking book. “the twists in the twisted pair cable are used to avoid the unwanted signals. For example one twist, one wire is closer to the noise source and the other is farther; in the next twist the reverse is true. Twisting makes its probable that both wires are equally affected by the unwanted signal. This means that the receiver which calculate the difference between the two receives no unwanted signal.” Now ok I understood the purpose of twists but I am confused about how receiver will calculate the difference when it will receive the signal?. How unwanted signal will be eliminated ? Another thing that I want to make clear is , I am beginner please provide such an answer that can be understood.

    Read the article

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