Search Results

Search found 5798 results on 232 pages for 'umbraco extension'.

Page 11/232 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • A simple Python extension in C

    - by celil
    I am trying to create a simple python extension module. I compiled the following code into a transit.so dynamic module #include <python2.6/Python.h> static PyObject* _print(PyObject* self, PyObject* args) { return Py_BuildValue("i", 10); } static PyMethodDef TransitMethods[] = { {"print", _print, METH_VARARGS, ""}, {NULL, NULL, 0, NULL} }; PyMODINIT_FUNC inittransit(void) { Py_InitModule("transit", TransitMethods); } However, trying to call this from python import transit transit.print() I obtain an error message File "test.py", line 2 transit.print() ^ SyntaxError: invalid syntax What's wrong with my code?

    Read the article

  • ff extension: how to read a cookie name and value on the current page

    - by encryptor
    My extension works on a application, which requires user login. Once the user has logged in, I need to read the cookies and use them in my xmlhttprequests. So initially i need to check if the cookie is set, if not, I direct the user to the login page. Once logged in, I need to read the cookies and send it as part of mt further requests. Can someone plese help me on how to read cookies from a xmlhttprequest or otherwise (if we dont even know the name of the cookie) there is to function as getRequestHeader.. but what i need is something like that

    Read the article

  • Extension method return using generics

    - by Steven de Salas
    Is it possible to return a generic type using extension methods? For example, I have the following method: // Convenience method to obtain a field within a row (as a double type) public static double GetDouble(this DataRow row, string field) { if (row != null && row.Table.Columns.Contains(field)) { object value = row[field]; if (value != null && value != DBNull.Value) return Convert.ToDouble(value); } return 0; } This is currently used as follows: double value = row.GetDouble("tangible-equity"); but I would like to use the following code: double value = row.Get<double>("tangible-equity"); Is this possible and if so, what would the method look like?

    Read the article

  • stumped on jquery call inside chrome extension

    - by phil swenson
    In my chrome extension I call this: jsonPost = { email:"[email protected]", password:"demo", content: $('#selected_text').val(), notification_type: $('#notification_type').val(), name:$('#notification_name').val() } $.post('http://localhost:3000/api/create.json', jsonPost, function (data) { console.log("type of data = " + typeof(data)); console.log("data in function = " + data); } The data makes it to the server. But the response is lost, in the console ---type of data = String ---data in function = So for some reason I am not getting the response back. Works from the browser. I even tried doing a get against cnn.com and got no response. any ideas? thanks

    Read the article

  • Getting current window on a popup (google chrome extension)

    - by Steinn
    Hi, i'm building a google chrome extension, and i'm trying to get the selected window in a popup. (i'm talking about the popup that shows when you click in the extesion icon). I try to use the documentation, but i didn't get it well. I tryied to use: chrome.windows.getCurrent(function(w) { chrome.windows.get(w.id, function (response){ alert(response.location.href); }); }); But didn't work. Any ideas? Thanks (sorry if the english is bad).

    Read the article

  • Firefox extension dev: observing preferencies, avoid multiple notifications

    - by Michael
    Let's say my Firefox extension has multiple preferences, but some of them are grouped, like check interval, fail retry interval, destination url. Those are used in just single function. When I subscribe to preference service and add observer, the observe callback will be called for each changed preference, so if by chance user changed all of the settings in group, then I will have to do the same routine for the same subsystem as many times as I have items in that preferences group. What I want is observe to be called just once for group of preferences. Say extensions.myextension.interval1 extensions.myextension.site extensions.myextension.retry so if one or all of those preferences are changed, I receive only 1 notification about it.

    Read the article

  • Using Components.utils.import in a firefox extension

    - by jamesatha
    I am trying to create some global variables in a firefox extension. In my content folder, I have two javascript files: 1) Main JS file that holds the functions for the different events, etc 2) A file that stores only an object with the pieces of state I want to maintain. Also, I set the array EXPORTED_SYMBOLS. I am having issues with the following line found in my main JS file: Components.utils.import("resource:///globalVariables.js"); When it is at the top of the file, nothing seems to work. If I move it into the function where I need the variable, the rest of my code works, but the function with this line does nothing. Any advice that would help me with this problem would be great. Thanks

    Read the article

  • Differences between extension methods in C#3 & 4

    - by Buh Buh
    I think I remember reading a long time ago that in C#3 extension methods could only be applied to primitive types and interfaces; and that in C#4 they could be used to extend any type. This doesn't seam to match up with what I am seeing now and I am finding it difficult to find this documented. Is there any truth to this or did my memory make it all up? What are the rules relating to which types can be extended? Are there any differences between C# 3 and 4?

    Read the article

  • can not find out if the div element is already set in body in chrome extension

    - by alpham8
    in my chrome extension I got an div, which I will add to the body of the current tab. I am listening to chrome.tabs.onUpdated. If this event is called, I execute a script inside content_scripts. In this function there I´ll wait till the document is ready with jQuery $(document).ready(...). I try to access $("#div").length and sometimes it returns 1 and sometimes 0. It should added to the body, if it´s not already there. For some strange reasons, the onUpdated event is called twice on each page reload. Actually I found no way to check safely if the div was already added.

    Read the article

  • Showing a loading page in a google chrome extension

    - by user1092042
    I have searched high and low for this but whatever i do this simply does not seem to work. I have a google chrome extension which send an XHR request using a background.js file. Now my requirement is that i need to show a small loading icon while the xhr request is proceeding. Are there any tutorials out there which explains how to do this. I have tried an iframe but it looks ugly when it expands as the entire popup.html expands. Is jquery my only option here because that would mean adding a lot of size to my current project just for a simple animation.

    Read the article

  • How to link a SQlite Extension Source File into Xcode for iPhone?

    - by crunchyt
    I use a statically linked library for Sqlite in an iPhone Xcode project. I am now trying to include a .C extension to Sqlite in this project. However, I am having trouble making the Sqlite in the build SEE the extension. The statically linked Sqlite library works fine. Also the .C extension works on my desktop, and builds fine as a statically linked library in Xcode. However, the custom functions it defines are missing when called. For example, I load the extension as so with no errors. SELECT load_extension('extension_name.so'); But when I try to call a function defined in the extension, I get this message DB Error: 1 "no such function: custom_function" Does anyone know much about linking a Sqlite extension into an Xcode project?

    Read the article

  • Umbraco on Windows 7 64-bit

    - by HeavyWave
    I'm trying to install Umbraco CMS on Windows 7 64-bit and I get the following exception: [HttpException (0x80004005): Could not load file or assembly 'ImageManipulation, Version=1.0.2105.41209, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission required. The application pool's trust mode is set to 'Full', all the user permissions are just as on other sites hosted on the same machine. I went through all relevant topics on Umbraco's forum, but all advices are about the trust level. How do I fix this?

    Read the article

  • Umbraco on Windows 7 64-bit

    - by HeavyWave
    I'm trying to install Umbraco CMS on Windows 7 64-bit and I get the following exception: [HttpException (0x80004005): Could not load file or assembly 'ImageManipulation, Version=1.0.2105.41209, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission required. The application pool's trust mode is set to 'Full', all the user permissions are just as on other sites hosted on the same machine. I went through all relevant topics on Umbraco's forum, but all advices are about the trust level. How do I fix this?

    Read the article

  • Post build events using ROBOCOPY instead of XCOPY

    - by Vizioz Limited
    I don't know about you, but for a long time I have used XCOPY statements in my Visual Studio post build events to copy my Umbraco files from the project folders to the local version of the website associated with the project.For the last few months we have been building a website framework for a client, who has subsequently sold the site to 5 clients, each with a different skin and some variations in their functional requirements.So, we now have a single source solutions, that builds and copies the site files into 5 seperate local websites, which enables us to easily test them all, what we had found was that this process was starting to slow up our build process and was reaching 30-45 seconds on a high spec Quad core machine (and slower on others)Today I asked Colin to create seperate Solution Configurations within Visual Studio so that while we were developing we could target a single site, and when we wanted to test all sites, we could target "ALL" and the Post Build script would then copy the files to all sites.This worked well, and with a couple of other optimisations, our build was now taking about 10 seconds for a single site.Then Colin came across ROBOCOPY and suggested that maybe this would be a suitable alternative to XCOPY, well, I had not heard of it.. (shock horror some of you shout, some I am sure like me, are also wondering what it is!)ROBOCOPY is new in Windows Vista & Windows 7 (you can also download it for XP & Windows 2003) and it has a lot of additional features, the two that were most interesting to us were:/MIR = Mirror a folder tree/XD = Exclude Directories/NP = No Progress (i.e. it does not give you a chart of it's results, which just fills up your Output window!)So, we set about implementing ROBOCOPY, we decided to use the /MIR switch on all folders that we knew were always stored in our project folders:- images- css- masterpages- xsltAnd for other files we just used the straight robocopy functionality.We also decided to exclude all the .SVN directories using the /XD switch and finally we added the /NP switch as mentioned above.The beauty of all of this, is the /MIR functionality, as this means that only files that have changed will be copied across which greatly speeds up the process, especially on the images folders which previously copied across on every build, now, if we add a new image to the project it will be copied across automatically and then never again, unless we change it of course!The build time now for all sites is approximately 4 seconds and for a single site, 2 seconds, I would highly recommend the time to make the same optimisations to your build processes if you have not done so already.

    Read the article

  • Firefox Extension Socket Transport

    - by Nathan
    Hey, I'm making a firefox extension and I'm currently trying to get it to send XML data over a local socket to another application that's listening on that socket. Does anyone know what I'm doing wrong in this? Its probably something simple and I'm just having a monday. Thanks. socketConn: function() { var httpLoc = window.top.getBrowser(). selectedBrowser.contentWindow.location.href; var outputData = '<?xml version="1.0"?>' + '<site_data>' + '<session_id></session_id>' + 'site_url>' + httpLoc + '</site_url>' + '<mime_type></mime_type>' + '<data_file>' + filePath + '</data_file>' + '<capture_mode></capture_mode>' + '</site_data>\n'; var transportService = Cc["@mozilla.org/network/socket-transport-service;1"] .getService(Ci.nsISocketTransportService); var transport = transportService.createTransport(["starttls"], 1,"localhost",currentPort, null); var outstream = transport.openOutputStream(0, 0, 0); outstream.write(outputData, outputData.length); var stream = transport.openInputStream(0, 0, 0); var instream = Cc["@mozilla.org/scriptableinputstream;1"] .createInstance(Ci.nsIScriptableInputStream); instream.init(stream); var dataListener = { data : "", onStartRequest: function(request, context){}, onStopRequest: function(request, context, status){ instream.close(); outstream.close(); }, onDataAvailable: function(request, context, inputStream, offset, count){ this.data += instream.read(count); }, };//end dataListener var pump = Cc["@mozilla.org/network/input-stream-pump;1"] .createInstance(Ci.nsIInputStreamPump); pump.init(stream, -1, -1, 0, 0, false); pump.asyncRead(dataListener, null); }//end socketConn Please ask questions about this if you don't understand what I'm trying to do with this.

    Read the article

  • Is there an extension or a way to write an extension for firefox that allows a developer to refresh

    - by Kevin J
    I'm a developer, and I spend much of my day refreshing the webapps I work on. Occasionally, I'll encounter pages where POST data was submitted, and firefox will prompt me to Resend POST data or to Cancel. Now, I know that I can just redirect a page to itself to get rid of this warning, but I still want to keep this warning for our users; I just want to be able to skip it while developing. It's also not just on one page, but at many different points throughout the app, so it's not like I can just do if $debug==true then redirect or something like that. Basically just a minor convenience issue, but when I encounter the message 50-100 times a day, it can get aggravating. What I want to do is essentially have 3 options when refreshing: Resend POST data, cancel, or refresh without resending POST data The third option would be equivalent to clicking "enter" in the address bar (which is what I end up having to do). The problem with clicking enter is that I often have to "hard refresh" using ctrl+shift+r, but if I do this with POST data I have to click cancel, then click enter on the address bar, then do a hard refresh after that. I would instead like to press ctrl+shift+r, then continue hard refreshing the page without the POST data. Does anyone know how to do this? Through an extension or otherwise? It's totally a minor issue, but it's something that constantly bothers me and I actually think it would be quite a useful option. Thanks

    Read the article

  • how to: dynamically load google ajax api into chrome extension content script

    - by Hoff
    Hi there, I'm trying to make use of google's ajax apis in a chorme extension's "content script". On a regular html page, I would just do this: <script src="http://www.google.com/jsapi"></script> <script> google.load("language", "1"); </script> But since I'm trying to load the tranlation library dynamically from js code, I've tried: script = document.createElement("script"); script.src = "http://www.google.com/jsapi"; script.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(script); google.load('language','1') but the last line throws the following error: Uncaught TypeError: Object # has no method 'load' Funny enough, when i enter the same "google.load('language','1')" in chrome's js console, it works as intended... I've also tried with jquery's .getScript() but the same problem persists... Does anybody have any clue what might be the problem and how it could be solved? Many thanks in advance! Martin

    Read the article

  • Extension Method for copying properties form object to another, with first attempt

    - by James
    Hi All, Im trying to write an extension method that I can use to copy values from one object property to another object of a different type, as long as the property names and types match exactly. This is what I have: public static T CopyFrom<T>(this T toObject, object fromObject) { var fromObjectType = fromObject.GetType(); var fromProperties = fromObjectType.GetProperties(); foreach (PropertyInfo toProperty in toObject.GetType().GetProperties()) { PropertyInfo fromProperty = fromObjectType.GetProperty(toProperty.Name); if (fromProperty != null) // match found { // check types var fromType = fromProperty.PropertyType.UnderlyingSystemType; var toType = toProperty.PropertyType.UnderlyingSystemType; if (toType.IsAssignableFrom(fromType)) { toProperty.SetValue(toObject, fromProperty.GetValue(fromObject, null), null); } } } return toObject; } This is working great for non boxed types, but Nullable<T> returns false when I call toType.IsAssignableFrom(fromType) because its type is Nullable<T> and is not the underlying type T. I read here that GetType() should unbox the Nullable<T> so it returns T but if I call that on PropertyInfo.PropertyType I get ReflectedMemberInfo and not the type T im looking for. I think im missing something obvious here, so I thought I would throw it open to SO to get some advice. Anyone have any ideas? Thanks, Jamee

    Read the article

  • Existing LINQ extension method similar to Parallel.For?

    - by Joel Martinez
    The linq extension methods for ienumerable are very handy ... but not that useful if all you want to do is apply some computation to each item in the enumeration without returning anything. So I was wondering if perhaps I was just missing the right method, or if it truly doesn't exist as I'd rather use a built-in version if it's available ... but I haven't found one :-) I could have sworn there was a .ForEach method somewhere, but I have yet to find it. In the meantime, I did write my own version in case it's useful for anyone else: using System.Collections; using System.Collections.Generic; public delegate void Function<T>(T item); public delegate void Function(object item); public static class EnumerableExtensions { public static void For(this IEnumerable enumerable, Function func) { foreach (object item in enumerable) { func(item); } } public static void For<T>(this IEnumerable<T> enumerable, Function<T> func) { foreach (T item in enumerable) { func(item); } } } usage is: myEnumerable.For<MyClass>(delegate(MyClass item) { item.Count++; });

    Read the article

  • ControlCollection extension method optimazation

    - by Johan Leino
    Hi, got question regarding an extension method that I have written that looks like this: public static IEnumerable<T> FindControlsOfType<T>(this ControlCollection instance) where T : class { T control; foreach (Control ctrl in instance) { if ((control = ctrl as T) != null) { yield return control; } foreach (T child in FindControlsOfType<T>(ctrl.Controls)) { yield return child; } } } public static IEnumerable<T> FindControlsOfType<T>(this ControlCollection instance, Func<T, bool> match) where T : class { return FindControlsOfType<T>(instance).Where(match); } The idea here is to find all controls that match a specifc criteria (hence the Func<..) in the controls collection. My question is: Does the second method (that has the Func) first call the first method to find all the controls of type T and then performs the where condition or does the "runtime" optimize the call to perform the where condition on the "whole" enumeration (if you get what I mean). secondly, are there any other optimizations that I can do to the code to perform better. An example can look like this: var checkbox = this.Controls.FindControlsOfType<MyCustomCheckBox>( ctrl => ctrl.CustomProperty == "Test" ) .FirstOrDefault();

    Read the article

  • How to return array of C++ objects from a PHP extension

    - by John Factorial
    I need to have my PHP extension return an array of objects, but I can't seem to figure out how to do this. I have a Graph object written in C++. Graph.getNodes() returns a std::map<int, Node*>. Here's the code I have currently: struct node_object { zend_object std; Node *node; }; zend_class_entry *node_ce; then PHP_METHOD(Graph, getNodes) { Graph *graph; GET_GRAPH(graph, obj) // a macro I wrote to populate graph node_object* n; zval* node_zval; if (obj == NULL) { RETURN_NULL(); } if (object_init_ex(node_zval, node_ce) != SUCCESS) { RETURN_NULL(); } std::map nodes = graph-getNodes(); array_init(return_value); for (std::map::iterator i = nodes.begin(); i != nodes.end(); ++i) { php_printf("X"); n = (node_object*) zend_object_store_get_object(node_zval TSRMLS_CC); n-node = i-second; add_index_zval(return_value, i-first, node_zval); } php_printf("]"); } When i run php -r '$g = new Graph(); $g->getNodes();' I get the output XX]Segmentation fault meaning the getNodes() function loops successfully through my 2-node list, returns, then segfaults. What am I doing wrong?

    Read the article

  • Multiple generic parameters on a html helper extension method

    - by WestDiscGolf
    What I'm trying to do is create an extension method for the HtmlHelper to create a specific output and associated details like TextBoxFor<. What I want to do is specify the property from the model class as per TextBoxFor<, then an associated controller action and other parameters. So far the signature of the method looks like: public static MvcHtmlString Create<TModel, TProperty, TController>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, Expression<Action<TController>> action, object htmlAttributes) where TController : Controller where TModel : class The issue occurs when I go to call it. In my view if I call it as per the TextBoxFor without specifying the Model type I am able to specify the lambda expression to set the property which it's for, but when I go to specify the action I am unable to. However, when I specify the controller type Html.Create<HomeController>( ... ) I am unable to specify the model property that the control is to be created for. I want to be able to call it like <%= Html.Create(x => x.Title, controller => controller.action, null) %> I've been hitting my head for a few hours now on this issue over the past day, can anyone point me in the right direction?

    Read the article

  • ControlCollection extension method optimization

    - by Johan Leino
    Hi, got question regarding an extension method that I have written that looks like this: public static IEnumerable<T> FindControlsOfType<T>(this ControlCollection instance) where T : class { T control; foreach (Control ctrl in instance) { if ((control = ctrl as T) != null) { yield return control; } foreach (T child in FindControlsOfType<T>(ctrl.Controls)) { yield return child; } } } public static IEnumerable<T> FindControlsOfType<T>(this ControlCollection instance, Func<T, bool> match) where T : class { return FindControlsOfType<T>(instance).Where(match); } The idea here is to find all controls that match a specifc criteria (hence the Func<..) in the controls collection. My question is: Does the second method (that has the Func) first call the first method to find all the controls of type T and then performs the where condition or does the "runtime" optimize the call to perform the where condition on the "whole" enumeration (if you get what I mean). secondly, are there any other optimizations that I can do to the code to perform better. An example can look like this: var checkbox = this.Controls.FindControlsOfType<MyCustomCheckBox>( ctrl => ctrl.CustomProperty == "Test" ) .FirstOrDefault();

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >