Wednesday, 15 May 2013

windows - Shared file access between Python and Matlab -


I have a Matlab application which is one. Writes in the csv file and a Python script that reads from it. These operations happen together and at their respective time (not necessarily the same). It all runs on Windows 7

I want to know:

  1. Has the OS naturally provided some type of locking mechanism so that only one of the two applications - Matlab or Python - shared file You can use?
  2. In the Python application, how can I check that the file is already "open" by the Ed Matlab app? What is the loop structure for it, so that until the file is accessed for reading, the Python app is blocked?

  1. While the file is open to matlab , Then you can create an empty file "data.lock" or something in that effect.

  2. When Python tries to read the file, it will check the lock file, and if it is there, then it will sleep for a given interval.

  3. When matlab is done with the file, it may delete the "data.lock" file.

It is a programmatic solution, but it is easier to dig through windows API and find the right calls in matlab and python.


javascript - Dropdown List - Display Value Instead of Text -


I'm using dropdown list to change a combo box for dropdown text, I'm adding two columns I am displaying them as one who works fine. When they choose a column, I need to display the selected VALUE instead of the selected text, but I still need the text to show as selectable options

What An easy way to do this? Or alternatively how can I create a multi-column dropdown list and use one text as the selected text?

In my dropdown list, I have:

  Value Text 1 Option An Option 2 Option Two 3 Option  

When I If I select 'option one', then I need a dropdown text display to be '1'. Hopefully things make things quite clear.

If you are dynamically adding data to your combo box, then it is added to each record Specify one value for This means that in runtime, you get the dim string string = combo box 1. The selected values ​​can display when the text box displays in the combo box dropdown.


c# - Generate Enum from Lookup Tables - EF 6 -


It can be repeated but I have gone through all the available positions but the EF 6 version did not understand the best method.

I have two tables

  PersonPhone (PersonID, PhoneTypeID) Phone Type (Phonetype ID, Details)  

as phonetips See just the up (cell, office, pager etc). How can I generate the same aromas in the code from the PhoneTip table?

Can anyone take steps to generate an enamel to see the tables? Thanks in advance

On the one hand, with a T4 template that automatically saves your enema from the table Will generate

Change the connection string, and make sure that the script assumptions about the format of your data are correct (that is, the name of the ID is TableNameID ) that I used in some projects. . Then add appropriate .tt files to each Enum, and run the template.


r - Creating a column that has the count of elements of different column -


मेरे पास एक डीएफ है

  xyz 1 1 1 2 2 2 2 5 3 3 5  

मुझे डीएफ का एक नया कॉलम बनाने के लिए आर में एक साधारण कमांड रखना होगा जो कि मेरी मूल डीएफ की गिनती है और निम्न की तरह दिखेगी:

  xyz xcount ycount zcount 1 1 1 2 1 1 1 2 5 2 2 3 2 2 5 1 2 3 3 3 5 1 1 3  

मुझे पता है यह एक सरल सवाल है और शायद जिस तरह से मैं इसके बारे में सोच रहा हूं, वह मेरे पिछले अनुभव से स्टेटा के साथ विकलांग है। मैंने तालिका फ़ंक्शन का उपयोग करने पर ध्यान दिया है, लेकिन वेक्टर जो उस मूल्य से अनन्य मानों की संख्या के बराबर है। मैं उन मूल्यों को आर में एक नए कॉलम में नक्शा कर सकता हूं, लेकिन यह घर्षण लगता है।

लाइनर:

  cbind (df, setNames (lapply (df, फ़ंक्शन (x) एवे (x, x, FUN = लंबाई)), पेस्ट0 (नाम (df), "count")) ) # Xyz xcount ycount zcount # 1 1 1 1 2 1 1 # 2 1 2 5 2 2 3 # 3 2 2 5 1 2 3 # 4 3 3 5 1 1 3  

महत्वपूर्ण हिस्सा है:

  & gt; Lapply (df, function (x) ave (x, x, FUN = लंबाई)) $ x [1] 2 2 1 1 $ y [1] 1 2 2 1 $ z [1] 1 3 3 3  

  dfcount & lt; - function (df) ) Cbind (df, setNames (lapply (df, function (x) ave (x, x, fun = length)), paste0 (names (df), "count"))) dfcount (df) # xyz xcount ycount zcount # 1 1 1 1 2 1 1 # 2 1 2 5 2 2 3 # 3 2 2 5 1 2 3 # 4 3 3 5 1 1 3  

sql server - Query error with 2 ambiguous column names in SQL -


I have been working with this question for a while and I have a hard time getting new to SQL and I can not understand their reason is that I get this error:

  select CUSTOMER_NUMBER, first_name_initial, last_name, serve_address_1, serve_address_2, serve_city, serve_state, route_serve_zip_code, phone_number1, the customer_master insider Join Where m.customer_number = r.customer_number on referral_code route_detail (referral_code = 'American')  

error

message 209, level 16, state 1, line 1Ndigd column called Grahk_anmber message 20 9, Level 16, State 1, Line 1 suspect column name 'phone_number1'.

I have tried to add the column as follows, but there is no luck with it. Any help would be greatly appreciated!

  CUSTOMER_NUMBER, the first_name_initial, last_name, serve_address_1, serve_address_2, serve_city, serve_state, route_serve_zip_code, phone_number1, referral_code customer_master meters Insider Join route_detail r on m.customer_number = r .customer_number where ( The problem is with this line   

pre> select customer_number

If you want to get the table Grahk_nmber the kind that you must specify:

  select r .customer_number Select  

or

  m.custo mer_number  

If your final query will look like this: