Thursday, 15 August 2013

SQL server 2008: How to get the start date and end date of my data? -


As a newb, I already know that I will be birited to ask this question, but I The answer can not be found here and the site can help with some help ...

I have a table that lists the data on a day-by-day basis, and for example by type

  transaction. Date | Type ------------------------- Update | 11/7/2008 | Cash-out updates. 11/10/2008 | Written check deposit. 11/11/2009 | Cassand check update | 11/18/2008 | Submit Check Deposit 11/19/2009 | CASAD CHECK  

What I am trying to do is the first occurrence of each transaction type, and the last event of each transaction type is. Therefore, I am trying to find out a SQL statement which I can write which will return something like this:

  Transaction | First date End date ---------------------------------------------- Update | 11/7/2008 | 11/18/2008 | Deposit | 11/11/2009 | 1/19/2009 |  

Any ideas? Select transaction, MIN [[date]] as [first date], max

  ([Date]) From the My_Table group for transaction from AS [last date]  

How to sniff the number of records in a binary file before reading into an array in the C programming language? -


How do I tell in a better way how many records I see in the binary file before opening a file, for example an array Records in?

  MyFile = Fopen ("DATA.dat", "rb"); I = 0; While (Fifi (MyFile) == 0) {FREED (& amp; Temple readings record, size (tempReadingRecord), 1, file); If (ff (mimefile) == 0 {i ++;}} fclose (MyFile);} printf ("% d", i); / * how many records works to find but optimal? * /   

has an arbitrary number of NULS attached at its end) but you will not run into problems on the most common systems (APAI, which was mainly on CP / M, Since the block was not stored, only several blocks, so the end of the file was always padded to fill the last block).

