Questions tagged [save]

1

votes
1

answer
265

Views

Rails 5 - how to negate a method call on a before_save callback conditional

In my Template model I have this callback: before_save :set_status, if: :is_template? private def is_template? return self.template_type == 'template' end How can I change it so that it only fires when the template_type is NOT 'template'? I tried these: 1 before_save :set_status, if: !:is_template?...
rmcsharry
1

votes
1

answer
4.8k

Views

Macro to save only the active worksheet

In the below code it saves the complete workbook. I want to save only the active worksheet. Sub sbVBS_To_SAVE_ActiveWorkbook() ActiveWorkbook.Save End Sub
1

votes
1

answer
59

Views

Save state of TextInput array - React Native

I am fetching from API multiple TextInputs and displaying them on my screen. So, how can I save the state of user inputs to a global object. Something like this: state = { foundtextfields: [] } Here I am pushing those fetched TextInputs to foundTextFields[] array: var foundTextFields = []; foundText...
DoeDoe
1

votes
3

answer
42

Views

Trying to save a class (in a list) to a file

I am trying to create a program where I can store NPCs in a game with certain attributes. Such as: Faction, personality, interests/hobbies. To achieve this, I have created an NPC class. class NPC: #name, faction, position/job, character, interests, other def __init__ (self, name, faction, pos, char,...
DustyHalo
1

votes
2

answer
1.4k

Views

Save object in cassandra using spark and java

Just started working with spark and cassandra in Java and I am already stuck with saving data to my cassandra database. here is the java bean class that i have public class User implements Serializable { public User(){} public User(String username, String password){ this.username = username; setPass...
chris
1

votes
2

answer
32

Views

How to create a for loop to open, mutate and save .csv files using R?

I have a several .csv files that have to be reformatted and saved again using an R script. The function that is needed to do the changes and the reformating of the files, is already established and works perfectly fine. But as there are always lots of documents to change, I would like to have a for...
Hotshot
1

votes
0

answer
482

Views

How to save & load Xgboost model.best_ntree_limit

I use the model.save_model('xgb.model') and model = xgb.Booster(model_file='xgb.model') to save & load xgboost model. But I found that this is not the best model in training. So, how to save the best model (best_ntree_limit) and load it?
j.j
1

votes
0

answer
205

Views

System.UnauthorizedAccessException: Access to the path '/data/user/0/MyApp.MyApp is denied? (Xamarin.Android)

I get the path of apk folder of my app: string apkFileFolder = FilesDir.Path; And get the path of folder in it string pathToFromServerFolder = apkFileFolder + '/backup/fromserver'; But when I try to save a zip file in it: System.IO.File.WriteAllBytes(pathToFromServerFolder, basedataZipFile); I get e...
Profile2ForStack
1

votes
0

answer
57

Views

Save a file to specific folder and convert to zip file

I have to upload a file and convert to zip file and save to server. But before uploading to server the file should be wrapped in a folder and then it should be converted to zip file. In this code below, I am able to convert to zip file directly without wrapping it in a folder. I used M-zip library f...
binila
1

votes
1

answer
72

Views

Userdefault Array Saving for Items on Plist Accordingly

Okay so I just got a quick question if this is possible or not. I got a array of dictionaries on my plist and it shows on viewcontroller 1 in a list of cells about 800 items. If user hits one of these cells and goes to Viewcontroller 2 can I make like a array of userdefaults associated with each cel...
Dkeem
1

votes
0

answer
17

Views

mongoose model.save() not working

// I was just try to feed data into mongo table but .save() function not working neither it is giving any error RUN: under terminal node feed.js var mongoose = require('mongoose'); var Schema = mongoose.Schema; var productSchema = new Schema({ image : { type: String,required: true }, title : { ty...
Ramesh Chand
1

votes
0

answer
49

Views

efficient way to work with ~2k variables of size ~400x400x3

I am running an optimization algorithm that involves iterating over ~2k variables, each variable representing an image of size ~400x400x3. In my iterations, I need to load these variables, update them, and go back to the next round, something like this % Initialize the global variable x x = 0; for i...
aasharma90
1

votes
1

answer
25

Views

Powerpoint SaveAs textbox form entry

Hello I have the following code written below to automatically send an email confirming that the user has filled out a form. Currently I have a powerpoint with one submit button which sends an automatic email. I also have a textbox named serial number where the user enters the part serial number. I...
EvanV
1

votes
0

answer
205

Views

MQTT connection in android application with cordova

Below code is my javascript code for MQTT communication. I have already checked the source code related to the MQTT part. It is working fine! What I would like to do is 1) In index.html, when connection success from mqtt_connect() using username&password, page move index.html to main.html. 2) After...
Anna Yang
1

votes
2

answer
992

Views

Is it possible to save a GameObject with its components in Unity?

I'm trying to Save/Serialize a GameObject and its components (with their current values), but I don't think it's possible, any ideas ??? Keep in mind that I don't wanna use an asset from the assets store, I wanna code it myself. Thanks in advance :)
i0mar
1

votes
0

answer
216

Views

Saving an h2o pipeline model build using sklearn

I have an sklearn pipeline with h2o preprocessors and h2o estimators. Please see below. pipeline = Pipeline([('standardize', h2o.transforms.preprocessing.H2OScaler()), ('pca', h2o.transforms.decomposition.H2OPCA(k=2)), ('drf', h2o.estimators.random_forest.H2ORandomForestEstimator(ntrees=200))]) pipe...
Anup
1

votes
1

answer
129

Views

Add “Save as new” button to Django foreign object edit popup

In Django we have save_as parameter for ModelAdmin, that enables 'Save as new' button on the admin's site edit page of some object. But when the object (Model1 instance) is in relations with other model (Model2) by default, and I want to edit Model2 instance in following way: take default for the cu...
Sindbag
1

votes
0

answer
57

Views

Using createElement to write file to downloads folder fails in Phonegap Android app

I've used the following javascript code to create and save a file in the downloads folder. This works fine in Chrome, but the same code fails when compiled to an Android app via phonegap. How do I get this to work? At one point it worked but only intermittently, and then stopped working altogether....
Zenid
1

votes
2

answer
112

Views

Twython - Saving Tweet IDs in a Text File

I am fairly new to Python, but have been enjoying it so far. I've been trying to write a code using Twython that saves the Tweet IDs of all the tweets that match my search query as variables in a file. I find that I can print all of the IDs that pertain to my search query with the following code: i...
user8714857
1

votes
0

answer
329

Views

R server Error Saving File No such file or directory (Ubuntu)

