w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Wordpress: Timezone issue of published field (Atom Publishing Protocol Plugin)
Replace get_publish_time() function in wp-content/plugins/atom-publishing-protocol/class-wp-atom-server.php with following code: /** * Retrieve published time to display in XML. * * @since 2.3.0 * * @param string $published Time string. * @return string */ function get_publish_time($published) { $pubtime = DateTime::createFromFormat(DateTime::RFC3339, $published); if (!$pubtime) { return array(current_time('mysql'),current_time('mysql',1)); } else { $localtime = $pubtime->format("Y-m-d H:i:s"); $pubtime->setTimezone( new DateTimeZone('UTC') ); $gmttime = $pubtime->format("Y-m-d H:i:s"); return array($localtime, $gmttime); } } Notice Requires PHP >= 5.2 If wp-app.php still exists, the plugin is not used. Reason

Categories : Wordpress

Using Javascript to pull data from an RSS Atom feed
Two things to check for starters: 1) Your NewsFeed.aspx needs to be hosted at exactly the same protocol, sub-domain, domain, and port as the page calling it. Otherwise browser security kicks in and prevents you from using an XHR. If you're trying to read a 3rd party RSS feed you may need to use a proxy. 2) The content-type header of the response needs to be text/xml. There are ways to get around this, but it's better if the content-type is accurate.

Categories : Javascript

Android Emulation Issue; Application working on ARM system image but not Intel Atom system image
Well this somehow resolved itself (no idea how). If you run into this issue just be patient and keep developing in your ARM image for a while, then check the Intel image once every few minutes for me it just started working again after about 45 minutes.

Categories : Android

Clojure - is this an appropriate use of an atom?
Your approach using an atom is fine and looks good and clojurish. If you are looking for other approaches as well; since you can split your problem into some code that will produce and answer (your visitor) and some other code that will need the answer when it is available, Clojure's promise and deliver functions may be well suited. If you create the promises in the let block, then have the visitor deliver the results to the promise.

Categories : Clojure

Atom:link in RSS using Rome
The blog post Adding Atom links to an RSS feed generated by ROME answers exactly that question: there is no build-in immediate support for Atom elements inside an RSS feed ... I’ve implemented an AtomContent class that holds a list of com.sun.syndication.feed.atom.Link but is easy extensible. The code is published as https://github.com/michael-simons/java-syndication .

Categories : Java

Ruby RSS/Atom documentation
RSS and Atom it only xml-document with known shema, which included some xml-tag: author, category. Therefore you can use any ruby library for generate xml. For example or nokogiri. Builder github For example: require 'builder' class Rss def initialize(hash) builder = Builder::XmlMarkup.new builder.instruct! :xml, :version => "1.0" builder.rss :version => "2.0" do builder.channel do |b| hash.each do |key, value| b.tag!(key) { value } end end end builder end end #hash of nodes with values rss_hash = {:title => "Some Title", :link => "http://example.com", :description => "foo bar"} Rss.new(rss_hash) #=> "<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title></t

Categories : Ruby

Converting value of a term to an atom
I think you are doing more complicated than necessary: animals_that_are(mammal, [lion, elephant, dog]). animals_that_are(reptile, [lizard, turtle]). does_animal_belong_to_group(Animal, Group) :- animals_that_are(Group, Animals), member(Animal, Animals). ?- does_animal_belong_to_group(lion, mammal). true ; false. Also, I would change the style of those facts, tentatively, the predicate naming should reflect the positions of arguments: animals_group([lion, elephant, dog], mammal).

Categories : Prolog

RSS == Atom? Issues when getting/parsing
Kind of obvious solution, the data variable was already an xml object, so I could traverse it with jquery: $(data).find('entry').find('author').text();

Categories : Jquery

ATOM XML is not accepted by IBM Connections Server
There are two things you want to double check 1) I wonder if you need an id element in the atom entry, in the example of Connections forums API document, no id is provided 2) I notice you use the topic uuid in ref="urn:lsid:ibm.com:forum:ee5878b5-65d4-4d44-8192-367e49c30e91" , in fact, you should use the correct forum uuid instead of the topic id.

Categories : Misc

How To deserialize an Atom feed using DataContracts
I don't have enough reputation to comment, or I otherwise I would have asked for clarification in the comments... As per your example XML that you have to deserialize, the double quotes (") are escaped in the version, encoding and id attributes. As shown, this is not valid XML. Is the XML an output of your own program? If so, find where it is escaping the characters and prevent it from doing so when writing the output. If that is the file you have to work with, then I suggest removing all backslashes escaping a double quote: // We have to escape the backslash and the quote both, with a backslash xmlString.Replace("\#","#"); Perhaps that solves your problem? Lastly, you only mention that your code is 'failing', and fail to provide any kind of exception or error message... Please prov

Categories : C#

Trying to Save Gmail Atom Feed to XML - C#
I have tried the code and it works fine (but I have no proxy in my network). I have changed the GmailHandler.cs, the constructor now accepts a internet proxy. using System; using System.Data; using System.Xml; using System.Net; using System.IO; /* * this code made by Ahmed Essawy * AhmedEssawy@gmail.com * http://fci-h.blogspot.com */ /// <summary> /// Summary description for Class1 /// </summary> public class GmailHandler { private string username; private string password; private string gmailAtomUrl; private string proxy; public string GmailAtomUrl { get { return gmailAtomUrl; } set { gmailAtomUrl = value; } } public string Password { get { return password; } set { password = value; } } public

Categories : C#

How to find element in atom xml file jquery?
You have to escape the colon (:) with a double backslash () : $(xml).find("d\:Message") For more information, see jQuery XML parsing with namespaces

Categories : Jquery

Adding categories to an Atom feed from Rails
This is what I ended up using. This actually gets 2 different models into the feed. views/entries/feed.atom.builder atom_feed language: 'en-US', schema_date: 2013 do |feed| feed.title @title feed.updated @updated @entries.each do |e| next if e.updated_at.blank? feed.entry e do |entry| entry.title e.name entry.summary e.summary.blank? ? truncate("#{strip_tags(e.content)}", length: 140, separator: ' ') : strip_tags(e.summary), type: 'html' entry.content e.content, type: 'html' entry.author do |author| author.name e.user.name end e.categories.map {|c| c.name}.each do |t| entry.category term: t, label: t, scheme: root_url end entry.category term: 'blog', label: 'blog', scheme: root_url end # end feed.entry

Categories : Ruby On Rails

Best way to remove item in a list for an atom in Clojure
Sure, you can use swap!, see A. Webb's answer. You might want to consider whether it's the best choice to store you clients in a list; a set or a map would be a more natural choice (for use with disj / dissoc). (Unless there is always a very small number of clients, in which case it may make sense to use the least complicated data structure available.) Also, the dosync does nothing here. dosync is for use with Refs (and alter, commute, ref-set, ensure). I'll also point out that if you run a loop like this: (doseq [c @clients] ...) then it'll always loop across the value of clients at the time the doseq form was entered, regardless of any swap!s to the clients Atom which might have occurred in the meantime. Not that it's likely to be a problem, just something to keep in mind. Anot

Categories : Multithreading

Atom Feed shows header but no posts
If you are trying to get the article content, use $item->get_content(); instead of $item->get_description(); The feed you listed also does not have any articles. If you paste it directly in your browser you will see the feed page with no content.

Categories : PHP

AngularJS JSONP issue
It is easier to deal with JSONP request using $resource. app = angular.module('myApp', ['ngResource']) app.service('calendarFactory', function ($resource, $q) { return { query: function () { return $resource(URL, { get: { method: 'jsonp' } }); } } }); function Ctrl($scope, calendarFactory) { $scope.eventSource = calendarFactory.query().get(); }

Categories : Jquery

Search.twitter.com Atom Feed doesn't work (?)
This API has now been retired: Requests to search.twitter.com/search.* will receive HTTP 410 Gone. Use GET search/tweets instead. note also that: JSON is API v1.1's only output format. XML, RSS, and ATOM response formats will be retired along with API v1.

