Daily Archives

Articles indexed Tuesday April 6 2010

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

  • PHP Doctrine: Filter Table?

    - by ropstah
    I'm still not convinced after my previous question and some experience. Requirements: I don't want to use an SQL query everytime a filterBy() function is called and still be able to call -filterBy() on the returned table. Please find the comment @ ObjectsTable class: "How to instantiate another table and add records which match the filter criteria?" Usage: $globaltable = new ObjectsTable(); //globally accessible variable $globaltable->findAll(); //this call is made once at the beginning of the request $globaltable->filterBy('somefield', $someValue); //this function is used all over the place ObjectsTable class: class ObjectsTable extends Doctrine_Table { function filterBy($field, $value) { //How to instantiate another table and add records which match the criteria? } }

    Read the article

  • Horizontal lines and PDF drawing on iPhone/iPad Quartz 2D

    - by aron
    I'm trying to display a PDF of music using the Quartz 2D calls: CGPDFDocumentGetPage and CGPDFPageGetDrawingTransform The problem is that some horizontal lines in the PDF get drawn thicker than others. The biggest problem is that I notice this in Preview on the Mac and on iPhone/iPad. Even when viewing this PDF in the iPhone/iPad mail, I get the same problem. Here is the example: http://aronnelson.com/problem/pdfproblem.jpg Note that the PDF on the left is preview, the PDF on the right is the same file but in Google Docs. See how clean the Google Docs version is? Is there any way to fix this problem? Would it help to draw the PDF larger and zoom down using a UIScrollView? Any help appreciated. I can't find much info re: this problem. Aron

    Read the article

  • Unable to Git-push master to Github

    - by Masi
    This question is related to my problem in understanding rebase, branch and merge, and to the problem How can you commit to your github account as you have a teamMate in your remote list? I found out that other people have had the same problem. The problem seems to be related to /etc/xinet.d/. Problem: unable to push my local branch to my master branch at Github I run git push origin master I get fatal: 'origin' does not appear to be a git repository fatal: The remote end hung up unexpectedly The error message suggests me that the branch 'origin' is not in my local git repository. This way, Git stops connecting to Github. This is strange, since I have not removed the branch 'origin'. My git tree is dev * master ticgit remotes/Math/Math remotes/Math/master remotes/origin/master remotes/Masi/master How can you push your local branch to Github, while you have a teamMate's branch in your local Git? VonC's answer solves the main problem. I put a passphares to my ssh keys. I run $git push github master I get Permission denied (publickey). fatal: The remote end hung up unexpectedly It seems that I need to give the passphrase for Git somehow. How can you make Git to ask passphares?

    Read the article

  • Animating Reloading of UITableView

    - by ustun
    I am trying to animate table rows in a UITableView in an iPhone project as I swipe across the screen to reload the data. When I disable animations and only call reloadData, table continues responding to swipe gestures. When I add animations with the reloadSections:WithRowAnimation: method, table stops responding to swipes, and only the navigation bar at the top responds to swipes. Another change is that, table starts responding to selection and I have to manually disable it again. I suspect these two issues might be related. I am using the swipe detection code over here btw: 1

    Read the article

  • NoSQL CouchDB Getting Stable with New Release

    <b>Database Journal:</b> "The open source Apache CouchDB database project hit a major milestone this week with the release of version 0.11. The release is an important one for the NoSQL database variant as it matures toward its 1.0 release."

    Read the article

  • Does cloud storage replicate the data over many datacenters if so it means i benefit content delive

    - by Berkay
    Let's assume that i want to use cloud storage service from one of the cloud storage provider, i got X gb structured and unstructured data and i will use this data as my contents of my interactive web page. And now i have some doubts about this point.I have many users and they are all visiting my web page from various countries.To be more specific first; does my data stored only of the Cloud Storage data center ? or Does my data replicated over many data centers of my provider? second if so; how can i benefit from content delivery network? (matching and placing users’ content nearest storage data centers)

    Read the article

  • Signs to Quit Programming?

    - by acidzombie24
    I was hanging out with two people and one of them had a design book and the other was talking to me about programming and design. He said he had difficulties programming and wondered what are signs that you should not or should stop programming? He wanted to know if he should stick to design and i said i didnt know since i havent seen him do either. How does one know if he or she should quit programming and stick to another discipline? and what are some signs?

    Read the article

  • What the reasons for/against returning 0 from main in ISO C++?

    - by Maulrus
    I know that the C++ standard says that return 0 is inserted at the end of main() if no return statement is given; however, I often see recently-written, standard-conforming C++ code that explicitly returns 0 at the end of main(). For what reasons would somebody want to explicitly return 0 if it's automatically done by the compiler?

    Read the article

  • How to manually add a legend to a ggplot object

    - by Dan
    I have this data frame: structure(list(month_num = 1:24, founded_month = c(4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 1L, 2L, 3L), founded_year = c(2008L, 2008L, 2008L, 2008L, 2008L, 2008L, 2008L, 2008L, 2008L, 2009L, 2009L, 2009L, 2009L, 2009L, 2009L, 2009L, 2009L, 2009L, 2009L, 2009L, 2009L, 2010L, 2010L, 2010L), count = c(270L, 222L, 256L, 250L, 277L, 268L, 246L, 214L, 167L, 408L, 201L, 225L, 203L, 220L, 230L, 225L, 177L, 207L, 166L, 135L, 116L, 122L, 69L, 42L), month_abb = c("Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar"), short_year = c("08", "08", "08", "08", "08", "08", "08", "08", "08", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "09", "10", "10", "10" ), proj = c(282, 246, 292, 298, 337, 340, 330, 310, 275, 528, 333, 369, 359, 388, 410, 417, 381, 423, 394, 375, 368, 386, 345, 330), label = c("Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan\n09", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan\n10", "Feb", "Mar")), .Names = c("month_num", "founded_month", "founded_year", "count", "month_abb", "short_year", "proj", "label"), row.names = c(NA, -24L), class = "data.frame") and i've got all of this done (I know the code's a bit ugly looking, pointers appreciated): p <- ggplot(m_summary2, aes(x = month_num, y = count)) p + geom_line(colour = rgb(0/255, 172/255, 0/255)) + geom_point(colour = rgb(0/255, 172/255, 0/255)) + geom_line(aes(x = m_summary2$month_num, y = m_summary2$proj), colour = rgb(18/255, 111/255, 150/255)) + geom_point(aes(x = m_summary2$month_num, y = m_summary2$proj), colour = rgb(18/255, 111/255, 150/255)) + scale_x_continuous("Month", breaks = m_summary2$month_num, labels = m_summary2$label) + scale_y_continuous("# Startups Founded") + opts(title = paste("# Startups Founded:", m_summary2$month_abb[1], m_summary2$short_year[1], "-", m_summary2$month_abb[nrow(m_summary2)], m_summary2$short_year[nrow(m_summary2)])) Now I would like to add a legend to clarify that the blue line is a projection and the green line is the current data. Thanks in advance!

    Read the article

  • Python beginner confused by a complex line of code

    - by Protean
    I understand the gist of the code, that it forms permutations; however, I was wondering if someone could explain exactly what is going on in the return statement. def perm(l): sz = len(l) print (l) if sz <= 1: print ('sz <= 1') return [l] return [p[:i]+[l[0]]+p[i:] for i in range(sz) for p in perm(l[1:])]

    Read the article

  • Select between dates with wildcard mysql

    - by Michael
    Hi, I am trying to select between two dates, but in the table they have timestamps after them. Example: calldate is 2010-03-16 22:43:28 How would I select this using calldate between '$date1' AND '$date2' to wildcard the timestamp after the date? I tried using like but it didn't work I just want to do between '$date1%' AND '$date2%' Anyone know how to do this? Thank you in advance!

    Read the article

  • What's wront in this iban validation code?

    - by Jackoder
    Hello coders, I'm working on a php iban validator but i have a problem I wrote like this: function IbanValidator($value) { $iban = false; $value= strtoupper(trim($value)); # Change US text into your country code if(preg_match('/^US\d{7}0[A-Z0-9]{16}$/', $value)) { $number= substr($value,4,22).'2927'.substr($value,2,2); $number= str_replace( array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'), array(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35), $number ); $iban = (1 == bcmod($number,97)) ? true; } return $iban; } Thanks. Funny Games

    Read the article

  • GDB not breaking on breakpoints set on object creation in C++

    - by Drew
    Hi all, I've got a c++ app, with the following main.cpp: 1: #include <stdio.h> 2: #include "HeatMap.h" 3: #include <iostream> 4: 5: int main (int argc, char * const argv[]) 6: { 7: HeatMap heatMap(); 8: printf("message"); 9: return 0; 10: } Everything compiles without errors, I'm using gdb (GNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009)), and compiled the app with gcc (gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)) with the commands "-c -g". When I add breakpoints to lines 7, 8, and 9, and run gdb, I get the following... (gdb) break main.cpp:7 Breakpoint 1 at 0x10000177f: file src/main.cpp, line 8. (gdb) break main.cpp:8 Note: breakpoint 1 also set at pc 0x10000177f. Breakpoint 2 at 0x10000177f: file src/main.cpp, line 8. (gdb) break main.cpp:9 Breakpoint 3 at 0x100001790: file src/main.cpp, line 9. (gdb) run Starting program: /DevProjects/DataManager/build/DataManager Reading symbols for shared libraries ++. done Breakpoint 1, main (argc=1, argv=0x7fff5fbff960) at src/main.cpp:8 8 printf("message"); (gdb) So, why of why, does anyone know, why my app does not break on the breakpoints for the object creation, but does break on the printf line? Drew J. Sonne.

    Read the article

  • Installing ant; clearly misunderstanding JAVA_HOME

    - by StormShadow
    Hey all, I am installing ant on a Windows XP machine, and am following the instructions at Apache's manual site. It said to set JAVA_HOME, so I checked, saw there was no environment variable named JAVA_HOME, made one, and set it to "C:\Program Files\Java\jdk1.6.0_19" When I try to run ant debug, however, it tells me that JAVA_HOME is currently set to "C:\Program Files\Java\jre6" I'm guessing JAVA_HOME isn't an environment variable. But if it isn't one, I'm at a loss as to where to start looking for it. Anybody know? Edit: Oh yeah - it's bugging me for tools.jar as well, but I'm guessing that when I fix the JAVA_HOME issue, that will help the terminal find tools.jar as well. Or maybe I'm wrong. Thanks

    Read the article

  • How to populate data from .txt file into Excel in VBA?

    - by swei
    I'm trying to create something to read data from a .txt file, then populate data into .xls, but after open the .txt file, how do I get the data out? Basically I'm trying to get the the third column of the lines dated '04/06/2010'. After I open the .txt file, when I use ActiveSheet.Cells(row, col), the ActiveSheet is not pointing to .txt file. My .txt file is like this (space delimited): 04/05/10 23 29226 04/05/10 24 26942 04/06/10 1 23166 04/06/10 2 22072 04/06/10 3 21583 04/06/10 4 21390 Here is the code I have: Dim BidDate As Date BidDate = '4/6/2010' Workbooks.OpenText Filename:=ForecastFile, StartRow:=1, DataType:=xlDelimited, Space:=True If Err.Number = 1004 Then MsgBox ("The forecast file " & ForecastFile & " was not found.") Exit Sub End If On Error GoTo 0 Dim row As Integer, col As Integer row = 1 col = 1 cell_value = activeSheet.Cells(row, col) MsgBox ("the cell_value=" & cell_value) Do While (cell_value <> BidDate) And (cell_value <> "") row = row + 1 cell_value = activeSheet.Cells(row, col) ' MsgBox ("the value is " & cell_value) Loop If cell_value = "" Then MsgBox ("A load forecast for " & BidDate & " was not found in your current load forecast file titled '" + ForecastFile + ". " + "Make sure you have a load forecast for the current bid date and then open this spreadsheet again.") ActiveWindow.Close Exit Sub End If Can anyone point out where it goes wrong here?

    Read the article

  • Add a row to UITableView for adding new item?

    - by David.Chu.ca
    In order to provide UI for user to add new items to my table view, I would like to add a new row in my table at a specified location (last row for example) when the view is in edit mode (I have a edit button on the view's navigation bar right side). This new row will have a add button indicator on the left side and disclosure accessory arrow on the right. When the view is not in edit mode, this add row should not be displayed. I am not sure if I should overwrite: - (void)setEditing:(BOOL)editing animated:(BOOL)animated{...} where I call the UITableView's method: insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation to insert a new row? My understanding is that this call may add a new row into the table view. The table view's data source is from CoreData storage. Not sure this may cause inconsistent numbers of data in the data store and table view? If it is OK and I have to manage rows in the table view, how can I add left add indicator and left disclosure arrow to the new row? Another question is that if I can do it to insert a new row as Add row, should I remove it when the table view not in edit mode? Just want to know if I am on the right track.

    Read the article

  • Efficiency of Java "Double Brace Initialization"?

    - by Jim Ferrans
    In Hidden Features of Java the top answer mentions Double Brace Initialization, with a very enticing syntax: Set<String> flavors = new HashSet<String>() {{ add("vanilla"); add("strawberry"); add("chocolate"); add("butter pecan"); }}; This idiom creates an anonymous inner class with just an instance initializer in it, which "can use any [...] methods in the containing scope". Main question: Is this as inefficient as it sounds? Should its use be limited to one-off initializations? (And of course showing off!) Second question: The new HashSet must be the "this" used in the instance initializer ... can anyone shed light on the mechanism? Third question: Is this idiom too obscure to use in production code? Summary: Very, very nice answers, thanks everyone. On question (3), people felt the syntax should be clear (though I'd recommend an occasional comment, especially if your code will pass on to developers who may not be familiar with it). On question (1), The generated code should run quickly. The extra .class files do cause jar file clutter, and slow program startup slightly (thanks to coobird for measuring that). Thilo pointed out that garbage collection can be affected, and the memory cost for the extra loaded classes may be a factor in some cases. Question (2) turned out to be most interesting to me. If I understand the answers, what's happening in DBI is that the anonymous inner class extends the class of the object being constructed by the new operator, and hence has a "this" value referencing the instance being constructed. Very neat. Overall, DBI strikes me as something of an intellectual curiousity. Coobird and others point out you can achieve the same effect with Arrays.asList, varargs methods, Google Collections, and the proposed Java 7 Collection literals. Newer JVM languages like Scala, JRuby, and Groovy also offer concise notations for list construction, and interoperate well with Java. Given that DBI clutters up the classpath, slows down class loading a bit, and makes the code a tad more obscure, I'd probably shy away from it. However, I plan to spring this on a friend who's just gotten his SCJP and loves good natured jousts about Java semantics! ;-) Thanks everyone!

    Read the article

  • Enjoy Discounts as High as 25 Percent on Online Training Products in the Microsoft Training Catalog

    Visit the Microsoft Training Catalog to find training and certification resources for Microsoft technologies including SharePoint 2010 and the .NET Framework. Receive discounts on the purchase of online training products in the catalog....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

  • Photosynth Panoramic Deep Zoom Mosaic

    18 years ago Virtual Reality was all the rage remember The Lawnmower Man? 16 years ago Apple came out with QuickTime VR which changed the way people experienced panoramic photos on the web. QuickTime VR (virtual reality) (also known as QTVR) is a type of image file format supported by Apple's QuickTime. It allows the creation and viewing of photographically captured panoramas and the exploration of objects through images taken at multiple viewing angles. It functions as a plug-in for QuickTime. QuickTime...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

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