Search Results

Search found 2606 results on 105 pages for 'combination'.

Page 64/105 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • Functional equivalent of if (p(f(a), f(b)) a else b

    - by oxbow_lakes
    I'm guessing that there must be a better functional way of expressing the following: def foo(i: Any) : Int if (foo(a) < foo(b)) a else b So in this example f == foo and p == _ < _. There's bound to be some masterful cleverness in scalaz for this! I can see that using BooleanW I can write: p(f(a), f(b)).option(a).getOrElse(b) But I was sure that I would be able to write some code which only referred to a and b once. If this exists it must be on some combination of Function1W and something else but scalaz is a bit of a mystery to me! EDIT: I guess what I'm asking here is not "how do I write this?" but "What is the correct name and signature for such a function and does it have anything to do with FP stuff I do not yet understand like Kleisli, Comonad etc?"

    Read the article

  • Apriori Algorithm- what to do with small min.support?

    - by user3707650
    I have a question about the table beneath my question: If i was told that the given min.support=10%, how can i know what is the support count, by which i will use during the exercise? What i know is: that you take the number of transactions (8) and multiple it by the min.support: 8*(10/100)=0.8 the problem is that i get this number: 0.8, how can i use this support count during this example?? 0.8 is a number that will make me prune all combination set that i will build... please help me!!! TID A B C D E F G 10 1 0 1 0 0 0 1 20 1 1 1 1 0 1 1 30 0 0 0 0 0 0 1 40 0 0 1 0 0 1 1 50 0 0 0 1 1 0 0 60 0 1 1 0 1 1 0 70 0 0 0 0 1 1 0 80 0 0 1 0 1 1 1

    Read the article

  • Expanding a row in a div-based table

    - by magneticMonster
    I have a stack of <div> elements that show a name. I'd like to include a + link off to the side that, when clicked, expands the <div> and adds more detailed information (from a RoR controller). After poking around on the net, I found link_to_remote and related RoR stuff, but I can't seem to get the right combination to work together. Can someone point me to a tutorial or show what the controller and view interaction should look like? Thanks!

    Read the article

  • How do customize the g:sortableColumn?

    - by kakaotalk
    Well, I have one column in my list that I need to customize, the thing is grails' own g:sortable doesn't work. For instance, my first column shows employee ids, then my second column, shows the employees full name where full name is a combination of first name and last name. I got it to work, sorting and all, but when I try to place it in a table with g:sortable, the g:sortable just wouldn't work. I'm thinking about passing params around but it's a bit tricky. Any suggestions? I've looked around the internet, and seems like nothing. :\

    Read the article

  • Is it possible to have a composite index with a list property and a sort order?

    - by npdoty
    And if not, why not? The following index always fails for me, even though I had thought I could have a sort order with a list property as long as the index didn't sort or match against any other properties. - kind: Foo properties: - name: location_geocells - name: time direction: desc If such a composite index is allowed, are there any reasons that this might be failing for me? Do the existence of other indices on the same model increase the likelihood of this failure? Does the combination of a sort order with a list property require more than N entries, where N is the number of values in the list property? (If so, how many does it require?)

    Read the article

  • A 3-D grid of regularly spaced points

    - by Jack
    I want to create a list containing the 3-D coords of a grid of regularly spaced points, each as a 3-element tuple. I'm looking for advice on the most efficient way to do this. In C++ for instance, I simply loop over three nested loops, one for each coordinate. In Matlab, I would probably use the meshgrid function (which would do it in one command). I've read about meshgrid and mgrid in Python, and I've also read that using numpy's broadcasting rules is more efficient. It seems to me that using the zip function in combination with the numpy broadcast rules might be the most efficient way, but zip doesn't seem to be overloaded in numpy.

    Read the article

  • scala coalesces multiple function call parameters into a Tuple -- can this be disabled?

    - by landon9720
    This is a troublesome violation of type safety in my project, so I'm looking for a way to disable it. It seems that if a function takes an AnyRef (or a java.lang.Object), you can call the function with any combination of parameters, and Scala will coalesce the parameters into a Tuple object and invoke the function. In my case the function isn't expecting a Tuple, and fails at runtime. I would expect this situation to be caught at compile time. object WhyTuple { def main(args: Array[String]): Unit = { fooIt("foo", "bar") } def fooIt(o: AnyRef) { println(o.toString) } } Output: (foo,bar)

    Read the article

  • Django query - join on the same table

    - by dana
    i have a mini blog app, and a 'timeline' . there i want to be displayed all the posts from all the friends of a user, plus the posts of that user himself. For that, i have to make some kind of a 'join' between the results of two queries (queries on the same table) , so that the final result will be the combination of the user - posesor of the account, and all his friends. My query looks like this: blog = New.objects.filter(created_by = following,created_by = request.user) By that ',' i wanted to make a 'join' -i found something like this on a doc- but this method is not correct- i'm getting an error. How else could be done this 'join' ? Thanks!

    Read the article

  • How to programmatically switch to a specific window in compiz?

    - by FossilBit
    Is there a command to tell compiz that we want to bring in front and set focus to a specific window? How should we identify the window in that command? The reason behind this question is the following use-case: Suppose we have a wiki to keep notes of anything interesting we find out. It would be very convenient to have a keyboard shortcut to bring the browser window with our Wiki page in front and start typing immediately then with another key combination switch to the application we were working before I know that "ALT+TAB" switches between the last two used windows but cannot support more complex combinations of applications. E.g Browser+Eclipse+ Wiki If there is a command like the one described, it is easy to add a shortcut to it from KDE or GNOME interface Thanx ...

    Read the article

  • MySQL Query : Advise Needed.

    - by Rachel
    "SELECT id as Id from dbTable WHERE code = ? AND CURDATE() BETWEEN start_date AND end_date AND offerId IN ('12321', '12124')"; //Passing arguments for the query $args = array_merge(array(51342),$offerid); //Execute the prepared query $statement->execute($args); Now array(51342) represents combination of code+value, aside my database has value, code columns and so I want a query which would look logically like "SELECT id as Id from dbTable WHERE code and value (Note here I do not know the syntax, what am looking at is (code+value = ?), please advise on query) = ? AND CURDATE() BETWEEN start_date AND end_date AND offerId IN ('12321', '12124')";

    Read the article

  • Aptana Open Resource Key Binding

    - by yagudaev
    The default keyboard shortcut for open resource in Eclipse is Ctrl+Shift+R. It is also the case in Aptana, but there also seems to be a conflicting key since when clicked it brings up a context menu with 2 options "Run" and "Open Resource". How to I avoid having this context menu pop up? I tried to go to the preferences and look for conflicting key-bindings but I could not find it. I am also not sure what "Run" command is actually bound (I tried searching based on the key combination, that did not seem to have worked).

    Read the article

  • Counting values in data frame subject to conditions

    - by unixsnob
    I have been searching around and I cannot figure out how to sumarise the data I have in my data frame (subject to some ranges). I know that it can be done when applying some combination of daaply/taaply or table but I haven't been able to get the exact result I was expecting. Basically I want to turn this: part_no val1 val2 val3 2 1 2 3 45.3 2 1 3 4 -12.3 3 1 3 4 99.3 3 1 5 2 -3.2 3 1 4 3 -55.3 Into this: part_no val3_between0_50 val3_bw50_100 val3_bw-50_0 val3_bw-100_-50 2 1 0 0 1 0 3 0 1 0 1 1 This is dummy data, I got a lot more rows, but the idea is the same. I just want to count the number of values for a participant that meet certain condition. If anyone could explain it sort of step by step, I would really appreciate it. I saw lots of different little posts around, but none do exactly this and my attempts only got me half way there. Like using table, etc. Thanks!

    Read the article

  • Metro style apps with Html and C#

    - by labroo
    According to this slide http://geekswithblogs.net/images/geekswithblogs_net/technetbytes/windows-8-platform-tools.jpg Does it mean I have to use XAML view with C# if I want to develop a metro styled application? Can I use a HTML/JS/CSS - C# combination with event handlers and all? Something like ASP.NET Webforms/MVC . I know it is not the same client server architecture, but since metro styled apps support HTML/JS, I was wondering. I can use Win-JS. But can I rather write C# than Javascript, and use HTML rather than XAML?(I dont know XAML and I like C#) All the C# samples I found online use XAML.

    Read the article

  • Use AJAX to check for a new message

    - by Luke
    Quite simply, I need to alert the end user when they have a new private message. From a combination of research and other opinion, I realise I need to use AJAX for this. The mysql query would be SELECT id FROM tbl_messages WHERE to_viewed = 1 So when someone sends a message, I want an alert to popup on the screen to inform the user without a page reload. I have absolutely no idea what I am doing, but know what I want. Really need help with this, AJAX is definitely something I want to improve as it opens up greater possibilities! Thanks

    Read the article

  • servlet authentication and further reference to the credentials

    - by user553592
    What I got so far: It all begins with an HTML form which prompts the user for a username and password. From there it post the acquired user/pass to a servlet, GateKeeper. GateKeeper determines if the user/pass combination match any records in the MySQL database. Here is the sql I use: SELECT id FROM Users WHERE username='?' AND password=MD5('?') where the ? indicate information provided the previous HTML form. What I need now: I need some way to store the username and id of the record in the database. GateKeeper redirects the user to a control panel upon success. Therefore, I need a method to reference the username to display simple greetings, etc and also the id so it eliminates unnecessary calls to the database. The control panel may make AJAX calls to Servlets that preform some sort of task to the MySQL database.

    Read the article

  • ruby on rails named scopes (searching)

    - by houlahan
    I have a named scope (name) combination of first and last name and I'm wanting to use this in a search box. I have the code below: named_scope :full_name, lambda { |fn| {:joins => :actor, :conditions => ['first_name LIKE ? OR second_name LIKE ?', "%#{fn}%", "%#{fn}%"]} } def self.search(search) if search self.find(:all, :conditions => [ 'full_name LIKE ?', "%#{search}%"]) else find(:all) end end but this doesn't work as it gives the following error: SQLite3::SQLException: no such column: full_name: SELECT * FROM "actors" WHERE (full_name LIKE '%eli dooley%') Thanks in advance Houlahan

    Read the article

  • Using sed with html data

    - by StackedCrooked
    I'm having some problems using sed in combination with html. The following sample illustrates the problem: HTML="<html><body>ENTRY</body><html>" TABLE="<table></table>" echo $HTML | sed -e s/ENTRY/$TABLE/ This outputs: sed: -e expression #1, char 18: unknown option to `s' If I leave out the / from $TABLE so that it becomes <table><table> it works ok. Any ideas on how to fix it?

    Read the article

  • Reboot windows machines at a certain time of day and automatically login with Python

    - by Tom
    I know how to reboot machines remotely, so that's the easy part. However, the complexity of the issue is trying to setup the following. I'd like to control machines on a network for after-hours use such that when users logoff and go home, or shutdown their computers, whatever, python or some combination of python + windows could restart their machines (for cleanliness) and automatically login, running a process for the night, then in the morning, stop said process and restart the machine so the user could easily login like normal. I've looked around, haven't had too terribly much luck, though it looks like one could do it with a changing of the registry. That sounds like a rough idea though, modifying the registry on a per-day basis. Is there an easier way?

    Read the article

  • Working with sets of rows in (My)SQL and comparing values

    - by Pep.
    Hello, I am trying to figure out the SQL for doing some relatively simple operations on sets of records in a table but I am stuck. Consider a table with multiple rows per item, all identified by a common key. For example: serial model color XX1 A blue XX2 A blue XX3 A green XX5 B red XX6 B blue XX1 B blue What I would for example want to do is: Assuming that all model A rows must have the same color, find the rows which dont. (for example, XX3 is green). Assuming that a given serial number can only point to a single type of model, find out the rows which that does not occur (for example XX1 points both to A and B) These are all simple logically things to do. To abstract it, I want to know how to group things by using a single key (or combination of keys) and then compare the values of those records. Should I use a join on the same table? should i use some sort of array or similar? thanks for your help

    Read the article

  • Are there any good Javascript/Jquery thumbnail script equivalents to TimThimb (PHP)?

    - by Mark
    For those unaware of TimThumb, it will take any image, of any size or dimension and create a thumbnail on the fly to any desired size. The beauty of it is that it really works on any dimension you feed it through a combination of either resizing the image, cropping or zoom cropping the image. Ive been searching for jscript equvalents but they either require the user to actually mask out the thumbs manually (looking for a script that automatically does it to images) or the scripts can't handle images in a different aspect ratio. Thanks for any leads on this!

    Read the article

  • document.getElementByIdContains?

    - by johnshaddad
    Hello Is there, by any chance, a way to solve this problem: I have elements that have IDs such as "x_y_z". The unique part is "x_y", thus there is no two items that have the same combination of x and y.. However, using getElementById won't work because when I do it I only have the "x" and "y" part and not the Z (think of Z as a random incremental counter). Is there a way around this? So that when I have the "x" and "y" I say something like getElementByIdContains("x_y")? Thanks!

    Read the article

  • Removing an element from an array (PHP)

    - by morpheous
    I want to remove an element from a PHP array (and shrink the array size). Just looking at the PHP docs, it seems this can be done using array_slice() and array_merge() so I am guessing (off the top of my head) that some combination of array_merge() and array_slice will work. However, array_slice() requires an index (not a key), so I'm not sure how to quickly cobble these functions together for a solution. Has anyone implemented such a function before?. I'm sure it must be only a few lines long, but I cant somehow get my head around it (its been one of those days) ... Actually, I just came up with this cheesy hack when writing up this question.... function remove_from_array(array $in, value) { return array_diff($in, (array)$value); } too ugly? or will it work (without any shocking side effects)?

    Read the article

  • jQuery - Traversing the DOM

    - by danit
    Here is my HTML: <li> <div class="menu_inner"> <a href="#"> <div class="button"><img class="486" src="images/portalbutton.png" /></div> <div class="prod_description">&nbsp;</div> </a> </div> </li> I want to add a .click() function to .prod_description, the click event should take the background colour applied in CSS from the li element. Using this code: $(".prod_description").mousedown(function() { $('#toolbar').css('background-color', $(this).parent().css('background-color')) }) I dont seem to be able to get the correct $(this).parent() combination....

    Read the article

  • About Attributes member of LUID_AND_ATTRIBUTES used in TOKEN_PRIVILEGES structure

    - by Astaroth
    MSDN article, Enabling and Disabling Privileges in C++, provided the a code example to show how to enable or disable a privilege in an access token. I quote the part in questioned: tp.PrivilegeCount = 1; tp.Privileges[0].Luid = luid; if (bEnablePrivilege) tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; else tp.Privileges[0].Attributes = 0; What is the meaning of zero value for Attributes member? According to the documentation of TOKEN_PRIVILEGES structure, the attributes of a privilege can be a combination of the following values: SE_PRIVILEGE_ENABLED  (it is 0x00000002L in WinNT.h) SE_PRIVILEGE_ENABLED_BY_DEFAULT  (it is 0x00000001L in WinNT.h) SE_PRIVILEGE_REMOVED  (it is 0x00000004L in WinNT.h) SE_PRIVILEGE_USED_FOR_ACCESS  (it is 0x80000000L in WinNT.h) So, we don't see any valid constant with a value of zero. I guess, the zero is equal to SE_PRIVILEGE_REMOVED. Anybody here could explain what the zero value really does?

    Read the article

  • JQuery mobile handling links (return false)

    - by shinax
    I'm planning on using JQM to make a simple mobile web app, and I'm having problems getting this simple functionality to work: when I click on some links (not all of them), I want to be able to first process some data, and then depending on that outcome, sometimes continue the link action (I like the whole transitions and ajax things), and sometimes don't. The important part is that I want to preserve the normal JQMobile transitions and stuff for the links, just sometimes prevent them (for example for validation and things like that). I've tried with: return false, preventDefault (and in combination with stopPropagation), and data-ajax="false", and none hav worked, they all redirect. Could somebody tell me the correct way to to this in JQMobile? Just in case it's important: I'm using anchor links, using this to test. Thank you in advance, Jennifer.

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >