Daily Archives

Articles indexed Thursday April 8 2010

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

  • Book: Confessions of a Public Speaker: Scott Berkun

    - by Greg Low
    It's probably apparent that I've been travelling again a lot lately as the number of posts related to books has gone up. One book that I picked up along the way and really enjoyed was Scott Berkun's Confessions of a Public Speaker . I could relate to so much of what Scott was talking about and there are quite a few solid nuggets of advice in the book. It's very important when you are regularly giving technical presentations to spend time learning about the "presenting" part of the task, not just...(read more)

    Read the article

  • Using phpFlickr, how would one display the primary photo from each photoset?

    - by Michael
    Referring to this question: http://stackoverflow.com/questions/2561475/flickr-phpflickr-api how would you display a primary photo from a photoset rather than all photos and photosets? this is the code I have so far: photosets_getList($user); ? <?php $photoset_id = $ph_set['id']; $photos = $f->photosets_getPhotos($photoset_id); foreach ($photos['photoset']['photo'] as $photo): ?> <?php if($parentID == $ph_set['parent']): ?> <a rel="lightbox[album<?=$count;?>]" href="<?= $f->buildPhotoURL($photo, 'medium') ?>" title="<?= $photo['title'] ?>"> <?php endif;?> <img src="<?= $f->buildPhotoURL($photo, 'square') ?>" alt="<?= $photo['title'] ?>" width="75" height="75" title="<?= $photo['title'] ?>" /> <h3><?=$ph_set['title']?></h3> <?php if($parentID == $ph_set['parent']): ?> </a> </div> <?php endif;?>

    Read the article

  • php adding images to another image, exact positioning

    - by user271619
    I have a cool snippet of code that works well, except one thing. The code will take an icon I want to add to an existing picture. I can position it where I want too! Which is exactly what I need to do. However, I'm stuck on one thing, concerning the placement. The code "starting position" (on the main image: navIcons.png) is from the Bottom Right. I have 2 variables: $move_left = 10; & $move_up = 8;. So, the means I can position the icon.png 10px left, and 8px up, from the bottom right corner. I really really want to start the positioning from the Top Left of the image, so I'm really moving the icon 10px right & 8px down, from the top left position of the main image. Can someone look at my code and see if I'm just missing something that inverts that starting position? function attachIcon($imgname) { $mark = imagecreatefrompng($imgname); imagesavealpha($mark, true); list($icon_width, $icon_height) = getimagesize($imgname); $img = imagecreatefrompng('images/sprites/navIcons.png'); imagesavealpha($img, true); $move_left = 10; $move_up = 9; list($mainpic_width, $mainpic_height) = getimagesize('images/sprites/navIcons.png'); imagecopy($img, $mark, $mainpic_width-$icon_width-$move_left, $mainpic_height-$icon_height-$move_up, 0, 0, $icon_width, $icon_height); imagepng($img); // display the image + positioned icon in the browser //imagepng($img,'newnavIcon.png'); // rewrite the image with icon attached. } header('Content-Type: image/png'); attachIcon('icon.png'); ? For those who are wondering why I'd even bother doing this. In a nutshell, I like to add 16x16 icons to 1 single image, while using css to display that individual icon. This does involve me downloading the image (sprite) and open photoshop, add the new icon (positioning it), and reuploading it to the server. Not a massive ordeal, but just having fun with php.

    Read the article

  • Why won't .attr('checked','checked') set?

    - by Jason
    I have the following snippet of code (I'm using jQuery 1.4.2): $.post('/Ads/GetAdStatsRow/', { 'ad_id': id }, function(result) { $('#edit_ads_form tbody').prepend(result); $(result).find('td.select-ad input').attr('checked','checked').click(); }); Assume that the post works correctly and returns a correct pre-built <tr> with some <td>s. Here's the weirdness: the $(result).find() line finds the correct input (which is a checkbox, as it's the only input in the cell) and runs the chained click() function correctly, but it REFUSES to set the box as checked, which I need to happen. Here's a crazy twist, too... when I get super specific and change the $(result).find() line to this (the id of the checkbox): $('#ad_' + id).click(); It checks the box, but doesn't run the click() function! If I set it to $('#ad_' + id).attr('checked','checked').click(); it runs the click function as though the box were checked, but the box remains unchecked, and if I do $('#ad_' + id).click().attr('checked','checked'); it does nothing at all. What in the world could be the matter with this? I'm running out of hair.... Thanks!

    Read the article

  • jQuery Validate: Checked *or* Filled?

    - by Mark
    required( dependency-expression ) They give an example of required: "#other:checked" but I want my field to be required if the #other field is either :checked or :filled (I don't know whether it will be a checkbox, radio button, or textbox beforehand). How would I do this?

    Read the article

  • Can I do video communication with silverlight 4.0?

    - by tom greene
    With silverlight 4.0, it is possible to show a live video of the user on the screen: Here is the code VideoBrush videoBrush = new VideoBrush(); CaptureSource captureSource = new CaptureSource { VideoCaptureDevice = CaptureDeviceConfiguration.GetAvailableVideoCaptureDevices().First() }; bool b = CaptureDeviceConfiguration.RequestDeviceAccess(); videoBrush.SetSource(captureSource); captureSource.Start(); myrect.Fill = videoBrush; However, I am looking at a way to show the video to someone else - seeing oneself on screen is not that interesting. Is it possible? Do I need my own server? Can I use clowd services to do the communication? Are there performance issues?

    Read the article

  • First order logic formula

    - by user177883
    R(x) is a red block B(x) is a blue block T(x,y) block x is on top of block y Question: Write a formula asserting that if no red block is on top of a red block then no red block is on top of itself. My answer: (Ax)(Ay)(R(x) and R(y) - ~T(x,y))-(Ax)(R(x)- ~T(x,x)) A = For all

    Read the article

  • Cannot get new product attribute in grid display

    - by russjman
    I added a new attribute to my products(a boolean "yes/no" field). It is a variable to enable/disable the price from displaying on the product detail page, and grid view. I managed to get it work on the product info page. But on product grid page I cant seem to access that variable. Specifically, the template i am working with is catalog/product/price.phtml. From what i can tell, the price is being displayed by the same group of if-statements on both the product detail page, and grid page. This has me confused because i cant find any code on that template to handle multiple products, just a bunch of nested if statements. this is how im attempting to access this new variable using $_displayPrice. on line 36 of catalog/product/price.html <?php $_product = $this->getProduct(); ?> <?php $_id = $_product->getId() ?> <?php $_displayPrice = $_product->getDisplayPrice() ? "Yes" : "No"; echo $_displayPrice;?> What has me further confused is that when display $_product-getData(), my new variable isn't anywhere among that data. thanks in advance

    Read the article

  • RSS feeds in Orchard

    When we added RSS to Orchard, we wanted to make it easy for any module to expose any contents as a feed. We also wanted the rendering of the feed to be handled by Orchard in order to minimize the amount of work from the module developer. A typical example of such feed exposition is of course blog feeds. We have an IFeedManager interface for which you can get the built-in implementation through dependency injection. Look at the BlogController constructor for an example: public BlogController(...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Databinder.Eval using Lamda Expressions

    Using lambda expression to help with compile time checking of Eval statements...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Commands to run programs using .NET

    - by Arjun Vasudevan
    In case I have .NET framework installed in my computer + all the necessary other language support(Perl Interpreter etc) What are the commands I should give in the console to run programs in the following languages: 1. C 2. C++ 3. Java 4. Python 5. VB 6. C# 7. Perl 8. Ruby Like we have for VB- vbc .vb, what are the commands to run other languages?

    Read the article

  • Limiting one of each Runnable type in ExecutorService queue.

    - by Andrew
    I have an Executors.newFixedThreadPool(1) that I send several different tasks to (all implementing Runnable), and they get queued up and run sequentially correct? What is the best way to only allow one of each task to be either running or queued up at one time? I want to ignore all tasks sent to the ExecutorService that are already in the queue.

    Read the article

  • What's correct way to remove a boost::shared_ptr from a list?

    - by Catskul
    I have a std::list of boost::shared_ptr<T> and I want to remove an item from it but I only have a pointer of type T* which matches one of the items in the list. However I cant use myList.remove( tPtr ) I'm guessing because shared_ptr does not implement == for its template argument type. My immediate thought was to try myList.remove( shared_ptr<T>(tPtr) ) which is syntactically correct but it will crash from a double delete since the temporary shared_ptr has a separate use_count. std::list< boost::shared_ptr<T> > myList; T* tThisPtr = new T(); // This is wrong; only done for example code. // stand-in for actual code in T using // T's actual "this" pointer from within T { boost::shared_ptr<T> toAdd( tThisPtr ); // typically would be new T() myList.push_back( toAdd ); } { //T has pointer to myList so that upon a certain action, // it will remove itself romt the list //myList.remove( tThisPtr); //doesn't compile myList.remove( boost::shared_ptr<T>(tThisPtr) ); // compiles, but causes // double delete } The only options I see remaining are to use std::find with a custom compare, or to loop through the list brute force and find it myself, but it seems there should be a better way. Am I missing something obvious, or is this just too non-standard a use to be doing a remove the clean/normal way?

    Read the article

  • Finding values from a table that are *not* in a grouping of another table and what group that value

    - by Bkins
    I hope I am not missing something very simple here. I have done a Google search(es) and searched through stackoverflow. Here is the situation: For simplicity's sake let's say I have a table called "PeoplesDocs", in a SQL Server 2008 DB, that holds a bunch of people and all the documents that they own. So one person can have several documents. I also have a table called "RequiredDocs" that simply holds all the documents that a person should have. Here is sort of what it looks like: PeoplesDocs: PersonID DocID -------- ----- 1 A 1 B 1 C 1 D 2 C 2 D 3 A 3 B 3 C RequiredDocs: DocID DocName ----- --------- A DocumentA B DocumentB C DocumentC D DocumentD How do I write a SQL query that returns some variation of: PersonID MissingDocs -------- ----------- 2 DocumentA 2 DocumentB 3 DocumentD I have tried, and most of my searching has pointed to, something like: SELECT DocID FROM DocsRequired WHERE NOT EXIST IN ( SELECT DocID FROM PeoplesDocs) but obviously this will not return anything in this example because everyone has at least one of the documents. Also, if a person does not have any documents then there will be one record in the PeoplesDocs table with the DocID set to NULL. Thank you in advance for any help you can provide, Ben

    Read the article

  • Forking with Pipes

    - by Luke
    Hello I have tried to do fork() and piping in main and it works perfectly fine but when I try to implement it in a function for some reason I don't get any output, this is my code: void cmd(int **pipefd,int count,int type, int last); int main(int argc, char *argv[]) { int pipefd[3][2]; int i, total_cmds = 3,count = 0; int in = 1; for(i = 0; i < total_cmds;i++){ pipe(pipefd[count++]); cmd(pipefd,count,i,0); } /*Last Command*/ cmd(pipefd,count,i,1); exit(EXIT_SUCCESS); } void cmd(int **pipefd,int count,int type, int last){ int child_pid,i,i2; if ((child_pid = fork()) == 0) { if(count == 1){ dup2(pipefd[count-1][1],1); /*first command*/ } else if(last!=0){ dup2(pipefd[count - 2][0],0); /*middle commands*/ dup2(pipefd[count - 1][1],1); } else if(last == 1){ dup2(pipefd[count - 1][0],0); /*last command*/ } for(i = 0; i < count;i++){/*close pipes*/ for(i2 = 0; i2 < 2;i2++){ close(pipefd[i][i2]); }} if(type == 0){ execlp("ls","ls","-al",NULL); } else if(type == 1){ execlp("grep","grep",".bak",NULL); } else if(type==2){ execl("/usr/bin/wc","wc",NULL); } else if(type ==3){ execl("/usr/bin/wc","wc","-l",NULL); } perror("exec"); exit(EXIT_FAILURE); } else if (child_pid < 0) { perror("fork"); exit(EXIT_FAILURE); } } I checked the file descriptors and it is opening the right ones, not sure what the problem could be..

    Read the article

  • Displaying UserControls based on the type a TreeView selection is bound to

    - by Ray Wenderlich
    I am making an app in WPF in a style similar to Windows Explorer, with a TreeView on the left and a pane on the right. I want the contents of the right pane to change depending on the type of the selected element in the TreeView. For example, say the top level in the Tree View contains objects of class "A", and if you expand the "A" object you'll see a list of "B" objects as children of the "A" object. If the "A" object is selected, I want the right pane to show a user control for "A", and if "B" is selected I want the right pane to show a user control for "B". I've currently got this working by: setting up the TreeView with one HierarchialDataTemplate per type adding all the UserControls to the right pane, but collapsed implementing SelectedItemChanged on the TreeView, and setting the appropriate usercontrol to visible and the others to collapsed. However, I'm sure there's a better/more elegant way to switch out the views based on the type the selection is bound to, perhaps by making more use of data binding... any ideas?

    Read the article

  • Core Data (NSFetchedResultsController) displaying one row per section

    - by Urizen
    I have a CoreData application which uses NSFetchedResultsController. NSFetchedResultsController is useful in that it allows me to access the fetched objects more easily etc. but I find that I have problems with the following: I get a crash when I display a single row for each section (irrespective of the number of actual rows present) as a summary of the information in that section (e.g. showing a statistical analysis of the data contained in the fetched rows for that section). I understand that the NSFetchedResultsControllerDelegatemethods have to agree with the number of rows reported per section by the UITableView Delegate method but I would like to be able to fetch all of the records for each section without necessarily displaying each of the rows. The above causes me inconsistency crashes, when I try to insert or delete data for a section, which reports that the number of rows for each section is not as it should be given the number of insertions/deletions. Is there any way I can do what I'm trying to achieve? Thanks for any help.

    Read the article

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