Posts

Showing posts from August, 2010

symlink - How to obtain the target path pointed by a symbolic link in Tcl -

i need find path of target file pointed symbolic link in tcl. ie. if c:\temp\link symbolic link file pointed target c:\bin\sub\sub1\originalfile , how can find path c:\bin\sub\sub1\originalfile symbolic link file c:\temp\link using tcl? used set item "c:\temp\link" file readlink $item but returned following error could not readlink "c:/temp/link": not directory can help?

sql server - Chart line title in SSRS -

Image
i'm working on ssrs line charts. in single graph have 4 lines, each 2 of comparisions. woud add title each line in chart below. understand data without checking color code of each lines axes definitions located @ end of chart. please guide me how achieve it. update: please find requirement question below in excel. similar in ssrs https://superuser.com/questions/807068/how-to-display-series-name-inside-bars-of-stacked-bar-chart you can set label property of series show helper text conditionally specific x-axis value. click serie need label, in case [sum(cancelations)] can see in below screenshot. press f4 , properties window appear. in property window, search label node , expand it, this: in label property have use expression determine have place label, in case i've used: =iif(fields!day.value="123", "cancelation", nothing ) this expression says, show cancelation label when x-axis label equal 123 , if day field (x-axis) not 1

Stripe Invoice. Start/created and End date are all the same for first invoice -

i getting invoices api, , noticing if there 2 full month billing cycles, - 1 in start/end , created dates same. so, end displaying , makes no sense.. ie. lets user created account on july 19, 2016.. 1 of invoices (the others good), getting this. amount: 0 billingdate:"2016-07-19t23:20:33.000z" enddate:"2016-07-19t23:20:33.000z" startdate:"2016-07-19t23:20:33.000z" how should handle this, or how valid response? keep in mind billing on 8th. little afraid :-), omit if start/end/created date same. the current_period_end , current_period_start corresponds period invoice for. rule on stripe's end, invoice "previous" period while line item subscription new month. this means if have monthly subscription on 1st of month, invoice on 1st of november 1st of october until 1st of november while line item subscription 1st of november 1st of december. there exception first invoice. since there no "past" invoice, current_p

java - HttpServletResponse getOutputStream sending html code on csv file -

