Daily Archives

Articles indexed Thursday December 30 2010

Page 10/34 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to make this sub-sub-query work?

    - by Josh Weissbock
    I am trying to do this in one query. I asked a similar question a few days ago but my personal requirements have changed. I have a game type website where users can attend "classes". There are three tables in my DB. I am using MySQL. I have four tables: hl_classes (int id, int professor, varchar class, text description) hl_classes_lessons (int id, int class_id, varchar lessonTitle, varchar lexiconLink, text lessonData) hl_classes_answers (int id, int lesson_id, int student, text submit_answer, int percent) hl_classes stores all of the classes on the website. The lessons are the individual lessons for each class. A class can have infinite lessons. Each lesson is available in a specific term. hl_classes_terms stores a list of all the terms and the current term has the field active = '1'. When a user submits their answers to a lesson it is stored in hl_classes_answers. A user can only answer each lesson once. Lessons have to be answered sequentially. All users attend all "classes". What I am trying to do is grab the next lesson for each user to do in each class. When the users start they are in term 1. When they complete all 10 lessons in each class they move on to term 2. When they finish lesson 20 for each class they move on to term 3. Let's say we know the term the user is in by the PHP variable $term. So this is my query I am currently trying to massage out but it doesn't work. Specifically because of the hC.id is unknown in the WHERE clause SELECT hC.id, hC.class, (SELECT MIN(output.id) as nextLessonID FROM ( SELECT id, class_id FROM hl_classes_lessons hL WHERE hL.class_id = hC.id ORDER BY hL.id LIMIT $term,10 ) as output WHERE output.id NOT IN (SELECT lesson_id FROM hl_classes_answers WHERE student = $USER_ID)) as nextLessonID FROM hl_classes hC My logic behind this query is first to For each class; select all of the lessons in the term the current user is in. From this sort out the lessons the user has already done and grab the MINIMUM id of the lessons yet to be done. This will be the lesson the user has to do. I hope I have made my question clear enough.

    Read the article

  • Installing sqlite on windows xp for ruby on rails?

    - by bennybdbc
    I've been trying to follow this guide to installing ruby and rails on my new machine. I'm having problems, however, when it comes to the sqlite gem. I installed the gem, which seemed to work perfectly. Then, however, it tells me to download a zip file from http://www.sqlite.org/sqlitedll-3_7_3.zip. When I do, the file is downloaded, but it doesn't seem to be a zip file. It has the icon of a microsoft word file, and clicking on it opens up Word but the file isn't opened, it just shows error messages. There is no option to extract the file, which is what the guide says to do. Is this a problem with sqlite or my machine? Any help would be appreciated.

    Read the article

  • Drupal Ubercart: error in passing values back to the Content Type after checkout

    - by user512826
    I am trying to set up event registration in a drupal site using Ubercart + the UC Node Checkout Module. I have followed the instructions provided in http://drupaleasy.com/blogs/ultimike/2009/03/event-registration-ubercart. However I seem to be unable to pass the Order ID and Payment Status back to the node. I have created a conditional action that on node checkout executes the following PHP code: I am using the following code to update the node on checkout - but nothing happens: if (isset($order)) { foreach ($order->products as $product) { if (isset($product->data['node_checkout_nid'])) { $node = node_load($product->data['node_checkout_nid']); $node->field_status['0']['value'] = 1; $node->field_orderid['0']['value'] = $order->order_id; node_save($node); } } } I know the conditional action is working because it prints dsm('hello world') messages on node checkout - however when I include a dsm($node) or dsm($product) in the PHP code, they return blank. Also when I go back to my product and click the 'Devel' tab, the 'data' string contains the following characters: a:1:{s:13:"form_build_id";s:37:"form-3ccc03345f4832c69666a89c560de940";} In this link http://www.ubercart.org/forum/support/10951/node_checkout_issue I found someone else with the same issue, but I have been unable to replicate his solution. Can anybody please help? Thanks so much!

    Read the article

  • iPhone crash on CoreData save

    - by davetron5000
    This is a different situation than this question, as the solution provided doesn't work and the stack is different. Periodical crash when I save data using coredata. The stack trace isn't 100% clear on where this is happening, but I'm certain it's this routine that's being called. It's either the save: in this method or the one following. Code: -(void)saveWine { if ([self validInfo]) { Wine *wine = (Wine *)wineToEdit; if (wine == nil) { wine = (Wine *)[NSEntityDescription insertNewObjectForEntityForName:@"Wine" inManagedObjectContext:self.managedObjectContext]; } wine.uuid = [Utils createUUID]; wine.name = self.wineNameField.text; wine.vineyard = self.vineyardField.text; wine.vintage = [[self numberFormatter] numberFromString:self.vintageField.text]; wine.timeStamp = [NSDate date]; wine.rating = [NSNumber numberWithInt:self.ratingControl.selectedSegmentIndex]; wine.partnerRating = [NSNumber numberWithInt:self.partnerRatingControl.selectedSegmentIndex]; wine.varietal = self.currentVarietal; wine.tastingNotes = self.currentTastingNotes; wine.dateTasted = self.currentDateTasted; wine.tastingLocation = [[ReferenceDataAccessor defaultReferenceDataAccessor] addEntityForType:TASTING_LOCATION withName:self.currentWhereTasted]; id type = [[ReferenceDataAccessor defaultReferenceDataAccessor] entityForType:WINE_TYPE withOrdinal:self.typeControl.selectedSegmentIndex]; wine.type = type; NSError *error; NSLog(@"Saving %@",wine); if (![self.managedObjectContext save:&error]) { [Utils showAlertMessage:@"There was a problem saving your wine; try restarting the app" withTitle:@"Problem saving"]; NSLog(@"Error while saving new wine %@, %@", error, [error userInfo]); } } else { NSLog(@"ERROR - someone is calling saveWine with invalid info!!"); } } Code for addEntityForType:withName:: -(id)addEntityForType:(NSString *)type withName:(NSString *)name { if ([Utils isStringBlank:name]) { return nil; } id existing = [[ReferenceDataAccessor defaultReferenceDataAccessor] entityForType:type withName:name]; if (existing != nil) { NSLog(@"%@ with name %@ already exists",type,name); return existing; } NSManagedObject *newEntity = [NSEntityDescription insertNewObjectForEntityForName:type inManagedObjectContext:self.managedObjectContext]; [newEntity setValue:name forKey:@"name"]; NSError *error; if (![self.managedObjectContext save:&error]) { [Utils showAlertMessage:[NSString stringWithFormat:@"There was a problem saving a %@",type] withTitle:@"Database Probem"]; [Utils logErrorFully:error forOperation:[NSString stringWithFormat:@"saving new %@",type ]]; } return newEntity; } Stack trace: Thread 0 Crashed: 0 libSystem.B.dylib 0x311de2d4 __kill + 8 1 libSystem.B.dylib 0x311de2c4 kill + 4 2 libSystem.B.dylib 0x311de2b6 raise + 10 3 libSystem.B.dylib 0x311f2d72 abort + 50 4 libstdc++.6.dylib 0x301dea20 __gnu_cxx::__verbose_terminate_handler() + 376 5 libobjc.A.dylib 0x319a2594 _objc_terminate + 104 6 libstdc++.6.dylib 0x301dcdf2 __cxxabiv1::__terminate(void (*)()) + 46 7 libstdc++.6.dylib 0x301dce46 std::terminate() + 10 8 libstdc++.6.dylib 0x301dcf16 __cxa_throw + 78 9 libobjc.A.dylib 0x319a14c4 objc_exception_throw + 64 10 CoreData 0x3526e83e -[NSManagedObjectContext save:] + 1098 11 Wine Brain 0x0000651e 0x1000 + 21790 12 Wine Brain 0x0000525c 0x1000 + 16988 13 Wine Brain 0x00004894 0x1000 + 14484 14 Wine Brain 0x00008716 0x1000 + 30486 15 CoreFoundation 0x31477fe6 -[NSObject(NSObject) performSelector:withObject:withObject:] + 18 16 UIKit 0x338c14a6 -[UIApplication sendAction:to:from:forEvent:] + 78 17 UIKit 0x3395c7ae -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86 18 CoreFoundation 0x31477fe6 -[NSObject(NSObject) performSelector:withObject:withObject:] + 18 19 UIKit 0x338c14a6 -[UIApplication sendAction:to:from:forEvent:] + 78 20 UIKit 0x338c1446 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26 21 UIKit 0x338c1418 -[UIControl sendAction:to:forEvent:] + 32 22 UIKit 0x338c116a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 350 23 UIKit 0x338c19c8 -[UIControl touchesEnded:withEvent:] + 336 24 UIKit 0x338b734e -[UIWindow _sendTouchesForEvent:] + 362 25 UIKit 0x338b6cc8 -[UIWindow sendEvent:] + 256 26 UIKit 0x338a1fc0 -[UIApplication sendEvent:] + 292 27 UIKit 0x338a1900 _UIApplicationHandleEvent + 5084 28 GraphicsServices 0x35d66efc PurpleEventCallback + 660 29 CoreFoundation 0x314656f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20 30 CoreFoundation 0x314656bc __CFRunLoopDoSource1 + 160 31 CoreFoundation 0x31457f76 __CFRunLoopRun + 514 32 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224 33 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52 34 GraphicsServices 0x35d664a4 GSEventRunModal + 108 35 GraphicsServices 0x35d66550 GSEventRun + 56 36 UIKit 0x338d5322 -[UIApplication _run] + 406 37 UIKit 0x338d2e8c UIApplicationMain + 664 38 Wine Brain 0x000021ba 0x1000 + 4538 39 Wine Brain 0x00002184 0x1000 + 4484 I have no idea why my app's memory locations aren't being symbolocated, but the code paths lead to only two manavedObjectContext save: calls. The time this happend, addEntityForType was called all the way through, creating a new object for the "whereTasted" entity, before the final save: on the entire wine object. When I go through the same procedure again, it works fine. This leads me to believe it's something to do with the app having been run for a while when adding a new location, but I'm not sure. Any thoughts on how I can debug this and get more info the next time this happens?

    Read the article

  • (android) rows of buttons that take up the entire width of the screen

    - by user558043
    I am trying to make 3 rows of 4 buttons each that will take up the entire width of the screen. I have tried Linear Layout but have trouble adding a second row and from what I have read nesting Linear Layouts is bad practice. I tried to use relative layout several times but I cannot manage to get the buttons to fill the width of the screen because it ignores layout_weight, I then tried nesting linear layout in relative layout but layout_weight is still ignored. What is the best way to accomplish this?

    Read the article

  • Using the same modules in multiple projects

    - by Andreas Vinther
    I'm using Visual Studio 2010 and coding in VB.NET. My problem is that I've collected all the modules I've written and intend to reuse and placed them in a separate folder. When I want to add a module from the above folder to any given project, it takes a copy of the module and places in the project's source code folder, instead of referencing the module in the folder containing all the other modules. Is it possible to include a module in my project and leave it in the folder with all the other modules, so that when I improve upon a module, it'll affect all the projects that uses/references that module. Instead of me having to manually copy the new module to all the projects that uses/references the module. Right now I have multiple instances of the exact same module that i need to update manually when I improve code or add functionality?

    Read the article

  • C++ STL type_traits question.

    - by Kim Sun-wu
    I was watching the latest C9 lecture and noticed something interesting.. In his introduction to type_traits, Stephan uses the following (as he says, contrived) example: template <typename T> void foo(T t, true_type) { std::cout << t << " is integral"; } template <typename T> void foo(T t, false_type) { std::cout << t << " is not integral"; } template <typename T> void bar(T t) { foo(t, typename is_integral<T>::type()); } This seems to be far more complicated than: template <typename T> void foo(T t) { if(std::is_integral<T>::value) std::cout << "integral"; else std::cout << "not integral"; } Is there something wrong with the latter way of doing it? Is his way better? Why? Thanks.

    Read the article

  • JNDI Datasource Problem on Tomcat 6, Hibernate

    - by Asuman AKYILDIZ
    Hello; I am using Tomcat 6 as application server, Struts-Hibernate and MyEclipse 6.0. My application uses JDBC driver but I should modify it to use JNDI Datasource. I followed steps as described in tomcat 6.0 howto tutorial. I defined my resource in tomcatconf: <Resource name="jdbc/ats" global="jdbc/ats" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@//localhost:1521/MISDEV" username="TEST" password="TEST" maxActive="20" maxIdle="10" maxWait="-1" validationQuery="SELECT 1 from dual" removeAbandoned="true" removeAbandonedTimeout="30" logAbandoned="false"/> I gave reference in my application web.xml: <resource-ref> <description>Oracle Datasource example</description> <res-ref-name>jdbc/ats</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> And I defined datasource-dialect in my hibernate-cfg.xml <property name="connection.datasource">java:comp/env/jdbc/ats</property> <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property> But when I create hibernate session, it can not open the connection: 09:18:11,322 ERROR JDBCExceptionReporter:72 - Connections could not be acquired from the underlying database! org.hibernate.exception.GenericJDBCException: Cannot open connection I also tried to set the properties at runtime: Configuration configuration = new Configuration(); configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.Oracle9Dialect"); //configuration.setProperty("hibernate.connection.datasource", "java:comp/env/jdbc/ats"); configuration.setProperty("hibernate.current_session_context_class", "thread"); configuration.setProperty("hibernate.connection.provider_class", "org.hibernate.connection.C3P0ConnectionProvider"); configuration.setProperty("hibernate.show_sql", "true"); sessionFactory = configuration.configure().buildSessionFactory(); It does not open connection again. But, when I use JDBC driver it works: Configuration configuration = new Configuration(); configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.Oracle9Dialect"); //configuration.setProperty("hibernate.connection.datasource", "java:comp/env/jdbc/ats"); configuration.setProperty("hibernate.connection.url", "jdbc:oracle:thin:@//localhost:1521/MISDEV"); configuration.setProperty("hibernate.connection.username", "test"); configuration.setProperty("hibernate.connection.password", "test"); configuration.setProperty("hibernate.connection.driver_class", "oracle.jdbc.OracleDriver"); configuration.setProperty("hibernate.transaction.factory_class", "org.hibernate.transaction.JDBCTransactionFactory"); configuration.setProperty("hibernate.current_session_context_class", "thread"); configuration.setProperty("hibernate.connection.provider_class", "org.hibernate.connection.C3P0ConnectionProvider"); configuration.setProperty("hibernate.show_sql", "true"); sessionFactory = configuration.configure().buildSessionFactory(); I have been searching for 3 days and no success. What may be de problem?

    Read the article

  • JNDI Datasource definition in Tomcat 6.0

    - by romaintaz
    Hi all, I want to define a DataSource to an Oracle database on my Tomcat 6.0. So, in conf/server.xml (yes, I know that this DataSource will be available for all the webapps in Tomcat, but it's not a problem here), I've set this Resource: <GlobalNamingResources> <Resource name="hibernate/HibernateDS" auth="Container" type="javax.sql.DataSource" url="jdbc:oracle:thin:@myserver:1542:foo" username="foo" password="bar" driverClassName="oracle.jdbc.OracleDriver" maxActive="50" maxIdle="10" validationQuery="select 1 from dual"/> Then, in the web.xml of my application, I set a resource-ref element: <resource-ref> <description>Hibernate Datasource</description> <res-ref-name>hibernate/HibernateDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> Finally, as Hibernate is used to manage the database connection, I have a webapps/mywebapp/WEB-INF/classes/hibernate.cfg.xml that creates a session-factory using the JNDI DataSource: <hibernate-configuration> <session-factory> <property name="connection.datasource">java:comp/env/hibernate/HibernateDS</property> ... However, when I start my Tomcat server, I get an error that says it could not create the INFO [net.sf.hibernate.util.NamingHelper] JNDI InitialContext properties:{} INFO [net.sf.hibernate.connection.DatasourceConnectionProvider] Using datasource: java:comp/env/hibernate/HibernateDS INFO [net.sf.hibernate.transaction.TransactionFactoryFactory] Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFactory INFO [net.sf.hibernate.transaction.TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended) WARN [net.sf.hibernate.cfg.SettingsFactory] Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59) at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84) at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1172) ... Caused by: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) ... 11 more Do you have any idea why Hibernate is not able to construct the session-factory? What is wrong in my configuration?

    Read the article

  • Remote connect into macbook pro at a different resolution

    - by user60277
    Hello, I have a Dell laptop with Windows 7 on it. Its resolution is 1920x1080. I want to connect to a macbook pro at that resolution. The macbook pro has a resolution of 1440x900 so when I VNC into it, I can only see 1440x900 box with black borders on full resolution. The macbook pro can drive resolutions of 2560x1440. What program do I use to connect to the macbook at full (1920x1080) resolution. I can use remote desktop and connect from the dell laptop to another dell laptop that has a 1440x900 max. resolution. However in case of Remote desktop connection I can expand the window to be 1920x1080. I'm using TightVNC viewer on Windows. Thanks

    Read the article

  • Unable to specify parameters to cvlc in a script

    - by VxJasonxV
    I'm creating a script that issues a few curl commands in order to access a time-protected mms stream link, then set up a relay using cvlc (vlc's command line interface) for my own use on an unencumbered player. The curl aspect of this is working, as I can run as a browser and curl side by side and get the same access url. (It's time locked meaning the stream will work forever, but you have to connect quickly or the URL will time out.) The very end of the script prints the command I will run, which is then followed up by "exec $CMD". When I echo $CMD I get: cvlc --sout '#standard{access=http,mux=asf,dst=0.0.0.0:58194}' mms://[...] Manually Copy/Pasting this command in, verbatim, works perfectly fine, but as part of a script, the cvlc execution output says: [0x9743d0] main interface error: no suitable interface module [0x962120] main libvlc error: interface "globalhotkeys,none" initialization failed [0x9743d0] dummy interface: using the dummy interface module... [0xb16e30] stream_out_standard stream out error: no mux specified or found by extension [0xb16ad0] main stream output error: stream chain failed for `standard{mux="",access="",dst="'#standard{access=http,mux=asf,dst=0.0.0.0:58194}'"}' [0xb11cd0] main input error: cannot start stream output instance, aborting [0xb11f70] signals interface error: Caught Interrupt signal, exiting... Why is --sout behaving one way in a script (non-interactive shell?) vs. another way in the foreground (interactive shell) ?

    Read the article

  • How to disable Utility Manager (Windows Key + U)

    - by Skizz
    How do I disable the Windows Key+U hotkey in Windows XP? Alternatively, how do I stop the utility manager from being active? The two are related. The utilty manager is currently providing a potential security hole and I need to remove it*. The system I'm developing uses a custom Gina to log in and start a custom shell. This removes most Windows Key hotkeys but the Win+U still pops up the manager app. Update: Things I've tried and don't work: NoWinKeys registry setting - this only affects explorer hotkeys; Renaming utilman.exe - program reappears next login; Third party software - not really an option, these machines are audited by the clients and additional, third party software would be unlikely to be accepted. Also, the proedure needs to be reasonably straightforward - this has to be done by field service engineers to existing machines (machines currently in Russia, Holland, France, Spain, Ireland and USA). * The hole is via the internet options in the help viewer the utility app links to.

    Read the article

  • How do I get rid of auto-generated line breaks by Blogger from plain-text emails?

    - by Avry
    I'm trying to use plain-text emails to submit posts to my blog that's hosted on Blogger. I've set my email client to use plain-text but every time I send a post, Blogger hard wraps it instead of letting the text just flow. I've tried this with different mail clients and gotten the same results. I'm 100% sure that I'm sending plain text each time. Does anyone know how to get Blogger to quit doing this? Sigh. Maybe I'll switch to Wordpress...

    Read the article

  • Internet Connection Dying after some time

    - by Rahul
    I'm using BSNL 3G USB Datacard(BSNL is a ISP in India). After connecting to internet, while browsing in browser, the connection is dying. So after disconnecting & connecting back, it works proper for some time & the same problem repeats. But if I'm downloading any movie or some file through uTorrent, the connection is not dying. I'm experiencing this problem in Vista & also in Ubuntu. Help me with this please. Thank you.

    Read the article

  • Intel HD graphic drivers for ubuntu 10.10 64bit: the brightness says its being adjusted but it isn't

    - by James
    Hey all, I picked up an hp dm3t laptop with intel HD graphics and installed ubuntu 10.10 64 bit on it. It works great -- the only problem is that the brightness controls on the keyboard don't work. The brightness is always at full. When I try to adjust it down, the indicator graphic indicates that it's going down but the actual brightness doesn't change. Is there anything that I can try to make this work? I'd really appreciate any help. I asked this on superuser.com and someone commented that I should play around with the intel hd drivers. I'm a total noob -- how do I do that? What else can I try? I reallly don't want to do back to windows.

    Read the article

  • Please help ubuntu or any other linux os is not booting from cd or usb

    - by Amith
    I will tell you the whole story,one night when i was using KDE on Ubuntu 10.10 Kwin crashed then i shut down the os next day when i booted it the display came completely garbled and i went to safe graphics mode ,it worked and in reinstalled the Nvidia drivers and then restarted .Then immediatly, It said No init found Busybox XX.XX then I thought ill do a fresh install I inserted the ubuntu cd provided to me by Canonical.When i pressed 'try ubuntu without installing' instead of the graphic boot screen i saw.Ubuntu 10.10 in regular text and a progress bar few seconds after that the screen was flooded with error messages first alot of white then red.I then went to my win7 installation and saw a website which told me to find a Ext3 reader and format the ubuntu partition and the swap.I did that and when i restarted. GRUB configuration not found grub> Then it took my win 7 ERD and restored 7's bootloder Xp and 7 were working i put in the livecd again,Same error,Now usin my seven,Please help geeks,Ive even tried Knoppix,Fedora,Debiane.t.c they wont boot and i want to retain my win 7 and winxp partitions,I really miss linux.

    Read the article

  • installing ubuntu on SSD

    - by kunal
    Going to install Ubuntu 10.10 on new intel x25M 80GB SSD. It will be fresh install. I have been googling for past few days and getting overwhelming articles/blogs/Q&As. One particularly very useful being: Optimize for SSD (I could not post other links as i dont have enough credits) But with so many suggestions and differences of opinions (on different links) this simple OS install process seems to be daunting task to me and I really want to stick with ubuntu (although have used for very short period of time). Can someone help me by answering few questions (yes they are repeated as i couldnt comprehend the answers elsewhere) which file system (ext2/3/4 or something else)? (consider SSD life) can it be changed after installation? should i partition the disk? (as we do in traditional HDD) for now, no plan of dual booting. Only ubuntu will live on scarce space of 80GB SSD. i have 2 GB RAM, should i still allocate swap space (if i dont allocate swap space, can i still hibernate the machine)? will swap space impact SSD life? should i consider putting additional 1GB RAM to avoid swap space? Linux experience - absolute novice intended usage - heavy browsing, programming, regular video/music and some other non-CPU/RAM-intensive programs. will backup big files to an external hard drive. laptop config - 3 yr old vaio, core2 duo, 2GB RAM Please pardon the repetition and i really appreciate anyone helping me getting started with ubuntu.

    Read the article

  • streaming to correct network interface

    - by robin hood
    I have IP cam that supports RTSP streaming. It's connected to router with 2 network cards with IP1 and IP2 addresses. I make 2 connections to IP cam by IP1 and IP2 addresses from the same IP and I need to receive corresponding streams thru correct network card, but both streams (RTP over UDP) go thru IP1. How this can be resolved? I don't know if RTSP server binds UDP sockets to corresponding IP and I don't know what IP stack is in IP cam (weak end system or strong end system). I haven't found anything interesting in router configuration. As I understand, routing table cannot help me cos I'm connected from the same IP, is it right? Also Sorry for incomplete info but it's all I have at the moment. Thanks for your time.

    Read the article

  • C#, AES encryption check!

    - by Data-Base
    I have this code for AES encryption, can some one verify that this code is good and not wrong? it works fine, but I'm more concern about the implementation of the algorithm // Plaintext value to be encrypted. //Passphrase from which a pseudo-random password will be derived. //The derived password will be used to generate the encryption key. //Password can be any string. In this example we assume that this passphrase is an ASCII string. //Salt value used along with passphrase to generate password. //Salt can be any string. In this example we assume that salt is an ASCII string. //HashAlgorithm used to generate password. Allowed values are: "MD5" and "SHA1". //SHA1 hashes are a bit slower, but more secure than MD5 hashes. //PasswordIterations used to generate password. One or two iterations should be enough. //InitialVector (or IV). This value is required to encrypt the first block of plaintext data. //For RijndaelManaged class IV must be exactly 16 ASCII characters long. //KeySize. Allowed values are: 128, 192, and 256. //Longer keys are more secure than shorter keys. //Encrypted value formatted as a base64-encoded string. public static string Encrypt(string PlainText, string Password, string Salt, string HashAlgorithm, int PasswordIterations, string InitialVector, int KeySize) { byte[] InitialVectorBytes = Encoding.ASCII.GetBytes(InitialVector); byte[] SaltValueBytes = Encoding.ASCII.GetBytes(Salt); byte[] PlainTextBytes = Encoding.UTF8.GetBytes(PlainText); PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations); byte[] KeyBytes = DerivedPassword.GetBytes(KeySize / 8); RijndaelManaged SymmetricKey = new RijndaelManaged(); SymmetricKey.Mode = CipherMode.CBC; ICryptoTransform Encryptor = SymmetricKey.CreateEncryptor(KeyBytes, InitialVectorBytes); MemoryStream MemStream = new MemoryStream(); CryptoStream CryptoStream = new CryptoStream(MemStream, Encryptor, CryptoStreamMode.Write); CryptoStream.Write(PlainTextBytes, 0, PlainTextBytes.Length); CryptoStream.FlushFinalBlock(); byte[] CipherTextBytes = MemStream.ToArray(); MemStream.Close(); CryptoStream.Close(); return Convert.ToBase64String(CipherTextBytes); } public static string Decrypt(string CipherText, string Password, string Salt, string HashAlgorithm, int PasswordIterations, string InitialVector, int KeySize) { byte[] InitialVectorBytes = Encoding.ASCII.GetBytes(InitialVector); byte[] SaltValueBytes = Encoding.ASCII.GetBytes(Salt); byte[] CipherTextBytes = Convert.FromBase64String(CipherText); PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations); byte[] KeyBytes = DerivedPassword.GetBytes(KeySize / 8); RijndaelManaged SymmetricKey = new RijndaelManaged(); SymmetricKey.Mode = CipherMode.CBC; ICryptoTransform Decryptor = SymmetricKey.CreateDecryptor(KeyBytes, InitialVectorBytes); MemoryStream MemStream = new MemoryStream(CipherTextBytes); CryptoStream cryptoStream = new CryptoStream(MemStream, Decryptor, CryptoStreamMode.Read); byte[] PlainTextBytes = new byte[CipherTextBytes.Length]; int ByteCount = cryptoStream.Read(PlainTextBytes, 0, PlainTextBytes.Length); MemStream.Close(); cryptoStream.Close(); return Encoding.UTF8.GetString(PlainTextBytes, 0, ByteCount); } Thank you

    Read the article

  • JPA 2.0 Provider Hibernate Spring MVC 3.0

    - by user558019
    Dear All i have very strange problem we are using jpa 2.0 with hibernate and spring 3.0 mvc annotations based Database generated through JPA DDL is true and MySQL as Database; i will provide some refference classes and then my porblem. public abstract class Common implements serializable{ @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id", updatable = false) private Long id; @ManyToOne @JoinColumn private Address address; //with all getter and setters //as well equal and hashCode } public class Parent extends Common{ private String name; @OneToMany(cascade = {CascadeType.MERGE,CascadeType.PERSIST}, mappedBy = "parent") private List<Child> child; //setters and rest of class } public class child extends Common{ //some properties with getter/setters } public class Address implements Serializable{ @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id", updatable = false) private Long id; private String street; //rest of class with get/setter } as in code you can see that parents and child classes extends Common class so both have address property and id , the problem occurs when change the address refference in parent class it reflect same change in all child objects in list and if change address refference in child class then on merge it will change address refference of parent as well i am not able to figure out is it is problem of jpa or hibernate or spring thanks in advance

    Read the article

  • changing button tag border color

    - by rashmi
    dear all, i have loaded image in border less button tag when button is selected with tab key i get brown color rectangle around image. how do i change color of that rectangle from brown to white. and is that possible to have white rectangle with inner and outer shadow of rectangle with blue. please help. here is my code snippet. <td align=center valign=middle > <figure> <button style="background-color:black; height:160px;width:160px ; border:none"><img src="F:\rashmi\icons_tv\Help_Normal.png" > </button> <figcaption><font size="5" color="white" style="font-weight:bold"><center>help</center></font></figcaption> </figure> </td>

    Read the article

  • How to insert additional content to page header from viewpage?

    - by madyalman
    Hi, I am new to asp.net mvc platform. I'm developing with razor template engine in mvc 3. I've created a layout page for all view pages but in some cases I need different page headers for different view pages. For example I have to insert additional script elements to page header to validate data in form pages. I want to know is there any way to add html element to layout page's header from view page? Thanks in advance.

    Read the article

  • How to get a project's directory from within T4?

    - by Earlz
    I've been messing around with T4 support in Mono and noticed a very cumbersome thing. The current directory when running T4 templates is the home directory. I need to be able to read a few files from the current project's directory but I'm at a loss for how to. <#@ template language="C#v3.5" #> <#@ output extension="txt" #> <#=System.IO.Directory.GetCurrentDirectory() #> yields /home/earlz where I want it to yield something like /home/earlz/MyProject How do I overcome this problem? Also, I tried the hostspecific and Host.ResolvePath, but I got a NotImplementedException

    Read the article

  • Excel UDF calculation should return 'original' value

    - by LeChe
    Hi all, I've been struggling with a VBA problem for a while now and I'll try to explain it as thoroughly as possible. I have created a VSTO plugin with my own RTD implementation that I am calling from my Excel sheets. To avoid having to use the full-fledged RTD syntax in the cells, I have created a UDF that hides that API from the sheet. The RTD server I created can be enabled and disabled through a button in a custom Ribbon component. The behavior I want to achieve is as follows: If the server is disabled and a reference to my function is entered in a cell, I want the cell to display Disabled If the server is disabled, but the function had been entered in a cell when it was enabled (and the cell thus displays a value), I want the cell to keep displaying that value If the server is enabled, I want the cell to display Loading Sounds easy enough. Here is an example of the - non functional - code: Public Function RetrieveData(id as Long) Dim result as String // This returns either 'Disabled' or 'Loading' result = Application.Worksheet.Function.RTD("SERVERNAME", "", id) RetrieveData = result If(result = "Disabled") Then // Obviously, this recurses (and fails), so that's not an option If(Not IsEmpty(Application.Caller.Value2)) Then // So does this RetrieveData = Application.Caller.Value2 End If End If End Function The function will be called in thousands of cells, so storing the 'original' values in another data structure would be a major overhead and I would like to avoid it. Also, the RTD server does not know the values, since it also does not keep a history of it, more or less for the same reason. I was thinking that there might be some way to exit the function which would force it to not change the displayed value, but so far I have been unable to find anything like that. Any ideas on how to solve this are greatly appreciated! Thanks, Che EDIT: By popular demand, some additional info on why I want to do all this: As I said, the function will be called in thousands of cells and the RTD server needs to retrieve quite a bit of information. This can be quite hard on both network and CPU. To allow the user to decide for himself whether he wants this load on his machine, he or she can disable the updates from the server. In that case, he or she should still be able to calculate the sheets with the values currently in the fields, yet no updates are pushed into them. Once new data is required, the server can be enabled and the fields will be updated. Again, since we are talking about quite a bit of data here, I would rather not store it somewhere in the sheet. Plus, the data should be usable even if the workbook is closed and loaded again.

    Read the article

  • Specifying distinct sequence per table in Hibernate on subclasses

    - by gutch
    Is there a way to specify distinct sequences for each table in Hibernate, if the ID is defined on a mapped superclass? All entities in our application extend a superclass called DataObject like this: @MappedSuperclass public abstract class DataObject implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) @Column(name = "id") private int id; } @Entity @Table(name = "entity_a") public class EntityA extends DataObject { ... } @Entity @Table(name = "entity_b") public class EntityB extends DataObject { ... } This causes all entities to use a shared sequence, the default hibernate_sequence. What I would like to do is use a separate sequence for each entity, for example entity_a_sequence and entity_b_sequence in the example above. If the ID were specified on the subclasses then I could use the @SequenceGenerator annotation to specify a sequence for each entity, but in this case the ID is on the superclass. Given that ID is in the superclass, is there a way I can use a separate sequence for each entity — and if so, how? (We are using PostgreSQL 8.3, in case that's relevant)

    Read the article

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