Posts

Showing posts from January, 2013

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...

ios - UIWindow in Xcode 6 templates -

I have a simple question, why is the main (and only UI window) on all Apple templates in Excel, instead of Var Let's go. var window: UIWindow? As I understand, we should use it wherever possible, and especially where this matter will not change. Even with the use of commodities, you still have your qualities (frames etc.). I have some difficulty using the object (class type) to go with. I assumed something like CLLocationManager and UIWindow would be the perfect example of using when to use objects, but the applet in their code Do not use to go. property with keyword properties defined by the time the object is started The window is not created during the initial time, so it can not be a walk. This is the only condition for viewers controlling - outlets, or indeed any of the visual properties, because they are not initially present, but when the scene is required, then Is created later. let properties really do not work well to see UIKit and contro...

vim - How can I get quickfix to open results in the previously focused window? -

I have written the following command to search help for VIM: command! -n = 1 -complete = Help SearchHelp \ help | Executed "grep! -i $ VIMRUNTIME / doc / -r" | For example, when I forget the key to increase the number under the cursor, I can: : SearchHel increment help To answer searches through files (Answer Done.) The problem is ... I have some windows open, And I want quickfix to leave them immediately. When I & lt; Enter & gt; Hit in the Quickfix list, I want it to open Open Results in that Help window , which I open at the beginning of the command. But it does not do this. It seems that it is always preferred to open the bottom result of all of its edits window, regardless of the window I have been focusing on, and with the complete indifference of the help window I opened it clearly Anything done for editing in the file is deleted (yes, I have : hidden ), in which & lt; Ctrl-O & gt; A arbitrary number of keys is required Then h...

javascript - Save series chart type for later use -

This high charts may be more than a scope question than the question. I have a function that changes the chart, please see below: function ChangeChartType (chart, Nyaprkar) {newType = newType.toLowerCase (); Var number series = char. Series.length; Var i = 0; If {newType == 'reset'} {for (i; i & lt; numberofseries; i ++) {if (chart type .eries [i] .defaulttype == 'string') {chart.series [i]. Update ({type: chart. Series [i] .defaulttype}); }} For} and {(i; i & lt; numberofseries; i ++) type {if (chart. Range [i] .defaulttype! = 'String') {chart.series [i] .defaulttype = chart .series [i] .type; // does not save new property} chart.series [i] .update ({type: newType}); }}} To save the chart type, I am trying to create a new property on the Series object named "defaulttype" which was created chart. When a "reset" button is clicked, I want to change the chart type to store it back in the property. The problem is that the ne...

actionscript 3 - AS3 Having difficulty getting movieclips to stay on top over other clips -

So I have 5 movie clips on the screen when clicked (bottom position) extension they are all due to this code screen Come to the top of: addChildAt (this.Step0btn, 1); AddChildAt (this.Step1btn, 1); AddChildAt (this.Step2btn, 1); AddChildAt (this.Step3btn, 1); AddChildAt (this.Step4btn, 1); My point is that another movieclip also extends on each of the extension movieclips, but when I click that it still displays everything below. I guess I just like another addChildAt order can add thought: addChildAt (this.Step0btn.Step0img, 1); But when I do this, I get this error: Type error: # 2007 Error: The parameter child should be non-empty on flash.display: : DisplayObjectContainer / addChildAt () on SMARTTTraining_fla :: MainTimeline / SMARTTTraining_fla :: frame5 () [SMARTTTraining_fla.MainTimeline :: frame5: 14] and then extend movieclip is still displayed at the bottom of everything. What could be wrong here? Step0img to null when the code The possibility to ru...

print date like 'Y-m-d H:i:s"in javascript -

What is built in JavaScript in a format formatted a date object in a format such as "Ymd H: i: s" Does it? i after var = new date (xhr.getResponseHeader ("last-modified")); Warning ("Modified:" ++GetDate +). '+ (Since. Gatemonth () + 1) +'. + + Since .gatehors () + ':' + since.getMinutes ()) But it is cut off from all the leading zeros You try it Can: Leading the function (S, Max) {var z = max-s.length + 1; Z = z & gt; 1? Array (Zed). Joint ('0'): ''; Return (Z + S); } Warning ("Modified ::" + pioneer (since.getDate), 2) + '. * * Leading Leading (because Gitmonoth (+) + 1,2) +'. '+ Leading Zero (since .gatehors ), 2 )); But I recommend using a library to handle dates in JS. It is made in a formatter and can do many other things. At the moment you can do this: var d = moment (since); Alert (D. Format ('YYYY-MM-DD HH: mm: ss'));

php - Ajax shopping cart with session_id() as unique identifier? -

I am creating an Ajax Shopping Cart and with a session in my DB- I I want to avoid refreshing all the pages and to avoid the need to log in to the user. Do not expect traffic of a ton. I do not care that the session is lost when the browser closes, so I think I do not need cookies like this:. Any damage to my attitude?

reactjs - Momentum for wheel event is cancelled when child element is removed -

I want to use the onWheel to execute those lists which only have those elements Presents that are in the scene, but it seems that if I want to charge child elements, then I have to sacrifice scrolling. In this example, you can scroll through one million rows, but the speed scroll works out only because the gray area is because the row element that was below the cursor when you trigger is removed from the dot. goes. (Do you want to leave the main feature on line 43, scrolling will work again because in this way, row elements are reused instead of being removed.) Does any container element The goal can be to make the case of the wheel incident instead of the transient line element Suggestions for optional implementation that might be avoiding this problem are probably welcome, probably using onScroll OnWheel ? (Note: Inspired by the system) I solved it ng-repeat It can not help you in the angular JS application by modifying, but considering this problem can help other ...

javascript - PHP - Where to put it -

Maybe very simple PHP question I'm just learning how to create my first website, which uses a database (and What is the general practice of where to put your PHP code? When I learned in CodeCadi, PHP was placed in my HTML (and I replace index.html with index.php). When I go to websites like Google, YouTube or this, you do not see any PHP in the HTML source code. I'm assuming that the code is behind scenes, like JavaScript. PHP (and other server-side scripting languages, such as Python and Ruby) exists only on server , It is not sent to the client. When you use a web page that is implemented using a server script, the server runs the script, and the script produces HTML it is sent to the browser. PHP may be confusing in this regard because it is an embedded language inside the block of HTML (or any other language) & lt ;? Php ...? & Gt; Enter it looks like HTML because & lt; ... & gt; Bracketting, but it is not. The PHP processor just starts co...

javascript - angularjs and ng-init scope when data changes -

Then I have a calendar application, where the user just selects the start / end date and the click updates calendar does. It shows a calendar, however, I am having trouble adding new elements to the scope. For example, instead of continuously using the same function to calculate "cell date" for some cells from the initial date, number of weeks, number of weeks, etc. of the week, I want to get into the realm and everyone should use it. Either way I am unable to do this despite many efforts. In JSFiddle below, you will notice the month display days in the top right corner of each calendar cell. However, if you change the dates, to say a month ago, the "Sale date" is not updated on the day of the month update but in the cell! For example, take "Sat July 05 2014". Update to start date 6/1, and so far the right cell is still "Sat July 05 2014," although the day of the month shows June 7! The related code is in the "Cassell" instruction...

NHibernate -How to conditionally load data from a column -

We are not using FlintNubrinate. We have a table with a Blob column that we want to conditionally load. . We have referred it as 'lazy' and lazy loading is working fine. Is there a way to not load the data on that column at all on a certain condition? ? Xml version = "1.0" encoding = "utf-8", (hence the property in the related category) For example, here is the mapping & lt? & Gt; & Lt; Hibernate-mapping xmlns = "vase: nhibernate-mapping -2.2" name space = "Blah.blah.blah" assembly = "Blah.blah" & gt; & Lt; Class name = "MyDocument" table = "HEAVY_DOCS" & gt; & Lt; Id name = "id" column = "docnum" type = "decimal" & gt; & Lt; / Id & gt; & Lt; Property Name = "docname" column = "docname" / & gt; & Lt; Property Name = "Description" column = "Description" /> & Lt; Property N...

Ruby: listing Fixnum methods does not include arithmetic operators -

फिक्सनम.मप्टेंसससोर्ट = & gt; [:!,!!, =!,!:,: & Lt ;,: & lt; =,: & lt; = & gt ;, ...,: विश्वास,: untaint,: untrust, untrusted?] यह : * , : / , : + , : - , :% (या : "*" , ": /" , आदि) विधियों के रूप में? कि उन्हें विधियों पर विचार किया जाता है। फिक्सनम का एक उदाहरण है कक्षा । वर्ग कोई * उदाहरण विधि परिभाषित नहीं करता है (वह भी क्या होगा), न ही वर्ग के पूर्वजों ( मॉड्यूल , ऑब्जेक्ट , कर्नेल , BasicObject )। अब, 1 पर दूसरी तरफ Fixnum का एक उदाहरण है, और जब से फिक्सएनम एक * उदाहरण विधि को परिभाषित करता है, तब उस विधि को दिखाता है जब आप 1 इसके तरीकों के बारे में: 1.methods.sort # = & gt; [:!!,! =,:! ~,:%,: & Amp; ;, *,: **,: +,: + @,: -,: - @,: /,: & lt ;,: & lt; & Lt ;,: & lt; =, ...] आप देख सकते हैं कि Fixnum नामित एक उदाहरण विधि को परिभाषित करता है * : Fixnum.instance_methods.sort # = & gt; [:!!,! =,:! ~,:%,: & Amp; ;, *,: **,: +,: + @,: -,: - @,: /,: & lt ;,:...

Batch JSON-RPCs in Go with Gorilla RPC -

OK, so I'm working on a server. It works in web pages and offers other services. Package main import ("fmt" "logon" "net / http" "github.com/gorilla/rpc" "github.com/gorilla/rpc / json") Type service struct {name} string type ServiceArgs struct {Str string Val float64} type ServiceReply struct {message string} function (e-Services) DoSomething (request * http.Request, args * ServiceArgs, North * ServiceReply) error {Fmt.Println ( "DoSomething Is called away! ") Answer Message = "OMG, it works." Return nil} function main () {rpcHandler: = rpc.NewServer () rpcHandler.RegisterCodec (json.NewCodec (), "application / json") rpcHandler.RegisterService (new (service), "") http.Handle ( "/ RPC", rpcHandler) http.Handle ( "/", http.StripPrefix ( "/", hearing http.FileServer (http.Dir ( ".")))) fmt.Println ( "" on port 8080) that An: = Http.Listen...

wordpress - Contact Form 7 sometimes doesn't work -

My contact form in some time does not work well in 7 other tasks I get a message : Failed to send your message Please try later or contact the administrator by some other method I tried debugging it and found that CF7 will call wp_mail. This will call this code from contact form 7: if (sent to $) {return @wp_mail ($ recipient, $ theme, $ body, $ headers, $ Attachments); Edit: When it calls wp_mail, then it's wordpress code This part will throw error in: if (! $ This-> smtp-> Data ($ header. $ Body)) {new phpmailerException ($ this-> ; Lang ('data_not_accepted'), auto :: STOP_CRITICAL); } Edit: This data function will call the "sendComand" function in the first row: Public Function Data ($ msg_data) {If (! $ This- & gt; Send Command ('Data', 'Data', 354)) {Return False; } ..... If in this situation it fails. Function is sent to: Secure function sendCommand ($ Command, $ commandstring, $ Expecte...

quickbooks online - Error Code: 2250 when deleting an invoice -

QBO error code 2250 picks "You must fill at least one split line" Why do you need to pass? Is it just an invoice.Id? For whatever bizarre reason, call Intuit v3 "delete" requires that you remove the invoice To delete the call, pass the full invoice item It's weird, yes. Unfortunately, this works as APIs and it is also needed. You can see this document here: Excerpt:

python - Trying to add a timer to my game -

This is a very simple question, and I do not know why I could not find the answer, but what does texta = font.render ("Time:" Anyone knows how to add timer correctly to pygame for Python 3.4.1? + String ( Time), True, Black) screen. Bleet (Text, [500,100]) I have read the solution using Loop and many other people, but no one is working till now. I want a timer to appear on the screen and count how many seconds the user takes to do a certain job. Here is a timer you can use import Import from pygame, sys Pygame.locals * clock = pygame.time.Clock () time = 0 #GameLoop is correct in seconds, while: milli = clock.tick () # clock.tick () since last time How many milliseconds is said to have passed, it tells you how long it took in loop seconds = ml / 1000 seconds. Time + = seconds print time # then you can see that it works

ios - UIImageView with an image set through IB is taking about 10 seconds to appear once view is called -

I have UIView , and then I have another UIView Add a child to see that scene using the code given below. TestViewController * holesaw = [[TestViewController alloc] init]; Holesaw.view.frame = CGRectMake (0, [UIApplication shared application] .statusBarFrame.size.height + 44, holesaw.view.frame.size.width, 454); [Add self childview controller: hole]; [Mentioned point view controller: Self]; [Self.view addSubview: holesaw.view]; In the child's view, there is an image showing a UIImageView through an IB. It takes about 10 seconds to load. Does anyone know why? I have seen this image both as .jpg and .png, and this is only image of 200kb.

How to draw circle by data with matplotlib + python? -

Image
I can draw a circle with scatter , which is shown in the image. But I want to draw them to buy a line, since there are several divisions in total, I need to add the nodes together for a specific cycle. Thank you. Make some random sequence points first: NP angle = NP. Range (0, NPPI.2, 0.05) r = 50 + N.P. Randem. Normal (0, 2, angle.Sp) x = R * np.cos (angle) y = r * np.sin (angle) idx = np.random.permutation (angle.shape [0]) x = x [idx ] Y = y [idx] Then use arctan2 () to analyze the angle, and sort the data by: angle = np.arctan2 (x, y) command = np.argsort (angle) x = x [command] y = y [command] fig, ax = pl.subplots () ax.set_aspect (1.0 ) X2 = np.r_ [x, x [0]] y2 = Ax.plot (x, y, "o") ax.plot (x2, y2, "r", lw = 2) NPR_ [y, y [0] is produced here:

html - How to php echo content into <div> classes dynamicaly -

Text after " My goal is to print all results (received from database) according to print and related formation. In HTML, I can define it as follows: & div; Div class = "gallery-item category-birds" & gt; & Lt; Div class = "gallery-item image" style = "background image: url ('_uploads / bc7113a3956b7a45e926f30258fa1b83.jpg');" & Gt; & Lt; Div class = "gallery-item-image-pattern" & gt; & Lt; Span & gt; Show image & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; H3 & gt; ImageTest1 & lt; / H3 & gt; & Lt; P & gt; MyImageDescription & Lt; / P & gt; & Lt; / Div & gt; In Php, I am trying to print the results in a loop (like I did in other examples first), but for some reason this is not working. "animals.php" Include & php (".. / config.php"); $ Result = mysql_query ("Choose from animals wh...

javascript - Event when chrome popup is closed -

I need to hear the chrome popup closure event. : background.js var port = chrome.runtime listen to on disconnected event as a suggestion Tried. Connect ({name: "hello"}); Port.onDisconnect.addListener (function () {console.log ("disconnected");}); However, whenever I close it, even when I open the popup, I get disconnected does anyone know why this is happening Used to be? solution: AddEventListener ("unload", function (event ) {DoSomethingInPopup ();}, true);

Loading co-dependent groovy classes in Java -

I am trying to find two co-dependent gruby scripts in Java on runtime. If I have two groovy scripts: A..groovy import b square A {a () {bb = new b ()}} > I want to load them as Java classes, but when I run: classloadloader root = getClass (). GetClassLoader (); GroovyClassLoader Loader = New GroovyClassLoader (Original); Loader.parseClass (new file ("Agrowvy"); I get an error: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup fail: A.groovy: 1: solve square b Unable to @ line1, column 1. Import B I certainly understand the cause of this error, but does this section have any way of loading over runtime despite co-dependency is? Thanks! GroovyClassLoader must be enabled to find B Jarovi on square path. It usually means that you change the classpath to include the root of the scripts. Since there is no package for scripts and since you use the new file ("AguVV"), I believe that this is the current directory. ...

php - WAMP server not working and giving some error related .dll file -

I am using wampserver 2.5 After the installation, when we start it, it creates an error The process entry point php_win_err can not be located in the dynamic link library php5ts.dll I also changed the port because some other application uses this port. is part of the MSVCR100.dll file for Windows 32: Make sure you have Visual C ++ 2010 SP1 Redistributable package is installed for x86: VC10 SP1 vcredist_x86.exe For Windows 64: Make sure that you install the Visual C ++ 2010 SP1 redditable package x64 Done: VC10 SP1 vcredist_x64.exe The app is not able to run without this component

c# - Multiple table linq query? -

You can help me translate this SQL query into Linq and Lambda expressions. Choose user .id = UserPassword.user_fk UserPassword at User.id = UserIdentifier.user_fk on UserIdentifier, select UserIdentifier.identifier_value = "Key" and UserPassword.password = " 1234 " I wrote this already on on query = context.Users from u.id at u.id in context.UserIdentifiers included in ui Being joined from joining jf.DefaultIfEmpty equals in the ui.user_fk () reference to join the userpacewords on the UED is equal to in UP2. New {id = u.id, identifier = j.identifier_value, password = added2. ???} Select with the help of I'm not a happy Linq user really does not like me linq due to such a request. It's a simple one, but when you make complicated requests, the leak is a nightmare. This is the worst with dynamic request. I always have problems with linq syntax and the web really does not help to write a correct document did not get. I think that I am not the...

intersection - Find out whether two rectangles are intersecting in 3D space -

I have two rectangles in the 3D space, each given by their coordinates of 4 corners. They are not pivot combine, which means their edges are not parallel to the world axes. There may be an orientation in each rectangle. What is the easiest way to know that there are two rectangular intersecting?

How to get the IP address of the docker host from inside a docker container -

is called as the title. I should be able to retrieve the IP address of the portmap of the container from the Dockers hosts and hosts, and should do this inside the container / sbin / ip route | Awk '/ default / {print $ 3}' @MichaelNeale has noticed that there is no point in using this method in Dockerfile (except when We should only need IP during this build time), because it will be IP hardcode during construction time.

php - Only 1 row return in MySQL select query -

Why this happens when I use selected queries in the MySQL database using PDO only it gives 1 row When do I really need it? This is my code $ data = $ connectionStrings- & gt; Prepare ("Select from animals"); $ Data- & gt; Executed (); $ Information = $ data- & gt; Fetch (); Return information; This is because you are using fetch () instead of fetchAll () Are ALL () $ data = $ connectionStyping-> & gt; Prepare ("Select from animals"); $ Data- & gt; Executed (); $ Information = $ data- & gt; Fatch ALL (); Return information; Read more here:

php - Error in mysqli prepare statement -

$ client = $ db - & gt; तैयार करें ('चयन करें CLIENT_ID, CLIENT_NAME क्लाइंट से कहाँ है CLIENT_NAME "%?%"'); $ Query = $ _GET ['क्वेरी']; $ क्लाइंट - & gt; बाइंड_परम ('एस', $ क्वेरी); $ क्लाइंट - & gt; निष्पादित(); $ क्लाइंट - & gt; Bind_result ($ client_id, $ client_name); जबकि ($ क्लाइंट - & gt; फ़ेच ()) {$ d ['सुझाव'] ['मूल्य'] = $ client_name; $ D ['सुझाव'] ['डेटा'] = $ client_id; } $ क्लाइंट - & gt; free_result (); मुझे ऊपर दिए गए बयान में निम्नलिखित त्रुटि मिली। देख सकते हैं कि त्रुटि का कारण क्या है। & lt; b & gt; चेतावनी & lt; / b & gt ;: mysqli_stmt :: bind_param (): चर की संख्या में तैयार कथन में मापदंडों की संख्या से मेल नहीं खाता & lt; p & gt; getclient.php & lt; / p & gt; लाइन पर & lt; b & gt; 15 & lt; / b & gt; & lt; br / & gt; & Lt; br / & gt; & Lt; b & gt; नोटिस & lt; / b & gt;: अपरिभाषित अनु...

Pass variable in soup.find() method - Beautifulsoup Python -

Currently, I am searching for elements using the syntax given below: priceele = soup .Find (itemprop = 'price'). String.strip () In fact, in the page element contains the attribute name itemprop with the value value . But, let me know The element is not required to search because the attribute is the same element with the itemprop . Now, what I want is itemprop = 'price' as the soup.find () method because I have these two things in database Loading from Dynamic Is this possible? If "two things" you see the name and value of the attribute, you can apply arbitrary keyword logic You can make them dynamic using the ** operator for For example: attrname = 'itemprop' attrvalue = 'price' search = {attribute: attrvalue} priceele = soup.find (** search) .string.strip ()

r - dplyr::manip: How to use string arguments (holding colnames) instead of column names -

I like the description of the headline: instead: Filters (mtcars, cyl == 8) I var such as mtcars [Joe (mtcars [, var] == 8],] I think there are functions like starts_with () but none of IMHO In fact, it is not suitable for the above mentioned rather than simple application. try this: mtcars%>% (filter (.,. [[Var]] == 8))

Mysql xlsx file import with php script Large file in MBs -

I have tried importing .xlsx file into php using PHP-EXCEL class. I have been successful in doing this but when the Excel file increases and size goes into MBs and hundreds of thousands of records in the record, it generates cell caching problems. Has anyone got the solution for this? Allocate more memory to process large files. To do this, you can do either in php: ini_set ('memory_limit', '64M'); // 64 MB is an example (which should be your case anyway), if you currently have 64, then set it to 128. Or search directly from your php.ini file, following line: memory_limit = 64M; Then, 64M is an example, but this should be your case;) If you still have problems with the memory limit, then please Re-increase to 256MB or 512 MB (which should be enough for the 10 MB XLSX file, if I'm not mistaken). Besides, remembering to set up infinite also from time to time, Excel files usually take a lot of time to expand. Again, you can easily do that e...

bash - Issue: iteration in sh -

I am new to Shaan and I would like to run on an array. "Cardio: $ NumPack" in carton "$ The numbers like the first numbers will return to my first number (88), 3 for the next number (88), the next number (454), 1 for the next (65). I have a second array with the number of those articles declared - a Numert noumart = (ZZZ CCDEZDSSDS SDSE AAJETTGIH DA DF ARFFF TRCC TOCC) article (ZZZ, CCDE) pack is 88 (AJDSS, SDSE, AAJE) pack 454, article TTGYH packs are 65, articles (DFDF, ARFFF) are 874, and for the rest 21. I had to draw those rows in 4 to a file. Need to avoid splitting. Each form is related to a pack Ote you should be in a file. So 88 = & gt; File1 454,65 = & gt; File2 (874,21) = & gt; File 3 Thanks for your help I agree See the following script: Instead of resolving this problem, announced to learn - a newpack namppak = (88 88 454 454 65 874 874 21 21) Declare - Save the cardboard box in "$ {Nampp [@]}" Save...

imap - Testing advanced scenarios using JMeter Mail Reader sampler -

I have written a test plan in Jmator using the Mail Reader Sampler to check an IMAPS server. The test only allows me to read all the mail from a folder or read the x number from the folder. Alternatively, I can remove the mail from the server after I read it. However, other tasks like: Read a special email identified by some mail identifier Mail Copy mail to a folder Reading / unreading mails Clear mail from trash explicitly. Is there any way in which these other scenarios can also be tested using some Aadian specimen or plugin? If Jmator does not support this, please suggest any other demonstration test device which can be tested like this Unfortunately JMF Mail Mail Reader Sampler does not allow advanced operation. Although JM + can be extended by scripting you can apply all the necessary methods that provide Java Mail API and scripting samples: See the examples below for deleting all messages from the "spam" folder using IMAP for Gmail:...

flash - ActionScript 3 - Removing Duplicates in ArrayCollection -

I have an array selection of list of user names and user IDs. This list contains duplicates that I need to remove I have searched the Internet and when there are so many examples of using it, then I can not get a clear example using the Arracklation. Should be simple other solutions. function removeDuplicatesInArray (val: *, index: uint, array: array): boolean {return array.indexOf (val) == array .last indexoff (val); } Function RemovedNipPlantsIncollection (archive: Arrayculation): ArrayConption {collection.source = collection.source.filter (Deleted duplicates); Return collection; }

Crash occurs while not debugging, and while Debugging App runs perfectly -

platform - Windows Phone 8.1 When I run my app normally (without debugging) Crash on the app is a specific point and when I start debugging the app to catch the exception, that's right. I have faced this issue on more than 1 scenario, so I am not mentioning code. Did anyone face the situation already on WP8.1? PS-debug mode as well as tried to debug the app in release mode.

Mysql query inner join two tables with group by last ID -

I am using two tables in the database: "member" table: id | Name ----------------------- 1 | John 2 | Mike 3 Jane 4 | Marriage "message" table: message_id | Text | From From --------------------------------------------- 1. Lesson 1 | 1 | 2 2 | Lesson 2 | 1 | 3 3 Lesson 3 1 | 4 4 lessons4 | 2 | 1 5 | Lesson 5 | 1 | 2 I need to get the messages sent by a specific user, sorted by the last message sent and count the total number of messages sent to the specific user is. My existing MySQL query looks: Max max_mess, messages.from, messages.to, members.name, messages.text as message SELECT max (messages .message_id) Join members from members .id = messages.to Message by WHERE messages.from = '1' group. ORDER max_mess DESC should necessarily look like this: Max_mess | From To Name | Text | Total_ Message ------------------------------------------------ - ------------------- 5 | 1 | 2 | Mike | Lesson 5 | 3 3 1 | 4 | Marriage | Lesson 3 1 ...

java - Conditional radio button in webobjects -

मेरे पास रेडियो बटन के लिए निम्नलिखित कोड है: Test.html & lt; तालिका & gt; & LT; टीआर & gt; & LT; टीडी & gt; & Lt; वेबबाइजेन्ट नाम = रेडियोबुटोन 1 & gt; & lt; / webobject & gt; & Amp; nbsp; & Lt; वेबबैक्ट नाम = लोकल स्ट्रिंग 1 & gt; ए & lt; / webobject & gt; & Lt; / टीडी & gt; & LT; टीडी & gt; & Lt; वेबबाइजेन्ट नाम = रेडियोबटन 2 & gt; & lt; / webobject & gt; & Amp; nbsp; & Lt; वेबबैक्ट नाम = लोकल स्ट्रिंग 2 & gt; बी & lt; / webobject & gt; & Lt; / टीडी & gt; & LT; टीडी & gt; & Lt; वेबबाइजेन्ट नाम = रेडियोबुटोन 3 & gt; & lt; / webobject & gt; & Amp; nbsp; & Lt; वेबब्इजेक्ट नाम = लोकल स्ट्रिंग 3 & gt; सी & lt; / webobject & gt; & Lt; / टीडी & gt; & Lt; / टीआर & gt; & Lt; / तालिका & gt; test.wod रेडियोबुटोन 1: वर्डाओबटन {name = "type"; चयन = अनुरोध प्रकार; मान = 0; } रेडियोबु...

c# - Using statement best practice -

This can be a silly question, but since I can not give it my answer, I will ask it here. We have a module that we want to use in an HTC Handler (Web app is written in ASP.NET in C #) and this module is written in IDisposable Interface Then there is a general approach to using the module: using (var module = new ModuleName (param1, param2, param3)) {} Is it better to put any code into variables, which we are using only using this statement or before the code reference: Is it better (and why) first approach or second approach: first approach using (var module = new) Modulenme (param1, param2, Prm3)) {brick A = Rikvestkgetpram & lt; Int & gt; ("ANumber"); String B = Request GETParam & lt; String & gt; ("Bistring"); // Other criteria included in other requests} second approach int a = request GETParam & lt; Int & gt; ("a number"); String B = Request GETParam & lt; String & gt; ("Bistring...

ruby - Validation working on edit but template missing error on Create Rails Error -

I am using Rails 4.1.4 and ruby ​​2.1.2. I am new to Ruby on Rails programming. Validating the form on the I got the missing error in the tape is working for editing the same code but showing this error in creating a new post Controller: class post controller & lt; Here's my code for creating / editing posts for a blog. ApplicationController def Indexe @ Post = Post. All FF Show @ Post = Post.Fund (Params [: ID]) F.Def New @ Post = Post.New and Make Diff @Post = Post.New (post_most) @ Post Redirect_to posts_path Save: Notice = & gt; "Your post has been saved" and again a new end-of-the-end def post-param params.require (: post). Parameter (: title, content: edit end DEF @ post = post.find (params [: id]) end def update @ post = Post.find (params [: id]) If @ post.update_attributes (post_params) redirect_to Posts_path ,: notice = & gt; "Post successfully updated" and then "Edit" End End Df Delete @ post = post.find (params [: id]) @...

Android ImageView selector cannot displayed normal -

Image
I need to show the drawable selector on listView , and I use the DrawableSelector to apply this effect to but in some devices, it will work as expected, while others do not, its not, Looked like a picture that I had captured with the exception devices: From the following code to apply: & lt; Selector & gt; & Lt; Item android: state_pressed = "true" Android: drawable = "@ drawable / img_hovered" & gt; & Lt; / Item & gt; & Lt; Item android: drawable = "img_normal" & gt; & Lt; / Item & gt; & Lt; / Selector & gt; Please tell me where I am going, thanks in advance.

java - Web socket chat and EJB services -

I'm new Java / EJB developer. I want to create chat service for my web application. The main functionality of the chat feature is to make the user Depending on some events to send ordinary messages. Here is the code: Chat endpoint @ServerEndpoint (value = "/ chat") Public class ChatEndpoint {@OnOpen Public Zero Open ( Last Session Session, Last EndpointConfig Config) {} @OnMessage Public Zero Message (Last String msg) {} @OnError Public Zero onError (Throwable T) {} @OnClose Public Zero OnClose {Last Session Session} {} Public Zero SendMessage @ Observe chat event event) {System.out.println ("Try sending new message:" + event.getMessage ()); }} Event class Public class ChatEvent {Private last string message; Public chat event (last string message) {this.message = message; } Public string getMessage () {return message; }} Timer class (to send some random messages) @Stateless Public Square ChatTimer {@Inject of event & Lt; ChatEvent ...

How to Find Documents in MongoDb where some fields are not null -

How to obtain a list of documents in Mongode where some fields are not zero. : If a student is not enrolled in name or age or course which should not be in the results collection. This should work: db.student.find ( {'Name': {$ Ne: null}, 'course': {$ ne: null}, 'age': {$ ne: null}}) But as @ Bipal said that there is no need to store any empty space; Value schema in the form of mongodibi is less; this query is not included outside of the result; all these areas have such documents.

java - Hibernate Envers @GeneratedValue skips values -

I am working on a project with Hibernate and its Environs jar. I'm using Oracle 11G. This works fine except for one thing when I give the code to @ id and @ generatedValue to a @edited unit and the user and I USERS Table ID leaves a value (id should be like 3,4,5,6 ... but 3,5,7, ...) and REV column> USERS_AUD . Maybe, in the ID and REV fields USERS_AUD The table can not be equal (in that table, the same ID and number in one unit Revision may not) number) How can I modify this behavior would order me USERS id table is generated normally?

c++ - How to use pointer to member function when when pointer to global function is required? -

I have the following problem: I have to use a function that takes a callback, implementing a callback is a difficult part because I More information is required, except that I can extract from the input parameter. I will try to give an example: typingf (* FTP) (four * in, four * out); // Callback I have to apply int letterer (FTPR, four * some other parameters); // is to use the method The problem is that I need additional information except the "in" parameter to create the "out" parameter I tried this approach: class wrapper {public: int callback (char * in, char * out) {// "extra info" to create "outIn") char * additionalInfo; } ... wrapper * obj = new wrapper (); Obj- & gt; Additional INFO = "whatIneed"; Lefter (obj-> callback, some peacock paragraphs); I get the following error from the compiler: Error: 'Cover': Callback type 'can not be changed with type' (ripper: :) Type four * * 'fptr...

java - Default variables and select lists in JMeter -

I entered the code with the recording controller in JMT. I was filling a lot of forms in this session. In other forms the selection box was also present with prices along with the values. For example: For Price: In the "john" text box, the value "1" appears in my selectbox "2" for the value (one Need to choose - none is selected by default): "Jack" in the text box appears in the value box "3" and "4" (like above) in my selection box There in the Add this to a http request before this page, where there is a Use Select box (first page for feedback with this page). Assume that id = "selectboxid" can be used in your selection box, select smth: // [@ id = " Selectboxid "] / option [1] / @ value take a look at some of the more Learn more

django - Trigger method on user creaton -

I would like to trigger a method when a user is created through the admin panel, but I can not say where I Can I do that? Any suggestions available? Thank you! If you do not have to restrict the trigger in the admin panel, you can use the JGSO signal () Otherwise, you can override the administrator's ModelAdmin.save_model to trigger your function,

jquery - Column data disappear on row selection in Jqgrid -

Image
My Jqgrid looks like below. When I select a special line my image column data disappears. When I click on the second line, the previous line of data is visible again. Tell me how to fix it. Before clicking: After Click: line After clicking on, images made before Actions and names disappear. When I click on the second row, these images appear again just before clicking. My colmodel is followed: $ ("# list_alter") .jqGrid ({Data type: function (gridata) {Bid alertsgriddata (gridata);}, colNames: [' , '', 'E-mail address',' agency ',' status', '', '', 'input type = "checkbox" id = "cbox" onclick = checkbox (event) /> '', 'Verb'], colomodel: [{name: 'accepted flag' index: 'accepted flag', width: 25, align: 'left', resizable: incorrect, formattor: checkstats flag}, {name : 'User_id', index: 'User_id', align: 'left', hidd...

implementation of lms adaptive filter in matlab -

How does adaptfilt.lms work in matlab? Nobody knows what will be the structure of the filter when we create and use mu = 0.09; % LMS step size is = adaptfilt.lms (32, mu); [Or, e] = filter (ha, x, d); Where do the desired output, X-real output? X and D are of size 2048 x 1, I need the structure of the filter. This is FIR (finite impulse response) filter. The structure is as follows: y (k) = b (1) .x (k) + ... + b (n) .x (kn + 1) where b is a polynomial, as found in the form of a Ha authifier , the data according to the lms method.

My android application is showing Incompatible for Android 4.4.4 Moto E In Play Store -

My Android app looks incompatible with Android 4.4.4 Moto E in the Google Play store, I tried many ways, how do I solve this issue, can you please help me? Thank you in advance If you want to use Google-mops, then moto To support E, you can remove it, uses Android: glEsVersion = "0x00020000" Android: required = "true" /> ; Your manifest from file Moto E does not support OpenGL ES version 2. I think ... I had the same problem After deleting I started supporting the code. Or the simple change android: essential = "wrong" inconsistent issues There may be issues depending on the app permissions , so you can use some permissions , which is the device assistant Not or is not available on that device Assume that your app is endorsing tablets , then your app phone if you have PHONE permissions , then your app will have permissions , then your app for this type of tablet will be incompatible which contains phone...

javascript - Passing additional data through my JSON object,that is returned from the auto complete -

I am working on an ASP.NET MVC web application. I have the following action method, which will return tag numbers as JSON to display as a full-time result: - public functioning autocomplete (string word) {var ad = Repository.FindServer (term, true). Oderby (p => P. technology.tag). Select (A = & gt; new {label = A.Technology. Tag}). ToList (); Return Jason (Advertising, Jesenfest Behavior Alove Gate); } and my auto complete area is: & lt; Text & gt; Search & lt; / Text & gt; & Lt; Input placeholder = "search by tag" name = "search term" data -auto-source = "@ Url.Action" (auto-complete "," rack ")" type = "article" class = "search_orggin" & Gt; But I added additional data such as "server name and data" in addition to the current tag number, back as part of Jason But to auto-complete based on the tag number. I'm looking for something like auto complete res...

Define attributes in method parameters in F# -

I am importing DLL in a FL and then passing some parameters for some method. [& lt; DllImport ( "Winspool.drv", EntryPoint = "OpenPrinterA", SetLastError = true, charset = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall) & gt;] exile bool OpenPrinter ([& LT; MarshalAs ( UnmanagedType.LPStr) & gt ;.] szPrinter) parameter with the characteristics also have a name should receive answer compilers it like we should have a MarshalAs feature first method in C # [DllImport ( "Winspool.drv", EntryPoint = "OpenPrinterA" ,, SetLastError = true, charset = CharSet .Ansi, ExactSpelling = True, CallingConvention = CallingConvention.StdCall)] Private Stable Execution bool OpenPrinter ([MarshallAs (UnmanagedTy Pe.LPStr)] string szPrinter; OpenPrinter parameter String szPrinter is called [UnmanagedType.LPStr MarshalAs (], but it's a feature is ) F # does not accept C # in such a way ...

android - i want to remove long press mode popup in specific key -

I have a list of keys in the keyboard, it is an example of one of the keys: & lt; Key Android: code = "45" Android: keyLabel = "-" Android: keyWidth = "20% p" Android: isModifier = "true" Android: keyEdgeFlags = "right" /> I want to remove the popup function. How do i do this If you mean you do not want to preview the key icon then you should use this code (if You press the OnKeyboardActionListener : Public Zero (int primecode) {if (PrimaryCode == - 2} PrimaryCode == - 5 = Primary COD = = - 4) Public Zero Release {mInputView.setPreviewEnabled (true);} on {mInputView.setPreviewEnabled (false);}}

html - table content out of the border of table td -

I want to set border widths on TD. But I do not know why the width of the table is? Here is a demo of my problem: I just want to run away from the blue interior Still, is it confused that even blue outside the table? Here is the html code: & lt; Table range = "1" & gt; & Lt; TR & gt; & Lt; Td style = "border-left: 10px solid blue" & gt; Content & lt; / Td> & Lt; TD & gt; Content & lt; / TD & gt; & Lt; TD & gt; Content & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Content & lt; / TD & gt; & Lt; TD & gt; Content & lt; / TD & gt; & Lt; TD & gt; Content & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Content & lt; / TD & gt; & Lt; TD & gt; Content & lt; / TD & gt; & Lt; TD & gt; Content & lt; / TD & gt; & Lt; / TR & gt; & Lt; / ...

java - How to convert ChartPanel Coordinates to XYPlot coordinates in JFreeChart -

I have a chartpanel with all the lists executed on it. On the event of mouse dragging, I would like to show my comment to the dragging action I'm changing coordinates. It's working fine, but the coordinates are a bit messy. Actually, I am getting coordinated which is in the context of the chart panel, which is then being converted into axis values ​​of the xyplate, because the annotations come to a strange location Has been there. You MouseEvent to XY java2dToValue () . Using the , the chart coordinates need to be synced. ChartPanel Mouse Handling Code Rectangle2D Datera = Chart Panel .getChartRenderingInfo (). GetPlotInfo () GetDataArea (); XYPlot xyPlot = chartPanel.getChart (). GetXYPlot (); // event stores a mouseAvent function / mouse event from a single location, and it later places JavaScript in place of java.awt.Point clickLocation = new Point (event.getX (), event.getY ()) ; Annotation code double x = xyPlot.getDomainAxis (). Java2dToValue ...

Asp.Net MVC 5 Restriction -

I want to create a simple message system. There are three important pillars in the message table; Message ID Sender's User ID Username I am getting the message ID from the URL and it has been ascertained whether the logged-in user is the sender or the receiver of that message. If not, I do not want to see the message. Public Action Detail Details (int? Id) {var result = db.Talep.Where (e => e.id = ID & amp; (user ID == User.Identity.GetUserId (). ToString () || E. Receiver == User.Identity.Name)); If (result == zero) {return HttpNotFound (); } Telep Telepp = DB. Talep.Find (ID); See the return (story); } The forwardword code is not working, the result never becomes zero even if the statement is wrong I tried to use the . Any extension but this does not work I hope someone can help you. . Always return where and IEnumerable, which will never be empty. There are 2 ways to handle it: If you change this thing: if (Anyone's result! Anyo...

New C-like language support - Eclipse Xtext vs Eclipse CDT vs Netbeans (JavaCC, ...) -

We are trying on CERN to build support for the language which is similar to the C (control script language). It is not compiled but has been interpreted and we want to easily create an editor to write code. We have already developed a plugin for Eclipse (extte), which can parse the source code and perform some static code analysis. But a lot of things are still missing so we were thinking that we can use the C / C + plugin in Eclipse / Netbeen and modify it. Is this current solution (and which one) possible for C-C? Like language, modify it and add your stuff? What does Eclipse CDT offer for IDE development that meets our needs Taking C / C + + plugin from Netbeans and changing the purse in that way Is it possible to parse that and analyze our language? thx for the answer; -) If you need all you should check out the original language of extext There will be a much more feasible plan than modifying the larger C ++ grammar.

r - How to prevent importFrom statements from autodeletion from NAMESPACE file? -

मेरा NAMESPACE फ़ाइल है: # roxygen2 द्वारा उत्पन्न (4.0.1): हाथ निर्यात (एआरसीआरजी) निर्यात (वीओबीओएजीएमसी) निर्यात (सीडीडीआईएफजी) द्वारा संपादित नहीं करते ................ निर्यात (सैबलन) devtools :: जांचें ("सी: / उपयोगकर्ता / एर्डोगान / दस्तावेज / क्रांति / काशीफंडर") मुझे इस तरह बहुत सी त्रुटियां मिलीं: conddiffG: * * 'b.star' के लिए कोई भी दिखाई देने वाली वैश्विक फ़ंक्शन परिभाषा नहीं। अब तक जो भी मैंने कोशिश की है: मैंने NAMESPACE फ़ाइल मैन्युअल रूप से से निम्न आयात जोड़ा है: importFrom (np, b.star) मैंने ये सभी के लिए किया था ... ... कोई भी दृश्यमान वैश्विक फ़ंक्शन के लिए परिभाषा ... "त्रुटियों दुर्भाग्य से, devtools :: check ("C: / users / erdogan / दस्तावेज / क्रांति / कासिफिंडर" Em> सभी importFrom बयानों को स्वचालित रूप से NAMESPACE फ़ाइल से हटा दिया गया था मैंने पढ़ा है कि यह NAMESPACE फ़ाइल को roxygen2 से पुनर्निर्मित करने के कारण है। मुझे आयात की आवश्यकता है CRAN भेजने के लिए पैकेज की सफल...