Search Results

Search found 65997 results on 2640 pages for 'custom post type'.

Page 7/2640 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Getting the type of an array of T, without specifying T - Type.GetType("T[]")

    - by Merlyn Morgan-Graham
    I am trying to create a type that refers to an array of a generic type, without specifying the generic type. That is, I would like to do the equivalent of Type.GetType("T[]"). I already know how to do this with a non-array type. E.g. Type.GetType("System.Collections.Generic.IEnumerable`1") // or typeof(IEnumerable<>) Here's some sample code that reproduces the problem. using System; using System.Collections.Generic; public class Program { public static void SomeFunc<T>(IEnumerable<T> collection) { } public static void SomeArrayFunc<T>(T[] collection) { } static void Main(string[] args) { Action<Type> printType = t => Console.WriteLine(t != null ? t.ToString() : "(null)"); Action<string> printFirstParameterType = methodName => printType( typeof(Program).GetMethod(methodName).GetParameters()[0].ParameterType ); printFirstParameterType("SomeFunc"); printFirstParameterType("SomeArrayFunc"); var iEnumerableT = Type.GetType("System.Collections.Generic.IEnumerable`1"); printType(iEnumerableT); var iEnumerableTFromTypeof = typeof(IEnumerable<>); printType(iEnumerableTFromTypeof); var arrayOfT = Type.GetType("T[]"); printType(arrayOfT); // Prints "(null)" // ... not even sure where to start for typeof(T[]) } } The output is: System.Collections.Generic.IEnumerable`1[T] T[] System.Collections.Generic.IEnumerable`1[T] System.Collections.Generic.IEnumerable`1[T] (null) I'd like to correct that last "(null)". This will be used to get an overload of a function via reflections by specifying the method signature: var someMethod = someType.GetMethod("MethodName", new[] { typeOfArrayOfT }); // ... call someMethod.MakeGenericMethod some time later I've already gotten my code mostly working by filtering the result of GetMethods(), so this is more of an exercise in knowledge and understanding.

    Read the article

  • Stay on current page after POST

    - by DogPooOnYourShoe
    I have a form which once the Submit button is pressed, it goes to a blank page and returns any error messages on that blank page. However I have a website template and I wish that my script is run, and returns the the page which did the action POST and puts any error messages on that page. Example of what is happening: PAGE REQUESTS POST ---- SCRIPT RUNS --- RETURNS ERROR MESSAGE What I want it to do is: PAGE REQUESTS POST --- SCRIPT RUNS ---- GOES TO THE PAGE WHICH REQUESTED POST ---- SHOWS ANY ERROR MESSAGES WHICH THE SCRIPT PICKED OUT.

    Read the article

  • uploading via http post (multipart/form-data) silently fails with big files

    - by matteo
    When uploading multipart/form-data forms via a http post request to my apache web server, very big files (i.e. 30MB) are silently discarded. On the server side all looks as if the attached file was received with 0 bytes size. On the client side all looks like it had been uploaded succesfully (it takes the expected long time to upload and the browser gives no error message). On the server, nothing is logged into the error log. An entry is logged into the access log as if everything was ok (a post request and a 200 ok response). These uploads are being posted to a php script. In the php script, If I print_r $_FILES, I see the following information for the relevant file: [file5] => Array ( [name] => MOV023.3gp [type] => video/3gpp [tmp_name] => /tmp/phpgOdvYQ [error] => 0 [size] => 0 ) Note both [error] = 0 (which should mean no error) and [size] = 0 (as if the file was empty). My php script runs fine and receives all the rest of the data except these files. move_uploaded_file succeeds on these files and actually copies them as 0byte files. I've already changed the php directives max_upload_size to 50M and post_max_size to 200M, so neither the single file nor the request exceed any size limit. max_execution_time is not relevant, because the time to transfer the data does not count; and I've increased max_input_time to 1000 seconds, though this shouldn't be necessary since this is the time taken to parse the input data, not the time taken to upload it. Is there any apache configuration, prior to php, that could be causing these files to be discarded even prior to php execution? Some limit in size or in upload time? I've read about a default 300 seconds timeout limit, but this should apply to the time the connection is idle, not the time it takes while actually transferring data, right? Needless to say, uploads with all exactly identical conditions (including file format, client and everything) except smaller file size, work seamlessly, so the issue is clearly related to the file or request size, or to the time it takes to send it.

    Read the article

  • Why my http POST request doesn't go well?

    - by 0x90
    I am trying to make this POST request in ruby. but get back #<Net::HTTPUnsupportedMediaType:0x007f94d396bb98> what I tried is: require 'rubygems' require 'net/http' require 'uri' require 'json' auto_index_nodes =URI('http://localhost:7474/db/data/index/node/') request_nodes = Net::HTTP::Post.new(auto_index_nodes.request_uri) http = Net::HTTP.new(auto_index_nodes.host, auto_index_nodes.port) request_nodes.add_field("Accept", "application/json") request_nodes.set_form_data({"name"=>"node_auto_index", "config" => { "type" => "fulltext", "provider" =>"lucene"} , "Content-Type" => "application/json" }) response = http.request(request_nodes) Tried to write this part: "config" => { "type" => "fulltext", provider" =>"lucene"} , "Content-Type" => "application/json" } like that: "config" => '{ "type" => "fulltext",\ "provider" =>"lucene"},\ "Content-Type" => "application/json"\ }' this try didn't help either: request_nodes.set_form_data({"name"=>"node_auto_index", "config" => '{ \ "type" : "fulltext",\ "provider" : "lucene"}' , "Content-Type" => "application/json" })

    Read the article

  • redirect to a new page with post data in Javascript

    - by Mick
    Hi , I have a html form with the data by this post method 'form id='form1' name='form1' method='post' action='process.php'etc ' to a php page for processing into a mysql database . When the user has filled in the form BEFORE submitting it I have a button that the user can click to open up a new page to display a pdf of the data entered. The new pdf file is generated fine but what I need in it is the post data from the form. In the pdf page I can use POST to get the detail. What I need is a method of sending the data from the form to this new page without using the form tag above as it is needed for the processing of the form. What I am looking for is a js method to redirect to a new page with the post data intact Can anybody help please ? , any help is much appreciated ! Mick

    Read the article

  • ASP.NET MVC POST Parameter into RouteData

    - by David Thomas Garcia
    I'm using jQuery to POST an Id to my route, for example: http://localhost:1234/Load/Delete with a POST Parameter Id = 1 I'm only using the default route in Global.asax.cs right now: routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); When I perform the POST, in my ActionFilter filterContext.RouteData.Values["Id"] is set to the default value of "". Ideally, I'd like it to use the POST Parameter value automatically if the URL comes up with "". I know it is posting properly because I can see the value of "1" in filterContext.HttpContext.Request.Params["Id"]. Is there a way to get RouteData to use a POST parameter as a fall back value?

    Read the article

  • asp.net mvc post variable to controller

    - by Erwin
    Hello fellow programmer I came from PHP language(codeigniter), but now I learning ASP.Net MVC :) In PHP codeigniter we can catch the post variable easily with $this->input->post("theinput"); I know that in ASP.Net MVC we can create an action method that will accepts variable from post request like this public ActionResult Edit(string theinput) Or by public ActionResult Edit(FormCollection formCol) Is there a way to catch post variable in ASP.Net like PHP's codeigniter, so that we don't have to write FormCollection object nor have to write parameter in the action method (because it can get very crowded there if we pass many variable into it) Is there a simple getter method from ASP.Net to catch these post variables?

    Read the article

  • New build won't POST, no video, no beeps

    - by Nate Koppenhaver
    Specs: Motherboard: MSI 760GM-P23 FX Integrated graphics (on MoBo) CPU: AMD Athlon II x4 640 RAM: GeIL Pristine 4GB DDR3 Case/PSU: TOPOWER TP-4107BB-400 Is not POSTing, no video output, no beeps. When RAM is removed, 3 beeps. I have tried removing and replacing the CPU and all the power cables with no change. Resetting the BIOS (by removing and replacing the battery) did nothing as well. Is there something I'm forgetting (1st time building from components), or could one of the components be bad? EDIT: New development: with CPU and RAM installed correctly, it will turn on lights and fans (still no POST) and after running for a minute or so it will turn off and the PSU will make a buzzing noise that ceases only when unplugged.

    Read the article

  • Three ways to upload/post/convert iMovie to YouTube

    - by user44251
    For Mac users, iMovie is probably a convenient tool for making, editing their own home movies so as to upload to YouTube for sharing with more people. However, uploading iMovie files to YouTube can't be always a smooth run, I did notice many people complaining about it. This article is delivered for guiding those who are haunted by the nightmare by providing three common ways to upload iMovie files to YouTube. YouTube and iMovie YouTube is the most popular video sharing website for users to upload, share and view videos. It empowers anyone with an Internet connection the ability to upload video clips and share them with friends, family and the world. Users are invited to leave comments, pick favourites, send messages to each other and watch videos sorted into subjects and channels. YouTube accepts videos uploaded in most container formats, including WMV (Windows Media Video), 3GP (Cell Phones), AVI (Windows), MOV (Mac), MP4 (iPod/PSP), FLV (Adobe Flash), MKV (H.264). These include video codecs such as MP4, MPEG and WMV. iMovie is a common video editing software application comes with every Mac for users to edit their own home movies. It imports video footage to the Mac using either the Firewire interface on most MiniDV format digital video cameras, the USB port, or by importing the files from a hard drive where users can edit the video clips, add titles, and add music. Since 1999, eight versions of iMovie have been released by Apple, each with its own functions and characteristic, and each of them deal with videos in a way more or less different. But the most common formats handled with iMovie if specialty discarded as far as to my research are MOV, DV, HDV, MPEG-4. Three ways for successful upload iMovie files to YouTube Solution one and solution two suitable for those who are 100 certainty with their iMovie files which are fully compatible with YouTube. For smooth uploading, you are required to get a YouTube account first. Solution 1: Directly upload iMovie to YouTube Step 1: Launch iMovie, select the project you want to upload in YouTube. Step 2: Go to the file menu, click Share, select Export Movie Step 3: Specify the output file name and directory and then type the video type and video size. Solution 2: Post iMovie to YouTube straightly Step 1: Launch iMovie, choose the project you want to post in YouTube Step 2: From the Share menu, choose YouTube Step 3: In the pop-up YouTube windows, specify the name of your YouTube account, the password, choose the Category and fill in the description and tags of the project. Tick Make this movie more private on the bottom of the window, if possible, to limit those who can view the project. Click Next, and then click Publish. iMovie will automatically export and upload the movie to YouTube. Step 4: Click Tell a Friend to email friends and your family about your film. You are also allowed to copy the URL from Tell a Friend window and paste it into an email you created in your favourite email application if you like. Anyone you send to email to will be able to follow the URL directly to your movie. Note: Videos uploaded to YouTube are limited to ten minutes in length and a file size of 2GB. Solution 3: Upload to iMovie after conversion If neither of the above mentioned method works, there is still a third way to turn to. Sometimes, your iMovie files may not be recognized by YouTube due to the versions of iMovie (settings and functions may varies among versions), video itself (video format difference because of file extension, resolution, video size and length), compatibility (videos that are completely incompatible with YouTube). In this circumstance, the best and reliable method is to convert your iMovie files to YouTube accepted files, iMovie to YouTube converter will be inevitably the ideal choice. iMovie to YouTube converter is an elaborately designed tool for convert iMovie files to YouTube workable WMV, 3GP, AVI, MOV, MP4, FLV, MKV for smooth uploading with hard-to-believe conversion speed and second to none output quality. It can also convert between almost all popular popular file formats like AVI, WMV, MPG, MOV, VOB, DV, MP4, FLV, 3GP, RM, ASF, SWF, MP3, AAC, AC3, AIFF, AMR, WAV, WMA etc so as to put on various portable devices, import to video editing software or play on vast amount video players. iMovie to YouTube converter can also served as an excellent video editing tool to meet your specific program requirements. For example, you can cut your video files to a certain length, or split your video files to smaller ones and select the proper resolution suitable for demands of YouTube by Clip or Settings separately. Crop allows you to cut off unwanted black edges from your videos. Besides, you can also have a good command of the whole process or snapshot your favourite pictures from the preview window. More can be expected if you have a try.

    Read the article

  • IIS7 rejecting POST requests with 400 error.

    - by Eli
    I have a web application that is supposed to handle post requests from SAP. This has been working fine at other customers with win2k3 systems (IIS6) and win2k8 (IIS7) systems. However, on this specific customer's site, IIS responds with a 400 response, without calling my aspx page. In fact, I don't even see it appear in the w3c log for the virtual directory. I do see the request using Network Monitor, so I know no firewalls and the like are eating the request, and as far as I can tell, all of the fields of the request are valid (there is "content-length", it looks correct (this is a sending of a 28K tiff file - which isn't MIME encoded, curiously enough now that I think of it...) Ideas?

    Read the article

  • hardy alternate cd customization and ubuntu-keyring-udeb

    - by gokul
    I have been trying to customize Ubuntu 8.04 (hardy heron) alternate install cd. I have followed the community documentation at https://help.ubuntu.com/community/InstallCDCustomization#Generating_a_new_ubuntu-keyring_.deb_to_sign_your_CD to rebuild the ubuntu-keyring packages. But when the media boots I get a warning: anna[7581]: WARNING **: bad md5sum. Though I have not been able to confirm that the message is for the ubunu-keyring-udeb package, the nearest debconf Adding [package] message is for ubuntu-keyring-udeb. This is followed by: INPUT critical retriever/cdrom/error. This message is already from syslog. I don't think dpkg.log will help in this case. I have tried modifying the md5sum file within the source package manually and signing it with my own public key, before building it. But that has not helped either. How do get the installer to work in this scenario? Alternatively, can I customize the contents of Ubuntu8.04 without signing anything?

    Read the article

  • What can Haskell's type system do that Java's can't?

    - by Matt Fenwick
    I was talking to a friend about the differences between the type systems of Haskell and Java. He asked me what Haskell's could do that Java's couldn't, and I realized that I didn't know. After thinking for a while, I came up with a very short list of minor differences. Not being heavy into type theory, I'm left wondering whether they're formally equivalent. To try and keep this from becoming a subjective question, I'm asking: what are the major, non-syntactical differences between their type systems? I realize some things are easier/harder in one than in the other, and I'm not interested in talking about those. And to make it more specific, let's ignore Haskell type extensions since there's so many out there that do all kinds of crazy/cool stuff.

    Read the article

  • What can Haskell's type system do that Java's can't and vice versa?

    - by Matt Fenwick
    I was talking to a friend about the differences between the type systems of Haskell and Java. He asked me what Haskell's could do that Java's couldn't, and I realized that I didn't know. After thinking for a while, I came up with a very short list of minor differences. Not being heavy into type theory, I'm left wondering whether they're formally equivalent. To try and keep this from becoming a subjective question, I'm asking: what are the major, non-syntactical differences between their type systems? I realize some things are easier/harder in one than in the other, and I'm not interested in talking about those. And to make it more specific, let's ignore Haskell type extensions since there's so many out there that do all kinds of crazy/cool stuff.

    Read the article

  • Post Error, Fixed/Removable Media Error

    - by Dan
    Hi, I really do not know what I am missing here. I ordered parts for a new server. The board is an Intel s3420GP. From the diagnostic LEDs I get the error message: 0xB1h which corresponds to "Fixed Media: Disabling fixed media" and 0xB8h which corresponds to "Removable Media: Resetting removable media device." I can not for the life of me figure out what it is talking about. I have two identical motherboards and both gave the error message. I don't have a second CPU yet, so I can't test that. There are no beeps or anything. It seems the server resets every 10 seconds or so (the speaker does work, I put the RAM in the wrong slots on purpose to test this out, and the correct error POST code came up) Please help me, I'm not sure where else to turn or to ask

    Read the article

  • What are some reasonable stylistic limits on type inference?

    - by Jon Purdy
    C++0x adds pretty darn comprehensive type inference support. I'm sorely tempted to use it everywhere possible to avoid undue repetition, but I'm wondering if removing explicit type information all over the place is such a good idea. Consider this rather contrived example: Foo.h: #include <set> class Foo { private: static std::set<Foo*> instances; public: Foo(); ~Foo(); // What does it return? Who cares! Just forward it! static decltype(instances.begin()) begin() { return instances.begin(); } static decltype(instances.end()) end() { return instances.end(); } }; Foo.cpp: #include <Foo.h> #include <Bar.h> // The type need only be specified in one location! // But I do have to open the header to find out what it actually is. decltype(Foo::instances) Foo::instances; Foo() { // What is the type of x? auto x = Bar::get_something(); // What does do_something() return? auto y = x.do_something(*this); // Well, it's convertible to bool somehow... if (!y) throw "a constant, old school"; instances.insert(this); } ~Foo() { instances.erase(this); } Would you say this is reasonable, or is it completely ridiculous? After all, especially if you're used to developing in a dynamic language, you don't really need to care all that much about the types of things, and can trust that the compiler will catch any egregious abuses of the type system. But for those of you that rely on editor support for method signatures, you're out of luck, so using this style in a library interface is probably really bad practice. I find that writing things with all possible types implicit actually makes my code a lot easier for me to follow, because it removes nearly all of the usual clutter of C++. Your mileage may, of course, vary, and that's what I'm interested in hearing about. What are the specific advantages and disadvantages to radical use of type inference?

    Read the article

  • Computer refuses to POST

    - by TheX
    Computer refuses to POST. What it will do is the fan spins up, and the lights come on on the motherboard, but other then that it just sits there and laughs in my face! Here is what I have done... I have tried 2 different video cards, both known to work, 4 different sticks of RAM in all four ram slots, 2 processors (known to work), and 2 power supplies (known to work). The only constant is the motherboard... The Motherboard is a Asus m3a3-mvp deluxe. Anyone have any other ideas? Also, I have bread boarded it to make sure there where no shorts (taken everything out of the case and tried again).

    Read the article

  • Android, sending XML via HTTP POST (SOAP)

    - by Intosia
    Hi, I would like to invoke a webservice via Android. I need to POST some XML to a URL via HTTP. I found this snipped for sending a POST, but i dont know how to include/add the XML data itself. public void postData() { // Create a new HttpClient and Post Header HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://10.10.4.35:53011/"); try { // Add your data List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("Content-Type", "application/soap+xml")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); // Where/how to add the XML data? // Execute HTTP Post Request HttpResponse response = httpclient.execute(httppost); } catch (ClientProtocolException e) { // TODO Auto-generated catch block } catch (IOException e) { // TODO Auto-generated catch block } } This is the complete POST message that i need to imitate: POST /a8103e90-f1e3-11dd-bfdb-8b1fcff1a110 HTTP/1.1 Host: 10.10.4.35:53011 Content-Type: application/soap+xml Content-Length: 602 <?xml version='1.0' encoding='UTF-8' ?> <s12:Envelope xmlns:s12="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"> <s12:Header> <wsa:MessageID>urn:uuid:fc061d40-3d63-11df-bfba-62764ccc0e48</wsa:MessageID> <wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</wsa:Action> <wsa:To>urn:uuid:a8103e90-f1e3-11dd-bfdb-8b1fcff1a110</wsa:To> <wsa:ReplyTo> <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address> </wsa:ReplyTo> </s12:Header> <s12:Body /> </s12:Envelope>

    Read the article

  • iPhone POST to PHP failing

    - by Alexander
    I have this code here: NSString *post = [NSString stringWithFormat:@"deviceIdentifier=%@&deviceToken=%@",deviceIdentifier,deviceToken]; NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:NO]; NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]]; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:@"http://website.com/RegisterScript.php"]]; [request setHTTPMethod:@"POST"]; [request setValue:postLength forHTTPHeaderField:@"Content-Length"]; [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; [request setValue:@"MyApp-V1.0" forHTTPHeaderField:@"User-Agent"]; [request setHTTPBody:postData]; NSData *urlData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; NSString *response = [[NSString alloc] initWithData:urlData encoding:NSASCIIStringEncoding]; which should be sending data to my PHP server to register the device into our database, but for some of my users no POST data is being sent. I've been told that this line: NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:NO]; may be causing the problem. Any thoughts on why this script would sometimes not send the POST data? On the server I got the packet trace for a failed send and the Content-lenght came up as 0 so no data was sent at all. Thanks for any help

    Read the article

  • PHP Redirection with Post Parameters

    - by arik-so
    Hello, I have a webpage. This webpage redirects the user to another webpage, more or less the following way: <form method="post" action="anotherpage.php" id="myform"> <?php foreach($_GET as $key => $value){ echo "<input type='hidden' name='{$key}' value='{$value}' />"; } ?> </form> <script> document.getElementById('myform').submit(); </script> Well, you see, what I do is transferring the GET params into POST params. Do not tell me it is bad, I know that myself, and it is not exactly what I really do, what is important is that I collect data from an array and try submitting it to another page via POST. But if the user has JavaScript turned off, it won't work. What I need to know: Is there a way to transfer POST parameters by means of PHP so the redirection can be done the PHP way (header('Location: anotherpage.php');), too? It is very important for me to pass the params via POST. I cannot use the $_SESSION variable because the webpage is on another domain, thus, the $_SESSION variables differ. Anyway, I simply need a way to transfer POST variables with PHP ^^ Thanks in advance!

    Read the article

  • PC in POST loop

    - by Antony Scott
    Hi, I have a custom built PC using a Gigabyte GA-EP35-DS3P motherboard with a Q6600 CPU. For the last 2 days it has got itself stuck into a POST loop. Saying that, I don't think it actually got in to the BIOS. It repeatedly lit up the LEDs and then not much more. Sometimes I could see the CPU fan twitch. Today I re-seated the DIMMs and it powered up straight away. Could this be a sign of an impending hardware failure? The PC is hooked up to a UPS, so I don't think it's a power spike or anything like that, as I have 2 other PCs on the same UPS and they're both fine. Yesterday, the first time this happened, I was getting a message which I think said "Scanning BIOS image on hard drive". I've been building and using PCs for well over 25 years and that's a new one on me! I don't think it's an over heating problem, as when the PC does finally boot up the CPU is running at 35-40C. Any help or suggestions would be greatly appreciated.

    Read the article

  • Jquery doesn't post for some reason

    - by Asaf
    I wrote this small page and for some reason when I cilck on the submit nothing happens (checked on firebug, no submit is happening) <head> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <script type="text/javascript"> $('form#login').submit(function() { $.ajax({ type: 'POST', url: 'http://my.site/login.php', data: this.html(data), success: success, dataType: dataType }) }); </script> </head> <body> <form action="#" id="login"> <input type="textbox" id="UserName" value="user"> <input type="textbox" id="Password" value="password"> <input type="submit" value="submit"> </form> </body>

    Read the article

  • Event receiver on Content Type not triggered on WikiPageLibrary

    - by Ciprian Grosu
    Hello all, I created a new content type for a wiki page library. I added this content type to library by code (the interface did not allow this). Next, I added an event receiver to this content type (on ItemAdded and ItemAdding). My problem is that no event is trrigered. If I add this events directly to the wiki page library all works fine. Is there a limitation/bug/trick ? I looked at the content type attached to the library with SharePoint Manager and in his schema the part for event receiver is missing...I know that there should be something like: <XmlDocuments> <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events"> <spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events"> <Receiver> <Name> </Name> <Type>1</Type> <SequenceNumber>10000</SequenceNumber> <Assembly>RssFeedWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6722cbeba696def</Assembly> <Class>RssFeedWP.ItemEventReceiver</Class> <Data> </Data> <Filter> </Filter> </Receiver> <Receiver> <Name> </Name> <Type>10001</Type> <SequenceNumber>10000</SequenceNumber> <Assembly>RssFeedWP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6722cbeba696def</Assembly> <Class>RssFeedWP.ItemEventReceiver</Class> <Data> </Data> <Filter> </Filter> </Receiver> </spe:Receivers> </XmlDocument> If I look with SPM to the content type added to site I see this part into schema. Here is my code: public override void FeatureActivated(SPFeatureReceiverProperties properties) { using (SPWeb web = (SPWeb)properties.Feature.Parent) { // create RssWiki content type SPContentType rssFeedContentType = new SPContentType(web.AvailableContentTypes["Wiki Page"], web.ContentTypes, "RssFeed Wiki Page"); // add rssfeed url field to the new content type AddFieldToContentType(web, rssFeedContentType, "RssFeed Url", SPFieldType.Note); // add use xslt check box field to the new content type AddFieldToContentType(web, rssFeedContentType, "Use Xslt", SPFieldType.Boolean); // add xslt url field to the new content type AddFieldToContentType(web, rssFeedContentType, "Xslt Url", SPFieldType.Note); web.ContentTypes.Add(rssFeedContentType); rssFeedContentType.Update(); web.Update(); AddContentTypeToList(web, rssFeedContentType); AddEventReceiversToCT(rssFeedContentType); //AddEventReceiverToList(web); } } private void AddFieldToContentType(SPWeb web, SPContentType ct, string fieldName, SPFieldType fieldType) { SPField rssUrlField = null; try { rssUrlField = web.Fields.GetField(fieldName); } catch (Exception ex) { if (rssUrlField == null) { web.Fields.Add(fieldName, fieldType, false); } } SPFieldLink rssUrlFieldLink = new SPFieldLink(web.Fields[fieldName]); ct.FieldLinks.Add(rssUrlFieldLink); } private static void AddContentTypeToList(SPWeb web, SPContentType ct) { SPList wikiList = web.Lists[listName]; wikiList.ContentTypesEnabled = true; wikiList.ContentTypes.Add(ct); wikiList.Update(); } private static void AddEventReceiversToCT(SPContentType ct) { //add event receivers string assemblyName = System.Reflection.Assembly.GetExecutingAssembly().FullName; string ctReceiverName = "RssFeedWP.ItemEventReceiver"; ct.EventReceivers.Add(SPEventReceiverType.ItemAdding, assemblyName, ctReceiverName); ct.EventReceivers.Add(SPEventReceiverType.ItemAdded, assemblyName, ctReceiverName); ct.Update(); } Thx !

    Read the article

  • [Haskell] Problem when mixing type classes and type families

    - by Giuseppe Maggiore
    Hi! This code compiles fine: {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators, TypeSynonymInstances, TypeFamilies #-} class Sel a s b where type Res a s b :: * instance Sel a s b where type Res a s b = (s -> (b,s)) instance Sel a s (b->(c,a)) where type Res a s (b->(c,a)) = (b -> s -> (c,s)) but as soon as I add the R predicate ghc fails: {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators, TypeSynonymInstances, TypeFamilies #-} class Sel a s b where type Res a s b :: * instance Sel a s b where type Res a s b = (s -> (b,s)) class R a where type Rec a :: * cons :: a -> Rec a elim :: Rec a -> a instance Sel a s (b->(c,Rec a)) where type Res a s (b->(c,Rec a)) = (b -> s -> (c,s)) complaining that: Illegal type synonym family application in instance: b -> (c, Rec a) In the instance declaration for `Sel a s (b -> (c, Rec a))' what does it mean and (most importantly) how do I fix it? Thanks

    Read the article

  • How to deal with multiple sub-type of one super-type in Django admin

    - by Henri
    What would be the best solution for adding/editing multiple sub-types. E.g a super-type class Contact with sub-type class Client and sub-type class Supplier. The way shown here works, but when you edit a Contact you get both inlines i.e. sub-type Client AND sub-type Supplier. So even if you only want to add a Client you also get the fields for Supplier of vice versa. If you add a third sub-type , you get three sub-type field groups, while you actually only want one sub-type group, in the mentioned example: Client. E.g.: class Contact(models.Model): contact_name = models.CharField(max_length=128) class Client(models.Model): contact = models.OneToOneField(Contact, primary_key=True) user_name = models.CharField(max_length=128) class Supplier(models.Model): contact.OneToOneField(Contact, primary_key=True) company_name = models.CharField(max_length=128) and in admin.py class ClientInline(admin.StackedInline): model = Client class SupplierInline(admin.StackedInline): model = Supplier class ContactAdmin(admin.ModelAdmin): inlines = (ClientInline, SupplierInline,) class ClientAdmin(admin.ModelAdmin): ... class SupplierAdmin(admin.ModelAdmin): ... Now when I want to add a Client, i.e. only a Client I edit Contact and I get the inlines for both Client and Supplier. And of course the same for Supplier. Is there a way to avoid this? When I want to add/edit a Client that I only see the Inline for Client and when I want to add/edit a Supplier that I only see the Inline for Supplier, when adding/editing a Contact? Or perhaps there is a different approach. Any help or suggestion will be greatly appreciated.

    Read the article

  • Uploading a file using post() method of QNetworkAccessManager

    - by user304361
    I'm having some trouble with a Qt application; specifically with the QNetworkAccessManager class. I'm attempting to perform a simple HTTP upload of a binary file using the post() method of the QNetworkAccessManager. The documentation states that I can give a pointer to a QIODevice to post(), and that the class will transmit the data found in the QIODevice. This suggests to me that I ought to be able to give post() a pointer to a QFile. For example: QFile compressedFile("temp"); compressedFile.open(QIODevice::ReadOnly); netManager.post(QNetworkRequest(QUrl("http://mywebsite.com/upload") ), &compressedFile); What seems to happen on the Windows system where I'm developing this is that my Qt application pushes the data from the QFile, but then doesn't complete the request; it seems to be sitting there waiting for more data to show up from the file. The post request isn't "closed" until I manually kill the application, at which point the whole file shows up at my server end. From some debugging and research, I think this is happening because the read() operation of QFile doesn't return -1 when you reach the end of the file. I think that QNetworkAccessManager is trying to read from the QIODevice until it gets a -1 from read(), at which point it assumes there is no more data and closes the request. If it keeps getting a return code of zero from read(), QNetworkAccessManager assumes that there might be more data coming, and so it keeps waiting for that hypothetical data. I've confirmed with some test code that the read() operation of QFile just returns zero after you've read to the end of the file. This seems to be incompatible with the way that the post() method of QNetworkAccessManager expects a QIODevice to behave. My questions are: Is this some sort of limitation with the way that QFile works under Windows? Is there some other way I should be using either QFile or QNetworkAccessManager to push a file via post()? Is this not going to work at all, and will I have to find some other way to upload my file? Any suggestions or hints would be appreciated. Thanks, Don

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >