Posts

c# - Using a Button Tag -

Program logic changes a button tag based on random things - but using the UI thread. Is the button tag value reliable to use in a click event? That is, will it be the same value as the event occurs at the handler, because it was at the time of the click? If not, what is the best way to pass an event specific parameter on the button, click on the event that will be safe? Update An example was added as a request. (Remember this is just theoretical). windows.form. Timer timer = new timer (); Timer Interval = 1; Timer Tick ​​+ = new event handler (timer_tick); Timer.start (); Zero timer_tick (object sender, event events e) {this.button.Tag = Random.NextInt (100). Ostring (); } Zero button_click (object sender, eventArgse E) {string s = (string) ((button) sender) .tag; Console. Light line ("tag value as push button:" + s); } Enter another way, the question has emerged: Events can be covered in the GUI event queue which pushed the position of the button and allows ...

firefox - JavaScript memory assignment -

Image
I am running on an issue where I compile values ​​and values ​​in different arrays in an object, But only the final iterations are value savings in different parts of the object. Here in the picture, I have given minimum and maximum values ​​in the console. Then I can use that value Which can be stored in my array before going into my use. Is it around Is there any way? In the second picture, these values ​​are used which ends, and it prevents me from proceeding. EDIT: Loop I am using for assignment: prefix for (var i = 0; i & lt; partition; i ++) {var Cellobject = new object (); CellObject.minX = WatchBound Minute [0] + box langam *; Cell object.mxx = quietband.mm [0] + boxlandi * i + boxlength; For {var j = 0; j & lt; partitions; j ++} {cellObject.minY = sceneBounds.min [1] + boxwidth * j; CellObject.maxY = ViewBound.man [1] + Boxwidth * J + BoxWith; (Var k = 0; k & lt; partitions; k ++) {// index index = height * width * k + width * j; Var index = pa...

c++ - Stop QListView from deleting entries on drag-drop -

मैंने एक QStringListModel के साथ एक QListView बनाया है। listModel = नया QStringListModel (ui- & gt; listView); UI- & gt; listView- & gt; setModel (listModel); UI- & gt; listView- & gt; setEditTriggers (QListView :: NoEditTriggers); UI- & gt; listView- & gt; setDragDropMode (QListView :: InternalMove); और मैं इनका उपयोग कर आइटम जोड़ता हूं: शून्य मुख्य विंडू :: addItem (QString परिणाम) {यदि (परिणाम == "") वापसी; listModel- & gt; insertRow (listModel- & gt; ROWCOUNT ()); QModelIndex a = सूचीमोडेल- & gt; सूचकांक (सूचीमोडेल- & gt; पंक्तिकाउंट () - 1); listModel- & gt; setData (एक, परिणाम); } समस्या यह है, जब आप सूची में किसी आइटम को खींचते हैं और इसे दूसरे स्थान पर स्थानांतरित करने का प्रयास करते हैं, तो वह उस आइटम को ओवर-लिखना पसंद करता है जिसे आप इसे खींचते हैं मैं ड्रैग-ड्रॉप एक्शन से कभी भी एक आइटम को हटाना नहीं चाहता। दस्तावेज़ से हम इस पर ध्यान दें कि इसमें अधिलेखित व्यवहार को नियंत्रित करने के लिए कहां है:...

node.js - passport.authenticate not working as expected -

Strange behavior, here. When I hit / login with the correct username / password combo, it actually sends me / secret passage when I use the wrong combination, then it's right back to my right where I started Had redirection there. However, if I try to "lock down" a route, say: app.get ('/ mySecretRoute', passport.authenticate ( 'Local'), function (Rick, race, next) {res.json ({test: "secret"}}}; Then I have a 401: unauthorized if I try to hit it after entering, it seems that a cookie is actually set, but probably is not correct. I have verified that the user is in the local strategy Has come, and this serialization captures the right user. How can I configure the passport correctly and lock the routes to use the local strategy? I have seen through the medium and it seems that I am following the instructions. / / all environment app.set ('port', process.env.port || 3000); App .set ('idea', path .jound (__deirna...

hover - jQuery only works when clicked F12 to activate developer mode -

I'm using a jquery for the direction awakening hover effect to sleephunter.js. When the page loads, the hover effect only works when F12 is clicked or the element is identified in Chrome and IE10. Once the developer mode is activated or the active developer mode has already shut down, this page starts working until it reloads. I am using several jquery plugins as the following. & lt; Script src = "js / jquery-1.11.0.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / jquery.sliphover.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / superfish.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "js / jquery.mmenu.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / jquery.singlePageNav.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / modernizr.min.js" & gt; & Lt; /...

amazon s3 - create a temp image file for upload -

I have created an HTML5 image uploader using the canvas. I have image data Canvas.toDataURL (); Which data: image / png; Base64, & lt; Base64image string & gt; I have sent the above data to php which will be used to upload an image to the Amazon server. I usually file_get_contents (path_to_file_to_upload); Amazon SDK is used to work and how can I now convert the code to file file_get_contents for uploading base 64 image data file. I do not have permission to create a file in the server. Create a temp image and get file_get_contents data from that temp file ?? Pass the return value of base64_decode () instead of file_get_contents in the AWS SDK.

database - Bigcouch Clustering not Working -

I'm new to bigcouch. I have successfully saturated on two different systems which are working perfectly well. In the first big coach, I have some DBS which I want to repeat on another big coach. And I copied all shoulders from big coach to second to first. And then I used the clustering command to make them cluster. Curl-X PUT db01.yourhostname.com:5986/nodes/bigcouch@db02.yourhostname.com -d {} gives its success The result. But when I try to create a new database it gives an internal breakdown error. My first question, is this a good way to clustering after shards from one to the other. I am not sure it is the right way to do this. So someone can tell me how to do this successfully or I am missing something. Thank you. Check that the two servers know each other about each other by visiting the following. curl 127.0.0.1: 884 / _membership if it looks ok to properly ensure that it is able to be resolvable Try pinging from one to the other using Bigcouch ta...