Posts

Showing posts from March, 2013

python - How can I get all days between two days? -

I need all working days between two days. Example: Wednesday - Friday = Wednesday, Thursday, Friday 3 - 5 = 3, 4, 5 Saturday - Tuesday = Saturday, Sunday, Monday, Tuesday 6 - 2 = 6 , 7, 1, 2 I'm pretty sure to make sure there is a clever algorithm to solve it. Only the algorithms I can consider using a loop or if statement. This should be a great way to solve. I use number 1-7 in weekdays, but 0-6 is also fine. The best I can come up with: def between (d1, d2): allds = [0,1,2,3,4,5,6 , 0,1,2,3,4,5,6] # or range (7) * 2 offsets = 8 if D1 & gt; (2, 4) Between # [0,1,2,3,4] (5,2) # [5,6,0,1,2] between D2 and 1 returns allied [d1: d2 + offset ] & gt; & Gt; & Gt; Def weekdays (S, E): ... for reserve [n% 7] ... ... gt; reserve (en, e + (1 if e & gt; second 8)); & Gt; & Gt; On weekdays (2, 4) [2, 3, 4] & gt; & Gt; & Gt; This is a bit more complex if you have to convert from real days to / from actual days. & gt; &

php - PDF show off (preview) -

I have a customer who works during the weekend and prepares a file in MS Word text < / P> That word document is converted to PDF to be downloaded as a link to a web site. I can create a php script which will create a list of how many files in the folder, check them, but I am the best way to preview the file (automatically) or to view the file online. To download ... How to do any idea, how do you manage that situation? Thanks in advance Here's one interesting You tried:; It can point to the file on your server

Php tags display -

