Posts

Showing posts from March, 2010

MySQL returned datatype and python outputs different type for different functions -

I have a lot of problems with MySQL returns and it has been inserted into a QT table with Python. To use data = cursor.fetchall () : for i category (data): sqlTableWidget.setItem (index, i, QtGui.QTableWidgetItem (data [i]) index = index1 Basically I would have kept str () around the return, and it used to work for everything, except its That when I am abroad Unicode problems on language and date time so now I did not insert str () and foreign language on the table. However, now there are some problems with some strings 1) I do not include that time When I type type (data [i]) , it returns datetime and when I call it the data [i] = data [i] .strftime ( "% Y-% m-% d% H:% M:% S") It tells me 'Tupal' does not support object item assignment 2) Then I Just passed for that time. Now I try to get the integer to display. If data [i] == 1: print data [i] print type (data [i]) data [i] = str (data [i]) / Pre> This results in the following: gt; 1

c# - Caliburn.Micro doesn't call my method when SearchBox fires an event -

मेरे विचार में मेरे पास है: & lt; SearchBox x: name = "SearchBox" सेमी: संदेश। अटैच = "[इवेंट क्वेरी सबमिट की गई है] = [एक्शन खोज (सर्चबॉक्स। टेक्नोलॉज़ी)]" / & gt; ViewModel: सार्वजनिक शून्य खोज (स्ट्रिंग क्वेरी) {...} लेकिन यह ' टी मेरी विधि कॉल मैंने विधि को बाध्य करने के लिए एक लंबी सिंटैक्स की कोशिश की लेकिन यह अभी भी काम नहीं कर रहा है जैसा कि मैंने नोट किया है कि यह ओवरराइड ISearchBox ईवेंट (क्वेरी चेंजेड, क्वेरी से सम्बद्ध, आदि) के साथ ही काम नहीं करता है, लेकिन उदाहरण के लिए टैप किया गया यह काम करता है अच्छी तरह से। thx क्योंकि आपके द्वारा बनाई गई विधि का अधिकार नहीं है पैर प्रिंट ... सार्वजनिक शून्य खोज (SearchBoxQuerySubmittedEventArgs args) {} के हस्ताक्षर की उम्मीद है हाथ होगा [ईवेंट क्वेरी सबमिट किया गया] = [कार्रवाई खोज ($ eventArgs)]; मैं सहमत हूं कि यह काम करना चाहिए था लेकिन कभी-कभी साधारण ईवेंट्स जैसे कि एक स्ट्रिंग सबमिट को पकड़ा नहीं जा सकता है, ऐसा लगता होगा कि यह होगा .. यह भी मेरे नियंत्र

c# - OleDbDataReader query syntax error in asp.net -

I am trying to execute a query that separates the separate database from OleDbDataReader, but in the query string Error getting, note that this query is correct and successfully running in SQL Studio Manager but in the net I get this error OleDbDataReader reader = myCommand.ExecuteReader (); Error message: Wrong syntax near 'PR1' My code is "long query string" protected zero page_load (object sender, event aRGS) {string stroke string = system. Configuration. Configuration Manager. Connection strings ["Workflow"]. ConnectionString.ToString (); String sqlstr = "Selection Collages (Angghier, 'Total') [Angdier]," + "SUM (in case when ASTAT = 'distributed' then the second second end) [Delayed]," + "SUM (full) "SUM" (case when a.Status = 'pending' then total second zero) as [pending], "+" SUM (case when (whole) a.Status = 'Rejected') then total zero ) [Disclaimed], &quo

sql - Insert data into multiple tables in single transaction in jdbc -

मेरे पास एक टेबल है ऑर्डर जिसमें फ़ील्ड ऑर्डरिड | स्थिति | cid | और अन्य तालिका Order_Details ओडर_विवरण _id | आदेश_आईडी | आइटम आईडी मैं चाहता हूं दोनों लेन-देन में एकल लेनदेन में मान सम्मिलित करें जैसे कि कोई ग्राहक एक आदेश रखता है ताकि ऑर्डर आईडी उत्पन्न हो और उस order_id को Order and Order_Details तालिका में डाला जाना चाहिए। लेकिन मैं जेडीबीसी में कैसे करूं ?? आप इसे false पर autocommit सेटिंग कर सकते हैं: < pre> dbConnection.setAutoCommit (गलत); // एक लेनदेन ब्लॉक शुरू करने के लिए // अपने यहाँ दो सम्मिलित करते हैं dbConnection.commit (); // एक लेनदेन ब्लॉक समाप्त करने के लिए पूर्ण उदाहरण के लिए यहां एक नज़र डालें:

algorithm - Running time for binary search tree -

The textbook says that the number of divided operations is surrounded by the height of the tree, which is O (Logan). I did not understand why it is surrounded by tree height? Can anyone explain this? when you start with root, and as far as you can do something down the down On the other hand, the maximum nodes you can come in are equal to the height of the tree (this should be easy to see and should be very much by definition, height of the tree). Now that you are searching in a binary search tree, you start with the root, and, in each step, you see the current node, pauses, moves left or goes right (Left or left side can be considered as a division operation) In this process, the same number of nodes is included, as mentioned above (some way is going down the root), in which many nodes have to face , And this light No more split operation, the tree height. Also keep in mind that the height of the tree is only O (log n) if the tree is balanced (see more).

authentication - Angularjs and SSO (SAML2) -

I have come with this fingerless thing, and I think this is very good, really working on my last time, many Problems have to be faced with Web Apps with just a few lines of code, now that I did not find or was looking at bad places is the security of the Kangarooz app with the SSO (simple SLAPP identity provider). How to deal with this? The build that I am going to build will use the pyramid structure as the backend restore API and Kangaroo (I want to) for the foreground. But how to protect the application from unauthorized access except for SO login, examples of any implementation or lesson working on the same case (can be with PHP, Ruby backend and SSO etc) will help. "Post-text" itemprop = "text"> I do not think the Pyramid has any direct support for SAML authentication. I suggest using third party applications for SAML, for example Shibbo The Layth SAML is done on the communication server side, so angular will not need any integration.

java - How to handle spring tag's if it is not checked? -

I have a scenario where an unchecked checkbox null value passes and Neur Pointer generates results in the exception. Can anyone tell me how the form can handle: checkbox if it is not checked? Code in jsp & lt; Form: checkbox path = "document list [$ {DocStatus.index}] .YnChkBox" cssClass = "genradio" value = "- 1" onclick = "selectkeybox (event.keyCode, this)" /> Any help is appreciated Code> validation interface, valid () the method as your spring form tag to all assumptions . To validate one of the forms you have Hope it helps !!

Java parameter value changes itself -

Today, while writing a simple program, I found some weird behavior. I have written a simple sorting method that gives an array of another array. public double [] sortime (double [] array) {double] narray = new double [array.length]; Narray = array; For (int i = 0; i & lt; narray.length; i ++) {for (int j = 0; j & lt; narray.length; j ++) {if (narray [i] & lt; Narray [j]) {double temp = narray [i]; narray [i] = narray [ja]; Narray [ja] temporary =; }}} / TODO automatically returns the generated method stub; } In my driver class, when I told this sort my method, it also updated my test diagram as testArray is out of scope for sortmeme method, then when test array Has been sorted? double [] testArray = {3, 6, 2, 5, 8, 4, 1, 7}; Double [] results; Results = Apestorts (testers); Af.printMe (results); In your sorting method, you specify the context Using array to narrey using narray = array; . This means that narrey is pointing the same code as arra

sql server - TransactionProxyException is thrown while creating a BizTalk Group -

I am trying to create a BizTalk group on BizTalk Server 2013 using this document: [Group] [Group] failed to configure with error message [exception was thrown to [System.EnterpriseServices.TransactionProxyException].] < / blockquote> For additional information: While this configuration is doing, I have seen the database server and found that it has successfully completed 3 databases (Bi ZTalkMgmtDb, BizTalkMsgBoxDb, BizTalkDTADb), but after it fails for some reason, this builds rollback and deletes the database created. To make some notice that while rolling back the changes, all created databases are deleted BizTalkMgmtDb which fails to drop. There are also log lines before logging in: 2014- 04-22 12: 24: 10: 072 9 [INF O] WMI deployment 'C : \ Program Files (x86) \ Microsoft BizTalk Server 2013 \ Microsoft.BizTalk.GlobalPropertySchemas.dll '2014-04-22 12: 24: 14: 0563 [Warning] AdminLib GetBTSMessage: hrErr = 80070002; Msg = the system ca

Detecting Drag and Drop event on Java FX? -

I have found some circle objects that I have a line when Drag from the circle. I started with this code to test the drag and drop coordinate: circle node = new circle (15.0); Nodo.setOnDragDetected (new event handler & lt; mouse Event & gt; () {@ Override Public Wide Handle (Mouse Event Event) {Coordination [0] = Event .getX (); Coordination [1] = event.getY ();}} ); Nodo.setOnDragDropped (New EventHandler & lt; DragEvent & gt; () {@Override Public Invalid Handle (Dragravent Event) {Sync [2] = event.getX (); Coordination [3] = event.getY (); System out.println (coordination);}}}; When I leave the mouse, when no circle is printed to console What is the correct perspective and how should I draw a line when dragging me. To detect drag and drop, this Follow the approach: // // Mouse preceded // -------------------- - nodo.numuspressproperty () Set (New Event Handler & lt; Mouse Event & gt; () {@ Override Public Wide Handle (Mouse Event Ev

How to save a VERY LARGE .rda file in R package -

I'm eager to save two 460 x 5000 numeric matrix in my R-package. Following the instructions given in: I saved the object as: save save (mat1, file = "mat1.rda", compress = "xz") (mat2 , File = "mat2.rda" However, the resulting R-objects are large (8.7 MB and 8.9 MB) and RMD checks - AS-Crane gives me notes: * Install package Check the size ... Note The installed size is 20.1Mb ​​sub-directory of 1Mb or more: Data 20.0Mb In my understanding, no R package should be given to CRAN Can not access that which does not "pass" (i.e., no notes or warnings) RCMD checkle-as-crane. Is there a way to reduce dataset? Is it really necessary to include those files? I see several options: A small matrix Include subsets, which you use in instances. Generate on-the-mike matrix, e.g., random number Keep up with. somewhere to download the files, and do not make sure that the examples performed.

javascript - height of page on scrolling -

How do I get the height of the page on the scroll? Is it possible to determine how many users have scrolled the page and it determines the length of the cover. I have tried: var scroll = $ wnd.scrollTop <> javascript But this is not giving results? Am I doing this wrong? Try using it. Public Fixed Country int getScrollTop () / * - {return $ wnd.pageYOffset; } - * /; For more information, take a look at

Magento - Show shipping methods by default on cart page -

I would like to show the shipping methods available on the Magento Cart page all the time. I have Magento 1.8.1 which uses destination-independent shipping methods. The cost of shipping is the same where the products are being sent. By default, some elements of a destination address are required before the shipping device is shown. I want to show shipping methods by default on the cart page. Here is a module that adds a drop of cart to the cart page Select the shipping method available for the total and it will update the price of the car. The source code of the module is also available.

asp.net - Form Method.GET: Only show populated inputs in Query String? -

I am working in an ASP.NET mvc application and I have a data table. I have a form with different inputs to filter the table above the data table. The form is using the GET method for transferring form data from the server, which works fine, although though I'm the only thing (like the manufacturer's name) I want to filter, all other input parameters are also posted in the query string! Like: http: // localhost / mysite / page1? Tab = Pending & SortBy = & SortAscending = False & amp; Manufacturer = Toyota & amp; Model = & amp; RegNumberFilter = As you can see, I only have the creator filled, but everything else is stored! Is there an easy way to clear my URL so that only the filters set are displayed in the query string? My filter form is below: & lt; Div class = "panel-body" & gt; @ (Html) ({@ole = "form", @class = "form-inline"})) {@ Html.Hidden ("tab", model: "indices", "page

jquery - How to pass variable value between different html pages in javascript -

I want to give the value of the selected page list item to another page, that means if If I select ABC from the list, then this ABC value passes through the next HTML form and it should open only that profile page. There is no way that I can use this variable in different HTML pages. $ ('.ui-li-icon li') (function () {var index = $ (this) .index (); text = $ (this) .text ( ); Alert ('index:' + index + 'and text' + text); I want to send my text to my profile.html , Which has the javascript function profile () . I want to pass this text in the function call such as profiles (text); I tried to declare var text above the function call, but still it Not working Let me tell that PLS is another way. You pass the value as a URL fragment In your click function, open the '/profile.html #' + text The URL fragment is found in your profile. Sample code: To navigate to the profile window.location.href = '& lt; profile.html &

arrays - c (and objc, and c++ and objc++) - char* argv[] -

I am cloning the echo command and it is more complicated than what I was thinking. Here's my problem: A four * argv [] How does it work? I know how my string [] works, but there is no strange way to create a string: Is it an indicator of array of characters or array of characters? Why I * argv [n], it shows me n logic, not four char ... can cheers behaves four argv [] such as char ** argv will behave you a Char argv [] [] can also be used in the same way. By default, when you call * argv , you should enter Argv [0] and * argv [n] gives argv [0] [n] edit: change argv [x] a std :: String in: std :: string s (argv [x]); s is a standard string at that point. But keep in mind that you should have a zero ended string, it's four ** ! will not work for random binary data,

WSO2 - Where in the source is the link between SCIM interface and IS identity management? -

I've got Sharon (SCIM) in the WSO2 source code and it's working. But that source tree has only one sample server implementation, how do I implement the underlying identity management of WSO2 in the WSO2 source tree, do I apply it? implementation of the WSO 2 Chain SCIM protocol, which can be used to support SCIM based provisioning support in any application. Can be done for. In the WSO2 identity server, it exposes its SCIM completion through SCIM Provider component. And it will underline that the user will call the core identity management capabilities. Additional information about this implementation can be found.

android - Draw Border on HorizontalScrollView Programmatically -

I'm trying to attract a border on the horizontal scroll view program, and fill in with a different color. I have tried different aproaches without success, I can attract only one thing at a time ... here I have tried the last code. Private Zero applyViewBorder (see layout, string border color, string fill collar, int border width) {if (Fillcolor == faucet = boundary color == empty) return; RectSpeed ​​Rect = new RectSpep (); Size Drainable RectSpeed ​​Darebull = New Size Drainage (Rect); Color Paint = rectShapeDrawable.getPaint (); Paint.setStyle (Style.STROKE); Paint.setStrokeWidth (BorderWidth); paint.setColor (Color.parseColor (BorderColor)); If (android.os.build.VERSION.SDK_INT & lt; 16) {layout.setBackgroundDrawable (rectShapeDrawable); } And {layout.setBackground (rectShapeDrawable); } Paint.setStyle (Style.FILL); paint.setColor (Color.parseColor (fillColor)); If (android.os.build.VERSION.SDK_INT & lt; 16) {layout.setBackgroundDrawable (rectShapeDrawable); } An

asp.net web api - In Web Api / Owin architecture, where are requests to '/token' handled? -

I am trying to understand asp.net web API personal accounts authentication and authorization. I have to see a lot of tutorials on the web. In a nutshell, when a user provides the username and password, the API raises the issue of a token that the customer will use it in the post-API call to identify himself. The token is received by a request to the user agent, usually: It appears that the path is set in the startup class: tokenend pointpoint = new pathstring ("/ token") My problem is, can not I find any controller methods that match that path How does this work? When you create a new project in ASP.NET with personal authentication, the solution is to handle the authentication request Has been created with an OAuth provider. If you look at the solution, then you should see a provider folder with a class ApplicationOAuthProvider. This class applies all the arguments. Authenticate your website to the website configuration is set to startup so that you can cus

java - avoiding class creation while making use of polymorphism -

I do not really have very practical experience with Java or above, so now I have a problem that could actually work It's easy, but where I'm not sure what an elegant, top-oriented solution might look like. So here's a simple raddin: I want to write some type of calculation app, which includes the first of many ways: < [...] Fixed double cosine (double x) {...} and even further. Some other static method would then calculate some kind of derivatives that would include the derivative of one of these tasks. If we pretend that there was no way to estimate derivatives, then the easiest solution for me was one way for me to wrap each method above in the classroom and apply those interfaces 'debrevibal' to those classes. Called 'evaluation evaluation', for example: Interface Differential (double evaluation) directive (double X); } Class Signable (Stable Double Assessment) (Double X) {Return ...; } Evaluation of public double evaluation (double X) {

inversion of control - IOC using AutoFac for internal class -

I have an internal class that is internal visible to a service factory. It has also inherited a public interface When I want to use my functionality in my application, I am announcing the object for the interface and it can be accessed through the special factories I'm getting immediate for Now we want to make an IOC for this class in my class of MVC and I controller. This class has been internal, I can not register it in global.ascx For example, when I am writing a builder. Registration Type (). As (). InstancePerHttpRequest (); General SSVC is internal, it is compiling time error as a service. builder.RegisterAssemblyTypes (typeOf (SomeOtherTypeInTheSameAssembly) assembly.where (T => IsEssignableFrom (T) type) .AsImplementedInterfaces (); < / Div>

java - Android BinaryFactory.decodeStream always return null -

I am trying to download the image and decode bitmap for bitmap, but decode stream always gives space is. I have raised many similar questions, tried many examples, but the solution was not found. Here is my code: the public class extends the main activity activity {@Override protected Crete on the zero (Bundle saved instance) {super. Instant state); SetContentView (R.layout.activity_main); } Public Zero Download Button (see V) {String image url = "http://www.picgifs.com/bird-graphics/bird-graphics/elf-owl/bird-graphics-elf-owl-527150.bmp"; New thread (New ImageDownloader (imageUrl)) Start (); } Public Zero Show Image Button (see V) {bitmap image = ImageHandler.getImage (); If log (image == zero) E ("error", "no image is available"); Else {ImageView imageView = (ImageView) findViewById (R.id.imageView); ImageView.setImageBitmap (image); }}} Class ImageHandler {static protected list & lt; Bitmap & gt; ImagesList; Fixed public Zero addImage (

asp.net - TVP - Failed to convert parameter value from a SqlParameter to a IEnumerable`1 -

I am trying to create a general purpose function that can accept TVP. I'm getting the error 'Failed to change the parameter value from an SqlParameter to an IEnumerable`1.' Param.SqlDbType = SqlDbType.Structured sqlProvider.ExecuteNonQueryV2 ("sp_Save", CommandType: StringProver, Ultimate) - The Ultimate New SqlParameter ("@ ParName", as GetTVP). -------------------- Public Function ExecuteNonQuery (ByVal as string, ByRef returnValue as integer, byVal ParamArray parameterValues ​​() as an object) Integer SqlConnection = SqlTransaction as some low transaction in the form of slow connection as SqlCommand = nothing as command = R0 = 1 SqlConnection as nothing MyconnectionString command = new SQL command (spname, connection) command.CommandType = CommandType.StoredProcedure connection.Open () SqlCommandBuilder.DeriveParameters (command) Me.SetParameters (command, parameterValues) transaction = connection.BeginTransaction () command.Transaction = transa

python - How do I get dimension data from Analytics reporting api -

I am trying to get statisitcs on top browsers used for my site using analytics reporting API v3 . I'm using the Python version of the API. I am able to query the API and I get a result. I ask using it: res = service.data (). Ga (). Get (Aids = 'ga:' + profile_id, start_date = '2014-01-01', end_date = t, matrix = 'ga: session', dimension = 'ja: browser'). Execute () But I do not know how to use the result data. My goal is to get the top 5 browsers, can I get this information either directly or I have to calculate it myself, how can I access data in rows and rows of results? All this work should have been done in a way so that your numbers are ordered first So set the maximum result to 5, in this way you should only get 5 rows back. res = service.data (). Ga (). Get (id = 'ga:' + profile_id, start_date = '2014-01-01', and_data = t, matrix = 'Ga: sessions', dimension = 'ga: browser', sort, '- ga: se

java - JPA throws no EntityExistsException but generates a duplicate row (auto generated PK) -

I'm new to JPA and I'm using a little bit in the hope of knowing the unit life cycle model. I expect EntityExists to be an exception in the code given below. However, instead of throwing the expected exception, it just creates a new line in the database table with a new primary key (increased by one). Can anyone explain this? I suspect that there may be something with my auto-keying primary key in the respective table with @Generated Value Annotations on my ID field. Below you can find 3 snippets: I try to run the code, my unit definition and my table design. I would like to thank you in advance for shining your light on your misconceptions. Merciful ps: I use excelping as APLL and a derby database script: Teacher Teacher = New Teacher ("John", "Do", "English"); // Continued John Doi EntityManager em = Perseverence.createEntityManagerFactory ("jpatest"). CreateEntityManager (); em.getTransaction () start () .; Em.pers

python - Is there way to check feature deprecation against django version? -

Some features are disliked with newer versions of the system, so there is no way to check it on an existing project code. Github. What a tool can do this I think that in a way it may be possible to run through a special edition of Django / Python And then check for errors. I'm just looking for something more elegant or direct, as it says - "Note that this feature has been disliked" , something that can be done in a strongly typed language as Java. If someone wants to make such a device, then it may be possible to have a starting point for it. I think this will be in unit tests for your project. If your testing exercise code that will be demoted to you in the future version of Django, you will find If you jumped for a version of Django where the feature has already been disliked, you will get an exception and of course unsuccessful testing. You can tell exceptions to the Python interpreter for promoting warnings, which can lead to testing failure.

How to implement email confirmation when removing a user in Yii -

In my project, I need to implement the following functionality: - When the user decides to delete his or her account, Before, an email must be sent to a user by confirming the decision by emailing an '$ Deletion URL'. I'm using the Yiimailer extension and although it's working fine, I'm not sure that the user's removal About me and other conditions Where and how should be kept. This is my verb: delete: Delete public function action ($ id) {$ this- & gt; LoadModel ($ id) - & gt; Remove (); If (! Isset ($ _GET ['ajax'])) {$ this- & gt; Redirect (isset ($ _ POST ['returnUrl']) $ $ _POST ['returnUrl']: array ('administrator')); }} I was researching on the internet and found that remove a CActiveRecord safe method () before the protected function (delete) {If ($ this- & gt; Heaven Handler ('On Banner Delay')) {$ event = new CModelEvent ($ this); $ This- & gt; OnBeforeDelete ($ event); Return $ e

git - mvn clean install+ repo.maven.apache.org: No address associated with hostname+ org.apache.maven.plugins:maven-clean-plugin:pom:2.5 -

I'm trying to setup some of the github for which Maven requires the following link: Try to setup the server I get an error when doing: mvn clean install Error in resolving the version for the plugin 'org.apache.maven.plugins: [local (/ home /gpadmin/.m2/repository), project plugin (file: /// home / gpadmin / Downloads / fire-samples-master / cache-demo / lib /) from the repository from the Maven-Jars-plugin 'central [link1]] : Plugin any The plug-in was not found in the repository - & gt; [Help1] I provide version definition 2.4 / 2.3 / 2.5 in POM.XML and below is an error that I am facing for all cases: [error] plugin [link 2] or its dependencies could not be solved: [link 2] failed to read artifact descriptor: Artifact [link 2] can not be transferred to / from central ([Link 1]): Repo.maven.apache.org: No address associated with hostname - & gt; [Help1] [link3]: Plugin [link 2] or one of its dependencies can not be solved: [link 2] failed to read th

google earth plugin - GEPlugin does not load KML files on VB.NET -

मैंने पर स्थित जीईप्लगिन का उपयोग करके एक ऐप विकसित किया है। I GEWebBrowser और GETreeView का उपयोग करें, और दोनों अच्छी तरह से काम करता है। मैं केवल नियंत्रण पर स्थानीय किमील फाइल लोड करता हूं, इसलिए ऐसा करने का तरीका, "KML_Samples.kml" फ़ाइल को वेब्रोएट निर्देशिका में कॉपी करना है , और फ़ंक्शन को निम्नानुसार कॉल करें: GeWebBrowser.FetchKml (http: // localhost: 8080 / KML_Samples.kml) हर बार मैं इसे कॉल करता हूं विधि, GeWebBrowser_KmlLoaded ईवेंट को सही तरीके से लॉन्च किया गया है। हालांकि, मैंने हाल ही में जाँच की है कि लोड किए गए दो या तीन प्रथम किमीले फ़ाइलों के लिए यह ठीक काम करता है। इस दो या तीन फ़ाइलों के बाद, जब मैं एक नई कि.एल.एल फ़ाइल लोड करने की कोशिश करता हूं, तो मैं देख सकता हूं कि KML_Samples.kml फ़ाइल को अपडेट कर दिया गया है, लेकिन GeWebBrowser_KmlLoaded ईवेंट लॉन्च नहीं किया गया है! मैंने कोशिश की है GeWebBrowser.FetchKml (http: // localhost: 8080 / KML_Samples.kml) और रेखा पर एक ब्रेकपॉइंट सेट करके चरण के द्वारा ऐप चरण को निष्पादित कर

python - wrapping class method in try / except using decorator -

I have a general purpose function that sends information about the exception of application lock I use the exception_handler function in the way of classes I do The app log handler, which is passed by the exception_handler and which makes Jason String, is actually sent to the logfile. It all works well def exception_handler (enter, then expire = false):. Exc_type, exc_value, exc_tb = sys.exc_info () file name, line_num, FUNC_NAME, text = traceback.extract_tb (exc_tb) [-1] log.error ('{0} thrown from module: {1} line {2} (End_num, text). Dell (file name, line_num, FUNC_NAME, text) Finished: sys.exit () <3} ({4}). Format (exc_value, file name, FUNC_NAME, line_num, text) / pre> Thus I use it: (a hyper-simplified example) def __init __ (self): self.log = {A class that applies the application log Is} DEF demo (self, name): try: Except print (name) exception: exception_handler (inside I want to change the exception_handler to use as a decorator for many ways. I am using

highcharts - drilldown on column range -

I'm thinking that someone has attempted to add drilldown to the column range chart. This is an example of what I am trying to do: $ (function () {$ ('# container'). HighChurch ({chart: {type: 'columnrange', Inverted:}, Title: {Text: 'History'}, Subtitles: {Text: ''}, XXIS: {Categories: ['Example 1', 'Example 2', 'Example 3'],}, yAxis: { Type: 'Date Time', Minimum: New Date ('2007,0101') Match-time (maximum): New Date ('2014, 05,01') Match-time (title), Title: {Text : 'Year'}}, Tooltip: True, Plot Options: {columnrange: {dataLabels: {Enabled: Wrong, Formatter : Function} {return.y;}}}}, legend: {enable: false}, series: [{name: 'year', data: [[date.UTC (2007, 2, 2), date.utc ( 200 9, 5, 10)], [date.utc (2009, 6, 10), dated UTC (2011, 9), 10)], [date.utc (2011, 9, 25), dated UTC (2014, 5, 1)]]}]});}); Anyone welcome you. Thank you This really works, especially the main series

jsf - Reload page from backBean -

How can I reload the JSF page after the session is over? I have a filter, when the session is over, it executes this code: res.sendRedirect ("/ index.xhtml"); But when I use a component when Ajax and session ends, nothing happens, so think of always reloading after this line. , But it does not know how to do I think the session has to be reloaded when the session expires. Anyone know that it is possible to do this, or any other better idea? See Balus's answers here: especially the following section: Exxide Exceptions to See < / Strong>

url redirection - How to redirect a wordpress page to a section of an existing page? -

I know that the ways of url redirects to a WordPress page on any other page via the PHP page, and you get the HTML Can link to One section of a page ... but how can I redirect to a section page? For example, on my home page I have different sections, services and projects. I have a service link in the main navigation. How can I open the homepage, but just on the home page OK, so just install this local wp on my test. To add an anchor to the page on which you want to load as part: & lt; An id = "Services" & gt; & Lt; / A & gt; Then in WordPress> Appearance & gt; Select your menu, then on the left side, click on the 'link' Add your page's full URL eg: Add it to look like a '#Service' tag: Then add it to your menu and save it. Then you should be able to click on that button on your menu and click on the page anchor tag upon clicking. If you are having trouble with poundsign / hashtag (#), then you can

Which implicit conversions in Scala are present as default when nothing is imported -

What are the underlying scalas present in default? I use Rich String >, Regex and some others. But is there a list of them all? Where do they apply? SourceFiles? Is there a way to get a list of all possible underlying conversions for the current state of imports? Automatically imported members are: java.lang package members Scala package members predef objects See Scale specifications to members. 9.1 Given that only objects (and package objects) can include methods or values, only There is a place where the underlying value can be found in the standard (without any extra imports) Confirms Predef scala a related package in package object is not).

regex - correct pattern to change array values in bash -

I need to strip 0 before all values ​​of an array, e.g. Change array = (01 02 03 [...] 10 [...] 20 [...]) to array = (1 2 3 [...] 10 [...] 20 [...]) I think I can do it together Can I get rid of the syntax? I have lost much of the syntax for $ {parameter / pattern / string} . Given that it is an array of numbers, instead of trying to replace it string arithmetic : $ a = ({01.20}) $ "one dollar [one [@]}" $ icho "$ {a [@]}" $ 02 ($ 10 ($ 10) ($ 10 ($ 10)); $ $ Echo "$ {b [@ ]} "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Here $ ((10 # $ i)) variable i will be assessed as base 10 number.

perl - script is reading only last line of an input file -

मेरे इनपुट फ़ाइल में मान (list_muni_nav.txt)। प्रत्येक पंक्ति एक फ़ाइल, यहाँ 'परीक्षण' और 'test2' फ़ाइल नाम हैं के लिए एक रास्ता है। / iwmnt / डिफ़ॉल्ट / मुख्य / सामग्री / Munic / workarea / कार्य / templatedata / muni_site / मेरा पर्ल स्क्रिप्ट (नीचे) प्रत्येक को पढ़ना चाहिए I / O इनपुट फ़ाइल में पंक्ति और उन्हें निष्पादित करें। लेकिन, पिछली पंक्ति को छोड़कर लाइनों के बाकी स्क्रिप्ट को स्क्रिप्ट द्वारा नहीं रखा जा रहा है। कृपया परिणाम देखें मेरी $ content_list = '/home/p12/scripts/list_muni_nav.txt'; प्रिंट "\ t ***************** स्टार्ट ********************************************************************** n "; प्रिंट करें \ \ $ फाइल को $ content_list खोलना \ n "; यदि (फ़ाइल खोलें, "$ content_list") {मेरी $ पंक्ति = & lt; FILE & gt ;; chomp ($ लाइन); जबकि ($ पंक्ति नी "") {प्रिंट "\ t ईएएस को $ पंक्ति फ़ाइल करने के लिए आवेदन करना \ n"; मेरी $ setEAVersion = "$ getAttrib-s टीमसाइट / एसोसिएशन /

cookies - AssertionError: Find text within the document body casperJS/phantomJS AND how count the total number of Li with specific class name using casperJS -

I tried this code: var casper = require ('casper') . (); Var mouse = requires ("mouse"). Build (Casper); Phantom.casperTest = true; Phantom.cookiesEnabled = true; Phantom.addCookie ({'name': 'authToken', 'value': '88f115b38585155c1', 'domain': 'localhost', 'path': '/'}); Phantom.addCookie ({'name': 'activationId', 'value': '1', 'domain': 'localhost', 'path': '/'}); Phantom.addCookie ({'name': 'userId', 'value': '1', 'domain': 'localhost', 'path': '/'}); Casper.start ('http: //localhost/history.php', function () {casper.on ('remote.message', function (message) {console.log (message);}); casper.thenOpen (' Http: //localhost/history.php ', function () {this.page.render (' cookie.jpeg '); this.evaluate (function () {console.log (' make it co

asp.net mvc - HTML minimalization IActionFilter or IResultFilter -

I am trying to minimize HTML using filters which are then cached using an orchard . Output Cache Module Public Zero Onset Exacted (ActionActioned Contact Filter Context) {if (FilterContacts.httptext.fix .filter! = Null & Orchard.U.Admin.AdminFilter.IPD (Filter Contains. Requestpeech)) {filterContext.HttpContext.Response.Filter = New TidyHtml (filterContext.HttpContext.Response.Filter, filterContext.HttpContext.Response.Output.Encoding); }} But I have the option of many events (IActionFilter) On-Action Exponent , On Action-Detected (IRSuiltFilters) Personalized Integration , Honorus Tutested Does it matter what I use? Does this make any difference? I do not know why, but all of them at 44ms without the service cache from the IActionFilter I cache Are there. IActionFilter - The average IResultFilter on the local host from cache 4ms - from average cache 8ms to local host So I On-Action Acquired

c# - Can you add a Console program to a WindowsFormApplication program? -

I want to create a C # WindowsFormApplication project to answer and archive. I want to use these answers to generate input for the Selenium Web driver which is a console application. Whether it is possible to join together in two projects, so I gathered my answers on the first form I am running, and when I click on runs on the windows application form to start the console application? If so, how will this be done? If you do not want to suggest the database by Kat0r you use sockets to communicate together can do.

javascript - How to instantiate class dynamically -

इस सवाल का पहले से ही एक उत्तर है: < / P> 28 जवाब मेरे नाम के साथ एक सरणी है कंस्ट्रक्शंस का var arr = ['वर्ग 1', 'कक्षा 2', 'कक्षा 3'] । फ़ंक्शन कक्षा 1 () {this.name = 'class1'; } क्या यह संभव है कि इन वर्गों के उदाहरण बनायें? मेरा मतलब है var class1Object = new arr [0] (); मैंने कोशिश की लेकिन यह काम नहीं कर रहा है (अनक्यूट टाइप एरर: स्ट्रिंग फ़ंक्शन नहीं है)। "वैश्विक" क्षेत्र में परिभाषित कार्य वास्तव में विंडो ऑब्जेक्ट पर बनाए गए हैं , ताकि आप ऐसा कर सकें (जब तक कि कोड को पृष्ठ के head में है, और कुछ विशिष्ट चीज़ों पर न डालें): फ़ंक्शन Class1 () { This.name = 'class1'; } Var className = "Class1"; Var c1 = नई विंडो [className] (); लाइव उदाहरण:

javascript - Removing a ul indention with twitter bootstrap -

Image
I have created an html page with the Twitter Bootstrap and here is the code and the screenshot of the result page & lt; Div class = "container" & gt; & Lt; Header class = "row" & gt; & Lt; A class = "span2" href = "/" & gt; & Lt; Img src = "./ logo .png" alt = "whitscare logo" & gt; & Lt; / A & gt; & Lt; Div class = "span2 offset6" id = "reminder" & gt; Ð ?? Ð ° Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ð Ñ ?? & Lt; / Div & gt; & Lt; Div class = "span2" id = "administration" & gt; Ð ?? Ð'Ð ¼ ¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸? Ñ ​​?? Ñ ​​?? Ð degree ± ?? ÐÑÑ & Lt; / Div & gt; & Lt; / Header & gt; & Lt; Div class = "row" & gt; & Lt; div class = "navbar span2" & gt; & Lt; Div class = "navbar-inner" & gt; & Lt; Ul class = "navy-nav-pills neve-stack" & gt; & Lt

javascript - How to create an image pattern for a path with Snap.svg? -

Failed to create an image pattern for a path element through the library. Is this possible? Create an Paper.image () and then attempting to call Element.pattern () An alternative or work solution. So I wonder if it is possible that using Snap.svg lib. Or should I prepare the necessary ingredients and then add them to the 'SPG' with the necessary hands? Thank you in advance! Do you mean it? var paper = snap (200,200); Var pattern = paper.image ("logo.svg", 0,0,50,50). Pattern (0,0,50,50); Var Path = Paper ("M0,0h200v200h-200z") etter ("fill", pattern);

spring - get method name in Pre/Post-Authorize -

I am writing my permission avilator for Spring Security and the name of the name that I am trying to do For example, for example, without the method name in the picture, I have something like: PostAuthorized ("Hapitation (return object, read ')" Event getEvent (int evendId) {...} and display in public boolean (authentication certification, object targetdomain Bjekt, object permission) {if (targetDomainObject inst. Event) {return Display (authentication, Lcshidomen object permission); } Return targetDiman object == zero; } But I need the name of the method "getEvent" which is available in that. I can pass it manually in the entry call, such as: @PostAuthorize ("Promotion (new com.example.AuthZObject (returnObject, 'getEvent'), 'Read ') ") Event getEvent (int eventId); But is there more automated way to do this? @ Ralph is the very right idea here is the first step to implement custom methodology of MethodSecurity

php - Symbolic link to database not working in /var/www -

I am working on a booklet site with access to real time weather data. Due to its security problems, I am using symbolic links from / var / www to my imagery data to avoid using the SUID. These are simple PNG files, and it's working. Then I wanted real time data based on mouse position hovering over image data. For this, I created a SQLite3 database with the actual values. First of all, as a test, I manually put this database into the site root, and everything worked perfectly. Unfortunately I can not find that database in that place In my site root < pre> ln-sf / path / to / db / db chmod 777 /path/to/db/data.db then to query the file by a simple PHP program Read: & lt ;? Php $ lat = float ($ _GET ['lat']); $ Lane = float ($ _ GET ['lawn']); $ Db = new SQLite3 ('db / sst.db'); # Line6 $ result = $ db- & gt; Query ("Select from current order" ("$ latitude-lat") * ($ latitude-latitude) + ($ latitude-axis

php - Delete image in database -

I am trying to delete specific images in the database via PHP I have a page where all the images are displayed in the database and I wanted a button under each of them, so I could have removed them individually through my ID but I Do not know how. Here is the PHP code to display all the images: & Lt ;? Php while ($ row = mysqli_fetch_array ($ result)) {? & Gt; & Lt; H6 & gt; & Lt ;? Php echo $ row ['titleimg']; ? & Gt; & Lt; / h6 & gt; & Lt; P & gt; & Lt ;? Php echo $ line ['events_id']; ? & Gt; & Lt; / P & gt; & Lt; img src = "../../litt/" php echo $ row ["img"] ;? & gt; " Width = "301px" height = "200px" /> & Lt; Form action = "delete_images.php" method = "post" & gt; & Lt; Input type = "submit" name = "delete" value = "delete" /> & Lt; / Form & gt; & Lt ;? Php echo &quo

c# - How to snapshot the speed of a processor's individual cores in MHz -

I would like to create an application that monitors frequencies of a core and for a user, the system's processor will have MHz. I have done other applications like that, so I know that this should be possible. I have tried to find a solution on stack overflow, but I could not find it. , Which could speak for the implementation of an anti-fraud in C ++, and did not provide a real solution, but there is an important danger: "Making power management technologies more common in today's computers, A commonly used method can achieve higher-resolution CPU time, RDTSC directive, can not work as expected. " Is. The closest thing I've seen is that, but the processor's personal core does not respond to the speed of the processor. There is also a development kit which I do not have the money. So ... back to the question, how can I get the current snapshot of the clock speed of a core of the program? There should be a way. P.S. With the increase of Turbo and

Oracle SQL: getting all row maximum number from specific multiple criteria -

मेरे पास निम्न तालिका नाम है foo: आईडी | डी 1 | डी 2 | डी 3 | --------------------- 1 | 47 | 3 | 71 | 2 | 47 | 98 | 82 | 3 | 0 | 99 | 3 | 4 | 3 | 100 | 6 | 5 | 48 | 10 | 3 | 6 | 49 | 12 | 4 | मैं एक चुनिंदा क्वेरी चलाऊंगा और परिणाम इस तरह दिखेंगे आईडी | डी 1 | डी 2 | डी 3 | परिणाम | ------------------------------ 1 | 47 | 3 | 71 | डी 3 | 2 | 47 | 98 | 82 | डी 2 | 3 | 0 | 99 | 3 | डी 2 | 4 | 3 | 100 | 6 | डी 2 | 5 | 48 | 10 | 3 | डी 1 | 6 | 49 | 12 | 4 | डी 1 | अतः, मूलतः मुझे डी 1, डी 2, डी 3 कॉलम के बीच अधिकतम मूल्य प्राप्त करना चाहते हैं I जैसा कि आप देख सकते हैं, डीडी 1: डी 2: डी 2: डी 3: डी 3 के बीच अधिकतम मान से आईडी 1 के पास D3 है, इसका अर्थ है 4: 3: 71, मैक्स वैल्यू 71 है। यही वजह है कि परिणाम 'डी 3' "पोस्ट-पाठ" itemprop = "पाठ"> निम्नलिखित पर विचार करें - एक सामान्यीकृत दृष्टिकोण ... ड्रॉप तालिका यदि मेरे_एबल मौजूद है; टेबल बनाओ my_table (आईडी INT नहीं NULL, डी INT नहीं शून्य, वैल INT नहीं शून्य, प्राथमिक कुंजी (आईडी,

c# - How can I get MemberInfos of a class in the order the members are declared? -

Image
मान लें कि मेरे पास निम्न श्रेणी है: सार्वजनिक वर्ग लक्ष्य {सार्वजनिक int field1; सार्वजनिक क्षेत्रफल 2; सार्वजनिक इंट प्रॉप 1 {प्राप्त करें; सेट; } सार्वजनिक int prop2 {get; सेट; }} अगर मैं ऐसा करता हूं: foreach (टाइपफ़ (लक्ष्य) में अभी तक f। गेटफिल्ड ()) कंसोल.प्रकाश रेखा (f.Name) ; मैं उन खेतों को उस क्रम में प्राप्त करूंगा, जो उन्हें ( field1 तब field2 ) में घोषित किया जाता है। यदि मैंने GetProperties किया था, तो निम्न बातों पर विचार करें: सार्वजनिक वर्ग लक्ष्य {public int field1; सार्वजनिक इंट प्रॉप 1 {प्राप्त करें; सेट; } सार्वजनिक क्षेत्रफल 2; सार्वजनिक इंट प्रोप 2 {प्राप्त; सेट; }} जब मैंने किया: var सदस्य = टाइपफ (लक्ष्य) .GetMembers ()। जहां (एम = & gt; m.MemberType == सदस्य प्रकार.फिल्ड || एम। मेम्बरटाइप == सदस्य प्रकार। प्रॉपर्टी); फोरेश (सदस्यों में एमआर) कंसोल। विलय लाइन (एम। नोम); मुझे निम्न आउटपुट मिला: prop1 prop2 field1 field2 जाहिर है, सदस्यों के क्रम में नहीं घोषित कर दिए गए हैं (जो कि field1 , prop1 , field2 और prop

Facebook javascript sdk return wrong user id -

I am trying to get user information ... and I am using this method FBP ('/ m', function (feedback) {console.log (response);}); But the problem is that the response is wrong user_id. Perhaps you are using Login 2.0 in the new GS SDK () and Graph API v2. Getting app-invoice user_id as described in the upgrade guide.

python - Scrapy returning scraped values into an array -

It seems that to pull out the data correctly, but to format the output in my JSON object as if it is an array: My spider class looks like this: For items in items: DEF Pars (self, response): cell = selector (response) item = sel.select ('// div / ul [@ class = "product Skateboard = [] in objects: skateboard = skateboard ['name'] = items.expath ('li [@ class =' ​​rick]] // text () '). Remove () Skateboard [' value '] = Item.xpath (' li [class = "value"] "] / text () [1] '). Remove () skateboard ['link'] = item. Xpath ('li [@ class = "image"]'). Remove () Skateboard Skateboard Return Skateboard How do I go to make sure that Scrappy is only outputing the same value for each key array which is currently producing? .extract () List you can use ''. Include (item.xpath ('li [@ class = "desc"] / text ()'). Remove ()) To get a string < / Div>

How to connect to Openshift Mysql database with PHPstorm? -

After reading the stack overflow, do not succeed and open the docs. This is the setting and error message: Not sure, do I have to forward port? Thank you! class = "post-text" itemprop = "text"> To join MySQL cartridge running OpenShift, first you have to rhc port-forward to run command. Rhc is a command line client that you can use to work with openshift. This is a Ruby gem, which you can install using the gem installed rhc command. And see

security - Can One-Time-Pad key be reused if encrypted plaintext is random? -

I want to encrypt random data with a single key, which is shorter than plain text. Do I use AES or any other strong encryption algorithm, or can I use OTP, i.e. block by blocking the travel text (black block) with only the unique key? Example data is 1024 bits tall and is random. The key is 128-bit long (even at random). Is it safe to encrypt data by adding 8 consecutive 128-bit blocks with the same key? For example the data is 1024 bits tall and is random. The key is 128-bit long (even at random). Is it safe to encrypt data by adding 8 consecutive 128-bit blocks with the same key? If your data is random, then the answer is yes. You can view your actual data as an OTP key. It is purely random and used only once, so there is no way to recover any keys or data.

android - How can I parse kml file from the assets folder? -

I have a KLL file, which has some latitude LNG but I do not know how to parse it in Android? I checked this link but it is different. It is receiving data from the server in km format. But I have deposited the KL file in the property. Thank you in advance .. read KML: public string load KMLFromAsset () {string kmlData = null; Try {InputStream = getAssets (). Open ("yourKMLFile"); Int size = is.available (); Byte [] buffer = new byte [size]; Is.read (buffer); is close(); KmlData = new string (buffer, "UTF-8"); } Hold (IOException pre) {ex.printStackTrace (); Return tap; } MLDData of return; }