Search Results

Search found 1221 results on 49 pages for 'jeff klein'.

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

  • Browser Statistics for Geekswithblogs.net

    - by Jeff Julian
    I love Google Analytics!  It helps me so much during my day-to-day maintenance of Geekswithblogs.net and our other sites.  I can see so much data about our visitors and come up with new ways of delivering more content to our readers so they can really get the most out of our community.  Browsers and Browser Versions is a big indicator for me to help decide what we can support and what we need to be testing with.  The clear browsers of choice right now are Chrome, IE, and Firefox taking up 94.1%.  The next browser is Safari at 2.71%.  What this really brings to my attention besides I better test well with Chrome, Firefox, and IE is that we are definitely missing an opportunity with Mobile devices.  We really need to kick up the heat when it comes to a mobile presence with Geekswithblogs.net as a community and the blogs that are on this site.  We need easy discovery of new content and easy tracking of what I like.  I am definitely on mission to make this happen and it will be a phased approach, but I want to see these numbers changes since most of us have 2 or 3 mobile devices we use for Social activities, but tools are lacking for interacting with technical data besides RSS readers. Technorati Tags: Mobile,Geekswithblogs.net,Browsers

    Read the article

  • No Launcher or bars on desktop when running from a VPS

    - by jeff
    I'm using tightVNC on Ubuntu 12.10 and can see and change the desktop background pic. I can also press f3 to get a file viewer. But there is no topbar or left side launcher. I do not think its an nvidia problem because I'm using a VPS and I logon remotely. I've tried so many variations of /root/.vnc/xstartup such as gnome-session &, or gnome-session –-session=gnome-classic &, my head is spinning. I've seen other people have this issue and was wondering if anyone solved it.

    Read the article

  • RadTabControl and MVVM

    - by Jeff
    First, so you know, Silverlight 4 and VS 2010 both RC and RIA services. I'm also new to Silverlight... I have a page that has a Telerik RadTabControl on it. It will always have six tabs, i.e. the number of tabs is not data driven. The tabs are used for various admin functions. One tab for managing users with a grid and edit view, another that will have basic company info - just a few text boxes on it. The other tabs are similar to these two. I'm trying to use MVVM and can't decide on the best approach. I don't think I want one big ViewModel that handles all six tabs - that would be big, ugly and harder to maintain. Any recommendations for approaches on how to break this out? Perhaps have a ViewModel for each tab? If so, how would I (generally) go about implementing something like that? Or is there another approach that makes more sense? Thanks, Jeff

    Read the article

  • C# average function for large numbers without overflow exception

    - by Ron Klein
    .NET Framework 3.5. I'm trying to calculate the average of some pretty large numbers. For instance: using System; using System.Linq; class Program { static void Main(string[] args) { var items = new long[] { long.MaxValue - 100, long.MaxValue - 200, long.MaxValue - 300 }; try { var avg = items.Average(); Console.WriteLine(avg); } catch (OverflowException ex) { Console.WriteLine("can't calculate that!"); } Console.ReadLine(); } } Obviously, the mathematical result is 9223372036854775607 (long.MaxValue - 200), but I get an exception there. This is because the implementation (on my machine) to the Average extension method, as inspected by .NET Reflector is: public static double Average(this IEnumerable<long> source) { if (source == null) { throw Error.ArgumentNull("source"); } long num = 0L; long num2 = 0L; foreach (long num3 in source) { num += num3; num2 += 1L; } if (num2 <= 0L) { throw Error.NoElements(); } return (((double) num) / ((double) num2)); } I know I can use a BigInt library (yes, I know that it is included in .NET Framework 4.0, but I'm tied to 3.5). But I still wonder if there's a pretty straight forward implementation of calculating the average of integers without an external library. Do you happen to know about such implementation? Thanks!!

    Read the article

  • infinite loop shutting down ensime

    - by Jeff Bowman
    When I run M-X ensime-disconnect I get the following forever: string matching regex `\"((?:[^\"\\]|\\.)*)\"' expected but `^@' found and I see this exception when I use C-c C-c Uncaught exception in com.ensime.server.SocketHandler@769aba32 java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) at java.net.SocketOutputStream.write(SocketOutputStream.java:153) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:220) at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:290) at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:294) at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:140) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) at java.io.BufferedWriter.flush(BufferedWriter.java:253) at com.ensime.server.SocketHandler.write(server.scala:118) at com.ensime.server.SocketHandler$$anonfun$act$1$$anonfun$apply$mcV$sp$1.apply(server.scala:132) at com.ensime.server.SocketHandler$$anonfun$act$1$$anonfun$apply$mcV$sp$1.apply(server.scala:127) at scala.actors.Actor$class.receive(Actor.scala:456) at com.ensime.server.SocketHandler.receive(server.scala:67) at com.ensime.server.SocketHandler$$anonfun$act$1.apply$mcV$sp(server.scala:127) at com.ensime.server.SocketHandler$$anonfun$act$1.apply(server.scala:127) at com.ensime.server.SocketHandler$$anonfun$act$1.apply(server.scala:127) at scala.actors.Reactor$class.seq(Reactor.scala:262) at com.ensime.server.SocketHandler.seq(server.scala:67) at scala.actors.Reactor$$anon$3.andThen(Reactor.scala:240) at scala.actors.Combinators$class.loop(Combinators.scala:26) at com.ensime.server.SocketHandler.loop(server.scala:67) at scala.actors.Combinators$$anonfun$loop$1.apply(Combinators.scala:26) at scala.actors.Combinators$$anonfun$loop$1.apply(Combinators.scala:26) at scala.actors.Reactor$$anonfun$seq$1$$anonfun$apply$1.apply(Reactor.scala:259) at scala.actors.ReactorTask.run(ReactorTask.scala:36) at scala.actors.ReactorTask.compute(ReactorTask.scala:74) at scala.concurrent.forkjoin.RecursiveAction.exec(RecursiveAction.java:147) at scala.concurrent.forkjoin.ForkJoinTask.quietlyExec(ForkJoinTask.java:422) at scala.concurrent.forkjoin.ForkJoinWorkerThread.mainLoop(ForkJoinWorkerThread.java:340) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:325) Is there something else I'm missing in my config or I should check on? Thanks, Jeff

    Read the article

  • VS2008 javascript debugger IE8 "there is no source code available for the current location"

    - by Jeff Keslinke
    I have almost the same problem as this unanswered question. The only difference is I'm using VS2008, but I'm in an MVC project calling this javascript function: function CompanyChange(compCtrl) { alert(compCtrl.value); debugger; var test; for (var i = 0; i < document.all.length; i++) { test = document.all[i]; } } I hit the alert, then I get the message "there is no source code available for the current location." At which point the page becomes unresponsive and I have to manually stop the debugger just to shut it down. I've logged into another machine and ran this exact code and it works fine, I hit the debugger and can step through. I've checked to make sure all settings in VSToolsOptionsDebugging are identical as well as IEOptionsAdvanced and they are. Both machines are Windows 7 Enterprise edition 32-bit, VS2008, IE8. I've also tried attaching a process manually in VS, and using the 'Developer Tools' in IE which didn't work (said there already was a process attached). I was hoping someone may have had this problem and found a work-around because I've already done a lot of searching and tried all the options I've read. Anyone else run into this? Thank you, Jeff

    Read the article

  • C# average function without overflow exception

    - by Ron Klein
    .NET Framework 3.5. I'm trying to calculate the average of some pretty large numbers. For instance: using System; using System.Linq; class Program { static void Main(string[] args) { var items = new long[] { long.MaxValue - 100, long.MaxValue - 200, long.MaxValue - 300 }; try { var avg = items.Average(); Console.WriteLine(avg); } catch (OverflowException ex) { Console.WriteLine("can't calculate that!"); } Console.ReadLine(); } } Obviously, the mathematical result is 9223372036854775607 (long.MaxValue - 200), but I get an exception there. This is because the implementation (on my machine) to the Average extension method, as inspected by .NET Reflector is: public static double Average(this IEnumerable<long> source) { if (source == null) { throw Error.ArgumentNull("source"); } long num = 0L; long num2 = 0L; foreach (long num3 in source) { num += num3; num2 += 1L; } if (num2 <= 0L) { throw Error.NoElements(); } return (((double) num) / ((double) num2)); } I know I can use a BigInt library (yes, I know that it is included in .NET Framework 4.0, but I'm tied to 3.5). But I still wonder if there's a pretty straight forward implementation of calculating the average of integers without an external library. Do you happen to know about such implementation? Thanks!! UPDATE: The previous example, of three large integers, was just an example to illustrate the overflow issue. The question is about calculating an average of any set of numbers which might sum to a large number that exceeds the type's max value. Sorry about this confusion. I also changed the question's title to avoid additional confusion. Thanks all!!

    Read the article

  • ActiveReports nested subreport rendering resulting in error

    - by Christopher Klein
    I'm having a problem with an ActiveReports(3.0) report which contains nested subreports. The problem is that the child/grandchild subreports are rendering before their predecessor has completed rendering so the XMLDataSource cannot be set properly. It seems to be a purely timing issue has occassionally if I am debugging the report in Visual Studio and stepping through the code the report will generate but mostly I get an error message: "FileURL not set or empty" The FileURL is supposed to be empty has we are dynamically loading the XML to the report. The structure of the report is: Parent Child1 Child2 GrandChild2-1 GrandChild2-2 I found one solution going back to 2004 on Data Dynamics website that you basically have to force the subreports to look at the parent. ((DataDynamics.ActiveReports.DataSources.XMLDataSource) subrpt.DataSource).FileURL = ((DataDynamics.ActiveReports.DataSources.XMLDataSource) this.DataSource).FileURL; This seemed to work for a while until I took out all my breakpoints and tried to run it and now it just gives me the error message. If anyone has ran across this or has any suggestions on getting around it, it would be greatly appreciated. Running ActiveReports 5.3.1436.2 thanks, Chris

    Read the article

  • dojox.grid.DataGrid populated from Servlet

    - by jeff porter
    I'd like to hava a Dojo dojox.grid.DataGrid with its data from a servlet. Problem: The data returned from the servlet does not get displayed, just the message "Sorry, an error has occured". If I just place the JSON string into the HTML, it works. ARRRRGGH. Can anyone please help me! Thanks Jeff Porter Servlet code... public void doGet(HttpServletRequest req, HttpServletResponse resp) { res.setContentType("json"); PrintWriter pw = new PrintWriter(res.getOutputStream()); if (response != null) pw.println("[{'batchId':'2001','batchRef':'146'}]"); pw.close(); } HtmL code... <div id="gridDD" dojoType="dojox.grid.DataGrid" jsId="gridDD" style="height: 600x; width: 100%;" store="ddInfo" structure="layoutHtmlTableDDDeltaSets"> </div> var rawdataDDInfo = ""; // empty at start ddInfo = new dojo.data.ItemFileWriteStore({ data: { identifier: 'batchId', label: 'batchId', items: rawdataDDInfo } }); <script> function doSelectBatchsAfterDate() { var xhrArgs = { url: "../secure/jsonServlet", handleAs: "json", preventCache: true, load: function(data) { var xx =dojo.toJson(data); var ddInfoX = new dojo.data.ItemFileWriteStore({data: xx}); dijit.byId('gridDD').setStore(ddInfoX); }, error: function(error) { alert("error:" + error); } } //Call the asynchronous xhrGet var deferred = dojo.xhrGet(xhrArgs); } </script> <img src="go.gif" onclick="doSelectBatchsAfterDate();"/>

    Read the article

  • Average function without overflow exception

    - by Ron Klein
    .NET Framework 3.5. I'm trying to calculate the average of some pretty large numbers. For instance: using System; using System.Linq; class Program { static void Main(string[] args) { var items = new long[] { long.MinValue + 100, long.MinValue + 200, long.MinValue + 300 }; try { var avg = items.Average(); Console.WriteLine(avg); } catch (OverflowException ex) { Console.WriteLine("can't calculate that!"); } Console.ReadLine(); } } Obviously, the mathematical result is 9223372036854775607 (long.MaxValue - 200), but I get an exception there. This is because the implementation (on my machine) to the Average extension method, as inspected by .NET Reflector is: public static double Average(this IEnumerable<long> source) { if (source == null) { throw Error.ArgumentNull("source"); } long num = 0L; long num2 = 0L; foreach (long num3 in source) { num += num3; num2 += 1L; } if (num2 <= 0L) { throw Error.NoElements(); } return (((double) num) / ((double) num2)); } I know I can use a BigInt library (yes, I know that it is included in .NET Framework 4.0, but I'm tied to 3.5). But I still wonder if there's a pretty straight forward implementation of calculating the average of integers without an external library. Do you happen to know about such implementation? Thanks!! UPDATE: The previous example, of three large integers, was just an example to illustrate the overflow issue. The question is about calculating an average of any set of numbers which might sum to a large number that exceeds the type's max value. Sorry about this confusion. I also changed the question's title to avoid additional confusion. Thanks all!!

    Read the article

  • UITextView - text shifts out of view when editing

    - by Jeff
    I have a tableHeaderView with a UITextView in it. The view loads from a nib. The UITextView does not have any scrolling turned on. The reason I am using it is simply that it wraps text over two lines. I gave it just enough room to fit two lines of text. The data that I prepopulate works just fine, and is aligned in the center vertically whether it is two or one line. The problem is that when I edit the cell via the UI, the text shifts up to the point that the top half of it is cut off. When exiting editing, it stays this way. Not sure I have any relevant code to show, but hopefully the explanation makes sense. I can't seem to find anyone else having this issue and I cannot imagine what it could be. I've played around with turning scrolling on and off, toying with the size of the field, and everything else I could play with to no avail. Thanks Jeff

    Read the article

  • Convert C++Builder AnsiString to std::string via boost::lexical_cast

    - by David Klein
    For a school assignment I have to implement a project in C++ using Borland C++ Builder. As the VCL uses AnsiString for all GUI Components I have to convert all of my std::strings to AnsiString for the sake of displaying. std::string inp = "Hello world!"; AnsiString outp(inp.c_str()); works of course but is a bit tedious to write and code duplication I want to avoid. As we use Boost in other contexts I decided to provide some helper functions go get boost::lexical_cast to work with AnsiString. Here is my implementation so far: std::istream& operator>>(std::istream& istr, AnsiString& str) { istr.exceptions(std::ios::badbit | std::ios::failbit | std::ios::eofbit); std::string s; std::getline(istr,s); str = AnsiString(s.c_str()); return istr; } In the beginning I got Access Violation after Access Violation but since I added the .exceptions() stuff the picture gets clearer. When the conversion is performed I get the following Exception: ios_base::eofbit set [Runtime Error/std::ios_base::failure] Does anyone have an idea how to fix it and can explain why the error occurs? My C++ experience is very limited. The conversion routine the other way round would be: std::ostream& operator<<(std::ostream& ostr,const AnsiString& str) { ostr << (str.c_str()); return ostr; } Maybe someone will spot an error here too :) With best regards! Edit: At the moment I'm using the edited version of Jem, it works in the beginning. After a while of using the programm the Borland Codeguard mentions some pointer arithmetic in already freed regions. Any ideas how this could be related? The Codeguard log (I'm using the german version, translations marked with stars): ------------------------------------------ Fehler 00080. 0x104230 (r) (Thread 0x07A4): Zeigerarithmetik in freigegebenem Speicher: 0x0241A238-0x0241A258. **(pointer arithmetic in freed region)** | d:\program files\borland\bds\4.0\include\dinkumware\sstream Zeile 126: | { // not first growth, adjust pointers | _Seekhigh = _Seekhigh - _Mysb::eback() + _Ptr; |> _Mysb::setp(_Mysb::pbase() - _Mysb::eback() + _Ptr, | _Mysb::pptr() - _Mysb::eback() + _Ptr, _Ptr + _Newsize); | if (_Mystate & _Noread) Aufrufhierarchie: **(stack-trace)** 0x00411731(=FOSChampion.exe:0x01:010731) d:\program files\borland\bds\4.0\include\dinkumware\sstream#126 0x00411183(=FOSChampion.exe:0x01:010183) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#465 0x0040933D(=FOSChampion.exe:0x01:00833D) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#151 0x00405988(=FOSChampion.exe:0x01:004988) d:\program files\borland\bds\4.0\include\dinkumware\ostream#679 0x00405759(=FOSChampion.exe:0x01:004759) D:\Projekte\Schule\foschamp\src\Server\Ansistringkonverter.h#31 0x004080C9(=FOSChampion.exe:0x01:0070C9) D:\Projekte\Schule\foschamp\lib\boost_1_34_1\boost/lexical_cast.hpp#151 Objekt (0x0241A238) [Größe: 32 Byte] war erstellt mit new **(Object was created with new)** | d:\program files\borland\bds\4.0\include\dinkumware\xmemory Zeile 28: | _Ty _FARQ *_Allocate(_SIZT _Count, _Ty _FARQ *) | { // allocate storage for _Count elements of type _Ty |> return ((_Ty _FARQ *)::operator new(_Count * sizeof (_Ty))); | } | Aufrufhierarchie: **(stack-trace)** 0x0040ED90(=FOSChampion.exe:0x01:00DD90) d:\program files\borland\bds\4.0\include\dinkumware\xmemory#28 0x0040E194(=FOSChampion.exe:0x01:00D194) d:\program files\borland\bds\4.0\include\dinkumware\xmemory#143 0x004115CF(=FOSChampion.exe:0x01:0105CF) d:\program files\borland\bds\4.0\include\dinkumware\sstream#105 0x00411183(=FOSChampion.exe:0x01:010183) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#465 0x0040933D(=FOSChampion.exe:0x01:00833D) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#151 0x00405988(=FOSChampion.exe:0x01:004988) d:\program files\borland\bds\4.0\include\dinkumware\ostream#679 Objekt (0x0241A238) war Gelöscht mit delete **(Object was deleted with delete)** | d:\program files\borland\bds\4.0\include\dinkumware\xmemory Zeile 138: | void deallocate(pointer _Ptr, size_type) | { // deallocate object at _Ptr, ignore size |> ::operator delete(_Ptr); | } | Aufrufhierarchie: **(stack-trace)** 0x004044C6(=FOSChampion.exe:0x01:0034C6) d:\program files\borland\bds\4.0\include\dinkumware\xmemory#138 0x00411628(=FOSChampion.exe:0x01:010628) d:\program files\borland\bds\4.0\include\dinkumware\sstream#111 0x00411183(=FOSChampion.exe:0x01:010183) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#465 0x0040933D(=FOSChampion.exe:0x01:00833D) d:\program files\borland\bds\4.0\include\dinkumware\streambuf#151 0x00405988(=FOSChampion.exe:0x01:004988) d:\program files\borland\bds\4.0\include\dinkumware\ostream#679 0x00405759(=FOSChampion.exe:0x01:004759) D:\Projekte\Schule\foschamp\src\Server\Ansistringkonverter.h#31 ------------------------------------------ Ansistringkonverter.h is the file with the posted operators and line 31 is: std::ostream& operator<<(std::ostream& ostr,const AnsiString& str) { ostr << (str.c_str()); **(31)** return ostr; } Thanks for your help :)

    Read the article

  • How can I use System.Web.Caching.Cache in a Console application?

    - by Ron Klein
    Context: .Net 3.5, C# I'd like to have caching mechanism in my Console application. Instead of re-inventing the wheel, I'd like to use System.Web.Caching.Cache (and that's a final decision, I can't use other caching framework, don't ask why). However, it looks like System.Web.Caching.Cache is supposed to run only in a valid HTTP context. My very simple snippet looks like this: using System; using System.Web.Caching; using System.Web; Cache c = new Cache(); try { c.Insert("a", 123); } catch (Exception ex) { Console.WriteLine("cannot insert to cache, exception:"); Console.WriteLine(ex); } and the result is: cannot insert to cache, exception: System.NullReferenceException: Object reference not set to an instance of an object. at System.Web.Caching.Cache.Insert(String key, Object value) at MyClass.RunSnippet() So obviously, I'm doing something wrong here. Any ideas? Update: +1 to most answers, getting the cache via static methods is the correct usage, namely HttpRuntime.Cache and HttpContext.Current.Cache. Thank you all!

    Read the article

  • Is there a free web file manager like Plesk or cPanel in ASP.Net

    - by Ron Klein
    I'm looking for a free, open-sourced web application written in C#/VB.Net on top of ASP.Net, which functions like Plesk or cPanel when it comes to (remote) file management. Something that simulates a regular FTP client, but actually displays web pages over HTTP, with the following functions: Create Folder Rename File/Folder Delete File/Folder Change Timestamp ("Touch") Move Archive etc. I saw a few commercial tools, but nothing when it comes to OSS. Any ideas? links?

    Read the article

  • SQL Server view: how to add missing rows using interpolation

    - by Christopher Klein
    Running into a problem. I have a table defined to hold the values of the daily treasury yield curve. It's a pretty simple table used for historical lookup of values. There are notibly some gaps in the table on year 4, 6, 8, 9, 11-19 and 21-29. The formula is pretty simple in that to calculate year 4 it's 0.5*Year3Value + 0.5*Year5Value. The problem is how can I write a VIEW that can return the missing years? I could probably do it in a stored procedure but the end result needs to be a view.

    Read the article

  • javafx doesnt repaint label till method has finished, why?

    - by jeff porter
    Hi all, I have a JavaFX app with a some code like this... public class MainListener extends EventListener{ override public function event (arg0 : String) : Void { statusText.content = arg0; } } statusText is defined like this... var statusText = Text { x: 30 y: stageHeight - 40 font: Font { name: "Bitstream Vera Sans Bold" size: 10 } wrappingWidth: 420 fill: Color.WHITE textAlignment: TextAlignment.CENTER content: "Status: awaiting DBF file." }; I also have some other Javacode that is load data, much like this.. public ArrayList<CustomerRecord> read(EventListener listener) { ArrayList<CustomerRecord> listOfCustomerRecords = new ArrayList<CustomerRecord>(); listener.event("Status: Starting read"); // ** takes a while... List<Map<String, CustomerField>> customerRecords = new Reader(file).readData(listener); // ** long running method over. listener.event("Status: Loaded all customers, count:" + listOfCustomerRecords.size()); return listOfCustomerRecords; } Now while the last method is in its long running call, I would expect to see my statusText updated to have 'Status: Starting read', but its doesn't. Its only when the read() method returns that the text is updated. If its was 'straight' java I would presume that the long running job is hogging the CPU, or the statusText needed to have repaint() called on it. Can anyone give me any ideas? Thanks Jeff Porter

    Read the article

  • OperationalError: foreign key mismatch

    - by Niek de Klein
    I have two tables that I'm filling, 'msrun' and 'feature'. 'feature' has a foreign key pointing to the 'msrun_name' column of the 'msrun' table. Inserting in the tables works fine. But when I try to delete from the 'feature' table I get the following error: pysqlite2.dbapi2.OperationalError: foreign key mismatch From the rules of foreign keys in the manual of SQLite: - The parent table does not exist, or - The parent key columns named in the foreign key constraint do not exist, or - The parent key columns named in the foreign key constraint are not the primary key of the parent table and are not subject to a unique constraint using collating sequence specified in the CREATE TABLE, or - The child table references the primary key of the parent without specifying the primary key columns and the number of primary key columns in the parent do not match the number of child key columns. I can see nothing that I'm violating. My create tables look like this: DROP TABLE IF EXISTS `msrun`; -- ----------------------------------------------------- -- Table `msrun` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `msrun` ( `msrun_name` VARCHAR(40) PRIMARY KEY NOT NULL , `description` VARCHAR(500) NOT NULL ); DROP TABLE IF EXISTS `feature`; -- ----------------------------------------------------- -- Table `feature` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `feature` ( `feature_id` VARCHAR(40) PRIMARY KEY NOT NULL , `intensity` DOUBLE NOT NULL , `overallquality` DOUBLE NOT NULL , `charge` INT NOT NULL , `content` VARCHAR(45) NOT NULL , `msrun_msrun_name` VARCHAR(40) NOT NULL , CONSTRAINT `fk_feature_msrun1` FOREIGN KEY (`msrun_msrun_name` ) REFERENCES `msrun` (`msrun_name` ) ON DELETE NO ACTION ON UPDATE NO ACTION); CREATE UNIQUE INDEX `id_UNIQUE` ON `feature` (`feature_id` ASC); CREATE INDEX `fk_feature_msrun1` ON `feature` (`msrun_msrun_name` ASC); As far as I can see the parent table exists, the foreign key is pointing to the right parent key, the parent key is a primary key and the foreign key specifies the primary key column. The script that produces the error: from pysqlite2 import dbapi2 as sqlite import parseFeatureXML connection = sqlite.connect('example.db') cursor = connection.cursor() cursor.execute("PRAGMA foreign_keys=ON") inputValues = ('example', 'description') cursor.execute("INSERT INTO `msrun` VALUES(?, ?)", inputValues) featureXML = parseFeatureXML.Reader('../example_scripts/example_files/input/featureXML_example.featureXML') for feature in featureXML.getSimpleFeatureInfo(): inputValues = (featureXML['id'], featureXML['intensity'], featureXML['overallquality'], featureXML['charge'], featureXML['content'], 'example') # insert the values into msrun using ? for sql injection safety cursor.execute("INSERT INTO `feature` VALUES(?,?,?,?,?,?)", inputValues) connection.commit() for feature in featureXML.getSimpleFeatureInfo(): cursor.execute("DELETE FROM `feature` WHERE feature_id = ?", (str(featureXML['id']),))

    Read the article

  • WPF TreeView: How to style selected items with rounded corners like in Explorer

    - by Helge Klein
    The selected item in a WPF TreeView has a dark blue background with "sharp" corners. That looks a bit dated today: I would like to change the background to look like in Explorer of Windows 7 (with/without focus): What I tried so far does not remove the original dark blue background but paints a rounded border on top of it so that you see the dark blue color at the edges and at the left side - ugly. Interestingly, when my version does not have the focus, it looks pretty OK: I would like to refrain from redefining the control template as shown here or here. I want to set the minimum required properties to make the selected item look like in Explorer. Alternative: I would also be happy to have the focused selected item look like mine does now when it does not have the focus. When losing the focus, the color should change from blue to grey. Here is my code: <TreeView x:Name="TreeView" ItemsSource="{Binding TopLevelNodes}" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"> <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="BorderBrush" Value="#FF7DA2CE" /> <Setter Property="Background" Value="#FFCCE2FC" /> </Trigger> </Style.Triggers> </Style> </TreeView.ItemContainerStyle> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type viewmodels:ObjectBaseViewModel}" ItemsSource="{Binding Children}"> <Border Name="ItemBorder" CornerRadius="2" Background="{Binding Background, RelativeSource={RelativeSource AncestorType=TreeViewItem}}" BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource AncestorType=TreeViewItem}}" BorderThickness="1"> <StackPanel Orientation="Horizontal" Margin="2"> <Image Name="icon" Source="/ExplorerTreeView/Images/folder.png"/> <TextBlock Text="{Binding Name}"/> </StackPanel> </Border> </HierarchicalDataTemplate> </TreeView.Resources> </TreeView>

    Read the article

  • bad performance from too many caught errors?

    - by Christopher Klein
    I have a large project in C# (.NET 2.0) which contains very large chunks of code generated by SubSonic. Is a try-catch like this causing a horrible performance hit? for (int x = 0; x < identifiers.Count; x++) {decimal target = 0; try { target = Convert.ToDecimal(assets[x + identifiers.Count * 2]); // target % } catch { targetEmpty = true; }} What is happening is if the given field that is being passed in is not something that can be converted to a decimal it sets a flag which is then used further along in the record to determine something else. The problem is that the application is literally throwing 10s of thousands of exceptions as I am parsing through 30k records. The process as a whole takes almost 10 minutes for everything and my overall task is to improve that time some and this seemed like easy hanging fruit if its a bad design idea. Any thoughts would be helpful (be kind, its been a miserable day) thanks, Chris

    Read the article

  • how can I validate column names and count in an List array? C#

    - by Christopher Klein
    I'm trying to get this resolved in .NET 2.0 and unfortunately that is not negotiable. I am reading in a csv file with columns of data that 'should' correspond to a List of tickers in IdentA with some modifications. The csv file columsn would read: A_MSFT,A_CSCO,_A_YHOO,B_MSFT,B_CSCO,B_YHOO,C_MSFT,C_CSCO,C_YHOO IdentA[0]="MSFT" IdentA[1]="CSCO" IdentA[2]="YHOO" The AssetsA array is populated with the csv data AssetsA[0]=0 AssetsA[1]=1.1 AssetsA[2]=0 AssetsA[3]=2 AssetsA[4]=3.2 AssetsA[5]=12 AssetsA[6]=54 AssetsA[7]=13 AssetsA[8]=0.2 The C_ columns are optional but if they exist they all need to exist. All of the suffixes must match the values in IdentA. The values in the csv files all need to be decimal. I'm using a group of 3 as an example, there could be any number of tickers in the IdentA array. Its easy enough to do the first part: for (int x = 0; x < IdentA.Count; x++) { decimal.TryParse(AssetsA[x + IdentA.Count], out currentelections); } So that will get me the first set of values for the A_ columns but how can I get through B_ and C_ ? I can't do something as simple as IdentA.Count*2...

    Read the article

  • Check whether Excel file is Password protected

    - by Torben Klein
    I am trying to open an Excel (xlsm) file via VBA. It may or may not be protected with a (known) password. I am using this code: On Error Resume Next Workbooks.Open filename, Password:=user_entered_pw opened = (Err.Number=0) On Error Goto 0 Now, this works fine if the workbook has a password. But if it is unprotected, it can NOT be opened. Apparently this is a bug in XL2007 if there is also workbook structure protection active. (http://vbaadventures.blogspot.com/2009/01/possible-error-in-excel-2007.html). On old XL2003, supplying a password would open both unprotected and password protected file. I tried: Workbooks.Open filename, Password:=user_entered_pw If (Err.Number <> 0) Then workbooks.open filename This works for unprotected and protected file. However if the user enters a wrong password it runs into the second line and pops up the "enter password" prompt, which I do not want. How to get around this?

    Read the article

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