Daily Archives

Articles indexed Wednesday April 28 2010

Page 8/119 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Unresolved external symbol error in c++

    - by Crystal
    I am trying to do a simple hw problem involving namespace, static data members and functions. I am getting an unresolved external symbol error Error 1 error LNK2001: unresolved external symbol "private: static double JWong::SavingsAccount::annualInterestRate" (?annualInterestRate@SavingsAccount@JWong@@0NA) SavingsAccount.obj SavingsAccount And I don't see why I am getting this error. Maybe I don't know something about static variables compared to regular data members that is causing this error. Here is my code: SavingsAccount.h file #ifndef JWONG_SAVINGSACCOUNT_H #define JWONG_SAVINGSACCOUNT_H namespace JWong { class SavingsAccount { public: // default constructor SavingsAccount(); // constructor SavingsAccount(double savingsBalance); double getSavingsBalance(); void setSavingsBalance(double savingsBalance); double calculateMonthlyInterest(); // static functions static void modifyInterestRate(double newInterestRate); static double getAnnualInterestRest(); private: double savingsBalance; // static members static double annualInterestRate; }; } #endif SavingsAccount.cpp file #include <iostream> #include "SavingsAccount.h" // default constructor, set savingsBalance to 0 JWong::SavingsAccount::SavingsAccount() : savingsBalance(0) {} // constructor JWong::SavingsAccount::SavingsAccount(double savingsBalance) : savingsBalance(savingsBalance) {} double JWong::SavingsAccount::getSavingsBalance() { return savingsBalance; } void JWong::SavingsAccount::setSavingsBalance(double savingsBalance) { this->savingsBalance = savingsBalance; } // returns monthly interest and sets savingsBalance to new amount double JWong::SavingsAccount::calculateMonthlyInterest() { double monthlyInterest = savingsBalance * SavingsAccount::annualInterestRate / 12; setSavingsBalance(savingsBalance + monthlyInterest); return monthlyInterest; } void JWong::SavingsAccount::modifyInterestRate(double newInterestRate) { SavingsAccount::annualInterestRate = newInterestRate; } double JWong::SavingsAccount::getAnnualInterestRest() { return SavingsAccount::annualInterestRate; }

    Read the article

  • How to scroll and zoom in/out large images on iPhone?

    - by Horace Ho
    I have a large image, size around 30000 (w) x 6000 (h) pixels. You may consider it's like a big map. I assume I need to crop it up into smaller tiles. Questions: what are the right ViewControllers to use? (link) what is the tile strategy? (I put this in another question, as it's not iPhone specific) Requirements: whole image (though cropped) can be scrolled up/down/left/right by swipes zoom in (up to pixel-to-pixel) out (down to screen-fit-by-height) by the 2-finger operation memory efficiency by lazy loading tiles Bonus requirements: automatic scroll, say from left to right slowly and smoothly Thanks!

    Read the article

  • How to tile a 30000 x 6000 image for a 480 x 320 screen?

    - by Horace Ho
    (this is related to another question about implementation on iPhone) I have a large image, size around 30000 (w) x 6000 (h) pixels. You may consider it's like a big map. I assume I need to crop it up into smaller tiles. Questions: what is the tile strategy? Requirements: whole image (though cropped) can be scrolled up/down/left/right by swipes zoom in (up to pixel-to-pixel) out (down to screen-fit-by-height) by the 2-finger operation memory efficiency by lazy loading tiles Thanks!

    Read the article

  • Should I Solve this with Multithreading in Ruby?

    - by viatropos
    I have a strange case, here's the sequence of actions: User edits a document and hits save Application sends GET request to service Service sends POST request back to application in the middle of responding to the GET request Application, in the same state as when it made the GET request, responds to the POST request (sends document data) to service. Service sends data back to Application (responding to original GET request) Application handles the rest... The use case is this: I was thinking how can I make Yahoo Pipes POST data? Specifically, I want it to be able to update Google Docs when a user makes a change locally (on a custom editor). So user edits doc, makes GET request to Yahoo Pipes, Pipes makes a POST request back to App to get the document (Pipes can only make this type of POST request), App sends doc, Pipes formats data according to the Google API, Pipes responds to GET request with Google API formatted XML, App makes the post request. Theoretically, how would I accomplish this? It seems that I need to create a separate ruby Process for the GET request, and when Pipes sends the POST request, I find that process and send its output, then I'm stuck. This would cut out the need for a database for this particular case (I could save the stuff temporarily in a database, but that doesn't seem right). Any ideas? This would make it so I don't have to format things to the Google API in ruby, I could leave that to Pipes.

    Read the article

  • How can I distinguish between overlapping segments of text using HTML?

    - by Siracuse
    Easy question, it is valid to have overlapping spans in html? Example: <span id="1">This is <span id="2"> some text </span> some other text </span> ^ ^ End1 End2 Edit: I see now that the spans closing tag would be ambiguous about which one it is closing, and that first </span> would close span id = 2, not 1 like I intended. My problem is, I have a block of text which I'm trying to highlight based on what the mouse hovers over. This block of text is composed of sections, some of which "overlap" eachother. I'm trying to use some jQuery and HTML to present this document so when I hover over the sections, the appropriate one will be highlighted. So, in my example above, the first span is meant to be ended with the first span close tag, and the second span is meant to be ended to with the second span close tag. This is because of the semantics of my document, these are two overlapping segments. I want it so when I hover to the left, it will only highlight up to span id = 1 and the first span close, if I hover between the two "overlapping" spans, it will highlight both of them, and if I hover to the right, it will highlight from span id=2 to the last span close. However, I'm starting to think this isn't possible. Is there any way I can distinguish segments of text in HTML that allows overlapping? So my jQuery script that highlights when I hover over different spans will highlight the correct portions. Should I alternate between div's and spans? Would that disambiguate what I'm closing then and allow me the do the proper highlighting with my jQuery hover script? I'm wondering about more than 2 segments overlapping now. Sigh, I wish I could just be explicate about what I'm closing.

    Read the article

  • dedicated template for a Drupal module

    - by ernie
    I have a Drupal module, that I want to present in a clean page - with no headers, menus, footer ect. I think all I need is a version of page.tpl.php that contains HTML page headers and <?php print $content ?> How can I point my module to such a page?

    Read the article

  • How do I reconnect to Memcache when forking in rails?

    - by Daniel Huckstep
    I have a rails 3 application, and a script called by rails runner. This script forks and does some stuff in other processes. I do the proper thing with ActiveRecord before forking, where I disconnect-fork-reconnect and all that jazz. My question is I also use memcache for the Rails.cache but should I be disconnecting-reconnecting that too for my forks? If so, how would I go about that in the rails way.

    Read the article

  • What is the best folder stucture in TFS for reporting service projects

    - by Dave
    Hi, I'm looking for some help on deciding a useful folder stucture strategy for reporting service projects in TFS. Does any one have some suggestions on which way I should stucture TFS? Should it be a project per report or should it be one Reporting project with multiple folders under the main that contain all the report projects? i.e. Senario 1 (separate projects for each report project) $ReportProject1 $ReportProject2 $ReportProject3 Senario 2 (Main report project in TFS and subfolders with report projects) $ReportingServices ------Src ---------Project1 -----------ReportProject1 files ---------Project2 -----------ReportProject2 files ---------Project3 -----------ReportProject3 files

    Read the article

  • Postfix configuration problem

    - by dhanya
    Can anyone help me by giving your postfix configuration file as a reference so that I can find my mistakes? I'm working on SUSE Linux Enterprise Server. My goal is to set up a mailserver in a campus network. Postfix shows it is running but no mail is sent to var/spool/mail I send mail using mail command at terminal. Here is my main.cf file, please help me finding a solution: readme_directory = /usr/share/doc/packages/postfix-doc/README_FILES inet_protocols = all biff = no mail_spool_directory = /var/mail canonical_maps = hash:/etc/postfix/canonical virtual_alias_maps = hash:/etc/postfix/virtual virtual_alias_domains = hash:/etc/postfix/virtual relocated_maps = hash:/etc/postfix/relocated transport_maps = hash:/etc/postfix/transport sender_canonical_maps = hash:/etc/postfix/sender_canonical masquerade_exceptions = root masquerade_classes = envelope_sender, header_sender, header_recipient myhostname = cmail.cetmail delay_warning_time = 1h message_strip_characters = \0 program_directory = /usr/lib/postfix inet_interfaces = all #inet_interfaces = 127.0.0.1 masquerade_domains = cetmail mydestination = cmail.cetmail, localhost.cetmail, cetmail defer_transports = mynetworks_style = subnet disable_dns_lookups = no relayhost = postfix mailbox_command = cyrus mailbox_transport = strict_8bitmime = no disable_mime_output_conversion = no smtpd_sender_restrictions = hash:/etc/postfix/access smtpd_client_restrictions = smtpd_helo_required = no smtpd_helo_restrictions = strict_rfc821_envelopes = no smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination smtp_sasl_auth_enable = no smtpd_sasl_auth_enable = no smtpd_use_tls = no smtp_use_tls = no alias_maps = hash:/etc/aliases mailbox_size_limit = 0 message_size_limit = 10240000

    Read the article

  • Memory over-release problem when I am animating UIView

    - by Sheehan Alam
    I have enabled NSZombie's and I am getting the following message in my console when I am running my application: *** -[UIViewAnimationState release]: message sent to deallocated instance 0xf96d7e0 Here is the method that is performing the animation -(void)loadAvatar:(STObject*)st { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; avatar.alpha = 0; avatar.frame = avatarRectSmall; avatar.image = [ImageCache getMemoryCachedImageAtUrl:st.avatar_url]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:.50]; avatar.frame = avatarRectNormal; [avatar setAlpha:1]; [UIView commitAnimations]; [pool release]; pool = nil; } I don't always get a crash, only sometimes. I'm wondering what is getting released?

    Read the article

  • Tortoise SVN does not give option to "Add to SVN"

    - by Clay Nichols
    I've created an SVN repository and added folders and added contents and Committed. No problem. But when go to add a new folder (the others were on the P:\ drive, now I want to add our website which is on the C:\ drive) but Tortoise doesn't give me the option of Adding a folder. I have no idea why. Help file shows the instructions I'd expect ("right click on the folder you want to add and choose +Add...") but Add... isn't in the menu. This is TortoiseSVN v 1.6.7.18415 (I'm about to update it but I was able to add folders before so I don't think this is just a bug, I think maybe I'm missing something obvious).

    Read the article

  • how to make a name from random numbers?

    - by blood
    my program makes a random name that could have a-z this code makes a 16 char name but :( my code wont make the name and idk why :( can anyone show me what's wrong with this? char name[16]; void make_random_name() { byte loop = -1; for(;;) { loop++; srand((unsigned)time(0)); int random_integer; random_integer = (rand()%10)+1; switch(random_integer) { case '1': name[loop] = 'A'; break; case '2': name[loop] = 'B'; break; case '3': name[loop] = 'C'; break; case '4': name[loop] = 'D'; break; case '5': name[loop] = 'E'; break; case '6': name[loop] = 'F'; break; case '7': name[loop] = 'G'; break; case '8': name[loop] = 'Z'; break; case '9': name[loop] = 'H'; break; } cout << name << "\n"; if(loop > 15) { break; } } }

    Read the article

  • Still confuse parse JSON in GWT

    - by graybow
    Please help meee. I create a project named 'tesdb3' in eclipse. I create the PHP side to access the database, and made the output as JSON.. I create the userdata.php in folder war. then I compile tesdb3 project. Folder tesdb3 and the userdata.php in war moved in local server(I use WAMP). I put the PHP in folder tesdb3. This is the result from my localhost/phpmyadmin/tesdb3/userdata.php [{"kode":"002","nama":"bambang gentolet"},{"kode":"012","nama":"Algiz"}] From that result I think the PHP side was working good.Then I create UserData.java as JSNI overlay like this: package com.tesdb3.client; import com.google.gwt.core.client.JavaScriptObject; class UserData extends JavaScriptObject{ protected UserData() {} public final native String getKode() /*-{ return this.kode; }-*/; public final native String getNama() /*-{ return this.nama; }-*/; public final String getFullData() { return getKode() + ":" + getNama(); } } Then Finally in the tesdb3.java: public class Tesdb3 implements EntryPoint { String url= "http://localhost/phpmyadmin/tesdb3/datauser.php"; private native JsArray<UserData> getuserdata(String json) /*-{ return eval(json); }-*/; public void LoadData() throws RequestException{ RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(url)); builder.sendRequest(null, new RequestCallback(){ @Override public void onError(Request request, Throwable exception) { Window.alert("error " + exception); } public void onResponseReceived(Request request, Response response) { Window.alert("betul" + response.getText()); //data(getuserdata(response.getText())); } }); } public void data(JsArray<UserData> data){ for (int i = 0; i < data.length(); i++) { String lkode =data.get(i).getKode(); String lname =data.get(i).getNama(); Label l = new Label(lkode+" "+lname); tb.setWidget(i, 0, l); } RootPanel.get().add(new HTML("my data")); RootPanel.get().add(tb); } public void onModuleLoad() { try { LoadData(); } catch (RequestException e) { } } } The result just showing string "my data". And the Window.alert(response.getText()) showing nothing. Whyy?

    Read the article

  • How to handle a webview dialog popup?

    - by brockoli
    I'm displaying a webpage in a WebView and on the webpage, there is a button. When you click the button, a confirmation dialog is supposed to popup, but it doesn't show in my WebView. It does popup if I go to the same webpage in the android browser. Anyone know how to handle popup dialogs coming from a webpage inside your WebView? brockoli

    Read the article

  • Help to the way to write a query for the requirement

    - by Lu Lu
    I need to write a SQL-Server query but I don't know how to solve. I have a table RealtimeData with data: Time | Value 4/29/2009 12:00:00 AM | 3672.0000 4/29/2009 12:01:00 AM | 3645.0000 4/29/2009 12:02:00 AM | 3677.0000 4/29/2009 12:03:00 AM | 3634.0000 4/29/2009 12:04:00 AM | 3676.0000 4/30/2009 12:00:00 AM | 3671.0000 4/30/2009 12:01:00 AM | 3643.0000 4/30/2009 12:02:00 AM | 3672.0000 4/30/2009 12:03:00 AM | 3634.0000 4/30/2009 12:04:00 AM | 3632.0000 4/30/2009 12:05:00 AM | 3672.0000 5/1/2009 12:00:00 AM | 3673.0000 5/1/2009 12:01:00 AM | 3642.0000 5/1/2009 12:02:00 AM | 3672.0000 5/1/2009 12:03:00 AM | 3634.0000 5/1/2009 12:04:00 AM | 3635.0000 I want to get the EOD's data of days which exist in table. (EOD = end of day). With the my sample's data, I will need to reture a table like following: Time | Value 4/29/2009 | 3676.0000 4/30/2009 | 3672.0000 5/1/2009 | 3635.0000 Please help me to solve my problem. Thanks.

    Read the article

  • How do I display a Wicket Datatable, sorted by a specific column by default?

    - by David
    Hello everyone! I have a question regarding Wicket's Datatable. I am currently using DataTable to display a few columns of data. My table is set up as follows: DataTable<Column> dataTable = new DataTable<Column>("columnsTable", columns, provider, maxRowsPerPage) { @Override protected Item<Column> newRowItem(String id, int index, IModel<Column> model) { return new OddEvenItem<Column>(id, index, model); } }; The columns look like so: columns[0] = new PropertyColumn<Column>(new Model<String>("Description"), "description", "description"); columns[1] = new PropertyColumn<Column>(new Model<String>("Logic"), "columnLogic"); columns[2] = new PropertyColumn<Column>(new Model<String>("Type"), "dataType", "dataType"); Here is my column data provider: public class ColumnSortableDataProvider extends SortableDataProvider<Column> { private static final long serialVersionUID = 1L; private List<Column> list = null; public ColumnSortableDataProvider(Table table) { this.list = Arrays.asList(table.getColumns().toArray(new Column[0])); } public ColumnSortableDataProvider(List<Column> list) { this.list = list; } @Override public Iterator<? extends Column> iterator(int first, int count) { /* first - first row of data count - minimum number of elements to retrieve So this method returns an iterator capable of iterating over {first, first+count} items */ Iterator<Column> iterator = null; try { if(getSort() != null) { Collections.sort(list, new Comparator<Column>() { private static final long serialVersionUID = 1L; @Override public int compare(Column c1, Column c2) { int result=1; PropertyModel<Comparable> model1= new PropertyModel<Comparable>(c1, getSort().getProperty()); PropertyModel<Comparable> model2= new PropertyModel<Comparable>(c2, getSort().getProperty()); if(model1.getObject() == null && model2.getObject() == null) result = 0; else if(model1.getObject() == null) result = 1; else if(model2.getObject() == null) result = -1; else result = ((Comparable)model1.getObject()).compareTo(model2.getObject()); result = getSort().isAscending() ? result : -result; return result; } }); } if (list.size() > (first+count)) iterator = list.subList(first, first+count).iterator(); else iterator = list.iterator(); } catch (Exception e) { e.printStackTrace(); } return iterator; } Sorting by clicking a column works perfectly, but I would like the table to initially be sorted, by default, by the Description column. I am at a loss to do this. If you need to see some other code, please let me know. Thank you in advance!!! - D

    Read the article

  • Release another user's lock obtained with sp_getapplock on SQL Server

    - by joshperry
    We have a system that uses sp_getapplock to create an exclusive mutex any time someone opens an order in the GUI. This is used to prevent multiple people from making changes to an order simultaneously. Sometimes people will open an order and go home, leaving it open. This effectively blocks anyone from being able to make changes to the order. I then get emails, calls and end up doing a kill <spid> in enterprise manager. Obviously I've gotten sick of this and want to make a quick self-service webform. The main problem I've run into is that kill requires sysadmin privileges, which I do not want to give to the user that the our website runs as. I have tried sp_releaseapplock but this doesn't let you release another user's lock (even when calling it as a sysadmin). So, finally my question; does anyone know of an alternative method to release a lock that was obtained by another user using sp_getapplock?

    Read the article

  • Getting 'error while loading shared libraries' when using -L to specifically find the library.

    - by e5
    I've been trying to solve this for a few hours now. I am compiling some c files using gcc. The files require libpbc, so I am using the -L flag to point gcc at the directory which contains libpbc.so.1. The code compiles without error yet when I attempt to run it I get the following error message: ./example.out: error while loading shared libraries: libpbc.so.1: cannot open shared object file: No such file or directory Looking at similar questions this error message seems to indicate that gcc can't find libpbc.so.1. I know gcc sees libpbc.so.1 because when I rename libpbc.so.1 to something else it fails to compile. I am using -L to point to the directory which contains libpbc.so.1. Not sure what next steps I can take to figure this out. Would appreciate any ideas. What does this error message mean exactly?

    Read the article

  • CSS Hover on parent list Item only

    - by Daniel O'Connor
    Hey Everyone, So I have some nested lists (only one level deep) and I'm running into trouble with the CSS :hover feature. I only want the hover to apply to the parent class, but I can't figure that one out. Here's my CSS <style type="text/css" media="screen"> .listblock li img { visibility: hidden; } .listblock li:hover img { visibility: visible; } </style> And here is a sample of one of the lists. <ul> <li>One <a href="#"><img src="img/basket.png" height="16" width="16" alt="Buy" class="buy" onClick="pageTracker._trackEvent('Outbound Links', 'Amazon');"/></a></li> <li>Two <a href="#"><img src="img/basket.png" height="16" width="16" class="buy" /></a> <ul> <li>Uno<a href="#"><img src="img/basket.png" height="16" width="16" class="buy" /></a></li> <li>Dos <a href="#"><img src="img/basket.png" height="16" width="16" class="buy" /></a></li> </ul> </li> <li>Three <a href="#"><img src="img/basket.png" height="16" width="16" alt="Buy" class="buy" onClick="pageTracker._trackEvent('Outbound Links', 'Amazon');"/></a></li> </ul> The problem is that the image in the Uno and Dos list items also hovers. :( Help please! Thanks a lot

    Read the article

  • Using Scala structural types with abstract types

    - by Joshua Hartman
    I'm trying to define a structural type defining anything that has an "add" method (for instance, a java collection or a java map). Using this, I want to define a few higher order functions that operate on a certain collection object GenericTypes { type GenericCollection[T] = { def add(value: T): java.lang.Boolean} } import GenericTypes._ trait HigherOrderFunctions[T, CollectionType[X] <: GenericCollection[X]] { def map[V](fn: (T) => V): CollectionType[V] .... } class RichJList[T](list: List[T]) extends HigherOrderFunctions[T, java.util.List] This does not compile with the following error error: Parameter type in structural refinement may not refer to abstract type defined outside that same refinement I tried removing the parameter on GenericCollection and putting it on the method: object GenericTypes { type GenericCollection = { def add[T](value: T): java.lang.Boolean} } import GenericTypes._ trait HigherOrderFunctions[T, CollectionType[X] <: GenericCollection] class RichJList[T](list: List[T]) extends HigherOrderFunctions[T, java.util.List] but I get another error: error: type arguments [T,java.util.List] do not conform to trait HigherOrderFunctions's type parameter bounds [T,CollectionType[X] <: org.scala_tools.javautils.j2s.GenericTypes.GenericCollection] Can anyone give me some advice on how to use structural typing with abstract typed parameters in Scala? Or how to achieve what I'm looking to accomplish? Thanks so much!

    Read the article

  • Changing an image's ALT value with jQuery

    - by NightMICU
    Hi all, I have a modal form that changes the caption of a photo (paragraph under the image) and I am also trying to change the image's ALT attribute but cannot seem to. Here is the jQuery I am trying to make work $(".edit").click(function() { var parent = $(this).parents('.item'); var caption = $(parent).find('.labelCaption').html(); $("#photoCaption").val(caption); $("#editCaptionDialog").dialog({ width: 450, bgiframe: true, resizable: false, modal: true, title: 'Edit Caption', overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { 'Edit': function() { var newCaption = $("#photoCaption").val(); $(parent).find(".labelCaption").html(newCaption); $(parent).find('img').attr('alt', newCaption); } } }); return false; }); And the HTML <li class="item ui-corner-all" id="photo<? echo $images['id'];?>"> <div> <a href="http://tapp-essexvfd.org/gallery/photos/<?php echo $images['filename'];?>.jpg" class="lightbox" title="<?php echo $images['caption'];?>"> <img src="http://tapp-essexvfd.org/gallery/photos/thumbs/<?php echo $images['filename'];?>.jpg" alt="<?php echo $images['caption'];?>" class="photo ui-corner-all"/></a><br/> <p><span class="labelCaption"><?php echo $images['caption'];?> </span></p> <p><a href="edit_photo.php?filename=<?php echo $images['filename'];?>" class="button2 edit ui-state-default ui-corner-all">Edit</a></p> </div> </li> The caption is changing like it should. Thanks

    Read the article

  • Android - Help with ANR and traces.txt

    - by Tori
    My app crashes with an ANR while scrolling in a spinner. I implemented many spinners in different apps and this is the first time i get this ANR. I would appreciate any help in deciphering the traces.txt DALVIK THREADS: "main" prio=5 tid=3 NATIVE | group="main" sCount=1 dsCount=0 s=0 obj=0x40018e70 | sysTid=896 nice=0 sched=0/0 handle=-1097417572 at android.os.BinderProxy.transact(Native Method) at android.app.ActivityManagerProxy.handleApplicationError(ActivityManagerNative.java:2103) at com.android.internal.os.RuntimeInit.crash(RuntimeInit.java:302) at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:75) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:887) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:884) at dalvik.system.NativeStart.main(Native Method)

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >