Posts

Showing posts from May, 2010

c# Array.ForEach alternative that replaces elements -

Is there a standard function that I can use again on an array in ForEach, in each element Applying a function and changing it with the result in the array? Something like the following, but later the dimension powers include the result of difference (2, I) on each element. Dimensions Powers = Numerical Category (0, dimension + 1) .oir (); Array.ForEach (Dimension Power, (i) => intoto (2, i)); (I know that I can iterate with an array for loop - I'm just wondering if there is a more concise option). Most types of orreter implementations (you actually need a "map" function) gives a new instance, for example an array, you can use LINQ: newArray = dimensionPowers.Select (i = & gt; IntPow (2, i)). ToArray (); Or better: dimension power = enumerable Category (0, dimension + 1). Choose (i => intoto (2, i)) .toArray (); However, if you want to modify the original array in-place, it is good to look old: for (int i = 0; I It is enough for...

mysql - Connect Android with database -

I am doing an academic project on electronic voting and connecting my Android application with my MySQL database designed in XMP Will happen. Apart from this, I am using the Eclipse program to do my project. Can you help me find a way to connect Android to XMD? If you need an application to connect to a database on the webserver, then create a REST service on the webserver. It can be best for you and then access it.

ruby on rails - Nested attributes saving error -

मेरे पास मॉडल हैं वर्ग सर्वेक्षण & lt; ActiveRecord :: बेस has_many: questions_as_list validates: शीर्षक,: उपस्थिति = & gt; सही मान्य है: short_description,: उपस्थिति = & true; मान्य मान्य: वर्णन,, उपस्थिति = & gt; सच अंत वर्ग प्रश्न & lt; ActiveRecord :: बेस is_to: सर्वेक्षण has_many: विकल्प स्वीकार करता है __ nested_attributes_for: options,: reject_if = & gt; लैम्ब्डा {| एक | एक [: शीर्षक] .blank? },: Allow_destroy = & gt; सच्चे कृत्यों_स_सूची: दायरा = & gt;: सर्वे एंड क्लास विकल्प & lt; ActiveRecord :: बेस attr_accessible: शीर्षक,: वर्णन,: स्थिति is_to: प्रश्न actions_as_list: scope = & gt;: सर्वेक्षण समाप्त जब मैं प्रश्न मॉडल को सहेज या अद्यतन करता हूं तो यह एक त्रुटि उत्पन्न करता है @question = Question.new (params [: प्रश्न]) @ सवालःव्व्वः प्रश्न = प्रश्न.फंड (पाराम [: आईडी]) @ प्रश्न। अपडेट_एडिटिब्यूट्स (पैराम्स [: प्रश्न]) दोनों मामलों में यह एक त्रुटि उत्पन्न करता है NoMethodError (# & lt; विकल्प: 0xb332394 & g...

asp.net - Displaying a image in a div -

I'm having trouble displaying an image in a div element. Div has a custom web control (a login control). & lt;% @page language = "c #" auto eventWireUp = "true" codefile = "login.aspx.cs" inherit = "login" theme = "styles"%> & Lt;% @ Register src = "wucLogin.ascx" tag name = "wucLogin" tagprofix = "log"% & gt; & Lt ;; DOCTYPE HTML PUBLIC "- // W3C // DTT XHTML 1.0 Transcription // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Head runat = "server" & gt; & Lt; Title & gt; Login & lt; / Title & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "app_Themes / styles / loginstyleshit.css" /> & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form id = "form1" run...

c++ - problem with Fmod wrapper (soundManager) for Ogre3d -

For fmod in Ogre 3D engine, I have a problem with the sound administrator (class). Here's just the code: ISoundManager.hIf someone wants me to upload it but I can not upload more than 2 hyperlinks now. SoundManager.h I have a simple code piece to play sound: ` SoundManager * soundManagerPtr = new SoundManager; SoundManagerPtr- & gt; Start (); Int mySound1 = soundManagerPtr- & gt; CreateStream (Ogre :: String ("boing.wav")); Int channel 1 = 0; SoundManager- gt; Place (mySound1, headNode, and channel1); Sound managerpat; Correcting ` , everything is fine, the sound is loading, but the PlaySound () function does not throws any errors and does not play sound even on the Ogre 3D forum Was asking, but no solution yet. I believe the sound manager needs to update and this is the frame starred () it means that you have started to start your ogre app to start the game to start the sound; root-> gt; StartRendering (); . Have you tried The above code ...

haskell - What type of math is this: a -> b -> c -

I often see similar types of announcements by looking at Haskell: A ->; (B -> C) I understand that it describes a function that takes some form and gives a new function that takes some of Type B And gives some sort of cues. I also understand that types are collaborative (edit: I was wrong about this - see the comments below), so the above can be written to get the same result: (a ->; b) - & gt; C This will describe a function that takes some form and some type of B and gives some sort of form. I have also heard that you a which I think is c -> B - & gt; A but I'm not sure. My question is, what is the name of such math? I want to know more about this so that I can help me write better programs. I'm interested in learning some things which is a complimentary work, and how other types of changes can be made on types of announcements. Thank you! Speaking roughly, it falls into the scope. Since this has to be done with the...

How to convert a String to long in javascript? -

I have a millisecond timestamp that I need to change from string to long. I have a parseInt in javascript but there is no parseLong . So how can I do this? Thanks EDIT: To make a little detail on my question: apparently, there is not a long type in JavaScript, I have long been easy How can I make arithmetic, which are initially expressed as strings? To get Delta one time, one has to subtract one from the other? A number type in javascript which is a 64 bit floating point number * . If you want to convert a string to a number, use either if I am using parseInt , So I always want to go through Radix. Use the Unary + operator e.g. + "123456" Use constructor example var n = number ("12343") * There are circumstances where the numbers will be internally organized as integers.

php - Encode any character to numbers/Latin and decode it back -

I have a UTF 8 string that contains non-English symbols. I tried htmlentities ('a ??') The result is & amp; Aring; & Amp; Shy; , but I need something like x3445 , so I can use html_entity_decode () or return some basic characters like this. How can I do this with PHP? Unfortunately, the heelentity will encode only those characters who have a named institution. To convert everything into a numerical unit, you can use mb_encode_numericentities For example, $ string = mb_encode_numericentity (HTML Straits, ENT_QUOTES, 'UTF -8 '), array (0x80, 0xffff, 0, 0xffff),' UTF-8 ');

objective c - How to use Xcode to populate PDF and HTML templates with user-defined variable data -

OK, so I've developed my entire user interface with encoded. I have set different text areas as variables, and I am trying to figure out how to populate PDF templates or HTML templates with this user defined variable data. First of all, which would be better for printing hardware printer, not in coding sense) - PDF or HTML? Secondly, is it possible to populate user input in PDF or HTML templates? I am writing a legal software suite that does not need to appear in the PDF / HTML templates interface, only when printing text on print, or any other source (iPad, laptop, etc.)? Thanks for any advice you can make. Mitch I think creating an HTML document would be easy, but For, PDF is better because that is, as far as I know, HTML is provided differently depending on the browser, but the PDF will always look the same. To create HTML, you can just write a plain text so that you can write the hand before the template, read that template in a string in memory, search for t...

jquery event not registering -

I have an image in which I have one click event, which is fine if I go $ ('# Image-id') Click (function () {warning ('click');}); My problem is that if I go $ MyGlobals = {ID: $ ('# image-id')}; Var mg = $ Meglobles; Mg.id.click (function () {alert ('clicked';)}; The second method does not work at all, but if I try to get an attribute, then mg .id.attr ('title'); This gives fine, its only events that do not work. Perhaps you've added a button after the document has been loaded. You can try to use live instead. mg.id.live ('click', function () {warning ('click');});

c++ - What does this mean? int foo = foo + 4; -

#include & lt; iostream & gt; Int main (int argc, char ** args) {int foo = foo + 4; Std :: cout & lt; & lt; फू & लेफ्टिनेंट; & lt; std :: endl; } और एक अनुवर्ती प्रश्न, क्या इस प्रकार की वस्तु को रोकने के लिए एक संकलक ध्वज है? मुझे मिल गया -नहीं कभी-कभी काम करते हैं, इसे पूरी तरह से पूरी तरह से रोकने के लिए बेहतर होगा। मेरा कंपाइलर: जी ++-वी का उपयोग कर निर्मित ऐप में लक्ष्य: i486-linux-gnu के साथ कॉन्फ़िगर किया गया है: ../src/configure -v --with-pkgversion = 'उबुंटू 4.4.3-4ubuntu5' --with-bugurl = फ़ाइल: /// usr / share / doc / gcc -4.4 / रीडमी.बग्स --सक्षम-भाषाओं = सी, सी ++, फॉरेन, ओबीजेसी, ओबीजे-सी ++ - प्रीफिक्स = / यूएसआर --सेंट-साझा --सक्षम-बहुआयामी --सक्षम-लिंकर-बिल्ड-आईडी - With-system-zlib --libexecdir = / usr / lib - बिना-शामिल-गेटटेक्स्ट - सक्षम-धागे = posix --with-gxx-शामिल करें- dir = / usr / include / c ++ / 4.4 --प्रोग्राम-प्रत्यय = -4.4 - सक्षम-एनएलएस - सक्षम-क्लोकेल = जीएनयू --enable-libstdcxx-debug --enable-plugin --enable-o...

Vertical Seekbar and problems with R / android.R -

I am trying to get a vertical socket in my app and I have found a sort of solution here: I downloaded and it looks good but how do I import it into my app? If I drag the source into my project then I get a bunch of errors related to "R" Create a new project from an existing source If you are getting errors related to R class, then clean and recreate the project and make sure that you are importing com.example.R instead of Android. R.

jquery selectors - Simpler way of coding this -

On this page: I have this jQuery, but it seems a little curved. & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("p"). Hide (); $ ("# lastfmrecords") Hide (); $ ("h2.btn1 a") Click (function () ($ ("Ol.btn1> *") Toggle (400);}); $ ("h2.btn2 a"). Click (function () {$ ("ol.btn2> *" Click toggle (400) $ ("H2.btn3 a"). (Function () {$ ("ol.btn3 & gt; *") Toggle (400);}); $ ("h2.btn4 A "). Click (function () ($ (" ol.btn4> * ") Toggle (400);}); $ (" h2.btn5 a "). Click (function () {$ ("Ol.btn5> *") $ ("H2.btn6 a"). (Function () {$ ("ol.btn6 & gt; *") Toggle (400);}); $ ("H2.btn7 one"). Click (function () {$ ("ol.btn7> *") Toggle (400);})}}); & lt; / script & gt; & Lt ; H2 class = "btn5" & gt; & lt; a hr Ef = "#...

WPF Data binding: How to bind items in ItemsCollection to Grid.Row and Grid.Column? -

मेरे पास एक वर्ग है: सार्वजनिक वर्ग TempClass {सार्वजनिक इंक पंक्ति {get {return पंक्ति; } सेट {row = value; }} सार्वजनिक एट कॉलम {प्राप्त करें {रिटर्न कॉलम; } सेट {column = value; }} सार्वजनिक स्ट्रिंग मान {get {return.value; } सेट {this.value = value; }} Int पंक्ति; इंट कॉलम; स्ट्रिंग मान; सार्वजनिक TempClass (int पंक्ति, int स्तंभ, स्ट्रिंग मान) {this.row = पंक्ति; This.column = कॉलम; This.value = मान; }} मैंने एक सूची & lt; TempClass & gt; DummyCollection और मैंने इसे एक ItemsControl पर बाध्य किया है ItemsControl एक UniformGrid पैनल के लिए ItemsPanel संपत्ति का उपयोग करता है। यहां एक्सएएमएल कोड है: & lt; आइटमोंकंट्रोल आइटमों स्रोत = "{बाध्यकारी पथ = DummyCollection}" & gt; & LT; ItemsControl.ItemsPanel & gt; & LT; ItemsPanelTemplate & gt; & Lt; यूनिफ़ॉर्म ग्रिड पंक्तियाँ = "3" स्तंभ = "5" / & gt; & Lt; / ItemsPanelTemplate & gt; & LT; /ItemsControl.ItemsPanel> & LT; Items...

jquery - if appending divs with getJSON, is it possible to display them animated one at a time? -

Everyone. I connect some devices through a getJSON function but I want to jazz a bit. All divs are currently displayed at the same time. Is it possible to separate milliseconds? Like the first fades, then the second, and so on? For example, what do I still have: $ Attached ("& lt; div class = 'thumb_container' & gt; .... & lt; / div & gt;"). Every child (results, work (i, area) {$ (". Thumbnail_area"). (). CSS ('background-color', 'red'). Delay (1000). FadeOut (1000);}); // the function of the result); // foreach function So far, everything fades out after each other (oh BTW I know I said I wanted them to be faded, but the image is just fade Thank you guys each frequency To generate incremental delays, the index value ( i ) that you already joined in the loop Use. $ Each (result, function (i, region) {$ (". Thumbnail_re"). Enclosed (" Each item will be delayed in i * 1000 milliseconds, so...

php - data input abstraction layer? -

I have to do a custom function with a insert / edit / delete records > Database for each page without writing single questions I have thought of moving forward in this way: // page.php: $ datainput = new data inputAbrace (); $ Datainput-> SetTableName = 'portal'; $ Datainput-> SetAllowedFields = Array ('name' = & gt; 'defaultvalue', 'text' =>; '', 'desc' = & gt; ''); $ Datainput-> Run (); // DataInputAbstraction.class.php: class dataInputAbracements {// & gt; Atr Public Function Run (if (Asset ($ _ POST ['Action']) and $ _POST ['Action'] == 'Insert') {$ filteredData = array_intersect_key ($ this- & gt; allowed fields , $ _pd); // $ ;- $ FilteredData to enter $ this-> Table} // & gt; if $ _POST ['action'] == 'edit' | ' Dell '}} Basically the action is executed () $ _POST [' Action ']. Unwanted variables with filtering Fiel...

ranking - 10 period moving average in MySql without using date -

I have a table of goalkeeper data, below snipet year gameid player sv% gamenum 2009 200165 John Smith 0.923 0165 2009 209 754 John Smith 1.000 9754 2009 206 938 John Smith 1.000 6938 2009 206 155 John Smith 0.833 6155 2009 203 021 John Smith 0.667 3021 2009 206 472 John Smith 0.909 6472 2009 209 524 John Smith 0.833 9524 2009 209 351 John Smith 0.800 9351 2009 203 056 John Smith 1.000 3056 2009 206 761 John Smith 0.935 6761 2009 200 466 John Smith 0.954 0466 2009 204 171 John Smith 0.932 4171 2009 207 876 John Smith 0.958 7876 2009 201 581 John Smith 0.941 1581 2009 205286 John scheme Thessalonica 0.930 5286 2009 208 991 John Smith 0.961 8991 2009 202 696 John Smith 0.916 2696 2009 206 401 John Smith 0.935 6401 2009 200 106 John Smith 0.921 0106 2009 201 381 John Smith .918 1381 I have 10 games each goalkeeper Want to get average moving, but I do not have dates or game numbers such as their first, second, third game etc. Game ID is assigned to an LSO order in which they are p...

Demo for Displaying Multiple Google Directions (Google Maps API v3) -

All of that, is there a work demo to display many directional routes on a Google map? Link to a set of snippets ?? | I think I am able to work better, I have seen a functional script in action. Thanks a lot! Using snippets from other posts, I found what I wanted. I have not only displayed many guidelines on one map, but there are unique methods for each instructional item.

forms - JQuery preventDefault() is stopping subsequent function -

I am using def default function to prevent my form from being paused. It's working fine, but following that function I'm no longer having an onClick function which is working. Strange, onclick function I have a simple div centric function which is also doing the following form preventDefault is doing the following work? Edit: I found this problem, the onclick function was for an item that was loaded by AJAX in the first function. So the selector was probably not finding this Below is my code: submit $ zip code ("#get_zip"). Submit (function (zip) {// submit zipcode $ .ajax ({type: "post", url: "ajax_calls.php", data: "zip =" + $ ('# zip') + & Amp; send_zip $ ("#Lightbox, #Welcome") .FadeOut (300);}, Error: Work () {Warning 3); $ ("# Error") Text ("Could not find post") fadein 300) .delay (900) .fadeOut (300)}}; .. // Stop form submission action zip.preventDefault ();}); // Center it...

ruby on rails - heroku deployment error -

My Rail app works fine on my local machine, but it displays the error on each other: 2011-03-27 T 13: 21: 45-07: 00app [Web.1]: /app/.bundle/gems/ruby/1.8/gems/activesupp ort-3.0.4 / lib / active_support / dependencies.rb: 239: `Requirements' in: / app / app / controllers / Home_controller.rb: 14: Syntax error, unexpected KEND, expected of $ end (syntax error) What does KEND mean and $ End? How can I solve it? thanks, edit: Edit: In the row in Control 14 - Termination . I do not remember or have too much - end in my code. Resolve this problem The problem was that there were some Hebrew texts in the controller. The strange thing is that the controller was in utf8. I think Herochro can read Hebrew.

javascript - Is there an equivalent to jQuery's .unwrap() for Dojo? -

मेरे पास इसके जैसा एक परिदृश्य है: & lt; div class = "divparent" & gt; & Lt; div वर्ग = "बाल 1" & gt; & lt; / div & gt; & Lt; div वर्ग = "बाल 2" & gt; & lt; / div & gt; & Lt; div वर्ग = "बाल 3" & gt; & lt; / div & gt; & Lt; / div & gt; मैं एक HTMLObject चाहता हूँ Child1, Child2 और Child3 w / o DivParent parent। अगर मैं jQuery का उपयोग कर रहा था तो मैं कह सकता हूं: var HTMLObjectIWant = $ ('। Parent & gt; div')। खोलना (); लेकिन मैं नहीं हूं ... मैं डोजो का उपयोग कर रहा हूं और मुझे डोजो में किया गया यह देखना अच्छा लगेगा। इसके अलावा - आदेश (बाल 1, चाइल्ड 2, चाइल्ड 3 बहुत महत्वपूर्ण है)। अग्रिम धन्यवाद। - माइक दोजो.इनवाप = डोजो.इनवाप || फ़ंक्शन (/ * नोड आईडी या नोड * / n) {var नोड = dojo.byId (n)। ParentNode; Dojo.query ('& gt; *', नोड)। ForEach (फ़ंक्शन (चाइल्डनोड) {dojo.place (childNode, नोड, 'पहले');}); dojo.destroy (नोड); } ...

Specific performance differences of certain features in Java and C# -

I'm currently testing Hibernate / doing some performance on Hibernate. Search with Lucene in Java and Pendant in C # Currently I am using the latest release of both versions. I had some interesting results in the test but now what I am doing is to find some performance tests or to improve some explanation of possible performance differences in both languages. For example: I know that Generic is more efficient in C # because they do not use runtime on runtime because they are type-protected, besides two different lists with referenced types, JIT -Code can share in C #. So there is now a boxing-overhead in C # This is an example I have searched for. But I would like to know that there are more differences in those two languages ​​which can create performance differences. But I also need some references, because these tests will be summarized in a scientific paper. I have got books about many papers / differences, but there is not much about performance differences in the ...

ruby on rails - What's the difference between kEND and $end? -

मुझे यह त्रुटि मिलती है: वाक्यविन्यास त्रुटि, अप्रत्याशित केएएनडी, $ end की उम्मीद KEND और $ अंत में क्या अंतर है? अंग्रेजी में यह कह रहा है: वाक्यविन्यास त्रुटि, अनपेक्षित अंत , मैं सहमत हूं कि यह एक बहुत ही सहज ज्ञान युक्त संदेश है। तो अंतर यह है:

python - Read words from .txt, and count for each words -

I wonder how to read fscanf such as character string, I need to read in the word all, in .txt I need a count for each word. with collectwords = collections.defaultdict (int) Open ('DatoSO.txt', 'r') as filetxt: For characters in line: = str In this way, I can not have difficulty reading the final word. If you are using Python and GT, you can use collections.counter You can use. ; = 2.7 It combines several ways like 'most unusual', which can be useful in this type of application. ) With f: for the line in f: c.update (line print 'most common:' in the letter, c.most_common (3)): print '% s:% 7d'% (letter, count) - Although it counts the letter instead of the terminology, in the c.update line, you can change the line.rstrip () .com line.split () and perhaps want to replace some code to get rid of punctuation. Edit: Here is the fastest way to remove punctuation: import import import string c = archi...

Unable to connect to database using both tableadapters.fill & sql code in VB.NET -

Running My Laptop: Visual Basic 2010 Express & amp; SQL Server 2008 I have successfully used the connection wizard to connect to my databases in vb.net and read / write data using datasets / tableadapters / binding_source etc. Now I'm trying to create a SQL connection to connect to my database to do some more complex queries. I was successful in being able to connect to my database with SQL, but by doing so it creates an error when it tries to run any .Fill () methods from my TableAdapters below. The error produced is the following:. "... SqlException was unable to open the user default database login failed to login" Chris-PC "Chris user failed" If I delete my SQL connection code, TableAdapter.Fill () The methods will work fine. How can I use both databases at once? Any suggestions? Here is the code: ` Dim connetionString string retarded CNN SqlConnection connetionString =" Data source = Chris-PC \ SQLEXPRESS, as in the initial list ...

jQuery Validation Problems -

I'm trying to validate 4 areas. Verification in the last two behaves correctly, but the first two do not work. If I do not enter anything - the form will still be valid. S + / g, ""); Return to this. Option (element). Phone_number.length & gt; 9 & amp; Amp; Amp; phone number. Milan (/ ^ (1 -?)? (\ [[2- 9] \ d {2} \) | [2- 9] \ d {2}) -? [2- 9] \ d {2} -? \ D {4} $ /);}, "Not a valid phone number"); Validate $ ("# Advertise.post") ({Rules: {advRetailerName: {expected: true}, advName: {required: true}, adphone: {required: true, phone: true}, advEmail: {REQUIRED: true , {Email: true}}, the message: {advRetailerName: {Required: "This is required."}, AdvName: {Required: "This is required."}, Adophone: {Required: "This is required.", Phone: This is an invalid phone number. "}, AdvEmail: {Required:" This is required ", email:" This is an invalid email "}}}); Here is the...

c# - DataReader returns no rows -- rows are present in database -

OK the world, I'm having some trouble, this is not 'homework' My Have some code that needs to do two things: 1) Read a list of artists from the database - 2) Find all tracks that artist and for next store What I'm doing I: 1) Select from artists Artists I get my list of artists. I call it list & lt; String & gt; Make this great by using a DataReader etc. in Datatype. 2) Track_numbers tracks as SELECT count (*) WHERE ArtistID = @ ArtistID does not work so great My problem : Second The selection statement will be successful if I manually track track_numbers as ArtistID (i.e .: SELECT SELECT SELECT (*) WHERE ArtistID = 0 works) But if I am repeating through my list, it will always return zero results. I have connector / net 6.3.6 , Visual Studio 2010 (all updates), .NET 4.0 client profiles MySQL Community Server 5.5.9 x 64 , Windows 7 Home Premium x64 I've tried: To construct a string combination Cast casting artist as stri...

How to efficiently initial data in Django forms.Form? -

For example, I have a paragraph model for blog articles, so it's easy to add articles to the database. But when I make them a form class by form.ModelForm , then I need to edit them in the form, I type instace = artcile and I can pass it / P> But if I create a form class by form.Forms , then I have to declare a form form and pass the field one by one. Something like this form = ArticleForm ({'title': article.title, 'body': article.body, 'pub_date': article.pub_date 'status ': Article.status,' writer ': article: author,' comments': article.comments.count (), 'blah': article: blahblahah, 'again blah': article song, ..... }) It's ugly, is not it? form.ModelForm ? model_to_dict And you can use django.forms.models from fields_for_model utils: # Contemplating the article is an example of your paragraph model : Django.forms import form django.forms.models from fields_for_model, model_to...

java - What's wrong with this for loop? -

I am making a dice game for Android and I have this loop, which is an array rolled out on roll Fills with "j" It went like this int [] roll = new int [6]; {Roll [j] = (int) (monastery. Randem) * 5) for (int j: roll); Roll [ja] ++; Logs. I (getclass (). GetName (), "roll [[+ + + + + +] =" + roll [ja]); } except the output (in the logfile) roll [0] = 4 rolls [0] = 2 rolls [0] = 3 rolls [0] = 6 rolls [0] = 3 rolls [0] = 4 and when I change the code on int [] roll = New int [6]; For (int j = 0; j and lt; roll length; j ++) {roll [j] = (int) (math.rendum) * 5); Roll [ja] ++; Logs. I (getclass (). GetName (), "roll [[+ + + + + +] =" + roll [ja]); } The output is correct rolls [0] = 4 rolls [1] = 2 rolls [2] = 3 rolls [3] = 6 rolls [4] = 3 rolls [5] = 4 I should be a little stupid. Statement: for (int j: roll) roll , not index since arrays are started in Java, value j zero for each of 6 iterations is.

Python instance to COM Object -

I am creating a small part of a game with the use of COM objects with Python and a small problem Has gone in. The COM object I'm using is a method called SetCallback , which takes object , the moth looks like this: [ID (0x60010010)] zero setbackback (IDIPACH * in callback item); taken from MS OLE / Com Object Viewer Now if I create and assign my coop app in Python then all Try something as long as it is ok and pass an example of an object with this method. callback = callback () mycomobject.SetCallback (callback) class callback (def): def SetStatusText (auto, state): print status i python window The error found in: TypeError: The Python instance can not be converted to a COM object When this happens in C # I like this thing like my class def Looks like: [CommonWeBible (True)] Public class callback {// some methods here} and call method Python version are equal. Is there something like this in Python for using such a object as a callback for a COM o...

css - Create a 960px style with two solid bars that are 100% of page width? -

I'm trying to create a WordPress style for the project site that I'm working on. I am an experience designer, but there is a concept that I do not understand. I want to be able to set the width of the site at 960px, but there are twice on the top You can see what I mean in the picture below. I really want to be able to use the blue bar as a menu system and all the contents main 960px width The logo image needs to start with the beginning of content beginning (where 960px starts). The image is just a ridicule, but I want my users to see it. I want the whole site to be able to look at the monitor of any size evenly. I am trying to come up with a solution to do this whole day effectively, but I have not been able to think anything about anything. Do anyone have any ideas for me? Is there something that will work in all browsers? You will have to make a relative container, and inside it in the full container, something like this: & lt; Div id = "header_...

Create line segment from two points in Clojure -

What's the best way to do this? Even i have so far (line-segment [start-end] (x-direction (stomach (- (first end))) y-direction ( Ab (- (last end) (last end)] (cond (= 0 x-direction) (some ...) (= 0 y-direction) (some ...)))) Here is my ultimate goal user => (line segment [5 6] [5 8]) ([5 6] [5 7] [5 8] ) And yes, there are no diagonals, only x or y movement. thanks Post-text "itemprop =" text "> I think it's a beautiful elegant The solution is: x1 x2) () -1) 1 (1) DI (if (> y1 y2 -1) ([x (range x1 (+ dx X2) dx y (category y1 (+ yy 2))) [] [xy]))) REPL session: users> ; (Line Segment [5 6] [5 8]) ([5 6] [5 7] [5 8]) Users & gt; (Line segment [5 8] [5 6]) ([5 8] [5 7] [5 6]) Users & gt; (Line segment [-2 7] [1 7]) ([-27] [-17] [0 7] [1 7]) User & gt; (Line Segment [1 7] [-27]) ([1 7] [0 7] [-17] [-27]) This function is a LazySeq even if your sample output is formatted as a vector. I thought it was not impor...

vim - gccsense vs. clang_complete -

I am using omniCppComplete + ctags for a while, and want to improve further when the code is completed. [/ P] [P] According to the suggestion here [], GCCSence and Clank_Five have the option, though, I'm not sure which one is better on any of their performance? Thanks! Update: When I tried Clang_complete, then I found the full speed very unacceptable. I then tried to use it libclang.dylib, which gives a lot of speed, but still feels a cold. I think I should stay in CTGs for now. You probably should use clang_complete, not gccsense main point here Has architecture. The idea behind both solutions is very similar: you can not get the normal C + + full access to the internal compiler (GCC) information (abstract syntax tree) while GCC does not provide you enough interface for it. Although the implementation part of access to this information is quite different: gccsense is a type of "hack" - it's a custom plugin that is necessary to store the information nee...

python - Adding and removing data to/from iCal -

I need to add / remove calendar data from / in iCal. I found google and found that I can use to create Iics file to add calendar information to ICal but to delete calendar information, I do not know exactly what to do. Question 2: What is the other way to add calendar data to iCal? To remove an event within iCal, you should be able to identify it . This event can be done through the UID property or by piece of any other information is a quick example: Tell the app "iCal" tell the calendar "Chuck" set with evt To finish the new event with properties, please specify {details: "Details", Summary: "Summary", Start Date: Get Current Date} evtID in each set of UL set UL, which summarizes " Summary "Delete delEvt Let The ICal dictionary file (& gt; script editor is available for an event take a look at open dictionary) you can find a list of properties.

java - Entirety of stack being set to one value -

I have a problem problem I'm programming for Android and I try to get a set of integer sets I am doing I have written the code to generate the code, and I track it with a remote debugger and it is working properly, it works by putting each new combo into the stack. However, each combo in the stack is being updated with every change in the active array, which has been repeatedly committed to the heap in many forms. I believe that this problem relates to my new combo containing pointers for the original array at the time of the construction of the combo. However, I'm not sure how to fix the problem. All advice is appreciated, and thanks for your time. / ** * * @ The ultimate combo sysyes * We are finding the desired size of the combo * @ Ultimate Value * Dataset; Ints * should be an array in which all possible combinations of comboSize for size * / private combo [] getCombos (Int comboSize, int [] value) {stack & lt; Combo & gt; Combo = new stack & lt; Combo ...

java - How to cause server to serve slower download to client ( like all this direct download sites ) -

I am using Java tomcat as backend and apache, for stable files between static users, and faster The option will speed up the normal download speed, but if I can make the files stored on the same server slow to download? If you are using some Java method to distribute the file, then you wait a few There are individual blocks, where you are copying the file input stream into the server output stream. (Do not wait after each byte, because it adds an overhead on your server.) But make sure that the result is not in multiple threads running on your server (even if they all Only waiting for the most If you are using Apache httpd directly to distribute this file, then you have to use some Apache config (such as the proposed time) And must switch to servlet or deliver it.

android - Create KSOAP request with Properties containing Attributes -

There is an easy way to create a request for Android with KSOPAP 2 in which a class is not created in which Are the qualities themselves serial? The request should be sth, such as Any help is appreciated, Rigoroth SOAP Object Requests = New SoapObject (Namespace, methodName); Request.addAtribute ("name", "peter"); I think you are sorry that I'm late

sql server - How to get Information about indexes of system views -

Image
How can I get information about the index of system views? I write this question and I see the execution. I saw this index rather index seek. Any one scan used to know why select OBJECT_NAME ( Object_id) TableName, ST.row_count from sys.dm_db_partition_stats ST index_id & lt; 2 and OBJECT_NAME (object_id) = 'Mytbl' idx_name, i.type_desc, i.is_unique, ac Choose. Name COL_NAME, c.key_ordinal, c.is_descending_key, c.is_included_column as sys.indexes as i join sys.all_objects one at a.object_id = i.object_id c.object_id = i.object_id and c.index_id Join sys.index_columns c = i.index_id ac.object_id = i.object_id and c.column_id = ac.column_id to join sys.all_columns ac where a.name = 'sysidxstats' returns idx_name type_desc is_unique col_name key_ordinal is_descending_key is_included_column ----------------- ----------- ---- ------ --- ----------- ----------- --------------- -------- ---------- CLST Cluster 1 ID 1 CLST Cluster 1 indid 2 0 nc non...

iphone - allocating object again -

मेरे पास निम्न कोड है: [chart removeFromSuperview]; [चार्ट जारी]; चार्ट = शून्य; बीएनपीईआरएटी * एचार्ट = [[बीएनपीईआरटीएएलओएल] इनटविथफ्रेम: सेल्फ। वीनफ्रेम]; Self.chart = aChart; [Achart रिलीज़]; और जैसा मैं चाहूं, चार्ट deallocating है, लेकिन चर में अभी भी कुछ है, अगली बार जब मैं achart को चार्ट मुझे EXC_BAD_ACCESS मिल गया है इसलिए मैंने चार्ट को शून्य प्रदान करने का निर्णय लिया। क्या यह एक अच्छा अभ्यास है? इससे भी बेहतर, प्रतिस्थापित करें: [चार्ट रिलीज़]; चार्ट = शून्य; के साथ: self.chart = nil; इसलिए यह सही तरीके से भी काम करेगा: [chart removeFromSuperview]; बीएनपीईआरएटी * एचार्ट = [[बीएनपीईआरटीएएलओएल] इनटविथफ्रेम: सेल्फ। वीनफ्रेम]; Self.chart = aChart; self.chart = achart आपके लिए रिलीज़ करेगा।

c# - Streaming data over sockets -

I want to broadcast live data from one server to multiple clients using socket , I am in concurrency issues with my current implementation. public class connection {Private unmanaged bull preparation endand; Private queue & lt; Byte [] & gt; Q; Private object buffer monitor; Public connection [// All things start and connect etc.] [...] // Some other functions which are irrelevant to this problem, called Private Zero Client Connect (Socket ASCINK Avenant ARGS) {// Thread A Is [ready] ToSend = true; WaitingForResponse (args); } Private Zero WaitingForResponse (SocketAsyncEventArgs) {// if called by Thread A (q.Count == 0) {Lock (buffer monitor) {Monitor.Wait (buffer monitor); }} If (q.Count! = 0) {byte [] data; Lock (q) {data = q.Dequeue (); } Args.Setbuffer (0, data lang); Args.ConnectSocket.SendAsync (args); // will send all bytes and later will remember the waiting force response I}} Internal Zero SendIf Connect (Byte [] data) {// Called by Thread B (if readyToSend) ...

cocoa touch - UIWebView not displaying images in SVG -

I have local HTML files that I'm displaying with UIWebView. Everything looks OK except for the embedded images in SVG-tags, such as: & Lt; / Svg & gt; & Lt; / Div & gt; & Lt; / Body & gt; Normal & lt; Img & gt; Tags work fine, so there is nothing wrong with the baseURL, and the image is in the same folder. The HTML file in the Mobile Safari is OK I have tried to load the load, and - LoadString: baseURL: and - Load Data: MIMEType: textEncodingName: baseURL, but I always get the range corresponding to the width and height of the image without the actual image. What could be wrong? Finally resolved this issue. DOCTYPE was set to strict XHTML: But the file extension was html. Changing the file extension to .xhtml solved the problem.

asp classic - ASP MySQL Loop Array -

I have a page that makes the following form through Ajax. & lt; Form action = "go.asp" method = "find" & gt; & Lt; -! Line - & gt; & Lt; Input type = 'hidden' name = 'bundletime id' id = 'bundlemeim id' value = '123' /> & Lt; Input type = 'hidden' name = 'bundle caller id' id = 'bundle caller id' value = '4' /> & Lt; Input type = 'hidden' name = 'bundle syside' id = 'bundle syside' value = 'big' /> & Lt; Input type = 'hidden' name = 'bundle quality' id = 'bundle quality' value = '4' /> & Lt; -! # Line - & gt; & Lt; / Form & gt; Creates a form and loop between the line, then the data will look like: & Lt; Input type = 'hidden' name = 'bundle caller id' id = 'bundle caller id' value = '4' /> & Lt; Input type = 'hidden' ...

c# - How to save the image to the database after streaming it from an IP camera? -

I have a code to stream snapshots from an IP camera and save it to hard disk. Then I have another code to read it and store it in the MS-SQL database. I know that it will be faster if I stream the image and save it to the database and save it to the hard disk and again it Read But I do not know how to merge it. Code to get the image string sourceURL = "http: //" + ip + "/ cgi-bin? / Cmd / encoder snapshot"; WebRequest req = (WebRequest) WebRequest.Create (sourceURL); Req.Credentials = New network credentials ("Admin", "123456"); WebResponse resp = req.GetResponse (); Stream stream = resp.GetResponseStream (); Bitmap BMP = (bitmap) bitmap Frostream (stream); Bmp.Save (ImagePath); Then to insert an image in the database: byte [] imageData = ReadFile (ImageName); (Using SqlConnection cn = new SqlConnection (constr)) {string qry = "Update vaiolations set val_image = @ ImageData, valid = 1 where id = @ OriginalPath"; SqlComman...

perl - How to understand local data type with respect to C++ data types? -

I could never clearly understand the use of local in Perl, except that the local defined within the stack Also other existing will be different from my existing version, variables and local variables will also be visible within other sub-routines. to: a local Simply temporarily assigns the global (i.e. the package) variable to the variable, it does not make a local variable, it is known as dynamic scoping with lexical scraping me , which is the auto declaration of C Works more like that

c# - Fluent NHibernate automap configuration throwing vague error -

I am trying to automate the ability of selfish NHibernate, and the same code that is clear ClassMap Configuration is failing when I try to move it to automapping when creating SessionFactory . Here is the code: Public stable ISessionFactory GetSessionFactory () {if (_sessionFactory == faucet) {_sessionFactory = Fluently.Configure (). Database (MsSqlConfiguration.MsSql2008 ConnectionString (c = & gt; c.FromConnectionStringWithKey ("DB")) // It works with: / / .appings (M => m.FluentMappings.AddFromAssemblyOf & lt; Customer & gt; )) // It failed with: mappings (m = & gt; m.AutoMappings.Add (AutoMap.AssemblyOf & lt; Customer & gt; ())). BuildSessionFactory (); Return _sessionFactory; } The error I get is: An invalid or incomplete configuration was used during a session-file creation. Check out InnerException for a more detailed description, more detail. I have calculation = 0 for possible reasons and the internal exception is t...

java - Why does this Exception Occur? networking (Connection Refused) -

* In this program, I have tried to make both my server and client on my PC. * The error I get is "Connection is declined" This is my program: import java.awt. *; Import javax.swing *; Import java.awt.event. *; Import Java.net *; Import java.io * *; Class chatbox client {JFrame fr; JPNl P; Send pocket JTextArea ta; JRDO Button RB; ChatboxClient () {new chatbox server (); Fr = new JFrame ("ChatBox_CLIENT"); P = new zpn (); Send = New Payton ("Send"); Ta = new JTextArea (); Ta.setRows (20); Ta.setColumns (20); RB = new JRDO button ("Connect"); // connector rb.addActionListener for action listener (new ActionListener) {public zero action action (action AE) {connectActionPerformed (ae);}}); Fr.add (p); P.add (ta); P.add (rb); P.add (send); Fr.setSize (500,500); Fr.setResizable (wrong); Fr.setVisible (true); } Public Zero Connect operation (Action AE) {try {InetAddress address = InetAddress.getLocalHost ()} Socket S = new socket (address, 3000...

javascript - jquery change different text in divs -

Hello, I have three separate divs and one paragraph in each of them I would like to click on div 1 and text 1 changes - if I click on div 2, we make changes in text 2, while text 1 is changing back to normal ... Should just change the Div in the text where I should just click since I am a newbie for jquery, I can only achieve that all texts are changing, but not even one. Who can help me? Thank you! This will do the trick - first populate the data for each div for the original detect, then click The event that sets everything back to original data, and sets itself in new text: $ ('div'). Each (function () {$ (this). Data ({original: $ (this) .text ()})}) $ ('div'). Click (function () {$ ('div'). (Function () {$ (this) .text ($ (this) data ('original'))} $ (this) .text ('new text ')})

How to break on assembly instruction at a given address in gdb? -

0x0000000000400448 & lt; main + 0 & gt; पुश% आरबीपी 0x0000000000400449 & lt; main + 1 & gt ;: mov% rsp, % Rbp 0x000000000040044c & lt; main + 4 & gt ;: mov $ 0x6,% eax 0x0000000000400451 & lt; मुख्य +9 & gt ;: 0x0000000000400452 & lt; main + 10 & gt ;: retq मैंने कोशिश की: लेकिन ऐसा लगता है कि ऐसा कोई आदेश नहीं है। क्या जीडीबी में ऐसी कोई विशेषता है? कोशिश करें break * 0x0000000000400448

xcode - Create Clean Rounded Corners on UITextField within UITableViewCell -

I am creating a UITextField within a UITableViewCell with the edges of the goal UITextField * SomeTextField = [[UITextField alloc] initWithFrame: CGRectMake (165, 9, 135, 20)]; SomeTextField.backgroundColor = [UIColor white color]; SomeTextField.borderStyle = UITextBorderStyleRoundedRect; Is there a way to make corners area, part of the corner between the round corner and the square corner is clear so that the background color is not visible there. Any help is appreciated Lq [Note: I answered my question, sorry, it was a lame Lq] // two! It gets rid of white corners: someTextField.backgroundColor = [UIColor clearColor];

sql - C# + MySQL prepared statement w/ON DUPLICATE KEY UPDATE problems -

I have a C # application that is having problems with a duplicate key update in MySQL using a prepared statement is. When I use the connection variable mypcmd.ExecuteNonQuery (); Check back at a breakpoint before false , mypcmd.IsPrepared . The query does not do anything (as the primary key it should be updated in advance) and no exception is thrown. mypcmd.Parameters.count = 25 As it should be and if I drill down in the data view, the value is OK. When the query goes through, the key is updated in 0 MySQL Server version 5.0.51A-24 + Lenny5 all parameter name (iefname :? Fname, middlename :? Middlename etc.) MySQL C # assembly version (mysql.data.dll) 6.3.6.0 WPF app is .NET 4.0 code as follows: insert const string sqlIpatients = @ "` tblpatients` ( `Nanbr`,` Fname`, `Middlename`, Srnem`` ` Title ',' contact number ',' mobile ', `sex`,` dob`, `homeman`,` hosse', `address1`,` address 2`, 'address 3`,' address 4`, 'post ...

C#: Sorting on date field in a Winforms app -

In an SQL database I have a stored date field as a test property that is in the following format: dd / mm / yyyy hh: mm: ss (For example, text appears in the field: 28/04/2009 19:15:15) I have built a datagroup view in the database through GUI in VS2008. So basically all the codes were automatically generated for me when I started my app. The database reads and displays all the rows in the DataGrid view. I can sort on all the columns except the date column. I suspect this because the Data Gridview thinks that the date column is just plain text. How do I work, like I want? UPDATE As far as I know that any DATE type is in sqlite, I must store it as text UPDATE user wants to see the date in the DD / MM / YY format. Thank you. There are several implementations of the sortable binding list that you can get on the Internet, one of which is also from MSDN. This blog can help you use known datatages and get the right sorting without worrying about the correct format fo...

Converting int primary key to bigint in Sql Server -

We have a production table with 770 million lines and changes. To allow future development, we want to change the primary ID column to increase the primary ID column for future growth (and to prevent sudden shutdown) Dev's experiments have shown that this column It is not as simple as changing because we have to leave the index and then have to recreate it. So far, the defect in the index is not finished after 1 and one-and-a-half hours (Devi which is slightly less than Prodi). This table has been hit 24/7 and offlineing it for so long is not an option. Has anyone else had to deal with such a situation? Edit: Additional information: The primary key You can try a phased approach. Create a new build column Create an insert trigger to synchronize with 2 columns All empty in the Biltin column Run updates to populate values ​​ Change the primary index on the new index from your old ID column Questions for using any of the points of the FK and the new colu...

sql server - How capture Sql_infomessage from ASP.NET -

is a Windows application that captures the sql_informessage event updating a progress bar. How can I do this on the ASP.NET application, have you seen? It can be done in F.P.net webforms, which can be compared to the Win form app.

jquery lightbox gallery with thumbnails? -

I need a lightbox light that will pop up a lightbox, but a gary format or the like ... is basically A lighthouse images with thumbnails from the images ... I can not think there is a .. many suggestions out there I'm finished with beautiful photos ... this is what I was looking for

concurrency - Distributed Locking and Java EE -

Writing Java AE application using Zebus AS6 and I have resources that require exclusive use (for some interface). Currently, I'm using java.util.concurrent.RententLock to handle miscreant (since) and locking for a third-party software for a method for any parameter. . Now I am clustering with many JBS application servers together so that I need a solution that works in different nodes in the cluster. I think I have at least the following options. File system based locking (probably bad, but we databases 's? Ideally, I am looking for a high level API so that I can write EJB methods like this Public class MyEJBBean {Private Shared Lock Lock; Public Zero doSomethingWithSharedResource (String S) {lock.lock (); // The blocks unless shared resources are not used by anyone else {// Sh Use the resource} Finally {lock.unlock ();}} I have not left any option? Does anyone have any experience with such locking mechanism Can they share? Ideally, I would suggest only ...

android - The format to store gps data -

I am trying to store GPS data in the SQL database. I retrieve data from a KML file via DDS and I store it in a geo-point like this: GeoPoint p = new GeoPoint (latitude, longitude) The problem is that accepts geopoint () LAN and only as AX, because it is not defined for two formats. Now if I have 45.3242355 longitude, then it is stored in the intersection of int-453242355. And I want to use it to draw a line on the map between geo-points, but I can extract this format of integers out of the range of latitude and longitude. Can anyone tell me how should I get back my actual form data? convert it to 10 ^ -6 (1a-6) (and double to its integer format For, multiply by 10 ^ 6 (1 A6)) The integer format data used by GeoPoint is not lost, as per the specification, it is in microdigridge instead of just the degree. (This is how a currency field can store a value of $ 2.36, simplifying "236" arithmetic and avoiding expensive float math and FP errors).

c# - Does ASP.NET Custom Errors override the actual HTTP response code? -

If I used to specify a page to redirect using ASP.NET custom errors feature, would my application Still the HTTP status code for that particular error? For example, if there was a line in my web.config , which contained all internal server errors errors / 500.aspx and then a 500 me If I get the error, I will be redirected to my custom errors / 500.aspx page. Will my application still respond to HTTP 500 at any point in this exchange? I'm just curious ... No, because your browser has an error Will interpret 500 as the response and will show you this error instead, instead it responds with one of the redesign status codes, which sends you to the specified error page.

c++ - Unable to get created /lastModified and lastRead time of a file -

I am trying to get a file created / last modified and reached the last entry date, below is my sample program - Method Signature - removeFiles (QDir & curDir, QStringList and fileList) The name of the QString file; QStringList :: This Iterator; QDateTime fileCreationDate; `For (this = fileList.begin (); it! = FileList.end (); ++ it) {QFile currentFile ((* it)); QFileInfo currentFileInfo ((* this)); FileName = currentFile.fileName (); Std :: cout & lt; & Lt; "" & Lt; & Lt; FileName.toStdString () & lt; & Lt; "Date created:" & lt; & Lt; CurrentFileInfo.created (). ToString () ToStdString () & lt; & Lt; Std :: endl; } 'I am unable to see the date printed on the screen. Can anyone tell a mistake thanks Are there full paths in the file list? You should verify that the QFileInfo object is valid. Or is your problem with unreadable output? If this is an application with a window, then I suggest using qDebug ...

regex - How to extract string with regular expressions in python -

I am trying to remove a sub string from a string in Python. My data file contains a line of Koran, where each is marked with the poem and chapter number at the beginning of the string. I want to try to remove the first number and the second number and write it in one line in another text file. Here is an example of some lines of a txt file. 2 | 12 | Of a surety, those people who do mischief, but they feel (this) do not. 2 | 242 Thus Allah has made clear to you your signs: that you may understand. As you can see that there are many points in the poem and chapter, so calculating the number of spaces from the beginning of the string will not be enough. Is there a way to use the regular expression to try to remove the string as the first number (the poem) and the second number (chapters)? The code for which I am writing this will try to write Arif, which is a poem and chapter string. An example of a line in the Arff file will be: 1,0,0,0,0,0,0,0,0,0,0,0,2,12 Where is th...