Search Results

Search found 10841 results on 434 pages for 'air native extension'.

Page 18/434 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • 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

  • Make a compiled binary run at native speed flawlessly without recompiling from source on a another system?

    - by unknownthreat
    I know that many people, at a first glance of the question, may immediately yell out "Java", but no, I know Java's qualities. Allow me to elaborate my question first. Normally, when we want our program to run at a native speed on a system, whether it be Windows, Mac OS X, or Linux, we need to compile from source codes. If you want to run a program of another system in your system, you need to use a virtual machine or an emulator. While these tools allow you to use the program you need on the non-native OS, they sometimes have problems of performance and glitches. We also have a newer compiler called "JIT Compiler", where the compiler will parse the bytecode program to native machine language before execution. The performance may increase to a very good extent with JIT Compiler, but the performance is still not the same as running it on a native system. Another program on Linux, WINE, is also a good tool for running Windows program on Linux system. I have tried running Team Fortress 2 on it, and tried experiment with some settings. I got ~40 fps on Windows at its mid-high setting on 1280 x 1024. On Linux, I need to turn everything low at 1280 x 1024 to get ~40 fps. There are 2 notable things though: Polygon model settings do not seem to affect framerate whether I set it low or high. When there are post-processing effects or some special effects that require manipulation of drawn pixels of the current frame, the framerate will drop to 10-20 fps. From this point, I can see that normal polygon rendering is just fine, but when it comes to newer rendering methods that requires graphic card to the job, it slows down to a crawl. Anyway, this question is rather theoretical. Is there anything we can do at all? I see that WINE can run STEAM and Team Fortress 2. Although there are flaws, they can run at lower setting. Or perhaps, I should also ask, "is it possible to translate one whole program on a system to another system without recompiling from source and get native speed?" I see that we also have AOT Compiler, is it possible to use it for something like this? Or there are so many constraints (such as DirectX call or differences in software architecture) that make it impossible to have a flawless and not native to the system program that runs at native speed?

    Read the article

  • Chrome Apps + Native Client

    Chrome Apps + Native Client Did you know that you can use Native Client inside a Chrome App? Join +John Mccutchan and +Pete LePage as they introduce Native Client Acceleration Modules (NaCl AM) which expose C++ libraries to JavaScript programs. NaCl AMs can, be used for bulk data processing (compression, encryption) but they also work well in interactive applications that require low latency. We'll explain how to build a NaCl Acceleration Module and demo a Bullet Physics engine running inside a Chrome App with a NaCl AM interacting with an HTML and JavaScript UI using three.js. We'll be live on Tuesday December 11th at at 9am PT, showing you code, samples and answering your questions. From: GoogleDevelopers Views: 0 0 ratings Time: 45:00 More in Science & Technology

    Read the article

  • HTML5 mobile game development vs. native game apps

    - by Vic Szpilman
    What is the current state of game engines, frameworks, libraries and conversions related to the HTML5 set of technologies (including CSS3 and JavaScript libraries such as RaphaelJS, Impact, gameQuery); and how does the best of that compare with developing a native app (especially for iOS and Android)? Especially in terms of performance, visuals and getting that "native feel". Thoughts on solutions such as Appcelerator and Corona SDK are also appreciated. In regards to Unity3D, is it possible to develop in it and still have the game be playable on a browser (such as current releases of Chrome or Firefox, at least) without any dependencies or having the user install anything (no unity web player). What I'm looking for is how to develop in web standards as to reach the maximum number of platforms (including outside mobile) while still retaining a native experience for mobile without having to implement the game anew for iOS and Android.

    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

  • 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

  • DBD::CSV: Append-extension-question

    - by sid_com
    Why does only the second example append the extension to the filename and what is the "/r" in ".csv/r" for. #!/usr/bin/env perl use warnings; use strict; use 5.012; use DBI; my $dbh = DBI->connect( "DBI:CSV:f_dir=/home/mm", { RaiseError => 1, f_ext => ".csv/r"} ); my $table = 'new_1'; $dbh->do( "DROP TABLE IF EXISTS $table" ); $dbh->do( "CREATE TABLE $table ( id INT, name CHAR, city CHAR )" ); my $sth_new = $dbh->prepare( "INSERT INTO $table( id, name, city ) VALUES ( ?, ?, ?, )" ); $sth_new->execute( 1, 'Smith', 'Greenville' ); $dbh->disconnect(); # -------------------------------------------------------- $dbh = DBI->connect( "DBI:CSV:f_dir=/home/mm", { RaiseError => 1 } ); $dbh->{f_ext} = ".csv/r"; $table = 'new_2'; $dbh->do( "DROP TABLE IF EXISTS $table" ); $dbh->do( "CREATE TABLE $table ( id INT, name CHAR, city CHAR )" ); $sth_new = $dbh->prepare( "INSERT INTO $table( id, name, city ) VALUES ( ?, ?, ?, )" ); $sth_new->execute( 1, 'Smith', 'Greenville' ); $dbh->disconnect();

    Read the article

  • Chrome extension javascript array bug?

    - by Wayne Werner
    Hi, I'm working on a Google Chrome extension. In the popup I have the following code: var bookmarks = []; function appendBMTnode(node){ bookmarks.push([node[0].title, node[0].id]); } function addchildren(results){ for(x = 0; x < results.length; x++){ bookmarks.push([results[x].title, results[x].id]); chrome.bookmarks.getChildren(results[x].id, addchildren); } } function getallbookmarks(){ chrome.bookmarks.get('0', appendBMTnode); chrome.bookmarks.getChildren('0', addchildren); } console.debug(bookmarks.length); console.debug(bookmarks); Now, I would assume that the first command would issue the # of bookmarks I have. Indeed, when I use Chrome's debugger and add bookmarks.length to the watch list, 418 is the value. In the console of the debugger I can write bookmarks.length and it will give me the correct length. I can type for(x = 0; x < bookmarks.length; x++){ console.debug(bookmarks[x]); } and I get string representations of each inner array. However, that original console.debug(bookmarks.length) gives an output of zero. And if I add console.debug(bookmarks[0]); to the popup.html it tells me that the value is undefined. This seems like a bug to me, but my real question is how can I iterate over this list? Thanks

    Read the article

  • Create Extension Method to Produce Open & Closing Tags like Html.BeginForm()

    - by DaveDev
    Hi Guys I wonder if it's possible to create an extension method which has functionality & behaviour similar to Html.BeginForm(), in that it would generate a complete Html tag, and I could specificy its contents inside <% { & } %> tags. For example, I could have a view like: <% using(Html.BeginDiv("divId")) %> <% { %> <!-- Form content goes here --> <% } %> This capability would be very useful in the context of the functionality I'm trying to produce with the example in this question This would give me the ability to create containers for the types that I'll be <% var myType = new MyType(123, 234); %> <% var tag = new TagBuilder("div"); %> <% using(Html.BeginDiv<MyType>(myType, tag) %> <% { %> <!-- controls used for the configuration of MyType --> <!-- represented in the context of a HTML element, e.g.: --> <div class="MyType" prop1="123" prop2="234"> <!-- add a select here --> <!-- add a radio control here --> <!-- whatever, it represents elements in the context of their type --> </div> <% } %> I realise this will produce invalid XHTML, but I think there could be other benefits that outweigh this, especially since this project doesn't require that the XHTML validate to the W3C standards. Thanks Dave

    Read the article

  • Remove php extension from URL on Windows hosting account using web.config

    - by asprin
    I've searched before asking this question. The answered ones were related to Linux hosting account and the ones with Windows hosting account didn't match what I was looking for. As you might have guessed, I've a Windows shared hosting account with godaddy. My aim was to remove the '.php' extension from the url. After researching I found that .htaccess would do exactly what I want. But I also found that .htaccess doesn't work in Windows environment and that I'll need a web.config file to do the same task. Now I know there are modules through which the code can be generated, but the problem is I don't know how to get them installed on my hosting account. I don't want to go through the process of contacting the people over at godaddy and hence I'm looking to solve this on my own. What I'm looking for is a web.config equivalent of .htaccess This is what I'm trying to achieve: Current URL : www.abcdef.com/contact.php Desired URL : www.abcdef.com/contact Any help would be greatly appreciated. Thanks, Nisar.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >