Search Results

Search found 2399 results on 96 pages for 'alex gosselin'.

Page 65/96 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • Accessing inbound HTTP headers in meteor?

    - by Alex K
    I'm working on an application that relies on data that the browser sends within the HTTP headers (and there's no way around this). This also happens to be my first time working with something node.js based, so it's very likely I'm completely missing something simple! Basically what I want to be able to do is call a method on the server from the client, and in that method read the HTTP headers that the client sent.

    Read the article

  • No data when attempting to get JSONP data from cross domain PHP script

    - by Alex
    I am trying to pull latitude and longitude values from another server on a different domain using a singe id string. I am not very familiar with JQuery, but it seems to be the easiest way to go about getting around the same origin problem. I am unable to use iframes and I cannot install PHP on the server running this javascript, which is forcing my hand on this. My queries appear to be going through properly, but I am not getting any results back. I was hoping someone here might have an idea that could help, seeing as I probably wouldn't recognize most obvious errors here. My javascript function is: var surl = "http://...omitted.../pull.php"; var idnum = 5a; //in practice this is defined above alert("BEFORE"); $.ajax({ url: surl, data: {id: idnum}, dataType: "jsonp", jsonp : "callback", jsonp: "jsonpcallback", success: function (rdata) { alert(rdata.lat + ", " + rdata.lon); } }); alert("BETWEEN"); function jsonpcallback(rtndata) { alert("CALLED"); alert(rtndata.lat + ", " + rtndata.lon); } alert("AFTER"); When my javascript is run, the BEFORE, BETWEEN and AFTER alerts are displayed. The CALLED and other jsonpcallback alerts are not shown. Is there another way to tell if the jsoncallback function has been called? Below is the PHP code I have running on the second server. I added the count table to my database just so that I can tell when this script is run. Every time I call the javascript, count has had an extra item inserted and the id number is correct. <?php header("content-type: application/json"); if (isset($_GET['id']) || isset($_POST['id'])){ $db_handle = mysql_connect($server, $username, $password); if (!$db_handle) { die('Could not connect: ' . mysql_error()); } $db_found = mysql_select_db($database, $db_handle); if ($db_found) { if (isset($_POST['id'])){ $SQL = sprintf("SELECT * FROM %s WHERE loc_id='%s'", $loctable, mysql_real_escape_string($_POST['id'])); } if (isset($_GET['id'])){ $SQL = sprintf("SELECT * FROM %s WHERE loc_id='%s'", $loctable, mysql_real_escape_string($_GET['id'])); } $result = mysql_query($SQL, $db_handle); $db_field = mysql_fetch_assoc($result); $rtnjsonobj -> lat = $db_field["lat"]; $rtnjsonobj -> lon = $db_field["lon"]; if (isset($_POST['id'])){ echo $_POST['jsonpcallback']. '('. json_encode($rtnjsonobj) . ')'; } if (isset($_GET['id'])){ echo $_GET['jsonpcallback']. '('. json_encode($rtnjsonobj) . ')'; } $SQL = sprintf("INSERT INTO count (bullshit) VALUES ('%s')", $_GET['id']); $result = mysql_query($SQL, $db_handle); $db_field = mysql_fetch_assoc($result); } mysql_close($db_handle); } else { $rtnjsonobj -> lat = 404; $rtnjsonobj -> lon = 404; echo $_GET['jsonpcallback']. '('. json_encode($rtnjsonobj) . ')'; }?> I am not entirely sure if the jsonp returned by this PHP is correct. When I go directly to the PHP script without including any parameters, I do get the following. ({"lat":404,"lon":404}) The callback function is not included, but that much can be expected when it isn't included in the original call. Does anyone have any idea what might be going wrong here? Thanks in advance!

    Read the article

  • Is there a way to get a mobile Safari WebApp to "forget" its state?

    - by Alex Mcp
    I have a nascent bridge scoring app that is meant to be stored locally on an iPod touch/iPhone (iPad? Would probably be fugly...) So far so good, got a custom icon rolling and basic JS navigation laid out, but my problem is that it retains its state when I quit the app. Is there a simple magic Apple meta tag for this? Or is it achieved with javascript? Thanks for any insight.

    Read the article

  • Implement loops for python 3

    - by Alex
    Implement this loop: total up the product of the numbers from 1 to x. Implement this loop: total up the product of the numbers from a to b. Implement this loop: total up the sum of the numbers from a to b. Implement this loop: total up the sum of the numbers from 1 to x. Implement this loop: count the number of characters in a string s. i'm very lost on implementing loops these are just some examples that i am having trouble with-- if someone could help me understand how to do them that would be awesome

    Read the article

  • How can I transform a DataTable in a group-by date DataTable with LINQ?

    - by alex
    I have a untyped DataTable that looks like this (srcTbl): date col_1 col_2 ... col_n 1.3.2010 00:00 12.5 0 ... 100 1.3.2010 01:00 0 0 ... 100 1.3.2010 22:00 0 0 ... 100 1.3.2010 23:00 12.5 0 ... 100 ... 31.3.2010 00:00 2 0 ... 100 31.3.2010 01:00 2 0 ... 200 I need to sum up the rows grouped by dates to get a DataTable like that (dstTbl): date, col_1 col_2 ... col_n 1.3.2010 15 0 ... 400 ... 31.3.2010 4 0 ... 300 Is this possible by using LINQ and if then how?

    Read the article

  • RSA key length and export limitations

    - by Alex Stamper
    I know, there are a lot of limitations to the length of used key (import and export limitations for nearly each country). Usually, it varies from 64 to 256 bits. To use more bits, it is obligatory to ask permission from authorities. But it is recommended to use 1024 bits keys for RSA as minimum! Does it mean that I cannot just use RSA without any problems with law and so on?

    Read the article

  • Question about JSON?

    - by Alex
    Hi all, I have a fairly simple question: In Javascript how can I return the boolean (if its found in the JSON) rather than the actual value? Example: var myJSON = { "foo" : "bar", "bar" : "foo" }; var keyToLookFor = "foo"; var found = myJSON[keyToLookFor]; if (found) { // I know I can test if the string exists in the if } // but is there a way I could just return something like: return found; // instead of testing found in the if statement and then returning true?

    Read the article

  • Java convert JSONObject to URL parameter

    - by Alex Ivasyuv
    What is the elegant way to convert JSONObject to URL parameters. For example, JSONObject: {stat: {123456: {x: 1, y: 2}, 123457: {z: 5, y: 2}}}} this should be like: stat[123456][x]=1&stat[123456][y]=2&stat[123457][z]=5&stat[123457][y]=2 of course with escaped symbols, and of course JSON object could be more complicated.. Maybe there already exist some mechanisms for that? Thanks,

    Read the article

  • How to use the vtable to determine class type

    - by Alex Silverman
    I was recently on an interview for a position where C/C++ is the primary language and during one question I was told that it's possible to use the vtable to determine which class in a hierarchy a base pointer actually stores. So if, for example you have class A { public: A() {} virtual ~A() {} virtual void method1() {} }; class B : public A { public: B() {} virtual ~B() {} virtual void method1() {} }; and you instantiate A * pFoo = new B(), is it indeed possible to use the vtable to determine whether pFoo contains a pointer to an instance of A or B?

    Read the article

  • Distributing a function over a single dimension of an array in MATLAB?

    - by Alex Feinman
    I often find myself wanting to collapse an n-dimensional matrix across one dimension, and can't figure out if there is a concise incantation I can use to do this. For example, when parsing an image, I often want to do something like this. (Note! Illustrative example only. I know about rgb2gray for this specific case.) img = imread('whatever.jpg'); s = size(img); for i=1:s(1) for j=1:s(2) bw_img = mean(img(i,j,:)); end end I would love to express this as something like: bw = on(color, 3, @mean); or bw(:,:,1) = mean(color); Is there a short way to do this?

    Read the article

  • Linq ChangeConflictException occurs when submitting DataContext changes

    - by Alex
    System.Data.Linq.ChangeConflictException: 2 of X updates failed. at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) at PROJECT.Controllers.HomeController.ClickProc(Int32 id, String code, String n) This is what I get very often. This action is done thousands of times a day, and I get this exception about once every 5 seconds. From what I understand it happens when something changes in the database in the period between creating DataContext and updating it. Am I right? How can I fix it? Update I just debugged the error and found the following: Table name: dbo.Stats current value: 9852039 original value: 9852038 database value: 9852039 The Stats table is updated constantly. So how can I still make LINQ save the changes. With "classical" SQL Server access through SqlDataCommand I never had problems like that.

    Read the article

  • The question about the basics of LINQ to SQL working

    - by Alex
    I just started learning LINQ to SQL, and so far I'm impressed with the easy of use and good performance. I used to think that when doing LINQ queries like from Customer in DB.Customers where Customer.Age > 30 select Customer Get all customers from the database ("SELECT * FROM Customers"), move them to the Customers array and then make a search in that Array using .NET methods. This is very inefficient, what if there are hundreds of thousands of customers in the database? Making such big SELECT queries would kill the web application. Now after experiencing how actually fast LINQ to SQL is, I start to suspect that when doing that query I just wrote, LINQ somehow converts it to a SQL Query string SELECT * FROM Customers WHERE Age > 30 And only when necessary it will run the query. So my question is: am I right? And when is the query actually run? The reason why I'm asking is not only because I want to understand how it works in order to build good optimized applications, but because I came across the following problem. I have 2 tables, one of them is Books, the other has information on how many books were sold on certain days. My goal is to select books that had at least 50 sales/day in past 10 days. It's done with this simple query: from Book in DB.Books where (from Sale in DB.Sales where Sale.SalesAmount >= 50 and Sale.DateOfSale >= DateTime.Now.AddDays(-10) select Sale.BookID).Contains(Book.ID) select Book The point is, I have to use the checking part in several queries and I decided to create an array with IDs of all popular books: var popularBooksIDs = from Sale in DB.Sales where Sale.SalesAmount >= 50 and Sale.DateOfSale >= DateTime.Now.AddDays(-10) select Sale.BookID; BUT when I try to do the query now: from Book in DB.Books where popularBooksIDs.Contains(Book.ID) select Book It doesn't work! That's why I think that we can't use thins kinds of shortcuts in LINQ to SQL queries, like we can't use them in real SQL. We have to create straightforward queries, am I right?

    Read the article

  • In MS Access is there a way to allow forms to update while maintaning Read Only

    - by Alex
    I have several forms linked tables via queries. The form pull data such as sales and ratios by selecting a product from the main's form's combo box. I am however having to issues: 1- I would ultimately prefer the combo box to be a free entry; however by just entering in the box and hitting enter (not a button called “enter on a screen” which would initiate recalcs, just normal enter), while it does bring the new information in sub-forms it also changes the information in the original table. If I make the table read only that it just doesn't allow the form to work by saying that the table is read only. 2- The same Read only issue occurs when another user with read only rights tries to use the database. I understand that ready only is functioning as intended, however I am wondering if there is way to make some functions work while disallowing the updating. I am unfortunately learning on the go, so go easy plz. Thank you

    Read the article

  • Simple Scala syntax - trying to define "==" operator - what am I missing?

    - by Alex R
    While experimenting with some stuff on the REPL, I got to a point where I needed something like this: scala class A(x:Int) { println(x); def ==(a:A) : Boolean = { this.x == a.x; } } Just a simple class with an "==" operator. Why doesn't it work??? Here's the result: :10: error: type mismatch; found : A required: ?{val x: ?} Note that implicit conversions are not applicable because they are ambiguous: both method any2ArrowAssoc in object Predef of type [A](x: A)ArrowAssoc[A] and method any2Ensuring in object Predef of type [A](x: A)Ensuring[A] are possible conversion functions from A to ?{val x: ?} class A(x:Int) { println(x); def ==(a:A) : Boolean = { this.x == a.x; } } ^ This is scala 2.8 RC1. Thanks

    Read the article

  • Can't install a ruby gem because of an error?

    - by Alex
    Hey there, trying to install a ruby gem but I keep getting the following error: ERROR:failed to build gem native extension /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at/System/ Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h I'm not exactly sure what is happening here. Is there anyone that knows what is going on and how to fix it? Thanks!

    Read the article

  • Reinstantiating a GUI (JFrame) object

    - by Alex
    Hi guys, basically I want my JFrame to become a completely new JFrame object when an event is triggered. I have some code that basically calls [CODE]GUI gui = new GUI(x, y)[/CODE] the only problem I'm having is that as well as creating the new GUI object, it is not deleting the old window. Can anyone tell me how to get rid of the old window. Thanks.

    Read the article

  • Trying to start a service on boot on Android

    - by Alex
    I've been trying to start a service when a device boots up on android, but I cannot get it to work. I've looked a number of links online but none of the code is working. Am I forgetting something? This is my code. Manifest <receiver android:name=".StartServiceAtBootReceiver" android:enabled="true" android:exported="false" android:label="StartServiceAtBootReceiver"> <intent-filter> <action android:name="android.intent.action._BOOT_COMPLETED"/> </intent-filter> </receiver> <service android:enabled="true" android:name="com.test.RunService"/> Receiver OnReceive public void onReceive(Context context, Intent intent) { if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) { Intent serviceLauncher = new Intent(context, RunService.class); context.startService(serviceLauncher); Log.v("TEST", "Service loaded at start"); } } Thanks,

    Read the article

  • Errors/Warnings/Debug Info no longer appears in Debug Console

    - by Alex L
    Hi Guys: This one is driving me crazy. When I run my App and open the Debug Console there is nothing there! Nope, not even the output from my NSLog statements. Before I would see a bunch of debug information starting with [Session Started ...] and ending with 'Terminating in response to SpringBoard's termination'. The Status Bar at the bottom of the Console says my App was successfully launched. Even Errors and Warnings from my code no longer appear. How do I get this to show up again? Any help would be greatly appreciated.

    Read the article

  • Multiple Input From Keyboard C# WPF

    - by Alex
    I am writing a Tetris clone in WPF. If I hold down the right arrow key, the current piece shifts right. For playability, I want to allow the user to press another key (i.e. F-key) and rotate the moving piece without having to let go of the right arrow key first. Currently when I do this, the piece stops shifting. My first basic attempt at this was hooking into Window_PreviewKeyDown(object sender, KeyEventArgs e) and then sending a message to the controller layer. How do I structure my input-listening code to allow this? My current code Here

    Read the article

  • Log information inside a JUnit Suite

    - by Alex Marinescu
    I'm currently trying to write inside a log file the total number of failed tests from a JUnite Suite. My testsuite is defined as follows: @RunWith(Suite.class) @SuiteClasses({Class1.class, Class2.class etc.}) public class SimpleTestSuite {} I tried to define a rule which would increase the total number of errors when a test fails, but apparently my rule is never called. @Rule public MethodRule logWatchRule = new TestWatchman() { public void failed(Throwable e, FrameworkMethod method) { errors += 1; } public void succeeded(FrameworkMethod method) { } }; Any ideas on what I should to do to achieve this behaviour?

    Read the article

  • Using Time datatype in MySQL without seconds

    - by Alex
    I'm trying to store a 12/24hr (ie; 00:00) clock time in a MySQL database. At the moment I am using the time datatype. This works ok but it insists on adding the seconds to the column. So you enter 09:20 and it is stored as 09:20:00. Is there any way I can limit it in MySQL to just 00:00?

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >