w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
getSaveFileName , getOpenFileName shows me the file to save or open, but cannot save the file or open the file in python QT
These functions only allow the user to select files, they don't actually open or save the files. In PySide, they return a tuple, so for example, saving the file would look like this: fileName, selectedFilter = QtGui.QFileDialog.getSaveFileName(self, "Save", "F:/python/bc_new_latest/bcForecasting.csv", "Excel (*.csv *.xls )") if fileName: with open(fileName, "w") as file: file.write(theCSVContent)

Categories : Python

R : How to show a Save File Dialog to save my file in gWidgets
Short answer: You can't. Long answer: you can by making your own menu. To do that create, the graphics device passing no_popup=TRUE to the constructor. Then you are free to add your own popup menu. The one in ggraphics is basically this (pointing you to gfile as Thomas did): library(gWidgets) g = ggraphics(cont=gwindow(), no_popup=TRUE) l <- list() l$copyAction <- gaction("Copy", "Copy current graph to clipboard", icon="copy", handler=function(h, ...) copyToClipboard(obj)) l$printAction <- gaction("Save", "Save current graph", icon="save", handler=function(h,...) { fname <- gfile(gettext("Filename to save to"), type="save") if(nchar(fname)) {

Categories : R

save file without save file dialog in c# webbrowser control
You can use something like this that would not show any dialog for download: WebClient client = new WebClient(); foreach (HtmlElement row in webBrowser1.Document.Window.Frames["View_Frame"].Document.GetElementsByTagName("input")) { if (row.Name == "DOWNLOADALL") { row.InvokeMember("click"); tbState.Text = "4"; client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); client.DownloadFile(URL, path);//I don't know where is your URL and path! break; } } from here

Categories : C#

Save JSON response
As per your callback function signature, you're receiving a variable named response. That is the entire returned object. That object has a property of its own named response. You need to access response.response.session_token (or edit the returned object to return only what's after response: if response.session_token is what you want.

Categories : Javascript

Save XML Response into Session in C#
1.Declare a variable. 2.store ur xml request data in that variable. 3.Declare another variable say (String Result). 4.Now Result="Call ur method here which will give u a xml response". 5.Session["Outcome"]=Result; 6.No need to use any XMLDocument here. If u want to format ur XML response, use XSLT template. In aspx page <div id="DivLoad"> <asp:Xml ID="xmlDaynamic" runat="server" Visible="true"></asp:Xml> </div> In cs xmlDaynamic.DocumentContent = session["outcome"]; xmlDaynamic.TransformSource = "yourxslttemplate.xslt"; Hope this will help you.

Categories : C#

How to save XML response locally with jQuery?
On success, render the response XML in a textarea or just a div and have the user copy+paste the results into a text editor. They can then save the file from the editor. or Instead of emitting the xml directly, provide a link to it instead.

Categories : Jquery

Midi sound file response is slower than wave sound file response
Sound performance via J2ME is often highly dependent on the device you are using, so what works well on one will often be nearly unusable on another. However, one thing you can try to do is pre-load and/or prefetch all of your sounds prior to needing to play them (usually during the loading animation for a level), store all your players in an array and just tell them to start/stop/reset when you need to manipulate them. In the past I often found that the biggest performance hit with sound was the initial request to access a hardware resource, so anything you can do to perform all hardware requests as early as possible is usually beneficial.

Categories : Java

AngularJS save() returns incorrect response from Web API
Reading the source code i have come to some conclusion : When is array is true ngResource module iterates over each item received in the response and it creates a new instance of a Resource.For this they are using angular.copy between response and the resource object . Since angular.copy works correctly only on arrays and object types but you are sending ["success"] which is a string so it does not work properly displaying character of arrays . Try below code in your editor and you will get the answer .To resolve this issues you should return a object like [{Message:"Success"}] var obj = angular.copy('success', {}); alert(obj);

Categories : Angularjs

how to use below response received from server and save in to database
Use a List of Map to the store the values and insert into database using it. String[] arr=response.split(","); List<Map<String,String>> list = new ArrayList(); for(int i = 0; i<arr.length; i+2){ String contactNo = arr[i]; String result = arr[i+1]; Map<String,String> m = new HashMap(); m.put(contactNo,result); list.add(m); }

Categories : Java

How to save the save the full file path in mysql table when using the upload form
mysql_query is deprecated in the newest PHP and it's also not so safe. I'd highly suggest switching to Mysqli or PDO. To answer your question though, try using mysql_real_escape_string() on your variables before inserting them in the DB. It will escape special chars.

Categories : PHP

Save Properties.Settings.Default items to list, change the values and then save it to the file
You could access the settings by name, like so. Settings.Default["Item1"]; Since you have the naming convention Item + Incrementing Number in your for loop you could do this, for (int i = 0; i < list.Count; i++) { Settings.Default["Item" + i.ToString()] = listBox1.GetSelected(i); } Properties.Settings.Default.Save();

Categories : C#

Save an Image generated during runtime onto the Picture library using File Save picker C# Win 8 Metro App?
var response = await HttpWebRequest.Create(url).GetResponseAsync(); List<Byte> allBytes = new List<byte>(); using (Stream imageStream = response.GetResponseStream()) { byte[] buffer = new byte[4000]; int bytesRead = 0; while ((bytesRead = await imageStream.ReadAsync(buffer, 0, 4000)) > 0) { allBytes.AddRange(buffer.Take(bytesRead)); } } StorageFolder storageFolder = awai KnownFolders.PicturesLibrary.CreateFolderAsync("QR Codes Generator",CreationCollisionOption.OpenIfExists ); //var file = await ApplicationData.Current.LocalFolder.CreateFileAsync(

Categories : C#

Either save state of Fragment or save file and update from that - Android
I think you are correct to try to find a simple approach to this. Case 1: You haven't posted your TabListener code, so firstly I am going to assume that you are adding fragments in onTabSelected and removing them in onTabUnselected. IF this is the case then you should look at using attach and detach instead. The difference is the same instance of the fragment will be used each time you press tab 1. Case 2: Based on what you have said (fragment 1 not being destroyed immediately) you may already using attach / detach. If this is the case, then the system may be responsible for destroying fragment 1 as part of its housekeeping. In this case, look at using setRetainInstance(true) for fragment 1. My concern about this approach is that you are updating your UI in this fragment , so you may ne

Categories : Android

Save PNG to Disk, but save file path to Core Data
You don't say if you have anything else in Core Data. If you do, simply create an imagePath attribute on your model, and assign the path to the document into it. Then, simply load the image into the UIImage when you need to, based on the model, using UIImage's imageWithContentsOfFile: method. If you don't already have Core Data in place and models generated, well, you really need to learn Core Data, and StackOverflow might not be the best place for that. This tutorial might be a good place to start. My first piece of advise when it comes to Core Data is to use the MagicalRecord library, which makes the general use of Core Data much, much easier.

Categories : IOS

Twitter typeahead.js save remote response into localStorage
There is such a possibility, for prefetch data. From the docs: Prefetched data is fetched and processed on initialization. If the browser supports localStorage, the processed data will be cached there to prevent additional network requests on subsequent page loads. ... and the relevant option in the prefetch object is: ttl – The time (in milliseconds) the prefetched data should be cached in localStorage. > Defaults to 86400000 (1 day). See here: https://github.com/twitter/typeahead.js#prefetch From looking at the source, it further appears that: PersistentStorage is indeed only for prefetch, and to be used the dataset must be initialized with a name. There is an additional, in-memory, request/response cache in the Transport layer.

Categories : Twitter

ExtJS 4.1 - Returning Associated Data in Model.Save() Response
I've found the issue, or rather, confusion lies in the getRecords() method of the Ext.data.Operation. This method returns "the operation's initially configured records will be returned, although the proxy may modify these records' data at some point after the operation is initialized." as per the documentation. This is rather confusing IMO, as the returned record is indeed updated, however the generated association store, and therefore associated data, is not! This is what lead to my confusion, it appeared as though the record contained the updated data from the application server, but this was not the case. In order to aid my simple mind in obtaining the FULLY updated data from the response, I have added a method to the Ext.data.Operation class... I just wrote this method and haven't te

Categories : Extjs

Browser tries to save JSON response to AJAX request instead of processing it
As you can see in the dialog, the file type is "Unknown File Type". In your code, I can see that you set the content type: response.setContentType( "application/json" ); and you're doing this before you start to write the data of the response. At first glance, this should work but somehow, the call to setContentType has no effect. Go to the debug tools of your browser and look into the response headers. You can find a line Content Type in there which should look like this: Content-Type: application/json If that line is missing, set a break point in the line with response.setContentType() and look into the response. There should be a stream in there. Make sure that stream is still empty.

Categories : Java

How to read response from angular resource $save() and also keeping original data
I think you want something like this: //Controller for testing app.controller('ApplicationController', function ($scope, Project) { //Project object var projectData = {"name":"New Project Test","thumbnail":"","statusid":"521d5b730f3c31e0c3b1e764","projecttypeid":"521f585c092a5b550202e536","teamid":"521f585a092a5b550202e521","authors":[{"firstname":"Dilip","lastname":"Kumar"}],"projectspecificmetadata":{"isbn13":"345345","guid":"asfas"},"modifiedby":"521f585a092a5b550202e525"}; var project = new Project(projectData); //Create new project project.$save(project, function (projectResponse) { projectData.projectId = projectResponse.id; console.log("ProjectData: %j", projectData);

Categories : Angularjs

Rename file in c#.net when its is uploaded through file upload control and save chang name of file in database
You can check out the following link http://asp-net-example.blogspot.in/2009/01/aspnet-fileupload-example-how-to-rename.html <%@ Page Language="C#" %> <%@ Import Namespace="System.IO" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Button1_Click(object sender, System.EventArgs e) { string uploadFolder = Request.PhysicalApplicationPath + "UploadFile\"; if (FileUpload1.HasFile) { string extension = Path.GetExtension(FileUpload1.PostedFile.FileName); FileUpload1.SaveAs(uploadFolder + "Test"+ extension); Label1.Text = "File uploaded successfully as: " + "Test"+ extensio

Categories : Asp Net

Open txt file, create new txt file, save old text to new file
The line outfilename$.SaveAs =:"FileName"infilename.txt",False" looks quite wrong indeed. You coud try this instead to pop-up a dialog for saving file outfilename$ = Application.GetSaveAsFilename(infilename$, "Neutral Files (*.txt),*.txt", , "Save file", "SAVE") Update : The full code is Sub test() Dim outfilename as Variant Dim infilename as Variant Dim msg As Variant infilename = Application.GetOpenFilename("Neutral Files (*.txt),*.txt", , "Open Neutral File", "OPEN", False) If infilename = "False" Then msg = MsgBox("No input file selected. Press OK to retry or cancel to quit", vbOKCancel) If msg = vbOK Then Do While msg <> vbCancel 'loop until user presses cancel infilename = Application.GetOpenFilename("Neutral Files (*.r01),*.r01", , "Open

Categories : Vba

how to streamWrite a .zip/epub file from response to isolatedStorage if that .zip/hpub file contains .jpg, .woff (web open font format)
using (IsolatedStorageFileStream fileStream = isf.OpenFile(fullFilePath, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite)) { s.CopyTo(fileStream); } In my case it is the only way to save different extension's files into the isolated Storage, BinaryWriter will not work. so @KooKiz was right. Thanks Kookiz :)

Categories : Windows Phone 8

Android Convert bytes array to File and Save file in SD card
You have binary data encoded using BASE64 encoding. To decode it you can use android.util.Base64 class. To learn how to write file to an external store read this article.

Categories : Java

Visual Studio LESS: Compile main file upon save of imported file
According to "SLaks" comment on the Uservoice request for this feature. "Press Alt+Shift+Y (Build, Web Essentials, Recompile all LESS Files) to do this without rebuilding." I agree, it would be a great feature for it to do it automatically without the shortcut.

Categories : Visual Studio

How do I change this code to use File I/O to Save a "High Score" File for my Game
I'd recommend you look into using the YAML data serializer. It creates a nicely formatted and readable file that is easily read by other languages. require 'pp' require 'yaml' hs = [["RANK", "PLAYER", "SCORE", "DATE"], ["1st", "-", 0, "-"], ["2nd", "-", 0, "-"], ["3rd", "-", 0, "-"], ["4th", "-", 0, "-"], ["5th", "-", 0, "-"], ["6th", "-", 0, "-"], ["7th", "-", 0, "-"], ["8th", "-", 0, "-"], ["9th", "-", 0, "-"], ["10th", "-", 0, "-"]] puts hs.to_yaml Which looks like: --- - - RANK - PLAYER - SCORE - DATE - - 1st - '-' - 0 - '-' - - 2nd - '-' - 0 - '-' - - 3rd - '-' - 0 - '-' - - 4th - '-' - 0 - '-' - - 5th - '-' - 0 - '-' - - 6th - '-' - 0 - '-' - - 7th - '-' - 0 - '-' - - 8th

Categories : Ruby

Basic image editor (open file, crop, save to new file) in a Java Tapestry web application
The Catalano Framework is a framework for scientific computing for Java and Android. Example: FastBitmap fb = new FastBitmap(bufferedImage); // Sepia effect. Sepia sepia = new Sepia(); sepia.applyInPlace(fb); // Crop int startX = 10; int startY = 10; int newWidth = 100; int newHeight = 100; Crop crop = new Crop(startX, startY, newWidth, newHeight); crop.applyInPlace(fb); ...and much more.

Categories : Java

Need assistance to decompile a jar file, edit the a class, and save as jar file
then there are lot of free utilities available like WinZip , 7-ZIP you can use them. Before opening jar file just change the extension of jar to zip file and then extract that particular class file that you want to edit , then decompile it using any decompiler ,make the changes , compile it back and then finally put it back in the zip file. Hope it helps. Thanks

Categories : Java

Save and load operations in a Portlet - jsp file cannot find the file
The problem is that using new File() in the Java code, create the file in a location which is relative to the location of the command line when you started your JBoss while the path in the JSP is relative to your webapp context. Not sure but I think you can try: File file = new File(getPortletContext().getRealPath("svg/topBar.svg"))

Categories : Java

Is it possible to load an XML file, modify a parameter and then save it as a text file?
This should do it ... script.vbs Set xmlDoc = CreateObject("MSXML.DOMDocument") xmlDoc.Load "input.xml" Set xmlNodeName = xmlDoc.selectSingleNode("/FCIV/FILE_ENTRY/name") Set xmlNodeMD5 = xmlDoc.selectSingleNode("/FCIV/FILE_ENTRY/MD5") Set fso = CreateObject("Scripting.FileSystemObject") Set file = fso.OpenTextFile("output.txt", 2, True) file.WriteLine "* name: " & xmlNodeName.Text file.WriteLine "* MD5: " & xmlNodeMD5.Text input.xml <?xml version="1.0"?> <FCIV> <FILE_ENTRY> <name>e:logs3database1.txt</name> <MD5>0rxJSXF5tCO3pAk3IcSJBA==</MD5> </FILE_ENTRY> </FCIV> remark: XML is cAsE-sEnSiTiVe output.txt * name: e:logs3database1.txt * MD5: 0rxJSXF5tCO3pAk3IcSJBA==

Categories : Xml

How to use sed / awk / grep … to extract blocks from a file and each block save it into a file
This code should create files named resultNUM where NUM is a number of the block awk '/PATTERN/{close("result"f);f++}{print $0 > "result"f}' file.log

Categories : Regex

why br not save in text file and html file in jquery
you can use like this: function nativePluginResultHandler (result) { var isappend= window.localStorage.getItem("isAppendButtonClick"); if(isappend=='true'){ console.log(result+"************naveen***************"); $('#realTimeContents' ).append('<br><p>'+result+'</p><br>'); } }

Categories : Jquery

download mp3 file through xmlhttprequest and save it as a file somewhere for upload later
thi is the function that loads and mp3 in your case using xhr , covertsit to base64 an then executes a function with the base64 file string var xhrfile=function(i,f){ var c=new XMLHttpRequest(); c.open('GET',i); c.responseType='arraybuffer'; //c.onprogress=function(e){var perc=Math.round((e.loaded/e.total)*100)+' of 100'}; c.onload=function(e){ var u8=new Uint8Array(this.response),ic=u8.length,bs=[]; while(ic--){bs[ic]=String.fromCharCode(u8[ic]);}; f('data:audio/mpeg;base64,'+btoa(bs.join(''))); }; c.send(); } usage: xhrfile('http://domain.com/your.mp3',filefunc) now as you want to save the file use indexedDB,websql,localstorage,fileApi or whatever you want.... it's a string now. consider that this mentioned saving possibilities have filesize limitations. you can al

Categories : Javascript

WP8 save isolated storage file to physical file
Use MediaLibraryExtensions SaveSong method like this MediaLibrary library=new MediaLibrary(); SongMetadata smd=new SongMetadata() { AlbumName = "AlbumName", Duration = TimeSpan.FromMinutes(2.50), Name = "SongName" }; MediaLibraryExtensions.SaveSong(library, new Uri(filePath, UriKind.RelativeOrAbsolute), smd, SaveSongOperation.CopyToLibrary);

Categories : C#

Save bitmap from selected file as new file into my own app folder
private String saveToInternalSorage(Bitmap bitmapImage){ ContextWrapper cw = new ContextWrapper(getApplicationContext()); File directory = cw.getDir("directoryName", Context.MODE_PRIVATE); File mypath=new File(directory,"profile.jpg"); FileOutputStream fos = null; try { // fos = openFileOutput(filename, Context.MODE_PRIVATE); fos = new FileOutputStream(mypath); // Use the compress method on the BitMap object to write image to the OutputStream bitmapImage.compress(Bitmap.CompressFormat.PNG, 100, fos); fos.close(); } catch (Exception e) { e.printStackTrace(); } return directory.getAbsolutePath(); }

Categories : Android

Modify a file and save it by the same file name in batch
Not in that way. The > redirection delete the file before findstr can process it. Do that this way: @ echo off if exist "%~f1" ( findstr /r "I.*=" "%~f1" >"%~f1.tmp" move /Y "%~f1.tmp" "%~f1" ) else ( echo File does NOT exist! )

Categories : File

Which file format should I use to save an array to a file?
Any format. iOS writeToPath: does not read the extension. You can even make up weird file names. Take the codes from your reference question as example, NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = [documentsDirectory stringByAppendingPathComponent:FILE_NAME]; [myArray writeToFile:filePath atomically:YES]; the FILE_NAME could be in any ASCII values.

Categories : Iphone

Premature end of file. XML response
You need to url encode the xml data before you can use it as a query parameter. So the url assignment becomes: $url = 'https://secure.rentalcars.com/service/ServiceRequest.do? serverName=www.rentalcars.com&xml='.urlencode(utf8_decode(trim($xml))); Note, I've just wrapped that for readability - that should obviously be on one line.

Categories : PHP

How to display the response from the php file
Add data in your $data1 array like this $data1=array('value1' => $get_row1[0], 'value2' => $get_row1[1], 'value3' => $get_row1[2], 'value4' => $get_row1[3]); And in AJAX response you can get the json encoded data like this $.ajax({ url:'process.php', dataType:'json', success: function(data) { $("#id").append(data.value1); alert(data.value1); }, error: function(jqXHR, textStatus, errorThrown) { alert(textStatus + errorThrown); } });

Categories : PHP

No such file or directory when trying to save file
Did you declare the proper uses permissions to access and write to the External SD card ? <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Categories : Android

how to send the a zip file as response in node js?
Use netstat to find which process is using the port. $ netstat -onp tcp Proto Local Address Foreign Address State PID TCP ESTABLISHED 408 TCP ESTABLISHED 1204 $ You can even use grep to narrow it down: $ netstat -onp tcp | grep 13000 TCP ESTABLISHED 408 $

Categories : Node Js

Spring - download response as a file
You can't download a file through an XHR request (which is how Angular makes it's requests). See Why threre is no way to download file using ajax request? You either need to go to the URL via $window.open or do the iframe trick shown here: Javascript/jquery to download file via POST with JSON data

Categories : Spring

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