Posts

Showing posts from July, 2014

Is it possible to get a prototype bean from Spring Context without creating a new bean every time? -

I have a servlet, which needs to get information from prototype bean. However, I do not want to get a new bean, servlet is running. So far, I still could not find a way to do this. In spring, the beans have two basic types, single songs or prototypes, if you have a singleton, which If the default is, the spring will make an example as the application reference is booted, and all the references to this bean will return this one example if the bean is a prototype, then complete all its references with a new instance in the context Will be done. However, your question is unclear if you mean that you have a bean, which is usually a prototype but for a particular use you want to treat it as a singleton , Then why not use two beans, the same type, as a singleton and as a prototype, and the qualifier to distinguish between two.

c++ - When is it useful to include the same header multiple times in one file? -

इस सवाल का पहले से ही एक उत्तर है: 6 जवाब मैं कई inclusions के बारे में पढ़ रहा था एक ही शीर्षक में एक फ़ाइल में, और एक दिलचस्प कथन () मिला: हेडर फाइलों के साथ कुछ युक्तियां हैं जिन्हें आप जान-बूझकर कई बार शामिल करते हैं (यह वास्तव में एक उपयोगी सुविधा प्रदान करता है )। मैं समझता हूं कि ये गुब्बारे शायद वास्तविक दुनिया की परियोजनाओं में अवांछित और भ्रामक हैं (खासकर जब लोग कई संलयनों की तरह सावधानियां लेते हैं, जैसे और)। लेकिन फिर भी, उन गुम क्या हैं? मैं कुछ विचारों के साथ आया था, लेकिन कुछ वास्तविक उदाहरण (आदर्श रूप से, सुरक्षित और प्रयास किए गए) को देखना चाहूंगा। मेरा विचार: सी में छद्म टेम्पलेट्स, जहां टेम्प्लेट पैरामीटर पूर्वप्रक्रमक परिभाषाओं के साथ प्रतिस्थापित किए गए हैं यह बिना समावेशन के किया जा सकता है, लेकिन फ़ंक्शंस बहुत बड़ा या बहुत अधिक हो सकता है, इसलिए एक अलग फाइल बनाने का मतलब होगा। ब्लॉक-बाय-ब्लॉक संरचना / श्रेणी निर्माण (टुकड़ों का समापन) यह सी में विरासत का अनुकरण करने में मदद कर सकता है और सामान्य सदस्यों के साथ स्ट्रैक्ट को परिभाषित करते...

vhdl - Error (10818): Can't infer register for ... at ... because it does not hold its value outside the clock edge -

I am trying to verify the four buttons when one of them is pushed, let me check it It is necessary that compatible leaders are burnt or not. Therefore, I gave the code, where a process is checked which button is pressed and compares the values ​​with the values ​​of the lead (published or not). This problem occurs when I want to increase the variable that controls the player's hit (successes). Remember that the "ectorus" is an sign type std_logic_vector 3 down from 0) process (pb0, pb1, pb2, pb3) Variable erro_int: STD_LOGIC; Then start (clk_game = '0') then erro_int: = '0'; If moving_ege (pb0) then if pb0 / = lead (0) then erro_int: = '1'; end if; Elsf RID_Age (PB1) then if PB1 / = Lead (1) then Arrow_Int: = '1'; end if; Elsf RID_Age (PB2) then if PB2 / = Lead (2) then Arrow_Int: = '1'; end if; Elsf RID_Age (PB3) then if PB3 / = Lead (3) then Arrow_Int: = '1'; end if; And Actors & lt; = Acertos + 1; end if; e...

python - matplotlib: Change grid interval and specify tick labels -

Image
I am trying to plot the plot in the disorganized plots, but I did not understand that I How do i go I want to: (1) There are dotted grid at a gap of 5 (2) Only large tile labels are (3) I (4) "Count" within those grids, I have probably tested such a duplicate, but I could not find it. This is my code. import Matplotlibkpyplot Matplotlibkticker import MultipleLocator, as plt value in FormatStrFormatter key, Sort (data.items ()): X = value [0] [2] Y = value [0] [3] count = value [0] [4] fig = PLT.figer () ax = fig. Ada_sbplot (111) Kulhadhiknotet (calculated, Aksai = (x, y), size = 5) # overwritten and I only get the final data point Pltkclose () # fail without this, I assign "Bitmap "Error plt.suptitle ('number of numbers', fontsize = 12) ax.set_xlabel ('x') ax.set_ylabel plt.axes (). ( 'Y') set_aspect ( 'equal') plt.axis ([0, 1000, 0, 1000]) # This gives a gap 200 Main Loketr = Multiple Locator (20) Pramukfarmr = fo...

jQuery Datatables not working properly -

I have a table that fills through Knockout.js and jQuery Datatables 1.9 on the table for sorting and paging Uses .x & lt; Table id = "myTasks-table" class = "table-table-border table-striped request-table" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th & gt; Request ID & lt; / Th & gt; & Lt; Th & gt; & Lt; / Th & gt; & Lt; Th & gt; Follow up & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody data-bind = "foreach: myTasksVM.tasks" & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt ;! - ko if: RequestSource == "I" - & gt; & Lt; A data-bind = "entry: {href: '/ helpdesk / ticket / description / service service}" & gt; & Lt; Span data-bind = "text: service royved" & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt ;! - / ko - & gt; & Lt ;! - ko if: RequestSou...

html - CSS nth-child all elements appearing as "odd" -

I have a table of HTML & amp; Want to apply CSS and N-th Child Chooser so that I can change colors between table rows. For some reason, each line is displayed in the same color. The same question on A stack overflow says that the n-th child selector applies to that element, not the child. I understand it, and I have another table class that works properly Is, but my second table class which I do not want to apply it. I have tried to implement the Working Table class in several tables. On some tables, it works on others, it is not so. CSS: .prevTable {table-layout: fixed; Degradation: collapse; Padding: 3px; Boundary-radius: 3px; Font size: 13px; Margin-left: 0 pixels; Width: 860px; } .prevTable th {padding: 6px 3px 6px 3px; Background color: #CCCCCC; Font-family: rally; Text align: center; Boundary-radius: 3px; Border: 1 px solid gray; } .prevTable td {padding: 5px; Font-family: rally; Border: 1 px solid gray; Text-align: left; } Table.prevTable tr: nth-child (even) ...

express - Full-duplex messaging between remote autonomous Node.js applications over WebSockets? -

There will be no human in the loop, and both endpoint autonomous nodes JS are working as independent services. Responsible for contacting endpoint via The two endpoints will send messages independently (without human intervention), and both points will be APIs (tragic or otherwise) to receive and process messages, you can say that each endpoint is a customer , And one server, the other endpoint. I am considering frameworks like sales.gse and loopback (apply to both end points), as well as messages on just passed JSON messages, but it is not clear what the most idiomatic approach would be. There is a lot of web sockets overhead to connect to browsers, because of the HTTP If you are simply adding a pair of server, then a simple TCP connection will be sufficient. You can use it for this. Now, after you have this connection, how do you start communicating? You can go through the hassle of building your own protocol, but I do not recommend it. I found that a simple RPC was th...

excel vba - Difference between DateValue and CDate in VBA -

I am new to VBA and I am working on a module to read data from a spreadsheet and based on the date. I calculate the values ​​in the spreadsheet as a string, and then using the CDAT, I am changing prices at a date. Although I just ran during the date and I was wondering what was the difference between the two functions and which one is better to use. date values ​​ will only return the date CDAT Will protect the date and time: ? Date value ("2014-07-24 15:43:06") 24/07/2014? CDT ("2014-07-24 15:43:06") 24/07/2014 15:43:06 Similar to returning you timevilla Only time part can be used: ? Time Price ("2014-07-24 15:43:06") 15:43:06? Timeville ("2014-07-24 15:43:06") & gt; Time limit (12, 0, 0) is true Also, as guitararthar says, date value (and time value ) Only string parameters, while CDAT can handle numbers, to compute these functions for numerical types, CDate (Int (num)) and CDate (num - Int (num)) .

jquery - HTML - Create a left menu occupying a part of the main page -

Image
मैं HTML, C #, CSS, Jquery, JQuery मोबाइल, के साथ ASP.NET MVC 4 के साथ एक वेबसाइट बना रहा हूँ। । यह मेरा मुखपृष्ठ है: यह मेरा भविष्य मेनू है: और मैं चाहूंगा कि जब मैं अपने होमपेज पर बाएं-टॉप बटन पर क्लिक करता हूं, तो मेनू पृष्ठ के दाहिनी ओर फिसल जाता है, और हम होमपेज का एक हिस्सा देखेंगे। उदाहरण के लिए, पृष्ठ का 70% मेनू के लिए है और पृष्ठ के लिए बाकी है। नीचे, यह एक ऐसे परिणाम का उदाहरण है जिसे मैं चाहता हूं: क्या मेनू एक div टैग या दृश्य है? मैं एक मेनू को सही करने के लिए कैसे कर सकता हूं? धन्यवाद यह = & gt; $ ('# मेनू, # सामग्री')। ऊंचाई ($ (खिड़की)। हल्का ()); Var खोला = गलत; $ ('# विज़िट')। क्लिक करें (फ़ंक्शन () (यदि (! खोला गया) {$ ('# मेनू')। एमीमेट करें ({मार्जिन लिफ्ट: '0 पिक्सेल'}, 500); $ ('# सामग्री')। ({मार्जिन लेफ्ट: $ ('# मेनू')। चौड़ाई () + 'पीएक्स'}, 500); खोला = सच;} और {$ ('# सामग्री')। एमीमेट करें ({मार्जिन लेफ्ट: '0 पिक्सेल'}, 500 ); $ ('# मेनू')। च...

javascript - Add timeout function to reveal modal with cookie -

I have successfully used this script to set up a jquery cookie that tells the site visitors that a model appears But only once per day. & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {// If the cookie does not exist then create it and show model if (! $ .cookie ('hereToday')) {// cookie Set it to end it. 1 day $ .cookie ('heretoday', true, {expires: 1}); // reveal call modal $ ('# subscribe'). Reveal ();}}); & Lt; / Script & gt; How can I add a timeout function to the script which will add some seconds delay before firing the modal? You should use setTimeout function: & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {// If the cookie does not exist then create it and show model if (! $ .cookie ('hereToday')) {// cookie Set it to end it. Call in a modal var delay = 5000; // ms in 1 day $ .cookie ('heretoday', true, {expires...

node.js does not start via upstart (but does when manually run from command line) -

I have a node. Js is an app that can run successfully from the command line. I want to start using it upstart. I do not need to define [context arrow] when it hits the first line of my app, which is .. Var requirejs = require ('requirejs'); Looks like exec line from my upstart script exec sudo -u pi / usr / local / bin / node / home / [my_app_dir] / Myapp.js & gt; & Gt; /var/log/myapp.log2 & gt; & Amp; 1 Is the path not being set correctly? This is more likely to be solved as it solves node_modules Seeing a CD (relevant dir) in the wrong place after which the node myapp & gt; & Gt; ... Instead, it should be able to find all your essential libraries.

java - Strange behavior trying to connect SQLite database -

After Well I have some time trying to connect to DB like this: Public Static Connection Connect (string URL) {try {class.forName ("org.sqlite.JDBC"); } Grip (Klassnotfound Expression E) {e.printStackTrace (); } Hold (exception e) {e.printStackTrace (); } Connection = null; Try {conn = DriverManager.getConnection (url); // (1) // conn = DriverManager.getConnection ("jdbc: sqlite: settings.db"); // (2)} hold (SQLException east) {ex.printStackTrace (); } Return conn; } Then I call it from the main ... connect ("jbdc: sqlite: settings.db"); It was only, I put in the work when I literally URL (2), but when I put variable (1) Other information: JDK (latest) Netbeans 8 GNU / Linux - Arch64 encoding UTF-8 editor JDBC driver - Any ideas? . Im stuck, thanks Edit: stacktrace java.sql.SQLException: Invalid database address: jbdc: SQLite: settings.db java on .sql.DriverManager.getConnection on org.sqlite.JDBC.createConnection (JDB...

netlogo - Groups agents on the basis of particular value in the agenset -

GIVEN: Given an agent of turtles where each turtle has a patch, the next Bar step (tick) Problems: Two or more turtles can have a single patch set which they resolve on: I decide on the basis of the other turtle parameters, for which someone will move that patch and the rest will still be CONSTRAINT: Thus, only one in each patch Only Turtle is allowed How do I give it, the agent does not have to remove the required functionality like duplicate etc. Use tables extensions to turtles Looping with ask , make coordinates for a list of turtles wishing to move a table mapping patch there. Write a resolution-conflict reporter who raises a turtle from such a list. Walk through the table using resolution-conflict to select a turtle for each goal, and take it to a target patch. I should add a group primitive in the table extension. This requirement is very common.

html5 - Having issue with JQuery Lightbox code -

The JQuery lightbox code is not working, have seen it many times and read docs, still can not find problems Any help appreciated, thanks. I'm a newbie. It's for a Bootstrap framework website. Enter code here & lt; Head & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Meta http-equiv = "X-UA-Compatible" content = "IE = Edge" & gt; & Lt; Meta name = "viewport" content = "width = device-width, initial-scale = 1.0" & gt; & Lt; Meta name = "description" content = "" & gt; & Lt; Meta name = "author" content = "" & gt; & Lt; Link rel = "shortcut icon" href = "../../docs-assets / ico / favicon.png" & gt; & Lt; Title & gt; Blank template for bootstrap & lt; / Title & gt; & Lt ;! - Bootstrap core CSS - & gt; & Lt; Link href = "bootstrap / css / bootstrap.css" rel = "stylesheet...

Python Regex to detect musical chords? (modified) -

I am working on a wire transposer in Python, and I'm mostly working, but some problems with my Reggae And I was thinking that if someone is more intelligent in reggax methods then there can be an idea of ​​fixing me. I am essentially using this regex, found in another thread: import ref def (line): notes = "[CDEFGAB]"; Accidental = "(?: ### | B | Bb)?"; Chords = "(?: Maj | min | m | sus | aug | dim)?"; Extra = "[0- 9]?" # A1, which works: Line = "AA7 AM 7 BM CMA 7" Print SearchCode (line) ['A', 'A7', 'M7', 'BB', 'CMJ 7'] # Case 2, who thinks the capital C is a string in the chorus. Line = "chorus: a7 am 7 bb cmaz 7" print searchcard (line) ['c', 'a', 'a7', 'm7', 'bb', 'cmaj 7'] P> As you can see, "Case 1" above works just fine. However, "case 2" fails, the word "chorus" has a wire considering th...

android - Java Nullpointer exception on Activity start -

I'm ready to create an alert dialog to display an activity. Here is the complete code, manifest and error trace. Anyone can tell me the error told me. // A service intended intent = new intent (this, Myclass.class); Intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Intent.putExtra ("TYPE", "ASToContainer"); Beginner (intent); // activity increases activation activity of the public class {@ Override Creature on Public Zero (Bundle Saved Instantstate) {Super.New (Saved Instantstate); String Type = Saved StainTest .getString ("TYPE"); If (type.equalsIgnoreCase ("ASToContainer")) {AlertDialog.Builder Builder = new AlertDialog.Builder (Myactivity.this); Builder .Setmessage (R. String SWEITHHEctivyYCOHOIPOACHOCO) Builder .set icon (R.drawable.icon); Builder.Seten Eligible (wrong); Builder.setTitle (R.string.SWITCH_AS_CONFIRMATION); builder.setPositiveButton (R.string.DIALOG_YES, New DialogInterface.OnClickListener () {public void onClick (Dia...

design patterns - Interface of Interface using C# -

I do not know the following is weird but really needs an interface for an interface & lt; T & gt; Example: Public Interface IRAPSorporation & lt; T & gt; To store it in a list without specifying a specific implementation. {Add Zero (T-NNTTY); Remove zero (T unit); IEnumerable & LT; T & gt; find all(); IEnumerable & LT; T & gt; Search (Expression & lt; Funk & lt; T, bool & gt; & gt; Forecasting); } Public Interface IUnitOfWork {// Here I would like to store only one irapository without the implementation of ILIST & lt; IRepository & lt; ** I have to specify the implementation here ** & gt; & Gt; Repositories {receive; Set; } Bool Commit (); } You can recommend me better ways to do this. This is only what I have to do ... Thanks Edit I Can not provide a non-normal interface because I'm using it like this: Public class generic repository & lt; T & gt; : IRAPSorgetry & Lt; T & gt; {...

Oauth 2.0 : Accessing asset in google map engine -

I tried to use an Ajax GET method to use a property - a Google Maps Engine asset that I Created, gave an asset ID. $ Ajax ({cache: false, url: Do 'https://www.googleapis.com/mapsengine/v1/assets/0773289246413284785416071188762309719429', type: 'GET', async: false, success: function (result) {console.log (result);}}}; but it does not work, and an error: https://www.googleapis.com / mapsengine / v1 / assets / 07732892464132847854 -16071188762309719429? _ a = 1406257065386 401 (unauthorized) it is unauthorized I've tried to test gET assets using asset ID Google , When I execute. It says: for this method Certified must be required to activate the toggle up to authorize your request using OAuth 2.0. I can test the gate asset am going Oath by providing. but I can do this in your application? how do I provide Oath 2.0 certification so I can use the property? Thank you! What you need OAuth2 authorization O. First you have to get a tissue token and...

html - how to select a some characters from string in javascript -

मेरे पास एक url स्ट्रिंग है जैसे "example.com/apps/visitor/visitscanner", "example.com/Apps/Seatings / Visitcanner मैं उपरोक्त उदाहरण url के लिए "" " के बाद निर्देशिका का नाम चुनना चाहता हूं, अगर मेरी यूआरएल स्ट्रिंग यह एक है, तो परिणाम" विज़िटर "। मैं जावास्क्रिप्ट में यह कैसे कर सकता हूं? आप उपयोग कर सकते हैं, जैसे: var str = "example.com/Apps/Visitor/visitscanner"; Var भागों = str.split ('/'); Console.log (भागों [parts.length - 2]); // विज़िटर

c# - Setup and Deployment of windows application along with .net frameworks, crystal reports and windows service -

Image
I am working on windows application, I have a new client requirement like everything tied in a single setup file (Example: SQL Server 2012 Express Edition, Application Database, Crystal Reports, .NET Framework, Other 2 Applications and Windows Service) I set the setup file with the database using the installer class below Created Its work is fine And I tried for crystal report, added some merge module but I do not know that merge module needs to be fixed, so I've added all the modules So, how do I add .NET Framework, Windows Service, Crystal Report, SQL Server 2012 Express Edition to a single setup file? Can you show me a way to follow this work thanks & amp; Regards, Shridhar Take a look at this answer. I think what the advanced installer is looking for you. You can easily bundle your pre-requisites with setup for Crystal Reports Runtime and SQL Express. Examples below. You can set the same setup file Will be able to put everything in it.

java switch statement many cases simplified -

तो कहते हैं कि एक स्विच स्टेटमेंट है, स्विच (महीना) {case 1: महीना स्ट्रिंग = "जनवरी"; टूटना; मामला 2: महीने स्ट्रिंग = "फरवरी"; टूटना; मामले 3: महीने स्ट्रिंग = "मार्च"; टूटना; मामला 4: महीने स्ट्रिंग = "अप्रैल"; टूटना; मामला 5: महीने स्ट्रिंग = "मई"; टूटना; क्या ऐसा कुछ को छोटा करना संभव है स्विच (महीना) {मामलों 1-3: महीने स्ट्रिंग = "जनवरी"; टूटना; मामला 4-5: महीने स्ट्रिंग = "अप्रैल"; टूटना; इतने सारे मामले संख्या एक मामले में हैं? मैं इसे कर रहा हूं क्योंकि मेरे पास 100 केस हैं I 30 एक उत्तर, 20 से दूसरे, 5 से दूसरे आदि के लिए सीधा ... इसलिए यदि मैं कई मामलों का उपयोग कर सकता हूं तो मुझे बहुत सारे कोड को कम करके कटनी चाहिए I मुझे प्रत्येक मामले में यह भी उल्लेख करना चाहिए कि मैं कुछ चीजें करना चाहता हूं और यदि मैं एक श्रृंखला का उपयोग करता हूं यदि और बयानों से यह केवल मुझे एक कार्य करने देता है तो मुझे उस मार्ग पर जाना नहीं लगता। किसी भी मदद के लिए धन्यवाद! क्षमा करें, मैं इस पर नया हूँ! क्या...

c# - Gridview Paging ASP.NET with Pager Panel outside Gridview -

This is my first time to use ASP.NET to develop a website. The paging function and I data from the database in a GridView with can implement it using OnPageIndexChanging = "GridView1_PageIndexChanging" but the question I would like to use your pager so How can I "How do I connect my pager (right down in the picture) to pager instead of gridview which is generated by ASP.net" Picture: This is my code Spx & lt; Asp: UpdatePanel ID = "Update Pencil 1" Runat = "Server" & gt; & Lt; ContentTemplate & gt; & Lt; Asp: GridView ID = "GridView1" runat = "server" AutoGenerateColumns = "false" CssClass = "Table Table bordered table dense table striped table primary table vertically-center is really" PageSize = "3" AllowPaging = "" OnPageIndexChanging = "GridView1_PageIndexChanging "& Gt; & Lt; Columns & gt; & Lt; ASP: Boundfield datedf...

javascript - jQuery Multiple Append -

I want to add multiple values ​​to the input, how I can dry up the code. Maybe in a function, thanks! var $ inputFirst = $ ('Input: first'). Val (); Var $ inputSecond = $ ('Input: Second'). Val (); $ ('Ul'). Attachment (' li & gt;' + $ input5 + '& lt; / li & gt;'); $ ('Ul') .andand (' gt;' + $ inputscand + '& lt; / li & gt;'); This should work for you $ ( ': Input'). Each (function (i) {$ ('ul'). Enclosed (' gt;' + $ (': input'). Eq (i) .val () + '& lt; / li & Gt; ')})

Unpacking arguments of a functional parameter to a C++ template class -

I have functional template arguments for template classes in C ++. I would like to take a template class foo to get a template parameter funny template & lt; Typename Fun & gt; Struct Foo {...}; Functions such as such as zero times (std :: string a, float b, char c) given {...} then foo will be equal to a typedef std :: tuple & lt; Std :: string, float, four & gt; Is this possible? (Use of std :: tuple is only for concrete. More generally, I am thinking that it is possible to do the pattern-matching on the arguments of a working template parameter.) Point template fu & lt; The typename A, typename B, typename c, typename, D like to avoid defining foo (* funny) (a, bb, cc) & gt; Structure foo {typedef std :: tuple & lt; A, B, C & gt; Args_t; }; for which both require fixed fixes of the function, and the function's argument and return type are clearly required to be provided as a template parameter (Variadic Tem...

How to write the hibernate hbm file for this relation -

I have a user table with a user table and a mapping user, for this connection, the User_Documentary table In the field user_id that stores the respective user's ID field value. How to write HBM file in hibernation for this connection? @ Vipin, please refer to the link below to find out :):

android - how to increase the accuracy of Grabcut Algorithm using OpenCV? -

I am using OpenCV's square algorithm for background subtraction of an image in Android. The algorithm runs fine but the result is not accurate. Like my input image: Output looks like image: So how can we increase the accuracy of the graft algorithm Are you PS: Apologies for not uploading images due to low reputation: ( I am battling the same problem for a while, I have some tips and tricks for this. 1> Improve your seed. Keeping in mind that GrabCut is basically a black Box, which you give seeds and expect fragmented image as output, seeds can control all of you and this is good If you have some expectations for the image that you want to segment, there are many things in this regard. In some cases these are considered: a > Is there a man in your image? Use the face detector to find the face and mark those pixels as potential / fixed foreground, as you think fit. Refine your seeds further. Model in some areas of interest for the sector b & gt; If ...

java - Ending an activity on a background thread -

I assume that it will call to end () on one activity from a thread Poor practice is not UI threads I need to end an activity when a certain event (rendering / loop is calculated in the thread). According to the answer to this type of question, using a handler, the UI thread is appropriate. I tried to do this but the activity never ended - should I do something before posting, or what Should I use a completely different method? By default, the handler (looper) is created on the thread which is installed on them. To ensure that the handler is on the main UI thread, you can: handler myHandler = new handler (Looper.getMainLooper ()); Then, to post the item on the main thread, create a class that executes the Runnable interface, then post to the handler myHandler.post (new Runnabel) {@Override public void run ()} {code to run on UI code}}}); Another easy grandma move you can post on a view which is visible to your activity. For example, see your root view MyV...

Pass a javascript array to php in Code Igniter -

इस सवाल का पहले से ही एक उत्तर है: 5 जवाब मैं CodeIgniter और मेरा उपयोग कर रहा हूँ जेएस कोड मेरे "दृश्य" में है और मैं अपने नियंत्रक में मान देना चाहता हूं। var भंडारण = []; फ़ंक्शन कुछ () {storage.push ('मान'); } अब मैं अपने PHP में मेमोरी सरणी को पास करने का एक बेहतर तरीका चाहता हूं। अग्रिम में धन्यवाद। यह कोड काम नहीं कर रहा है क्योंकि यह अलग फ़ोल्डर में है। $। Ajax ({url: 'yourPHPFile.php', प्रकार: 'पोस्ट', डेटा: {data: storage.toString ()}, सफलता: कार्य (परिणाम) {// अपनी सफलता को संभालते हैं}, त्रुटि: कार्य () {// चेतावनी ("त्रुटि");}}); सबसे आसान तरीका jQuery का उपयोग करना है। > आप इसे सर्वर पर डेटा भेजकर $। Ajax $। एजेक्स ({url: ' सफलतापूर्वक: कार्य (परिणाम) {// अपनी सफलता को संभालते हैं}, त्रुटि: कार्य () {// चेतावनी ("त्रुटि" );}}); सर्वर पर, अपने PHP कोड में, $ data = $ _POST ['डेटा']; $ डेटा गूंज; $ डेटा में मूल्य होगा।

java - How to detect how much handles the application is using -

For our SWT-based application we are getting the SWT error "and not handle" a relatively frequent to find out To find out how that problem is in our code - Using the code in our application - How much does our application really handle? If I understand you correctly, you are likely getting the following exceptions: org.eclipse.swt.SWTError: there is no other handle You can create resources (such as font, image or GC objects) that you are right Are not removed in the manner. You may want to take some time to read. It is certain whether this is really the case, I can recommend this helpful article. Use slake, this is also a way to monitor your resources.

javascript - How to replace ' / ' with '-' inside ObservableArray ? Knockout js -

Well, I'm trying to pass an observable array to my controller via AJAX call, But I get every value other than the date I get something like '01 -01-01 '. I found this problem but unable to fix it because I do not know how to replace / with - . There are about 10 list items in my observable array, in each list item There are many properties outside startdate , such as ("23/10/2014") just ("23-10-2014") Need something like that. The thought of posting my function and I hope that in this case I am not required. I have been explained with a little code and sample data: function myarray () {var self = this; Self.startDate = ko.observable (""); Self.name = ko.observable (""); Self.place = ko.observable (""); } MyObservableArray: self.Main = ko.observableArray (); In between I do something to load data in self.main and I'm sending myself. The controller has the controller with the fol...

php - How to store multiple value inside array and show them -

I am working on a shopping cart and I use car_id , value And add to session items. I managed to store in session, but how do I get them according to the ID? Here is the code that stores inside the session: $ _ session ['item'] [$ value] = array ('total' = & gt; $ Car_id, 'add_on' = & gt; $ add_on); Similarly I get them back. I can show the ID and the value by adding it, but not the addon .. Because there can be many additional additions to the items in an ID and how can I retrieve the stores in the same way? & lt; Table & gt; & Lt; Tr & gt; & Lt; Th & gt; Price & lt; / Th & gt; & Lt; Th & gt; Car id & lt; / Th & gt; & Lt; Th & gt; Extra & lt; / Th & gt; & Lt; / Tr & gt; & Lt ;? Php foreach ($ _ session ['item'] as $ total = & gt; $ id) {? & Gt; & Lt; TR & gt; & Lt; Td width = "100" & gt; & Lt ;? Php echo 'rm...

javascript - Error from google maps API when in an angular directive -

I'm trying to make a simple angular directions which adds Google Maps locations search box for an input. See . I do not need a map, only search box. command successfully runs (search box object is the console print successful), but I get an error on the console after the run, and input error does not console work Ankyut is Taiparrr: There is no undefined function . Just to make sure, I am using another directive right next to it, with the help of which a date picker was started for jQuery ui. It works fine. HTML: & lt; Html ng-app = "events" & gt; & Lt; Body & gt; & Lt; H1 & gt; Hello Plunker! & Lt; / H1> Date: & lt; Input type = "text" datetime-input = "format" /> & Lt; Br> Location: & lt; Input type = "text" location-input = "format" /> & Lt; / Body & gt; & Lt; / Html & gt; js: var event = angular. Modules ('events', []); Events.directi...

hook - How to use Github webhooks -

I need your help! How to download updated files in the Gitobb project (not all files) while using the Git hook API, when members of the project reduce the new version? This idea is for your repo, which will listen to what you hear. You can register for . The listener relies on your local environment. For example, you have one that can filter payloads by payload type: For repository, branch, file or tag you have simple audiences. Again, the nuances of the listener and what you can do when you receive the message (such as git pull to download what has changed) depending on your specific environment is.

automation - Coded UI: Can we perform drag & drop without consuming mouse? -

I have used the Selenium web driver in the past and because it uses the browser driver, without drag and drop it Works as it really is taking the mouse The problem of dragging and dropping with the mouse is that you can not actually open anything or move your mouse when you are running your tests. I'm wondering if the coded UI has the same feature? Please note that I do not want to use a test recorder, instead I am using a more flexible approach and building UI test through the Page Model. This means that I am putting all my tests in hand. Not afraid it will always use the mouse to interact.

java - How to automate test google analytics on every event fired using Selenium WebDriver -

I am working on the Google Analytics automation test with Selenium WebDriver Java binding. Our site has Google Analytics tracking events set to important elements on the site. I must verify that after clicking on a certain element of the test, the Google analytic event has actually been removed. I'm testing it on Firefox when I click on F12, I can see in the console that a Google Analytics message on every element click event GET http: // www Is removed from .google-analytics.com / __ utm.gif . Sample code: - WebDriver wd = new Firefox driver (); Wd.get ("http://www.dummyExample.com/"); Wd.findElement (By.linkText ("Document References")). Click (); . Click on wd.findElement (By.id ("Ex2vc2")) (); How can I get this work done? I went to it but could not find a good answer. If someone can help me with some reference or sample code, I would be very grateful. How to test good GAS using Javascript. Example shows tests with phantomjs, beca...

Android: counting occurrence of words on file on SD Card -

It should be straight forward, but for some reason when I downloaded it on my SD card after the words in the file I try to count, the number starts closing. There are more incidents than this, and my results start to stop. I use Microsoft Word to verify the number of incidents (using only the undiscovered case and whole word). To check the number of events, I use the "the_counter" variable below. I also verified that there is nothing wrong with the download & amp; The whole file is downloaded to my SD card. It's driving me crazy - I'm thinking that the word can not be wrong here, then maybe what's wrong in my code below? Due to this problem the file may contain white space or special characters - is there a way to clear the file to verify it? // Find directory using sdcard = Environment.getExternalStorageDirectory () to the API file for SD card; // Get the text file file file = new file (SDCard, TEMP_FILE); // Read the text from the file / stringbinde...

javascript - Appending to the beginning of a text file and then saving as .js for iOS -

Introduction I want to open a txt file and add new one Let's line the text in the beginning of the file. I then want to save the file. JS file was. I've written some code but instead of overwriting the original text, adding a new line, I do not even know how to save the file as a .js file. Do I need to change? Code NSString * content = @ "test"; NSString * filepath = [[NSBundle main bundle] pathForResource: @ "main" ofType: @ "txt"]; NSFileHandle * fileHandle = [NSFileHandle File HandleForWritingAtPath: filepath]; If (fileHandle) {// [fileHandle seekToEndOfFile]; [FileHandle writeData: [Content DataUsingEncoding: NSUTF8StringEncoding]]; [Filehandle closefile]; } And {[written content: path to file: encoding: NSStringEncodingConversionAllowLossy error: zero]; } NSArray * data = [[NSString stringWithContentsOfFile: file path encoding: 4 error: zero] Separate components from components: [NSCharacterSet newlineCharacterSet]]; NSLog (@ ...

TypeError: Can't convert 'int' object to str implicitly *Python* -

For an assignment, I am trying to get the results of an "age" and using that python I'm trying to add. Users in the form must enter their age and the results should be of their age next year. Even I have so far: import cgi form = cgi.FieldStorage () name = rr (form.getvalue ("name")) Age = int (form.getvalue ("age")) Print ("" "" Content Type: Text / html "! DOCTYPE html public" - // W3C // DTT XHTML 1.0 Strongly //n "" http: /www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> & gt; HTML & gt; & gt; Head & gt; Title & gt; Lab 9 & lt; print ("& lt; P & gt; Hello, "+ name +". & Lt; / p & gt; ") Print (" Next year you will be "+ str (age) Error is found traceback (most recent call Last: You "+ str (age + 1) +" next year "print" in the file "/ user / jlu / document / CMPT165 / lab 9 / result", in lin...

Selenium Python - Test if an element exists in the page -

I'm new to Selenium and I would like to write a Python script that searches for some keywords on Google and automatically The page opens and the keywords are found. I'm trying to work with the script: Selenium from Selenium Import WebDriver Com.exceptions Import timeout selenium from Akspshn selenium.webdriver.support.ui import webdriver.support.ui import WebDriverWait selenium.webdriver.common.by select Import selenium.webdriver as EC selenium.common.exceptions. imports NoSuchElementException by the support import expected_conditions, then __name__ == "__main__": driver = webdriver.Firefox () wait = WebDriverWait (driver, 100) driver.get ( "http://google.com") inputElement = driver .find_element_by_name ( "q") inputElement.send_keys ( "Irwin Quan") wait.until (EC.element_to_be_clickable ((By.XPATH, "//a[@href='http://irwinhkwan.wordpress.com/ '] "))) Blog = driver.find_element_by_xpat H (" //a[@href='h...

c# - Stored procedure returning value in sql server but not in asp.net -

मेरे पास एक संग्रहीत कार्यविधि है जो किसी पैरामीटर प्रदान किए बिना मूल्य (letterNo) लौटाता है, यह कार्य करता है, लेकिन समान प्रक्रिया एएसपी में गलत मान देती है शुद्ध कोड अर्थात् यह केवल 0 देता है, लेकिन सपा में 1, 2 आदि जैसे अपेक्षित मूल्यों को रिटर्न मिलता है। क्यों? सपा: ALTER प्रक्रिया [dbo]। [SelectLetterNoFromComposedLetter] @LetterNo bigint उत्पादन के रूप में @date varchar घोषित (5) सेट @date = (परिवर्तित का चयन करें (vARCHAR (5), getdate (), 110)) शुरू घोषित @MaxComposeLetterID bigInt सेट @MaxComposeLetterID = ( मैक्स ComposedLetter से (ComposedLetterID)) सेट करें चुनें @ LetterNo = (सबस्ट्रिंग का चयन करें (ComposedLetter.LetterNo, 15,20) ComposedLetter से जहां ComposedLetterID = @MaxComposeLetterID) यदि (@date! = '01-01') --Check अगर यह पहले है नए साल का दिन या नहीं शुरू करें @ लेटर नो + 1 को पत्र के रूप में चुनें - यदि ऐसा नहीं है तो यह मौजूदा लार्टोर्नो +1 देता है; पुरानी मूल्य बढ़ाना यदि अंतराल (@ दिनांक = '01 -01 ') - यदि वर्तमान दिनांक 1 जनवरी से...

bash - AWK read file, operate on several columns of certain lines and print all the file with the change performed -

I want to make some numerical changes in the file 'test' as I did not do it with 'sed' I tried to do this with 'awk' in this case, I want to multiply numbers by a certain number in the third line. Is described in the file test: xxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyy 0.08 0.11 0.14 0.19 0.24 Fixed zzzzzzzzzzzzzzzzz To do this, I have the following script 'file .awk ': printf start {} {/0k08/ "% K2f% K2f% K2f% K2f% K2f% S", $ L * var, $ 2 * Up, $ 3 *, $ 4 *, $ 5 *, $ 6;} {Print;} End {} Then I type in the command line: awk -v var = 2 -f file.awk test the script was like I wrote blows on the line, but it replaces the line yxyxx 0.48 period 0.08 0.11 0.14 0.19 0.24 Fixed zzzzzzzzzzzzzzzzzzzzz I function read sub and I tried despite being about gsub, but I did not succeed in changing the place of the new line old line . Any thoughts? Thanks! "itemprop =" text "> after you , move forward in the next...

Git log only master branch -

Is there any way to display in the GIT log, which has ever been indicated by the master branch? For example: * c7e0107 - (22 hours ago) Merge branch 'branch_b' - Master | \ | * 3 B 9696 - (22 hours ago) Branch 'branch_a' in branch at branch- b - | | \ | * | 033fef1 - (22 hours ago) _____________ - | * | 2944 9C6 - (22 hours ago) _____________ - * | | Cbd8a15 - (22 hours ago) Merge branch 'branch_a' - Master | \ \ \ | | | / | | / | | * | E5e4aa4 - (22 hours ago) _____________ - | * | 7215282 - (22 hours ago) _____________ - | * | E9aadd9 - (22 hours ago) _____________ - | * | 4824 CF - (22 hours ago) _____________ - * | | 4a13ff3 - (22 hours ago) _____________ - Master | | / | / | * | 77b9965 - (22 hours ago) _____________ - Master * | 47fef00 - (22 hours ago) _____________ - Master / / 2cd1c2e - (22 hours ago) _____________ - Master * 768ebc8 - (22 hours ago) _____________ - Master And I would like to show only ' Master 'I have seen that the...

android - Bitmap is not saving in SD Card -

updated I'm trying to save bitmap to the SD card I am The code is working, showing no errors and exceptions, but the image is not saved in the gallery. Please help log report 07-25 04: 26: 04.126: D / Deluxe (2453): GC_Farlalok Free 82, 7% free 2788/2 9 76, 210 seconds Paused Total 228ms 07-25 April: 26: 04.168: 26 :: 04.306: 1,127,536-Byte Allocation Increase the pile (frag case) for 07-25 April are 3.894MB: I / dalvikvm-pile (2453) D / dalvikvm (2453): GC_FOR_ALLOC free 3887K / 4080K free 2K, 5%, paused 137ms, total 137ms 07-25 Apr: 26: 04.375: E / MainActivity ( 2453): 26 :: 04.706: Error occurred in the fragment 07-25 April / Cyro Rafr (2453): Omitted 30 frames! The application may be doing a lot of work on the main thread 07-25 04: 26: 04.735: D / Grolok_Goldfish (2453): Emulator detected without GPU simulation. 07-25 Apr: 26: 09326: D / dalvikvm (2453): GC_FOR_ALLOC 114K released, 5% free 4285K / 4500K, paused 29ms, total 35ms 07-25 April: 26:12, 26: d / dalvikvm...

javascript - Draggable from HTML droppable on SVG -

I am using jquery draggable on some pins ... I should leave them on the paths on a SVG map that The path id I cant seem to work for it. Here is a piece of my code. Ideally if I drag the sign-drag on this path, then I have to return the 'Map_1' by ID, but I do not have such a code like normal form Works with non SVG from & lt; Div class = "signal s 1 dragable" & gt; & Lt; / Div & gt; & Lt; Svg version = "1.1" id = "map" xmlns = "http://www.w3.org/2000/svg" xmlns: xlink = "http://www.w3.org/1999/xlink" x = " 0px "y =" 0px "visible box =" 0 0 540 360 "xml: space =" protected "& gt; & Lt ;! - areas - & gt; & Lt; G id = "state" & gt; & Lt; Ch & gt; & Lt ;! - AL - & gt; & Lt; Path class = "droppable al" id = "map_1" fill = "# EBECED" stroke = "#FFFFFF" stroke-width = "1...

audio - How to convert headerless ima-adpcm raw file to wav using sox -

I'm trying to convert a raw file (header-less) to wav ADPCM has 16 rate 8000 I have tried three console commands SOCKS -A IMA-ADPCM-R 8000 input. And output .Vove SOCKS -E IMA - ADPCM-R8000 -b16 input.raw output.wav These same error triggers: SOCKS failed format: file `input.raw Bad input format for: No data encoding or sample size specified Done and last attempt SOCKS-T raw-t wav -e ima-adpcm -r 8000 -b 16 input.raw output.wav that triggers another error SOCKS failed format: Can not open input file 'input.raw': WAVE: RIFF header not found Do you know why I get these errors? thanks edit Hex dump first 48 bytes of FYI cc 00 00 00 00 37 C 0 0 0 0 0 0 D 0 30 37 C 30 C7 CD D3 C 03 CD 00 37 03 C 00 Dc CD 00 C 0 F 0 0 03 55 0 B4 Bfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 4 cc 43 It looks like -t raw -e Using ima-adpcm does not work, but instead you have to -t ima -e ima-adpcm . I think that ...

iphone - iOS Tab Bar Controller memory management -

I am using an iPhone storyboard, which is the main entry point tab bar controller . This tab bar controller is connected to seven other different view controllers. These view controllers are mostly table view controllers or web views. I'm not sure I'm searching for a problem that is not actually present, but my app's usage is ~ 80 MB RAM after seeing all the controllers Once opened and therefore I have this assumption, it is wrong. After making calls to the scene controllers many times the size is not high, like I do not think I have a memory leak. I have also searched for this problem, but there is only one thing that I could get, it was that the OS caches all opened view controllers and keeps them in memory, does anyone confirm it Could? If the OS does not have enough memory, then what ideas will be killed? I have the impression that I am a good app citizen in any way, with each view controller viewDidDisappear ? Or should I leave memory management in OS? ...

plsql - string variable in where clause with dynamic pl/sql -

मेरे पास यह कोड है: instr varchar2 (20); Num_no संख्या; आरआईआईआईडी का चयन करें, instr में आईडी, qula_match से num_no जहां आईडी = 1; तत्काल अमल 'बना सकते हैं या के रूप में चयन AR_ID, kurs, ((TO_CHAR (TO_DATE (di.kursdatum, interm2 देखें की जगह' 'dd.mm.yyyy' '),' 'YYYYMMDD' ')) + (TO_CHAR (TO_DATE (डि। verfall, '' dd.mm.yyyy ''), 'daten_import di से dumdate के रूप में' YYYYMMDD ''))) जहां di.AR_ID = '|| निर्देप्राप्तगुम ||' '; - जहां DI.AR_ID = '' GXIndex '' '; समाप्त ; मुझे त्रुटि मिलती है b / c instr मान्य नहीं है। जब मैं वास्तविक स्ट्रिंग जीएक्सआईडीएक्सएक्स के साथ चर को बदलता हूं, तो कोड काम करता है। यह संख्याओं के साथ चर के साथ काम करता है, लेकिन स्ट्रिंग के साथ नहीं। ऐसा क्यों है? इस: तत्काल अमल 'बना सकते हैं या interm2 के रूप में देखें की जगह चयन AR_ID, kurs, ((TO_CHAR (TO_DATE (di.kursdatum, '' dd.mm.yyyy ''), '' YYYYMMDD '')) + ...

How to generate TimeUUID in Java/Scala -

Do anyone know how to generate time-base UUID in Java / Scala? This column is the family: Make a table call (ts timeuuid) I am using Cassandra 1.2.4 Appreciate your help! The source for this is to create the TimesUides of the UUIDGENA of Sissand:

exchange server - Outlook 2010 signatures profile dissapearing -

I am working on a service desk / position, though not very long, and this morning when I got my machine By logging in on my company Citrix machine, I tried to reply to Citrix and I suddenly found out that my signature is excluded in the profile. When I asked my colleagues whether they had said the same issue, yes, I had some kind of offer, but only one that made Oulook 2003 understand a problem for the problem Was started to search for. On the installation of 2003 Outlook creates a registry key of 'run for the first time' or something like that and if you work with more than one server that I have when I connect to the Citrix machine and if The value is different from the server to the server, Outlook looks like you are on your first run and you create a new profile, then on 2003 it is fixed that you have to set the same value to the first run on all citrix servers. But 2010 looks like this reg is important that if I mentioned earlier I would really appreciate it if s...

c# call access with property["propertyname"] (equal to JavaScript) -

How can I use a property property in C # with the name of the property? Like I do it in javascript in property ["propertyname"] ? To reach the value of the property by name, you must use reflection: var propInfo = obj.GetType (). GetProperty (propertyName); Var value = propInfo.GetValue (obj);

c++ - Return type of abs is complex? -

क्या std :: abs एक जटिल मान वापस करता है? यही है, एक वास्तविक मूल्य शून्य काल्पनिक भाग के साथ एक जटिल संख्या के रूप में दर्शाया गया है। मुझे यह त्रुटि मिलती है g ++ -march = native "utilities.cpp" -fpic -g -Wall -c -std = c ++ 11 -i "/ घर / टॉर्बोजर / तैनात" - O "__wand_targets_dbg / utilities.o" फ़ाइल में /usr/include/c++/4.8/algorithm:62:02 से शामिल है, / home / torbjorr / तैनात / जड़ी बूटी / मेमोरी / मेमोरीएच: 14, /home/torbjorr/deployed/vector/matrixstorage.h.10 से, frame_in.h: 9 से, utilities.cpp से: 6: /usr/include/c++/4.8 /bits/stl_algo.h: '_OIter std :: transform (_IIter, _IIter, _OIter, _UnaryOperation) के तत्काल में [_IIter = std :: जटिल & lt; float & gt; *] के साथ; _OIter = फ्लोट *; _ यूनानीऑपरेशन = std :: जटिल & lt; float & gt; (*) (Const std :: complex & lt; std :: complex & lt; float & gt; & gt; & amp;)] ': utilities.cpp: 89: 34: यहां से आवश्यक / usr/include/c++/4.8/bits/stl_algo.h : 492...