This question is similar to this post, but the response there doesn't really give what I need. Context: After I edit the R script on RStudio, it pops out an error message and says: 'Error Saving File: No such file or directory'. At the same time, I can't open any script also (error message: 'Error w...
LeGeniusII
1

votes
0

answer
91

Views

save and use the bootstrapped coefficients, boot library in r

I want to save and use later the bootstrapped regression coefficients of a regression model using the library 'boot' in R. In the example below, I want to be able to see and use the 1,000 bootstrapped coefficients for 'wt'. Is there a way to do so? library(boot) set.seed(6967) # Make the results...
Spyros
1

votes
0

answer
204

Views

how can i save a foreign key with null value by spring boot jpa?

In my application i need to save foreign key as a null . but background jpa create a primary key in primary table then it save this id in foreign key table . but i need to save null value for my application criteria. my foreign key table here.. @JsonIgnoreProperties({'courses','handler','hibernateL...
Mojar Dokan
1

votes
1

answer
36

Views

Issues with pickling in python - items not saving to file once program exits

I am trying to create a python program to save my friends' birthdays and access them easily and check for birthdays each day(I am not great at remembering dates and I never use facebook), but when I add a new birthday it is only accessible until I end the program - it then disappears again. I have b...
Hannah Mishow
1

votes
0

answer
51

Views

Yii2-Unable to send image name via client interface

I am working on Yii2. I have developed an API which will save the incoming records from the client. A client can send an image so I am saving its name and then uploading in the folder. Along with the name of the image I am also sending data with it. All the data except the image name are saved. Belo...
Faisal
1

votes
1

answer
20

Views

Saving object attributes using a function

I'm trying to modify the save() function so that the script from which the object originated is stored as an attribute of the object. s = function(object, filepath, original.script.name){ #modified save() function #stores the name of the script from which the object originates as an attribute, then...
Thistle19
1

votes
0

answer
222

Views

Save multiple Variables with Google play games

I am currently setting up a wild system for a mobile game in unity thanks to the google play games plugin. I have currently managed to save a value through the tutorial provided here: http://resocoder.com/2017/03/10/gpg-tutorial-saved-games-code/ But I can not manage to save a larger number of varia...
Nicolas Decelle
1

votes
1

answer
34

Views

Paste columns in separate file with save() in R

I am using a for loop to impute values per column, and want to save these columns with the predictions to another file. So, that the columns are pasted in there one by one. However, my code throws an error and it is not working. This is the part of the code: for (column in 1:ncol(NB_mcar)) { # Impu...
MLnewby
1

votes
1

answer
57

Views

File saving issue to public storage directory

I'm struggling with a file saving issue. I have 2 features: capturing photo and saving picture adding picture to gallery for the first part (file saving), I use ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 90, stream); byte[] byteArray...
Leo
1

votes
1

answer
95

Views

Vba Excel error using SaveAs with password

I wrote a simply code to save every Excel Worksheet as a new file (.xlsx) protected with password: For i = 1 To 7 ThisWorkbook.Sheets(i).Copy ActiveWorkbook.SaveAs ThisWorkbook.Path & '\' & i & '.xlsx', FileFormat:=51, Password:='XXX' ActiveWorkbook.Close False Next i It works but the error is t...
Angelo C
1

votes
1

answer
446

Views

Django save uploaded file

I want to upload a file, what I am able to do with the code stated below, but I also need to save all the uploads in different folder with different names. If 2 users upload the same file from browser, then in the folder it should be saved with different name or Unique Identification number. Followi...
Cyley Simon
1

votes
1

answer
15

Views

Prompt file open, make changes and save as another copy, and close + unsave the original file

I am trying to prompt user open file1 and file 2. then make changes (highlight non date cell) on file 2 and then save copy of the changed file2. At the same time, keep the original file2 unsave and close it. Below is my code Running result: file1 stays opened, file2 is highlighted but no copy is sa...
Thompson Ho
1

votes
0

answer
192

Views

Creating Multiple Workbooks from One Workbook VBA

I am new to this site and this is my first question, so if I didn't set this up correctly please excuse me. Here is some background info. We purchased a digital book with relevant company information. It came as a unformulated excel workbook which was great. This workbook has all the particulars of...
Kenny
1

votes
0

answer
36

Views

Save Img with paste.image.js

I can not customize a plugin I found. https://redgeoff.github.io/paste-image/examples/ it generates a file img url 'blob: // local / 293843234223' codified that even if I read it I do not know how to resume it to save it, but I do not find so much documentation and the way to save and to encode the...
npget
1

votes
0

answer
30

Views

Trading Card Deck Generatior

I'm trying to make a random deck generator for HearthStone and something is wrong with card[] array. It gives me null pointer exception and the first time it occurs is in the readFile() method, the debugger says the problem is with this line (well it starts there anyway) card[a].setName(name);. I k...
Luke Moore
1

votes
2

answer
670

Views

save Excel with date in name

I am trying to build a macro that will save my Excel file with the specified name (customer and date). Not working so far and as I am not very fluent in VBA maybe someone here would be willing to help: Sub Save() Sheets('Tool').Unprotect Password:='xxxx' Dim fclient As String Dim path As String fcli...
Ella
1

votes
1

answer
41

Views

How to Have a VBA Cancel the Script?

How can I have the VBA code cancel if the cancel button is pressed. I have... Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim ws As Worksheet Set ws = Sheets('EDITS') Dim tbl As ListObject Set tbl = ws.ListObjects('Table1') Dim newrow As ListRow Set newrow = tbl.Lis...
Kenny
1

votes
1

answer
257

Views

How to save multiple files in loop with original filenames

I'm trying to import several SAS datafiles from a folder and then save them back into the folder as R dataframes with the same original SAS dataset name. Everything works except I can't figure out how to save the file with the original file name (i.e., I can't figure out the x in > save(xxx, file =...
Ryan
1

votes
0

answer
48

Views

How to get Web Request saved to file

This is what I have so far. Fairly new myself. Would much appreciate the help. I am aiming to save the info into a text file created pretty much anywhere, but preferably inside temp folder or something. static async void GetNewData() { String page = 'http://www.coinmarketcap.com'; var client = new H...
ceruleanblue
1

votes
0

answer
27

Views

docker-save from HUB without dockerd running

As SystemImager developper, I'd like to mange images using docker (instead of using a simple directory on the image server). On the image server I would have docker running and I could start container to update content (yum update, change configs, ...) and keep track of changes and be able to revert...
user3807327
1

votes
1

answer
21

Views

Odoo email template unable to edit and save

Dears I am using odoo 10. I have created automated actions and used email templates in it. Everything was quiet simple and working good initially. But now I want to edit the email template and add few details in it. But when I save the template it does not show the error and what ever text/data I ad...
user3606682

View additional questions