i'm trying download csv file html code (header , footer) sent file. i'm using weblogic, tomcat works fine. code below: public void downloadcsvreport(string csvfile, httpservletresponse response){ try { response.setheader("content-disposition", "attachment; filename=example.csv"); response.setcontenttype("text/csv"); bytearrayinputstream bais = new bytearrayinputstream(csvfile.tostring().getbytes(report_encoding)); ioutils.copy(bais, response.getoutputstream()); response.flushbuffer(); } catch( ioexception e ){ logger.error(e.getmessage(), e); } } thanks! this code in spring webapp works public static void putfileinresponse(httpservletresponse response, file file, string contenttype) throws ioexception { // set headers response.setcontenttype(contenttype);// "application/octet-stream" example response.setc

sql - Need to compare which user is logged in to determine which information to show -

it's vendor page multiple users having different roles. right it's 2 user types, , have boolean method uses linq sql check if it's user made changes vendor. error i'm getting sequence returns multiple. public static bool booluser1(string user) { bool user1bool = false; if (user == string.empty) { return false; } if (user != null) { var context = new rempscodatacontext(); string user1 = (from u in context.vendors u.user1_info_edit_user == user select u).singleordefault().user1_info_edit_user; if (user1 == user) user1bool = true; } return user1bool; } well singleordefault throw exception if there more 1 element in sequence. returns element of sequence, or default value if sequence empty; method throws exception if there more 1 element in sequence. perha

jquery - How to translate JavaScript strings dynamically? -

i need dynamically translate 2 strings spanish in following js, namely "date" , "read more" if html-document's language code set spanish (html lang="es"): $.each(data,function(post, postinfo) { jsonarray.push( postentry + '<a href="' + postinfo.link + '" class="preview-title"><h2>' + postinfo.title + '</h2></a><div class="preview-meta">date: ' + postinfo.date + '</div><p>' + postinfo.preview + '...</p><div class="read-more"><a href="' + postinfo.link + '" class="link-button">read more</a></div>' + postfooter); }); i unsure how approach in best way. getting language code string work this: var languagecode = $('html').attr('lang'); and implement simple check like: if (languagecode === 'es') { ... } else { ... } would app

java - Can't set "input-channel" on service-activator in spring integration? -

Image
i'm trying run tests spring integration , i'm running strange error. it's telling me can't have input-channel on service-activator, i've done several times before, , in the documentation it's used on place. here's namespace config. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:int="http://www.springframework.org/schema/integration" xmlns:file="http://www.springframework.org/schema/integration/file" xmlns:feed="http://www.springframework.org/schema/integration/feed" xmlns:jms="http://www.springframework.org/schema/integration/jms" xsi:schemalocation="http://www.springframework.org/schema/integration/feed http://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www

javascript - redis client and node js - hgetall method fails with empty results -

this day 1 me redis cilent , node js. i'm trying replicate command run via redis-cli in node.js: 127.0.0.1:6379> hgetall widgets:9145090003_00:00_00:00 1) "id" 2) "33305" 3) "loc" 4) "jamaica" 5) "days" 6) "" here's nodejs code: client.hgetall("widgets:9145090003_00:00_00:00", function (err, replies) { console.log(err); replies.foreach(function (reply,i) { console.log(' ' + + ':' + reply); }); }); it comes null , fails while trying foreach. i tried: client.hgetall("widgets", function (err, replies) { console.log(err); replies.foreach(function (reply,i) { console.log(' ' + + ':' + reply); }); }); but same result. not sure i'm doing wrong. edit 1 i tried code: 17 console.log("attempting hgetall.."); 18 client.hgetall(&qu

raspberry pi - RPI2b - "ALSA: Underrun Occurred" -

i running python script on rpi2b + cirrus logic audio card. want iir filter music. open stream pyaudio , have callback function. the first (around) 5 seconds runs fine , error... couldnt find helpful google, frustrated ^^ what kind of information can provide you? turn on debug options , can show outputs? alsa underrun means , not giving data alsa in proper intervals. ie, algorithm not enough fast in rpi2b. need improve algorithm or need faster chip.

javascript - How to have angular directive for two elements? -

i have small menu on page directive. user scrolls, want navigation become sticky once gets out of viewport. i have jquery code involves cloning element, , i've used code in past , tried convert on angular in multiple ways. tried leaving 1 element , changing ng-class not have same visual effect , looks bad determined need 2 elements (the original , sticky). i tried cloning in directive link function, ng-repeat inside not run, menu not populated links. so tried putting 2 < elements > in dom , renders last one. best way have 2 elements go through same directive? i'm lost. directive link: link: function( scope, element ){ var scrolltimer; var origheight = element.offset().top; element.clone().insertafter(element).toggleclass('secondary original'); angular.foreach(scope.days, function(value, key) { var date_data = {action: 'get_date', day: value.name}; $http({ method: 'p

Delete Mail with Python Outlook IMAP -

i´m trying delete mails in outlook mail account. this code : message_to_delete in messages: print(message_to_delete) server.store(message_to_delete, '+flags', '\\deleted') print(server.expunge()) wont work. last print returns: b'584' ('ok', [none]) is there different flag in outlook? or problem? greetings

html - Use: Need Javascript code that gets the inner width/height of screen onload into width/height style variables -

i find innerwidth , innerheight of screen via javascript, , place values width , height variables of body class in style area (css) of html. example: <style> body { background-image: url("images/hello.jpg"); background-repeat: no-repeat; background-color: brown; width: valuew; height: valueh;} </style> where valuew returned value of pixels of innerwidth of screen, , valueh innerheight . "px" pixels value need follow returned number of course. is possible? thanks input. you're looking css vh , vw units, automatically. no javascript needed.

javascript - jQuery target next() html item -

hi have list of items generated so: <li class="panel-title">item 1<i class="fa pull-right fa-plus"></i></li> <ul class="panel-body">...</ul> <li class="panel-title">item 2<i class="fa pull-right fa-plus"></i></li> <ul class="panel-body">...</ul> <li class="panel-title">item 3<i class="fa pull-right fa-plus"></i></li> <ul class="panel-body">...</ul> upon clicking 'li' item need next 'ul' expand. unsure how solve & whether next() right action heres code $('li.panel-title > .fa').on("click",function() { var $curricon = $(this); var $contents = $('ul.panel-body'); if($curricon.hasclass('fa-plus')) { $curricon.$contents.next().slidedown(); $curricon.rem

How to prevent Kendo Grid (ASP.NET MVC wrapper) from escaping HTML link in bound data? -

i have kendo data grid in asp.net mvc application. first column of data bound grid contains string includes html link. when grid loads in browser, html markup escaped , visible, rather rendering hyperlink. how can change behavior? <div> @(html.kendo().grid<manageprojectviewmodel>() .name("grid") .columns(columns => { columns.bound(c => c.organizationname).width(150).format(""); columns.bound(c => c.name).width(150); columns.bound(c => c.administratorname).width(150); columns.bound(c => c.sponsorname).width(150); }) .selectable(selectable => selectable .mode(gridselectionmode.single)) .events(events => events.change("onchange").databound("initgrid")) .sortable() .datasource(datasource => datasource .ajax() .read(read => read.action("listprojects", "organization")) .serveroperati

oop - Having Problems Designing Sign-In / Sign-Up Logic with Firebase + Android -

i'm relatively new android/programming... i'm trying design app uses firebase backend (although problems having exist app tries make immediate decisions based on remote data). i feel there smarter way i'm trying do. the requirements (the way i'm thinking problem): design app new users sign in , register (two separate things), app not allow them use app unless have been expicitly (manually) authorized human via firebase database console. existing/approved users bypass these stages. so... solve this, have thought: when first open app, if not signed in, present them signin activity. if, upon successful sign-in, found have not yet registered, present registration activity. if upon successful registration, found not yet admin-approved, exit app alert dialog explaining must wait longer approval. sounds simple... have mainactivity onresume() method this: @override protected void onresume(){ super.onresume(); // if not signed in, go signin/crea

postgresql - search_path doesn't work as expected with currentSchema in URL -

my sql commands have issues finding objects public schema (which in default db search_path ) when specifying currentschema parameter in db connection url. how fixed? the long story: i have application schema app1 . the db has postgis extension installed in public schema (and want keep there). the db search_path configured this: alter database tst set search_path = "$user", public when connecting db without specifying current schema in url, default schema public , finds geo functions , objects. have specify app1 schema prefix when addressing objects app1 , e.g.: select st_asgeojson(geometry,15,4) app1.shapes limit 5 this not convenient. added "app1" current schema parameter connection url this: jdbc:postgresql://localhost:5432/tst?currentschema=app1 now, when connect db, don't have specify app1 prefix when addressing objects app1 schema. however, requests involve postgis objects don't work anymore , fail with: error: function s

javascript - In String.prototype.slice(), should .slice(0,-0) and .slice(0,+0) output the same result? -

i came across quirk while trying optimise string pluralisation in game of code golf. had idea write strings plurals , use substr cut last character off, conditionally: var counter = 1; var mytext = counter + " units".substr(0, 6-(counter===1)); it's fine - wanted. looking @ mdn docs string.prototype.slice() , thought had found way make even shorter, using passing negative 0 second argument function. docs: endslice optional. zero-based index @ end extraction. if omitted, slice() extracts end of string. if negative, treated sourcelength + endslice sourcelength length of string (for example, if endslice -3 treated sourcelength - 3). var mytext = counter + " units".slice(0,-(counter===1)); this evaluates .slice(0,-1) when counter equal 1, chop last letter string, or otherwise evaluate .slice(0,-0) , according docs should mean 0 characters subtracted length of string being operated upon. as happens, -0 treated same +0 string.prototype.s

node.js - Npm script that finds and kills port that's in use -

i'm on windows machine , every time quit node process, , try restart again error: listen eaddrinuse :::8004 i have netstat -o -n -a | findstr 0.0:8004 taskkill /f /pid <pid> how can write script finds , kills pid doing npm kill ? 1) problem isn't killing server, it's closing port upon exiting. program missing server.close() in process.on('exit', ..) , process.on('uncaughtexception', ..) . 2) first argument allowed next npm 1 of predefined set. read output of npm that. 3) answer question, , lazy work, can put 2 commands inside batch file, set listening port parameter , declare script section in package.json , { "name": "myserver", "scripts": { "kill": "killserver.bat" }, } then use npm run kill -- 8004 , port number being of course parameter in batch. note longer , more complicated calling batch directly. see https://docs.npmjs.com/cli/run-script , it's useful

swing - Trying to set the location of a Java Button using JFrame isn't working? -

Image
please below edits. so i've looking on numerous "solutions" fix problem, can't seem working. this application looks code below: basically, want set location of button, can't manage so. here code: package me.cervinakuy.application; import java.awt.borderlayout; import java.awt.color; import java.awt.gridlayout; import javax.swing.imageicon; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jpanel; public class controlpanel3 extends jframe { jpanel panel = new jpanel(); jbutton startrobo = new jbutton(); jbutton stoprobo = new jbutton(); jbutton restartrobo = new jbutton(); public controlpanel3() { // setlayout(null); setsize(1000, 700); setresizable(false); setlocation(450, 150); setdefaultcloseoperation(jframe.exit_on_close); getcontentpane().setbackground(new color(45, 48, 55)); settitle("espin software | control panel"); setvisi

javascript - ajax passing the json value to html header class -

i confused on how pass json variable html header tag. using codeigniter framework, got values of query in json , put in variable , works good, when tried display in header, confused how right. all want : this ajax query. function showprojectdetails(projectselected) { var studentid = null; $.ajax({ url : "<?php echo site_url('manager/projects/projdetails/')?>/" + projectselected, type: "get", datatype: "json", success: function(data) { $projcode = data['project_code']; $projtitle = data['project_title']; $projdesc = data['project_desc']; $projstat = data['project_status']; $projpercent = data['project_percent']; $projadd = data['project_address']; }, error: function (jqxhr, textstatus, errorthrown) { alert('error data ajax'); } }); from html

r - trouble with converting values to scientific notation 1e-3 from 0.001 etc -

Image
i know silly question think things should more clear on this. mean converting numbers normal scientific format example usual 0.001 1e-3 format. i know there similar questions point want process without changing global options(scipen) . not use first change options(scipen) in case other values dont want them changed. here mean, lets have data this set.seed(12345) set =rep(rep(c("1","2"),each=5),times=1) v=rep(seq(1,1.4,0.1),times=2) value <- replicate(1,c(replicate(2,sort(10^runif(5,-3,0),decreasing=false)))) data_rep <- data.frame(v, value,set) #> data_rep # v value set #1 1.0 0.002351715 1 #2 1.1 0.005382811 1 #3 1.2 0.023703932 1 #4 1.3 0.058314556 1 #5 1.4 0.476184589 1 #6 1.0 0.001595635 2 #7 1.1 0.001896175 2 #8 1.2 0.034667861 2 #9 1.3 0.097931107 2 #10 1.4 0.197982134 2 trial 1 when options(scipen=-10) #> data_rep # v value set #1 1.0e+00 2.341224e-02 1 #2 1.1e+00 1.45449

Converting hex format to float numbers in R -

could please me how can convert 4 byte hex format float number in r? example want transfer "aec7a042" 80.39 . not find in r after lots of search give me conversion! c function bitconverter. tosingle. need same in r? can me, please? you can read value using readbin . seems have 4-byte signed float value. can read with: readbin("aec7a042", "double", size=4) # [1] 80.39 if doesn't work in version of r, try x <- "aec7a042" readbin(as.raw(strtoi(substring(x, (step<-seq(1, nchar(x), by=2)), step+1), 16)), "double",n=1,size=4) # or readbin(as.raw(strtoi(apply(matrix(strsplit(x,"")[[1]],2),2,paste, collapse=""), 16)), "double", size=4) here more explicitly convert character string raw vector of bytes.

reactjs - Handling updates to store with React/Redux and lifecycle events -

i'm using react redux on front end , using rails api handle backend. @ present, trying update list of articles based on user addition of article. articleform component fires action creator updating articlelist. however, @ present life cycle method componentwillupdate firing continuously making axios requests rails, , rails keeps querying database , sending articlelist. note: have tried using shouldcomponentupdate such no avail, dom doesn't update: // shouldcomponentupdate(newprops){ // return newprops.articlelist !== this.props.articlelist // } my question is: how can use react's lifecycle methods avoid happening , only happening when articlelist updates. going down wrong path using lifecycle methods? i'm new react/redux , advice helpful! i have following container: import react, { component } 'react' import { connect } 'react-redux' import { bindactioncreators } 'redux' import articleform './articleform' import a

android - Set the distance between the menu in a navigation drawer and the screen edge? -

Image
i want set distance "d" specific value, how can make it? yes, question how programatically set margin between icon , title of menu item of navigation drawer in android? same mine. code follows: activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:opendrawer="start"> <include layout="@layout/app_bar_main" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.design.widget.navig

codeigniter - php-fpm slow unknown 0 -

my nginx appear nginx_elapsed. see php-fpm slow log. script_filename = /home/work/www/order/index.php [0x00007f04508ca378] mysqli_query() /home/work/www/order/system/database/drivers/mysqli/mysqli_driver.php:179 [0x00007f04508c9ee8] _execute() /home/work/www/order/application/core/database/db_driver.php:465 [0x00007f04508c8a58] simple_query() /home/work/www/order/application/core/database/db_driver.php:298 [0x00007f04508c8748] query() /home/work/www/order/system/database/db_active_rec.php:962 [0x00007f04508c8138] get() /home/work/www/order/application/models/api_model.php:309 [0x00007f04508c7a68] get_sales_appointment() /home/work/www/order/application/controllers/api.php:412 [0x00007fffa9508440] appointment_alert_get() unknown:0 [0x00007f04508c7978] call_user_func_array() /home/work/www/order/application/libraries/rest_controller.php:442 [0x00007f04508c69f0] _fire_method() /home/work/www/order/application/libraries/rest_controller.php:429 [0x00007f04508c4908] _remap() /hom

haskell - creating a function that takes a list of Ints and returns the list with any odd numbers squared -

i want write function similar filter using odd function takes list , returns list odd numbers squared. ex gchi> sqrodd [1,2,3,4,5] [1,2,9,4,25] what have , believe close is sqrodd :: (a->bool) -> [a] -> [a] sqrodd odd [] = [] sqrodd odd (x:xs) = if odd x (x*x) :sqrodd odd xs else x : sqrodd odd xs but errors function definition saying "couldn't match expected type a -> bool actual type [a] " as wrote yourself, want function takes list argument , returns list, instead of having type signature sqrodd :: (a->bool) -> [a] -> [a] you should make function type signature looks this sqrodd :: [a] -> [a] which have written on beginning. because of compiler expects, first argument of function function of (a -> bool). should remove odd arguments list , change type signature shown above. cause function use odd prelude instead of expecting filter function argument. anot

java - Confusion when using the strategy method -

i trying implement strategy pattern find middle point of arraylists hold different types of numerical data including paired numerical data(coordinates). having difficulty with pairs and my strategy method 'findmiddle' not implementing. how implement strategy pattern , how work in java using pairs? when comes strategy pattern, 'cannot find symbol' error lines say intdata.findmiddle(new midint()); floatdata.findmiddle(new midflo()); and when comes pairs, main method outputs this... 30 added integer arraylist 57 added integer arraylist 22 added integer arraylist 57 removed integer arraylist 5.55 added float arraylist 6.14 added float arraylist 5.42 not in float arraylist strat.coordinates$pair@2a139a55 removed coordinate arraylist what going on in last line of output? your design isn't 1 begging strategy pattern. pattern best fit class change strategy performing action time time. example player in

excel - VBA sum of a range withing vba not working? -

i writing small macro calculations me before displaying them "sum" function within macro doesnt seem working? sub compiledashboard() = 3 100 if sheets(1).cells(i, "a").value = "week 36" sheets(2).cells(1, 1) = application.worksheetfunction.sum(range(cells(i, "an"), cells(i, "bf"))) end if next end sub this jsut simplification of step isnt working , i'm not sure why isnt summing? outputs 0 despite values in range. as mentioned in comments line: sheets(2).cells(1, 1) = application.worksheetfunction.sum(range(cells(i, "an"), cells(i, "bf"))) needs changed to sheets(2).cells(i, 1) = application.worksheetfunction.sum(range(cells(i, "an"), cells(i, "bf"))) just variation on theme. syntax, never see it. sub compiledashboard() dim integer sheets(1) = 3 100 .rows(i) if .columns("a").v

c# - MVC.Net Controller path with multiple parameters -

[route("add/user/{name}&{state}&{zipcode}&{indeflag}&{email}")] public async task<actionresult> createuser( string name, string state, string zipcode, boolean indeflag, string email) { } how define route of controller method in example above can pass correct data method? please help. you can pass each parameter : [route("[controller]")] public class usercontroller : controller { // < mvc 6 : [route("add")] [httppost] public async task<iactionresult> create( string name, string state, string zipcode, bool indeflag, string email) { // code here } // if want call in simple query [route("quickadd")] [httpget] public async task<iactionresult> create(

c# - What are some techniques or Frameworks to secure username and password credentials in Selenium Web Automation Testing? -

i'm using selenium web driver web page automation. website on want run test automation has authentication page need enter username , password. have used sendkeys() enter both username , password. writing such credentials plain texts in source code not practice are there programming libraries send encrypted texts through automation rather username , password strings? no when sending username , password login form in selenium must not encrypted has same manually. however if dont want keep username , password plain strings can put in app.config file.but let see credentials has access binaries. but if want credentials more secure can use below options option 1 when ever start selenium web driver test ask username , password entered argument c# console application. dont have store username , password anywhere ex: myseleniumtest.exe 'username' 'password' create xml or json file or event text file in solution , store username , password right

angular - Why Checkbox [checked] is firing multiple times for all options -

i creating form have field checkbox (multiple options). use such kind of field in many places in application , that's why decided use directive functionality. what noticed angular2 not supporting checkbox (multiple options) in nice way. because of using [checked] options checkbox verify if checkbox checked or not , (change) update model. during development noticed on clicking on checkbox - [checked] firing multiple times , checking options not in clicked. i created plunkr show i`m talking about. i wondering why [checked] firing multiple times (in plunkr twice) , it`s checking options not clicked one? it's how angular works. change part of application's model angular checking "zone" model (it's more complicated, should search zones in angular). http://blog.thoughtram.io/angular/2016/02/01/zones-in-angular-2.html http://blog.thoughtram.io/angular/2016/01/22/understanding-zones.html

linux - Unable to download mongo-connector using pip -

i trying install mongo-connector on amazon-ec2 instance using following command: pip install mongo-connector but following error flashes everytime: exception: traceback (most recent call last): file "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) file "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 31 7, in run prefix=options.prefix_path, file "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 736, in install requirement.uninstall(auto_confirm=true) file "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 742

restructuredtext - How to adjust the table generated from sphinx-doc? -

i use sphinx-doc generate pdf files,i want know how adjust table's scale when mark in resrtucturedtext. and have new problem ,the csv-table can not skip next page automatically. confused. enter image description here enter image description here

.net - Trigger SendGrid message (Azure Functions) when Storage Table is added to -

i have azure function queues storage table records can see in azure storage explorer. i have azure function sends messages through sendgrid, , is supposed trigger when aforementioned queue added to, not. i'm guessing there's config issue. they're both in same function app , using same connection string, sendgrid function doesn't trigger. both functions vanilla minus email address changes. there other config use? httppost(crud)-csharp1 { "bindings": [ { "type": "httptrigger", "direction": "in", "name": "req", "methods": [ "post" ], "authlevel": "function" }, { "type": "http", "direction": "out", "name": "res" }, { "type": "table", "name": "outtable", &

ios - How to append NSString into NSmangedobject -

i new ios development. want know 1 thing appending string nsmenged object giving me error please resolve it here code- let json1 = try nsjsonserialization.jsonobjectwithdata(response.data!, options:.allowfragments) let json2 = json1["interests"] as! nsarray // print(json2) var i=0; i<json2.count; i++ { let object = json2[i] as! nsdictionary //print(object) let name = object["name"] as! nsstring print(name) self.names.append(name as! nsmanagedobject) } in last line getting error. try this: let appdel:appdelegate = uiapplication.sharedapplication().delegate as! appdelegate let context:nsmanagedobjectcontext = appdel.managedobjectcontext let newcontact = nsentitydescription.insertnewobjectforentityforname("contact", inmanagedobjectcontext: context) newcontact.setvalue(txtname.text, forkey: "name") { try context.save() } catch { print("save error!") }

java - Getting NoClassDefFoundError for com.sun.xml.wss.XWSSecurityException -

i upgraded spring version 1.5.8 version 4.2.3.release , spring ws 1.5.8 2.2.0.release. project compiles fine when start tomcat following error.i using cxf 2.6.0. using xwssecurityinterceptor. caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'annotationmapping' defined in class path resource [applicationcontext-ws.xml]: initialization of bean failed; nested exception java.lang.noclassdeffounderror: com/sun/xml/wss/xwssecurityexception @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:553) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:482) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregi

Android - Why Doesn't Android Obey The Pythagorean Theorem? -

i have samsung galaxy s4 5.0 inches diagonally. confirmed both looking on internet , measuring phone ruler. by programmatically getting phone's width , height in pixels, got width 1080px , height 1920px. phone's density 480dpi, xxhdpi. using convertor ( https://pixplicity.com/dp-px-converter/ ), 1920px 4.00 inches , 1080px 2.25 inches, @ xxhdpi. using pythagorean theorem, diagonal line in inches phone should approximately 4.59 inches, not 5.00 inches. the pythagorean theorem doesn't rationalize android's sizing of several of virtual devices well. why not adding up? doing calculations wrong?

android - Multiple Identity Provider Login OAuth/Open ID -

there mobile applications such games allow user register , log in using google, facebook, or own server. after logging in using third party provider, seem able store user information such game progress server means can associate third party accounts user profile database. how people typically this? i using identity server main identity provider. uses asp.net identity manage users. have android application uses resource owner grant authorization token identity server. new user can register new account going site identity server hosted. now want add button login via google or facebook within android application. when user logs in via google or facebook, user information should retrieved , registration form within android app show fields automatically filled based on user information third party providers. user can register using detail , save user identity server identifier that google or facebook account. asp.net identity site mobile. i believe can have button allows us

C Concatenate string in while loop -

this question has answer here: c concatenate string in while loop 2 answers i cant seem use following function concatenate string in while loop. idea im doing wrong? void do_file(file *in, file *out, options *options) { char ch; int loop = 0; int sz1,sz2,sz3; int seeker = offsetof(struct mystruct, contents.datas); //find total length of file fseek(in, 0l, seek_end); sz1 = ftell(in); //find length struct beginning , minus total length fseek(in, seeker, seek_set); sz2 = sz1 - ftell(in); sz3 = (sz2 + 1) * 2;//allocate enough size 2x array length char buffer[sz3];//set size of buffer copied char msg[sz3];//set size of msg buffer[0] = '\0'; while (loop < sz2) { if (loop == sz2) { break; } fread(&ch, 1, 1, in); //sprintf(msg, "%02

Azure Table Service REST API: JSON format is not supported -

i'm trying request line azure table storage using rest api , c++, got following error: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <cod_e>jsonformatnotsupported</cod_e> <message xml:lang="en-us">json format not supported. requestid:0ccb3b9b-0002-0029-3389-0d2fa1000000 time:2016-09-13t06:39:13.3155742z</message> </error> here request: get https://<myaccount>.table.core.windows.net/<mytable>(partitionkey='<mypartition>',rowkey='<myrow>')?<sharedsignature> here how fill request headers, https://msdn.microsoft.com/en-us/library/dd179428.aspx : std::string sharedaccesssignature("<sharedsignature>"); std::string datetime(getdatetime()); std::string stringtosign(datetime + "\n/" + account + "/" + "<myt

c - Why does a pointer work and not a normal variable in this code? -

in below code following warnings went built: in function ‘on_btn_convert_clicked’:| warning: assignment makes integer pointer without cast [enabled default]| warning:passing argument 2 of ‘gtk_label_set_text’ makes pointer integer without cast [enabled default]| ||=== build finished: 0 error(s), 2 warning(s) (0 minute(s), 1 second(s)) ===| if run program open gui button in question cause segmentation fault when pressed , crash program. #include <stdlib.h> #include <stdio.h> //include gtk headers #include <gtk/gtk.h> //define pointer variable names gtkwidget *plblfilename; gtkwidget *pbtnconvert; gtkwidget *pbtnfilechooser; //prototype functions char on_btn_convert_clicked(); char on_btn_convert_clicked() { //define variables char hello; hello = "hello!"; gtk_label_set_text(gtk_label(plblfilename), hello); return 0; } //start main loop int main( int argc, char **argv )