database

how to protect database from windows authentication

戏子无情 提交于 2021-02-11 15:32:10
问题 I want to deploy .net application on client machine.I don't know how to protect my database from from windows authentication. I want to access my database only from defined sqlserver authenticated user. I am Using sqlserver 2008 R2. 回答1: From MSDN discussion: You cannot disable Windows Authentication on SQL Server. In fact, SQL Server recognizes two modes of security: 1) Windows Authentication 2) SQL Server AND Windows Authentication There's a way out, however. Users of the Adminstrators

Requery multiple instances of form independently in VBA (Access)

我的未来我决定 提交于 2021-02-11 15:24:50
问题 I am using Allen Browne's brilliant code (http://allenbrowne.com/ser-35.html) to open several instances of a form on click event. I understand that new instances are read-only and I managed to record the data the user inputs, to keep a log, thanks to this post (Access 2007 / VBA - Multiple Instances of Form, Update controls on specific instance from Module). I have several combo boxes on each form and would like to update/requery what is shown in one depending on user selection on other (for

How to insert a real pivot table in a excel sheet with python?

泄露秘密 提交于 2021-02-11 15:24:47
问题 I want to create a "real" pivot table in excel sheet with python without using the function of pandas (pandas.pivot_table). Is there a method? I need to create the "true" pivot table in excel with a dropdown combo box. Unfortunately the pandas pivot is static (is a table) and not dynamic. Can anyone help me? 回答1: Can you try it this way? import win32com.client Excel = win32com.client.gencache.EnsureDispatch('Excel.Application') # Excel = win32com.client.Dispatch('Excel.Application') win32c =

How to store timetables?

你离开我真会死。 提交于 2021-02-11 15:19:57
问题 I'm working on a project that must store employees' timetables. For example, one employee works Monday through Thursday from 8am to 2pm and from 4pm to 8pm. Another employee may work Tuesday through Saturday from 6am to 3pm. I'm looking for an algorithm or a method to store these kind of data in a MySQL database. These data will be rarely accessed so it's not important performance questions. I've thought to store it as a string but I don't know any algorithm to "encode" and "decode" this

POSTGRES select n equally distributed rows by time over millions of records

[亡魂溺海] 提交于 2021-02-11 15:17:46
问题 I have a table with columns id,filter1,filter2,time,value which contains millions of records. I want to fetch n equally distributed rows between two timestamps. If the number of records between timestamps is less than n I want to fetch all the records. My current query looks like below, assuming n=200 SELECT s.* FROM ( SELECT t.time, t.value, ROW_NUMBER() OVER(ORDER BY t.time) as rnk, COUNT(*) OVER() as total_cnt FROM table_name t WHERE t.filter1='filter_value' and t.filter2='another_value'

@Transactional not working when i throw exception on next line

牧云@^-^@ 提交于 2021-02-11 15:14:34
问题 I don't understand the below behavior: I have a method: @Transactional public void processRejection(final Path path) { try { //some code here } catch (final Exception e) { this.handleException(e)); } } which calls the below which does a saves an entity which doesn't yet exists in the database: void handleException(final Throwable e) { this.filesMonitoringJpaManager.save(someEntityHere); throw new Exception(...) } Now the strange is when I comment the throw new Exception(...) the save works,

@Transactional not working when i throw exception on next line

故事扮演 提交于 2021-02-11 15:13:09
问题 I don't understand the below behavior: I have a method: @Transactional public void processRejection(final Path path) { try { //some code here } catch (final Exception e) { this.handleException(e)); } } which calls the below which does a saves an entity which doesn't yet exists in the database: void handleException(final Throwable e) { this.filesMonitoringJpaManager.save(someEntityHere); throw new Exception(...) } Now the strange is when I comment the throw new Exception(...) the save works,

What is the fastest way to record real-time data in python with least memory loss

孤街醉人 提交于 2021-02-11 14:53:12
问题 In every step of a loop I have some data which I want to be saved in the end in my hard disk. One way: list = [] for i in range(1e10): list.append(numpy_array_i) pickle.dump(list, open(self.save_path, "wb"), protocol=4) But I worry: 1_I ran out of memory for because of the list 2_If something crashes all data will be lost. Because of this I have also thought of a way to save data in real time such as: file = make_new_csv_or_xlsx_file() for i in range(1e10): file.write_in_a_new_line(numpy

A complex update in GORM

非 Y 不嫁゛ 提交于 2021-02-11 14:33:01
问题 I have a model in GORM with Postgres as database. The model is like this type Country struct { gorm.Model Name string Population int64 Regions []Region } type Region struct { gorm.Model Name string Cities []City CountryID uint `sql:"type:bigint REFERENCES countries(id) ON DELETE CASCADE" json:"-"` } type City struct { gorm.Model Name string Comment string RegionID uint `sql:"type:bigint REFERENCES regions(id) ON DELETE CASCADE" json:"-"` } When I create a new record from model, I invoke

Select information from the database for a page accessed by different users

六月ゝ 毕业季﹏ 提交于 2021-02-11 14:17:55
问题 This is the scenario: User A: Access the website and choose a questionnaire. The questionnaires are separated on different pages in the same domain, for example: Home: "surveys.com" Questionnaires: "surveys.com/type1" "surveys.com/type2" After choosing one, he ( User A ) puts the following information: 1 = Recipient's email 2 = His email And then submit. User B: Person who received this link to the questionnaire (surveys.com/type1). What I want to do is: When User B accesses the link to the