Posts

Showing posts from March, 2012

ruby - Rails devise customization -

The will of the user table I'm trying to save email and password through a different controller, but in the server I'm getting this error in the log, Warning: User protected attributes can not be assigned: encrypted_password ---------------- ------- ------------------------------------------- ------- ----- (0.1ms) Initial user exists (0.4ms) from `users` where` users`.email` = binary 'mail@mail.com' border1 (0.2ms ) ROLLBACK as one. So I'm not able to put it in the user table. And, how to encrypt the password? . Thinking is made in the gem Controller: @user = User.new (: Email = & gt; Parameter [: Supplier] [: User Name],: user name = & gt; parameter [: supplier] [: user name],: encrypted_password = & gt; '$ 2a $ 10 $ / Hh7UegsWm2ndRXbDEfjvOKBUiI1fa / z1GIbE5OYFpyqW6P97llsG') @ user.save puts @ user.errors Model: attr_accessible: encrypted_password After I will just use users = users .new (email: "...", passw

c# - How can I read file properties/metadata? -

Image
I should look at the system file properties as shown in the image below, especially title and Copyright Properties How can I do this? Normally you System.Diagnostics , Then check the file description and LegalCopyright properties. Although the case is different for images, you need to explicitly remove bitmap metadata. Think, using (stream fs = file. Open ("path \ to \ file", FileMode.Open, FileAccess.ReadWrite)) {bitmapcodecoder decoder = bitmapdicoder. Composition (FS, Bitmapcreate Option None, BitmapUp Default); Bitmapframe frame = decoder Frame [0]; // First frame with metadata bitmap metadata metadata = frame. Metadata as bitmap metadata; Check if (metadata! = Null) // // metadata Title, metadata Copyright) fs.Close (); } You can find all the properties listed in the documentation on MSDN.

javascript - Is there an IDE that highlights possible logical errors? If so, what is the best? -

For example, after spending an hour on the following JavaScript logic error, I finally realized the problem. Keep in mind that if the statement is embedded in a lot of code for (i = 0; i & lt; alength; i ++) {if (myvar = true) {// ommitted irrelevent code}} As you know, I was specifying to compare Heavyare with the correct variable, so it should have been: If (myvar == is correct) After the error was finally realized, I was very angry that I did not recognize it very fast I could have been more than 5 years Prog I am Raming, mostly in Java but it happens a lot and I was wondering if there is an IDE or something that can highlight possible logical errors. you can get your code written In this case, it tells you Would "expect a conditional expression and in return an assignment has been seen."

sql - How to create a Stored Procedure with dynamic Schema -

Create MySchema. Select MySpName as MyTable Conclusion As you can see above, there is a stored procedure in the schema MySchema , I dynamically do this schema I want to use. As I have many different schemas like MySchema1 , MySchema2 . Suppose I want to execute my above stored procedure in schema MySchema1 , so I want my stored procedure schema MySchema1.MySpName Any suggestions with. There is no way to make a process without specifying the schema and any object was created for it SQL Server is bound to schema. This is a security barrier implemented in SQL Server 2005 SQL Server. All objects in SQL Server should be under a specific schema. Now in your case you have two options. Make this process in every database in your schema. Create a process Accept this object name and schema name within any one schema and process. Example The process of making the process is DB.PROG_N @Satinnam Navaarar (128), @tabnnnn Op note starting as NHA CAR (128); D

sql - Best method to communicate securely between two different servers -

I am trying to figure out the best way to send information back and forth between my servers and other company's servers In, the other company processes the sale of my software, then goes to our server to activate the software. Every time my software loads to get an active license, my server gets hit. My server is blocked from external SQL queries (will not run queries from other companies' servers), so I somehow have to send data back and forth with my server. Being new to this kind of thing, I'm looking for opinions on how to do it safely (I already know how to write code) The Best. For example, an encrypted GET request is sufficient, where I can only decrypt the information passing through a link? SSL with data in XML? It seems that you can keep a web or web service server? Your server only accepts connections through HTTPS, and requires client authentication. The server of another company is contacted by using HTTPS with a post request from your server. You

arraylist - Trying to print a binary tree vertically using HashMap in Java -

I am trying to print the binary tree vertically. I have used the hashmap with the horizontal distance of the node from the root and used it as the simplified list of nodes in the form of values. In accordance with the hardcode input in the main module, the tree looks like this: 1/2 2 3 / / / 4 5 6 7 Required output (when I print the hampapa entry): [0 = [1,5, 6], 1 = [3], 2 = [7], -2 = [4], -1 = [2]] Output given by the code given below: [0 = [1, 6], 1 = [], 2 = [], -2 = [], -1 = []] Can anyone explain to me the problem here? import java.util.ArrayList; Import java.util.HashMap; Public class TriDode {Private key key; Left the private tree node; Private Tree Node Correct; Public TreeNode (Anti Key) {Public key key}} Public key () {return key;} Public triode left () {left left}; Public triode right () {right;} Return to right} Public Zero Set Public keys set {Public key} {this.key = key;} Public Zero Set Lift (tree_node left) {this.left = left;} Public Zero Satrite

linker - Linking with libmaxminddb -

I am trying to replace libgeoip with libmaxminddb. I am using the Lima build system, while the link fails in this undefined context, but -lmaxminddb exists. liblua_modules.a is a library that calls MMDB_open (). Linking to XXX executable SOURCE server CD / home / pyronov / suckerserv / trunk / suckerserv-v5 / release_build / src & amp; Amp; / usr / bin / cmake -ememake_link_script CMakeFiles / sauer_server.dir / link.txt --verbose = 1 / usr / bin / c ++ CMakeFiles / sauer_server.dir / engine / server.cpp.o CMakeFiles / sauer_server.dir / fpsgame / server.cpp.o CMakeFiles / sauer_server.dir / hopmod / netbans.cpp.o CMakeFiles / sauer_server.dir / hopmod / startup.cpp.o CMakeFiles / sauer_server.dir / hopmod / scheduler.cpp.o CMakeFiles / sauer_server.dir / Hopmode / lua CPPO CMakeFiles / sauer_server.dir / hopmod / core_bindings.cpp.o CMakeFiles / sauer_server.dir / hopmod / events.cpp.o CMakeFiles / sauer_server.dir / hopmod / signals.cpp.o -o sauer_server - rdynamic -lrt

PHP use variables in an array -

Currently I'm setting an array like this ... public function Setup_array () {$ columns = array ('date1' => '2014-01-24', 'date2' => '2014-02-14', 'date3' => '2014-03 -11 ',' date4 '= & gt;' 2014-04-01 '); Return $ column; } This works, but I would like to use those variables that are already set in place of dates ... public function Setup_Are () {$ Columns = array ('date1' => '$ date1', 'date2' => 'date1', 'date3' => 'date1', 'date4' = & Gt; '$ date1'); Return $ column; } I have tried to do this, although $ derivatives variables are available and set, it actually prints instead of $ 1 or receives variable value again. What am I doing wrong? remove quote public function setup_are ($ Date1) {$ Columns = array ('date1' = & gt; $ date1, 'date2' => $ date1, 'date3' = & gt; $

objective c - Set label text from one view to anther -

I am trying to move the user to his settings where they will set a name. After clicking save name, the application will be placed on the main screen label without having to launch again. How can I do this, the easiest way? Thank you! If you have a settings view controller, I think that to keep track of saved settings You have some model objects. You must keep track of the username in that model object Just add to your main view controller: - (zero) viewDidPair {[SuperWoodPeeper]; Self.userNameLabel.text = [self.modelObject valueForKey: @ "userName"]; }

php - MySQL won't recognize MD5 -

A quick question .. I am trying to see if an MD5 password is identical MySQL entry but I badly fail ATM (it works fine on my offline server ..) Can you please tell me what I am doing wrong in this question: SELECT * FROM 'users' where 'Username' = ''. Trim ($ _ POST ['Username']). "'And` password` =' ".MD5 (trim ($ _ POST ['password']))" "border 0,1; thanks! < / Div> As they have explained in the comments, you want to either use the Mysqli or MySQL PDF class ... But I use the PDO, which can help a lot with security, and it's not very difficult to get your head around. Here's a tutorial that helped me: If you like it If you have already posted, you can post the full php MySQL statement, and we can tell you in the right direction: D Oh, and secondly, you do not really want Odi Use MD5 ... This is really weak for rainbow attacks ... Use bluffish with salts ... Here's a tutorial fo

html - CSS relative div's width auto extend by absolute div -

Is it possible to get parent (status: relative) auto expands its width by its entire child? This is my JScript link: Ideal # Container and # Full Width Width must be in the form of width. CSS: # Container {Location: Relative; Border: 1 px solid green; } #broad-width, #call- width {display: table; Status: Completed; } #World Width {White Location: No-Rap; Width: 1500px; Height: 200 pixels; Border: 1px solid red; } #top-width {top: 30px; Width: 100%; Border: 1px solid blue; } HTML: & lt; Div id = "container" & gt; & Lt; Div id = "large-width" & gt; This is the wide width & lt; / Div & gt; & Lt; Div id = "full-width" & gt; This is the full width & lt; / Div & gt; & Lt; / Div & gt; I need to implement it by CSS, do not use javascript. Does anyone know how to do it? Thank you very much. You can not extend to the div div according to the condition of the child If the child's status i

java - Error with openid4java -

I have found this project which depends on openId4Java but I am facing the following problem This is when I am running HTTP status 500 - org.openid4java.message.IndirectError to the org.openid4java.message.AuthSuccess type exception report message in org.openid4java.message.IndirectError Can not be cast The openid4java.message.AuthSuccess description server encountered an internal error that prevented this request from completing. Exception can not be entered in java.lang.ClassCastException: org.openid4java.message.IndirectError in org.openid4java.message.AuthSuccess net.vinant.idp4java.openid4javaImpl.OpenId4JavaProtocolEmplementation.checkId (OpenID 4JavaProtocolEmplementation.javacember45). net.vinant.idp4java.openid4javaImpl OpenID4 Java Protocolmelmentation Ondley (OpenID 4JavaProtocolEmplementation.java:105) net.vinant.idp4java.EndpointServlet.doPost (EndpointServateJavaAut) javax.servlet.http.HttpServlet.service (HttpServlet.java:646) javax.servlet.http.httpServlet. Ser

i have a formula, trying to put it into python and this is what i have so far, whats the issue with it? -

First of all, I want to create a program for this thread: "All Nodes X4 X Node_type X Node_Version X1 Capacity aspect_count is that I have done so far: import math node_type = 1 node_feature = 1 aspect_count = 0 capacity = 0 def capacity (): capcaity = Int (input ("input capacity of your node:") def aspect_count (): aspect_count = int (input ("Number of aspects that have their input:")) / 10 + 1 def node_type (): node_type = raw_input ("Input no Type such as yellow / bright / normal ") def node_feature (): node_feature = raw_input (" input feature your node's appetite / Pure / Normal ") def which_node_type (): If NODE_TYPE == Yellow: NODE_TYPE = 1.1 elif NODE_TYPE == bright: NODE_TYPE = remaining 1.5: NODE_TYPE = 1.3 def which_node_feature (): If node_feature == hunger: Node_feature = 5 Elif node_feature == frightening: Node_feature = 3 Elif node_feature == net: node_feature = 4 second: Nod_fecr = 2.5 DRP primary CE (): value =

image - MATLAB - variable in .dat file save command -

I am converting a .tif image into double format, and the new file name is stored in a variable. When typing the save command, the script is executed, but the file is not saved unless I manually type 'command-file-name.dat' in the command (instead of the variable). That is, the variable is not working in the command to save. Am I forgetting something which I am doing wrong? Code below % user image selection [imagerawname imagerawpath] = uigetfile ('* .tif', 'double convert - select raw image file', directory) ; % Image Location String ImageLock = Create Stracket (Imagervapath, Imagerwamen); Read pack% = and imread (imagine) to change in double image; Imagedbl = double (image); % save as' savepath 'imagedbl -ascii fprintf (' \ n Double conversion has been saved. \ n .dat file to save save path = strcat (imagerawpath, imagerawname (1: (end-4)), '-dbl' '.dat' '' I feel like you are saving in the named file, 'code'

siteminder - Java Code to fetch Session Store attribute values -

I'm writing an inexhaustible generator plugin in Java to get a user statement from the session store, Accordingly. I am able to use the method () which I can use to extract user values ​​from session store (agentAPIObject.getSessionVariables ()) based on SessionID, but, I am having trouble writing the code. To bring specific parameters from the store (explicitly about setting up values ​​for the attribute type and making it as an array) Can you post a sample code if you have ever Its place Could have seen / written, so I get the user to facilitate the session. / P> I have trouble understanding Java docs around this. Thank you in advance, The API mentions this thing: Feedback - On successful withdrawal from this method (yes comes back), this output parameter includes the variable name and their value retrieved. I If the method returns to Anarolaved, then this parameter contains variables that can not be recovered. You will need to create two objects if the g

PHP MD5 not working in if statement -

I am having trouble comparing a submitted password and there is one thing called from the database. Both are equal to the same output, but when compared to a statement, they are not equal to one another Both pies & amp; TestUserPin = ad0234829205b9033196ba818f7a872b But if statement is wrong in the statement that they do not match You must enter the password Do not use md5 because it is broken, instead its more secure using BCRYPT on the register page $ pass = "User password"; $ Secure_pass = password_hash ($ pass, PASSWORD_BCRYPT) ;; // Secure Hashed Pass on the login page ---- $ pass_by_user = "Password entered by user in login page"; $ Pass_in_db = "User password obtained from mysql table using email or other non sensitive data"; $ Correct_pass = password_verify ($ pass_by_user, $ pass_in_db); // Database password and password entered

ruby on rails - Rspec - obvious test is failing, how to troubleshoot? -

I have a very simple app that I am trying to test with RSPC. I find it difficult to determine whether my configuration is a problem, or if this code is /people/index.html the first line of .arb and <1 p> error: < Ex> code> "Completely awesome page" text in "Index" is expected. /spec/features/people_spec.rb:19:in 'Block (level 3) & lt; class: PeopleSpec & gt; test gems: group: development, testing gem 'rspec' gem 'rspec-rails' gem 'capebara' gem 'factory alleys' end spec / features / people_spec.rb: class 'spec_helper' requires PeopleSpec & lt; Imagery / "People" spec_helper: ENV ["RAILS_ENV"] == File 'test' Expand_path ("../../config / environment", __FILE__) requires 'rspec / rails' Requires 'minimum / autoron' for 'rspc / autoron' 'capebara / rails' Requires 'Capibara / RSPC' Dir [Rails.ro

PHP Mail_Mime: How to properly use encodeHeader() on the body of an email -

मैं इसके लिए वर्ण एन्कोडिंग को कैसे ठीक कर सकता हूँ: need_once (/ mail / mime .php "); $ corpoTxt = 'teste envio relatórios sà £ o'; $ corpoHtml = '& lt; html & gt; & lt; body & gt; वर्सा पाउंड ओ एचटीएमएल टेक टेक्टेको & lt; / body & gt; & lt; / html & gt;'; मैंने कोशिश की: $ corpoTxt = $ mime- & gt; एन्कोड हेडर ("कॉर्पो", $ corpoTxt, "utf-8", "उद्धृत-प्रिंट करने योग्य"); $ corpoHtml = $ mime- & gt; एन्कोड हेडर ("corpohtmls", $ corpoHtml, "utf-8", "उद्धृत-प्रिंट करने योग्य"); लेकिन यह काम नहीं करता, मुझे मिल रहा है : वर्सो? एक पाउंड ओ एचटीएमएल टेक टेक्सास किसी भी मदद के लिए अग्रिम धन्यवाद! < $ Mine-headers () फ़ंक्शन को कॉल करने से पहले इन पंक्तियों को शामिल करने का प्रयास करें। # सुनिश्चित करें कि EML UTF-8 है $ mimeparams ['डीबग'] = "सच"; $ mimeparams ['text_encoding'] = "8bit"; $ mimeparams ['t

c# - Cannot insert into SQL Server 2012 - Error: "the property CommandText has not been initialized" -

I'm not seeing any errors, though I'm getting an exception: Code: Private dataTable_employees; Private Systems Data SQLLient.SqlDataAdapter _adapter; Private datasets _ds; Receive private datatable employee {if _employees! = Null} returns _employees; else {_adapter = New SqlDataAdapter ("Select from employees'", Convert.ToString (ConfigurationManager.ConnectionStrings ["NORTHWNDConnectionString"])); _ds = new dataset (); _adapter.Fill (_ds); _ds.Tables [0] .tablename = "employee"; _employees = _ds.Tables [0]; Return worker; }}} Hashtable collectFormData (Telerik.Web.UI.GridCommandEventArgs e) {UserControl UserControl = (UserControl) e.Item.FindControl (GridEditFormItem.EditFormUserControlID) is protected; Hashtable new value = new hashtable (); New Price ["Country"] = (UserControl.FindControl ("TextBox7") text box) Text; New Price ["City"] = (UserControl.FindControl ("TextBox8") as text box) T

ios - removeWithCompletionHandler causes logging out of Game Center -

When the center is needed (to avoid extra loading burden, I want to keep the minimum number of matches minimum). I have not received any error and the match has been removed properly. However, most of the time I do this, my user is taken out of the sports center, so the local players have not been certified anymore. It happens on iOS 7, with both the iPhone and the iPad. Does anyone experience this? Is there a way around it? NB: I can not even remove matches from GC, because I use internal business logic to determine which matches the user should be listed and tell, only 10 (Incomplete) Most recent, however, I am afraid that hundreds of games can be kept in GC and it can slow down the conversation with GC when I have to get a list of matches. If you are ending a conclude call within a completion handler for another game center API call , Then maybe you are experiencing the same problem for a while. The solution I tried today included delaying the call to remove i

Can i run two copies of a python program? -

मान लें कि मेरे पास scr.py नामक एक अजगर स्क्रिप्ट है। अजगर scr.py चल रहा है एक scr.pyc फ़ाइल बनाता है जिसे पायथन द्वारा व्याख्या की जाती है। अब, मान लीजिए कि मैं scr.py में एक बदलाव कर रहा हूँ, और फिर एक और टर्मिनल विंडो में, मैं फिर से python scr.py चलाता हूँ क्या होता है? क्या मूल scrsupport/c फाइल को अधिलेखित किया जाता है? क्या कोई समस्या है जो हो सकती है? आप एक ही समय में एक ही फाइल की दो अलग-अलग प्रतियां चला सकते हैं? हाँ, यह कोशिश करेगा नए संस्करण के साथ .पीसी फ़ाइल अधिलेखित करने के लिए। लेकिन इससे पहले प्रोग्राम को प्रभावित नहीं किया जाएगा, जब तक स्पष्ट मॉड्यूल पुनः लोड कहा जाता है, क्योंकि मॉड्यूल को स्मृति में लोड किया जाता है। ओटीओएच, उदाहरण के लिए, अपवाद के लिए प्रिंटिंग स्टैक स्रोत फ़ाइल पढ़ने की जरूरत है, और, यदि यह बदल गया है, तो गलत लाइनें मुद्रित की जाएंगी। इसलिए मक्खी पर जगह लेने पर यह अनुशंसित है जब मॉड्यूल ठीक इसके बाद ठीक से लोड होता है।

c++ - Callbacks from private CRTP bases -

The following code does not work, because you can not do static_cast from the private base class. Changing cast with C-style artists (although I basically thought it would apply undefined behavior, apparently it does not seem), rather it's ugly because it gives you the power of Constant- Allows bypassing checking, etc. There will be another way for CRTPs to be a friend, but they will expose all the derived personal members. Is there another way to write it without using the C-style and without making CRPPs a Friend? template & lt; Typename T & gt; Struct CRTPBase {Zero Counts () {T * Derived = Fixed_ of & lt; T * & gt; (this); derived-> PublicMethod (); }}; Structured Derivatives: Private CRTPBase & lt; Derived & gt; {Void callParent () {this- & gt; Callbase (); } Zero public method () {}}; Int main () {Derived D; D.callParent (); Return 0; } I think the best solution is to avoid personal heritage and instead The option to hide data

php echo to html with jquery fade effects -

I am trying to do PHP, everything works fine, but it resonates on the page when Until it is not refreshed. Anyway I can use jquery to fade it out, out? Part of PHP coding: $ q1 = mysql_query ("selection` deals' from `show 'range' 1); $ D1 = mysql_fetch_array ($ q1); $ N2 = $ d1 ['Deal']; If ($ n2! = 0) {foreach ($ $ address as $) {Mail ($ $ to $ $ theme, $ message, $ headers); } Echo & lt; Center & gt; & Lt; span class = "text-wrapper-2 text-wrapper-green" & gt; Email Sent! & Lt; / Span & gt; & Lt; / Center & gt; '; } Else {echo '& lt; Center & gt; & Lt; span class = "text-wrapper-2 text-wrapper-red" & gt; Email failed & lt; / Span & gt; & Lt; / center> '; } So the code above is to be echoed correctly for HTML but I want to add some Jquio face effect to it. Javascript is done entirely in PHP, after which the interaction is completely client-side. Ther

How to capture the fixed terms of a R formula? -

Suppose I have R formulas, which are with random posts: f1 < -formula (y ~ x1 + x2 + (1 | x3) + x1 * x4) f2 and lt; - Formula (y ~ x1 + x2 + (1 | x3 + (0 + x5 | x3)) + x1 * x4] How do I get certain conditions for these formulas? : Factrum [1] "x1" "x2" "x4" "x1: x4" library (lme4) f1.fixed & lt; - terms (lme4 ::: nobars (f1)) etter (f 1. fixed, "term.labels") # [1] "x1" "x2" "x4" "x1: x4"

java - Is the Clip class appropriate for 'heavy use'? -

I am working on a program that is of clip s ( clip) Series runs .start () ), average on each other. The meaning of a clip has started, and after each other it has been closed and another clip has been started, and so on for 10 clips The result is not 'fluid', some clips do not even start or hear. My question: Is there a proper clip class for this type of object? Or should the clips stop and start very often? If the clip is not suitable, can you recommend an alternative category or library for this purpose? Or maybe there are some guidelines for working with the clip which I have described as working with the matter? (Probably about threading or some things) I do not have much experience with audio in Java, but I have experience with clips The experience is bad. I have found that for some reason it takes half a second to restart a clip which is not acceptable (found that some older bugs were fixed in relation to this issue, but probably At the time I was seei

icons - Android application logo implementation -

I have created a logo using the paint and saved as a logo. Now I want to change the default ic_launcher logo for my logo. I know that I need to copy my logo in the res / drawable folders. I added the same file to all druble and changed the Android manifest.xml . In the Android manifest I selected "App" and then changed the icon name to logo.png instead of ic_launcher . I think I need to change the proposals, but I do not know the parameters of the drauble folders do you know how can I optimize them? Use Android Asset Studios. Select the launcher icon and select the picture at the top. There you can upload an image and the rest is taken care of for you. You can edit some things about the image here and there is also a preview below when you are finished, click on the download. Just below the zip preview The zip will contain all the images for all the necessary offers.

java - How do I get the power of each string based on its length? -

मेरे पास 15 की एक स्ट्रिंग है: "10101000000010" । मैं अनन्य या अर्थात् ^ [/ p> int s = a [3] ^ a [5] ^ ए [7] ^ ए [9] ^ ए [11] ^ ए [13] ^ लेना चाहता हूं। एक [15]; // here skips 1 सूचकांक सभी तरह से स्ट्रिंग के अंत तक जो 7 है। int t = a [3] ^ a [6] ^ a [ 7] ^ ए [10] ^ ए [11] ^ ए [14] ^ ए [15]; // here ^ skips 2 index and lets 2 go, और इतने पर ... मैं यह करने के लिए एक एल्गोरिथ्म कैसे तैयार करूं? मैं बस excluisve या प्रत्येक सूचकांक लेने के बाद int चाहता हूं। तो सवाल क्या है, मुझे क्या करना है अगर स्ट्रिंग की लंबाई 20 है, तो मैं कैसे निम्न कोड आपके अनुरोध को पूरा करता है सार्वजनिक स्थिर इंट पावर (स्ट्रिंग ए) {int total = 0; के लिए (int i = 3; i & lt; a.length (); i + = 3) {कुल ^ = (int) a.charAt (i); } कुल वापसी; }

css - Span element not aligning properly in Chrome on Windows 8 -

Then this is a doozy ... Our QA department reported a bug that only Chrome 8. Windows 8. Works fine in all other browsers on all other browsers. Bug? The text within a span element goes down below, where it should be placed, trying to align the full height of the element. When it was told, I was working from home, so I actually installed Windows 8 on the latest iMac and installed the latest Chrome - the same version was tested by QA - but the bug Everything could not be reproduced completely aligned. Tried every possible screen resolution and all were pretty good. So I have returned to the office today, and a QA has installed me a laptop with Windows 8, and will not you know this? The text is not properly aligned. It's a Lenovo UltraBook, a difference, though: disabling a touch screen but even touch screen (and verifying through the Dev console that Chrome no longer recognizes the touch screen) did not fix the problem . There was no add-on in Chrome installation. Wh

mysql - concatenating multiple fields in one record sql -

I would like to get the amount per month (gross) for each user and show each event field. Therefore I will need to show these columns My table Order ID, user, month, event, gross 1 jack October Event 2 30 2 Jack November Event 3 20 3 will be the result for the Jack November Event 3 20 4 Jack Number Event 2 30 SAM November Event 2 30 6 Zone October Event 3 20 Jack > So I believe that multiple records of one field should be found in the records. I have seen something like a union that is keeping values ​​separated by commas in a column, but it is not sure how to use it. "post-text" itemprop = "text"> I think you are looking for something like this will work: select based on xyz GROUP month from user, month, group_concat (event), sim (gross)

debian - How do you install Libevent for PHP? -

मेरे डेबियन 7 64 बिट डेस्कटॉप पर libevent-dev लायब्रेरी स्थापित किया गया है: $ sudo aptitude install -i libevent-dev फिर मैंने पीईसीएल पुस्तकालय स्थापित किया है $ pecl सूची स्थापित संकुल, चैनल pecl Php.net: ========================================= पैकेज संस्करण राज्य libevent 0.1 .0 बीटा मैंने PHP और ओएस को पुनरारंभ कर दिया है लेकिन PHP एक लिखित एक्सचेंज के रूप में phpinfo () के साथ libEvent की सूची नहीं है और मुझे "PHP घातक त्रुटि: अपरिभाषित फ़ंक्शन event_base_new () को कॉल करें" जब मैं इसका उपयोग करने का प्रयास करता हूं। आप Libevent कैसे स्थापित करते हैं? < div class = "post-text" itemprop = "text"> PHP 5.X के लिए Libevent स्थापित करें sudo apt-get install libevent-dev sudo Pecl स्थापित libevent-beta sudo su sudo echo 'extension = libevent.so' & gt; /etc/php5/mods-available/libevent.ini exit sudo ln -s /etc/php5/mods-available/libevent.ini/etc/php5/fpm/conf.d/ sudo ln -s / etc / php5 / mods -वेबल / libev

php - "Couldn't connect to database" error on Android -

I want to make an application on Android to view my database from MySQL, but my code does not work properly The Android device told me that it could not "connect to the database". This is a screenshot of my problem: This is my MainActivity.java code: package com.example .bismillahirohamnirohim; Import java.io.buffferedReader; Import java.io.InputStream; Import java.io.InputStreamReader; Import org.apache.http.HttpEntity; Import org.apache.http.HttpResponse; Import org.apache.http.client.HttpClient; Import org.apache.http.client.methods.HttpGet; Import org.apache.http.client.methods.HttpPost; Import org.apache.http.impl.client.DefaultHttpClient; Import org.json.JSONArray; Import org.json.JSONObject; Android Import annotations. Import android App Import android.os.asyncTask; Importroid.os.Bundle; Import android.os.StrictMode; Import android.util.log; Import android.view.Menu; Import android.widget.TextView; @SuppressLint ("NewAP") public class extends mai

javascript - Wrapping Elements Based on Loop, Plus Amount of Modulus -

After I have every third example of a & lt is needed to wrap; Div & gt; Dynamically in some HTML, and, if there is any remaining, in that way to wrap the amount of less than three in a similar way, then it will serve as the last example of "wrap". Taking every third example is very basic: var divs = $ (". Someclass"); Var range = 10; For (; I & lt; boundary; above i = 0 i + = 3) {divs.slice (i, i + 3) .wrapAll (" However, because there is 1 remaining in this example, and I'm dynamically creating HTML somewhere else (here it is very complex for demo, but this aspect works fine It does the result, this example sets four ".classwrap" divs, sets three ".someclass" divs, giving me twelve ".someclass" divs, not ten what I'm trying to get in this example I really have four sets of ".classwrap" divs, but those wrapper sets With each three containing ".someclass" divs, and after that the f

encryption - Using CreateDecryotor() in PowerShell -

I was thinking that someone could help me with the error found in PowerShell. I'm not having any problems with making the encryptor shown below: $ crypto = New-object System.Security.Cryptography.RNGCryptoServiceProvider $ IV = New-Object System.Byte [] 16 $ crypto GetNonZeroBytes ($ iv) $ RIJSym = New-Item System.Security.Cryptography.RijndaelManaged [Byte []] $ key = ('mysecret $% @'). ToCharArray () $ encryptor = $ RIJSym.CreateEncryptor ($ key, $ 4) But when I want to decrypt my key, I have a problem for any reason This is what I am using and when I run the program I get: $ decrypted = $ RIJSym.CreateDecryptor ($ encryptor) Error message can not find an overload for "CreateDecryptor" and logic number: "1" 15 four: $ 1 $ $ DeCryp = $ rijSym.CreateDecryptor ($ en Cryptor) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodException + FullyQualifiedErrorId: MethodCountCouldNotFindBest er

linux - non www to www with extra redirect -

I am currently using the following code in my HTX file so that all the www server. Rewrite% {HTTP_HOST}! ^ Www. RewriteRule ^ (. *) $ Http: //www.% {HTTP_HOST} / $ 1 [R = 301, L] Everything works fine with all sites, but Some sites are still not open to the public. In those sites, I am using a redirect in a folder that has a "under construction page blank blah" the following code rewritecond% {HTTP_HOST} ^ www.mysite.com $ [or] rewrite% {HTTP_HOST} ^ mysite.com $ rewriterule ^ mysite \ / $ "http \: \ / \ / mysite \ .com \ /beta\/beta\.html "[R = 301, L] Point when I get a loop and stop error in the browser when using another redirect, then how do I simultaneously with both redirects Can i work Put your rules in the right order: Rewrite on rewriting Code% {HTTP_HOST} ^ (www \.)? Domain \ .com $ [NC] RewriteRule ^ mysite /? $ Http://domain.com/beta/beta.html [R = 301, L, NC] RewriteCand% {HTTP_HOST}! ^ Www. RewriteRule! ^ Beta / Beta \ .htm

c# - Creating Subarray Without Copy and/or Allocation -

I am new to C #, and am wondering how to do the following: I Create the array whose maximum number of elements I need to store: int [] myArray = new int [64000]; I am passing this array in a third party API. In this API, they use the .length property to determine the number of elements. I do not want that because the array length is the maximum number, not the "active count" (i.e. the number of elements in use). Keeping this in mind, create another array, whose size is equal to the active number? And, can it be done without copying and / or allocation? The memory I have allocated already is - what I want to do is that it indicates the sub-region of interest playing well with the third party API. If the third party accepts a int [] , then passing your data The only way to copy will be. An API can be easily designed where it is not necessary (i.e.: pass the number of elements, or use ArraySegment , etc. ), But if the API

excel - Read and list exif data using vba -

In an Excel spreadsheet, try to create a list of Exifa data for each image in a folder such as focal length and exposure time I am doing Does anyone have any signs? I have seen the second method but only made the list of things, etc., but never in the EXIF ​​data (in the "Details" tab in the image properties). I'm not sure this can also be done. I think it's a good question to remove IPTC and XMP metadata as well as exiv2 You can use an Exhibition 2 command line tool for See if you can call this device with VBA and mention it in the results as described below: I am surprised that there is a simple solution for this.

createprocess - SaltStack: Use directory as source only if it exists -

I would like to know if there is a way to run a sultstacks situation, if the directory source is defined in a master source Actually, I want to allow users to put some configuration files in their HOME directory, most users will not have special, but some of them (a custom < code> .vimrc , for example) I What do I want to do now As of now, I have the following: ['User']%} {{username}} in the column for the user name: user: - current - home: / home / {{user name} }}. . . ] # (Yadda, yadda, yadda) #toDo: If the user's directory # is not present then is there any way to run it? / Home / {{username}}: file.recurse: - User: {{username}} - group: ubuntu - source: - salt: // user / {{username}} - required: - User: { {User name}} {% Endfor%} What do I do, what happens in the code like ToDo is: If a directory is < Code> salt: // user in the salt tree (or salt master) / {{username}} , then as the source of file.recurse with that directory file

How to get the month depending on the week number in C# and .NET -

How can I get the month according to a specific number of weeks? For example, if a week number 2 returns, then month 1 (January) comes back? Take the number and multiply it by 7. For example, if this week number is 12, multiply 12 to 7. This will indicate that how many days it is, it has been rounded in the nearest week. 30. For example, the number we received from the calculation was 84. 84 divided by 84 is 2.8 Use this number to find the month. 2.8 means that this is march. The number before the decimal point indicates months ago Always keep the numbers above, this will give you the current month. Read more:

javascript - How to find an element by searching with InnerHTML using C# and Selenium -

Image
I have to get a special element ID by searching for the milling interiors HTML string. For example, I want to find element ID in which the internal HTML is the "beginning of the car" select public static bundle some (IWebDriver driver, string search name) {var js = driver IJavaScriptExecutor; If incorrect (js ==) wrong return; Var element = (string) js.ExecuteScript ("... to get script to get ID ..."); Var x = Driver. Fund Element (By ID); X.Click (); Back true; } I know that it is possible through loops and they all get them using Javascript, but once you find the internal matching with the 'SearchName' string Get HR, How do I return the ID? Using jQuery is simple, just use: in - var found = $ ("TD: happens ('start of car')"). Ether ('id'); This allows you to return the ID of the element in question. Alternatively here's just one way to do this with JavaScript - function text id (node, text) {if (

Maximize distance between variables' value in SWI-Prolog(clpfd) -

मैं दो चर के बीच अंतर को अधिकतम करना चाहता हूं: : - use_module (library ( clpfd))। अधिकतम (एक्स): - एक्स = [ए, बी], एक्स इन्स 1..5,% मैं ए और बी के बीच अधिकतम अंतर रखने के लिए एक बाधा लिखना चाहता हूं। < P> अधिकतम अंतर व्यक्त करने के लिए कोई बाधा नहीं है। अधिकतम 1 को अभिव्यक्त करने के लिए कोई बाधा नहीं है। इस तरह के निर्माण की अनुमति के लिए मात्रा का ठहराव के कुछ फार्म आवश्यक होगा। हालांकि, कुछ संबंधित है: आप ऐसे मूल्यों को उत्पन्न करना चाह सकते हैं, जो सबसे बड़ा मान पहले उत्पन्न होता है: : - use_module (पुस्तकालय (clpfd))। अधिकतम (एक्स): - एक्सएस = [ए, बी], एक्सएस इंस 1..5, लेबलिंग ([अधिकतम (ए बी (ए-बी)), एक्सएस)। ? - अधिकतम करें (एक्सएस) एक्स = [1, 5]; एक्स = [5, 1]; एक्स = [1, 4]; एक्स = [2, 5]; Xs = [4, 1] ... तो यह सबसे बड़ी दूरी से शुरू होता है और फिर इसे एक-एक करके कम करता है। सबसे पहले यह व्यवहार आश्चर्यचकित हो सकता है लेबलिंग हमेशा पूर्ण होता है, हमेशा समाप्त होता है, और कोई बेमानी समाधान नहीं देता है। यह एक बहुत मजबूत गारंटी है! यदि आप अब पह

json - Returning complex KO ViewModel to controller -

I tried to follow this post here, but it was a bit intolerable. I have a ViewModel when I dump JSON as a model on this page so it looks like this: {"selectedCatalog": 7, " Catalog ": [{" name ":" EDI outbound "," list id ": true," gross ": true}, {" name ":", "" truth "," total ": true}, {" name ":" Active "," active "," active "," adwords "," active "," active "," active "," active "," active " "PdbColumnId": 2, "selectedColumn": 2}, {"pdbColumnName": "category", "outbound columnname": "category", "PDB column ID "PdbColumnName": "Inventory", "Outbound columnname": "Inventory", "PDB column ID": 4, "Selected column": 4}, {"pdbColumnName "," Man

delphi - How to free object contained in another object -

I am using Delphi 2010 and I have a question of reclamation of the object. And if there is an exception, then I want to clean both TProduct and TPart. How do I properly tie the object contained? // The clause is defined as this TProduct = class (trimotable) Private F name: string; FAge: integer; FColor: string; FPart: TPart; Published property name: string FName type FName; Property Age: Read Integer FAge Write FAge; Property color: FString FString to read string; Property Part: TPart FPart Write FPart; End; TPart = Class (Trustable) Private F Name: string; FColor: string; Published property name: string FName type FName; Property color: FString FString to read string; End; // Then in a method, the code will get information from the database, MyFunction to create objects and fill them functions: TProduct; Results start: = zero; Query.Open; Results: = TProduct.Create; Try the result. Name: = qery.FieldByName ('NAME'). AstString; Result.Age :. = Query.FieldByName ('a

autorun - Auto run ruby script on windows start -

मैंने एक रूबी स्क्रिप्ट लिखी है। स्क्रिप्ट mysites एलेक्स रैंक प्राप्त करती है और उस मान को बचाने के लिए एक पाठ फ़ाइल लेकिन अब मुझे मैन्युअल रूप से इस स्क्रिप्ट को चलाने के लिए है। क्या मैं इसे स्वचालित कर सकता हूँ? उदाहरण के लिए, मैं इस स्क्रिप्ट को विंडोज़ स्टार्ट या क्रोनबोज़ सेट करना चाहता हूँ। क्या यह संभव है? मेरी स्क्रिप्ट: की आवश्यकता होती है 'नेट / http' की आवश्यकता होती है 'rexml / document' की आवश्यकता 'तिथि' url = 'http: //www.example .com 'xml_data = Net :: HTTP.get_response (URI.parse (' http://data.alexa.com/data?cli=10&data=snbamz&url='+url)) .body doc = REXML: : Document.new (xml_data) doc.elements.each ('एलेक्सए / एसडी / पॉप्युलैटी') | ele | $ alexaValue = ele.attributes ["TEXT"] तोड़ने का अंत $ आज = ​​दिनांक। $ $ गूंज = "# {$ $} - # {$ alexaValue} - # {url} \ n" फाइल। ओपन ("alexa.txt ", 'a +') {| f | | f.write ($ echo)} cmd.exe का शॉर्टकट बनाएं और डाल दो यह

ios - In Core data unable to store objects -

Here I try to add a list of objects to my array form which try to add that data Has been doing. Features. #import "ViewController.h" #import "model.h" #import "coredataManager.h" @interface view controller () {NSMutableArray * entries; } @end @ Implementation View Controller - (zero) viewDidoad {entries = [[NSMUTABARARROL] INST]; coredataManager * coreobj = [[coredataManager alloc] init]; Model * obj = [[Model alloc] initWithContents: @ "1" alternate link: @ "1" DownloadURL: @ "1"]; Model * obj2 = [[Model alloc] initWithContents: @ "2" Alternate link: @ "2" DownloadURL: @ "2"]; Model * obj3 = [[Model alloc] initWithContents: @ "3" Alternate link: @ "3" DownloadURL: @ "3"]; [To add entries: obj]; [To add entries: obj2]; [Add Entries: obj3]; NSLog (@ "% @", entries); [Corobe's Store Value: Entries]; [Super viewedload]; // Setup an additional after l

automated tests - Geb / Groovy - Page content not recognized when used within other Page Object method -

When I click on a button, I have to render for some dynamic content. When I waited, it works correctly to stop the examination. However, I want to wait for a method inside the Thapton object, so I do not always need to call for waiting, after every click, but when I do this fails stating that this property Can not get it. This is not working: The class landing page extension page {static content = {resultsBtn (result: page) ($ ("button", id: " The results page expanded {page {static content = {results {$ ("div", id: "listresults"), }}}} ShowResults class GebReportingTest {@Test Public Zero DisplayPrint ()) receives landing page (relationships) ()}} Some such situation says, "No such asset: Results for the class results page " Is it possible to reference the content within the other page objects from other page objects? EDIT: I think there is more of a Groovy specific thing than Gabe. I'm not sure it is possible to use bin

ios - Animating Subview's Frame In A UIScrollView -

मेरे पास क्षैतिज UIScrollView के अंदर एक सबव्यूव है। उपव्यू के फ्रेम जब ऊर्ध्वाधर UISwipeGestureRecognizer ट्रिगर किया जाता है तब परिवर्तन होता है। हालांकि, यदि उपयोगकर्ता गलती से तिरछे स्वाइप करता है, तो सबव्यू का फ्रेम वास्तव में नहीं बदलता। ठीक है, तकनीकी रूप से यह करता है, लेकिन आप बहुत तेज़ फ्लैश देख सकते हैं - जहां आप इसे बदलते हैं, लेकिन फिर तुरंत अपने मूल फ्रेम में वापस जाएं । पेजिंग सक्षम है - तो क्या यह वर्तमान पृष्ठ के स्थान पर वापस चला जाता है? मैं कैसे उपज की फ़्रेम को बदलने के लिए (वापस वापस बिना) कैसे प्राप्त करूं? मैंने कई विकल्पों का उपयोग करने की कोशिश की है जैसे कि UIViewAnimationOptionAllowUserInteraction | | UIViewAnimationOptionLayoutSubviews। वर्तमान में मैं animateWithDuration: देरी: विकल्प: एनीमेशन: पूरा होने पर कॉल करता हूं जब एक ऊर्ध्वाधर स्वाइप पंजीकृत है आपको अपनी विधि के अंत में CGRectMake का उपयोग करने की कोशिश करनी चाहिए। subview.frame = CGRectMake (x, y, width, height);

xml - transformation of RSS date in XSLT -

कई आरएसएस-फीड्स से उत्पन्न & lt; pubDate & gt; के लिए मूल्य (xml में) @ डीमित्र ने एक अच्छा समाधान प्रदान किया, जिसमें उनके जवाब में सप्ताह का दिन शामिल है: यहां सवाल यह है कि कैसे substring () के लिए pubDate को उस उत्तर के अनुसार अनुकूलित करें जब सप्ताह का दिन pubDate का हिस्सा नहीं है, तो ऐसा है: 17 Feb 2009 00:05:25 +0100 इसके अतिरिक्त यह जानने के लिए सुविधाजनक होगा कि कैसे एक अतिरिक्त आरएसएस-नोड को लागू करने के लिए जैसे & lt; लिंक & gt; या & lt; शीर्षक & gt; उदाहरण के परिणामस्वरूप & lt; pubDate & gt; और & lt; लिंक & gt; (या उदा। & lt; title & gt; ) पर सॉर्ट किया जाएगा। फीडबैक के लिए धन्यवाद। यदि आपके सभी pubDate के पास नहीं है सप्ताह के दिनों में आप केवल प्रत्येक उपस्ट्रिंग के शुरुआती बिंदु से क्रमबद्ध बयान से 5 अवयव लेते हैं: & lt; xsl: sort डेटा-प्रकार = "संख्या" क्रम = "अवरोही" का चयन करें = "concat (substring ( PubDate, 8,4), $ vMonths [@name = substring (वर्तमा

camera - Setting Android Photo EXIF Orientation -

I have written an Android activity, which captures a picture from the program, I get an image with the correct XIP orientation data I want to save as JPEG (like the original Android camera app comes automatically). There is actually a method to take photos (I have removed the try / catch block): Private zero LEphoto () {camera = Camera.open ( ); Surface structure DummySurfaceTexture = A mixture of new surface (0); camera.setPreviewTtexture (dummySurfaceTexture); Camera.startPreview (); Camera.takePicture (empty, null, jpgCallback); } ... and callback: Private camera. IllustratorCollectionbackJpgCallback = New Camera.Picture Callback (Public Void (Byte [] Data, Camera Camera on Chitrakoot {releaseCamera (); SavePhoto (data); }; The picture is taken properly, but my problem is that EXIF ​​data shows that orientation "image orientation: top, left hand" regardless of device's orientation. , So that when I upload the photo, it will rotate or rotate. Do I need

jquery - Stop a setInterval function -

When I switch the button "STOP" and click, I try to set this interlabel function I am here. The word START is changing in STOP and vice versa, but the random BG color change will not stop and instead it will be compound. $ (document) .ready (function () {function randomColor () {return "#" + Math.random () .toString (16) .Slice (2,8);} $ ("Button"). Click (function () {var $ go = $ ("button") .txt (); if ($ go === "START") {setInterval (function color () ($ ( "CSS" ("background color", "white") $ ("button") ("button") ("body"). CSS ("background color", random collar ());}, 300) Stop ");} Other {// tried a clean interval and are doing a new $ (" body "). Text (" Start ");}}});}); Please let me know if any link or additional information is helpful on the site Gee. Thanks! you the value returned by setInterval in a code save will

html - iOS's UIWebView loading URL with apostrophe -

The one app I have a UIWebView uses to load a local HTML file Does. The file is called "Newton's second law. Html" for example, but due to that epostrophe, the file will not be loaded. I have tried to take Apostrophy after that. So my question is how can I load a local url with apostrophy? Is there a key to escape that I can use? I loaded the file from this line: Failpath is the full path to the file [_ webView loadRequest: [NSURLRequest requestWithURL: [NSURL fileURLWithPath: filePath]]] ; Thanks! What's the use of you have tried to load the file: < code> NSURL * url = [NSURL URLWithString: @ "/ path / to / your / file / newton \ 's.html"];

java - GAE/Datastore: How to model my data for frequently updated statistics? -

Say I have a unit that has been called user and I want to store statistics about the user, for example how many pages they saw. My dilemma is that I should store a property called "Page-Overview" or a new user called "UserStatistics", which will store all the statistics and store the data in the user unit as it will be linked to a single user. Because I will need to use many transactions to get the information that related to the institutions that will be otherwise very small, only to read, and needs related, because I think It was probably better to make a new unit for this data to reach (memory) a lot ... if I store these data in the original unit, will it create multiple overhead, or is it B Electricity is no more? If I do a lot of transactions on one unit, will it slow down reading from it? "itemprop =" text "> You should store updated data often in a separate unit. Every time you update an entity, you spend writing costs on each indexed

Trying to understand a java function parameters -

My teacher has asked a question and here it is: Write a program that uses input words Say in an array. When a word is entered twice, then the program will stop using the following method: Stable Boolean search word (string s, string [] arr) // If true, in AR Is found, wrong otherwise When the input is complete, then your program will output to the list in the ordered order. I'm a little lost on this parameter of the function string [] arr what type of parameter input is searching for Here's my code. public static zero main (string [] args) {c = new console (); String word [] = new string [50000]; {C.print ("Input word:") for (Int i = 0; i & gt; -1; i ++); Word [i] = c.readLine (); Keywords ("apple", what goes here?); }} Fixed Boolean keyword (string s, string [] term) {return false; } At any time, I try to insert some sort of array or value in the spot, such as findWord ("hello", the word [ 0]) Or whatever I get the