BTW, your loop is a problem to read the record - in fact, sort Almost any loop while ((Fif (file)) , or nothing is guaranteed to work with similar incorrectly (usually it will "last record Twi read" CE).


c# - How does one implement UI independent applications? -


What are the basic techniques for making the majority of my C # source code UI independent?

For example, I would like to write my source code for the Winforms desktop application, which I can plug in in a WPF application with the ASP.NET web application or very small changes. To wit. I would be able to use the same source code in spite of UI technology to make this future proof.

I know that can do this.

But if I do not use CSLA (it takes some time to learn a new framework and currently I do not have much time to spend on it), what should be kept in mind Getting this type of capability in my C # code?

Can you give me an example? I am already using commercial object and layering technology in my applications. But still I have noticed that many coding needs to be plugged into my UI for new UI technologies.

Please do not provide me with any superficial reply.

The best way to do independent coding for UI is to separate the argument from the presentation. Take a look at this

It is more than a discipline issue with its design instead of a framework issue. A framework can not force you to design properly. If you design the app properly, it can make things easier for you, although there are always ways around implementing it.


c++ - How can I share HWND between 32 and 64 bit applications in Win x64? -


MSDN tells me that handles Windows (HWND) (can be shared between 32-and 64-bit applications, (MSDN). However, Win32 has a HWND 32 bit, 64 in 64-bit window How can the handle be shared?

I think the same question applies to handles for named objects such as mutes, semaphores, and file handles.

"Post-Text "Itemprop =" t "Can not be shared that only 32 bits are used in the Win64 process? Windows handles, at least as far as I can tell, are not indexed indicator, so long as MS 2 ^ 32 did not want to give more than window / file / mute x / handle. There is no reason to use 32 x 32 bits of zero * on Win64.


Sample domains for testing DNS lookups -


Is there a well-known address that resolved well-known IP address for both IPv4 and IPv6 can go?

I'm playing with Berkeley Sockets and wrote a class to finish sockaddr_in stuff, and want to test the unit, but I do not know about any address that I tested I can put in the form of data that is guaranteed to be solved for a specific IP address.

I mentioned www.example.com and ipv6.example.com in the Guide of Beige, but ipv6.example.com no longer exists ... I have found the best c. Iana-servers.net which has both an IPv4 and IPv6 addresses that solve it, but I do not know how it is stable ...

This is a good question, I can not give you a single domain that you can rely on, yet there are some other issues about which you Content Distribution Networks want to be aware that by transferring the traffic to the server via diesel lookup on geography. If you are looking to make this project compatible with other locations, then search for a server that is not under a CDN or caching server.

I suggest creating your own server, in this way you can control all the variables.


Boolean Implication -


I need some help with this boolean imp.

Can someone explain how it works in simple words:

A means B = B + A '(if A to B). In addition, A> = b

Boolean means A means B Just means "if one is true, then b should be correct". It means (pun intended) that if A is not true, then B can be anything. Thus:

  false false false meaning -> The true lie means the truth - & gt; True tru means wrong - & gt; False truth means truth - & gt; True  

It can be read as " (not a) or b - i.e." either a liar, or b must be true ".


Quickest way to convert XML to JSON in Java -


What are some good tools to convert JSOM quickly and easily to Java? There are some great resources in

Maven Dependence:

  & lt; Dependency & gt; & Lt; Group & gt; Org.json & lt; / Group & gt; & Lt; ArtifactId & gt; Json & lt; / ArtifactId> & Lt; Version & gt; 20160807 & lt; / Edition & gt; & Lt; / Dependencies & gt;  

XML.java is the class you are looking for:

  import org.json.JSONObject; Import org.json.xml; Public Sector Main {Public Fixed In PRETTY_PRINT_INDENT_FACTOR = 4; Public Stabilized String TEST_XML_STRING = "& lt ;? Xml Version = \" 1.0 \ "? & Gt; Exam attrib = \" Maximize \ "& gt; Turn it on JSON & lt; / test & gt; ; Public static zero major (string [] args) {try {JSONObject xmlJSONObj = XML.toJSONObject (TEST_XML_STRING); String jsonPrettyPrintString = xmlJSONObj.toString (PRETTY_PRINT_INDENT_FACTOR); Println (jsonPrettyPrintString); } Hold (Jason Exception JE) {System.out.println (je.toString ()); }}}  

Output is:

  {"test": {"attrib": "moretest", "content": "it turned on JSON Do "}}  

c# - How to call a .NET DLL from a Win32 process? -


What are the options to use a .NET DLL from the Win32 process? I basically need to use C # DLL from a Win32 process.

I have a possible solution, which requires that C # DLL needs to add GAC (using RegAsm.exe), then C # DLL calls the COM wrapped, though this solution is too heavy . This requires that the .NET DLL be added to all the machines that want to run this Win32 process.

Is it possible to call the RegAsm before being able to use C # DLL?

You can use register-free COM with .NET COM components - see.

Another option is to use C ++ / CLI as a bridge, people are familiar with using it to wrap unmanaged APIs to manage it, but it is actually in both ways Works - it is possible to compile it with / clr , and yet a .dll assemblies with plain unmanaged exports, which can be called unmanaged code as usual Here's a very simple example: System :: String :: Toopper displays in this way:

  // comp.exe / clr / LD compile with wrapper.cpp ole32. Lib #include & lt; Windows.h & gt; __declipsee (dilexport) wchar_t * ToUpper (const wchar_t * wcs) {system :: string ^ s = gcnew system :: string (wcs); Array & lt; Wchar_t & gt; ^ Character = s-> ToUpper () - & gt; ToCharArray (); Size_ty size = character- & gt; Length * 2; Wchar_t * dst = (wchar_t *) Kotesak Almallok (size + 2); Pin_ptr & lt; Wchar_t & gt; Src = more characters [0]; Memcpy (DST, src, size); DST [Character-> Length] = 0; Return DST; }  

This will generate wrapper.dll - hybrid managed / unmanaged assembly - and an export library wrapper.lib . The latter can be used in the net resident application:

  // cl.exe test.cpp ole32.lib wrapper.lib // Compile with Note, no / clr #include & Lt; Stdio.h & gt; #include & lt; Windows.h & gt; Wchar_t * ToUpper (Const. Wchar_t * wcs); Int main () {wchar_t * s = Toupper (L "Foo"); Wprintf (L "% s", S); CoTaskMemFree (s); }  

In practice this CLR will load runtime in the calling process (unless it has already been loaded there) and send the familyly managed code from the native code - all Magic C ++ / CLI is compiled by the compiler.


Expression Encoder SDK - WMA Pro Codec Issues with Windows Server 2003 -


I am using the expression encoder SDK to signal. AV and Flash files are suitable for Silverlight. By default, EE encoded files with audio using the WMA Pro codec. If you are running Windows Server 2003, then this is a problem because it does not support WMA Pro codec and gives output and error messages similar to the following is.

  Error message: Audio profile settings do not match valid system profiles Error Source: Microsoft.Expression.Encoder Error Target Site: System.String GetProfileString ()  
< P> I'm looking for a way to change the default audio codec to something suitable for WS 2003.

I know that though that is not originally supported, however, Windows Media Player 11 is a highly invasive way to install and it is a codec on the 2003 WS but it has Registry tinkering and other hacks Which are not suitable for our production environments, in order to get the solution on the solution encoder SDK, there was an answer after too much tampering.

Encoder Media item itemTranscode = new encoder MediaTime (srcPath); ItemToTranscode.OutputFormat.AudioProfile.Codec = AudioCodec.Wma;

It works fine with Windows Server 2003 and fixes the problem.


BlazeDS data push over SSL -


I have an application that uses Data Push Technology of Blazad, which Flex Client sends data in event 5 seconds . This application works fine when I run it without proxy or without proxy. When I run it from https, data push does not work anymore. I get the following error

  root cause [IOErrorEvent type = "ioError" bubbles = false cancelable = false eventPhase = 2 text = "error # 2032: stream error. URL: https: // localhost / Admin / messagebroker / streamingamfsecure? Command = open & version = 1  

Did anyone successfully get streaming to work on SSL?

Thanks,

Questions to ask yourself (and post here)

  • Is the request appearing in your access logs?
  • What can be the usual HTML pages via HTTPS?
  • What do the response headings look like? Does cleaning your cache make any changes?
  • Which browsers ?
  • Can you explain caching headers?

Try one of these:

  Cash-Control: Cash-Control: Any-Store Cash-Control: No-Store, Cash-Control: No-Store, Max-Age = 0, Co-Modified Cash Sh-Control: Maximum-age = 0, should be modified for cache-control: revise exit  

jquery - My form can not be submitted even if "true" is returned in the submithandler function, what's wrong -


यह jQuery कोड है:

  $ (document) .ready (function () {$ ("# डिजिटलचेंज")। मान्य करें ({नियम: {असंतुलन: {अंक: सही, न्यूनतम: 20, अधिकतम: 1000}, एक्स्क्वाटा: {अंक: सत्य, न्यूनतम: 5, अधिकतम: 1000}, कमकोटा: { अंक: सच्चा, न्यूनतम: 1, अधिकतम: 50}}, सबमिट करेंहाण्डलर: फ़ंक्शन () {var var1 = $ ('# addquota')। Val (); var var2 = $ ('#quotequota')। Val (); अगर (var1! = '' & Amp; var2! = '') {चेतावनी ('आप केवल शॉर्टल जोड़ सकते हैं या शॉर्टॉल को कम कर सकते हैं।'); वापसी लौटा;} सही सत्य;}, संदेश: {}});} );  

समस्या यह है कि डिजिटलचैक्शन का कोई भी रूप प्रस्तुत नहीं होगा, चाहे कितनी भी हो। जब मैं टिप्पणी करता हूं

  submitHandler: function () {var var1 = $ ('# addquota')। Val (); Var var2 = $ ('# reduquota')। Val (); अगर (var1! = '' & Amp; var2! = '') {चेतावनी ('आप केवल शॉर्टल जोड़ सकते हैं या शोर्ट कम कर सकते हैं।'); विवरण झूठा है; } वापस सच; },  

तो फ़ॉर्म सबमिट किया जा सकता है। क्या गलत है?

मैंने वापस सत्य बदल दिया है, से $ ("# digitalchange")। सबमिट करें (); , फ़ॉर्म सबमिट किया जा सकता है। हालांकि, जब मैं "सबमिट" बटन पर क्लिक करता हूं, तो क्या गलत है, सबमिट करने से पहले एक महत्वपूर्ण (या स्पष्ट) देरी है? देरी से छुटकारा पाने के लिए कैसे?

  submitHandler: फ़ंक्शन (फ़ॉर्म) {var var1 = $ ('# addquota')। Val (); Var var2 = $ ('# reduquota')। Val (); अगर (var1! = '' & Amp; var2! = '') {चेतावनी ('आप केवल शॉर्टल जोड़ सकते हैं या शोर्ट कम कर सकते हैं।'); विवरण झूठा है; } Form.submit (); },  

काम नहीं कर रहा है।

कोड> submitHandler इस के साथ

  submitHandler: फ़ंक्शन (फ़ॉर्म) {var var1 = $ ('# addquota')। Val (); Var var2 = $ ('# reduquota')। Val (); अगर (var1! = '' & Amp; var2! = '') {चेतावनी ('आप केवल शॉर्टल जोड़ सकते हैं या शोर्ट कम कर सकते हैं।'); विवरण झूठा है; } Form.submit (); },  

इसके अतिरिक्त आपको सत्यापन दस्तावेज़ में और भाग पर पढ़ना चाहिए।

दस्तावेज़ीकरण राज्य

submitHandler

जब फॉर्म वैध है तो वास्तविक सबमिट करने के लिए कॉलबैक। फॉर्म को केवल तर्क के रूप में मिल जाता है। डिफ़ॉल्ट सबमिट की प्रतिस्थापित करता है

इसलिए सत्यता वापस करना AFAIK को कुछ भी नहीं करेगा जैसा कि आप भी पूरी तरह से अलग कुछ प्रस्तुत या करने का निर्णय नहीं कर सकते नमूने भी स्पष्ट रूप से दिखाते हैं कि फार्म तत्व ( submitHandler फ़ंक्शन पर पैरामीटर के रूप में पारित किया जाता है) का उपयोग करने का सही तरीका है।

सबमिट करें Handler को कुछ और प्रक्रिया करने के लिए तो डिफ़ॉल्ट सबमिट का उपयोग कर। ध्यान दें कि "फ़ॉर्म" एक DOM तत्व को संदर्भित करता है, इस तरह से सत्यापन फिर से शुरू नहीं होता है।

  $ ("। चयनकर्ता")। मान्य करें ({submitHandler: function ( प्रपत्र) {// एक वैध फॉर्म form.Submit ();}})  

के लिए अन्य सामान करते हैं जबकि दस्तावेजों में बहुत अधिक पुनरावर्ती भाग कहते हैं कि $ ("# digitalchange") का उपयोग करते हुए। सबमिट करें (); (जो $ (फ़ॉर्म) के समतुल्य है। दस्तावेज के नमूने में सबमिट करें) एक पुनरावर्तन का कारण होगा क्योंकि यह आपको बार-बार मान्यता देता है (इस प्रकार ध्यान देने योग्य विलंब)।


MySQL sort by calculated value of 2 rows -


"itemprop =" text ">

I am trying to create a MySQL statement that will be sorted based on a value calculated within the statement My table will look like this:

  posts + ---- + ----------- + -------------- + | ID | Post_type | Post_ content | + ---- + ----------- + -------------- + | 1 | Posted in | Hello | 2 | Posted in | World | + ---- + ----------- + -------------- + Postman + --------- + ----- ----- + ------------ + | Post_id | Meta_key | Meta_Luite | + --------- + ---------- + ------------ + | 1 | Price | 50 | | 1 | Retail | 100 | | 2 | Price | 60 | | 2 | Retail | 90 | + --------- + ---------- + ------------ +  

I'm trying A value savings named am ( .5 for id = 1 , .3 for id = 2 ) So to calculate it by order it's the same I've done so far, but I'm not sure how to calculate a 2 in the rows (everything is about calculating between the columns I found).

  Select wposts * $ Wpdb-to & gt; Posts wposts, $ wpdb-> Wpostmeta.meta_value DESC by postmeta wpostmeta wposts.id = wpostmeta.post_id and wpostmeta.meta_key = 'value' and wposts.post_type = 'post' order  

Thank you for your help!

Here is a simple join that will calculate the per post savings, which assumes that meta_value one There is a numerical data type.

  Choose from posts.id, (retail.meta_value - price.meta_value) * 1.0 / retail.meta_value as a post-saving, (select * from postmeta) where meta_key = 'price') As a value, (where select 'meta_key =' retail 'from postmeta) as retail, where post. Id = price.post_id and posts.id = retail.post_id and posts.post_type =' post 'order deposit capital ; + ---- + --------- + | ID | Savings | + ---- + --------- + | 1 | 0.50000 | | 2 | 0.33333 | + ---- + --------- +  

c++ - Hiding the Cursor -


I have a Windows program with a Direct X / OPENLAG Renderer, and a custom mouse provided as a tractor has been done. The program currently runs on the window.

The problem is that the standard window mouse is overlaid on my custom cursor when it's inside my window, so how do I hide it?

Try ShowCursor (FALSE); When you are intruding your window.


Advanrtages of Flex3 over Flex 2 -


Can you explain the main benefits of Flex 3.0 on Flex 2.0? (Not the advantage of the flex builder).

Thanks, Sun

You can start from here:

And here:

But depending on the schedule of your project, you can consider Flex 4.


  • Master-detail migrate in SSIS 2008 -


    I have two MSSQL2008 databases DBA and DBB, DBA master-detection table pairs include: AMSTER, ADTT DBB also includes BMM and BD etail. The only difference is that the betwee A and B primary key type is the integer in the source database (DBA), but this is the unique identifier in the destination (DBB).

    Dear Partner: How to describe the dataflow in SSIS to change this matter? I need to convert all the fields, but replace it with the new key type

    If you do not want to store the natural primary key then how do you make the update, as if a record has changed in the source and you want to repeat this kind of change in the destination table, how would you do it, I mean Logically not possible Either keeps you should be integer-based natural keys in the destination table or you will keep mapping tables between old natural keys and related new key mapping information.

    And the UID is still a big number and I do not think that the UID is a good option for changing the integer if you really want to do this, then do so. See more on INT >> hex STRING >> uid uid [


    What is the memory footprint of a method intensive Java object? -


    Let's say I have a Java class that has a 100 code worth of code that does not have any variable, but only has 20 byte attributes.

    I instantiate 1,000 objects from this class.

    Did I consume 100,000 memory? Or only 100K + (20bytes * 1000)? Or something else?

    The memory footprint will almost correspond to the code size to load the square, but each frequency The code for will not be duplicated. For an example, the frequency characteristics will require a lot of memory + some overhead for the management of the object instance.


    sql - MySQL Order by multiple column combined (not order by field1 asc, field2 asc) -


    It looks like a common question, but it is different.

    I have an ID with ID and minus all 3 Field 3 timestamp field (just) started, and they are filled with values. Examples of lines are:

      id time 1 2 time3 1 +125 9 625661 +125 9 643563 Null Null 2 ​​+125 9 621 231 null 3 +125 9 62 588 9 null +125 9 644 511 4 null +125 9 621 231 null 5 null null +125 9 644 511 6 null +125 9 621231 null 7 +125 9 62 588 9 null null   

    a list of IDs recent timestamp (ignore if time is 1 time 2 or 3) . Time 1 desc, while 2 desc, time3 by command desc me as a wrong list gives you all the time 1 field, and the other, etc ...

    required, This is the first type of result ID.

    Can this be done in a single query in MySQL? Thank you

      SELECT * most by MyTable order (COALESCE (1, 0) , COALESCE (time 2, 0), coal (time 3, 0)) DESC  

    php - XMPP: Connect to GTalk -


    One of my other accounts from GMTP to send one of my GAC accounts to PHP from my main account The XMPP is using the page I get an error that is unable to connect before timeout, please advise.

    XMPP has a different feature, authentication methods: requires a GTK server:

    < Ul>
  • This service talks on port 5222 (Actually 443 is also working)
  • TLS is required
  • Only supported authentication mechanism is SASL Plant

  • reverse ajax - Can push technology / comet be faked? -


    The customer has a dating site and a popup (either a good JavaScript overlay or a new browser window popup). 'Flexible.) Users are displayed when other users are going to their page.

    I am familiar with push technology and comet, but it is quite challenging to implement and unique visitors over 100,000 per day.

    I am thinking that there is no way to cheat it, maybe because of not being accurate for another

    Anyone?

    EDIT: What's this about: By putting an IFRAME on the page that refreshes every few seconds and loads on every page, it checks in DB if a visitor log on this profile page If yes, it shows a message that the message will be visible, but the background of the iframe will be mixed with the background of the site and will disappear. If the message fades out in and out, it will look like "popping up" like a JS box.

    The "fictitious" comet is the only way through some sort of voting, which is always a possibility There is an IFrame, Exercise, or JSNP request, all possibilities to vote for voting.

    You may be better off buying a pre-built comet server (I definitely recommend it). If you are worried about loads, then you can check our on-demand version where we will host it for you.

    Regardless, WebSync (or any pre-packaged product you can see) will deliver more than a million users in a day without any problem, and more efficient than voting Because it only kills your database when new users come in, instead of every two seconds; He said, "If you ask for" scrutiny for new users "easily, and delay in just a few seconds, the idea of ​​voting will be" simple "solution.


    ruby on rails - what does 'invalid gem format' mean? -


    Does this mean that I have stopped my ruby ​​/ gem / rail environment in some way? I am using Instantales 2-0 for a while, but recently decided to upgrade the rail. This is a big pain till now. At first I was getting the latest gem version, rubygems-update could not find the latest. I was finally able to get the latest gem version manually by downloading it and running setup.rb by rubygems-1.3.5.

    When I am updating ' gem update ', I get the following error:

    Invalid gem format forr C: / ruby ​​/ lib / ruby /gems/1.8/cache/activesupport-2.3.5.gem

    I tried to manually download the Activesupport gem and the 'gem installed local [path for gem]' is doing this work , So I did this with the 2.3.3.game rail, but still got the same invalid gem format error, but for activrecord-2.3.3.gem

    My GEM version 1.3.5 Current Rail Version is .... The RubyGem version is not working now due to error: activesupport (2.1.1 not = 2.0.2)

    This post can be helpful:

    You may have to clean the rail and its dependencies gem cache directory before you offensive gems

    can uninstall gem

    Another Javascript Undefined Null Question -


    So I have done most of the questions here. Apart from this, some articles are good and bad

    One thing I am looking for for some additional explanation is how to treat undefined and un-declared variables

    Take the code below.

      var a If (a == null) // is true due to pressure (a == 'null') // false then (a === faucet) // false if (a === 'null') // false If (a == undefined) // True if (a === undefined) // True if (a == 'undefined') // false (a === 'undefined') // False if (a) // false-A is undefined warning (typef (a)) // undefined  

    I understand all of the above. But when you look at the undeclared variable, things are weird Note: I'm specifically leaving a "var b".

      Alert (typef (b)) // Undefined if (typef (b) == 'undefined') / True if (typeof (b) === 'undefined') // true - It indicates that the function typef is returning a string value if (typef (b) == 'empty') / / false (if type (b) === 'null') // false if (typef (b) == faucet) // Fellus if (typef (b) === blank) // false (b) // runtime error - b is undefined  

    any other type of operation then type (B) Results in a runtime error. Yet I can understand the way the expression is being evaluated.

    So now I see a non-existent property and are really confused.

      If (AC) // runtime error - C is zero or not an object alert (typef (AC)) // runtime error - is undefined or not an object  

    I would think that in this case c will be treated like b in the previous example, but not its You have to start a bit to actually do something, so you can get it as the behavior of B. And stop throwing runtime errors.

    Why is that so? Are there some special handling types of undefined type or what kind of methodology that has been repeatedly doing some time to evaluate the depreciating sub-property?

    1. I think there is a practical question here: I am looking at Nested Object C in AC, can I guess immediately if someone is undefined?

    2. And what's the best way, if I want to see some highly nested objects, whether it was set in MyObject like X. Some. some. some. X? I have to navigate through the element through the element of the element so that each one is present before going down to the next one in a series?

      Yes.

      I can post "itemprop =" text ">

      Can I immediately assume that is undefined if someone is undefined?

      > I have to navigate through the element through the element of the element so that make sure that each one is present before going below the next one in the moon?

      Yes .


    rest - Need a better language/frameworks doing RESTful webservices -


    I am developing a replacement for our company's web service stack.

    The existing pile was developed using SOAP and some other end points were hacked manually. This maintenance is a nightmare.

    I can use any language, technique, and framework until it fits the goal.

    Requirements:

    • Undoubtedly easy to fill the services
    • Uses an MVC model
    • Middle It helps in injection of layers Authentication around the call (ohth and basic ath) (primarily in a declarative way)
    • It will return JSON, JSONP and Plain OL XML (Simple XML) Return Data Makes it easy to serialize
    • primarily caching controls Designed and built in e-tag support
    • is primarily using a steady typed language but it does not matter if I have to type It is dramatically low
    • This is a framework that would be great to support handling microfreaded / epole type HTTP so that I can easily support HTTP long voting, but this is not a requirement.

    So far I have noticed:

    • .NET (C #)
      • ASP.NET MVC (Simple MVC framework, manually adding missing pieces to meet my needs
      • Monorail (Simple MVC Framework, Less Supported)
      • WCF (Unfor Tununit to make it a lot of acquisition in order to work well for customers' consumption To force it do not use WCF itself)
    • Python
      • < /
      • Scala (still new but bigger) startups are using it)
      • Ruby on Rail (the way I do not like on scale)

      Any other thoughts or ideas?

    I just started working with - I think this is a great combination.


    .net - Fastest socket method for a lot of data between a lot of files -


    I am creating a socket application for which it needs to alter many small / medium sized files, Files on a lot of clients like 5-100kb size (like a web server, but not quite enough).

    Do I just want to win in standard voting / appol (linux) or winsock (encrypted sockets), or there are over-lapsed i / o on any method (for example Win32, for example) with more performance ?

    You can try on windows, in which kernel space & lt; -> Ability to increase your performance by avoiding user space data copying.


    asp.net - spam filter logic -


    I know you guys can tell me what I can not do. that's why I'm here.

    Actually I need an antiseptem bot mechanism for any site I have created. The problem is that sometimes they are very complicated or I do not have time to put them on the website, because some sites are already doing and some require a hard time limit. I was wondering how these spammers attack your site in such a way. Since most antipamps (reCAPTCHA, ACQUETIT etc.) use the same principle in avoiding spam, where they use any kind of random images (with words) and people can guess only on the basis of that word The correct word about them is. Now, can not I just make a random word that people who can enter (based on the given question), I have a simple question on the antispam field: "What is the sixth planet in the solar system?", The answer to the registrant "Saturn", gets the correct answer, it gets registered ... Are spammers answer these types of Random questions?

    Just wondering ...

    Thanks in advance!

    Problems in your own implementation are not usually the ones that come with you (though your case This is very low in) This is a real implementation, which will almost certainly go wrong in some small fashion.

    In this way, it is better (faster and easier) to use the reCAP (if your boat floats).

    The thing is, if you implement a custom system, the "normal" spammers who want to see the common implementation and solving them, it will be difficult, but as soon as you are targeted, it It's all over.


    c# - Asp.net controls' Attributes collection property -


    आप मेरा पोस्ट देख सकते हैं।

      WebControl.Attributes.Add (स्ट्रिंग कुंजी , स्ट्रिंग मान);  

    इस तरह से गुण एक asp.net वेब नियंत्रण की संपत्ति का उपयोग किया जा सकता है।

    क्या कोई मुझे पूरी सूची के साथ प्रदान कर सकता है कुंजी एस जो वेब नियंत्रण के साथ उपयोग के लिए उपलब्ध हैं?

    कोई भी वेब लिंक जिसमें व्यापक सूची की सराहना की जाएगी।

    विशेषताएं प्रस्तुत किए गए HTML के माध्यम से सीधे पारित हो जाती हैं, इसलिए आप जिस व्यापक सूची की तलाश कर रहे हैं वह HTML पर W3C के दस्तावेज़ है:

    < / html>

    c# - Authenticate user in Global Catalog -


    I need to authenticate the user's Windows credentials, which is a user ID, domain and password in our Active Directory There are several domains, some that we can list using the following code:

      var domain = System.DirectoryServices.ActiveDirectory.Forest.GetCurrentForest (). Domain;  

    However, we have users who are related to the domain outside the forest, although they are accessible to me from Global Catalog (GC) below code I get a directory entry for a user ID Allows to

      System.DirectoryServices.DirectoryEntry globalCatalogDE = New System.Directory Services. DirectoryEntreter ("GC: // DC = NSRO, DC = Net"); Var ds = new system Directory Services Directory Search (GlobalCaladEdED); Ds.Filter = "(and (objectClass = user) (sAMAccountName =" + userId + ")); System.DirectoryServices.DirectoryEntry userDE = ds.FindAll () [0] .GetDirectoryEntry ();  

    How can I authenticate a user who comes under a domain that I can not use directly but is available to me in GC?

    You can not authenticate a user by looking at the global catalog, it is only for searching ( Any feature marked with the isMemberOfPartialAttributeSet in the schema is repeated for GC for each domain).

    Passwords are not replicated by it; Otherwise you will have the password of all users in the entire forest on each domain controller, which is much worse than the security and replication approach. You must establish a connection to the domain where the user's credentials are stored (i.e. you need access to LDAP port 389 or 636).


    ide - Aptana studio won't load? -


    I am using a standalone version of Aptana and I have just finished correcting. When I tried to launch Aptana, I found this error:

    The product could not be launched because the specified workspace can not be created. The specified workspace directory is either invalid or read-only.

    How can I solve it?

    I just went to this same issue. This is due to mapping your "My Documents" folder to a different drive. The installer and program believe that it is located on the C: \ drive and tries to create or open the workspace there.

    To fix the problem:

    Create a new shortcut for Aptana (or modify existing one) and the path to your workspace folder Add a --Data parameter (under your documents by default) on my system this is such a setup:

      "C: \ Users \ lance \ AppData \ Local \ Aptana Studio 2.0 \ AptanaStudio .exe "-data" E: \ Documents \ Aptana Studio Workspace " 

    View error log:

    Every time you try is , Is written in a log file program / configuration / folder launch the program. Log files appear as they are in the name of some type of timestamp (1259818956579.log). Inside the log file, there is a detailed error message with the data solution:

    Route exception: java.lang.IllegalStateException: The platform metadata area could not be written: C: \ Users \ Lance \ My document \ Aptana Studio Workspace When the Metadata Platform launches, the platform writes its content under the current content. To specify a separate content area for the platform, use the -data parameter.


    How to see the connection string used to connect to SQL Server -


    Is there a way to use connection strings to connect to SQL Server? Or the string was used in an unsuccessful login attempt.

    Many times I have to deal with complex systems in which I see a failure due to some service which fails to enter SQL. I'm guessing that the connection string may be wrong, but since I can not see what I'm having problems, I'm having problems finding out that in order to really add that problem, reconfigure it and it Due to being able to fix

    Errors in logs just say a few: 2009-12-01 20: 16: 31.05 Logon failed with SSPI Hathyshek error code 0x8009030c when connection with integrated security was established; Connection has been closed. [Customer: 10.124.172.65] 2009-12-01 20:16:16: 31.06 Logon error: 18452, Seriousness: 14, State: 1. 2009-12-01 20: 16: 31.06 Logon login failed. Login is from an untrusted domain and can not be used with Windows authentication. [Customer: 10.234.222.13]

    Can any audit be done that I can be able to smell the connection string or put the equipment so that there is a problem in the string by analyzing the string?

    Not really the connection string is only a case between client applications and SQL client libraries and to monitor that tight spot There is no out-the-the-box tool for.

    However, there is no one in your example Need to know the connection string, you know that the connection string was using integrated security (according to the 'SSPI handshake' definition), you know that It was trying to connect to the server on which this error was logged, you know the cause of failure (error SEC_E_LOGON_DENIED), and you know which customer has tried to connect (10.234.222.13). There is absolutely nothing in the connection string which will help in troubleshooting this problem.

    The error you are seeing is an SSPI error, especially Kerberos / NTLM error and if you use Kerberos / NTLM devices and methods, most not all, if Kerberos / NTLM problems Taxation can be troubleshooting.

    In your case you will find one of the common culprits:

    • Services are running
    • A expired password
    • Try connecting with (most likely) services

    Is this type of continuous pair programming good? -


    I am working in a company where I have been forced to do a pair programming program with 6 years More than I experienced at the same time, we work on the same PC on the same code, design or some other problem.

    Damage.
    It takes away the feeling of ownership of the result and starts affecting each other's mood.

    Profit.
    Well thought outcome and output to the company.

    I want to know how other developers deal with this type of situation. / P>

    pair programming is like figure skating

    • you do not need it Have 24x7 together, when you're on the ice! (I.e., many parts of a project are benefited by being coded separately, the couple again reviews the review / debug for the group, but is not actively "competing" for its completion).
    • It all depends on your partner: it can work very well or not, independent of skating (or programming) skills.
    • This requires the right balance of honesty and patience (speaking, clearly, but at the right time, a clear lack of ownership, or with some tasks, you have great happiness or any other part With about your obstacles ...)

    For these reasons, a little steadfast and mandate programming. I am personally in favor of this practice, but I believe that programmers and management should understand the need for "proper chemistry" and when a couple does not work well together, then There should be no least bit of dissatisfaction or judgment.

    To ensure this, the programmer should try this discipline at a large scale and earn a living with specific partners (for a long period of time and for various project types) before declaring personality conflict. Should work. It may also be that a given pair works better on special project types.


    failed to prepare insert statement -


    sqlite3 * insert_statement = शून्य;

      यदि (insert_statement == शून्य) {स्थिर वर्ण * क्वेरी = "आइटमइन्फ़ो में प्रविष्ट करें (आइटम का नाम, दोस्ती) मूल्य (?,?) जहां आइटम आईडी =?"; यदि (sqlite3_prepare_v2 (डेटाबेस, क्वेरी, -1, और amp; insert_statement, NULL)! = SQLITE_OK) {NSAssert1 (0, @ "त्रुटि: संदेश '% s' के साथ बयान तैयार करने में विफल रहा है।), Sqlite3_errmsg (डेटाबेस)); }  

    है ... मैं उद्देश्य सी के लिए नया हूँ ...

    मैं डेटाबेस में कुछ मान डालने के लिए इस कोड को कोशिश कर रहा हूँ लेकिन इसमें डालने की एक अपवाद है बयान plz मेरी मदद करो मुझे कुछ याद आ रही है ... अग्रिम धन्यवाद ...

    क्या आप कोड में क्वेरी स्ट्रिंग में उन प्रश्न चिह्न हैं। मुझे लगता है कि आपको VALUES (?,?) में कुछ वास्तविक मूल्यों के बजाय होना चाहिए, जहां आइटम आईडी =? भाग।


    How to retrieve uploaded image and save to a file with JSP? -


    इस सवाल का पहले से ही एक उत्तर है: < / P>

    • 12 जवाब

    क्षमा करें, लेकिन मैं पूरी तरह से Jsp के लिए नया।

    अपलोड की गई छवि को कैसे प्राप्त करें और जेएसपी के साथ फाइल में सहेजना है?

    1. एक वेब प्रोजेक्ट बनाएं।
    2. कम से कम निम्न सामग्री वाला एक जेएसपी फ़ाइल बनाएं:

        & lt; form action = "upload" Method = "post" enctype = "multipart / form-data" & gt; & Lt; इनपुट प्रकार = "फ़ाइल" नाम = "फ़ाइल" & gt; & Lt; इनपुट प्रकार = "सबमिट करें" & gt; & Lt; / प्रपत्र & gt;   
    3. निम्न पुस्तकालयों के बाइनरी :

      • अनपैक ज़िप करें और अपने वेब प्रोजेक्ट के / WEB-INF / lib में JAR फाइलें रखें।

      • कम से कम निम्न सामग्री वाला एक सर्वलेट वर्ग बनाएं :

          सार्वजनिक वर्ग अपलोडसर्वेट एचटीटीपीएसवर्लेट का विस्तार करता है {@ ओवरराइड संरक्षित शून्य डूओपस्ट (एचटीटीपीएसएआरलेट अनुरोध अनुरोध, एचटीटीपीएसर्वेट रेस्पॉन्स प्रतिक्रिया) सर्विसलेट एक्सप्शन, आईओएक्सेशन {सूची & lt; फाइलइस्टम & gt; आइटम = नल; कोशिश {आइटम = नया ServletFileUpload (नया DiskFileItemFactory ())। ParseRequest (अनुरोध); } पकड़ (FileUploadException ई) {नया ServletException फेंक ("मल्टीपार्ट अनुरोध पार्स नहीं कर सकता।", E); } के लिए (फ़ाइल आईटम आइटम: आइटम) {if (item.isFormField ()) {// नियमित रूप से फार्म फ़ील्ड को अनुरोध करें। // आप item.getFieldName () द्वारा पैरामीटर नाम प्राप्त कर सकते हैं; // आप item.getString () द्वारा पैरामीटर मान प्राप्त कर सकते हैं; } Else {// प्रक्रिया अपलोड किए गए फ़ील्ड यहां हैं स्ट्रिंग फाइलनाम = फाइलनामयूटी .getName (item.getName ()); // फ़ाइल नाम प्राप्त करें फ़ाइल फ़ाइल = नया फ़ाइल ("/ पथ / अपलोड / अपलोड", फ़ाइल नाम); // गंतव्य फ़ाइल को परिभाषित करें item.write (फ़ाइल); // गंतव्य फ़ाइल पर लिखें। }} // परिणाम पेज दिखाएं Request.getRequestDispatcher ("result.jsp") अग्रेषित (अनुरोध, प्रतिक्रिया); }}  
      • web.xml में servlet को निम्नानुसार टाइप करें:

          & lt; servlet & gt; & LT; सर्वलेट-नाम & gt; अपलोड & lt; / सर्वलेट-नाम & gt; & LT; सर्वलेट श्रेणी & gt; mypackage.UploadServlet & lt; / सर्वलेट श्रेणी & gt; & Lt; / सर्वलेट & gt; & LT; सर्वलेट-मैपिंग & gt; & LT; सर्वलेट-नाम & gt; अपलोड & lt; / सर्वलेट-नाम & gt; & LT; यूआरएल पैटर्न & gt; / अपलोड & lt; / यूआरएल पैटर्न & gt; & Lt; / सर्वलेट-मैपिंग & gt;  

    यह होना चाहिए। जब आप जेएसपी में फॉर्म जमा करते हैं, तो यह क्रिया / अपलोड को लागू करेगा जो सर्वोबैले के और lt; url-pattern & gt; से मेल खाती है और फिर सर्विसलेट इसके कार्य करेगी doPost () विधि में अंत में यह सब बहुत सरल है उम्मीद है कि यह मदद करता है।


    Deleting xml nodes using xslt -


    Do anyone know how to copy only the first nodes in an XML file and the rest use XSLT? So says that I only want to copy the first 10 nodes and want to remove the remaining nodes of the remaining parent.

    You should remove them from your results set, such as:

      & Lt ;! - Note that you have to encode 'more than' and 'at least characters - & gt; & Lt; Xsl: each selection = "parent / nodes [condition () & amp; lt; = 10]" & gt; ... & lt; / Xsl: each -G & gt;  

    Change event not triggering until the document is clicked [JQUERY] -


    O people, I am using a reconciliation solution for setting fire on Everest. Although IE seems to be a bug, unless my click is clicked anywhere on the document, my event is not being called.

    Any thoughts?

    Sample code ...

    <("(selection")} {if (v == "0.00") {// some stuff} else {// some stuff}} other { // some things}});

    Edit:

    It seems I change. Well check box at least.

    Event Bubbleing / Propagating Issue or something that I think.


    performancecounter - How to intrepret values of the ASP.NET Requests/sec performance counter? -


    If I monitor the AAPNet request / second display counter every N seconds, how should I interpret the values ? What is the number of requests processed during the sample interval divided by N? Or is it the current request / sec, even if the sample interval?

    What is the number of seconds depending on your N value As the display counter will always be read on before 0 after the start. This makes all of your calculations relative to the last point on which you are called the next value () .

    You also want to be careful about calling your counters nextValue () works at less intervals than one because it can produce some very foreign outlaws results is. To call every 5 seconds function, for my use, provides a good balance between up-to-date information, and general average.


    iphone - MapKit mercator projection -


    मैपकिट मर्केटर प्रक्षेपण का उपयोग करता है, मैं अक्षांश को Y स्क्रीन निर्देशांक में कैसे परिवर्तित कर सकता / सकती हूं? अपडेट: धन्यवाद मैं इसका उपयोग

      CLLocationCoordinate2D leftTopBoxCoordinate; leftTopBoxCoordinate.longitude = -180 + cacheRegion.minX * boxSize; leftTopBoxCoordinate.latitude = 85 cacheRegion.minY * boxSize; CGPoint leftTopPoint = [नक्शा बदलें कोंडर्डिनेट: बाएंटेपबॉक्सकॉर्निडेन्ट टू प्वॉइंटटोव्यू: मैप]; Int बॉक्सडीवाई = बाएंटेपपॉइंट.य; Int boxDX = leftTopPoint.x; NSLog (@ "\ NL:% एफ, जी:% च \ NDX:% d, डीवाई:% d \ n", topLeft.latitude, topLeft.longitude, boxDX, boxDY);  

    मुझे उस ग्रिड को आकर्षित करना होगा जो मैप, कैश रीजियन। माइिन - को ग्रिड में बॉक्स का न्यूनतम सूचकांक है, इसके द्वारा मैं अक्षांश और बॉक्स के रेखांश की गणना करता हूं और मुझे बाईप बॉक्स और मानचित्रदृश्य क्षेत्र लेकिन 10 डिग्री के बाद [मैप कन्वर्ट करें: बाएंटोबबॉक्स कॉओर्डिनेट टू प्वॉइंटटोव्यू: मैप]; काम नहीं। यह अच्छा

      - [ग्रिड ओवरले ड्राराक्रेक्ट:]: एल: 80.058050, जी: -180.000000 डीएक्स: 0, डीवाय: -56 यह बुरा - [ग्रीड ओवरले ड्रॉ रेखें]: एल: 79.432371, जी: -180.000000 डीएक्स: 0, डीवाई: 28  

    सभी लॉग:

      - [ग्रिड ओवरले ड्राराक्रेक्ट:]: एल: 85.000000, जी: -180.000000 डीएक्स: 0, डीवाई: 0 - [ग्रिड ओवरले ड्राराक्रेक्ट:]: एल: 80.058050, जी: -180.000000 डीएक्स: 0, डीवाय: -56 - [ग्रिड ओवरले ड्राराक्रेक्ट:]: एल: 79.432371, जी: -180.000000 डीएक्स: 0, डीवाय: 28  

    क्या हुआ है? क्या आप जानते हैं? I

    Mercator प्रक्षेपण नक्शा अक्षांश रेखीय है, ताकि आप मानचित्र के दृश्य के समन्वय की गणना कर सकें क्षेत्र की संपत्ति।

    हालांकि, MKMapView में एक विधि है जो नक्शे को डब्लूजीएस 84 से स्क्रीन तक समन्वयित करता है: convertCoordinate: toPointToView:


    windows - Get Link Speed - Win32_PerfRawData_Tcpip_NetworkInterface -


    I found and now I'm trying to Win32_PerfRawData_Tcpip_NetworkInterface data Win32_NetworkAdapter (or Win32_NetworkAdapterConfiguration ).

    Win32_PerfRawData_Tcpip_NetworkInterface I have any index or unique key that I do not see that you can use for reference Win32_NetworkAdapterAdapterConfiguration or Win32_NetworkAdapter I tried to use name Win32_PerfRawData_Tcpip_NetworkInterface and Win32_NetworkAdapter`, but still they look different.

    Name: Intel (R) PRO / 1000 PL network connection

    versus

    < P> Name: Intel [R] PRO_1000 PL network connection

    Any hint?

    Thanks in advance,

    milde

    ===

    Perhaps the piece of code will help you to help people: )

      # I have got DeviceID of a NIC and use it to get "Netconnection ID": $ objWMIService = Win32 :: OLE- & Gt; GetObject ("winmgmts: \\\\ $ $ computer \\ root \\ CIMV2") or die "Exit: WMI connection failed. \ N"; $ ColNicSetts = $ objWMIService-> ExecQuery (select "* from Win32_NetworkAdapter *, where DeviceID = '$ id'", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly); $ $ In $ objItem ($ colNicSetts) NetConnID = $ objItem-> {NetConnectionID}; } # = & Gt; $ Netconad Store "Intel (R) Pro / 1000 PL Network Connection" # I now try to get link speed with STH. Like this: $ collItems = $ objWMIService- & gt; ExecQuery ( "Select * Win32_PerfRawData_Tcpip_NetworkInterface name where = '$ NetConnID", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly); $ {LinkSpeed ​​= $ objItem-> in my $ objItem ($ collItems) {CurrentBandwidth}; } #include "Intel® (R) PRO_1000 PL Network" Connection # "Intel (R) Pro / 1000 PL Network Connection" in "Win32_PerfRawData_Tcpip_NetworkInterface"! = Intel [R] PRO_1000 PL network connection # = & gt; $ LinkSpeed ​​Empty  

    OK. Thanks for posting a short script while you were working on it, I was following a different track and digging through the docs to see if you missed anything.

    I could not find a better method (should be one) Name:

      #! Use / usr / bin / perl strict; Use warnings; Use DBI; Use data: Dumper; My $ computer = '.'; ($ Computer) = @ARGV if @RAGV; My $ dbh = dbi- & gt; Connect ("DBI: WMI: $ computer", undefined, undefined, {RaiseError => 1),); Print "=== === from Win32_NetworkAdapter \ n"; My $ name = $ dbh- & gt; Selectall_arrayref ('SELECT * FROM Win32_NetworkAdapter WHERE DeviceID = 11') - & gt; [0] - & gt; [0] - & gt; {Name}; (My $ canonname = $ name) = ~ s / [^ A-Za-z0- 9] / _ / g; Print "name: $ name \ n legal name: $ canonname \ n \ n"; My $ sth = $ dbh- & gt; Prepare ('Choose * Win32_PerfRawData_Tcpip_NetworkInterface'); $ Sth- & gt; Execution; Print "=== Win32_PerfRawData_Tcpip_NetworkInterface === \ n"; While (defined (my $ adapter = $ sth-> fetchrow_arrayref)) {my $ conf = $ adapter-> [0]; My $ perfname = $ conf- & gt; {Name}; (My $ canonperfname = $ perfname) = ~ s / [^ azza-j 0-9] / _ / g; If ($ canonperfname = ~ / ^ $ canonname /) {print "name: $ perfname \ n canonical name: $ canonperfname \ n"; Print $ conf- & gt; {CurrentBandwidth}, "\ n \ n"; last; }}  

    Output:

     Win32_NetworkAdapter === name ===: Intel (R) PRO / Wireless 3945ABG network connection canonical name: Intel_R__PRO_Wireless_3945ABG_Network_Connection === the Win32_PerfRawData_Tcpip_NetworkInterface === name: Intel [R] PRO_Wireless 3945ABG Network connection - packet Scheduler Miniport canonical name: Intel_R__PRO_Wireless_3945ABG_Network_Connection___Packet_Scheduler_Miniport 54,000,000 

    .net - Why shouldn't I use Unity? -


    I am using Integration IoC container. This was not really a decision that I did, it just came with the prism Was, and I was stuck with it. I have never used any other IOC framework, and I have to admit that I am very happy with unity. However, Santosh can come from ignorance because I do not really know what other frameworks provide.

    I am hearing that I should not use the Unity IoC container instead of "use castle, ni inject or structural map", people are saying, but I still do not have any concrete reasoning or examples I've heard why I should use a different framework. So, why should not I use unity? Or maybe I want to?

    These containers are about flavor , more than anything else. There is a good fluent interface to configure Ninject, but some people are perceived as the ability of unifying through config (masochists, I think) and code.

    I, like you, used to practice unity with both Nanning and Autofak. I have not found any reason to be strong in terms of performance or facilities which have to be with more than unity. There are some things that were good at both, but they all basically did the same thing and did it well.

    I will look at each one's characteristics, style and syntax, and decide who you like best. This is actually the only difference ... how it looks usually some main characteristics are different, but this possibility of you is very thin.

    Post an update about the decisions you make ... I am always interested in the findings of people's real world. Users who are passionate are advocating.


    jquery - jrails autocomplete selection problems with DIVs or anything else -


    I'm just starting to use jRails and jRails auto_complete assistant

    I used to use prototype before using the default auto_complete assistant and leaving the hovering on the results of autocomplete, drops in properly worked with JRless if you use simple text for the result, Works but I'm using several divisions in my partial form Which generates output to auto-complete.

      & lt; Li class = "location" & gt; & Quot; Div class = "picture" & gt; & Lt; Img src = "/ images / flags /" & lt;% = h image% & gt; .png "/> & Lt; / Div & gt; & Lt; Div class = "name" & gt; & Lt;% = h place Keyword = & gt ;, & lt; / Div & gt; & Lt; Div class = "country" & gt; & Lt;% = h location.sideinfo% & gt; & Lt; / Div & gt; & Lt; / Li & gt;  

    It looks the same and all CSS works and looks like before, but the result is a selection or hovering over. This allows only selection if you hover over the background around the text ... Anything in a tag, (div, span, etc.) goes to the hover to go and clicking it does not text the textbox Is added.

    Is anyone else having such problems?

    I know for a while, but I hit the same problem today itself.

    The mousewoucher incites the mouse to the event with all these items, which is clearly not the lack of self-integral property (it is employed only on light elements. Therefore, when the indicator is from one of the children One,

      onHover: function (e) {var my_index = e.target.autocompleteIndex; if (if! My_index) {my_index = $ (e.target) .closest ('li' Attr ('autocompleteIndex');} if (this.index! = My_index) {this.index = my_index; this.render ();} stop event (e);},  

    Now if we have an autoplay index property in that element If we fail to know who is removed from the mouseover event, then we look at the nearest parent of 'Li' and use anything present there.

    There is a little regret, but at least Worked for me.

    On a sidenote, I also had clicked on tickling, or when I clicked the mouse and hit one, say, div element, the index was lost. That's why it was in the first place, so in the keyboard interface Nothing is included.

      onClick: function (e) {/enthis.index = e.target. Auto integer index * / This.selectEntry (); This.hide (); },  

    c++ - two dimensional array using vector in cpp -


    I want to create a 2D array using vector. But, when I do this, I have a mistake, can someone please explain to me what I am doing, and the possible solution to this problem.

    I made everything public because now I do not want to deal with gates and sets. I want to clarify the concept of 2D array.

      #include & lt; Iostream & gt; # Include & lt; Vector & gt; using namespace std; Square point {public: point (): x (0), y (0) {} dot () {} point (float xx, float): x (xx), y (yy) {} float x, y ; }; Int main () {Vector & lt; Vector & lt; Point & gt; & Gt; a; // 2D sur point point (2,3); A [0] [0] = p; // error here 0; }    

    Your vector is empty I [0] [0] can not be used.

    Here's how you declare it:

      a.push_back (vector & lt; point & gt; ()); A [0] .push_back (P);  

    If you know how many items will be from the beginning, then you can:

      vector & lt; Vector & lt; Point & gt; & Gt; One (10, vector, lie; point & gt; (10));  

    This is a vector containing 10 points with 10 points. After that you can use

      a [4] [4] = p;  

    However, I believe that using vector vectors is misleading. If you want an array, consider using uBLAS

      #include & lt; Boost / numeric / ublas / matrix.hpp & gt; #include & lt; Boost / numeric / ublas / io.hpp & gt; Int main () {namespace boost :: numeric :: ublas; Matrix & lt; Double & gt; M (3, 3); For (unsigned i = 0; i & lt; m.size1 (); ++ i) for (unsigned j = 0; j & lt; m.size2 (); ++ j) m (i, j) = 3 * i + j; Std :: cout & lt; & Lt; M & LT; & Lt; Std :: endl; }  

    path - Qt: Expand ~ to home-directory -


    Is there a platform-independent functionality in QT to accept routes like "~ / myfile"?

    I know about, but it would be good with stage-independent cover.

    Edit:

    Thanks for all the responses. "~ / Myfile" was just an example. What I see is the functionality to handle file-paths, because you will be able to write on the command line. So on Linux, it should accept "~ / myfile", "~ other / / his file", "$ VAR / file" etc. It should accept "% HOMEDIR% \ myfile" etc.

    You might have to tild with the result of QDir :: homePath () can change? Reference.


    c# - Workflow Foundation Separate Schema -


    I am working with firmness and tracking services in the workflow foundation and I thought it was a different way to use it Good idea would be the schema for the workflow in SQL Server

    Unfortunately, it appears that they have default D.O. in their code. Schema works hard to name One example is the SqlTrackingService class, the way they wrote tracking classes, I did not override ways to provide my own DB query code.

    I have thought about the following options, but nothing is possible:

    • Reprint tracking from
    • Disassemble and < / Li>
    • Some ways to stop and rewrite SQL queries
    • There are a few ways to trick this to use a custom version of SqlCommand, which filters the command text < / Li>
    • Just go ahead and use the DO schema for WF stuff
    • Complete for WF Use different databases in a way.

    Does anyone have any suggestions or choices I have not considered? In most cases I accept the only scheme and occasionally take things into a separate database. As far as I know that there is no way to stop the orders and to rewrite the plans or names of the table, but then I never tried it. If you want to rewrite, then I did a port, SQLCE and WordFloppresence service in SQLE and LinkTSSCL. Feel free to use it and / or modify it to meet your needs. See

    for the default SqlWorkflowPersistenceService as part of the proprietary part. .

    How to benchmark php/mysql site -


    I would like to know how to benchmark a php / mysql site.

    We have a web app almost complete and ready to live, we know how many people are going to use it in a year's time, but it does not know exactly how much the average user takes on the bandwidth It is, how much time they burn the database etc. We need to purchase the correct server to determine.

    Is there any server side Linux that can monitor these statistics per user? So can we take this data and extrapolate it?

    If I am going about this completely wrong then please let me know, but I believe this is a continuous activity for new web applications.

    EDIT: I may have asked for the wrong information, we can see how long the database query takes, and how long it takes to load the page but it does not know that on the server What has been loaded. The question I am asking is, can we handle 100 users on an average ... 1000? What types of server requirements are required to kill 1M users etc.

    Thank you for your help.

    A tool that I find quite useful is (this is the most basic) Allows you to set up your browser to use jmeter, so you revolve around your website and it will record you everything.

    Once you are happy that it is a decent test of most of your website you can then save the test in jmeter and copy it to set a set number of threads and copy Thread can be said to run your test with many loops.

    For example, you can run the testplan for every 50 clients running 10 times.

    Then you can ramp up the numbers up and down to see the effect of the performance on the site, it underlines the reaction time for you.

    This lets you tune into different standards, try different caching strategies and check the effect of the real world of those changes.


    php - DECIMAL vs INT what is the best optimized choice? -


    I'm sure the asking is incomplete without a precise reference, so I will try to explain it, and I will be clear Try
    I need to store whole data with grams, mg, microgram and kelzol on the page.

    All this data is 99999.99g (different to kelozole), so I can use Decimal (7,2) or Decimal (5,2) with older MySQL versions.

    However, I have seen in my website, the DCIML datatype is heavier than a mediocre (I am wrong?) That can be enough to store the data.
    Primarily, I will make the user operate digitally or float from the machine, and there is no need to restore it, so I doubt it about the best datatype in this case.

    So what is the best datatype in this case?

    A purpose of the database is to provide data integrity and ensure that data is which is close to the same natural nature, there is a need to store e-type data. Keeping this in mind, you should not attempt to optimize the data type for a database engine prematurely (unless you have a benchmark and you have a good reason). Instead, your efforts are better spent to properly design and index your table structures with the right relationships, where it is useful to help you deal with the amount of database engine and the type of data. is. You will be surprised how much data the DB engine can process if the data is corrected properly and indexes and relationships are made where appropriate.

    So, as a best practice, decimals or partial numbers such as values, partial quantities etc.


    ios - How can I initialize a let variable using a shared init method? -


    I want to set up a variable using let so that its not optional, but change There will be no need to open dirty to enter time and every time. I know that I can set it legally, but the problem inside one of the only init methods is that you override the init (codec additive: encoder) for swift Need to do initializer However, I have never made such an app that the initiator was called. It is always called init (frame: CGRact) originator. So if I did not have to override the init (coder aDecoder: NSCoder) then self.imageView = UIImageView.new () in Init (frame: CGRTact) < / Code> and I will be done, but the compiler complains that it is not even set in another init, I tried to create a sharedInit () method, which is called from both intits. , But the compiler will not let me set imageView from there because it's only read out of init methods. How should I complete all my insights in the INP mode?

    SuperCoolView: UIView {imageView: UIImageView required init (encoder: NSCoder) {sharedInit () Super.init (encoder: aDecoder) Override init (frame: CGRact) {SharedInit () super.init (frame: frame)} func sharedInit () {self.imageView = UIImageView.new () // other similar share init}}
    < P>

    Simply use the combination of lazy initialization and private 'set':

    SuperCoolView: UIView { Public Private (Set) Lazy Vari imageView: UIImageView = {// In practice, Yes More Access status // In this case, include more calculation UIImageView.new ()} () // inits w / o setting imageView}

    'Private set' This is a Equals let equally; Lazy lets you start the price based on another state in the SuperCoolView example

    Note that if the initialization of the image view, and others, the example But do not depend on the state, you can avoid the the lazy and can only do the initial work by closing


    Macro issues in C++ -


    I am trying to apply some code that is working for other people. I am using Visual Studio 2013, but I believe they are using a different compiler.

      #ifndef SAFE_DELETE #define SAFE_DELETE (x) / if (x! = NULL) Everything in the code is working properly expect a handful of macros.  / {/ Delete x; / X = null;   or  error C2059: syntax error: 'if'       P> 

    Not surprisingly, I get an error when trying to use it:

      SAFE_DELETE (* this); // "Expect an Expression"  

    The namespace where I define this macro is shared with the rest of my part, and the macro is not used anywhere else. There are no other syntax errors, including it and commenting on SAFE_DELETE (* this); produces the code that will compile Additionally, the macro works with the code from the macro as well as the place of the call.

    I tried to redefine the function:

      #ifndef SAFE_DELETE #define SAFE_DELETE (X) / X = zero; / #endif  

    This error generates error: There is no storage class or type specifier in this declaration . It makes me believe that in some way it is not being called in any class, yet it is very clearly.

    What could be the issue? In addition, how is it possible that it was compiled for someone else?

    You do not want to continue a line of a backslash ( \ ), Forward slash ( / ).


    RegEx how to insert text in a previous line of searched text in notepad++ -


    I'm looking for a regular expression to insert text in the previous line below, for example, I'm notepad ++ There is a need to include in

      submit ... action .. method = post  

    I would like to search with method = post and then below Like this "post" text will always put this method = two lines from the post

      post action method = post post  

    Can you use any of the regular expressions in Notepad ++?

    If I understand what you want: Find & amp; Change the dialog box, find what you are looking for, add "method = post", and add "Post ^^ ^ ^ Action ^^ method = submit" and then change all


    hadoop - What determines how many times map() will get called? -


    I have a text file and a parser that will parse each row (pars) and store it in my custom split input , I'm parsing my custom file in the input format phase, my division is customizable right now, I have 2 partitions and there is a list of my data within each partition.

    But right now, my Mapper function is being called repeatedly on the same partition. I thought the mapper function will only call on the basis of your partition's number?

    I do not know what this applies but my custom suffix gives a certain number for getLength () and for an empty string array GetLocation () what I have to do for them I have uncertainty.

      @ Override Public RecordRider & lt; Longweightable, derivative & gt; CreateRecordReader (InputSplit Input, TaskAttemptTontext taskContext) throws IOException, blocking exceptions {logger.info (">> > Creating record reader"); Customcorder reader recorder = new customcorder (inputable input split)); Return record reader; }  

    map () once for every record It is said in your InputFormat from RecordReader (or referenced) from For example, TextInputFormat call map for each row in the input, even if there are usually several rows in the partition.


    php - Notice on setting a property -


    मुझे यह सूचना मिलती है:

    ओवरलोडेड प्रॉपर्टी के अप्रत्यक्ष संशोधन ReadData_model :: $ err इस लाइन पर

    कोई प्रभाव नहीं

      $ this-> err {$ target} '_db'} = '& lt; div class = "सतर्क चेतावनी-खतरे" भूमिका = "सतर्क" & gt; माफ करना, हम आपके & lt; मजबूत & gt; । $ लक्ष्य 'डेटाबेस & lt; / strong & gt; अपने प्रविष्टियों की जांच करें और पुनः कनेक्ट करने का प्रयास करें। & Lt; / div & gt; ';  

    मैं एक डायनामिक प्रॉपर्टी सेट करने की कोशिश कर रहा हूं।

    नोटिस का क्या मतलब है और मैं इस समस्या को कैसे हल कर सकता हूं?

    < P>

    मैंने इसे इस तरह हल करने की कोशिश की और यह काम करता है:

      $ this-> gt; err_ ' । $ लक्ष्य '_db'} = 'जो भी';  

    Netsuite - Set Line Item Value -


    I am trying to find out how to set a custom value item with the value of another field on the item field. I have not received any error, but this value is not changing.

    Here is the code:

      Validate the function POLineItem (type) {if (type == 'item') {For (var i = 0; i & lt ; = NlapiGetLineItemCount ('item'); i ++) {// Get the value for the amount on the item line var amount = nlapiGetCurrentLineItemValue ('item', 'amount'); // Get the value for PO amount on the object line var po_amount = nlapiGetCurrentLineItemValue ('item', 'custcol_po_amount'); // set PO amount is equal to item item line nlapiSetCurrentLineItemValue ('item', po_amount, amount); It looks like you tried to leave the column name that you want to set up. In addition, you just have to update the "current" line ...  
      Validate the function POLineItem (type) {if (type == 'item') {var zodiac = nlapiGetCurrentLineItemValue ( 'Item', 'amount'); NlapiSetCurrentLineItemValue ('item', 'custcol_po_amount', amount); }}  

    uninstaller - Inno Setup Optional Remove appdata\YourApp during uninstall? -


    I am using Inno Setup and I have to remove AppData \ Local \ MyApp while removing that builder's build I do not want to, but I want to give users the option to delete this data without a message box.

    Here is a screen shot example I'm trying to get.

    Enter image details here

    Here are some examples I've already seen it.

    I therefore uninstall the user program you want to be able to add an alternate Czech box they can extract the hidden data .. but since those that are only upgrading or installing things they left unchecked this area, nor is it To delete the generated data

    I should really be missing something simple but I can only do this at this time to figure it out.

    Thank you.

    Here is sampling to make msg box during Uninstall

      `[Code] Process CurUninstallStepChanged (CurUninstallStep: TUninstallStep); Var Merce: Integer; usPostUninstall start case CurUninstallStep of: MRes start:? = MsgBox (, mbConfirmation, MB_YESNO or MB_DEFBUTTON2 'you want to delete the settings') if MRes = IDYES so deltree (ExpandConstant ( '{userappdata} \ MyApp'), it is true, This is true, true); End; End; End;  

    You can change as you like '{userappdata} \ Myapp' .


    ios - ld: library not found for -lPods-SmartSuite-Bolts Cocoapods -


    Trying to add cocopodes to my project when I compile it, I get this error:

    : ld: -lPods - Library for SmartSuite-Bolts not found

    I tried to restore the cocopod, delete workspace, etc. I have another flag flag in the other linker flag. It seems that there is a specific thing related to Bolts, because I have both pars and Facebook SDKs in the project. Google has tried a lot, but it is a typical error. Completely remove the cocopod from this project and adding it has finally resolved the problem. <


    How can I use CSS and JavaScript with Ruby on Rails? -


    I have a template code css and javascript file and I have to use them in my rail application to see them in the list < / P>

    How can you insert it into your application?

    App / assets / stylesheet folders and styles in javascript / apps / javascript folders.

    You can either add files, or paste the code into application.css and application.js.

    Then they need such a top type:

      // = Required jquery // requires jquery_ujs // = bootstrap.min // is required turbolinks // requires_tree  

    graph - Android Handler is not updating automatically, rather it update when i touch the screen? -


    I am making graph of the data coming from Arduino via Bluetooth. I am implementing the Live Graph using the Graphview Library. I am using handler for dynamic graph purpose. The problem handler is not automatically updating the graph The graph is updated only when I touch the screen and then it still becomes.

      handler mHandler = new handler () {@Override public void handleMessage:   

    Note that these two fuses are in two separate classes. (Message message) {// TODO auto generated method stub super. HandleMessage (msg); Switch (msg.) {Case Bluetooth. UCCCNACCT: Bluetooth.connectedTrade = New Bluetooth. ConnectedTrade (BluetoothSocket) msg.obj); Toast. Make Text (getApplicationContext (), "Connected!", 0). Show (); String s = "connect successfully"; Bluetooth.connectedThread.start (); break; Case bluetooth MESSAGE_READ: Byte [] readBuf = (Byte []) msg.obj; String strIncom = new string (readBuf, 0, 5); Create string with // byte array // lag D. ("Instinctincom", Strencom); If (strIncom.indexOf ('.') == 2 & amp; amp; amp; amp; amp; amp; InternetOf ('s') == 0} {strIncom = strIncom.replace ("s", " ); If (isFloatNumber (strIncom)) {Series.appendData (new graphview data (Article 2LastXValue, Double.parseDouble (strIncom)), AutoScrollX); //GraphView.updateViewLayout (Graphview, empty); // X-Axis control (article 2lostequality> gt; = exeview & lock == true) {Series.resetData (new graphviewdata [] {}); Graph2LastXValue = 0; } And Article 2LastXValue + = 0.1; If (lock == true) graphView.setViewPort (0, XView); Else graphView.setViewPort (graph2LastXValue-Xview, XView); // Refresh GraphView.removeView (graphView); GraphView.addView (graphView); } } break; }}

    This is the function where the data handler is being sent.

      Public Zero Run () {Byte [] Buffer; // buffer store for stream int byte; // Bytes Reading () Returning to I / InputStream, an exception occurs only when (true) {try {sleep (30); } Grip (Interrupted E) E. {// TODO Auto-Generated Catch Block e.printStackTrace (); } Buffer = new byte [1024]; // Read InputStream bytes = mmInStream.read (buffer); // Send the received bytes to the UI activity mHandler.ShareNews (MESSAGE_READ, bytes-1, buffer) .endToTarget (); } Hold (IOException e) {break; }}}  


    extjs - Sencha Architect (IDE) not showing build button why? -


    No reason why the architect build button is not showing? Here's a picture of what I'm looking for:

    Enter image details here < /

    You need to do the following

    1. Apache Anti

    Check the current status in the Dependency section (Menu> Edit> Preferences)

  • screen shot


  • assembly x86 coding with a data segment and loop -


    The code below prints '1' from some data data segments. Then it prints from 1 to 5. I want to use mov eax, instead of 1 to 1 set, '1' from the data segment. Not sure how to do this when I use the '1' character, I think I can add it to add and add to it to get the next number instead of al registering.

      including Irvine32.inc. Data some data byte "1", 0h, 0h, 0. Exit the code Main Proxy call test Main EDP Test Process mov ADX, offset some data; This call is for callstring testing; Just for the mov ecx test, 5 mov eax, 1 l1: writedec call; EX is a counter call, CRLF Inc. al; Next letter Loop L1 Rate Test ENDP END Main  

    Checking your code, I think That you are using al (ink al), not ex So you can add some data directly to the AL. Or you can clear it earlier and use eX. I modify my code for this change:

      .stack 100h Data is some data byte "1", 0dh, 0ah, 0 Code Main Proxy Call Test Moment Ax, 4c00h int 21h Main ENDP Test Procc Mov dx, OFFSET someData; This is just for the mov ah test, 9 to 21 hours; Display SOMEDATA mov ecx, 5 mov eax, 0; Clearing EACA, now SODDATA mov al, someData; The entire eX has L1: call the callcard; EX is a counter call, CRLF Inc. al;  

    Due to some data type BYTE, you have to use AL with EX, but if you want to use EX, size is DWORD, just clear it already So, all its bytes are zero, and the value of AL in EX will be.

    By the way, you are using ASCII characters, I mean, you are not counting 1, 2, 3 ... but "1", "2", "3". .. this is not the problem if you want to stop 9, but if you want to go to 10, 11 ..., then you need to convert some data from "1" to 1. In that case, to display some data on the screen, you will have to make a process of converting from number to letter, what might be WriteDec.


    android - How to add tags to my fragments during initialising them inside a view pager adapter -


    This is my code; The adviewer, the dataviewer and the settings viewer are my piece squares. I want to give a tag during intialising each method so that I can use them within some other piece or main activation.

      import java.util.ArrayList; Import java.util.HashMap; Import android.support.v4.app.Fragment; Import android.support.v4.app.FragmentManager; Import android.support.v4.app.FragmentPagerAdapter; Import android.view.ViewGroup; Public Category View Pager Adapter FragmentPagerAdapter {ArrayList & lt; Fragment & gt; ARF; Public Viewpage Adapter (Fragment Manager FM) {Super (FM); // Tudo Auto-Generated Producer Stub Array = New Arrestist & lt; Piece & gt; (); Arf.add (new datatyur ()); Arf.add (new AddViewer ()); Arf.add (new settings () ()); } @ Override Public Fragment Mill Itam (Int. 2) {// Todo Auto-Generated Method Stub Returns arf.get (arg0); } @ Override Public Inaccount () {// Todo Auto-Generated Method Stub Returns arf.size (); }}  

    Use instantiateItem (...) and lostteam (... ) The way you can construct / construct your piece / destruction, or you can always organize your bundle (Bundle B) during construction. East.

      Private Spacer & lt; Piece & gt; Registered Fragment = New Sparse Array & lt; & Gt; (); @ Override public object instantiateItem (ViewGroup container, int position) {piece piece = (fragment) super.instantiateItem (container, position); // TODO Check whether you want it to be that type, and tagged registered fragmentation. Set input (position, piece); Return piece; } @ Override Public Null destroyed item (ViewGroup container, int position, object object) {super.destroyItem (container, position, object); RegisteredFragments.remove (status); }  

    osx - AppleScript to Launch 1Password mini -


    I use 1 password to store my password, and fluid .app to create some site-specific apps / browsers

    While 1 password integrates well with Chrome, Safari and other browsers, this fluid I do not play well with the app, where my trouble lies.

    So while I'm in the Flood App, I've created a shortcut (with keyboard Maestro ) to run an applescript for opening the mini though, Here are my attempts to get applescript:

    1. Do not tell the application "1 password minis to launch" anything, though AppleScriptEditor Does not report any errors
    2. Apple Sky The Ripit Editor does not report any errors, however to open the application "1 password mini"
    3. tell the application "to activate 1 password mini " is useless, as 1 password mini is already activated
    4. Tell the application" 1 password "to open main Opening the 1 password application, not the mini, what I want.

    Interestingly, when I run (1), (2), and (3), AppleScriptEditor , automatically 1Password mini 2BUA8C4S2C.com.agilebits.onepassword-osx-helper , which does not clarify things for me.

    Does anyone have any clue how this can be resolved?
    I'm on OSX 10.10.2 (Yosemite), if it matters

    I work for Agilibits, developer of 1 password.

    It looks like you've got a solution, but here's another option for you:

      open space "x-onepassword-assistant: // search / " 

    will create 1 password mini to search that applet.

    And if you can obtain the current website's domain from a fluid, you could already open 1 password mini with a search term:

      open Place "x-onepassword-helper: http://search/twitter.com"  

    I hope that helps!


    JavaFX CSS theming via @import and variables -


    I specify the variable in the colors that are repeatedly used in my Java Fx CSS and references the variable instead of the color constant Taken to:

    / P>

      * {Theme-Background Dark: # 335588; } #messageListPane {-fx-background-color: theme-backgroundDark; }  

    Now I want to move the block where I define color variable names and move it to a different CSS file. This will allow me to swap different CSS files on the runtime to change the theme of the application:

    Theme1.css

      * { Theme - Background: # 335588; }  

    Main.css

      @import url ("/styles/Theme1.css"); # Message ListPan {-fx-background-color: theme-backgroundDark; }  

    But when I do this, JavaFX is unable to find variables at runtime:

      Warning: While solving lookup, theme background is dark 'Could not be resolved in' * # messageListPane 'in the stylesheet file by the' -fx-background-color 'rule: / C: /xxxx/styles/Main.css  

    This is not a problem with @import statement; I have other @import that define class selectors and they just pick up in Main.css . It looks like the wildcard selector * {...} . There is something to do with .

    So why did a wildcard selector in the same CSS designate color variables, but not imported from another CSS?

    The designated colors are fine. My @import statement is being ignored, it's as simple as if I attach themes.css manually via code, named colors are visible. @import statement is not picking the theme file and I am not giving any kind of error, I will open another question for that.


    multithreading - java synchronization with executor framework -


    इस कोड में क्या गलत है

      सार्वजनिक वर्ग SimpleThreadPool {सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [ ] आर्ग्स) {निष्पादक सेवा निष्पादक = निष्पादक। एनएफ़फिक्सट्रेडपूल (5); (इंट आई = 0; आई & lt; 2000; i ++) के लिए (रननबल वर्कर = नया वर्कर थ्रेड ("+ i"); executor.execute (कार्यकर्ता); } वर्कर थ्रेड ओबज = नया वर्करट्रेड (); Println (obj.getCount ()); executor.shutdown (); जबकि (! निष्पादक.सुरक्षित ()) {} System.out.println ("सभी धागे समाप्त"); }} क्लास वर्कर टू्रेड ऑप्लेट्स रननाबल {निजी स्ट्रिंग कमांड; निजी अस्थिर स्थैतिक इंट गणना; सार्वजनिक वर्कर थ्रेड () {} सार्वजनिक वर्कर थ्रेड (स्ट्रिंग्स) {this.command = s; } @ ओवरराइड पब्लिक वायड रन () {प्रयास करें {सिंक्रनाइज़ (इस) {processCommand (); }} पकड़ (बाधित ईक्सेप्शन ई) {e.printStackTrace (); }} प्राइवेट व्यर्थ प्रोसेस कॉमांड () इंटरवर्टेड एक्सपेशेशन फेंकता {count ++; System.out.println ("गणना" + गणना); //Thread.sleep(500); } @ ओवरराइड सार्वजनिक स्ट्रिंग toString () {this.command लौटें; } सार्वजनिक int getCount () {वापसी गणना; }}  

    मैं 2000 के रूप में गिनती का परिणाम प्राप्त करने की कोशिश कर रहा हूं और वह भी अंत में ... मेरे कोड में क्या गलत है ?? कैसे मैं यह सुनिश्चित कर सकता हूं कि गिनती हमेशा सही क्रम में बढ़ी है ?? मुझे अस्थिर या सिंक्रनाइज़ किए गए ब्लॉक या दोनों का उपयोग कब करना चाहिए ??

    आप इस पर सिंक्रनाइज़ कर रहे हैं। लेकिन जब आप ऐसा करते हैं, तो आपको प्रत्येक WorkerThread लॉक करना होता है, जो उत्पादक नहीं है।

    विधि processcommand विधि परमाणु नहीं है, इसलिए आउटपुट आदेश से बाहर आओ इसके अलावा, वेतन वृद्धि भी परमाणु नहीं है; इसे मान पढ़ना, मान बढ़ा देना चाहिए, और मान को वापस चर में संग्रहीत करना होगा।

    बनाना count अस्थिर केवल यह सुनिश्चित करता है कि एक अद्यतन मान

    यदि आप एक ऑब्जेक्ट को सभी थ्रेडों में सिंक्रनाइज़ करते हैं ( WorkerThread.class यहां काम करेगा), फिर प्रत्येक थ्रेड अपडेट हो जाएगा और सुरक्षित रूप से प्रिंट कर देगा।

      सिंक्रनाइज़ (वर्करट्रेड। क्लास) {processCommand (); }  

    यदि आप ठीक से ऊपर सिंक्रनाइज़ करते हैं, तो अस्थिर यहां आवश्यक नहीं है, हालांकि यह कुछ भी चोट नहीं पहुँचाएगा; गिनती तक पहुंच पूरी तरह से नियंत्रित है।

    ध्यान दें: प्रश्न के लिखित में 2000 20000 ; यह अब प्रासंगिक नहीं है।

    साथ ही, 20000 प्राप्त करने के लिए, आप शायद 20000 कार्य करना चाहते हैं; वे प्रत्येक एक बार मान बढ़ाते हैं।

      के लिए (int i = 0; i & lt; 20000; i ++) { 

    node.js - Runnig two instances of a script in forever.js -


    Is there no way to run two or more instances of the same node script forever? If not, what is the best tool for that?

    The best tool to run (at this time) is the same node process forever.

    npm i pm2 -g

    Start pm2 app.js -i 2

    This will run two instances of the same app, even if your app opens the same ports pm2 uses both instances of the network to route network connections, to disturb you about clustering Not required, just open any port and it will work.


    javascript - Delegated events don't work in combination with :not() selector -


    I want to do something on all clicks except a certain element

    I have made a very simple example which shows this issue:.

    My code:

      $ ('body'). 'Click', ': no ​​(a)', function () {// do stuff});  

    I hope every click on & lt; A & gt; will not be taken into account, but this is not the case.

    Am I doing something wrong or is this a bug in favor of jQuery?

    There's a lot going on in that code, it's not natural Most importantly, the click event is actually linked to the body element, since this element is not an anchor, so you will always receive a warning. (The event delegation works because click event bubbles from a through all of their ancestors, which includes body This does not reach the document. .)

    Check what you want to do. He will tell you the element which was actually clicked, but the actual click event is still bound to the body element:

     < Code> $ (': no ​​(a)')) (click on the alert ('one click has been found), function (e) {// E = event item if ($ (e.target)');} });  


    OpenCV c++ assertion failed <i < 0> in cv::_InputArray::getMat -


      #include & lt; opencv2 / core / core.hpp & gt; #include & lt; opencv2 / imgproc / imgproc.hpp & gt; #include & lt; opencv2 / highgui / highgui.hpp & gt; #include & lt; opencv2 / video / background_segm.hpp & gt; # शामिल करें & lt; iostream & gt; # शामिल & lt; windows.h & gt; नामस्थान cv का उपयोग करना; नेमस्पेस एसटीडी का उपयोग करना; // आरंभिक न्यूनतम और अधिकतम एचएसवी फिल्टर मान // यह ट्रैकबर्स का उपयोग करके परिवर्तित किया जाएगा Mat Src; चट एचएसवी; मैट रोइ; चटाई रेंज; चटाई टूट गई; Mat ग्रे; इंट थ्रेश = 100; Int max_thresh = 255; / ** @ फ़ंक्शन मुख्य * / इंट मुख्य (इंट आर्जैक, चार ** argv) {createTrackbars (); वीडियो कैप्चर कैप (0); // डिफॉल्ट कैमरा खोलें अगर (! Cap.isOpened ()) // जांचें कि क्या हम वापसी -1 सफल हुए हैं; नामांकित विन्डो ("पृष्ठभूमि", 1); इंट प्रतीक्षा टाइम = 50; इंट काउंटर = 101; इंट रोली = 20; इंट roiTop = 50; इंट roiRight = 200; इंट आरिबॉटम = 200; रीट्र आरआरओई = रीकट (रोइलाफ्ट, रॉयोपॉप, रोइराइट, रॉयबॉटम); चटाई पृष्ठभूमि; कैप & gt; & gt; पृष्ठभूमि; पृष्ठभूमि = पृष्ठभूमि (आरआरओई); // cvtColor (पृष्ठभूमि, पृष्ठभूमि, CV_BGR2HSV); // imshow ("पृष्ठभूमि", पृष्ठभूमि); वेक्टर के & lt; वेक्टर & LT; प्वाइंट & gt; & Gt; आकृति; वेक्टर & lt; vector & lt; सीवी :: प्वाइंट & gt; & gt; पतवार (1); वेक्टर के & lt; Vec4i & gt; पदानुक्रम; वेक्टर के & lt; CvConvexityDefect & gt; दोष के; जबकि (सच) {कैप & gt; & gt; src; // रुचि के क्षेत्र बनाएँ। मट आईआरआईआई = एसआरसीक्लोन () (आरआरओई); चटाई iRoiSRC = src (आरआरओई); // वहां एक आयताकार बनाएं आयत (स्रोत, आरआरओआई, स्केलर (255, 128, 0), 1, 8, 0); // imshow ("roi", iRoi); // स्थैतिक पृष्ठभूमि को घटाना Absdiff (iRoi, पृष्ठभूमि, iRoi); // imshow ("diff", iRoi); // इसे ग्रेस्केल में कनवर्ट करें और इसे थ्रेसहोल्ड करें CvtColor (iRoi, iRoi, सीवी_BGR2GRAY); थ्रेशोल्ड (आईरोइ, ग्रे, 15, 255, सीवी_ DHRESH_BINARY); // एक समापन प्रदर्शन करें चटाई erodeElement = getStructuringElement (MORPH_ELLIPSE, आकार (erodeSize, erodeSize)); चटाई एलेमेंट = मिलनस्ट्रेटिंग एलेमेंट (एमओआरपीएच_आईएलआईपीईई, साइज (फैलाइएट साइज़, फैलाइएट साइज़)); (इंट इंडेक्स = 0; इंडेक्स एंड लेफ्टिनम; लूप एमाउंट; इंडेक्स ++) के लिए (इरोड (ग्रे, ग्रे, एरोड एलेमेंट); फैलाना (ग्रे, ग्रे, एलेमेंट पतला); } // imshow ("श्रेणी", ग्रे); // प्रतिरूप खोजें FindContours (ग्रे, आकृति, पदानुक्रम, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE, बिंदु (0, 0)); // सबसे बड़ा समोच्च चुनें इंट सबसे बड़ा सेंसर इंडेक्स = 0; Int बड़ाएरिया = 0; के लिए (int i = 0; i & lt; contours.size (); i ++) {if (contours [i]। आकार ()> सबसे बड़ा एरेया) {सबसे बड़े एरे = आकृतियाँ [i]। आकार (); सबसे बड़ा कंटूर इंडेक्स = i; }} वेक्टर & lt; int & gt; hullsI; वेक्टर के & lt; प्वाइंट & gt; hullsP; वेक्टर के & lt; Vec4i & gt; दोष के; // उत्तल पतवार खोजें If (contours.size () & gt; 0) {convexHull (रूपरेखा [सबसे बड़ा कॉंटोर इंडैक्स], hulls I, true, true); ConvexHull (समोच्च [सबसे बड़ा कॉन्टोर इंडैक्स], hullsP, सच है, सच); } // उत्थान दोष मिल If (contours.size () & gt; 0) {if (contours [biggestContourIndex]। आकार ()> 3) {convexityDefects (contours [सबसे बड़ा कॉंटोर इंडैक्स], hullsI, दोष); }} // सबसे बड़ा समोच्च और उसके उत्तल पतवार को ड्रा करें स्केलर रंगऑन = स्केलर (255, 128, 0); स्केलर रंग दो = स्केलर (0, 0, 255); If (contours.size ()> gt; {drawContours (iRoiSRC, contours, सबसे बड़ा कॉंटोर इंडेक्स, रंगीन, 2, 8, पदानुक्रम, 0, बिंदु ()); ड्रा कैंटर्स (आईआरआईएसआरसी, हल्प्स पी, 0, रंग दो, 1, 8, वेक्टर & lt; Vec4i & gt; (), 0, प्वाइंट ()); आयत (iRoiSRC, बाउंडिंगराइट (प्रतिरूप [सबसे बड़ा कॉन्टोर इंडैक्स]), स्केलर (0, 255, 0), 1, 8, 0); } Imshow ("src", src); अगर (इंतजार करें (प्रतीक्षा समय) & gt; = 0) तोड़; } वापसी (0); }  

    स्क्रीन के ऊपरी भाग में एक आयताकार होता है, जहां एक बार मैं उसे पकड़ कर एक बार पहचाना जाएगा।

    मुझे जो त्रुटि मिलती है वह पहले drawContours पर दिखाई देती है। कंसोल द्वारा मुझे पूरी त्रुटि दी गई है: OpenCV त्रुटि: प्रविष्टि विफल & lt; i & lt; 0 & gt; Cv :: _ InputArray :: getMat, फ़ाइल C: \ buildslave64 \ win64_amdoc1 \ 2_4_PackSlave-win64-vc11- साझा \ opencv \ modules \ core \ src \ matrix.cpp, पंक्ति 963

    मैं स्टेक ओवरफ्लो सहित कई साइटों पर एक समाधान के लिए बड़े पैमाने पर खोज कर रहा हूं, लेकिन समाधान में से कोई भी काम नहीं कर रहा है।

    किसी भी मदद की सराहना की जाएगी।

    मैं विज़ुअल स्टूडियो 2013 का उपयोग करता हूं OpenCV-2.4.10 के साथ

    कनवर्टिंग vector & lt; CvConvexityDefect & gt; दोष, एक बिंदु के लिए चाल को लग रहा था


    algorithm - Paul Erdos Conjecture [Java] -


    I'm trying to solve this one simple problem at SPOJ.

    It needs a number of prime numbers (less than N) which can be expressed as X ^ 2 + Y ^ 4 (where x and y are integers).

    I've killed an animal force, which takes a lot of time (n ~ = 1000000), which results in a TLE (time limit exceeded) error being thrown by the engine. Here is the source code:

      import java.io. *; Import java.util. *; Class HS08PAUL {Public Stable Ent [] Sieve (Int N) {Boolean [] Prime = New Bullion [N + 1]; Int [] primeNumbers = new int [n]; Int index = 0; Arrays.fill (primeNumbers, 0); Arrays.fill (prime, true); Head [0] = wrong; Head [1] = wrong; Int m = (int) Math.sqrt (n); For (int i = 2; i & lt; = m; i ++) {for (s [i]) (int k = i * i; k & lt; = n; k + = i) prime [K] = false; } For (int j = 2; j & lt; = n; j ++) {if (principal [j]) {primeNumbers [index] = j; Index ++; }} Return primetime; } Public static zero main (string [] args) {scanner = new scanner (System.in); {Try Double Number Opt Cascus = in.nextDouble (); While (Number of test cases -> 0) {int index = 0, y = 0, count = 0; Int num = in.nextInt (); Int [] primes = sieve (number); While (index and lieutenant; number / 3) {for (y = 1; y & lt; 57; y ++) {if (Math.ceil (Math.scrt (primes [index] - Math.pow (y, 4 )) == math.flur (mathematics.sqrt (primes [index] - Math .pow (y, 4))) {count ++; break; }} Index ++; } System.out.println (calculation); }} Hold (exception e) {}}}  

    Is there any way I can work this approach?

    PS: Please ignore uncontrolled exception handling.

    How many numbers are x ^ 2 + y ^ 4 below 1000000? How many prime numbers are less than 1000000?

    @ isnot2bad's comment is also relevant.


    Newline characters in CSV Data URI not showing up -


    I have a CSV data

      column 1, column 2, column 3 data 1 , Data 2, Data 3 Data 1, Data 2, Data 3  

    I'm in the form of a Z-variable, which is similar to HTML in the form of a fully interpolated string, And I get it in the a link

      Var link = document.getElementById ('link'); Var data = 'column1, column2, column3 \ n \ rdata1, data2, data3 \ n \ rdata1, data2, data3'; Link.href = 'Data: Text / CSV' + Data;  
      & lt; Id = "I used javascript to insert data here for the demo" link = "download =" data csv "> download & lt; / a & gt;  

    , but I'm actually using Z as server side: (I do not think it separates in any way ..)

     The problem is that it is not of new characters. (/ [\ R \ n] /, \ "\" \ R \ n ')} download "download =" data.csv ") downloading. When I download the file I do not have a new letter in it. 

    In fact, the wiki says that

    If I do not misunderstand, So it is possible that this is possible.

    Is the new lining of CSV download in the data URI format probably not possible, or is there any way I can remember?