Posts

Showing posts from September, 2011

Java - How to get the index of a given element in an array -

I have an array of such contacts: public class applications {private scanner input ; Personal contact [] contact; Private Ent Aranyam; Public application () {input = new scanner (System.in); Contact = new contact [5]; ArrayNum = 0; } And what I want to do is enter a person's name on the contact list, and if they are found in their list, they come back like an index: System.out.println ("Who do you want to remove?"); String name = input.nextLine (); (Contact C: contact) {if (c.getName (). Equals (name)} {// get index here}} I tried to research it, but No answers or guides seem very clear on this, so I hope someone can explain this to me. Instead use a loop using a counter. for (int i = 0; i & lt; contacts.length, i ++) {if (contact [i] .getName (). Equals (name)) {// Do something with the index, i}}

libgdx - How do I make a flat shaded mesh? -

Image
How to create a flat shaded trap in a libgdx? Most examples of custom mash (which I could find) are covered with guards. I want my game to be a flat-style like the following: So, how do I create a flat shed custom shape?

java - ClassCastException when trying to get ORecordBytes with OrientDB via Graph API -

I use Oriantdibi to store images / byte data and try to follow this tutorial: (I chose it "to shop with" Orkardbits I Vertex Vertex = db.addVertex ("category: item"). ; ... orcrbits Imejrekord = new Orkerrdbaits (stream. to Batare ()); Imejrekord Sav (); Vertex Ksetproprti ( "Image" Image Record); ... dB code Erase (); However, when I try to recover data in this way: ORecordBytes imageRecord = vertex.getProperty ( "image" ); .. I get it for the above line: Exception in thread "main" java.lang.ClassCastException: com. orientechnologies.orient.core.record.impl.orecordBytes can not be inserted into the com com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.getElement (Oriantbesegrafkjav) on .orientechnologies.orient.core.record.impl.odocument a : 1145) com.dk.ink.epp.blueprints.impls.orient.OrientElement.getProperty (Orient on service.database.DAO.OrientDBGraphAPIItemDAO.vertexToItem On serviceDatabase.DAO.OrientDBG...

multithreading - Threading socket server in Python -

I am working in Python on a threading server, but I'm running into problems with blocking a connection. When I make the first connection, it sleeps and by then I do not take back the first connection on the server until it first sleeps. Any ideas on what I'm doing wrong? import socket, SSL, time, defing test_handler (conn) threading: print "sleeping 10 seconds" time.sleep (10) conn.write "done") 0 square clientTrade ( Threading Thread): def __init __ (self, connstream): Threading. Thread .__ init __ (self) self.conn = connstream def run (auto): test_handler (self.conn) thread = [] Bindsocket = socket.socket () bindsocket.bind (('0.0.0.0', 10023)) Bindsocket.listen (10) While true: newsbook, fromaddr = bindsocket.accept () connstream = ssl.wrap_socket (newsbook, server_side = true, certfile = "server.crt", keyfile = "server.key", ssl_version = ssl. PROTOCOL_TLSv1) Try: c = ClientThread (connstream) c.start () threads.appe...

angularjs - Detect if a function is bounded to the scope with & -

I have a directive popup in which it has a separate scope with a function bond: Template & lt; Popups & gt; & Lt; Div class = "confirm-button" ng-show = "showConfirmbutton" ng-click = "on confirm ()" & gt; Confirmation & lt; / Div & gt; & Lt; / Popup & gt; Director & Controller Angular Modules ('app.directives'). Instructions ('popup', [function] {"strict use"; return {restricted: 'e', ​​scope: {onConfirm: "& amp;"}, administrator: 'popup Ctrl', templateUrl: "partial / instructions / Popup.html "};}]); Angular.module ('app.controllers') controller (' popup ctrl ', [function ($ scope) {"strict use."; $ Scope.showConfirmButton = typeof $ scope.onConfirm === "function'; // Always correct: (// ...}]); Usage & popup onConfirm = "doSomething () "& Gt; & lt; / popup & gt; ...

matlab - How to add noise to an image loaded from .mat file? -

इसलिए मैंने .mat फ़ाइल लोड की है: लोड Yale_32x32.mat; एक्स = फी '; तब मैं इस छवि का उपयोग कर देख सकता हूँ: imshow (reshape (एक्स (:, 1), 32,32), []) 165 छवियाँ हैं, इसलिए दूसरा आयाम 1 से 165 तक किसी भी संख्या में हो सकता है। मान लीजिए, मैं छवियों में से एक को 'नमक-काली मिर्च' शोर जोड़ना चाहता हूं। अगर मैं करने की कोशिश करता हूं: J = इम्यूइज़ (एक्स (:, 1), 32,32), 'नमक और मिर्च', 0.05); और फिर: imshow (j, []); ... यह मुझे पूरी तरह से सफेद पृष्ठभूमि पर एक शोर प्रदर्शित करेगा मैं क्या कर रहा हूं? संपादित करें एक्स (:, 1) मुझे देता है: 70 68 49 53 50 50 37 33 26 13 17 61 69 109 .... आदि। आवेदन करने के बाद j = imnoise (एक्स (:, 1), 'नमक और मिर्च', 0.05); , मुझे मिलता है: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 आदि। संपादित करें फिक्स्ड: मुझे अपनी छवि को सामान्य करना पड़ा धन्यवाद।

More efficient way to perform multiple MySQL queries in PHP -

I have an online store with thousands of orders and I am writing some inquiry so that each supplier (brand) is made on the site. Have given. I have the following questions, for each month of the selected year: $ filterJan = "$ filterYear-01"; $ QueryJan = "select value, volume Ordr_itms WHERE ProductID = '$ ProductID" and timestamp'% $ Filtrjan% ' "10000"; $ SuppliersQueryFilter = mysql_query ($ queryJan, $ connection) or die (mysql_error ()); while ($ rowF = mysql_fetch_assoc ($ suppliersQueryFilter)) {$ price = $ rowF [ "value"] * $ rowF [ "volume"]; $ Kuljan = $ Kuljan + $ value;} ** and so on ** for each month ** takes time to load (we are talking for at least 60 seconds) and I know that it is any size or Not every master is skilled Are they searching these questions through thousands of records? Is there any more effective method or writing on this: a) Probably reduce the amount of code for 1 query b) Rais...

Chrome App inside an Extension -

I am trying to create a Chrome app but I need it to be accessible from any web page on which Viewing as the user app is supposed to be interacting with the contents of the page. I have seen what I have seen, this is done only through the extension, but there are only apps that have the file system permission which I try to do I am doing Is it possible that a chrome app is a chrome extension to get the best of both worlds? It is possible to write one app and both Your question is not quite clear Is that what you want to achieve (a single item? So, no), but this is the best guess.

json - Ember data - Cannot read property 'typeKey' of undefined -

plan is trying to load the model, embedded , My app model. I get the following error when I load (it just saves ok): can not type an asset type of indefinite duration: Ember.Object. undefined on extend.modelFor property can not be read 'typeKey' (http: // localhost: 4200 / assets / vendor.js: 71,051: 22) Ember.Object.extend.recordForId (at http: // localhost: 4200 / assets / vendor.js: 70,496: 21) deserializeRecordId (at http: // localhost: 4200 / assets / vendor.js: 71500: 27) at http: // localhost: 4200 / assets / vendor.js: 71477 : 11: //s at http Local host: 4200 / assets / vendor.js: 69,701: 20 at http: // localhost: 4200 / assets / vendor.js: 17,687: 20 Object.OrderedSet.forEach (at http: // localhost: 4200 / assets / vendor.js: 17530: 14) Object.Map.forEach (at http: // localhost: 4200 / assets / vendor.js: 17,685: 14) on Function.Model.reopenClass.eachRelationship (http: / / localhost: 4200 / assets / vendor.js: 69700: 42) General Rilti onships (http: // ...

c++ - 3D Coordinate System Transformation (X,Y,Z) to (X',Y',Z') -

Image
I am working with reference to the new Kinect v2, and a task coordination system for the given frame I'm trying to do with coordinates (X, Y, Z) in mm line up, transform or Kinect is related to camera coordination systems and about that object which he is looking at. This object has its own coordinate frame, its X, Y, and Z axis tracks the connecting object, returns the world, coordinates with kinact in X, Y, Z root. However, keeping in mind X, Y, and Z Offset, I can also specify a new root within the same coordinate frame. I was thinking that if I started in the position of the object, the same origin, I could understand who used the instructions given to their X ', Y', and 'Z' movements. Can translate You can see what I'm saying about here) Drawing. Is there a way IX ', y Set a coordinate frame when given a new set of values ​​'and z'? Suppose I have 3 sets of coordinates in both the frame frame and the connect frame. I 3 pairs (x...

javascript - Highcharts slow performance when adding more than 10 series -

I am adding a series using code below. Now we are talking about 10 ~ 20 series, while doing so the UI is freeze and it slows down fast and it is in a PC browser. I hope these charts are used on tablets (KitKat) in an Android webview. Any suggestions on how to increase performance? var x in current version {chart.addSeries ({name: currentSerie [x] .name, data: currentSerie [X] .data, lineWidth: current credentials [x]. LineWidth || 1, Color: Current [x] .color || '', DataSumming: {approximation: "average", enabled: wrong, compelled: right, units: [['hour', [1]], marker: {enabled: True, Radius: 1}, Tooltip: {valueDecimals: 1, Mansfield: Current Surface [x]. Unit || '}, Shadow: Wrong,}, False); } Chart.redraw (); I had the same problem and the following has been considered guilty. Marker: {Enabled: true, radius: 1}, If you compel markers to enable and display markers Let the chart set, performance is much better.

sorting list of objects in Python -

इस सवाल का पहले से ही एक उत्तर है: 6 जवाब पायथन में, मैं पार्स कर रहा हूँ शब्दकोश में एक xml फ़ाइल, इस का उपयोग कर। मेरे कोड का मूल बहुत सरल है: configdict = कन्वर्ट एक्समलटॉडेडिक्ट ('tasks.xml') को कॉन्फ़िगेंट में कार्य के लिए ['osmo_tasks'] ['tasks_entries'] ['एंट्री']: प्रिंट कार्य ['आईडी'], कार्य ['नियत_डेट'], कार्य ['सारांश'] शब्दकोश में कोड को xml फ़ाइल में पार्स करेगा और फिर कार्यों के माध्यम से पुनरावृत्त करें और उन्हें प्रिंट करें जाहिर है, यह एक ही क्रम में उन्हें प्रिंट करेगा, xml फ़ाइल: 1 736366 सारांश 2 735444 दूसरे सारांश 5 735796 blah मैं कार्य ['नियत_डेट'] के अनुसार क्रमबद्ध लाइनों को कैसे मुद्रित कर सकता हूँ यह एक नमूना है एक्सएमएल फ़ाइल: & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "यूटीएफ -8"? & Gt; & Lt; osmo_tasks संस्करण = "000212" & gt; & LT; category_entries / & gt; & LT; tasks_entries & gt; & LT...

php - What's the right magento observer event to capture order paid? -

I am trying to send orders after a payment order and only to a third party and now set What is the best supervisor to use it to work for all the payment types for 'processing' as a situation? After reading several sources it looks like: sales_order_invoice_pay should work for all payment methods but it seems It has been removed on Magento 1.9: ( this list is incomplete, please check the update below ) The second option was: 'sales_order_payment_pay' But when I test that "check / money order" after ordering it did not remove it after generating an invoice on the backend Have been > Invoice> Submit Invoice Is this method only called with other payment methods? (PayPal / authotize.net) Update: After reading: This second question is the only way to guarantee that I export one After payment (online or offline) the order has been made to capture when an invoice has been created, and is the perfect supervisor for Magento 1.9: s...

javascript - How to debug in a mean.io app? -

whenever I mean. Even if I run the app, I can see all my works in aggregated.js. Is there a way to debugging plain and simple browsers? This question is for front end debugging ... but it would be great to know how to backend debugging. Config \ env \ all.js, add a switch: debug: true

Save PHP Post Data to string -

I have simple PHP code; I $ _ POST ["email"]; I can resonate correctly. But I can not save it in the variable. var email = $ _POST ["email"]; I got this error Parse error: syntax error, unexpected T_VAR Any ideas? Please read. You need to change: var email = $ _ POST ["email"]; to $ email = $ _ POST ["email"]; If you want to assign the php value to the JavaScript variable, then it will: var email = '& lt ;? Php echo $ _POST ["email"]; ? & Gt; ';

subset - R accessing variable column names for subsetting -

does the following and what I want to do: dat & Lt; -subset (Figures,% NLI in% NLI) However, I might require a subset through a separate column (i.e. NLI.2 and NLI.3). I have tried NLI_col & lt; - "NLI.1" NLI_col & lt; -subset (data, select = NLI_col) data & lt; Data -subset (% NLI, NLI_col%) surprised it to achieve results does not address how I use NLI_col do? It was requested that I give the example that looks like data . Here: NLI.1 & lt; -c (NA, NA, NA, NA, NA, 1,2,2,2, NA, 2,2,2,2,2,2,2, 2, NA, NA, 2,2,2,2 , NA, 2,2,2,2,2,2,2, NA, NA, NA, NA, 2,2,2,2,2,2,2,2,2,2,2,2,2 , 2,2,2,2,2,2,2,2,2,2,2, NA, 2,2,2,2,2,2,2,2,2,2, NA, 2,2 , 2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,1,2,2,2,2,2,1,1,2,2 , 2,2,2,2,2,2,2,2,2,2,2,1,1,1,2,2,1,2,2, 2) NLI2 and LT; -C (NA, NA, NA, NA, NA, 2,2,2, NA, NA, 2,2,2,2,2,2, NA, 2,2, 2,2,2, NA, 2 , 2,2,2,2,2,2, NA, NA, NA, NA, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 , 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, NA, 2,2,2,2 , ...

php - cakephp - order by a field in the contained Model -

After I'm trying to get all the products in which there are any special category (products haveandbelongstomany Catrgories). My terms range. Name = 'whatever' and Product.live = 1 I can do this: $ cats = $ this- & gt; Category & gt; Seems ('all', array ('condition' => gt; array ('category.name' = & gt; $ categoryname), 'contains' = & gt; 'product.live = 1')); But I also want to sort product.sort_order results, so I tried: $ cats = $ this-> gt; ; Category & gt; Array ('all', 'array' = '> & gt; array (' category.name '= & gt; $ categoryname),' order '=> array (' Product.sort_order '),' yes , '= & Gt;' Product.live = 1 ')); But this does not work, what is the right way to do it? TLR: join instead of using my There is no overflow - it is not sure whether it is not yet in ... etc ... but - you can not order it ...

android - Why didn't the notification show? -

The app will post a notification but when you click it, nothing will happen. / / This imports a notification app android.os.Bundle; Import android App Import android.app.Notification; Import android.app.NotificationManager; Import android.app.PendingIntent; Import android.content.Intent; Import android.view.Menu; Import android.view.View; Import android.widget.Button; Public class extends the main activity (static final difference NOTIFICATION_ID = 0x1123; @ Override protected void saved create (bundled Instansstet) {Suprknkret (saved Instensstet); setContentView (R.layout.other); buttons BN 1 = (button) this.findViewById (R.id.button1); bn1.setOnClickListener (new View.OnClickListener () {@SuppressWarnings ( "resistance") @Override public void onClick (View v) {// TODO auto-generated method stub Intent = new intent (MainActivity.this, OtherActivity.class); PendingIntent Pending = PendingIntent.getActivity (MainActivity.this, 0, Intentions, 0); Notification notif = new...

html - CSS: How to set height of body element to fill rest of total height excluding variable length header and footer -

I would like to create a full-screen HTML such as filling the window with headers, headers, and footers. And, I want to fill the main element with the rest of the height. Therefore, the height of the main element should be (window height - top height - footer height). Header and footer height are not fixed. I can work it using Javascript, but I think it would be better if it is possible to resize through CSS. Here is what I am trying to do, and is Jasfield .header {height: 30px; Width: 100%; }. Silence {Position: Absolute; Width: 100%; Height: 50%; } .footer {status: complete; Bottom: 0 pixels; Width: 100%; } .content {position: absolute; Height: 100%; Width: 100%; } & Lt; Div class = "content" & gt; & Lt; Img src = "http://mrg.bz/ccyR3V" square = "header" & gt; & Lt; Img src = "http://mrg.bz/qmVoy1" class = "main" & gt; & Lt; Div class = "footer" & gt; Here footer is not altitude &...

AngularJS - $broadcast to only commence on the first match -

मेरे पास निम्न मार्कअप है: & lt; div class = "parent" & gt; & Lt; div वर्ग = "बच्चों में बच्चे" & gt; और अभिभावक के लिए निर्देश, और बच्चे के लिए एक निर्देश पहले बच्चे को झंडा मिला scope.isHovered = true , जबकि बाकी सब झूठे हो जाते हैं अब, माता-पिता पर, जब एक बटन क्लिक किया जाता है, तो मैं चाहता हूं कि अगले बच्चे को चुना जाए। तो मेरे पास क्या था: // मूल कार्यक्षेत्र के लिंक फ़ंक्शन .selectNext = function () {scope। $ Broadcast ('HOVER_NEXT'); } // चाइल्ड स्कोप के लिंक फंक्शन। Hovered = false; यदि (दायरे। $ पहले) scope.isHovered = सच; दायरा। $ ('HOVER_NEXT', फ़ंक्शन () (यदि (स्कोप.आईएच और amp; क्षेत्र। $$ अगला सिब्लिंग) {scope.isHovered = false; गुंजाइश। $ $ अगला सिबलिंग.हिंह = सच; गुंजाइश। $ लागू होते हैं हालांकि, एक घटना पर, सभी बच्चे को अपना कोड मिलता है सही पर सेट है, क्योंकि $ पर प्रसारण, पहले बच्चे को पहली बार कहा जाता है, और इसलिए यह दूसरे बच्चे को सच्चा होना तय करता है। फिर दूसरे बच्चे को कहा जाता है, और इ...

ios7 - NSTimer repeating too fast -

समस्या मैं निर्माण कर रहा हूं एक ऐप जहां मुझे रियल-टाइम डेटा मिल रहा है और एक MKMapView को अपडेट किया जा रहा है। मुझे हर 10 सेकेंड में डेटा का एक बैच मिलता है और webs सेवा से डेटा सेट के बीच मैं पुराने डाटा पॉइंट को हटा रहा हूं जबकि नए लोगों को जोड़ता हूं। उन सभी को अद्यतन करने के बजाय एक बार जब मैं उस 10 सेकंड में डेटा सेवा से प्राप्त नए बिंदुओं के एनीमेशन को फैलाना चाहता हूं तो मैं 'रीयल टाइम' महसूस करता हूं और कई स्टॉप से ​​बचता हूं शुरू हो सकता है जैसा मैं कर सकता हूं। ऐसा लगता है कि एनएसटीइमर हमेशा शुरुआती खत्म हो रहा है ... जिस तरह से जल्दी हो। यह 10 सेकंड से नए डेटा के माध्यम से लूप होना चाहिए, लेकिन आमतौर पर यह पहले 4 से 5 सेकंड के नए डेटा सेट के माध्यम से लूपिंग को समाप्त करना चाहिए। मैंने बहुत से एप्पल दस्तावेज़ और स्टैक ओवरफ्लो प्रश्नों के माध्यम से पढ़ा है (नीचे दिखने वाले लोगों के लिए दो अच्छे हैं):) लेकिन ऐसा लगता है कि ज्यादातर सिफारिशें गेमिंग ऐप के लिए CADisplayLink (लेकिन मैं एक गेमिंग ऐप नहीं बना रहा हूँ) या यदि आपको एक उच्च प्रदर्शन टाइ...

python - Can't connect to the correct COM port in FreePIE -

Image
Text after "div class =" itemprop = "text"> I have a code in freePIE (free programmable input emulator), which is a software that provides sensor or additional recognition I am trying to run the hardware as an input in your computer to enable it. Well, I run the Python code: def update (): Global Global Global Global pitch deviation roll = ahrsImu.yaw roll = ahrsImu.roll pitch = ahrsImu.pitch vireioSMT.yaw = deviation - cyaw vireioSMT.roll = roll - croll vireioSMT.pitch = pitch - cpitch diagnostics.watch (Vichln- cyaw) diagnostics.watch (roll croll) diagnostics.watch (pitch cpitch) If early: cyaw = 0 croll = 0 cpitch = 0 ahrsImu.update + = update Center = keyboard.getPressed (Key.Z) if the center: cyaw = Yav Krol = roll cpitch = pitch when I Try to get this error popped up to run: Well, there is no serial configuration in the software, C ohm 3 is actually not in existence and nothing in it Not connected, only my Arduino is in COM6, which would be ri...

ios - Couldn't Serialize NSData Objective C -

I can sort the following JSON data. I can not see anything wrong in it. ["Id": 2182, "title": "heaven on paradise", "content": "description", "post_date": "2014-07-28 09:29: 45 "," Post_modifaid ":" 2014-07-28 09:29:45 "," Abisi_fecrd ":" "," Abisi_reting ":" 0 "," Abisi_apekshit "" "" Abc_phone "" "" Abc_address " : "" "abc_address2": "" "abc_postcode": "" "abc_suburb": "" "abc_state": "NSW", "abc_website": "http: \ / \ /", "abc_email": "Pralead @ hotmail .com "," Abs_lt ":" - 1000 "," Abs_lon ":" 10000 "," Abs_clojd_tst "" "" Ys_ivent ":" "," From_ivent_det "" "" To_ivent_...

java - Maven tar target output folder -

I currently have a Maven project, as structured: -Part modules / -ld_module 1 / -scripts_directory / -src / -main / -java / -resources / -test / -child_module2 / -scripts_directory / -src / -main / -java / -resources / -test / -child_module3 / ... (above the hair module as the same structure) When this project is created, then each child makes a jar for the module and it is a Place in general directory Transmits; Every child copies all the dependency in the same directory; Copies the contents of the module of each child in another normal directory to scripts_directory ; And finally all your resources in another general directory then the final structure is after installing mvn: / packages / mymavenapp / -conf / (All resources of each child's modules include resources) -Lib / (It includes all children module jars (compiled) and their dependencies) -Chil_am odule 1.jar- child_module2 Zer -ChildMule 3.Jere -Syping Jar -More dependency jar-script / / (All the childr...

jquery - Binding knockout array to render jqm radio buttons -

I'm trying to present a radio button list. I modified the code sample from this URL and finished with this nonsense / code, I do not know what I am doing wrong. I see in the rendered html, the div (with the class ui-radio) is just around the input, the label is out of div thanks. Post text" itemprop = "text"> You need to tell jquery mobile to increase these manually Will be. How to do this: $ ('[type = "radio"]'). CheckboxDride ();

Asp.net MVC web Application Date Format for Text Box -

Image
मैं एक asp.net mvc वेब अनुप्रयोग विकसित कर रहा हूं। मेरे आंशिक दृश्य । समस्या जब भी मैं एक "नया रूप" के लिए अपना आंशिक दृश्य खोलता हूं, तो मुझे निम्न प्रारूप में पाठ बॉक्स में एक तिथि मिली: "Https://i.stack.imgur.com/ue8yR.jpg" alt = "यहाँ छवि विवरण दर्ज करें"> लेकिन जब मैं "रिकॉर्ड संपादित करें" , मुझे मिल जाता है मेरे आंशिक दृश्य पाठ बॉक्स में निम्न की तरह: निम्नलिखित मेरा मॉडल है: [DataType (DataType.Date), DisplayFormat (DataFormatString = "{0: d}", ApplyFormatInEditMode = true)] सार्वजनिक Nullable & lt; System.DateTime & gt ; रिलीज़डेट {प्राप्त करें; सेट; } निम्नलिखित मेरा आंशिक दृश्य कोड है: & lt; div class = "editor-field" & gt; @ Html.TextBoxFor (मॉडल = & gt; मॉडल। रीलीज डेट, नया {@class = "दिनांक"}) @ एचटीएमएल। वैधता संदेश (मॉडल = & gt; मॉडल। रीलीज डेट) & lt; / div & gt; & Lt; स्क्रिप्ट प्रकार = "टेक्स्ट / जावास्क्रिप्ट" & g...

.net - why listview scrolliintoview is not working? -

I have a list of items and next I have a button I want functionality like this, when I click on the button I'll show items related to the list view at the top of the list. For this I thought that Screintwe would work, but unfortunately it is not working. Any suggestions? ... lstview.SelectedItem = lstview.Items.GetItemAt (lstview.SelectedIndex); Lstview.ScrollIntoView (lstview.SelectedItem); Lstview.UpdateLayout (); ..... The ScrollIntoView method will only show items, if it appears If it is already visible, then the method will not have any effect from the call. In your case, if you are able to click on the item, then the item is in the view and there is no need to scroll. Explanation. If the object is not visible, then it is aligned above or below the viewport. If you always want that item to be the first item in the viewport, you must adjust the vertical offset to get the Y value of your ListBox and scroll the scroll viewer to the Y value. listBoxScrollViewer...

java - Replace constructor with factory method -

In Java, a factory manufacturer can be defined in an abstract superclass: Make a Public Static GuardianTilfrom Type (Int Type) {Switch (Type) {Case 0: Return New Child 1 (); Case 1: New hair 2 () returned; Default: throw a new exception (); }} But, in Objective-C, I'm not getting any known class method for 'Selector' for "all code" case1 : #import "Child1.h" #import "Child2.h" @implementationParent + (id) createChildFromType: type {switch (type) {case 0: return [[Child1 Alloc] init]; Case 1: Return [[Child2 alloc] init]; Default: @ throw [NSE option with name exception: NSInternalInconsistencyException Reason: @ "Invalid subclass type." UserInfo: zero]; }} - (zero) someAbstractMethod {@throw [NSException exception: with name: NSInternalInconsistencyException reason: [NSString stringWithFormat: @ "You must override% @ in a subclass.", NSStringFromSelector (_cmd)] userInfo: zero]; } @end Both Child1.h and ...

java - setContentLength is set high -

जब setContentLength विधि का उपयोग उच्च लंबाई के साथ प्रतिक्रिया की लंबाई निर्धारित करने के लिए किया जाता है वास्तविक आकार के मुकाबले, कंटेनर को लंबाई की गणना के लिए स्वतः क्यों नहीं है उदाहरण के लिए, स्ट्रिंग s = "हैलो"; बाइट [] बी = s.getBytes (); response.setContentLength (100); । Response.getOutputStream () लिखना (ख); response.flush (); जब मैं सर्वलेट को मारा, पृष्ठ को लोड करने में लगभग आधा मिनट लगता है, यह सामग्री लंबाई शीर्षलेख की वजह से है ..? आवश्यकता क्या है ऐसी विधि के लिए? यदि आप वापस लौटना चाहते हैं तो क्यों नहीं कंटेनर को प्रतिक्रिया की लंबाई की गणना करने के लिए बनाया जा सकता है? बड़ी सामग्रियों को यह पूरी तरह से पूर्ण प्रतिक्रिया लोड करने के लिए व्यावहारिक नहीं है और इसे एक बार में भेजना है, लेकिन इसे लोड करने और विखंडनों में भेजना है। चूंकि लंबाई प्रतिक्रिया की शुरुआत के हिस्से के रूप में भेजी जाती है, इसलिए कंटेनर को बाद में बदलने के लिए कोई रास्ता नहीं है। इस मामले में आप कंटेनर को बताते हैं कि आपकी प्रतिक्रिया 100 बाइट्स है, आप पहले 5 ब...

angularjs - Deploying ASP.Net MVC, Angular application download file when there is a change -

I have an ASP.NET application that uses Angular JS, Javascript, HTML5. The problem is that when I can cache some files to the browser, which results in errors, because the user is not getting the latest HTML and JavaScript files. I know that there is a MANIFEST file in HTML 5 that can force the file to download; the file has actually been replaced when a more efficient way to download the file is? I understand that this is not just for javascript files, which are not HTML files? I am not sure that it is swaped using the related angulas as a number of these HIL files using ng-visual and templates. Any clue will be appreciated. I am trying to use bundles, but do not make sure it applies to html files using angulars thanks updated answer I'm not sure that this angle is related because many HIL files are ng-visons And are swapping using templates. The number of bundling decreases. Request for the server For AngularJS, you can use a technique at build time to...

c# - Unity.RegistrationByConvention.WithXXX members are accessed like properties when they are actually methods -

In most examples, and, I see methods with classes WithMappings , Unlimited with and withName are used as Microsoft.Practices.Unity.RegistrationByConvention.dll version 3.5.0, as if they were properties, but When I see them in the reflector, I see that they are the methods and they expect a array of (mostly) System.Type or System.Type . What's the deal? Are these examples wrong or am I missing something? If you look at the definition of the container. Registration Type Method, you will see that GetFromTypes, getName, getLifetimeManager, and getInjectionMembers are expecting all types of Func, which means they expect a method, for example getName is defined as: function & lt; Type, string & gt; GetName = null This allows you to pass in a method that accepts a type parameter and returns a string, such as standard string withName.TypeName (type Type) method However, it gives you the flexibility to define your own method with the same signature if yo...

linux - IO location vs Memory region -

As I was going through the section accessing I / O and memory space , Page # 15, I wonder what's the difference between the IO location and memory area. Here are the first two sentences ... A PCI device applies above six I / O address areas. Each area has memory or I / O location. I would like to know the difference between memory and I / O location. The difference is generally how the device is addressed. The word 'location' in your question usually refers to device mapping, that is, whether the device is an I / O map or a memory map. The difference between the two is that the I / O uses dedicated instructions and control signals to access the mapped I / OI / O space, while the memory mapped I / O is the same Using the instruction, to access the memory, in that case, instead of moving to the memory location, the data goes to the device (or incoming). As far as PCI devices are concerned, it is capable of mapping for both / o as well as any of the memo...

c - Modbus rtu slave is not responding to modbus rtu master -

I am using this program. This is in my prototype slave which has the stm32f103c6 microcontroller. Again I send the request of my slave to the help of doclite software, but it does not respond. What should I do? I set the master's baud rate and slave equal, so this is not a problem. I was thinking that the program might be some error but I could not find it. So please help me find something wrong in this program that I have downloaded from Google code which I have shown above. Any suggestion that you would like to suggest, please give me suggestions. Try removing the CRC request on the input data and then try communicating through the doclite Please make sure that the CRC module of code is working properly.

Store values in PHP -

I have an object on which there is a single comment and after that the object is sub -jected on which each comment on May be as it is today, I have comment on the whole object and a single variable to store a list for archiving comments for the object subject. public $ TestResultComments = array (); Public $ comment; Now I do not want to store plain text of only one comment but also to store the name of the person who wrote and timestamp. So instead of single variable $ comment , I now want to store three, what is the best way to store it, in the array or is there something similar, such as Haskell where there are tuples? $ comment = odbc_result ($ result, "comment"); $ UserName = odbc_result ($ result, "username"); $ TimeStamp = odbc_result ($ result, "timestamp"); $ TestResult-> Comment = $ comment; // I do this today, but I want to include $ username and timestamps here The second part is where I archive the subobjects for comments. ...

Combobox in C# i Need to fill two value in combo box -

I have a problem with the C # code for the combo box. My code is here CmbProjectName Items.Clear (); If (obds.Tables.Count & gt; 0 and amp; amp; and obds.Tables [0] .rav count * gt; {for (int iCount = 0; iCount & lt; obds.Tables [0] .Rows.Count; ICount ++) {cmbProjectName.Items.Add (obds.Tables [0] .ows [iCount] ["Project_Name"]. ToString ()); }} Add value to the combo box but I will add the indicator of this item for further operation on other items, please notify me ... The solution for JAEP will work by using the class. There is another way to bind a dictionary, you do not have to make extra classes here. The code will be down in your case. Replace ICount with the index you want. cmbProjectName.Items.Clear (); Dictionary & lt; Int, string & gt; ProjectsDictionary = New Dictionary & lt; Int, string & gt; (); If (obds.Tables.Count & gt; 0 and amp; amp; and obds.Tables [0] .rav count * gt; {for (int iCount = 0; iCount & lt; ...

vhdl assign specific bit of std_logic_vector with index failed -

मैंने ऐसा करने की कोशिश की पुस्तकालय आईईईई; IEEE.STD_LOGIC_1164.ALL का उपयोग करें; IEEE.STD_LOGIC_ARITH.ALL का उपयोग करें; IEEE.STD_LOGIC_UNSIGNED.ALL का उपयोग करें; इकाई mux_8to1 पोर्ट (Y: STD_LOGIC_VECTOR (0 से 7) में; एस: STD_LOGIC_VECTOR में (2 से डाउन 0); एफ: बाहर STD_LOGIC); अंत mux_8to1; वास्तुकला mux_8to1 का व्यवहार शुरू होता है: i से 0 से 7 में उत्पन्न एफ & lt; = y (i) जब S = i और '0'; अंत रन बनाने; अंत व्यवहार; लेकिन Xilinx मुझे एक त्रुटि रिपोर्ट त्रुटि: Xst: 528 - इकाई में मल्टी-स्रोत & lt; mux_8to1 & gt; सिग्नल पर & lt; F & gt; क्या यह इनपुट इनपुट या कहीं पर इस्तेमाल नहीं किया जा सकता है? संश्लेषण उपकरण उत्पन्न पाश को अनवरोधित करेगा, जिसके परिणामस्वरूप: F & lt; = Y (0) जब S = 0 else '0'; एफ एंड एलटी; = वाई (1) जब एस = 1 और '0'; ... एफ एंड एलटी; = वाई (7) जब एस = 7 और '0'; आप देख सकते हैं कि एफ के पास कई ड्राइवर हैं, जो वास्तव में Xilinx संश्लेषण के बारे में शिकायत करता है। गैर-मानक वीएचडी...

android - Open installed apps from Flex app -

I am developing a FLEX mobile application, the goal I want to achieve is to get the device from Flex App already There is an open-ended application to be installed on. Click on a button and the app is opened directly from my app. What is the easiest way to do this? I read somewhere about ANE, but in fact I do not know the need or I can not understand ANE's work. What is the way to do this on Android? And what is the case for iOS? You should use. It receives the package name of all installed apps on the device. And then you can open the application using some assumptions.

objective c - Get exactly 1 day using NSDate -

I How can a day before using NSDate i.e. 2014-08-01 00:00:00 +0000 of 2014-08-01 23:59:59 +0000 Is it possible to use Ansdit? I do not clearly understand your question. If you to get the next day for NSDate are: + (Ansditi *) Nanbrofde: (Ansaitiafr) Nanbrof D: to: date (Ansdit *) {NSDATConnector * DayCompany = [[NSDATCompanies Eloop] Init]; DayComponent.day = numberOfDays; NSCalendar * Calendar = [NSCalendar Current Calendar]; Return [calendar dated date banking companies: day to date: Sedet options: 0]; } If you want to compare the two, two-day Ansdite the same day, then (Ansditi category): - (BOOL) is onsmadeae :: (NSDT *) Date {NSC calendar * Calendar = [NSC calendar carrier]; NSDateComponents * components1 = [calendar components: (NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit | NSWeekdayCalendarUnit | NSWeekdayOrdinalCalendarUnit] date: self]; NSDateCompo...

c# - Comparing namespaces to see if they match -

I'm trying to compare namespaces to see if only in my method only throws the right exception With the right exceptions I mean the following: Exception from the same namespace. Exception from high namespace. Exception from the equivalent (and higher) system-namespace. Example: The method is in the namespace MyNamespace.Collections.Generic , so it can throw exceptions from MyNamespace.Collections.Generic . The method is in the namespace MyNamespace.Collections.Generic , so it is MyNamespace.Collections and MyNamespace . The method is in the namespace MyNamespace.Collections.Generic , so it can throw exceptions from System.Collections.Generic and System.Collections and system . The first section is quite easy; One part of the same name space check number 3 works; Because system namespace is always correct For other parts I tried the following: string [exceptNamespaceSegments = exceptionNamespaceSegments. Except (classNamespaceSegments) ToArray (...

format - Gnuplot Date and Time on the x axis -

What I want to do is a graph, where my x axis takes a date from the first column of data and then a time From my second column and using both to create an X-axis, I have a set of data from a date logger that I want to graph on Gnuplot, because I get new data every day And it would be just like every T.T.T. Adding to the file as much as I find them The text file looks like this (each span is 24 hours) Date time value 30/07 / 2014 00:59:38 0.075 30/07/2014 00:58:34 0.102 30/07/2014 00:57:31 0.058 30/07/2014 00: 56:31 0.089 30/07/2014 00:55:28 0.119 30/07/2014 00:54:26 0.151 30/07/2014 00:53:22 0.17 30 / 07/2014 00:52:19 0.171 - 30/07/2014 00:51:17 0.221 30/07/2014 00:50:17 0 30/07/2014 00:49: 13 0 30 / 07/2014 00:48:11 0 30/07/2014 00:47:09 0 This solution will suit me perfectly, but its very complex and I do not know what's going on, Akel It is applied to many files Here I tried the code, but I get illegal day error month? #! / Gnuplot set timezone ...

kettle - Sort Raw step is not working proper in pentaho PDI -

Image
Here before I use the sort lines step and before sorting in descending order based on "CB_LearningObjectStartTimeStamp" Attaching shots "and" CB_USIRID "field You can see that the consumer EMPLID and CB_UserID remain the same for a user, and after sorting CB_UserID, some pages are changing between the same user I can tell you that I am doing something wrong ... how can I solve this issue. Because 1 user will have to be equal to consumer EMPLID and CB_UserID because it is coming well before sorting. The data inside does not change the line. It is likely to interrupt the other rows that you are looking at. You must properly select the fields properly if you only sort on the basis of that timestamp, then according to that timestamp the rows will be output and all the other rows Based on that order, the output will be based on order.

java - How to convert .mov, .avi, .wmv to mp4 -

I'm new to xuggler. I'm ready to convert. Use mov, .avi, .wmv to convert mv4 into mv4 and .wmv first to flv and then convert it to mp4 using mp4 xuggler. But I want to convert directly to MP4 but AV does not convert to FLV and MP4. I use simple code. IMDI ​​Reader Reader = ToolFactor. Macadar ("1.mov"); Reader.addListener (ToolFactory.makeWriter ("wild.flv", Reader)); While (reader.readPacket () == faucet); Please help me understand it. Thank you You can try it to input and output in the required format. IMDI ​​reader media reader = toolfactor Macready (inputfilmenam); IMDIRDriver MediaWriter = Toolfactor. Makveter (outputfilemen, mediareader); MediaReader.addListener (mediaWriter); IMDAVE Media Media = Toolfinner Meikyuvur (true); MediaReader.addListener (mediaViewer);

Creating C++ class instances globally within my main file -

I have a program with some classes for OpenGL stuff: windows, programs, etc. I would like the example of windows and programmable sections that use to be main for the main file in my main file, I was doing it for a while with the window like this // outside main window ("test", // heading 1366, // width 768, // height); Then I can use this example in the rest of the main file eg. // within main () .create (); Window.refresh (); etc. Now when I try to make a global example of the program, I do it like this: // just below the window, still main () Program program (); // There is no logic for the program, then when I try to use it in my main function like this: program. AddShader (GL_VERTEX_SHADER, "vertex_shader_source.glsl"); I get an error: The request for member 'add-ons' in the 'program', which requests of non-square type 'program' It seems as if the compiler thinks that my initiality of the first example ...

javascript - jasmine.clock().tick() does not work with $timeout and debounce, but works fine with setTimeout -

Below I have 3 functions that do exactly the same thing. Each one uses a different way of calling a setTimeout, the delay 1 (), uses the settime directly, delay 2 () uses angularjs $ timeout and delays (3), uses the launches debugging All work fine. The problem occurs when I do a test using Jasmine. SetTimeout works fine with jasmine. Clock (). Tick ​​() method, but do not have $ timeout and debugging I am interested in doing Debian work with Jasmine, I know that I can use timeout.flush with angularjs, but $ timeout And setTimeout is giving me some other problems in my code where I'm experimenting with this leaflet map works well with debug leaflets. I have created a plunker here: where you will see the time-limits and see the tests that are not passed when passing the settime exam. Is there any way i can work around this problem? Thanks JS var app = angular Module ('plunker', []); App.controller ('MainCtrl', function ($ radius, $ timeout) {$ scope....

javascript - Hide or show a div element based on IP address -

Is it possible, to create Apache, Javascript, or CSS (or something in the plan for that matter) ) & Lt; Div & gt; Is IP address visible only for a certain category? The code below I want to be available for a certain category IP address: Ideally, I will only see it from 3 set IP addresses. Allow order, refuse to deny, allow, allow allow, to control access to Apache, but on the whole site, the following restrictions (IP addresses change) Given) are a separate site. Permission from 000.0.00 to 000.0.01, deny the order, Allow anyone to reject The purpose of this is to allow anyone to send a pop-up login (or login page ) To access the site from within a certain location even if I hide any person who does not reach the IP address limit only then "user" div (not the login button) If so Oga. Thank you You can use to explicitly specify a group for viewers Optimize your Plone template, and then customize your Plone template so that your div is conditio...

generics - How to declare a covariant type correctly in Scala? -

I have created a property with the following symptoms and methods (descriptions are omitted): property trash [A and lieutenant;: java.io.Serializable] {Def Push (key: string, value: a) = ??? Def bridge (key: string): A = ??? } The following code is not compiled (the document class implies java.io.Serializable , and the list tool Scala.Sableializable which extends java.io.Serializable ): Class Docs enhances service waste [list [document]] {. ..} The error message said something like this: The Cachable [list [document]] type does not correspond to Cachable [A & lt;: java.io.Serializable]. If I understand the issue properly, the compiler means that Cachable [scala.Serializable] Cachable [java.io.Serializable] Does not have a subtype. I thought, & lt ;: is like the statement of Java? How can this fix in scale?

jquery - Highcharts reflow does not work on class selector -

Did anyone try to run High Chart reflow () function on class selector instead of ID selector? See examples where I have 2 charts with 1 chart, which is to toggle the size of their divisvei. I have the second 2 buttons, to reflow the chart by an id, and The second class reflows the chart. Note that no two charts using class selector refill, and it only reflows the first element using that square. HTML: & lt; Script src = "http://code.highcharts.com/highcharts .js" & gt; & Lt; / Script & gt; & Lt; Script src = "http://code.highcharts.com/modules/exporting.js" & gt; & Lt; / Script & gt; & Lt; Div style = "width: 600px" & gt; & Lt; Div id = "container1" class = "needreflow" style = "width: 400px; height: 300px; margin: 1em; range: 1px solid brown" & gt; & Lt; / Div & gt; & Lt; Div id = "container2" class = "needreflow" style = "widt...

javascript - How does requiring modules manually differ from calling them dynamically with browserify? -

Sorry for the strange post title, but it's a very strange situation inside. In my project I have such folder structure: / filter index.js [...] / controller index.js [...] app.js App JS is basically the entry point of my application and I think it would be nice if I can automatically load the contents of those directories with the requirement of I am Directory and index .js take care of loading in all the directories that need to load it. But I'm running into a problem that I do not understand. Because I'm deliberately frustrated (this is a learning / experiment practice) I tried and decided to keep it dry as human, so I tried this big code to handle module loading: 'strict use'; Var custom modules = ['controller', 'filter']; //require('/controllers'); //require('./filters'); (For var i in custom module) {if (custom module hasOwnProperty (i)) {Required ('./' + custom module [i]); }} Var Basic Module = [...

Fiddlercore: Unable to intercept network traffic, when we manually set no proxy in firefox. -

Image
मैंने नेटवर्क ट्रैफ़िक को अवरुद्ध करने के लिए C # FiddlerCore API का उपयोग किया है। फिडलरकोर सेट हमारे मशीन में प्रॉक्सी। मैं सभी ब्राउज़र के माध्यम से नेटवर्क यातायात पर कब्जा करने में सक्षम हूं। लेकिन फ़ायरफ़ॉक्स में प्रॉक्सी सेट करने का तरीका है, हम फ़ायरफ़ॉक्स में प्रॉक्सी नहीं सेट भी कर सकते हैं। जब मैं फ़ाइंडलकोर की तुलना में फ़ायरफ़ॉक्स में कोई प्रॉक्सी सेट नहीं करता तो फ़ायरफ़ॉक्स नेटवर्क को अवरुद्ध करने में असमर्थ है, लेकिन फिडलरकोर अन्य ब्राउज़र के नेटवर्क यातायात को रोक सकता है। मेरा प्रश्न है कि फिडलर के माध्यम से प्रॉक्सी सेट करने के बाद, फ़ायरफ़ॉक्स कोई प्रॉक्सी मोड में काम नहीं करते हैं ..? हम नेटवर्क ट्रैफिक को भी कैसे रोक सकते हैं, भले ही हम फ़ायरफ़ॉक्स में कोई प्रॉक्सी सेट न करें। यहां बताया गया है कि कैसे मैं फ़ायरफ़ॉक्स में कोई प्रॉक्सी नहीं सेट करता हूं। फिडलर एक प्रॉक्सी है, यह केवल उस ट्रैफ़िक को देखता है जिसे इसे भेजा जाता है। / P> डिफ़ॉल्ट रूप से, अधिकांश विंडोज ब्राउज़र (सफारी, क्रोम, आईई, आदि) IE के उपकरण> इंटरनेट विकल्प> कनेक्...

android - Getting object from DB returns empty object or app crashes -

In my DB Manager class, I have a way of recovering the selected group with group_db and trip_db parameters. public selected_ group get_selected_group_by_group_id_and_trip_id (int trip_id, int group_id) {open_readable (); Cursor cursor = db.query (static.tablets_names.TABLE_NAME_SELECTED_GROUPS, blank, "trip_id =" + trip_id + "& group_id =" + group_id, empty, blank, empty, empty); Int sg_id = 0; Int sg_trip_id = 0; Int sg_group_id = 0; While (cursor.movteonxt ()) {sg_id = cursor.getInt (0); Sg_trip_id = Cursor.Gist (1); Sg_group_id = cursor.getInt (2); } Selected_groupsg = new selected_groups (sg_id, sg_trip_id, sg_group_id); Cursor.close (); Close (); Return sg; } However in this case the cursor skips the entire while loop and I am getting a selected group with initial values, i.e. _id = 0 So I tried it like this: gets the public chosen group - selected / group_by_graph_id_ and_trop_id (int trip_id, int group_id) {open_readable (); Cursor cursor =...