w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to parse json using sapui5
Try something like var oControl = new sap.ui.commons.TextView().bindProperty("text", "user/usernme"); oTable.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "User Name"}), template: oControl})); var oControl = new sap.ui.commons.TextView().bindProperty("text", "user/id"); oTable.addColumn(new sap.ui.table.Column({label: new sap.ui.commons.Label({text: "UserID"}), template: oControl})); https://sapui5.hana.ondemand.com/sdk/#docs/guide/JSONModel.html

Categories : Javascript

Importing local json file using d3.json does not work
If you're running in a browser, you cannot load local files. You can, however load the json with jQuery's get or simply hardcode it within your code like this: var json = {"my": "json"}; d3.json(json, function(json) { root = json; root.x0 = h / 2; root.y0 = 0; });

Categories : Json

populate datatable from a local json file
Looks like the problem could be that your ajax is loading and setting the myObject variable but it is done after Datatables initialized so it does not get the updated myObject variable after your request has finished. You could do something like this to fix that: var myObject; $.ready(function(){ myObject={}; $.getJSON('http://localhost:8080/jsontext.json', function(data){ /* here I have tried using both the paths the c:pathjsontext.json and the one above */ myObject=data; $('#example').dataTable().fnAddData(myObject); }); });

Categories : Javascript

Cannot load local JSON file in django
This is working with your file: In [1]: import json In [2]: with open('config.json') as json_data: ...: data = json.load(json_data) ...: print data ...: [{u'lastName': u'Chepesky', u'employeeNumber': u'01840192', u'firstName': u'Mike'}, {u'lastName': u'Barichak', u'employeeNumber': u'47901927', u'firstName': u'Westlee'}, {u'lastName': u'Lambier', u'employeeNumber': u'51239657', u'firstName': u'Jamie'}, {u'lastName': u'Marshall', u'employeeNumber': u'41239520', u'firstName': u'Denise'}, {u'lastName': u'Taylor', u'employeeNumber': u'01963597', u'firstName': u'Matthew'}, {u'lastName': u'Tiegs', u'employeeNumber': u'65321951', u'firstName': u'Mark'}, {u'lastName': u'Tetzel', u'employeeNumber': u'03266987', u'firstName': u'Karla'}, {u'lastName': u'Dundas', u'employeeNumber': u'294

Categories : Django

CasperJs loads json data from a local file
I have the following working on CasperJS 1.1-beta1 and PhantomJS 1.9.1 test.json { "test": "hello" } test.js var json = require('test.json'); require('utils').dump(json); casper.echo(json.test); // "hello"

Categories : Json

Parse local JSON file with jQuery and Javascript
getJSON will parse it for you. Just remove the var obj = $.parseJSON(json); line (since that will stringify the object and try to parse it as JSON (which it won't be)).

Categories : Javascript

add item to a local json file using javascript object / java code
If you need to get access to local file system from browser you might want to check File API You cannot simply access clients computer from jQuery/JavaScript. User will need to permission that as well.

Categories : Java

RestKit "Cannot perform relationship mapping without a data source" from local JSON file
dataSource refers to the property of the RKMappingOperation which provides it with an object conforming to RKMappingOperationDataSource. This allows you to implement mappingOperation:targetObjectForRepresentation:withMapping: so that you can find existing objects which match the supplied parameters and return those objects (instead of new objects always being created).

Categories : IOS

Trying to load local JSON file to show data in a html page using JQuery
As the jQuery API says: "Load JSON-encoded data from the server using a GET HTTP request." http://api.jquery.com/jQuery.getJSON/ So you cannot load a local file with that function. But as you browse the web then you will see that loading a file from filesystem is really difficult in javascript as the following thread says: Local file access with javascript

Categories : Javascript

Html5 filereader - read local Json Array file and display only a specific section
If you get the text with fr.readAsText into a string, you can use JSON.parse() (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) to convert the string into a JSON object. Then you can access your specific content like a normal array.

Categories : Javascript

Databinding combobox cannot connect to specified file
You need to include the full path to the workbook: oBook = oExcel.Workbooks.Open("H:2011.1004.Salary Survey Template.xlsm") Or better (since the path can change) you should use an OpenFileDialog From: http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.aspx Dim openFileDialog1 As New OpenFileDialog() openFileDialog1.InitialDirectory = "c:" openFileDialog1.Filter = "xlsm files (*.xlsm)|*.xlsm|All files (*.*)|*.*" openFileDialog1.FilterIndex = 2 openFileDialog1.RestoreDirectory = True If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then oBook = oExcel.Workbooks.Open(openFileDialog1.filename) Else Exit Sub End If

Categories : Vb.Net

How to debug Json between Local IIS Website and Local
Let's back up. Fiddler's a proxy server; it sees all of the traffic that is sent to it. Generally speaking (unless you're using it as a Reverse Proxy) you never want to configure Fiddler to run on port 80; instead leave it up at port 8888 where it runs by default. You instead configure your client to proxy its traffic through Fiddler. Now, what "reading around on the Internet" did you do that caused you to modify your machine.config or web.config file (you didn't mention which you edited)? If your goal is to watch traffic with Fiddler, you need to point the ASP.NET proxy settings at Fiddler, not at whatever "PH.api" is (e.g. use "127.0.0.1:8888" and set bypassOnLocal to false). The further complexity arises in that System.NET bypasses the proxy for any request to "localhost" or "127.0.0

Categories : Rest

Error in AJAX post when running from local web server but not local file system
Note to anyone who runs into this. It took me about a day to figure it out. First off Blender was right about the POST requests, I changed them to GET requests. Secondly the issue, as I found out lied not within my code, but with IIS 7.5. It does not come with json as a predefined MIME type. Here are the steps in order to solve this. 1)Make sure you are running IIS 7.5. 2)Open the IIS Services Manager. 3)Open up MIME Types 4)Add a new MIME type 5) There are two fields to fill out. File Name Extension: JSON MIME Type: application/json After that it should work.

Categories : Jquery

Can't get a XMLHttpRequest's response neither from local file:/// nor from local web server
Feedburner does not support CORS (yet). These are the headers I receive from feedburner when executing your code from jsfiddle: HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 ETag: ckkcnAejDTcF+4d0Kj6kftZuq+0 Last-Modified: Tue, 30 Jul 2013 19:56:16 GMT Content-Encoding: gzip Transfer-Encoding: chunked Date: Tue, 30 Jul 2013 19:58:11 GMT Expires: Tue, 30 Jul 2013 19:58:11 GMT Cache-Control: private, max-age=0 X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Server: GSE If it supported CORS you should see an Access-Control-Allow-Origin header in there

Categories : Javascript

How to display Gridview in SapUI5
Use the following code to create a image and then place it in a grid layout: var oImage = new sap.ui.commons.Image("image"); oImage.setSrc("source of image"); oImage.setTooltip("tooltip"); oImage.placeAt("grid layout");

Categories : HTML

sapui5 table shows only the same record
My understanding is every entity/entry in the collection should have a unique id <entry><id>...</id></entry>. And in my case, the returned collection had no ids set for the entities. So the bound ui element finds multiple objects with same id (in this case empty id) and ends up displaying value which it finds the last. The same should apply even if the id is same across all entities. Hope it helps, if you have not already found what the problem is. Thanks,

Categories : Jquery

SapUi5 + Phonegap - loading Sap libraries
UI5 does not seem to officially support Windows Phone Browsers at all: https://openui5.hana.ondemand.com/#docs/guide/BrowserSupport.html Anyways since it is supporting IE9+ it should work on Windows Phone as well. At least starting from IE10 the mobile version shouldn't differ from the desktop version: http://en.wikipedia.org/wiki/Internet_Explorer_Mobile#Version_10

