Thursday, 15 January 2015

ios - Distribute iPhone App by Carrier -


One way Google's Developer Console is by way of delivering apps by the carrier. I'm trying to find the same thing for iTunes Connect. I need to make sure that T-Mobile users can not download my app. Is there any way of doing it? Nothing in the document can be found.

Sorry but this is not the only way that you can limit your app to the country of distribution. Are there.

swing - How to get Clojure exception notification when they happen on the EDT? -


I've just been scratching my hair for a long time so I could not find it. This became an exception exception, but apparently because it happened on ADT, I could not "see" it. When run from the terminal it was not shown in the "Lean Run" terminal and when running from AMCS, it was not shown in any AMACS buffer.

After a very long time I ended up doing this:

  (try (function-call-in-error-error ...) (Exception e (Printen e)   

And finally, thanks, I have been printed it:

  # & lt; ArityException clojure.lang.ArityException: incorrect The numbers were passed ...   

and so I can find my error.

And if I do this:

  (do not println "try ...") (arity-   

then the terminal print "trying ..." But never goes to "done ..." .

I tried to set a default exception exception handler: The exception is not being caught, such a program or EDT Hrithik was "stuck" after the exception (without printing anything).

How can I deal with this next time? Because I could not find any message anywhere because I took a long time to find out Once again: nothing in 'Lean Run' terminal and in any AMACS buffer Nothing.

What I should be made a function that should call for the catch / hold manually EDT and then log / Printlain exception?

Also note that this is a relatively "long" closure app: 1000 lines of code, so I can not paste it here and I do not reproduce that behavior in a small instance Could (but it is consistent in my app)

You can register an ineligible exception handler with a thread so that you can have all the eDT No need to wrap the calls.

  • Trying to enter one with the EDT and seeing that it gives you the desired behavior.

Core data iterate over fetchrequest in chunks with setFetchLimit only processing half the records -


I'm trying to process several objects in a certain size (batch section). This loop starts working, but it only processes half of the records. The relevant piece of code is:

  {// database to prepare the product without images in NSFetchRequest * productFetchRequest = [NSFetchRequest fetchRequestWithEntityName: @ "product"]; // Sort first according to final converted photo NSSortDescriptor * sortDescriptor = [[NSSortDescriptor alloc] initWithKey: @ "photoModificationDate" ascending: no]; [ProductFetchRequest set certificatescript: @ [sortedcriptter]]; NSPredicate * predicate = [NSPredicate predicateWithFormat: predicateString]; [ProductFetchRequest set pediatry: counting]; // Get the total count first NSUInteger numberoffproducts = [self.backgroundMOC countForFetchRequest: productFetchRequest error: & amp; Error]; NSLog (@ "Receiving images:% D product", numberoffproducts); // Set the batch size to get the amount of data nsuenter batch size = 25; [ProductFetchRequest setFetchBatchSize: batch size]; [ProductFetchRequest setFetchLimit: Batch Size]; // Get the products in batch (NSUINTER offset = 0; offset & lt; numberofproducts; offset + batch size) {@autoreleasepool {{productFetchRequest setFetchOffset: offset]; NSArray * products = [self.backgroundMOC executeFetchRequest: productFetchRequest error: & amp; Error]; NSLog (@ "Offset:% D, Number of Products:% d", Offset, [Product Count]); If (! Products) {do not return; } (Products in the product * product) {nslog (@ "download photo for product:% @", product.number); [Self-download endorseproduct: product]; } [Self-saving and resetback mouc]; }} Yes return;   

}

}

The log shows that for the first half of the count (numberOfProducts), it acts as expected, so that part of 25 products is processed is. After that first half, there are 0 records as a result to bring in the loop. If I try the same code again, then only half of the remaining record is processed, so the total 3/4 What am I doing wrong? Note that the managed object contact is not saved only, but it also resets the save after saving for saving. If I do not do this, the program crashes properly after downloading about 3000 pictures.

First point: There may be some basic misconception that fetchLimit and fetchBatchSize

fetchLimit and fetchoffset determine how many records are received < P> fetchBatchSize indicates how many records are retrieved during a visit to the continuous store. In this case, the result of 4 visits will be for 100 million, one fetchBatchSize store in 25 stores (with or without fetchBatchSize ). (In other words, 4 executed SQL statements for specific SQLite stores. However, this is all behind the scenario.)

In this way, code snippet

  request. FetchLimit = X; Request.fetchBatchSize = x;   

The number of visits to the store will always be in a way.

The other point: I'm not sure that your setup with the second MOC is very understandable. I think you are already in a background thread. As far as I know that resetting the MOC is quite expensive. This is not really necessary if you disable the undo manager of the MOC. For looping, I believe you can get all the records and take care of fetchBatchSize discrete "chunking". Due to defective behavior of core data, your @autoreleasepool will only bring limited benefits in the loop

@autoreleaspool useful when you download images It is probably enough to batch this part of the process.

It is being said, you may not want to change the thing that is (working).

Third point: You calculate the number of records based on an unknown (for us) prediction string. Is it dynamic? Not sure whether this is also not part of the problem. After all, it does not know what it is, it is amazing that the number of records changes.

Finally: Check whether you can do without resetting your MOC.

c++ - Handling #ifdef's that were used to create multiple versions of an algorithm -


I am trying to benchmark several (approximately 25) variations of the algorithm written in C ++

I have implemented these methods using a combination of three methods:

  1. To copy and make minor changes to the copied version <

  2. using #ifdef s to switch between the snippets of code

    Variations arising from options 1 and 2 are OK Because I can select which variation of the algorithm in the configuration file, I can then iterate through different configuration files and keep a record of "configuration: result" pair - keeping these records very important for my work is.

    Let me currently #ifdef s because I have to compile more than one version of code to access these variables, to run automated experiment scripts and It is very difficult to keep accurate records. However, #ifdef s is very useful because if I get a copy of the code in error, then I do not have to remember to correct this mistake to improve many copies.

    #ifdef has extended six forms, which I have both copied code and 24 total variations (4 variations for each basic change) both sub-closing Created by

    Here's an example - Mostly I am using #ifdef s to avoid duplication of code:

      .... double lasso_gam = * gamma; * Lasso_idx = -1; For (int aj = 0; aj & lt; (int) a_idx.size (); aj ++) {int j = a_idx [aj]; Emphasis (J & lt; = C * L); Double Inc = W [AG] * (* Gamma) * Icon [AJ]; If ((beta_sp (j)> gt; 0 and beta_sp (j) + inc <0) #ifdef ALLOW_NEG_LARS || (beta_p (j) <0 & amp; beta_p (j) + inc & gt; ; 0) # other || (beta_p (j) == 0 and BBA_SP (J) + Ink & Lt; 0) #Endif) {double TMP_Gim = = BITASP (J) / WA [AJ] * Icon [AJ]; If (tmp_gam> = 0 & amp; amp; tmp_gam & lt; lasso_gam) {* lasso_idx = aj; * Next_active = j; Lasso_gam = tmp_gam; }}} If (lasso_idx> = 0) {* gamma = lasso_gam; }.   

    Question: What is the best way to allow multiple variations of the algorithm, which is currently available in #ifdef A configuration file is given to run s, which specifies the difference in how to run the algorithm.

    Ideally, I want to compile the code only once and use the config file to select algorithm variation on the runtime.

    If your #if s is scattered all around and one The row changes the code, or here its all the #if s is changed on the basis of the ANIM run in the function in if s, for which the variation can be run and Hope the compiler does a great job optimizing on optimization to decide to run it, leaving the single run time condition apart from the function And defined to be roughly the same code. No promise

    If you add a block of code to the #if algorithm, then you divide the algorithm into smaller functions, which can call different implementations of your different algorithm. This is clearly impractical if your #if s is so intrusive that you will end up with 50 functions.

css - 'Invalid property value' in Div background-color -


मैं एक बूटस्ट्रैप उदाहरण का उपयोग करता हूं:

निम्न कोड navbar- आंतरिक div में डाला जाता है:

  & lt; div वर्ग = "लोगो" & gt; & Lt; div class = "quadratlogo" & gt; & amp; nbsp; & lt; / div & gt; & Lt; / div & gt;   

इस रूप में स्टाइल:

  .logo {font-size: 24px; फ़ॉन्ट-परिवार: 'एरियल'; न्यूनतम चौड़ाई: 500 पिक्स; } .quadratLogo {width: 24px; ऊँचाई: 20px; सीमा-त्रिज्या: 0 पिक्सेल 4px 0px 4px; पृष्ठभूमि रंग: ff0000; बाईंओर तैरना; }   

क्या आप बता सकते हैं कि क्यों quadratLogo div अदृश्य है और क्रोड द्वारा पृष्ठभूमि के रंग की संपत्ति quadratLogo को अनभिज्ञ के रूप में देखा जाता है?

यह एक मान्य रंग है - लेकिन आप हेक्स मान से पहले एक # प्रतीक को शामिल करना भूल गए हैं।

  क्वाडराट लोगो {चौड़ाई: 24px; ऊँचाई: 20px; सीमा-त्रिज्या: 0 पिक्सेल 4px 0px 4px; पृष्ठभूमि रंग: # एफएफ 0000; / * -------- ^ * /}    

Exporting SSL Certificate in Linux Browser (or Linux Command Line) for Java Certificate Truststore -


पृष्ठभूमि:

मुझे एक वेब सेवा के साथ परेशानी हो रही है कोल्ड फ्यूजन 9 (सहकर्मी प्रमाणित नहीं है)।

सबसे पहले, मैं कोशिश करूँगा अगर वह काम नहीं कर रहा है, तो मैं कोशिश कर रहा हूं।

लेकिन मेरे प्रश्न अधिक विशिष्ट हैं ...

प्रश्न:

मैं क्रोम (या लिनक्स सीएलआई) में प्रमाणपत्र (सही स्तर पर) कैसे निर्यात कर सकता हूं, और किस प्रारूप में?

विवरण

मैंने ब्राउज़र से एक प्रमाणन निर्यात करने के लिए कुछ निर्देश देखे हैं, लेकिन वे IE (पुराने संस्करण, उस पर) के लिए हैं, और मैं क्रोम का उपयोग करना पसंद करता हूं, क्योंकि मैं लिनक्स पर हूं।

  • "कनेक्शन" टैब (इस वेबसाइट की पहचान "दिखाता है"
  • "विवरण" टैब पर क्लिक करें

  • "प्रमाणपत्र सूचना लिंक" : //i.stack.imgur.com/CiaYb.png "alt =" क्रोम के प्रमाणपत्र निर्यात संवाद का स्क्रीन शॉट ">

    वहां से, मैं चार स्तरों में से एक पर निर्यात करने में सक्षम हूं:

    • अंतर्निहित ऑब्जेक्ट टोकन: थॉएट प्रीमियम सर्वर सीए
    • प्राथमिक रूट सीए thawte
    • Thawte SSL CA
    • sb1.geolearning.com

      कौन सा उपयुक्त है?

      इसके अलावा, "प्रमाण पत्र को विशिष्ट रूप से X.50 9 प्रमाणपत्र होना चाहिए एन्कोडिंग रूल्स (डीईआर) प्रारूप। ", और क्रोम के निर्यात डायलॉग इन विकल्पों की पेशकश करता है:

      • बेस 64-एन्कोडेड एएससीआईआई, एकल प्रमाणपत्र
      • बेस 64-एन्कोडेड एएससीआईआई, प्रमाण पत्र श्रृंखला
      • डीईआर-एन्कोडेड बाइनरी, एकल प्रमाणपत्र
      • पीकेसीएस # 7, एकल प्रमाण पत्र
      • पीकेसीएस # 7, प्रमाणपत्र श्रृंखला
      • सभी फाइलें

        मुझे लगता है "डीईआर-एन्कोडेड बाइनरी, एकल प्रमाणपत्र" उचित है?

        एक ब्राउजर के साथ

        निम्नलिखित एक प्रमाण पत्र जेनरेट कर रहा है जिसे मैं कुंजी टोल का उपयोग करके आयात कर पा रहा था:

        • स्तर: sb1.geolearning.com
        • फ़ाइल टाइप: डीईआर-एन्कोडेड बाइनरी, एकल प्रमाणपत्र

          भावी पीढ़ी के लिए, यहां आयात करने के लिए उपयोग की जाने वाली कमान थी:

            sudo keytool -import -keystore / opt / Jrun4 / jre / lib / security / cacerts -alias "sb1.geolearning.com (Thawte एसएसएल सीए) "-स्टोरेपास चेंटीट -नॉपमार्प्ट -ट्रस्टकैक्ट -फ़ाइल ~ / डाउनलोड / एसबी 1.एजोलैर्निंग.कॉम   <एचआर> 

          ब्राउज़र के बिना

          इन दिनों कर रहे हैं (एक आवेश प्रावधान में)। इस स्क्रिप्ट में, कीस्टोर हार्ड-कोडेड है, क्योंकि मैं इसे केवल लुसे के लिए प्रयोग कर रहा हूं, इस समय; हालांकि, जिस पथ को मुख्यतः आसानी से पैरामीटेट किया जा सकता है इसके अलावा, runfile संबंधित कोड बस इतने उग्र है कि स्क्रिप्ट को एक से अधिक बार नहीं चलाया जाता है; उन पंक्तियों की ज़रूरत से ज़्यादा ज़रूरत नहीं है यदि आप कोड को वग्रेंट प्रावधान के रूप में उपयोग नहीं कर रहे हैं।

          उपरोक्त समाधान से वास्तव में यह अंतर करता है कि यह openssl s_client (और इसे sed से साफ़ करता है) इसके बजाय ब्राउज़र के माध्यम से मैन्युअल रूप से ऐसा करने से।

            #! / Usr / bin / env bash set -e description = " लुसे की कीस्टोर को प्रमाणित करें। " जबकि: $ 1 में प्रोजेक्ट-डीआईआर = *) प्रावधान_आकार = $ {1 # * =} # "" = "बदलाव तक सबकुछ हटाना ;; --runfile-name = *) runfile_name = $ {1 # * =} # "=" शिफ्ट तक सब कुछ हटाना ;; --साइट-होस्ट-नाम = *) site_host_name = $ {1 # * =} # "=" शिफ्ट तक सब कुछ हटाना ;; - *) गूंज "चेतावनी: अज्ञात विकल्प (उपेक्षित): $ 1" & gt; और 2 बदलाव ;; *) # और अधिक विकल्प नहीं। लूप ब्रेक के दौरान बंद करो ;; Esac किया runfile = "$ {provisioned_dir} / $ {runfile_name}" अगर [-f "$ {रनफाइल}"]; फिर "$ {description} एको": पहले से ही चल रहे हैं। " बाहर निकलें 0f ईको "कुंजीस्टोर में प्रमाण जोड़ें" echo -n | \ Openssl s_client-connect $ {site_host_name}: 443 \ | Sed -ne '/ -जैग सर्टिफिकेट - /, / - एंड सर्टिफिकेट- / पी' \ & gt; /tmp/${site_host_name }.cert / opt / lucee / jdk / jre / bin / keytool \ -import \ -keystore / opt / lucee / lib / lucee-server / context / security / cacerts \ -alias "$ {site_host_name} } (स्व-हस्ताक्षरित) "\ -storepass changeit \ -file /tmp/${site_host_name}.cert \ -noprompt \ || सच स्पर्श "$ {runfile}"    

  • android - How to populate SQLite databse with a .txt file? -


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

    • 1 उत्तर

      मैं एक एंड्रॉइड ऐप लिख रहा हूं । मेरे पास एक टेक्सटाइल फ़ाइल है जो मुझे एक SQLite डेटाबेस में डालने की आवश्यकता है। यह कैसे किया जा सकता है?

      कुछ बिंदुओं:

      • .txt फ़ाइल को अपने ऐप में संपत्ति के रूप में यह आपको इसे एसेटफ़ाइल डिस्क्रिप्टर के साथ खोलने की अनुमति देगा।
      • आपको .txt फ़ाइल से डेटा पढ़ना होगा और पंक्तियों को अपने डेटाबेस में सम्मिलित करना होगा। यदि आपके .txt फ़ाइल के प्रारूप पर कुछ नियंत्रण है, तो यह करना आसान है। उदाहरण के लिए, यदि आप मूल्यों के बीच अल्पविराम सम्मिलित कर सकते हैं, और प्रत्येक पंक्ति के मूल्य के डेटा के अंत में एक लाइन फ़ीड डालें।
        • आवश्यक होने पर लेनदेन का उपयोग करें।
        • पृष्ठभूमि थ्रेड पर कार्रवाई करें मैं एक IntentService का उपयोग करने का सुझाव देता हूं।