4 tables are used to store tags: TEGOVI_VISGSTY, TEGOVI_LOGOVY, TEGOVI_DOGADDEN structure od table tagovi : id - name < P> The structure of the table is tagovi_vijesti : id - vijesti_id - tag_id The same is for the other two tables. On the main page, I display the tags from all the three tables like this: $ sql = "SELECT T.ID as id, T.name as tag, TV.id as tag_vijest_id, TD.id AS Tag_dogadjan_id, TB.ID AS tag_ballag_ID, Tag (blog) as taggate (adt left job) T.V.V.V.V. TV on TV as TV_vijesti, excluding TAG_ID, taggi_dogadjya TD on T.ID = TD.T.G.ID Left Join Tagoavi_BlogVi TB on T.id = TB.tag_id WHERE There is no zero group in the id order by TV.ID IID DESC limit 5 "; $ Sql_result = mysql_query ($ sql, $ connect) or die ("uptiz ignorance"); While ($ row = mysql_fetch_array ($ sql_result)) {$ tag_id = $ line ["id"]; $ Tag_url = $ line ["tag"]; $ Tag = preg_replace ('/ - /', '', $ tag_url); $ Tag_ponav

c# - Passing a single item as IEnumerable<T> -

Is there a way to expect one type of T one method ? IEnumerable & lt; T & gt; parameter? Language C # is Framework version 2.0. Currently I am using an accessory method (this is .Net 2.0, so I have a whole group of casting / project supporting methods similar to LINQ), but it seems silly only: Public Stable Class IEnumerableExt {// Usage: IEnumerableExt.FromSingleItem (someObject); Public stable IEnumerable & lt; T & gt; From Signal Atom & lt; T & gt; (T items) {yield returns item; }} The other way is definitely a list & lt; T & gt; or Aare to create and populate IEnumerable & lt; T & gt; . [edit] It can be named as an extension method: public static class IEnumerableExt {// Usage: someObject.SingleItemAsEnumerable (); Public stable IEnumerable & lt; T & gt; SingalItemAmAmaryable & lt; T & gt; (It's T item) {yield returns item; }} Am I missing something here? [edit 2] We found someObject.ield

asp.net mvc - main purpose of using mvc -

Recently, there was some research / reading / reading in MVC and wondering what its main purpose was. Say something different than HTML as something like this < Li> Or to create clean url I can disappear completely, but asp.net forms actually separates logic from HTML and if you just want to clear url So why not use the mod_rewrite rule? Business logic ( m odd) code that follows all the cruel powers behind the scenes Works; Working with databases, doing big calculations; And User Interface Logic ( V iew) code that presents information to your users in a beautiful way. is for the C intranler - the ligaments binding to the bones of the model and the muscles of the model and they interact with each other Allow to communicate. You are right that 'normal' uses the ASP.x-back-up files so that the page can be kept separate from the markup code which generates that markup (as opposed to languages ​​like PHP, where The code is directly embedded

c++ - How to store TypeInfo -

वर्ग ए {} ए ए; Type_info info = टाइपिड (ए); // त्रुटि type_info निजी है मुझे कक्षाओं के प्रकार को संग्रहीत करने के लिए एक सूची सूची & lt; type_info & gt; चाहिए क्या कोई समाधान है? आप सीधे type_info वर्ग की वस्तुओं को इन्स्तांत नहीं कर सकते, क्योंकि कक्षा में केवल एक निजी प्रतिलिपि निर्माता चूंकि सूची की प्रतिलिपि कन्स्ट्रक्टर की आवश्यकता है ... यदि आपको वास्तव में इसकी आवश्यकता है, तो std :: list & lt; Type_info *>। मुझे नहीं पता कि आपको इस सूची की आवश्यकता क्यों है, लेकिन मैं एक वैकल्पिक डिज़ाइन पर विचार करूंगा, यदि संभव हो तो RTTI को शामिल न करें।

c++ - Qt: TableWidget's ItemAt() acting weirdly -

I am working on a Windows application, where in a dialog I ask for some data from postgres and manually output To show me A table widget. m_ui-> Table Widget-> Settokount (connected datatown ()); Each line {m_ui-> TableWidget- & gt; ITunes (); i ++); //; M_ui- for setItem (i, 0, new QTableWidgetItem (for data [i] .bobin.referenceNumber) (int i = 0; i & lt; Gt; Tableview-> Set item (i, 1, new QTableWidgetItem (QString :: number (associated data [i] .bobin.width)); M_ui- & gt; Table-Widget- & gt; set item ( I, 2, new QTableWidgetItem (QString :: number (linked data). Tolerance.getHole ()))); M_ui-> Tableview-> Set item (i, 3, new QTableWidgetItem (QString :: number (linked data). Tolerance.getLessThanZeroFive ()))); M_ui-> Tableview-> Set item (i, 4, new QTableWidgetItem (QString :: number (linked data). Tolerance.getZeroFive_to_zeroSeven ()))); M_ui-> Table Widget-> SetItem (i, 5, new QTableWidgetItem (QString :: number (linked data).

class - C# - To use Partial Classes, or Seperate Ones? -

संभव डुप्लिकेट: सबसे अच्छा अभ्यास और सबसे अच्छा प्रोग्रामिंग दृष्टिकोण, आंशिक कक्षाएं या व्यक्तिगत कक्षाएं किस तरह से है? केवल आंशिक उपयोग कक्षाएं जहां एकाधिक वर्गों में एक वर्ग के तर्क को अलग करने में स्पष्ट लाभ होता है। सबसे स्पष्ट उदाहरण यह है कि जहां कोड का कुछ हिस्सा ऑटोजैनरेट किया गया है - कोड जनरेटर को आमतौर पर आंशिक प्रकार के निर्माण के लिए, डेवलपर द्वारा संवर्धित करने की अनुमति देने के लिए आम तौर पर इसका निर्माण करना चाहिए। दो, यह महसूस करने के लिए कि कक्षाएं बाद की तरह कैसी दिखाई देगी। ये वास्तव में प्रमुख उपयोग के मामले हैं - मैं उनको उदारतापूर्वक प्रयोग नहीं करना शुरू करूँगा; यह काम करना कठिन बनाता है जहां सब कुछ है जाहिर है, अपवाद हैं ... उदाहरण के लिए, System.Linq.Enumerable क्लास में .NET 3.5 बड़ा होना चाहिए, और यह आंशिक प्रकारों को प्रबंधित करने योग्य फाइलों के साथ समाप्त करने के लिए समझदारी होगी। / P>

attach file to email using php -

I have an input on my form to allow me to browse at a file location. They can resume the application that is ready for submission. & lt; Label class = "description" for = "element_5" & gt; Upload a file & lt; / Labels & gt; & Lt; Div & gt; & Lt; Input id = "element_5" name = "element_5" class = "element file" type = "file" /> For some of my text fields and dropdowns I am using something with the lines of $ experince = $ _POST ["experince"]; But I do not want the path string that I want the acetol file. How can I get the file myself and how do I add it to e-mail Is there an easy way to limit the bonus to .doc / .pdf? I've done something like this recently. It's not trivial. Your email message must be multipart mime message. You can read it in your file, encode it (using base 64), then place it in the correct position in your email message string. It loo

regex - Java: How to replace all occurances of a character if and only if followed by some other character -

Specifically: I want to change all the events of a full stop. A full stop plus white space \. With the \ S if the full stop is immediately followed by an upper case letter [A-Z]. Any suggestions? Thanks yourstring.replaceAll ("\\. ([AZ])", "$ 1 ")

Problem using flex to read XML in e4x format from SOAP webservice -

UPDATE : समस्या नाम स्थान या फ्लेक्स पर बिल्कुल नहीं थी। मेरी webservice लिपटे xml लौट रहा था मैं जावा पर सवाल करने से पहले उस भाषा को दोष दे रहा था जिसका मुझे कम से कम अनुभव था ... मेरे पास एक बुनियादी साबुन वेबसाइर्ब है जो मुझे फ्लेक्स से परिणाम को पढ़ने में परेशानी हो रही है। मैं एक ठोस जावा प्रोग्रामर हूँ और सिर्फ एडोब फ्लेक्स के आसपास मेरे सिर को प्राप्त करने की कोशिश कर रहा हूं। मुझे "वेबसर्विज" का उपयोग करने के लिए परिणाम को e4x प्रारूप में वापस करने में सक्षम होना चाहिए। & lt; mx: वेबसर्विज आईडी = "वर्तमानलेयरर्सडब्ल्यूएस" wsdl = "http: // localhost: 8080 / myproject / ws / myservice.wsdl" showBusyCursor = "true" परिणाम = "अद्यतन चयन (घटना)" गलती = "अलर्ट। शो (event.fault.faultString), 'त्रुटि'" & gt; & Lt; mx: ऑपरेशन का नाम = "प्रकाशक" परिणामस्वरूप = "e4x" & gt; & LT; mx: अनुरोध & gt; & LT; publisherRequest & gt; & LT; getConfiguration / &

objective c - Is this the right way for a block inside a struct to access a member variable in the same struct? -

I am experimenting with Obj-C blocks and am trying to do a straight with two blocks in it Changing a block is what the second block does. This is an ideal way to do something simple ... and there can be better ways to do this, but exercise means to understand the blocks. I here is the code, it does not work , So do I not remember / understand and / or am doing wrong? // Calculate my math operation options so that I can understand a bit more ... 0, 1, 2, etc. Also makes adding operation is easy because opTypeTotal // Before 1, the index of its operation will be Type-F Amem {opTypeAdd = 0, opTypeSubtract = 1, opTypeTotal} opType; // Not sure if (struct someMathStruct) * is correct, maybe wrong / / some MathStart has to pass an indicator, but the compiler // will not know about its existence for some lines after it ... Typedef (zero) (^ changeblocks) (optip, (straight some mathstrext) *); Type-F (zero) (^ math block) (int, int, int *); // Grab two blocks, then some mathstreck on

ios - UIViewController viewDidLoad vs. viewWillAppear: What is the proper division of labor? -

I have always been a bit unclear on the type of tasks that should be assigned vs. viewDidLoad . View ViewApps : In a UIViewController subclass For example, I'm doing an app where I have a UIViewController sub-class is killing a server, getting data, feeding it to see And then displays that scene. viewDidLoad versus viewWillAppear ? See that the load once has to be done whenever the scene is visible Let's see it every time to see it. You should do things you want to do to see only once - like setting up your ULL texts, however, to see the user every time you want to modify a specific part of the scene, eg Whenever you go to the "Play now playing" scene, the iPod app scrolls back to the top. However, when you are loading things from a server, you will have to think about the delay if you pack all of your network communications in the ViewDidoadload or View option, before the user can view them Will be executed - potentially a small freeze of your

recursion - Java recursive binary tree -

Welcome! I have a recursive public static method, which is a tree node (a basic binary tree, not actually a search tree) and takes an integer parameter if all the values ​​in the paste are less than the integer. So, I will use a public square TN {public entrant value; Public Tien left, right; Public Tien (Int V, TN L, TN R) {value = v; Left = l; Therefore, my method will look like this: Public stable boolean low (TnS, int to find) {if (S == empty) back Is correct; And (if (S.Viewell and Lieutenant; = Towfind) returns the lower (S. left, tofind) and amp; less (S. Right, Toofid); // Right here I return the truth? Or do I remember anyhow I have to make a recursive false return again;} I was thinking that it was right or did I forget something ??? do I have to return true and false ?? short return (s, tofind); Should be: short return (S.B. I, dofind) & amp; amp; amp; amp; amp; amp; amp; amp; short (as well, tofid); I do not know why the function is static. As

c# - Convert.ToDateTime causes FormatException on afternoon date/time values -

We have a format that returns the date / time value in the following format: 2009-10-10 09: 19: 12.124 2009-10-10 12:13:13 14.852 2009-10-10 13:00:00 2009-10-10 15:23 23: 32.022 A special server failed to parse all suddenly (today) at 13:00 or later. This special customer has five servers and there is only one problem. We have dozens more customers with hundreds of servers without the problem. System.FormatException: The string was not valid as valid date time on System.DateTimeParse.Parse (String s, DateTimeFormatInfo dtfi, DateTimeStyles style) on System.DateTime.Parse (string S , IFormatProvider provider) on the system. Convert ToDateTime (string value, IFormatProvider provider) on System.String.System.Conconvertible on system. Determined Time (IFormatProvider Provider) Convert Tudentime (object value) I played a test using date time. Purse (S., Culture Info. Contentculture) works with Datetime. Pars (S, CultureInfo.InvariantCulture) and the problem only appears with Cu

javascript - Is there the difference in JS execution in IE6 andIE7 -

लगता है कि यह है संक्षिप्त उत्तर, हाँ। सूक्ष्म बारीकियों और कार्यान्वयन अंतर हैं आप जिन मुद्दों पर चल रहे हैं वे क्या हैं?

When is the size of the database call more expensive than the frequency of calls? -

Can anyone give me a relative idea when trying to hit the database several times to capture the small query results? Understand the large number of rows and raising questions on it? For example, if I return 2,000 results and then I have additional questions on those results that take 10-20 items, would it be better to cache the results of 2000 or 10 or 20 Will every time the database hit each set of results? Other answers are correct here - RDBMS and your data are important factors. However, another important factor is that it is the most important factor in the process of using this type of data. DataSet and subkeys on it as it turns, keep that data up to date and Choosing subsets has really slow motion in leaving the data in the database. So my advice is: This is the easiest way, first see the profile and see if you have to adapt to the display.

oop - God object - decrease coupling to a 'master' object -

I have an object called parameter, which is methodically thrown down from the method and at the top of the call tree, into package boundaries is. It is about fifty state variables, each method can use one or two variables to control its output. I think this is a bad idea, it is possible that I can not easily see which method is needed, or what might be with it, some combination of parameters for module U That is completely unrelated to my current module. What are some good techniques for reducing the coupling of this god object, or are it ideally destroyed? Public Zero ExporterExcelParFonds (ParametresExecution parametres) {ApplicationExcel appExcel = null; LogTool.Instance.ExceptionSoulevee = false; Bowl wrapper reference = parametres.inclureReferences; Bull embrace = parametres.inclureBornes; Date Date Date Debut = parametres.date; Date time datefin = parametres.dateFin; Try {LogTool.Instance.AfficherMessage (Variables.msg_GenerationRapportPortefeuilleReference); Bool fich

html - How can I avoid iphone safari first letter in caps -

I am preparing a small webpage targeted for an iPhone / iPod touch. I have a form for which the user Requires to enter. When you tap on related fields, the iPhone will automatically set the first letter to the capitals. Is there any way to avoid this? I want the whole area to be put in small caps. thanks Edit: instead of "none" Use on your webpage, you only have to set the AutoCapitrated property for your input field. Therefore: & lt; Input autocapitalize = "none" & gt; Below and Below are the answers given to anyone who is looking for the answer that is related to the original app. From the UITextField The appearance of the keyboard can be customized using the properties provided by the UITXTI InjectTract Protocol. Text field objects apply this protocol and it defines properties that support. You can use these properties to specify keyboard type (ASCII, number, url, email, and other) to display. You can also configure the basic text en

iphone - Rotating UIView - willRotateToInterfaceOrientation not being called -

I am trying to autorotate a scene and I have explained the same problem here. < P> Even though I have implemented shouldAutorotateToInterfaceOrientation and implemented in each UIViewController subclass; willRotateToInterfaceOrientation is not being called. Perhaps someone can tell me what I'm missing. I have the following visual controller structure (I hope it is quite clear ..): Navigation controller (programmatic) - root & gt; TabBarController (Programmatic) - with tab item & gt; Navigation Controller (Programmatic) - Basic & gt; UITableViewController (a subclass) - Navigator deployed for controller & gt; UIViewController (a subclass). I hope someone can help me in advance thanks! You can try inserting your controller (navigation controller) in the window by the root view controller. If not working for you, use the notifications UIApplicationWillChangeStatusBarOrientationNotification edit Works: // custom controller TestCo

asp.net mvc - JQuery File upload dialog not returning back to dialog from MVC Controller action -

I have an ASP.NET MVC app that uses a jquery UI dialog for file upload. Everything is working fine with loading the dialog with the right content and displaying the dialog on my click event, though my problem is that when I process the action in my controlling method, I do not return to my dialogue because I expect an AJAX call like to behave. My dialogue is a form whose "method = post" I believe it is When I post the form I do not have a reference to the dialog when I remove "method = post" from my form tag, then I did not get 404 on my controller action. I would say that the work I want to accomplish is I have tried many ways to do this, but each method has not worked for one reason or another. Basically I tried the $ (post) method to urge my controller action but I found out that the request Files were not set when I tried to process my controller action, I tried to use Html.BeginForm instead of HTML, but I did not try to return to the dialogue on the same is

javascript - Search For Words, Replace With Links -

मेरे पास इस तरह एक सरणी है var शब्द = [{शब्द: 'कुछ' , लिंक: 'http://www.something.com'}, {शब्द: 'कुछ कुछ', लिंक: 'http://www.something.com/else'}]; मैं इसे शब्द के लिए पेज खोजना चाहता हूं और उसे लिंक के साथ बदलना चाहता हूं क्या ऐसा करने का एक प्रभावशाली तरीका है? ऐसा लगता है कि यह सीपीयू भूखा हो सकता है। क्षमा करें और अधिक exlained होना चाहिए ... यह वर्ग के साथ प्रत्येक तत्व खोज करेगा। उदाहरण के लिए संदेश। तब उसमें सभी शब्द ढूंढें। इस सरणी के भीतर कुछ सौ भी हो सकता है एक अच्छी रणनीति है: 1) किसी ऑब्जेक्ट का निर्माण करें जिसके चाबियाँ बदलने के लिए वाक्यांश हैं और जिनके मूल्य उनके साथ बदलने के लिए लिंक हैं। 2) ऐसा करने से, नियमित अभिव्यक्ति का निर्माण कर सकते हैं जो कि किसी भी चाबियाँ से मेल खा सकता है, फिर 3) उस रैगेक्स को विश्व स्तर पर बदलें। किसी न किसी उदाहरण: < कोड> var प्रतिस्थापन डीआईसीटी = {'एफू': 'http://www.foo.com/', 'bar': 'http://www.bar.net/'}; Var theRegex = / \ b (foo | बा

python - Possible Data Schemes for Achievements on Google App Engine -

I am creating a flash game website using Google App Engine. I am making achievements on this, and it is scratched on my head how to store this data. I have a (non-google) user model. I should know how to store each kind of achievement (name, description, picture) as well as linking them with the users who earn them. Also, I need to keep an eye on him, when he has earned it, as well as his present progress for those who have not yet. If someone wants to suggest tips about other work experience related to achievement or other achievements. Edit: Non-Google User Model: Class BeardUser (db.Model): Email = Db.StringProperty () user name = db.StringProperty () password = db.StringProperty () settings = db.ReferenceProperty (UserSettings) is_admin = db.BooleanProperty () user_role = db.StringProperty (default = "user") datetime = db Unless your users are dynamically adding achievements (such as / in some cases like Konggate where users can upload their own games), you

python - google wave OnBlipSubmitted -

I am trying to create a wave robot, and I have basic material working. I am trying to create a new blip with help text when giving some kind of @ support, but for some reason it is not about to make it. I have not found any errors in the log console, and I have a 'log in' log Looking at the information log in def OnBlipSubmitted (property, context): Receive #Blip which was submitted now. Blip = context.GetBlipById (Properties ['blipId']) text = blip.GetDocument (). GetText () if text.startswith ('@ help') == true: logging.info ('in @help') Blip SetBild () GetDocument () SetText ('help text') If it just started working, my There are two suggestions ... -> Are you updating the robot version in the constructor? You should change the prices when updating the changes so that the cache can be updated. If __name__ == '__main__': myRobot = robot.Robot ('waverobotdev', image_url = baseurl + 'Assets / Ripple_pot_kur

c# - Linq Arithemetic Operator combinations -

नीचे दिए गए कार्य को हल करने का प्रयास करते समय: अंकगणित ऑपरेटरों का उपयोग करना ( +, -, *, /) 4 से पांचवें संख्या को 1 से 10 के बराबर पुनर्व्यवस्थित करें। उदाहरण: 5/5 + 5-5 = 1, 5/5 + 5/5 = 2 मैंने Linq का उपयोग किए बिना सी # में कोशिश की (मुझे नहीं पता कि आगे कैसे आगे बढ़ना है) सार्वजनिक शून्य GetDetails () {char [] sym = new char [] {'+', '-', '/', '*'}; Int [] एओएफ 5 = नया इंट [] (5, 5, 5, 5}; (For int i = 0; i & lt; 4; i ++) {for (int j = 0; j & lt; 4; j ++) {के लिए (int k = 0; k & lt; 4; k ++) {for (int l = 0; एल एंड एलटी; 4; एल ++) {इंट का परिणाम 1 = एओएफ 5 [0] + सिम [आई] + एओएफ 5 [1] + सीएमएम [जे] + एओएफ 5 [2] + सीएमएम [के] + एओएफ 5 [3]; Int परिणाम 2 = एओएफ 5 [0] + सिम [आई] + एओएफ 5 [1] + एसएमएम [जे] + एओएफ 5 [2] + सीएमएम [एल] + एओएफ 5 [3]; इंट परिणाम 3 = एओएफ 5 [0] + सिम [आई] + एओएफ 5 [1] + एसएमएम [के] + एओएफ 5 [2] + सीएमएम [एल] + एओएफ 5 [3]; .... ....}}}} } मैं इसे बिना linq और linq का उपयोग करने में असमर्थ ह

How to implement monkey patch in C++? -

क्या सी ++ में बंदर पैचिंग लागू करना संभव है? धन्यवाद। पोर्टेबल नहीं तो, और बड़ी परियोजनाओं के खतरों की वजह से आपके पास बेहतर कारण हो सकता है। प्रीप्रोसेसर संभवतः सबसे अच्छा उम्मीदवार है, इसकी वजह से भाषा की अज्ञानता ही है यह विशेषताओं, विधियों और अन्य प्रतीक नामों का नाम बदलने के लिए इस्तेमाल किया जा सकता है - लेकिन प्रतिस्थापन कम से कम एक एकल #include या कोड के अनुक्रम के लिए वैश्विक है मैंने "लायब्रेरी हीरे" को जमा करने में पहले प्रयोग किया है - लाइब्रेरी ए और बी दोनों एक ओएस पुस्तकालय एस आयात करते हैं, लेकिन अलग-अलग तरीकों से एस के कुछ चिन्हों को समान रूप से नामित किया जाता है लेकिन अलग-अलग। (नामस्थान सवाल से बाहर थे, क्योंकि उनके पास बहुत अधिक दूरगामी परिणाम होंगे)। समानांतर, आप संगत-लेकिन-श्रेष्ठ वर्गों के साथ प्रतीक नामों को बदल सकते हैं। जैसे वीसी में, #import टाइप एडेप्टर के रूप में _bstr_t का उपयोग करने वाली एक आयात लाइब्रेरी बनाता है एक परियोजना में मैंने सफलतापूर्वक इन _bstr_t को एक संगत-पर्याप्त वर्ग के साथ उपयोग किया है जो अन्य कोड के साथ

c# - DllNotFoundException while trying to "fix" LuaInterface, but why? -

Since my game, which I really want to be mono-worthy, does not seem to run under Linux because LuaInterface Shock (for more information on that), I have decided what suggestions have been given there. For example, [DllImport ("I" Lua51 ")] Public Static Extern IntPtr luaL_newstate (); Edit LuaInterface.dll (which now hosts its Lua511.LuaDLL) and is a pure, native Win32 lua51.dll in the startup folder of my game, when I get a DllNotFound exception in some way LuaInterface attempts to start: public lu () {luaState = LuaDLL.luaL_newstate (); // OK, okay then ... Absolutely, with DLL, okay, should not do this? Aj Instead, the net version of Lua51.dll returns an EntryPointNotFoundException instead. The relevant source code:, it was removed in the LuaInterface project, then the reference was removed, so that It should be changed. > Edit: This screw, I am looking for alternatives. Or roll your own or stop worrying about Linux compatibility. You are re

Preserving original StackTrace/LineNumbers in .NET Exceptions -

पूर्व और फेंक के बीच के अंतर को समझना, क्यों मूल स्टैकट्रेस इस उदाहरण में संरक्षित है: स्थिर शून्य मुख्य (स्ट्रिंग [] आर्ग्स) {try {LongFaultyMethod ()} } पकड़ (System.Exception पूर्व) {Console.WriteLine (ex.StackTrace); }} स्थिर शून्य LongFaultyMethod () {{int x = 20; SomethingThatThrowsException (x); } पकड़ (अपवाद) {फेंक; }} स्थिर शून्य कुछ ऐसा कुछ है जो त्रिभुज अपवाद (int x) {int y = x / (x - x); } लेकिन इस में नहीं: स्थिर शून्य मुख्य (स्ट्रिंग [] आर्ग्स) {try {LongFaultyMethod ()} } पकड़ (System.Exception पूर्व) {Console.WriteLine (ex.StackTrace); }} स्थिर शून्य LongFaultyMethod () {{int x = 20; Int y = x / (x - 20); } पकड़ (अपवाद) {फेंक; }} दूसरा परिदृश्य, पूर्व के रूप में एक ही उत्पादन का उत्पादन करेगा? दोनों ही मामलों में, एक लाइन संख्या को देखने की उम्मीद है जहां y आरंभ किया जाता है। < P> मुझे यकीन नहीं है कि यह सीमा सी # भाषा, सीएलआई, या इनके माइक्रोसॉफ्ट कार्यान्वयन के भीतर है, लेकिन आपका दूसरा उदाहरण एक ऐसा मामला है जहां अपवाद के लिए एक स्प

Help converting this piece of code from jQuery to plain javascript -

My website is trying to add dynamic limitations to the top, left, and right ... the pages on my site are dynamic. .. that they change ... I need a script that optimizes a div on the web page ... Does anyone know this? I've got this script from some guy on this forum, but I'm trying to avoid jquery (not ask) ... & lt; P class = "bgr" & gt; Content content content & lt; / P & gt; & Lt; Script type = "text / javascript" & gt; $ ('.bgr'). Each (function (I, L) {$ ('' ). Height ($ (this). Light () + 'px'). AppendTo ($ (this) ); // Top, Right and Bottom;}; & lt; / Script & gt; Calculating the dimensions in a cross-browser fashion (you're doing as altitude) ( < / Pre> fitting and setting) is an incredibly difficult task in plain JavaScript, this is the reason that, other reasons In, why libraries like jQuery make up in the first place I advise you strongly no without any framework

sql server - How to make tasks double-checked (the way how to store it in the DB)? -

I have a DB that stores different types of functions and more items in different tables. In many of these tables (which differ from their structure) I have one way to do this, that the item has to be checked twice, which means that the item can not be "saved" (I mean it definitely Each table should have a column called "IsConfirmed", then when that person wants to confirm all things, the program runs through all the tables and a list of those items Makes ones che Not used. The table should be the third table holding the name and the ID of the line which should be confirmed. I hope that you have a better idea than two subdivisions. Is this really a double-confirmed status for a single entity? Or can it be rejected and need to go through the confirmation again? In the latter case, should you keep all this history? Do you need to keep track of every time you confirm (for example, you do not have both people confirming)? Simple case: Add optional t

rails paperclip batch processing -

How can I use a clipboard to upload to the server using FTP, create thumbnails and then all of it Move to Away? There is no problem using the paperclip as part of the uploading process, and taking files as AAS as part of the process is not a big problem, but I have a paperclip You can use some kind of croon and rack in completely certain types of Tasks: yourtask = & gt; : Environment . If you are trying to do this in a manner that does not touch any database, you may need to create your paperclip :: attachment instance and work with them directly to their incidents (I I'm not completely expert about how you do this.) Perhaps you can tell it in detail what you want and which solutions you will not find .

php - can $_FILES superglobal be accessible in class -

Does anyone have experience with it I wanted to use $ _files in my class < / P> like $ uploadfile = $ _FILES ['file']; But then the errors of the script I thought that a superglobe is accessible anywhere thanks, Richard Yes, $ _ files is a super global, which means that it is accessible from every scope. It is set only if the request actually contains a multipart / form-data body.

python - Using multiprocessing pool of workers -

I have the following code written for my lazy CPU core work. Originally code gets the desired "marine" files in the directory hierarchy, and in order to process these binary "sea" files, 50 to 100 text and binary files are produced in order to execute external scripts. is. As the title of the question gives an equally suggestive way to increase the speed of processing. This question arises from the discussion for a long time that we keep the title as "" in the list of IPython users. Starting with its use on parallel processing functions of IPython The issue is that I am unable to run this code correctly. If there are only "Sea" files in folders containing "sea" files, then the script completely eliminates its execution without the external script runs. (I have 30-50 external scripts to run, but only after executing the first script in these multi-script series my script was extracted from the multiprocessing script.) Interesting

Is it possible to to re-initialize an object in cocos2d -

I have a sprite pest child. I have made an example of that class in GameLayer and then start it with it using Insect * bgg = [Insect spriteWithFile: @ "bird2a. Gif "]; Then I set a timer (10 seconds) * bgg = [Insect refrigerated file: @ "2.gif"]; But my program crashes. Now my question is possible I have another question, when I - (BOOL) CCT UsageBaggan: (NSAT *) is used with the event: (UIEvent *) Event { UITouch * touch = [touches anyObject] CG point point 2 = [Touch space Iniview: [Touch View]] CGP Cpoint = [[Directors Share Director] Convert Condanet: point 2]; NSLog (@ "started in contact"); } In my pest class it can detect the touch on the 'bgg' object declared in the GameLayer. But when I used this function in GameLayer Advanced thanx for your answer Your program crashes because you have a typo '*' with '* bgg' Remove it means that you are defending the pointer, then you are trying to ma

c# - Design Windows Forms -

How do I start learning Windows Form Designing? For example: Microsoft Zune Player, Button, Form and etc. I am developing in C #. Thank you all, Amit if I was going to write and write something like Zune software, then I would start with WPF instead of Windows Form. See some of the good examples of "experience-driven" applications. You can learn to read or read.

c# - WPF: Execute a Command Binding in a search field when pressing the enter button -

I have a search field with a search button in which a command is binding. It works great, but if I enter the keyboard, how can I use the same command binding for text fields? The examples I have seen are using all the code with the KeyDown event handler, is this a great way to build this task only with xaml and command binding? You can use the IsDefault property of the button: & Lt; Button command = "Search Command" ISDFault = "{Bidding Elementonym = Search Textbox, Path = Iskiboard Focus}" & gt; Search! & Lt; / Button & gt;

testing - Using different versions of a python library in the same process -

We've got a dragon library that we are developing. During development, I want to use parts of that library to test its new versions. That is, use static code to test the development code. Is there any way to do this in dragon? Edit: To be more specific, we have got a library (Libya) in which there are many useful things, apart from this, we have a testing library which has some testing facilities (Liberty) to use LibA. We want to test LibT using LibT, but LibT depends on LibA, so we use a stable version of LibA, while LibT tests (because we will only convert LibT to new test as well ). Therefore, when the unit test is going on, LibA-dev testing will use Liberty code which depends on LibA-Stable. We have come up with an idea that is calling a steady code on a different process using RPYC, but it is difficult to implement in a tightly-airy manner (make sure it is properly Etc. dies, and allows many examples to execute on the same computer at the same time). Thanks &q

Polymorphism (not) broken with visitor pattern in C# (and new instead of override) -

मेरे पास निम्न कोड है: वर्ग आगंतुक {आंतरिक वर्चुअल शून्य जाएँ (नोड n ) {}} वर्ग आगंतुक विशेष: आगंतुक {नोड एन} {}} वर्ग आधार {आंतरिक वर्चुअल शून्य स्वीकार (विज़िटर वी) {} आंतरिक वर्चुअल शून्य स्वीकार करें (विज़िटरविशेष v) {}} वर्ग नोड: बेस {आंतरिक ओवरराइड शून्य स्वीकार करें (विज़िटर v) {v.Visit (this); } आंतरिक ओवरराइड शून्य स्वीकार करें (विज़िटर विशेष v) {v.Visit (this); }} क्या कोई कारण है कि स्वीकार करें (विज़िटर v) पद्धति को चुना जाएगा जब new node () को कॉल करता है। स्वीकार करें (नया विज़िटर विशेष ( )) अपडेट: ठीक है, मेरी बुरी, मुझे एहसास हुआ कि मैं ओवरराइड के बजाय आगंतुक में "नया" का प्रयोग कर रहा था। अब मुझे पता है क्यों "नया विघटन बहुरूपता" यह मेरे प्रश्न को पूरी तरह बेवकूफ बना देता है मदद के लिए धन्यवाद। मुझे लगता है कि आप एक विशिष्ट भाषा (सी #?) के लिए सवाल पूछते हैं। तर्कसंगतता के अनुसार यह सबसे उपयुक्त अधिभार चुनने के लिए भाषा पर है (ध्यान दें: ओवरराइड नहीं!) यह फ़ंक्शन लुकअप के प्रकार पर निर्भर करता है जो इसका उपयोग करता है: स्थिर (

HTML / JSP Visual Design Editor -

Is there a graphical design tool for JSF pages (such as ASPX NF Environment) for HTML / JSP pages? Yes, excluding visual JSF inside an IDE such as Netbeen can be what you're talking about Are there. This tutorial lets you visit the Whirlwind of Visual Web JSF Application Development in NetBusiness IDE 6.5. The tutorial shows you how to use the visual web JSF functionality and Java Server 1.2 (Woodstock) components to meet specific steps of web web application development. This tutorial has been created so that you do not need to go through it, in a particular order, you want to skip it quickly and then return to each section.

php - cakephp habtm relationship (saving data) -

The questions related to HABTm have been posted to the stack overflow, but I still find the solution to my problem I am here. / P> I am creating an application that allows for the creation of topics based on a particular subcategory. When adding a topic, the user is asked for the tag (on the same form) Now when the user has added the tags in the subject, clicking on the add button has successfully added the subject but have no tags. I have both the subject and tags for tbl_tags_topics (as defined in the KPPP conventions) and both models of themes and tags have properly defined the 'The Andalong Tomami' array. What action am I taking? I have another question related to this but I will post it when I will send a database related to a subject successfully. (Functionality is similar to linking and enclosing Stoxhofflow tags) Any help is greatly appreciated. If you have found anyone, then tell me about any good tutorials on HABT. Thanks When you save a field

debugging Flex ActionScript singleton -

When I step through the code in the Flex debugger, and enter my singular class, "this" variable Appears in the window can not be expanded. How do you observe the "this" variable? Right clicking and adding will let you see some of them

sql - MySQL dot-traversal... possible? -

So I'm working on a CMS that will allow users to "transfer" via the database tables. Although I have some difficulty in implementing it, and am wondering if there is any suggestion Table: Home name (varchar), city (using relation, rel table) Table: City name (varchar) Table of contents (relation using Reliance Energy Table) Table: State Name (varchar) Table: rel id1, id2, rel_type The following example shows the intended use. It reads, "Find 10 homes within the state of Alaska, ordered by name". & lt ;? Php $ record = new Pod ('house'); $ Record-> FindRecord ('ASC Name', 10, 'town.state.name =' Alaska ''); ? & Gt; As a side note, I can easily find homes inside the city's name because MySQL supports [table] [dot] [column_name]: & lt; Php $ record = new pod ('home'); $ Record- & gt; Search Line ("Name ASC", 10, "Town. Name = 'Great Falls'');? & Gt; I al

UiTextView doesn't display text on iphone os 2.0 -

When I'm using an iPhone OS 3.0, my text shows the text - but for some reason it's text on the OS Will not show 2.0 I can get input text on OS 2.0 and save it as well in the file, and then I can restore the text, but still the text does not appear on OS 2.0. I have tried to change scrolling properties and font and color and hidden property - anyone knows what it is? Thank you- free Answering your question: I added my text view to see a button - so I It has changed it and now I'm adding it to a uiView. I think the old OS 2.0 has a different way of displaying a text field at the top of a button.

c# - Windows memory and page file usage -

Can someone explain to me why the minimum application of windows reduces memory usage? For example, I show Visual Studio 800 megapixels memory usage in Task Manager, then I reduce the Visual Studio app window and memory usage now shows only 50 MB of Task Manager. It seems that all the Windorfs are in the apples. to: Whether the task manager shows up as a memory usage of an application Actually, its functioning set is when Windows decreases, then Windows trim any work set, which is why this figure goes down. The working set is not a true representation of how an app is using. In Windows Vista, Microsoft will show private bytes instead of Task Manager (which is a more useful figure), so this phenomenon does not happen anymore.

xml - Unable to make request using SOAP to a webservice -

My requirement is that I will have SOAP data in XML. I will read from the file, and then send the request for a webservice. So, I have to write a file answer. I'm using vs. 2005 XmlDocument doc = New XmlDocument (); Doc.Load (@ "Path xml file"); HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.w3schools.com/webservices/tempconvert.asmx"); Req.Headers.Add ("SOAPAction", "\" \ ""); Req.ContentType = "text / xml; charset = \" utf-8 \ ""; Req.Accept = "text / xml"; Req.method = "POST"; Stream STM = req.GetRequestStream (); Doc.Save (STM); Stm.Close (); WebResponse resp = req.GetResponse (); Stm = resp.GetResponseStream (); Streamerdinder r = new streamrider (STM); Console.WriteLine (r.ReadToEnd ()); You have not really told what problem you faced, what you expected to happen What were they doing and actually? Anyway, it seems that the web service you are trying t

C : Problem with Jagged Arrays -

मेरे पास निम्न कोड है: int * किनारों [500]; Char arr [] = {'c', 'd'}; किनार [0] = आर्म; Printf ("% c -% c", किनारों [0] [0], किनारों [0] [1]); मुझे जो प्रदर्शित करना चाहते हैं वह है c-d लेकिन जो वास्तव में प्रदर्शित किया जा रहा है वह है c - ताकि आप कर सकते हैं ऊपर देखें, पहला तत्व प्रदर्शित किया जा रहा है, लेकिन दूसरा नहीं। क्यों प्रदर्शित नहीं किया जा रहा ऐरे का दूसरा तत्व? चूंकि एक int और char के विभिन्न आकार हैं, आपको कोशिश करनी होगी char * किनारों [500 ]

c# - Contains() method of List<T> -

In short, which methods in a class list & lt; T & gt; To operate of I have overloaded == in my class but it has no effect. This will only call equals () - all that override (Or not, if you are happy with reference identification comparison) if type iequatable & lt; T & gt; , then that implementation will be used in the priority of the normal identical . Specifically, for documentation from: This method determines the similarity using the default similarity comparison equality compass (t). The default for T , type of values ​​in the list. and from: defaults checks for the property to implement what type T Is System The IEquatable (T) normal interface and if this happens, then a equity compairer (t) which uses the implementation otherwise it is a equity compartment (t) < / Code> that uses the object. T provided by AVWOLS and Object.GetHashCode . I do not believe it will use it at GetHashCode at all.

javascript - Problem printing contents of Canvas tag (Chrome, Opera) -

These browsers (Windows versions) print a web page, which has a canvas overlay on the IMG tag image: / P> IE 6, IE7, IE8, Firefox, Safari but Chrome (as an up-to-date I version 3.0.195.27 Type) and Opera (as I do this version type 10.0 build 1750). Chrome completely ignores canvas rendering, Opera renders the entire canvas as a white rectangle, obscuring the image behind it. I know that the canvas tag is new, and the printing web page is always Dixie how should I control it? Am I missing for not doing any work? Is there a "About to print" event that I can warn at least the user from javascript? Update: It seems that besides this, the combined image (an IMG overlaying canvas) is printed properly on my brother LaserJet, but not on my HP Inkjet.) Therefore the current position is that most browsers have been correctly printed in my inkjet, but chrome does not. Opera screw-up is on both printers. Is this all under printer drivers and how have different brow

testing - Are the any free windows emulators available to test web sites against an iPhone? -

I am looking to test some internal web applications against iPhone for iPhone emulation software. One of the examples is that the number is shown as the phone number link on the iPhone, which are some quirks with iPhone users, who want to recover, but I decide 99% of the time is wrong. Regularly this does not happen on Windows Safari. Safari's iPhone version is formatting issues with fonts and spacing on other Brocers except. The emulator should be free and work under Windows Tips: Blackbod IPhone Browser Simulator is a Windows Build embedded webkit within an iPhone-like shape. You can download it here

GWT UI testing tool -

Can anyone recommend a good device to test the GWT UI What about using Selenium & amp; Opinion is; WebDriver? Any hints and tips are welcome. Thank you, SD How and when to test various test strategies for GWT apps The basic idea to apply is to use Unit Testing when you are testing business logic, but you use Selenium for a specific end-to-end test, where you want to simulate user interaction. is.

configuration - Apache web-server config, what is redirecting me and how can I change it -

Background: I inherited a web server that files / var / www / html Servers are used to serve files to the server from the following locations: /var/www/html/alpha/index.php/var/www/html/bravo /index.php / var / www /html/charlie/index.php You can use these sites from the web: http: //apples.mysite.edu/ Alpha http://apples.mysite.edu/bravo http://apples.mysite.edu/charlie http://apples.mysite.edu/drupal & lt; - It was later added by someone Problem: Someone has moved to a Dopl Site Directory and now all other sites are inaccessible (404 I did not get it when I'm using HTTPFox) and being redirected to Drupal site means that my alpha, Bravo, Charlie website is not yet accessible. Question: How many different ways can this conflicts with server configurations due to this result? I need to check all the different ways so that I can fix it 1) and find out what to look for someone to try again. If we are talking about a standard apache2 installation, then

linux - How do I import environment settings into my Perl program? -

I have a script whose content simply exports a variable in Linux. export LD_LIBRARY_PATH = .... I want to run this script in my Perl script so that anyone who is running my Perl script is < Code> LD_LIBRARY_PATH will be set. Can I do this at the beginning of my Perl script? #! / Usr / bin / perl -w system ("/myfolder1/myfolder2/myScript.sh"); #! / Bin / sh /myfolder1/myfolder2/myScript.sh exec perl -wxS "$ 0" "$ @" #! / Usr / bin / perl -w #. Normal as your script When you run it, it will first be executed by / bin / sh , Which is capable of loading myScript.sh in the local environment. sh then exec s pell, which is said to continue from the following line.

Sourcing multiple xml docs from single xslt -

I'm trying this and it can not seem to work. Someone can see me and can see that I am not very clear. I am referring to such additional doctors in test.xsl. & lt; Xsl: value-selection = "document ('/ customer service / library / test / test 1.xml') / resource / resource / name" /> This is the XML test1.xml. & lt; Resources & gt; & Lt; Resources & gt; & Lt; Name & gt; Configuration & lt; / Name & gt; & Lt; / Resources & gt; & Lt; / Resources & gt; This is the slice call in my ASP page index.aspx. MM.XSLTransform = new MM.XSLTransform () Mm_xsl.setXML (Server.MapPath ("/ customercare / library / test / test2.xml") as & lt;% dimmm_xsl ) Mm_xsl.setXSL (Server MapPath ("/ customercare / library / test / test.xsl")) Response.write (mm_xsl conversion ())% & gt; I am architecting a site that has several hundred products. I would like a XML doctor who has high level de

shell - Iterating through a range of ints in ksh? -

How can I be repeated through a simple category for loops in KS? For example, my script currently does this ... In 1 2 3 4 5 6 7 do # in the code ... but I want to expand the range of range above D7. Is there any better syntax? curly bracket? i in {1..7} do # stuffed

delphi - Display progress from time consuming process -

Sorry for my bad english ... Using Delphi 7 I want to create a dialogue window to show this That something happening in me is the application when I have to run slow procedures. I had something to do which I could use in this way: Start with TMyDialog.Create / Call the time-lapse method here; End; When I make dialogue, a window will appear with animation or something and the time consuming method will disappear after the completion (on free method) - If manually Please update progress with that dialogue, in such cases when the process gives me such information: start with TMyDialog.Create while starting time_consuming_method UpdateStatusOnMyDyalog (); End; Free; End; But generally it will be an animation only to show that something is happening. Has anyone done something like that, knows a component or has a suggestion about it, is the best way to do it in the most clean and simple way? The bad but easy way to do this is to call the application. Processing messa

sql - Two left joins and one query to MySQL performance problem -

I am preparing a project for quizzes and quizzes results. So I have two tables: quizz_race and quiz. ID is the primary key of the quiz and quizz_result is the foreign key for foreign identity quizz_id. The question below is designed to order the date with public information: If the current user (683735) had made this quiz a valid result (> 0) and how many people did this point In time till this question filled up. So I did this simple query with two left joining: Select one. *, COUNT (countt.QUIZZ_ID) from a SUMFILL join a left quizz_result countt on countt.QUIZZ_ID = a.ID on the group by a.ID and and quizzed indexes added to these columns: < ID, (id, date), public, (public, DATE) and on quizz_result: , (QUIZZ_ID, USER_ID), QUIZZ_ID, USER_ID, (QUIZZ_ID, QUIZZ_RESULT_ID) But even when I query, it looks like about a minute. And I have only 34k rows in the Quasiz table and 120 queues in the quiz table. When I clarify on this query, I get: SELECT TYPE: Sim

Creating a Windows Forms Control (C++) -

Trying to run on MSDN In the step 1 of the part " a custom To add an asset to a control "We place the ClickAnywhere code in the public section of class. The first error: " error C2144: syntax error: must be before 'bool' ';' " Is this syntax correct in C ++? (See below) (delete the ClickAnywhere part of the code, it is compiled properly ...) #pragma once using the namespace system; Namespace system :: using the component model; Using the namespace system: archive; Using Namespace System :: Window :: Form; Namespace system :: Using data; Namespace System :: Using Drawing; Namespace ClickContent {/// & lt; Summary & gt; ClickcounterControl /// & lt; / Summary & gt; For /// Summary ///// Warning: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// All .resx This class depends on the files associated with it but it depends

Java Internationalization -

I have a Java string that is having trouble bothering me I have a string, which is the value of (A Chinese character that I randomly chose, I do not speak sugar). If I call string t = new string (s.getBytes ()); If (s.equals (t)) System.out.println ("string unchanged"); Else System.out.println ("string changed"); Then I get string converting results. Does anyone know what's going on? Because: Encoding in the order of bytes, using the default charset of the platform If your default charset is the same as US-ASCII The only one bytes used by the letter will not be found I think an extra bit / byte can be added / dropspad in this process. Try to use