unicode riddle


Hi,  

I have this code:



list =



```
def func(list):
... 	for e in list:
... 		e = re.sub(' ?&# x([0-9a-f]*);',r'\x\1',e)
... 		print type(e)
... 		e = unicode(e,'iso-8859-1')
... 		print type(e)
... 		print e
```

I get this output:



```
12 angry men
Rash\xf4mon
```

whereas I wanted the output to be:



```
12 angry men
Rasho'mon (o' is like spanish o with some accent like character above it)
```

Can someone help me?



PS: I tried this on python interactive shell (of PythonWin). python version 2.6
What is your question exactly?



```
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'Rash\xf4mon'
Rashômon
>>>
```
you can use the repmat function here
if you have to print the patter n (here 10) times, use the following code:
a = [5 4 3 2 1 0]';
n = 10;
b =repmat(a, n,1) finding the correct answer here is important, but perhaps equally important is finding it using the method of matrix reduction, since those are the instructions.the augmented matrix is4 -2 -5 -514 -1 -2 -364 -2 4 -24you'll have to forgive the poor formatting. this answer box doesn't have a proper math symbol editor.using elementary row operations, the reduced row echelon form of the augmented matrix is1 0 0 -60 1 0 60 0 1 3from which we conclude that the system has a unique solution (-6,6,3). differ, mismatch, anger, upset, disturb, disappoint, question, offend, displease, oppose, disagree, annoy, miss, reject, refuse, frustrate, neglect, dissatisfy, fail. dear student
red is coded as 2076
which means
r=20
e=7
d=6
now lets us number the alphabets as follows
a=1
b=2
c= 3
d= 4
e= 5




r=18


y=25
z=26

now according to the question
r=20=18+2
e=7=5+2
d=6=4+2

therefore we can say that
g = 7+2 =9
a=1+2=3


gag will be coded as 939


regards
â€‹â€‹â€‹â€‹â€‹â€‹â€‹ mach, macho, marches, maths, sachs, mashes, matches, maces, macs, macias, acquittings, administerings, unsticky, artsycraftsy, post-card. hi, thank you for the help.

we were able to find the issue by comparing with the workstation of one of our coworker not having this issue. the character “é” from the file location was causing it to bug as it is a special character. we have had to change our computers language settings from french t… i use a mac as well. you can set textedit to ‘plain text’ instead of ‘rich text’ and make sure it’s saving as a utf-8 .txt file in the preferences, but there isn’t an easy way to show the line numbers. if it’s saving as .rtf, that might be one reason your code isn’t working for you currently.

as fo… depending if you want to physically add a back return into the code, of if you want to only format the display of the code, you will have to apply different solution

1 if you want to change the code... search and replace using reg exp

search (<p[^+>]*>)|(<\/p>)|(<img[^+>]*>)

replace by $1$2$3<br>

2 if you want to display code format differently

go on edition > bibliotheque de balises...

search for you concerned tag and edit the line retun pop up

![](/legacyfs/online/1611145_pastedImage_0.png) A few things to try.


1. Use [Variable Tables](http://odetocode.com/Articles/365.aspx) instead -> maybe the import wizard prefers that?
2. Name your return fields.


Try using the following stored proc (untested .. just thinking out loud...)



```
CREATE PROCEDURE dbo.Foo
AS

    SET NOCOUNT ON

    DECLARE @ResultTable TABLE (SomeId INTEGER)

    INSERT INTO @ResultTable
    SELECT DISTINCT Id AS Identity -- Or u can rename this field to anything...
    FROM SomeExistingTableWhichHasAnIdentityField

GO

```

Try that and see if the wizard refreshes, now.


-- 


 Attempt #2 :)


Ok .. when the EF designer/wizard/whatever fails to figure out EXACTLY what my stored proc is suppose to be returning, I usually do the following :-


1. Make sure the stored procedure doesn't exist at all in the EF designer/context, etc. (You have a clean starting point)
2. Open up your stored procedure and `/* /*` comment out *EVERYTHING* after the procedure definition.


eg..



```
ALTER PROCEDURE dbo.Foo
(
    Bar1 INT,
    Bar2 TINYINT,
    ... // whatever u have as your optional input arguments //
)
AS
    SET NOCOUNT ON

    /* 
    .... every thing in here is commented out 
    */
GO

```

Now ...
 3. Add a forced fake return in the stored proc, which (more or less) just *defines* the output structure/fields.


eg..



```
ALTER PROCEDURE dbo.Foo
(
    Bar1 INT,
    Bar2 TINYINT,
    ... // whatever u have as your optional input arguments //
)
AS
    SET NOCOUNT ON

    SELECT 1 AS Id, 1 AS UserId, 1 AS SomeOtherId, 
        CAST('AAA' AS NVARCHAR(350)) AS Name,
        -- etc etc etc..
    /* 
    .... every thing in here is commented out 
    */
GO

```

[and then](http://www.youtube.com/watch?v=K7luMp6lb9M) ...


4. Add this stored proc to your EF designer/wizard/etc... Now the correct fields should be 'determined' by the designer. AWESOME. Yes .. the values are all hardcoded .. but that's ok (so far).
5. Once your happy that EF is now updated right, go back to your stored proc, and remove all hardcoded SELECT (which we did in the above step). Now we remove the comments which we commented out the entire real code. So you should have your original stored proc, back.


... and now EF is updated and doesn't know we've changed the plumbing of your stored proc.


win :)


does this work for ya? start with 50 easys. if you solve those quickly, then move into mediums. hards are pretty tricky tbh i just attempt then peek answers/memorize lol