Search Results

Search found 6524 results on 261 pages for 'the ever kid'.

Page 165/261 | < Previous Page | 161 162 163 164 165 166 167 168 169 170 171 172  | Next Page >

  • Can Django flush its database(s) between every unit test

    - by mikem
    Django (1.2 beta) will reset the database(s) between every test that runs, meaning each test runs on an empty DB. However, the database(s) are not flushed. One of the effects of flushing the database is the auto_increment counters are reset. Consider a test which pulls data out of the database by primary key: class ChangeLogTest(django.test.TestCase): def test_one(self): do_something_which_creates_two_log_entries() log = LogEntry.objects.get(id=1) assert_log_entry_correct(log) log = LogEntry.objects.get(id=2) assert_log_entry_correct(log) This will pass because only two log entries were ever created. However, if another test is added to ChangeLogTest and it happens to run before test_one, the primary keys of the log entries are no longer 1 and 2, they might be 2 and 3. Now test_one fails. This is actually a two part question: Is it possible to force ./manage.py test to flush the database between each test case? Since Django doesn't flush the DB between each test by default, maybe there is a good reason. Does anyone know?

    Read the article

  • Why do they initialize pointers this way?

    - by Rob
    In almost all of the books I read and examples I go through I see pointers initialized this way. Say that I have a class variable NSString *myString that I want to initialize. I will almost always see that done this way: -(id)init { if (self = [super init]) { NSString *tempString = [[NSString alloc] init]; myString = tempString; [tempString release]; } return self; } Why can't I just do the following? -(id)init { if (self = [super init]) { myString = [[NSString alloc] init]; } return self; } I don't see why the extra tempString is ever needed in the first place, but I could be missing something here with memory management. Is the way I want to do things acceptable or will it cause some kind of leak? I have read the Memory Management Guide on developer.apple.com and unless I am just missing something, I don't see the difference.

    Read the article

  • Subsonic: Select on a View, locks the table update?

    - by Jay
    Hi, I have a Web site live and running now. I am using the Subsonic to handle the database connections etc. I am getting time out expired error while updating a table (say Employee). When I check sp_who2, I see the suspended connection for the PID which is updating with a block by anothor pid, so I run the profiler and found out when ever this suspended connection occur, the blocked pid is a select statement on the view (say ActiveEmployees, which is the same as the table but with some where conditions). Anyone know why a Select statement on the view could cause failure in update. If it is other (like select fails due to update) may be reasonable. Is there any way for me to make select on a view without locking the table? PS: I am using the Sql server 2005 and subsonic 2.2. Thanks

    Read the article

  • Are these 2 sql queries equivalent in all respects (e.g. estimated and actual execution plan)?

    - by Xerion
    Are query 1) == 2) in terms of estimated query plan AND actual plan? (can statistics affect the actual plan here, ever?) declare @cat int -- input param from prc ... 1) select * from A as a join B as b on b.id = a.id on b.cat = @cat join C as c on c.fid = b.fid on c.cat = @cat where a.cat = @cat 2) select * from A as a join B as b on b.id = a.id on b.cat = a.cat join C as c on c.fid = b.fid on c.cat = b.cat where a.cat = @cat It seems to me that these should logically be equivalent and the execution plan should always be the same regardless of actual difference in tables. And adding more conditions either in join, or where, or add more tables to join shouldn't change this. Are there cases this is not true?

    Read the article

  • Confusion using MYSQLI

    - by user1020069
    I just started using mysqli API for PHP. Apparently, every time an object of the class MYSQLI is instantiated, it can setup a connection to the database as it connects to the server unlike mysql_connect, which connects to the server first and then you are required to specify the database to query. Now this is a good problem if the db exists, in my case, the db does not exist on the first ever connection to the server/execution of the problem, hence I must connect without specifying the database, which is fine, since the msyqli constructor does not make this database mandatory. My challenge is essentially, how do I check if the database exists before attempting the first connection. The only way to really do this would be to establish a conection to the server and then use the result of the following query to gauge if the database exists: SELECT COUNT(*) AS `exists` FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMATA.SCHEMA_NAME="dbname" ; If this returns true, then the database exists, but now the challenge is how do I get the mysqli object to query this database rather than having to prefix the name of the database in the query. Thanks much

    Read the article

  • Is there kind of runtime C++ assembler library around?

    - by Anton
    Hi guys! For my small hobby project I need to emit machine code from C++ program in runtime. I have base address 0xDEADBEEF and want to write something like this: Assembler a((void*)0xDEADBEEF); a.Emit() << Push(Reg::Eax) << Push(Reg::Ebx) << Jmp(0xFEFEFEFE); Inline assembler isn't my choice because generated machine code is dependent of the program state. Does anybody know any existing library for doing this? If no, would it be a good idea to develop one from scratch and make it open source? (I mean, will anybody ever use this library if it existed?)

    Read the article

  • Normal Priority Builds Will Not Build in TFS 2010

    - by 37Stars
    I have two build processes setup in TFS 2010. One build starts when any developer checks code into TFS. The second build runs every night at 12:30am. I can see the builds have a priority of Normal in the queue. However no queued build ever is run until I change the priority to high. They will sit in the queue forever until the priority is changed. It appears there is a normal priority build in the queue that is stuck. However I cannot find it. I can select , , and and not see anything but these builds queued up. I can run them all and the next day I have queued builds again. I say this because I see the Build Service is configured for port 9192, which leads me to believe there is or was another Build Service on port 9191. Any idea how to resolve this issue? Thanks

    Read the article

  • iOS Downloading Videos and saving in Application Support folder

    - by Satyam svv
    In my application, i've to download videos around 10 to my application and play accordingly. Each video is around 50 MB. I'm using following code and then after downloading the video, i'm saving it to Application support folder to avoid icloud sync. But the problem is that when downloading the videos its crashing. [NSURLConnection sendAsynchronousRequest:req queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *rcvdDat, NSError * err) { . . . } What I'm thinking is that, while downloading the video, it resides in memory and so the total memory occupying by the app is increasing. Finally iOS is making the app to close. I would like to download the video and when ever a stream of data received, write to temp file and when completes move it to application support folder. Can some one help me on how to write it to file and save it at the end? I cannot use 3rd party libraries (unless its small) due to legal issues.

    Read the article

  • MySQL SELECT WHERE returning empty with long numbers, although they are there

    - by brybam
    Alright, so basically the most simple query ever... I've done this a million times... SELECT * FROM purchased_items WHERE uid = '$uid' if $uid == 123 It works fine and returns all data in rows where uid is 123 if $uid == 351565051447743 It returns empty... I'm positive 351565051447743 is a possible uid in some rows, i literally copied and pasted it into the table. $uid is a string, and is being passed as a string. This is something i've done a million times, and i've never had this simple query not work. Any ideas why this is not working?

    Read the article

  • C++ Types Impossible to Name

    - by Kirakun
    While reading Wikipedia's page on decltype, I was curious about the statement, Its [decltype's] primary intended use is in generic programming, where it is often difficult, or even impossible, to name types that depend on template parameters. While I can understand the difficulty part of that statement, what is an example where there is a need to name a type that cannot be named under C++03? EDIT: My point is that since everything in C++ has a declaration of types. Why would there ever be a case where it is impossible to name a type? Furthermore, aren't trait classes designed to yield type informations? Could trait classes be an alternative to decltype?

    Read the article

  • Major inconsistencies in Zend Framework

    - by John Nall
    Okay first of all let me just say Zend Framework is the greatest tool I have ever used in 30+ years of programming (well, for web development, Qt wins the desktop market). However, through my use I have noticed some glaring and annoying inconsistencies. For instance, Zend_Form_Element's have a setAttrib() method. Now why the hell is this the only method in that API which is abbrev.? Why then am I using setRequired() instead of setReq()? I have more examples, I am extremely nerd raged about this. It is completely ruining what could have been God's gift to web development. FOR FUTURE REFERENCE NEVER ABBREV. THINGS WHEN MAKING AN API. also always filter data before storing it i m o Who do we talk to about this, where something will actually get done about it?

    Read the article

  • What is the use of commit messages?

    - by eteubert
    Hi folks, I struggled asking that question but here it is. I am using source control since several years for multiple projects using different systems (svn, hg, git) and I learned how to improve my messages by following guidelines etc. But as far as I can remember I never ever had a look at them afterwards. So ... how do you profit from your own commit messages? When I need to go back because I smashed something and need a fresh start, I usually just go back to the latest "node" (where I started or merged a branch). Do I write those messages just for people monitoring the project who are curious what is going on? Regards

    Read the article

  • Secure C# Assemblies from unauthorized Callers

    - by Creepy Gnome
    Is there any way to secure your assembly down to the class/property & class/method level to prevent the using/calling of them from another assembly that isn't signed by our company? I would like to do this without any requirements on strong naming (like using StrongNameIdentityPermission) and stick with how an assembly is signed. I really do not want to resort to using the InternalsVisibleTo attribute as that is not maintainable in a ever changing software ecosystem. For example: Scenario One Foo.dll is signed by my company and Bar.dll is not signed at all. Foo has Class A Bar has Class B Class A has public method GetSomething() Class B tries to call Foo.A.GetSomething() and is rejected Rejected can be an exception or being ignored in someway Scenario Two Foo.dll is signed by my company and Moo.dll is also signed by my company. Foo has Class A Moo has Class C Class A has public method GetSomething() Class C tries to call Foo.A.GetSomething() and is not rejected

    Read the article

  • Can someone help me understand why this is happening?

    - by Juan Manuel Formoso
    I just run into the weirdest thing I've ever encounter. Consider this test page: <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <script language=javascript> function test(myParameter) { alert(myParameter); } </script> </head> <body> <input type="button" value="Strange" onclick="javascript: test(044024);" /> <input type="button" value="Ok" onclick="javascript: test('044024');" /> </body> </html> If I click the "strange" button, I get 18452, if I click the "ok" button I get 044024 Does anyone know what is happening and explain it to me?

    Read the article

  • How to design model for multi-tiered data?

    - by Chris
    Say I have three types of object: Area, Subarea and Topic. I want to be able to display an Area, which is just a list of Subareas and the Topics contained in those Subareas. I never want to be able to display Subareas separately - they're just for breaking up the Topics. Topics can, however, appear in multiple Areas (but probably under the same Subarea). How would I design a model for this? I could use ForeignKey from Topic to Subarea and from Subarea to Area, but it seems unnecessarily complex given that I never want to interact with subareas themselves. Also, none of these objects are ever altered or added to by the user. They're just for me to represent information. Maybe there is a better way to represent it all?

    Read the article

  • How can I declare a pointer structure using {}?

    - by Y_Y
    This probably is one of the easiest question ever in C programming language... I have the following code: typedef struct node { int data; struct node * after; struct node * before; }node; struct node head = {10,&head,&head}; Is there a way I can make head to be *head [make it a pointer] and still have the availability to use '{ }' [{10,&head,&head}] to declare an instance of head and still leave it out in the global scope? For example: //not legal!!! struct node *head = {10,&head,&head};

    Read the article

  • Question About NerdDinner Controller Constructors

    - by Gavin Draper
    I've been looking at the Nerd Dinner app, more specifically how it handles its unit tests. The following constructors for the RSVPController are confusing my slightly public RSVPController() : this(new DinnerRepository()) { } public RSVPController(IDinnerRepository repository) { dinnerRepository = repository; } From what I can tell the second one is used by the unit tests so it can use Fake repositories. What I cant work out is what the first constructor does. It doesn't seem to ever set the dinnerRepository variable, it seems to imply its inheriting from something but I really don't get it. Can anyone explain? Thanks

    Read the article

  • ASP/HTML problem with spaces and monofonts

    - by nickik
    I have a ASP has a Function that converts ä to &auml so far so good. I have lets say space for 10 char's if there are more cut them of if there are less fill the space up with &nbsp's. . Like this: test &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp but if i say "täst" it does this: te &auml t &nbsp It interprets the &auml not as one char it looks at it as 6 chars. Is there a clever way around that? This problem messes up my design because I need the right count of spaces. The whole thing goes into a big select box. Of you have to add a ; at the end of ever &... I could add them because the Editor would really interprt them.

    Read the article

  • Problem with displaying my Image..

    - by Josh
    Here is my full problem so if anyone has any ideas or can offer some help, please let me know. I have a Website that will generate a Report and this Report takes some time to create. There is a MyReport.ASPX file that has a form1, Image1, and a ReportViewer control. There is also a MyReport.cs file that has C# code to generated a HTMLText string that the ReportViewer control will display. When I pull the Website up in the browser, the MyReport.cs file creates the Report before MyReport.ASPX ever gets called so my Image1 (which I need to display while the Report is being created) never gets displayed until AFTER the Report is created and displayed. What do you suggest I do here? If I did not supply enough information, please let me know what else you need to know and I will gladly post it. Thanks,

    Read the article

  • SVN files edited thru FTP, How do I fix the edited files so they work thru SVN again?

    - by Bobby
    Basically, a 3rd party analyst we brought on to make some improvements to our site decided to edit files directly on the live server threw FTP. Any time we make changes to those pages threw SVN we have PHP parse errors. Things should be edited threw the SVN and committed. We have our working copies setup so we can edit them how ever we want while having them running under apache for testing. We commit all of our changes to a local repository, then commit from there to the live server. The code on the live server that causes the parse error has " .mine" and " .rxxxx", and my question is, how can I revert those files back to before they were edited thru FTP so I can update them threw SVN again?

    Read the article

  • how can an application use port 80/HTTP without conflicting with browsers?

    - by John
    If I understand right, applications sometimes use HTTP to send messages, since using other ports is liable to cause firewall problems. But how does that work without conflicting with other applications such as web-browsers? In fact how do multiple browsers running at once not conflict? Do they all monitor the port and get notified... can you share a port in this way? I have a feeling this is a dumb question, but not something I ever thought of before, and in other cases I've seen problems when 2 apps are configured to use the same port.

    Read the article

  • Rails model to represent multiple fields

    - by Tristan O'Neil
    I'm developing a rails project where I have one data model with multiple fields that are collection selects. I'd like to create another model to represent all of these collection select fields. So, for instance, my main data model has three collection select fields -- one for county, one for category, and one for classification. I could separate these into three separate data models, but that seems redundant since they all share the same characteristics. They have a type and a value, like a county is a county and it has a value of let's say Sonoma, just as category has a type of category and a value of let's say Winery. If you've ever used Drupal, I'm basically looking for the behavior of the taxonomy functionality. So you see my dilemma: I need to separate these fields into three separate fields but they have very similar data structures. Any suggestions would be greatly appreciated.

    Read the article

  • FKs on all tables for status colunm

    - by Jonarch
    I have a colunm "Status" in every table in my DB. The purpose of it is to show if the given row is in use or if it has been deactivated. So values can be (0=deactive and 1= active). Two ways I see this: I can have enums or I am thinking if it is better to keep this colunm as a FK which references the main system data dictionary table which has all the codes used on the system. (website) The benefit is every table, every row can then be centralized through this FK. So if i ever want to check all rows which are deactive on my system i can from this table as all th child tables will have like status = ID 233, where 233 = deactive in the data dictionary table. Any benefit or should i stick with the old way of enums?. Also I am thinking if i need one more status for deleted or is that same as deactivated?

    Read the article

  • Are there any good reasons why I should not use Python?

    - by coppro
    I've heard from reliable sources that Python is a great language that every programmer can learn, but I've heard so much good about it that I'm clearly not getting the whole picture. I'm considering spending more time to learn it, and I've heard more than I need about its virtues (to the point where I've started recommending it having never really used it), so I want to know its drawbacks, flaws, issues, and every single minor point of irritation you've ever had (preferably with explanations readable to one who doesn't program Python, such as with an example in another language). Convince me not to try it out.

    Read the article

  • Storing tree data in Javascript

    - by Ozh
    I need to store data to represent this: Water + Fire = Steam Water + Earth = Mud Mud + Fire = Rock The goal is the following: I have draggable HTML divs, and when <div id="Fire"> and <div id="Mud"> overlap, I add <div id="Rock"> to the screen. Ever played Alchemy on iPhone or Android? Same stuff Right now, the way I'm doing this is a JS object : var stuff = { 'Steam' : { needs: [ 'Water', 'Fire'] }, 'Mud' : { needs: [ 'Water', 'Earth'] }, 'Rock' : { needs: [ 'Mud', 'Fire'] }, // etc... }; and every time a div overlaps with another one, I traverse the object keys and check the 'needs' array. I can deal with that structure but I was wondering if I could do any better? Edit: I should add that I also need to store a few other things, like a short description or an icon name. So typicall I have Steam: { needs: [ array ], desc: "short desc", icon:"steam.png"},

    Read the article

< Previous Page | 161 162 163 164 165 166 167 168 169 170 171 172  | Next Page >