Categories : Javascript

Cannot parse local json
Store loading is asynchronous, so you cannot access their data immediately after having created them. To know when the store has been loaded, you can listen on the load event of the store: var store = Ext.create('MyApp.store.Tasks'); // you cannot use the store's data yet // expect(store.getCount()).toBe(4); store.on('load', function(records, success) { if (success) { // here the store has been loaded expect(store.getCount()).toBe(4); } }); Or, you can also pass a callback to the load method: var store = Ext.create('MyApp.store.Tasks', {autoLoad: false}); store.load({ callback: function(records, operation, success) { if (success) { // here the store has been loaded expect(store.getCount()).toBe(4); } } }); No

Categories : Javascript

Local storage: MySQL vs. JSON?
Are you going to be consistently loading and using the ENTIRE data-set, or will you only really want part of it? Use a database (mySql or Sqlite or whatever) if you want something the database gives you, specifically in this case the ability to query your data-set. (security and normalization and standardization ate nice, too.) Use a raw file (csv, xml, json) if you don't want anything a database provides, and want to load he entire data-set into memory anyway.

Categories : Mysql

Select2 - use JSON as local data
Load data from a local array The webpage of jquery-select2 with the examples contains a demo to use Select2 with local data (an array). The html <input type="hidden" id="e10" style="width:300px"/> The javascript $(document).ready(function() { var sampleArray = [{id:0,text:'enhancement'}, {id:1,text:'bug'} ,{id:2,text:'duplicate'},{id:3,text:'invalid'} ,{id:4,text:'wontfix'}]; $("#e10").select2({ data: sampleArray }); }); Select2 load data if array has no text property For your question the example e10_2 is relevant <input type="hidden" id="e10_2" style="width:300px"/> To achive that you need the function format() as seen below: $(document).ready(function() { // tell Select2 to use the property name f

Categories : Javascript

JSON Parsing with JQuery from local directory
The JSON is incorrect. This seems to be an array of objects, they need to be wrapper between brackets: INCORRECT {"category":"Soups","menu_item":"Tomato Soup","type":"veg"}, ... ,{"category":"Soups","menu_item":"Chicken Soup","type":"non-veg"} CORRECT [{"category":"Soups","menu_item":"Tomato Soup","type":"veg"}, ... ,{"category":"Soups","menu_item":"Chicken Soup","type":"non-veg"}]

Categories : Jquery

Phonegap caching Json data on local device
Normally you can store your JSON Data into HTML5 localstorage and make it Offline. But here localstorage gives size limit upto 5MB. But as you said you are working with large data then, You can do it via this approach: Create phonegap custom plugin for handling all webservice calls Using this plugin also store JSON data into native storage database (there is no size limit cause you are using device storage) So, there will be no ajax calls on your HTML code instead of Plugin is handling it.

Categories : Json

Data from a JSON API combined with local database in Rails
@userlist = [] that line, each time through the loop @data.each do |key| is clearing out the previous data by re-initializing @userlist. Then you're returning the user you added last, since all the others were thrown away the last time you assigned an empty array to @userlist. Just move @userlist = [] above @data.each do |key| and you should be good.

Categories : Ruby On Rails

upload file to the Windows azure media services without using the local file path
take a look into http://www.windowsazure.com/en-us/solutions/media/ . It describe main scenarios and capabilities of Microsoft Azure Media Services. Developer portal for Azure Media Services located at http://www.windowsazure.com/en-us/develop/media-services/. It has getting starting articles covering following scenarios: Upload Encode Deliver Consume

Categories : Azure

MediaInfo not able to get details of uploaded file in the same manner it can when pointed to local file
There is a way you can parse a file using a stream instead of a file. Look into these methods: Open_Buffer_Init(..) Open_Buffer_Continue(..) Open_Buffer_Continue_GoTo_Get(..) Open_Buffer_Init(..) It took me a while to work out how to get the IntPtr for the buffer.. remember to use GCHandle and AddrOfPinnedObject My sample is all over the place if you need any more help I'll try to get my code working again.

Categories : C#

delete a file from local drive after successful upload to ftp using batch file
You need to redirect the output of the FTP command. Check for a succesful message and act upon it. I can't provide an exact script, because it will depend on the FTP command you actually use, but the idea is like this. echo open Host Name >%temp%ftpin.txt echo user_name >>%temp%ftpin.txt echo password >>%temp%ftpin.txt echo put user_input.csv >>%temp%ftpin.txt echo bye >>%temp%ftpin.txt ftp -n -s:%temp%ftpin.txt >%temp%ftpout.txt for /f "tokens=* skip=9" %%a in (ftpout.txt) do ( if "%%a"=="226 Transfer complete." ( del user_input.csv ) ) EDIT: You will have to adjust your BAT to the actual output of your FTP script. Probably you will need to change the "skip" parameter of the FOR command.

Categories : Batch File

A batch file that opens up IE and delays opening up a new window with my specified local file
Ok I have got alot closer - my only query now is instead of this opening tabs I want it to open a new windows for login.html @echo off start "webpage name" "http://google.com" choice /d y /t 1 > nul start "webpage name" "login.html"

Categories : Batch File

Read a local file using JavaScript HTML5 file api (offline website)
I'm afraid I may be the bearer of bad news for your design: The action you are requesting expressly violates the security model as specified in the File API spec. The client implementation of FileReader() must make sure that "all files that are being read by FileReader objects have first been selected by the user." (W3C File API , 13. Security Considerations: http://www.w3.org/TR/FileAPI/#security-discussion). It would be a huge security risk of browser scripts could just arbitrarily open and read any file from a path without any user interaction. No browser manufacturer would allow unfettered access to the entire file system like that. If your script really needs that XML file, you are going to have to instruct users on how to grant the browser access to it, as every browser will prev

Categories : Javascript

html5 local storage split JSON.stringify data
Well you can do this: $('body').append('color:' + localStorage.getItem('Test').replace(/,/g,'", color: "') + '"') That is, replace each comma with the text ", color: " (where the double-quotes are part of the replace string), as well as putting 'color:' at the beginning and a double-quote at the end. If you want to get the individual colours into an array so that you can process them in some other way you can do this: var colorArray = JSON.parse(localStorage.getItem('Test')).split(','); // gives ["yellow", "green"] Demo (of both): http://jsfiddle.net/TUFfS/

Categories : Jquery

Parsing JSON Data from local server using JQuery.....but not getting result
result is an Array of objects. field is the entire object in each iteration.. field 1st iteration - {"category":"Soups","menu_item":"Tomato Soup","type":"veg"} You would need to use a specific key to get the value field.category which would give you Soups for the first iteration .append(field.category + " "); You have 3 keys in each object category , menu_item and type So use the key on the object to access a specific value. Check Fiddle

Categories : Jquery

Node-Webkit: How to create a file in the local file system?
It sounds like you might be trying to use the web filesystem API. That might be a reasonable solution, it would allow you to run your app as a regular webpage, however the web filesystem API is sandboxed. node-webkit offers "Complete support for Node.js APIs," which I think means you can use the node.js file system API to write anywhere on the file system. Pretty cool. So something like this should work: var fs = require('fs'); fs.writeFile("path/to/anywhere/test.txt", "Hi mom!", function(err) { if(err) { alert("error"); } }); Also, node-webkit web-workers do not support require I hear. So you'll need to do your filesystem stuff in your main thread.

Categories : Javascript

JavaScript creates and saves a file to local file system
I've just tested it, google doesn't create a file named log.txt (but the file will be accessible via the File-API by using this name). For me (WinXP) the file is located in %LOCALAPPDATA%/Google/Chrome/User Data/Default/FileSystem/ You'll find there some folders named by numbers, inside these folders may be 2 folders named t and p . You have ro search within the t-folder(because you have used window.TEMPORARY) Inside the t-folder is one more folder named by numbers, which contains files named by numbers. These files are the stored files. For me it's e.g. %LOCALAPPDATA%/Google/Chrome/User Data/Default/FileSystem/000/t/00/00000000

Categories : Javascript

Fallback on Local js file If file is missing from remote path
Something like this might work: <script src="http://tab-slide-out.googlecode.com/files/jquery.tabSlideOut.v1.3.js"></script> <script> if(!jQuery().tabSlideOut) document.write('<script src="js/jquery.tabSlideOut.v1.3.js"></script>'); </script>

Categories : Jquery

Parsing Local XML File Works, Downloaded XML File Doesn't
A couple of observations: The key issue would appear to be that you retrieved the data in rspData, but when you write it to your temporary file, you're writing data, not rspData. So change the line that says: [data writeToFile:path atomically:YES]; to [rspData writeToFile:path atomically:YES]; Frankly, I don't even see the data variable defined at that point (do you have some ivar lingering about?). I'd be ruthless about getting rid of any ivars or other variables that you don't need, so that you don't accidentally refer to some unused variable. Anyway, just use the rspData that you retrieved rather than some other variable. Why are you even writing that to a file, only to then read the file into another NSData that you pass to your XML parser? That seems entirely unnecessary. Just

Categories : Iphone

Big external JSON file or littles JSON file?
The real answer is: you should try both and measure them in a real environment (ie., on production hardware with your browser). The fake guess-y answer is: the larger file will probably yield slightly less latency when loading your page, assuming it is blocking load completion in a meaningful way.

Categories : Javascript

Sencha Touch 2: no local json data shown on Android device -- in dev is all OK
You load the data from a file, so that in development Sencha finds it. But in production you did not copy the json to 'build/production/xxx/dev/akApp/app/data/dvs-tab.json' It can't be found by Sencha until you copy the data by hand or add it to: app.json -> "resources": []

Categories : Android

How to copy file from HDFS to the local file system
bin/hadoop fs -get /hdfs/source/path /localfs/destination/path bin/hadoop fs -copyToLocal /hdfs/source/path /localfs/destination/path Point your web browser to HDFS WEBUI(namenode_machine:50070), browse to the file you intend to copy, scroll down the page and click on download the file.

Categories : Hadoop

TFS get removes pre-existing local copies of
I don't think you can achieve this in TFS. if you remove a workspace mapping it'll remove the files. If you try to map the same file to 2 places you'll get an error. You need to fix your build process. A short term solution might be to get the file once and then copy it to any other locationsit is needed. otherwise I think you need to bite the bullet and refactor your build process to be simpler. regardless of what systems you are using, simplifying you're build will help you in the long term.

Categories : Tfs

Bat file to open webpage with parameters to local file
I tested this and got the same result. I'm not really sure, but I guess this belongs to the question mark. The local file system of Windows can never have file names with ?, because this is a "wildcard" like *. I think it is possible that the file name is truncated there. The following codes also doesn't work or produces only error messages: start "file:///C:/Users/d92495j/Desktop/OracleCDs/WebLogic/template.html?wbt=1" start file:///"C:/Users/d92495j/Desktop/OracleCDs/WebLogic/template.html?wbt=1"

Categories : Windows

System.Web.Helpers.Json.Encode circular reference on server but not on local machine
I am thinking it may be a server configuration problem -- a stray checkbox, wrong library version, or some such. No, you are thinking wrong. It's just as the error message states: the object you are trying to JSON serialize is containing circular references which is not supported. Why it works locally then? Maybe because the object you are serializing on the server contains circular references which have values contrary to what you have locally. To ensure that you do not have such problems always serialize a specifically designed view mode to JSON. This view model will cut all circular references.

Categories : C#



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