Search Results

Search found 1015 results on 41 pages for 'mongodb csharp'.

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

  • Csharp component which generates fragments with highlights for diffs for 2 strings

    - by MicMit
    I need C# implementation ( ideally open source ) which is similar to Delphi DLL. I am currently using the wrapper ( C# syntax is provided , but it is a call from a different language ) zdiff( string ref str1, string ref str2, int range , int trim ) it calls inside str1 = GetHiDiff(@str1,1,trim) str2 = GetHiDiff(@str1,2,trim) where function GetHiDiff(s:pchar; sIndex:integer; wtrim:integer): pchar; stdcall; What it does it returns a left fragment html of str1 and a right html fragment of str2 with diffs highlighted as strings are passed by reference. Range parameter determines the size of html fragment. Not sure what trim 0 does.

    Read the article

  • CSharp: Testing a Generic Class

    - by Jonas Gorauskas
    More than a question, per se, this is an attempt to compare notes with other people. I wrote a generic History class that emulates the functionality of a browser's history. I am trying to wrap my head around how far to go when writing unit tests for it. I am using NUnit. Please share your testing approaches below. The full code for the History class is here (http://pastebin.com/ZGKK2V84).

    Read the article

  • Csharp component which generates fragmens with highlights for diffs for 2 strings

    - by MicMit
    I need C# equivalent ( ideally open source ) which is similar to Delphi DLL. I am currently using the wrapper ( C# syntax is provided , but it is a call from a different language ) zdiff( string ref str1, string ref str2, int range , int trim ) it calls inside str1 = GetHiDiff(@str1,1,trim) str2 = GetHiDiff(@str1,2,trim) where function GetHiDiff(s:pchar; sIndex:integer; wtrim:integer): pchar; stdcall; What it does it returns a left fragment html of str1 and a right html fragment of str2 with diffs highlighted as strings are passed by reference. Range parameter determines the size of html fragment. Not sure what trim 0 does.

    Read the article

  • asp.net - csharp - jquery - looking for a better and usage solution

    - by LostLord
    hi my dear friends i have a little problem about using jquery...(i reeally do not know jquery but i forced to use it) i am using vs 2008 - asp.net web app with c# also i am using telerik controls in my pages also i am using sqldatasources (Connecting to storedprocedures) in my pages my pages base on master and content pages and in content pages i have mutiviews ================================================================================= in one of the views(inside one of those multiviews)i had made two radcombo boxes for country and city requirement like cascading dropdowns as parent and child combo boxes. i used old way for doing that , i mean i used update panel and in the SelectedIndexChange Event of Parent RadComboBox(Country) i Wrote this code : protected void RadcomboboxCountry_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { hfSelectedCo_ID.Value = RadcomboboxCountry.SelectedValue; RadcomboboxCity.Items.Clear(); RadcomboboxCity.Items.Add(new RadComboBoxItem(" ...", "5")); RadcomboboxCity.DataBind(); RadcomboboxCity.SelectedIndex = 0; } my child radcombo box can fill by upper code , let me tell you how : the child sqldatasource have a sp that has a parameter and i fill that parameter by this line - hfSelectedCo_ID.Value = RadcbCoNameInInsert.SelectedValue; RadcbCoNameInInsert.SelectedValue means country ID. after doing that SelectedIndexChange Event of Parent RadComboBox(Country) could not be fire therefore i forced to set the autopostback property to true. afetr doing that every thing was ok until some one told me can u control focus and keydown of your radcombo boxes (when u press enter key on the parent combobox[country] , so child combobox gets focus -- and when u press upperkey on child radcombobox [city], so parent combobox[country] gets focus) (For Users That Do Not Want To Use Mouse for Input Info And Choose items) i told him this is web app , not win form and we can not do that. i googled it and i found jquery the only way for doing that ... so i started using jquery . i wrote this code with jquery for both of them : <script src="../JQuery/jquery-1.4.1.js" language="javascript" type="text/javascript"></script> <script type="text/javascript"> $(function() { $('input[id$=RadcomboboxCountry_Input]').focus(); $('input[id$=RadcomboboxCountry_Input]').select(); $('input[id$=RadcomboboxCountry_Input]').bind('keyup', function(e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 13) { -----------> Enter Key $('input[id$=RadcomboboxCity_Input]').focus(); $('input[id$=RadcomboboxCity_Input]').select(); } }); $('input[id$=RadcomboboxCity_Input]').bind('keyup', function(e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 38) { -----------> Upper Key $('input[id$=RadcomboboxCountry_Input]').focus(); $('input[id$=RadcomboboxCountry_Input]').select(); } }); }); </script> this jquery code worked BBBBBBUUUUUUUTTTTTT autopostback=true of the Parent RadComboBox Became A Problem , Because when SelectedIndex Change Of ParentRadComboBox is fired after that Telerik Skins runs and after that i lost parent ComboBox Focus and we should use mouse but we don't want it.... for fix this problem i decided to set autopostback of perentCB to false and convert protected void RadcomboboxCountry_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { hfSelectedCo_ID.Value = RadcomboboxCountry.SelectedValue; RadcomboboxCity.Items.Clear(); RadcomboboxCity.Items.Add(new RadComboBoxItem(" ...", "5")); RadcomboboxCity.DataBind(); RadcomboboxCity.SelectedIndex = 0; } to a public non static method without parameters and call it with jquey like this : (i used onclientchanged property of parentcombo box like onclientchanged = "MyMethodForParentCB_InJquery();" insread of selectedindexchange event) public void MyMethodForParentCB_InCodeBehind() { hfSelectedCo_ID.Value = RadcomboboxCountry.SelectedValue; RadcomboboxCity.Items.Clear(); RadcomboboxCity.Items.Add(new RadComboBoxItem(" ...", "5")); RadcomboboxCity.DataBind(); RadcomboboxCity.SelectedIndex = 0; } for doing that i read the blow manual and do that step by step : ======================================================================= http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=732 ======================================================================= but this manual is about static methods and this is my new problem ... when i am using static method like : public static void MyMethodForParentCB_InCodeBehind() { hfSelectedCo_ID.Value = RadcomboboxCountry.SelectedValue; RadcomboboxCity.Items.Clear(); RadcomboboxCity.Items.Add(new RadComboBoxItem(" ...", "5")); RadcomboboxCity.DataBind(); RadcomboboxCity.SelectedIndex = 0; } so i recieved some errors and this method could not recognize my controls and hidden field... one of those errors like this : Error 2 An object reference is required for the non-static field, method, or property 'Darman.SuperAdmin.Users.hfSelectedCo_ID' C:\Javad\Copy of Darman 6\Darman\SuperAdmin\Users.aspx.cs 231 13 Darman any idea or is there any way to call non static methods with jquery (i know we can not do that but is there another way to solve my problem)???????????????

    Read the article

  • CSharp -- PInvokeStackImbalance detected on a well documented function?

    - by Aaron Hammond
    Here is my code for a ClickMouse() function: [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo); private const long MOUSEEVENTF_LEFTDOWN = 0x02; private const long MOUSEEVENTF_LEFTUP = 0x04; private const long MOUSEEVENTF_RIGHTDOWN = 0x08; private const long MOUSEEVENTF_RIGHTUP = 0x10; private void ClickMouse() { long X = Cursor.Position.X; long Y = Cursor.Position.Y; mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0); } For some reason, when my program comes to this code, it throws this error message: PInvokeStackImbalance was detected Message: A call to PInvoke function 'WindowsFormsApplication1!WindowsFormsApplication1.Form1::mouse_event' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature. Please help?

    Read the article

  • CSharp Compiler and Windows.Forms

    - by j-t-s
    Hi All I've just created a little app that programmatically compiles code using the C# Compiler, and it works brilliantly. But, one thing that I need it to do is compile Windows.Forms code. Like, I can create a console app with it, but I can't create a GUI-based form. Here's the link that got me started: http://support.microsoft.com/kb/304655 Can somebody please help? Thank you :)

    Read the article

  • Accessing C++ methods from Csharp

    - by Code Smack
    Hello, I have a string with CompressedRichText in it. I want to uncompressed it to standard RTF and then to plain Text. I am using VS 2008 C# Windows Application. I found references to C++ code to do it, but nothing directly in C#. I found some info at this site on the C++ part, but I have no idea how to use this from my C# code. What do I need to do in order to access the methods in the C++ code from my C# project. Link to the C++ Code http://msdn.microsoft.com/en-us/library/bb905295.aspx Thanks!

    Read the article

  • Exceptions from automongobackup, yet script completes

    - by chakram88
    I am using automongobackup to, well, automate the backups of mongodb. output from the script (to STDERR) has the following exceptions (but the backup completes, and the dump files are created) ###### WARNING ###### STDERR written to during mongodump execution. The backup probably succeeded, as mongodump sometimes writes to STDERR, but you may wish to scan the error log below: exception: connect failed exception: connect failed exception: connect failed exception: connect failed exception: HostAndPort: bad port # exception: connect failed exception: connect failed exception: connect failed exception: connect failed exception: connect failed exception: connect failed I know that the Host & Port are correct. If I run mongodump --host=127.0.0.1:27017 --journal (which is the effective command from automongobackup based on the options set and my reading of the src code) everything runs clean without any error reporting and the dump files are created as expected. Why would automongobackup report connection errors, even tho it does create the dump files, yet a straight call to mongodump does not? Debian 6.0 Lenny (from Linode image: Latest 3.2 (3.2.1-x86_64-linode23)) AutoMongoBackup VER 0.9 mongodb v 2.0.2

    Read the article

  • Csharp: I am trying to get the top nth values from and rectangular array

    - by user355925
    I am reading a txt file for strings that represent intergers. the file is space delimited. I have created an array[10,2]. evertime the the strings 1~10 is found in the file I increment array[n,0] by 1. I also feed array[n,1] with numbers 1~10. ie txt file contents: 1/1/1 10/1/2001 1 1 10 2 2 3 1 5 10 word word 3 3 etc.. streamreader reads 1/1/1 and determines that is is not 1~10 streamreader reads 10/1/2001 and determines that it is not 1~10 streamreader reads 1 and ++array[0,0] streamreader reads 1 and ++array[0,0] streamreader reads 10 and ++array[9,0] etc.. the result will be: '1' was found 3 times '2' was found 2 times '3' was found 3 times '5' was found 1 time '10' was found 2 times My problem is that I need this array placed in order(sorted) by value of column 0 so that it would be: 1 3 2 10 5

    Read the article

  • csharp get value datatemplate element

    - by To-me
    Hello, Here is my code <ListBox x:Name="myList" IsSynchronizedWithCurrentItem="True" SelectionChanged="editElement"> <ListBox.ItemTemplate> <DataTemplate x:Name="ElementItemTemplate"> <StackPanel Name="stackPanelElementItem" Orientation="Horizontal"> <Label Name="SelectedItemlabel" Content="{Binding}" /> <Button Name="buttonDelElement" Click="btnDelElement">Delete</Button> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> private void btnDelElement(object sender, RoutedEventArgs e) { ListBoxItem lbi2 = (ListBoxItem)(lstCursus.ItemContainerGenerator.ContainerFromItem(myList.Items.CurrentItem)); String selectedItem = lbi2.Content.ToString(); MessageBox.Show("Selected Item " + selectedItem + " ."); private void editCursus(object sender, RoutedEventArgs e) { MessageBox.Show("Selected Item " + selectedItem + " ."); /* some code to edit selected item using linq */ } My issue, SelectionChange doesn't work anymore and when I click on buttonDelElement, Selected Item doesn't change immediately. Please, any ideas?

    Read the article

  • non-mapped virtual memory & total number of connections

    - by tszming
    We have two MongoDB data nodes (replica set) - Primary & Secondary. I noticed that the non-mapped virtual memory is relatively high and wondering if they are hurting our MongoDB performance (The server usually peaked at around 6-7K queries per sec). In MMS, it was stated: "The most common case of usage of a high amount of memory for non-mapped is that there are very many connections to the database." So we checked the memory usage with db.serverStatus().mem in our Secondary: { "bits" : 64, "resident" : 6846, "virtual" : 416797, "supported" : true, "mapped" : 205549, "mappedWithJournal" : 411098, "note" : "virtual minus mapped is large. could indicate a memory leak" } Note: We are using 2.0.4 and now the default stack size should be 1MB per connection. The current number of connections is around 1.1K, but the non-mapped virtual memory (virtual-mappedWithJournal) is around 5699 MB. The trend is quite stable so I can't say there is a leak here, but where is the memory gone? Any idea?

    Read the article

  • Document-oriented vs Column-oriented database fit

    - by user1007922
    I have a data-intensive application that desperately needs a database make-over. The general data model: There are records with RIDs, grouped together by group IDs (GID). The records have arbitrary data fields, (maybe 5-15) with a few of them mandatory and the rest optional, and thus sparse. The general use model: There are LOTS and LOTS of Writes. Millions to Billions of records are stored. Very often, they are associated with new GIDs, but sometimes, they are associated with existing GIDs. There aren't as many reads, but when they happen, they need to be pretty fast or at least constant speed regardless of the database size. And when the reads happen, it will need to retrieve all the records/RIDs with a certain GID. I don't have a need to search by the record field values. Primarily, I will need to query by the GID and maybe RID. What database implementation should I use? I did some initial research between document-oriented and column-oriented databases and it seems the document-oriented ones are a good fit, model-wise. I could store all the records together under the same document key using the GID. But I don't really have any use for their ability to search the document contents itself. I like the simplicity and scalability of column-oriented databases like Cassandra, but how should I model my data in this paradigm for optimal performance? Should my key be the GID and should I create a column for each record/RID? (there maybe thousands or hundreds of thousands of records in a group/GID). Or should my key be the RID and ensure each row has a column for the GID value? What results in faster writes and reads under this model?

    Read the article

  • How to represent a tree structure in NoSQL

    - by Vlad Nicula
    I'm new to NoSQL and have been playing around with a personal project on the MEAN stack (Mongo ExpressJs AngularJs NodeJs). I'm building a document editor of sorts that manages nodes of data. Each document is actually a tree. I have a CRUD api for documents, to create new trees and a CRUD api for nodes in a given document. Right now the documents are represented as a collection that holds everything, including nodes. The children parent relationship is done by ids. So the nodes are an map by id, and each node has references to what nodes are their children. I chose this "flat" approach because it is easier to get a node by id from a document. Being used to having a relation table between nodes and documents, a relation table between nodes and children nodes I find it a bit weird that I have to save the entire "nodes" map each time I update a node. Is there a better way to represent such a data type in NoSQL?

    Read the article

  • How to use 3rd party libraries in glassfish?

    - by Hank
    I need to connect to a MongoDB instance from my EJB3 application, running on glassfish 3.0.1. The Mongo project provides a set of drivers, and I'm able to use them in a standalone Java application. How would I use them in a JEE application? Or maybe better phrasing: how would I make a 3rd party library available to my application when it runs in an EJB container? At the moment, I'm getting a java.lang.NoClassDefFoundError when deploying a bean that tries to import from the library: [#|2010-03-24T11:42:15.164+0100|SEVERE|glassfishv3.0|global|_ThreadID=28;_ThreadName=Thread-1;|Class [ com/mongodb/DBObject ] not found. Error while loading [ class mvs.core.LocationCacheService ]|#] [#|2010-03-24T11:42:15.164+0100|WARNING|glassfishv3.0|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=28;_ThreadName=Thread-1;|Error in annotation processing: java.lang.NoClassDefFoundError: com/mongodb/DBObject|#] [#|2010-03-24T11:42:15.259+0100|SEVERE|glassfishv3.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=28;_ThreadName=Thread-1;|Exception while loading the app org.glassfish.deployment.common.DeploymentException: java.lang.NoClassDefFoundError: com/mongodb/DBObject at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:171) at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:125) at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:224) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338) I tried adding it to the NetBeans project (Properties - Libraries - Compile - Add Jar, enable 'Package'), and I also tried manually copying the jar file to $GF_HOME/glassfish/domains/domain1/lib (where the mysql-connector already resides). Do I need to 'register' the library with the container? Reference it via Annotation? Extend the classpath of the container to include the library?

    Read the article

  • Is an ORM redundant with a NoSQL API?

    - by Earlz
    Hello, with MongoDB (and I assume other NoSQL database APIs worth their salt) the ways of querying the database are much more simplistic than SQL. There is no tedious SQL queries to generate and such. For instance take this from mongodb-csharp: using MongoDB.Driver; Mongo db = new Mongo(); db.Connect(); //Connect to localhost on the default port. Document query = new Document(); query["field1"] = 10; Document result = db["tests"]["reads"].FindOne(query); db.Disconnect(); How could an ORM even simplify that? Is an ORM or other "database abstraction device" required on top of a decent NoSQL API?

    Read the article

  • Moving webshop storage to NoSQL solution

    - by mare
    If you had a webshop solution based on SQL Server relational DB what would be the reasons, if any, to move to NoSQL storage ? Does it even make sense to migrate datastores that rely on relations heavily to NoSQL? If starting from scratch, would you choose NoSQL solution over relational one for a webshop project, which will, after a while, again end up with a bunch of tables like Articles, Classifications, TaxRates, Pricelists etc. and a magnitude of relations between them? What's the support like in .NET (4.0) for MongoDB or MongoDB's support for .NET 4.0? Can I count on rich code generation tools similar to EF wizard, L2SQL wizard etc. for MongoDB? Because as what I have read so far, NoSQL's are mostly suited for document storage, simpler object models. Your answer to this question will help me make the right infrastructure design decisions.

    Read the article

  • Why is it called NoSQL?

    - by beef jerky
    I've recently worked with MongoDB and learned about its schemaless design. However, I'm confused with the term NoSQL? Why is it called that? Doesn't it use SQL or SQL-like queries? I've also read from an article that the main difference lies in how data is stored. In the case of MongoDB, it's stored like JSON documents. Is this true? Also, I'm confused why I always see 'NoSQL vs relational databases'. Aren't NoSQL databases relational? I believe documents in MongoDB are still related/linked through some keys (please correct me if I'm wrong). So why is it labeled as non-relational? Thanks in advance!

    Read the article

  • Rails/Mongo across multiple different geo-regions

    - by wmarbut
    I have a system that by necessity requires physical presence in three or more different locations and I need advice on structuring in such a way that my database stays replicated in a timely manner without horrible latency. I've seen mysql access and replication be incredibly slow when the application server was trying to talk to a node that wasn't physically collocated. In this case I am using mongodb. The stack is linux/passenger/ruby/rails/mongodb. The database is write heavy and read light. The infrastructure is Amazon EC2 The application layer must be physically located in 3 or more different locations. I can't justify this requirement further than it is a requirement. The database, however needn't be located in more than one location if it can be written to quickly from other locations. From reading mongo's documentation, mongo replication seems like more of a candidate than sharding b/c my datastore is not huge. However I don't see anything that addresses the issue of speed for servers communicating across large distances with potentially high latency.

    Read the article

  • How to run "mongodb --repair" if it's an Upstart job?

    - by Wolfram Arnold
    My MongoDB server died. The log says something about an unclean shutdown and an existing mongodb.lock file. It recommends to remove the lock file, then restart the mongodb server with --repair. However, on my system (Ubuntu 10.10), I've installed MongoDB via an apt-get package, and it's set up as Upstart job. If I run mongodb from the command line, it won't find the data, none of the paths are set correctly. Surely, I could read the man page, try to emulate what Upstart would do, give it all the correct parameters plus --repair but that seems like a lot of trouble. There must be a simpler way, that's not fighting Upstart. What is it?

    Read the article

  • Developing high-performance and scalable zend framework website

    - by Daniel
    We are going to develop an ads website like http://www.gumtree.com/ (it will not be like this one but just to give you an ideea) and we are having some issues regarding performance and scalability. We are planning on using Zend Framework for this project but this is all that I'm sure off at this point. I don't think a classic approch like Zend Framework (PHP) + MySQL + Memcache + jQuery (and I would throw Doctrine 2 in there to) will fix result in a high-performance application. I was thinking on making this a RESTful application (with Zend Framework) + NGINX (or maybe MongoDB) + Memcache (or eAccelerator -- I understand this will create problems with scalability on multiple servers) + jQuery, a CDN for static content, a server for images and a scalable server for the requests and the rest. My questions are: - What do you think about my approch? - What solutions would you recommand in terms of servers approch (MySQL, NGINX, MongoDB or pgsql) for a scalable application expected to have a lot of traffic using PHP?...I would be interested in your approch. Note: I'm a Zend Framework developer and don't have to much experience with the servers part (to determin what would be best solution for my scalable application)

    Read the article

  • Automatically creating volume partitions on boot

    - by Justin Meltzer
    I followed this guide: http://www.mongodb.org/display/DOCS/Amazon+EC2+Quickstart to set up Mongodb. It had me create a RAID 10 array out of the four devices on EBS. Then it had me create a physical volume, a volume group, and three logical volumes out of that RAID 10 array. Lastly it had me create ext4 filesystems out of the logical volumes and mount them. Now the quickstart guide had me put two things in place so that these steps would be replicated on reboot of the system. It had me add some instructions to the mdadm.conf file to automatically create the RAID 10 array, and it also had me add instructions to the fstab file to automatically mount the filesystem for each logical volume. However, the quickstart guide does not have anything for automatically creating the logical volumes from the RAID 10 array. I checked my system and see that each of the four devices are part of a RAID array: $ sudo mdadm -Q /dev/sdh1 /dev/sdh1: is not an md array /dev/sdh1: device 0 in 4 device unknown raid10 array. Use mdadm --examine for more detail. However, the filesystem is never created or mounted from fstab because it's trying to mount it from logical volumes that were never created (or so it seems). My question is, how can I automatically accomplish all the steps from the quickstart guide on a reboot of the system, and what config file do I need to add data to so that I can automatically create these volume partions after the RAID 10 is created but before the filesystem is mounted. Also I'm unsure whether fstab actually creates and mounts the filesystem or just mounts the filesystem.

    Read the article

  • sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 command returns error

    - by nyamka
    I'm trying to install Mongodb on Ubuntu 12 but when I run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 This returned the error below: keyserver.ubuntu.com host not found gpgkeys: HTTP fetch error 7: couldn't connect: no such file or directory gpg:no valid openPGP data found gpg: Total number processes :0 I turned off Firewall on Iptables, but it don't work. Is there any idea?

    Read the article

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