Search Results

Search found 5842 results on 234 pages for 'break'.

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

  • Why Hebrew letters in the address bar break the ARR gateway (Only With Explorer 8,9,10)?

    - by Noamway
    The ARR is working great in all browsers except Internet Explorer 8,9,10. When I paste Hebrew URL directly to the address bar it's working good, but when I surf (click on a simple href URL) from one Hebrew URL page to another Hebrew URL the ARR return me that error: "502 - Web server received an invalid response while acting as a gateway or proxy server." There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server. I checked it number of times including with HTTP analyzer and I saw that the "referer" is making all the problems and cause to that error. For example when I enter to that page: mydomain.com/somehebrewchars (mydomain.com/???? you will need Hebrew install) And click in the page on a link to: mydomain.com/somehebrewchars2 (mydomain.com/???????? you will need Hebrew install) I will get the error above and when you look at the referrer you will see something like that: mydomain.com/עמוד-× ×—×™×ª×” We use other proxies application to others projects and we don't have the same issue like that. For this example we used WIN 2008 and 2012 with ARR 2.5 and also 3 beta. Any help is welcome :-) Thanks, Noam

    Read the article

  • Why does using nginx as a reverse proxy break local links?

    - by tsvallender
    I've just set up nginx as a reverse proxy, so some sites served from the box are served directly by it and others are forwarded to a Node.js server. The site being served by Node.js, however, is displayed with no CSS or images, so I assume the links are somehow being broken, but don't know why. The following is the only file in /etc/nginx/sites-enabled: server { listen 80; ## listen for ipv4 listen [::]:80 default ipv6only=on; ## listen for ipv6 server_name dev.my.site; access_log /var/log/nginx/localhost.access.log; location / { root /var/www; index index.html index.htm; } location /myNodeSite { proxy_pass http://127.0.0.1:8080/; proxy_redirect off; proxy_set_header Host $host; } } I had thought perhaps it was trying to find them in /var/www due to the first entry, but removing that doesn't seem to help.

    Read the article

  • Why does this package (ppa:ondrej/php5, it's PHP 5.5) break the apache2 installation?

    - by Panique
    Problem Currently this package (ppa:ondrej/php5) is quite popular for installing the latest version of PHP 5.5. I've worked quite much with it, and everything ran smoothy, on several (dev) servers. But from today (?) this breaks the apache2 installation (it empties the /etc/apache2/sites-available/default file). This is reproduceable. Way to reproduce (on naked Ubuntu 64 12.04 LTS) // basic installs sudo apt-get update sudo apt-get install apache2 sudo apt-get install php5 Apache is fine, nano /etc/apache2/sites-available/default has valid content now // getting PHP 5.5.x sudo apt-get install python-software-properties (for add-apt-repository) sudo add-apt-repository ppa:ondrej/php5 sudo apt-get update sudo apt-get install php5 // php -v shows successful install of PHP 5.5.x now Apache is broken, nano /etc/apache2/sites-available/default is empty now Question Why does this happen ? According to https://launchpad.net/~ondrej/+archive/php5 there were no changes in the last few days.

    Read the article

  • Did a recent WinXP update break CD/DVD read speeds? SP2/SP3

    - by quack quixote
    I have two systems with fresh installations of Windows XP Pro SP3 (SP3 slipstreamed into the installer; fully updated after install). One's a refurbished 2.4GHz Pentium4 system; the other is a new 1.6GHz Atom330 build. Both have brand-new dual-layer CD/DVD burners (one's a LiteOn IDE, the other an LG SATA). Both take a really looooong time to read a single-layer DVD in Windows with Cygwin tools. Specifically, 40 minutes or more. I burn backup data to single-layer DVD+/-R and use MD5 hashes for data verification (made with the standard md5sum tool in Unix or Cygwin). The hashes are burned to disc with the data files, and I use this command to verify: $ cd /path/to/disc/mountpoint ; time md5sum -c < md5.txt Here's how long that takes to run on a full single-layer DVD+/-R disc: Old system (WinXP SP2, 1.8GHz Athlon 2500+, last summer): ~10 minutes Old system (Ubuntu 9.04, 1.8GHz Athlon 2500+): ~10 minutes Old system (Debian 5, dual 550MHz P3): ~10 minutes New Pentium4 system (running Ubuntu 9.04): ~5 minutes New Pentium4 system (running WinXP SP3, file copy from Win Explorer): ~6 minutes New Atom330 system (running WinXP SP3, file copy from Win Explorer): ~6 minutes Now the weird stuff: Old system (WinXP SP2, 1.8GHz Athlon 2500+, today): ~25 minutes New Pentium4 system (running WinXP SP3, read from Cygwin): ~40-50 minutes (?!!) New Atom330 system (running WinXP SP3, read from Cygwin): ~40 minutes (can do it in ~30 minutes ...if i have another program spin up the drive first) Since both systems will copy files in 6 minutes using Windows Explorer, I know it's not a hardware problem. Windows just never spins up the drive during the Cygwin read, so it stays super-slow the whole time. Other programs like EAC and DVD Decrypter seem to spin up the disc just fine during their processing. DMA is enabled on both systems. (Can confirm in Windows' Device Manager on the Atom330, not on the P4.) Nero's DriveSpeed tool doesn't seem to have any effect. Copy times are comparable from commandline with Windows' xcopy. Copying with Cygwin's cp looks more like the problem state -- it will spin up the drive for a short time, never reaches full speed, and lets it spin back down again for most of the copy. What I need is to get full read speeds from Cygwin. Is this a known issue with SP3 or some other recent Windows update? Any other ideas? Update: More testing; Windows will spin up the drive when data is copied with Windows tools, but not when read in place or copied with Cygwin tools. It doesn't make sense to me that Windows spins up the drive for copying, but not for other reads. Might be more of a Cygwin problem? Update 2: GUI activity is sluggish during the problem state -- during the Cygwin verifies, there's a slight but noticable delay when dragging windows or icons around on the desktop, switching windows, Alt-Tabbing through open applications, opening new windows, etc. It reminds me of the delay when opening a Windows Explorer window on My Computer just after inserting a DVD. I've tried updating Cygwin (from 1.5.x to 1.7.x), but no change in the problem behavior. I've also noticed this issue occurs on WinXP SP2, but it's not exactly the same -- some spin-up occurs, so the read happens in ~25-30 minutes instead of 40+. The SP2 system used to run the verifies in ~10 minutes, and when it first changed (not sure exactly when, maybe in late November or early December 2009) I thought it was dying hardware. This is why I suspect an official update of breaking this functionality; this has worked for years on that SP2 box.

    Read the article

  • Why does my DNS change (and break) at regular intervals?

    - by Peter Kelly
    I have a laptop running Windows 7. Up until recently, everything was fine. We have multiple devices in my house connecting to the one access point with no problems. No issues with ISP. Now my Windows 7 PC DNS settings change every minute or so. Before the problem occurs if I do an ipconfig /all I have two DNS settings (primary/secondary) and everything is fine. After a short period of time this change to a sole DNS, 10.0.0.1. Webpages no longer resolve. If I do an ipconfig /renew, this fixes the problem. I have tried uninstalling various programs I thought might be related but the problem persists. Any ideas of potential causes?

    Read the article

  • How can I delete, break, or otherwise convert cross references to simple text in microsoft word 2013

    - by Mr Purple
    Cross referencing figure and table captions is useful while editing a document but can become confude when copying and pasting between large documents. I need to pass my document to a colleague who will collate my document with others and has requested that I remove or delete any cross referencing so that my "correct" cross references do not interfere or get interfered with by any other cross references that may be in my colleagues master collated document. My document will be cut and pasted into the master and no further complicated instructions after that point will be tolerated by my colleague. Is there a simple way to convert my cross references to simple text? I am using microsoft word 2013.

    Read the article

  • checksecurity / setuid changes, is this a bug or did somebody break in?

    - by Fabian Zeindl
    I received a mail by checksecurity from my ubuntu 12.04 server with the following content: --- setuid.today 2012-06-03 06:48:09.892436281 +0200 +++ /var/log/setuid/setuid.new.tmp 2012-06-17 06:47:51.376597730 +0200 @@ -30,2 +30,2 @@ - 131904 4755 2 root root 71280 Wed May 16 07:23:08.0000000000 2012 ./usr/bin/sudo - 131904 4755 2 root root 71280 Wed May 16 07:23:08.0000000000 2012 ./usr/bin/sudoedit + 143967 4755 2 root root 71288 Fri Jun 1 05:53:44.0000000000 2012 ./usr/bin/sudo + 143967 4755 2 root root 71288 Fri Jun 1 05:53:44.0000000000 2012 ./usr/bin/sudoedit @@ -42 +42 @@ - 130507 666 1 root root 0 Sat Jun 2 18:04:57.0752979385 2012 ./var/spool/postfix/dev/urandom + 130507 666 1 root root 0 Mon Jun 11 08:47:16.0919802556 2012 ./var/spool/postfix/dev/urandom First i was worried, then i realized that the change was actually 2 weeks ago, i think there was a sudo-update back then. Since checksecurity runs in /etc/cron.daily i wondered why i only get that email now. I looked into /var/log/setuid/ and found the following files: total 32 -rw-r----- 1 root adm 816 Jun 17 06:47 setuid.changes -rw-r----- 1 root adm 228 Jun 3 06:48 setuid.changes.1.gz -rw-r----- 1 root adm 328 May 27 06:47 setuid.changes.2.gz -rw-r----- 1 root root 1248 May 20 06:47 setuid.changes.3.gz -rw-r----- 1 root adm 4473 Jun 17 06:47 setuid.today -rw-r----- 1 root adm 4473 Jun 3 06:48 setuid.yesterday The obvious thing that confuses me is that the file setuid.yesterday is not from yesterday = Jun/16. Is this a bug?

    Read the article

  • Other then DDNS, can a fake primary DNS server break anything else?

    - by Nimmy Lebby
    I am aware that the primary server listed in SOA record has to be valid for DDNS to work. Is anyone aware of any other application that uses the SOA listed primary DNS server in one way or the other? By a fake primary server I mean either: Inaccessible by anything else other than secondary servers (this is called hidden primary correct? unsure). A completely fake domain name like dig +short soa spamhaus.org

    Read the article

  • Create image (EBS AMI) takes forever - possibly caused MySQL Server to break?

    - by fuzzybee
    I'm trying to create an EBS AMI from my running EC2 instance to reuse my LAMP fully configured (for my needs). I got my website up and running yesterday on this EC2 instance my MySQL was working fine until this morning (it's not that difficult to install LAMP thanks to yum so I can't see how I could go wrong with this; having said that, it's always difficult for one to realise his own errors) I have seen "Loading, please wait ..." for a few hours now. How do I know whether this is completed or its progress? Shortly after I tried to create the AMI image from my EC2 instance, I encountered database connection error can't connect to local mysql server through socket '/var/lib/mysql/mysql.sock' I was able to restart mysqld at first. But database connection was down again. This time, I could not restart mysqld anymore. It shows MySQL Daemon failed to start. Could my attempt to create the AMI by any chance cause the MySQL server to reboot or corrupt? I did a lot of searched and have done the following although I think I shouldn't have to do any workaround for MySQL server to work here chown -R mysql.mysql /var/lib/mysql/ I also found this workaround but I'm very reluctant to follow due to my belief and the fact I would need to understand this problem first. Any help would be greatly appreciated. Getting back to searching for a solution for the MySQL server problem ... Thanks, Eric

    Read the article

  • does leaving the laptop cord in break the cord?

    - by firedrake
    i recently got a new cord for my laptop because the cord i had before broke.im not sure how it got messed up, but one moment it charged my laptop and the next moment it didn't. i then got a new cord. the new cord worked perfectly fine until now, and it has only been a month. the cord wont work unless i am pressing it into the socket, which i am currently doing. the only thing i can find in common with the cords is that i leave them plugged in 24/7. my brother says that is the problem, but i do not think it is.any tips or hints? im going to use duct tape to keep the pressure on the cord till i can find a better solution(im also thinking it could be the hole i plug it into on the back of my computer, but im focusing on the other idea for now.if i wiggle the plug part in the socket of my computer it will stop charging unless im pressing it in or to the side) any help or ideas are appreciated. not sure if this will help but i use a gateway with windows vista. thanks

    Read the article

  • Will resetting the computer account in AD(2003) break the shares?

    - by Thoreau
    Had a power outage last night, still cleaning up from that. I have a file server that doesn't know it's part of the domain (getting the error: windows cannot connect to the domain either because the domain controller is down). I read that "resetting" the machine account the bring it back into the domain will do the trick. Since this is the file server for the entire office, I would like to be sure that I won't bork the umpteen number of shares on this server. Thanks!

    Read the article

  • SQL queries break our game! (Back-end server is at capacity)

    - by TimH
    We have a Facebook game that stores all persistent data in a MySQL database that is running on a large Amazon RDS instance. One of our tables is 2GB in size. If I run any queries on that table that take more than a couple of seconds, any SQL actions performed by our game will fail with the error: HTTP/1.1 503 Service Unavailable: Back-end server is at capacity This obviously brings down our game! I've monitored CPU usage on the RDS instance during these periods, and though it does spike, it doesn't go much over 50%. Previously we were on a smaller instance size and it did hit 100%, so I'd hoped just throwing more CPU capacity at the problem would solve it. I now think it's an issue with the number of open connections. However, I've only been working with SQL for 8 months or so, so I'm no expert on MySQL configuration. Is there perhaps some configuration setting I can change to prevent these queries from overloading the server, or should I just not be running them whilst our game is up? I'm using MySQL Workbench to run the queries. Here's an example.... SELECT * FROM BlueBoxEngineDB.Transfer WHERE Amount = 1000 AND FromUserId = 4 AND Status='Complete'; As you can see, it's not overly complex. There are only 5 columns in the table. Any help would be very much appreciated - Thanks!

    Read the article

  • problems with infinite loop

    - by Tom
    function addAds($n) { for ($i=0;$i<=$n;$i++) { while($row=mysql_fetch_array(mysql_query("SELECT * FROM users"))) { $aut[]=$row['name']; } $author=$aut[rand(0,mysql_num_rows(mysql_query("SELECT * FROM users")))]; $name="pavadinimas".rand(0,3600); $rnd=rand(0,1); if($rnd==0) { $type="siulo"; } else { $type="iesko"; } $text="tekstas".md5("tekstas".rand(0,8000)); $time=time()-rand(3600,86400); $catid=rand(1,9); switch ($catid) { case 1: $subid=rand(1,8); break; case 2: $subid=rand(9,16); break; case 3: $subid=rand(17,24); break; case 4: $subid=rand(25,32); break; case 5: $subid=rand(33,41); break; case 6: $subid=rand(42,49); break; case 7: $subid=rand(50,56); break; case 8: $subid=rand(57,64); break; case 9: $subid=rand(65,70); break; } mysql_query("INSERT INTO advert(author,name,type,text,time,catid,subid) VALUES('$author','$name','$type','$text','$time','$catid','$subid')") or die(mysql_error()); } echo "$n adverts successfully added."; } The problem with this function, is that it never loads. As I noticed, my while loop causes it. If i comment it, everything is ok. It has to get random user from my db and set it to variable $author.

    Read the article

  • Getting bizarre "expected primary-expression" error.

    - by Fecal Brunch
    Hi, I'm getting a really strange error when making a method call: /* input.cpp */ #include <ncurses/ncurses.h> #include "input.h" #include "command.h" Input::Input () { raw (); noecho (); } Command Input::next () { char input = getch (); Command nextCommand; switch (input) { case 'h': nextCommand.setAction (ACTION_MOVELEFT); break; case 'j': nextCommand.setAction (ACTION_MOVEDOWN); break; case 'k': nextCommand.setAction (ACTION_MOVEUP); break; case 'l': nextCommand.setAction (ACTION_MOVERIGHT); break; case 'y': nextCommand.setAction (ACTION_MOVEUPLEFT); break; case 'u': nextCommand.setAction (ACTION_MOVEUPRIGHT); break; case 'n': nextCommand.setAction (ACTION_MOVEDOWNLEFT); break; case 'm': nextCommand.setAction (ACTION_MOVEDOWNRIGHT); break; case '.': nextCommand.setAction (ACTION_WAIT); break; } return nextCommand; } and the error: Administrator@RHYS ~/code/rogue2 $ make g++ -c -Wall -pedantic -g3 -O0 input.cpp input.cpp: In member function `Command Input::next()': input.cpp:21: error: expected primary-expression before '=' token input.cpp:24: error: expected primary-expression before '=' token input.cpp:27: error: expected primary-expression before '=' token input.cpp:30: error: expected primary-expression before '=' token input.cpp:33: error: expected primary-expression before '=' token input.cpp:36: error: expected primary-expression before '=' token input.cpp:39: error: expected primary-expression before '=' token input.cpp:42: error: expected primary-expression before '=' token input.cpp:45: error: expected primary-expression before '=' token make: *** [input.o] Error 1 Sorry about the lack of linenumbers, the errors occur on the lines "nextCommand.setAction(...)", which is totally bizarre considering that they don't contain a '='. Any ideas? Thanks, Rhys

    Read the article

  • Scanner error that I can't figure out: NoSuchElementException

    - by iaacp
    It's crashing on the third line inside the do-while loop, and doesn't wait for my input: input = kb.nextInt(); Stack trace: Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at main.MainDriver.main(MainDriver.java:50) Relevant code: do { displayFullMenu(); System.out.print("Selection: "); input = kb.nextInt(); switch (input) { //Create new survey case 1: currentSurvey = new Survey(); break; //Display current survey case 2: currentSurvey.display(); break; //Save current survey case 3: saveSurvey(currentSurvey); break; //Load a survey case 4: currentSurvey = loadSurvey(); break; //Modify a survey case 5: currentSurvey.modify(); break; /*******************Test Functions*******************/ //Create new test case 6: currentSurvey = new Test(); break; //Display current test case 7: currentSurvey.display(); break; //Save current test case 8: saveSurvey(currentSurvey); break; //Load a test case 9: currentSurvey = loadTest(); break; //Modify a test case 10: currentSurvey.modify(); default: System.out.println("Invalid choice. Please make a valid choice: "); input = kb.nextInt(); System.out.println(); } } while (input != 99); kb.close(); It crashes after I choose option 9. It saves the file correctly, then goes back to the top of the loop, and crashes at the previously mentioned line. I want it to ask for more input. What gives?

    Read the article

  • Multiple case or switch commands in php?

    - by kitenski
    Good Afternoon, I am trying to assign some variables to a listing which has a main category and a subcategory. This works fine for most of the variables, however in each sub category there are some fields which are other. ie Main Category 1 has sub category database, development and other Main Category 2 has sub category email, internet and other Main Category 3 has sub category graphics and other. So my first case statement is as follows which works fine. switch ($main_cat) { case "Main Category 1": $main="79"; break; case "Main Category 2": $main="83"; break; case "Main Category 3": $main="87"; break; } However I am struggling as to how to handle other. This stops the whole page loading with no error message switch ($second_cat) { case "Database": $second="145"; break; case "Development": $second="146"; break; case "Other": if ($main_cat) == 'Main Category 1' { $second="147";} break; } This doesn't work at all, second is not changed. switch ($second_cat) { case "Database": $second="145"; break; case "Development": $second="146"; break; case "Other": switch ($main_cat) { case "Main Category 1": $second="147"; break; } }

    Read the article

  • ASP.NET List Control

    - by Ricardo Peres
    Today I developed a simple control for generating lists in ASP.NET, something that the base class library does not contain; it allows for nested lists where the list item types and images can be configured on a list by list basis. Since it was a great fun to develop, I'd like to share it here. Here is the code: [ParseChildren(true)] [PersistChildren(false)] public class List: WebControl { public List(): base("ul") { this.Items = new List(); this.ListStyleType = ListStyleType.Auto; this.ListStyleImageUrl = String.Empty; this.CommonCssClass = String.Empty; this.ContainerCssClass = String.Empty; } [DefaultValue(ListStyleType.Auto)] public ListStyleType ListStyleType { get; set; } [DefaultValue("")] [UrlProperty("*.png;*.gif;*.jpg")] public String ListStyleImageUrl { get; set; } [DefaultValue("")] [CssClassProperty] public String CommonCssClass { get; set; } [DefaultValue("")] [CssClassProperty] public String ContainerCssClass { get; set; } [Browsable(false)] [PersistenceModeAttribute(PersistenceMode.InnerProperty)] public List Items { private set; get; } protected override void Render(HtmlTextWriter writer) { String cssClass = String.Join(" ", new String [] { this.CssClass, this.ContainerCssClass }); if (cssClass.Trim().Length != 0) { this.CssClass = cssClass; } if (String.IsNullOrEmpty(this.ListStyleImageUrl) == false) { this.Style[ HtmlTextWriterStyle.ListStyleImage ] = String.Format("url('{0}')", this.ResolveClientUrl(this.ListStyleImageUrl)); } if (this.ListStyleType != ListStyleType.Auto) { switch (this.ListStyleType) { case ListStyleType.Circle: case ListStyleType.Decimal: case ListStyleType.Disc: case ListStyleType.None: case ListStyleType.Square: this.Style [ HtmlTextWriterStyle.ListStyleType ] = this.ListStyleType.ToString().ToLower(); break; case ListStyleType.LowerAlpha: this.Style [ HtmlTextWriterStyle.ListStyleType ] = "lower-alpha"; break; case ListStyleType.LowerRoman: this.Style [ HtmlTextWriterStyle.ListStyleType ] = "lower-roman"; break; case ListStyleType.UpperAlpha: this.Style [ HtmlTextWriterStyle.ListStyleType ] = "upper-alpha"; break; case ListStyleType.UpperRoman: this.Style [ HtmlTextWriterStyle.ListStyleType ] = "upper-roman"; break; } } base.Render(writer); } protected override void RenderChildren(HtmlTextWriter writer) { foreach (ListItem item in this.Items) { this.writeItem(item, this, 0); } base.RenderChildren(writer); } private void writeItem(ListItem item, Control control, Int32 depth) { HtmlGenericControl li = new HtmlGenericControl("li"); control.Controls.Add(li); if (String.IsNullOrEmpty(this.CommonCssClass) == false) { String cssClass = String.Join(" ", new String [] { this.CommonCssClass, this.CommonCssClass + depth }); li.Attributes [ "class" ] = cssClass; } foreach (String key in item.Attributes.Keys) { li.Attributes[key] = item.Attributes [ key ]; } li.InnerText = item.Text; if (item.ChildItems.Count != 0) { HtmlGenericControl ul = new HtmlGenericControl("ul"); li.Controls.Add(ul); if (String.IsNullOrEmpty(this.ContainerCssClass) == false) { ul.Attributes["class"] = this.ContainerCssClass; } if ((item.ListStyleType != ListStyleType.Auto) || (String.IsNullOrEmpty(item.ListStyleImageUrl) == false)) { if (String.IsNullOrEmpty(item.ListStyleImageUrl) == false) { ul.Style[HtmlTextWriterStyle.ListStyleImage] = String.Format("url('{0}');", this.ResolveClientUrl(item.ListStyleImageUrl)); } if (item.ListStyleType != ListStyleType.Auto) { switch (this.ListStyleType) { case ListStyleType.Circle: case ListStyleType.Decimal: case ListStyleType.Disc: case ListStyleType.None: case ListStyleType.Square: ul.Style[ HtmlTextWriterStyle.ListStyleType ] = item.ListStyleType.ToString().ToLower(); break; case ListStyleType.LowerAlpha: ul.Style [ HtmlTextWriterStyle.ListStyleType ] = "lower-alpha"; break; case ListStyleType.LowerRoman: ul.Style [ HtmlTextWriterStyle.ListStyleType ] = "lower-roman"; break; case ListStyleType.UpperAlpha: ul.Style [ HtmlTextWriterStyle.ListStyleType ] = "upper-alpha"; break; case ListStyleType.UpperRoman: ul.Style [ HtmlTextWriterStyle.ListStyleType ] = "upper-roman"; break; } } } foreach (ListItem childItem in item.ChildItems) { this.writeItem(childItem, ul, depth + 1); } } } } [Serializable] [ParseChildren(true, "ChildItems")] public class ListItem: IAttributeAccessor { public ListItem() { this.ChildItems = new List(); this.Attributes = new Dictionary(); this.Text = String.Empty; this.Value = String.Empty; this.ListStyleType = ListStyleType.Auto; this.ListStyleImageUrl = String.Empty; } [DefaultValue(ListStyleType.Auto)] public ListStyleType ListStyleType { get; set; } [DefaultValue("")] [UrlProperty("*.png;*.gif;*.jpg")] public String ListStyleImageUrl { get; set; } [DefaultValue("")] public String Text { get; set; } [DefaultValue("")] public String Value { get; set; } [Browsable(false)] public List ChildItems { get; private set; } [Browsable(false)] public Dictionary Attributes { get; private set; } String IAttributeAccessor.GetAttribute(String key) { return (this.Attributes [ key ]); } void IAttributeAccessor.SetAttribute(String key, String value) { this.Attributes [ key ] = value; } } [Serializable] public enum ListStyleType { Auto = 0, Disc, Circle, Square, Decimal, LowerRoman, UpperRoman, LowerAlpha, UpperAlpha, None } SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/2.0.320/scripts/clipboard.swf'; SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp']; SyntaxHighlighter.all();

    Read the article

  • Changing enum in a different class for screen

    - by user2434321
    I'm trying to make a start menu for my game and my code uses Enum's to moniter the screen state. Now i want to change the screenstate declared in the main class, in my Background class Screen screen = new Screen(); is declared in the Game1 class Background(ref screen); This is in the update method for the Background Class KeyboardState keystate = Keyboard.GetState(); switch (screen) { case Screen.Start: if (isPressed && keystate.IsKeyUp(Keys.Up) && keystate.IsKeyUp(Keys.Down) && keystate.IsKeyUp(Keys.Enter)) { isPressed = false; } if (keystate.IsKeyDown(Keys.Down) && isPressed != true) { if (menuState == MenuState.Options) menuState = MenuState.Credits; if (menuState == MenuState.Play) menuState = MenuState.Options; isPressed = true; } if (keystate.IsKeyDown(Keys.Up) && isPressed != true) { if (menuState == MenuState.Options) menuState = MenuState.Play; if (menuState == MenuState.Credits) menuState = MenuState.Options; isPressed = true; } switch (menuState) { case MenuState.Play: arrowRect.X = 450; arrowRect.Y = 220; if (keystate.IsKeyDown(Keys.Enter) && isPressed != true) screen = Screen.Play; break; case MenuState.Options: arrowRect.X = 419; arrowRect.Y = 340; if (keystate.IsKeyDown(Keys.Enter) && isPressed != true) screen = Screen.Options; break; case MenuState.Credits: arrowRect.X = 425; arrowRect.Y = 460; if (keystate.IsKeyDown(Keys.Enter) && isPressed != true) screen = Screen.Credits; break; } break; } } For some reason when I play this and I hit the enter button the Background class's screen is changed but the main class's screen isn't how can i change this? EDIT 1* class Background { private Texture2D background; private Rectangle backgroundRect; private Texture2D arrow; private Rectangle arrowRect; private Screen screen; private MenuState menuState; private bool isPressed = false; public Screen getScreenState(ref Screen screen) { this.screen = screen; return this.screen; } public Background(ref Screen screen) { this.screen = screen; } public void Update() { KeyboardState keystate = Keyboard.GetState(); switch (screen) { case Screen.Start: if (isPressed && keystate.IsKeyUp(Keys.Up) && keystate.IsKeyUp(Keys.Down) && keystate.IsKeyUp(Keys.Enter)) { isPressed = false; } if (keystate.IsKeyDown(Keys.Down) && isPressed != true) { if (menuState == MenuState.Options) menuState = MenuState.Credits; if (menuState == MenuState.Play) menuState = MenuState.Options; isPressed = true; } if (keystate.IsKeyDown(Keys.Up) && isPressed != true) { if (menuState == MenuState.Options) menuState = MenuState.Play; if (menuState == MenuState.Credits) menuState = MenuState.Options; isPressed = true; } switch (menuState) { case MenuState.Play: arrowRect.X = 450; arrowRect.Y = 220; if (keystate.IsKeyDown(Keys.Enter) && isPressed != true) screen = Screen.Play; break; case MenuState.Options: arrowRect.X = 419; arrowRect.Y = 340; if (keystate.IsKeyDown(Keys.Enter) && isPressed != true) screen = Screen.Options; break; case MenuState.Credits: arrowRect.X = 425; arrowRect.Y = 460; if (keystate.IsKeyDown(Keys.Enter) && isPressed != true) screen = Screen.Credits; break; } break; case Screen.Pause: break; case Screen.Over: break; } } public void LoadStartContent(ContentManager Content, GraphicsDeviceManager graphics) { background = Content.Load<Texture2D>("startBackground"); arrow = Content.Load<Texture2D>("arrow"); backgroundRect = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); arrowRect = new Rectangle(450, 225, arrow.Width, arrow.Height); screen = Screen.Start; } public void LoadPlayContent(ContentManager Content, GraphicsDeviceManager graphics) { background = Content.Load<Texture2D>("Background"); backgroundRect = new Rectangle(0, 0, graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height); screen = Screen.Play; } public void LoadOverContent(ContentManager Content, GraphicsDeviceManager graphics) { } public void Draw(SpriteBatch spritebatch) { if (screen == Screen.Start) { spritebatch.Draw(background, backgroundRect, Color.White); spritebatch.Draw(arrow, arrowRect, Color.White); } else spritebatch.Draw(background, backgroundRect, Color.White); } } Thats my background class!

    Read the article

  • Is there an effective way to test XSL transforms/BizTalk maps?

    - by nlawalker
    Creating repeatable tests for BizTalk maps is frustrating. I can't find a way to handle testing them like I'd do unit testing, because I can't find ways to break them into logical chunks. They tend to be one big monolithic unit, and any change has the potential to ripple through the map and break a lot of unit tests. Even if I could break it up, creating XML test inputs is painful and error prone. Is there any effective way of testing these? I'd settle for recommendations for testing XSL transforms in general, but I specifically mention BizTalk maps primarily for the reason that when using the mapper, there really isn't any way to break your XSLT into templates (which I'd imagine you could use to break up your logic into testable chunks, but I've honestly never gotten that far with XSLT).

    Read the article

  • Would making plain int 64-bit break a lot of reasonable code?

    - by R..
    Until recently, I'd considered the decision by most systems implementors/vendors to keep plain int 32-bit even on 64-bit machines a sort of expedient wart. With modern C99 fixed-size types (int32_t and uint32_t, etc.) the need for there to be a standard integer type of each size 8, 16, 32, and 64 mostly disappears, and it seems like int could just as well be made 64-bit. However, the biggest real consequence of the size of plain int in C comes from the fact that C essentially does not have arithmetic on smaller-than-int types. In particular, if int is larger than 32-bit, the result of any arithmetic on uint32_t values has type signed int, which is rather unsettling. Is this a good reason to keep int permanently fixed at 32-bit on real-world implementations? I'm leaning towards saying yes. It seems to me like there could be a huge class of uses of uint32_t which break when int is larger than 32 bits. Even applying the unary minus or bitwise complement operator becomes dangerous unless you cast back to uint32_t. Of course the same issues apply to uint16_t and uint8_t on current implementations, but everyone seems to be aware of and used to treating them as "smaller-than-int" types.

    Read the article

  • WP7: Why does a ListBox.ItemsPanel break my ElementName data binding?

    - by iguanaNet
    I have a Windows Phone 7 ListBox that binds to a list of integers. I am using the default MVVM Light template, so there is a ViewModel class that contains data and a simple RelayCommand. Here is the ListBox: <ListBox ItemsSource="{Binding MyData}"> <ListBox.ItemTemplate> <DataTemplate> <Button Content="{Binding}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <cmd:EventToCommand Command="{Binding ElementName=ContentGrid, Path=DataContext.TestCommand}" CommandParameter="{Binding}" /> </i:EventTrigger> </i:Interaction.Triggers> </Button> </DataTemplate> </ListBox.ItemTemplate> </ListBox> This displays a vertical list of integers inside buttons. If you click any of them, the following command code executes and shows a pop-up: new RelayCommand<int>(i => MessageBox.Show("Test" + i)); However, if I simply add the following XAML to change to a horizontal list, the databinding fails. Nothing happens when you click the button and no error messages are written to the Output window. <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> I have tried some other types of binding for the EventToCommand. For example, specifying my ViewModel as a static resource. It works, but is less ideal than the example above. Why does that ItemsPanel break the databinding?

    Read the article

  • Should Service Depend on Many Repositories, or Break Them Up?

    - by Josh Pollard
    I'm using a repository pattern for my data access. So I basically have a repository per table/class. My UI currently uses service classes to actually get things done, and these service classes wrap, and therefore depend on repositories. In many cases my services are only dependent upon one or two repositories, so things aren't too crazy. Unfortunately, one of my forms in the UI expects the user to enter data that will span five different tables. For this form I made a single service class that depends upon five repositories. Then the methods within the service for saving and loading the data call the appropriate methods on all of the corresponding repositories. As you can imagine, the save and load methods in this service are really big. Also, unit testing this service is getting really difficult because I have to setup so many fake repositories. Would it have been a better choice to break this single service apart into a few smaller services? It would put more code at the UI layer, but would make the services smaller and more testable.

    Read the article

  • Using foreach loop.

    - by Harikrishna
    I break the code of the for loop without using break like I have for loop given below.And when i is 1 or 2 or 3 or any else but if condition is true then loop will be terminated because i will be 5 if the condition is true.And so NO need of break is needed there.Beacause I do not want to use break.I have done like this here.It works. bool myCondition=false; for(int i=0;i<5;i++) { if(myCondition) { i=5; } } But now I want to use foreach loop and in this loop when some condition is true then I want to break the foreach loop code.So what should I do here for breaking the foreach loop code without using break ? Like in the above for loop I have initialize i to 5 when condition is true.In the foreach loop anything like that to do to avoid break.

    Read the article

  • Complex Entity Framework linked-graphs issue: how to limit change set / break the graph?

    - by Hightechrider
    I have an EDMX containing Sentences, and Words, say and a Sentence contains three Words, say. Appropriate FK relationships exist between the tables. I create some words: Word word1 = new Word(); Word word2 = ... I build a Sentence: Sentence x = new Sentence (word1, word2, word3); I build another Sentence: Sentence y = new Sentence (word1, word4, word5); I try to save x to the database, but EF builds a change set that includes everything, including y, word4 and word5 that aren't ready to save to the database. When SaveChanges() happens it throws an exception: Unable to determine the principal end of the ... relationship. Multiple added entities may have the same primary key. I think it does this because Word has an EntityCollection<Sentence> on it from the FK relationship between the two tables, and thus Sentence y is inextricably linked to Sentence x through word1. So I remove the Navigation Property Sentences from Word and try again. It still tries to put the entire graph into the change set. What suggestions do the Entity Framework experts have for ways to break this connection. Essentially what I want is a one-way mapping from Sentence to Word; I don't want an EntityCollection<Sentence> on Word and I don't want the object graph to get intertwined like this. Code sample: This puts two sentences into the database because Verb1 links them and EF explores the entire graph of existing objects and added objects when you do Add/SaveChanges. Word subject1 = new Word(){ Text = "Subject1"}; Word subject2 = new Word(){ Text = "Subject2"}; Word verb1 = new Word(){ Text = "Verb11"}; Word object1 = new Word(){ Text = "Object1"}; Word object2 = new Word(){ Text = "Object2"}; Sentence s1 = new Sentence(){Subject = subject1, Verb=verb1, Object=object1}; Sentence s2 = new Sentence(){Subject=subject2, Verb=verb1, Object=object2}; context.AddToSentences(s1); context.SaveChanges(); foreach (var s in context.Sentences) { Console.WriteLine(s.Subject + " " + s.Verb + " " + s.Object); }

    Read the article

  • What's a clean way to break up a DataTable into chunks of a fixed size with Linq?

    - by Michael Haren
    Update: Here's a similar question Suppose I have a DataTable with a few thousand DataRows in it. I'd like to break up the table into chunks of smaller rows for processing. I thought C#3's improved ability to work with data might help. This is the skeleton I have so far: DataTable Table = GetTonsOfData(); // Chunks should be any IEnumerable<Chunk> type var Chunks = ChunkifyTableIntoSmallerChunksSomehow; // ** help here! ** foreach(var Chunk in Chunks) { // Chunk should be any IEnumerable<DataRow> type ProcessChunk(Chunk); } Any suggestions on what should replace ChunkifyTableIntoSmallerChunksSomehow? I'm really interested in how someone would do this with access C#3 tools. If attempting to apply these tools is inappropriate, please explain! Update 3 (revised chunking as I really want tables, not ienumerables; going with an extension method--thanks Jacob): Final implementation: Extension method to handle the chunking: public static class HarenExtensions { public static IEnumerable<DataTable> Chunkify(this DataTable table, int chunkSize) { for (int i = 0; i < table.Rows.Count; i += chunkSize) { DataTable Chunk = table.Clone(); foreach (DataRow Row in table.Select().Skip(i).Take(chunkSize)) { Chunk.ImportRow(Row); } yield return Chunk; } } } Example consumer of that extension method, with sample output from an ad hoc test: class Program { static void Main(string[] args) { DataTable Table = GetTonsOfData(); foreach (DataTable Chunk in Table.Chunkify(100)) { Console.WriteLine("{0} - {1}", Chunk.Rows[0][0], Chunk.Rows[Chunk.Rows.Count - 1][0]); } Console.ReadLine(); } static DataTable GetTonsOfData() { DataTable Table = new DataTable(); Table.Columns.Add(new DataColumn()); for (int i = 0; i < 1000; i++) { DataRow Row = Table.NewRow(); Row[0] = i; Table.Rows.Add(Row); } return Table; } }

    Read the article

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