Search Results

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

Page 23/2640 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Type hinting for functions in Clojure

    - by mikera
    I'm trying to resolve a reflection warning in Clojure that seems to result from the lack of type inference on function return values that are normal Java objects. Trivial example code that demonstrates the issue: (set! *warn-on-reflection* true) (defn foo [#^Integer x] (+ 3 x)) (.equals (foo 2) (foo 2)) => Reflection warning, NO_SOURCE_PATH:10 - call to equals can't be resolved. true What is the best way to solve this? Can this be done with type hints?

    Read the article

  • Cannot convert lambda expression to type 'string' because it is not a delegate type

    - by RememberME
    I have the following code written by another developer on 2 pages of my site. This used to work just fine, but now is giving the error "Cannot convert lambda expression to type 'string' because it is not a delegate type" on the Delete line with Ajax.ThemeRollerActionLink. I don't go into this section of the site often, and we recently upgraded from MVC 1.0 to 2.0. I'm guessing that's probably when it stopped working. I've looked up this error and the recommended fix seems to be add using System.Linq However, the page already has <%@ Import Namespace="System.Linq" %> <% Html.Grid(Model).Columns(col => { col.For(c => "<a href='" + Url.Action("Edit", new { userName = c }) + "' class=\"fg-button fg-button-icon-solo ui-state-default ui-corner-all\"><span class=\"ui-icon ui-icon-pencil\"></span></a>").Named("Edit").DoNotEncode(); col.For(c => Ajax.ThemeRollerActionLink("fg-button fg-button-icon-solo ui-state-default ui-corner-all", "ui-icon ui-icon-close", "Delete", new { userName = c }, new AjaxOptions { Confirm = "Delete User?", HttpMethod = "Delete", InsertionMode = InsertionMode.Replace, UpdateTargetId = "gridcontainer", OnSuccess = "successDeleteAssignment", OnFailure = "failureDeleteAssignment" })).Named("Delete").DoNotEncode(); col.For(c => c).Named("User"); }).Attributes(id => "userlist").Render(); %>

    Read the article

  • How to specialize template for type derived from particular type

    - by relaxxx
    I have class World which manages creation of object... After creation it calls afterCreation method and I the created object is user-defined type derived from Entity (eg. MyEntity), I want to call addEntity. I the object was something else, I want to do nothing. addEntity must be called with appropriate T, because it generates unique IDs for every derived class etc. Here is my solution: template <int v> struct ToType { enum { value = v }; }; template <typename T> void World::afterCreation(T * t) { afterCreation(t, ToType<std::is_base_of<Entity, T>::value>()); } template <typename T> void World::afterCreation(T * t, ToType<true>) { addEntity(t); //here I cant pass Entity *, I need the real type, eg. MyEntity } template <typename T> void World::afterCreation(T * t, ToType<false>) { } My question is - Can in be done better way? How can I simulate following code without ToType or similar? template <typename T> void afterCreation(){/*generic impl*/} template <typename T where T is derived from Entity> void afterCreation(){/*some specific stuff*/} "specialize" in the title is only to describe my intention, no need to solve problem with template specialization

    Read the article

  • Izpack: Creating custom panels

    - by bguiz
    Hi, I am trying to create a custom panel for an IzPack installer. This means that I have to extend IzPanel. However, it appears that if I do this, the extended panel needs to be in the com.izforge.izpack.panels package. Then I found this post, which stipulates that: As such, you must include installer.jar from the lib folder of IzPack in the build path of your custom panel project. Your custom panel /must/ extend com.izforge.izpack.installer.IzPanel. Furthermore, it /must/ reside in the com.izforge.izpack.panels package. On top of it all, your build jar's name /must/ be the same as the unqualified name of your custom panel class. I take issue with the 1st and 4th points. They imply that I have to create an additional JAR file for each custom IzPanel that I create. Also, I would have to modify the IzPack installation by adding these JARs to one of its subdirectories. Is this article outdated (2008) and can it be safely ignored, or is this still true? If not how can I avoid this and simply have the extended IzPanel on the classpath instead? Thank you!

    Read the article

  • «HTTP::Message content must be bytes» error when trying to post

    - by ZyX
    I have the following code: ... sub setImage { my $self=shift; my $filename=shift; unless(-r $filename) { warn "File $filename not found"; return; } my $imgn=shift; my $operation=&URI::Escape::uri_escape_utf8( (shift) ? "???????! (Delete)" : "?????????! (Store)"); my $FH=&::File::open($filename, 0, 0); my $image; # &utf8::downgrade($image); sysread($FH, $image, 102400, 0); close $FH; my $imginfo=eval{&Image::Info::image_info(\$image)}; if($@ or $imginfo->{"error"}) { warn "Invalid image: ".($@ || $imginfo->{"error"}); return undef; } my $fields=[ DIR => $self->url("fl"), OPERATION => $operation, FILE_NAME => ".photo$imgn", # FILE => [$filename], FILE => [undef, "image.".$imginfo->{"file_ext"}, # Content_Type => $imginfo->{"file_media_type"}, # Content_Type => 'application/octet-stream', Content => $image, ], ]; my $response=&ZLR::UA::post( &ZLR::UA::absURL("/cgi-bin/file_manager")."", $fields, Content_Type => "form-data", ); print $response->decoded_content; } ... When I try to use function setImage it fails with error HTTP::Message content must be bytes at /usr/lib64/perl5/vendor_perl/5.8.8/HTTP/Request/Common.pm line 91. Worse that I can't reproduce this error without using all of my code and upgrading libwww-perl does nothing. What can cause it?

    Read the article

  • jquery ajax post canceled

    - by hsemu
    I want to track the mouse click events on a set of UI components on a set of pages. To do this, I am using the following jquery/ajax call(trimmed out u): 1.Ajax call which will add the click logging. myClickLogger = { endpoint: '/path/to/my/logging/endpoint.html', logClickEvent: function(clickCode) { $.ajax({ 'type': 'POST', 'url': this.endpoint, 'async': true, 'cache': false, 'global': false, 'data': { 'clickCode':clickCode }, 'error': function(xhr,status,err){ alert("DEBUG: status"+status+" \nError:"+err); }, 'success': function(data){ if(data.status!=200){ alert("Error occured!"); } } }); } }; 2.JQuery click event which will call the ajax logger(the clickCode is an identifier for which button/image was clicked): $(document).ready(function() { $(".myClickEvent[clickName]").click(function() { var clickCode = $(this).attr("clickName"); myClickLogger.logClickEvent(clickCode); }); }); The above ajax call(1.) is "canceled" by browser whenever the button click being tracked takes to a new page. If I change 'aysnc' to 'false', then the ajax call succeeds. Also, click events which do not take to a new page succeed. Only the click events taking to new page are being canceled. I do not want to make the call synchronous. Any ideas, what could be the issue? How can I guarantee that the asynchronous call before is finished when the click event takes to a new page?

    Read the article

  • Android: Can not send http post

    - by jpartogi
    Hi all, I've been banging my head trying to figure out how to send a post method in Android. This is how my code look like: public class HomeActivity extends Activity implements OnClickListener { private TextView textView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); textView = (TextView) findViewById(R.id.text); Button button = (Button)findViewById(R.id.button); button.setOnClickListener(this); } @Override public void onClick(View view) { HttpPost httpMethod = new HttpPost("http://www.example.com/"); httpMethod.addHeader("Accept", "text/html"); httpMethod.addHeader("Content-Type", "application/xml"); AndroidHttpClient client = AndroidHttpClient.newInstance("Android"); String result = null; try { HttpResponse response = client.execute(httpMethod); textView.setText(response.toString()); HttpEntity entity = response.getEntity(); Log.i(HomeActivity.class.toString(), result); textView.setText("Invoked webservice"); } catch (IOException e) { e.printStackTrace(); Log.e(HomeActivity.class.toString(), e.getMessage()); textView.setText("Something wrong:" + e.getMessage()); } } } What am I doing wrong here? Is there anything that I may need to configure from the Android emulator to get this working? Thank you for your help.

    Read the article

  • POST data getting lost: Content Length = 0

    - by Igor K
    I've been trying to find a solution for ages with no success. On our app, customers submit a form and on the next page we process it. Sometimes though the data never arrives. This seems to happen for just a few of our customers. Seems to happen with IE7 and using a proxy. Here's some headers, note the HTTP_VIA: X-REWRITE-URL: /process.asp?r=699743 APPL_MD_PATH: /LM/W3SVC/31555/ROOT APPL_PHYSICAL_PATH: C:\inetpub\vhosts\mysite.com\httpdocs\ AUTH_PASSWORD: AUTH_TYPE: AUTH_USER: CERT_COOKIE: CERT_FLAGS: CERT_ISSUER: CERT_KEYSIZE: CERT_SECRETKEYSIZE: CERT_SERIALNUMBER: CERT_SERVER_ISSUER: CERT_SERVER_SUBJECT: CERT_SUBJECT: CONTENT_LENGTH: 0 CONTENT_TYPE: application/x-www-form-urlencoded GATEWAY_INTERFACE: CGI/1.1 HTTPS: off HTTPS_KEYSIZE: HTTPS_SECRETKEYSIZE: HTTPS_SERVER_ISSUER: HTTPS_SERVER_SUBJECT: INSTANCE_ID: 31555 INSTANCE_META_PATH: /LM/W3SVC/31555 LOCAL_ADDR: XXX.XXX.XXX.XXX LOGON_USER: PATH_INFO: /process.asp PATH_TRANSLATED: C:\inetpub\vhosts\mysite.com\httpdocs\process.asp QUERY_STRING: r=699743 REMOTE_ADDR: YYY.YYY.YYY.YYY REMOTE_HOST: YYY.YYY.YYY.YYY REMOTE_USER: REQUEST_METHOD: POST SCRIPT_NAME: /process.asp SERVER_NAME: www.mysite.com SERVER_PORT: 80 SERVER_PORT_SECURE: 0 SERVER_PROTOCOL: HTTP/1.1 SERVER_SOFTWARE: Microsoft-IIS/7.0 URL: /process.asp HTTP_CONNECTION: Keep-Alive HTTP_PRAGMA: no-cache HTTP_VIA: 1.1 WEBCACHE-2 HTTP_CONTENT_LENGTH: 0 HTTP_CONTENT_TYPE: application/x-www-form-urlencoded HTTP_ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* HTTP_ACCEPT_LANGUAGE: en-gb HTTP_COOKIE: ASPSESSIONIDQCKSDCTS=FENMPCMDCHEOENGOJPGDGPLN; HTTP_HOST: www.mysite.com HTTP_REFERER: http://www.mysite.com/theform.asp HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022) HTTP_UA_CPU: x86 HTTP_X_REWRITE_URL: /process.asp?r=699743

    Read the article

  • Window Installer custom action BEFORE any validation

    - by Marc
    I wrote a Windows Installer custom action based on the tutorial found here: http://www.codeproject.com/kb/install/msicustomaction.aspx My custom action is killing a background process of a given name which could still be opened by the user. The reason is that I don't want users to see the warning that a given EXE is running and must be closed so that setup can continue. This works fine when the MSI passes through the UI sequence as the action is created in "InstallUISequence" table like in the tutorial. However, when the MSI is used silently (right-click and select repair or uninstall), then my custom action isn't executed of course. Where do I have to put my custom action so that it is executed immediately also when run silently? I tried adding it to "InstallExecuteSequence", but the 'app running' warning is still shown. I then tried lowering the sequence number of my custom action to 5, but this also didn't help. Note: I'm using Orca to modify an MSI generated from a Visual Studio setup project. I'm then using the transform file to apply it.

    Read the article

  • Windows Installer custom action BEFORE any validation

    - by Marc
    I wrote a Windows Installer custom action based on the tutorial found here: http://www.codeproject.com/kb/install/msicustomaction.aspx My custom action is killing a background process of a given name which could still be opened by the user. The reason is that I don't want users to see the warning that a given EXE is running and must be closed so that setup can continue. This works fine when the MSI passes through the UI sequence as the action is created in "InstallUISequence" table like in the tutorial. However, when the MSI is used silently (right-click and select repair or uninstall), then my custom action isn't executed of course. Where do I have to put my custom action so that it is executed immediately also when run silently? I tried adding it to "InstallExecuteSequence", but the 'app running' warning is still shown. I then tried lowering the sequence number of my custom action to 5, but this also didn't help. Note: I'm using Orca to modify an MSI generated from a Visual Studio setup project. I'm then using the transform file to apply it.

    Read the article

  • Problem passing strings with PHP post

    - by andy
    Hi Guys, Basically I'm developing a (very) simple search engine. You can enter a search term and you are taken to the results page - which works fine. However on the results page, I have a button that will take you to the next 10 results: where $term is the $_POST['term'] value. echo "<input type='hidden' name='term' value='" . $term . "'>"; This causes the following problem with the term is for example "aidan's". When the next 10 button is clicked, the term becomes aidan\ and no further results are found. I am not doing anything to $term. I usually use Java, but am required to use PHP for this uni assignment! Any help would be greatly appreciated.

    Read the article

  • How to post a poll on the Facebook wall

    - by Bengt
    Hi, I'm trying to convert my poll app into a Facebook iframe app. My app is written in PHP and uses some Ajax calls to vote at a poll. In the application canvas everything is working fine, but of course I want to get the poll on the wall of a user too. Unfortunately I'm not able to find out how I can post a simple poll with some radio buttons for the options on the wall. I know how to publish images, text, audio files and links to the wall, but I have no idea how to publish my poll on the wall. And I don't just want to use links to vote, I want the user be able to choose a radio button. Does anyone have an idea how to do this or where to find information about doing this? I'm stuck there now for a while and it gets pretty frustrating. I'm using the new Graph API by the way. Or is this impossible? But I don't think so. Any help is appreciated. Bengt

    Read the article

  • Email an image via custom url scheme

    - by Amaresh
    I am using custom url schemes. I can send string messages as parameters to my custom url and emailing this to any person. When any person opens this email attachment in device in it open my app installed in device with the passed parameters in my custom url. Similarly how to email an image via custom url and when any person opens this attachment the image is passed to my app in device. I tried to encode the image in base64 format and tried to append to my url,but not working. Any ideas?? Thanks in advance

    Read the article

  • NSURLConnection and empty post variables

    - by SooDesuNe
    I'm at my wits end with this one, because I've used very similar code in the past, and it worked just fine. The following code results in empty $_POST variables on the server. I verified this with: file_put_contents('log_file_name', "log: ".$word, FILE_APPEND); the only contents of log_file_name was "log: " I then verified the PHP with a simple HTML form. It performed as expected. The Objective-C: NSString *word = "this_word_gets_lost"; NSString *myRequestString = [NSString stringWithFormat:@"word=%@", word]; [self postAsynchronousPHPRequest:myRequestString toPage:@"http://www.mysite.com/mypage.php" delegate:nil]; } -(void) postAsynchronousPHPRequest:(NSString*)request toPage:(NSString*)URL delegate:(id)delegate{ NSData *requestData = [ NSData dataWithBytes: [ request UTF8String ] length: [ request length ] ]; NSMutableURLRequest *URLrequest = [ [ NSMutableURLRequest alloc ] initWithURL: [ NSURL URLWithString: URL ] ]; [ URLrequest setHTTPMethod: @"POST" ]; [ URLrequest setHTTPBody: requestData ]; [ NSURLConnection connectionWithRequest:URLrequest delegate:delegate]; [URLrequest release]; } The PHP: $word = $_POST['word']; file_put_contents('log_file_name', "log: ".$word, FILE_APPEND); What am I doing wrong in the Objective-C that would cause the $_POST variable to be empty on the server?

    Read the article

  • WPF Custom Control with Image problem

    - by user311883
    Hi all, I am quite new to WPF/XAML and I am currently facing a problem. I have a solution with two projects in it, the first project is a Custom Control Library with a custom Window form control inside. The second project is a WPF application using my custom window form. All work fine except for the form Icon. In the WPF application project I set my window icon property to "/ProjectTwoNameSpace;component/Resources/Images/Film.ico", and in the WPF custom control I try to show that image that way : <Image Grid.Column="0" Margin="3" Width="27" Height="27"> <Image.Source> <BitmapImage UriSource="{Binding Path=Icon}" /> </Image.Source> </Image> But it doesn't work, I get a error at runtime saying that the property UriSource or StreamSource must be set for my tag. Anyone can help me ? I think it's jsut a WPF newbie problem ^^

    Read the article

  • Get all custom fields that belong to a certain box in Wordpress

    - by user252160
    How can I get all custom fields that belong to a certain box only. For example, I am using the "more fields" plugin which allows me to create boxes of custom fields for instance a box called "hotel features" with different custom fields as the particular features. Teh point is that when I extract meta data in the template, there is no way, known to me, how to get only the fields that belong to the "hotel features box", say. Please, help with suggestions

    Read the article

  • flex custom events bubbling

    - by Rajeshbabu TRC
    Dear Richard Szalay, i go through your answers regarding bubbling, i want explore bubbling more. Please see my sample below <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:view="com.view.*" > } ]] In my custom event class i set bubbling=true, cancelable=true I can understand from previous answer that bubbling only affects UI components; events fired from custom classes will not bubble, even if the bubbles argument is set to true. My question is how can i prevent panelClickHandler function got fired when i click button in the "Load" (custom component)?? pleas explain bubbling with good example ( like to have with custom event classes)?

    Read the article

  • How to process XML sernt via POST?

    - by John Conde
    I'm receiving XML sent via POST. Naturally I need to parse this XML to get at the goodies it holds for me. However, when I receive the XML is seems that PHP is parsing it like a query string. For example, this xml: <?xml version="1.0" encoding="utf-8"?> <ForgotPassword> <version>1.0</version> <authentication> <login>myresllerid</login> <apikey>1234567890abcdef</apikey> </authentication> <parameters> <emailAddress>[email protected]</emailAddress> </parameters> </ForgotPassword> Becomes this (from print_r($_REQUEST)): Array ( [ <?xml_version] => "1.0" encoding="utf-8"?> <IDCForgotPassword> <version>1.0</version> <authentication> <login>myresllerid</login> <apikey>1234567890abcdef</apikey> </authentication> <parameters> <emailAddress>[email protected]</emailAddress> </parameters> </IDCForgotPassword> ) You can see the XML is being broken up at the first equals sign (=) in the XML into a key/value pair. How do I avoid this?

    Read the article

  • Access values of a group of select boxes in php from post

    - by 2Real
    Hi, I'm new to PHP, and I can't figure this out. I'm trying to figure out how to access the data of a group of select boxes I have defined in my HTML code. I tried grouping them as a class, but that doesn't seem to work... maybe I was doing it wrong. This is the following HTML code. <form action="" method="post"> <select class="foo"> <option> 1.....100</option> </select> <select class="foo"> <option> 1.... 500></option> </select> <input type="submit" value="Submit" name="submit"/> </form> I essentially want to group all my select boxes and access all the values in my PHP code. Thanks

    Read the article

  • GET and POST on the same page?

    - by Phil
    I am creating a commenting script and I came across a problem. I am having to use $_POST and $_GET on the same page, which I don't think makes sense. I am very new to php and am training myself. I have a page named viewVerses.php - this has a lists of verses. When someone follows the reply link, echo '<br /><a href="reply.php?verseid='.$verseid.'">Reply</a>'; I'm passing the verseid (commenting on bible verses) into the reply.php, so that a query may be made with that verseid. (This is so that the user can still see the verse he/she is commenting on). Now reply.php has the form in it for posting a reply. The form goes to postReply.php This is in postReply.php $title = $_POST['title']; $body = $_POST['body']; $verseid = $_GET[verseid]; Can I get the verseid from the url and the POST the values from the form in the same page? If not, is there a way I can do this better? Remember, I am new at php and probably won't implement a solution that is super hard. I have to get it for my to put it in my site. I hope this is clear

    Read the article

  • NetBeans create and instantiate programatically custom swing widgets

    - by RenegadeAndy
    Hey! I have a problem I know how I would solve easily developing under eclipse - but not so easily developing under net beans. I want to create a custom swing widget - which I can instantiate by code as many as I need and attach them to my main panel. I have developed the rest of the GUI using the GUIBuilder. The problem is - im not entirely sure how to do this. Say I got 20 results back from a web service, I would wana loop round - and add 20 of these custom swing widgets - the custom swing widgets would look as follows : :Picture: :Label: :Label: Can anybody please help me, im not entirely sure how to do the custom widget either! Thanks in advance for any support. Andy

    Read the article

  • C# custom control: Use internal content as Text field

    - by Ed Woodcock
    I'm creating a custom control, and I want to get all the stuff within the tags and use it as a string Text field on my control: i.e. <custom:control ID="C" runat="server">This text should go into the text property</custom:control> Does anyone know how to achieve this? I've tried the following attributes on my text field (copied from the Literal control) but it doesn't seem to work! [DefaultValue(""), Bindable(true), Localizable(true)]

    Read the article

  • PHP post programmatically

    - by Tural Teyyuboglu
    After user registration, website send activation code to email. something like that. www.domain.com/?activate=<code> I'm creating 2 variants of activation: 1.manual 2.auto Lets say we have index.php. 1.Manual method. When someone wants to activate user manually all things are obvious: User opens page www.domain.com/?activate Index.php checks with following script and includes div file (which contains activation form) if (isset($_GET['activate'])) { $page='activate'; $divfile = 'path to div.php'; } include $divfile; Then page sends form data via ajax to activation.php file. 2.Auto method. Lets say user clicked directly to www.domain.com/?activate=<code>. What I wanna do is, to check if(!empty($_GET['activate'])), if all right ... I can't figure out how to act?! Programmatically send something like POST to activation.php or what? Please help. Thx in advance

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >