Search Results

Search found 1449 results on 58 pages for 'hints'.

Page 45/58 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Trying to access a specific option value to generate a popup window

    - by Isaac
    I am trying to use a click event to generate a popup window based off of the specific value chosen. I am having trouble with the if statement and trying to access each specific option value. Can any of you give me some hints? <select id="offices"> <option value="Choose an Office">Choose an Office</option> <option value="Residential Education (ResEd)" >Residential Education (ResEd)</option> <option value="Dean of Students">Dean of Students</option> <option value="Office of Student Affairs">Office of Student Affairs</option> <option value="Vice-Provost of Student Affairs">Vice-Provost of Student Affairs</option> </select> </div> function display(){ var officearray = [{ Office: "Residential Education (ResEd)", ID: "725-2800", Description: "The Office of Residential Education is responsible for developing the policies, programs, and staffing which support the intellectual, educational, and community-building activities in student residences. Second Floor. " }, { Office: "Dean of Students", ID: "723-7833", Description: "The Dean of Students office is composed of 13 individual administrative units that are concerned with the general welfare of both undergraduate and graduate students, in and out of the classroom. Second floor." }, { Office: "Office of Student Activities (OSA)", ID: "723-2733", Description: "Services for student organizations, student-initiated major events and programs, and fraternities and sororities. Second floor." }, { Office: "Vice-Provost of Student Affairs", ID: "725-0911", Description: "The Vice Provost for Student Affairs is responsible to the Provost for providing services and programs to undergraduate and graduate students in support of the academic mission of the University. Second floor." }] for(var i = 0; i < officearray.length; i++) { var o = document.getElementById("offices") var oString = o.options[o.selectedIndex].value; newwindow2 = window.open('', 'name', 'height=200, width=150') var tmp = newwindow2.document if (oString == officearray[i].Office) { tmp.writeln(officearray[i].Description) } } } document.getElementsByTagName('option').addEventListener("click",display,false)

    Read the article

  • UIView Controller mysteriously getting deallocated

    - by Dan Ray
    I have a UINavigation scheme with a "welcome" page, a middle page, and a detail page. In the middle page, there's a segmented controller that can swap the main body of that page between a table, a calendar, and a MKMapView, each implemented with their own view controller classes. Today I implemented the MapView and its annotations and all of that. It's nice. And a detail disclosure on each callout takes you to the detail page just the same way as if you'd gotten there via the table. Lovely. I also have a right-button-bar button that pushes in a "search" view. From there you can search the data I'm navigating. When it's done filtering the data (an array of objects I'm keeping in a data singleton), it makes the table reload its data, and calls my annotation-clearer-and-builder methods on the map view, and then pops itself out, so the "middle" page (including whatever view was in the guts of it) is back on the screen. Problem is, if I go back and forth between the map and the search a couple times, any mention of the table view causes us to crash with: *** -[CALayer retain]: message sent to deallocated instance 0x710b810. (I obviously have NSZombies turned on.) I put an NSLog in the dealloc method of my table view controller. That thing's never getting called. I don't know if we're ditching it behind the scenes for memory purposes, or if I'm leaking it and can't get my hands back on it, or what. I'm sort of at a loss about where to look. Any hints?

    Read the article

  • .NET XML serialization

    - by ShdNx
    I would like to serialize and deserialize mixed data into XML. After some searches I found out that there were two ways of doing it: System.Runtime.Serialization.Formatters.Soap.SoapFormatter and System.Xml.Serialization.XmlSerializer. However, neither turned out to match my requirements, since: SoapFormatter doesn't support serialization of generic types XmlSerializer refuses to serialize types that implement IDictionary, not to mention that it's far less easy-to-use than "normal" serialization (e.g. see this SO question) I'm wondering if there exists an implementation that doesn't have these limitations? I have found attempts (for example CustomXmlSerializer and YAXLib as suggested in a related SO question), but they don't seem to work either. I was thinking about writing such serializer myself (though it certainly doesn't seem to be a very easy task), but then I find myself limited by the CLR, as I cannot create object instances of types that won't have a paramaterless constructor, even if I'm using reflection. I recall having read somewhere that implementations in System.Runtime.Serialization somehow bypass the normal object creation mechanism when deserializing objects, though I'm not sure. Any hints of how could this be done? Could somebody please point me to the right direction with this?

    Read the article

  • deploy a sinatra app with passenger gives only 404, page not founds. Yet a simple rack app works.

    - by berkes
    I have correctly (or prbably not) installed passenger on apache 2. Rack works, but sinatra keeps giving 404's. Here is what works: config.ru: #app = proc do |env| return [200, { "Content-Type" => "text/html" }, "hello <b>world</b>"] end run app Here is what works too: Running the app.rb (see below) with ruby app.rb and then looking at localhost:4567/about and / restarting the app, gives me a correct hello world. w00t. But then there is the sinatra entering the building: config.ru require 'rubygems' require 'sinatra' root_dir = File.dirname(__FILE__) set :environment, ENV['RACK_ENV'].to_sym set :root, root_dir set :app_file, File.join(root_dir, 'app.rb') disable :run run Sinatra::Application and an app.rb require 'rubygems' require 'sinatra' get '/' do "Hallo wereld!" end get '/about' do "Hello world, it's #{Time.now} at the server!" end This keeps giving 404s. /var/logs/apache2/error.log lists these correctly as "404" with something that worries me: 83.XXXXXXXXX - - [30/May/2010 16:06:52] "GET /about " 404 18 0.0007 83.XXXXXXXXX - - [30/May/2010 16:06:56] "GET / " 404 18 0.0007 The thing that worried me, is the space after the / and the /about. Would apache or sinatra go looking for /[space], like /%20? If anyone knows what this problem relates to, maybe a known bug (that I could not find) or a known gotcha? Maybe I am just being stupid and getting "it all wrong?" Otherwise any hints on where to get, read or log more developers data on a running rack, sinatra or passenger app would be helpfull too: to see what sinatra is looking for, for example. Some other information: Running ubuntu 9.04, apache2-mm-prefork (deb), mod_php5, ruby 1.8.7, passenger 2.2.11, sinatra 1.0

    Read the article

  • Converting a bash script to python (small script)

    - by Mestika
    Hi, I’ve a bash script I’ve been using for a Linux environment but now I have to use it on a Windows platform and want to convert the bash script to a python script which I can run. The bash script is rather simple (I think) and I’ve tried to convert it by google by way around but can’t convert it successfully. The bash script looks like this: runs=5 queries=50 outfile=outputfile.txt date >> $outfile echo -e "\n---------------------------------" echo -e "\n----------- Normal --------------" echo -e "\n---------------------------------" echo -e "\n----------- Normal --------------" >> $outfile for ((r = 1; r < ($runs + 1); r++)) do echo -e "Run $r of $runs\n" db2 FLUSH PACKAGE CACHE DYNAMIC python reads.py -r1 -pquery1.sql -q$queries -shotelspec -k6 -a5 >> $outfile done The main command, the python read.py … etc. is another python file I’ve been given and have the arguments as you see. I know it is a lot to ask for, but it would really help me out if someone could convert this to a python script I can use or at least give me some hints and directions. Sincerely Mestika

    Read the article

  • Neural Network settings for fast training

    - by danpalmer
    I am creating a tool for predicting the time and cost of software projects based on past data. The tool uses a neural network to do this and so far, the results are promising, but I think I can do a lot more optimisation just by changing the properties of the network. There don't seem to be any rules or even many best-practices when it comes to these settings so if anyone with experience could help me I would greatly appreciate it. The input data is made up of a series of integers that could go up as high as the user wants to go, but most will be under 100,000 I would have thought. Some will be as low as 1. They are details like number of people on a project and the cost of a project, as well as details about database entities and use cases. There are 10 inputs in total and 2 outputs (the time and cost). I am using Resilient Propagation to train the network. Currently it has: 10 input nodes, 1 hidden layer with 5 nodes and 2 output nodes. I am training to get under a 5% error rate. The algorithm must run on a webserver so I have put in a measure to stop training when it looks like it isn't going anywhere. This is set to 10,000 training iterations. Currently, when I try to train it with some data that is a bit varied, but well within the limits of what we expect users to put into it, it takes a long time to train, hitting the 10,000 iteration limit over and over again. This is the first time I have used a neural network and I don't really know what to expect. If you could give me some hints on what sort of settings I should be using for the network and for the iteration limit I would greatly appreciate it. Thank you!

    Read the article

  • PHP (A few questions) OO, refactoring, eclipse

    - by jax
    I am using PHP in eclipse. It works ok, I can connect to my remote site, there is colour coding of code elements and some code hints. I realise this may be too long to answer all questions, if you have a good answer for one part, answering just that is ok. Firstly General Coding I have found that it is easy to loose track of included files and their variables. For example if there was a database $cursor it is difficult to remember or even know that it was declared in the included file (this becomes much worse the more files you include). How are people dealing with this? How are people documenting their code - in particular the required GET and POST data? Secondly OO Development: Should I be going full OO in my development. Currently I have a functions library which I can include and have separated each "task" into a separate file. It is a bit nasty but it works. If I go OO how do I structure the directories in PHP, java uses packages - what about php? How should I name my files, should I use all lower case with _ for spaces "hello_world.php"? Should I name classes with Uppercase like Java "HelloWorld.php"? Is there a different naming convention for Classes and regular function files? Thirdly Refactoring I must say this is a real pain. If I change the name of a variable in one place I have to go through whole document and each file that included this file and change the name their too. Of course, errors everywhere is what results. How are people dealing with this problem? In Java if you change the name in one place it changes everywhere. Are there any plugins to improve php refactoring? I am using the official PHP version of Eclipse from their website. thanks

    Read the article

  • PHP get "Application Root" in Xampp on Windows correctly

    - by Michael Mao
    Hi all: I found this thread on StackOverflow about how to get the "Application Root" from inside my web app. However, most of the approaches suggested in that thread can hardly be applied to my Xampp on Windows. Say, I've got a "common.php" which stays inside my web app's app directory: / /app/common.php /protected/index.php In my common.php, what I've got is like this: define('DOCROOT', $_SERVER['DOCUMENT_ROOT']); define('ABSPATH', dirname(__FILE__)); define('COMMONSCRIPT', $_SERVER['PHP_SELF']); After I required the common.php inside the /protected/index.php, I found this: C:/xampp/htdocs //<== echo DOCROOT; C:\xampp\htdocs\comic\app //<== echo ABSPATH /comic/protected/index.php //<== echo COMMONSCRIPT So the most troublesome part is the path delimiters are not universal, plus, it seems all superglobals from the $_SERVER[] asso array, such as $_SERVER['PHP_SELF'], are relative to the "caller" script, not the "callee" script. It seems that I can only rely on dirname(__FILE__) to make sure this always returns an absolute path to the common.php file. I can certainly parse the returning values from DOCROOT and ABSPATH and then calculate the correct "application root". For instance, I can compare the parts after htdocs and substitute all backslashes with slashes to get a unix-like path I wonder is this the right way to handle this? What if I deploy my web app on a LAMP environment? would this environment-dependent approach bomb me out? I have used some PHP frameworks such as CakePHP and CodeIgniter, to be frank, They just work on either LAMP or WAMP, but I am not sure how they approached such a elegant solution. Many thanks in advance for all the hints and suggestions.

    Read the article

  • Libraries for developing NCPDP SCRIPT based systems (a standard for e-prescribing)

    - by Kaveh Shahbazian
    What are (based on experiences) best (commercial or open source) libraries for developing NCPDP-based systems? Background: NCPDP (National Council for Prescription Drug Programs) is a not-for-profit, ANSI-accredited, standards development organization. One of it's standards is the SCRIPT Standard for Electronic Prescribing, which allows PHARMACY, PRESCRIBER (i.e. Physician) and PAYERS (patient or more often insurer) communicate. So the SCRIPT standard is about data transmission. Problem: One step in implementing such systems is to develop models for data based on SCRIPT standard. These models should have utilities for serializing/deserializing to/from SCRIPT binary format and SCRIPT XML format (there are two distinct formats here; both must be supported). Here rises the problem (for me at least). To develop this subsystem for handling the model, implementing serializing and deserializing facilities and keep it uptodate with the SCRIPT standard specifications is a lot of work; it needs it's own team and team management issues (to support a standard implementation). So I am looking for a solution to this problem; to keep standard implementation out of the way and focusing on main problems. Thanks to all (Thankyou Freiheit for your hints!) Edit 2: Thanks to all for help! NCPDP (National Council for Prescription Drug Programs) is an standard for e-prescribing. It defines two formats for message transmission: binary and XML. Implementing XML is somehow easier because it is a standard format which in turn gives us more tooling options. The binary format has a very big specification and time-consuming to implement. I did not find an open source solution to work with. So I am looking for commercial alternatives. Edit 1: Please guide me; what's wrong with this question?

    Read the article

  • Modeling related objects and their templates

    - by Duddle
    Hello everybody! I am having trouble correctly modeling related objects that can use templates. This is not homework, but part of a small project in the university. In this application the user can add several elements, which can either be passive or active. Each concrete element has different attributes, these must be set by the user. See diagram 1: Since the user will create many elements, we want there to be templates for each type of element, so some of the attributes are filled in automatically. See diagram 2: In my opinion, this is a bad design. For example, to get all possible templates for a PassiveElementA-object, there has to be a list/set somewhere that only holds PassiveElementATemplate-objects. There has to be a separate list for each subclass of Element. So if you wanted to add a new PassiveElement-child, you also have to edit the class which holds all these separate lists. I cannot figure out a good way to solve this problem. Since the concrete classes (i.e. PassiveElementA, ..., PassiveElementZ) have so many different attributes, many of the design patterns I know do not work. Thanks in advance for any hints, and sorry for my bad English.

    Read the article

  • Output iterator's value_type

    - by wilhelmtell
    The STL commonly defines an output iterator like so: template<class Cont> class insert_iterator : public iterator<output_iterator_tag,void,void,void,void> { // ... Why do output iterators define value_type as void? It would be useful for an algorithm to know what type of value it is supposed to output. For example, a function that translates a URL query "key1=value1&key2=value2&key3=value3" into any container that holds key-value strings elements. template<typename Ch,typename Tr,typename Out> void parse(const std::basic_string<Ch,Tr>& str, Out result) { std::basic_string<Ch,Tr> key, value; // loop over str, parse into p ... *result = typename iterator_traits<Out>::value_type(key, value); } The SGI reference page of value_type hints this is because it's not possible to dereference an output iterator. But that's not the only use of value_type: I might want to instantiate one in order to assign it to the iterator.

    Read the article

  • Actionscript project that loads a Flex SWF, "Could not find resource bundle" Error when using Layout

    - by Leeron
    Hi guys. I'm using an actionsciprt only project (under FlashDevelop) to load an .swf flex file built by another department of the company I work for. Using the follwing code: var mLoader:Loader = new Loader(); var mRequest:URLRequest = new URLRequest('flexSWF.swf'); mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler); mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler); mLoader.load(mRequest); That worked fine until I wanted to use Flex's mx.managers.LayoutManager. I've added the this line to my class: import mx.managers.ILayoutManagerClient; import mx.managers.LayoutManager; . . . private var _layoutManager:LayoutManager; And I get this run time error: Error: Could not find resource bundle messaging at mx.resources::ResourceBundle$/getResourceBundle()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\resources\ResourceBundle.as:143] at mx.utils::Translator$cinit() at global$init() at mx.messaging.config::ServerConfig$cinit() at global$init() at _app_FlexInit$/init() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3217] at mx.managers::SystemManager/docFrameListener()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3069] commenting the LayoutManager line, the swf works fine. But I do want to use LayoutManager. Any hints?

    Read the article

  • Declaration of arrays before "normal" variables in c?

    - by bjarkef
    Hi We are currently developing an application for a msp430 MCU, and are running into some weird problems. We discovered that declaring arrays withing a scope after declaration of "normal" variables, sometimes causes what seems to be undefined behavior. Like this: foo(int a, int *b); int main(void) { int x = 2; int arr[5]; foo(x, arr); return 0; } foo sometimes is passed a pointer as the second variable, that does not point to the arr array. We verify this by single stepping through the program, and see that the value of the arr variable in the main scope is not the same as the value of the b pointer variable in the foo scope. And no, this is not really reproduceable, we have just observed this behavior once in a while. Changing the example seems to solve the problem, like this: foo(int a, int *b); int main(void) { int arr[5]; int x = 2; foo(x, arr); return 0; } Does anybody have any input or hints as to why we experience this behavior? Or similar experiences? The MSP430 programming guide specifies that code should conform to the ANSI C89 spec. and so I was wondering if it says that arrays has to be declared before non-array variables? Any input on this would be appreciated.

    Read the article

  • ClassCastException while using service

    - by Sebi
    I defined a local Service: public class ComService extends Service implements IComService { private IBinder binder = new ComServiceBinder(); public class ComServiceBinder extends Binder implements IComService.IServiceBinder { public IComService getService() { return ComService.this; } } public void test(String msg) { System.out.println(msg); } @Override public IBinder onBind(Intent intent) { return binder; } } The corresponding interface: public interface IComService { public void test(String msg); public interface IServiceBinder { IComService getService(); } } Then i try to bind the service in another activity in another application, where the same interface is available: bindService(new Intent("ch.ifi.csg.games4blue.gamebase.api.ComService"), conn, Context.BIND_AUTO_CREATE); and private ServiceConnection conn = new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { Log.i("INFO", "Service bound " + name); comService = ((IComService.IServiceBinder)service).getService(); serviceHandler.sendEmptyMessage(0); } @Override public void onServiceDisconnected(ComponentName arg0) { Log.i("INFO", "Service Unbound "); } }; but the line comService = ((IComService.IServiceBinder)service).getService(); always throws a 05-02 22:12:55.922: ERROR/AndroidRuntime(622): java.lang.ClassCastException: android.os.BinderProxy I can't explain why, I followed the app sample on http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/LocalServiceBinding.html Any hints would be nice!

    Read the article

  • How to make Resig's micro-templates XHTML compliant?

    - by mshelv
    Hello, I have been experimenting with John Resig's micro-template, which works great. However, the mark-up will not pass the XHTML 1.0 Transitional validation test. (Among other things, id attributes yield errors.) Replacing tags identifiers <, with [[,]], passes validation. Thus, I created a js script which at load time (jQuery document ready) converts the square brackets back to regular markers. This works fine in FF, but not in IE, Chrome, etc. Scripts embedded within CDATA tags validate as well. Question: Is there a way to insert micro-template in a script and still pass XHTML validation? My idea was to remove the CDATA tags once the page has been loaded. But there are probably smarter ways. (Note: I'd prefer not to inject HTML via js since the mark-up will be difficult to maintain.) PS: I looked at other js templates, but they are either not XHTML compliant or too bulky. TIA for any hints.

    Read the article

  • Is it possible to read data that has been separately copied to the Android sd card without having ro

    - by icecream
    I am developing an application that needs to access data on the sd card. When I run on my development device (an odroid with Android 2.1) I have root access and can construct the path using: File sdcard = Environment.getExternalStorageDirectory(); String path = sdcard.getAbsolutePath() + File.separator + "mydata" File data = new File(path); File[] files = data.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String filename) { return filename.toLowerCase().endsWith(".xyz"); }}); However, when I install this on a phone (2.1) where I do not have root access I get files == null. I assume this is because I do not have the right permissions to read the data from the sd card. I also get files == null when just trying to list files on /sdcard. So the same applies without my constructed path. Also, this app is not intended to be distributed through the app store and is needs to use data copied separately to the sd card so this is a real use-case. It is too much data to put in res/raw (I have tried, it did not work). I have also tried adding: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> to the manifest, even though I only want to read the sd card, but it did not help. I have not found a permission type for reading the storage. There is probably a correct way to do this, but I haven't been able to find it. Any hints would be useful.

    Read the article

  • Cross-browser padding/margins

    - by Lucifer
    Hi All, I was wondering if you could give me some helpful hints on how to correct this issue? I have a main menu on my site, the code for it is as follows: li:hover { background-color: #222222; padding-top: 8px; padding-bottom: 9px; } And here's a demo of what it actually looks like: The problem is that when I hover over a menu option (li), the background appears, but it overflows to the outside of the menu's background, and makes it look really dodgy/crap/cheap/yuck! Note that (obviously) when I change the padding to make it display correctly in these browsers, it appears too small in height in IE! So I'm screwed either way. How can I make little imperfections like this look the same in all browsers? Update: HTML (The menu): <ul class="menu"> <li class="currentPage" href="index.php"><a>Home</a></li> <li><a href="services.php">Services</a></li> <li><a href="support.php">Support</a></li> <li><a href="contact.php">Contact Us</a></li> <li><a href="myaccount/" class="myaccount">My Account</a></li> </ul> The CSS: .menu { margin-top: 5px; margin-right: 5px; width: 345px; float: right; } li { font-size: 9pt; color: whitesmoke; padding-left: 6px; padding-right: 8px; display: inline; list-style: none; } li:hover { background-color: #222222; padding-top: 8px; padding-bottom: 9px; }

    Read the article

  • How to convert none-Latin-based encoded text into UTF-8, or make them coexist on same page?

    - by Yallaa
    Good day, I have a script that scrapes the title/description of remote pages and prints those values into a corresponding charset=UTF-8 encoded page. Here is the problem, whenever a remote page is encoded with non-Latin characters encoding like (Arabic, Russian, Chinese, Japanese etc.) the imported values print as garbled text. I've tried passing those values through either iconv or mb_convert_encoding converters but without much success. Then, I tried detecting the remote encoding first, then change my presentation page's encoding into the remote one instead of the current utf-8, which works okay with the imported values, but the other existing utf-8 content of that language on the page gets garbled instead. Example: If I try to import those values from a Russian windows-1251 into my UTF-8 encoded page which has a mix English/Russian content. I change the imported non-utf-8 string into a utf-8 using either iconv or mb_convert_encoding. I tried: $RemoteValue = iconv($RemoteEncoding, 'UTF-8', $RemoteValue); or $RemoteValue mb_convert_encoding($RemoteValue, "UTF-8", $RemoteEncoding); or $RemoteValue mb_convert_encoding($RemoteValue, "UTF-8", "auto"); without success. If I detect that the remote page is windows-1251 encoded and I change my presentation page (which already has UTF-8 encoded mixed language content) to be similar to the remote page, then the japanese utf-8 content on the existing page gets garbled... Can 2 differently encoded strings coexist on the same page (ex. utf-8 & windows-1251)? Am I using the converters correctly? any hints as to why they don't work? Is there any better way to do this? Thank you for your help

    Read the article

  • correct way to create a pivot table in postgresql using CASE WHEN

    - by mojones
    I am trying to create a pivot table type view in postgresql and am nearly there! Here is the basic query: select acc2tax_node.acc, tax_node.name, tax_node.rank from tax_node, acc2tax_node where tax_node.taxid=acc2tax_node.taxid and acc2tax_node.acc='AJ012531'; And the data: acc | name | rank ----------+-------------------------+-------------- AJ012531 | Paromalostomum fusculum | species AJ012531 | Paromalostomum | genus AJ012531 | Macrostomidae | family AJ012531 | Macrostomida | order AJ012531 | Macrostomorpha | no rank AJ012531 | Turbellaria | class AJ012531 | Platyhelminthes | phylum AJ012531 | Acoelomata | no rank AJ012531 | Bilateria | no rank AJ012531 | Eumetazoa | no rank AJ012531 | Metazoa | kingdom AJ012531 | Fungi/Metazoa group | no rank AJ012531 | Eukaryota | superkingdom AJ012531 | cellular organisms | no rank What I am trying to get is the following: acc | species | phylum AJ012531 | Paromalostomum fusculum | Platyhelminthes I am trying to do this with CASE WHEN, so I've got as far as the following: select acc2tax_node.acc, CASE tax_node.rank WHEN 'species' THEN tax_node.name ELSE NULL END as species, CASE tax_node.rank WHEN 'phylum' THEN tax_node.name ELSE NULL END as phylum from tax_node, acc2tax_node where tax_node.taxid=acc2tax_node.taxid and acc2tax_node.acc='AJ012531'; Which gives me the output: acc | species | phylum ----------+-------------------------+----------------- AJ012531 | Paromalostomum fusculum | AJ012531 | | AJ012531 | | AJ012531 | | AJ012531 | | AJ012531 | | AJ012531 | | Platyhelminthes AJ012531 | | AJ012531 | | AJ012531 | | AJ012531 | | AJ012531 | | AJ012531 | | AJ012531 | | Now I know that I have to group by acc at some point, so I try select acc2tax_node.acc, CASE tax_node.rank WHEN 'species' THEN tax_node.name ELSE NULL END as sp, CASE tax_node.rank WHEN 'phylum' THEN tax_node.name ELSE NULL END as ph from tax_node, acc2tax_node where tax_node.taxid=acc2tax_node.taxid and acc2tax_node.acc='AJ012531' group by acc2tax_node.acc; But I get the dreaded ERROR: column "tax_node.rank" must appear in the GROUP BY clause or be used in an aggregate function All the previous examples I've been able to find use something like SUM() around the CASE statements, so I guess that is the aggregate function. I have tried using FIRST(): select acc2tax_node.acc, FIRST(CASE tax_node.rank WHEN 'species' THEN tax_node.name ELSE NULL END) as sp, FIRST(CASE tax_node.rank WHEN 'phylum' THEN tax_node.name ELSE NULL END) as ph from tax_node, acc2tax_node where tax_node.taxid=acc2tax_node.taxid and acc2tax_node.acc='AJ012531' group by acc2tax_node.acc; but get the error: ERROR: function first(character varying) does not exist Can anyone offer any hints?

    Read the article

  • Need help in tuning a sql-query

    - by Viper
    Hello, i need some help to boost this SQL-Statement. The execution time is around 125ms. During the runtime of my program this sql (better: equally structured sqls for different tables) will be called 300.000 times. The average row count in the tables lies around 10.000.000 rows and new rows (updates/inserts) will be added with a timestamp each day. Data which are interesting for this particular export-program lies in the last 1-3 days. Maybe this is helpful for an index to create. The data i need is the current valid row for a given id and the forerunner datarow to get the updates (if exists). We use a Oracle 11g database and Dot.Net Framework 3.5 SQL-Statement to boost: select ID_SOMETHING, -- Number(12) ID_CONTRIBUTOR, -- Char(4 Byte) DATE_VALID_FROM, -- DATE DATE_VALID_TO -- DATE from TBL_SOMETHING XID where ID_SOMETHING = :ID_INSTRUMENT and ID_CONTRIBUTOR = :ID_CONTRIBUTOR and DATE_VALID_FROM <= :EXPORT_DATE and DATE_VALID_TO >= :EXPORT_DATE order by DATE_VALID_FROM asc; Here i uploaded the current Explain-Plan for this query. I'm not a database expert so i don't know which index-type would fit best for this requirement. I have seen that there are many different possible index-types which could be applied. Maybe Oracle Optimizer Hints are helpful, too. Does anyone has a good idea for tuning this sql or can point me in a right direction?

    Read the article

  • Bash and regex problem : check for tokens entered into a Coke vending machine

    - by Michael Mao
    Hi all: Here is a "challenge question" I've got from Linux system programming lecture. Any of the following strings will give you a Coke if you kick: L = { aaaa, aab, aba, baa, bb, aaaa"a", aaaa"b", aab"a", … ab"b"a, ba"b"a, ab"bbbbbb"a, ... } The letters shown in wrapped double quotes indicate coins that would have fallen through (but those strings are still part of the language in this example). Exercise (a bit hard) show this is the language of a regular expression And this is what I've got so far : #!/usr/bin/bash echo "A bottle of Coke costs you 40 cents" echo -e "Please enter tokens (a = 10 cents, b = 20 cents) in a sequence like 'abba' :\c" read tokens #if [ $tokens = aaaa ]||[ $tokens = aab ]||[ $tokens = bb ] #then # echo "Good! now a coke is yours!" #else echo "Thanks for your money, byebye!" if [[ $token =~ 'aaaa|aab|bb' ]] then echo "Good! now a coke is yours!" else echo "Thanks for your money, byebye!" fi Sadly it doesn't work... always outputs "Thanks for your money, byebye!" I believe something is wrong with syntax... We didn't provided with any good reference book and the only instruction from the professor was to consult "anything you find useful online" and "research the problem yourself" :( I know how could I do it in any programming language such as Java, but get it done with bash script + regex seems not "a bit hard" but in fact "too hard" for anyone with little knowledge on something advanced as "lookahead"(is this the terminology ?) I don't know if there is a way to express the following concept in the language of regex: Valid entry would consist of exactly one of the three components : aaaa, aab and bb, regardless of order, followed by an arbitrary sequence of a or b's So this is what is should be like : (a{4}Ua{2}bUb{2})(aUb)* where the content in first braces is order irrelevant. Thanks a lot in advance for any hints and/or tips :)

    Read the article

  • Creating a single CRM plugin DLL to store in the CRM database

    - by Shaamaan
    Since the suggested way of storing plugins in MS CRM is via the CRM database, I figured it's about time to do something about the method I'm currently using, which is storing the DLLs on the disk. The trouble however is that I don't know how to embed all the other various bits that are needed by the DLL: the localization resource files (which are kept in another folder) and some referenced DLLs from the latest SDK (which had to be manually placed in the bin\assembly folder). At this point, I'm not even entirely sure this is possible. So far I've tried to solve the localization problem by changing the build action on the resource files to "Content" or "Resource" and tested this solution (still keeping the location on-disk, but without the added localization folder). This didn't work: when I purposely generated a validation error in one of the plugins, I got the default language message (English) despite having a different language selected in the CRM. I've faced a similar problem when trying to add some of the referenced DLL files (namely the new SDK DLLs: xrm.portal, xrm.portal.files and xrm.client). When I tried to store the plugin in the database (skipping for a moment the localization issue), I got a CRM error saying it cannot find the XRM.Client assembly or one of it's dependencies. I know I could use ILMerge to put the whole thing together, but I've got a gut feeling telling me this isn't really a good idea. Any hints or suggestions on this issue would be great.

    Read the article

  • Is my heuristic algorithm correct? (Sudoku solver)

    - by Aposperite
    First of -yes this IS a homework- but it's primarily a theoretical question rather than a practical one, I am simply asking a confirmation if I am thinking correctly or any hints if I am not. I have been asked to compile a simple Sudoku solver (on Prolog but that is not so important right now) with the only limitation being that it must utilize a heuristic function using Best-First Algorithm. The only heuristic function I have been able to come up with is explained below: 1. Select an empty cell. 1a. If there are no empty cells and there is a solution return solution. Else return No. 2. Find all possible values it can hold. %% It can't take values currently assigned to cells on the same line/column/box. 3. Set to all those values a heuristic number starting from 1. 4. Pick the value whose heuristic number is the lowest && you haven't checked yet. 4a. If there are no more values return no. 5. If a solution is not found: GoTo 1. Else Return Solution. // I am sorry for errors in this "pseudo code." If you want any clarification let me know. So am I doing this right or is there any other way around and mine is false? Thanks in advance.

    Read the article

  • Pong: How does the paddle know where the ball will hit?

    - by Roflcoptr
    After implementing Pacman and Snake I'm implementing the next very very classic game: Pong. The implementation is really simple, but I just have one little problem remaining. When one of the paddle (I'm not sure if it is called paddle) is controlled by the computer, I have trouble to position it at the correct position. The ball has a current position, a speed (which for now is constant) and a direction angle. So I could calculate the position where it will hit the side of the computer controlled paddle. And so Icould position the paddle right there. But however in the real game, there is a probability that the computer's paddle will miss the ball. How can I implement this probability? If I only use a probability of lets say 0.5 that the computer's paddle will hit the ball, the problem is solved, but I think it isn't that simple. From the original game I think the probability depends on the distance between the current paddle position and the position the ball will hit the border. Does anybody have any hints how exactly this is calculated?

    Read the article

  • Using MSBuild 4 command line to publish ASP.NET web application

    - by meandmycode
    In previous msbuild we used the target '_CopyWebApplication' in order to build and convert the source of a project into a published site, this worked OK, but wasn't ideal. In .NET 4, the publishing process is somewhat more sophisticated and additionally seems a bit of a black box to understand. Whilst packages look great, I cannot fully understand how they can be harnessed by a build server, the build server would not get any manifest information, and equally, something (msbuild?) is CREATING this manifest information FROM the project file. In our build server, I ideally want to say, here is my csproj file, deploy it by the package configuration 'x'. I'm trying to understand the workflow I need to make this happen. Right now when I use _CopyWebApplication, the result is different to doing a publish from visual studio 2010, primarily that web.config transforms aren't processed, and obviously msdeploy isn't involved at all. Can somebody point me in the right direction, I believe I need to get msbuild to do the equiv of 'Build Deployment Package', and then use msdeploy to deploy this from our build server to our CI testing environments. I know this is a very vague post, but I hope somebody can give me some hints, I'll be continuing research also, so if I make any progress, I'll post my findings here. Thanks in advance, Stephen.

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >