Search Results

Search found 8255 results on 331 pages for 'general guts'.

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

  • General SQL Server query performance

    - by Kiril
    Hey guys, This might be stupid, but databases are not my thing :) Imagine the following scenario. A user can create a post and other users can reply to his post, thus forming a thread. Everything goes in a single table called Posts. All the posts that form a thread are connected with each other through a generated key called ThreadID. This means that when user #1 creates a new post, a ThreadID is generated, and every reply that follows has a ThreadID pointing to the initial post (created by user #1). What I am trying to do is limit the number of replies to let's say 20 per thread. I'm wondering which of the approaches bellow is faster: 1 I add a new integer column (e.x. Counter) to Posts. After a user replies to the initial post, I update the initial post's Counter field. If it reaches 20 I lock the thread. 2 After a user replies to the initial post, I select all the posts that have the same ThreadID. If this collection has more than 20 items, I lock the thread. For further information: I am using SQL Server database and Linq-to-SQL entity model. I'd be glad if you tell me your opinions on the two approaches or share another, faster approach. Best Regards, Kiril

    Read the article

  • Objective-C Social Networking General Question

    - by ludo
    Hi, I've been developing application for Iphone and now I want to try to create appplication like social bookmarking but I didn't really find any help on the net. I will have a create a login/pass, retrieve data and display them. So I want to know what do I have to use to implement all of that for any social bookmarking website. If you have suggestion, idea, tutorial, you are welcome. thanks,

    Read the article

  • General question about Ruby singleton class

    - by Dex
    module MyModule def my_method; 'hello'; end end class MyClass class << self include MyModule end end MyClass.my_method # => "hello I'm unsure why "include MyModule" needs to be in the singleton class in order to be called using just MyClass. Why can't I go: X = MyClass.new X.my_method

    Read the article

  • General ORM design question

    - by Calvin
    Suppose you have 2 classes, Person and Rabbit. A person can do a number of things to a rabbit, s/he can either feed it, buy it and become its owner, or give it away. A rabbit can have none or at most 1 owner at a time. And if it is not fed for a while, it may die. Class Person { Void Feed(Rabbit r); Void Buy(Rabbit r); Void Giveaway(Person p, Rabbit r); Rabbit[] rabbits; } Class Rabbit { Bool IsAlive(); Person pwner; } There are a couple of observations from the domain model: Person and Rabbit can have references to each other Any actions on 1 object can also change the state of the other object Even if no explicit actions are invoked, there can still be a change of state in the objects (e.g. Rabbit can be starved to death, and that causes it to be removed from the Person.rabbits array) As DDD is concerned, I think the correct approach is to synchronize all calls that may change the states in the domain model. For instance, if a Person buys a Rabbit, s/he would need to acquire a lock in Person to make a change to the rabbits array AND also another lock in Rabbit to change its owner before releasing the first one. This would prevent a race condition where 2 Persons claim to be the owner of the little Rabbit. The other approach is to let the database to handle all these synchronizations. Who makes the first call wins, but then the DB needs to have some kind of business logics to figure out if it is a valid transaction (e.g. if a Rabbit already has an owner, it cannot change its owner unless the Person gives it away). There are both pros/cons in either approach, and I’d expect the “best” solution would be somewhere in-between. How would you do it in real life? What’s your take and experience? Also, is it a valid concern that there can be another race condition the domain model has committed its change but before it is fully committed in the database? And for the 3rd observation (i.e. state change due to time factor). How will you do it?

    Read the article

  • General JDBC Setup

    - by AeroDroid
    So I have a MySQL database set up on a Debian server and it works fine from a phpMyAdmin client. I'm currently working on a project to write a Java server that would be able to use the MySQL database that is already on this server through a JDBC connection. I've looked at many tutorials and documentations but all of them seem to just explain how to do client-side code, but I have yet to figure out how to even successfully open a JDBC connection to the server. As far as I am concerned, I believe that program has the drivers properly set up because it's not crashing anymore (I simply direct the Java Build Path of my program to the Connector/J provided by MySQL). As far as my program goes, this is what it looks like... import java.sql.*; public class JDBCTest { public static void main(String[] args) { System.out.println("Started!"); try { DriverManager.registerDriver(new com.mysql.jdbc.Driver()); System.out.println("Driver registered. Connecting..."); Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/", "root", "password"); System.out.println("Connected!"); conn.close(); } catch (SQLException e) { System.out.println("Error!"); e.printStackTrace(); } } } This is what's printed... Started! Driver registered. Connecting... It's as if the DriverManager.getConnection(String) just freezes there. I'm sure this is a problem with the server because when I intentionally misspell localhost, or an IP address, the program crashes within 20 seconds. This just hangs there forever. Sorry about this wall of text, but my final question is if anyone has any information what I should do or install on the server to get this to work? Thank you so much!

    Read the article

  • magento payment process.. how it works in general

    - by spirytus
    hi everyone, got a question and I hope this is right place to ask :).. don’t quite understand how payment works in magento. client goes to checkout and lets say wants to pay as a guest, so provides address etc. and finally gets to payment methods. Then I want clients to pay thru credit card. Already have module installed for gateway (bank?) of my choice. At that point I would expect users to be redirected to 3rd party page (bank hosted) where they giving all the details, only after being returned to my magento site with appropriate message. In magento however it seems like they need to provide cc numbers and details on magento checkout page. I don’t understand if I (or the payment module I installed) need to transfer then all the credit card details to bank? I would have to have checkout page on ssl connection and static ip right? The thing is I want to avoid touching CC numbers at any point and would love to have it done by a bank page. I like the idea of magento interface all the way without redirecting to another page though, the only problem is not sure if would be able to set it all up properly. If anyone could explain to me possible options, what is the common way to do it and how the whole process works that would be very much appreciated. I did my research and looked all over google and various forums still need someones help though. Please let me know if some parts of my question are not quite clear, will try to better explain if necessary.

    Read the article

  • Modern Web Development + General question

    - by ritu
    I have been given a nasty wake up a while ago when I discovered that my 10 years of experience was really equivalent of about 4 (got trapped in a big company doing the same thing over and over without realizing it) and is now paying a huge price. Question 1: I did servlets/JSP programming back in the day (2001-2003). Since then there have been libraries like GWT, YUI, etc. Is JSP still the preferred way of building web apps using Java? Question 2: Because I enjoyed what I was doing and needed to pay the bills, I didn't realize that the ground below me has shifted. How do avoid this in the future? My years of C system programming doesn't seem to matter a lot now to the young guys who talk about design patterns.

    Read the article

  • Framework/App for custom maps(not general google maps)

    - by Franz Xaver
    Hi! I've started to develop in Android 2 weeks ago and until now, I like it! Currently I am working on a project where I have to display an individual map (not a google maps view, I'd like to display the map of a building's interior) with which the user can interact(mark positions, etc.). Is there a framework or an existing app that I could use? Of course I searched the internet but could not find anything. Perhaps it is in some way possible to use the google maps API? I hope you can help me, thanks in advance!

    Read the article

  • C# Parsing html for general use?

    - by Wardy
    What is the best way to take a string of html and turn it in to something useful? Essentially if i take a url and go get the html from that url in .net i get a response but this would come in the form of either a file or stream or string. What if i want an actual document or something I can crawl like an xmldocument object? I have some thoughts and an already implemented solution on this but I am interested to see what the community thinks about this.

    Read the article

  • IN statement performance in PostgreSQL (and in general)

    - by Vasil
    I know this has probably been asked before, but I can't find it with SO's search. Lets say i've TABLE1 and TABLE2, who should I expect the performance of a query such as this: SELECT * FROM TABLE1 WHERE id IN SUBQUERY_ON_TABLE2; as the number of rows in TABLE1 and TABLE2 grow and id is a primary key on TABLE1. Yes, I know using IN is such a n00b mistake, but TABLE2 has a generic relation (django generic relation) to multiple other tables so I can't think of another way to filter the data. At what (aproximate) ammount of rows in TABLE1 and TABLE2 should I expect to notice performance issues because of this? Will performance degrade linearly, exponentially etc. depending on the number of rows?

    Read the article

  • Simple web general localization/translation backend (using mysql)?

    - by Hendrik
    Hi is there a free avaible translation backend with database avaible which can handle multiple users(no login needed), multiple languages (UTF-8) and provides automatic google translation? I just need this tool to fill a database (preferable mysql) with simple tables like this: language | label | text english | _helloworld | Hello World! german | _helloworld | Hallo Welt! I don't care about export since this will have to be created anyways.. Thanks it would be a real timesaver if something with an usable UI exists already.

    Read the article

  • Python CLI tool - general parsing question

    - by WinkyWolly
    If possible I would like to use the following structure for a command however I can't seem to figure out how to achieve this in Python: ./somescript.py arg <optional argument> -- "some long argument" Would it be possible to achieve this in a feasible manner without too much dirty code? Or should I just reconsider the syntax (which is primarily preference). Thanks!

    Read the article

  • best practice - loging events (general) and changes (database)

    - by b0x0rz
    need help with logging all activities on a site as well as database changes. requirements: * should be in database * should be easily searchable by initiator (user name / session id), event (activity type) and event parameters i can think of a database design but either it involves a lot of tables (one per event) so i can log each of the parameters of an event in a separate field OR it involves one table with generic fields (7 int numeric and 7 text types) and log everything in one table with event type field determining what parameter got written where (and hoping that i don't need more than 7 fields of a certain type, or 8 or 9 or whatever number i choose)... example of entries (the usual things): [username] login failed @datetime [username] login successful @datetime [username] changed password @datetime, estimated security of password [low/ok/high/perfect] @datetime [username] clicked result [result number] [result id] after searching for [search string] and got [number of results] @datetime [username] clicked result [result number] [result id] after searching for [search string] and got [number of results] @datetime [username] changed profile name from [old name] to [new name] @datetime [username] verified name with [credit card type] credit card @datetime datbase table [table name] purged of old entries @datetime etc... so anyone dealt with this before? any best practices / links you can share? i've seen it done with the generic solution mentioned above, but somehow that goes against what i learned from database design, but as you can see the sheer number of events that need to be trackable (each user will be able to see this info) is giving me headaches, BUT i do LOVE the one event per table solution more than the generic one. any thoughts? edit: also, is there maybe an authoritative list of such (likely) events somewhere? thnx stack overflow says: the question you're asking appears subjective and is likely to be closed. my answer: probably is subjective, but it is directly related to my issue i have with designing a database / writing my code, so i'd welcome any help. also i tried narrowing down the ideas to 2 so hopefully one of these will prevail, unless there already is an established solution for these kinds of things.

    Read the article

  • Best practice - logging events (general) and changes (database)

    - by b0x0rz
    need help with logging all activities on a site as well as database changes. requirements: * should be in database * should be easily searchable by initiator (user name / session id), event (activity type) and event parameters i can think of a database design but either it involves a lot of tables (one per event) so i can log each of the parameters of an event in a separate field OR it involves one table with generic fields (7 int numeric and 7 text types) and log everything in one table with event type field determining what parameter got written where (and hoping that i don't need more than 7 fields of a certain type, or 8 or 9 or whatever number i choose)... example of entries (the usual things): [username] login failed @datetime [username] login successful @datetime [username] changed password @datetime, estimated security of password [low/ok/high/perfect] @datetime [username] clicked result [result number] [result id] after searching for [search string] and got [number of results] @datetime [username] clicked result [result number] [result id] after searching for [search string] and got [number of results] @datetime [username] changed profile name from [old name] to [new name] @datetime [username] verified name with [credit card type] credit card @datetime datbase table [table name] purged of old entries @datetime via automated process etc... so anyone dealt with this before? any best practices / links you can share? i've seen it done with the generic solution mentioned above, but somehow that goes against what i learned from database design, but as you can see the sheer number of events that need to be trackable (each user will be able to see this info) is giving me headaches, BUT i do LOVE the one event per table solution more than the generic one. any thoughts? edit: also, is there maybe an authoritative list of such (likely) events somewhere? thnx stack overflow says: the question you're asking appears subjective and is likely to be closed. my answer: probably is subjective, but it is directly related to my issue i have with designing a database / writing my code, so i'd welcome any help. also i tried narrowing down the ideas to 2 so hopefully one of these will prevail, unless there already is an established solution for these kinds of things.

    Read the article

  • Visual Studio Web Development - General Question?

    - by elviraHiggins
    Hi, I like using Visual Basic for C++. I'm a student I noticed the web development feature in it, and I was wondering if it is any good for web design, maybe if someone has used it or does use it if they can give a few words on weather or not it's worth learning? I have been using Dreamweaver as my platform for web design. So pretty much I'm asking Dreamweaver VS Visual Studio for webdesign, pros and cons?

    Read the article

  • Backbone events not firing (this.el undefined) & general feedback on use of the framework

    - by Leo
    I am very new to backbone.js and I am struggling a little. I figured out a way to get data from the server (in json) onto the screen successfully but am I doing it the right/best way? I know there is something wrong because the only view which contains a valid this.el is the parent view. I suspect that because of this, the events of the view are not firing ()... What is the best way forward? Here is the code: var surveyUrl = "/api/Survey?format=json&callback=?"; $(function () { AnswerOption = Backbone.Model.extend({}); AnswerOptionList = Backbone.Collection.extend({ initialize: function (models, options) { this.bind("add", options.view.render); } }); AnswerOptionView = Backbone.View.extend({ initialize: function () { this.answerOptionList = new AnswerOptionList(null, { view: this }); _.bindAll(this, 'render'); }, events: { "click .answerOptionControl": "updateCheckedState" //does not fire because there is no this.el }, render: function (model) { // Compile the template using underscore var template = _.template($("#questionAnswerOptionTemplate").html(), model.answerOption); $('#answerOptions' + model.answerOption.questionId + '>fieldset').append(template); return this; }, updateCheckedState: function (data) { //never hit... } }); Question = Backbone.Model.extend({}); QuestionList = Backbone.Collection.extend({ initialize: function (models, options) { this.bind("add", options.view.render); } }); QuestionView = Backbone.View.extend({ initialize: function () { this.questionlist = new QuestionList(null, { view: this }); _.bindAll(this, 'render'); }, render: function (model) { // Compile the template using underscore var template = _.template($("#questionTemplate").html(), model.question); $("#questions").append(template); //append answers using AnswerOptionView var view = new AnswerOptionView(); for (var i = 0; i < model.question.answerOptions.length; i++) { var qModel = new AnswerOption(); qModel.answerOption = model.question.answerOptions[i]; qModel.questionChoiceType = ChoiceType(); view.answerOptionList.add(qModel); } $('#questions').trigger('create'); return this; } }); Survey = Backbone.Model.extend({ url: function () { return this.get("id") ? surveyUrl + '/' + this.get("id") : surveyUrl; } }); SurveyList = Backbone.Collection.extend({ model: Survey, url: surveyUrl }); aSurvey = new Survey({ Id: 1 }); SurveyView = Backbone.View.extend({ model: aSurvey, initialize: function () { _.bindAll(this, 'render'); this.model.bind('refresh', this.render); this.model.bind('change', this.render); this.model.view = this; }, // Re-render the contents render: function () { var view = new QuestionView(); //{el:this.el}); for (var i = 0; i < this.model.attributes[0].questions.length; i++) { var qModel = new Question(); qModel.question = this.model.attributes[0].questions[i]; view.questionlist.add(qModel); } } }); window.App = new SurveyView(aSurvey); aSurvey.fetch(); }); -html <body> <div id="questions"></div> <!-- Templates --> <script type="text/template" id="questionAnswerOptionTemplate"> <input name="answerOptionGroup<%= questionId %>" id="answerOptionInput<%= id %>" type="checkbox" class="answerOptionControl"/> <label for="answerOptionInput<%= id %>"><%= text %></label> </script> <script type="text/template" id="questionTemplate"> <div id="question<%=id %>" class="questionWithCurve"> <h1><%= headerText %></h1> <h2><%= subText %></h2> <div data-role="fieldcontain" id="answerOptions<%= id %>" > <fieldset data-role="controlgroup" data-type="vertical"> <legend> </legend> </fieldset> </div> </div> </script> </body> And the JSON from the server: ? ({ "name": "Survey", "questions": [{ "surveyId": 1, "headerText": "Question 1", "subText": "subtext", "type": "Choice", "positionOrder": 1, "answerOptions": [{ "questionId": 1, "text": "Question 1 - Option 1", "positionOrder": 1, "id": 1, "createdOn": "\/Date(1333666034297+0100)\/" }, { "questionId": 1, "text": "Question 1 - Option 2", "positionOrder": 2, "id": 2, "createdOn": "\/Date(1333666034340+0100)\/" }, { "questionId": 1, "text": "Question 1 - Option 3", "positionOrder": 3, "id": 3, "createdOn": "\/Date(1333666034350+0100)\/" }], "questionValidators": [{ "questionId": 1, "value": "3", "type": "MaxAnswers", "id": 1, "createdOn": "\/Date(1333666034267+0100)\/" }, { "questionId": 1, "value": "1", "type": "MinAnswers", "id": 2, "createdOn": "\/Date(1333666034283+0100)\/" }], "id": 1, "createdOn": "\/Date(1333666034257+0100)\/" }, { "surveyId": 1, "headerText": "Question 2", "subText": "subtext", "type": "Choice", "positionOrder": 2, "answerOptions": [{ "questionId": 2, "text": "Question 2 - Option 1", "positionOrder": 1, "id": 4, "createdOn": "\/Date(1333666034427+0100)\/" }, { "questionId": 2, "text": "Question 2 - Option 2", "positionOrder": 2, "id": 5, "createdOn": "\/Date(1333666034440+0100)\/" }, { "questionId": 2, "text": "Question 2 - Option 3", "positionOrder": 3, "id": 6, "createdOn": "\/Date(1333666034447+0100)\/" }], "questionValidators": [{ "questionId": 2, "value": "3", "type": "MaxAnswers", "id": 3, "createdOn": "\/Date(1333666034407+0100)\/" }, { "questionId": 2, "value": "1", "type": "MinAnswers", "id": 4, "createdOn": "\/Date(1333666034417+0100)\/" }], "id": 2, "createdOn": "\/Date(1333666034377+0100)\/" }, { "surveyId": 1, "headerText": "Question 3", "subText": "subtext", "type": "Choice", "positionOrder": 3, "answerOptions": [{ "questionId": 3, "text": "Question 3 - Option 1", "positionOrder": 1, "id": 7, "createdOn": "\/Date(1333666034477+0100)\/" }, { "questionId": 3, "text": "Question 3 - Option 2", "positionOrder": 2, "id": 8, "createdOn": "\/Date(1333666034483+0100)\/" }, { "questionId": 3, "text": "Question 3 - Option 3", "positionOrder": 3, "id": 9, "createdOn": "\/Date(1333666034487+0100)\/" }], "questionValidators": [{ "questionId": 3, "value": "3", "type": "MaxAnswers", "id": 5, "createdOn": "\/Date(1333666034463+0100)\/" }, { "questionId": 3, "value": "1", "type": "MinAnswers", "id": 6, "createdOn": "\/Date(1333666034470+0100)\/" }], "id": 3, "createdOn": "\/Date(1333666034457+0100)\/" }, { "surveyId": 1, "headerText": "Question 4", "subText": "subtext", "type": "Choice", "positionOrder": 4, "answerOptions": [{ "questionId": 4, "text": "Question 4 - Option 1", "positionOrder": 1, "id": 10, "createdOn": "\/Date(1333666034500+0100)\/" }, { "questionId": 4, "text": "Question 4 - Option 2", "positionOrder": 2, "id": 11, "createdOn": "\/Date(1333666034507+0100)\/" }, { "questionId": 4, "text": "Question 4 - Option 3", "positionOrder": 3, "id": 12, "createdOn": "\/Date(1333666034507+0100)\/" }], "questionValidators": [{ "questionId": 4, "value": "3", "type": "MaxAnswers", "id": 7, "createdOn": "\/Date(1333666034493+0100)\/" }, { "questionId": 4, "value": "1", "type": "MinAnswers", "id": 8, "createdOn": "\/Date(1333666034497+0100)\/" }], "id": 4, "createdOn": "\/Date(1333666034490+0100)\/" }], "id": 1, "createdOn": "\/Date(1333666034243+0100)\/" })

    Read the article

  • PHP general form generator/builder

    - by Ehsan
    I'm looking for an open source php form builder or form generator to add/edit/delete/search records? I have to create a simple manager for some records, it's a common application that should be found easily, but I can't find any good code/class/application/etc :( Any help is appreciated.

    Read the article

  • Application path in General class (.CS)

    - by Anu
    Hi i want to get applcation path in one seperate class used in my XAML,WPF applcation. In Animals.cs, string aPath2 = Application.StartupPath; MessageBox.Show(path); It shws error error CS0117: 'System.Windows.Application' does not contain a definition for 'StartupPath' I have to give data to treeview,im taking that all details from file in applcation path.

    Read the article

  • General Question about MD5

    - by chicane
    So im just playing around with PHP and the MD5 functionality, sorry if this sounds really silly, but I cant seem to understand, how is it possible to represent an unlimited number of characters of input into a 32 bit character output? Is my logic sound here? Or is there a limit to the input that a MD5 function can take? Thanks...

    Read the article

  • Retaining Managed objects - more general retaining objects

    - by Luuk D. Jansen
    A quick question regarding Managed Objects. I created an Array with Managed Objects (in Object 1: TableViewConbtroller), and pass one of those objects to another class/object (object 2: TableCell). The original array should still be retained in the original caller class. Then Object 2 is released, does that mean that that particular item in the array is released as well, as the reference to it in Object 2 was released? I am trying to better understand how to work with ManagedObjects as I get 'Object was released' errors. [EDIT] After some experimenting I came across the following scenario: I have the main AppDelegate. In a different class I create an AppDelegate to obtain the ManagedObjectContext. appDelegate = (iDomsAppDelegate *)[[UIApplication sharedApplication] delegate]; [self setContext:[appDelegate managedObjectContext]]; When the class is finished, and I release it, the variable in the class 'appDelegate' is also released. But then the ManagedObjectContext is closed, and obvious any future attempt to use it will cause a crash. So should I leave the appDelegate unreleased? This comes to the same question as the above about when and how to release in those situations where an objects is used from another class. I think a way of putting it is, how to know when you own an object and when not.

    Read the article

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