Daily Archives

Articles indexed Monday November 28 2011

Page 8/14 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • how to track Google Analytics of Adobe Air app?

    - by dreagan
    I have written an Adobe Air desktop application that tracks a bunch of websites and displays images from the websites in the app. And instead of keeping my mouth shut about it and making it look like an attack on the website, I'd like to make it so that the webmasters can see that these pageviews are made by my application. Is there any way the webmaster could distinguish adobe air access of the website from normal visitor browsing? Perhaps by adding something to the URLrequests I make in the application..?

    Read the article

  • How to insert in a blog sharing links to visitors Tweet, Facebook and so on social networks?

    - by Andry
    I am developing a web blog using ASP.NET, but I guess that the tech details like this, here, is not important. My aim is to insert in every post I create those nice buttons to the social networks account of my visitors so that they can quote or post the link to the blog entry in their space. How can I do this? I guess it also de3pend on the social network I want to use. Lets say, now, that I want to have links to Facebook, Tweet and Google circle accounts. Thankyou.

    Read the article

  • UDP Code client server architecture

    - by GameBuilder
    Hi I have developed a game on android.Now I want to play it on wifi or 3G. I have game packets which i want to send it form client(mobile) to server then to another client2(mobile). I don't know how to write code in Java to send the playPackets continuously to server and receive the playPacket continuously from the server to the clients. I guess i have to use two thread one for sending and one for receiving. Can someone help me with the code, or the procedure to write code for it. Thanks in advance.

    Read the article

  • How can I resize pixel art in Pyglet without making it blurry?

    - by Renold
    I have a tileset of 8x8 pixel images, and I want to resize them in my game so they'd be double that (16x16 pixels, e.g. turning each pixel into a 2x2 block.) What I'm trying to achieve is a Minecraft-like effect, where you have small pixel images scale to larger blockier pixels. In Pyglet, the sprite's scale property blurs the pixels. Is there some other way? Update: So I changed my code, but I'm still having the same issue (nothing changed.) Of course, the GL commands are kind of mysterious to me: gl.glEnable(gl.GL_TEXTURE_2D) image = resource.image('tileset.png') texture = image.get_texture() gl.glBindTexture(gl.GL_TEXTURE_2D, texture.id) gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_NEAREST) texture.width = 16 # resize from 8x8 to 16x16 texture.height = 16 image.blit(100, 30) # draw Is there something else I should try?

    Read the article

  • Could I be going crazy with Event Handlers? Am I going the "wrong way" with my design?

    - by sensae
    I guess I've decided that I really like event handlers. I may be suffering a bit from analysis paralysis, but I'm concerned about making my design unwieldy or running into some other unforeseen consequence to my design decisions. My game engine currently does basic sprite-based rendering with a panning overhead camera. My design looks a bit like this: SceneHandler Contains a list of classes that implement the SceneListener interface (currently only Sprites). Calls render() once per tick, and sends onCameraUpdate(); messages to SceneListeners. InputHandler Polls the input once per tick, and sends a simple "onKeyPressed" message to InputListeners. I have a Camera InputListener which holds a SceneHandler instance and triggers updateCamera(); events based on what the input is. AgentHandler Calls default actions on any Agents (AI) once per tick, and will check a stack for any new events that are registered, dispatching them to specific Agents as needed. So I have basic sprite objects that can move around a scene and use rudimentary steering behaviors to travel. I've gotten onto collision detection, and this is where I'm not sure the direction my design is going is good. Is it a good practice to have many, small event handlers? I imagine going the way I am that I'd have to implement some kind of CollisionHandler. Would I be better off with a more consolidated EntityHandler which handles AI, collision updates, and other entity interactions in one class? Or will I be fine just implementing many different event handling subsystems which pass messages to each other based on what kind of event it is? Should I write an EntityHandler which is simply responsible for coordinating all these sub event handlers? I realize in some cases, such as my InputHandler and SceneHandler, those are very specific types of events. A large portion of my game code won't care about input, and a large portion won't care about updates that happen purely in the rendering of the scene. Thus I feel my isolation of those systems is justified. However, I'm asking this question specifically approaching game logic type events.

    Read the article

  • 3D models overlapping each other

    - by Auren
    I have a problem at the moment when I draw some models to teach me more about 3D game programming. The models at the moment overlaps each other from some angles witch makes sense since the game at the moment draws from left to right, line after line. However my question is: Is there any easy escape from this issue or is there any way that you could draw the in-game world from the players position? I would really appreciate if someone could give me some answers on this.

    Read the article

  • LINQ to SQL Converter

    - by user609511
    How can I convert My LINQ to SQL ? i have this LINQ statement: int LimCol = Convert.ToInt32(LimitColis); result = oListTUP .GroupBy(x => new { x.Item1, x.Item2, x.Item3, x.Item4, x.Item5 }) .Select(g => new { Key = g.Key, Sum = g.Sum(x => x.Item6), Poids = g.Sum(x => x.Item7), }) .Select(p => new { Key = p.Key, Items = Enumerable.Repeat(LimCol, p.Sum / LimCol).Concat(Enumerable.Repeat(p.Sum % LimCol, p.Sum % LimCol > 0 ? 1 : 0)), CalculPoids = p.Poids / Enumerable.Repeat(LimCol, p.Sum / LimCol).Concat(Enumerable.Repeat(p.Sum % LimCol, p.Sum % LimCol > 0 ? 1 : 0)).Count() }) .SelectMany(p => p.Items.Select(i => Tuple.Create(p.Key.Item1, p.Key.Item2, p.Key.Item3, p.Key.Item4, p.Key.Item5, i, p.CalculPoids))) .ToList(); } It works well, but somehow want to push it and it become too complicated, so I want to convert it into Pure SQL. I have tried SQL Profiler and LinqPad, but neither shows me the SQL. How can I see the SQL code from My LINQ ? Thank you in advance.

    Read the article

  • Boost Python - Limits to the number of arguments when wrapping a function

    - by Derek
    I'm using Boost Python to wrap some C++ functions that I've created. One of my C++ functions contains 22 arguments. Boost complains when I try to compile my solution with this function, and I'm trying to figure out if it is just because this function has too many arguments. Does anyone know if such a limit exists? I've copied the error I'm getting below, not the code because I figure someone either knows the answer to this or not - and if there is no limit then I'll just try to figure it out myself. Thanks very much in advance! Here is a copy of the beginning of the error message I receive... 1>main.cpp 1>c:\cpp_ext\boost\boost_1_47\boost\python\make_function.hpp(76): error C2780: 'boost::mpl::vector17<RT,most_derived<Target,ClassT>::type&,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> boost::python::detail::get_signature(RT (__thiscall ClassT::* )(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) volatile const,Target *)' : expects 2 arguments - 1 provided 1>c:\cpp_ext\boost\boost_1_47\boost\python\signature.hpp(236) : see declaration of 'boost::python::detail::get_signature' And eventually I get about a hundred copies of error messages very much resembling this one: 1>c:\cpp_ext\boost\boost_1_47\boost\python\make_function.hpp(76): error C2784: 'boost::mpl::vector17<RT,ClassT&,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> boost::python::detail::get_signature(RT (__thiscall ClassT::* )(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) volatile const)' : could not deduce template argument for 'RT (__thiscall ClassT::* )(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) volatile const' from 'std::string (__cdecl *)(const std::string &,jal::date::JULIAN_DATE,const std::string &,const std::string &,int,const std::string &,const std::string &,const std::string &,const std::string &,const std::string &,const std::string &,int,const std::string &,const std::string &,int,const std::string &,const std::string &,const std::string &,const std::string &,const std::string &,int,const std::string &)' 1> c:\cpp_ext\boost\boost_1_47\boost\python\signature.hpp(218) : see declaration of 'boost::python::detail::get_signature' 1>c:\cpp_ext\boost\boost_1_47\boost\python\make_function.hpp(76): error C2780: 'boost::mpl::vector17<RT,most_derived<Target,ClassT>::type&,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14> boost::python::detail::get_signature(RT (__thiscall ClassT::* )(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14) volatile,Target *)' : expects 2 arguments - 1 provided 1> c:\cpp_ext\boost\boost_1_47\boost\python\signature.hpp(236) : see declaration of 'boost::python::detail::get_signature'

    Read the article

  • calling a function from another function in python

    - by user1040503
    I have written this function that takes to strings in order to see if they are anagrams: def anagram_check(str_x, str_y): x = string1.replace(" ","") y = string2.replace(" ","") lower1 = x.lower() lower2 = y.lower() sorted1 = sorted(lower1) sorted2 = sorted(lower2) if sorted1 == sorted2: return True else: return False this function works fine, the problem is that now I need to use this function in another function in order to find anagrams in a text file. I want to print a list of tuples with all the anagrams in it. this is what i have done so far def anagrams_finder(words_num): anagrams = [] f = open("words.txt") a = list(f) list1 = ([s.replace('\n', '') for s in a]) list2 = ([i.lower() for i in list1]) list3 = list2[0:words_num] #number of words from text that need to be checked. for i in list3: .... I tried using for loops, while loops, appand.... but nothing seems to work. how can I use the first function in order to help me with the second? Please help...

    Read the article

  • Change HTML DropDown Default Value with a MySQL value

    - by fzr11017
    I'm working on a profile page, where a registered user can update their information. Because the user has already submitted their information, I would like their information from the database to populate my HTML form. Within PHP, I'm creating the HTML form with the values filled in. However, I've tried creating an IF statement to determine whether an option is selected as the default value. Right now, my website is giving me a default value of the last option, Undeclared. Therefore, I'm not sure if all IF statements are evaluation as true, or if it is simply skipping to selected=selected. Here is my HTML, which is currently embedded with PHP(): <select name="Major"> <option if($row[Major] == Accounting){ selected="selected"}>Accounting</option> <option if($row[Major] == Business Honors Program){ selected="selected"}>Business Honors Program</option> <option if($row[Major] == Engineering Route to Business){ selected="selected"}>Engineering Route to Business</option> <option if($row[Major] == Finance){ selected="selected"}>Finance</option> <option if($row[Major] == International Business){ selected="selected"}>International Business</option> <option if($row[Major] == Management){ selected="selected"}>Management</option> <option if($row[Major] == Management Information Systems){ selected="selected"}>Management Information Systems</option> <option if($row[Major] == Marketing){ selected="selected"}>Marketing</option> <option if($row[Major] == MPA){ selected="selected"}>MPA</option> <option if($row[Major] == Supply Chain Management){ selected="selected"}>Supply Chain Management</option> <option if($row[Major] == Undeclared){ selected="selected"}>Undeclared</option> </select>

    Read the article

  • VS 2010 Profiling Problem with Signed Assemblies

    - by Binder
    I have a website that uses AjaxControlToolkit.dll and Log4Net.dll; When I try to run the performance profiling tool in VS 2010 on it it gives me the following warnings "AjaxControlToolkit.dll is signed and instrumenting it will invalidate its signature. If you proceed without a post-instrument event to re-sign the binary it may not load correctly". Now, if I choose the option to continue without re-signing the profiling starts but the assembly doesn't load and gives an ASP.NET exception.

    Read the article

  • Difficulty in Understanding Slideshow script

    - by shining star
    I have taken slide show script from net. But There some functions i cannot understand here is script <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" > <html lang="en"> <head> <title></title> <script> var interval = 1500; var random_display = 0; var imageDir = "my_images/"; var imageNum = 0; imageArray = new Array(); imageArray[imageNum++] = new imageItem(imageDir + "01.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "02.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "03.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "04.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "05.jpg"); var totalImages = imageArray.length; function imageItem(image_location) { this.image_item = new Image(); this.image_item.src = image_location; return this.image_item.src; } function get_ImageItemLocation(imageObj) { return(imageObj.image_item.src) } alert(imageArray[imageNum].image_item.src); function randNum(x, y) { var range = y - x + 1; return Math.floor(Math.random() * range) + x; } function getNextImage() { if (random_display) { imageNum = randNum(0, totalImages-1); } else { imageNum = (imageNum+1) % totalImages; } var new_image = get_ImageItemLocation(imageArray[imageNum]); //alert(new_image) return(new_image); } function getPrevImage() { imageNum = (imageNum-1) % totalImages; var new_image = get_ImageItemLocation(imageArray[imageNum]); return(new_image); } function prevImage(place) { var new_image = getPrevImage(); document[place].src = new_image; } function switchImage(place) { var new_image = getNextImage(); document[place].src = new_image; var recur_call = "switchImage('"+place+"')"; timerID = setTimeout(recur_call, interval); } </script> </head> <body onLoad="switchImage('slideImg')"> <img name="slideImg" src="27.jpg" width=500 height=375 border=0> <a href="#" onClick="switchImage('slideImg')">play slide show</a> <a href="#" onClick="clearTimeout(timerID)"> pause</a> <a href="#" onClick="prevImage('slideImg'); clearTimeout(timerID)"> previous</a> <a href="#" onClick="switchImage('slideImg'); clearTimeout(timerID)">next </a> </body> </html> here exactly i dont know what does acctually function of get_ImageItemLocation(imageObj) and imageItem(image_location) what does these two functions seperately? Thanks in advance for attention

    Read the article

  • Override decimal ToString() method

    - by Jimbo
    I have a decimal datatype with a precision of (18, 8) in my database and even if its value is simply 14.765 it will still get displayed as 14.76500000 when I use Response.Write to return its value into a webpage. Is it possible to override its default ToString method to return the number in the format #,###,##0.######## so that it only displays relevant decimal places? UPDATE I'm assuming that when one outputs number on a page like <%= item.price %> (where item.price is a number) that the number's ToString method is being called? I'm trying to avoid having to change every instance where the value is displayed by defaulting the ToString() format somehow.

    Read the article

  • Android Handler postDelayed executes twice

    - by Ömer Baykal
    When I use Handler and its postDelayed method, the run() method executes twice. Below is part of my code. Handler deneme = new Handler(); deneme.postDelayed(new Runnable() { @Override public void run() { randomOyna(); } }, 1000); where randomOyna is the method public void randomOyna() { Log.v("sonOlarak", "çalisti"); } I monitor the LogCat and see that "çalisti" entry is written twice, so that randomOyna is called twice. The task is scheduled truely, but executes both after 1 sec and 2 secs. Can you help me???

    Read the article

  • Could someone give me their two cents on this optimization strategy

    - by jimstandard
    Background: I am writing a matching script in python that will match records of a transaction in one database to names of customers in another database. The complexity is that names are not unique and can be represented multiple different ways from transaction to transaction. Rather than doing multiple queries on the database (which is pretty slow) would it be faster to get all of the records where the last name (which in this case we will say never changes) is "Smith" and then have all of those records loaded into memory as you go though each looking for matches for a specific "John Smith" using various data points. Would this be faster, is it feasible in python, and if so does anyone have any recommendations for how to do it?

    Read the article

  • Number distribution

    - by Carra
    Problem: We have x checkboxes and we want to check y of them evenly. Example 1: select 50 checkboxes of 100 total. [-] [x] [-] [x] ... Example 2: select 33 checkboxes of 100 total. [-] [-] [x] [-] [-] [x] ... Example 3: select 66 checkboxes of 100 total: [-] [x] [x] [-] [x] [x] ... But we're having trouble to come up with a formula to check them in code, especially once you go 11/111 or something similar. Anyone has an idea?

    Read the article

  • How do I do MongoDB console-style queries in PHP?

    - by Zoe Boles
    I'm trying to get a MongoDB query from the javascript console into my PHP app. What I'm trying to avoid is having to translate the query into the PHP "native driver"'s format... I don't want to hand build arrays and hand-chain functions any more than I want to manually build an array of MySQL's internal query structure just to get data. I already have a string producing the exact content I want in the Mongo console: db.intake.find({"processed": {"$exists": "false"}}).sort({"insert_date": "1"}).limit(10); The question is, is there a way for me to hand this string, as is, to MongoDB and have it return a cursor with the dataset I request? Right now I'm at the "write your own parser because it's not valid json to kinda turn a subset of valid Mongo queries into the format the PHP native driver wants" state, which isn't very fun. I don't want an ORM or a massive wrapper library; I just want to give a function my query string as it exists in the console and get an Iterator back that I can work with. I know there are a couple of PHP-based Mongo manager applications that apparently take console-style queries and handle them, but initial browsing through their code, I'm not sure how they handle the translation. I absolutely love working with mongo in the console, but I'm rapidly starting to loathe the thought of converting every query into the format the native writer wants...

    Read the article

  • postgresql drop table

    - by Russell
    I have two tables (tbl and tbl_new) that both use the same sequence (tbl_id_seq). I'd like to drop one of those tables. On tbl, I've removed the modifier "not null default nextval('tbl_id_seq'::regclass)" but that modifier remains on tbl_new. I'm getting the following error: ERROR: cannot drop table tbl because other objects depend on it DETAIL: default for table tbl_new column id depends on sequence tbl_id_seq After reviewing http://www.postgresql.org/docs/9.1/static/sql-droptable.html It looks like there is only CASCADE and RESTRICT as options.

    Read the article

  • Append a .css file to an iframe so styles can be overrided

    - by Toni Michel Caubet
    i am trying like this: $(document).ready(function(){ $('#muestraMotor').bind('mousedown',function(){ var cssLink = document.createElement("link"); cssLink.href = "../estilo/css/datepicker.css"; cssLink .rel = "stylesheet"; cssLink .type = "text/css"; frames['cboxIframe'].document.body.appendChild(cssLink); }); }) where cboxIframe is the id of the iframe, Firebug jumps: frames.cboxIframe is undefined [Detener en este error] frames['cboxIframe'].document.body.appendChild(cssLink);

    Read the article

  • Dynamic allocated array is not freed

    - by Stefano
    I'm using the code above to dynamically allocate an array, do some work inside the function, return an element of the array and free the memory outside of the function. But when I try to deallocate the array it doesn't free the memory and I have a memory leak. The debugger pointed to the myArray variable shows me the error CXX0030. Why? struct MYSTRUCT { char *myvariable1; int myvariable2; char *myvariable2; .... }; void MyClass::MyFunction1() { MYSTRUCT *myArray= NULL; MYSTRUCT *myElement = this->MyFunction2(myArray); ... delete [] myArray; } MYSTRUCT* MyClass::MyFunction2(MYSTRUCT *array) { array = (MYSTRUCT*)operator new(bytesLength); ... return array[X]; }

    Read the article

  • Multiple complete HTTP requests stuck in TCP CLOSE_WAIT state

    - by Sean Owen
    I have a Java and Tomcat-based server application which initiates many outbound HTTP requests to other web sites. We use Jakarta's HTTP Core/Client libraries, very latest versions. The server locks up at some point since all its worker threads are stuck trying to close completed HTTP connections. Using 'lsof' reveals a bunch of sockets stuck in TCP CLOSE_WAIT state. This doesn't happen for all, or even most connections. In fact, I saw it before and resolved it by making sure to set the Connection: Close response header. So that makes me think it may be bad behavior of remote servers. It may have come up again since I moved the app to a totally new service provider -- different OS, network situation. But, I am still at a loss as to what I could do, if anything, to work around this. Some poking around on the internet didn't turn up anything I'm not already doing. Just thought I'd ask if anyone has seen and solved this?

    Read the article

  • Vim: replacing start and end of a visual char, line or block

    - by gattu marrudu
    I am trying to find a shortcut to place a custom comment sequence on my code, e.g.: /* start of comment blah end of comment /**/ (it is easier to void the comment by just adding a / to the beginning) I would like to do this in Vim by selecting a visual line, block or char and adding '/' characters at the beginning of the block and '/*/' at the end, plus newlines. After selecting some lines (Shift-V) I tried this: '<,'>s/\(.*\)/\/*\r\1\r\/**\// But it adds the comment chars at EACH newline. How can I only apply the substitution at the beginning and end of the selected range? Thanks gm

    Read the article

  • Adding time to a timer/counter

    - by BoneStarr
    I've looked all over the web and everyone can teach you how to make a timer for your game or a countdown, but I can't seem to find out how to add time to an already counting timer. So here is my counter class: package { import flash.display.MovieClip; import flash.display.Stage; import flash.text.TextField; import flash.events.Event; import flash.utils.Timer; import flash.events.TimerEvent; public class Score extends MovieClip { public var second:Number = 0; public var timer:Timer = new Timer(100); private var stageRef:Stage; public function Score(stageRef:Stage) { x = 560.95; y = 31.35; this.stageRef = stageRef; timer.addEventListener(TimerEvent.TIMER, scoreTimer); timer.start(); } public function scoreTimer(evt:TimerEvent):void { second += 1; scoreDisplay.text = String("Score: " +second); } That works without any issues or problems and just keeps counting upwards at a speed of 100ms, what I want to know is how to add say 30 seconds if something happens in my game, say you kill an enemy for example. Please help!

    Read the article

  • How to disable server-side caching on IIS 7.5 (asp net mvc3)

    - by troebr
    I'm struggling with my IIS setup regarding caching, here's a brief description of my problem: I'm making a site for mobile and non-mobile, sharing the same controllers. IE: mysite/page will serve either mysite/page.cshtml, or mysite/M/page.cshtml, depending on the device. Here's the catch, it worked fine with my local and integration environment (cassiini and iis 6), but on another machine (2008r2/iis 7.5), apparently there is an aggressive server-side caching policy: If I access the website from a desktop machine, I have the correct pages (desktop version) If now I use my mobile phone to access the site, I will have the desktop version, (which implies a server-side cache, my phone is not using the same network). On the contrary, if I were to restart the server and access the site using my phone first, then I will get the mobile version on my desktop (only for the pages I already visited of course). I tried 2 solutions so far: Disabling OutputCache from my Web.config: <httpModules> [..] <remove name="OutputCache" /> </httpModules> And unchecking "Enable output cache" in "Output Caching" for my site in IIS. What's bugging me is that I do not have this problem with my other server (iis 6.0), although caching is enabled on this one, which leads me to think it is related to iis 7 caching addition. My question is simple: how does one disable server-side caching on IIS 7.5? Thanks in advance for your iis lights!

    Read the article

  • The SQL Server ODBC Driver for Linux is Available!

    - by The Official Microsoft IIS Site
    The first beta release of the SQL Server ODBC Driver for Linux is available for download! As announced in October , the “Multiplatform Team” (a.k.a. the “MPlat Team”) has released a preview version of a driver that will provide first-class access to SQL Server from applications running on Linux operating systems. The team is looking for feedback on this release to incorporate into their production-ready release, so try it out and let us know what you think. Here are the important...(read more)

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14  | Next Page >