Posts

Showing posts from April, 2013

2d - 2-D alpha map examples for blending two overlayed images in MATLAB -

Image
i blend 2 images, 1 smaller , enclosed larger one, assume both rectangular. blend these 2 there smooth transition in rectangular band around smaller image. trying in matlab. example here 2 images shown on top of each other, orange , black mages: i create transition band around orange image such @ outward boundaries of band alpha map orange image has value of 0 , inward boundaries have value of 1 , there smooth transition 0 1 inside gray band shown below: i looking map gray area 2-d matrix has values between 0 , 1. there equation based or ready made such matrix? know can create simple linear transition vertical or horizontal band example if x shows x-coordinate of left edge of inner image , blending width w can use this: alpha(x) = (x-x)/w x<x<x+w 1 x > x+w but how create such alpha in 2-d?

c# - Confused with something looking like the curiously recursive template pattern -

i have application made of several "levels" of elements. elements parent of 0..n children elements, being parent of 0..n other elements. top level type has no parent , bottom level elements have no children. in other words, let 3 types : a, b , c. instance of parent of multiple instances of b, being parents of multiple instances of c. each instance has (strongly typed) reference parent. i have several methods same in parent classes, addchild, removechild, getchildindex, etc. have base class parent classes in order not duplicate these methods each parent type. the idea that, when deriving parent base class, have provide type of children, depending on type of parent. so far have come overly complex design : public interface ichild<tparent> tparent : parentbase<ichild<tparent>> { tparent parent { get; set; } } public class parentbase<tchild> tchild : ichild<parentbase<tchild>> { public list<tchild> children; } pub...

google spreadsheet - Adding multiple lines of body in script editor -

Image
i using following code in spreadsheet send emails. // constant written in column c rows email // has been sent successfully. var email_sent = "email_sent"; function sendemails2() { var sheet = spreadsheetapp.getactivesheet(); var startrow = 2; // first row of data process var numrows = 2; // number of rows process // fetch range of cells a2:b3 var datarange = sheet.getrange(startrow, 1, numrows, 3) // fetch values each row in range. var data = datarange.getvalues(); (var = 0; < data.length; ++i) { var row = data[i]; var emailaddress = row[0]; // first column var message = row[1]; // second column var emailsent = row[2]; // third column if (emailsent != email_sent) { // prevents sending duplicates var subject = "sending emails spreadsheet"; mailapp.sendemail(emailaddress, subject, message); sheet.getrange(startrow + i, 3).setvalue(email_sent); // make sure cell updated right away in ...

web applications - Exposing data models as graphql api with filters -

i've been playing graphql while now, using both graphql-js (javascript) , graphene (python). graphql comes relay spec pagination, awesome our schema. find hard set mind on filters. every database provides full query language (whether sql or nosql). our simple web apps, need access our data, of interesting stuff happens in client side rich js frameworks. so after reviewing few of our backend apps, can see parsers: parsing requests rest mongodb or sql . we try provide rich queries client side, add arguments our graphql endpoints, every new filter requires lot of work (new code). going rest graphql great, why not take little farther more expressive language data querying? there reason restrictions? should keep develop "parsers"? to clarify point made above, graphql spec not include relay , mentions nothing pagination. in fact, graphql doesn't specify network layer either choice use http implementor. so graphql provide: a strong t...

reactjs - preact compat causing component to mount infinitely -

i have working reactjs app redux , react router. want switch preact. when updated webpack config alias react , react dom. component started mounting infinitely. mount unmount .. goes on doing so. webpack config. alias: { "react": path.resolve(__dirname, 'react.js'), "react-dom": path.resolve(__dirname, 'react.js') }, react.js var preact = require('preact-compat'); var react = {}; object.keys(preact).foreach(function(key) { react[key] = preact[key]; }); module.exports = react; this file because using react hot loader. react app working fine .. adding preact has bug. pls guide me. from experience, preact-compat , react hot loader (rhl) don't work (it's still on todo list of developer of preact-compact , see this comment ). i work around these issues myself not combining two, i.e. use "real" react , reactdom when want use rhl, or use preact-compat when don't need rhl....

Using mono with ssl in apache -

i have following problem: i want access mono application via ssl. want not accessible without ssl. i using apache2.4 , mod-mono-server4.exe 3.0.0.0 at moment have working configuration this: <virtualhost *:80> documentroot /srv/www/htdocs/my-mono-app #sslengine on #sslcertificatefile /path/to/key.pem #sslcertificatekeyfile /path/to/key.pem monoautoapplication disabled monoserverpath my-mono-app "/usr/bin/mod-mono-server4" monoapplications my-mono-app "/my-mono-app:/srv/www/htdocs/my-mono-app" <directory /srv/www/htdocs/my-mono-app> require granted monosetserveralias my-mono-app sethandler mono </directory> </virtualhost> but turn sslengine on , change port 443 not work anymore. says: object not found! if navigate address. it not record errors in logs. can me please? ps: here complete not working configuration: <virtualhost *:443> documentroot...

deployment - What to use in Production environment instead of UserSecrets -

i have console app in dotnet core. use appsettings.development.josn , appsettings.staging.json dev , staging environment production environment use usersecrets. have 2 problem when app running on production env not create usersecrets in %appdata%/microsoft have make manually , starts work. another part of question this: today found out microsoft wrote here the secret manager tool used in development. can safeguard azure test , production secrets microsoft azure key vault configuration provider. see azure key vault configuration provider more information. i dont have azure. can use in production if not supposed use usersecrets. while environment variables 1 of used options in web development , the twelve factor app documents states : "store config in environment" there reasons why may not best approach: the environment implicitly available process , it's hard track access. result, example, may face situation when error report contain secrets ...

php - Repeat table rows till new div arrives DOMPDF -

Image
i trying create invoice , exporting in pdf using dompdf. stucked is, table using display product details, remaining till rows only, want add blank rows till new footer div comes up current invoice : what want : i using code igniter , dompdf i have tried foreach ($rows $row):{} this isn't can dompdf. have determine how many rows fit on page add more rows using php before give document dompdf. way feasible if height of rows known in advance.

ios - Swift Firebase viewcontroller only for specific user -

in app have validate user generated content, saw panel of firebase not fast thing, searched , found firebase fireadmin, it's not free , want change value of approvation not yes (after have seeing content). it's idea make viewcontroller hide exept me checking firauth property of firebase? let userid : string = (auth.auth().currentuser?.uid)! if userid == myid... { show view controller... thanx in advance no it's not idea. value can changed or controller can access if code usafe. application heavier controller not used users. you have build admin interface if don't want pay firebaseadmin. in function of looking for, can have @ firebase database can read , edit values.

Group result by 15 minutes time interval in MongoDb -

i have "status" collection strcture - { _id: objectid("545a0b63b03dbcd1238b4567"), status: 1004, comment: "rem dolor ipsam placeat omnis non. aspernatur nobis qui nisi similique.", created_at: isodate("2014-11-05t11:34:59.804z") }, { _id: objectid("545a0b66b03dbcd1238b4568"), status: 1001, comment: "sint et eos vero ipsa voluptatem harum. hic unde voluptatibus et blanditiis quod modi.", created_at: isodate("2014-11-05t11:35:02.814z") } .... .... i need result grouped 15 minutes interval collection. there couple of ways this. the first date aggregation operators , allow dissect "date" values in documents. "grouping" primary intent: db.collection.aggregate([ { "$group": { "_id": { "year": { "$year": "$created_at" }, "dayofyear": { "$dayofyear...

php - .htaccess redirect from path to file -

i want set custom template system website i'm working on, want redirect requests single file. if user visits url http://www.mywebsite.de/products/software/ want redirect request file index.php , following: $look_at = $_get['first_level']; //for example: products if($look_at == 'products') { $look_at = $_get['second_level']; //here: software if($look_at == 'software') { //show software specific stuff } else if ($look_at == 'hardware') { //show hardware specicif stuff } else { //show error message } } else { //show error message } then, use include to, include, other html files index.php depending on being requested. in end, request http://www.mywebsite.de/products/software/ supposed same http://www.mywebsite.de/index.php?first_level=products&second_level=software rewriteengine on redirectmatch 403 /\..*$ # if directory or file exists, use them directly rewritecond %{re...

Filtering responsed data from ElasticSearch -

i want ask you, if there way filter searchrequestbuilder srb in elasticsearch. have index consists of companies. every company has document english language , may has documents other languages. want bring companies has document selected user language , if company hasn't document language bring me english. is there way this? thank in advance. answer updated return companies using scrolling api. querybuilder qb = termquery("document", "english"); searchresponse scrollresp = client.preparesearch(test) .addsort(fieldsortbuilder.doc_field_name, sortorder.asc) .setscroll(new timevalue(60000)) .setquery(qb) .setsize(100).execute().actionget(); //max of 100 hits returned each scroll //scroll until no hits returned { (searchhit hit : scrollresp.gethits().gethits()) { //handle hit... } scrollresp =client.preparesearchscroll(scrollresp.getscrollid()).setscroll(new timevalue(60000)).execute().actionget(); } wh...

R smbinning package: why 'Too many categories' for some variables? -

i have dataset in r containing many variables of different types , attempting use smbinning package calculate information value. i using following code: smbinning.sumiv(sample,y="flag") this code produces iv of variables, process column states 'too many categories' shown in output below: char iv process 12 relationship na many categories 15 nationality na many categories 22 business_activity na many categories 23 business_activity_group na many categories 25 local_authority na many categories 26 neighbourhood na many categories if take @ values of business_activity_group instance, can see there not many possible values can take: affordable rent combined commercial community combined 2546 4 freeholders combined ...

c# - Write similar logic using generics -

i have following method determines cars need delete db. private list<cardto> buildcarstodelete(ilist<cardto> newcars, ilist<cardto> existingcars) { var missingcars = new list<cardto>(); var cars = newcars.select(c => c.carid); var newcarids = new hashset<int>(cars); foreach (var car in existingcars) { //if there no new cars had , have been removed if (newcars.count() == 0) { missingcars.add(car); } else { if (!newcarids.contains(car.carid)) { missingcars.add(car); } } } return missingcars; } this works want - if want achieve same functionality customers or apartments of other dtos copying pasting code changing variable names , type of dto around - there nicer way possible using generics keep algorithm , logic allow me use on dto? if ids of type int can passing in func determine id. pr...

xslt - xsltproc add text before and after multiple files -

i'm using xsltproc utility transform multiple xml test results pretty printed console output using command following. xsltproc stylesheet.xslt testresults/* where stylesheet.xslt looks this: <!-- 1 testsuite per xml test report file --> <xsl:template match="/testsuite"> <xsl:text>begin</xsl:text> ... <xsl:text>end</xsl:text> </xsl:template> this gives me output similar this: begin testsuite: 1 end begin testsuite: 2 end begin testsuite: 3 end what want following: begin testsuite: 1 testsuite: 2 testsuite: 3 end googling turning empty. suspect might able merge xml files somehow before give them xsltproc , hoping simpler solution. xsltproc transforms each specified xml document separately, indeed sensible thing because xslt operates on single source tree, , xsltproc doesn't have enough information compose multiple documents single tree. since template emits text nodes "begin" , ...

jquery - Angular 2 - ng2-smart-table - global search on a rendered field -

i have ng2-smart-table global search filter interacts fields of table. work columns doesn't have rendering. code onsearch(query: string = '') { if(query != ""){ this.pages.setfilter( [ // fields want include in search { field: 'producttypedescription', search: query }, { field: 'products', search: query }, { field: 'varianti', search: query } ], false); } and these columns producttypedescription: { title: 'tipo prodotto', filter: false, class: "colonnetabella", width: "20%", }, products: { title: 'prodotto', filter: false, ...

rest - Multiple Authentication Schemes and WWW-Authenticate Challenges -

i developing rest api supports multiple authentication schemes ( oauth , bearer , , basic ). when authorization header absent or contains unsupported scheme, service responds multiple www-authenticate headers: www-authenticate: oauth realm="myrealm" www-authenticate: bearer realm="myrealm" www-authenticate: basic realm="myrealm" when request contains authorization header 1 of supported schemes invalid credentials, should service respond all supported www-authenticate schemes, or just scheme provided in request? for example, if client provides: authorization: bearer invalid should service respond bearer challenge? www-authenticate: bearer realm="myrealm", error="invalid_token", error_description="token malformed or represents invalid credentials" or should respond www-authenticate challenges? www-authenticate: bearer realm="myrealm", error="invalid_token", error_description="...

Google Apps Scripts limit: Can I share a file to partner's account to use their limit? -

i have quite big google spreadsheet file lot of apps script functions data api every minute. that's why causes exceeding limits of google (service used computer time, urlfetch called many times, , etc.). now have 2 questions: can share sheet partner's account , run own limit? google continue count limit me or not? (ex: function execution time limit 90 min/day/account. if used of that, share file partner's account , continue run me own 90 mins limit. possible? ) if 1. impossible, maybe need make copy of sheet account other account (b). run sheet on 0 12am. , 12am 12pm run file on b. can tell me how disable script function calls, triggers of google account? (so disable b when runs , disbale when b runs)? in advance! 1: google app script quota limit linked google account of person running script , not owner of script or spreadsheet. when friend runs script, quota limit calculated against his/ account. 2: not possible disable trigger can delete trigger usi...

java - Can I specify *source* IP address for a JDBC connection? -

i have java application connects database jdbc driver. happens postgres instance, i'm looking general solution if exist. the server on application runs has multiple ip address, in same subnet. jdbc connection established using 'primary' ip of server. i can play linux networking stack have outgoing connections database use secondary ip address. is there way programatically specify source ip address used to jdbc connection? context: want move application without touching database, has rules restricting ip address accept connections from. the hack see making ssl connection, , return new socket bound secondary ip custom sslsocketfactory . some googling suggests depends on particular jdbc driver. for mysql , it's done via property on url: jdbc:mysql://localhost:3306/sakila?localsocketaddress=123.33.33.33 (see https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html ) in case of postgres , looks best o...

Can I use just HTML and CSS to make a contact form? -

so creating contact form , realized not sure how connect submit button send set email. html , css enough or need database, storage, or different language? if 1 easiest learn , do? here code if need it. body { background: #292a2b; font-family: arial; } .contact-title { margin: auto; width: 30%; border: 1.5px solid #0054a9; padding: 5px 0px; border-radius: 8px 8px 0px 0px; background: #0054a9; } .contact-title h2 { text-align: center; color: #ede; letter-spacing: 2px; } .name-contact { margin: auto; width: 30%; padding: 15px 0px 10px 0px; background: #fff; } .message-contact { margin: auto; width: 30%; padding: 15px 0px 10px 0px; background: #fff; }...

knockout.js - DIsplaying graph using knock out and kendo chart -

i need display graph using kendo chart , knockout js. graph not displayed in page. problem greatful. below html page <!doctype html> <html> <head> <link href="kendo.common.min.css" rel="stylesheet" /> <link href="kendo.default.min.css" rel="stylesheet" /> <script src="jquery-3.1.1.js"></script> <script src="bootstrap.min.js"></script> <script type="knockout-3.4.0.js"></script> <script src="kendo.all.min.js"></script> </head> <body> <div id="countrygraph" class="k-chart" style="position: relative; touch-action: none; " data-bind="kendochart: { data: countryusers, title: { text: '' }, legend:{position: 'top'},series: usercount, seriescolors: ['lightgreen'], axisdefaults: {categories:countryname } }"> </div> ...

c# - Locate database -

i have used sql server management studio convert access file sql server. want add database project using c# (it appears in server explorer - data connections). when use c#, solution explorer - properties - addresource - add existing file required navigate database file, cannot locate it. database rwj-pc.paulsnewdatabase.dbo. please advise if possible. somewhere on hard disk (or in network folder)is file extension of mdf. attach file sql server (using sql server management studio) instance , have a database. sql server databases live on file system mdf , (possible 1 or more ndf) file(s). lives in memory , can used when attached sql server instance.

php - Docker raspbian lighttpd container not working -

i trying create php ligttpd docker container serves hello world type page displays host. have launched page on raspberry pi when try run container version container returns error exit of 255 the command running lighttpd -d -f /etc/lighttpd/lighttpd.conf dockerfile from resin/rpi-raspbian # update system , install nginx webserver , php run apt-get update && \ apt-get upgrade && \ apt-get -y install lighttpd && \ apt-get install -y php5-common php5-cgi php5 && \ lighty-enable-mod fastcgi-php # add required files copy www/* /var/www/html copy run.sh /run.sh env listen_port=80 expose 80 cmd /run.sh run.sh #!/bin/bash lighttpd -d -f /etc/lighttpd/lighttpd.conf what causing this? there easier way this? i used /etc/init.d/lighttpd start cmd command exits container right after command finishes. update: i did not figure out solution problem have created similar image using dockercloud/hello image reference changed...

python - Does GridSearchCV call initialisers of the objects in pipeline? -

i wrote code process kaggle's titanic data. class wrote follows: class transform(baseestimator,transformermixin): def __init__(self,select_dict={},default=false,list_of_attributes=dataset_columns, one_hot_default=true,one_hot={}): if list_of_attributes none: list_of_attributes=dataset_columns self.attributes=select_dict #here select attributes take self.transformed=[] #if default false(true) changes other attributes #default not select (to make things little easy def transform_name(self,x): #transformation function specific attribute #i made such functions every attribute , append #the transformed series in self.transformed self.transformed.append(x); def transform(self,x,y=none): #this function calls transform function of value true in #self.attributes , returns dataframe return pd.concat(self.transformed_data,axis=1) i have show relevant code of cla...

Telerik MVC hierarchy grid, editor popup, get parent data in JavaScript event -

i've been doing lot of searching, , can't seem find examples work. i simplify code here have large telerik mvc hierarchy grid. here's child template few levels down, need parent information previous level. <script id="leaguetemplate" type="text/kendo-tmpl"> @(html.kendo().grid<leagueviewmodel>() .name("grid_#=leaguetypeid#") .toolbar(toolbar => { toolbar.create().text("add new league(window)"); }) .events(e => e.edit("leagueedit")) // function runs .datasource(datasource => datasource .ajax() .model(model => model.id(p => p.leagueid)) .read(read => read.action("bound_league_read", "configuration", new { _leaguetypeid = "#=leaguetypeid#" })) .create(create => create.action("league_creat...

php - Logging PDO exception to error_reporting and error_log -

currently script able display pdo exception on browser not logging error file. rather turn off browser error message using display_errors , log file using error_log instead. don't know if it's possible or if need write custom handler or it's being overridden framework. here log configuration in virtualhost. note it's logging other error messages including notices. not logging pdo exceptions. ideas? i think can ignore value of display_errors of virtualhost configuration. php_admin_flag log_errors on php_admin_flag display_errors on php_admin_value error_reporting 30719 php_admin_value error_log "/....path/php.error.log" it turns out need override exception handler independent error handler. need forward exceptions error handler. theoretically, following should implemented. <?php function exception_handler($exception) { echo "uncaught exception: " , $exception->getmessage(), "\n"; error_log(........

protractor - Angular e2e test page object initialize before all tests -

here folder structure: |-- test |-- unit |-- e2e |--suita testa.js |--suitb testb.js |--helper helper.js in helper functions: var helper = function() { console.log('load helper module'); this.listh3title = element.all(by.css('div.col-sm-3 h3')).first().gettext(); this.firstresponsivetable = element(by.css('div.responsive-table')); }; module.exports = helper; in testa.js describe('testa:', function() { browser.get(''); it('login form should present', function() { var loginform = element(by.css('form[name="loginform"]')); expect(loginform.ispresent()).tobetruthy(); }); }); in testb.js var helper = require('../utilities/helper'); var helper = helper = new helper(); describe('testb:', function() { }); the helper function run before tests. in case testa fail because can't find element ...

asp.net - How to Send Invite with Summary different from Email Subject -

Image
sending invite using alternateview class when sending email , invite using alternateview class invite description , summary equals email body , subject when hardcoded. sending invite using attachment class when invite sent attatchment text changed accordingly there no request information shown (image bellow). i solve issue either alternateviews or attachment. asp.net code //email message mailaddress emailfrom = new mailaddress("from@email.com", "from email"); mailaddress emailto = new mailaddress("to@email.com", "to email"); mailmessage mymail = new mailmessage(); mymail.isbodyhtml = true; mymail.from = emailfrom; mymail.to.add(emailto); //email subject , body mymail.subject = "email subject"; mymail.body = "<h5>emaill description</5>"; //invite stringbuilder str = new stringbuilder(); str...

user interface - Python tkinter:Update label tag , Event and label in different classes -

i have problem want update label when push on button.but event , label in different classes make hard assign it.here how try it.first event class: class eventsbinding(windowinhalt): def test(self, event): print("gedrückt") def root_destroy(self, event): self.root.destroy() def credits(self, event): window = windowinhalt() window.label1.config(text="update") #here try update label and second here class label: class windowinhalt(): def label4(self): events_binding = eventsbinding() label = label(self.root, text="credits", fg="black",bg="lightyellow", font=('arial', 14)) label.bind("<button-1>", events_binding.credits) #here assign event label.place(x=200, y=280, width="400", height="20") and here full code if need them: #mein erstes gui python programm mit tkinter #created: july,2017 #creator: yuto tk...

python - Slack Bot Creating DM Without Itself? -

i'm trying have slack bot create direct message between 2 people without bot being present. understand mpim.open command opens group direct message , can pass in users via user id, wondering if there way have bot leave direct message or create 1 without including itself? i've tried using groups.leave , didn't work. thanks!

Fastest Magento Theme installation - Couldn't proceed to the next step after readiness check -

i'm newbie in magento. i'm trying install fastest magento theme on digitalocean magento server (ubuntu). have uploaded theme files var/www/html/magento directory. when trying install theme http://myip/themesetup , cannot proceed next step after readiness check(check successful). here? in advance!

javascript - Logout on tab closed -

this question has answer here: is there way in javascript detect if unload event caused via refresh, button, or closing browser? [duplicate] 3 answers i want trigger logout when close tab of application. tried $(window).on('unload', logout); , $(window).on('onbeforeunload', logout); works fine events triggered when reload page. how can prevent on reload? before asking found options event.currenttarget.performance.navigation.type no posibility separate reload , close in way. there opputurnity trigger logout on tab closed? as per here is there way in javascript detect if unload event caused via refresh, button, or closing browser? there no way detect difference. if there other circumstances wouldn't work.

gensim - Using a Word2Vec model pre-trained on wikipedia -

i need use gensim vector representations of words, , figure best thing use word2vec module that's pre-trained on english wikipedia corpus. know download it, how install it, , how use gensim create vectors? @imanzabet provided useful links pre-trained vectors, if want train models using genism need 2 things: acquire wikipedia data, can access here . looks recent snapshot of english wikipedia on 20th, , can found here . believe other english-language "wikis" e.g. quotes captured separately, if want include them you'll need download well. load data , use generate models. that's broad question, i'll link excellent genism documentation , word2vec tutorial . finally, i'll point out there seems blog post describing precisely use case.

How to install latest allure 1 release? -

how install latest allure 1 version? since release of allure 2, references allure 1 binaries removed sources. seem not possible install allure 1 via homebrew. allure 2 great, plugins not yet compatible it. nice have convenient way install allure 1 time being. you can download allure 1 releases github https://github.com/allure-framework/allure1/releases/tag/allure-core-1.5.2

node.js - mocha test case for res.render not working -

i'm writing simple test case route. i've used mocha , chai-http , sinon check if correct page rendered or not. contact page user provides info. , contact page rendered again now. below test case : const chai = require('chai'); const chaihttp = require('chai-http'); const sinon = require('sinon'); const ejs = require('ejs'); var app = require('../app'); var path = require('path'); var fs = require('fs'); var contact = require('../models/contacts'); chai.use(chaihttp); var should = chai.should(); var expect = chai.expect; describe('contact', () => { describe('/post contact', () => { it('it should not post book without pages field', (done) => { var spy = sinon.spy(ejs, '__express'); let contact = { name: "my name", msg: "my msg" } chai.request(app) ...

c# - Sitecore throwing exception for unique index when we try to publish -

we getting exception when trying make change in existing sitecore item , publish web db. following exception- message: cannot insert duplicate key row in object 'dbo.versionedfields' unique index 'ndxunique'. duplicate key value (48338b8b-7bfb-44e4-9715-3bafc826abfe, en, 1, b05b85e8-20a6-4f1c-9a04-1645d9a262b4). the statement has been terminated. source: sitecore.kernel @ sitecore.data.dataproviders.sql.dataprovidercommand.executenonquery() @ sitecore.data.dataproviders.sql.sqldataapi.<>c__displayclass15.b__14() @ sitecore.data.dataproviders.nullretryer.execute[t](func 1 action, action recover) @ sitecore.data.dataproviders.sql.sqldataprovider.writeversionedfield(id itemid, fieldchange change, datetime now, boolean fieldsareempty) @ sitecore.data.dataproviders.sql.sqldataprovider.updateitemfields(id itemid, itemchanges changes) @ sitecore.data.dataproviders.sql.sqldataprovider.<>c__displayclass1d.<saveitem>b__1b() @ sitecor...

c++11 - how ! is different from != -

i writing function goal print list in pair of two, eg: list : 1 2 3 4 5 6 pair list: 2 1 4 3 6 5 i wrote following code: printpair(){ bool flag = 1; node *temp = new node(); node *temp2 = new node(); temp2 = null; if(!head) { printf("empty list!!"); return 0; } temp = head; while(!temp && !temp->next) //error here 1. { if(!temp2) //error here 2. temp2->next->next = temp->next; temp2 = temp->next; temp->next = temp->next->next; temp2->next = temp; if(flag) { head = temp2; flag = 0; } temp = temp->next; } } it works fine if replaced : 1. `while(temp !=null && temp->next !=null)` 2. `if(temp2 != null)` so how ! different != ? while(!temp){} execute when temp has boolean value false. while(temp != null) execute if temp has value ...

I ain't able to convert json in XML -

Image
i relative new in wso2 , having little problems. asked here, how make conversion, , able in moment. tried same code passed stack overflow: <?xml version="1.0" encoding="utf-8"?> <api context="/test" name="jsontoxmlapi" xmlns="http://ws.apache.org/ns/synapse"> <resource methods="post" uri-template="/xml/"> <insequence> <property name="messagetype" scope="axis2" type="string" value="text/xml"/> <header action="remove" name="to" scope="default"/> <property name="response" scope="default" type="string" value="true"/> <send/> </insequence> <outsequence/> <faultsequence/> </resource> </api> and send equal request, of taught before: but rece...

android - Sync server data with Mobile Application -

i have portal , mobile app i want have proper mechanism data syncing server mobile application i have 2 approches both not consistent. below scenario clear question suppose have 1 sql table testtable @ first android app call server api , server give him data in table testtable if 1 record updated in testtable when after 1 hour mobile app again call api retrieve data has been updated , yet not sent particular device question how should maintain this i have 2 approaches 1) add column name updatedatetime in testtable,and when mobile app calls api send , lastsync date time api return data updated after that 2)maintain table eg synctable keep record of each record in testtable , device , if send particular device update record synced please me in both appproches not consistent both fail ayt point is there other approach can use??? please comment if question still unclear. thanks

python - Organizing csv data and computing average grades -

i have sample csv data of classes , grades on 500 rows , looks this courseid title teacher avggpa students bs cs ds fs 101 math stevens 3.15 105 25.2 45.1 16.7 10.1 2.9 101 math stevens 2.98 95 20.2 30.1 30.5 11.5 5.4 101 math smith 3.33 120 33.1 40.1 10.2 7.6 4.3 103 english jane 3.55 108 20.5 16.2 16.5 20.5 10.2 103 english jane 3.47 100 25.2 38.0 22.0 7.0 2.0 202 science roberts 2.67 80 12.0 35.0 27.5 12.5 8.3 (pretend comma separated, typed formatting purposes. percentages don't add 100% pretend do) so far have is: with open(filename, 'rb') f: reader = csv.reader(f, delimiter=',') next(reader, none) #to skip header self.data = list(reader) case_list = [] entry in self.data: case = {'course_number': entry[1], 'course_title': entry[2], 'teacher': entry[3]... #and on e...

apache - Rails web application error on start -

i new linux , rails , trying development server , running. have installed ruby/rails , had working under localhost:3000. can create rails app , have run. i installed apache 2/passenger. when try hit ip address of machine getting following error: it looks bundler not find gem. maybe didn't install gems application needs. install gems, please run: bundle install if didn't work, problem caused application being run under different environment it's supposed to. please check following: app supposed run a-cjstewar user? app being run on correct ruby interpreter? below see ruby interpreter phusion passenger attempted use. -------- exception follows: ------- not find rake-12.0.0 in of sources (bundler::gemnotfound) /var/lib/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/spec_set.rb:87:in `block in materialize' /var/lib/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/spec_set.rb:81:in `map!' /var/lib/gems/2.3.0/gems/bundler-1.15.3/lib/bundler/spec_set.rb:81:in `mat...

exception - ConcurrentModificationException in java calculator -

i have problem in calculator tried made. first must idea, idea first separate in arraylist, example: [12, +, (, 236, -, 7, ×, 23, ), +, 5!, -, 3, ^, 5] next remove part of list , replace 1 number, if used previous example: [12, +, (, 236, -, 7, ×, 23, ), +, 5!, -, 3, ^, 5] -> [12, +, 215, +, 5!, -, 3, ^, 5] -> [12, +, 215, +, 120, -, 243] , on.. but have problem. way calculate [3, ^, 5] is: first check if there ^ in arraylist loop, , make 2 variables 1 index of first number 0 has value of 3 , 1 2 has value of 5 , make third variable answer, after turn answer double string, , remove 3 , ^ , 5 list , add answer in of first number 3 0 , problem when try turn answer string exception happen ( concurrentmodificationexception ), searched , discovered because reason can't turn variable type type in situation in. want know reason , how fix it. your problem trying modify arraylist while iterating in loop wrong, can use iterator.remove if need delete val...

Where is python on mac? (osx el capitan) -

i'm trying download pygame on computer , use it, i've seen, need 32-bit python not 64-bit 1 have. however, cannot find file on computer delete it. looked through of files name of 'python' nothing has shown 64-bit pre installed program. know how find it? type which python on terminal.

java - How can we maintain unique object list without using set? -

suppose have 2 employee instances having common attributes id,name,address (all values same ). i want unique objects list without implementing set. please don’t explain logic primitive data type ,i want uniqueness object type. simple: create "collection" class calls uses equals() method of "incoming" objects compare them against stored objects. if method gives false - no duplicate, add collection. if true - not unique. no adding. in other words - re-invent wheel , create resembles java set. of course, implicit drawbacks - such repeating implementation bugs fixed in java set implementations 15 20 years ago.

<img src> tag issue while practicing Html on macbook -

Image
can please give me clear idea on why image not show when use <img src> tag <img src="../../newimg.jpg"> image gets displayed when use <img src="../../newimg.jpg "> . got difference? image gets displayed when give space between newimg.jpg , ' " '. don't know why happens. i'm using macbook pro. tried same code in textedit , bbedit. code , image under same folder. /documents/website/index.html. /documents/website/newimg.jpg update when manually checked image file name unable identify spaces after .jpg when inspect image think found something. i think figured out. have curly quotes (“ ”) in img tag. change standard type of quotes. (" ")

javascript - How to Select HTML Elements Added Using .html() in jQuery -

i attempting make small browser game , having trouble selecting elements added using .html() in jquery. for game, use html template system templates stored in templates/%name%.txt . then, load template, use following function. function template(name) { $.get("templates/" + name + ".txt", function(data) { $(".content").html(data); }); } here example of template use: <div class="title"> <!-- fill --> </div> <table> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td>...