Search Results

Search found 3423 results on 137 pages for 'tom daniel'.

Page 113/137 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • When to use reflection to convert datarow to an object

    - by Daniel McNulty
    I'm in a situation now were I need to convert a datarow I've fetched from a query into a new instance of an object. I can do the obvious looping through columns and 'manually' assign these to properties of the object - or I can look into reflection such as this: http://www.codeproject.com/Articles/11914/Using-Reflection-to-convert-DataRows-to-objects-or What would I base the decision on? Just scalability??

    Read the article

  • How to join by column name

    - by Daniel Vaca
    I have a table T1 such that gsdv |nsdv |esdv ------------------- 228.90 |216.41|0.00 and a table T2 such that ds |nm -------------------------- 'Non-Revenue Sales'|'ESDV' 'Gross Sales' |'GSDV' 'Net Sales' |'NSDV' How do I get the following table? ds |nm |val --------------------------------- 'Non-Revenue Sales'|'ESDV'|0.00 'Gross Sales' |'GSDV'|228.90 'Net Sales' |'NSDV'|216.41 I know that I can this by doing the following SELECT ds,nm,esdv val FROM T1,T2 WHERE nm = 'esdv' UNION SELECT ds,nm,gsdv val FROM T1,T2 WHERE nm = 'gsdv' UNION SELECT ds,nm,nsdv val FROM T1,T2 WHERE nm = 'nsdv' but I am looking for a more generic/nicer solution. I am using Sybase, but if you can think of a way to do this with other DBMS, please let me know. Thanks.

    Read the article

  • PHP: report table with date gaps

    - by Daniel
    Hi. I have a table in DB which contains summaries for days. Some days may not have the values. I need to display table with results where each column is a day from user selected range. I've tried to play with timestamp (end_date - start_date / 86400 - how many days in report, then use DATEDIFF(row_date, 'user_entered_start_date') and create array from this indexes), but now I've got whole bunch of workarounds for summer time :( Any examples or ideas how to make this correct? P.S. I need to do this on PHP side, because DB is highly loaded.

    Read the article

  • migrate a portion of a mysql table to SQLite

    - by daniel
    I have a mysql table set up like so: user_id | document 44 [blob] 44 [blob] 44 [blob] 46 [blob] I'd like to export all of user_id 44's data to an SQLite3 file. Best way to go about this without writing a script that reads the data and dumps it into a SQLite file?

    Read the article

  • Symfony: Web debug toolbar icons disappeared

    - by Tom
    Hi, Just moved a symfony project from local (win) to server (linux), and the icons in the web debug toolbar have disappeared. Only the image alts remain so I guess it's a path issue with the images. Basically, I see "Time 300ms" instead of "[icon] 300ms" for each of the items. I'm a little worried that some other paths aren't broken as well that are going to be a pain to find. Has anyone had/resolved this issue? Thank you.

    Read the article

  • How to authenticate a user using SQL

    - by Tom
    I have an DLL which is constantly connected to a SQL Server instance. The server itself is connected with "admin" permissions, but "normal" users should be able to access the server with their own username and password. The server would still be connected a "admin". I just want to check if the user can access the database. Is there a way to authenticate the user using a SQL query? It would of course be possible to add a encrypted "password" column to a database table for users, but I would prefer not having to do that.

    Read the article

  • Mapping LINQ to SQL table to another very similar table without iterating through every one

    - by Daniel Coffman
    Apologies for the vague question. Here it is: I have a table object created by LINQ to SQL. I am copying entries from one table to an "archive" table that has all the columns of the original, plus a couple extra ones. It feels sloppy to iterate through every object and manually define the mapping like: foreach (oldTable in dbContextOldTables) { var newTable = new NewTable(); newTable.TableID = oldTable.ID; newTable.Title = oldTable.Title; ... (repeat for twenty columns) newTable.ColumnThatIsntInOldTable = "Data that will be the same for every row"; dbContext.NewTables.InsertOnSubmit(newTable); } dbContext.SubmitChanges(); Is there a clever way to do this?

    Read the article

  • Calling Windows commands (e.g. del) from a GNU makefile

    - by Tom
    It does not appear to be possible to call Windows system commands (e.g. del, move, etc) using GNU Make. When the following rule is run, an error is reported del: command not found: clean: del *.o This is presumably because there is no such execuatable as "del". I've also tried running it as an option to cmd but with this only seems to open a new prompt: clean: cmd /C del *.o I'm using GNU Make 3.79.1 that is bundled as part of MSys.

    Read the article

  • Java xml binding with wrong xmlns attribute name

    - by Tom Brito
    When I use the annotation: @XmlRootElement(name="RootElement", namespace="namespace") class RootElement { to create xml file from java, it creates the root element as: <ns2:RootElement xmlns:ns2="namespace"> but I wanted to create without the "ns2", like: <RootElement xmlns="namespace"> Any idea how to fix it? Reletad link (example I used to create the xml): http://www.java2s.com/Code/JavaAPI/javax.xml.bind.annotation/XmlRootElementname.htm

    Read the article

  • Problem with .htaccess (mod_rewrite). RewriteRule's doens't work correctly

    - by daniel
    Hello, I have a problem with my two RewriteRules. .htaccess: # protect the htaccess file <files .htaccess> order allow,deny deny from all </files> RewriteEngine On Options +FollowSymlinks Options -Indexes RewriteBase /test/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^download/([0-9]+)$ download.php?id=$1 [L] RewriteRule ^(.*)$ index.php?c=view&misc=$1 [B] If the url contains download (some like this: mydomain.com/download/9) the first rule should redict this request to download.php?id=9. But it doesn't. var_dump($_GET) shows the following: array(2) { ["c"]=> string(4) "view" ["misc"]=> string(9) "index.php" } index.php Any ideas?

    Read the article

  • IBM Toolkit for MPEG-4 terms of use, am I understanding right?

    - by Tom Brito
    The IBM Toolkit for MPEG-4 comes with the following paragraph in its licence: Rights In Data You assign to IBM all right, title, and interest (including ownership of copyright) in any data, suggestions, and written materials that 1) is related to Your use of the Program and 2) You provide to IBM. If IBM requires it, You will sign an appropriate document to assign such rights. Neither party will charge the other for rights in data or any work performed as a result of this Agreement. Correct me if I am wrong, but I'm understanding that I cannot use their toolkit without give them rights on my software?

    Read the article

  • Unit Tests Architecture Question

    - by Tom Tresansky
    So I've started to layout unit tests for the following bit of code: public interface MyInterface { void MyInterfaceMethod1(); void MyInterfaceMethod2(); } public class MyImplementation1 implements MyInterface { void MyInterfaceMethod1() { // do something } void MyInterfaceMethod2() { // do something else } void SubRoutineP() { // other functionality specific to this implementation } } public class MyImplementation2 implements MyInterface { void MyInterfaceMethod1() { // do a 3rd thing } void MyInterfaceMethod2() { // do something completely different } void SubRoutineQ() { // other functionality specific to this implementation } } with several implementations and the expectation of more to come. My initial thought was to save myself time re-writing unit tests with something like this: public abstract class MyInterfaceTester { protected MyInterface m_object; @Setup public void setUp() { m_object = getTestedImplementation(); } public abstract MyInterface getTestedImplementation(); @Test public void testMyInterfaceMethod1() { // use m_object to run tests } @Test public void testMyInterfaceMethod2() { // use m_object to run tests } } which I could then subclass easily to test the implementation specific additional methods like so: public class MyImplementation1Tester extends MyInterfaceTester { public MyInterface getTestedImplementation() { return new MyImplementation1(); } @Test public void testSubRoutineP() { // use m_object to run tests } } and likewise for implmentation 2 onwards. So my question really is: is there any reason not to do this? JUnit seems to like it just fine, and it serves my needs, but I haven't really seen anything like it in any of the unit testing books and examples I've been reading. Is there some best practice I'm unwittingly violating? Am I setting myself up for heartache down the road? Is there simply a much better way out there I haven't considered? Thanks for any help.

    Read the article

  • Function to convert a z-score into a percentage

    - by Daniel
    Google doesn't want to help! I'm able to calculate z-scores, and we are trying to produce a function that given a z-score gives us a percent of the population in a normal distribution that would be under that z-score. All I can find are references to z-score to percentage tables. Any pointers?

    Read the article

  • Is it more secure to run a desktop app in a applet?

    - by Tom Brito
    Fist of all, when I say "run a desktop app in a applet" I mean do a Applet application that runs off-line, instead of a Desktop application that runs inside a JFrame. The little I know about applets (and maybe something I say is wrong, please correct me) is that applets have all permitions not granted by default. Also, the applets run inside a Sandbox, that does not allow information in or out without explicity permition. So, if I am focused on security in my application, its best to run it inside an applet (off-line, for a desktop application) then inside a JFrame. Is it right?

    Read the article

  • Querying results on timestamp in mysql

    - by Tom
    Hi, I have series of records in a table called 'hits' and each record has the current_timestamp (ie. 2010-04-30 10:11:30) in a column called 'current_time'. What I would like to do is query these records and return only the records from the current month. I cannot seem to get this to work. I have tried a range of queries that don't work such as - Select * FROM hits WHERE MONTH(FROM_UNIXTIME(current_time)) = 4 I don't know if I am even on the right lines! Can anyone point me in the right direction? Cheers.

    Read the article

  • Returning a lua table on SWIG call

    - by Tom J Nowell
    I have a class with a methodcalled GetEnemiesLua. I have bound this class to lua using SWIG, and I can call this method using my lua code. I am trying to get the method to return a lua table of objects. Here is my current code: void CSpringGame::GetEnemiesLua(){ std::vector<springai::Unit*> enemies = callback->GetEnemyUnits(); if( enemies.empty()){ lua_pushnil(ai->L); return; } else{ lua_newtable(ai->L); int top = lua_gettop(ai->L); int index = 1; for (std::vector<springai::Unit*>::iterator it = enemies.begin(); it != enemies.end(); ++it) { //key lua_pushinteger(ai->L,index);//lua_pushstring(L, key); //value CSpringUnit* unit = new CSpringUnit(callback,*it,this); ai->PushIUnit(unit); lua_settable(ai->L, -3); ++index; } ::lua_pushvalue(ai->L,-1); } } PushIUnit is as follows: void CTestAI::PushIUnit(IUnit* unit){ SWIG_NewPointerObj(L,unit,SWIGTYPE_p_IUnit,1); } To test this I have the following code: t = game:GetEnemiesLua() if t == nil then game:SendToConsole("t is nil! ") end The result is always 't is nil', despite this being incorrect. I have put breakpoints in the code and it is indeed going over the loop, rather than doing lua_pushnil. So how do I make my method return a table when called via lua?

    Read the article

  • Click() works in IE but not Firefox

    - by Tom Andrews
    I have code which is trivial but only works in IE not Firefox. $(document).ready(function(){ $('li#first').click(); }); I have also tried: document.getElementById('first').click(); But that doesn't work either. Is this an IE bug/feature or is click() not supported in the other browsers? Thanks in advance.

    Read the article

  • How can I format numbers as money in JavaScript?

    - by Daniel Magliola
    I would like to format a price in JavaScript. Basically, I have a float variable, and I'd like to have a function that will receive that variable, and output: "$ 2,500.00" What's the best way to do this? EDIT: OK, since I haven't gotten any answers better than the code I implemented, plus my own answer has been voted down and I can't put my own answer as the right one... Here it is... var DecimalSeparator = Number("1.2").toLocaleString().substr(1,1); var AmountWithCommas = Amount.toLocaleString(); var arParts = String(AmountWithCommas).split(DecimalSeparator); var intPart = arParts[0]; var decPart = (arParts.length > 1 ? arParts[1] : ''); decPart = (decPart + '00').substr(0,2); return '£ ' + intPart + DecimalSeparator + decPart;

    Read the article

  • Filter a CSV list in XSLT

    - by Tom W
    Hello SO; I'm trying to convert xml elements whose content is a csv list of identifiers, the exact form doesn't matter. I want to exclude every item that contains the character "/". The best I've come up with is translate(./someElement, ",*/*", "") but this has at least two problems; I'm pretty sure that xsl doesn't accept wildcards, and "," is an illegal character in xpaths. Is there a straightforward way to do this sort of thing?

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >