Search Results

Search found 489 results on 20 pages for 'brad pears'.

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

  • Is It Possible To Cast A Range

    - by Brad Rhoads
    I'd like to do something like this: def results = Item.findAll("from Item c, Tag b, ItemTag a where c = a.item and b = a.tag and (b.tag like :q or c.uri like :q) " + ob,[q:q]) def items = (Item) results[0..1][0] but I get Cannot cast object '[Ljava.lang.Object;@1e224a5' with class '[Ljava.lang.Object;' to class 'org.maflt.ibidem.Item' I can get what I need with this, but it doesn't seem like it's the best solution: def items = [] as Set def cnt = results.size() for (i=0;i<cnt-1;i++) { items << results[i][0] } items = items as List

    Read the article

  • return unique values from array

    - by Brad
    I have an array that contains cities, I want to return an array of all those cities, but it must be a unique list of the cities. The array below: Array ( [0] => Array ( [eventname] => Wine Tasting [date] => 12/20/2013 [time] => 17:00:00 [location] => Anaheim Convention Center [description] => This is a test description [city] => Anaheim [state] => California ) [1] => Array ( [eventname] => Circus [date] => 12/22/2013 [time] => 18:30:00 [location] => LAX [description] => Description for LAX event [city] => Anaheim [state] => California ) [2] => Array ( [eventname] => Blues Fest [date] => 3/14/2014 [time] => 17:00:00 [location] => Austin Times Center [description] => Blues concert [city] => Austin [state] => Texas ) ) Should return: array('Anaheim', 'Austin'); Any help is appreciated.

    Read the article

  • If attacker has original data, and encrypted data, can they determine the passphrase?

    - by Brad Cupit
    If an attacker has several distinct items (for example: e-mail addresses) and knows the encrypted value of each item, can the attacker more easily determine the secret passphrase used to encrypt those items? Meaning, can they determine the passphrase without resorting to brute force? This question may sound strange, so let me provide a use-case: User signs up to a site with their e-mail address Server sends that e-mail address a confirmation URL (for example: https://my.app.com/confirmEmailAddress/bill%40yahoo.com) Attacker can guess the confirmation URL and therefore can sign up with someone else's e-mail address, and 'confirm' it without ever having to sign in to that person's e-mail account and see the confirmation URL. This is a problem. Instead of sending the e-mail address plain text in the URL, we'll send it encrypted by a secret passphrase. (I know the attacker could still intercept the e-mail sent by the server, since e-mail are plain text, but bear with me here.) If an attacker then signs up with multiple free e-mail accounts and sees multiple URLs, each with the corresponding encrypted e-mail address, could the attacker more easily determine the passphrase used for encryption? Alternative Solution I could instead send a random number or one-way hash of their e-mail address (plus random salt). This eliminates storing the secret passphrase, but it means I need to store that random number/hash in the database. The original approach above does not require this extra table. I'm leaning towards the the one-way hash + extra table solution, but I still would like to know the answer: does having multiple unencrypted e-mail addresses and their encrypted counterparts make it easier to determine the passphrase used?

    Read the article

  • Visual Studio 2008 compiles anything in C++ file?

    - by Brad Pepers
    I noticed today that a source code file in a project was compiling even though it had junk at the top of it. It got me wondering what all would pass without error through the compiler. Here is an example of code that will not generate any error messages: what kind of weird behaviour is this??? #include "stdafx.h" // what is up? int foo(int bar) { bla bla bla????? return bar; } and more junk??? What in the world is the compiler doing to allow this code to compile without giving any error messages? I'm using Visual Studio 2008 and this is unmanaged C++ code. The foo function isn't actually generated in the object file so it can't be used but why no errors???

    Read the article

  • can bind successfully to the ldap server, but needs to know how to find user w/i AD

    - by Brad
    I create a login form to bind to the ldap server, if successful, it creates a session (which the user's username is stored within), then I go to another page that has session_start(); and it works fine. What I want to do now, is add code to test if that user is a member of a specific group. So in theory, this is what I want to do if(username session is valid) { search ldap for user -> get list of groups user is member of foreach(group they are member of) { switch(group) { case STAFF: print 'they are member of staff group'; $access = true; break; default: print 'not a member of STAFF group'; $access = false; break; } if(group == STAFF) { break; } } if($access == TRUE) { // you have access to the content on this page } else { // you do not have access to this page } } How do I do a ldap_search w/o binding? I don't want to keep asking for their password on each page, and I can't pass their password thru a session. Any help is appreciated.

    Read the article

  • Membership systems for MVC4 that support RavenDB

    - by brad oyler
    I create a lot of quick "proof of concept" MVC apps and I actually found the SimpleMembership provider that shipped with the MVC4 templates to be very handy since it gets me up and running with user registration & OAuth in a matter of minutes. But...I've started to use RavenDb (on RavenHQ for a lot for my projects). So, I starting trying to implement my own "custom membership provider" based on the ExtendedMembershipProvider and while doing that I realized that didn't make much sense. I later stumbled upon 2 interesting projects that try to solve this exact problem: WorldDomination.Web.Auth: https://github.com/PureKrome/WorldDomination.Web.Authentication MemFlex: https://github.com/OdeToCode/Memflex Both are pretty interesting recent efforts and was wondering if these are the only ones being built right now. I'm essentially looking for nuget pkg that I can drop into a MVC4 app, connect to my RavenDb and be done. I'm willing to build this thing but don't want to duplicate any efforts that are already in motion. Thx!

    Read the article

  • Should nested attributes be automatically deleted when I delete the parent record?

    - by brad
    I'm playing around with nested forms in attributes and have a model Invoice that has_many invoice_phone_numbers. I have the following line in my invoice.rb model file accepts_nested_attributes_for :invoice_phone_numbers, :allow_destroy => true, :reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } } This does what it should and I can delete invoice_phone_numbers from the form by selecting their 'delete' checkbox. But when I delete an Invoice, I have noticed that the nested invoice_phone_numbers are not also deleted. This causes problems as rails seems to reuse id numbers in the Invoice model (Should it? Does this depend on the database? I'm using SQLite3) so phone numbers from previous invoices turn up in new invoices after they have been created. Anyway, my question is should the nested attributes be deleted when I delete the parent attribute? Is there a way to make this happen automatically as part of the nesting process or do I need to deal with this in my invoice model? If so, what is the best way to do this? I would try to go about this with a before_destroy callback but want to know if this is the best way to do this. Anyway, thanks.

    Read the article

  • C# Search for subdirectory (not for files)...

    - by Brad
    Every example I see seems to be for recursively getting files in subdirectories uses files only. What I'm trying to do is search a folder for a particular subdirectory named "xxx" then save that path to a variable so I can use it for other things. Is this possible without looping through all the directories and comparing by name?

    Read the article

  • Best way to package a class for use in another app?

    - by Brad Hein
    I've written an Android app wich various abstract classes that perform useful functions. These functions could be leveraged in other apps. I want to share a class module with another programmer, but I don't want to share the source code. I would like to share a .class file but I'm not sure how to do the following: Compile an Android .java file into .class What does the receiver of the .class file have to do to use that .class in their project? (using Eclipse environment) Thank you very much

    Read the article

  • packaging sequences of png files in iPhone APP for animations to reduce bundle size

    - by Brad Smith
    Basically, I have an application that uses a flip-book style animation technique. I am simply cycling through around 1000 320x480 pngs at 12fps, and everything works really well. Except for the fact that 1000 images takes up a ton of disk space. Ideally I'd like to be able to compress these images as a movie file and pull out each frame as I need them, or simply play back a movie with frame by frame precision. Ideas?

    Read the article

  • Local variable not being passed to partial template by render?

    - by brad
    I don't seem to be able to pass a variable to my partial template in rails (2.3.5). My code is as follows; In the main view .html.erb file: <% f.fields_for :payments do |payment_form| %> <%= render 'payment', {:f => payment_form, :t => "test" } %> <% end %> and in the _payment.html.erb file: <%= t %> produces a wrong number of arguments (0 for 1) error. The payment_form object is being passed to the partial as f without any problems. I've tried a number of variations on the above syntax (e.g. :locals => {:f => payment_form, :t => "test" } without success. I presume I'm doing something pretty basic wrong but just can't see it.

    Read the article

  • need help revising this javascript that opens to a new window on submit/post

    - by Brad
    I have a form that once you select from a drop-down list and select submit, it is suppose to open up to a new window Here is the code that is currently on the page and I think it needs to be completely wiped out or revised, it only works in IE and Firefox <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> //<!-- Hide JavaScript from older browsers // Function to open a window function windowOpen(window_url) { helpWin = window.open(window_url,'','toolbar=yes,status=no,scrollbars=yes,menubar=yes,resizable=yes,directories=no,location=no,width=350,height=400'); if (document.images) { if (helpWin) helpWin.focus() } } // End script hiding --> </SCRIPT>

    Read the article

  • PHP Pass Dynamic Array name to function

    - by Brad
    How do I pass an array key to a function to pull up the right key's data? // The array <?php $var['TEST1'] = Array ( 'Description' => 'This is a Description', 'Version' => '1.11', 'fields' => Array( 'ID' => array( 'type' => 'int', 'length' =>'11', 'misc' =>'auto_increment' ), 'DATA' => array( 'type' => 'varchar', ' length' => '255' ) ); $var['TEST2'] = Array ( 'Description' =? 'This is the 2nd Description', 'Version' => '2.1', 'fields' => Array( 'ID' => array( 'type' => 'int', 'length' =>'11', 'misc' =>'auto_increment' ), 'DATA' => array( 'type' => 'varchar', ' length' => '255' ) ) // The function <?php $obj = 'TEST1'; print_r($schema[$obj]); // <-- Fives me output. But calling the function doesn't. echo buildStructure($obj); /** * @TODO to add auto_inc support */ function buildStructure($obj) { $output = ''; $primaryKey = $schema["{$obj}"]['primary key']; foreach ($schema["{$obj}"]['fields'] as $name => $tag) // #### ERROR #### Invalid argument supplied for foreach() { $type = $tag['type']; $length = $tag['length']; $default = $tag['default']; $description = $tag['description']; $length = (isset($length)) ? "({$length})" : ''; $default = ($default == NULL ) ? "NULL" : $default; $output .= "`{$name}` {$type}{$length} DEFAULT {$default} COMMENT `{$DESCRIPTION}`, "; } return $output; }

    Read the article

  • Determine if a Range contains a value

    - by Brad Dwyer
    I'm trying to figure out a way to determine if a value falls within a Range in Swift. Basically what I'm trying to do is adapt one of the examples switch statement examples to do something like this: let point = (1, -1) switch point { case let (x, y) where (0..5).contains(x): println("(\(x), \(y)) has an x val between 0 and 5.") default: println("This point has an x val outside 0 and 5.") } As far as I can tell, there isn't any built in way to do what my imaginary .contains method above does. So I tried to extend the Range class. I ended up running into issues with generics though. I can't extend Range<Int> so I had to try to extend Range itself. The closest I got was this but it doesn't work since >= and <= aren't defined for ForwardIndex extension Range { func contains(val:ForwardIndex) -> Bool { return val >= self.startIndex && val <= self.endIndex } } How would I go about adding a .contains method to Range? Or is there a better way to determine whether a value falls within a range? Edit2: This seems to work to extend Range extension Range { func contains(val:T) -> Bool { for x in self { if(x == val) { return true } } return false } } var a = 0..5 a.contains(3) // true a.contains(6) // false a.contains(-5) // false I am very interested in the ~= operator mentioned below though; looking into that now.

    Read the article

  • How To Include Transitive Dependencies

    - by Brad Rhoads
    I have 2 gradle projects: an Android app and a RoboSpock test. My build.gradle for the Android app has . . . dependencies { compile fileTree(dir: 'libs', include: '*.jar') compile ('com.actionbarsherlock:actionbarsherlock:4.4.0@aar') { exclude module: 'support-v4' } } . . . and builds correctly by itself, e.g assembleRelease works. I'm stuck getting the test to work. I gets lots of errors such as: package com.google.zxing does not exist Those seem to indicate that the .jar files aren't being picked up. Here's my build.gradle for the test project: buildscript { repositories { mavenLocal() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' classpath 'org.robospock:robospock-plugin:0.4.0' } } repositories { mavenLocal() mavenCentral() } apply plugin: 'groovy' dependencies { compile "org.codehaus.groovy:groovy-all:1.8.6" compile 'org.robospock:robospock:0.4.4' } dependencies { compile fileTree(dir: ':android:libs', include: '*.jar') compile (project(':estanteApp')) { transitive = true } } sourceSets.test.java.srcDirs = ['../android/src/', '../android/build/source/r/debug'] test { testLogging { lifecycle { exceptionFormat "full" } } } project.ext { robospock = ":estanteApp" // project to test } apply plugin: 'robospock' As that shows, I've tried adding transitive = true and including the .jar files explicitly. But no matter what I try, I end up with the package does not exist error.

    Read the article

  • Access startup form locked GUI

    - by Brad
    I just had an interesting experience with a startup form in MS Access 2010. I designed a login form and when I thought I was done I set my startup form to be the login form I'd just created. I then closed Access and reopened it but my login form did not appear. Instead the whole GUI was locked. I cannot click on anything. My form was working during my tests before I set it as a startup form and reloaded Access. How can I either remove my form as a startup object or get the use of my GUI back?

    Read the article

  • Eclipse - How to show warning for unused method parameter ?

    - by Brad
    I am using Eclipse v3.5. In previous Eclipse versions i remember if i have defined a method with a parameter and didn't use it internally a warning appears, like this : public void myMethod( int x ) { // Didn't use x here so a warning appears at the x parameter. } But in v3.5 i do not see this warning. How can i enable it in Eclipse ?

    Read the article

  • possible to use jquery to skip to a certain part of a page, based on its div class?

    - by Brad
    I want a link that scrolls the page to the start of the <div class="content-body"> The same functionality as a: <a href="#maincontent">Skip</a>, and placing <a name="maincontent"></a> right next to <div class="content-body"> I am seeing if it is possible via jQuery, and want to know if I would run into any problems down the road using that method (besides the user having javascript disabled).

    Read the article

  • SQL 2008 CASE statement aggravation...

    - by Brad
    Why does this fail: DECLARE @DATE VARCHAR(50) = 'dasf' SELECT CASE WHEN ISDATE(@DATE) = 1 THEN CONVERT(date,@DATE) ELSE @DATE END Msg 241, Level 16, State 1, Line 2 Conversion failed when converting date and/or time from character string. Why is it trying to convert dasf to date when it clearly causes ISDATE(@DATE) = 1 to evaluate to false... If I do: SELECT ISDATE(@DATE) The return value is 0.

    Read the article

  • Need to redirect to true root folder

    - by Brad
    I am running a website on MAMP, and the root is http://localhost/sandbox When I have links that link to, for example - /calendar it directs them to localhost/calendar, I want it to redirect to localhost/sandbox/calendar What would I have to do in htaccess to get it to redirect everything to localhost/sandbox/ as the root?

    Read the article

  • MySQL: Matching inexact values using "ON"

    - by Brad
    I'm way out of my league here... I have a mapping table (table1) to assign particular values (value) to a whole number (map_nu). My second table (table2), is a collection of averages (avg) (I couldn't figure out how to properly make a markdown table, please feel free to edit!) table1: table2: (value)(Map_nu) (avg) ---- ----- 1 1 1.111 1.045 2 1.2 1.09 3 1.33333 1.135 4 1 1.18 5 1.389 1.225 6 1.42 1.27 7 1.07 1.315 8 1.36 9 1.405 10 I need to find a way to match the averages from table2 to the closest value in table1. It only need to match to the 2 digit past the decimal, so I've added the Truncated function SELECT map_nu FROM `table1` JOIN table2 ON TRUNCATE(table1.value,2)=TRUNCATE(table2.avg,2) I still miss the values that don't match the averages exactly. Is there a way to pick the nearest truncated value? Thanks!

    Read the article

  • Export to csv, string w/ comma in it, splits it up

    - by Brad
    This code exports data into a csv file, which is opened within Excel. When a string has a comma within it, it messes up the order of the data. I need help modifying my code below to resolve any data that contains a comma within it, to not to create a new column. I am assuming it will pass each string within double quotes, so any comma within those quotes, then it will make an exception. Any help is appreciated. $result = mysql_query("select lname, fname, email, dtelephone, etelephone, contactwhen, comments, thursday, friday, saturday, sunday, monday FROM volunteers_2010"); $csv_output .= "Last Name,First Name,Email,Telephone (Day),Telephone (Evening),Contact When,Comments,Thursday,Friday,Saturday,Sunday,Monday,Comments\n"; $i = 0; if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $csv_output .= $row['Field'].", "; $i++; } } $csv_output .= "\n"; $values = mysql_query("SELECT lname, fname, email, dtelephone, etelephone, contactwhen, comments, thursday, friday, saturday, sunday, monday FROM volunteers_2010 WHERE venue_id = $venue_id"); while ($rowr = mysql_fetch_row($values)) { for ($j=0;$j<$i;$j++) { $csv_output .= $rowr[$j].", "; } $csv_output .= "\n"; }

    Read the article

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