Search Results

Search found 1402 results on 57 pages for 'album art'.

Page 15/57 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Why is my file being cleared if I don't save it?

    - by Kat
    My program is suppose to maintain a collection of Photos in a PhotoAlbum. It begins by reading a folder of photos and adds them to my PhotoAlbum. It then prints a menu that allows the user to list all the photos, add a photo, find a photo, save, and quit the program. Right now if I run my program it will add the 100 photos to the PhotoAlbum, but if I quit the program without saving, it clears the file I am reading from even if I haven't added a photo or done anything to the PhotoAlbum and I'm not sure why. Here is my method for printing to a file: private static void saveFile(PrintWriter writer) { String result; ArrayList<Photo> temp = album.getPhotoAlbum(); for (int i = 0; i < temp.size(); i++){ result = temp.get(i).toString() + "\n"; writer.println(result); } writer.close(); } And where the PrintWriter is instantiated: File file = new File(args[0] + File.separator + "album.dat"); try { PrintWriter fout = new PrintWriter(new FileWriter(file)); fileWriter = fout; } catch (IOException e){ System.out.println("ReadFromFile: Folder " + args[0] + " is not found."); System.exit(0); } And where it is called in my runMenu Method: private static void runMainMenu(Scanner scan) { String input; do { showMainMenu(); input = scan.nextLine().toLowerCase(); switch (input.charAt(0)) { case 'p': System.out.println(album.toString()); break; case 'a': album.addPhoto(readPhoto(scan, t)); break; case 'f': findMenu(scan); break; case 's': saveFile(fileWriter); System.exit(0); break; case 'q': break; default: System.out.println("Invalid entry: " + input.charAt(0)); break; } } while (!input.equalsIgnoreCase("q")); }

    Read the article

  • Returning different images through PHP.

    - by Espresso
    There's a status indicator code for AIM which returns two different images depending on your status (on/offline) which was done in PHP and with the AIM API. <img src="http://big.oscar.aol.com/USERNAME?on_url=ON_IMAGE&off_url=OFF_IMAGE"> I was looking for a Last.fm widget that shows JUST the album cover I'm listening to or the last album I listened to, but couldn't find it. How do I go along making it using PHP and the Last.fm API.

    Read the article

  • Can you authenticate Facebook Graph entirely from command line with Python?

    - by Sebastian
    I'm writing a (tabbed) application for Facebook that requires a background process to run on a server and, periodically, upload images to an album on this application's page. What I'm trying to do is create a script that will: a) authenticate me with the program b) upload an image to a specific album All of this entirely from the command line and completely with the new Graph API. My problem right now is trying to locate the documentation that will allow me to get a token without a pop-up window of sorts. Thoughts?

    Read the article

  • PHP something faster than explode to get filename from URL

    - by FFish
    My URL's can be absolute or relative: $rel = "date/album/001.jpg"; $abs = "http://www.site.com/date/album/image.jpg"; function getFilename($url) { $imgName = explode("/", $url); $imgName = $imgName[count($imgName) - 1]; echo $imgName; } There must be a faster way to do this right? Maybe a reg expression? But that's Chinese to me..

    Read the article

  • MSbuild task fails because "Any CPU" solution is built out of order

    - by Art Vandalay
    I have two solutions to build in Teambuild, one is the application itself, the other one is the WiX installer. I want to build the application using "Any CPU" build configuration and the installer using "x86". I've listed the "Any CPU" solution first in my project file, but Teambuild always builds the "x86" solution first. I'm setting BuildSolutionsInParallel = false, but it still builds the solutions in the reverse listed order. If I change the first solution to "Mixed Platform", it works fine. How can I get the solutions to build in the order listed in the project file? <Project ...> <PropertyGroup> <!-- We want to build the install solution after the build solution --> <BuildSolutionsInParallel>false</BuildSolutionsInParallel> </PropertyGroup> <ItemGroup> <SolutionToBuild Include="$(BuildProjectFolderPath)/Pricer/Pricer.sln"> <Targets></Targets> <Properties></Properties> </SolutionToBuild> <SolutionToBuild Include="$(BuildProjectFolderPath)/Pricer/Pricer.Install/Pricer.Install.sln"> <Targets></Targets> <Properties></Properties> </SolutionToBuild> </ItemGroup> <ItemGroup> <ConfigurationToBuild Include="Release|Any CPU"> <FlavorToBuild>Release</FlavorToBuild> <PlatformToBuild>Any CPU</PlatformToBuild> </ConfigurationToBuild> <ConfigurationToBuild Include="Release|x86"> <FlavorToBuild>Release</FlavorToBuild> <PlatformToBuild>x86</PlatformToBuild> </ConfigurationToBuild> </ItemGroup> </Project>

    Read the article

  • User/browser fingerprinting without cookies

    - by Art
    I'm sure that many of you have heard about this: http://panopticlick.eff.org/ It's a way to form a somewhat unique fingerprint of a web site visitor based on information about their browser, fonts, plugins, etc... Does anyone know of a library (python!?) to do this? I'd like to allow for visitors to vote on a poll without having to have an account...

    Read the article

  • binary search tree recursive subtree in java

    - by Art Peterson
    Can anyone point me to a code example (java preferably) or psuedocode that uses recursion to return a subtree that contains all nodes with keys between fromKey and toKey. So if I was to call Tree.subtree(5,10) it should return all nodes in the BST that have keys between 5 and 10 inclusive - but I can't use loops or helper methods...only recursive calls to the subtree method, which takes fromKey and toKey as parameters. Thanks!

    Read the article

  • Sending emails to site subscribers

    - by Art
    I have a site where people enter their email address to be reminded of a weekly posting. I only send them the weekly email that they double-opt-in for. I do not sell, trade, expose, or do anything else with their address. Right now I have a bit of a hack, connecting to a large email providers SMTP server to send the emails. As the site grows I fear that my emails will be marked as spam and that I will be violating the TOS of the provider. I'm considering two options, building an in-house SMTP server or using a mailing list service. Is there a best-known-method for this? I'd really prefer to simply build my email and use a script to send them through the SMTP server rather then use some GUI to build the email and import a list of addresses. But previous experience tells me that running a mail server and not being marked as spam can be difficult. Help!?

    Read the article

  • Database migrations for SQL Server

    - by Art
    I need a database migration framework for SQL Server, capable of managing both schema changes and data migrations. I guess I am looking for something similar to django's South framework here. Given the fact that South is tightly coupled with django's ORM, and the fact that there's so many ORMs for SQL Server I guess having just a generic migration framework, enabling you to write and execute in controlled and sequential manner SQL data/schema change scripts should be sufficient.

    Read the article

  • Database migrations for MS SQL Server

    - by Art
    I need a database migration framework for MS SQL Server, capable of managing both schema changes and data migrations. I guess I am looking for something similar to django's South framework here. given the fact that South is tightly coupled with django's ORM, and the fact that there's so many ORMs for MS SQL I guess having just a generic migration framework, enabling you to write and execute in controlled and sequential manner SQL data/schema change scripts should be sufficient. Thanks!

    Read the article

  • Maximum Year in Expry Date of Credit Card

    - by Art
    Various online services have different values for maximum year of expiry, when it comes to Credit Cards. For instance: Basecamp: +15 years (2025) Amazon: +20 years (2030) Paypal: +19 years (2029) What is the reasonable maximum here? Are there any official guidelines?

    Read the article

  • can't activate rack problem while install spree commerce

    - by art
    I install spree version 0.9.4 with gem install spree and run a set up command spree mystore and get this errors messages. Have anybody experienced this whether in spree or not ? D:\Workspaces>spree mystore C:/Program Files/BitNami RubyStack/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:280:i n `activate': can't activate rack (>= 1.0.1, runtime) for ["spree-0.9.4"], alrea dy activated rack-1.0.0 for ["actionpack-2.3.5", "rails-2.3.5", "spree-0.9.4"] ( Gem::LoadError) from C:/Program Files/BitNami RubyStack/ruby/lib/ruby/site_ruby/1.8/ruby gems.rb:296:in `activate' from C:/Program Files/BitNami RubyStack/ruby/lib/ruby/site_ruby/1.8/ruby gems.rb:295:in `each' from C:/Program Files/BitNami RubyStack/ruby/lib/ruby/site_ruby/1.8/ruby gems.rb:295:in `activate' from C:/Program Files/BitNami RubyStack/ruby/lib/ruby/site_ruby/1.8/ruby gems.rb:68:in `gem' from C:/Program Files/BitNami RubyStack/ruby/bin/spree:18 Thanks

    Read the article

  • URL redirect/remapping to a Django app, using DNS or Apache

    - by Art
    Typically I've been lucky enough to have a fairly simple Django and Apache configuration. But now I'm writing several apps that will sit on the same server and I need them to each have individual domains. The apps live at www.myserver.com/app/app1 (app2...) and I would like to access it using www.someawesomedomain.com. I don't want a redirect since I do not want to expose the underlying path. What is the best way to do this, in the context of 5 - 10 sites? I'm using Apache2.

    Read the article

  • data breakpoints in avr studio

    - by Art Spasky
    I want to set data breakpoint for TCNT1 register of ATMega16 in AVR Studio 4.17 Build 666. I add breakpoint by specifing in the Location field of "Add data breakpoint" window the value IO@0x2C. But breakpoint seems not work. Can some one help me how to setup a data breakpoint for an IO reginster?

    Read the article

  • Spring validation errors not displayed

    - by Art Vandelay
    I have the following situation. I have a validator to validate my command object and set the errors on a Errors object to be displayed in my form. The validator is invoked as expected and works okay, but the errors i set on the Errors objects are not displayed, when i am sent back to my form because of the validation errors. Validator: public void validate(Object obj, Errors err) { MyCommand myCommand = (MyCommand) obj; int index = 0; for (Field field : myCommand.getFields()) { if (field.isChecked()) { if ((field.getValue() == null) || (field.getValue().equals(""))) { err.rejectValue("fields[" + index + "].value", "errors.missing"); } } index++; } if (myCommand.getLimit() < 0) { err.rejectValue("limit", "errors.invalid"); } } Command: public class MyCommand { private List<Field> fields; private int limit; //getters and setters } public class Field { private boolean checked; private String name; private String value; //getters and setters } Form: <form:form id="myForm" method="POST" action="${url}" commandName="myCommand"> <c:forEach items="${myCommand.fields}" var="field" varStatus="status"> <form:checkbox path="fields[${status.index}].checked" value="${field.checked}" /> <c:out value="${field.name}" /> <form:input path="fields[${status.index}].value" /> <form:errors path="fields[${status.index}].value" cssClass="error" /></td> <form:hidden path="fields[${status.index}].name" /> </c:forEach> <fmt:message key="label.limit" /> <form:input path="limit" /> <form:errors path="limit" cssClass="error" /> </form:form> Controller: @RequestMapping(value = REQ_MAPPING, method = RequestMethod.POST) public String onSubmit(Model model, MyCommand myCommand, BindingResult result) { // validate myCommandValidator.validate(myCommand, result); if (result.hasErrors()) { model.addAttribute("myCommand", myCommand); return VIEW; } // form is okay, do stuff and redirect } Could it be that the paths i give in the validator and tag are not correct? The validator validates a command object containing a list of objects, so that's why i give a index on the list in the command object when registering an error message (for example: "fields["+index+"]".value). Or is it that the Errors object containing the errors is not available to my view? Any help is welcome and appreciated, it might give me a hint or point me in right direction.

    Read the article

  • Rails 3 - Nested layouts - LocalJumpError

    - by Art Shayderov
    Hi Nested layouts do not work in Rails 3. After I hit this I tried Rails Guides Example on a blank project (both ruby 1.9.1 and 1.8.7). LocalJumpError no block given on line <%= yield :stylesheets %. If you remove this line you will get the same error on the next yield statement. Could someone fix(patch) this? It's probably just a matter of calling block_given? in the right place. That would be great. Thanks Added on 4/3: Rails 3 beta 2 released. Problem fixed.

    Read the article

  • Why use semicolon?

    - by Art
    Are there any reasons, apart from subjective visual perception and cases where you have multiple statements on the same line, to use semicolon at the end of statements in Javascript?

    Read the article

  • How can I use htaccess to protect a subdirectory of codeigniter installation?

    - by Art Peterson
    I have codeigniter installed at the root directory, and would like to have a subdirectory called "test" password protected using htaccess. I keep getting a "404 page not found" no matter what I try. The directory structure is: /public_html /css /images /system (codeigniter directory) /test .htaccess .htaccess .htpasswd index.php The root .htaccess file looks like: RewriteEngine On RewriteBase / Options -Indexes # Removes trailing slashes RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ $1 [L,R=301] # Enforce www RewriteCond %{HTTP_HOST} !^(www) [NC] RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301] #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^(.*)test(.*) RewriteRule ^(.*)$ index.php?/$1 [L] The /test/.htaccess file: AuthUserFile /home/dir/.htpasswd AuthName "Protected Area" AuthType Basic <limit GET POST PUT> require user adminuser </limit> I'm not even getting the authentication prompt, just the codeigniter 404 page when I navigate to the url "http://www.mydomain.com/test/". Please advise!

    Read the article

  • Do I need to auto-login after account activation?

    - by Art
    This is the standard scenario: User registers on the site User receives an account activation email, clicks link to activate Web site notifies the user that account is activated Now there are at least two pathways: User is taken to the login screen and asked to enter login details User is automatically logged in and taken to a welcome/profile/etc page While there are obvious benefits in (1) as far as the user's experience is concerned, there could be drawbacks as well. Option (2) offers improved security at cost of UX. Which of the scenarios is preferable and why? Any serious flaws in any of them?

    Read the article

  • Forms bound to updateable ADO recordsets are not updateable when the source includes a JOIN

    - by Art
    I'm developing an application in Access 2007. It uses an .accdb front end connecting to an SQL Server 2005 backend. I use forms that are bound to ADO recordsets at runtime. For the sake of efficiency, the recordsets usually contain only one record, and are queried out on the server: Public Sub SetUpFormRecordset(cn As ADODB.Connection, rstIn As ADODB.Recordset, rstSource As String) Dim cmd As ADODB.Command Dim I As Long Set cmd = New ADODB.Command cn.Errors.Clear ' Recordsets based on command object Execute method are Read Only! With cmd Set .ActiveConnection = cn .CommandType = adCmdText .CommandText = rstSource End With With rstIn .CursorType = adOpenKeyset .LockType = adLockPessimistic 'Check the locktype after opening; optimistic locking is worthless on a bound End With ' form, and ADO might open optimistically without firing an error! rstIn.Open cmd, , adOpenKeyset, adLockPessimistic 'This should run the query on the server and return an updatable recordset With cn If .Errors.Count <> 0 Then For Each errADO In .Errors Call HandleADOErrors(.Errors(I)) I = I + 1 Next errADO End If End With End Sub rstSource (the string containg the TSQL on which the recordset is based) is assembled by the calling routine, in this case from the Open event of the form being bound: Private Sub Form_Open(Cancel As Integer) Dim rst As ADODB.Recordset Dim strSource As String, DefaultSource as String Dim lngID As Long lngID = Forms!MyParent.CurrentID strSource = "SELECT TOP (100) PERCENT dbo.Customers.CustomerID, dbo.Customers.LegacyID, dbo.Customers.Active, dbo.Customers.TypeID, dbo.Customers.Category, " & _ "dbo.Customers.Source, dbo.Customers.CustomerName, dbo.Customers.CustAddrID, dbo.Customers.Email, dbo.Customers.TaxExempt, dbo.Customers.SalesTaxCode, " & _ "dbo.Customers.SalesTax2Code, dbo.Customers.CreditLimit, dbo.Customers.CreationDate, dbo.Customers.FirstOrder, dbo.Customers.LastOrder, " & _ "dbo.Customers.nOrders, dbo.Customers.Concurrency, dbo.Customers.LegacyLN, dbo.Addresses.AddrType, dbo.Addresses.AddrLine1, dbo.Addresses.AddrLine2, " & _ "dbo.Addresses.City, dbo.Addresses.State, dbo.Addresses.Country, dbo.Addresses.PostalCode, dbo.Addresses.PhoneLandline, dbo.Addresses.Concurrency " & _ "FROM dbo.Customers INNER JOIN " & _ "dbo.Addresses ON dbo.Customers.CustAddrID = dbo.Addresses.AddrID " strSource = strSource & "WHERE dbo.Customers.CustomerID= " & lngID With Me 'Default is Set up for editing one record If Not Nz(.RecordSource, vbNullString) = vbNullString Then If .Dirty Then .Dirty = False 'Save any changes on the form .RecordSource = vbNullString End If If rst Is Nothing Then 'Might not be first time through DefaultSource = .RecordSource Else rst.Close Set rst = Nothing End If End With Set rst = New ADODB.Recordset Call setupformrecordset(dbconn, rst, strSource) 'dbconn is a global variable With Me Set .Recordset = rst End With End Sub The recordset that is returned from setupformrecordset is fully updateable, and its .Supports property shows this. It can be edited and updated in code. The entire form, however, is read only, even though it's .AllowEdits and .AllowAdditions properties are both true. Even the fields from the right hand side (the 'many' side) cannot be edited. Removing the INNER JOIN clause from the TSQL (restricting strSource to one table) makes the form fully editable. I've verified that the TSQL includes priimary key fields from both tables, and each table includes a timestamp field for concurrency. I tried changing the .CursorType and .CursorLocation properties of the recordset to no avail. What am I doing wrong?

    Read the article

  • Git - switching between branches in the middle of work

    - by Art
    For various reasons (code review mostly) I need to switch from current development branch to other branches quite often. Currently, I use either 'git stash' to shelve the uncommitted changes, checkout other branch, then switch back and do 'git stash apply' However, sometimes I'd have some newly added files there, which are not tracked. Unfortunately, stashing does not affect them. In this case I'd have to add them to the index and stash. What I am looking here for is a workflow where I'd have to perform a minimal set of actions to switch the branches, preferably avoiding adding of files into the index.

    Read the article

  • matlab: figure size, same axis size

    - by Art
    I have a figure with fixed size, like that: hFig = figure(1); set(hFig, 'Position', [200 200 500 500]) But the thing is, that I want to have my AXIS with fixed size (i want them to be a square), not (necessary) the whole figure... - see image attached, Y axis is a bit longer than X axis (of course longer in a meaning of display... X and Y axis range is set to the same value). How to adjust it? Thanks!

    Read the article

  • Using the "naked" attribute for functions in GCC

    - by Art Spasky
    GCC documentation (http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html) states in 6.29 Declaring Attributes of Functions "naked Use this attribute on the ARM, AVR, IP2K, RX and SPU ports to indicate that the specified function does not need prologue/epilogue sequences generated by the compiler. It is up to the programmer to provide these sequences. The only statements that can be safely included in naked functions are asm statements that do not have operands. All other statements, including declarations of local variables, if statements, and so forth, should be avoided. Naked functions should be used to implement the body of an assembly function, while allowing the compiler to construct the requisite function declaration for the assembler." Can I safely call functions using C syntax from naked functions, or only by using asm?

    Read the article

  • Check request type in Django

    - by Art
    While it is recommended to use the following construct to check whether request is POST, if request.method == 'POST': pass It is likely that people will find if request.POST: pass to be more elegant and concise. Are there any reasons not to use it, apart from personal preference?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >