Posts

Showing posts from July, 2014

c# - How to avoid implementing empty constructors in derived classes? -

i have base class has large number of derived classes, , base class has several constructors. in derived classes have implement empty constructors forward arguments base constructors. possible somehow tell c# use derived constructors? for example, if using base class. class basetool { public basetool(string arg1, string arg2) { // stuff. } public basetool(string arg1) { // stuff. } public basetool(int arg1) { // stuff. } } i have implement above constructors arguments, , call : base(...) forward them derived class. resulting in lot of classes have empty constructors. seems lot of wasted code. constructors not inherited base classes, there no way around declaring constructors in each derived class. however, automate repetitive task with, example, t4 templates .

javascript - How to watch ng-html-bind from a directive? -

i'm trying watch content of ng-html-bind , modify div content auto link hyperlinks in div since original content not have hyperlink html. here plunker here directive app.directive('autolink', ['$compile', '$timeout', function ($compile, $timeout) { return { restrict: 'ea', replace: true, link: function (scope, element, attrs) { $timeout(function () { var text = element[0].innerhtml; var linktypes = ["http://", "https://"]; linktypes.foreach(function (linktype) { var startspace = 0; while (startspace >= 0) { text = element[0].innerhtml; var locationofhttp = text.indexof(linktype, startspace); if (locationofhttp < 0) break; var locationofspace = text.indexof(" ", locationofhttp);

I need to get info from HTML table , java -

i'm trying create program read table in specific website , can data need. read jsoup , elements , tried implement read missing me table html code is <tr> <td valign="top" width="980px;"> <!-- start warranty results --> <!-- start warrantyresultsdetails --> <table class="ibm-data-table" summary="warranty results" border="0" cellpadding="0" cellspacing="0"> <caption><b>warranty information</b></caption> <thead> <tr> <th scope="col">type</th> <th scope="col">model</th> <th scope="col">serial number</th> </tr> </thead> <tbody> <tr> <td>8205</td> <td>e6c</td> <td>06202et</td> </tr> </tbody> <thead> <tr> <th scope="col">warranty status</th> <th sc

ruby on rails - Calculation in model or controller -

i'm builing weight loss app. in app each user has_one :profile , has_many :weights . each profile belongs_to :pal . app work need value called smr formula takes variables user's size, age , gender (all profiles table), user's current weight (from weights table) float number pal table. i able calculate smr in profiles_controller.rb show action , show in profiles show.html.erb. i have 2 questions now: is correct calculation in profiles_controller.rb show action or should in profile.rb model? if should in model: how can (how should code like)? i need smr value later on in app variable other calculations well. how can achieve (if calculated in profile controller/model needed somewhere else later on)? i'm new rails world maybe questions noob questions. profile.rb class profile < activerecord::base belongs_to :user belongs_to :pal belongs_to :goal def age if birthdate != nil = time.now.utc.to_date now.year - birthdate.year -

java - NPE when testing servlet with testNG and Mockito -

this question has answer here: what nullpointerexception, , how fix it? 12 answers everyone! have problem tests servlets refreshed test, npe @ line in servlet "session.setattribute("login", user.getlogin());" my servlet: @webservlet("/login") public class loginservlet extends httpservlet { private iuserdao dao; @override public void init() throws servletexception { dao = (iuserdao) getservletcontext().getattribute("users"); } @override protected void dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { httpsession session = request.getsession(); if (dao.isuserexists(request.getparameter(login), request.getparameter(password))) { user user = dao.getuser(request.getparameter(login)); session.setattribute("login", user.getlo

android - Error: cannot find symbol method canDrawOverlays(Context) -

sorry if blatantly obvious issue resolution. can't seem figure out how fix it. i'm importing. import android.provider.settings; and attempting run code snippet below in activities, application, broadcast receivers, etc. works fine in paid version of app. when copy code out free version , paste in(same machine, same sdk) compiler goes red. boolean candrawoverlays; if(build.version.sdk_int >= 23) { candrawoverlays = settings.candrawoverlays(getapplicationcontext()); } solved. blatantly obvious. save time , trouble in future of overlooked project setting. right click project. goto module settings. goto compile sdk version. set api level appropriate. in case @ level 19 , needed 23 candrawoverlays coming through. alternatively open project's build.gradle , set compilesdkversion there.

android - Gradle - how to capture Gradle Sync error message from build.gradle? -

Image
in android studio, when hit "gradle sync" button in toolbar: i can see gradle sync event logs: if gradle sync completes , error occurred, "messages gradle sync" window pops up: how capture "failed resolve" message?

difference between List<T> and List<T>=new List<T> in c# -

i sorry if question silly, new c# i want know exact difference between when create list variable this list<t> lststudents; and when create list this list<t>= new list<t>(); i found out if create variable without intializing object it, still able add new objects, if difference between 2 let me explain scenario code trying list<product> product = new list<product> { new product() { productid = 1, productname = "a" } , new product() { productid = 2, productname = "b" } , new product() { productid = 3, productname = "c" } , new product() { productid = 4, productname = "d" } , new product() { productid = 5, productname = "e" } }; now if add variable this

ios - Updating a CocoaPod -

i'm using googlemaps pod in xcode workspace. i followed https://developers.google.com/maps/documentation/ios-sdk/start#step_1_get_the_latest_version_of_xcode setup year ago. i've got new computer , when open workspace project get podfile.lock: no such file or directory manifest.lock: no such file or directory "the sandbox not in sync podfile.lock. run pod install or update cocoapods installation. i updated cocoapods installation. i ran pod update. , pod install. in both cases continue message says : ! dependency 'googlemaps' not used in concrete target. the podfile using: source 'https://github.com/cocoapods/specs.git' pod 'googlemaps' finally tried deleting podfile , pods folder , ran pod install , still error message. i've tried both platform ios target of 8.1 , 9.0. by reinstalling cocoapods on system, guess downloaded newer version of it, podfile syntax changed little bit, you're missing target, can read

c# - There is already a data reader open associated with this command even with MARS active -

i have exception telling me that: there datareader open associated command must closed first even mars enabled in connection string: data source=servername;integrated security=true;initial catalog=database;multipleactiveresultsets=true wasn't mars supposed remove limitation? i'm using c# , sql server 2008

AngularJS: refresh ng-options when property source object changes -

full description: have list of options multiple properties (not key-value pair): [ { id: 1, name: "111", some: "qqq" }, { id: 2, name: "222", some: "www" } ]; and select defined as: <select name="myselect" id="myselect" ng-options="option.name option in opts track option.id" ng-model="mod1"></select> depending on app logic, property may change: { id: 2, name: "222", some: "www1" } but actual list in select doesn't change! however, if name changes, entire optionlist refreshed. in short can see demo on jsfiddle or jsfiddle . prepared 2 similar examples: when button clicked property updates when button clicked - both property , key receive new value does know solution? update for i'm solving issue update + delay + update solution: this.click = function(){ $scope.opts = {}; $timeout(function()

ncurses - C++ code reduction for identical submenus -

i coding way last project of semester , have code duplication issue. using ncurses or pdcurses make menu interact user. the problem: each choice of menu(five in total) need submenu. submenu's difference main menu is, array of items printed, , parameters go functions, result of items array size. since need 5 submenus, need 5 times same code(six if add main menu). could of me make function same thing, i'll call 6 times create menu? here's code void menu(){ const char* items[]={ "[1]...new tax declaration", "[2]...modify tax declaration", "[3]...cancel tax declaration", "[4]...additional information", "[5]...exit" }; int cur=0; int ch, i; int flag=0; do{ werase(wm); mvwaddstr(wm, 2, 16, "menu"); for(int i=0; i<5;i++){ if(i==cur) wattr_on(wm, a_reverse, 0); mvwaddstr(wm, 4+i

python - Create copy of Oracle database table to another Oracle database using SQL -

i wondering if there simple way copy either entire oracle database table or data rows oracle database table (different databases). there type of way using sql language? initial thought use sql query this: insert outputtable select * username/password@instance.inputtable if not sql, there way this? trying automate task performing copy using sql developer or along lines not suffice unfortunately. trying using python. you can create dblink connect source , target db, use sql save data in linked db. something like: create database link "target" connect your_schema identified your_password using your_connection_string; once have dblink, can use plain sql, no matter involved tables on different db: insert your_table@target select * your_table

Run aggregate function in Postgresql stored procedure -

i have question running built in aggregate functions within stored procedure on postgres. i have query run function lot: select max(column_name) max_val, min(column_name) min_val, (column_name - min_val) / (max_val - min_val) my_value; i care final my_value parameter, , since need run method lot of columns i've been trying write stored procedure, can run select get_my_val(column_name); having trouble getting work correctly. here's along lines of have right (note, wrong , not work): create or replace function get_my_val(col varchar(32)) returns float $body$ begin return query execute '(' || col || ' - min(' || col || ')) / (max(' || col || ') - min(' || col || '))'; end $body$ language plpgsql; i think i'm using return query execute incorrectly. can give me push in right direction?

c++ - Eclipse "implement method" function will not work with a template class -

i have been using eclipse quite time, have used c++ programming. bunch of fun figuring out how actual compile c++ on eclipse on system, have figured out 100% success, have stumbled upon annoying issue. have seen if create class in header file can use nifty tool under source menu called "implement method" take function declarations header file , place them in source file body ready code. well today messing around new code , needed template class working on, behold when tried use implement method function find eclipse tells me there "no implement file found 1 or more methods" , instead creates inline function in header file (like need that!). bug in eclipse or there underlying c++ rule cannot avoided? dont seem understand why having class declration class foo{}; work fine, having template <typename t> class foo{}; causes error. know issue becuase if declare normal class 1 public function works, if take same class , declare template class find error occur

winforms - How can I fix item positions in my form in c#? -

Image
i'm trying make own monopoly game in c# visual studio have problems position of items. this how want see game resolutions: but when resize main window get: i have put buttons monopoly's properties, inside of panel inside of form fixed position adapted parent (the window), buttons aren't adapted parent (the panel) , want know how fix position autosize , autoposition themselves. the panel fixed in position tool dock set fill can't use tool buttons because has 5 different positions top, right, left, bottom or center , uses space.

Google Maps JavaScript API V3, plot array of Lat/Lon Points -

i'm trying create simple google map iterate through multi-dimensional array of lat/lon pairs , plot them. map display if for-loop commented-out. in advance. here code have: <script type="text/javascript"> function initialize() { var map; var mapoptions = { zoom: 9, center: new google.maps.latlng(39.03454, -94.587315), maptypeid: google.maps.maptypeid.roadmap, }; map = new google.maps.map(document.getelementbyid('body-space-inside'), mapoptions); var business_locations = [ ['south plaza', '5105 main st  kansas city, mo 64112', '39.03454', '-94.587315'], ['city market', '427 main street kansas city, mo 64105', 39.108518, -94.582635], ['barry road east', '221 northeast barry road kansas city, mo 64155', 39.246116, -94.57759], ['barr

json - Scala Spray Templated Custom Routing Directive -

okay so.... have this: def convertpost = extract { _.request.entity.asstring.parsejson.convertto[customclass] } private def myroute: route = (post & terminalpath("routeness")) { convertpost { req => detach() { thinghandler.getmyresults( req ) } } } but want template it, this: def convertpost[t] = extract { _.request.entity.asstring.parsejson.convertto[t] } private def myroute: route = (post & terminalpath("routeness")) { convertpost[customclass] { req => detach() { thinghandler.getmyresults( req ) } } } but doesn't work. using spray-json-shapeless . error error:(28, 50) cannot find jsonreader or jsonformat type class t _.request.entity.asstring.parsejson.convertto[t] ^ when try: def getstuff[t] = extract { _.request.entity.asinstanceof[t] // .convertto[t]

java - Class not able to recognize maven dependencies -

Image
i trying create maven project. added dependencies jar files , importing them in class. class doesn't recognize it. i tried couple of options , serached couldn't resolve. please guide. attached below screenshot of project str try this: right click project , select maven click update project . select project , select force update of snapshots/releases option. refresh project , build (if not see compilation error after updating).

python - Deserialize json/yaml from binary stream which contains other data -

suppose have binary stream stream , generate follows. stream.write('lol'.encode()) yaml.dump(some_obj, stream) stream.write('awesome'.encode()) then have write custom parser of sort stream or can recover some_obj follows. stream.read(3) recovered = yaml.load(stream) stream.read(7) if doesn't work yaml serialization, work json serialization? you cannot want because yaml parser consumes complete stream if dummp explicit end ( yaml.dump(some_obj, stream, explicit_end=true) (which insert ...\n before awesome ) , doesn't work when writing ---\nawesome (the document separator). yaml parser consumes word awesome ¹ both when use yaml.load() when use yaml.load_all() . the part front works fine, can consider doing like: import ruamel.yaml yaml file_name = 'test.comb' some_obj = dict(a = [1, 2], b = {3: 42}) open(file_name, 'w') stream: stream.write('lol'.encode()) yaml.dump(some_obj, stream, explicit_end=tr

python - Filter in Apache Spark is not working expected -

i'am executing code below: ordersrdd = sc.textfile("/user/cloudera/sqoop_import/orders") orderitemsrdd = sc.textfile("/user/cloudera/sqoop_import/order_items") ordersparsedrdd = ordersrdd.filter(lambda rec: rec.split(",")[3] in "canceled").map(lambda rec: (int(rec.split(",")[0]), rec)) orderitemsparsedrdd = orderitemsrdd.map(lambda rec: (int(rec.split(",")[1]), float(rec.split(",")[4]))) orderitemsagg = orderitemsparsedrdd.reducebykey(lambda acc, value: (acc + value)) ordersjoinorderitems = orderitemsagg.join(ordersparsedrdd) in ordersjoinorderitems.filter(lambda rec: rec[1][0] >= 1000).take(5): print(i) final results not getting displayed me, display stops @ condition. before join command able display records, after join data not getting displayed. error shown below: 16/06/01 17:26:05 info storage.shuffleblockfetcheriterator: getting 12 non-empty blocks out of 12 blocks 16/06/01 17:26:05 inf

javascript - How can I delay a function with parameter? -

this question has answer here: calling functions settimeout() 5 answers i trying make game, machine takes while respond, user knows machine 'deciding' move. need use settimeout() method, want specify parameter function. example: settimeout(myfunction('p'), 1000); . problem when specify parameter, function runs fine, there´s no delay. when write settimeout(myfunction('p'), 1000); , myfunction('p') evaluated , settimeout(returnvalueofmyfunction, 1000) evaluated. this code run anonymous function @ correct time: settimeout(function (){myfunction('p')}, 1000);

php - SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens error -

i got error on 2 of pages , can't understand why. have rewritten code , triple checked it, can't find wrong. the first 1 is: public function academics ($id,$problem_solving , $math_understanding, $cs_understanding , $math_useful , $cs_useful, $math_ava, $cs_ava, $assigment_start, $assigment_submit, $travel_time, $stress,$assigment_when, $full_part, $pair_programming, $attending_class, $attending_labs,$attending_tutorials, $extra_reading, $p_progamming, $q_cs, $q_maths, $procrastinating_assigments, $procrastinating_studying){ try{ $stmt = $this->db->prepare("update student_data set problem_solving=:problems, math_understanding=:math_u, cs_understanding=: cs_u, math_useful =:m, cs_useful=:cs_u, math_ava=:ma, cs_ava=:ca, assigment_start=:ass_st, assigment_submit=:assigment_submit, travel_time =:travel_time, stress=: stress, assigment_when =:assigment_when, full_part =:full_part, pair_programming=: pair_programmin

c++ - const-reference binding to a temporary -

consider following: string const& name1 = get_name(...); string const name2 = get_name(...); where get_name returns string object. known, introduction of move-semantics in c++11, both statements can efficient, first 1 being more since move not need made. (yeah, know return-value optimization, it's more nuanced. general idea.) however, suppose function calls left out of this: string const& name3 {"billy"}; string const name4 {"debbie"}; in case, string-literal "billy" implicitly converted temporary string , , name3 binds temporary. obviously, name4 not temporary. is true name3 , name4 , both equally efficient? seems me be... name3 , name4 indistinguishable rest of program, unless use decltype(name3) or decltype(name4) . so compiler can generate same assembly both cases. of course, general statement; individual compiler may generate slower or faster code , way find out try on compiler.

jquery - C# - HiddenField values changes after Button Click -

i have form captures few information and, using jquery, checks against database if company exists , sets hiddenfield value of yes or no. textbox input follows <asp:textbox id="txt_companyname" runat="server" cssclass="quote-contact-textbox-style" placeholder="company name" required="required"></asp:textbox> jquery code check if company exists $('#<%=txt_companyname.clientid%>').blur(function () { $.ajax({ url: 'fetch/verifyifcompanyexists.aspx', data: { companyname: $('#<%=txt_companyname.clientid%>').val(), }, success: function (result) { var data = result.split('|'); if (data[0] == "red") { alert('this company exists in crm'); $('#<%=hdn_custalreadyexists.clienti

Javascript Clock - Line break -

this current code i'm using clock (from tutorial), , i'm wondering if there way make time appear above date? function rendertime(){ // date var mydate = new date(); var year = mydate.getyear(); if(year < 1000){ year +=1900; } var day = mydate.getday(); var month = mydate.getmonth(); var daym = mydate.getdate(); var dayarray = new array("sunday","monday","tuesday","wednesday","thursday","friday","saturday"); var montharray = new array("january","february","march","april","may","june","july","august","september","october","november","december"); // date end // time var currenttime = new date(); var h = currenttime.gethours(); var m = currenttime.getminutes(); var s = currenttime.getseconds(); if( h == 24){ h = 0; } e

jquery - Javascript slideshow background with images in order -

i have following code rotate through images. need images go in order rather random. need change code in order make happen? <div class="test" data-slides='[ "images/video/images/img_0001.jpg", "images/video/images/img_0002.jpg", "images/video/images/img_0003.jpg", "images/video/images/img_0004.jpg", "images/video/images/img_0005.jpg", "images/video/images/img_0006.jpg", "images/video/images/img_0007.jpg", "images/video/images/img_0008.jpg", "images/video/images/img_0009.jpg" ]'></div> <script> ! function(t) { "use strict"; var = t("[data-slides]"), s = a.data("slides"), e = s.length, n = function() { a.css("background-image", 'url("' + s[math.floor(math.random() * e)] + '")').show(0, function() { settimeout(n, 3.

java - HttpServletRequest.getParamter() return null in CXF Restful service(Post) -

i wrote web api using apache cxf. when use httpservletrequest.getparamter() in post method, return null.here code: @path("/") public class tokenservice extends digiwinbaseservice { private static void printrequest(httpservletrequest httprequest) { system.out.println("\n\n headers"); enumeration headernames = httprequest.getheadernames(); while (headernames.hasmoreelements()) { string headername = (string) headernames.nextelement(); system.out.println(headername + " = " + httprequest.getheader(headername)); } system.out.println("\n\n parameters"); enumeration params = httprequest.getparameternames(); while (params.hasmoreelements()) { string paramname = (string) params.nextelement(); system.out.println(paramname + " = " + httprequest.getparameter(paramname)); } system.out.println("\n\n row data");

php - How to turn a string into and array -

i have string saved in database: 'array\n (\n [id] => xxx111\n [amount] => 2000\n [currency] => usd\n [created] => xxx222\n [object] => refund\n [balance_transaction] => xxx333\n [charge] => xxx444\n [receipt_number] => xxx555\n [reason] => requested_by_customer\n )' and need parse how , array(). \n don't appear in db, when retrieve them , check value in xdebug \n show up. i've tried using eval() so: eval('$my_array = ' . $string_from_db . ';'); but doesn't work because of [] s indexes instead of "" s. tried string replaces switch them , add commas regex-fu isn't great. any appreciated. messy , ugly , should trick $array(); $tmparray=explode("\n",$str); foreach($tmparray $row){ if(strpos($row,'>')!==false){ $tab2=explode(">",$row); $array[trim(substr(trim($tab2[0]),1,-3))]=trim($tab2[1]); } }

how to use multiline edit textbox to get user-defined matrix data from users in matlab gui -

i have written code in matlab , has worked. started developing gui code. however, want collect matrix data user using multiline edit textbox, new row distinguished new line. example, n×3 matrix: 3 3 2 4 4 3 . . . n1 n2 n3 if assume user of application enters numbers in correct format, can use str2num function. for example, use following code in button callback: a = get(handles.yourtextboxtag, ‘string’); b = str2num(a);

In crystal report I am trying to convert datetime value to date to string -

the following conversion not working. see if can able solve it. syntax: totext(date({db.field}),"dd/mm/yyyy") system saying date id required. however totext( date({db.field}), "dd/mm/yyyy") working fine.... the other simplest way : crystal report design window->right click on date field->format field->customize date format want to.

php curl nss initialize error -

i use php curl visit https website such " https://api.mch.weixin.qq.com " in php-fpm environment, code is: <?php $ch = curl_init(); curl_setopt($ch, curlopt_timeout, 10); curl_setopt($ch, curlopt_url, 'https://api.mch.weixin.qq.com'); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, false); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_verbose, 1); $verbose = fopen('php://temp', 'w+'); curl_setopt($ch, curlopt_stderr, $verbose); curl_setopt($ch, curlopt_post, true ); curl_setopt($ch, curlopt_postfields, 'test'); $data = curl_exec($ch ); if ($data === false) { $error = curl_errno($ch) . ' ' . curl_error($ch); echo $error; rewind($verbose); $verboselog = stream_get_contents($verbose); echo "verbose information:\n<pre>", htmlspecialchars($verboselog), "<

meteor - TypeScript Javascript patterns -

i busy creating meteor.d.ts support typescript developments on meteor.js platform. current status can found here with said, having issues abstracting 2 typical javascript patterns. the first 1 template.mytemplate.events(eventmap) , mytemplate can dynamically created user. second, ability map this different interface. meteor uses pattern lot. instance, when calling meteor.methods(..methods..), methods given access this.issimulation() not visible anywhere else. kind of difficult explain, @ meteor documentation may help any idea how declare these 2 patterns? thank you. mytemplate solution provide 2 interfaces user. 1 can use add new templates template . allow him specify features of template: interface itemplate{ } interface itemplatestatic{ events:function; } declare var template:itemplate; // user's code: interface itemplate{ mytemplate:itemplatestatic; } template.mytemplate.events({}); this solution answer second question this . wa

selenium - Appium- Getting app configuration error while running the code -

failed configuration: @beforetest setup org.openqa.selenium.sessionnotcreatedexception: new session not created. (original error: no app set; either start appium --app or pass in 'app' value in desired capabilities, or set androidpackage launch pre-existing app on device) (warning: server did not provide stacktrace information) command duration or timeout: 98 milliseconds build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:55:52' system info: host: 'god23342', ip: '10.244.46.14', os.name: 'windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_92' driver info: org.openqa.selenium.remote.remotewebdriver @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:62) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorim

Why do we allow interface to be used as a type in Java? -

for example, see this: queue<string> q = new linkedlist<string>(); i totally understand point declaring type of queue, class implements queue interface can used instantiate object. what bothers me see like q.size() to size of queue. this compiles , works fine, me, doing defeats concept of "interface", because size() method in linkedlist class. essentially need aware of class used instantiate queue object. if later decided use different class instantiate queue object, may run trouble e.g. if decide not use linkedlist class , decide use other class instantiate queue object, we need make sure new class has method size(), otherwise need change it. note: using size() method as example. potentially, method linkedlist has can called on queue object right? if later decided use other class instantiate queue object? need make sure new class has same method, right? seems defeating purpose of interface. if declare variable interface type, should usi

java - Correct way to instantiate class so I'm able to validate path chains in certificate -

i have 3d party library(sdk kalkan provider). part of library checks certificate paths believe. problem should pass 2 parameters instantiate class correctly use 1 of method need. here's code: final pkixcertpathreviewer checker = new pkixcertpathreviewer(cp, params); boolean test = checker.isvalidcertpath(); here's part of constructor: public pkixcertpathreviewer(certpath certpath, pkixparameters params) about task bit. have signed document client certificate. want validate path in client's certificate. have client's x509certificate instance of certificate, 1 middle certificate , 1 root certificate. last 2 files in cer format on disk. understand should combine 3 certificates together. if showed me how create cp , params helpfull. in advance. so i've managed solve problem. here's code if have same problems me. certificatefactory cf = certificatefactory.getinstance("x.509", kalkanprovider.provider_name); java.security.cert.certi

asp.net mvc - MVC4 Ajax Form URL -

is there way set url asp.net-mvc-4 ajax form? looking answer using ajax.beginform() syntax can make use of microsoft's model construction sorcery without needing re-parse url string myself. there partial view lives on foo.com.au/getfoo has ajax form in it. ajax form post foo controller (default), getfoo action. when calling external site ( bar.com.au ) want post foo.com.au/getfoo . instead posting bar.com.au/getfoo . there way tell ajax form post full url instead of relative path? motive of suspect hax0rz or other foul play, have built widget being integrated across multiple client sites. building authentication plugin widget. widget not redirect them website authentication, therefore want post domain results of username/password input form. you need pass in through ajax-options instead of supplying in overloaad of beginform: @using (ajax.beginform( new ajaxoptions { url = url.action("getfoo", "foo", null, request.url.

android - ExpandableListView OnChildClickListener with checkbox row not fire when scrolling -

i have baseexpandablelistadapter this: public view getchildview(final int groupposition, final int childposition, boolean islastchild, view convertview, viewgroup parent) { final contentviewholder contentviewholder; view view = convertview; final book book = getchild(groupposition, childposition); if (view == null) { layoutinflater inflater = context.getlayoutinflater(); view = inflater.inflate(r.layout.item_book_row, null); contentviewholder = new contentviewholder(); contentviewholder.tvname = (textview) view.findviewbyid(r.id.tvname); contentviewholder.chkselected = (checkbox) view.findviewbyid(r.id.chkselected); view.settag(contentviewholder); }else{ contentviewholder = (contentviewholder) view.gettag(); } contentviewholder.tvname.settext(book.gettitle()); contentviewholder.chkselected.setchecked(checkstates[groupposition][childposition]); contentviewholder.chkselect

android - EACCES (Permission denied) after granting the necessary permissions -

okay having problem while testing app on emulator (android 6.0) (since dont have android 6.0 device ) @ first asking user grant necessary permission before executing task , after getting permission executing task giving me error : unable decode stream: java.io.filenotfoundexception: /storage/19fa-1f0b/dcim/image1464800718267.jpg: open failed: eacces (permission denied) 06-02 12:04:11.906 21595-21595/pb.mypackage d/androidruntime: shutting down vm ----------beginning of crash 06-02 12:04:11.907 21595-21595/pb.mypackage e/androidruntime: fatal exception: main process: pb.mypackage, pid: 21595 java.lang.runtimeexception: unable start activity componentinfo{pb.mypackage/pb.mypackage.cropactivity}: java.lang.nullpointerexception: at