fo

INSERT statement conflicted with the FOREIGN KEY constraint

匿名 (未验证) 提交于 2019-12-03 01:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting the following error. Could you please help me? Msg 547, Level 16, State 0, Line 1 The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Sup_Item_Sup_Item_Cat". The conflict occurred in database "dev_bo", table "dbo.Sup_Item_Cat". The statement has been terminated. Code: insert into sup_item (supplier_id, sup_item_id, name, sup_item_cat_id, status_code, last_modified_user_id, last_modified_timestamp, client_id) values (10162425, 10, 'jaiso', '123123', 'a', '12', '2010-12-12', '1062425') The last column client_id is

Curl request with digest auth in PHP for download Bitbucket private repository

匿名 (未验证) 提交于 2019-12-03 01:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm try to do this request on php, for download the last source from my Bitbucket private repository: curl --digest --user user:pass https://bitbucket.org/user/repo/get/tip.zip -o test.zip in command line its ok, the file download perfect, but in php dont work, this my php code: $out = fopen('test.zip', 'w+'); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); curl_setopt($ch, CURLOPT_USERPWD, 'user:pass'); curl_setopt($ch, CURLOPT

EmberJS: Good separation of concerns for Models, Stores, Controllers, Views in a rather complex application?

匿名 (未验证) 提交于 2019-12-03 01:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm doing a fairly complex emberjs application, and tying it to a backend of APIs. The API calls are not usually tied to any particular model, but may return objects of various types in different sections of the response, e.g. a call to Events API would return events, but also return media assets and individuals involved in those events. I've just started with the project, and I'd like to get some expert guidance on how best to separate concerns to have a clean maintainable code base. The way I am approaching this is: Models : essentially

Are there NUnit Test Case Attributes for specifying Configuration

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am writing an NUnit test that I want run only in the Release configuration. Is there an elegant way of doing this with a test case attribute? Right now, I am surrounding the entire function block with compiler directives: I am using Nunit 2.5.6.10205. #if !DEBUG [Test] public void MyReleaseOnlyTest() { // stuff } #endif 回答1: You could use the [Category] attribute. If you mark release only tests with [Category("Release")] then exclude that category in your normal test run and include it in you release run. So now your test becomes [Test]

Python MySQLdb issues (TypeError: %d format: a number is required, not str)

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to do the following insert operation: cursor.execute(""" insert into tree (id,parent_id,level,description,code,start,end) values (%d,%d,%d,%s,%s,%f,%f) """, (1,1,1,'abc','def',1,1) ) The structure of my MYSQL table is: id int(255), parent_id int(255), level int(11), description varchar(255), code varchar(255), start decimal(25,4), end decimal(25,4) However when I run my program, I get the error " File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 151, in execute query = query % db.literal(args) TypeError: %d format: a

No targets specified and no makefile found

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a make file that contains this code: all: main.o Etudiant.o gcc -lobjc -o program main.o Etudiant.o main.o:main.m Etudiant.h gcc -c main.m Etudiant.o:Etudiant.m Etudiant.h gcc -c Etudiant.m When I write this in the shell command: $make I got this: make: **** No targets specified and no makefile found. Stop. How do I fix this? 回答1: Mmm... makefiles. Whee. All that whitespace at the beginning of the line. That has to be tabs. Or Make will barf up a really obscure error. Make sure those are tabs and try again. See the button on the left

How to install PIL on Mac OSX 10.5.8 for Google App Engine?

匿名 (未验证) 提交于 2019-12-03 01:28:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to get PIL installed locally to test GAE's images api in my local environment. I grabbed the PIL 1.1.6 installer for Mac, and when I go to select the destination (when installing), I get the error: You cannot install PIL 1.1.6 on this volume. PIL requires System Python 2.5 to install. I have Python 2.5.x on this machine. NOTE: Added a bounty. I am in real need of a way to test the image API locally on my Mac. 回答1: That's quite easy: Install MacPorts Install Python 2.5 with sudo port install python25 Install Pil for Python 2.5 with

Using alternation or character class for single character matching?

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: (Note: Title doesn't seem to clear -- if someone can rephrase this I'm all for it!) Given this regex: (.*_e\.txt) , which matches some filenames, I need to add some other single character suffixes in addition to the e . Should I choose a character class or should I use an alternation for this? (Or does it really matter??) That is, which of the following two seems "better", and why: a) (.*(e|f|x)\.txt) , or b) (.*[efx]\.txt) 回答1: Use [efx] - that's exactly what character classes are designed for: to match one of the included characters.

open a sqlite database when choosing folder with ACTION_OPEN_DOCUMENT_TREE

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an already existing sqlite database in a folder /sdcard/myfolder/db/mydb.db . My app shows a dialog to choose a folder: Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); startActivityForResult(intent, 42); The Dialog pops up and I can choose the folder: I choose the folder /sdcard/myfolder/db/ and press choose/ok. My onActivityResult gets called. I go through all files and if the file is my "mydb.db" then I try to open the sqlite database with SQLiteDatabase.openDatabase(); and I get an error (see below) My guess of the

Android - transform Classes With Dex For Debug

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My project was working fine until I added the Facebook dependency. I've started getting this error. I've read many question, the problem seems to be related to MultiDex . But none of the solutions worked for me Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 1 Even after I remove