w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I convert this for loop into something cooler like by in R
A more vectorized (== cooler?) version would pull the common operations out of the loop and let R do the book-keeping about unique factor levels. dat <- split(-2 * log(as.numeric(file[,10])), file[,12]) names(dat) <- paste0("IoOPanos_filtered_on_pc_", names(dat)) (paste0 is a convenience function for the common use case where normally one would use paste with the argument sep=""). The for loop is entirely appropriate when you're running it for its side effects (plotting pretty pictures) rather than trying to capture values for further computation; it's definitely un-cool to use T instead of TRUE, while seq_along(dat) means that your code won't produce unexpected results when length(dat) == 0. pdf("SKAT.pdf") for(i in seq_along(dat)) { vals <- dat[[i]] nm <- names(da

Categories : R

pspdfkit Custom Save iOS
To disable the autosave function call document.annotationSaveMode = PSPDFAnnotationSaveModeDisabled on the PSPDFDocument. To save an annotation by clicking a specific button you can call saveAnnotationsWithError in PSPDFAnnotationParser.

Categories : IOS

Asp.net Web API - Where to Save Custom Handlers?
Where you store MyMessageHandler.cs doesn't matter at all, as long as you get your references in WebApiConfig right. I personally store them like project_root/MessageHandlers/MyMessageHandler.cs

Categories : Http

AutoCAD .net save custom object
Check out my GitHub. https://github.com/XxZer0xX here is an quick example. using System; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; namespace stackclass { /// <summary> /// Description of MyClass. /// </summary> public class MyClass : BlockTableRecord { public string BlkRecordName {get;set;} public MyClass(BlockTableRecord _RecordParam) { BlkRecordName = _RecordParam.Name; } public MyClass(){} } public static class MyClassInstanciator { public static void Main(string[] args) { var AcDoc = Application.DocumentManager.MdiActiveDocument; using (var Trans = Application.DocumentManager.MdiActiveDocument.TransactionManager.StartTransaction()) { var BlkTable = Trans.Get

Categories : C#

Where to save custom Laravel filters?
Something you'll see the Laravel Core Developers say a lot: there's no such thing like a right place for your files in Laravel. It all depends on your project design and the way you work. In Taylor`s first book (https://leanpub.com/laravel) he says: "Is your models directory deleted yet? If not, get it out of there!". If a directory that 'important' can be deleted and files moved away, anything else can go away too, as long your application benefits from it. A start (good for me, maybe not for you): create an app/services/<ServiceName> directory and put the related filters.php (by service) there. And then load them as Laravel do with its own filters.php, via globals.php: /* |-------------------------------------------------------------------------- | Require The Filters File |----

Categories : PHP

Save email as .eml, with custom date
You are halfway there since you specify PickupDirectory. Specify a different directory. After saving, open up the file in your code and change the date and time. Then move file to the PickupDirectory specified in your IIS SMTP settings.

Categories : C#

where to save a custom log file in android?
Place it in externalFilesDir(), and don't forget to get android.permission.WRITE_EXTERNAL_STORAGE.

Categories : Android

Trying to save image to Photo album with custom name in iOS
Since you cannot override any image/video in the users photo library you will not be able to give the the file a specific filename. You can add some metadate to you image if you use the writeImageDataToSavedPhotosAlbum:metadata:completionBlock: but you will not be able to set the filename.

Categories : IOS

Save data of Custom Fields in Liferay
This is incorrect: classPK="<%= 0 %>". classPK is basically the user's primary-key i.e. userId. So while adding the User classPK will be zero since there is no user created yet, but when you have saved or are updating, then the User would have a classPK and the custom-field Bio you are saving will be associated with that userId. Instead you need to use `classPK="<%= (selUser != null) ? selUser.getUserId() : 0 %>" so that when you save and the User is updated, the Users custom-field would be populated.

Categories : Java

Save Screenshot to Custom Photo Album
You need to use the AssetsLibrary framework. Here is a tutorial that explains how to do it: http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/

Categories : IOS

VBA - force excel to save in custom format
Is 'clg' a format you use? or just a random not xls/x extension? If the file does need to be viewed and viewed in excel (guessing your not exporting windows catalogue files?) then changing the extension might not be the best move. If you create your export using VBA, then you can automate some things to make it more apparent to the users that they should not be editing the data. The Workbook.SaveAs method has the option for "ReadOnlyRecommended" which will inform the user that the workbook should be opened read-only when opening it. (its optional though, so they could ignore it) Assuming the data is always read-only you could also lock the workbook so that no changes can be made. Update If you want to save an Excel Workbook with a custom extension (and not as a custom format) then us

