Search Results

Search found 16885 results on 676 pages for 'custom headers'.

Page 61/676 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • help needed on libcurl programming in sending HTTP HEAD Request.

    - by Mani
    Hi all, I need clarifications on using libcurl for the following: I need to send an http HEAD request shown as below :: HEAD /mshare/3/30002:12:primary/stream_xNKNVH.mpeg HTTP/1.1 Host: 192.168.70.1:8080 Accept: */* User-Agent: Kreatel_IP-STB getcontentFeatures.dlna.org: 1 The code I wrote (shown below) , sends the HEAD Request in slightly different way: curl_global_init(CURL_GLOBAL_ALL); CURL* ctx = NULL; const char *url = "http://192.168.70.1:8080/mshare/3/30002:12:primary/stream_xNKNVH.mpeg" ; char *returnString; struct curl_slist *headers = NULL; ctx = curl_easy_init(); headers = curl_slist_append(headers,"Accept: */*"); headers = curl_slist_append(headers,"User-Agent: Kreatel_IP-STB");\ headers = curl_slist_append(headers,"getcontentFeatures.dlna.org: 1"); headers = curl_slist_append(headers,"Pragma:"); headers = curl_slist_append(headers,"Proxy-Connection:"); curl_easy_setopt(ctx,CURLOPT_HTTPHEADER , headers ); curl_easy_setopt(ctx,CURLOPT_NOBODY ,1 ); curl_easy_setopt(ctx,CURLOPT_VERBOSE, 1); curl_easy_setopt(ctx,CURLOPT_URL,url ); curl_easy_setopt(ctx,CURLOPT_NOPROGRESS ,1 ); curl_easy_perform(ctx); curl_easy_cleanup(ctx); curl_global_cleanup(); The code shown above sends the HEAD Request in slightly different form (shown below) HEAD http://192.168.70.1:8080/mshare/3/30002:12:primary/stream_xNKNVH.mpeg HTTP/1.1 Host: 192.168.70.1:8080 Proxy-Connection: Keep-Alive Accept: */* User-Agent: Kreatel_IP-STB getcontentFeatures.dlna.org: 1 Can any one , share the appropriate code ?

    Read the article

  • QGraphicsView and custom Cursors

    - by Etienne de Martel
    I am trying to make use of a mix of custom cursors and preset cursors for my QGraphicsView. In my implementation we have created a notion of "modes" for the view. Meaning that depending on what "mode" the user is in, different things will happen on the left-click, or left-click drag. Anyway, none of that is the problem, just the context. The problem arises when I try to change the cursor for each mode. For instance, for mode 1 we want to show the regular Arrow cursor, but for mode 2, we want to use a custom pixmap. Seemingly simple we call graphicsview->viewport()->setCursor(Qt::QArrowCursor)  when we are switching to mode 1, and graphicsview->viewport()->setCursor(our custom cursor) for mode 2. Except it doesn't work at all. Firstly, the cursor does not change to the custom cursor. That is the first problem. However, if through another operation the drag mode of the graphics view gets set to ScrollHandDrag, the cursor will switch to the custom cursor once the drag operation is complete. Weird. But the plot thickens... Once we switch to the custom cursor, it can never be changed back to the ArrorCursor no matter how many times we call setCursor(Qt::QArrowCursor). it also doesn't seem to matter whether I call setCursor on the viewport or the graphics view itself. So, just for fun, I added a call to graphicsview->unsetCursor() just before we want to change the cursor, and that at least rectifies the second problem. The cursor changes just fine so long as we do a little HandDragging in between. Better, but certainly not optimal. However it should be noted, that doing the unsetCursor on the viewport doesn't work. it must absolutely be done on the graphicsview - regardless of the fact that we are setting the cursor on the viewport. To completely patch over the problem I have added these two lines after I set the cursor: graphicsview->setDragMode(QGraphicsView::ScrollHandDrag); graphicsview->setDragMode(QGraphicsView::NoDrag); Which works, but ye gads!! So something magical is happening inside these two methods that fixes the problem, but glancing at the code I don't see what. Something to do with the fact that the drag mode is changing the cursor I imagine. Just for completeness, I should also mention that the thing that triggers the mode change, is a QPushButton that has been added to the scene using QGraphicsScene->addWidget(). I don't know if that has anything to do with it, but you never know. I am hoping that either someone could clarify why I need to make these seemingly random calls. I don't think I am doing anything wrong anywhere. Thanks in advance for any help. EDIT: Here is an actual code example with the cursor patches as described above. You can look at and/or download them from the link below. It was a little long to paste here. I included the framework around which the cursors are changed, because I have a funny feeling that that is important somehow. https://gist.github.com/712654 The code where the problem lies is in MyGraphicsView.cpp starting at line 104. This is where the cursor is set in the graphics view. It is exactly as described above. Keep in mind, with the very ugly patches in place the cursors do work - more or less. Without those lines you will see very clearly the problems listed in the post above. Also included in the link, is all the code for a mainWindow that uses the view, etc... the only thing missing are the images I am using. But the images themselves don't matter, any 16x16 pngs will do.

    Read the article

  • How do I fix dependency problems with the kernel in apt?

    - by Jon
    When trying to install new packages, either manually or with muon, I get these errors: jon@jon-desktop:~/Apps/mendeleydesktop-1.5-dev4-linux-x86_64/bin$ sudo apt-get install kupfer [sudo] password for jon: Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: kupfer : Depends: python-keybinder but it is not going to be installed Recommends: python-wnck but it is not going to be installed linux-headers-generic : Depends: linux-headers-3.2.0-20-generic but it is not installable linux-image-generic : Depends: linux-image-3.2.0-20-generic but it is not installable E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). jon@jon-desktop:~/Apps/mendeleydesktop-1.5-dev4-linux-x86_64/bin$ sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed: linux-generic linux-headers-generic linux-image-generic The following packages will be upgraded: linux-generic linux-headers-generic linux-image-generic 3 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. 3 not fully installed or removed. Need to get 0 B/6,658 B of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? dpkg: dependency problems prevent configuration of linux-image-generic: linux-image-generic depends on linux-image-3.2.0-20-generic; however: Package linux-image-3.2.0-20-generic is not installed. dpkg: error processing linux-image-generic (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. dpkg: dependency problems prevent configuration of linux-generic: linux-generic depends on linux-image-generic (= 3.2.0.20.22); however: Package linux-image-generic is not configured yet. dpkg: error processing linux-generic (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. dpkg: dependency problems prevent configuration of linux-headers-generic: linux-headers-generic depends on linux-headers-3.2.0-20-generic; however: Package linux-headers-3.2.0-20-generic is not installed. dpkg: error processing linux-headers-generic (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: linux-image-generic linux-generic linux-headers-generic E: Sub-process /usr/bin/dpkg returned an error code (1) As indicated above, I ran sudo apt-get -f install but it still tells me there are dependency issues.

    Read the article

  • Silverlight 3 - Creating Custom Objects inside a Merged ResourceDictionary

    - by Tony Heupel
    I have custom classes that I currently instantiate within App.xaml as resources. I want to move these custom objects into a Merged ResourceDictionary, where they are used within styles, and keep them close to where they are used. Here's an example of what I want, arbitrarily using fake converter objects, but they could be any custom object... App.xaml (namespace declarations ommitted): <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Merged.xaml" /> </ResourceDictionary.MergedDictionaries> <Style x:Key="SomeStyle" TargetType="SomeControl"> ... </Style> ... </ResourceDictionary> And then in Merged.xaml (namespace declarations omitted): <ResourceDictionary> <cvt:VisibilityToBoolConverter x:Key="BoolToVisibility" Inverted="True"/> <cvt:VisibilityToBoolConverter x:Key="NotBoolToVisibility" Inverted="True" Not="True"/> <Style x:Key="SomethingThatUsesVisibilityToBoolConvertersStyle" TargetType="SomeOtherControl"> .... </Style> </ResourceDictionary> The issue I'm seeing is this: when I create the BoolToVisibility and NotBoolToVisibility objects (as well instantiating other objects that are instances of custom classes I have created) just as part Application.Resources, they are created and all the references work as expected; however, when I move these into a Merged Resource Dictionary (as I have in the sample above), I get a malformed Application exception when the Silverlight application loads. I belive this to be an issue with how objects are instantiated differently in Merged Resource Dictionaries (I belive it is more of a lazy-load approach), but I would expect it to work nonetheless. I am very much able to add Style objects, DataTemplates, ControlTemplates, and the like. But when I want to create instances of custom classes that are named or keyed using Xaml, it works great inside of App.xaml's Application.Resources directly and Application.Resources/ResourceDictionary as well. As soon as they are moved into a merged dictionary, it throws the exception. Is this by design? Any other ideas that work? Thanks in advance...

    Read the article

  • Wordpress Custom Post Type adding tags

    - by Nick White
    I am currently working on a Wordpress site I have created some custom Post Types all work fine create the post etc. What I need however is custom taxonomies with some of the custom Post Types, I have set this up and when adding different tags to the taxonomy it works however, when creating a post for a custom post type in the taxonomy block clicking add tag it just does a anchor link to #Member news Category-add Nothing else happens, it's not a big bug but I would however, like to fix this so it is correct for the time I go live Is this a known bug? or is there something I have probably missed when creating the custom post type? register_post_type('member_news', array( 'label' => 'Member News','description' => 'News content submitted by members of RRUKA.','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'member-news'),'query_var' => true,'has_archive' => true,'exclude_from_search' => false,'menu_position' => 5,'supports' => array('title','editor','excerpt','trackbacks','revisions','thumbnail','author','page-attributes',),'labels' => array ( 'name' => 'Member News', 'singular_name' => 'Member News', 'menu_name' => 'Member News', 'add_new' => 'Add Member News', 'add_new_item' => 'Add New Member News', 'edit' => 'Edit', 'edit_item' => 'Edit Member News', 'new_item' => 'New Member News', 'view' => 'View Member News', 'view_item' => 'View Member News', 'search_items' => 'Search Member News', 'not_found' => 'No Member News Found', 'not_found_in_trash' => 'No Member News Found in Trash', 'parent' => 'Parent Member News', ),) ); Any information on this would be very welcome Thanks in advanced

    Read the article

  • why headers of query results display sometimes in button sometimes in links format ?

    - by I Like PHP
    Hello All, it's just my curiosity to know that why phpmyadmin behavior in different manner when we modify query a bit( putting extra space) then headers of query results, sometime comes in Button format( on hover it say sort, but sorting not working at all) and sometimes in blue link is there any difference for this or it just causing by some othe reason? i m attaching both images. Button headers Link headers

    Read the article

  • Could not load type in Custom Profile provider

    - by Cragly
    I am writing a small console application in C# that references a custom assembly that implements custom .net Profile provider. I have added the following sections to my app.config file which references the custom class and assembly. <system.web> <profile defaultProvider="MyCompanyProfileProvider" inherits="MyCompany.Web.User.GenericProfile" automaticSaveEnabled="false"> <providers> <clear/> <add name="MyCompanyProfileProvider" connectionStringName="defaultDatabase" applicationName="/myApplication" type="MyCompany.Web.ProfileProvider, MyCompany.Web"/> </providers> <properties> <add name="JobRoleId" type="System.Int32"/> <add name="LastCompetencyId" type="System.Int32" defaultValue="0"/> <add name="MixSettings" type="System.Xml.XmlDocument"/> </properties> </profile></system.web> However when I run the app in debug mode I get the following error as if it is looking in the System.Web assembly rather than one specified in the app.config file. Could not load type 'MyCompany.Web.User.GenericProfile' from assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. I have a local web app that also uses the assembly and custom Profile provider and that work without any problems. I have checked the referenced assembly is being copied to the output directory. Any ideas??

    Read the article

  • Android custom categories

    - by marian
    Hello, I have a view as a main screen of the application which contains the available application's actions as icon+text pairs ( desktop like). I want to find out programatically what are the activities defined ONLY in my AndroidManifest.xml Suppose I have : < activity android:name="example.mainActivity" android:label="mainActivity" < intent-filter < action android:name="android.intent.action.MAIN" / < category android:name="android.intent.category.LAUNCHER" / < /intent-filter < /activity < activity android:name="example.activity1" android:label="Activity1" < intent-filter < action android:name="android.intent.action.VIEW" / < category android:name="example.custom.ACTIVITY" / < /intent-filter < /activity < activity android:name="example.activity2" android:label="Activity2" < intent-filter < action android:name="android.intent.action.VIEW" / < category android:name="example.custom.ACTIVITY" / < /intent-filter < /activity I want that in the mainActivity to dinamically read Activity1 and Activity2 because when i add Activity3 for example it will be automatically read. I thought that this could be done by defining a custom category, example.custom.ACTIVITY, and in the mainActivity use the packageManager.queryIntentActivities(Intent intent, int flags) but it doesn't seem to be working. I really would like to code it to dinamically discover the installed activities in my application. Do you have any ideas on how to do this? Thank you

    Read the article

  • Magento MAGMI: Product attributes (custom options) not showing up in import

    - by Rodgers and Hammertime
    When importing a CSV into Magento with the MAGMI importing tool, I am unable to import Custom Options (as in size: smalee/medium/large). The import manages to put in the basic products, but the Custom Options don't transfer accross. By custom options I mean the fields Title, Input Type, Is Required, Sort Order Title, Price, Price Type, SKU, Sort Order Title, Price, Price Type, SKU, Sort Order Title, Price, Price Type, SKU, Sort Order and so on ... Found in the custom options menu... Even using the example CSV from the MAGMI SourceForge Wiki: sku,name,description,price,Size:drop_down:1 T-Shirt1,T-Shirt,A T-Shirt,5.00,Small|Medium|Large T-Shirt2,T-Shirt2,Another T-Shirt,6.00,XS|S|M|L|XL ...it fails to import the attributes. So i'm simply using MAGMI with the supplied example data from SourceForge on a blank magento product list, and it doesn't transfer properly. Can anyone shed any light on what might be wrong? I am using Magento ver. 1.6.1.0 if that changes anything. Thanks.

    Read the article

  • How to bind form collection back to custom model object that uses 2 custom objects in asp.net mvc?

    - by baijajusav
    What I'm trying to do is rather basic, but I might have my facts mixed up. I have a details page that has a custom class as it's Model. The custom class uses 2 custom objects with yet another custom object a property of one of the 2. The details page outputs a fair amount of information, but allows the user to post a comment. When the user clicks the post button, the page gets posted to a Details action that looks something like this: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Details(VideoDetailModel vidAndComment) { ....} The only fields on the form that is posted are CommentText and VideoId. Here is what the VideoDetailModel looks like. public class VideoDetailModel { public VideoDetailModel() { Video = new VideoDTO(); Comment = new CommentDTO(); } public VideoDetailModel(VideoDTO vid) { Video = vid; Comment = new CommentDTO(); } public VideoDTO Video { get; set; } public CommentDTO Comment { get; set; } } VideoDTO has a few properties, but the ones I need are VideoId. CommentDTO's pertinent properties include CommentText (which is posting correctly) and a UserDTO object that contains a userId property. Everything other than the CommentText value is not being posted. I also have the following line on the ascx page, but the model value never gets posted to the controller. Html.Hidden("Model.Video.VideoId", Model.Video.VideoId); I'm really not sure what I'm missing here. I suppose if I added more form fields for the properties I need, they would get posted, but I only need 1 form entry field for the CommentText. If I could get the same Model objects value that were sent to the page to post with the page, that would help. I'll be happy to make any clarifications needed here. I'm just at loss as to what's going on.

    Read the article

  • E-commerce platform for custom application integration

    - by Zach Smith
    We are building an online subscription-based website and I'm looking for recommendations on which e-commerce platform to use for the checkout process. Requirements include: Only four products. The sign-up process of the site is heavily customized, and after checkout the user should automatically get logged into the subscriber area. Subscriptions will last one year and can be renewed manually. Support for coupons/discount codes at a later point. Since the entire application is custom, we've weighed building a custom checkout but are strongly leaning towards using existing software to avoid having to build lots of admin reporting as well as a coupon engine down the road. The two questions we're pondering are: Is it better to a) build our application custom and use whatever e-commerce software we select just for the payment piece, or b) use the e-commerce software as the basis and build our application around it/as a module/etc? Which e-commerce platform should we use? I've looked into a variety of off the shelf e-commerce software, but it's not clear to me which would be easiest to integrate with. I've researched on the Web and looked at many of the threads on SO to compiled a list of potential candidates: www.magentocommerce.com/ (seems difficult to integrate with) www.prestashop.com/ www.nopcommerce.com/ www.opencart.com/ www.cubecart.com/ www.spreecommerce.com/ www.interspire.com/ www.tradingeye.com/ We're most concerned with the level of effort required with ramping up on the software and then doing the integration with our custom functionality. We're most proficient with PHP, ASP.NET and some ROR and are only considering those technologies. We prefer open source, but would be open to commercial if there's a significant upside. Any experiences with similar projects and advice is greatly appreciated.

    Read the article

  • Implementing custom Matlab functions in Simulink

    - by niko
    Hi, I would like to use custom Matlab function in Simulink. So far I have done it by placing Embedded Matlab Fuction block. However if the custom function contains another custom function the compile process fails. Here is the example of function I am trying to embed in the simulation: function [c, d, iterationsCount] = decodeLDPC(y, H, variance) Lci = initializeLq(y, H, variance); Lr = getLr(Lci); [Lq, c] = getLq(Lci, H, Lr); iterationsCount = 1; while(sum(mod(c * H', 2)) ~= 0) Lr = getLr(Lq); [Lq, c] = getLq(Lq, H, Lr); iterationsCount = iterationsCount + 1; end; G = getGeneratorMatrix(H); d = c/G; where initializeLq and getLr are custom functions as well. I would be very thankful if anyone could suggest a method to implement the above function in the simulation. Thank you.

    Read the article

  • Event OnClick for a button in a custom notification

    - by Simone
    I have a custom notification with a button. To set the notification and use the event OnClick on my button I've used this code: //Notification and intent of the notification Notification notification = new Notification(R.drawable.stat_notify_missed_call, "Custom Notification", System.currentTimeMillis()); Intent mainIntent = new Intent(getBaseContext(), NotificationActivity.class); PendingIntent pendingMainIntent = PendingIntent.getActivity(getBaseContext(), 0, mainIntent , 0); notification.contentIntent = pendingMainIntent; //Remoteview and intent for my button RemoteViews notificationView = new RemoteViews(getBaseContext().getPackageName(), R.layout.remote_view_layout); Intent activityIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:190")); PendingIntent pendingLaunchIntent = PendingIntent.getActivity(getBaseContext(), 0, activityIntent, PendingIntent.FLAG_UPDATE_CURRENT); notificationView.setOnClickPendingIntent(R.id.button1, pendingLaunchIntent); notification.contentView = notificationView; notificationManager.notify(CUSTOM_NOTIFICATION_ID, notification); With this code I've a custom notification with my custom layout...but I can't click the button! every time I try to click the button I click the entire notification and so the script launch the "mainIntent" instead of "activityIntent". I have read in internet that this code doesn't work on all terminals. I have tried it on the emulator and on an HTC Magic but I have always the same problem: I can't click the button! My code is right? someone can help me? Thanks, Simone

    Read the article

  • Runtime Exception when using Custom Healthmonitoring event in medium trust

    - by Elementenfresser
    Hi, I'm using custom healthmonitoring events in ASP.NET We recently moved to a new server with default High Trust Permissions. Literature says that healthmonitoring and custom events should work under Medium or higher trust (http://msdn.microsoft.com/en-us/library/bb398933.aspx). Problem is it doesn't. In less than high trust I get a SecurityException saying The application attempted to perform an operation not allowed by the security policy It works in Full trust or when I remove the inheritance of System.Web.Management.WebErrorEvent. Any suggestions anyone? Here is the super simple code behind with a custom event defined: public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { try { CallCustomEvent(); } catch (Exception ex) { Response.Write(ex.Message); throw ex; } } /// <summary> /// this metho is never called due to lacking permissions... /// </summary> private void CallCustomEvent() { try { //do something useful here } catch (Exception) { //code to instantiate the forbidden inheritance... WebBaseEvent.Raise(new CustomEvent()); } } } /// <summary> /// custom error inheriting WebErrorEvent which is not allowed in high trust? can't believe that... /// </summary> public class CustomEvent : WebErrorEvent { public CustomEvent() : base("test", HttpContext.Current.Request, 100001, new ApplicationException("dummy")) { } } and the Web Config excerpt for high trust: <system.web> <trust level="High" originUrl="" />

    Read the article

  • InstallExecuteSequence cache interferes with custom action operation

    - by Dima G
    I need to upgrade a product that could be installed in per-user context to a new version that is always in per-machine context. The requirements are: Whether the old version was installed in a Per-User (no matter who) or Per-Machine context should be completely seamless to an administrator user that performs the upgrade. The MSI upgrade should succeed without the need to know the password of the user that originally installed the previous version of the product in a Per-User context. The installation should be performed from a single .msi file (no setup.exe is allowed). The installation should be able to run in a silent (non-UI) mode. No reboots are allowed during installation. My strategy is to find in the beginning of the installation whether the product is already installed in per-user context, and if so, to transform the registry keys manually to Per-Machine context (I checked: no additional changes such as file system changes etc. are needed except this transform). I figured out how to move all appropriate keys in the registry from the user settings to the machine settings (pre-loaded appropriate user hive in case it didn't appear in HKEY_USERS) and created custom action that does it - and it does work when I run it as a stand-alone executable before running the MSI. The problem, however, is that when Windows Installer runs InstallExecuteSequence it first creates a 'cached product context' for all products. So when my custom action runs in the course of InstallExecuteSequence, this cache has already been created. Thus FindRelatedProducts action that determines if older product with same upgrade code exists looks on that cache and ignores the changes that my custom action applied. If before running the MSI the previous product was in per-user context, FindRelatedProducts will look at the cache and not apply the upgrade and remove the previous version, because the new product is in per-machine context, even though the previous product version is already configured to per-machine context in the registry by that time by my custom action. What can be done to solve this problem without violating the requirements stated above?

    Read the article

  • Security Exception when using Custom ASP.NET Healthmonitoring event in medium trust

    - by Elementenfresser
    Hi, I'm using custom healthmonitoring events in ASP.NET We recently moved to a new server with default High Trust Permissions. Literature says that healthmonitoring and custom events should work under Medium or higher trust (http://msdn.microsoft.com/en-us/library/bb398933.aspx). Problem is - it doesn't. In less than full trust I get a SecurityException saying The application attempted to perform an operation not allowed by the security policy It works in Full trust or when I remove the inheritance of System.Web.Management.WebErrorEvent. Any suggestions anyone? Here is the super simple code behind with a custom event defined: public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { try { CallCustomEvent(); } catch (Exception ex) { Response.Write(ex.Message); throw ex; } } /// <summary> /// this metho is never called due to lacking permissions... /// </summary> private void CallCustomEvent() { try { //do something useful here } catch (Exception) { //code to instantiate the forbidden inheritance... WebBaseEvent.Raise(new CustomEvent()); } } } /// <summary> /// custom error inheriting WebErrorEvent which is not allowed in high trust? can't believe that... /// </summary> public class CustomEvent : WebErrorEvent { public CustomEvent() : base("test", HttpContext.Current.Request, 100001, new ApplicationException("dummy")) { } } and the Web Config excerpt for high trust: <system.web> <trust level="High" originUrl="" />

    Read the article

  • Titanium TableViewRow classname with custom rows

    - by pancake
    I would like to know in what way the 'className' property of a Ti.UI.TableViewRow helps when creating custom rows. For example, I populate a tableview with custom rows in the following way: function populateTableView(tableView, data) { var rows = []; var row; var title, image; var i; for (i = 0; i < data.length; i++) { title = Ti.UI.createLabel({ text : data[i].title, width : 100, height: 30, top: 5, left: 25 }); image = Ti.UI.createImage({ image : 'some_image.png', width: 30, height: 30, top: 5, left: 5 }); /* and, like, 5+ more views or whatever */ row = Ti.UI.createTableViewRow(); row.add(titleLabel); row.add(image); rows.push(row); } tableView.setData(rows); } Of course, this example of a "custom" row is easily created using the standard title and image properties of the TableViewRow, but that isn't the point. How is the allocation of new labels, image views and other child views of a table view prevented in favour of their reuse? I know in iOS this is achieved by using the method -[UITableView dequeueReusableCellWithIdentifier:] to fetch a row object from a 'reservoir' (so 'className' is 'identifier' here) that isn't currently being used for displaying data, but already has the needed child views laid out correctly in it, thus only requiring to update the data contained within (text, image data, etc). As this system is so unbelievably simple, I have a lot of trouble believing the method employed by the Titanium API does not support this. After reading through the API and searching the web, I do however suspect this is the case. The 'className' property is recommended as an easy way to make table views more efficient in Titanium, but its relation to custom table view rows is not explained in any way. If anyone could clarify this matter for me, I would be very grateful.

    Read the article

  • WPML is not detecting Wordpress custom post types

    - by janoChen
    I learned how to make custom post types with the following tutorial: http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/ It basically consist in adding this code to function.php: add_action( 'init', 'create_events' ); function create_events() { $labels = array( 'name' => _x('Events', 'post type general name'), 'singular_name' => _x('Event', 'post type singular name'), 'add_new' => _x('Add New', 'Event'), 'add_new_item' => __('Add New Event'), 'edit_item' => __('Edit Event'), 'new_item' => __('New Event'), 'view_item' => __('View Event'), 'search_items' => __('Search Events'), 'not_found' => __('No Events found'), 'not_found_in_trash' => __('No Events found in Trash'), 'parent_item_colon' => '' ); $supports = array('title', 'editor', 'custom-fields', 'revisions', 'excerpt'); register_post_type( 'event', array( 'labels' => $labels, 'public' => true, 'supports' => $supports ) ); } The WPML plugin help you to translate posts to different langauges. But this option doesn't appear in the custom post types. Any suggestions?

    Read the article

  • Django Getting RequestContext in custom tag

    - by greggory.hz
    I'm trying to create a custom tag. Inside this custom tag, I want to be able to have some logic that checks if the user is logged in, and then have the tag rendered accordingly. This is what I have: class UserActionNode(template.Node): def __init__(self): pass def render(self, context): if context.user.is_authenticated(): return render_to_string('layout_elements/sign_in_register.html'); else: return render_to_string('layout_elements/logout_settings.html'); def user_actions(parser, test): return UserActionNode() register.tag('user_actions', user_actions) When I run this, I get this error: Caught AttributeError while rendering: 'Context' object has no attribute 'user' The view that renders this looks like this: return render_to_response('start/home.html', {}, context_instance=RequestContext(request)) Why doesn't the tag get a RequestContext object instead of the Context object? How can I get the tag to receive the RequestContext instead of the Context? EDIT: Whether or not it's possible to get a RequestContext inside a custom tag, I'd still be interested to know the "correct" or best way to determine a user's authentication state from within the custom tag. If that's not possible, then perhaps that kind of logic belongs elsewhere? Where?

    Read the article

  • Custom authentication method for GDM

    - by FMC
    I am trying to find a way of authenticating users on public computers through GDM, but I have a few things to be taken in account. The users do not have a login/password, they only thing they are given is a string. This string is unique and will allow us to identify them. You can see this string as a login without a password. The users must be present in a remote database The users must have the rights to login on the computer they are on at that time. A remote database would check if a booking on the computer had been set for that time by that user. Or if no booking had been made, allow to login. A default user id/home/gid has to be set to the user once logged in I have found ways to deal with most of those requirements, but not altogether. PAM looks nice to set up a custom way of checking if the user booked its computer. NSS MySQL looks nice to set up the environment. Would you know how to set up the environment by myself using a custom PAM module (using pam_python would be preferred)? Or any other method that could help me? Thanks in advance!

    Read the article

  • How to do custom sorting using unix sort?

    - by jewelia
    I'm using unix sort to sort a comma delimited file with multiple columns. Thus far, this has worked perfectly for sorting the data either numerically or in alphabetical order: Example file before any sorting: C,United States,WA,Tacoma,f,1 A,United States,MA,Boston,f,0 B,United States,NY,New York,f,5 A,Canada,QC,Montreal,f,2 A,Bahamas,Bahamas,Nassau,f,2 A,United States,NY,New York,f,1 Sort the file: $ sort -t ',' -k 2,2 -k 3,3 -k 4,4 -k 5,5r -k 6,6nr tmp.csv Sorted result: A,Bahamas,Bahamas,Nassau,f,2 A,Canada,QC,Montreal,f,2 A,United States,MA,Boston,f,0 B,United States,NY,New York,f,5 A,United States,NY,New York,f,1 C,United States,WA,Tacoma,f,1 Here is the issue: I want to sort column 2 based on a custom sort, meaning I want United States first, then Canada, then Bahamas: Desired sort: A,United States,MA,Boston,f,0 B,United States,NY,New York,f,5 A,United States,NY,New York,f,1 C,United States,WA,Tacoma,f,1 A,Canada,QC,Montreal,f,2 A,Bahamas,Bahamas,Nassau,f,2 Is there some way to pass unix sort a custom sort order that it can then apply? Something like: $ sort -t ',' -k 2,2:'United States, Canada, Bahamas' -k 3,3 -k 4,4 -k 5,5r -k 6,6nr tmp.csv Thanks!

    Read the article

  • Custom HTTP Status Codes (a la Twitter 420: Enhance Your Calm) [migrated]

    - by Max Bucknell
    I'm currently implementing an HTTP API, my first ever. I've been spending a lot of time looking at the Wikipedia page for HTTP status codes, because I'm determined to implement the right codes for the right situations. Listed on that page is a code with number 420, which is a custom code that Twitter used to use for rate limiting. There is already a code for rate limiting, though. It's 429. This led me to wonder why they would set a custom one, when there is already a use case. Is that just being cute? And if so, then which circumstances would make it acceptable to return a different status code, and what, if any problems may clients have with it? I read somewhere that Mozilla doesn't implement the joke 418: I’m a teapot response, which makes me think that clients choose which status codes they implement. If that's true, then I can imagine Twitter's funny little enhance your calm code being problematic. Unless I'm mistaken, and we can appropriate any code number to mean whatever we like, and that only convention dictates that 404 means not found, and 429 means take it easy.

    Read the article

  • nginx & php-fpm and custom header

    - by nixer
    I would like to pass some custom header (ACCESS_TOKEN) from client RESTful application (JS) to application server (php-fpm). I had read that nginx should pass all http headers to php, but somehow it does not come to my php :( I can see it in firebug http://o7.no/N6DM7q but can't see it in $_SERVER variable. it just does not exist in $_SERVER array. I'm thinking that i need to pass it manually. Now my config looks like that: location @php-fpm { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/tmp/php5-fpm.sock; fastcgi_param REQUEST_URI /index.php$request_uri; fastcgi_param SCRIPT_FILENAME /htdocs/index.php; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param DOCUMENT_ROOT /htdocs; } } and when I add new line in location definition: location @php-fpm { include /etc/nginx/fastcgi_params; ... fastcgi_param ACCESS_TOKEN $http_access_token; } } or even if i will add it into fastcgi_params file it does not help :( if I put into location part next line: fastcgi_param ACCESS_TOKEN $http_access_token; then in php it has empty value :( how I can pass custom header from client to backend (php) via nginx ?

    Read the article

  • Router that allows custom Dynamic DNS server [closed]

    - by Thuy
    I've made my own DDNS service and it works fine using an application running on clients to update the IP. But if for some reason I don't have the choice of using my software and instead I need to use a router to update the IP, it becomes troublesome. For example, I needed to setup IPsec from a customer to me and the customers router/firewall (netgear srx5308) has a dynamic IP which is given from the ISP which can't offer static IPs. So it needs to use dynamic dns for it to work. In this case there really isn't a client to run the software on since it's a router/firewall. Unfortunately it seems that most routers are rather unfriendly towards custom DDNS solutions and most offer only dyndns.com or similar templates. Which was the case with this router too. Leaving me with no way to use my own dynamic dns server IP. I have the option of switching out the customers router and I've been looking around for alternatives and other routers/solutions and I was wondering if anyone on this great site might have been in a similar situation or might just know about some router/firewall that is more friendly towards custom ddns solutions that I might be able to use. Thanks in advance for any help or guidance!

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >