Search Results

Search found 11822 results on 473 pages for 'ms word'.

Page 171/473 | < Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >

  • Load DataSet into an XML Document - C#.Net

    - by NLV
    Hello I'm trying to read a dataset as xml and load it into an XML Document. XmlDocument contractHistoryXMLSchemaDoc = new XmlDocument(); using (MemoryStream ms = new MemoryStream()) { //XmlWriterSettings xmlWSettings = new XmlWriterSettings(); //xmlWSettings.ConformanceLevel = ConformanceLevel.Auto; using (XmlWriter xmlW = XmlWriter.Create(ms)) { xmlW.WriteStartDocument(); dsContract.WriteXmlSchema(xmlW); xmlW.WriteEndDocument(); xmlW.Close(); using (XmlReader xmlR = XmlReader.Create(ms)) { contractHistoryXMLSchemaDoc.Load(xmlR); } } } But i'm getting the error - "Root Element Missing". Any ideas? NLV

    Read the article

  • Asp.net JSON Deserialize problem

    - by Billy
    I want to deserialize the following JSON string: [ {"name":"photos","fql_result_set":[{"owner":"123456","caption":"Caption 1", "object_id":123},{"owner":"223456","caption":"Caption 2", "object_id":456}]}, {"name":"likes","fql_result_set":[{"object_id":123,"user_id":12156144},{"object_id":456,"user_id":140342725}]} ] and get the POCO like [DataContract] public class Photo{ [DataMember] public string owner{get;set;} [DataMember] public string caption{get;set;} [DataMember] public string object_id{get;set;} } [DataContract] public class Like { [DataMember] public string object_id { get; set; } [DataMember] public string user_id { get; set; } } What should I do? I already have this piece of code: public class JSONUtil { public static T Deserialize<T>(string json) { T obj = Activator.CreateInstance<T>(); MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(json)); System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(obj.GetType()); obj = (T)serializer.ReadObject(ms); ms.Close(); return obj; }

    Read the article

  • Get the caret position when losing focus in WPF

    - by DrLazer
    I have two textbox's. I have an event setup for the "onLostFocus" of the textbox's. If i finish typing a word into both boxes one after the other all is well. At the point where i click back on the first textbox i want to click halfway through the word (perfectly resonable thing for a user to do). When the onLostFocus event fires here is my code : void tbox_LostFocus(object sender, RoutedEventArgs e) { IInputElement focusedelement = FocusManager.GetFocusedElement(this); if (focusedelement is TextBox) { TextBox focusedTextBox = focusedelement as TextBox; int focusIndex = m_commandsStacker.Children.IndexOf(focusedTextBox); int caretIndex = focusedTextBox.CaretIndex; The caret index is 0. At that point I refresh the whole form and set parameters and all other kinds of whizzery, storing the texbox index and caret position to put everything back the same. Why does it return 0 and not the position where the caret should be halfway between the word?

    Read the article

  • Vbscript / webcam. using flash API - Save streaming file as image

    - by remi
    Hi. Based on a php app we've tried to developp our own webapp in vbscript. All is working well. The camera starts, etc.. The problem we're left with is the following: the flash API is streaming the content of the video to a webpage, this page saves the photo as a jpg. The PHP code we're trying to emulate is as follow $str = file_get_contents("php://input"); file_put_contents("/tmp/upload.jpg", pack("H*", $str)); After intensive googling the best we can come up with is Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Dim sImagePath As String = Server.MapPath("/registration/") & "test.jpg" Dim data As Byte() = Request.BinaryRead(Request.TotalBytes) Dim Ret As Array Dim imgbmp As New System.Drawing.Bitmap("test.jpg") Dim ms As MemoryStream = New MemoryStream(data) imgbmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg) Ret = ms.ToArray() Dim fs As New FileStream(sImagePath, FileMode.Create, FileAccess.Write) fs.Write(Ret, 0, Ret.Length) fs.Flush() fs.Close() End Sub which is not working, does anybody have any suggestion?

    Read the article

  • DataNucleus Enhancer flakey?

    - by KevMo
    I'm creating a GWT app in Google App Engine, and using Google data store. Does anybody else have the problem of the DataNucleus being flakey as all get out? I can save a class, and DataNucleus will do it's thing just fine. If I change ANYTHING in the class (even adding whitespace) and then save, I get the following error: DataNucleus Enhancer completed with success for 0 classes. Timings : input=37 ms, enhance=0 ms, total=37 ms. Consult the log for full details DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details Once I clean my project, DataNucleus is happy again. Is this common when using eclipse? Is there a workaround?

    Read the article

  • Animation in quartz 2D

    - by coure06
    I want to create an app which after each 1 second will show 4-5 words on screen but the last word will zoom out/in. I can easily create static words and for the last animating word i need to draw the static again n again. How can i create 2 separate layers so the static text is on one layer ( i will fill it after each second) and the last word (animated one) will be on other layer. How to create 2 separate layers? Attached on same screen but handling their drawRect method separately?

    Read the article

  • Rails reserved words and convention

    - by PatrickLightning
    After having spent a lot of time researching Rails reserved words and implementing, I still have a few questions regarding use. In my example here, I'll consider the reserved word 'time'. Let's say I want to create a class 'Timepiece'. Is it not recommended to use 'timepiece' because the name begins with 'time'? Would it be recommended to use 'time_piece' or to avoid inserting the reserved word at all? My question here is also about use of the exact reserved word within the class like that. Thank you.

    Read the article

  • C#/.NET: Separation of multipage tiff with compression "CCITT T.6" very slow

    - by Alex B
    I need to separate multiframe tiff files, and use the following method: public static Image[] GetFrames(Image sourceImage) { Guid objGuid = sourceImage.FrameDimensionsList[0]; FrameDimension objDimension = new FrameDimension(objGuid); int frameCount = sourceImage.GetFrameCount(objDimension); Image[] images = new Image[frameCount]; for (int i = 0; i < frameCount; i++) { MemoryStream ms = new MemoryStream(); sourceImage.SelectActiveFrame(objDimension, i); sourceImage.Save(ms, ImageFormat.Tiff); images[i] = Image.FromStream(ms); } return images; } It works fine, butt if the source was encoded using the CCITT T.6 compression, separating a 20-frame-file takes up to 15 seconds on my 2,5ghz CPU. Saving the images afterwards to a single file using standard compression (LZW), the separation time is under 1 second. Is there a way to speed up the process?

    Read the article

  • Avoiding dispose of underlying stream

    - by danbystrom
    I'm attempting to mock some file operations. In the "real" object I have: StreamWriter createFile( string name ) { return new StreamWriter( Path.Combine( _outFolder, name ), false, Encoding.UTF8 ) ); } In the mock object I'd like to have: StreamWriter createFile( string name ) { var ms = new MemoryStream(); _files.Add( Path.Combine( _outFolder, name ), ms ); return new StreamWriter( ms, Encoding.UTF8 ) ); } where _files is a dictionary to store created files for later inspection. However, when the consumer closes the StreamWriter, it also disposes the MeamoryStream... :-( Any thoughts on how to pursue this?

    Read the article

  • Basic Profanity Filter in Objective C for iPhone

    - by David van Dugteren
    How have you like minded individuals tackled the basic challenge of filtering profanity, obviously one can't possibly tackle every scenario but it would be nice to have one at the most basic level as a first line of defense. In Obj-c I've got NSString *tokens = [text componentsSeparatedByString:@" "]; And then I loop through each token to see if any of the keywords (I've got about 400 in a list) are found within each token. Realising False positives are also a problem, if the word is a perfect match, its flagged as profanity otherwise if more than 3 words with profanity are found without being perfect matches it is also flagged as profanity. Later on I will use a webservice that tackles the problem more precisely, but I really just need something basic. So if you wrote the word penis it would go yup naughty naughty, bad word written.

    Read the article

  • i'm trying to solve an equation using gfortran but i keep getting error

    - by sameon
    i'm using the below program but i keep getting error.What is wrong with my progam? real x complex y real m1,H0,Ms,P1,P2,P3,w0,wm,wh complex w1,w2,o1,o2 integer i,n real pi n=4000000000 pi=4*atan(1.0) m1=4*pi*1e-7 H0=39.79e3 Ms=1400e3 P1=0.7*0.12 P2=0.3*0.12 P3=P1-P2 w0=m1*(1.76e11)*H0 wm=m1*(1.76e11)*Ms wh=w0-P3*wm im=cmplx(0,1) w1=wm/2+wh-im*0.06*2*pi*x w2=wm/2-wh-im*0.06*2*pi*x o1=x**2-x*(2*wh-(P3*wm)/2)-w1*w2+(wm/2)*(P1*w2+P2*w1) o2=x**2+x*(2*wh-(P3*wm)/2)-w1*w2+(wm/2)*(P1*w2+P2*w1) do i=0,n x=i y=1+wm*(P1*w1*((w2)**2-x**2))/(o1*o2) & +wm*(P2*w2*((w1)**2-x**2))/(o1*o2) & -wm*((wm/2)*((P1*w2+P2*w1)**2)))/(o1*o2) & +wm*((wm/2)*((P3*x)**2))/(o1*o2) write(10,*)x,y enddo return end

    Read the article

  • Select Range by string

    - by Petott
    How I can change this feature so I select the range of characters in a word document between the characters "E" and "F", if I have; xasdasdEcdscasdcFvfvsdfv is underlined to me the range - cdscasdc private void Rango() { Word.Range rng; Word.Document document = this.Application.ActiveDocument; object startLocation = "E"; object endLocation = "F"; // Supply a Start and End value for the Range. rng = document.Range(ref startLocation, ref endLocation); // Select the Range. rng.Select(); } This function will not let me pass by reference two objects of string type....... Thanks

    Read the article

  • Is SQL server the best DB for Storing and comparing images in database for a small ecommerce applica

    - by iecut
    I have been trying to create a small e-commerce web based application using MS Dot Net framework. The application will let the user allow to store the image of their product that they want to sell or purchase, then they will have the option to upload the image of a particular product and compare that image with the similar images in the database. So my two main concerns are: - Is MS SQL a good option to store and compare the images. - Is the any other better database that can do the same work with less complexity of work and that is also easy to integrate with MS dot net framework.

    Read the article

  • SqlBulkCopy unusual TimeOut Error

    - by ChrisHDog
    I have a SqlBulkCopy operation that is taking data from an MS-Access 2007 database (via OleDbConnection) and using SqlBulkCopy to transfer that data to a SQL Server database. This has previously been working and continues to work for one MS-Access database, but not the other. I get the error message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. It is hard to believe it is a timeout ast the oledbCommand.CommandTimeout = 0 the sqlBulkCopy.BulkCopyTimeout = 0 and on either side (MS-Access and SQL Server the timeouts have now been set to 0). Are there other issues/exceptions that the above error message could be hiding? Is there a way to determine what the base cause of a sqlBulkCopy.WriteToServer exception is (there doesn't appear to be any inner exceptions etc...)

    Read the article

  • Linq to Entities performance within ASP.NET Development Server

    - by tster
    I've been evaluating linq to entities and linq to SQL for a project. Obviously each has its own advantages and disadvantages which have been discussed plenty of times here. However, One thing I am seeing with L2E is kind of odd. Using L2S, when using the ASP.NET Development Server, the performance is a little slower for my web service calls. I'm looking at 300ms vs. 250 ms. However, when using L2E, when using ASP.NET Dev Server, the performance is awful. I'm talking 1,250 ms vs. 220 ms. I know I should probably just use local IIS for development, but I'm curious if anyone else has seen this, or knows what is causing it.

    Read the article

  • Regex and Pattern Matching in Scala

    - by Bruce Ferguson
    I am not strong in regex, and pretty new to Scala. I would like to be able to find a match between the first letter of a word, and one of the letters in a group such as "ABC". In pseudocode, this might look something like: case Process(word) => word.firstLetter match { case([a-c][A-C]) => case _ => } } but I don't know how to grab the first letter in Scala instead of Java, how to express the regular expression properly, nor if it's possible to do this within a case class. Any suggestions? Thanks in advance. Bruce

    Read the article

  • Parsing names with pyparsing

    - by johnthexiii
    I have a file of names and ages, john 25 bob 30 john bob 35 Here is what I have so far from pyparsing import * data = ''' john 25 bob 30 john bob 35 ''' name = Word(alphas + Optional(' ') + alphas) rowData = Group(name + Suppress(White(" ")) + Word(nums)) table = ZeroOrMore(rowData) print table.parseString(data) the output I am expecting is [['john', 25], ['bob', 30], ['john bob', 35]] Here is the stacktrace Traceback (most recent call last): File "C:\Users\mccauley\Desktop\client.py", line 11, in <module> eventType = Word(alphas + Optional(' ') + alphas) File "C:\Python27\lib\site-packages\pyparsing.py", line 1657, in __init__ self.name = _ustr(self) File "C:\Python27\lib\site-packages\pyparsing.py", line 122, in _ustr return str(obj) File "C:\Python27\lib\site-packages\pyparsing.py", line 1743, in __str__ self.strRepr = "W:(%s)" % charsAsStr(self.initCharsOrig) File "C:\Python27\lib\site-packages\pyparsing.py", line 1735, in charsAsStr if len(s)>4: TypeError: object of type 'And' has no len()

    Read the article

  • Grails Unit testing a function with session object

    - by Suganthan
    I having a Controller like def testFunction(testCommand cmdObj) { if (cmdObj.hasErrors()) { render(view: "testView", model: [cmdObj:cmdObj]) return } else { try { testService.testFunction(cmdObj.var1, cmdObj.var2, session.user.username as String) flash.message = message(code: 'message') redirect url: createLink(mapping: 'namedUrl') } catch (GeneralException error) { render(view: "testView", model: [cmdObj:cmdObj]) return } } } For the above controller function I having a Unit test function like: def "test function" () { controller.session.user.username = "testUser" def testCommandOj = new testCommand( var1:var1, var2:var2, var3:var3, var4:var4 ) testService service = Mock(testService) controller.testService = service service.testFunction(var2,var3,var4) when: controller.testFunction(testCommandOj) then: view == "testView" assertTrue model.cmdObj.hasErrors() where: var1 | var2 | var3 | var4 "testuser" | "word@3" | "word@4" | "word@4" } When running this test function I getting the error like Cannot set property 'username' on null object, means I couldn't able to set up the session object. Can someone help to fix this. Thanks in advance

    Read the article

  • Track status of Microsoft TTS output to wav file

    - by user325478
    I'm trying to track the status of my applications TTS output to a wav file. When speaking the text (to the speaker) the expected events (StartStream, Word, EndStream) are fired, however, no events are fired when outputing to a wave file. SpVoice vox = new SpVoice(); vox.Word += VoxWord; // Handle word processed event SpFileStream voxStream = new SpFileStream(); voxStream.Open(@"c:\test.wav", SpeechStreamFileMode.SSFMCreateForWrite, false); vox.AudioOutputStream = voxStream; vox.Speak("Hello World. Please track my status!", SpeechVoiceSpeakFlags.SVSFlagsAsync); Is it possible to asynchronously know the status of TTS output to wav?

    Read the article

  • Writing a post search algorithm.

    - by MdaG
    I'm trying to write a free text search algorithm for finding specific posts on a wall (similar kind of wall as Facebook uses). A user is suppose to be able to write some words in a search field and get hits on posts that contain the words; with the best match on top and then other posts in decreasing order according to match score. I'm using the edit distance (Levenshtein) "e(x, y) = e" to calculate the score for each post when compared to the query word "x" and post word "y" according to: score(x, y) = 2^(2 - e)(1 - min(e, |x|) / |x|) Each word in a post contributes to the total score for that specific post. This approach seems to work well when the posts are of roughly the same size, but sometime certain large posts manages to rack up score solely on having a lot of words in them while in practice not being relevant to the query. Am I approaching this problem in the wrong way or is there some way to normalize the score that I haven't thought of?

    Read the article

  • Web Service appears as website instead of developer web server

    - by stocherilac
    I recently reimaged my PC and regrabbed one of our projects from Source Safe. In our solution we have a web service that normally runs on a server, however we can build the webservice on our localhost for debugging as well. However, now whenever I grab the project from source safe it is building the webservice as a website instead of a developer web server. This is causing a variety of issue, specifically I am no longer able to specify which port I would like that webservice to use. As a result I cannot connect to our database through my local webservice. How can I change the project in my solution that controls the webservice from a website to a developer web server? MS Visual Studio 2005. MS Visual Source Safe 2005. MS SQL Server 2000. VB .NET project

    Read the article

  • Java: how to use Google's HashBiMap?

    - by HH
    Keys are a file and a word. The file gives all words inside the file. The word gives all files having the word. I am unsure of the domain and co-domain parts. I want K to be of the type <String> and V to be of type <HashSet<FileObject>>. public HashBiMap<K<String>,V<HashSet<FileObject>>> wordToFiles = new HashBiMap<K<String>,V<HashSet<FileObject>>>(); public HashBiMap<K<String>,V<HashSet<FileObject>>> fileToWords = new HashBiMap<K<String>,V<HashSet<FileObject>>>(); Google's HashBiMap.

    Read the article

  • invalid conversion from 'char' to 'int* in C

    - by majdal
    Hi, I have the following arrays: int A[] = {0,1,1,1,1, 1,0,1,0,0, 0,1,1,1,1}; int B[] = {1,1,1,1,1, 1,0,1,0,1, 0,1,0,1,0}; int C[] = {0,1,1,1,0, 1,0,0,0,1, 1,0,0,0,1}; //etc... for all letters of the alphabet And a function that prints the letters on a 5x3 LED matrix: void printLetter(int letter[]) I have a string of letters: char word[] = "STACKOVERFLOW"; and I want to pass each character of the string to the printLetter function. I tried: int n = sizeof(word); for (int i = 0; i < n-1; i++) { printLetter(word[i]); } But I get the following error: invalid conversion from 'char' to 'int*' What should i be doing? Thanks!!

    Read the article

  • Most efficient way for a lookup/search in a huge list (python)

    - by user229269
    Hey guys, -- I just parsed a big file and I created a list containing 42.000 strings/words. I want to query [against this list] to check if a given word/string belongs to it. So my question is: What is the most efficient way for such a lookup? A first approach is to sort the list [list.sort()] and then just use the if word in list: print 'word' -- which is really trivial and I am sure there is a better way to do it. My goal is to apply a fast lookup that finds whether a given string is in this list or not. If you have any ideas of another data structure, they are welcome. Yet, I want to avoid for now more sophisticated data-structures like Tries etc. I am interested in hearing ideas (or tricks) about fast lookups or any other python library methods that might do the search faster than the simple 'in'. Thanks in advance!

    Read the article

  • Adding a Line Break in mySQL INSERT INTO text

    - by james
    Hi Could someone tell me how to add a new line in a text that i enter in a mySql table. I tried using the '\n in the line i entered with INSERT INTO statement but '\n is shown as it is. Actually i have created a table in Ms Access with some data. Ms Access adds new line with '\n. I am converting Ms Access table data into mySql . But when i convert, the '\n is ignored and all the text is shown in one single line when i display it from mySql table on a php form. Can anyone tell me how mySQL can add a new line in a text ? Awaiting response Thanks !!

    Read the article

< Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >