Search Results

Search found 600 results on 24 pages for 'splitting'.

Page 16/24 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Entity Framework projections

    - by David McClelland
    We are investigating the Entity Framework to see if it will meet our particular needs. Here is the scenario I am interested in: I have a large table (let's call it VeryWideRecord) which has many columns, and it has a corresponding business object (it's also called VeryWideRecord). I would like to be able to query my database for a VeryWideRecord business object, but only have values for certain columns returned by the underlying SQL. Can I do this with the Entity Framework? I am uncertain as to whether this could be done with the Entity Framework's table splitting feature, because the application needs to be able (at runtime) to change the columns that are requested. The reason for this is that we are trying to minimize the amount of information that is going across the wire. I see how this could be done using NHibernate (example), but how can I do this with the Entity Framework?

    Read the article

  • split with javascript

    - by Sourabh
    Hi below is something I am trying to do with JavaScript. If I have string like str = "how are you? hope you are doing good" ; now I want to split it with ? but I dont want to lose the "?". Instead I want to break the string just after the question mark such a way that question mark is with the first segment that we have after splitting str what should I get is ["how are you?","hope you are doing good"] I am not sure if it can be done with Javascript split() function ,please help.

    Read the article

  • Finding if a sentence contains a specific phrase in Ruby

    - by TenJack
    Right now I am seeing if a sentence contains a specific word by splitting the sentence into an array and then doing an include to see if it contains the word. Something like: "This is my awesome sentence.".split(" ").include?('awesome') But I'm wondering what the fastest way to do this with a phrase is. Like if I wanted to see if the sentence "This is my awesome sentence." contains the phrase "my awesome sentence". I am scraping sentences and comparing a very large number of phrases, so speed is somewhat important.

    Read the article

  • XmlNode.InnerText

    - by Jonathan.Peppers
    We have XML like so: <Example> <Node>Some text here <ChildNode>Child 1</ChildNode> <ChildNode>Child 2</ChildNode> </Node> </Example> We are using XmlDocument to parse this. When we have the XmlNode of the Node element, XmlNode.InnerText returns us this: "Some text hereChild 1Child2" How can we get the inner text of the Node element without the child nodes' inner text? We don't really want to use any Regex or string splitting to accomplish this. Note: We also don't want to switch to using a different set of classes to parse this XML, it would be too much of a code change.

    Read the article

  • How to declare a variable that spans multiple lines

    - by Chris Wilson
    I'm attempting to initialise a string variable in C++, and the value is so long that it's going to exceed the 80 character per line limit I'm working to, so I'd like to split it to the next line, but I'm not sure how to do that. I know that when splitting the contents of a stream across multiple lines, the syntax goes like cout << "This is a string" << "This is another string"; Is there an equivalent for variable assignment, or do I have to declare multiple variables and concatenate them? Edit: I misspoke when I wrote the initial question. When I say 'next line', I'm just meaning the next line of the script. When it is printed upon execution, I would like it to be on the same line.

    Read the article

  • Split string into multiple lines

    - by RememberME
    I have a long string of comments that I'd like to split into multiple lines. It's currently displayed as <%= Html.Encode(item.important_notes) %> I've played with using .Substring to split it, but can't figure out how to prevent it from splitting in the middle of a word. Instead of characters 1-100 on line 1 and 101-200 on line 2, I'd like to do something like character 1 through the last space before character 100 on line one. That character through the last space before the next 100 characters on line 2, etc. What is the best way to do this? EDIT: using ASP.NET-MVC

    Read the article

  • Parsing String into multiple variable length String (C#)

    - by Nassign
    I am currently trying to convert a VB6 program into C#. There was extensive use of string splitting into structure. For example, Dim Sample AS String Sample = "John Doe New York Test Comment" Public Type Struct1 Name As String * 15 Address As String * 10 Comment As String * 20 End Type Dim dataStruct As Struct1 Set dataStruct = Sample When the dataStruct is set, it will automatically split value into the 3 structure member. Is there a special function to do this in C#. The only way I know how to do this is thru Attributes/Annotation describing the length and start position of string. Any other suggestion?

    Read the article

  • c++ programming for clusters and HPC

    - by Abruzzo Forte e Gentile
    HI All I need to write a scientific application in C++ doing a lot of computations and using a lot of memory. I have part of the job but due to high requirements in terms of resources I was thinking to start moving to OpenMPI. Before doing that I have a simple curiosity: If I understood the principle of OpenMPI is the developer that has the task of splitting the jobs over different nodes calling SEND and RECEIVE based on node available at that time. Do you know if it does exist some library or OS or whatever that has this capability letting my code reamain as it is now? Basically something that connects all computers and let share as one their memory and CPU? I am a bit confused because of the high material available on the topic. Should I look at cloud computing? or Distributed Shared Memory? Can you help me or address me a bit? Thanks

    Read the article

  • Tools for viewing logs of unlimited size

    - by jkff
    It's no secret that application logs can go well beyond the limits of naive log viewers, and the desired viewer functionality (say, filtering the log based on a condition, or highlighting particular message types, or splitting it into sublogs based on a field value, or merging several logs based on a time axis, or bookmarking etc.) is beyond the abilities of large-file text viewers. I wonder: Whether decent specialized applications exist (I haven't found any) What functionality might one expect from such an application? (I'm asking because my student is writing such an application, and the functionality above has already been implemented to a certain extent of usability)

    Read the article

  • Adding more OR searches with CONTAINS Brings Query to Crawl

    - by scolja
    I have a simple query that relies on two full-text indexed tables, but it runs extremely slow when I have the CONTAINS combined with any additional OR search. As seen in the execution plan, the two full text searches crush the performance. If I query with just 1 of the CONTAINS, or neither, the query is sub-second, but the moment you add OR into the mix the query becomes ill-fated. The two tables are nothing special, they're not overly wide (42 cols in one, 21 in the other; maybe 10 cols are FT indexed in each) or even contain very many records (36k recs in the biggest of the two). I was able to solve the performance by splitting the two CONTAINS searches into their own SELECT queries and then UNION the three together. Is this UNION workaround my only hope? Thanks. SELECT a.CollectionID FROM collections a INNER JOIN determinations b ON a.CollectionID = b.CollectionID WHERE a.CollrTeam_Text LIKE '%fa%' OR CONTAINS(a.*, '"*fa*"') OR CONTAINS(b.*, '"*fa*"') Execution Plan (guess I need more reputation before I can post the image):

    Read the article

  • Should I Split Tables Relevant to X Module Into Different DB? Mysql

    - by Michael Robinson
    I've inherited a rather large and somewhat messy codebase, and have been tasked with making it faster, less noodly and generally better. Currently we use one big database to hold all data for all aspects of the site. As we need to plan for significant growth in the future, I'm considering splitting tables relevant to specific sections of the site into different databases, so if/when one gets too large for one server I can more easily migrate some user data to different mysql servers while retaining overall integrity. I would still need to use joins on some tables across the new databases. Is this a normal thing to do? Would I incur a performance hit because of this?

    Read the article

  • How to get Path Separator in Perl?

    - by ram
    In case of Java, we can get the path separator using System.getProperty("path.separator"); Is there a similar way in Perl? All I want to do is to find a dir, immediate sub directory. Say I am being given two argumens $a and $b; I am splitting the first one based on the path separator and joining it again except the last fragment and comparing with the second argument. The problem is my code has to be generic and for that I need to know whats the system dependent path separator is? Could you help if there is any way to get it? TIA

    Read the article

  • Best tools to create valid XML files from an Excel file

    - by systempuntoout
    I need to create a script that extracts some data from a complex Excel 2003 file (with multiple Sheets and different tables inside a single sheet) and produces different XML files that need to be validated against a given XSD file. My preferred language is Python; to create and validate XML files i would go with lxml. What do you suggest for parsing XSL files? Is xlrd the right tool to use for complex Excel files? Or do i need to convert all the sheets in CSV manually, and read files line by line, splitting and getting data? I accept C#, VB6 suggestions too.

    Read the article

  • css help , to create div

    - by 422
    Please see pic, this is what I want to do. I am really struggling to bloody do it lol. The master div, is 600px wide ( blue bg ) and need splitting into two areas, left for the image and right for the text etc. Ignore the vertical divider line The left hand div, is approx 200px wide, and need to specify a min-height of 100px, as the placeholder image which is centered to that div 50% 50% will change size, as I will be adding another div like this with larger image placeholder. The right part contains the header tag, description, button and second description. I have already constructed this and works fine in chrome and ff, but not in ie. So could you guys have a think, and give me some code that complies in all browsers. It is officially doing my head in now. Screenpic of it working in ff and chrome below:

    Read the article

  • Foreach wont split a string

    - by Luke
    //assign variables string measurementIn; //read in file in array string[] lines = File.ReadAllLines("../../convert.txt"); //ask user for date Console.WriteLine("Enter the conversion in the form (amount,from,to)"); measurementIn = Console.ReadLine(); //array for splitting input string[] conversionArray = measurementIn.Split(','); Console.WriteLine("{0} , {1} , {2}", conversionArray[0], conversionArray[1], conversionArray[2]); Console.ReadLine(); //check lines for conversion foreach (string line in lines) { //array for the measurement string[] measurementArray = line.Split(','); Console.WriteLine("{0}", measurementArray[0]);

    Read the article

  • Are multiple asserts bad in a unit test? Even if chaining?

    - by Michael Haren
    Is there anything wrong with checking so many things in this unit test?: ActualModel = ActualResult.AssertViewRendered() // check 1 .ForView("Index") // check 2 .WithViewData<List<Page>>(); // check 3 CollectionAssert.AreEqual(Expected, ActualModel); // check 4 The primary goals of this test are to verify the right view is returned (check 2) and it contains the right data (check 4). Would I gain anything by splitting this into multiple tests? I'm all about doing things right, but I'm not going to split things up if it doesn't have practical value. I'm pretty new to unit testing, so be gentle.

    Read the article

  • How to get "printer ready bytes" from a source in c#?

    - by luis_villase
    Hey everyone! I'm in a bit of trouble here, hoping you can help a fellow programmer out. I have an application that receives a pointer to raw bytes (plus length and stuff) and sends said raw data to a printer. This is important, I have no choice but to use this method to get any printing done. If I send a raw string, it will print with no problem. However, I need to be able to print formatted text, images, etc. So the thing is... I would like to be able to get printer ready bytes from a given source (maybe a pdf, or html, does not matter as long as it contains formatted text and/or images). It would be like "splitting" the print command like so: a) Open file and read data b) Load printer data into memory c) Send bytes to printer Obviously, I've got a) and c) covered, it's b) the one that's breaking my head. Any thoughts? Thanks in advance for your help.

    Read the article

  • Regex to split a string (in Java) so that spaces are preserved?

    - by david
    I need to split a string (in Java) into individual words ... but I need to preserve spaces. An example of the text I need to split is something like this: ABC . . . . DEF . . . . GHI I need to see "ABC", " . . . .", "DEF", ". . . .", and "GHI". Obviously splitting on the space character \s isn't going to work, as all the spaces get swallowed up as one space. Any suggestions? Thanks

    Read the article

  • Regex whitespace and special characters

    - by Sam R.
    I have this regular expression: [^\\s\"']+|\"([^\"]*)\"|'([^']*)' which works for splitting a string by white spaces, and anything within a quotation is not delimited. However, I notice that if I put in a string that starts with "" no matches are found. How would I correct this? For example, if I enter " test 2". I want it to match to [, test, 2] Note: using java to compile the regex, here is some code Pattern pattern = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher matcher = pattern.matcher(SomeString); while (matcher.find()){ String temp = matcher.group(); //... Do something ... } Thanks.

    Read the article

  • What things can I teach a group of children about programming in one day?

    - by Rich Bradshaw
    I'm running a day for 30 kids aged 11-18 about computer game programming. They have all opted to do it, but they have no experience at all of programming. My main aim is for them to learn a few things: programming is hard/challenging programming is something they can learn to do being a computer games programmer != playing games all day a little more insight into how games actually work I'd thought of splitting them into two groups, of younger/less experience and older/more experience, then doing slightly different things. I'd considered showing them Scratch, Game Maker, before showing them the basics of Python and getting them to write a simple text based game (perhaps something like, computer picks a random number, you have to guess it in as few guesses as possible, computer says higher/lower for each guess). Does anyone have any ideas of things to do/show them/ways to teach them?

    Read the article

  • Split a sting array into a number array in javascript

    - by Wesley Skeen
    I am reading a value from a dropdown list depending on what option is selected. I am using jqPlot to graph the values. jqPlot expects an array of values like [91, 6, 2, 57, 29, 40, 95] but when I read the value in from the dropdown box it is coming in as a whole string "[91, 6, 2, 57, 29, 40, 95]" I tried splitting it but I got ["91", "6", "2", "57", "29", "40", "95"] which wont display the graph correctly. Is there anybody that has encountered something like this before and what can I do to make my values convert into a number array. Thanks for any help

    Read the article

  • How to optimize this script

    - by marks34
    I have written the following script. It opens a file, reads each line from it splitting by new line character and deleting first character in line. If line exists it's being added to array. Next each element of array is splitted by whitespace, sorted alphabetically and joined again. Every line is printed because script is fired from console and writes everything to file using standard output. I'd like to optimize this code to be more pythonic. Any ideas ? import sys def main(): filename = sys.argv[1] file = open(filename) arr = [] for line in file: line = line[1:].replace("\n", "") if line: arr.append(line) for line in arr: lines = line.split(" ") lines.sort(key=str.lower) line = ''.join(lines) print line if __name__ == '__main__': main()

    Read the article

  • Iterate over the lines of a string

    - by Space_C0wb0y
    I have a multi-line string defined like this: foo = """ this is a multi-line string. """ I need an iterator that iterates over the individual lines of that string. I could of course do it like this: lineiterator = iter(foo.splitlines()) Is there a more direct way of doing this? In this scenario the string has to traversed once for the splitting, and then again by the parser. It doesn't matter in my test-case, since the string is very short there, I am just asking out of curiosity. Python has so many useful and efficient built-ins for such stuff, but I could find nothing that suits this need.

    Read the article

  • Wierd characters in exported csv files when converting

    - by Ahue
    Hey guys, I came across a problem I cannot solve on my own concerning the downloadable csv formatted trends data files from Google Insights for Search. I'm to lazy to reformat the files I4S gives me manually what means: Extracting the section with the actual trends data and reformatting the columns so that I can use it with a modelling program I do for school. So I wrote a tiny script the should do the work for me: Taking a file, do some magic and give me a new file in proper format. What it's supposed to do is reading the file contents, extracting the trends section, splitting it by newlines, splitting each line and then reorder the columns and maybe reformat them. When looking at a untouched I4S csv file it looks normal containing CR LF caracters at line breaks (maybe thats only because I'm using Windows). When just reading the contents and then writing them to a new file using the script wierd asian characters appear between CR and LF. I tried the script with a manually written similar looking file and even tried a csv file from Google Trends and it works fine. I use Python and the script (snippet) I used for the following example looks like this: # Read from an input file file = open(file,"r") contents = file.read() file.close() cfile = open("m.log","w+") cfile.write(contents) cfile.close() Has anybody an idea why those characters appear??? Thank you for you help! I'll give you and example: First few lines of I4S csv file: Web Search Interest: foobar Worldwide; 2004 - present Interest over time Week foobar 2004-01-04 - 2004-01-10 44 2004-01-11 - 2004-01-17 44 2004-01-18 - 2004-01-24 37 2004-01-25 - 2004-01-31 40 2004-02-01 - 2004-02-07 49 2004-02-08 - 2004-02-14 51 2004-02-15 - 2004-02-21 45 2004-02-22 - 2004-02-28 61 2004-02-29 - 2004-03-06 51 2004-03-07 - 2004-03-13 48 2004-03-14 - 2004-03-20 50 2004-03-21 - 2004-03-27 56 2004-03-28 - 2004-04-03 59 Output file when reading and writing contents: Web Search Interest: foobar ??????????? ? ? ? ????????? ????????? ???? ?????? Week foobar ?? ?? ?? ? ? ? ?? ??? ????? 2004-01-11 - 2004-01-17 44 ?? ?? ???? ? ? ?? ????????? 2004-01-25 - 2004-01-31 40 ?? ?? ?? ? ? ? ?? ?? ?????? 2004-02-08 - 2004-02-14 51 ?? ?? ???? ? ? ?? ????????? 2004-02-22 - 2004-02-28 61 ?? ?? ???? ? ? ?? ?? ?????? 2004-03-07 - 2004-03-13 48 ?? ?? ???? ? ? ?? ??? ?? ?? 2004-03-21 - 2004-03-27 56 ?? ?? ???? ? ? ?? ?? ?????? 2004-04-04 - 2004-04-10 69 ?? ?? ???? ? ? ?? ????????? 2004-04-18 - 2004-04-24 51 ?? ?? ???? ? ? ?? ?? ?????? 2004-05-02 - 2004-05-08 56 ?? ?? ?? ? ? ? ?? ????????? 2004-05-16 - 2004-05-22 54 ?? ?? ???? ? ? ?? ????????? 2004-05-30 - 2004-06-05 74 ?? ?? ?? ? ? ? ?? ????????? 2004-06-13 - 2004-06-19 50 ?? ?? ??? ? ? ?? ????????? 2004-06-27 - 2004-07-03 58 ?? ?? ?? ? ? ? ?? ??? ????? 2004-07-11 - 2004-07-17 59 ?? ?? ???? ? ? ?? ?????????

    Read the article

  • Twitter Answering System with Php

    - by 1342
    I'm working on a project which gives information to students, online and instantly on Twitter ( for my university, I'm also student in Computer Engineering - first year ) I'm fetching mentions which comes to this account - https://twitter.com/BahcesehirBilgi I'm trying to search these in order to filters which i created in my panel. http://imgim.com/2107incia8023554.jpg - This is panel screenshot ( filter add ) I'm splitting filter words and searching them in mydatabase coloumn which get information about users tweet ( using mysql like, %word1%%word2% etc ). http://imgim.com/3792incis3008867.jpg - Example of filter, and answers http://imgim.com/1424incit5317319.jpg - random dashboard screenshot Here is the question, how can i search this filters more accurately and more human friendly in my database ? Please dont forget this is my first project, and new in Php and working alone :)

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >