Search Results

Search found 11923 results on 477 pages for 'inner classes'.

Page 15/477 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • MySQL LEFT JOIN, INNER JOIN etc, complicated query, PHP + MySQL for a forum

    - by Sven Eriksson
    So I've got a little forum I'm trying to get data for, there are 4 tables, forum, forum_posts, forum_threads and users. What i'm trying to do is to get the latest post for each forum and giving the user a sneak peek of that post, i want to get the number of posts and number of threads in each forum aswell. Also, i want to do this in one query. So here's what i came up with: SELECT lfx_forum_posts.*, lfx_forum.*, COUNT(lfx_forum_posts.pid) as posts_count, lfx_users.username, lfx_users.uid, lfx_forum_threads.tid, lfx_forum_threads.parent_forum as t_parent, lfx_forum_threads.text as t_text, COUNT(lfx_forum_threads.tid) as thread_count FROM lfx_forum LEFT JOIN (lfx_forum_threads INNER JOIN (lfx_forum_posts INNER JOIN lfx_users ON lfx_users.uid = lfx_forum_posts.author) ON lfx_forum_threads.tid = lfx_forum_posts.parent_thread AND lfx_forum_posts.pid = (SELECT MAX(lfx_forum_posts.pid) FROM lfx_forum_posts WHERE lfx_forum_posts.parent_forum = lfx_forum.fid GROUP BY lfx_forum_posts.parent_forum) ) ON lfx_forum.fid = lfx_forum_posts.parent_forum GROUP BY lfx_forum.fid ORDER BY lfx_forum.fid ASC This get the latest post in each forum and gives me a sneakpeek of it, the problem is that lfx_forum_posts.pid = (SELECT MAX(lfx_forum_posts.pid) FROM lfx_forum_posts WHERE lfx_forum_posts.parent_forum = lfx_forum.fid GROUP BY lfx_forum_posts.parent_forum) Makes my COUNT(lfx_forum_posts.pid) go to one (aswell as the COUNT(lfx_forum_threads.tid) which isn't how i would like it to work. My question is: is there some somewhat easy way to make it show the correct number and at the same time fetch the correct post info (the latest one that is)? If something is unclear please tell and i'll try to explain my issue further, it's my first time posting something here.

    Read the article

  • best practice to persist classes model

    - by Yaron Naveh
    My application contains a set of model classes. e.g. Person, Department... The user changes values for instances of these classes in the UI and the classes are persisted to my "project" file. Next time the user can open and edit the project. Next version of my product may change the model classes drastically. It will still need to open existing projects files (I will know how to handle missing data). How is it best to persist my model classes to the project file? The easiest way to persist classes is Data contract serialization. However it will fail on breaking changes (I expect to have such). How to handle this? use some other persistence, e.g. name-value collection or db which is more tolerance ship a "project converter" application to migrate old projects. This requires to either ship with both old and new models or to manipulate xml, which is best?

    Read the article

  • Entity Framework 4 + POCO with custom classes and WCF contracts (serialization problem)

    - by eman
    Yesterday I worked on a project where I upgraded to Entity Framework 4 with the Repository pattern. In one post, I have read that it is necessary to turn off the custom tool generator classes and then write classes (same like entites) by hand. That I can do it, I used the POCO Entity Generator and then deleted the new generated files .tt and all subordinate .cs classes. Then I wrote the "entity classes" by myself. I added the repository pattern and implemented it in the business layer and then implemented a WCF layer, which should call the methods from the business layer. By calling an Insert (Add) method from the presentation layer and everything is OK. But if I call any method that should return some class, then I get an error like (the connection was interrupted by the server). I suppose there is a problem with the serialization or am I wrong? How can by this problem solved? I'm using Visual Studio S2010, Entity Framework 4, C#. UPDATE: I have uploaded the project and hope somebody can help me! link text UPDATE 2: My questions: Why is POCO good (pros/cons)? When should POCO be used? Is POCO + the repository pattern a good choice? Should POCO classes by written by myself or could I use auto generated POCO classes?

    Read the article

  • Mixing together Connect by, inner join and sum with Oracle

    - by François
    Hey there, I need help with a oracle query. Excuse me in advance for my english. Here is my setup: I have 2 tables called respectively "tasks" and "timesheets". The "tasks" table is a recursive one, that way each task can have multiple subtasks. Each timesheet is associated with a task (not necessarily the "root" task) and contains the number of hours worked on it. Example: Tasks id:1 | name: Task A | parent_id: NULL id:2 | name: Task A1 | parent_id: 1 id:3 | name: Task A1.1 | parent_id: 2 id:4 | name: Task B | parent_id: NULL id:5 | name: Task B1 | parent_id: 4 Timesheets id:1 | task_id: 1 | hours: 1 id:2 | task_id: 2 | hours: 3 id:3 | task_id:3 | hours: 1 id:5 | task_id:5 | hours:1 ... What I want to do: I want a query that will return the sum of all the hours worked on a "task hierarchy". If we take a look at the previous example, It means I would like to have the following results: task A - 5 hour(s) | task B - 1 hour(s) At first I tried this SELECT TaskName, Sum(Hours) "TotalHours" FROM ( SELECT replace(sys_connect_by_path(decode(level, 1, t.name), '~'), '~') As TaskName, ts.hours as hours FROM tasks t INNER JOIN timesheets ts ON t.id=ts.task_id START WITH PARENTOID=-1 CONNECT BY PRIOR t.id = t.parent_id ) GROUP BY TaskName Having Sum(Hours) > 0 ORDER BY TaskName And it almost work. THe only problem is that if there are no timesheet for a root task, it will skip the whole hieararchy... but there might be timesheets for the child rows and it is exactly what happens with Task B1. I know it is the "inner join" part that is causing my problem but I'm not sure how can I get rid of it. Any idea how to solve this problem? Thank you

    Read the article

  • Make joomla blog link to inner pages(or blog roll post actual)

    - by somdow
    So i was told to create a blog for client in Joomla and, i have minimal knowledge of Joomla inner workings. I made the blog as seen here http://www.assurancepower.com/about-us/blog.html But the problem is that, the headers/titles for each story in that blog roll cant be clicked. Im wondering is there a way i can make this happen? Essentially this page is a collection of the stories and i want to be able to click on a particular one (any of them) and be taken to its inner page/full version of the story. Not exactly sure what im supposed to do/search for. Im not sure if joomla has a wordpress like functions.php or for example, is there somewhere i can instert a....maybe something like how wordpress does it with permalinks like so: <?php permalink(); ?> //title link here to the actual story. or something like <?php bloginfo('url');?>// this relative link for WP. Etc, All i want is to be able to have these titles in this story be active links to their full counterpart. Not sure what to look for/how to go about fixing this. Thanks in advanced.

    Read the article

  • Inner or Outer left Join

    - by user1557856
    I'm having difficulty modifying a script for this situation and wondering if someone maybe able to help: I have an address table and a phone table both sharing the same column called id_number. So id_number = 2 on both tables refers to the same entity. Address and phone information used to be stored in one table (the address table) but it is now split into address and phone tables since we moved to Oracle 11g. There is a 3rd table called both_ids. This table also has an id_number column in addition to an other_ids column storing SSN and some other ids. Before the table was split into address and phone tables, I had this script: (Written in Sybase) INSERT INTO sometable_3 ( SELECT a.id_number, a.other_id, NVL(a1.addr_type_code,0) home_addr_type_code, NVL(a1.addr_status_code,0) home_addr_status_code, NVL(a1.addr_pref_ind,0) home_addr_pref_ind, NVL(a1.street1,0) home_street1, NVL(a1.street2,0) home_street2, NVL(a1.street3,0) home_street3, NVL(a1.city,0) home_city, NVL(a1.state_code,0) home_state_code, NVL(a1.zipcode,0) home_zipcode, NVL(a1.zip_suffix,0) home_zip_suffix, NVL(a1.telephone_status_code,0) home_phone_status, NVL(a1.area_code,0) home_area_code, NVL(a1.telephone_number,0) home_phone_number, NVL(a1.extension,0) home_phone_extension, NVL(a1.date_modified,'') home_date_modified FROM both_ids a, address a1 WHERE a.id_number = a1.id_number(+) AND a1.addr_type_code = 'H'); Now that we moved to Oracle 11g, the address and phone information are split. How can I modify the above script to generate the same result in Oracle 11g? Do I have to first do INNER JOIN between address and phone tables and then do a LEFT OUTER JOIN to both_ids? I tried the following and it did not work: Insert Into.. select ... FROM a1. address INNER JOIN t.Phone ON a1.id_number = t.id_number LEFT OUTER JOIN both_ids a ON a.id_number = a1.id_number WHERE a1.adrr_type_code = 'H'

    Read the article

  • Sendmail Issue - Local Mail / Inner Domain Mail

    - by ngl5000
    Environments: Ubuntu / Sendmail / Google Apps Emailing: I send and receive all of my emails through google apps besides emails that are sent directly from my website. My Web Domain: example.com (for the purpose of the question only) Problem: When my website sends an email, using sendmail, to any local address ([email protected]) I get an unknown user error. Emails sent to other domains seem to work just fine. Question: I believe this is because I don't have these users defined on my ubuntu server, this is besides the point I need to configure sendmail such that it doesn't pick out local emails sent to ([email protected]) and instead finds their name server which points to google apps and sends it there instead. This is my first try at serverfault, I normally use stackoverflow so let me know if I'm messing up! Thank you!

    Read the article

  • variables used in inner queries

    - by wcpro
    im trying to build a query that has something like this select id, (select top 1 create_date from table2 where table1id = t1.id and status = 'success') [last_success_date], (select count(*) from table2 where table1id = t1.id and create_date > [last_success_date]) [failures_since_success] from table1 t1 as you can see the [last_Success_Date] is not within the scope of the second query, and i was wondering how i could access that value in other queries without having to rerun it?

    Read the article

  • Ubuntu odd mouse and keyboard behavior when window gains inner focus

    - by Scott
    This morning on my Ubuntu 10.10 system when I open a window - for example, system-preferences-about me, if I click in to a field such as "work email", I can no longer close the window with the mouse! Clicking the X on the window will not work. Also, I loose the ability to click on anything else - clicking on the desktop, icons, menus, workspaces, etc. do not work. Even the effect when you hover over a folder on the desktop and that folder highlights - that stops until the window is closed. If I open this same screen but do not click in to a field, everything is fine - I can close the window with the X and everything else works fine. Same thing happens with several other windows I tried. Even calculator - I can open it, everything is fine until I click on a button in the calculator - then no ability to click on anything else. Have to Alt-F4 to close the window. The system is only about a week old from a fresh install (64 bit ubuntu - quad core amd machine). I uninstalled wine, turned off remote desktop/disabled in startup, also in startup disabled visual assistance, bluetooth, dropbox, klipper. Reboot, no difference. The only other thing non-standard I see in startup is nvidia. Using a logitec usb mouse, saitek usb keyboard. Was working fine yesterday. I can not think of anything I did / installed yesterday. I switched themse, then went to update manager and saw two x server / x org related updates and installed them, reboot and NOW IT IS FINE! However, then I re-enabled dropbox, klipper and remote desktop rebooted and the problem is back. Again I disabled and rebooted. Problem is still there!! So somehow I fixed it at least for a few minutes, but now it is back and I am out of ideas.

    Read the article

  • unpack dependency and repack classes using maven?

    - by u123
    I am trying to unpack a maven artifact A and repack it into a new jar file in the maven project B. Unpacking class files from artifact A into: <my.classes.folder>${project.build.directory}/staging</my.classes.folder> works fine using this: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack</id> <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>com.test</groupId> <artifactId>mvn-sample</artifactId> <version>1.0.0-SNAPSHOT</version> <type>jar</type> <overWrite>true</overWrite> <outputDirectory>${my.classes.folder}</outputDirectory> <includes>**/*.class,**/*.xml</includes> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> In the same pom I now want to generate an additional jar containing the classes just unpacked: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>jar</goal> </goals> <configuration> <classesdirectory>${my.classes.folder}</classesdirectory> <classifier>sample</classifier> </configuration> </execution> </executions> </plugin> A new jar is created but it does not contain the classes from the: ${my.classes.folder} its simply a copy of the default project jar. Any ideas? I have tried to follow this guide: http://jkrishnaraotech.blogspot.dk/2011/06/unpack-remove-some-classes-and-repack.html but its not working.

    Read the article

  • Puppet classes out of order despite explicit arrow operator use

    - by Alexandr Kurilin
    Absolute puppet beginner here. I'm experiencing an interesting behavior with my puppet manifests and would love to know what I'm doing wrong. Let's for example say I'm configuring the instance with the following ordered classes: class { 'update_system': } -> class { 'facter': } -> class { 'user_sshkey': user => 'ubuntu', type => 'rsa', } -> class { 'tmux': user => 'ubuntu', } -> class { 'vim': user => 'ubuntu', } -> class { 'bashrc': user => 'ubuntu' } -> notify {"Configuring DB role":} -> class { 'postgresql': } when I run the manifest with the --debug switch, by looking at notify statements I can see the classes be executed in the following order: 1. update_system starts 2. a cron type inside of postgresql class (the very **last** class in that ordered list above) is executed 3. postgres::install starts 5. facter starts installing 6. postgres::configure and postgres::service start 7. the vim class is executed 8. "Configuring DB role" notification is made. All the way at the end here. etc Basically the thing is all over the place, the order doesn't seem to follow the arrow operators in any way. I'm guessing I'm missing something here that would force the classes to execute one at a time. Could it be that I'm missing some kind of anchor pattern here? Invalid containment?

    Read the article

  • Puppet: array in parameterized classes VS using resources

    - by Luke404
    I have some use cases where I want to define multiple similar resources that should end up in a single file (via a template). As an example I'm trying to write a puppet module that will let me manage the mapping between MAC addresses and network interface names (writing udev's persistent-net-rules file from puppet), but there are also many other similar usage cases. I searched around and found that it could be done with the new parameterised classes syntax: if implemented that way it should end up being used like this: node { "myserver.example.com": class { "network::iftab": interfaces => { "eth0" => { "mac" => "ab:cd:ef:98:76:54" } "eth1" => { "mac" => "98:76:de:ad:be:ef" } } } } Not too bad, I agree, but it would rapidly explode when you manage more complex stuff (think network configurations like in this module or any other multiple-complex-resources-in-a-single-config-file stuff). In a similar question on SF someone suggested using Pienaar's puppet-concat module but I doubt it could get any better than parameterised classes. What would be really cool and clean in the configuration definition would be something like the included host type, it's usage is simple, pretty and clean and naturally maps to multiple resources that will end up being configured in a single place. Transposed to my example it would be like: node { "myserver.example.com": interface { "eth0": "mac" => "ab:cd:ef:98:76:54", "foo" => "bar", "asd" => "lol", "eth1": "mac" => "98:76:de:ad:be:ef", "foo" => "rab", "asd" => "olo", } } ...that looks much better to my eyes, even with 3x options to each resource. Should I really be passing arrays to parameterised classes, or there is a better way to do this kind of stuff? Is there some accepted consensus in the puppet [users|developers] community? By the way, I'm referring to the latest stable release of the 2.7 branch and I am not interested in compatibility with older versions.

    Read the article

  • Radar chart color inner circles

    - by JJ
    Hello, Is it possible to color the inner circles of a radar chart. I want to color each section differently The image below should clarify: Wanted radar chart Thanks in advance! Kind Regards, JJ

    Read the article

  • table with black outer, but grey inner border

    - by Jan-Frederik Carl
    Hello, I want to create a html table with a 1pt black outer border and the same border around every td. Should look like this (only the borders, of course) link text I use <table border="1" style="border-collapse:collapse; border-color:Black; border-style:solid; border-width:1pt"> As a result I get a black outer, but grey inner borders.

    Read the article

  • Inner text shadow with CSS

    - by eteubert
    Hey Folks, I am currently playing around with CSS3 and trying to achieve a text effect like this (the black blurry inner shadow): But I cannot find a way to create text shadows inside the text. I wonder whether it is still possible because the box-shadow element is able to render shadow inside like this: box-shadow: inset 0px -5px 10px 0px rgba(0, 0, 0, 0.5); Any ideas?

    Read the article

  • sql inner join problem

    - by Luke
    The following SQL query isn't working. I think the error is on the first line. SELECT SUBSTRING(tbl_news.comment, 1, 250) as tbl_news.comment, tbl_news.id, tbl_news.date, tbl_news.subject, tbl_users.username FROM tbl_news INNER JOIN tbl_users ON tbl_news.creator = tbl_users.id ORDER BY date DESC

    Read the article

  • Adding Items to an Inner (Nested) ListView

    - by Corey O.
    I have 2 asp:ListView controls, one embedded in the other (OuterListView and InnerListView respectively). I am trying to add an asp:linkbutton in the InnerListView layout that will allow the user to add an item to the InnerListView. Unfortunately, when I handle the OnClick event in the linkbutton control, I can't figure out how to get a handle on the asp:linkbutton's parent ListView from within the codebehind handler. Obviously, there is no global handle since there are multiple inner listviews. I can link code if necessary.

    Read the article

  • inner div invisible with jquery

    - by Demiurg
    I'm using JQuery tabs to implement a very simple tabbed web site design. It works OK, unless I define another div inside every pane's div - this inner div is always invisible, i.e. display:none. I can probably hack it to make it work, but maybe I'm missing something. Is it how JQuery supposed to work ?

    Read the article

  • Can I call DbDataAdapter.Fill with a DbDataAdapter.SelectCommand that has a inner join to populate

    - by matti
    or do I have to use 2 separate DbDataAdapters with single-table Selects and then use DataRelations? like: SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo FROM Persons INNER JOIN Orders ON Persons.P_Id=Orders.P_Id ORDER BY Persons.LastName I can't yet try this. I'm designing a xml config file schema for a general program so it would help a lot! -cheers & BR: Matti

    Read the article

  • getting IllegalAccessException when accessing a protected method from parent from inner class

    - by EnToutCas
    I got a very weird problem and a weird solution: class Parent { protected void aProtectedMethod() { doSomething(); } } class Child extends Parent { void anotherMethod() { new SomeInterface() { public void interfaceMethod() { aProtectedMethod(); } }; } } When child.anotherMethod() is run, I got IllegalAccessException at myProtectedMethod(), saying my inner class doesn't have access to the Parent class... However, if I add: protected void aProtectedMethod() { super.aProtectedMethod(); } in my Child class, everything is fine... I wonder why this is?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >