Daily Archives

Articles indexed Monday May 17 2010

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

  • a quick overview on access

    - by masfenix
    Hey I am a university student (math major), but programming since I was little (read: 14). I am starting a new programming job tomorrow at a very big company. However I just found out that I might be just working with access for a couple of weeks (macros and whatnot). Can someone just give me a general rundown on how to create and use VB in access. What I mean is how do tables refer to themselves (as objects? as what name?) how to run queries through vb and such. thanks all.

    Read the article

  • How do I write this MySQL query?

    - by CT
    I am working on an Asset DB using a lamp stack. In this example consider the following 5 tables: asset, server, laptop, desktop, software All tables have a primary key of id, which is a unique asset id. Every object has all asset attributes and then depending on type of asset has additional attributes in the corresponding table. If the type is a server, desktop or laptop it also has items in the software table. Here are the table create statements: // connect to mysql server and database "asset_db" mysql_connect("localhost", "asset_db", "asset_db") or die(mysql_error()); mysql_select_db("asset_db") or die(mysql_error()); // create asset table mysql_query("CREATE TABLE asset( id VARCHAR(50) PRIMARY KEY, company VARCHAR(50), location VARCHAR(50), purchase_date VARCHAR(50), purchase_order VARCHAR(50), value VARCHAR(50), type VARCHAR(50), notes VARCHAR(200))") or die(mysql_error()); echo "Asset Table Created.</br />"; // create software table mysql_query("CREATE TABLE software( id VARCHAR(50) PRIMARY KEY, software VARCHAR(50), license VARCHAR(50))") or die(mysql_error()); echo "Software Table Created.</br />"; // create laptop table mysql_query("CREATE TABLE laptop( id VARCHAR(50) PRIMARY KEY, manufacturer VARCHAR(50), model VARCHAR(50), serial_number VARCHAR(50), esc VARCHAR(50), user VARCHAR(50), prev_user VARCHAR(50), warranty VARCHAR(50))") or die(mysql_error()); echo "Laptop Table Created.</br />"; // create desktop table mysql_query("CREATE TABLE desktop( id VARCHAR(50) PRIMARY KEY, manufacturer VARCHAR(50), model VARCHAR(50), serial_number VARCHAR(50), esc VARCHAR(50), user VARCHAR(50), prev_user VARCHAR(50), warranty VARCHAR(50))") or die(mysql_error()); echo "Desktop Table Created.</br />"; // create server table mysql_query("CREATE TABLE server( id VARCHAR(50) PRIMARY KEY, manufacturer VARCHAR(50), model VARCHAR(50), warranty VARCHAR(50))") or die(mysql_error()); echo "Server Table Created.</br />"; ?> How do I query the database so that if I search by id, I receive all related fields to that asset id? Thank you.

    Read the article

  • C# "Could not find a part of the path" - Creating Local File

    - by Pyronaut
    I am trying to write to a folder that is located on my C:\ drive. I keep getting the error of : Could not find a part of the path .. etc My filepath looks basically like this : C:\WebRoot\ManagedFiles\folder\thumbs\5c27a312-343e-4bdf-b294-0d599330c42d\Image\lighthouse.jpg And I am writing to it like so : using (MemoryStream memoryStream = new MemoryStream()) { thumbImage.Save(memoryStream, ImageFormat.Jpeg); using (FileStream diskCacheStream = new FileStream(cachePath, FileMode.CreateNew)) { memoryStream.WriteTo(diskCacheStream); } memoryStream.WriteTo(context.Response.OutputStream); } Don't worry too much about the memory stream. It is just outputting it (After I save it). Since I am creating a file, I am a bit perplexed as to why it cannot find the file (Shouldn't it just write to where I tell it to, regardless?). The strange thing is, It has no issue when I'm testing it above using File.Exists. Obviously that is returning false, But it means that atleast my Filepath is semi legit. Any help is much appreciated.

    Read the article

  • what's faster: merging lists or dicts in python?

    - by tipu
    I'm working with an app that is cpu-bound more than memory bound, and I'm trying to merge two things whether they be sets or dicts. Now the thing is i can choose either one, but I'm wondering if merging dicts would be faster since it's all in memory? Or is it always going to be O(n), n being the size of the smaller set. The reason I asked about dicts rather than sets is because I can't convert a set to json, because that results in {key1, key2, key3} and json needs a key/value pair, so I am using a dict so json dumps returns {key1:1, key2:1, key3:1}. Yes this is wasteful, but if it proves to be faster then I'm okay with it.

    Read the article

  • Getting Facebook App's User Public Information

    - by geoffrobinson
    I have a client who would like to pull public information about people who "like" some of their web pages or are associated with their Facebook app. I wanted to do a proof of concept, but we really don't about any particular methodology. Another option we want to explore is to assume we have captured a Facebook user ID/email. Can we use that to collect public profile information?

    Read the article

  • Coroutines in Java

    - by JUST MY correct OPINION
    I would like to do some stuff in Java that would be clearer if written using concurrent routines, but for which full-on threads are serious overkill. The answer, of course, is the use of coroutines, but there doesn't appear to be any coroutine support in the standard Java libraries and a quick Google on it brings up tantalising hints here or there, but nothing substantial. Here's what I've found so far: JSIM has a coroutine class, but it looks pretty heavyweight and conflates, seemingly, with threads at points. The point of this is to reduce the complexity of full-on threading, not to add to it. Further I'm not sure that the class can be extracted from the library and used independently. Xalan has a coroutine set class that does coroutine-like stuff, but again it's dubious if this can be meaningfully extracted from the overall library. It also looks like it's implemented as a tightly-controlled form of thread pool, not as actual coroutines. There's a Google Code project which looks like what I'm after, but if anything it looks more heavyweight than using threads would be. I'm basically nervous of something that requires software to dynamically change the JVM bytecode at runtime to do its work. This looks like overkill and like something that will cause more problems than coroutines would solve. Further it looks like it doesn't implement the whole coroutine concept. By my glance-over it gives a yield feature that just returns to the invoker. Proper coroutines allow yields to transfer control to any known coroutine directly. Basically this library, heavyweight and scary as it is, only gives you support for iterators, not fully-general coroutines. The promisingly-named Coroutine for Java fails because it's a platform-specific (obviously using JNI) solution. And that's about all I've found. I know about the native JVM support for coroutines in the Da Vinci Machine and I also know about the JNI continuations trick for doing this. These are not really good solutions for me, however, as I would not necessarily have control over which VM or platform my code would run on. (Indeed any bytecode manipulation system would suffer similar problems -- it would be best were this pure Java if possible. Runtime bytecode manipulation would restrict me from using this on Android, for example.) So does anybody have any pointers? Is this even possible? If not, will it be possible in Java 7?

    Read the article

  • SQl to list rows if not in another table

    - by SmartestVEGA
    I have the following query which have 1000 rows select staffdiscountstartdate,datediff(day,groupstartdate,staffdiscountstartdate), EmployeeID from tblEmployees where GroupStartDate < '20100301' and StaffDiscountStartDate > '20100301' and datediff(day,groupstartdate,staffdiscountstartdate)>1 order by staffdiscountstartdate desc i have the following query which have 400 rows: ie the employees in tblemployees and in tblcards select a.employeeid,b.employeeid from tblEmployees a,tblCards b where GroupStartDate < '20100301' and StaffDiscountStartDate > '20100301' and datediff(day,groupstartdate,staffdiscountstartdate)>1 and a.employeeid=b.employeeid How to list the employees which is there in tblemployees and not in tblcards? ie is 1000-400 = 600 rows ???

    Read the article

  • add database Tablenames to the JList in java

    - by Litecia
    // Declare JList private JList jlstTab, jlstCol; . . . DefaultListModel dlmTables = new DefaultListModel(); DefaultListModel dlmCol = new DefaultListModel(); // Instantiate dlmTables.addElement("kl"); jlstTab= new JList(dlmTables); jlstTab.setSelectedIndex(0); jlstTab.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); . . . . Connect to the database public static void main(String args[]) { DBToolSwing cs = new DBToolSwing("DB Tool Swing"); try DBAccessObject dbAccess1 = new DBAccessObject("jdbc:odbc:JavaClassDSN"); DBAccessObject dbAccess2 = new DBAccessObject(); ResultSet rsTables = dbAccess1.getDatabaseTableNames(); while (rsTables.next()) System.out.println(rsTables.getString("TABLE_NAME")); I need to get the table names from the database, the output shouldn't be printed on the screen, instead I need the output added to the JlstTab so dlmTables.addElement("TABLE_NAME"); Please if someone can help I would appreciate it. Thanks in advance.

    Read the article

  • What problems have you solved using artificial neural networks?

    - by knorv
    I'd like to know about specific problems you - the SO reader - have solved using artificial neural network techniques and what libraries/frameworks you used if you didn't roll your own. Questions: What problems have you used artificial neural networks to solve? What libraries/frameworks did you use? I'm looking for first-hand experiences, so please do not answer unless you have that.

    Read the article

  • Incorporating Devise Authentication into an already existing user structure?

    - by Kevin
    I have a fully functional authentication system with a user table that has over fifty columns. It's simple but it does hash encryption with salt, uses email instead of usernames, and has two separate kinds of users with an admin as well. I'm looking to incorporate Devise authentication into my application to beef up the extra parts like email validation, forgetting passwords, remember me tokens, etc... I just wanted to see if anyone has any advice or problems they've encountered when incorporating Devise into an already existing user structure. The essential fields in my user model are: t.string :first_name, :null => false t.string :last_name, :null => false t.string :email, :null => false t.string :hashed_password t.string :salt t.boolean :is_userA, :default => false t.boolean :is_userB, :default => false t.boolean :is_admin, :default => false t.boolean :active, :default => true t.timestamps For reference sake, here's the Devise fields from the migration: t.database_authenticatable :null => false t.confirmable t.recoverable t.rememberable t.trackable That eventually turn into these actual fields in the schema: t.string "email", :default => "", :null => false t.string "encrypted_password", :limit => 128, :default => "", :null => false t.string "password_salt", :default => "", :null => false t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" t.string "reset_password_token" t.string "remember_token" t.datetime "remember_created_at" t.integer "sign_in_count", :default => 0 t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" t.datetime "created_at" t.datetime "updated_at" What do you guys recommend? Do I just remove email, hashed_password, and salt from my migration and put in the 5 Devise migration fields and everything will be OK or do I need to do something else?

    Read the article

  • What problems have you solved using genetic algorithms/genetic programming?

    - by knorv
    Genetic algorithms (GA) and genetic programming (GP) are interesting areas of research. I'd like to know about specific problems you - the SO reader - have solved using GA/GP and what libraries/frameworks you used if you didn't roll your own. Questions: What problems have you used GA/GP to solve? What libraries/frameworks did you use? I'm looking for first-hand experiences, so please do not answer unless you have that.

    Read the article

  • Novel fitness measure for evolutionary image matching simulation

    - by Nick Johnson
    I'm sure many people have already seen demos of using genetic algorithms to generate an image that matches a sample image. You start off with noise, and gradually it comes to resemble the target image more and more closely, until you have a more-or-less exact duplicate. All of the examples I've seen, however, use a fairly straightforward pixel-by-pixel comparison, resulting in a fairly predictable 'fade in' of the final image. What I'm looking for is something more novel: A fitness measure that comes closer to what we see as 'similar' than the naive approach. I don't have a specific result in mind - I'm just looking for something more 'interesting' than the default. Suggestions?

    Read the article

  • Are evolutionary algorithms and neural networks used in the same problem domains?

    - by Joe Holloway
    I am trying to get a feel for the difference between the various classes of machine-learning algorithms. I understand that the implementations of evolutionary algorithms are quite different from the implementations of neural networks. However, they both seem to be geared at determining a correlation between inputs and outputs from a potentially noisy set of training/historical data. From a qualitative perspective, are there problem domains that are better targets for neural networks as opposed to evolutionary algorithms? I've skimmed some articles that suggest using them in a complementary fashion. Is there a decent example of a use case for that? Thanks

    Read the article

  • How is Java Process.getOutputStream() Implemented?

    - by Amit Kumar
    I know the answer depends on the particular JVM, but I would like to understand how it is usually implemented? Is it in terms of popen (posix)? In terms of efficiency do I need to keep something in mind (other than using a Buffered stream as suggested by the javadoc). I would be interested to know if there is a general reference about implementations of JVMs which answers such questions.

    Read the article

  • Looking for evolutionary music example code

    - by Dan Dyer
    I would like to implement an interactive evolutionary algorithm for generating music (probably just simple melodies to start with). I'd like to use JFugue for this. Its website claims that it is well-suited to evolutionary music, but I can't find any evolutionary examples. I already have a framework to provide the evolutonary machinery. What I am looking for is some simple, working code that demonstrates viable approaches for the musical part (e.g. suitable encodings and evolutionary operators for the evolved tunes). I have some ideas how it might be achieved, but I'm not particularly knowledgeable about music theory, so to start with I'd like to just reimplement something that is known to work. So does anybody have, or know of, any freely available code (any language is fine) that demonstrates one or more approaches to evolutionary music? EDIT: I'm specifically looking for evolutionary code rather than other techniques that could be used for music synthesis.

    Read the article

  • VB.net Reading from ListViews with Multiple Columns

    - by xzerox
    Alright. So I was able to find out how to read from the first column but I need to read from both of them. I am using full row select which I need on there. Here is the code I am using to get it for the first column. Dim I As Integer For I = 0 To ListView1.SelectedItems.Count - 1 MsgBox(ListView1.SelectedItems(I).Text) Next MessageBox.Show(ListView1.Columns(0).Text)

    Read the article

  • Is there a list of language only character regions for UTF-8 somewhere?

    - by Brehtt
    I'm trying to analyze some UTF-8 encoded documents in a way that recognizes different language characters. For my approach to work I need to ignore non-language characters, such as control characters, mathematical symbols etc. Just trying to dissect the basic Latin section of the UTF standard has resulted in multiple regions, with characters like the division symbol being right in the middle of a range of valid Latin characters. Is there a list somewhere that identifies these regions? Or better yet, a Regex that defines the regions or something in C# that can identify the different characters?

    Read the article

  • Evolutionary Algorithms: Optimal Repopulation Breakdowns

    - by Brian MacKay
    It's really all in the title, but here's a breakdown for anyone who is interested in Evolutionary Algorithms: In an EA, the basic premise is that you randomly generate a certain number of organisms (which are really just sets of parameters), run them against a problem, and then let the top performers survive. You then repopulate with a combination of crossbreeds of the survivors, mutations of the survivors, and also a certain number of new random organisms. Do that several thousand times, and efficient organisms arise. Some people also do things like introduce multiple "islands" of organisms, which are seperate populations that are allowed to crossbreed once in awhile. So, my question is: what are the optimal repopulation percentages? I have been keeping the top 10% performers, and repopulating with 30% crossbreeds and 30% mutations. The remaining 30% is for new organisms. I have also tried out the multiple island theory, and I'm interested in your results on that as well. It is not lost on me that this is exactly the type of problem an EA could solve. Are you aware of anyone trying that? Thanks in advance!

    Read the article

  • Genetic Programming in C#

    - by Mac
    I've been looking for some good genetic programming examples for C#. Anyone knows of good online/book resources? Wonder if there is a C# library out there for Evolutionary/Genetic programming?

    Read the article

  • How to make the WebBrowser to scroll up when new content is appended to the bottom of the page?

    - by Java Doe
    In order to achieve this effect, I would like to know how I can make the WebBrowser to scroll up when new content is added to the HTML page? "Allow more entries to be displayed in the view: When the user clicks more, additional entries should be displayed in addition to the ones which are already displayed. The code should cause the UI to scroll such that the first entry of the "more" set is on top". I am using com.ibm.rcp.browser.service.WebBrowser which is similar to SWT WebBrowser.

    Read the article

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