Search Results

Search found 10177 results on 408 pages for 'thumbs db'.

Page 144/408 | < Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >

  • dynamic searchable fields, best practice?

    - by boblu
    I have a Lexicon model, and I want user to be able to create dynamic feature to every lexicon. And I have a complicate search interface that let user search on every single feature (including the dynamic ones) belonged to Lexicon model. I could have used a serialized text field to save all the dynamic information if they are not for searching. In case I want to let user search on all fields, I have created a DynamicField Model to hold all dynamically created features. But imagine I have 1,000,000,000 lexicon, and if one create a dynamic feature for every lexicon, this will result creating 1,000,000,000 rows in DynamicField model. So the sql search function will become quite inefficient while a lot of dynamic features created. Is there a better solution for this situation? Which way should I take? searching for a better db design for dynamic fields try to tuning mysql(add cache fields, add index ...) with current db design

    Read the article

  • Decimal rounding strategies in enterprise applications

    - by Sapphire
    Well, I am wondering about a thing with rounding decimals, and storing them in DB. Problem is like this: Let's say we have a customer and a invoice. The invoice has total price of $100.495 (due to some discount percentage which is not integer number), but it is shown as $100.50 (when rounded, just for print on invoice). It is stored in the DB with the price of $100.495, which means that when customer makes a deposit of $100.50 it will have $0.005 extra on the account. If this is rounded, it will appear as $0, but after couple of invoices it would keep accumulating, which would appear wrong (although it actually is not). What is best to do in this case. Store the value of $100.50, or leave everything as-is?

    Read the article

  • Is there a function similar to Math.Max for Entity Framework?

    - by Ryan ONeill
    I have an entity framework query as follows; From T In Db.MyTable Where (T.Col1 - T.Col2) + T.Col3 - T.Col4 > 0 _ Select T I now need to make sure that the bracketed part '(T.Col1 - T.Col2)' does not go below zero. In .Net, I'd code it as follows (but obviously EF does not like Math.Max). From T In Db.MyTable Where Math.Max(T.Col1 - T.Col2,0) + T.Col3 - T.Col4 > 0 _ Select T Is there an easy way to do this? I am using EF 2.0 (not the latest, just released version). Thanks in advance

    Read the article

  • LinqToSql: How can I create a projection to adhere to DRY?

    - by mhutter
    Just wondering if there is a way to take some of the repitition out of a LINQ to SQL projected type. Example: Table: Address Fields: AddressID, HouseNumber, Street, City, State, Zip, +20 more Class MyAddress: AddressID, HouseNumber, Street (Only 3 fields) LINQ: from a in db.Addresses select new MyAddress { AddressID = a.AddressID, HouseNumber = a.HouseNumber, Street = a.Street } The above query works perfectly, and I understand why something like this will return all 20+ fields in each row: from a in db.Addresses select new MyAddress(a); class MyAddress { public MyAddress(Address a) { this.AddressID = a.AddressID, this.HouseNumber = a.HouseNumber, this.Street = a.Street } } Which leads me to my Question: Is it possible to implement some kind of helper function or extension method to "map" from the LINQ model to MyAddress yet only return the necessary fields in the query result rather than all of the fields?

    Read the article

  • ORM on which standards i can select?

    - by just_name
    Q: This question is about how can i figure or select the convenient ORM to my web application. when beginning a new web application,What are the criteria on which i can consider a specific ORM is better than another one for my project or case(web application)? another part of my question : when i begin any web application i use three layers: the DB layer (which contains the connections , and handle the CRUD operations ) the Managers layer(the Data Access Layer) a class for each table on my db (loosely coupled with the previous layer )it contains the CRUD operations for the specific table and the other required operations. the interface layer.. and i use Object Data source.Is that considered as an ORM (as a concept) or I'm wrong in understanding this concept. note:I still a beginner in this field ,, and every day i learn more about web development. please i want explanation and suggestions for this point. Thanks in advance.

    Read the article

  • Updating Many-to-Many relationship with LinqToSQL

    - by Noffie
    If I had, for example, a Many-to-Many mapping table called "RolesToUsers" between a Users and an Roles table, here is how I do it: // DataContext is db, usr is a User entity // newUserRolesMappings is a collection with the desired new mappings, probably // derived by looking at selections in a checkbox list of Roles on a User Edit page db.RolesToUsers.DeleteAllOnSubmit(usr.RolesToUsers); usr.RolesToUsers.Clear(); usr.RolesToUsers.AddRange(newUserRolesMappings); I used the SQL profiler once, and this seems to generate very intelligent SQL - it will only drop the rows which are no longer in the mapping relationship, and only add rows which did not already exist in the relationship. It doesn't blindly do a complete clearing and re-construction of the relationship, as I thought it would. The internet is surprisingly quiet on the subject, and the query "LinqToSQL many-to-many" mostly just turns up articles about how the LinqToSQL data mapper doesn't "support" it very well. How does everyone else update many-to-many with LinqToSQL?

    Read the article

  • MS Access questions - Scalability / indexing / transactions

    - by oo
    A few questions on MS Access databases - Size: Are there limits to the size of an access database? The reason i ask is that we have an access database that has a few simple tables. The size of the db is about 1GB. When I do a query on it, i see it taking over 10 minutes to run. With proper indexing, should MS Access be able to handle this or are there fundamental limitations to the technology. This is MS Access XP. Also, does MS Access support db transactions, commit and rollback?

    Read the article

  • Ideas for loading initial data in an iPhone application?

    - by Derek Clarkson
    Hi all, In my app I want to load some initial data to show the user how it works. The app uses a CoreData managed sqllite db. SO far I've thought of 3 options: Write code into a class to programmatically create the data. Create a xml file in the apps resources and load through a NSXmlParser whose delegate creates the entries in the sqllite db. Same as option #2, but use a json file and bring in a 3rd party lib to read it. Are there other options I have not found yet? and given that I'm talking about perhaps 6 records per table when there are 3 tables, which would you choose?

    Read the article

  • Need Help with Page Life Cycle(I think it is screwing me up)

    - by chobo2
    Hi I have dragged a empty asp.net table onto my webform. I generate all the rows in the code behind those. Now my table gets filled up and has dropdown lists. When the user hits save I go through all the rows and update the values from the dropdownlist in the db. This works all great. However if 2 columns have each have "Present" then those 2 columns should be not be shown anymore and 2 new columns get put in its place with other dropdown lists. This all works. However you have to refresh the entire page to for the 2 columns that should go away to go away. So what I tried to do is at the end of the button click event. Clear the whole table and then regenerate it. However when I do this then my values are not saved to the database anymore for whatever reason. if (IsPostBack == false) { // check if dummy variables exist in db- If true just generate tables with values in db. If not generate them. } else { // grab the values from the database // generate tables with the values } btn click event { go through all rows in table(foreach loop) update each column in the database with cells in each row. while in foreach loop. //done } So this is how it goes and it works expect(all correct values are saved) the table is just not updated to the user. Does not work if (IsPostBack == false) { // same code as above } // if postback is true do nothing. By the time it gets to the click event it says there is zero rows in the table so nothing happens. btn click event { // same code } Fails also. if (IsPostBack == false) { // same code as above } else { // same code as above but moved into its own method. gernerateTable(); } btn click event { // update all rows // once done clear the Tables rows // call generateTable() } This last one does nothing as for some reason it does not update anything. I don't understand why. So what am I doing wrong with this life cycle something in my process is wrong. The code works just not when I want the table to be updated right away.

    Read the article

  • Custom keys for Google App Engine models (Python)

    - by Cameron
    First off, I'm relatively new to Google App Engine, so I'm probably doing something silly. Say I've got a model Foo: class Foo(db.Model): name = db.StringProperty() I want to use name as a unique key for every Foo object. How is this done? When I want to get a specific Foo object, I currently query the datastore for all Foo objects with the target unique name, but queries are slow (plus it's a pain to ensure that name is unique when each new Foo is created). There's got to be a better way to do this! Thanks.

    Read the article

  • SQLite/iPhone read copyright symbol

    - by Marco A
    Hi All, I am having problems reading the copyright symbol from a sqlite db that I have for my App that I am developing. I import the information manually, ie, from an excel sheet. I have tried two ways of doing it and failed with both: 1) Tried replacing the copyright symbol with "\u00ae" (unicode combination) within excel and then importing the modified file. - Result: I get the combination of \u00ae as a part of the string, it doesnt detect the unicode combination. 2) Tried leaving as it is. Importing the excel with the copyright symbol. - Result: I get a symbol that is different from the copyright, its something like an AE put together.looks like this: Æ Heres my code how I read from DB: -(void) readCategoriesFromDatabase:(NSString *) rest_input { // Init the products Array categories = [[NSMutableArray alloc] init]; // Open the database from the users filessytem rest_input = [rest_input stringByAppendingString:@"'"]; NSString *newString; newString = [@"select distinct category from food where restaurant='" stringByAppendingString:rest_input]; const char *cat_sqlStatement = [newString UTF8String]; sqlite3_stmt *cat_compiledStatement; if(sqlite3_prepare_v2(database, cat_sqlStatement, -1, &cat_compiledStatement, NULL) == SQLITE_OK) { // Loop through the results and add them to the feeds array while(sqlite3_step(cat_compiledStatement) == SQLITE_ROW) { NSString *catName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(cat_compiledStatement,0)]; // Create a new product object with the data from the database Product *category = [[Product alloc] initWithName:catName]; // Add the product object to the respective Array [categories addObject:category]; [category release]; } sqlite3_finalize(cat_compiledStatement); } NSLog(@"Finished Accessing Database to gather Categories...."); } I open the DB with this function: -(void) checkAndCreateDatabase{ NSLog(@"Checking/Creating Database...."); NSFileManager *fileManager = [NSFileManager defaultManager]; success = [fileManager fileExistsAtPath:databasePath]; [fileManager removeFileAtPath:databasePath handler:nil]; NSString *databasePathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:databaseName]; [fileManager copyItemAtPath:databasePathFromApp toPath:databasePath error:nil]; [fileManager release]; if (sqlite3_open([databasePath UTF8String], &database) != SQLITE_OK) { sqlite3_close(database); database = nil; } NSLog(@"Finished Checking/Creating Database...."); } Thanks to anything that can help me out.

    Read the article

  • SQLite not pluralizing Table Names

    - by weenet
    I am using SQLite as my db during development, and I want to postpone actually creating a final database until my domains are fully mapped. So I have this in my Global.asax.cs file: private void InitializeNHibernateSession() { Configuration cfg = NHibernateSession.Init( webSessionStorage, new [] { Server.MapPath("~/bin/MyNamespace.Data.dll") }, new AutoPersistenceModelGenerator().Generate(), Server.MapPath("~/NHibernate.config")); if (ConfigurationManager.AppSettings["DbGen"] == "true") { var export = new SchemaExport(cfg); export.Execute(true, true, false, NHibernateSession.Current.Connection, File.CreateText(@"DDL.sql")); } } The AutoPersistenceModelGenerator hooks up the various conventions, including a TableNameConvention like so: public void Apply(FluentNHibernate.Conventions.Instances.IClassInstance instance) { instance.Table(Inflector.Net.Inflector.Pluralize(instance.EntityType.Name)); } This is working nicely execpt that the sqlite db generated does not have pluralized table names. Any idea what I'm missing? Thanks.

    Read the article

  • How to enable i18n from within setup_app in websetup.py ? (formatted resend)

    - by daniel
    From within the setup_app function (websetup.py) of a pylons i18n application, which is making use of a db, I was trying to initiate multilingual content to be inserted into the db. To do so the idea was something like: #necessary imports here def setup_app(command, conf, vars): .... for lang in langs: set_lang(lang) content=model.Content() content.content=_('content') Session.add(content) Session.commit() Unfortunately it seems that it doesn't work. the set_lang code line is firing an exception as follows: File ".. i18n/translation.py", line 179, in set_lang translator = _get_translator(lang, **kwargs) File ".. i18n/translation.py", line 160, in _get_translator localedir = os.path.join(rootdir, 'i18n') File ".. /posixpath.py", line 67, in join elif path == '' or path.endswith('/'): AttributeError: 'NoneType' object has no attribute 'endswith' Actually I'm even not sure it could be possible launching i18n mechanisms from within this setup_app function without an active request object. Anyone has tried some trick on a similar story ?

    Read the article

  • SQL Script to clear database tables.

    - by pencilslate
    I have a need to take backup of a SQL Server Db with tons of data in it and import into another environment for updating and testing. Since, i am not interested in the data, i just want to recreate the schema on my other server. There is an option called 'Generate Script', but is throwing errors running them on the target server. Curious, if anyone attempted to write a SQL script that would run through all the tables in the db and clear the rows, thereby i could just create the schema backup as .bak file and restore it into another server.

    Read the article

  • Interview question - c#

    - by ltech
    I was tasked to conduct my first interview and would like to pose my question to this world for both their feedback on my question and also on their solutions. Question: I have a legacy system with users and files, the info of all files pertaining to a user are stored on a flat file. I want to upgrade this system by storing all info on a db, design tables, and create a C# system that will populate the new db as well as ftp the files to a new path. Define the desgin consideration and develop a prototype. Note: We are looking more for what design one would use and why rather than code that compiles. If it does then kudos to you and we will give it more weight. @Tim C, I did show the interviewee the file: User1234.txt UserID=1234 ParentPath=\\somewhere\nowehere\everywhere\1234 FileCount=20 File0=something0.ext .. File19=something19.ext @Tim C, I have never conducted an interview and I followed a script given to me by my senior developer who was absent.

    Read the article

  • Add Wordpress Video Gallery from YouTube User account to template

    - by Derek Organ
    I'm trying to create a small gallery of my youtube videos in wordpress. I need to have full control of style though. What i'm looking to do is have one big video (latest) and the next three as small thumbs underneath that. Can anyone recommend the best way to do this. I've can get use RSS feed from my youtube page to get a list of the videos. I now need a simple way to embed this info in my template.

    Read the article

  • Having difficulty catching postgresql exception in sequel/ruby

    - by mhd
    I have postgresql table that has somekind of unique constraint. I have ruby script that will update this table. The ruby script should be able to switch to UPDATE instead of INSERT when this kind of error occured: PGError: ERROR: duplicate key value violates unique constraint CMIIW, sequel seems cannot catch this exception?? Anyway,sample code below is something that I would like to see to work but apparently not: @myarray.each do |x| fresh_ds = DB["INSERT INTO mytable (id, col_foo) values ('#{x}' ,'#{myhash[x]}')"] result = fresh_ds.insert catch Sequel::Error do fresh_ds = DB["UPDATE mytable set col_foo = '#{myhash[x]} where id = #{x}"] result = fresh_ds.update end end Maybe my ruby code is wrong or I missed something I don't know. Any solution? Thanks. UPDATE: code below works, the error is caught when unique constraint is violated. @myarray.each do |x| begin # INSERT CODE rescue Sequel::Error # UPDATE CODE end end

    Read the article

  • How to take first file name from a folder in C#

    - by riad
    Hi all, I need to get the first file name from a folder .How i do it in C#? My below code return all the file names.pls guide: DirectoryInfo di = new DirectoryInfo(imgfolderPath); foreach (FileInfo fi in di.GetFiles()) { if (fi.Name != "." && fi.Name != ".." && fi.Name != "Thumbs.db") { string fileName = fi.Name; string fullFileName = fileName.Substring(0, fileName.Length - 4); MessageBox.Show(fullFileName); } } I just need the first file name.pls guide thanks Riad

    Read the article

  • CRUD Question with Codeigniter

    - by Brad
    I have a database with blog entries in it. The desired output I am trying to acheive is 3 entrys displayed using the css3 multi paragraph and then another 3(or more) formatted with the codeigniter Character_limiter. So I need 3 displays formatted one way and 3+ formatted another way on the same page. So far this is what I have, but i do not know how to format the sql to achieve what I want. I can call all posts in descending order like I want, but dont know how to separate the code to achieve my output Controller: $this->db->order_by('id', 'DESC'); $this->db->limit('2'); $query = $this->db->get('posts'); if($query->result()) $data = array(); { $data['blog'] = $query->result(); } $data['title'] = 'LemonRose'; $data['content'] = 'home/home_content'; $this->load->view('template1', $data); View: <?php if (isset($blog)): foreach ($blog as $row): ?> <span class="title"><?php echo $row->title; ?> </span> <?php echo $row->date; ?> <div class="split"><?php echo $row->post =$this->typography->auto_typography($row->post); ?></div> <?php echo 'Post #',$row->id; ?> <p> Trackback URL: <? echo base_url()."trackbacks/track/$row->id";?></p> <hr /> <?php endforeach; endif; ?> The split class is multiple columns. I tried 2 different querys but dont know how to separate all the post displays. Also one query always overides the second and produces all split or all character limited paragraphs. Im lost here lol. Thanks

    Read the article

  • Python and sqlite3 - importing and exporting databases

    - by JPC
    I'm trying to write a script to import a database file. I wrote the script to export the file like so: import sqlite3 con = sqlite3.connect('../sqlite.db') with open('../dump.sql', 'w') as f: for line in con.iterdump(): f.write('%s\n' % line) Now I want to be able to import that database. I tried: import sqlite3 con = sqlite3.connect('../sqlite.db') f = open('../dump.sql','r') str = f.read() con.execute(str) but I'm not allowed to execute more than one statement. Is there a way to get it to run a .sql script directly?

    Read the article

  • help me to choose the best soulotion for my purpose to build my software.

    - by rima
    before answer me plz thinking about the futures of these kind of program and answer me plz. I wanna get some data from oracle server like: 1-get all the function,package,procedure and etc for showing them or drop them & etc... 2-compile my *.sql files,get the result if they have problem & etc... becuz I was beginner in oracle first of all I for solve the second problem I try to connect to sqlPlus by RUN sqlplus and trace the output(I mean,I change the output stream of shell and trace what happend and handle the assigned message to customer. NOW THIS PART SUCCEED. just a little bit I have problem with get all result because the output is asynchronous.any way... [in this case I log in to oracle Server by send argument to the sqlplus by make a process in c#] after that I try to get all function,package or procedure name,but I have problem in speed!so I try to use oracle.DataAccess.dll to connect the database. now I m so confusing about: which way is correct way to build a program that work like Oracle Developer! I do not have any experience for like these program how work. If Your answer is I must use the second way follow this part plz: I search a little bit the Golden,PLedit (Benthic software),I have little bit problem how I must create the connection string?because I thinking about how I can find the host name or port number that oracle work on them?? am I need read the TNSNames.Ora file? IF your answer is I must use the first way follow this part plz: do u have any Idea for how I parse the output?because for example the result of a table is so confusing...[i can handle & program it but I really need someone experience,because the important things to me learn how such software work so nice and with quick response?] All of the has different style in output... If you are not sure Can u help me which book can help me in this way i become expert? becuz for example all the C# write just about how u can connect to DB and the DB books write how u can use this DB program,I looking for a book that give me some Idea how develop an interface for do transaction between these two.not simple send and receive data,for example how write a compiler for them. the language of book is not different for me i know C#,java,VB,sql,Oracle Thanks.

    Read the article

  • As a team should we develop locally and merge into the dev server, or develop on the dev server?

    - by CogitoErgoSum
    Hey, Recently I was tasked with writing up formal procedures for a team based development enviroment. We have several projects with multiple modules each. Right now there are only two programmers, however there are plans to expand to 4-6 programmers. Each programmer will be working on the same project and possibly pages which may cause over writing or error issues. So far the ideal solution I have thought up is: Local development (WAMP/VM or some virtual server instance on their own machine). Once a developer has finished their developments, they check it into the CVS Repository and merge it wih other fixes etc. The CVS version is then deployed to the primary dev server for testing by the devs. The MySQL DAtabases are kept on the primary dev server and users may remotely connect to it. Any Schema / Data alterations are run through a DB Admin who will notify all devs of any DB Changes (Which should be rare). Does anyone see an issue with this or have a better solution?

    Read the article

  • jquery $.ajax not working in firefox against rails (406 response) (works in chrome & IE)

    - by phil swenson
    I have a rails backend and am testing the following jquery code against it: var content = $("#notification_content").val(); var data = new Object(); data.content = content; $.ajax({ url: "/notifications/detect_type.json", type:"POST", data: data, success: function(result ){updateTypeDropDown(result)}}); This code works fine in Chrome and IE. However in Firefox (using Firebug), I see this: http://localhost:3000/notifications/detect_type.json 406 Not Acceptable here is a chrome request in the log: Processing NotificationsController#detect_type (for 127.0.0.1 at 2010-12-21 17:05:59) [POST] Parameters: {"action"="detect_type", "content"="226 south emerson denver co 80209", "controller"="notifications"} User Columns (2.0ms) SHOW FIELDS FROM users User Load (37.4ms) SELECT * FROM users WHERE (users.id = '1') LIMIT 1 Completed in 58ms (View: 1, DB: 40) | 406 Not Acceptable [http://localhost/notifications/detect_type.json] here is a firefox request in the log: Processing NotificationsController#detect_type (for 127.0.0.1 at 2010-12-21 17:06:41) [POST] Parameters: {"action"="detect_type", "content"="226 south emerson 80209", "controller"="notifications"} User Columns (2.1ms) SHOW FIELDS FROM users User Load (30.4ms) SELECT * FROM users WHERE (users.id = '1') LIMIT 1 Completed in 100ms (View: 1, DB: 33) | 200 OK [http://localhost/notifications/detect_type.json] I'm stumped. Ideas?

    Read the article

  • PHP copy problem with uploaded file

    - by ookla
    Hi there, how can I copy two times the same file? I'm trying to do something like this: copy($file['tmp_name'], $folder."1.jpg"); copy($file['tmp_name'], $folder."2.jpg"); copy($file['tmp_name'], $folder."3.jpg"); And how many time does temp files has before it's destroyed by the server? I try using move_uploaded_file also, but I can't make it work. I want to generate 2 thumbs from an uploaded file. Some help? Thanks,

    Read the article

< Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >