Daily Archives

Articles indexed Tuesday January 11 2011

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

  • Remove characters with regex in c#

    - by Rise_against
    Hello all, I am not a regex specialist, so I need some help with this. I have a text file, and I need to remove some trailing delimiters. The text file looks like this: MSH|^~\&|OAZIS||||20101029135359||ADT^A31|00000015|P|2.3.1||||||ASCII EVN|A31|20101029135359^^^^||||19900101 So I think the best way is to do a Regex replace? Can anyone help me with this regex? I want to remove all ^ that come before a | So test^A^^| has to become test^A| Thanks

    Read the article

  • Cocoa NSTextField Drag & Drop Requires Subclass... Really?

    - by ipmcc
    Until today, I've never had occasion to use anything other than an NSWindow itself as an NSDraggingDestination. When using a window as a one-size-fits-all drag destination, the NSWindow will pass those messages on to its delegate, allowing you to handle drops without subclassing NSWindow. The docs say: Although NSDraggingDestination is declared as an informal protocol, the NSWindow and NSView subclasses you create to adopt the protocol need only implement those methods that are pertinent. (The NSWindow and NSView classes provide private implementations for all of the methods.) Either a window object or its delegate may implement these methods; however, the delegate’s implementation takes precedence if there are implementations in both places. Today, I had a window with two NSTextFields on it, and I wanted them to have different drop behaviors, and I did not want to allow drops anywhere else in the window. The way I interpret the docs, it seems that I either have to subclass NSTextField, or make some giant spaghetti-conditional drop handlers on the window's delegate that hit-checks the draggingLocation against each view in order to select the different drop-area behaviors for each field. The centralized NSWindow-delegate-based drop handler approach seems like it would be onerous in any case where you had more than a small handful of drop destination views. Likewise, the subclassing approach seems onerous regardless of the case, because now the drop handling code lives in a view class, so once you accept the drop you've got to come up with some way to marshal the dropped data back to the model. The bindings docs warn you off of trying to drive bindings by setting the UI value programmatically. So now you're stuck working your way back around that too. So my question is: "Really!? Are those the only readily available options? Or am I missing something straightforward here?" Thanks.

    Read the article

  • ASP .net MVC Invoking default controller and action vs Setting a startup page

    - by SARAVAN
    Hi, I am developing code on the sample ASP .net MVC template provided by VS2010. The first time I ran the code without adding anything, the index.aspx page was invoked which is expected. But for some reasons I added a login.aspx and then accidentally set that as a startup page. Now when I ran the application the default startup url look like http://localhost/Views/login.aspx. I am thinking this is not a valid MVC routing path and I get the requested resource cannot be found error. I am not sure how to revert this back and make sure the default ../home/index is invoked. Can any one throw some light on this? Also should I not set the startup page as we do in asp .net webforms?

    Read the article

  • How To Compile YACC And LEX?

    - by nisha
    Actually I'm having YACC file as pos.yacc and LEX file name is pos1.lex.. while compilling I'm getting the folowing error... malathy@malathy:~$ cc lex.yy.c y.tab.c -ly -ll pos1.lex %{ #include "y.tab.h" int yylval; %} DIGIT [0-9]+ %% {DIGIT} {yylval=atoi(yytext);return DIGIT;} [\n ] {} . {return *yytext;} %% yacc file is pos.yacc %token DIGIT %% s:e {printf("%d\n",$1);} e:DIGIT {$$=$1;} |e e "+" {$$=$1+$2;} |e e "*" {$$=$1*$2;} |e e "-" {$$=$1-$2;} |e e "/" {$$=$1/$2;} ; %% main() { yyparse(); } yyerror() { printf("Error"); } so while compiling i m getting like malathy@malathy:~$ cc lex.yy.c y.tab.c -ly -ll pos.y: In function ‘yyerror’: pos.y:16: warning: incompatible implicit declaration of built-in function ‘printf’ pos.y: In function ‘yyparse’: pos.y:4: warning: incompatible implicit declaration of built-in function ‘printf’

    Read the article

  • Easy way to add custom prerequisite in clickonce publish (VS 2010)

    - by Maciej
    I would like to add Infragistics dlls as custom prerequisite when publishing my project. I've read about that: http://msdn.microsoft.com/en-us/library/aa730839%28VS.80%29.aspx But this seems to be a bit complicated... I wonder if exists a bit simple way to archive that (eg by passing URL to setup.exe or such) ? EDIT This Might be also interesting: http://www.codeproject.com/KB/aspnet/Add_Custom_Prerequisite.aspx?msg=2520811 will check and let you know...

    Read the article

  • ruby send vs __send__

    - by jaydel
    I understand the concept of some_instance.send but I'm trying to figure out why you can call this both ways? The Ruby Koans imply that there is some reason beyond providing lots of different ways to do the same thing and I'm wrestling with figuring this out. Here are the two examples of usage more concretely class Foo def bar? true end end foo = Foo.new foo.send(:bar?) foo.send(:bar?) Anyone have any idea about this? thanks in advance!

    Read the article

  • how do i keep the aspect ratio on image buttons in android?

    - by clayton33
    i have 5 square ImageButtons that i want to have lined up side by side on the bottom of the screen. I have each one set (different id's) as: <ImageButton android:id="@+id/box1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:adjustViewBounds="true" android:scaleType="fitXY" android:layout_weight="1" android:layout_margin="1dp" /> and i have the background assigned in main java like this: int[] imageIds = new int[] {R.id.box1,R.id.box2,R.id.box3,R.id.box4,R.id.box5}; for(int i = 0; i<5; i++){ imageButtons[i] = (ImageButton) findViewById(imageIds[i]); imageButtons[i].setBackgroundResource(R.drawable.blank); } what i would like to have it do is scale the width to fit neatly side-by-side at the bottom of the screen (which it does now ok), but have the height automatically scale to match the width as well. is this possible? i don't want to use setImageSource because then it puts a border around the imagebutton.

    Read the article

  • How to create a snowstorm on your Windows desktop?

    - by Vilx-
    Practical uses aside, how (if it is possible at all) could you create a "snowing" effect on your desktop PC running Windows? Preferably with nothing but raw C/C++ and WinAPI. The requirements for the snow are: Appears over everything else shown; Snowflakes are small, possibly simple dots or clusters of a few white pixels; Does not bother working with the computer (clicking a snowflake sends the click through to the underlying window); Plays nicely with users dragging windows; Multimonitor capable. Bonus points for any of the following features: Snow accumulates on the lower edge of the window or the taskbar (if it's at the bottom of the screen); Snow accumulates also on top-level windows. Or perhaps some snow accumulates, some continues down, accumulating on every window with a title bar; Snow accumulated on windows gets "shaken off" when windows are dragged; Snow accumulated on taskbar is aware of the extended "Start" button under Vista/7. Snowflakes have shadows/outlines, so they are visible on white backgrounds; Snowflakes have complex snowflike-alike shapes (they must still be tiny). Most of these effects are straightforward enough, except the part where snow is click-through and plays nicely with dragging of windows. In my early days I've made an implementation that draws on the HDC you get from GetDesktopWindow(), which was click-through, but had problems with users dragging windows (snowflakes rendered on them got "dragged along"). The solution may use Vista/7 Aero features, but, of course, a universal solution is preferred. Any ideas? :)

    Read the article

  • PHP GET issue - it aint workin!

    - by benhowdle89
    I have a simple PHP form which displays inputs with values from a mysql DB and send the form results to another page which updates a db table based on the GET results: echo "<form method='get' action='updateprojects.php'>"; echo "<table>"; echo "<tr>"; echo " <th>Project No</th> <th>Customer Name</th> <th>Description</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td><input value=" . $row['project_no'] . "></input></td>"; echo "<td><input value='" . $row['cust_name'] . "'></input></td>"; echo "<td><input value='" . $row['description'] . "'></input></td>"; echo "</tr>"; } echo "</table>"; echo "<input type='submit' value='Update' />"; echo "</form>"; on updateprojects.php i have set up the GET variable and even echoed them to check but nothing comes through! Cannot see why!? This is the start of updateprojects.php: echo $_GET['project_no'].$_GET['cust_name'].$_GET['description'];

    Read the article

  • how to get json string value?

    - by Net205
    var responseFromServer = "{\"flag\":true,\"message\":\"\",\"result\":{\"ServicePermission\":true,\"UserGroupPermission\":true}}"; var serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); var responseValue = serializer.DeserializeObject(responseFromServer); responseFromServer value is get a webservice, and then how to get the json string value, such as "flag","Servicepermission"??

    Read the article

  • Windows Macro + Hot Key - Paste Without Formatting

    - by JasonStoltz
    Not sure if this appropriate to put as a question or not? It's sort of a scripting question I think. Just down vote me if not :p Basically, what I'm looking for is a way to push a windows hotkey and have whatever text is in the clipboard be stripped of formatting. An example of what the macro could do: I push (whatever hotkey combo here) open notepad.exe Paste to notepad from clipboard Select all text in notepad Copy/Cut all text from notepad Close notepad I'm just wondering if someone has done something like this before, or knows how it could be accomplished. I think this could be a huge time-saver for almost anyone. I find myself doing this all the time when cutting and pasting between different office applications, etc.

    Read the article

  • When is BIG, big enough for a database?

    - by David ???
    I'm developing a Java application that has performance at its core. I have a list of some 40,000 "final" objects, i.e., I have an initialization input data of 40,000 vectors. This data is unchanged throughout the program's run. I am always preforming lookups against a single ID property to retrieve the proper vectors. Currently I am using a HashMap over a sub-sample of a 1,000 vectors, but I'm not sure it will scale to production. When is BIG, actually big enough for a use of DB? One more thing, an SQLite DB is a viable option as no concurrency is involved, so I guess the "threshold" for db use, is perhaps lower.

    Read the article

  • Place GWT application on Jetty

    - by Noor
    Can someone help me to place my GWT application on Jetty. I am not using maven. I have libraries in my build path. First I am taking the war folder already exploded and copy it in jetty/webapps, then in folder context. I have placed a folde named BiddingSystem in folder web apps, it is an already exploded folder and not a .war file In folder jetty/context, there is a file test.xml I am renaming the file to BiddingSystem.xml and also editing content of BiddingSystem.xml, finally the content of BiddingSystem.xml is <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <configure class="org.mortbay.jetty.webapp.WebAppContext"> <set name="contextPath">/BiddingSystem</set> <set name="war"><systemproperty name="jetty.home" default="."/>/webapps/BiddingSystem</set> </configure> I am getting this error:

    Read the article

  • Win 2008 R2 terminal server and redirected printer queue security

    - by Ian
    I have a case where I need a non-priv account to be able to make a modification to the redirected printer. I know, its not advisable but we're not giving them access - changes will be made in code. So, following the docs (http://technet.microsoft.com/en-us/library/ee524015(WS.10).aspx) I modified the default security for new printer queues. This doesnt work though as windows doesn't seem to assign the privs you configure in the printer admin tool to redirected printer queues. As I test I added a non-priv test user to the default security tab in the printer admin tool (control panel - admin tools - printer admin. I assigned it all privs (its a test) and logged the user into the terminal server. The redirected printers duely appeared as usual. However if I open the printer properties - security tab, the user appears in the list of accounts/groups but the options I selected (all privs) are not set. Instead the user special privs box is marked and when I click on 'advanced options' and view them, there is nothing marked. So, something is clearing these options.... the question is, why and how can I convince it not to? Ian

    Read the article

  • Different color prompts for different machines when using terminal/ssh?

    - by bcrawl
    Hi, I have 5 machines I constantly ssh into to do work. Its getting increasingly frustrating when I am issuing wrong commands on wrong boxes. Luckily I havent done anything bad yet. I wanted to know if there is any hack which I can hardcode which will display my prompt in different colors based on the machine I am ssh into? Such as blue for desktop1, purple for laptop, red for server etc? Is this possible? Currently I am using this command export PS1="\e[0;31m[\u@\h \W]\$ \e[m " taken from here http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/ but it obviously doesnt work across ssh. Also, if you have any other cool bash tips for helping me ease my sight will be wonderful. I got this tip which colors the man pages. http://linuxtidbits.wordpress.com/2009/03/23/less-colors-for-man-pages/

    Read the article

  • Outbound ports to allow through firewall - core requirements

    - by dunxd
    This question was asked before, but in a rather general way. I'm asking more specifically based on my current requirements. We have a number of remote offices made up of a bunch of PCs and an ASA 5505 which is used as firewall and VPN termination point. In the offices we share the internet connection with one or more other organisations over whom we have very little control, asides from the config on the ASAs. For a bunch of reasons I'd like to lock down these ASA 5505s to only allow outbound traffic to ports used by applications we know we need. I'm putting a standard config to roll out to all the ASAs, and if we need to open up ports for the other orgs we can do it on request. But I want to leave open the most commonly required ports so we can get up and running without waiting on other folks technical staff to get back. I plan to allow the following TCP ports to support email and web access, which I know everyone will need: POP3 (110 and 995) HTTP (80 and 443) IMAP4 (143 and 993) SMTP (25 and and 465) The question really is, what other ports do I need to leave open to allow for "normal" working? I've seen UDP port 53 for DNS as one. Are there any others that would be worth opening up? Just to note - I'll also be setting up monitoring systems to keep an eye on the ports we do allow. Any of the above could be misused of course. We'll also back all this up with signed agreements. But I'm aiming for a technical solutions where I don't have to start out with the full requirements of everyone we share connections with. See also: outbound ports that are always open

    Read the article

  • mdadm lvm and ext4 slowness - How can I speed it up?

    - by beatbreaker
    I can't figure out why I'm getting such terrible times out of my mdadm and in particular the lvm partitions in it. I made the raid: mdadm --create --verbose /dev/md0 --level=5 --chunk=1024 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 # cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] md0 : active raid5 sda1[0] sdd1[3] sdc1[2] sdb1[1] 2930279424 blocks level 5, 1024k chunk, algorithm 2 [4/4] [UUUU] I then created the physical volume, volume group, and logical volumes, I then formatted the logical volumes to ext4 using the following commands I got from here: http://busybox.net/~aldot/mkfs_stride.html mkfs.ext3 -b 4096 -E stride=256,stripe-width=768 /dev/datavg/blah Now I'm confused, I had these lvs running real quick before in mdadm but now that I've 'optimized' everything it's slower, eg, before: /dev/datavg/lv_audio: Timing buffered disk reads: 598 MB in 3.01 seconds = 198.85 MB/sec but now after: /dev/datavg/audio: Timing buffered disk reads: 198 MB in 3.00 seconds = 65.96 MB/sec That's pitiful! What's happened here? Did I not follow the instructions correctly? Can i reshape the ext4 partitons to default back to what they were? (I used defaults before and they were fine!)

    Read the article

  • SSL configuration issue. SSL/IIS7 not loading all scripts/CSS on user's first visit

    - by Chris
    Hi all, Hopefully this isnt a tricky one. I've got a web app that doesn't load all javascript/css/images on the first visit. Second visit is fine. After approximately 2 minutes of inactivity the problem reoccurs. These problems only started occuring after the customer requested SSL be applied to the application. Ajax requests stop working after 2 minutes of activity despite a successful page load of all javascript elements. Application timeout is 30 minutes - like I said, everything was fine before SSL was applied. All javascript and CSS files use absolute URLS - e.g https://blablabla There appears to be no pattern as to why certain files arent loaded. The firebug Net output shows the status for the failed elements as 'Aborted'. For example, site.css and nav.css are in the same folder, are declared after each other in the head tag yet one is loaded and the other is not. Both will load fine after refreshing the page (unless roughly two minutes have passed). An Ajax request also shows as aborted after two minutes. However, if i do the request again the Ajax request will succeed. Almost as if the first request woke something up. None of these problems occur in Chrome Any ideas? FYI this is a .Net 4 C# MVC app running under IIS7 but I'm not sure its relevant since it works in Chrome. Everything worked fine before SSL was applied. Originally posted on stackoverflow but recommended to list here. Can provide additional details if necessary.

    Read the article

  • Are there any benefits to using a Distributed vSwitch for iSCSI?

    - by dunxd
    I am designing our vSphere farm - we'll be migrating from ESX 3.5 to 4.1. I plan to set up a new farm using ESXi 4.1, and move the Virtual Machines on the 3.5 farm into it by shutdown, then import. In ESX 3.5 there is no distributed networking, so each host has a vSwitch connected to my SAN NICs, and a port group for the vmkernel. In vSphere (ESXi 4.1) I have the extra option to set up a distributed vSwitch and distributed port groups for vmkernel to access iSCSI storage. Is there any benefit to this, or should I stick to non-distributed networking for iSCSI.

    Read the article

  • Get sudoers information for all users on a server

    - by Jon Kruger
    I want to collect information on what sudoers actions a user can perform on a server. From what I've read, you can do this with the command sudo -l -U username. However, one server that I have has a slightly older version of sudo (1.6.7p5) and the -U option doesn't seem to exist (I don't own the server so I can't just upgrade to a newer version of sudo). Has anyone ever had to collect sudoers information for all users on a server? How would you recommend doing it?

    Read the article

  • WINDOWS 7 SOFTWARE PROBLEM

    - by PHILIP KIRK
    I am running Windows 7 and have adjusted something which has caused all of my shortcuts and program icons to show the same program namely Adobe Reader and when I click on any of the icon or shortcuts they only open Adobe reader, I have reinstalled Windows 7 But this has made no change, I posted this question yesterday but apparently with not enough information I hope this is better and someone can help.

    Read the article

  • How do I see a history of what I've POST-ed in Google Chrome?

    - by Tomas Lycken
    I just submitted a form that included a text box, in which I had written a quite long text. In another textbox, I filled in a date in the wrong format - and instead of getting an error message, the web site just acted as if my form submission was valid, except nothing was saved. Is there any way to see the history of what has been POST-ed (in the current session, at least), from where I can recover my lost text?

    Read the article

  • Record keyboard/mouse macros for games

    - by Dan
    I want to record a keyboard/mouse macro for automatically playing repetitive flash games. The programs I'm familiar with xnee/gnee/pnee and xmacro don't work under Ubuntu 10.04. (Xnee gives "Xnee failed due to bad data received from RECORD extension" for version 3.02, which is a known issue which I haven't found a solution for, and xmacro just plain doesn't work...) Are there any other methods I could use besides these two programs? Thanks

    Read the article

  • Open a remote folder in windows mobile

    - by Luis
    I have a device with windows mobile 6.1 and I want to open a shared folder on my laptop with the file browser... Both are connected to the same wireless network, both have access to internet but I can't have access between them... I have used open path in the file explorer and nothing... I shut down the firewall on mi laptop but still I can't access.. I don't know anything about permissions if that is the problema because I'm a novice... if anyone can helpme I'll appreciate it a lot...Thanks...

    Read the article

  • How to make Chrome open bookmarks and URLs in new tabs?

    - by MBraedley
    I principally use Firefox both at home and at work, but on occasion I use Chrome. I have Firefox working the way I like it by having it open bookmarks in a new tab when left clicked, as well, URLs open in new tabs. Although having URLs open in a new tab can be annoying if I type a bad URL, I still prefer it, but that's neither here nor there. I would like to replicate this behaviour in Chrome, and can't seem to find anything relavent in the settings. Is there any way of doing this without an extension? If not, can you point me towards an appropriate extension (I've already done a search and can't find what I'm looking for)?

    Read the article

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