Search Results

Search found 155 results on 7 pages for 'dylan mccall'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • What's the scope of a Javascript variable declared in a for() loop?

    - by Dylan Beattie
    Check out the following snippet of HTML/Javascript code: <html> <head> <script type="text/javascript"> var alerts = []; for(var i = 0; i < 3; i++) { alerts.push(function() { document.write(i + ', '); }); } for (var j = 0; j < 3; j++) { (alerts[j])(); } for (var i = 0; i < 3; i++) { (alerts[i])(); } </script> </head><body></body></html> This outputs: 3, 3, 3, 0, 1, 2 which isn't what I was expecting - I was expecting the output 0, 1, 2, 0, 1, 2, I (incorrectly) assumed that the anonymous function being pushed into the array would behave as a closure, capturing the value of i that's assigned when the function is created - but it actually appears that i is behaving as a global variable. Can anyone explain what's happening to the scope of i in this code example, and why the anonymous function isn't capturing its value?

    Read the article

  • Core Data Null Relationship

    - by Dylan Copeland
    I have a to-one relationship in my data model with Core Data. I'm trying to set the value of the relationship but Core Data keeps thinking that it's nil. The "creatorUser" relationship is not optional, so when I go to save my managed object context, Core Data gives errors because it thinks the "creatorUser" is nil. Any help would be greatly advised. NSManagedObject *teamManagedObject = [NSEntityDescription insertNewObjectForEntityForName:@"DCTeam" inManagedObjectContext:_managedObjectContext]; // Creator Properties NSManagedObject *creator = [self userForID:[ticketInfo objectForKey:@"userid"]]; if (!creator) { creator = [NSEntityDescription insertNewObjectForEntityForName:@"DCUser" inManagedObjectContext:_managedObjectContext]; [creator setValue:[personInfo objectForKey:@"userid"] forKey:@"userid"]; [creator setValue:[personInfo objectForKey:@"creatorName"] forKey:@"name"]; } [teamManagedObject setValue:creator forKey:@"creatorUser"];

    Read the article

  • How can I determine file encodings on Windows / IIS ?

    - by Dylan Beattie
    From the answers to this question it appears there's a file somewhere on our server that's been saved with the wrong encoding. I've seen this happen before - most often when pasting from Word into Visual Studio, when "smart quotes" can interfere with Visual Studio's encoding settings when saving the file. Thing is - the problem I'm having involves 20-30 different script files, include files and so on (hey, that was how we kept it modular back in the day...) and I really don't want to open every one of them in Visual Studio and check the file encodings individually. Is there any way I can analyze a folder tree full of files and spit out a list of each filename along with the text encoding used to save the file? (Or - if encodings aren't clearly specified - work out what encoding Microsoft IIS thinks was used to save the file?)

    Read the article

  • How can I get all content within <td> tag using a HTML Agility Pack?

    - by Bob Dylan
    So I'm writing an application that will do a little screen scrapping. I'm using the HTML Agility Pack to load an entire HTML page into an instance of HtmlDocoument called doc. Now I want to parse that doc, looking for this: <table border="0" cellspacing="3"> <tr><td>First rows stuff</td></tr> <tr> <td> The data I want is in here <br /> and it's seperated by these annoying <br /> 's. No id's, classes, or even a single <p> tag. </p> Just a bunch of <br /> tags. </td> </tr> </table> So I just need to get the data within the 2nd row. How can I do this? Should I use a regex or something else?

    Read the article

  • DIV with text over an image on hover.

    - by Dylan Taylor
    OKay first off this is really really similiar to the http://dribbble.com homepage. In the simplest form possible. I have an image, and i'm trying to CSS it so that when i hover over the image, a DIV shows up with some text and a partially transparent background color. I have no idea how to do this..

    Read the article

  • Cocoa Touch best practice for capturing/logging/diagnosing crashes

    - by Dylan
    As I get closer to releasing my first public iPhone app I'm concerned about catching crashes in the field. I'm curious to hear how others have gone about this. I'm not sure what's possible outside of the debugger. Is all lost with an EXC_BAD_ACCESS or can I still catch it and get something useful into a log? Is the program main() the spot to put a @try/@catch?

    Read the article

  • How can I get all content within <table></table> tags using a regex?

    - by Bob Dylan
    So I'm writing an application that will do a little screen scrapping. All the pages (about 1000 or so) contain this line: <table border="0" cellspacing="3"> <tr><td>First rows stuff</td></tr> <tr> <td> The data I want is in here <br /> and it's seperated by these annoying <br /> 's. No id's, classes, or even a single <p> tag. Just a bunch of <br /> tags. </td> </tr> </table> So I just need to get the data within the 2nd row out. How can I do this? Should I use a regex or something else?

    Read the article

  • PHP if string contains URL isolate it

    - by Dylan Taylor
    In PHP, I need to be able to figure out if a string contains a URL. If there is a URL, I need to isolate it as another separate string. For example: "SESAC showin the Love! http://twitpic.com/1uk7fi" I need to be able to isolate the URL in that string into a new string. At the same time the URL needs to be kept intact in the original string. Follow? I know this is probably really simple but it's killing me.

    Read the article

  • Strange error: cannot convert from 'int' to 'ios_base::openmode'

    - by Dylan Klomparens
    I am using g++ to compile some code. I wrote the following snippet: bool WriteAccess = true; string Name = "my_file.txt"; ofstream File; ios_base::open_mode Mode = std::ios_base::in | std::ios_base::binary; if(WriteAccess) Mode |= std::ios_base::out | std::ios_base::trunc; File.open(Name.data(), Mode); And I receive these errors... any idea why? Error 1: invalid conversion from ‘int’ to ‘std::_Ios_Openmode’ Error 2: initializing argument 2 of ‘std::basic_filebuf<_CharT, _Traits* std::basic_filebuf<_CharT, _Traits::open(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits]’ As far as I could tell from a Google search, g++ is actually breaking the C++ standard here. Which I find quite astonishing, since they generally conform very strictly to the standard. Is this the case? Or am I doing something wrong. My reference for the standard: http://www.cplusplus.com/reference/iostream/ofstream/open/

    Read the article

  • iPhone/Obj-C - Archiving object causes lag

    - by Dylan
    Hi I have a table view, and when I delete a cell I am removing an item from an NSMutableArray, archiving that array, and removing the cell. However, when I do this, it is causing the delete button to lag after I click it. Is there any way to fix this? // Override to support editing the table view. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { int row = [indexPath row]; [savedGames removeObjectAtIndex:row]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; //this line causing lag [NSKeyedArchiver archiveRootObject:savedGames toFile:[self dataFilePath]]; } } Thanks

    Read the article

  • Customizing TabWidget in SDK 1.5, API 3

    - by Dylan McClung
    I'm aware that API 3 doesn't allow a view to be set for a tab, but I still need to modify the TextView displayed as the indicator. I'd also like to change the Drawable for the tab, but I don't see a way to do it without a custom tab view as allowed in 1.6, API 4. Working with this generic example below, is there way to retrieve the TextView and modify its properties or change the drawable? TabHost tabHost = getTabHost(); TabHost.TabSpec spec; spec = tabHost.newTabSpec("nearby") .setIndicator("Nearby Activity") .setContent(R.id.nearby_list); tabHost.addTab(spec); spec = tabHost.newTabSpec("friends") .setIndicator("Friends & Favorites") .setContent(R.id.friends_list); tabHost.addTab(spec); tabHost.setCurrentTabByTag("nearby"); Thanks for any help.

    Read the article

  • Postgresql sequences

    - by Dylan
    When I delete all records from a Postgresql table and then try to reset the sequence to start a new record with number 1 when it is inserted, i get different results : SELECT setval('tblname_id_seq', (SELECT COALESCE(MAX(id),1) FROM tblname)); This sets the current value of the sequence to 1, but the NEXT record (actually the first because there are no records yet) gets number 2! And I can't set it to 0, because the minimum value in the sequence is 1! When I use : ALTER SEQUENCE tblname_id_seq RESTART WITH 1; the first record that is inserted actually gets number 1 ! But the above code doesn't accept a SELECT as a value instead of 1. I wish to reset the sequence to number 1 when there are no records, and the first record then should start with 1. But when there ARE already records in the table, I want to reset the sequence so that the next record that is inserted will get {highest}+1 Does anyone have a clear solution for this?

    Read the article

  • MySQL : select/join on strings as fieldnames - is this possible?

    - by Dylan
    I can retrieve all column names from table 'categories' with : SELECT col.column_name FROM information_schema.columns AS col WHERE col.table_schema= database() and col.table_name = "categories" This produces a resultset like this : column_name ----------------- categoryID name description I can retrieve all values for a specific category with : SELECT * FROM categories AS c WHERE c.categoryID=12345 this results in a resultset like this: categoryID | name | description ------------------------------------------------ 12345 | test | this is a test Now I would like to get some kind of join of above selects to get a resultset that looks something like this : fieldname | value ---------------------------------------- categoryID | 12345 name | test description | this is a test Does anyone know if this is possible ? Can you do a join on strings that come from another select ?? The reason for this is that I'm writing a universal stored procedure that outputs all fields + their values from a table, without knowing what fields there are in the table. (The tablename is given in a parameter)

    Read the article

  • Rotating images with PHP reduces quality especially over about 10-20 actions

    - by Dylan Cross
    I am using this code below to rotate my jpeg images, the problem is that after around 10-20 times of rotating the image the image is dramatically lower quality, especially blue skies and such, my question is how can I keep these images the same high quality image? There must be a way. I mean, i keep the original image on the server for each image uploaded, and I don't do anything to that, so if need be it, I guess I could always come up with some way of using that over whenever possible.. But would rather not have to. $source = imagecreatefromjpeg($filename); $rotate = imagerotate($source, 90, 0); imagejpeg($rotate, $filename ,100);

    Read the article

  • Moving x,y position of all array objects every frame in actionscript 3?

    - by Dylan Gallardo
    I have my code setup so that I have an movieclip in my library a class called "block" being duplicated multiple times and added into an array like this: function makeblock(e:Event){ newblock=new block; newblock.x=10; newblock.y=10; addChild(newblock); myarray[counter] = newblock; //adds a newblock object into array counter += 1; } Then I have a loop with a currently primitive way of handling my problem: stage.addEventListener(Event.ENTER_FRAME, gameloop); function gameloop(evt:Event):void { if (moveright==true){ myarray[0].x += 5; myarray[1].x += 5; myarray[2].x += 5 -(and so on)- My question is how can I change x,y values every frame for new objects duplicated into the array, along with the previous ones that were added. Of course with a more elegant way than writing it out myself... array[0].x += 5, array[1], array[2], array[3] etc. Ideally I would like this to go up to 500 or more array objects for one array so obviously I don't want to be writing it out individually haha, I also need it to be consistent with performance so using a for loop or something to loop through the whole array and move each x += 5 wouldn't work would it? Anyway, if anyone has any ideas that'd be great!

    Read the article

  • Compiler error when using abstract types

    - by Dylan
    I'm trying to implement a "protocol helper" trait that is responsible for matching up Prompts and Responses. The eventual goal is to have an object that defines the various Prompt and Response classes as subclasses of a sealed trait, then have a class that mixes in the ProtocolSupport trait for that Protocol object. The problem is that my current approach won't compile, even though I'm fairly sure it should. Here's a distilled version of what I've got: trait Protocol { type Response type Prompt <: BasePrompt trait BasePrompt { type Data def validate(response: Response): Validated[Data] } } trait ProtocolSupport[P <: Protocol] { def foo(prompt: P#Prompt, response: P#Response) = { // compiler error prompt.validate(response) } } The compiler doesn't like the response as an argument to prompt.validate: [error] found : response.type (with underlying type P#Response) [error] required: _4.Response where val _4: P [error] prompt.validate(response) [error] ^ This isn't very helpful.. it seems to say that it wants a P.Response but that's exactly what I'm giving it, so what's the problem?

    Read the article

  • This is the End of Business as Usual...

    - by Michael Snow
    This week, we'll be hosting our last Social Business Thought Leader Series Webcast for 2012. Our featured guest this week will be Brian Solis of Altimeter Group. As we've been going through the preparations for Brian's webcast, it became very clear that an hour's time is barely scraping the surface of the depth of Brian's insights and analysis. Accordingly, in the spirit of sharing Brian's perspective for all of our readers, we'll be featuring guest posts all this week pulled from Brian's larger collection of blog postings on his own website. If you like what you've read here this week, we highly recommend digging deeper into his tome of wisdom. Guest Post by Brian Solis, Analyst, Altimeter Group as originally featured on his site with the minor change of the video addition at the beginning of the post. This is the End of Business as Usual and the Beginning of a New Era of Relevance - Brian Solis, Principal Analyst, Altimeter Group The Times They Are A-Changin’ Come gather ’round people Wherever you roam And admit that the waters Around you have grown And accept it that soon You’ll be drenched to the bone If your time to you Is worth savin’ Then you better start swimmin’ Or you’ll sink like a stone For the times they are a-changin’. - Bob Dylan I’m sure you are wondering why I chose lyrics to open this article. If you skimmed through them, stop here for a moment. Go back through the Dylan’s words and take your time. Carefully read, and feel, what it is he’s saying and savor the moment to connect the meaning of his words to the challenges you face today. His message is as important and true today as it was when they were first written in 1964. The tide is indeed once again turning. And even though the 60s now live in the history books, right here, right now, Dylan is telling us once again that this is our time to not only sink or swim, but to do something amazing. This is your time. This is our time. But, these times are different and what comes next is difficult to grasp. How people communicate. How people learn and share. How people make decisions. Everything is different now. Think about this…you’re reading this article because it was sent to you via email. Yet more people spend their online time in social networks than they do in email. Duh. According to Nielsen, of the total time spent online 22.5% are connecting and communicating in social networks. To put that in perspective, the time spent in the likes of Facebook, Twitter, and Youtube is greater than online gaming at 9.8%, email at 7.6% and search at 4%. Imagine for a moment if you and I were connected to one another in Facebook, which just so happens to be the largest social network in the world. How big? Well, Facebook is the size today of the entire Internet in 2004. There are over 1 billion people friending, Liking, commenting, sharing, and engaging in Facebook…that’s roughly 12% of the world’s population. Twitter has over 200 million users. Ever hear of tumblr? More time is spent on this popular microblogging community than Twitter. The point is that the landscape for communication and all that’s affected by human interaction is profoundly different than how you and I learned, shared or talked to one another yesterday. This transformation is only becoming more pervasive and, it’s not going back. Survival of the Fitting But social media is just one of the channels we can use to reach people. I must be honest. I’m as much a part of tomorrow as I am of yesteryear. It’s why I spend all of my time researching the evolution of media and its impact on business and culture. Because of you, I share everything I learn in newsletters, emails, blogs, Youtube videos, and also traditional books. I’m dedicated to helping everyone not only understand, but grasp the change that’s before you. Technologies such as social, mobile, virtual, augmented, et al compel us adapt our story and value proposition and extend our reach to be part of communities we don’t realize exist. The people who will keep you in business or running tomorrow are the very people you’re not reaching today. Before you continue to read on, allow me to clarify my point of view. My inspiration for writing this is to help you augment, not necessarily replace, the programs you’re running today. We must still reach those whom matter to us in the ways they prefer to be engaged. To reach what I call the connected consumer of Geneeration-C we must too reach them in the ways they wish to be engaged. And in all of my work, how they connect, talk to one another, influence others, and make decisions are not at all like the traditional consumers of the past. Nor are they merely the kids…the Millennial. Connected consumers are representative across every age group and demographic. As you can see, use of social networks, media sharing sites, microblogs, blogs, etc. equally span across Gen Y, Gen X, and Baby Boomers. The DNA of connected customers is indiscriminant of age or any other demographic for that matter. This is more about psychographics, the linkage of people through common interests (than it is their age, gender, education, nationality or level of income. Once someone is introduced to the marvels of connectedness, the sensation becomes a contagion. It touches and affects everyone. And, that’s why this isn’t going anywhere but normalcy. Social networking isn’t just about telling people what you’re doing. Nor is it just about generic, meaningless conversation. Today’s connected consumer is incredibly influential. They’re connected to hundreds and even thousands of other like-minded people. What they experiences, what they support, it’s shared throughout these networks and as information travels, it shapes and steers impressions, decisions, and experiences of others. For example, if we revisit the Nielsen research, we get an idea of just how big this is becoming. 75% spend heavily on music. How does that translate to the arts? I’d imagine the number is equally impressive. If 53% follow their favorite brand or organization, imagine what’s possible. Just like this email list that connects us, connections in social networks are powerful. The difference is however, that people spend more time in social networks than they do in email. Everything begins with an understanding of the “5 W’s and H.E.” – Who, What, When, Where, How, and to What Extent? The data that comes back tells you which networks are important to the people you’re trying to reach, how they connect, what they share, what they value, and how to connect with them. From there, your next steps are to create a community strategy that extends your mission, vision, and value and it align it with the interests, behavior, and values of those you wish to reach and galvanize. To help, I’ve prepared an action list for you, otherwise known as the 10 Steps Toward New Relevance: 1. Answer why you should engage in social networks and why anyone would want to engage with you 2. Observe what brings them together and define how you can add value to the conversation 3. Identify the influential voices that matter to your world, recognize what’s important to them, and find a way to start a dialogue that can foster a meaningful and mutually beneficial relationship 4. Study the best practices of not just organizations like yours, but also those who are successfully reaching the type of people you’re trying to reach – it’s benching marking against competitors and benchmarking against undefined opportunities 5. Translate all you’ve learned into a convincing presentation written to demonstrate tangible opportunity to your executive board, make the case through numbers, trends, data, insights – understanding they have no idea what’s going on out there and you are both the scout and the navigator (start with a recommended pilot so everyone can learn together) 6. Listen to what they’re saying and develop a process to learn from activity and adapt to interests and steer engagement based on insights 7. Recognize how they use social media and innovate based on what you observe to captivate their attention 8. Align your objectives with their objectives. If you’re unsure of what they’re looking for…ask 9. Invest in the development of content, engagement 10. Build a community, invest in values, spark meaningful dialogue, and offer tangible value…the kind of value they can’t get anywhere else. Take advantage of the medium and the opportunity! The reality is that we live and compete in a perpetual era of Digital Darwinism, the evolution of consumer behavior when society and technology evolve faster than our ability to adapt. This is why it’s our time to alter our course. We must connect with those who are defining the future of engagement, commerce, business, and how the arts are appreciated and supported. Even though it is the end of business as usual, it is the beginning of a new age of opportunity. The consumer revolution is already underway, and the question is: How do you better understand the role you play in this production as a connected or social consumer as well as business professional? Again, this is your time to define a new era of engagement and relevance. Originally written for The National Arts Marketing Project Connect with Brian via: Twitter | LinkedIn | Facebook | Google+ --- Note from Michael: If you really like this post above - check out Brian's TEDTalk and his thought process for preparing it in this post: 12.00 Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-family:"Calibri","sans-serif"; mso-bidi-font-family:"Times New Roman";} http://www.briansolis.com/2012/10/tedtalk-reinventing-consumer-capitalism-screw-business-as-usual/

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >