Posts

Showing posts from April, 2013

windows - Python console can't deal with Unicode? -

(i'm using python 3.4 this, on windows) so, have code whipped out better show troubles: #!/usr/bin/env python # -*- coding: utf-8 -*- import os os.startfile('c:\\téxt.txt') on idle works should (it opens file specified), on console (double-click) keeps saying windows can't find file. of course, if try open "text.txt" instead works perfectly, long exists. it's driving me insane. me, please. you using wrong encoding, try using cp1252 - # -*- coding: cp1252 -*-

CSS animation swaying curtains -

i have customer curtains opening on entrance page, can not flash animation, , animated gif large in file size. created set of curtains open css animation on mouseover. basic animation here http://www.nightwingsgraphics.com/curtains/curtainstest.html however, since more doors (too stiff) when open, added slight swaying motion here http://www.nightwingsgraphics.com/curtains/swaytest.html better, still stiff, , i'm lost or how add kind of "warping" (or morphing) effect make them more natural. any appreciated. ps: created jsfiddle both versions, it's not allowing me post more 2 links here :( you can use skew() transformation this #axis:hover .move-right{ transform: translate(215px,0) scalex(0.2) skew(-15deg, 5deg); } #axis:hover .move-left{ transform: translate(-215px,0) scalex(0.2) skew(15deg, -5deg); } also see chenge translate value because came out of container when applying skew() function play cubic-bezier function improve t

css - alignment of textbox and image button(asp.net) -

Image
here output of ui may make date textbox , image button align straight task name dropdown , add image button?? here code asp.net <table id="fix"> <tr> <td > <asp:label id="lblusername" runat="server" text="label" style="width:80px;"></asp:label> </td> <td> <asp:dropdownlist id="dropdownlist1" runat="server" width="200px" style="width: 150px" datasourceid="sqldatasource1" datatextfield="username" datavaluefield="username" autopostback="true" onselectedindexchanged="dropdownlist1_selectedindexchanged"> <asp:listitem></asp:listitem> </asp:dropdownlist>

tomcat - Cannot find a package in yum repo list -

i'm looking tomcat-native (centos 6) $sudo yum install tomcat-native no package tomcat-native available. error: nothing how update yum repository list? your yum configured search default yum repositories , if can't find package in repository, need specify appropriate repository hosting package. specify using https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-managing_yum_repositories.html below articles might install tomcat-native http://linuxfreaks.in/tomcat-native-library-apr-installation-on-centos/ http://blogoless.blogspot.com/2012/08/how-to-install-apache-tomcat-native.html

java - Side Collisions -

i'm making tilemap game , i've got simple collisions down. make game work have know side of rectangle hit wall/brick. putting simple collision code inside of main collision: if(spritex < brickx + brickwidth) {} doesn't work. main collision code @ moment is: for(int counter = 0; counter < 31; counter++) { if(spritex + 40 >= collisionx[counter] && collisionx[counter] + 100 >= spritex && spritey + 40 >= collisiony[counter] && collisiony[counter] + 100 >= spritey) { velx = 0; vely = 0; collisions = counter; } else { if(counter == collisions && jumping == false) { fall(); } } } if want entire class: package main; import java.awt.color; import java.awt.dimension; import java.awt.graphics; import java.awt.graphics2d; import java.awt.event.keyevent; import java.awt.event.keylistener; import java.awt

Complete Supervisor Hierarchy for an employee SQL Oracle -

how can print entire employee hierarchy each employee using oracle sql hierarchial query. sample employee table>> empid, ename, mgr 1, a, 1 2, b, 1 3, c, 2 4, c, 2 5, c, 3 sample output>> empid, ename, hierarchy 1, a, - 2, b, /1 3, c, /1/2 4, c, /1/2 5, c, /1/2/3 can me. in advance. don't have database test out on, thinking need use sys_connect_by_path , connect prior . try like: select empid, ename, sys_connect_by_path(mgr, '/') "heirarchy" employee connect prior empid= mgr;

multithreading - Substitute for async/await when C# form is closing since await never returns? -

this question has answer here: awaiting asynchronous function inside formclosing event 5 answers i have c# windows forms app launches other processes. when form closes, need shutdown processes , make sure they're gone don't hang around zombie processes. strategy send processes shutdown command on socket bridge, , wait them close gracefully. after 3 seconds however, if still around, force close them (kill them). originally used await task.delay(3000) instruction lived in form's closing event. didn't work. time await task.delay(3000) statement tried return, main thread gone code after statement force closes child processes if they're still around never executed . solve problem changed await task.delay(3000) plain thread.sleep(3000) statement. code following thread.sleep(3000) executes since thread never switched away before. howeve

haskell - How to search for matching items in a list? -

i'm doing exercise practice exam tomorrow. text tells me implement database library, define item s can books or magazines. each book save name + author. each magazine save name: data item = book string string | magazine string deriving(show) data requisition = req string item type database = [requisition] exdb :: database exdb = [req "john" (book "pf" "hs"),req "jay"(book "apple" "steve jobs"),req "francis"(magazine "forbes")] books :: database -> string -> [item] books db name = {-- what's next?-} now, need create function named books :: database -> string -> [item] , searches name on database , gives me books person requested. how do this? this straightforward using filter function: filter :: (a -> bool) -> [a] -> [a] it takes condition apply each element of list, returns list of elements meet condition. in case, want books have been

Is it possible to create a cluster in Container Engine with Cloud Deployment Manager? -

"supported resource types , properties" in https://cloud.google.com/deployment-manager/configuration/create-configuration-file has "container.v1beta1.cluster", link broken. that link fixed now: google container engine api the cloud deployment manager uses underlying apis work, if api exists, should able use cloud deployment manager it. quoting docs: remember deployment manager uses underlying apis of google cloud platform services manage resources in deployment. if api doesn't support action, deployment manager cannot perform action either. example, deployment manager can update existing resource if there update method in corresponding api. so should able create cluster cloud deployment manager.

generics - Java get the default value of a type -

so i'm writing program in java after using c# few years , can't seem find answer anywhere. when creating generic<t> class in c#, if want set variable default value of t , use default(t) . there same functionality in java , if how it? java not have equivalent facility. if want pass value generic method must pass explicitly, if you're invoking type's default constructor.

dataframe - R: Create 2 columns with difference and percentages values of another column -

i have dataframe id <- c(101,101,101,102,102,102,103,103,103) pt_a <- c(50,100,150,20,30,40,60,80,90) df <- data.frame(id,pt_a) +-----+------+ | id | pt_a | +-----+------+ | 101 | 50 | | 101 | 100 | | 101 | 150 | | 102 | 20 | | 102 | 30 | | 102 | 40 | | 103 | 60 | | 103 | 80 | | 103 | 90 | +-----+------+ i want create 2 new columns values calculated pt_a column. df$del_pt_a <- nthrow(pt_a) - 1strow(pt_a) grouped id, n = 1,2,...n df$perc_pt_a <- nthrow(del_pt_a) / 1strow(pt_a) grouped id, n = 1,2,...n here desired output +-----+------+---------+-----------+ | id | pt_a | del_pt_a | perc_pt_a| +-----+------+---------+-----------+ | 101 | 50 | 0 | 0 | | 101 | 100 | 50 | 1.0 | | 101 | 150 | 100 | 2.0 | | 102 | 20 | 0 | 0 | | 102 | 30 | 10 | 0.5 | | 102 | 40 | 20 | 1.0 | | 103 | 60 | 0 | 0 | | 103 | 80 | 20 | 0.3 | | 103 | 90 | 30

Char array not initializing empty in C -

i have char array collect names, positions not being initialized empty. if value entered, rest of positions empty, if nothing entered, positions filled "weird" characters. how can fix this? depends on how you're initializing array. statically allocated arrays (arrays outside of function not dynamically allocated): char arr[20] = {0}; void function( void ) { // stuff happens here array } for automatic arrays (arrays within scope of function not dynamically allocated): void function( void ) { char arr[20] = {0}; // stuff happens array , cannot // accessed outside function } for dynamic arrays, use calloc() dynamically allocate , initialize 0: size_t len = 20; char *arr = calloc ( len , sizeof(char)); you can use memset() clear arrays: char arr[20]; memset (arr, 0 , sizeof(arr));

javascript - Connecting nodejs to google cloud SQL -

i trying connect instance of nodejs google cloud sql database. failing. i run command node server.js and error problem mysql error: connect enetunreach here server.js file var gcloud = require("gcloud"); var express = require("express"); var mysql = require("mysql"); var app = express(); var connection = mysql.createconnection({ host : "2001:****:****:*:****:****:****:****", user : "root", password : "*****", database : "scripto_5_k" }); /* connection database */ connection.connect(function(error){ if(error) { console.log("problem mysql "+error); } else { console.log("connected database "); } }); /*start server */ app.listen(3000,function(){ console.log("its started on port 3000"); }); i have gone sql database in developers console , allowed ip address of home , node js instance cant seem find problem. any appreciated. update 1 i pinged ipv6 address result c:\us

java - Which API to use to find Geofence Breach in the direction from start to end -

i have used google direction api calculate duration , distance start end destination. how find device has come closer destination without looking @ distance. how know device has breached geofence in 200 meters radius. how achieve without using android sdk. want calculate distance , beep once device breaches geofence.

On demand Publish on Meteor? -

is there way publish updates collection on demand? (e.g. send updates every 5 seconds?) i publishing leaderboard, shows the top 50 players (have points) in game. updates users' points happen frequently, leaderboard changes (every 1-5 seconds). every minute or so, server updates points ~100 user in foreach loop. problem publish methods start updating right away, before 100 elements have been updated. creates painful performance issue (publishing updates users multiple times)... is there way hold publish until updates done? or way update published data every 5 seconds instead of immediately? thanks help! :) create custom publication , take control! var pubshandlers = []; meteor.publish('totalscore', function() { this.added('someclientcollection', 'totalscoreid', { totalscore : somegettotalscorefunction() }); pubshandlers.push(this); //maaaaybe not cleanest thing do. this.ready(); }); meteor.setinterval(function updatescores()

ms access - SQL Update query on query result -

i have 2 tables like: table 1 sid sdefinition cvalue 4057 s1 32 4058 s2 4059 s3 6 4060 s4 mapping_tbl sid sinid ecfid sid-sinid 4057 1099 4027e 1099_4057 4058 1099 4027e 1099_4058 4059 1121 4003e 1121_4059 4060 1121 4003e 1121_4060 query1 select mapping_tbl.sid, table1.sdefinition, table1.cvalue table1 inner join mapping_tbl on table1.sid= mapping_tbl.sid; query1(result) sid sdefinition cvalue 4057 s1 32 4058 s2 4059 s3 6 4060 s4 i have situation wanted update query table (query1) i.e set field(cvalue) 0 if contains null. using update query like update query1 set cvalue = 0 cvalue null; the query table (query1) gets updated , sets cvalue 0 if contains nulls, , updates(set 0) table1 cvalues null. how can avoid updating table1? suggestions. it seems don't want change values stored in table, ,

python - Adding tags to mp3 with eyed3 results in no change -

i trying add tags (title, genre, etc.) mp3 file downloaded created urllib in python. using eye3d , example website, program runs without errors, doesn't seem anything. when checking details of file, title, artist , else stays empty before. using example: import eyed3 audiofile = eyed3.load("song.mp3") audiofile.tag.artist = u"nobunny" audiofile.tag.album = u"love visions" audiofile.tag.album_artist = u"various artists" audiofile.tag.title = u"i girlfriend" audiofile.tag.track_num = 4 audiofile.tag.save() am missing something? i had same problem. worked me add file's path in save() function: audiofile.tag.save(filename) in example filename "song.mp3".

javascript - XML3D: XFLOW syntax -

i have 2 question regarding xflow syntax: can use xflow data gained <assetdata> node? what difference between <data> , <assetdata> seem 2 have same functionalities. or in other words assetdata node considered datacontainer . right main difference between <data> , <assetdata> includes attribute, can reference <assetdata> 's name attribute , scoped enclosing <asset> . designed way make possible nest assets or declare many assets in same document without having worry making sure ids may use unique (like if use src attribute of <data> elements, reference html id). the other differences are: you can't nest <assetdata> elements. can same functionality using includes attribute though. <assetdata> elements can used inside <asset> element aside work <data> elements do, can give them compute operators or nest other data inside them or overwrite data <data> elements. may

python - Checking the language of extracted trends from twitter -

i extracting top hashtags twitter using tweepy module in python. there 1 major problem face, wish check if tag in english or not. tags not in english should removed. example: tags=['askorange','charlestonshooting','replytoasong','uberlive','otecmatkasyn'] should not have otecmatkasyn . what need use language detector api. 1 one offered google , not free. option language detection api . after choose best api you, you'd need parse text makes sense sentence. example, tag 'askorange' must split read 'ask orange' . can iterate on each character of string, check if uppercase , insert space there: new_tags = [] tag in tags: new_word = tag uppercases = 0 # in case sentence has several uppercases in xrange(1, len(tag)): if tag[i].istitle(): new_word = new_word[:i+uppercases] + ' ' + new_word[i+uppercases:] uppercases = uppercases + 1 new_tags.append(new_wor

Android armeabi devices with API level 15+ -

i'm developing app api level 15+ has jni code , i'm wondering if there devices armeabi abi (armv5) , api level 15+ can include armeabi-v7a , x86 libraries , skip old armeabi? android doesn't support arm versions below armv7 android 4.4 (api level 19). since android 4.0 (api level 15), doesn't support armv5/armv6 default can modified build platforms (see https://groups.google.com/d/msg/android-building/q_gu1zb6dlc/bq5qryioq_kj ), , there custom builds run on armv6. i'm not entirely sure if there official, certified compatible devices run such combination (android 4.0-4.3) though - there should @ least not such certified devices running android 4.4, since compatibility definition document strictly requires armv7 version. so in practice should pretty safe skip it, might exclude fringe third party roms doing that. see https://stackoverflow.com/a/28926267/3115956 similar answer similar question.

vba - how to count duplicate names excel -

i have single column of data in column looks this: joe joe joe john john josh josh josh josh can please provide me code sum number of joes, johns, , joshs , put sum each name in adjacement column. thank in advance! huge help.. have 5000 rows of names [note] the meaning of question has been change. answer refer original version of question. you can use dictionary class count of each name in string . please, see: 'needs reference sctipting runtime dll sub dosomething() dim s string, result() string dim integer, counter integer dim dic dictionary, k variant s = "joe joe joe john john josh josh josh josh" result = split(s, " ") set dic = new dictionary dic .comparemode = binarycompare = lbound(result) ubound(result) if not .exists(result(i)) .add key:=result(i), item:=1 else k = dic(result(i)) dic(result(i)) = k + 1 end if next end each k in dic.keys

algorithm - Combining daily Welford computed variance into monthly -

i'm using welford's method compute running variance , standard deviation described many times on stack overflow , john d cook's excellent blog post . i store timestamp, count, sum, , running calculation of "sk" , stdev in database table per day. i combine or rollup daily computed count,sum, , sk values monthly standard deviation. john d cook's blog has another post provides algorithm combine 2 "runningstats" 1 (see operator+ method). works combining 2 days 1. use iterate through days combine days in month. however, unlike calculating daily stdev have large number of samples must dealt in streaming fashion, have access daily data, , single formula combine days in month @ once. lend creation of database view. it not appear summing sk values , dividing total monthly count - 1 produces accurate variance. example data: date, count, sum, sk, stddev 1-jun-15, 60, 514, 1556.733336, 5.14 2-jun-15, 51, 455, 1523.686274, 5.52 3-jun-15, 61,

MySQL Query fails. Error message does not show my full query--cuts off at string -

when attempt run following query in phpmyadmin or directly in cli, delete mdl_enrol n1 n1.id > ( select n2.id mdl_enrol n2 n2.enrol = "database" , n1.id > n2.id , n2.courseid = n1.courseid ) , n1.enrol = "database" i following error message: #1064 - have error in sql syntax; check manual corresponds mariadb server version right syntax use near 'n1 n1.id > (select n2.id mdl_enrol n2 n2.enrol = "da' @ line 1 if run command select * works fine , returns right number of rows. why keep cutting off partway through string "database"? as mentioned in comments, mysql doesn't return whole query in error message. , don't need know query submitting (if done e.g. via php, "echo" query before executing). mysql returns query first character caused error. in case, error in ... mdl_enrol n1 ... . according mysql manual , in delete syntax, not allowed specify table aliases in select queries. h

jquery - On iOS Safari, using radio button to toggle dom breaks radios/checkboxes -

the following code works fine on browsers except safari on ios (haven't tested android yet). simple enough concept. when user clicks radio option, toggle class change additional fields shown. works first time, after change once, radio buttons , checkboxes become unclickable. here's code looks like.. html: <div class="form-group col-xs-12 checklist patientorother"> <p>will cd going (the patient) or facility/clinician?</p> <label for="patient"><input type="radio" name="topatientorother" id="patient" value="patient" checked>to patient (myself)</label> <label for="other"><input type="radio" name="topatientorother" id="other" value="other">to facility/clinician</label> </div> <div class="topatient"> <p>info needed when going patient</p> </div> <div class="

javascript - Detecting ctrl+z (and other control combos) in paper.js -

i'm trying enable editing commands in paper.js application (such ctrl+z 'undo'). detecting individual letter keys works great, , can detect modifier keys held during mouse events, i'm having trouble writing event handler detects combinations of ctrl , letter keys. based on the examples given fabric.js , expect key handler looks this: function onkeydown(event) { if (event.key == 'z' && event.modifiers.control){ //do thing! } } however, doesn't work! weirdly enough, conditional block never fires. investigate this, wrote following diagnostic handler... function onkeydown(event) { console.log(event.key); console.log(event.modifiers.control); } ... , tried out various keyboard inputs interesting results: //ctrl key key: control control: true //z key key: z control: false //z key pressed while holding ctrl key: control: true these results suggest string returned event.key different depending on whether control

interrupt - Why page fault is considered as trap -

why page fault considered trap instead of interrupt? , stages take place when try access null pointer until segmentation fault? , signal sent in situations sigill, right? thanks! a trap exception in users-pace caused user-space program. in specific case user-space program accessed page not mapped using memory management unit (mmu) , therefore caused trap. interrupts on other hand generated external hardware events, such timer.

node.js - Need to parse live json file using Socket io -

first heads up! new world of node.js , socket.io have json file contains following data example:- { "football": { "id": 1, "home": "liverpool", "away": "chelsea", "score": "1-0", "last scorer":"gerrard" } } this file updated live on few seconds basis. what want achieve parse json , update same html on client side, in addition want listen changes in json file , update same again html client side. how can achieve this, sorry if question seemed dumb enough, suggestion can help. (sorry little-detailed answer, i'm having computer problems , it's hard much; i'll edit after they're resolved , stops crashing) to change in file, try like: monitor file change through ajax, how? or check if file has changed using html5 file api server file: var eventemitter = require('events'

java - Android RecyclerView isn't restored on rotate -

when rotate app content disappears, have recyclerview card list obtains content external db using json , webservice. trying save content in following way: @override protected void onsaveinstancestate(bundle outstate) { super.onsaveinstancestate(outstate); if(items != null) { outstate.putparcelablearraylist("items", items); items = null; } } @override protected void onrestoreinstancestate(bundle savedinstancestate) { super.onrestoreinstancestate(savedinstancestate); if (items == null) { items = savedinstancestate.getparcelablearraylist("items"); recycler.setadapter(adapter); } } but still same problem occurs. my mainactivity.java file: public class mainactivity extends appcompatactivity { drawerlayout drawerlayout; toolbar toolbar; actionbar actionbar; intent intent; private sqlitehandler db; private sessionmanag

actionscript 3 - A movie clip above a simple button makes it unresponsive -

i have designed menu in flash cc consists of several cloned buttons , mc containing text supposed stay above buttons. each time user switches menu's page, commands clip switch appropriate frames, therefore changing text above buttons. , here's catch: whenever roll cursor on text itself, button not recognized rolled over. makes feel ugly , looks unprofessional. tried setting text mc's alpha 99 no effect. know can make lot of same buttons, each different text, tells me there more efficient way of doing this. ideas? a simple solution disable mouse events on text movie clip: mymovieclip.mouseenabled = false; mymovieclip.mousechildren = false;

c# - Converting Input.GetAxis to touch screen -

i created pong game in unity using c#. works on computer work on windows phone. believe have change input.getaxis kind touch control don't know how do i'll post code here paddle. other paddle ai. public float paddlespeed = 1; public vector3 playerpos; void update () { float ypos = gameobject.transform.position.y + (input.getaxis ("vertical") * paddlespeed); playerpos = new vector3 (-315, mathf.clamp (ypos, -148,148),0); gameobject.transform.position = playerpos; } you might need add conditional compiler directives. see page: http://docs.unity3d.com/manual/platformdependentcompilation.html so: #if unity_wp8 // touch code windows phone 8 #else // other platform #endif for touch input should go @bart's comment.

html - md-select - how to force required? -

how force md-select in multiple mode behave like <select multiple required ... > ? here fiddle, show mean. in example, browser doesn't let me submit form without selecting @ least 1 option select tag. i want md-select behave similarly, don't know how can - neither putting 'required' attribute nor adding 'ng-require' directive helps. you can rely on angular validation this, rather browser. here's forked example: http://codepen.io/anon/pen/rvglzv specifically: <button type="submit" ng-disabled="myform.$invalid">submit</button> to keep submit button disabled until form valid and, <form novalidate name="myform"> to name form , tell browser not own validation on it. you add css class ng-invalid show red around invalid fields. edit: make sure put ng-model on <select multiple> , otherwise required attribute won't work.

c - Magnitude of numbers -

problem : determine number of pos, neg , zeros entered user. code in c: #include <stdio.h> void main() { int pos, neg, 0 = 0 ; char x[7] ; int num = 0 ; printf("\npress q quit anytime"); while( printf("\n") , gets(x)) { num = atoi(x) ; if( !strcmp(x , "q")) break ; if( num > 0) pos++ ; else if (num < 0) neg++ ; else zero++ ; } printf("\npos nos: %d \tneg nos: %d \tzeros: %d", pos, neg, zero); } here, although neg , zeros being counted appropriately, positives not. shows positive numbers offset of 4196240 ie if there 4 positive numbers, show 4196244. whats special 4196240? , why showing this? you need initialize of counting variables. declaration initializes zero , leaving pos , neg uninitialized. int pos = 0, neg = 0, 0 = 0 ; whats special 4196240 ? , why showing ? it happens value when not initialized you, there's nothing speci

javascript - Using ajax to pass time in seconds to div -

i'm trying use ajax pass time in seconds div div id of 'seconds', reason it's not passing div. please take @ code: testing1.php <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type = "text/javascript"> function timeoutajax(url,id,timeout) { $.ajax({ type: "post", url: url, error: function(xhr,status,error){alert(error);}, success:function(data) { document.getelementbyid( id ).innerhtml = data; settimeout(function() { timeoutajax(url,id,timeout); }, timeout); } }); } timeoutajax("testing2.php","seconds",1000); <div id = "seconds"></div> </script> testing2.php <?php $date = date("s"); echo $date; ?> put div after closing script tag. </script> <div id = "seconds"></d

objective c - Convert Obj C code to Swift weak self -

i using code here i'm having difficulty convert the __weak __typeof(self) weakself = self; to swift. there way me convert following code swift? i'm stucked convert swift after reading material said [unowned self] or [weak self]. __weak __typeof(self) weakself = self; uiviewcontroller *controller = [self.gamingpageviewcontroller viewcontrolleratindex:index]; [self.gamingpageviewcontroller setviewcontrollers:@[controller] direction:(self.gamingpageindex<index)?uipageviewcontrollernavigationdirectionforward:uipageviewcontrollernavigationdirectionreverse animated:no completion:^(bool finished) { // method not mess view order in pageview uipageviewcontroller* pvcs = weakself.gamingpageviewcontroller; if (!pvcs) return; dispatch_async(dispatch_get_main_queue(), ^{ [pvcs setviewcontrollers:@[controller] direction:uipageviewcontrollernavigationdirectionforward

php - Echo JSON encode not echoing anything -

this working absolutely fine until today when stopped working... (i know isn't helpful i've looked around everywhere) i'm iterating through values returned mysql query , putting each of them array placed inside array. try jsonencode array , echo that, no longer works. $rows = array(); while(($row = mysqli_fetch_array($result))) { $record = array("id" => $row[0],"image" => $row[1]); $rows[] = $record; } echo json_encode($rows); this literally returns blank page. vardump of $rows variable shows it's populated of arrays array (size=50) 0 => array (size=2) 'id' => string '13847519' (length=8) 'image' => string 'path image' (length=13) 1 => array (size=2) 'id' => string '73829485' (length=8) 'image' => string 'path image' (length=13) ... any appreciated! i'm confused! json_en

c# - XMLException when processing RSS -

i've been trying process rss feeds using argotic newsreader application. of them works fine, on feed ( like this ) breaks following: additional information: security reasons dtd prohibited in xml document. enable dtd processing set dtdprocessing property on xmlreadersettings parse , pass settings xmlreader.create method. the error straightforward, passed xmlreadersettings object dtdprocessing enabled. following appeared: an unhandled exception of type 'system.xml.xmlexception' occurred in system.xml.dll additional information: ';' character, hexadecimal value 0x3b, cannot included in name. line 9, position 366. the code using: xmlreadersettings settings = new xmlreadersettings(); settings.ignorecomments = true; settings.ignorewhitespace = true; settings.dtdprocessing = dtdprocessing.parse; xmlreader reader = xmlreader.create(this.url, settings); rssfeed feed = new rssfeed(); feed.load(reader); what mis

python - How can I scrape the correct number of URLs from an infinite-scroll webpage? -

i trying scrape urls webpage. using code: from bs4 import beautifulsoup import urllib2 url = urllib2.urlopen("http://www.barneys.com/barneys-new-york/men/clothing/shirts/dress/classic#sz=176&pageviewchange=true") content = url.read() soup = beautifulsoup(content) links=soup.find_all("a", {"class": "thumb-link"}) link in links: print (link.get('href')) but i'm getting output 48 links instead of 176. doing wrong? so did used postmans interceptor feature @ call website made each time loaded next set of 36 shirts. there replicated calls in code. can't dump 176 items @ once replicated 36 @ time website did. from bs4 import beautifulsoup import requests urls = [] in range(1, 5): offset = 36 * r = requests.get('http://www.barneys.com/barneys-new-york/men/clothing/shirts/dress/classic?start=1&format=page-element&sz={}&_=1434647715868'.format(offset)) soup = beautifulsou

r - Error in UseMethod("xtable") -

i trying load multiple files , merge using reduce function... tried several options got same error got 'xtable' applied object of class "character" server.r library(shiny) shinyserver(function(input,output) { output$data <- renderui({ res <- lapply( 1:input$fnos, function(i) { fileinput(paste("file", i), "load file", accept=c( 'text/csv', 'text/comma-separated-values', 'text/tab-separated-values', 'text/plain','.csv','.tsv' ))} ) do.call(sidebarpanel,res) }) output$multi <- rendertable({ infile <- list( lapply(1:input$fnos, function(i) {input[[paste("file",i)]]}) )[[1]] # data frame names df <- (letters[1:input$fnos]) # trying

Edit title slide of R Markdown Slidy Presentation -

is there way edit title slide of r markdown slidy presentation? able add header, footer, , custom css: title: "slidy template" author: "" date: "june 18, 2015" runtime: shiny output: slidy_presentation: css: ./styles/slidy_styles.css includes: after_body: ./styles/doc_suffix.html before_body: ./styles/header.html but can't figure out how either add besides title, author, , date slide, or else replace standard slidy title slide custom html template, header , footer. is there way this? you can modify part title page in pandoc slidy template , found pandoc -d slidy . $if(title)$ <div class="slide titlepage"> <h1 class="title">$title$</h1> $if(subtitle)$ <h1 class="subtitle">$subtitle$</h1> $endif$ <p class="author"> $for(author)$$author$$sep$<br/>$endfor$ </p> $if(date)$ <p class="date">$date$</p&

javascript - HTML Form not passing inputs added dynamically from jQuery -

i'll keep short , simple, i've browsed , browsed around here , other sites unable find solution issue: i've got html form works fine. update i'm doing allows end user add new tr dynamically table contain 4 input fields. each input field has name, id, , class set. (this 1 of solutions posting.) there's span user clicks creates new tr inputs. functionality of works perfectly, , new tr gets created , inputs there , need them to. however, when submit form, doesn't recognize dynamically created inputs. i've debugged in both chrome , ff, can see other form elements being passed through, except dynamically created elements. way i'm trying reference data on receiving page not issue (another solution user having same issue,) since data isn't being passed in first place. if serialize form , alert before submitting it, not pick on dynamically created elements. below jquery code, appreciated, , in advance! var kit_rows = 0; var btn_add_rows_i = 1; va

android - Difference between FILE_URI and NATIVE_URI in cordova plugin camera -

what different between file_uri , native_uri in cordova plugin camera? there 3 options, , understand different per platform: camera.destinationtype.file_uri 'file://' ios 'content://' android camera.destinationtype.native_uri 'assets-library://' ios 'content://' android camera.destinationtype.data_url 'data:image/jpg;base64,' if want convert them other urls can use file plugin: https://github.com/apache/cordova-plugin-file navigator.camera.getpicture(function (path) { window.alert('getpicture.success: ' + json.stringify(path)); window.resolvelocalfilesystemuri(path, function (fileentry) { window.alert("success: " + json.stringify(fileentry)); }, function (e) { window.alert("error: " + json.stringify(e)); }); }, function (e) { window.alert('getpicture.error: ' + json.stringify(e)); }, $scope.options); here documentation options: https

salesforce - Loading CSS in lightning component as static resource? -

i got salesforce design system pilot morning's webinar. uploaded package (as 'sds.zip') static resource. i'm calling css (immediately after '' in .cmp file) with: <link href='/resource/sds/index.scss' rel="stylesheet"/> however when attempt save error: failed save undefined: no component named markup://use found : [markup://c:contactlist]: source ​i think 'use' error refrence code block, later in .cmp file: <svg aria-hidden="true" class="icon icon--large icon-standard-user"> <use xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#user" /> </svg> i assume i'm importing css incorrectly, what's right way it? you importing css correctly. that's way inside lightning component. inside visualforce page <apex:stylesheet value="{!urlfor($resource.sds, '/resource/sds/index.css')}" /> . the problem not css import vf not u

java - RestFul web service which reads properties file -

i have got couple of jersey rest web services sendpassword , resetpassword purpose send email . for sending email , have configured properties file under tomcat , works fine the code of sendpassword.java way @path("/sendpassword") public class sendpassword { @get @produces("application/json") public string sendpasswordtoemail(@queryparam("empid") string empid) throws jsonexception { try { sendemailutility.sendmail("weqw","2312"); } catch(exception e) { } } sendemailutility.java public class sendemailutility { public static string sendmail(string sendemalto,string generatedpwd) throws ioexception { string result = "fail"; file configdir = new file(system.getproperty("catalina.base"), "conf"); file configfile = new file(configdir, "email.properti

php - Date_default_timezone wrong -

i looking bug real long time. discovered it, cant fix myself. im using date_default_timezone_set function, , set europe/amsterdam. when echo this: echo date_default_timezone_get() . ' => ' . date('e') . ' => ' . date('t'); echo date('y-m-d h:i:s', time()); the response follow: europe/amsterdam => europe/amsterdam => cest2015-06-18 05:44:21 as see no problem, in fact there is. because in amsterdam 17:44:21 atm, date okay, time isn't. someone had bug before or how can solve problem? thanks in advance! from date manual: h 12-hour format of hour leading zeros 01 through 12 h 24-hour format of hour leading zeros 00 through 23 use h instead of h in format string.

lucene.net - Choose Lucene or Solr -

we need integrate search engine in our plataform catalog management software in share point. information stored in multiple databases , storage of files ( doc , ppt , pdf .....). our dev platform asp.net , have done pre-liminary work on lucene, found good. however, came know of solr. need continue using lucene, need defend solr. please accepted. , sorry english. lucene full-text search library used provide search functionalities application. can't used application itself. solr complete search engine built around lucene providing search functionalities , others. solr web application can used without development around it. if need search engine called application recommend use solr.

c# - CreateMediaWithIdentity/CreateContentWithIdentity without raising events in Umbraco -

i using umbraco 7 , have written custom code on following events umbraco.core.services.mediaservice.saved += new umbraco.core.events.typedeventhandler<imediaservice, umbraco.core.events.saveeventargs<imedia>>(mediaservice_published); umbraco.core.services.contentservice.saved += new umbraco.core.events.typedeventhandler<icontentservice, umbraco.core.events.saveeventargs<icontent>>(contentservice_published); for content, generating media folder , vice versa. the following code causes other method fired. var newcontent = contentservice.createcontentwithidentity(mediaitem.name, obj.id, "somecontentalias"); and... var newmedia = mediaservice.createmediawithidentity(contentitem.name, obj.id, "somemediaalias"); i have used save method update nodes before, , has parameter of raised events... contentservice.save(contentitem, 0, false); is there way can create new media item identity , suppress event being raised? no,

javascript - Expand Child Rows of Responsive Datatables automatically -

i have responsive datatable ( responsive doc. ) in following format: var datatableinfo = j$('[id$="datatableinfo"]').datatable({ responsive: { "autowidth": true, details: { type: 'column', target: 0 } }, columndefs: [ { classname: 'control', orderable: false, targets: 0 } ] }); i fill data through search external data source , have second table inside datatable additional data (in child row) comes automatically instaniation. can click on icon in first column expand , show child row, works fine. what want accomplish automatically expand child rows through javascript of datatable, once data has been loaded (i know when occurs in callback function). i have tried multiple variation of followi

c++ - How to mock classes already compiled into a library? -

our code base has collection of components. each component contains "common"/reusable code in form of independent projects built static libraries. examples of components: ui widgets, containers, networking, etc. when write unit test our ui widgets, building executable links against "ui widgets" static library. when comes mocking, makes things complicated. normal mocking methods i've read (dependency injection / inversion of control) demonstrated in such way seems difficult (if not impossible) when code being mocked has been compiled. if ui widgets static library contains implementation of 20 classes, might need mock 5 of those. need somehow tell test executable use 15 symbols static lib ignore 5 (and favor mocked implementations in either library or ideally compiled test executable directly). how can mock classes in static library effectively? can think of ways using runtime polymorphism + interface pattern, i'd love able mock using templates wel

How to design database agnostic references in DDD -

Image
while working on separating applications data domains , make them work independently 1 cannot avoid references other domains. while data domain should accessible via api couldn't find answer on how design reference between domains are they api centric database agnostic not losing database functionalities grouping the image should visualize intend, though right approach here? when multiple systems have interact each other, i'd recommend using guids store references between them. as per description, guids used globally uniquely identify something, regardless of , it's stored. if have multiple systems storing data in different places, , you'd need merge/group them , ensure uniqueness, use guids. are: unique across tables, databases, servers, can safely join/merge data stored in different places predictable, no need insert in table generate it no need of central authority, if multiple systems registering orders, example, , need share them, th