Search Results

Search found 14182 results on 568 pages for 'andrew answer'.

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

  • NHibernate's automatic (dirty checking) update behaviour - turning it off

    - by Andrew Bullock
    I've just discovered that if I get an object from an NHibernate session and change a property on object, NHibernate will automatically update the object on commit without me calling Session.Update(myObj)! I can see how this could be helpful, but as default behaviour it seems crazy! How can I stop this happening? Is this default NHib behaviour or something coming from Fluent NHibs AutoPersistenceModel? If there's no way to stop this, what do I do? Unless I'm missing the point this behaviour seems to create a right mess, violating my UoW. Im using NHibernate 2.0.1.4 and a Fluent NHib build from 18/3/2009 Edit, is this guy right with his answer? Edit: I've also read that overriding an Event Listener could be a solution to this. However, IDirtyCheckEventListener.OnDirtyCheck isn't called in this situation. Does anyone know which listener I need to override? Thanks Andrew

    Read the article

  • wheel of fortune collision detection

    - by Andrew
    Hey, I have a wheel segmented into 8 pie pieces, and a picker that is pointing at the currently selected segment (think wheel of fortune). I want to highlight the currently selected segment, and so have started to use Chipmunk to construct the 8 segments, attached to a rotating body, and then the picker that is put in a position to collide with each of the segments. The trick is, how do you allow the picker to pass over top of the segments, while still getting the collision, but not actually colliding and slowing down the wheel? I haven't started down this path yet, but thought this may solve the problem: removing the colliding segment and then putting it back after the picker has started colliding with another segment a bit away (like two segments away). There may be a much simpler solution not even involving Chipmunk that I haven't thought of. Thanks, Andrew

    Read the article

  • Tips on debugging copy and paste into powerpoint 2010

    - by Andrew S.
    I have a custom application in C++ that has been used to successfully copy-and-paste an object from the application into MS Office 2003 and 2007 (Word, Excel and PowerPoint). The object opens in our own custom activeX control. Now with windows XP and PowerPoint 2010, nothing happens on the cut-and-paste. I have tried turning off the smart copy/paste to no avail. Copy/paste works with Word and Excel 2010. Do you have tips on how to debug this? Thanks Andrew

    Read the article

  • filtering for multiple values on one column. All values must exist, else - return zero

    - by Andrew
    Hello All, I would like to filter one column in a table for couple values and show results only if all those values are there. If one or more is missing, then return zero results. example table +----+--------+----------+ | id | Fruit | Color | +----+--------+----------+ | 1 | apple | red | | 2 | mango | yellow | | 3 | banana | yellow | +----+--------+----------+ example "wrong" code: (this must return 3 rows) select Fruit FROM table WHERE Color = red AND Color = yellow but select Fruit FROM table WHERE Color = red AND Color = green must return 0 rows. (If i use select Fruit FROM table WHERE Color = red OR Color = green i get 1 row which is not what i need) I am using PHP with form where user checks different checkboxes that represent different values of the same column. So when he selects multiple checkboxes, all those values should be in the result set, otherwise no result should be given. Thank you, Andrew

    Read the article

  • NHibernate Linq queries not returning data saved in the same transaction

    - by Andrew
    Hi, I have a situation where I am using NHibernate in a WCF service and using a TransactionScope for the transaction management. NHibernate enlists in the ambient transaction fine, but, any changes I make and save inside the transaction, are not visible to any queries I make while still in that transaction. So if I add an entity and session.save() it, then further on in the code, there is a linq query against that entities table, the entity I just added is not returned. Strangely this seems to work fine if I use explicit NHibernate transactions in my tests. Anyone have any ideas as to why and what I can do about it? Many thanks Andrew

    Read the article

  • Large Data Table with first column fixed

    - by bhavya_w
    I have structure as shown in the fiddle http://jsfiddle.net/5LN7U/. <section class="container"> <section class="field"> <ul> <li> Question 1 </li> <li> question 2 </li> <li> question 3 </li> <li> question 4 </li> <li> question 5 </li> <li> question 6 </li> <li> question 7 </li> </ul> </section> <section class="datawrap"> <section class="datawrapinner"> <ul> <li><b>Answer 1 :</b></li> <li><b>Answer 2 :</b></li> <li><b>Answer 3 :</b></li> <li><b>Answer 4 :</b></li> <li><b>Answer 5 :</b></li> <li><b>Answer 6 :</b></li> <li><b>Answer 7 :</b></li> </ul> </section> </section> </section> Basically its a table structure made using divs. The first column contains a long list of questions and the second column contains answers/multiple answers which can be quite big ( there has to be horizontal scrolling in the second column.) The problem i am facing is when i scroll downwards the second column which has the horizontal scroll bar is also scrolling downward. I want horizontal scrollbar to be fixed there. as in it should be always fixed there no matter how much i scroll vertically. Much Like Google Spreadsheets: where the first column stays fixed and there's horizontal scrolling on rest of the columns with over vertical scrolling for whole of the data. I cannot used position fixed in the second column. P.S : please no lectures on using div's for making a table structure. I have my own reasons. and its kinda urgent. Thanks in advance.

    Read the article

  • Strange DNS issue with internal Windows DNS

    - by Brady
    I've encountered a strange issue with our internal Windows DNS infrastructure. We have a website hosted on Amazon EC2 with the DNS running on Amazon Route 53. In the publicly facing DNS we have the wildcard record setup as an A record Alias pointing to an AWS Elastic Load Balancer sitting in front of our EC2 instances. For those who are not aware, the A record Alias behaves like a CNAME record, however no extra lookup is required on the client side (See http://docs.amazonwebservices.com/Route53/latest/DeveloperGuide/CreatingAliasRRSets.html for more information). We have a secondary domain that has the www subdomain as a CNAME pointing to a subdomain on the primary domain, which resolves against the wildcard entry. For example the subdomain www.secondary.com is a CNAME to sub1.primary.com, but there is no explicit entry for sub1.primary.com, so it resolves to wildcard record. This setup work without issue publicly. The issue comes in our internal DNS at our corporate office where we use the same primary domain for some internal only facing sites. In this setup we have two Active Directory DNS servers with one Server 2003 and one Server 2008 R2 instance. The zone is an AD integrated zone, but it is not the AD domain. In the internal DNS we have the wildcard record pointing to a third external domain, that is also hosted on Route 53 with an A record Alias pointing to the same ELB instance. For example, *.primary.com is a CNAME to tertiary.com, so in effect you have www.secondary.com as a CNAME to *.primary.com, which is a CNAME to tertiary.com. In this setup, attempting to resolve www.secondary.com will fail. Clearing the cache on the Server 2003 instance will allow it to resolve once, but subsequent attempts will fail. It fails even with a clean cache against the 2008 R2 server. It seems that only Windows clients are affected. A Mac running OSX Mountain Lion does not experience this issue. I'm even able to replicate the issue using nslookup. Against the 2003 server, with a freshly cleaned cache, I recieve the appropriate response from www.secondary.com: Non-authoritative answer: Name: subdomain.primary.com Address: x.x.x.x (Public IP) Aliases: www.secondary.com Subsequent checks simply return: Non-authoritative answer: Name: www.secondary.com If you set the type to CNAME you get the appropriate responses all the time. www.secondary.com gives you: Non-authoritative answer: www.secondary.com canonical name = subdomain.primary.com And subdomain.primary.com gives you: subdomain.primary.com canonical name = tertiary.com And setting type back to A gives you the appropriate response for tertiary.com: Non-authoritative answer: Name: tertiary.com Address: x.x.x.x (Public IP) Against the 2008 R2 server things are a little different. Even with a clean cache, www.secondary.com returns just: Non-authoritative answer: Name: www.secondary.com The CNAME records are returned appropriately. www.secondary.com returns: Non-authoritative answer: www.secondary.com canonical name = subdomain.primary.com And subdomain.primary.com gives you: subdomain.primary.com canonical name = tertiary.com tertiary.com internet address = x.x.x.x (Public IP) tertiary.com AAAA IPv6 address = x::x (Public IPv6) And setting type back to A gives you the appropriate response for tertiary.com: Non-authoritative answer: Name: tertiary.com Address: x.x.x.x (Public IP) Requests directly against subdomain.primary.com work correctly.

    Read the article

  • How to make Firefox use TCP for DNS

    - by miniBill
    I want to use TCP for DNS, to bypass my ISP's slow and broken DNS servers. I'm not using (and don't want to use) a proxy. Note: I want to use DNS over TCP because if I use it over udp, no matter what server I set, I get answers from my ISP's DNS. Notice that I will fiercely downvote whoever suggests: programs to do TCP over DNS, the setting in about:config to make DNS go over the proxy too: I'm not using a proxy, use another DNS: I've already set up Google as my DNS, but I get intercepted. Example of what I mean by saying intercept: $ dig @8.8.8.8 thepiratebay.se ; <<>> DiG 9.8.1 <<>> @8.8.8.8 thepiratebay.se ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24385 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;thepiratebay.se. IN A ;; ANSWER SECTION: thepiratebay.se. 28800 IN A 83.224.65.41 ;; Query time: 50 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Sun Sep 16 22:51:06 2012 ;; MSG SIZE rcvd: 49 $ dig +tcp @8.8.8.8 thepiratebay.se ; <<>> DiG 9.8.1 <<>> +tcp @8.8.8.8 thepiratebay.se ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15131 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;thepiratebay.se. IN A ;; ANSWER SECTION: thepiratebay.se. 436 IN A 194.71.107.15 ;; Query time: 61 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Sun Sep 16 22:51:10 2012 ;; MSG SIZE rcvd: 49 If it matters, I'm using Firefox 14 on Gentoo Linux.

    Read the article

  • attach / detach mssql 2008 sql server manager [SOLVED]

    - by Tillebeck
    An external consult wrote a guide on how to copy a database. Step two was detach the database using Sql Server Manager. After the detach the database was not visible in the SQL Server Manager... Not much to do but write a mail to the service provider asking to have the database attached again. The service porviders answer: Not posisble to attach again since the SQL Server security has been violated". Rolling back to last backup is not the option I want to use. Can any one give feedback if this seems logic and reasonable to assume that a detached database in a SQL Server 2008 accessed through SQL Server Manager cannot be reattached. It was done by rightclicking the database and choosing detach. -- update -- Based on the comments below I update the question with the server setup. There are two dedicated servers: srv1: Web server with remote desktop and an Sql Server Manager srv2: Sql server that can be accessed through the Sql Server Manager on the web server -- update2 -- After a restart of the server the DBA could suddenly do the attachment of the database. And I guess that after the restart it was a simple task. So all of your answer were rigth! It seems that I can only mark one as a correct answer so I marked the first answer correct. But all are correct answer. Thanks a lot. Without posting the link to this thread then we might had so suffer while watching our database beeing restored by a backup :-) Thanks a lot. BR. Anders

    Read the article

  • How is DNS related to Active Directory and what are some common configurations that I should be aware of?

    - by MDMarra
    Please note that I do know the answer to this and have provided one below. I see a lot of newer systems administrators that don't understand the contents of my answer, so I hope that all of the beginner AD DNS questions will be closed as a duplicate of this. If you have a minor improvement, feel free to edit my answer. If you can provide a more comprehensive complete answer, feel free to leave one. How is DNS related to Active Directory and what are some common configurations that I should be aware of?

    Read the article

  • Weird DNS bug - external server resolves to internal IP

    - by emilecantin
    I have a server that is hosted by my university. I have root access, but no control over network setup, firewall, etc. This server's DNS resolves to an internal IP here on campus (10.x.x.x), and an external IP outside campus. I also have a few servers hosted at Amazon, and they mostly work well. However, one of them started to resolve the university server by its internal IP address. This causes problems, as 10.x.x.x on Amazon EC2 is someone else. I have connected to the Amazon server with SSH agent forwarding a few times in the past, to access a Git repository on the university server. Any idea what could cause this? EDIT: Here's my /etc/resolv.conf # Generated by dhcpcd for interface eth0 search ec2.internal nameserver 172.16.0.23 Here's the output of dig myserver.myuniversity.ca.: ; <<>> DiG 9.8.1-P1 <<>> myserver.myuniversity.ca. ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34470 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;myserver.myuniversity.ca. IN A ;; ANSWER SECTION: myserver.myuniversity.ca. 537586 IN A 10.43.x.x ;; Query time: 2 msec ;; SERVER: 172.16.0.23#53(172.16.0.23) ;; WHEN: Wed Nov 28 16:07:21 2012 ;; MSG SIZE rcvd: 60 Here's the expected output (on another Amazon server): ; <<>> DiG 9.8.1-P1 <<>> myserver.myuniversity.ca. ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8045 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;myserver.myuniversity.ca. IN A ;; ANSWER SECTION: myserver.myuniversity.ca. 601733 IN A x.x.239.1 ;; Query time: 1 msec ;; SERVER: 172.16.0.23#53(172.16.0.23) ;; WHEN: Wed Nov 28 16:09:36 2012 ;; MSG SIZE rcvd: 60

    Read the article

  • What are some "must have" Windows programs?

    - by hmemcpy
    Inspired by this question, what 3rd party essential software do you have on a Windows machine? One per answer please, and if you can, please provide the download/site link. Notice: Check the other pages before you propose a new answer, as your program might have been mentioned already. If so, vote for this answer instead of writing a new one.

    Read the article

  • Frustration with superuser.com user interface (please migrate this to "meta")

    - by Randolf Richardson
    Can someone please migrate this question to "meta" for me? I'm unable to post there while I wait for OpenID to fix my password problems. Thanks. I'm having problems with superuser.com's interface -- when I provide an answer to a question, sometimes the buttons get locked and then I find out that the question was migrated. Usually I can go back and copy-and-paste my answer at whatever site it goes to, but on occasion my answer is lost and I have to re-type it. This is very time-consuming, and makes it quite frustrating to use the system. In addition, I find that I'm wasting a lot of time dealing with having to re-register on the other sites. My suggestion is to not de-activate the "Submit answer" button but to just forward that along to the migrated site automatically, thus ensuring that answers that people put a lot of effort into don't get lost. Thanks in advance.

    Read the article

  • Can dd-wrt or tomato keep track of GB usage per billing period per device?

    - by Sam Hasler
    I want to be able to track the usage of each device connecting to our router so we can split up the ISP bill by usage. Can dd-wrt or tomato provide the stats I'd need to do this? Update: After a bit of googling I'm aware of a much better answer than the current one. However I suspect there's probably more answers out there for other firmwares so in the interests of getting a more diverse set of answers—­and, I'll admit, because I'm getting tired of reading through obtuse firmware documentation—I've put up a bounty. If the only answer added is the one I've found I'll be happy to accept it for the bounty, otherwise I'll add it and accept it myself, but I'm hoping for an even better answer, or at least some options for other firmwares as from looking I've seen a few other people have asked for this and there doesn't appear to be a definitive answer, let's make this it! Go lazywebs! (Sorry. I've always wanted to say that.)

    Read the article

  • dnsmasq local network works for some but hostnames are not resolving for others

    - by prggmr
    I have set up a local network and it seems that some of us can use it properly while others can't. The problem seems to be that the local hostnames I setup don't get resolved for everyone. To overview how the network is setup: I am running an Ubuntu 10.01 server using dnsmasq, this server is setup to act as our primary DNS server, configured via our router. dnsmasq is configured using the options of domain-needed bogus-priv I use the /etc/hosts file to determain the hostnames 192.168.1.10 ra.xsi 192.168.1.10 test.xsi From my machine: If I dig the hostnames they resolve properly ; <<>> DiG 9.4.3-P1 <<>> ra.xsi ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61671 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;ra.xsi. IN A ;; ANSWER SECTION: ra.xsi. 0 IN A 192.168.1.10 ;; Query time: 9 msec ;; SERVER: 192.168.1.10#53(192.168.1.10) ;; WHEN: Wed Nov 9 12:28:34 2011 ;; MSG SIZE rcvd: 40 Ping also works: PING ra.xsi (192.168.1.10): 56 data bytes 64 bytes from 192.168.1.10: icmp_seq=0 ttl=64 time=0.834 ms 64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.699 ms ^C --- ra.xsi ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.699/0.766/0.834/0.068 ms And login via SSH works using the hostname. For those that cannot connect using hostnames, if I dig from their machine it appears the name is being resolved, but they cannot ping, SSH or http access the hostname. ; <<>> DiG 9.6.0-APPLE-P2 <<>> ra ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12554 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;ra.xsi. IN A ;; ANSWER SECTION: ra.xsi. 0 IN A 192.168.1.10 ;; Query time: 8 msec ;; SERVER: 192.168.1.10#53(192.168.1.10) ;; WHEN: Wed Nov 9 12:05:50 2011 ;; MSG SIZE rcvd: 36 I've been banging my head at this and just can't seem to figure it out.

    Read the article

  • useful JMX metrics for monitoring WebSphere Application Server (and apps inside it)?

    - by Justin Grant
    When managing custom Java applications hosted inside WebSphere Application Server, what JMX metrics do you find most useful for monitoring performance, monitoring availability, and troubleshooting problems? And how do you prefer to slice and visualize those metrics (e.g. chart by top 10 hosts, graph by app, etc.). The more details I can get, the better, as I need to specify a standard set of reports which IT can offer to owners of applications hosted by IT, which those owners can customize but many won't bother. So I'll need to come up with a bunch of generally-applicable reports which most groups can use out-of-the-box. Obviously there's no one perfect answer to this question, so I'll accept the answer with the most comprehensive details and I'll be generous about upvoting any other useful answer. My question is WebSphere-specific, but I realize that most JMX metrics are equally applicable across any container, so feel free to give an answer for JBoss, Tomcat, WebLogic, etc.

    Read the article

  • Google DNS Same Entry Different Results

    - by Henrik P. Hessel
    Why is this happening? The Rootserver returns a wrong entry I fixed containing 5269.XXX.com. instead of 5269 XXX.com. Macbook @ Home ; <<>> DiG 9.6.0-APPLE-P2 <<>> @8.8.8.8 srv _xmpp-server._tcp.XXX.com. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18412 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;_xmpp-server._tcp.XXX.com. IN SRV ;; ANSWER SECTION: _xmpp-server._tcp.XXX.com. 64328 IN SRV 10 0 5269 XXX.com. ;; Query time: 21 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Tue Dec 28 03:16:45 2010 ;; MSG SIZE rcvd: 86 Rootserver ; <<>> DiG 9.6-ESV-R1 <<>> @8.8.8.8 srv _xmpp-server._tcp.XXX.com. ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27240 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;_xmpp-server._tcp.XXX.com. IN SRV ;; ANSWER SECTION: _xmpp-server._tcp.XXX.com. 52139 IN SRV 0 10 0 5269.XXX.com. ;; Query time: 7 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Tue Dec 28 03:23:23 2010 ;; MSG SIZE rcvd: 91

    Read the article

  • DNS no longer works after server reboot

    - by Burning the Codeigniter
    Strangely enough, when I reboot my Ubuntu 12.04 server, the DNS no longer works, which makes the domain unavailable to access to my site. Normally the DNS should be working after a reboot, but this doesn't happen anymore. I use nginx to serve content, but nginx is already configured to work with my domains. What are the typical practises must I do after a reboot and how can I solve this issue I experience? I already have BIND, networking and resolvconf to boot when the server boots up. ; <<>> DiG 9.8.1-P1 <<>> mysite.com ;; global options: +cmd ;; connection timed out; no servers could be reached This is my output with dig $ttl 38400 mysite.com. IN SOA ns1.mysite.com. webmaster.mysite.com. ( 1055026205 6H 1H 5D 20M ) mysite.com. IN A xx.xx.xx.xx # Server IP *.mysite.com. IN A xx.xx.xx.xx # Server IP www.mysite.com. IN CNAME mysite.com. ns1.mysite.com. IN A xx.xx.xx.xx # Server 2nd IP ns2.mysite.com. IN A xx.xx.xx.xx # Server 3rd IP mysite.com. IN NS ns1.mysite.com. mysite.com. IN NS ns2.mysite.com. mail.mysite.com. IN MX 1 mysite.com. This is the contents of /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 85.17.150.123 nameserver 85.17.96.69 nameserver 62.212.64.122 search localdomain After using more dig commands, outputs: ; <<>> DiG 9.7.3-P3 <<>> @85.17.150.123 mysite.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 24847 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;mysite.com. IN A ;; Query time: 2145 msec ;; SERVER: 85.17.150.123#53(85.17.150.123) ;; WHEN: Mon Nov 5 16:31:32 2012 ;; MSG SIZE rcvd: 30 ; <<>> DiG 9.7.3-P3 <<>> @85.17.96.69 mysite.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 27879 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;mysite.com. IN A ;; Query time: 949 msec ;; SERVER: 85.17.96.69#53(85.17.96.69) ;; WHEN: Mon Nov 5 16:32:59 2012 ;; MSG SIZE rcvd: 30 ; <<>> DiG 9.7.3-P3 <<>> @62.212.64.122 mysite.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 29293 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; QUESTION SECTION: ;mysite.com. IN A ;; Query time: 825 msec ;; SERVER: 62.212.64.122#53(62.212.64.122) ;; WHEN: Mon Nov 5 16:33:39 2012 ;; MSG SIZE rcvd: 30 With Google DNS (8.8.8.8): ; <<>> DiG 9.7.3-P3 <<>> @8.8.8.8 mysite.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 38498 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;mysite.com. IN A ;; Query time: 3982 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Mon Nov 5 16:37:27 2012 ;; MSG SIZE rcvd: 30

    Read the article

  • MySQL Query GROUP_CONCAT Over Multiple Rows

    - by PeteGO
    I'm getting name and address data out of generic question / answer data to create some kind of normalised reporting database. The query I've got uses group_concat and works for individual sets of questions but not for multiple sets. I've tried to simplify what I'm doing by using just forename and surname and just 3 records, 2 for 1 person and 1 for another. In reality though there are more than 300,000 records. Example of results with qs.Id = 1. QuestionSetId Forename Surname ------------------------------------------------------- 1 Bob Jones Example of results with qs.Id IN (1, 2, 3). QuestionSetId Forename Surname ------------------------------------------------------- 3 Bob,Bob,Frank Jones,Jones,Smith What I would like to see for qs.Id IN (1, 2, 3). QuestionSetId Forename Surname ------------------------------------------------------- 1 Bob Jones 2 Bob Jones 3 Frank Smith So how can I make the 2nd example return a separate row for each set of name and address information? I realise the current way the data is stored is "questionable" but I cannot change the way the data is stored. I can get sets of individual answers but not sure how to combine the others. My simplified Schema that I cannot change: CREATE TABLE StaticQuestion ( Id INT NOT NULL, StaticText VARCHAR(500) NOT NULL); CREATE TABLE Question ( Id INT NOT NULL, Text VARCHAR(500) NOT NULL); CREATE TABLE StaticQuestionQuestionLink ( Id INT NOT NULL, StaticQuestionId INT NOT NULL, QuestionId INT NOT NULL, DateEffective DATETIME NOT NULL); CREATE TABLE Answer ( Id INT NOT NULL, Text VARCHAR(500) NOT NULL); CREATE TABLE QuestionSet ( Id INT NOT NULL, DateEffective DATETIME NOT NULL); CREATE TABLE QuestionAnswerLink ( Id INT NOT NULL, QuestionSetId INT NOT NULL, QuestionId INT NOT NULL, AnswerId INT NOT NULL, StaticQuestionId INT NOT NULL); Some example data for only forename and surname. INSERT INTO StaticQuestion (Id, StaticText) VALUES (1, 'FirstName'), (2, 'LastName'); INSERT INTO Question (Id, Text) VALUES (1, 'What is your first name?'), (2, 'What is your forename?'), (3, 'What is your Surname?'); INSERT INTO StaticQuestionQuestionLink (Id, StaticQuestionId, QuestionId, DateEffective) VALUES (1, 1, 1, '2001-01-01'), (2, 1, 2, '2008-08-08'), (3, 2, 3, '2001-01-01'); INSERT INTO Answer (Id, Text) VALUES (1, 'Bob'), (2, 'Jones'), (3, 'Bob'), (4, 'Jones'), (5, 'Frank'), (6, 'Smith'); INSERT INTO QuestionSet (Id, DateEffective) VALUES (1, '2002-03-25'), (2, '2009-05-05'), (3, '2009-08-06'); INSERT INTO QuestionAnswerLink (Id, QuestionSetId, QuestionId, AnswerId, StaticQuestionId) VALUES (1, 1, 1, 1, 1), (2, 1, 3, 2, 2), (3, 2, 2, 3, 1), (4, 2, 3, 4, 2), (5, 3, 2, 5, 1), (6, 3, 3, 6, 2); Just in case SQLFiddle is down here are the 3 queries from the examples I've linked to: 1: - working query but only on 1 set of data. SELECT MAX(QuestionSetId) AS QuestionSetId, GROUP_CONCAT(Forename) AS Forename, GROUP_CONCAT(Surname) AS Surname FROM (SELECT x.QuestionSetId, CASE x.StaticQuestionId WHEN 1 THEN Text END AS Forename, CASE x.StaticQuestionId WHEN 2 THEN Text END AS Surname FROM (SELECT (SELECT link.StaticQuestionId FROM StaticQuestionQuestionLink link WHERE link.Id = qa.QuestionId AND link.DateEffective <= qs.DateEffective AND link.StaticQuestionId IN (1, 2) ORDER BY link.DateEffective DESC LIMIT 1) AS StaticQuestionId, a.Text, qa.QuestionSetId FROM QuestionSet qs INNER JOIN QuestionAnswerLink qa ON qs.Id = qa.QuestionSetId INNER JOIN Answer a ON qa.AnswerId = a.Id WHERE qs.Id IN (1)) x) y 2: - working query but undesired results on multiple sets of data. SELECT MAX(QuestionSetId) AS QuestionSetId, GROUP_CONCAT(Forename) AS Forename, GROUP_CONCAT(Surname) AS Surname FROM (SELECT x.QuestionSetId, CASE x.StaticQuestionId WHEN 1 THEN Text END AS Forename, CASE x.StaticQuestionId WHEN 2 THEN Text END AS Surname FROM (SELECT (SELECT link.StaticQuestionId FROM StaticQuestionQuestionLink link WHERE link.Id = qa.QuestionId AND link.DateEffective <= qs.DateEffective AND link.StaticQuestionId IN (1, 2) ORDER BY link.DateEffective DESC LIMIT 1) AS StaticQuestionId, a.Text, qa.QuestionSetId FROM QuestionSet qs INNER JOIN QuestionAnswerLink qa ON qs.Id = qa.QuestionSetId INNER JOIN Answer a ON qa.AnswerId = a.Id WHERE qs.Id IN (1, 2, 3)) x) y 3: - working query on multiple sets of data only on 1 field (answer) though. SELECT qs.Id AS QuestionSet, a.Text AS Answer FROM QuestionSet qs INNER JOIN QuestionAnswerLink qalink ON qs.Id = qalink.QuestionSetId INNER JOIN StaticQuestionQuestionLink sqqlink ON qalink.QuestionId = sqqlink.QuestionId INNER JOIN Answer a ON qalink.AnswerId = a.Id WHERE sqqlink.StaticQuestionId = 1 /* FirstName */ AND sqqlink.DateEffective = (SELECT DateEffective FROM StaticQuestionQuestionLink WHERE StaticQuestionId = 1 AND DateEffective <= qs.DateEffective ORDER BY DateEffective DESC LIMIT 1)

    Read the article

  • Can i use a switch to hold a function?

    - by TIMOTHY
    I have a 3 file program, basically teaching myself c++. I have an issue. I made a switch to use the math function. I need and put it in a variable, but for some reason I get a zero as a result. Also another issue, when I select 4 (divide) it crashes... Is there a reason? Main file: #include <iostream> #include "math.h" #include <string> using namespace std; int opersel; int c; int a; int b; string test; int main(){ cout << "Welcome to Math-matrix v.34"<< endl; cout << "Shall we begin?" <<endl; //ASK USER IF THEY ARE READY TO BEGIN string answer; cin >> answer; if(answer == "yes" || answer == "YES" || answer == "Yes") { cout << "excellent lets begin..." << endl; cout << "please select a operator..." << endl << endl; cout << "(1) + " << endl; cout << "(2) - " << endl; cout << "(3) * " << endl; cout << "(4) / " << endl; cin >> opersel; switch(opersel){ case 1: c = add(a,b); break; case 2: c = sub(a,b); break; case 3: c = multi(a,b); break; case 4: c = divide(a,b); break; default: cout << "error... retry" << endl; }// end retry cout << "alright, how please select first digit?" << endl; cin >> a; cout << "excellent... and your second?" << endl; cin >> b; cout << c; cin >> test; }else if (answer == "no" || answer == "NO" || answer == "No"){ }//GAME ENDS }// end of int main Here is my math.h file #ifndef MATH_H #define MATH_H int add(int a, int b); int sub(int a, int b); int multi(int a, int b); int divide(int a, int b); #endif Here is my math.cpp: int add(int a, int b) { return a + b; } int sub(int a, int b) { return a - b; } int multi(int a, int b) { return a * b; } int divide(int a, int b) { return a / b; } }// end of int main

    Read the article

  • SQL SERVER – Take the Quiz for a chance to win a Quadcopter Drone – Brain Teasers

    - by Pinal Dave
    It has been a long time since we ran quiz. So let us get ready for a quiz. The quiz has two parts. You have to get both the parts correct to win Quadcopter with Camera (we will call it drone). We will be giving away a total of 2 Quadcopters. The quiz is extremely easy and I will ship the Drone anywhere in the world where Amazon will ship it. Let us jump directly to the quiz. Please complete all the three questions of the contest.  Contest Part 1: Brain Teasers There are two questions for you in this part of the contest. Question: There are two 7s. How will you write select statement with a single operator that returns single 7? Hint: SELECT 7(Answer)7 Question: Write down the shortest code that produces 1 without using any numbers in the select statement? Hint: SELECT (Answer) Contest Part 2: Download and Activate Rapid SQL Question: Download and Activate Rapid SQL. Hint: You have to download and activate Rapid SQL. If you do not activate Rapid SQL, you will be disqualified for the contest. Why take risk, let us start! That’s it! Just answer above questions in the following comments area, in following format. Remember: Use comments area right below the blog to take participation in the contest Answer before June 5, 2014 midnight GMT. The winner will be announced on June 8. The winner will be selected randomly from all the valid answers. All the valid answers will be kept hidden till June 5, 2014. There will be a total of two winners. The contest is open for any country of the world where Amazon ships products. Reference: Pinal Dave (http://blog.sqlauthority.com)Filed under: PostADay, SQL, SQL Authority, SQL Puzzle, SQL Query, SQL Server, SQL Tips and Tricks, T SQL

    Read the article

  • SQL SERVER – Validating Unique Columnname Across Whole Database

    - by pinaldave
    I sometimes come across very strange requirements and often I do not receive a proper explanation of the same. Here is the one of those examples. Asker: “Our business requirement is when we add new column we want it unique across current database.” Pinal: “Why do you have such requirement?” Asker: “Do you know the solution?” Pinal: “Sure I can come up with the answer but it will help me to come up with an optimal answer if I know the business need.” Asker: “Thanks – what will be the answer in that case.” Pinal: “Honestly I am just curious about the reason why you need your column name to be unique across database.” (Silence) Pinal: “Alright – here is the answer – I guess you do not want to tell me reason.” Option 1: Check if Column Exists in Current Database IF EXISTS (  SELECT * FROM sys.columns WHERE Name = N'NameofColumn') BEGIN SELECT 'Column Exists' -- add other logic END ELSE BEGIN SELECT 'Column Does NOT Exists' -- add other logic END Option 2: Check if Column Exists in Current Database in Specific Table IF EXISTS (  SELECT * FROM sys.columns WHERE Name = N'NameofColumn' AND OBJECT_ID = OBJECT_ID(N'tableName')) BEGIN SELECT 'Column Exists' -- add other logic END ELSE BEGIN SELECT 'Column Does NOT Exists' -- add other logic END I guess user did not want to share the reason why he had a unique requirement of having column name unique across databases. Here is my question back to you – have you faced a similar situation ever where you needed unique column name across a database. If not, can you guess what could be the reason for this kind of requirement?  Additional Reference: SQL SERVER – Query to Find Column From All Tables of Database Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL System Table, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • How to visualize timer functionality in sequence diagram?

    - by truthseeker
    I am developing software for communication with external device through serial port. To better understand the new functionality I am trying to display it in sequence diagram. Flow of events is as follows. I send to the device command to reset it. This is asynchronous operation so there is some delay between request and response (typically 100 ms). There can be case when the answer never comes (for example device is not connected to the specified port or is currently turned off). For this purpose I create a timer with period twice the maximum answer time. In my case it is 2 * 125 ms = 250 ms. If the answer comes in predefined time interval, I destroy already running timer. If the answer doesnt come in predefined interval, timer initiates some action. After this action we can destroy it. How to effectively model this situation in sequence diagram? Addendum 1: Based on advices made by scarfridge i drew following UML diagram. Comment by Ozair is also helpful for simplifying the diagram even more.

    Read the article

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