Categories : Twitter

ld: Assertion failed: (src.atom != NULL), function addRelocFixup
I was having this issue with the Bump library on my simulator. This thread provides a simulator friendly version of the lib: https://github.com/bumptech/bump-api-ios/issues/15

Categories : IOS

BTC Guild API Parsing Issue with AngularJS
A couple of notes: You're going to get a "Cross Origin Request" error. Here's a snippet of the response after fixing it: OPTIONS https://www.btcguild.com/api.php?api_key= No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://fiddle.jshell.net' is therefore not allowed access. Take a look at these notes on how to properly format a JSFiddle for Angular: Frameworks & Extensions should be No Library - pure JS, and No wrap, in . Also, you'll want to put this under Fiddle Options: Body Tag <body ng-app="BTCGuild"> Here is the updated JSFiddle: http://jsfiddle.net/bX3ar/14/ If you can get through the CORs issue, you'll see this work. Or if you put in a fake response, you can see it display properly.

Categories : Angularjs

Naming issue with AngularJS controllers
Oh, I found it. It seems that the bootstrap angular directives are already defining a controller called "TabsController", so that is where the conflict is. I didn't find this conflict when I was looking for an existing object called "TabsController" in the debug console, but that is of course because it was not declared as a global variable inside the bootstrap directive.

Categories : Javascript

some issue about "angularJS work with Plupload
Might be an issue with the iterator and the fact you are changing the list as you browse it. You may try to replace : **angular.forEach($scope.uploader.files, function(v, k) { $scope.uploader.removeFile(v); $scope.fileLength = $scope.uploader.files.length; });** with : $scope.uploader.splice(0); // $scope.uploader.splice(); should work too $scope.fileLength = $scope.uploader.files.length; Hope this will help

Categories : Javascript

AngularJS view rendering issue
I am not able to figure out what exactly you mean by the "..data is still there but the element is empty.." - the only issue that I find with the rendering by AngularJS is that the "Review" (button?) is overwritten with the number. Looking at your code (which, as @Wingman4l7 suggests needs to be posted in the question rather than as a image), I see that you are using bindings to define a class dynamically. Instead, can you use the ng-class directive and see if it resolves the issue? That is, replace: <div class="cd-rating {{caseData.scoreClass}}"> with <div class="cd-rating" ng-class="caseData.scoreClass"> instead and check if the issue gets resolved?

Categories : CSS

Back button angularjs issue
You're setting your url via the href attribute in your link tag. Try using ng-click and the $location object to set the browser's url. <div ng-controller="myCtrl"> <a href="#" ng-click="goTo('myUrlPart')">My Link</a> </div> Then in your controller angular.module('myApp',[]) .controller('myCtrl',['$scope','$location',function($scope,$location){ $scope.goTo = function(url){ $location.path(url); }; // end goTo }]); // end myCtrl / myApp

Categories : Javascript

AngularJS and ExpressJS Routing issue?
The problem is that you are trying to handle the routes in both your angular code and your express code. In order to get it to work as expected, you need to direct all non-partial/non-api routes to your index.html file. Try doing something like this: wine.js (your express route file) exports.index = function(req, res) { res.sendfile(__dirname + "/public/index.html"); // updated to reflect dir structure }; app.js (your express app file) ... // make this your last route and remove your '/view1' route app.get('*', wine.index); ...

Categories : Node Js

url in atom feed-builder behaves different to erb-template with nested resource
I'm not sure why, but after restarting the server and a cold reload, it works this way: feed.entry(feeditem, :url => url_for(:action =>'show', :controller =>'games',:category_id => feeditem.categorygames.first.category, :id => feeditem, :only_path => false)) do |entry|

Categories : Ruby On Rails

AngularJs performance issue with Table and 3000+ tr?
In the case that someone is stumbling upon this question now, I would generally recommend infinite-scroll. It makes the filter operation that @toy mentioned very simple. When they include an option for removing off-screen elements that you've scrolled past it will be the killer angular ng-repeat performance option.

Categories : Javascript

AngularJS Issue in ng-repeat data binding
You need to set a $watch on SellValue() in order to be notified whenever the returned value changes: $scope.$watch('SellValue()',function(newValue){ for(var i=0;i<$scope.Brokers.length;i++){ $scope.Brokers[i].Brokerage = ... * newValue; // Calculate the Brokerage } }); Explanation: The view can bind to model values through the scope. The Brokers object is not a view element and so is not bound to anything. A $watch is needed when the model wants to be notified in changes to other parts of the model. Otherwise, your Brokerage property gets calculated only once during the controller's initial run phase. Here is a fiddle where I've created a BrokerageRate to compute the new Brokerage any time the SellValue() changes. Broker Four will need a little more work in that th

Categories : Javascript

Bootstrap Datepicker with AngularJS Update Issue
You either need to roll your own directive that "plays nice" with ng-model as described in the bottom of this page: http://docs.angularjs.org/guide/forms In order for custom control to work with ngModel and to achieve two-way data-binding it needs to: implement $render method, which is responsible for rendering the data after it passed the NgModelController#$formatters, call $setViewValue method, whenever the user interacts with the control and model needs to be updated. This is usually done inside a DOM Event listener. or use one like this: https://github.com/angular-ui/ui-date EDIT Here's another write up on creating custom directives for non-angular libraries to integrate their functionality: http://briantford.com/blog/angular-d3.html

Categories : Twitter

AngularJS 'this' issue when using anonymous functions and $q promises
You should be able to use Function.bind to achieve the result you want: doWork: function () { mySubWorkerService.someData.then((function(data) { //this now refers to whatever it referred to in the doWork function }).bind(this)); } Do note however that bind is not available in older browsers. However it's very easy to patch it in to the prototype manually if necessary.

Categories : Javascript

Angular.js: How can I return a content without view? Returning atom feed to users
Use the following process: Append an <object> or <iframe> to the DOM with the XML within the tag OR: Return Atom from the service Store in a documentFragment Use transformToFragment or DOMParser to create a view Use XMLSerializer to convert the view to a string Insert an XML stylesheet into the string: <?xml-stylesheet href="feed.css"?> Use the string as the value of the srcdoc attribute: <iframe srcdoc="{{atomfeed}}" height="95%" width="100%"> For example: $scope.atomstyle='<?xml-stylesheet href="feed.css"?>' $scope.atomboilerplate='<feed xmlns="http://www.w3.org/2005/Atom">' $scope.atomhead='<title></title><link></link>' $scope.atomcontent='<entry><title></title><link></link></entry&

Categories : Angularjs

How to fix incorrect mime-type (atom-feed) showed in chrome-devtools?
The problem seems to be Chrome not regognizing the application/*+xml content type. It looks that you need to use plain old application/xml to get XSLT processing and correct Content-Type display to work in dev tools.

Categories : PHP

AngularJS , Node.js, ExpressJS application integration issue
If you're using AngularJS to implement a single-page experience then you should serve the same front-end code every time, and then have AngularJS take over processing the URLs and displaying the content. Remember that you are managing two routing systems. One for the front-end and one for the backend. Express routes map to your data, usually returned in JSON format. (You can also render html directly, see Option #1.) Angular routes map to your templates and controllers. Option #1: Set static folder to serve front-end code (HTML/CSS/JS/AngularJS). app.use(express.static(__dirname + '/public')); Look at these for sample code: https://github.com/btford/angular-express-seed https://github.com/btford/angular-express-blog Directory Structure: public/ index.html js/ angular.js

Categories : Node Js

Weird AngularJS issue : Directive looping with dictionary
In the template of the directive, you need to just pass word_id into the function remove(), <i class="icon-remove" ng-click="remove(word_id)"></i> And in the controller, you can remove the entry with delete keyword $scope.removeWord = function (word_id) { delete $scope.wordlist[word_id]; console.log("Removing", word_id); }; Demo

Categories : Angularjs

Scope issue in AngularJS using AngularUI Bootstrap Modal
Looks like a scope issue. I got it to work like this: var ModalInstanceCtrl = function ($scope, $modalInstance) { $scope.input = {}; $scope.ok = function () { alert($scope.input.abc); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }; HTML: <textarea ng-model="input.abc"></textarea>

Categories : Angularjs

Issue using the Angularjs $location provider and ASP.NET MVC action links together
By default, the link in directive a is handled by AngularJS's route module. If you want to make a API request, you can make the call using $http module either wrapped in a service or factory or just in the controller. Try this: <a href="" ng-click="showVideo(@(Url.Action("Details", "Video"))/{{item.id}})"> $scope.showVideo = function (url) { $http.get { method: 'GET', url: url }). success(function (data, status, headers, config) { // this callback will be called asynchronously // when the response is available }). error(function (data, status, headers, config) { // called asynchronously if an error occurs // or server returns response with an error status. }); }

Categories : Asp Net Mvc

AngularJS $route service undesirable hash issue
Make sure to turn on html5mode http://docs.angularjs.org/guide/dev_guide.services.$location But the hash is inevitable on non-html5 browser.

Categories : Angularjs

Angularjs function call issue with nested elements
Is there some way to call getCellValue() when the input is updated without calling the method on every instance? <div class="output" ng-bind="foo"> then use $watch: function MyCellCtrl($scope) { $scope.foo = $scope.lw.library.name; $scope.$watch('foo', function(newValue) { $scope.foo = getCellValue($scope.foo); }); } or use viewChangeListeners as an alternative: function MyCellCtrl($scope) { $scope.foo = $scope.lw.library.name; this.$viewChangeListeners.push(function(newValue) { $scope.foo = getCellValue($scope.foo); }); } References Effective Strategies for avoiding watches in AngularJS Compile, Pre, and Post Linking in AngularJS

Categories : Angularjs

angularjs binding/scope issue for select list?
Anything you do async needs to be wrapped in $scope.$apply(). This is because angular works in a similar fashion to a game loop, however instead of constantly running, it knows to end the loop when an action is taken, and $scope.$digest() is called. If you are using IndexedDB, I would recommend creating an angular wrapper for it, like so: (forgive my IndexedDB code, I'm not experience with it) angular.module('app',[]) .factory('appdb', function($rootScope){ var db = indexedDB.open('appdb', 3); return { get : function(table, query, callback) { var req = db.transaction([table]) .objectStore(table) .get(query); req.onsuccess(function(){ $rootScope.$apply(function(){

Categories : Angularjs

Issue AngularJS nested transclusions and isolate scope
This question is pretty old so you probably found the answer but I'm still going to try to explain it as other people might find it useful. There are three things to remember when working with isolated scopes and transcluding content with ng-transcludedirective. Isolated scope means that it doesn't inherit properties of its parent. It only inherits properties that you explicitly bind inside the scope object. Transcluded content gets compiled and linked only after it's inserted. ng-transclude creates a new sibling scope of the directive which transcludes the content. Although, this may change from version 1.3.0 ng-transclude should not create new sibling scope. The best way to understand what's going on in your example is to look at your scope tree. < Scope (002) : ng-app <

Categories : Angularjs

Angularjs $http load data from local disk issue in IE9
it is due to same origin policy You would see same error in chrome. Chrome and IE does not allow local ajax requests. there are ways to do that for example chrome you would have to start it with some special flags http://joshuamcginnis.com/2011/02/28/how-to-disable-same-origin-policy-in-chrome/ C:UsersYOUR_USERAppDataLocalGoogleChromeApplicationchrome.exe --allow-file-access-from-files --disable-web-security and in ie you can reduce your security settings to be minimal. there are other solutions like jQuery $.ajax run as a local HTML file avoiding SOP (same origin policy) use jquery's $.support.cors = true; Another Solution try to put the json data in js file or your server that way you don't have to do any ajax request to local file Other sources: Ways to circumvent the same-o

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.