Search Results

Search found 13070 results on 523 pages for 'simply tom'.

Page 3/523 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Using Facebook Graph to simply post a wall message with just javascript

    - by Glycerine
    Hey guys, Now I know this question has been asked similarly a lot of times but I'm really struggling here. Its a simple thing I need to do: I would like to post a message onto a users wall saying "I scored 8/10 on objects game" then a URL Thats it. I don't mind if facebook needs to authenticate and then post the message. and I really don't want to have to use the full API - as I don't want to handle user login details. Is it possible using the new Graph API and javascript. Uber thanks guys this'll allow me to sleep tonight.

    Read the article

  • How to simply a foreach iteration using reflection

    - by Priya
    Consider that I have to get the overall performance of X. X has Y elements and Y in turn has Z elements which inturn has some N elements. To get the performance of X I do this: List<double> XQ = new List<double>(); foreach (Elem Y in X.Y){ List<double> YQ = new List<double>(); foreach (Elem Z in Y.Z){ List<double> ZQ = new List<double>(); foreach (Elem N in Z.N){ ZQ.Add(GetPerformance(N)); } YQ.Add(AVG(ZQ)); } XQ.Add(AVG(YQ)); } AVG of XQ list gives the performance of X. The performance can be calculated for either X or Y or for Z. X, Y and Z share the same base class. So depending on the item given the foreach loop has to be executed. Currently I have a switch case to determine each item (X or Y or Z) and the foreach loop is repeated in the code pertaining to the item (eg. If Y foreach starts from Y.Z). Is is possible to convert this whole code generic using reflection instead of having to repeat it in each switch case? Thanks

    Read the article

  • jQuery jScrollPane - it simply won't work! :'(

    - by Jack Webb-Heller
    Hey folks, OK - I'll admit, I'm quite a beginner in this jQuery-department. I've probably made some amateur mistake, but hey, you gotta learn somewhere! :) So I'm using jScrollPane: http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html I want to use it style the scrollable area in my second column. Specifically, I would like to apply and format the scrollbars on the div #ajaxresults My page is... rather jQuery heavy. I don't know if any variables are conflicting or something... in fact I really have no idea at all why this isn't working. Take a look at my problematic page: http://furnace.howcode.com In the header, I've set this to go: <!-- Includes for jScrollPane --> <script type="text/javascript" src="http://localhost:8888/js/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="http://localhost:8888/js/jScrollPane.js"></script> <link rel="stylesheet" type="text/css" media="all" href="http://localhost:8888/stylesheets/jScrollPane.css" /> <script type="text/javascript"> $(function() { $('#ajaxresults').jScrollPane(); }); </script> (I've changed localhost on the server copy though) Nothing ever seems to work with the #ajaxresults div. I've set, as the jScrollPane docs say, overflow:auto on it but still no luck. I find that when jScrollPane DOES seem to 'run' it just moves the div down about 100 pixels. Try it for yourself. Perhaps someone could help? There's quite a few jQuery plugins there so I don't know if something's colliding/crashing etc... Please note the site is still in development between myself and a friend, which explains the personal messages we submit to each other ('Hi Donnie!' etc. :D ). Also, when you view the page nothing may appear in the second column for a few seconds - it's just fetching the data via Ajax. So give it a little time. Thanks very much! Jack

    Read the article

  • Simply if Statement for checking co-ordinate square.

    - by JonB
    I have an UIImageView and taking the raw touch input. I need to check if a touch is within a certain set of squares. At the moment... I have this if statement.... if(46 < touchedAt.x && touchedAt.x < 124 && 18 < touchedAt.y && touchedAt.y < 75) but I have tried to simplify it to this one... if(46 < touchedAt.x < 124 && 18 < touchedAt.y < 75) It didn't work. Is it possible to simplify like this or am I stuck with the slightly lengthier version at the top? Is there a reason why the types of comparisons in the bottom if don't work? Many Thanks.

    Read the article

  • Javascript: Simply change items in another select box?

    - by oni-kun
    I'm developing a registration page and wish to use JS to dynamically choose avatar selection based on gender. Here's what I have so far.. <select name="gender"> <option value="Male">Male </option> <option value="Female">Female </option> </select> And that should update options in this based on gender: <select name="avatar"> <option value="Trainer">Trainer </option> </select> <br /> <img src="images/trainers/male/Trainer.gif" /> I can't wrap my head around example code or concepts, I just need an example of how to fill 2-3 values into the 'avatar' selectbox based on gender, female or male, also how can I make 'Trainer' part of 'Trainer.gif' become dynamic? based on the avatar they choose?

    Read the article

  • Create blog post simply and easily

    - by danit
    I have a script which collects an image, link and some text content from various sources. It loops through and creates a number of posts. I'd like take each post add it to Wordpress with a Title, an image, and a link. Can anyone suggest an easy way of doing this?

    Read the article

  • How can I simply "run" lisp files

    - by Annan
    Python When I learned Python I installed it on windows with a nice gui installer and all .py files would automatically run in python, from the command line or explorer. I found this very intuitive and easy, because I could instantly make plain text files and run them. Lisp I'm starting to learn lisp and have decided (from reviews) that SBCL is not a bad lisp implementation. Is there a way to setup SBCL to run .lisp files as easily as with Python? Are there other lisp implementations that have this?

    Read the article

  • Can Symfony simply reload a page request?

    - by Rob Wilkerson
    I have an app that receives a request from another app. It detects a value on the query string, checks that value against a cached value and, if they don't match, it needs to clear its cache and reload the page (establishing a new cache). Unfortunately, I can't find a way to tell Symfony to redirect to the current page in exactly the same format (protocol, URI path, query string, etc.). What am I missing? This is all happening in a filter on isFirstCall(). Thanks.

    Read the article

  • Simply display RSS feed in/on aspx page

    - by Louis van Tonder
    Maybe I am being a n00b here, but for the life of me, I cant find a simple drop in type solution for displaying an rss feed inside an aspx page? I am looking for a simple solution, as when Firefox gets pointed to an rss feed, it just plainly displays it, no thrills, no fuss. I don't want to get into the xml and format it extensively. I just want a basic feed, will style it with font and a:styles. Thats it. Any ideas? EDIT: I am attempting to show a worpress "feed" inside an aspx page...

    Read the article

  • How does py2exe actually -and simply explained- work? :)

    - by sandra
    Hi folks, I have a c++ app that calls another python one (bundled into an exe with py2exe) So I have 2 apps. So I was wondering: What if my c++ did what py2exe does? i.e. embed the python app in the c++ one. This way I won't depend on py2exe and its configurations nighmares (yes, it has some) Hence my questions: how does py2exe work (so I can do its job with my c++ app) What about just embedding the whole python app with the c++? I read the python doc about embedding, did an example (a very simple one that does PyRun_SimpleString) but what about a whole python app with tons of modules? (zipimport maybe?) I'd love to hear how you'd do that. Thanks a lot! :)

    Read the article

  • No parameterless constructor defined for this object when simply copying site

    - by jaffa
    I'm getting the above error. All I have done is copied an existing site and set-up debugging to use a different port using IISExpress in Visual Studio. Any ideas why I would suddenly get this error? Normally I get this error when StructureMap cannot for some reason resolve a dependency to inject into a controller. But this has me stumped. The code-base is the same. All I've done is copied the code into another folder!?!

    Read the article

  • Remove this URL string when login fails and simply show div error

    - by Anagio
    My developer built our registration page to display a div when logins failed based on a string in the URL. When logins fail this is added to the URL /login?msg=invalid The PHP in my login.phtml which displays the error messages based on the msg= parameter is <?php $msg = ""; $msg = $_GET['msg']; if($msg==""){ $showMsg = ""; } elseif($msg=="invalid"){ $showMsg = ' <div class="alert alert-error"> <a class="close" data-dismiss="alert">×</a> <strong>Error!</strong> Login or password is incorrect! </div>'; } elseif($msg=="disabled"){ $showMsg = "Your account has been disabled."; } elseif($msg==2){ $showMsg = "Your account is not activated. Please check your email."; } ?> In the controller the redirect to that URL is else //email id does not exist in our database { //redirecting back with invalid email(invalid) msg=invalid. $this->_redirect($url."?msg=invalid"); } I know there are a few other validation types for disabled accounts etc. I'm in the process of redesigning the entire interface and would like to get rid of this kind of validation so that the div tags display when logins fail but not show the URL strings. If it matters the new div I want to display is <div class="alert alert-error alert-login"> Email or password incorrect </div> I'd like to replace the php my self in my login.phtml and controller but not a good programmer. What can I replace $this->_redirect($url."?msg=invalid"); with so that no strings are added to the URL and display the appropriate div tags? Thanks

    Read the article

  • EXC_BAD_ACCESS when simply casting a pointer in Obj-C

    - by AlexChilcott
    Hi all, Frequent visitor but first post here on StackOverflow, I'm hoping that you guys might be able to help me out with this. I'm fairly new to Obj-C and XCode, and I'm faced with this really... weird... problem. Googling hasn't turned up anything whatsoever. Basically, I get an EXC_BAD_ACCESS signal on a line that doesn't do any dereferencing or anything like that that I can see. Wondering if you guys have any idea where to look for this. I've found a work around, but no idea why this works... The line the broken version barfs out on is the line: LevelEntity *le = entity; where I get my bad access signal. Here goes: THIS VERSION WORKS NSArray *contacts = [self.body getContacts]; for (PhysicsContact *contact in contacts) { PhysicsBody *otherBody; if (contact.bodyA == self.body) { otherBody = contact.bodyB; } if (contact.bodyB == self.body) { otherBody = contact.bodyA; } id entity = [otherBody userData]; if (entity != nil) { LevelEntity *le = entity; CGPoint point = [contact contactPointOnBody:otherBody]; } } THIS VERSION DOESNT WORK NSArray *contacts = [self.body getContacts]; for (NSUInteger i = 0; i < [contacts count]; i++) { PhysicsContact *contact = [contacts objectAtIndex:i]; PhysicsBody *otherBody; if (contact.bodyA == self.body) { otherBody = contact.bodyB; } if (contact.bodyB == self.body) { otherBody = contact.bodyA; } id entity = [otherBody userData]; if (entity != nil) { LevelEntity *le = entity; CGPoint point = [contact contactPointOnBody:otherBody]; } } Here, the only difference between the two examples is the way I enumerate through my array. In the first version (which works) I use for (... in ...), where as in the second I use for (...; ...; ...). As far as I can see, these should be the same. This is seriously weirding me out. Anyone have any similar experience or idea whats going on here? Would be really great :) Cheers, Alex

    Read the article

  • Refactoring a long method that simply populates

    - by Jeune
    I am refactoring a method which is over 500 lines (don't ask me why) The method basically queries a list of maps from the database and for each map in the list does some computation and adds the value of that computation to the map. There are however too many computations and puts being done that the code has reached over 500 lines already! Here's a sample preview: public List<Hashmap> getProductData(...) { List<Hashmap> products = productsDao.getProductData(...); for (Product product: products) { product.put("Volume",new BigDecimanl(product.get("Height")* product.get("Width")*product.get("Length")); if (some condition here) { //20 lines worth of product.put(..,..) } else { //20 lines worth of product.put(..,..) } //3 more if-else statements like the one above try { product.put(..,..) } catch (Exception e) { product.put("",..) } //over 8 more try-catches of the form above } Any ideas on how to go about refactoring this?

    Read the article

  • How can I [simply] consume JSON Data in a Line of Business Web Application

    - by Atomiton
    I usually use JSON with jQuery to just return a string with html. However, I want to start to use Javascript objects in my code. What's the simplest way to get started using json objects on my page? Here's a sample Ajax call ( after $(document).ready( { ... }) of course: $('#btn').click(function(event) { event.preventDefault(); var out = $('#result'); $.ajax({ url: "CustomerServices.asmx/GetCustomersByInvoiceCount", success: function(msg) { // // Iterate through the json results and spit them out to a page? // }, data: "{ 'invoiceCount' : 100 }" }); }); My WebMethod: [WebMethod(Description="Gets customers with more than n invoices")] public List<Customer> GetCustomersByInvoiceCount(int? invoiceCount) { using (dbDataContext db = new dbDataContext()) { return db.Customers.Where(c => c.InvoiceCount >= invoiceCount); } } What gets returned: {"d":[{"__type":"Customer","Account":"1116317","Name":"SOME COMPANY","Address":"UNit 1 , 392 JOHN ST. ","LastTransaction":"\/Date(1268294400000)\/","HighestBalance":13922.34},{"__type":"Customer","Account":"1116318","Name":"ANOTHER COMPANY","Address":"UNIT #345 , 392 JOHN ST. ","LastTransaction":"\/Date(1265097600000)\/","HighestBalance":549.42}]} What I'd LIKE to know, is what are people generally doing with this returned json? Do you iterate through the properties and create an html table on the fly? Is there way to "bind" JSON data using a javascript version of reflection ( something like the .Net GridView Control ) Do you throw this returned data into a Javascript Object and then do something with it? An example of what I want to achieve is to have an plain ol' html page ( on a mobile device )with a list of a Salesperson's Customers. When one of those customers are clicked, the customer id gets sent to a webservice which retrieves the customer details that are relevant to a sales person. I know the SO talent pool is quite deep so I figured you all here would be able to guide in the right direction and give me a few ideas on the best way to approach this.

    Read the article

  • Strange behaviour when simply adding strings in Lazarus - FreePascal

    - by linkcharger
    The program has several "encryption" algorithms. This one should blockwise reverse the input. "He|ll|o " becomes "o |ll|He" (block length of 2). I add two strings, in this case appending the result string to the current "block" string and making that the result. When I add the result first and then the block it works fine and gives me back the original string. But when i try to reverse the order it just gives me the the last "block". Several other functions that are used for "rotation" are above. //amount of blocks function amBl(i1:integer;i2:integer):integer; begin if (i1 mod i2) <> 0 then result := (i1 div i2) else result := (i1 div i2) - 1; end; //calculation of block length function calcBl(keyStr:string):integer; var i:integer; begin result := 0; for i := 1 to Length(keyStr) do begin result := (result + ord(keyStr[i])) mod 5; result := result + 2; end; end; //desperate try to add strings function append(s1,s2:string):string; begin insert(s2,s1,Length(s1)+1); result := s1; end; function rotation(inStr,keyStr:string):string; var //array of chars -> string block,temp:string; //position in block variable posB:integer; //block length and block count variable bl, bc:integer; //null character as placeholder n : ansiChar; begin //calculating block length 2..6 bl := calcBl(keyStr); setLength(block,bl); result := ''; temp := ''; {n := #00;} for bc := 0 to amBl(Length(inStr),bl) do begin //filling block with chars starting from back of virtual block (in inStr) for posB := 1 to bl do begin block[posB] := inStr[bc * bl + posB]; {if inStr[bc * bl + posB] = ' ' then block[posB] := n;} end; //adding the block in front of the existing result string temp := result; result := block + temp; //result := append(block,temp); //result := concat(block,temp); end; end; (full code http://pastebin.com/6Uarerhk) After all the loops "result" has the right value, but in the last step (between "result := block + temp" and the "end;" of the function) "block" replaces the content of "result" with itself completely, it doesn't add result at the end anymore. And as you can see I even used a temp variable to try to work around that.. doesnt change anything though.

    Read the article

  • How do I simply hide a tooltip?

    - by Jonathan Garrido
    I have a image set as a link, with a title which is used for a caption in a lightbox. I need the "title" set in order to keep the caption for the lightbox, but I don't want the tool tip to pop up when I hover over the links. Anyone got a easy css fix? Or does this need to be done in Javascript?

    Read the article

  • Why is joining two vectors simply not working?

    - by Jim
    I have two vectors of MyObj structs. MyObj is defined as follows: struct MyObj { float x, y; unsigned int data[8]; unsigned int tmp[1]; MyObj(const MyObj &m) { x = m.x; y = m.y; tmp[0] = 0; for (int i = 0; i < 8; ++i) { data[i] = m.data[i]; } } }; I then have two vectors... vector<MyObj> v1; vector<MyObj> v2; // both get data eventually. v1.insert(v1.end(), v2.begin(), v2.end()); v2 has 3535004 elements in my experiment. v1 is similarly sized. I've also tried building a new vector and just using .push_back to build it from both vectors. Essentially, when I try to merge the two vectors I just get an error from visual studio saying "Debug error! R6010, abort() has been called". Very non-useful... So my question is: what could be causing this error, and how can I solve it? Thank you

    Read the article

  • Simply tag-based highlighting with Javascript

    - by nkd
    Hello, I got this code which works: <html> <head> <title>JS highlighting test</title> <script type="text/javascript"> function highlight() { var t = document.getElementById('highlight').innerHTML; t = t.replace(/(if|switch|for|while)\s*(\()/gi, "<b>$1</b>$2"); document.getElementById('highlight').innerHTML = t; } </script> </head> <body onload="javascript:highlight();"> <pre id="highlight"> 1 if(foo) { 2 bar(); 3 } 4 3 while(--baz) { 5 oof(); 6 } </pre> </body> </html> I would like to have it for all <pre> tags instead of just one with some specific and unique id as it works now. The best would be to have an combination of a specific tag with a specific id. Is it possible to extend the small JS function above to work this way (using some document.getElementsByTag(tag).getElementsById(id).innerHTML or something alike (I don't know what exactly suites the need) in a loop? I tried myself but with no real success. I need only as simple solution as possible, nothing really special. Thank you for your ideas. -- nkd

    Read the article

  • node.js simply does not run

    - by user309641
    I installed and ran node.js just fine on my mac, but even if I do this on windows chdir c:\testfolder node example.js then I get this error: node.js:201 throw e; // process.nextTick error, or 'error' event on first tick Error: Cannot find module 'c:\testfolder\example.js' at Function._resolveFilename <module.js:322:11> at Function._load <module.js:299:25> at Array.0 <module.js:499:10> at EventEmitter._tickCallback <node.js:192:40> I'm only even trying to run the example code on the nodejs website: var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');

    Read the article

  • How can I [simply] consume JSON Data to display to the page

    - by Atomiton
    I usually use JSON with jQuery to just return a string with html. However, I want to start to use Javascript objects in my code. What's the simplest way to get started using json objects on my page? Here's a sample Ajax call ( after $(document).ready( { ... }) of course: $('#btn').click(function(event) { event.preventDefault(); var out = $('#result'); $.ajax({ url: "CustomerServices.asmx/GetCustomersByInvoiceCount", success: function(msg) { // // Iterate through the json results and spit them out to a page? // }, data: "{ 'invoiceCount' : 100 }" }); }); My WebMethod: [WebMethod(Description="Gets customers with more than n invoices")] public List<Customer> GetCustomersByInvoiceCount(int? invoiceCount) { using (dbDataContext db = new dbDataContext()) { return db.Customers.Where(c => c.InvoiceCount >= invoiceCount); } } What gets returned: {"d":[{"__type":"Customer","Account":"1116317","Name":"SOME COMPANY","Address":"UNit 1 , 392 JOHN ST. ","LastTransaction":"\/Date(1268294400000)\/","HighestBalance":13922.34},{"__type":"Customer","Account":"1116318","Name":"ANOTHER COMPANY","Address":"UNIT #345 , 392 JOHN ST. ","LastTransaction":"\/Date(1265097600000)\/","HighestBalance":549.42}]} What I'd LIKE to know, is what are people generally doing with this returned json? Do you iterate through the properties and create an html table on the fly? Is there way to "bind" JSON data using a javascript version of reflection ( something like the .Net GridView Control ) Do you throw this returned data into a Javascript Object and then do something with it? An example of what I want to achieve is to have an plain ol' html page ( on a mobile device )with a list of a Salesperson's Customers. When one of those customers are clicked, the customer id gets sent to a webservice which retrieves the customer details that are relevant to a sales person. I know the SO talent pool is quite deep so I figured you all here would be able to guide in the right direction and give me a few ideas on the best way to approach this.

    Read the article

  • Tricky SQL - Select non-adjacent numbers

    - by Daniel
    Given this data on SQL Server 2005: SectionID Name 1 Dan 2 Dan 4 Dan 5 Dan 2 Tom 7 Tom 9 Tom 10 Tom How would I select records where the sectionID must be +-2 or more from another section for the same name. The result would be: 1 Dan 4 Dan 2 Tom 7 Tom 9 Tom Thanks for reading!

    Read the article

  • For normal mapping, why can we not simply add the tangent normal to the surface normal?

    - by sebf
    I am looking at implementing bump mapping (which in all implementations I have seen is really normal mapping), and so far all I have read says that to do this, we create a matrix to convert from world-space to tangent-space, in order to transform the lights and eye direction vectors into tangent space, so that the vectors from the normal map may be used directly in place of those passed through from the vertex shader. What I do not understand though, is why we cannot just use the normalised sum of the sampled-normal vector, and the surface-normal? (assuming we already transform and pass through the surface normal for the existing lighting functions) Take the diagram below; the normal is simply the deviation from the 'reference normal' for any given coordinate system, correct? And transforming the surface normal of a mapped surface from world space to tangent space makes it equivalent to the tangent space 'reference normal', no? If so, why do we transform all lighting vectors into tangent space, instead of simply transforming the sampled tangent once in the pixel shader?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >