Posts

ios - NSCFData gunzippedData crash -

i integrating payu in swift 2 based project using sample code source link: https://github.com/payu-intrepos/ios-sdk/releases/tag/v3.3 the app crashes following log in console, when payu webview code class payuuipaymentuiwebviewcontroller executed: webviewdidstartload url-----> 2016-01-07 19:07:59.788 mytestapp[14764:2080307] -[__nscfdata gunzippeddata]: unrecognized selector sent instance 0x7f80395de440 2016-01-07 19:07:59.809 mytestapp[14764:2080307] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscfdata gunzippeddata]: unrecognized selector sent instance 0x7f80395de440' it unhandled exception. know means? cause of it? in xcode project add "-objc" in other linker flags in project build settings.

How can I extend ActiveRecord::Associations to a frozen_record in rails -

i'm using frozen record gem in rails upload yaml file containing fixed questions app. once they're uploaded want use salequalifier model grab each question, associate answer, , use state machine move through question tree. i've got frozen record gem working , yaml file uploads fine. when tried associating model new model (salequalifier) got 'method_missing': undefined method 'belongs_to' question:class (nomethoderror) as result added include activerecord::associations components in order let me associate new record salequalifier question belongs_to :sale_qualifier - throws: 'method_missing': undefined method 'dangerous_attribute_method?' question:class (nomethoderror) according search, error thrown when i've declared method beforehand. don't know defined, frozen_record gem files can see set frozenrecord following: module frozenrecord class base extend activemodel::naming include activemodel::conversion include a...

c# - SignalR Memory Leak -

Image
we have asp.net webapi signalr hub running on 2 servers redis backplane. typically our api consumes 3gb - 4gb of memory happens, there hugh memory spike 20gb. dont know reason yet, assume, can happen when there connection issues redis (it rare). i analyzed dump file , found following hints: to honest, dont understand it. seems has exception handling, dont understand why byte arrays big. i looking ideas how solve , have hope, had same issue.

Checking off pdf checkbox with itextsharp -

Image
i've tried many different ways, can't check box checked! here's i've tried: var reader = new itextsharp.text.pdf.pdfreader(originalformlocation); using (var stamper = new itextsharp.text.pdf.pdfstamper(reader,ms)) { var formfields = stamper.acrofields; formfields.setfield("isno", "1"); formfields.setfield("isno", "true"); formfields.setfield("isno", "on"); } none of them work. ideas? you shouldn't "guess" possible values. need use value stored in pdf. try checkboxvalues example find these possible values: public string getcheckboxvalue(string src, string name) throws ioexception { pdfreader reader = new pdfreader(src); acrofields fields = reader.getacrofields(); // cp_1 name of check box field string[] values = fields.getappearancestates("isno"); stringbuffer sb = new stringbuffer(); (string value : values) { sb.append(v...

cordova - Error when deploy a windows 7 app into emulator -

i developed app jquery mobile , compiled phonegap build. when try install windows 7 emulator got error like error- installation of application failed. run time error has occurred. fix capabilities in wmappmanifest.xml file. here wmappmanifest.xml <?xml version="1.0" encoding="utf-8"?> <deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" appplatformversion="7.1"> <app xmlns="" productid="{80a42ce2-0c9f-39d1-a273-bb2e5bdbe855}" title="pg build app" runtimetype="silverlight" version="0.0.1.0" genre="apps.normal" author="xxxxxx@gmail.com" description="" publisher="xxxxxx@gmail.com"> <iconpath isrelative="true" isresource="false">applicationicon.png</iconpath> <capabilities> <capability name="id_cap_contacts" /...

java - Codename one: Why am I getting "/ by zero" when trying to scale an image -

i trying scale image fit screen width. therefore trying load imported multi image in beforeterminalgui method here: @override protected void beforeterminalgui(form f) { imageviewer iv = findimageviewer(f); image = fetchresourcefile().getimage("stillstand.png"); i.scaledwidth(iv.getwidth()); iv.setimage(i); } which created when clicked beforeshow event in gui builder. (i saved gui builder after doing so) but getting error: java.lang.arithmeticexception: / 0 @ com.codename1.impl.javase.javaseport.scalearray(javaseport.java:3505) @ com.codename1.impl.javase.javaseport.scale(javaseport.java:3497) @ com.codename1.ui.image.scale(image.java:961) @ com.codename1.ui.image.scaledimpl(image.java:931) @ com.codename1.ui.image.scaled(image.java:896) @ com.codename1.ui.image.scaledwidth(image.java:835) @ com.codename1.ui.encodedimage.scaledwidth(encodedimage.java:536) @ userclasses.statemachine.beforeterminalgui(statemachine...

How to find a value in a sorted vector (C++) -

i have searched solution problem, did not find answer. following code learning purposes. want erase elements value 3 in vector: std::vector<int> v{1,1,2,2,2,3,3,4,4}; i tried solve this: //only excerpt code iterator erase(t const& elem) { return v.erase(std::remove(v.begin(), v.end(), elem), v.end()); } but in test case, expect have iterator point value 4, in code points value 3. removes first 3 vector. how can remove both values "3", iterator returned points 4? thank help! although std::remove work, doesn't take advantage of fact container sorted. that, need find range contains of target values. this: #include <algorithm> #include <vector> void remove(std::vector<int>& vec, int value) { auto lb = std::lower_bound(vec.begin(), vec.end(), value); auto ub = std::upper_bound(vec.begin(), vec.end(), value); vec.erase(lb, ub); }