Posts

postgresql - Kill all database connections on heroku when max connections have been reached -

My example has a maximum of 16 connections. As soon as I realized that I had the 19 connection, I used to hurry to kill one, who goes out to open a standard connection with the same priority and boundaries. I have now reached the absolute maximum number of connections, which is 20 , and even pg: ps or Pg: killall can not. How can I destroy all the connections, or do anything to reduce the number of connections now? The blocked query is too long (looks like select * from the table containing 410k entries). $ heroku pg: info -a XYZ === HEROKU_POSTGRESQL_COBALT_URL (DATABASE_URL) Plan: Original Status: Available Connection: 19 PG Version: 9.1.11 Created: 2013-03-12 15: 11 UTC data size: 7.16 GB Tables: 103 Fork / Follow: Unsupported rollback: unsupported $ Heroco PG: PS-A XYZ Prop. Source | Is running for Wait | (...) $ heroku pg: kill 12593- one XYZ pg_cancel_backend ------------------- T (1 line) $ heroku pg: ps -a XYZ psql: FATAL : Too many connections to role ...

In Google App Engine Datastore, to what extent does using parent keys hurt performace? -

I have two models that are naturally present in parent's relationship. Unique in terms of, but not universally necessary, and whenever I want to ask a specific child, the ID will be available for both my parents and children. I can implement these two methods. Generate the string "", "child_id", "child_id>" to each child unit's datestore key name, and join the process and partition id id. Use the parent key. Option 2 sounds like a clear winner from the code scenario, but hurts the performance on writing? If I never use the transaction, then is it still overwritten by the same parents to write different children concurrently? Is Datastore quite understandable that if I do two transactions in the same unit group which can not affect each other, then both should still be implemented? Or if the locking is not necessary then should not the keys of the parents be left? For transactions, you can not concurrently write multiple ...

bitmap - How do I get string representation of jpeg EXIF tags in c#? -

Using bitmap class, you can enumerate and edit EXIF ​​tags, there are lots of examples. one: bitmap bjpgWithExifData = (bitmap) Image.FromFile (@ "myfile.jpg"); Foreign currency (var items in bjpgWithExifData.PropertyItems) {Console.WriteLine ("{0} \ t {1} \ t {2}", item type, item.Id, item.Len); } However, it does not explain how I get the string value of those tags. The data is binary, and when I try to decode it with the encoding .ASCII.GetString (item.Value) , I get some junk instead of the appropriate properties. How do I get string values? UPDATE Aksaif shown by JPIFSnoop tag here: EXIF ​​IFD0 @ absolute 0x00000014 Dir length = 0x0010 [model] = "GT-I9500" [orientation] = row 0: top, Colonel 0: left [White Balance] = Auto White Balance [Dettaim] = "2014: 07: 30 13:24:28" # "[make] =" Samsung "[Aksaifofset] = @ 0x010 Sifrf offset IFD = 0x00000000 to when enumerate C # properties, I have 18 different l...

objective c - Does accessing a property on an NSManagedObject from a background thread make the context cross that thread? -

I need to use a property in the background running method as a custom on my NSManagedObjectContext. After being told, I have problems after that reference, even if whatever I did, the value of the property was received. to: Manipulate managed objects at any time To access, you use the associated managed object context. Core data does not present a situation where reads are "safe" but changes are "dangerous" - each operation is "dangerous" because each operation has a cash cuisine effect and can trigger a faulting. i is working with core data in multi-threaded app for a while (in the pre-iOS 5 era, without parent references). I suspect it has some threading magic (locks and stuff) under the hood. If you want to be 100% safe, you can not call any method to NSManagedObject in the background thread, if its NSManagedObjectContext is not built on the same thread Otherwise, there may be undefined behavior (for example, I get some deadlocks) ...

java - Serving Compiled Scripts on Webserver -

I have a webserver that runs Apache http webserver and it works fine. I can view and download files I put in the htdocs folder through a web browser. What do I want to be able to write java code in my IDE (using IntelliJ IDEA) and when I compile my project, I want to download updated compiled class files To be available on your webserver. Currently I am using PHP script to download files from my project directory, but I want to change this so that the URL points to the actual file and has a class extension in it. I need to do this because I am planning to load classes using a Classloader in the future. Whenever I compile, I do not want to manually copy files from my project folder. I have thought of some ways to do this but they are not ideal: I can use some programs that sync files between two folders And the class files in my project folder are synced in the htdocs folder. I really do not want to rely on any other program and it seems to be wrong to do this. Create vi...

c++ - Pointing a derived smart pointer to a stack object returned by base reference -

I have a problem. I want to point to those objects that are stored in the class. I code has one holder. The getSomething () function that gives context to a base, I want to put that derived B_PRR here is the code: #include & lt; Memory & gt; using namespace std; Class A {Public: int a; A (): A (0) {} Virtual ~ A () {}}; Class B: Public A {public: bool; B (): a () {b = false; }}; Class holder {public: B ARE [1]; // It has a referee, no b, because I will load a bottle of derivative. & Amp; GetSomething () {Return arr [0]; } Holder () {arr [0] = B (); }}; Int main () {Holder H; Shared_ptr & lt; P & gt; B_ptr; //b_ptr = some_lines_Here (h.getSomething ()); Return 0; }; I know (and "know" I mean I have an uneducated guess) that I should use dynamic_ (pointer _?) Cast, but I know the correct syntax address You can not know / can not know the full point of a shared pointer is that its referee is counting and destroying - which tells it when the last cha...

sprite kit - Objective-C SpriteKit: What is the relation between values set in CGVector and actual International System of Units (SI)? -

The Apple Developer Guide, it says: Sprite Kit International System of Units , Which is also called SI or Meter-kilogram-second system. Where necessary, you may need to consult other reference material to learn more about the physics equations used by . I am developing a small game in which the user touches their screen. Code - (SKSpriteNode *) createBat: to the main menu, I want to keep flying over your bat up and down, I like to describe the harmonic oscillation ) Scale {SKSpriteNode * bat = [SKSpriteNode spriteNodeWithImageNamed: @ "bat_01"]; Bat.xScale = Scale; Bat.yScale = Scale; Bat.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize: bat.size]; Returning bat; } - (SKAction *) Action Squiwings {Returns [Sacking Runblock: ^ {[Self. Player.FixicsBody SetVeloCity: CGVectorMake (0.0 F, 450.0F)]; }]; } - (float) Taimtaurtain to Aenishiyl Pojisnafetrjmp {/ * code to spare characters original code to adopt = a, gravity / 2, B = Int Speed ​​= 450.0 & amp; Wit...