Posts

Showing posts from April, 2011

pointers - Design choices implementing linked list in C -

i hope question isn't open format of site. new c, , enjoy playing around learn intricacies. current "task" building singly-linked list. here's setup: first iteration of linked list program stored nodes in 1 contiguous block of memory. required realloc push , pop functions. however, when got using realloc, decided try new design malloc , free called during creation or deletion of single node, respectively. i've read on larger scales can hampering program. which way better, first or second? or both ideas lend implementations? forgive me if broad, want check understanding , learn designing program. your second way 'classic' linked list. malloc each node in turn. each node has pointer next node. last 1 has null next pointer. have root pointer points first node there no scale issue this; modern heap managers efficient. there brain scale issue. need write nice clean code dont leak or crash :-) if doing on linux learn how use tool called va

matlab - How to solve a really nasty system of nonlinear equations -

i'm trying solve rather nasty system of equations consisting of 160 quadratic equations on 16 variables. know there tons of solutions (tons being @ least subvariety of dimension 6's worth) ones know aren't ones i'm interested in. i tried using fsolve on matlab, fails when feed solution know works starting point (not time though, suspect not error in equation set, it's many equations handle reliably[mumble mumble... tolerance... mumble]). also, using normal solve function hilariously inadequate: if reduce system 20 quadratics, still takes quite awhile. does know of computer algebra package or function can handle of magnitude? thanks much!

android - Inserting items in a list dynamically by class object -

i adding life event event name, start , and time on list view using class object , still not succeeded; have search lot can't find relevant answer. beginner me public class meetingfragment extends fragment { list<meetings> meetinglist; //here meetings class meetings newmeeting; listview listview; string meetingtag; string[] meetings; arrayadapter<meetings> adapter; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment view rootview = inflater.inflate(r.layout.fragment_meeting, container, false); newmeeting = new meetings(); listview = (listview) rootview.findviewbyid(r.id.list_meetings); meetings = new string[] {}; adapter = new arrayadapter<meetings>(getactivity(), r.layout.list_item, r.id.meeting_name); listview.setadapter(adapter); }); //this custom dialog ok.setonclicklistener

arm - ecc throws linker error -

i've downloaded ellcc binaries (windows, mingw). i'm trying assemble , link single simple ir file. for x86_64-ellcc-windows-gnu , works fine. armv7-ellcc-linux ( arm-linux-engeabi ) , other arm target, throws linker error similar this: "v:\users\teo\downloads\ellcc-x86_64-w64-mingw32-0.1.12\bin/ecc-ld.exe" -n ostdlib "-lv:\users\teo\downloads\ellcc-x86_64-w64-mingw32-0.1.12\bin\..\ libecc/lib/arm-linux-engeabi" -m armelf_linux_eabi --build-id --hash-style=gnu - -eh-frame-hdr -o a.out -e start -bstatic "v:\users\teo\downloads\ellcc-x86 64-w64-mingw32-0.1.12\bin\..\libecc/lib/arm-linux-engeabi/crt1.o" "v:\users\ \teo\downloads\ellcc-x86_64-w64-mingw32-0.1.12\bin\..\libecc/lib/arm-linux- engeabi/crtbegin.o" "c:\users\teo\appdata\local\temp\int32add-42cacb.o" -( -lc -lcompiler-rt -) "v:\users\teo\downloads\ellcc-x86_64-w64-mingw32-0.1.1 2\bin\..\libecc/lib/arm-linux-engeabi/crtend.o" c:\user

node.js - Route traffic to multiple node servers based on a condition -

i'm coding online multiplayer game using nodejs , html5 , i'm @ point have multiple maps people play on, i'm having scaling issue. server i'm running on isn't able support game loops more few maps on own, , though has 4 cores can utilize 1 single node process. i'd able scale not limited single server. i'd able start node process each map in game, have master process looks map player in , passes connection correct sub process handling, updating game information, etc. i've found few ways use proxy nginx or built in node clusters load balance can tell examples i've seen give connection whatever next available process is, , need hand them out specifically. there way me route connection node process based on condition that? i'm using express serve static content , socket.io client server communication currently. information map player in in mongodb along rest of player data, if makes difference. there many ways adress problem, here 2

ios - Scroll second UITableView in line with second UITableView -

i have 2 table views set side side, , need them scroll @ same time. so, when scroll one, other 1 scroll @ same time. i did searching , couldn't find information, assume must possible somehow. my table views both connected same class , differentiate between them this: if tableview == tableview1 { // } else if tableview = tableview2 { // } you can set scrollview delegate self on both of tableview 's scrollviews . , in -scrollviewdidscroll , take contentoffset , set other scrollview 's contentoffset same value.

jquery ui - ui.selected is returning undefined when used with a table -

alert(id) returning nothing when used in table. when use jquery selectable on "ol" tag returns id of "li", when change "ol selectable" "table selectable", starts showing empty in alert message. need different when using table jquery ui selectable versus "ol" . please suggest. $("#selectable").selectable({ selected: function (event, ui) { var id = $(ui.selected).attr("id"); var color = $(ui.selected).css("border-color"); alert(id); } }); adding filter: "td" helped achieve wanted to. got answer jquery forum https://forum.jquery.com/topic/jquery-selectable-as-table-not-returning-id credit goes jakecigar

javascript - Copy to clipboard from a cloned textarea -

i found codes posted here that's need tool i'm working on right now; copy previous textarea's value clipboard, doesn't seem work cloned textarea. need help. <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title> - jsfiddle demo</title> <script type='text/javascript' src='/js/lib/dummy.js'></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> </head> <body> <center> <button id="button" onlick="duplicate()">duplicate</button> </center> <div id="duplicater"> <center> duplicate inside div <br> <textarea id="notestocopy" name="notestocopy&qu

c - How to print the 32 different combinations of a 5-digit access code(2 choices per number(2^5))? -

i trying write program scans in 5-digit key pad access code , returns 32 different ways access code mimicked. means each button has 2 possible choices; therefore, each 5-digit access code has 2^5 = 32 combinations. program returns buttons user has pressed , how many times, i've come brick wall implementing piece of code various combinations equivalent. question is: how can implement code return 32 other equivalent access codes? the key pad looks this: (buttons 1-5) button 1: 1 & 2 button 2: 3 & 4 button 3: 4 & 6 button 4: 7 & 8 button 5: 9 & 0 /*headers*/ #include<stdio.h> #include<stdlib.h> #define size 5 int main (void){ /***** key pad ******/ /* (buttons 1-5) button 1: 1 & 2 button 2: 3 & 4 button 3: 4 & 6 button 4: 7 & 8 button 5: 9 & 0 */ /***** key pad**** */ /* data */ unsigned int input1[2]; unsigned int input2[2]; unsigned int input3[2]; unsigned int input4[2]; unsigned int input5[2];

html - How to pass values from mustache to JavaScript? -

when generating html, can fetch properties json objects need calling {{cmpyjson[jobcmpyid].company_name}} then html include "google", "amazon" or other objects asked. however, when try <script> var company = cmpyjson[jobcmpyid].company_name </script> company assigned null . so how go setting company value string obtainable html? here overall page trying generate: <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>google maps javascript api v3 example: geocoding simple</title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var geocoder; var map; var address = "lamar "; //address = "

javascript - How to make an image height resize accordingly to the size of the contents below it, in a fixed size container -

Image
i understand hard one, have 10+ years working html, can't find solution doesn't involve working complicated calculations javascript. i have fixed-size container divided in two, container has top half , bottom half. top half has image. bottom half has text. want image , text occupy available space. if text short, there more space available image. if text larger, image smaller, dynamically. i've added couple of screenshots illustrate want. in cases, occupy 100% of available vertical space of fixed-size container. here's pure css approach you can try using display: table-row https://jsfiddle.net/4h37fv7o/ try , modify length of text @ bottom , see image resize. there caveats works. alternatively, can use flexbox albeit, using background image: https://jsfiddle.net/kdm0amsx/1/

math - Convert signed to unsigned integer mathematically -

i in need of unsigned 16 bit integer value in opc server can send signed 16 bit integer. need change signed integer unsigned mathematically unsure how. internet research has not lead me in right path either. please give advise? in advance. mathematically, conversion signed unsigned works sending non-negative remainder of signed integer divided 1 + max , max maximum integer can write available number of bits, 16 in case. this logic works follows signed integer s : if s >= 0 return s else return 1 + max + s for convention work expected signed s must satisfy - (1 + max)/2 <= s < (1 + max)/2 in case, given have 16 bits, have max = 0xffff , 1 + max = 0x10000 = 65536. note if codify negative integer convention, result have highest bit on, i.e., equal 1. way, highest bit becomes flag tells whether number negative or positive. examples: 2 -> 2 1 -> 1 0 -> 0 -1 -> 0xffff -2 -> 0xfffe -3 -> 0xfffd ... -15 -> 0xfff1 ... -32768 -

php - Symfony2: Passing options to buildForm -

so i'm pretty new symfony , i'm trying have controller build different forms based on controller actions. right now, have this //in controller public function addlocationentryaction(request $request) { $entry = new entry(); $form = $this->get('form.factory')->create(new entrytype('addlocation'), $entry); return $this->render('ootnblogbundle:blog:addentry.html.twig', array( 'form' => $form->createview() )); } public function addarticleentryaction(request $request) { $entry = new entry(); $form = $this->get('form.factory')->create(new entrytype('addarticle'), $entry); return $this->render('ootnblogbundle:blog:addentry.html.twig', array( 'form' => $form->createview() )); } and //in entrytype public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('title', 'text

.htaccess - Basic authentication for subsite only -

i have single site, want protect. it's /phpinfo on website. there several redirects. apache file looks this: rewriteengine on ... list of rewriterules rewriterule ^(phpinfo)$ index.php?controller=$1 index.php takes controller argument , includes specific site viewed. i use basic authentication on several places already, works fine: authuserfile /var/www/....../.htpasswd authgroupfile /dev/null authname "protected content" authtype basic <limit get> require valid-user </limit> but, question is how can limit basic authentication /phpinfo on server, site protected? ideally authuserfile points relative directory can deploy on live server without needing change path. a solution using php , not htaccess. it's simple yet effective. if (!isset($_server['php_auth_user']) || $_server['php_auth_user'] != config::adminuser || $_server['php_auth_pw'] != config::adminpassword) { header('www-authenticat

javascript - Conflict resolution with breeze -

how can conflict resolution achieved in breeze.sharp or breeze.js , how compare newly released azure "asynctable" conflict handling? the scenario this: entity (e.g. person) saved in breeze cache previous fetch server (the reason saving data in cache make possible user work on app while mobile device disconnected internet). while mobile device offline user edits details on person (e.g. edits surname). meanwhile else edits same person's surname , saved azure (or central ms sql) database. mobile device comes online again , sends update (which has been stored in local cache until now) server. my question is, how can/should done breeze open possibility pick "winner" between these 2 conflicting updates? mechanism deciding winner not issue here. i'd know how best opportunity make decision - , how let winner's version of surname persisted on loser's side (i.e. mobile device or server db). the closest managed answer in breeze documentation on "

ios - Pop from a view controller to an navigation controller -

i have 1 uiviewcontroller(login) , 1 navigationcontroller in storyboard , there 2 view controller included in navigationcontroller the question how can pop loginviewcontroller 1 of view controller belongs navigationcontroller after user login (i need use code because need check if username correct or not) using swift make navigationcontroller initial view controller (tick checkbox on attributes inspector). when app launched, present loginviewcontroller modal present modally segue, or programmatically [self presentviewcontroller:loginviewcontroller animated:yes completion:nil] after checked if username correct or not, dismiss loginviewcontroller calling loginviewcontroller [self dismissviewcontrolleranimated:yes completion:nil]

mysql - SQL query doesn't work? -

i want create table in database , below query wrote; have idea why doesn't work? 1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'sname varchar(255), city varchar(255), avg int(20), clg# int(20) )' @ line 4` create table stud ( s# int, sname varchar(255), city varchar(255), avg int(20), clg# int(20) ); the # not valid character identifier. remove it: create table stud ( s int, sname varchar(255), city varchar(255), avg int(20), clg int(20) ); you can review rules identifiers here . note put name in backticks: `s#` int, however, discourage using names need escaped.

python - i18n and l10n in Django with different views -

i'm trying localize application internationalization purposes, i'm having problem developing url views once language chosen. i have these relevant entries in settings.py ... use_i18n = true use_l10n = true locale_paths = ( os.path.join(base_dir, 'locale'), ) django.utils.translation import ugettext_lazy _ languages = ( ('en', _('english')), ('es', _('spanish')), ('zh', _('chinese')), ) ... and urls.py looks this... # -*- coding: utf-8 -*- django.conf.urls import include, url, patterns django.contrib import admin django.conf import settings django.conf.urls.i18n import i18n_patterns urlpatterns = patterns('', url(r'^$', 'myapp.views.home', name='home'), url(r'^admin/', include(admin.site.urls)), url(r'^downloads/$', 'myapp.views.downloads'), # etc. etc. ) urlpatterns += i18n_patterns('', url(r'^$&#

optional - Retrieve copy of an object from a java stream -

i want copy of object filtered stream. by moment, made way. foo foo = new foo(foolist.stream() .filter(f -> (f.getid().equals(anotherfooid))) .findany().orelse(new foo(anotherfooid))); as can see, object have, among others contructors, clone constructor. class foo { private string id; foo(string id) { this.id = id; } foo(foo originalfoo) { this.id = originalfoo.getid(); } } my question is, there's no more elegant way streams? you call foo::new after findany() don't need instantiate 2 objects when don't find match: foo foo = foolist.stream() .filter(f -> (f.getid().equals(anotherfooid))) .findany().map(foo::new).orelse(new foo(anotherfooid));

c# - Encapsulate context constructor on a query object -

it idea create class holds both query , context constructors func of context , func of iqueryable of tentity solving context lifetime problem? example: on data layer, if use 1 context per method using "using" statement, can't return iqueryables because wouldn't valid after context has been released, makes use of: one context per form (this need injecting form context onto data layer) thread static context call tolist() before returning query (disable query composition) as far recall, contexts designed created , recreated needed, not statically kept in memory (though have done way well). find fine create context in class (like controller class, or view model class, of mvc app), have methods use that. however, if have large amount of static data want cache users, have kept statically in memory. you'd have consider threading, mentioned. if reading only, can create read-only locks access data (not c# lock{} ). for more details if going stat

html - Absolute Positioning Inside Absolutly Positioned Div -

Image
i'm relatively new guy html , css sorry if stupid question. anyway can't seem re-create this: i converting mobile app webpage. anyway have 'wrapping' make centred when resizing first problem when did not reposition divs inside wrapping when using position:absolute. partly fixed using relative positioning 1 of divs caused me not able put relatively positioned 1 wanted it. question: how arrange icons image , have not move when loaded in different resolutions , when window resized? /* body */ #body { background-image: url('images/bg-img.jpg'); font-family: museo300-regular, museo700-regular; } /* font */ @font-face { font-family: museo300-regular; src: url(museo300-regular.otf) } /* nav */ #wrapper { margin-left: auto; margin-right: auto; position: absolute; top: 50%; left: 50%; -moz-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); /* ie 9 */ -webkit-transform:

Android JSON listview search function(update) -

1.my search function works filter int (ex:rank) if want filter char(ex:country name),how should change code? 2.when type in medittext delete it,the listview become empty,how see json listview again if medittext empty ? for filter works fine,i can't figure out how solve these 2 question.thanks import android.app.activity; import android.app.progressdialog; import android.os.asynctask; import android.os.bundle; import android.text.editable; import android.text.textwatcher; import android.util.log; import android.widget.edittext; import android.widget.listview; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import java.util.arraylist; import java.util.hashmap; public class mainactivity extends activity { // declare variables jsonobject jsonobject; jsonarray jsonarray; listview listview; listviewadapter adapter; progressdialog mprogressdialog; arraylist<hashmap<string, string>> arraylist; st

xcode - How to check for functions which have no callers in the whole project? -

how check functions have no callers in whole project? have turned these flags on: unused functions, unused values, unused variables in xcode, did not work. lot. my guess because xcode doesn't objective-c , swift methods , xcode looks c functions instead. actually, there no efficient approach xcode. can try find occurrences of specific fields , methods using project find tool , comment or change access level of fields , methods compile errors. if try use 1 of last 1 approaches, fact of project build doesn't means made clean correctly, kvc or @selector aren't detected in compile time, because accessed dynamically in run time. i know appcode have default , other useful tools makes code better.

javascript - Chrome DevTools Workspace and Meteor -

i'm trying use chrome devtools of development meteor project (specifically less files, that's irrelevent). it looks chrome has bug causes use query string url mapping, without ability tell ignore question. meteor puts query strings on of style sheets, javascript files, etc., that's problematic. i see 2 possible solutions this. can tell me: is possible remove query strings meteor (at least in dev environment)? or, possible wildcard query strings in chrome way isn't mentioned in bug? or, can think of method? update: i'm not sure did, loaded without query strings once , able mapping. chrome complained slight mismatch in url, otherwise seems working. know if going last, or if got temporarily lucky?

java - Using InputMismatchException try/catch block -

i want catch input not int , prompt valid input 3 times. after 3 times, program move on , ask rating. can't seem have try/catch block repeat or catch inputmismatchexception. suggestions? do { //prompt rating try { system.out.println("enter rating between 0-4 movie of week (enter -1 stop/exit): "); //capture rating = response.nextint(); } catch (inputmismatchexception err) { system.out.println("invalid input. please enter rating 0-4 or enter -1 exit: "); rating = response.nextint(); } //end catch } while (rating >= 0); you either in loop: int count = 0; { //prompt rating try { system.out.println("enter rating between 0-4 movie of week (enter -1 stop/exit): "); //capture rating = response.nextint(); } catch (inputmismatchexception err) { system.out.println("invalid input. please enter r

windows - GetObject() 429 Error When Using PSExec To Run WScript File On Virtual Machine -

i using following psexec command run wscript file on vmware player 7 virtual machine: psexec \\devtest1 -u "administrator" -p "password" -h -i 1 -d c:\windows\system32\wscript.exe c:\scripts\closefiles.vbs this psexec command runs closefiles.vbs file on virtual machine devtest1. when run, closefiles.vbs file supposed detect open instance of excel 2007 and, if found, save every open workbook, close each workbook. when run locally on virtual machine, closefiles.vbs executes perfectly. the problem arises when use psexec remote machine execute closefiles.vbs file on virtual machine. windows 7 has locked down uac remote access prevent loopback attacks. security reasons, must keep restriction in place (i know how change registry remove uac remote access restriction). means account can use run application on virtual machine, without using remote desktop client (which can't use in application), virtual machine's administrator account. when run close

jsf 2 - How to replacement "<%=" from jsp to jsf2 page -

this question has answer here: component inject , interpret string html code jsf page 1 answer i have jsp page code : <f:verbatim><%=printpassedparam(request)%></f:verbatim> printpassedparam returns string type. (it return html tags) wanna migrate jsf2, how replace <%= in xhtml page ? thanks in advance i did using "h:outputtext" this. it's working :) <h:outputtext escape="false" value="#{page.beanname.printpassedparam()}"/>

How to Get rid of SalesMagnet from Chrome? -

i'm using window 7 ultimate x64. recently, salesmagnet drives me insane lots of advertisments! it? me remove it? for windows 7: tap windows key , select control panel. then select uninstall program. select salesmagnet , click uninstall. for chrome: open browser , tap alt+f. select settings. then select extensions. click trash can icon remove salesmagnet extension from here: http://www.pcthreat.com/parasitebyid-46031en.html

c# - how to host an ASP .NET 3.5 website to world wide web. like www.mynewwebsite.com -

how host asp .net 3.5 website world wide web. -- need know ftp process, means how upload new files -- steps should take upload website. here project's webconfig file <?xml version="1.0"?> <configsections> <sectiongroup name="system.web.extensions" type="system.web.configuration.systemwebextensionssectiongroup, system.web.extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35"> <sectiongroup name="scripting" type="system.web.configuration.scriptingsectiongroup, system.web.extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35"> <section name="scriptresourcehandler" type="system.web.configuration.scriptingscriptresourcehandlersection, system.web.extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" requirepermission="false" allowdefinition="machinetoapplication"/> &l

java - How to make buttons retain their size in FXML -

Image
so button normal when program starts if decrease size window cursor horizontally or vertically, buttons shrink smaller size. code fxml file <?import java.lang.*?> <?import java.net.*?> <?import javafx.scene.shape.*?> <?import javafx.scene.text.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.image.*?> <?import java.net.url?> <vbox fx:id="optionmenulayout" alignment="top_center" spacing="15" prefwidth="1366" prefheight="768" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.40" fx:controller="millionairetriviagame.optionscreencontroller"> <stylesheets> <url value="@backgroundimages.css" /> </stylesheets> <stylesheets> <url value="@buttonlayout.css" /> </stylesheets> <children>

i need to have some assistance with my pyglatin translator code (python) -

ok code is pyg = 'ay' def word(): def new_word(): new_word = word + first + pyg print "to translate type word or name!" original = raw_input('enter word:') if len(original) > 0 , original.isalpha(): def new_word(): word = original.lower() first = word[0] new_word = word[1 : len(new_word)] + first + pyg print "translating 1 moment..." print "translated view below!" print new_word print "made by: tobias balentine" else: print 'empty' thats code every thing working except part supposed translated word ill show im getting to translate type word or name! enter word:tobias translating 1 moment... translated view below! <function new_word @ 0x021619f0> made by: tobias balentine so line ( <function new_word @ 0x021619f0> ) supposed translated word reason not showing please somebody pyg = 'ay' print "to translate type w

Custom Shortcut Keys in Visual Studio doesn't work -

i created shortcut key creating new folder in visual studio 2013. when hit key, in example ctrl + shift + atl + f nothing happens. if @ options keyboard , search project.addnewsolutionfolder can see command there, , global setting. i found solution, wrong setting keyboard, should project.newfolder , not project.addnewsolutionfolder

PHP: FedEx Web Services -

i'm trying track number uses fedex, can't series of events shown in website. i'm using track web services , using test key. i'm using $response->completedtrackdetails->trackdetails->events which gives me first step (out of total of 9). please, doing wrong. i'm not sure how you're parsing xml response, need loop thru trackreply->trackdetails->events something this... $scancount = substr_count ($response, '<events>') ; $xmlresult = xml2array($response); if ( $scancount > 1 ) { ( $i=0 ; $i < $scancount ; $i++) { $status=$xmlresult['trackreply']['trackdetails']['events'][$i]['eventdescription']['value']; // addl parsing... } }

c# - How to remove duplicates form string array -

i have string array contains json strings . possible identify , remove records contains same uid ? {"object":"user","entry":[{"uid":"823602904340066","id":"823602904340066","time":1429276535,"changed_fields":["feed"]}]} {"object":"user","entry":[{"uid":"10203227586595390","id":"10203227586595390","time":1429278537,"changed_fields":["feed"]}]} {"object":"user","entry":[{"uid":"10203227586595390","id":"10203227586595390","time":1429278531,"changed_fields":["feed"]}]} a single item unique, duplication occurs in multiple items. so, first of convert data list // convert list, add values list<myobject> array = jsonconvert.deserializeobject<list><myobject>>(j

wso2 - Custom Claim Handling Failed In Single Sign On -

i using wso2 identity server single sign on implementations. in demo applications trying custom claim attributes of authenticated user own jdbc database. i followed blog of pushpalanka. this worked fine identity server 5.0.0 but when updated identity server latest update "wso2-is-5.0.0-sp01" , custom claim handling stopped working. following error stack : [2015-04-22 19:09:43,311] error {org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.defaultstepbasedsequencehandler} - claim handling failed! org.wso2.carbon.identity.application.authentication.framework.exception.frameworkexception: index: 0, size: 0 @ com.wso2.sample.claim.handler.customclaimhandler.handlelocalclaims(customclaimhandler.java:200) @ com.wso2.sample.claim.handler.customclaimhandler.handleclaimmappings(customclaimhandler.java:66) @ org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.defaultstepbasedseq

Error while doing insert/update in MySql -

i want capture error occurring during inserting or updating data in mysql stored procedures. when data updated in db, no of rows modified can checked know whether update or insert happened or not, if rows affected 0 (same data updated again), may not error condition. i want capture insert/update failed. please share light on same my sp below delimiter $$ create procedure `sp_test`( in param1 varchar(50), in param2 varchar(50) ) begin if updatecount > 0 update tbname set val = param1 con = param2; else insert tbname set val = param1,con = param2; end if; end$$ delimiter ; i want track whether statements has executed or not. i have added exception block below, declare exit handler sqlexception begin diagnostics condition 1 @sqlstate = returned_sqlstate, @errno = mysql_errno, @text = message_text; set @full_error = concat(&quo

c# - Trim empty spaces in int array -

i need trim trailing spaces @ start , end in int array , how can it, not getting trim() function anywhere here. pls suggest me. int[] arrpct = dtold.asenumerable().select(r => r.field<int>("pct")).toarray(); int numeric values. don't contain spaces (or other char). makes no sense trying trim them.