Search Results

Search found 40 results on 2 pages for 'norbert hartl'.

Page 1/2 | 1 2  | Next Page >

  • Michael Hartl's rails tutorial: reusing sessions resource for multiple User types

    - by ntaj
    I'm learning Ruby on Rails through Micheal Hartl's tutorial. In my web application, I require two types of Users, called publishers and subscribers. Currently I have a publishers resource and a subscribers resource. I'd like both of them to be able to use the sessions resource for signin/signout. I'm looking for some direction on how to implement this. Should my publisher and subscriber resource inherit from the User resource, so that, for example, the following code works through polymorphism? def create user = User.find_by_email(params[:session][:email]) if user && user.authenticate(params[:session][:password]) # Sign the user in and redirect to the user's show page. else # Create an error message and re-render the signin form. end end The publisher and subscriber do not have many common fields and different capabilities, so I think they should be modeled as two separate resources, but how to have them share the Sessions resource?

    Read the article

  • Having difficulties in ending Michael Hartl's tutorial. Help?

    - by konzepz
    Following Michael Hartl's (amazing) Ruby on Rails Tutorial, on the final section, I get the following errors: 1) User micropost associations status feed should include the microposts of followed users Failure/Error: @user.feed.should include(mp3) expected [#<Micropost id: 2, content: "Foo bar", user_id: 1, created_at: "2011-01-12 21:22:41", updated_at: "2011-01-12 22:22:41">, #<Micropost id: 1, content: "Foo bar", user_id: 1, created_at: "2011-01-11 22:22:41", updated_at: "2011-01-12 22:22:41">] to include #<Micropost id: 3, content: "Foo bar", user_id: 2, created_at: "2011-01-12 22:22:41", updated_at: "2011-01-12 22:22:41"> Diff: @@ -1,2 +1,2 @@ -#<Micropost id: 3, content: "Foo bar", user_id: 2, created_at: "2011-01-12 22:22:41", updated_at: "2011-01-12 22:22:41"> +[#<Micropost id: 2, content: "Foo bar", user_id: 1, created_at: "2011-01-12 21:22:41", updated_at: "2011-01-12 22:22:41">, #<Micropost id: 1, content: "Foo bar", user_id: 1, created_at: "2011-01-11 22:22:41", updated_at: "2011-01-12 22:22:41">] # ./spec/models/user_spec.rb:214 2) Micropost from_users_followed_by should include the followed user's microposts Failure/Error: Micropost.from_users_followed_by(@user).should include(@other_post) expected [#<Micropost id: 1, content: "foo", user_id: 1, created_at: "2011-01-12 22:22:46", updated_at: "2011-01-12 22:22:46">] to include #<Micropost id: 2, content: "bar", user_id: 2, created_at: "2011-01-12 22:22:46", updated_at: "2011-01-12 22:22:46"> Diff: @@ -1,2 +1,2 @@ -#<Micropost id: 2, content: "bar", user_id: 2, created_at: "2011-01-12 22:22:46", updated_at: "2011-01-12 22:22:46"> +[#<Micropost id: 1, content: "foo", user_id: 1, created_at: "2011-01-12 22:22:46", updated_at: "2011-01-12 22:22:46">] # ./spec/models/micropost_spec.rb:75 Finished in 9.18 seconds 153 examples, 2 failures Seems like mp3 is not included in the feed. Any ideas on how to fix it? Or where to look for possible errors in the code? I compared the files with Hartl's original code; seems exact. Thanks.

    Read the article

  • Firebird .NET: Database backup not working (small file)

    - by Norbert
    Hi, I am trying to backup my Firebird 2.5 database file by code: FbBackup backupSvc = new FbBackup(); backupSvc.ConnectionString = MyConnectionManager.buildConnectionString(); backupSvc.BackupFiles.Add(new FbBackupFile(backupPathFilenameAndExtension, 2048)); backupSvc.Verbose = true; backupSvc.Options = FbBackupFlags.IgnoreLimbo; backupSvc.Execute(); The database gets saved to the specified directory. However, the file saved file is only 168kB large. The original database is nearly 7MB in size. What goes wrong? Thanks, Norbert

    Read the article

  • Rundum sicher. Ganzheitlich gut beraten.

    - by A&C Redaktion
    IT-Security hat sich unter den Beratungsthemen zu einer ganzheitlichen Disziplin entwickelt. Trotz der großen Nachfrage sind bisher nur ausgewählte Unternehmen in der Lage, das gesamte Spektrum der IT-Sicherheitsberatung umfassend anzubieten. Die TWINSEC GmbH fokussiert sich als Oracle Gold Partner darauf, große und mittelständische Unternehmen bei der Umsetzung von Sicherheitsanforderungen zu beraten. Norbert Drecker, als Geschäftsführer des Kölner Beratungshauses, kann genau beschreiben, warum das Sicherheitsthema in den obersten Führungsetagen inzwischen höchste Priorität hat. Am Beispiel Oracle Identity Analytics erklärt Norbert Drecker, wie sich die Konsolidierung von Berechtigungen realisieren lässt und welchen Vorteil die Rezertifizierung in der konkreten Anwendung bringt. Wenn Sie erfahren wollen, warum Oracle Identity Analytics das richtige Werkzeug für mehr Sicherheit im Unternehmen ist und, wenn Sie wissen wollen, warum TWINSEC auf die intensive Zusammenarbeit mit Oracle setzt, dann schauen Sie sich das Video an.

    Read the article

  • Chrome window controls in xubuntu 12.04

    - by Norbert
    I'm a long time ubuntu 10.04 LTS user, very used to having window controls on top left borders. New computer with new video card requires newer kernel. Unity doesn't suit and much googling turned up recommendations for xubuntu. Installed 12.04 and first aggravation is window controls at upper right a la Windows. No problem ... Settings Manager - Windows Manager - rearrange button layout Fixes everything until ... I abandoned firefox long ago because of memory leak issues and general fat. I fetch a current version of chrome (19.0.1084.52) and install. Once adblock is added and it's the default browser, everything's great. Except ... Alone among all applications, chrome will not honour the window manager's preferred button layout. Buttons are at upper right no matter what I try. Uninstall and then reinstall: nope. Trawl through /home/user/.config/google-chrome/* looking for a likely setting: nope. Search the web: nothing useful. How do I get chrome's window decoration in sync? Thanks very much for any and all help.

    Read the article

  • Any way to list similar commands?

    - by Septagram
    When you write the command name wrong, bash often does this: septi@norbert:~$ good No command 'good' found, did you mean: Command 'gold' from package 'binutils' (main) Command 'gmod' from package 'gmod' (universe) Command 'goo' from package 'goo' (universe) Command 'god' from package 'god' (universe) Command 'geod' from package 'proj-bin' (universe) Command 'gord' from package 'scotch' (universe) good: command not found Or sometimes it does this: septi@norbert:~$ nftp No command 'nftp' found, but there are 23 similar ones nftp: command not found Is there any way to ask bash to show these 23 similar commands for me? And, is there a way to show similar commands, including those that aren't yet installed, instead of running the application, ftp for example?

    Read the article

  • How to avoid trailing spaces when you copy something from terminal?

    - by Michael Härtl
    I often copy a code snippet from a SSH terminal session where i'm logged in to some remote server and have a file opened in vim, for example to paste it here into an answer at SO. It frequently happens, that the code is padded with trailing spaces to match the terminal width. Whereas i've seen this on both, my Ubuntu and Windows machines (using putty) i think, it doesn't happen always. I was not able to figure out when it happens, though. So i wonder how i can avoid those trailing spaces which i have to remove manually all the time in the textarea, where i copy it to. Note, that the files do not have trailing spaces on the server! It only happens if i select and copy some text.

    Read the article

  • How to adapt a SOAP Service to REST in java?

    - by Norbert Hartl
    I need to integrate some services that are external and that are offered as SOAP Services. I don't like to use SOAP inside our system for a few reasons. I think from a pragmatic point of view it should be fairly easy to adapt SOAP to REST. This is not a SOAP vs. REST question! I'm just trying to collect java libraries, code, howtos etc. to accomplish this. Due the difference in its nature I don't expect a ready made solution. Just a couple of hints for tools and such to get going.

    Read the article

  • [WordPress] Hide Custom Fields in New Post?

    - by Norbert
    I just started out with WordPress and I'm having some problems with the custom fields. Here's the code from functions.php add_post_meta($post_id, 'Post Thumbnail', $post_thumb, true) or update_post_meta($post_id, 'Post Thumbnail', $post_thumb); add_post_meta($post_id, 'Project URL', $url, true) or update_post_meta($post_id, 'Project URL', $url); add_post_meta($post_id, 'Project Thumbnail', $thumb, true) or update_post_meta($post_id, 'Project Thumbnail', $thumb); The problem is that they show up when I try to create a new post like so: The other problem is that they don't even work, only if I publish the post, go back and readd each field. Is there any way to hide the fields to only show the "Add new custom field:" part? Thank you!

    Read the article

  • Hide Custom Fields in New Post?

    - by Norbert
    I just started out with WordPress and I'm having some problems with the custom fields. Here's the code from functions.php add_post_meta($post_id, 'Post Thumbnail', $post_thumb, true) or update_post_meta($post_id, 'Post Thumbnail', $post_thumb); add_post_meta($post_id, 'Project URL', $url, true) or update_post_meta($post_id, 'Project URL', $url); add_post_meta($post_id, 'Project Thumbnail', $thumb, true) or update_post_meta($post_id, 'Project Thumbnail', $thumb); The problem is that they show up when I try to create a new post like so: The other problem is that they don't even work, only if I publish the post, go back and readd each field. Is there any way to hide the fields to only show the "Add new custom field:" part? Thank you!

    Read the article

  • iPhone like red badge notification in a WPF project?

    - by Norbert
    I have a C# WPF project which generates daily and weekly reports automatically. I want to inform the user when new reports are available, so I thought of a badge like on the iPhone where the number of new messages appears on a little red circle: I thought of three images: Two images with semi circles on the left and right if the number to display is small. And a third image for the middle for the case that the number is large (123) and wouldn't fit in a circle. I want a glossy effect, so I've thought of pictures. Does anyone have a good idea how to do this without pictures but programmatically?

    Read the article

  • Exclude Category From wp_get_archives?

    - by Norbert
    Is there any way to exclude a category from wp_get_archives? I'm trying to show the months in the sidebar, but I want to exclude the posts that are not blog entries. $catID = get_cat_id('Projects'); $variable = wp_get_archives('type=monthly&show_post_count=1); echo $variable;

    Read the article

  • Top Container Background Problem

    - by Norbert
    Here's a screenshot: http://dl.getdropbox.com/u/118004/Screen%20shot%202010-04-13%20at%202.50.49%20PM.png The red bar on the left is the background I set for the #personal div and I would like it to align to the top of the container, vertically. The problem is that I have a background for the #container-top div on top of the #container div with absolute positioning. Is there any way to move the #personal div up so there would be no space left? HTML <div id="container"> <div id="container-top"></div> <div id="personal"> <h1>Jonathan Doe</h1> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliqua erat volutpat.</p> </div> <!-- end #personal --> </div> <!-- end #container --> CSS #container { background: url(images/bg-mid.png) repeat-y top center; width: 835px; margin: 40px auto; position: relative; } #container-top { background: url(images/bg-top.png) no-repeat top center; position: absolute; height: 12px; width: 835px; top: -12px; } #container-bottom { background: url(images/bg-bottom.png) no-repeat top center; position: absolute; height: 27px; width: 835px; bottom: -27px; } #personal { background: url(images/personal-info.png) no-repeat 0px left; }

    Read the article

  • jQuery - Animation Causes Div Overlap IE7

    - by Norbert
    I have a hidden div (#contactArea) above another div. When I click the link, the #contactArea opens up. When I click it again, it closes back up. It all works nicely, except in IE7. The two divs are transparent, so they overlap. I have no idea why this happens, or why doesn't it happen on other browsers. It just about feels like IE7 is right on this one. Any way to fix this? $(document).ready(function(){ $("#contactArea").css('display', 'none'); $("a.contact").toggle(function() { $("#contactArea").animate({height: "show"}, 1500, "easeOutBounce"); }, function() { $("#contactArea").animate({height: "hide"}, 1500, "easeOutBounce"); }); });

    Read the article

  • Search 2 Columns with 1 Input Field

    - by Norbert
    I have a db with two columns: first name and last name. The first name can have multiple words. Last name can contain hyphenated words. Is there a way to search both columns with only one input box? Database ID `First Name` `Last Name` 1 John Peter Doe 2 John Fubar 3 Michael Doe Search john peter returns id 1 john returns id 1,2 doe returns id 1,3 john doe returns id 1 peter john returns id 1 peter doe returns id 1 doe john returns id 1 I previously tried the following. Searching for John Doe: SELECT * FROM names WHERE ( `first` LIKE '%john%' OR `first` LIKE '%doe%' OR `last` LIKE '%john%' OR `last` LIKE '%doe%' ) which returns both 1 and 3

    Read the article

  • [WordPress] Get Comment Reply Link Only?

    - by Norbert
    I'm using comment_reply_link, for the reply links on every comment, but I want to use an image instead of text. I only need the link of the comment reply, not the whole thing. Codex wasn't helpful, neither the WP forums. <span class="reply"> <a href="<?php //comment reply link here ?>"> <img src="<?php bloginfo('template_url') ?>/css/images/reply-button.png" alt="" /> </a> </span>

    Read the article

  • iPhone App is leaking memory; Instruments and Clang cannot find the leak

    - by Norbert
    Hi, i've developed an iPhone program which is kind of an image manipulation program: The user get an UIImagePickerController and selects an image. Then the program does some heavy calculating in a new thread (for responsiveness of the application). The thread has, of course, its own autorelease pool. When calculation is done, the seperated thread signals the main thread that the result can be presented. The app creates a new view controller, pushes it onto the navigation controller. In short: UIImagePickerController new thread (autorelease pool) does some heavy calculation with image data signal to main thread that it's done main thread creates view controller and pushes it onto navigation controller view controller presents image result My program works well, but if I dismiss the navigation controller's top view controller by tapping on the back button and repeat the whole process several times, my app crashes. But only on the device! Instruments cannot find any leaks (except for some minor ones which I don't feel responsible for: thread creation, NSCFString; overall about 10 kB). Even Clang static analyzer tells me that my could seems to be all right. I know that the UIImage class can cache images and objects returned from convenience methods get freed only whet their autorelease pool gets drained. But most of the time I work with CGImageRef and I use UIImage' alloc, init & release methods to free memory as soon as possible. Currently, I don't know how to isolate the problem. How would you approach this problem? Crash Log: Incident Identifier: F4C202C9-1338-48FC-80AD-46248E6C7154 CrashReporter Key: bb6f526d8b9bb680f25ea8e93bb071566ccf1776 OS Version: iPhone OS 3.1.1 (7C145) Date: 2009-09-26 14:18:57 +0200 Free pages: 372 Wired pages: 7754 Purgeable pages: 0 Largest process: _MY_APP_ Processes Name UUID Count resident pages _MY_APP_ <032690e5a9b396058418d183480a9ab3> 17766 (jettisoned) (active) debugserver <ec29691560aa0e2994f82f822181bffd> 107 syslog_relay <21e13fa2b777218bdb93982e23fb65d3> 62 notification_pro <8a7725017106a28b545fd13ed58bf98c> 64 notification_pro <8a7725017106a28b545fd13ed58bf98c> 64 afcd <98b45027fbb1350977bf1ca313dee527> 65 mediaserverd <eb8fe997a752407bea573cd3adf568d3> 319 ptpd <b17af9cf6c4ad16a557d6377378e8a1e> 142 syslogd <ec8a5bc4483638539fa1266363dee8b8> 68 BTServer <1bb74831f93b1d07c48fb46cc31c15da> 119 apsd <a639ba83e666cc1d539223923ce59581> 165 notifyd <2ed3a1166da84d8d8868e64d549cae9d> 101 CommCenter <f4239480a623fb1c35fa6c725f75b166> 161 SpringBoard <8919df8091fdfab94d9ae05f513c0ce5> 2681 (active) accessoryd <b66bcf6e77c3ee740c6a017f54226200> 90 configd <41e9d763e71dc0eda19b0afec1daee1d> 275 fairplayd <cdce5393153c3d69d23c05de1d492bd4> 108 mDNSResponder <f3ef7a6b24d4f203ed147f476385ec53> 103 lockdownd <6543492543ad16ff0707a46e512944ff> 297 launchd <73ce695fee09fc37dd70b1378af1c818> 71 **End**

    Read the article

  • Path to WordPress Template Directory inside jQuery?

    - by Norbert
    My header is calling a javascript file which sends out an email: <script type="text/javascript" src="<?php bloginfo('template_directory') ?>/css/effects.js"></script> But inside this file, I have a jQuery code that calls a .php file that does the actual sending of the email: $.ajax({ type: "POST", url: "css/sendmail.php", data: dataString` But the script doesn't work, unless the url is: <?php bloginfo('template_directory') ?>/css/sendmail.php and not just: css/sendmail.php Is there any way to include a path to the wordpress template directory inside js?

    Read the article

  • jQuery: 'async: false' Not Working With IE7 / IE6

    - by Norbert
    I created a simple tracking script which adds the users info to a database when the page is unloaded. It works on all browsers except IE7 and IE6. IE7 gives me errors, but I can't open the "debugger" because I'm using the standalone version (or at least that's what I think the problems is). I removed the async: false, from the script below and I didn't get any errors, but I need async set to false in order for the script to work. Any ideas? $(window).unload(function() { $.ajax({ type: "POST", async: false, url: "add.php", data: "ip=" + jIp + "&date=" + jDate + "&time=" + jTime, }); }); Update: I got IE7 to display the error, kinda. When I click OK on the dialog on top, it closes both dialogs. Ugh!

    Read the article

  • Get jQuery Error if PHP Breaks

    - by Norbert
    I have a PHP script that breaks if a variable is not populated and it isn't added to the database, but jQuery handles this as a success and I get this error: TypeError: Result of expression 'data' [null] is not an object. Here's the jQuery script: $.ajax({ type: "POST", url: "/clase/do-add", data: $("#adauga").serialize(), dataType: "json", error: function (xhr, textStatus, errorThrown) { alert('Try again.'); }, success: function(data) { var dlHTML = '<dl id="' + data.id + '"> [too long] </dl>'; $('form#adauga').after(dlHTML); $('#main dl:first').hide().fadeIn(); adaugaClasaSubmit.removeAttr('disabled'); adaugaClasa.removeAttr('readonly'); adaugaClasa.val("").focus(); } });

    Read the article

  • WordPress: Related Posts by Tags, but in the Same Categories

    - by Norbert
    I'm using the script below to get related posts by tags, but noticed that if I have a picture of a bird tagged white and a table also tagged white, the table will show up in the related posts section of the bird. Is there a way to only get posts that match at least one of the categories, so bird and table won't be related, unless they share one category? I tried setting an category__in array inside $args, but no luck! <?php $tags = wp_get_post_tags($post->ID); if ($tags) { $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; $args=array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'showposts'=>6, // Number of related posts that will be shown. 'caller_get_posts'=>1 ); $my_query = new wp_query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) { $my_query->the_post(); ?> <?php if ( get_post_meta($post->ID, 'Image', true) ) { ?> <a style="text-decoration: none;" href="<?php the_permalink(); ?>"> <img style="max-height: 125px; margin: 15px 10px; vertical-align: middle;" src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "Image", $single = true); ?>&w=125&zc=1" alt="" /> </a> <?php } ?> <?php } } } ?>

    Read the article

  • JOIN two tables to show already purchased items

    - by Norbert
    I have a table where I keep all my templates: templates template_id template_name template_price These templates can be purchased by a registered user and then are inserted in the payments table: payments payment_id template_id user_id Is there a way to join these two tables and get not just a list of templates that have been purchased by a certain user, but all the templates? And then figure out from there which ones have already been purchased? I used this SELECT, but only the ones that the user bought showed up. I would like to have all the rows from templates, but empty in case the user_id doesn't match. SELECT * FROM templates LEFT JOIN payments ON templates.template_id = payments.template_id WHERE user_id = 2 GROUP BY templates.template_id

    Read the article

1 2  | Next Page >