Categories : Excel

where do you save custom saved strategies in factory girl?
I just ran into this issue myself and have been searching on where to save new strategies. I can't seem to find a place where they are automatically loaded/included, but you can save the file wherever you like. I saved mine in lib/factory_girl/strategy/json.rb (this follows the same convention that they are saved in the factory girl repo). Once saved, you will need to register your new strategy as described in the guide. If your strategy is not in your load path (mine is not), then you will need to require it before registering it. This is the code I have in my spec_helper.rb file in order to require and then register the strategy require "#{Rails.root}/lib/factory_girl/strategy/json" FactoryGirl.register_strategy(:json, JsonStrategy) After that, use is just as described in their g

Categories : Ruby On Rails

How to save a multi-leveled custom object to NSUserDefault's?
All the objects (Instructor, Class, and Student) need to adopt and implement the NSCoding protocol. See this post for an implentation. As @uchuugaka said though, it sounds like NSUserDefaults isn't the place to store this data. You could still serialize the data to disk, but just write it to a separate file. Apple's Archives and Serializations Programming Guide is good reading to learn the basics of this method. If the object graph you want to save is going to be more complex and you require searching and querying the object graph, e.g. finding the number of students with studentMoney >= 50 with lastName beginning with 'A', then you may want to look into Core Data. However, be aware that Core Data is an advanced framework so it does have a sizable learning curve.

Categories : IOS

