parameters

How to send attachments (images) and nested params using XHR to uplaoad file in titanium?

血红的双手。 提交于 2019-12-12 17:30:42
问题 I am trying to upload images from the photo gallery of the phone to the server. Images gallery is opening perfectly fine. Here is my code. var win = Ti.UI.createWindow({ navBarHidden : true, }); var ind = Titanium.UI.createProgressBar({ width : 200, height : 50, min : 0, max : 1, value : 0, style : Titanium.UI.iPhone.ProgressBarStyle.PLAIN, top : 10, message : 'Uploading Image', font : { fontSize : 12, fontWeight : 'bold' }, color : '#888' }); win.add(ind); ind.show(); var main_url = "http:/

Displaying two seperate select box values in a URL

做~自己de王妃 提交于 2019-12-12 17:22:56
问题 Here are both select boxes, what I need is if there are values selected from both boxes, both should be displayed in the URL, something like this e.g www.example.com#135+#140 OR www.example.com#135&140 (It doesn't matter in which sequence as long as both gets displayed that's the main aim of this) <select name="search_region" id="search_region" class="search_region"> <option value="0">All Regions</option> <option class="level-0" value="135">HTML</option> <option class="level-0" value="136"

How to collect variables from a URL, insert them into an array and dynamically change a href URLs?

♀尐吖头ヾ 提交于 2019-12-12 17:20:54
问题 How to collect variables from a URL, insert them into an array and dynamically change a href URLs? I'm not a developer so please be easy on me here! I am familiar with HTML and not bad at taking snippets of code from various sources and cobbling them together. This is the first time, I've ever decided to reach out for help on a blog like this because I've been looking around and just can't seem to find exactly what I need. Very close and yet so far.. Please help! What I want to do is: collect

(C++) Passing a pointer into a template

你离开我真会死。 提交于 2019-12-12 17:03:58
问题 I have two pointers. p1. p2. p1 and p2 both point to different classes. The classes have some similar method names, and I'd like to call a template function twice to avoid repeated code. Here is my function: template <class T> void Function(vector<T> & list, T* item, const string & itemName) see that middle paramater, "item".. is that how my signature should look if I want the item changed? ..or should I pass it as T* & item ..or should I pass it as T** item the compiler is letting a lot of

Cocoa Selector Question

别来无恙 提交于 2019-12-12 16:20:07
问题 I have a question on how to use a selector with multiple parameters. I need to toggle this: -(void)openBackupNamed:(NSString *)name using this: [backupList addItemWithTitle:file action:@selector(openBackupNamed:) keyEquivalent:@""]; I know that there is the withObject: parameter for these cases, but I can't do this in the addItemWithTitle:action:keyEquivalent: method or am I missing something? Thanks 回答1: In your case you will have to create a new NSInvocation object and set it's index 2

Form Post with enctype = “multipart/form-data” causing parameters to not get passed

纵饮孤独 提交于 2019-12-12 15:36:28
问题 In an ASP.NET MVC 3 (Razor) project i 'm trying to upload a picture: the relevant part of the view: @using (@Html.BeginForm( new {enctype = "multipart/form-data" })) { <text>Select a file </text> <input type="file" name="file" /> <input type="submit" value="Upload" /> } stating explicitly the enctype parameter is "responsible" for stripping off the parameter part. For example, if the URL (opening the view) was the following: mydomain/Controller/Action/id?parameter1=somevalue1 the BeginForm

c++ Object parameters: polymorphism, value semantics, object lifetimes?

爱⌒轻易说出口 提交于 2019-12-12 15:15:49
问题 As I make the transition from C# to C++ I get a lot of recommendations to use value semantics where possible. It's pretty much guaranteed that if I post a question with a pointer anywhere someone will come along and suggest that it should be a value instead. I'm starting to see the light and I have found a lot of places in my code where I could replace dynamic allocation and pointers with stack allocated variables (and usually references). So I think I have a grasp on using stack allocated

How to Pass a Late Bound Parameter

倾然丶 夕夏残阳落幕 提交于 2019-12-12 14:25:49
问题 In VB6, I'm trying to pass a late bound object to another form. frmMain.vb Dim x Set x = CreateObject("MyOwn.Object") Dim f as frmDialog Set f = New frmDialog f.SetMyOwnObject x frmDialog Dim y Public Sub SetMyOwnObject(ByVal paramX As Variant) Set y = paramX End Sub The contents of y are a string containing the type name of the late bound object, "MyOwn.Object". ByVal and ByRef don't make a difference. Any clues? Having trouble remembering. 回答1: I used VarType(y). The result is 8, for

Shouldn't C# 4.0's new “named parameters” feature be called “named arguments”?

跟風遠走 提交于 2019-12-12 13:57:06
问题 I suppose there could be historical reasons for this naming and that other languages have similar feature, but it also seems to me that parameters always had a name in C#. Arguments are the unnamed ones. Or is there a particular reason why this terminology was chosen? 回答1: Yes, you're absolutely right (to my mind, anyway). Ironically, although I'm usually picky about these terms, I still use "parameter passing" when I should probably talk about "argument passing". I suppose one could argue

PostMessage unable to pass a string C#

不羁岁月 提交于 2019-12-12 12:30:43
问题 Here is my prototype: [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern bool PostMessage(int hhwnd, uint msg, IntPtr wparam, IntPtr lparam); And here is how I'm using it: PostMessage(HWND_BROADCAST, msg, Marshal.StringToHGlobalAuto("bob"), IntPtr.Zero); In a different thread I can intercept this message, but when I try to get bob back using: string str = Marshal.PtrToStringAuto(m.WParam); // where m = the Message object I don't get bob in str. I'm thinking this has got to