Search Results

Search found 997 results on 40 pages for 'josh holmes'.

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

  • Rails: Easy way to add more than one flash[:notice] at a time.

    - by Josh Pinter
    I thought every time you do a flash[:notice]="Message" it would add it to the array which would then get displayed during the view but the following just keeps the last flash: flash[:notice] = "Message 1" flash[:notice] = "Message 2" Now I realize it's just a simple hash with a key (I think :)) but is there a better way to do multiple flashes than the following: flash[:notice] = "Message 1<br />" flash[:notice] = "Message 2" Thanks. Josh

    Read the article

  • Silverlight Cream for April 07, 2010 -- #833

    - by Dave Campbell
    In this Issue: Alan Mendelevich, Siyamand Ayubi, Rudi Grobler(-2-), Josh Smith, VinitYadav, and Dave Campbell. Shoutouts: Jordan Knight has a demo up of a project he did for DigiGirlz: DigiGirlz, Deep Zoom and Azure, hopefully we'll get source later :) Jeremy Likness has a must-read post on his Ten Reasons to use the Managed Extensibility Framework I put this on another post earlier, but if you want some desktop bling for WP7, Ozymandias has some: I Love Windows Phone Wallpaper If you're not going to be in 'Vegas next week, Tim Heuer reminds us there's an alternative: Watch the Silverlight 4 Launch event and LIVE QA with ScottGu and others From SilverlightCream.com: Ghost Lines in Silverlight Alan Mendelevich reports an issue when drawing lines with odd coordinate values. He originated it in Silverlight 3, but it is there in SL4RC as well... check it out and leave him a comment. A Framework to Animate WPF and Silverlight Pages Similar to the PowerPoint Slides Siyamand Ayubi has an interesting post up on animating WPF or Silverlight pages to make them progress in the manner of a PPT slideshow. And it can also make phone calls… Rudi Grobler has a list of 'tasks' you can do with WP7 such as PhoneCallTask or EmailComposeTask ... looks like this should be plasticized :) Using the GPS, Accelerometer & Vibration Controller Rudi Grobler is also investigating how to use the GPS, Accelerometer, and Vibration in WP7 with a bunch of external links to back it up. Assembly-level initialization at design time Josh Smith has a solution to the problem of initializing design-time data in Blend (did you know that was an issue?) ... the solution is great and so is the running commentary between Josh and Karl Shifflett in the comments! ySurf : A Yahoo Messenger Clone built in Silverlight VinitYadav built a Yahoo Messenger app in Silverlight and has detailed out all the ugly bits for us on the post, plus made everything available. Your First Silverlight Application Dave Campbell's first post at DZone cracking open a beginner's series on Silverlight. If you're expecting something heavy-duty, skip this. If you're wanting to learn Silverlight and haven't jumped in yet, give it a try. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Silverlight Cream for May 20, 2010 -- #866

    - by Dave Campbell
    In this Issue: Mike Snow, Victor Gaudioso, Ola Karlsson, Josh Twist(-2-), Yavor Georgiev, Jeff Wilcox, and Jesse Liberty. Shoutouts: Frank LaVigne has an interesting observation on his site: The Big Take-Away from MIX10 Rishi has updated all his work including a release of nRoute to the latest bits: nRoute Samples Revisited Looks like I posted one of Erik Mork's links two days in a row :) ... that's because I meant to post this one: Silverlight Week – How to Choose a Mobile Platform Just in case you missed it (and for me to find it easy), Scott Guthrie has an excellent post up on Silverlight 4 Tools for VS 2010 and WCF RIA Services Released From SilverlightCream.com: Silverlight Tip of the Day #23 – Working with Strokes and Shapes Mike Snow's Silverlight Tip of the Day number 23 is up and about Strokes and Shapes -- as in dotted and dashed lines. New Silverlight Video Tutorial: How to Fire a Visual State based upon the value of a Boolean Variable Victor Gaudioso's latest video tutorial is up and is on selecting and firing a video state based on a boolean... project included. Simultaneously calling multiple methods on a WCF service from silverlight Ola Karlsson details a problem he had where he was calling multiple WCF services to pull all his data and had problems... turns out it was a blocking call and he found the solution in the forums and details it all out for us... actually, a search at SilverlightCream.com would have found one of the better posts listed once you knew the problem :) Securing Your Silverlight Applications Josh Twist has an article in MSDN on Silverlight Security. He talks about Windows, forms, and .NET authorization then WCF, WCF Data, cross domain and XAP files. He also has some good external links. Template/View selection with MEF in Silverlight Josh Twist points out that this next article is just a simple demonstration, but he's discussing, and provides code for, a MEF-driven ViewModel navigation scheme with animation on the navigation. Workaround for accessing some ASMX services from Silverlight 4 Are you having problems hitting you asmx web service with Silverlight 4? Yeah... others are too! Yavor Georgiev at the Silverlight Web Services Team blog has a post up about it... why it's a sometimes problem and a workaround for it. Using Silverlight 4 features to create a Zune-like context menu Jeff Wilcox used Silverlight 4 and the Toolkit to create some samples of menus, then demonstrates a duplication of the Zune menu. You Already Are A Windows Phone 7 Programmer Jesse Liberty is demonstrating the fact that Silverlight developers are WP7 developers by creating a Silverlight and a WP7 app side by side using the same code... this is a closer look at the Silverlight TV presentation he did. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • MSDN Magazine May Issue is Live

    Editor's Note: This Way-Cool 'Internet' Doohickey It wasn't all that long ago that surfing meant grabbing a board and hanging 10. Keith Ward Silverlight Security: Securing Your Silverlight Applications Josh Twist explains the unique challenges developers face in securing Silverlight applications. He shows where to focus your efforts, concentrating on the key aspects of authentication and authorization. Josh Twist Now Playing: Building Custom Players with the Silverlight Media Framework...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Macs don't connect to wifi access point but PCs will

    - by Josh
    So, as a side project I'm going to try and figure out why the wifi APs in my building exhibit the following behavior: - They typically allow all types of computers to connect without issues - Sometimes Apples can't get an IP address but will still connect to the AP's signal - Less often, PCs can't connect to the wifi (same as above - yes signal, no IP addy) - Don't let Raiders fans on no matter the time of day! My first thought was that the DHCP leases were all taken up when the Apples would try to connect, and it was just their unlucky timing, but I would then try to log on with a PC that had a new, unleased MAC address and it would work... Could this be something to do with interoperability between an apple wifi card, and the APs? Different parts of the DHCP lease being taken up first? The fact that the Seattle Mariners might actually be good this year?? If this hasn't used up everyone's patience (with my crappy sports jokes), something else I could use some help with: - We don't have the model or type of AP - This is because there is no documentation available for them, and they literally look like small white boxes with no writing on them. Also, the company that installed them is out of business, so the situation might be that no docs will ever be on the way. -- Do you guys have any ideas on how to figure out what we have? Thanks as always for all the help, and I'm looking forward to the day when I know enough to start contributing back to the site, Josh

    Read the article

  • SOAP PHP Parsing Error?

    - by Josh
    I'm communicating with a SOAP service created with EJB -- it intermittently fails, and I've found a case where I can reliably reproduce. I'm getting a funky ass SOAP fault that says "looks like we got not XML," however, when retrieving the last response I get what is listed below (and what looks like valid XML to me). Any thoughts? Soap Fault: object(SoapFault)#2 (9) { ["message:protected"]=> string(33) "looks like we got no XML document" ["string:private"]=> string(0) "" ["code:protected"]=> int(0) ["file:protected"]=> string(40) "/Users/josh/Sites/blahblahblah/test-update.php" ["line:protected"]=> int(26) ["trace:private"]=> array(2) { [0]=> array(4) { ["function"]=> string(6) "__call" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(24) "UpdateApplicationProfile" [1]=> array(1) { [0]=> array(2) { ["suid"]=> string(36) "62eb56ee-45de-4971-9234-54d72bbcd0e4" ["appid"]=> string(36) "6be2f269-4ddc-48af-9d47-30b7cf3d0499" } } } } [1]=> array(6) { ["file"]=> string(40) "/Users/josh/Sites/blahblahblah/test-update.php" ["line"]=> int(26) ["function"]=> string(24) "UpdateApplicationProfile" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> array(2) { ["suid"]=> string(36) "62eb56ee-45de-4971-9234-54d72bbcd0e4" ["appid"]=> string(36) "6be2f269-4ddc-48af-9d47-30b7cf3d0499" } } } } ["faultstring"]=> string(33) "looks like we got no XML document" ["faultcode"]=> string(6) "Client" ["faultcodens"]=> string(41) "http://schemas.xmlsoap.org/soap/envelope/" } And the actual raw XML response using client-__getLastResponse(): <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header> </env:Header> <env:Body> <ns2:UpdateApplicationProfileResponse xmlns:ns2="blahblahblah"> <paramname>status</paramname> <paramname>location</paramname> <paramname>timezone</paramname> <paramname>homepage</paramname> <paramname>nickname</paramname> <paramname>firstName</paramname> <paramname>languages</paramname> <paramname>color</paramname> <paramname>lastName</paramname> <paramname>gender</paramname> <paramvalue></paramvalue> <paramvalue></paramvalue> <paramvalue></paramvalue> <paramvalue></paramvalue> <paramvalue>XXX XXX</paramvalue> <paramvalue>XXX</paramvalue> <paramvalue></paramvalue> <paramvalue>CA0008</paramvalue> <paramvalue>XXX</paramvalue> <paramvalue></paramvalue> </ns2:UpdateApplicationProfileResponse> </env:Body> </env:Envelope>

    Read the article

  • Is make -j distcc possible to scale over 5 times?

    - by holmes
    Since distcc cannot keep states and just possible to send jobs and headers and let those servers to use only the data just sent and preprocess and compile, I think the lastest distcc has problem in scalability. In my local build environment which has appx. 10,000 c/c++ files to build, I could only make 2 times faster than not using distcc (but using make -j) when having 20 build servers. What do you think is the problem? If anyone has achieved scalability more than 10 - 20 times using make -j and distcc, please let me know. The following product claims that it is impossible to scale make -j and distcc faster than 5 times. http://www.electric-cloud.com/products/electricaccelerator.php I think this can be improved by: Letting the distccd server to maintain sessions Tied to those sessions, they will cache their own header directories Preprocess will be done demand base from the distccd server This will be done through a LD_PRELOADed library libdistcc.so which will replace stat/open syscalls and fetches the header files over network. ... Has anyone done this kind of thing?

    Read the article

  • During suite tests EasyMock says 0 matchers expected 1 recorded

    - by holmes
    So I've been using EasyMock's class extension for a while now. All of a sudden I'm getting this exception, but only when I run the entire test suite: java.lang.IllegalStateException: 0 matchers expected, 1 recorded. at org.easymock.internal.ExpectedInvocation.createMissingMatchers(ExpectedInvocation.java:42) at org.easymock.internal.ExpectedInvocation.<init>(ExpectedInvocation.java:34) at org.easymock.internal.ExpectedInvocation.<init>(ExpectedInvocation.java:26) at org.easymock.internal.RecordState.invoke(RecordState.java:64) at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:24) at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:56) at org.easymock.classextension.internal.ClassProxyFactory$1.intercept(ClassProxyFactory.java:74) at com.protrade.soccersim.data.emulator.matrix.PositionCategoryMatrix$$EnhancerByCGLIB$$c5298a7.getPossession(<generated>) at com.protrade.soccersim.data.emulator.stats.team.PossessionCalculatorUnitTest.testDeterminePossessionHomeWin(PossessionCalculatorUnitTest.java:45) The code involved is this little beauty (trimmed a bit): @Before public void setUp() throws Exception { homeTeam = createMock( PositionCategoryMatrix.class ); awayTeam = createMock( PositionCategoryMatrix.class ); ... } @Test public void testDeterminePossessionHomeWin() { expect(homeTeam.getPossession()).andReturn( 0.15151515 ); expect(awayTeam.getPossession()).andReturn( 0.01515152 ); replay( homeTeam, awayTeam ); ... } The exception is being thrown on the first expect. And it really doesn't make sense. It says it's getting a matcher, but the method doesn't even take an argument. And odd enough it's only during test suites! I'm creating a new mock in the @Before, so it shouldn't be inheriting anything from somewhere else (not that some other method would have a matcher on it) So, any ideas?

    Read the article

  • Django + jQuery: Sometimes AJAX, but always DRY?

    - by Justin Myles Holmes
    Let's say I have an app (in Django) for which I want to sometimes (but not always) load content via ajax. An easy example is logging in. When the user logs in, I don't want to refresh the page, just change things around. Yet, if they are already logged in, and then arrive at (or refresh) the same page, I want it to show the same content. So, in the first case, obviously I do some sort of ajax login and load changes to the page accordingly. Easy enough. But what about in the second case? Do I go back through and add {% if user.authenticated %} all over the place? This seems cold, dark, and WET. On the other hand, I can just wrap all the ajaxy stuff in a javascript function, called loggedIn(), and run that if the user is authenticated. But then I'm faced with two http requests instead of one. Also undesirable. So what's the standard solution here?

    Read the article

  • How do I determine if a packet is RTP/RTCP?

    - by Chris Holmes
    I am using SharpPCap which is built on WinPCap to capture UDP traffic. My end goal is to capture the audio data from H.323 and save those phone conversations as WAV files. But first thing is first - I need to figure out what my UDP packets are crossing the NIC. SharpPCap provides a UdpPacket class that gives me access to the PayloadData of the message. But I am unsure what do with this data. It's a Byte[] array and I don't know how to go about determining if it's an RTP or RTCP packet. I've Googled this topic but there isn't much out there. Any help is appreciated.

    Read the article

  • How does one capture H.323 voice traffic on a VOIP network?

    - by Chris Holmes
    What I am trying to do is capture the WAV data of a phone conversation on a VOIP network using SharpPCap/PCap.Net. We are using the H.323 recommendation and my understanding is that voice data is located in the RTP packets. However, there is no way to heuristically determine if a UDP packet is a RTP packet, so we have to do more work before we can capture the data. The H.323 recommendation apparently uses a lot of traffic on specific TCP ports to negotiate the call before the WAV data is sent via RTP. However, I am having very little luck determining what data is actually sent on those TCP ports, when it is sent, what the packets look like, how to handle it, etc. If anyone has any information on how to go about this I'd really appreciate it. My Google-Fu seems to be failing me on this one.

    Read the article

  • LINQ to SQL: On load processing of lazy loaded associations

    - by Matt Holmes
    If I have an object that lazy loads an association with very large objects, is there a way I can do processing at the time the lazy load occurs? I thought I could use AssociateWith or LoadWith from DataLoadOptions, but there are very, very specific restrictions on what you can do in those. Basically I need to be notified when an EntitySet< decides it's time to load the associated object, so I can catch that event and do some processing on the loaded object. I don't want to simply walk through the EntitySet when I load the parent object, because that will force all the lazy loaded items to load (defeating the purpose of lazy loading entirely).

    Read the article

  • Why is generated XAML spitting out namespaces that are not asked for?

    - by Matt Holmes
    I have a very simple XAML form, that has one namespace definition. For some reason, when Visual Studio processes that XAML file in to it's component .g.cs, it's sticking a bunch of namespace definitions at the top that I have not asked for in the XAML, or the code behind, and they are namespaces that no longer exist in my project. Thus the project is failing to compile. Why is Visual Studio sticking arbitrary namespace 'using' statements in my generated XAML .g.cs files? It's caused my entire project to break. Not one time did this .xaml file ever reference the namespaces in question, so it's doubly annoying.

    Read the article

  • <div> that only scrolls horizontally?

    - by holmes
    How can I create a element that only scrolls horizontally? If it makes sense, I want the element to act like it is position:fixed when the user scrolls vertically down the page, but act like it's position:static for sideways scrolling. HTML/CSS solutions preferred, but if it isnt' feasible, JavaScript fixes are fine.

    Read the article

  • jQuery .closest returns undefined

    - by Andy Holmes
    I've got the code below which works fine, however the jquery to add the items doesnt find the data-parent-room value and just returns undefined. This is the only thing not working :( HTML: <div id="inventoryRooms"> <!--BOX SHART--> <div class="widget box formHolder" data-parent-room="1"> <!--ROOM NAME--> <form class="widget-header rooms"> <input type="text" placeholder="Type Room name" name="roomName[]" class="form-input add-room-input input-width-xxlarge"> <input type="hidden" class="roomId" name="roomId[]"> <input type="hidden" class="inventoryId" name="inventoryId[]" value="<?=$_GET['inventory_id']?>"> <div class="toolbar no-padding"> <div class="btn-group"> <span class="btn saveRoom"><i class="icon-ok"></i> Save Room</span> </div> </div> </form> <!--/END--> <!--GENERIC ROW TITLES--> <div class="widget-header header-margin hide"> <div class="row row-title"> <div class="col-md-3"><h5>ITEM</h5></div> <div class="col-md-3"><h5>DESCRIPTION</h5></div> <div class="col-md-3"><h5>CONDITION</h5></div> <div class="col-md-2"><h5>PHOTOGRAPH</h5></div> <div class="col-md-1 align-center"><h5><i class="icon-cog"> </i></h5></div> </div> </div> <!--/END--> <!--ADD ITEM--> <div class="items"> </div> <!--/END--> <div class="toolbar-small"> <div class="btn-group"> <span class="btn addItem"><i class="icon-plus"></i> Add Item</span> <span data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-gear"></i> Options<span class="button-space"></span><i class="icon-angle-down"></i></span> <ul class="dropdown-menu pull-right"> <li><a href="#"><i class="icon-trash"></i> Delete Room</a></li> </ul> </div> </div> </div> </div> jQuery: $(document).on('click','.addItem', function(){ $('<!--ROW START-->\ <form class="widget-content item">\ <div class="row">\ <div class="col-md-3"><input type="text" class="form-control" name="itemName[]"></div>\ <div class="col-md-3"><textarea class="auto form-control" name="itemDescription[]" cols="20" rows="1" style="word-wrap: break-word; resize: vertical;"></textarea></div>\ <div class="col-md-3"><textarea class="auto form-control" name="itemCondition[]" cols="20" rows="1" style="word-wrap: break-word; resize: vertical;"></textarea></div>\ <input type="hidden" class="itemId" name="itemId[]" value="">\ <input type="hidden" name="itemInventoryId[]" value="<?=$_GET["inventory_id"]?>">\ <input type="hidden" name="itemParent[]" value="'+$(this).closest().attr('data-parent-room')+'">\ <div class="col-md-2">\ <div class="fileinput-holder input-group">\ <input id="fileupload" type="file" name="files[]" data-url="uploads/">\ </div>\ </div>\ <div class="col-md-1 align-center"><i class="save icon-ok large"> </i>&nbsp;&nbsp;&nbsp;<i class="delete icon-trash large"> </i></div>\ </div>\ </form>\ <!--/ROW END-->').fadeIn(500).appendTo($(this).parents().siblings('.items')); $(this).parent().parent().siblings('.widget-header, .header-margin, .hide').removeClass('hide').fadeIn(); }); Like i say, it all works fine apart from that damn data-parent-room value. Any help is appreciated! using jQuery 1.10.1

    Read the article

  • SASS color array

    - by Eric Holmes
    I am trying to write a loop that will cycle through colors and condense the amount of code in my scss file. Here is a simple example of what I have: $color1: blue; $color2: red; $color3: white; $color4: black; .color1-bg { background-color: $color1; } .color2-bg { background-color: $color2; } .color1-border { border-color: $color1; } .color2-border { border-color: $color2; } And so on. I am looking for a way to make the equivalent of a foreach loop, and cycle through an 'array' of colours by index. Something like this: @each $color in $color1, $color2, $color3, $color4 { .{$color}-bg { background-color: $color; .{$color}-border { border-color: $color; } I know the syntax is wrong, but that is my thinking process. Thanks for the help!

    Read the article

  • Threadpool with pasistant worker instances

    - by Matt Smokey-waters Holmes
    So basically what im trying to do is queue up tasks in a thread pool to be executed as soon as a worker becomes free, i have found various examples of this but in all cases the examples have been setup to use a new Worker instance for each job, i want persistent workers. Im trying to make a ftp backup tool, i have it working but because of the limitations of a single connection it is slow. What i ideally want to do is have a single connection for scanning directories and building up a file list then four workers to download said files. Here is an example of my worker /** * FTP Worker */ public class Worker implements Runnable { protected FTPClient _ftp; // Connection details protected String _host = ""; protected String _user = ""; protected String _pass = ""; // worker status protected boolean _working = false; public Worker(String host, String user, String pass) { this._host = host; this._user = user; this._pass = pass; } // Check if the worker is in use public boolean inUse() { return this._working; } @Override public void run() { this._ftp = new FTPClient(); this._connect(); } // Download a file from the ftp server public boolean download(String base, String path, String file) { this._working = true; boolean outcome = true; //create directory if not exists File pathDir = new File(base + path); if (!pathDir.exists()) { pathDir.mkdirs(); } //download file try { OutputStream output = new FileOutputStream(base + path + file); this._ftp.retrieveFile(file, output); output.close(); } catch (Exception e) { outcome = false; } finally { this._working = false; return outcome; } } // Connect to the server protected boolean _connect() { try { this._ftp.connect(this._host); this._ftp.login(this._user, this._pass); } catch (Exception e) { return false; } return this._ftp.isConnected(); } // Disconnect from the server protected void _disconnect() { try { this._ftp.disconnect(); } catch (Exception e) { /* do nothing */ } } } and basically i want to be able to call Worker.download(...) for each task in a queue whenever a worker becomes available without having to create a new connection to the ftp server for each download Any help would be appreciated as iv'e never used threads before and I'm going round in circles at the moment

    Read the article

  • Why can't I use __getattr__ with Django models?

    - by Joshmaker
    I've seen examples online of people using __getattr__ with Django models, but whenever I try I get errors. (Django 1.2.3) I don't have any problems when I am using __getattr__ on normal objects. For example: class Post(object): def __getattr__(self, name): return 42 Works just fine... >>> from blog.models import Post >>> p = Post() >>> p.random 42 Now when I try it with a Django model: from django.db import models class Post(models.Model): def __getattr__(self, name): return 42 And test it on on the interpreter: >>> from blog.models import Post >>> p = Post() ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (6, 0)) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /Users/josh/project/ in () /Users/josh/project/lib/python2.6/site-packages/django/db/models/base.pyc in init(self, *args, **kwargs) 338 if kwargs: 339 raise TypeError("'%s' is an invalid keyword argument for this function" % kwargs.keys()[0]) -- 340 signals.post_init.send(sender=self.class, instance=self) 341 342 def repr(self): /Users/josh/project/lib/python2.6/site-packages/django/dispatch/dispatcher.pyc in send(self, sender, **named) 160 161 for receiver in self._live_receivers(_make_id(sender)): -- 162 response = receiver(signal=self, sender=sender, **named) 163 responses.append((receiver, response)) 164 return responses /Users/josh/project/python2.6/site-packages/photologue/models.pyc in add_methods(sender, instance, signal, *args, **kwargs) 728 """ 729 if hasattr(instance, 'add_accessor_methods'): -- 730 instance.add_accessor_methods() 731 732 # connect the add_accessor_methods function to the post_init signal TypeError: 'int' object is not callable Can someone explain what is going on? EDIT: I may have been too abstract in the examples, here is some code that is closer to what I actually would use on the website: class Post(models.Model): title = models.CharField(max_length=255) slug = models.SlugField() date_published = models.DateTimeField() content = RichTextField('Content', blank=True, null=True) # Etc... Class CuratedPost(models.Model): post = models.ForeignKey('Post') position = models.PositiveSmallIntegerField() def __getattr__(self, name): ''' If the user tries to access a property of the CuratedPost, return the property of the Post instead... ''' return self.post.name # Etc... While I could create a property for each attribute of the Post class, that would lead to a lot of code duplication. Further more, that would mean anytime I add or edit a attribute of the Post class I would have to remember to make the same change to the CuratedPost class, which seems like a recipe for code rot.

    Read the article

  • mySQL auto increment problem: Duplicate entry '4294967295' for key 1

    - by Josh
    I have a table of emails. The last record in there for an auto increment id is 3780, which is a legit record. Any new record I now insert is being inserted right there. However, in my logs I have the occasional: Query FAIL: INSERT INTO mail.messages (timestamp_queue) VALUES (:time); Array ( [0] => 23000 [1] => 1062 [2] => Duplicate entry '4294967295' for key 1 ) Somehow, the autoincrement jumped up to the INT max of 4294967295 Why on god's green earth would this get jumped up so high? I have no inserts with an id field. The show status for that table, Auto_increment table now reads: 4294967296 How could something like this occur? I realize the id field should perhaps be a big int, but the worry I have is that somehow this thing jumps back up. Josh

    Read the article

  • PHP/MySQL database connection priority?

    - by Josh
    Hello, I have a production database where usage statistics for a service we're working on. I use php to periodically roll up different resolutions (day, week, month, year) of interesting statistics in buckets dictated by the resolution. The php application I've written "completes" its data when its run, such that it will calculate all the rolled-up statistics for the resolutions and periods since it was last run. This is useful if we want to turn this off to debug database performance issues, because I can turn it back on and have it complete its data set. The problem I have, is the calculations are fairly intensive and drive the QPS of the production database server up. Is there a way to set a "priority" on a particular database connection so that it will only use "off-cycles" to do these calculations? Maybe a proper response would be to replicate the tables I'm working on into a different stats database, but, unfortunately I don't have the resources in place to attempt such a thing (yet). Thanks in advance for any help, Josh

    Read the article

  • PHP - ADO recordsets

    - by Josh
    I am referencing a COM component from PHP. This COM component returns records using ADO. I am assuming I will need to reference ADO in PHP for this to function. How do I do this? Secondly (related to the first question) I have run accross ADODB abstraction libraries, however these seem to mostly deal with queries and handle the ADO internally. How do I get the returned ADO recordset into a PHP friendly array, and likewise pass in an ADO array to the COM object? Thank you, Josh

    Read the article

  • ORM in the realworld

    - by josh
    I am begining a new project that i think will last for some years. Am in the point of deciding the ORM framework to use (or whether to use one at all). Can anyone with experience tell me whether orm frameworks are used in realworld applications. The problem i have in mind is this: The orm tool will generate for me tables and columns etc as i create and modify my entities. However, after the project has gone live and is in production, certain database changes will not be possible. Can this hinder the advancement of the project. If i had used a framework like ibatis for example, i know i would only need to adjust the sql statements based on the database changes. Can someone tell me whether ORM tools have survived the live environment. At my office, we use java based ERP that was done long ago and it was never done using any ORM framework. Regards. Josh

    Read the article

  • ExpressionEngine: {exp:query} producing error

    - by Josh Brown
    Hi. I have this code in place to pull some relation data from the database based on a ID of another weblog entry. The relationship custom field would not work for my situation. I have tested the SQL with MySQL and get no errors. But I get an error when I pull up the page. {exp:query sql="SELECT entry_id,field_id_16,field_id_19 FROM exp_weblog_data WHERE field_id_15='2' AND weblog_id='6'"} Also, I want to populate the “field_id_15” from the url. I have tried using the “segment_*” tag, but nothing. Maybe it is something else. Any help is greatly appreciated. Thanks, Josh

    Read the article

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