How can I run custom tool or save a file programmatically using EnvDTE?
You can use the FindProjectItem method of the EnvDTE.Solution type to find a file within the current solution by it´s name. The ExecuteCommand method is dependent on the current UI context; so the item must be selected, otherwise the call fails. private bool TryExecuteTextTemplate(string filename) { var dte = (DTE2)this.GetService(typeof(SDTE)); Solution solution = dte.Solution; if ((solution != null) && solution.IsOpen) { ProjectItem item = solution.FindProjectItem(filename); if (item != null) { // TODO: track the item in the Solution Explorer try { item.DTE.ExecuteCommand("Project.RunCustomTool"); return true; } catch (COMException) {

Categories : Misc

efficient way to save custom form fields to database
If I understand this correctly, you're trying to use a one-to-one relationship where there should be a one-to-many. If you're going to have multiple Outcomes for one StateOption, may I suggest you use a many-to-many bridge table to link up which StateOption has which Outcome(s). Then in that bridge table you can also store the associated value as an additional column for the appropriate StateOption/Outcome pair.

Categories : Django

Custom added cell wont save in table view
I think tableData is getting deallocated when you are coming back to the home page. If the tableData is not a huge array you can store it in NSUserDefaults. This way when ever you come back to the table you can always retreat the data. Check out this code. It will store the tableData in the NSUserDefaults every time you add anything to the array. Let me know if this works for you. #import "ViewController.h" @interface ViewController () <UIAlertViewDelegate,UITableViewDataSource,UITableViewDelegate> @property (weak, nonatomic) IBOutlet UITableView *myTableView; @property (nonatomic,strong) NSMutableArray *tableData; @end @implementation ViewController -(NSMutableArray *)tableData { if(!_tableData){ NSMutableArray *data = [[N

Categories : IOS

Save custom macro toolbar modifications in Excel 2011 for Mac
The most recent version of Excel 2011 (14.3.5) seems to save custom toolbars in a single file in specific user folder: Users/[User]/Library/Application Support/Microsoft/Office/Preferences/Office 2011/Microsoft Excel Toolbars.xlsx (original source here) When I saved an Excel 2011 workbook with a custom toolbar on one Mac, and transferred it to another, the toolbar did not appear. When I coied the Microsoft Excel Toolbars.xlsx file over (and dropped it in the proper location), the toolbar did appear. Note: This location may be specific to more recent versions of Office 2011; older versions seem to store them in Users/[User]/Library/Preferences/Microsoft/Office 2011. Short-term, you may need to distribute the toolbar file along with the spreadsheet, as well as some means (via script a

Categories : Excel

Can't save meta box data in Wordpress using custom post types
Problems with your code: Unnecessary block (it's not related to the goal at hand): $values = get_post_custom( $post->ID ); $text = isset( $values['my_meta_box_text'] ) ? esc_attr( $values['my_meta_box_text'][0] ) : ”; $selected = isset( $values['my_meta_box_select'] ) ? esc_attr( $values['my_meta_box_select'][0] ) : ”; $check = isset( $values['my_meta_box_check'] ) ? esc_attr( $values['my_meta_box_check'][0] ) : ”; You're saving testimonial_text with: update_post_meta( $post_id, 'testimonial_text', $testimonial_text ); but getting _my_meta_value_key with: $value = get_post_meta( $post->ID, '_my_meta_value_key', true ); Change the get_ to testimonial_text. A textarea doesn't have value, the content goes inside the open/close tags: echo '<textarea id="test

Categories : Wordpress

Save clicked images into custom folder(Preferably internal to the app ) instead of gallery
You can delete the file once it's saved in your custom file. If you're not sure of the name of the file the camera took, you can look at the time stamp or, if you're willing to go crazy, you can use FileObserver to wait for the file to be finished writing before deleting it (if concurrency is an issue and something bad happens.) After doing some research, I found that that answer is posted here: Double save image

Categories : Android

Custom Cell label text overlaps after core data save
The problem is that you are misusing the boilerplate configureCell method. If you look at Apple's template code you will notice that it is used to configure a fully created cell, i.e. populate it with data. The cell creation can be largely omitted when using storyboard. With storyboard, typically there is no need to create stuff in if (cell==nil) {...}. Of course you can still do it in code, if not in the if block also in a separate method, if you prefer. I would recommend to call this method createCell though, not configureCell. In configureCell: you can then put in your data - what you are already doing outside the if block in cellForRowAtIndexPath: That is actually the stuff that goes into configureCell. The way you are doing it now, you are creating new labels in the NSFetchedRe

Categories : Iphone

django-social-auth with custom user model and overridden save() method
In order to solve the problem I created a custom "pipeline" (com.mysite.apps.users.social_auth.pipeline.addFacebookDetails) in which I add the necessary data to the user model only during its creation: in settings.py: SOCIAL_AUTH_PIPELINE = ( 'social_auth.backends.pipeline.social.social_auth_user', 'social_auth.backends.pipeline.user.get_username', 'social_auth.backends.pipeline.user.create_user', 'com.mysite.apps.users.social_auth.pipeline.addFacebookDetails', 'social_auth.backends.pipeline.social.associate_user', 'social_auth.backends.pipeline.user.update_user_details', ) in com.mysite.apps.users.social_auth.pipeline.addFacebookDetails.py: def addFacebookDetails(*args, **kwargs): if kwargs['is_new']: user = kwargs['user'] user.field1 = 'fo

Categories : Django

Unable to save changes made to entity when calling javascript function through custom ribbon button event
As Guido mentions in his comment the code looks good which leads me to think that one of your two if statements is failing. The first one obviously will fail if it is set to null. A little bit less obvious is that it will fail as well as if the field is not actually on the form (even though it may be a valid attribute of the entity). So step 1, ensure that your field exists on the form. The second one I'm not sure of... I don't think getIsDirty() is keeps track of programmatic changes, so even though your programmatically updating a field and setting it to always submit, it may be returning false. Regardless of how exactly it's working, the if statement really isn't needed. The Xrm.Page.data.entity.save function will only actually save if it has some value that has changed, so I'd re

Categories : Javascript

Do I need to create a module for: A user account, to create and save custom "objects" made of choices from a form
Drupal is great for such a project. And you don't need too much extra modules, just core modules. 1) Core user module is fine. 2) Node type A. Create the node with the described fields and a user Role that will be able to add new A nodes as also as edit/delete own A nodes. 4) Node type B. Just add relationship for the Node type A so users can make the connection. Use the EntityReference module here. Similar user role permissions here. 6) This needs more information but it seems you need to use Views module to achieve this. 7) Welcome to Drupal! This is a core functionality also.

Categories : Forms

Replace "Save To Foursquare" button with custom button
OK, I knew I should keep searching and tinkering before posting this question. :) Thanks to vnads here, I saw how to set up the global onReady functionality. I set it up to use a jQuery each(), loop through the spans, grab the data-context values, and then attach the functionality to my DOM element. The critical bit here came from vnads' comment at the end of the (currently) accepted solution: foursquare is looking for a DOM element, not a jQuery object. Oh, and the widget.attach() instead of widget.replace() keeps the custom graphic from getting run-over. <!-- 4Square js: --> <script type='text/javascript'> (function() { window.___fourSq = { "explicit": false, "onReady": function () { $('.fc-webicon.foursquare').each(function() {

Categories : Javascript

Save image with my own custom image in ios
// Image to save UIImage *img = [UIImage imageNamed:@"ImageName.png"]; // Request to save the image to camera roll UIImageWriteToSavedPhotosAlbum(img, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); Hope this helps..

Categories : IOS

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

Calling save on a destroyed object returns true, but doesn't save
Model#save Saves the changed attributes to the database atomically, or insert the document if new. Will raise an error of validations fail. After destruction, the document is not new and there are no attributes that have changed, so save just returns without errors. In a strict sense this seems to be the expected behavior. You could use Model#upsert: Performs a MongoDB upsert on the document. If the document exists in the database, it will get overwritten with the current attributes of the document in memory. If the document does not exist in the database, it will be inserted. This will actually save the document using the same ID, but it will still be frozen? and marked as destroyed?. Therefore it might be better to just clone the document as suggested by insane-36 in the

Categories : Ruby

How to automatically create a folder / run a "save as" and "save to" function in browser when downloading PDF
If you are using a web application you won't be able to create a folder through a browser on the clients computer because that would be a security issue. If you are doing this in another type of application that is on the user's computer. Then all you have to do is include System.IO and do a Directory.CreateDirectory http://msdn.microsoft.com/en-us/library/54a0at6s(v=vs.100).aspx

Categories : C#

Oracle Forms 10g - why do I have to click save so that my insert query will save to database
Oracle Forms provides a great deal of functionality for you so that you don't have to write it. For example, if you base a block on a table, and if the user enters data and clicks "Save", Oracle Forms knows whether to execute Insert, Update or Delete statements appropriately followed by a Commit. In your case, you have ignored that functionality and have hardcoded an Insert and Commit in your button code. Therefore, the user does not have to click the Save button, because the data has already been "saved" by your Add button.

Categories : Oracle

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#

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#

Barcode Scanner Phonegap plugin; Can't save results into global variable, or save to hidden field
You need to pass functions for callback to .scan() so they can be called after the scan intent finishes. You want something like this: scanner.scan(success,error); function success(result) { document.getElementById('barcode').value = result.text; } function error(error) { alert(error); }

Categories : Javascript

Ruby 101: How Can I Save, Read, Write, then Save the Contents of an Array?
Array#to_s does indeed have different behaviour in ruby 1.8 and 1.9. There's universal way to get the string that you want. Array has a join method that concatenates all elements of the array with a separator. Your separator would be a string ', '. @points = [1, 2, 3, 4] s = "SAVED_POINTS2 = [#{@points.join(', ')}]" s # => "SAVED_POINTS2 = [1, 2, 3, 4]"

Categories : Ruby

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

save new tab data in separate table when save cms >> page form
I got answer this problem now. Here is link actually I post this question in two panel of the StackExchange (stackoverflow & magento.stackexchange). I got answer on magento.stackexchange. Thanks to ProxiBlue, who resolve my issue. Here I am sharing this thread for whom are mostly stackoverflow visitors.

Categories : Magento

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

Mobile web site - explicit save button or implicit save?
Since your program is a website and not an App, most users will use the Back button to go back to the previous page. I suggest you should add a save button since most people are used to seeing them on websites, and will treat your site as such. thanks, Alex M

Categories : Android

In Qt Framework based Python desktop application , is it possible to give a internally created CSV save as or select location to save option?
You can probably use this class: http://doc.qt.io/qt-4.8/qfiledialog.html (Qt 4.8) http://doc.qt.io/qt-5/qfiledialog.html (Qt 5.0)

Categories : Python

IPersistFile::Save method keeps failing to save the shortcut
you have only initialized hres to 0 and then ur checking if it succeded ? u are never realling declaring it somewhere, and -2147024891 probably means that the variable is not initialized yet. a wild guess is that it never even reahes the: hres = ppf->Save(wsz, TRUE); line and therefore it is not initialized :P try putting out some breakpoints when debugging and maybe use some watches to peek into variables :) Best regards.

Categories : C++

Save by cell and not by line #: IPython %save magic: Is there a way?
After talking with the IPython dev team minrk found an answer: %%writefile filename.py will write everything below it in the cell to filename.py. link to the converastion.

Categories : Javascript



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