Rectangle 27 14

I started experiencing the exact same issue with Visual Studio 2010 while running a MVC3 project on local host with the Debugger. All of my pages suddenly started taking at least 10x to load. I found this question, and the six word answer. Problem solved. Thank you.

OMG!!.... I never thought a breakpoint could cause such harm....!!! I kept looking for a hole day... changing IPV6 to IPV4, disabling WCF services... omg... Simplicity always kills complexity...

Same issue with VS2012 / MVC4 / IIS Express (the message appearing started "'iisexpress.exe' (Managed (v4.0.30319)):"). I had just one breakpoint in Web.Release.Config and ended up with terrible slowdowns. I was running a Debug build, so it's pretty odd a release transformation file was affecting it!

Visual Studio 2010 WebServer Very Slow loading - Stack Overflow

visual-studio-2010 webserver
Rectangle 27 1

It sounds like you want to use MVC and other patterns because they are the new buzz words. Splitting your design among model view and controller should tell you how to spread the functionality of your application. Although I totally agree that using MVC is the correct approach, I suggest you research the pattern and look at some source code that implements it. As a start to your question though, the widgets that will be displayed will be your views, that much should be obvious. Input from the user, such as changing a parameter of some widget or requesting other information will come into your application and should be handled by a controller. A concrete example of this is a Java-based HttpServlet. The controller servlet receives the user request and asks the lower layers of your app (Service, Persistence, etc) for an updated representation of your model. The model includes all of your domain-specific objects (i.e the data from your databases, etc). This data (the updated model) comes back to the controller, which in turn pushes out a new view for the user. Hopefully that is enough to get you started about designing your app.

As further help, you could consider using a framework to assist in the development of your app. I like Spring a lot, and it has a first class MVC implementation that really helps guide you to designing a correct MVC web app.

model view controller - Getting started with software design using MVC...

model-view-controller design-patterns oop
Rectangle 27 1

As far as I know there is some mechanism to automate building msword 2007 docs from xml. Main idea is to build xslt transformation on your xml. As you know word document is just an archive(just change extension to .zip and you will see) of different xml's. But problem that it is not always in one xml file(I worked with excel generation - there is a lot xml files there).

Also here is great example how to make exactly what you want - http://www.codeproject.com/KB/office/Generating_Word_Reports.aspx but I was not able to apply this to msexcel documents..

Word 2010 for writing invoices, starting with XML - Stack Overflow

xml ms-word docx
Rectangle 27 1

As far as I know there is some mechanism to automate building msword 2007 docs from xml. Main idea is to build xslt transformation on your xml. As you know word document is just an archive(just change extension to .zip and you will see) of different xml's. But problem that it is not always in one xml file(I worked with excel generation - there is a lot xml files there).

Also here is great example how to make exactly what you want - http://www.codeproject.com/KB/office/Generating_Word_Reports.aspx but I was not able to apply this to msexcel documents..

Word 2010 for writing invoices, starting with XML - Stack Overflow

xml ms-word docx
Rectangle 27 12

I prefer Java. I'm going to explain TCP: The basic concept is that you have to run a "Server" on a machine. That server accepts clients waiting for a connection. Each connection goes over a port (you know, I hope...). Always use ports above 1024 because ports lower than 1025 are most of the time reserved for standard protocols (like HTTP (80), FTP (21), Telnet, ...)

However, creating a Server in Java is done this way:

ServerSocket server = new ServerSocket(8888); // 8888 is the port the server will listen on.

"Socket" is the word you are probably looking for if you want to do research. And to connect your client to a server you have to write this:

Socket connectionToTheServer = new Socket("localhost", 8888); // First param: server-address, Second: the port

But now, there isn't still a connection. The server has to accept the waiting client (as I noticed here above):

Socket connectionToTheClient = server.accept();

Done! Your connection is established! Communicating is just like File-IO. The only thing you have to keep in mind is that you have to decide when you want to flush the buffer and really send the data through the socket. Using a PrintStream for text-writing is very handy:

OutputStream out = yourSocketHere.getOutputStream();
PrintStream ps = new PrintStream(out, true); // Second param: auto-flush on write = true
ps.println("Hello, Other side of the connection!");
// Now, you don't have to flush it, because of the auto-flush flag we turned on.

A BufferedReader for text-reading is the good (best*) option:

InputStream in = yourSocketHere.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String line = br.readLine();
System.out.println(line); // Prints "Hello, Other side of the connection!", in this example (if this would be the other side of the connection.

Hopefully you can start with networking with this information! PS: Of course, all networking code have to be try-catched for IOExceptions.

EDIT: I forgot to write why it isn't always the best option. A BufferedReader uses a buffer and read as much as it can into the buffer. But sometimes you don't want that the BufferedReader steals the bytes after the newline and put them into his own buffer. Short example:

InputStream in = socket.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
// The other side says hello:
String text = br.readLine();
// For whatever reason, you want to read one single byte from the stream,
// That single byte, just after the newline:
byte b = (byte) in.read();

But the BufferedReader has already that byte, you want to read, in his buffer. So calling in.read() will return the byte following on the last byte in the buffer of the reader.

So, in this situation the best solution is to use DataInputStream and manage it your own way to know how long the string will be and read only that number of bytes and convert them into a string. Or: You use

This method doesn't use a buffer and reads byte by byte and checks for a newline. So this method doesn't steal the bytes from the underlying InputStream.

java - Getting started with client-server networking - Stack Overflow

java c++ c network-programming
Rectangle 27 14

yourString.substring(yourString.indexOf("no") + 3 , yourString.length());

You should probably add trim to the end or replace 2 with 3 to get solely the number... and add () after length.

also make the .length a function call: .length(), or it barfs

java - Getting a substring from a string after a particular word - Sta...

java string substring
Rectangle 27 13

yourString.substring(yourString.indexOf("no") + 3 , yourString.length());

You should probably add trim to the end or replace 2 with 3 to get solely the number... and add () after length.

also make the .length a function call: .length(), or it barfs

java - Getting a substring from a string after a particular word - Sta...

java string substring
Rectangle 27 3

Perhaps reCAPTCHA, as it starts to run lower on words that people get correctly, starts paring harder and harder 'unknkown' words as people filter out all the easy ones?

This is my assumption as well. I presume that most of the remaining words in their "unknown" category are ones that no one (or almost no one) has been able to identify.

Are reCAPTCHA CAPTCHAs getting harder or is just me - Stack Overflow

recaptcha
Rectangle 27 6

String example = "ABC Results for draw no 2888";
System.out.println(example.substring(example.lastIndexOf(" ") + 1));

java - Getting a substring from a string after a particular word - Sta...

java string substring
Rectangle 27 6

String example = "ABC Results for draw no 2888";
System.out.println(example.substring(example.lastIndexOf(" ") + 1));

java - Getting a substring from a string after a particular word - Sta...

java string substring
Rectangle 27 3

Well, i had added a downloable example made using Vb.NET 2010 that does exactly what you need, and it's available in another post in the same thread Chris referenced. That code will work for every font type, font size and will return all matches for the word/sentence you search for, returning each match as a rectangle with x/y locations to the UI, and finally hightlighting them all and saving to a new PDF, you just need to give some initial parameters like, search term, comparison type by culture, source PDF path and destination PDF Path. The only thing not implemented is that particular case when the search word/sentence falls into multiple lines, but it should be an easy change in code since you can use SameLine() method in TextChunk Class.

c# - search PDF text, highlight found words by drawing rectangle after...

c# pdf itextsharp
Rectangle 27 1

I guess I would start by writing some kind of jquery that would find all the cells with those words and swap the Css around to move/hide the text and add your images as a background image. Much like the image replacement techniques people use for getting fancy fonts in headers. If you can do that without changing the underlying markup, it shouldn't affect the sorting mechanism?

jquery - Drupal 6 : CCK : Views2 : What ways would you substitute an i...

jquery drupal drupal-views cck
Rectangle 27 1

You might start by getting post-update to echo some debugging output. Both standard output and standard error output are forwarded to git send-pack on the other end, so you can simply echo messages and you will see these on the client that you did git push. I assume you followed the guide to the word, made the post-update script executable, cloned the repo to the web folder etc.

git push - Using git to publish to a website - Stack Overflow

git git-push git-remote
Rectangle 27 14

We have been using WF 4.0 the last couple of months. I have to say it's challenging to think the Workflow way. However, I can tell you it's worth it. We knew very little when we started. We've bought a beginner and professional book for WF 4.0 that helped. I, myself, watched many videos online and followed PDC 2009 for their breaking news about WF 4.0 and how it's different from the previous somewhat sucky versions. One major thing that we had to propose a solution for is the way we can deal with In/Our Arguments in a workflow without bounding our custom activities to certain data types and how to pass parameters between activities. I have come up with a good solution for that, and the workflow experience that we have so far is not bad at all. Actually, we have a workflow-intensive application that is getting bigger and bigger and I really cannot imagine myself solving it in a different environment. I love the visual effect that it has: it keeps me away from the details of if/else etc constructs and makes the business rules apparent in a way that doesn't make you forced to dive into lines of code to know what's going on or how to fix some bug. By the way, the project that we worked on is very similar to what you described and it's a medium-sized project. You can tell from my words that I like it and I do recommend it although is incorporates some risks as it's a new technology and you have to come up with some innovative ideas.

I would be interested in hearing about your solution for handling the passing of parameters between activities. I have been toying with WF on and off and this is one area that looks a little arkward to me, but that could just be my lack of understanding.

I think it's a place where they need to work on more. In any case, we use a big "global hashtable" repository where we add variables typecasted. The naming convention for these variables incorporates both their type, name and their parent activity. This really helped us in our implementation. I realize there might be better ways to do this, but this works really well and you can utilize it in different ways when you design the workflow. For example, GerCustomer activity might have a handful of input args and 2 out args: GetCustomer.str_customerID and GetCustomer.int_premium. Hope this helps..

c# - To Workflow or Not to Workflow? - Stack Overflow

c# workflow c#-4.0 workflow-foundation-4
Rectangle 27 2

You always want to strive something that is easy to configure and modify. That is why I always recommend to choose Regex Pattern matching over other searches.

Example, consider this for your example:

import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Play {
  public static void main(String args[]) { 
    Pattern p = Pattern.compile("^(.*) Results for draw no (\\d+)$");
    Matcher m = p.matcher("ABC Results for draw no 2888");
    m.find();
    String groupName = m.group(1);
    String drawNumber = m.group(2);
    System.out.println("Group: "+groupName);
    System.out.println("Draw #: "+drawNumber);
  }
}

Now from the provided pattern, I can easily identify the useful parts. It helps me to identify problems, and I can identify additional parts in the pattern that is useful to me (I have added the group-name).

Another clear benefit is that I can store easily this pattern externally in a configuration file.

java - Getting a substring from a string after a particular word - Sta...

java string substring
Rectangle 27 2

You always want to strive something that is easy to configure and modify. That is why I always recommend to choose Regex Pattern matching over other searches.

Example, consider this for your example:

import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Play {
  public static void main(String args[]) { 
    Pattern p = Pattern.compile("^(.*) Results for draw no (\\d+)$");
    Matcher m = p.matcher("ABC Results for draw no 2888");
    m.find();
    String groupName = m.group(1);
    String drawNumber = m.group(2);
    System.out.println("Group: "+groupName);
    System.out.println("Draw #: "+drawNumber);
  }
}

Now from the provided pattern, I can easily identify the useful parts. It helps me to identify problems, and I can identify additional parts in the pattern that is useful to me (I have added the group-name).

Another clear benefit is that I can store easily this pattern externally in a configuration file.

java - Getting a substring from a string after a particular word - Sta...

java string substring
Rectangle 27 1

NSString *string = @"[Anything]/BlaBla";
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@".*[^ A-z0-9\(\)]+" options:0 error:nil];
NSTextCheckingResult *match = [regex firstMatchInString:string options:0 range:NSMakeRange(0, [string length])];
if(match.range.length > 0) {
    NSString *newString = [string substringFromIndex:match.range.length];
}

The regex will analyze your String until the last special character (except the space character, since you want to keep the space in the names of your folders).

I think this can do the trick.

No, It is not specific "/", it is coming with different chars/strings like that.

I'm working on a solution right now, will edit this post if I find anything.

It gives null when folder string is "inbox". And, for "[Gmail]/Sent Mail" it returns only "Mail"

objective c - Getting word from string in iOS - Stack Overflow

ios objective-c
Rectangle 27 1

As @Mr.Alien said, setting MaxLength property will safeguard the text box in having more than 1 character of text. Additionally, You should select the text in the text box while it is getting a focus. It will simplify the process if user starts from the first text box again.

DEMO It is a modified copy of @Mr.Alien demo

Implementing the above concept in a selected text box, [Concept: Set a class for the text boxes which you want to apply the need]

$("input").keyup(function() {

    var input_flds = $(this).nextAll(".test:first");
    input_flds.select().focus();

});

//where .test will be your class on the selected text boxes.

Hi RajaPrabhu - Many thanks for this! Yes it works beautifully. If you've ever in Malaysia, I'll treat you to a durian buffet. Hopefully you can eat the durian fruit ;-).

@RajaPrabhuOfficial Yes, I had kept that method for forms across, thank you for the refatoraction :)

How do I tick both answers as correct! Only One Green Tick allowed? :-(

@user1029442 No Problem, I have inherited a lot from the answer that you had accepted. Real credits should belongs to him. By the way, You can upvote my answer if it helped in solving your problems.

javascript - Type a word from the keyboard and store each letter into ...

javascript jquery html input
Rectangle 27 1

If the web service being invoked uses windows integrated security, creating a NetworkCredential from the current WindowsIdentity should be sufficient to allow the web service to use the current users windows login. However, if the web service uses a different security model, there isn't any way to extract a users password from the current identity...that in and of itself would be insecure, allowing you, the developer, to steal your users passwords. You will likely need to provide some way for your user to provide their password, and keep it in some secure cache if you don't want them to have to repeatedly provide it.

Edit: To get the credentials for the current identity, use the following:

Uri uri = new Uri("http://tempuri.org/");
ICredentials credentials = CredentialCache.DefaultCredentials;
NetworkCredential credential = credentials.GetCredential(uri, "Basic");

c# - Word add-in: Getting user credentials which were used to open the...

c# sharepoint sharepoint-2010 ms-word add-in
Rectangle 27 0

You can rewrite the whole sentence word-by-word keeping track of the height changes. Here is some explanation via code:

<div id="flop" class="foobar">Lorem ipsum dolor sit amet, consectetur adipisicing 
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim 
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea 
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit 
esse cillum dolore eu fugiat nulla pariatur.</div>
<br>
<button value="Go" onclick="foo();">Go</button>
function foo(){
    var d = document.getElementById('flop');
    var t = d.innerHTML;
    var w = t.split(' ');       

    d.innerHTML = w[0];
    var height = d.clientHeight;
    for(var i = 1; i < w.length; i++){
        d.innerHTML = d.innerHTML + ' ' + w[i];

        if(d.clientHeight > height){
            height = d.clientHeight;
            console.log(w[i-1]);
        }
    }
}

This will log the last words of each line to the console except the last line. I leave that to you. The nice thing about this solution is even after a window resize it works correctly. By the way, Yi Jiang deserves all the credit for his answer to this question here on SO.

wrap - Javascript - Getting the last word in a line - Stack Overflow

javascript wrap word-wrap