Daily Archives

Articles indexed Thursday March 18 2010

Page 12/133 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Storing Icons and Sql with PHP

    - by Ole Jak
    So I have a simple Apache with MySql I am developing a PHP app. I have Users Table in my DB. I vant to let them store Icons. My question Is what's the best way of attaching such data as icons (100-250kb's) to DB - Is it beter to store them Inside DB or store them as File and some how attaching links to icons into DB. What's the best way? Are there any classes that automate this process (of attaching such data to DB)?

    Read the article

  • "Unable to associated Elastic IP with cluster" in Eclipse Plugin Tutorial

    - by Jeffrey Chee
    Hi all, I am currently trying to evaluate AWS for my company and was trying to follow the tutorials on the web. http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2241 However I get the below error during startup of the server instance: Unable to associated Elastic IP with cluster: Unable to detect that the Elastic IP was orrectly associated. java.lang.Exception: Unable to detect that the Elastic IP was correctly associated at com.amazonaws.ec2.cluster.Cluster.associateElasticIp(Cluster.java:802) at com.amazonaws.ec2.cluster.Cluster.start(Cluster.java:311) at com.amazonaws.eclipse.wtp.ElasticClusterBehavior.launch(ElasticClusterBehavior.java:611) at com.amazonaws.eclipse.wtp.Ec2LaunchConfigurationDelegate.launch(Ec2LaunchConfigurationDelegate.java:47) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:696) at org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3051) at org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3001) at org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:300) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Then after a while, another error occur: Unable to publish server configuration files: Unable to copy remote file after trying 4 timeslocal file: 'XXXXXXXX/XXX.zip' Results from first attempt: Unexpected exception: java.net.ConnectException: Connection timed out: connect root cause: java.net.ConnectException: Connection timed out: connect at com.amazonaws.eclipse.ec2.RemoteCommandUtils.copyRemoteFile(RemoteCommandUtils.java:128) at com.amazonaws.eclipse.wtp.tomcat.Ec2TomcatServer.publishServerConfiguration(Ec2TomcatServer.java:172) at com.amazonaws.ec2.cluster.Cluster.publishServerConfiguration(Cluster.java:369) at com.amazonaws.eclipse.wtp.ElasticClusterBehavior.publishServer(ElasticClusterBehavior.java:538) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:866) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:708) at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2731) at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:278) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Can anyone point me to what I'm doing wrong? I followed the tutorials and the video tutorials on youtube exactly. Best Regards ~Jeffrey

    Read the article

  • org-mode schedule weekly event for a period.

    - by Hamza Yerlikaya
    I would like to use agenda to keep track of my classes, assuming i have a com 355 class every week from march to june, <2010-03-23 Tue 10:40-12:10 +1w> this works but it schedules it indefinitely if i use, <2010-03-23 Tue 10:40-12:10 +1w>-<2010-06-23> it gets scheduled for everyday from march to june, how can i schedule this once a week for a period of time?

    Read the article

  • Rails: Create method available in all views and all models

    - by smotchkkiss
    I'd like to define a method that is available in both my views and my models Say I have a view helper: def foo(s) "hello #{s}" end A view might use the helper like this: <div class="data"><%= foo(@user.name) %></div> However, this <div> will be updated with a repeating ajax call. I'm using a to_json call in a controller returns data like so: render :text => @item.to_json(:only => [...], :methods => [:foo]) This means, that I have to have foo defined in my Item model as well: class Item def foo "hello #{name}" end end It'd be nice if I could have a DRY method that could be shared in both my views and my models. Usage might look like this: Helper def say_hello(s) "hello #{s}" end User.rb model def foo say_hello(name) end Item.rb model def foo say_hello(label) end View <div class="data"><%= item.foo %></div> Controller def observe @items = item.find(...) render :text => @items.to_json(:only=>[...], :methods=>[:foo]) end IF I'M DUMB, please let me know. I don't know the best way to handle this, but I don't want to completely go against best-practices here. If you can think of a better way, I'm eager to learn!

    Read the article

  • Keep Side Navigation Fixed with Scrolling of page

    - by Stuart Robson
    Hi Guys, I have a clients website - www.stagecraft.co.uk and they want the navigation on the hire pages (longer page) to still be there at when you scroll the page down. I've had a quick go (not live) with position fixed but in doing so it the leftside navigation is about 200px or so from the top of the window. Any when to get it at the top of the window when scrolling? Thanks in advance....

    Read the article

  • VBA Word 2003 Dialog box

    - by user171476
    Hi, Our client enironment recently migrated from word 2000 to 2003, we use the below code in one of the templates to show the word's default insert file dialog box. Word is integrated with another third party application Hummingbird docspen. With Dialogs(wdDialogInsertFile) .Name = "q:*.*" .Show End With In old environment it opens up the default insertfile dialog box pointing to my documents folder, where as in word 2003, it opens up the Docsopen insertfile dialog box. I have compared the settings of word 2000 and 2003 it seems to be same. Any suggestions on this please.

    Read the article

  • Access to variables in an asp.net user control vs an include file

    - by user204588
    I've asked this question before but couldn't get the answer I was looking for so I'm going to try it again. I'm translating pages from old asp to asp.net and I don't want to do this any other way so I really just want to know if this can be done. In asp, I'd assign a variable on one page <% myVar = "something" %> I could assign many variables here and then use an include <!--#include file="Test2.aspx"--> then in test2 file, I could access all the variables without having to pass all the variables into the control or declaring them again, like <% myVar = "something else" %> I want to do this the dot net way but I have some thirty variables on the page and i don't want to pass a bunch into the user control and I don't want to have to keep declaring the same variables. All I really want to know is if there is some way to replicate the behavior above in asp.net?

    Read the article

  • Problem retrieving values from Zend_Form_SubForms - no values returned

    - by anu iyer
    I have a Zend_Form that has 4 or more subforms. /** Code Snippet **/ $bigForm = new Zend_Form(); $littleForm1 = new Form_LittleForm1(); $littleForm1->setMethod('post'); $littleForm2 = new Form_LittleForm2(); $littleForm2->setMethod('post'); $bigForm->addSubForm($littleForm1,'littleForm1',0); $bigForm->addSubForm($littleForm2,'littleForm2',0); On clicking the 'submit' button, I'm trying to print out the values entered into the forms, like so: /** Code snippet, currently not validating, just printing **/ if($this-_request-getPost()){ $formData = array(); foreach($bigForm->getSubForms() as $subForm){ $formData = array_merge($formData, $subForm->getValues()); } /* Testing */ echo "<pre>"; print_r($formData); echo "</pre>"; } The end result is that - all the elements in the form do get printed, but the values entered before posting the form don't get printed. Any thoughts are appreciated...I have run around circles working on this! Thanks in advance!

    Read the article

  • Is Annotation in Javascript? If not, how to switch between debug/productive modes in declarative way

    - by Michael Mao
    Hi all: This is but a curious question. I cannot find any useful links from Google so it might be better to ask the gurus here. The point is: is there a way to make "annotation" in javascript source code so that all code snippets for testing purpose can be 'filtered out' when project is deployed from test field into the real environment? I know in Java, C# or some other languages, you can assign an annotation just above the function name, such as : // it is good to remove the annoying warning messages @SuppressWarnings("unchecked") public class Tester extends TestingPackage { ... } Basically I've got a lot of testing code that prints out something into FireBug console. I don't wanna manually "comment out" them because the guy that is going to maintain the code might not be aware of all the testing functions, so he/she might just miss one function and the whole thing can be brought down to its knees. One other thing, we might use a minimizer to "shrink" the source code into "human unreadable" code and boost up performance (just like jQuery.min), so trying to match testing section out of the mess is not possible for plain human eyes in the future. Any suggestion is much appreciated.

    Read the article

  • Nested Functions in C - Best Practices

    - by Justin Ethier
    I just realized a function may be defined inside another function in C: void main(){ int foo(){ return 2; }; printf("%d\n", foo()); } Besides being a neat trick, the useful thing about this is that the inner function is private to the outer function. But... is that a good enough reason to do this in a "real-world" application? What are the best practices for using this syntax?

    Read the article

  • sqlite - any improvements for this attach code (running multiple sql commands transactionally in sql

    - by Greg
    Hi, Is this code solid? I've tried to use "using" etc. Basically a method to pass as sequenced list of SQL commands to be run against a Sqlite database. I assume it is true that in sqlite by default all commands run in a single connection are handled transactionally? Is this true? i.e. I should not have to (and haven't got in the code at the moment) a BeginTransaction, or CommitTransaction. It's using http://sqlite.phxsoftware.com/ as the sqlite ADO.net database provider. private int ExecuteNonQueryTransactionally(List<string> sqlList) { int totalRowsUpdated = 0; using (var conn = new SQLiteConnection(_connectionString)) { // Open connection (one connection so should be transactional - confirm) conn.Open(); // Apply each SQL statement passed in to sqlList foreach (string s in sqlList) { using (var cmd = new SQLiteCommand(conn)) { cmd.CommandText = s; totalRowsUpdated = totalRowsUpdated + cmd.ExecuteNonQuery(); } } } return totalRowsUpdated; }

    Read the article

  • URL rewriting with mod_rewrite

    - by Steven
    The web server is Apache. I want to rewrite URL so a user won't know the actual directory. For example: The original URL: www.mydomainname.com/en/piecework/piecework.php?piecework_id=11 Expected URL: piecework.mydomainname.com/en/11 I added the following statements in .htaccess: RewriteCond %{HTTP_HOST} ^(?!www)([^.]+)\.mydomainname\.com$ [NC] RewriteRule ^(w+)/(\d+)$ /$1/%1/%1.php?%1_id=$2 [L] Of course I replaced mydomainname with my domain name. .htaccess is placed in the site root, but when I access piecework.mydomainname.com/en/11, I got "Object not found".(Of course I replaced mydomainname with my domain name.) I added the following statements in .htaccess: RewriteRule ^/(.*)/en/piecework/(.*)piecework_id=([0-9]+)(.*) piecework.mydomainname.com/en/$3 Of course I replaced mydomainname with my domain name. .htaccess is placed in the site root, but when I access piecework.mydomainname.com/en/11, I got "Object not found".(Of course I replaced mydomainname with my domain name.) What's wrong?

    Read the article

  • sqlite3_prepare_v2 throws SQLITE_ERROR in iPhone code

    - by incognitii
    I have a piece of code that used to work, and other iterations of it that DO work within the same app, and have compared code, and they are identical in structure. This is driving me INSANE!!!!!! In this instance, sqlite3_prepare_v2 is throwing one of those useless SQLITE_ERROR exceptions. Apparently, it can FIND the database, and OPEN the database, but it can't prepare a statement for it. Does ANYONE have any ideas? I'm desperate here. second_maindatabaseName = @"database.db"; NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDir = [documentPaths objectAtIndex:0]; second_maindatabasePath = [documentsDir stringByAppendingPathComponent:second_maindatabaseName]; // Setup the database object sqlite3 *database; // Init the entry requirements Array BOOL success; NSFileManager *fileManager = [NSFileManager defaultManager]; success = [fileManager fileExistsAtPath:second_maindatabasePath]; if(!success) { NSString *databasePathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:second_maindatabaseName]; [fileManager copyItemAtPath:databasePathFromApp toPath:second_maindatabasePath error:nil]; [fileManager release]; } if(sqlite3_open([second_maindatabasePath UTF8String], &database) == SQLITE_OK) { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; value1 = [defaults stringForKey:kConst1]; value2 = [defaults stringForKey:kConst2]; value3 = [defaults stringForKey:kConst3]; value4 = [defaults stringForKey:kConst4]; const char *sqlStatement = "SELECT * FROM myTable WHERE Field1 = ? AND Field2 = ? AND Field3 = ? AND Field4 = ?"; sqlite3_stmt *compiledStatement; int error_code = sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL); if(error_code == SQLITE_OK) { // Loop through the results and add them to the feeds array sqlite3_bind_text(compiledStatement,1,[value1 UTF8String],-1,SQLITE_TRANSIENT); sqlite3_bind_text(compiledStatement,2,[value2 UTF8String],-1,SQLITE_TRANSIENT); sqlite3_bind_text(compiledStatement,3,[value3 UTF8String],-1,SQLITE_TRANSIENT); sqlite3_bind_text(compiledStatement,4,[value4 UTF8String],-1,SQLITE_TRANSIENT); while(sqlite3_step(compiledStatement) == SQLITE_ROW) { // Read the data from the result row NSString *aNewValue = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)]; } } sqlite3_finalize(compiledStatement); } sqlite3_close(database);

    Read the article

  • I thought this parsing would be simple...

    - by Rebol Tutorial
    ... and I'm hitting the wall, I don't understand why this doesn't work (I need to be able to parse either the single tag version (terminated with /) or the 2 tag versions (terminated with ) ): Rebol[] content: {<pre:myTag attr1="helloworld" attr2="hello"/> <pre:myTag attr1="helloworld" attr2="hello"> </pre:myTag> <pre:myTag attr3="helloworld" attr4="hello"/> } spacer: charset reduce [#" " newline] letter: charset reduce ["ABCDEFGHIJKLMNOPQRSTUabcdefghijklmnopqrstuvwxyz1234567890="] rule: [ any [ {<pre:myTag} any [any letter {"} any letter {"}] mark: (print {clipboard... after any letter {"} any letter {"}} write clipboard:// mark input) any spacer mark: (print "clipboard..." write clipboard:// mark input) ["/>" | ">" any spacer </pre:myTag> ] any spacer (insert mark { Visible="false"}) ] to end ] parse content rule write clipboard:// content print "The end" input

    Read the article

  • How much customization can you do with djangoforms.ModelForm?

    - by Randell
    I've just started playing with The Django Form Validation Framework on Google App Engine (from google.appengine.ext.db import djangoforms) and I got stuck googling how to customize forms using it. I was wondering whether the following are possible using the package: Add help texts beside/below input/select fields and textareas (e.g. "This field is required", "Example: qwerty123") Add/modify attributes for the input/select fields and textareas (e.g. adding the following attributes: class, id, name, maxlength, minlength, etc.) Add custom validations like checking whether a particular field should be unique or checking a value against a regular expression Modify the error messages Add another column to the table generated by the form Also note that djangoforms.ModelForm is different from django.forms.Form.

    Read the article

  • backup exec - backup to disk offline

    - by Adam
    Hi We are running backup exec 9.1 doing a backup to disk to portable hard disk drives. When we run the backup manually it works fine. But when the backup is setup to run in the evening on a schedule it does not run as the backup to disk folders goes offline and therefore has to be switched back on line. After we have done this the backup runs and completes fine. Any ideas? We have tried leaving the progam open and this makes no difference. Server is Windows 2003 SBS

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >