Search Results

Search found 1513 results on 61 pages for 'unexpected'.

Page 34/61 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • Generic Any/Attach/Add function for Entity Framework

    - by Matt Thrower
    Looking through my EF classes, they're littered with code that looks like this: if (_myContext.[EntityType].Any(d => d.RowId == dc.RowId)) { _myContext.[EntityType].Attach(dc); _myContext.Entry(dc).State = EntityState.Modified; } else { _myContext.[EntityType].Add(dc); } It's the same thing over and over, and is clearly itching to be handled by a generic function. However, I'm not sure how you'd go about handling the need for it to deal with a variety of unexpected entity types. A good example to get me started would be most appreciated.

    Read the article

  • Git Status Across Multiple Repositories on a Mac

    - by eapen
    I have been searching for a solution to this for a while and have not found quite what I need. I have several Git Repositories in a folder on my Mac (OSX 10.6) and would like a script or tool that will loop through all the repositories and let me know if any of them needs "commit"-ing. This is my structure Sites   /project1   /project2   /project3 I want the tool to do a "git status" in Sites/project1, Sites/project2, Sites/project3 and let me know if Sites/project2 and Sites/project3 have changes or new files and needs to be Staged/committed The closest script I found that might be hackable is here: http://gist.github.com/371828 but even that script wouldn't run and I get an error: "syntax error near unexpected token `do" which might have been written for *nix.

    Read the article

  • Developing for mobile devices and desktop

    - by Augusto
    Hi, I'm starting a new project. It will run on devices running Windows CE, Windows Mobile 6 and will also have a desktop version. The software will connect to some equipments through the serial port, using it's own protocol. Basically it will: connect to the equipment send and receive info read and write binary files These tasks will be shared between desktop and mobile devices. I've been searching the information I need, but I still have some doubts: If I target Windows CE devices it will work with Windows Mobile 6 too? Creating a class library targeting Windows CE will give me any trouble on using it in the desktop version? (when I add a reference to that class library, my VS says that I could experience some unexpected results) Is it possible to install .NET CF 3.5 on devices running Windows CE 4.2? Thanks!

    Read the article

  • How to code for Alternate Course AKA Rainy Day Scenary?

    - by janetsmith
    Alternate course is something when user doesn't do what you expected, e.g. key in wrong password, pressing back button, or database error. For any programming project, alternate course accounts for more than 50% of a project timeline. It is important. However, most computer books only focus on Basic Course (when everything goes fine). Basic course is rather simple, compared to Alternate course, because this is normally given by client. Alternate course is what we, as a programmer or Business Analyst needs to take care of. Java has some built-in mechanism (try-catch) to force us to handle those unexpected behavior. The question is, how to handle them? Any pattern to follow? Any guideline or industry practice for handling alternate course?

    Read the article

  • SVN Authorization

    - by Weslei
    I am trying to setup SVN authorization (authentication works fine already) and my AuthzSVNAccessFile looks like the following: [groups] todos = user1, user2 proj = user1 [/] @todos = r [/myproj] @proj = rw However, I can checkout the content of proj (as user1) but I can't commit to it... If i change the file changing to the following: [groups] todos = user1, user2 proj = user1 [/] @todos = rw [/myproj] @proj = rw I can successful commit... Anyone knows what's wrong with my access file? I am using SVN with SVNParentPath, to point to a folder containing multiple repositories. The errors it gives are: svn: Error: Server sent unexpected return value (403 Forbidden) in response to CHE CKOUT Thanks.

    Read the article

  • Google Translation API not working for even one page long documents

    - by Saubhagya
    I'm using Google Translation API to translate text from Chinese Simplified to English in my C# program. The problem is if the text is small (around one line) the API is able to translate it, but if the text is larger (more than 3 lines) is gives an exception saying "The remote server returned an unexpected response: (414) Request-URI Too Large.". However if I use translate.google.com in my browser that works fine. Please tell me how can I process large documents using Google Translate API in my desktop application written in C#.

    Read the article

  • PHP Populating array with $variables

    - by Tom
    Hi, I'm trying to create a basic shopping cart, having an issue with the product page allowing users to add more items to their cart then are in stock (I have code in place to prevent this on the view cart page, just not the view product page) This is what I have so far; for ($i = 0; $i < $numItem; $i++) { extract($cartContent[$i]); $subTotal += $price * $cartQuantity; $cartLimiter[$itemNo => $cartQuantity]; Using an array so the position number becomes the item number and the cart quantity becomes the assigned value, however it doesn't seem to like it and throws out on the bottom line of code: Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting ']' Thanks

    Read the article

  • tfs : branch moved folder based on label or date

    - by Andy
    I've moved a folder in tfs using the "move" command but now I cannot create branches off the moved folder based on date or label (label was created when source was in the old folder). I can however create a branch based on "latest version". I get an error message "no items match in if I try to branch of a label. I'm guessing the label references files using the old folder before I moved it. I also get no files if I try to "get specific version" by either date or label. I've tried to roll back moving the folder but this gives me errors such as "An unexpected error occured".

    Read the article

  • ResultSet and aggregation

    - by kachanov
    Ok, I admit my situation is special There is a data system that supports SQL-92 and JDBC interface However the SQL requets are pretty expensive, and in my application I need to retreive the same data multiple times and aggregate it ("group by") on different fields to show different dimensions of the same data. For example on one screen I have three tables that show the same set or records but aggregated by City (1st grid), by Population (2nd grid), by number of babies (3rd grid) This amounts to 3 SQL queries (which is very slow), UNLESS anyone of you can suggest any idea any library from apache commons or from google code, so that I can select all records into ResultSet and get 3 arrays of data group by different fields from this single ResultSet. Am I'm missing some obvious and unexpected solution to this problem?

    Read the article

  • Unicorn: Which number of worker processes to use?

    - by blackbird07
    I am running a Ruby on Rails app on a virtual Linux server that is capped at 1GB RAM. Currently, I am constantly hitting the limit and would like to optimize memory utilization. One option I am looking at is reducing the number of unicorn workers. So what is the best way to determine the number of unicorn workers to use? The current setting is 10 workers, but the maximum number of requests per second I have seen on Google Analytics Real-Time is 3 (only scored once at a peak time; in 99% of the time not going above 1 request per second). So is it a save assumption that I can - for now - go with 4 workers, leaving room for unexpected amounts of requests? What are the metrics I should have a look at for determining the number of workers and what are the tools I can use for that on my Ubuntu machine?

    Read the article

  • Passing functions as arguements in Matlab

    - by Dave
    Hi, I'm trying to write a function that is gets two arrays and the name of another function as arguements. e.g. main.m: x=[0 0.2 0.4 0.6 0.8 1.0]; y=[0 0.2 0.4 0.6 0.8 1.0]; func2(x,y,'func2eq') func 2.m : function t =func2(x, y, z, 'func') //"unexpected matlab expression" error message here t= func(x,y,z); func2eq.m: function z= func2eq(x,y) z= x + sin(pi * x)* exp(y); Matlab tells gives me the above error message. I've never passed a function name as an arguement before. Where am I going wrong? p.s. sorry about the formatting of code above, I can't seems to get SO to show parts of the code as code.

    Read the article

  • cross-domain data with AJAX using JSONP

    - by kooshka
    I'm trying to get data from Geobytes. One of the templates returns JSON and I need to cross-domain access it. I wrote these 2 functions function getCountry(ip) { var surl = "http://www.geobytes.com/IpLocator.htm?GetLocation&template=json.txt"; $.ajax({ url: surl, data: '{"ipaddress":"' + ip + '"}', dataType: "jsonp", jsonp: "callback", jsonpCallback: "jsonpcallback" }); } function jsonpcallback(rtndata) { alert(rtndata.message); } The call is executed but I get 1 warning: Resource interpreted as Script but transferred with MIME type text/html: "http://www.geobytes.com/IpLocator.htm?GetLocation&template=json.txt&callback=jsonpcallback&{%22ipaddress%22:%22200.167.254.166%22}&_=1353148931121" 1 Error: Uncaught SyntaxError: Unexpected token : The error is thrown on the returned data at {"geobytes":{"countryid":117, I think is maybe because it's 117 and not "117" but I obviously can't control the returned data How can I fix these 2 issues?

    Read the article

  • Wrong file encoding after Dist::Zilla

    - by xenoterracide
    How can I get mojibake to pass? this might be a bug in the contributors plugin. The character does not render correctly in perldoc, but does in my vim and in the extracted git log. # Failed test 'Mojibake test for blib/lib/Pod/Spell.pm' # at /home/xenoterracide/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Test/Mojibake.pm line 168. # Non-UTF-8 unexpected in blib/lib/Pod/Spell.pm, line 431 (POD) here's a snippet from the source which should probably be looked at directly due to copy-paste maybe not catching an encoding issue. =item * Olivier Mengué <[email protected]> =back A little more vim exploration shows that :set filencoding is being changed to latin1 editing the file in vim seems to fix this, but since the file is being generated, how can I get it generated with the correct encoding?

    Read the article

  • What are some of the best automated web QA tools out there?

    - by Kant
    Issue We have a series of websites built in ASP.NET that we deploy frequently. Due to the lack of a QA team, we are unable to test the functionality and load of every web page within the site. Question What are some of the top tools for doing QA testing. The tool should include some basic functionality, such as: Notifying parties when unexpected results occur. Expected results should be configurable (i.e. Hit web page A, if the response doesn't have the string, "My intranet portal" in it, notify the appropriate parties). Any help is appreciated.

    Read the article

  • How to output JavaScript with PHP

    - by krishna
    Hi, I am new to PHP. I need to output the following JavaScript with PHP. This is my code: <html> <body> <?php echo "<script type="text/javascript">"; echo "document.write("Hello World!")"; echo "</script>"; ?> </body> </html> But it's showing the error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /var/www/html/workbench/person/script.php on line 4 Can anyone please help? I also need some simple tutorials on how to use PHP, HTML and JavaScript for an application.

    Read the article

  • regex pattern to match only strings that don't contain spaces PHP

    - by Jamex
    Hi, I want to match the word/pattern that is contained in the variable, but only match against the words that don't have white spaces. Please give suggestions. $var = 'look'; $array = ('look', 'greatlook', 'lookgreat', 'look great', 'badlook', 'look bad', 'look ', ' look'); matches words: look, greatlook, lookgreat, badlook non matches: look great, bad look, look (trailing space(s)), (space(s)) look. The syntax of the below functions are OK, but it matches everything $match = preg_grep ("/$var/", $array); $match = preg_grep ("/^$var/", $array); (match words with 'look' at the start) but when I include the [^\s], it gives an error $match = preg_grep ("/$var[^\s]/", $array); Parse error: syntax error, unexpected '^', expecting T_STRING or T_VARIABLE TIA

    Read the article

  • How do I set a variable inside a bash for loop?

    - by Isaac Moore
    I need to set a variable inside of a bash for loop, which for some reason, is not working for me. Here is an excerpt of my script: function unlockBoxAll { appdir=$(grep -i "CutTheRope.app" /tmp/App_list.tmp) for lvl in {0..24} key="UNLOCKED_$box_$lvl" plutil -key "$key" -value "1" "$appdir/../Library/Preferences/com.chillingo.cuttherope.plist" 2>&1> /dev/null successCheck=$(plutil -key "$key" "$appdir/../Library/Preferences/com.chillingo.cuttherope.plist") if [ "$successCheck" -eq "1" ]; then echo "Success! " else echo "Failed: Key is $successCheck " fi done } As you can see, I try to write to a variable inside the loop with: key="UNLOCKED_$box_$lvl" But when I do that, I get this: /usr/bin/cutTheRope.sh: line 23: syntax error near unexpected token `key="UNLOCKED_$box_$lvl"' /usr/bin/cutTheRope.sh: line 23: `key="UNLOCKED_$box_$lvl"' What am I not doing right? Is there another way to do this? Please help, thanks.

    Read the article

  • Github svn interface

    - by Fabio
    I recently moved a project on github and I still use this library in some svn projects as external. However I can't get github svn interface working at this time. If I run svn list http://svn.github.com/fabn/zle.git I obtain this error svn: Server sent unexpected return value (500 Internal Server Error) in response to PROPFIND request for '/fabn/zle.git/!svn/bc/0' If I run the same command using a fork of my project the list (and also the checkout) goes fine and i obtain what I need (this is the command svn list http://svn.github.com/JellyBelly/zle.git) Is there anything I can do to resolve this issue or it's a github problem?

    Read the article

  • Array in Bash Not Found

    - by Waffle
    I am trying to declare an array in bash, but when the code is run it says it cannot find the array. I have tried to write out the declaration of the array in several different ways, but it seems no matter how I try to declare it I cannot get it to work. I originally tried to declare it as such: candidate[1]= 0 candidate[2]= 0 candidate[3]= 0 The error messages that are returned are: votecalculation.sh: 13: candidate[1]=: not found votecalculation.sh: 14: candidate[2]=: not found votecalculation.sh: 15: candidate[3]=: not found After this I tried another solution I found online: ARRAY=( 'can1' 'can2' 'can3' ) When that is used it returns this error: votecalculation.sh: 12: Syntax error: "(" unexpected I am new to Bash and am getting really confused about arrays. Is there some specific way I need to declare an array or am I just going about it completely wrong?

    Read the article

  • Modifying annotation attribute value at runtime in java

    - by Lici
    Hi folks: some methods in our model pojos have been annotated like this: @Column(name="cli_clipping_id", updatable=false, columnDefinition = "varchar(" + ModelUtils.ID_LENGTH + ") COLLATE utf8_bin") columnDefinition attribute is database vendor dependant, so when trying to drop schema in HSQLDB using Hibernate it fails: [ERROR] 16 jun 12:58:42.480 PM main [org.hibernate.tool.hbm2ddl.SchemaExport] Unexpected token: COLLATE in statement [create table cms.edi_editorial_obj (edi_uuid varchar(23) COLLATE ] To fix this, i'm thinking on this solution (but don't want to spend time if it isn't possible) , at runtime, for each method column annotated: Get @Column annotation Create a copy of the column annotation, setting columnDefinition null using javaassist. set column method annotation to the copy column annotation object overriding the old one (i don't know it this is possible) Is it possible to "hack" these methods this way? Any help would be much appreciated ...

    Read the article

  • C++'s char * by swig got problem in Python 3.0

    - by gpliu3
    Our C++ lib works fine with Python2.4 using Swig, returning a C++ char* back to a python str. But this solution hit problem in Python3.0, error is: Exception=(, UnicodeDecodeError('utf8', b"\xb6\x9d\xa.....",0, 1, 'unexpected code byte') Our definition is like(working fine in Python 2.4): void cGetPubModulus( void* pSslRsa, char* cMod, int* nLen ); %include "cstring.i" %cstring_output_withsize( char* cMod, int* nLen ); Suspect swig is doing a Bytes-Str conversion automatically. In python2.4 it can be implicit but in Python3.0 it's no long allowed.. Anyone got a good idea? thanks

    Read the article

  • Jenkins and Visual Studio Online integration authentication

    - by user3120361
    right now I am trying to Setup Continuouse Integration - Delivery for a basic WCF Service, which will be hosted on a Microsoft Azure VM. The Project is Version Controlled through Visual Studio Online. So I installed Jenkins (also on the Azure VM), TFS plugin etc. and started the first Test Build: As Server URL I used "[VSO Adress]/DefaultCollection" and for Login purposes my Microsoft Account (I can Access VSO with that). The Problem is, when I run the Build I get the following error: Started by user Developer Building in workspace C:\Program Files (x86)\Jenkins\jobs\test\workspace [workspace] $ "C:\Program Files (x86)\TEE-CLC-11.0.0.1306\TEE-CLC-11.0.0\tf.cmd" workspaces -format:brief -server:[VSO Adress]/DefaultCollection ****" An error occurred: Access denied connecting to TFS server [VSO Adress] (authenticating as har****@*******o.com) FATAL: Executable returned an unexpected result code [100] ERROR: null Finished: FAILURE So my question is, whether it is generally possible to connect Jenkins and VSO that way and if so, which login credentials are needed

    Read the article

  • Symfony2 Syntax Errors (in vendor files)

    - by user1665246
    To maintain code integrity across our servers we'd like to keep the /vendor/* directory under source control, rather than use composer to download files each time we roll out onto another server - i.e. we can be certain that the /vendor/* files are identical. We run a syntax checker against all files committed to source control and run across the following error: File '/vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php' failed the PHP syntax check with the following error: PHP Parse error: syntax error, unexpected '}', expecting T_NS_SEPARATOR in /vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/bundle/Bundle.php on line 3 Is the "error" in this file intentional ? Any help appreciated. File contents below: <?php namespace {{ namespace }}; use Symfony\Component\HttpKernel\Bundle\Bundle; class {{ bundle }} extends Bundle { }

    Read the article

  • where are wrong in my php code ????

    - by user318068
    hi all, <td align="center" bgcolor="#FFFFFF"><?php echo '<label onclick="window.open('profilephp.php?member=$row['MemberID']','mywindow')">'.{$row['MemberName']}.'</label>';?><br /> <?php echo "<p align='center'><img width='100' height='100' src={$row['MemberImg']} alt='' /></p>";?></td></tr> Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\home - Copy\membercopy.php on line 141 I really don't know where it went wrong. Please help,

    Read the article

  • Javascript Illegal Token Error

    - by Pete Herbert Penito
    Forgive me if this is a simple problem but I can't seem to find why this code: function create_content(c) { var html = "<div id='header'>"+c+"</div>"; if(c == "links") { var ul = "<ul><li><a href='http://www.mylink.com'>My Link 1</a></li> <li><a href='http://www.mylink2.co.uk'>My Link 2</a></li></ul>"; html = html + ul; } return(html); } Is giving me this error in Chrome (win): Uncaught SyntaxError: Unexpected token ILLEGAL On the line that starts with "var ul = " Any advice would help thanks!

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >