Posts

Showing posts from May, 2010

ruby - Set-up Many-to-Many in Rails with destroy allowed for only one of the many -

I am trying to prepare a very simple system, but the railroad way to do this is to save me. There should be two institutions, one user and one son, one condition has two users and the user has many bets. I want to make this condition to be a user so that it can be solved (in any form of update) or remove it . In my initial thinking, there are two ways for a user, one can be the best choice of many associations in the rail as a better response or, keeping in mind that who is the owner of the model. But, then you are repeating the User ID twice. Thank you in advance! I think you want this: class users I am (beta,: foreign_kys => gt; bettor_id ',: class_name = & gt;' bet ') - medium (: responses, alien_key =>; responder_id' ',: class_name = (Bettor ,: class_name = & gt; 'user')) related_ to (: responder, class_name = & gt; 'user') end

c++ - std::vector overwriting final value, rather than growing? -

मुझे एक समस्या है जहां vector.push_back (value) का उपयोग करना अंतिम मान को ओवरराइट कर रहा है , अंत के लिए संलग्न करने के बजाय ऐसा क्यों हो सकता है? मेरे पास वेक्टर में एक नमूना आइटम है, इसलिए इसका आकार शून्य में कभी नहीं गिरता है नीचे कोड है .. शून्य अपडेटटैबल (वेक्टर & lt; माइस्ट्रेड & gt; * व्यक्तियों, माइस्ट्रेड एंट्री) {MyStruct someEntry; Bool isNewEntry = सच है; के लिए (इंट आई = 0; आई & lt; इंडिविजुज- & gt; आकार (); आई ++) {यदि (! (एसआरसीएमपी (व्यक्तियों-> (आई) पर। एसोसिएशन, एंट्री। स्रोत एड्डर))) {हैनईएनेंट्री = गलत; // धज्जी। यहाँ कुछ काम किया। }} If (isNewEntry) {व्यक्तियों- & gt; पुश_बैक (प्रविष्टि); }} यह मेरे पहले "नमूना" मूल्य में रहने दें, और वेक्टर में सिर्फ एक और आइटम की अनुमति देगा। संपादन: अधिक कोड, क्योंकि यह स्पष्ट रूप से मुद्दा नहीं है? शून्य * टैबलेट प्रबंधन (शून्य * आर्ग) {// एनडीपी तालिका में खोजे हुए उपकरणों को स्टोर करने के लिए। // नमूना डेटा की एक पंक्ति के साथ भरा वेक्टर के & lt; MyStruct & gt; d...

"There is no spoon" or: Unexpected error 0xdeadbeef in PHP -

I have some PHP code, listed below. I have a trap that tells that if the data does not match any test of input code ("no spoon is there", it says, cautious, what?). The problem occurs when the data - which is not unusual in any way that I can see , and for that matter, it is similar to the other data that this trap Avoid - does match any test in any way it makes it in any way. And of course, the "unexpected error" error outputs the data that was input, just to make sure. As far as I can tell, there is nothing wrong with that input data. First of all, there is output, which can be a bit easier to understand: For customer XXXXXXXXXXXX, DED 2010-01, the bill has already been sent to XXXXX2515 database before continuing Removing the last billing from this DID is a toll free number hence the trunk: 0.05 DID XXXXXX2515 starting billing for trancreate: 0.05 type: TFN 2010-01-22 15:45:15: Bilkax: 22bill Pisces: 1 source : XXXXXX0808 Destination: XXXXXX2515 Erro...

xml - How can I exclude elements with xsi:nil="true" from a transformation? -

I have some XML files that have been recently changed so that in some nodes Extra xsi: nil = "true" . I've got an XSLT style sheet that provides XML for HTML for quick-eye statistics. In order to make things easier for myself in the present time, I take the names out of XML before applying a style sheet. It worked fine till our last update. Now I am getting an error because XSL does not know how to handle XSL: Niil = "True". I can easily update the code so that all of my XSL: "true" matches in XML before zero, but I was thinking that it is possible to hide the XSLT style sheet, so that the XSIL is ignored Given / can not be the reason for failures of change, even if there is no name space XML I like to work like this because now I can make changes on the server, where I have to release a new web build, I have to jump through some internal hoops to deploy it. After I'm working on things (either XSL: by removing Neil before or after the trans...

sql server - Efficient SQL query for two updates and search queries -

I have such a query: SELECT TOP 1 ID, data, Other acknowledged date = @DATE After reading and using line data, I want to update that retrieval line and change it to a single column. (In other transactions). But as you see here I have searched for that line twice, is there any way that I remember the line and update without searching again. Thank you. I know its prevalent information but you can also update the status on the cursor. Use EMP_CURSOR Cursor to go to Northwind For the top 1 employee, the last name for the employee, where the final name for OpenData = '1 994-11-15' is open for updates EMPCRORATOR Eager EMPPORTS Update next to employee Employee NextName LastName = LastName + CAST (Datestart (MS, GateDate)) EMP_CURSOR EMP_CURSOR DEALLOCATE EMP_CURSOR

ffmpeg - Missing of image when conversion from flv to 3gp -

मैं ffmpeg के लिए कमांड लाइन में उपयोग करता हूं -i इनपुट। FLV-vcodec h263 - बी 256 के -आर 15-एस 320x240 -कोडोडिक लिबोपेंकोर_आमआरएनबी \ -ab 7.4k -ar 8000 -ac 1 -f 3gp Output.3gp नतीजे केवल ऑडियो-रहित है, बिना वीडियो। लेकिन जब 176x144, यह महान काम करता है। फ्रेम आकार (320x240) के उपयोग में क्या गलत है? और क्या समाधान है? क्या आप सुनिश्चित हैं कि परिणामस्वरूप आउटपुट में कोई वीडियो नहीं है .3gp फ़ाइल? क्या यह संभव है कि अंत डिवाइस 320x240 का समर्थन नहीं करता है? यह आपके प्रश्न में संपूर्ण FFmpeg आउटपुट को शामिल करने के लिए काफी मददगार होगा।

security - OAuth and phishing vulnerabilities, are they inexorably tied together? -

I've been doing a fair job with OAuth lately, and I have to say that I really like it. I like the concept, and I like that it provides insertion of a low blocker to connect your users' external data to your site (or to provide a data API for external access to you) private As a matter of fact, I have always attached sites that ask me to login directly to another website from me. And the Oath "Wallet key for web" approach resolves this well. The biggest problem I (and many others) with it though, standard oath work flow encourages the same type of behavior that phishing attacks use for their benefit, if you use your user It is common practice to be redirected to a site to provide login credentials, so it is easy for the phishing site to take advantage of general practice, but Means to redirect their clone site where they receive their username and password. Are you asking users to login and login to the available site? Did you do anything to reduce this pro...

c# - When I try to execute a stored proc ,from another stored proc, from the middle-tier -- nothing happens -

We have the ability to execute medium-level stored procs. In fact, "SQLJobStep" called us in a database table - among other things - a considered (300) column called "stored Prokraduar", which means something like this: usp_SendReminderEmails @ debug = 0, @ Loginaidi through the mid-level, user clicks on a link to run a promotion like what happens in the backend a proc ( " Usp_SQLJobsActionGet ") looks the right value from the" SQLJobStep.StoredProcedure "column and after that Version value is executed. This "usp_SQLJobsActionGet" is part of the code that executes the above prices above: announcement @StepId integer @LoginID varchar (12) announced @StoredProcedure varchar declared ( 300) set @StepId = 74 set @LoginID = 'Yoav' select @StoredProcedure = SJS.StoredProcedure where SJS from SQLJobStep SJS.StepId = @StepId set @StoredProcedure = IsNull (@StoredProcedure, '') CHARINDEX IF ( '@ LoginID ', ...

c# - Thread Abort in .NET -

I have a thread that analyzes a file and calls the transaction to the database, audit in each transaction Entry is Transaction There is nothing wrong with calling the thread. To stop file processing ()? Compared to ugly safe places everywhere? The file will be closed after a canceled call. The obvious problem would be the risk of abandoning a transaction, which would be indefinitely (or periodically) of type off dirt - irreversible monitors locks, sequvers, etc., memory leaks, etc. In essence: try as hard as possible until you exactly do not know what it is doing at the time, it is possible to avoid canceling the thread and the only way you can know that it What is doing if it is already in a known "safe place" (to use your word) - then you can throw an exception or something and increase it yourself in a managed way.

.net - How to publish to Facebook fan/business pages (not user profiles) -

I am trying to figure out that fan / business pages are similar to regular user pages. My ultimate goal is to publish the events of a third-party web site (new content, announcements, etc.) in the FB page promoting third-party site, I'm not sure where to start really. Looking at .NET Facebook SDK, and it focuses on FB apps and authentication. Answers to "yes" for your question, fan / business pages regularly like regular user pages Are there. You need to specify the ID of the page instead of the user profile. Either way, you'll need to get an access token to allow your app to publish a page or profile on behalf of a specific user.

Visualization from C/C++ via Gnuplot's pipe interface -

I'm trying to gnuplot (a standard gnuplot_i. {CPP, HPP}) to use the pipe interface A real-time demonstration of constantly changing values ​​in other programs written in C ++ does work fine, but I have to see if someone has any suggestions for improvement. In this implementation, there is a facility method for filtering a vector and 2 vectors in 2D plot. It acquired a temporary file by typing the mktemp function through a standard library call and then using it as the input of a Gnplot plot call. This generated too much temporary files and whenever the update rate on the plot is high (probably the IO is limited to one point) does not work well. I have decided to use a 'pseudo-file' in the plot call and simply send the vector directly to the pipe (it ends with a line with "E" on it). It works better, but still is not good. What am I trying to do in relation to constantly changing the plot when changing the values? How often is it safe to update the plot w...

c++ - Finite State Machine : Bad design? -

What is normally considered as poor design in OOP? I have heard that much more, when I had to work to use an old, uncertified piece of C ++, I agree. FSM should never be considered bad. They are very useful by now, but people who are not accustomed to them will often be burdened with them. There are several ways to implement one with OOP. Some are inferior to others. Your low-level people will use the switch statement, jump the table or even "goto." If you are looking for a cleaner way to do this, then I would recommend, which is designed to implement UML, state diagram in C ++ uses this modern template technology, so that Things could be made more readable. It also performs very well.

actionview - Ruby on rails nested form model -

I'm trying to use auxiliary form_for nested rails, but I am getting the following error: BlogPage (# 49,859,550) expected, array (# 31117360) found here are my model objects: class blog & Lt; ActiveRecord :: Base # table configuration set_table_name "blog" # model configuration belongs_to: item has_many: blog_pages accepts_nested_attributes_for: blog_pages ,: allow_destroy = & gt; True End Class Blog Page & lt; ActiveRecord :: Base # table configuration set_table_name "blog_page" # model configuration belongs_to: Blogs end The Form I is generated (the unnecessary HTML left out): & lt;% form_for: blog ,: url = & gt; {: Action = & gt; : Making} do Blog_form | & Gt%; & Lt;% = blog_form.text_field: Title ,: style = & gt; "Width: 400px"%> & Lt;% blog_form.fields_for: blog_pages do | Page_fields | | & Gt%; & Lt;% @ blog.blog_pages.each do | Page | & Gt%; & Lt;% = page_fields.text...

c# - Proper Drawing2D class for NET CF? -

As I have recently discovered that most of its functionality of drawing 2D class NET CF is missing, for example " Is there a way to expand it with LinearGradientBrush ? If you are looking for a replacement specifically for LinearGradientBrush So a Win32 function is called. Here's how to use it:

Licensing for MSDN code samples -

I am preparing several deep code samples for future employers. In the sample I have included references to many open source projects, and For some functionality, I need to modify the fraction of the expression tree and I would like to use it from standard method a ExpressionVistor such as MSDN, but I do not understand Coming out whether the license allows me to use it for the project. any suggestion? On one side, note that this special part of the code is largely in the wild. Any project of Expression Tree uses it. EDIT: I think what is the word behind the license. I am confused about what constitutes a sample? To comply with the license, I have added the original source licenses and links. is: "If there is no" license "form available on this web site Microsoft without a license agreement , The code is licensed under the terms of the conditions. " This is the relevant section in MLPL: 2 (A) Copyright Grant - Subject to the terms of this licen...

linux - Simple way to convert HH:MM:SS (hours:minutes:seconds.split seconds) to seconds -

What is an easy way to change 00: 20: 40.28 (hh: mm: ss) Is sec with a bash script? Split seconds can be cut, it is not necessary. Try awk . As a bonus, you can keep split seconds. echo "00: 20: 40.25" | Awk -F: '{Print ($ 1 * 3600) + ($ 2 * 60) + $ 3}' '

VBA basic script for reading xml data?? Resource for learning this method? -

So I was just looking for basic examples of reading XML structure data with basic basic subs / scripts. Specifically, if possible, how can I get the structure data of XML, read data with some VBAs, and keep it in Excel spreadsheets? Or just a learning resource for this type of thing Thank you very much! These three topics will help you get started. 1) Load XML to XML - XMLDOC.Load ("D: \ folder \ yourXML.xml") 2) Read with data or XML Navigator 3) Use Excel Spreadsheet

JQuery Carosellite and cycle and parameter from c# -

I am using jquery Carosellite and Cycle to display images like frames. How to pass value to properties, such as speed, visual ect, codebehind (c #) Pre-HTML code: & lt; Script type = "text / javascript" language = "javascript" & gt; JCarouselLite ({btnNext: ".next", btnPrev: ".prev", View: 1, Scroll: 1, Speed: 1000});}) & Lt / Script> Geeta. if you The ASP mix does not like the .NET code. You can also mark-up your markup: Markup: & asp: HiddenField runat = "server" id = " Hfvisible "Value =" true "/> asp: HiddenField runat =" server "id =" hfSpeed ​​"value =" 1000 "/> javascript: $ (function () {$ (". Anyclass"). JCarouselLite ({btnNext: ".next", btnPrev: ".prev", visible: $ ('# HF Visual') .val (), scroll: 1, speed: $ ('# HFSPEd '). Val ();});}); Behind the code: Safe override zero a...

cocoa - Core Data and threading -

What are some ambiguous losses to using core data and threads? I have read a lot of documents, and so far I have come in the following through docs or painful experience: Use a new NSManagedObjectContext for each thread, but a single NSPersistentStoreCoordinator is a whole app Is enough for Before sending the object of the NSMANAd object back to the main thread (or any other thread), make sure the reference is saved (or at least, it was not new - just-on-now-saved No object) - otherwise objectID would actually be a temporary ID and not a constant one. Use merge changframontaxdeswen notification: When a saved one is in another thread and it is used to merge those changes with reference to the current thread. Bonus Question / Observation: I was believed by the words of some documents that merge changframontaxidens notification: only necessary by the main thread to merge the change in the "main" reference from the worker thread But for the sake of I did not - that...

Rails nested form with has_many :through, how to edit attributes of join model? -

Acceptpts_nested_attributes_for? How do you edit the properties of joining a model? I have 3 models: topics and articles included by linkers class topics & lt; ActiveRecord :: Base has has_many: linkers have has_many: articles, via = & gt; : Linkers ,: foreign_key => : Article_id accepts_ts_lights_submission: end articles of articles & lt; ActiveRecord :: Base has has_many: linkers have_many: topics ,: through = & gt; : Linkers ,: foreign_key => : Topic_id & Class Linker & lt; ActiveRecord :: Base # is included in this model, it has additional features like "relevance": subject is related to: end of article So when I create an article in "new" action Theme Controller ... Create a nested form in @ topic.articles.build ... and topics / new.html .erb. . & lt;% form_for (@topic). Topic_form | & Gt%; ... field ... & lt;% subject_form.fields_for: article | Article_form | & Gt%; ... field ... ... Rail au...

google app engine - Expando Model in Django -

Is it possible to implement the 'Exposure' model in the Django, like a Google App Engine? I got a degena app called Digengo-Extension on Gitobb but it is still in the early stages. This is possible, but it will be a havoc of the epic proportion. GAE uses a different database design that is known as a column-based database, and Django ORM is designed to link to the relational database. Since technically everything in GAE is stored in a very large table with a schema (hence you do not have syncdb for GAE applications), it is easy to add arbitrary area with relational database, Where each table stores one type of data (usually) and a certain schema, arbitrary areas are not very easy. A possible The way you can apply it is to create a new model or table for the properties that are for a table name, object ID, and crushed data. Stores a textfield, and then all the extension models are derived from a subclass which overrides __cert __ and __getattr __ this table Wi...

iphone - How to use coordinates in glClipPlanef? -

I want to clip some closed path area from the texture image in OpenGL ES and iPhone SDK. I have found that this can be done with planes and glClipPlanef: glClipPlanef (GL_CLIP_PLANE0, v); GlEnable (GL_CLIP_PLANE0); GlDrawArrays (GL_TRIANGLE_STRIP, 0, 4); GlDisable (GL_CLIP_PLANE0); Where there is a const GL float array of v coordinate I do not understand how to set these cores to clip off the area of ​​closing? How do I use glClipPlanef: const GLfloat v [/ p> ] = {A, B, C, -D}; // Force the plane to click glClipPlanef (GL_CLIP_PLANE0, v); // Enable this glEnable (GL_CLIP_PLANE0); // Some Draw arguments glDrawArrays (GL_TRIANGLE_STRIP, 0, 4); // clip area glDisable (GL_CLIP_PLANE0); Where the parameters of A, B, C, D - If we have three points with chorodes (x1, y1, z1), (x 2, y2, j2), (x3, y3, z3), then a = y1 * (z2 - z3) + y2 (z3 - z1) + y3 (Z1 - z2) b = z1 * (x2 - x3) + z2 (x3 - x1) + z3 (x1 - x2) c = x1 * (y2 - y3) + x2 (y3 - y1) + x3 (y1 - y2 ) - D = x...

websphere - Richfaces 3.3.2 - JSF 1.2 - Facelets in RAD 7.5 and IBM WAS 7.0 -

I would like to know which JBoss richFaces (3.3.2) SNRI is with jsf implementation (1.2) RAD 7.5 and 7.0, with Facet. We have overturned a class loader policy at the application level to get it, but I'm not sure it is the best way to do it (the parent's last policy can be potentially harmful). Thank you ships with IBM website creation with JSF libraries which can actually be an old version compared to ship libraries with your webpage. com.ibm packages and so on) of the IBM / website. The other solution is to upgrade Websphere with the new library according to IBM WebSpace upgrade service / instructions.

MySQL database corrupted -

My INNODB database has corrupted somehow. I do not have any backups of that database When I click on the database tables in question, they come with: (# 1033 - Incorrect information in the file: './resafari/properties Frm ') Any solution for that? Please help me If the table is actually broken (@HadleyHop, something like this seems to be the first, first of all, Stop the MySQL server and make a backup copy of your MySQL data. Then look at the following SO queries:

xml - Using XPath function fn:replace from XSLT -

I am trying to use XSLT to convert a simple XML schema to HTML and fn : Replace & lt; P & gt; To change the return ( \ n ) with . However, I did not know how to use this function properly. I read a simplified version of XSLT: & lt ;? Xml version =? "1.0" & gt; & Lt; Xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" xmlns: fn = "http://www.w3.org/2005/xpath- tasks" & Gt; & Lt; Xsl: template match = "/ root" & gt; & Lt; Html & gt; & Lt; Body & gt; & Lt ;! - Change \ n & lt; P & gt; - & gt; & Lt; Xsl: Select the value = "fn: Replace (value, '\ n', ' & lt; p & gt;')" /> & Lt; / Body & gt; & Lt; / Html & gt; & Lt; / XSL: Templates & gt; & Lt; / XSL: stylesheet & gt; And the meaning of this XLST input is:. & lt ;? XML version = "1.0"? & ...

custom controls - Silverlight Dependancy Property Change Event Problem -

I have a custom control on which there is a dependency property ... it has something but tell us that the dresble is my problem The property is a boolean and I want to execute a piece of code every time I make this change. I have two options, both of which are shown below [category ("modal option")] public bowl drag ({return (gate) gateway (draggable property) );} Set {value (dragable property, value); toggleDragable ();}} // Using dependency properties in the form of backing store for draggable enables this animation, styling, binding, etc. ... public Dependency property for stable reading Accessible Properties: Registrar ("dragable", typef (boole), typef (plus window), new property matadata (false)); Private Zero MakeDragable () {this.dragBehavior.Attach (this.LayoutRoot);} Private Zero MakeUnDragable () {this.dragBehavior.Detach ()}} Public Virtual Zero Toggle Dragetable () (if it is Drugble) {MacDraggetable ();} and {MacCreative ();}} or [category...

Good examples of unit test suites -

Which of us want to learn by reading the code, what are some of the projects that you have seen, A great example of a great suit? This is not a question about your preferred unit testing framework, but it may be helpful to add which unit testing and / or joke frameworks are used by the projects you have mentioned. What platforms will any one do, but I mainly take interest in projects that use an x unit-style unit testing framework. One of the unit tests - they are written in junit, and with the juneet-spring mechanism One of the fake libraries is also included. These include the process of launching and many other mechanisms that you may need some days.

makefile - Make computes wildcard too early? -

I have a lower file, less or more, the following structure that compiles the C ++ source code: .phone: all of all: compile_obj_files my_binary # This rule generates object files it works fine afaik .PHONY: compile_obj_files compile_obj_files: $ (create) --file = child.makefile # my_binary one There is a real binary file that I want to create. My_binary: $ (wildcard * o) $ (CC) $ (wildcard * o) -o my_binary generates all the object files on the run for the first time, but $ (Wildcard * OO) returned an empty list, in the second race nothing was compiled as expected, and $ (wildcard * o) actually all the objects Returned files. It looks like $ (Wildcard * .o) is executed before all the objects of the file, despite the fact that my_binary rule compile_obj_files . I look helpless on this script without any idea what is wrong (something should be silly). Can you think anything you should not really use $ (wildcard ...) Inside the rules, but do something like this ...

seo - Allow SE indexing on index.html only -

* What will be the shortest way to block and allow only the major search engines to index the site's index page Will you? User-agent: * Disclaimer: / User-agent: Googlebot Disclaimer: / Allow: index.html User-agent: Reject slurar: / allow: index.html User-agent : Deny MSN: / Allow: index.html Will this work? Yes, this is not necessarily the right path to do so. All bots do not support allow instructions. And some bots are confused about interpreting robots.txt when both are applied in a user-agent: * section and a user-agent: specific-bot section it happens . It will be sure that this will work, you want to do something like this: User-agent: Googlebot Disclaimer: / file1 Disclaimer: / file2 Disallow: / file3 # etc. Until you block every path except the index.html user-agent: Reject slurp: / file1 Reject: / file2 Disallow: / file3 # etc. As long as you index.html user-agent, every path Block: reject msn: / file1 reject: / file2 rejected Do: Do ​​not block...

flex - the grid cell width should be resize as the text length which entered in that cell -

In the datagrid, when we click on the grid vertical line, the grid cell width should be resized as the length of the text That cell Thank you You dynamically resize the size of a datagrid column to the text component Change the handler for and change the width of the DataGrid column in it. To do this, you have to write your own item renderer for that column. More details about the Flex component size:

java - Jackrabbit Observation with Spring -

Here are the details: I have created a Param class, and it is a pause with the setters and gates that represent each parameter: ObservationManager. AddEventListener () I have extended the XListener to Event Listener , and defined a method: () . . . and return it to use later to add this listener, and OnEvent () currently prints only a message new node added . A new class created for the MyEventListener has been added to a new class listener registers and it is a set of XListeners which has been added to applicationContext.xml for spring. Back to ListenerRegistrar, I repeat on the set of listeners and the consultation object is used to call the observation authority. ObserveManager.addEventListener () The problem Can anyone help me? Thanks in advance. I would say that you have the problem that your listener, The registrar is never being applied (it seems that this is only declared in the application context). As you ar...

jquery - javascript validation for dynamic element -

How can I validate dynamically-generated text inputs? I have a "Add more" link that creates new ones, and a link to delete them. > I understand how to dynamically form a form Adding the input from, and adding validation rules for the jQuery validation plugin together. In my example, this was an order form for the helmet: // Each set of helmet input is unique ID function newHelmetInputs (i) {var inputSet = '' ; InputSet + = '& lt; Label = "helmet" + i + 'color' & gt; Helmet '+ i +' color & lt; / Label & gt; InputSet + = '& lt; Input id = "helmet" + I + 'color "name =" helmet [' + I + '] [color] "/> gt; inputset + =' & lt; label =" helmet "+ i + 'size" Gt; Helmet '+ i +' size & lt; / Label & gt; InputSet + = '& lt; Input id = "helmet" + i + 'size "name =" helmet [' + I + '] [s...

uinavigationbar - Android Navigation Bar Top -

How do I create a navigation bar at the top of my application? I want something like a top bar in the picture: This question is quite similar, and may be You are watching:. To create a header, simply create a relative layout with two buttons : one on the left side of the parent One of the parents' realm

sql - Check if role exists in DB? -

I want to add users to the same role in multiple databases. Although the role can not be present in all the databases, how can I check whether the role is present in the database and if it connects users in that role? For example, if the role exists, add the user to the role AD Try: If DATABASE_PRINCIPAL_ID ('role') is started tap - Add user here Create role role authorization MyUser; END

Sorting a multi-dimensional [,] array in C#, composed of integers -

मेरे पास निम्न सरणी है: निजी int [,] testSamples = new test samples [ 101,101]; यह कॉलम 0 से 100 और पंक्ति 0 से 100 के साथ एक रोस्टर का प्रतिनिधित्व करने वाला माना जाता है। इस रोस्टर में, विभिन्न रासायनिक तरल पदार्थ छोड़े गए हैं। जिस व्यक्ति के लिए मैं यह कर रहा हूं वह इस तरह से काम करना चाहता है कि वह कंटेनर का सबसे पहले इसे सबसे अधिक तरल रखे। तो, मुझे डेटा प्राप्त करना और प्रिंट करना होगा इस तरीके से: परीक्षण नमूने [35,40] = 12 टेस्ट नमूने [11,12] = 11 टेस्ट नमूने [92,14] = 10 टेस्ट नमूने [18,3] = 10 टेस्ट नमूने [1,61 ] = 7 ... उदाहरण के लिए। मैं कुछ दिनों के लिए इस पर अपना सिर टूट रहा था, मैंने स्टैकवर फ्लो पर यहां कुछ और प्रश्नों को देखा है, लेकिन मैं उनमें से किसी भी काम पर नहीं जा सकता। क्या कोई तरीका है क्या यह करना चाहिए, या क्या मैं सरणियों को छोड़ देना चाहिए और किसी अन्य तरह के कंटेनर के लिए जाना चाहूँगा, जैसे कि सरणी सूची या सूची आइटम? यहाँ एक सुझाव है जो मुझे लगता है कि रिचर्ड की तरह काफी है, लेकिन LINQ का उपयोग किए बिना समाप्त होता है। एक त्वरित ...

What's a Regex pattern for 3 consecutive digits increasing or decreasing -

I need a regex pattern to match the successive 3 digit sequence in a rising or decreasing string. For example: These strings must match (xxx123xxx, 789xxxxxx, xxxxxx987, xxxxxx432) These strings must not match (xxxxxx454, 333xxxxxx, xxx429xxx) There is no other way than to list them: (012 | 123 | 234 | 345 | 456 | 567 | 678 | 789 | 987 | 876 | 765 | 654 | 543 | 432 | 321 | 210]

Converting a large SQL Server Database to Azure Storage -

I have a very large database structure, (Data is not important at this time, I can migrate information in DB If structure is done), all live in SQL Server and I have also published it in SQL Ezur, but considering the size of the size of SQL Ezur, I need to decide to switch the tables which All the hours Season Urt is not SQL Ajhur to Aejhyur Table and Blob Storage. I was thinking of making a TT template which is a dose, but wondering if its such a device. Any thoughts or thoughts? The only interchange payments placed in SQL Exem itself will be related to transactions such as. I have posted now hope That it will help someone to complete as a starting point

screen scraping - C#: Need to render a form/control on an "imaginary" desktop -

OK, what I'm trying to do here. First of all, I will explain the end result, as a result I am trying to get it, there are other ideas about doing this. I am creating a screen capture utility which only takes the screen shot of a window ... my window (which I have total programmatic control). However, this window can be very large compared to the computer on which the utility will run. The height, in particular, can reach up to several thousand pixels on a computer with 1024x768 resolution. So I am trying to capture the entire window, though it is bigger than the screen. I am trying to achieve the end result of this. A hypothetical solution is to render the form / control on any type of graphics or screen object, and instead of turning off the object's screen, instead of taking the screen shot of the physical desktop. Basically I need to draw control over an imaginary screen which is present only in code and memory and I do not even know what to look for, so also con...

Does C++ support constant arrays of type string? -

I am a programming student in my first C ++ classroom, and for a recent project, Arrays like I have C #: Is it possible to do something similar in C ++? Thank you! If you start the array in C ++, then it does not need to set a size (Although it will accept one), therefore: std :: string month [] = {"Jan", "fur", "march", "april", "may", "June", "July", "August", "September", "October", "November", "Dec"}; For me, it's fine with G ++ and I hope it compiles it elsewhere. I hope your errors are due to the lack of std :: namespace.

c - Stop condition for printing linked structs? -

मेरे पास निम्न संरचना है: स्ट्रक्चर सेल {int nmbr; स्ट्रैट सेल * पी; }; मैंने इस प्रकार से जुड़े स्ट्रक्चियों की एक श्रृंखला बनाई है। प्रत्येक संरचना अपने पूर्ववर्ती से * पी के साथ जुड़ा हुआ है यदि मैं नीचे दिखाए गए के रूप में एक रिकर्सिव एल्गोरिथ्म के साथ सभी nmbr s को प्रिंट करने का निर्णय लेता हूं, तो मैं कैसे रोक स्थिति को परिभाषित करूं? शून्य लिखना (स्ट्रक्चर सेल * l) { / * निम्नलिखित अगर कथन मेरी समस्या का समाधान नहीं करता है, लेकिन उम्मीद है कि आप देखेंगे कि मैं क्या करने की कोशिश कर रहा हूँ * / if (& amp; l! = 0x000000) {printf ("% d \ t", l-> nmbr ); लिखने (एल & gt; पी); }} आप चाहते हैं if (l ! = 0) या if (l! = Null) बेशक, आपको भी यह सुनिश्चित करने के लिए कि आपकी लिंक्ड सूची की पूंछ में p असाइन किया गया NULL भी है; अन्यथा यह अप्रयुक्त नहीं होगा और शायद कुछ नहीं NULL लेकिन अमान्य भी हो।

windows - Maximum number of socket in java -

How many chairs are there in maximum windows under Java? How can I change it? This file is dependent on the maximum number of descriptors (handles in windows) configured for OS is. Each open file or socket uses a file descriptor in Solaris, for example, 65536 is the default for the maximum FD. It is possible that there are additional files using FD pool, so the upper limit of the soak limit is not limited unless the OS is tuned to increase the number of FD's Windows NT In the / 2000 / XP (probably Vista & 7) there should be an entry "FILES =" in the \ Windows \ System32 \ config.nt (possibly even a registry setting?) That should give you the maximum number of file handles. Here's more in-depth discussion of boundaries in Windows:

c++ - Particle stream should be the same length regardless of emitter speed -

Image
I am writing a particle system for our student gaming, and I have participated in a little problem i I want to improve the effect, but I could not find out how. Here's how the impact on a stable ship looks: And it looks on a moving ship: Flames should consistently have the same length. Here particle 's tick function: zero particle: tick (float a_DT) {// temporarily view the effect The remaining code is more explicitly set to // m_Pos + = m_Vel; If (m_Owner) {m_Pos + = m_Owner-> GetParentSpeed ​​(); } M_Life - = 1; If (m_Life Thanks in advance. EDIT: To clean things, I should have a mark of effect, but I want to keep it in the same way with the speed of emitter. You're doing that particles fast or slow moves according to the speed of the original leg, but their Life is certain that you reduce any one till you reach zero, right? What you probably want to do is set the distance to a distance value, instead of a distance, . Then, reduce th...

uiwebview - Using iphone UIWebKit to create a web browser, problems with getting url -

So I'm building a web browser for my classroom and I have a problem whenever I Speaking from a website like form, it does not update my address bar text (which is UIT-field). As an example, if I go to google.com on my browser and search for something in the search field and it is submitted, then it loads a new page without changing my address bar (this is just now Is also on google.com). I have to change it for the link, but I do not think how it can be made, so it works for these types of forms. I have added NSLog to my webViewDidFinishLoading function and do not say that the page is loading, so I'm not sure how to find out how it changes in this way. Does anyone have no idea why he is not working? Instead, stop this in this method: - (BOOL ) Webview: (UIWebView *) webView should StartLoadWithRequest: (NSURLRequest *) Request Navigation Type: (UIWebViewNavigationType) Navigation Type; Navigation type may be UIWebViewNavigationTypeLinkClicked, UIWebViewNavigat...

c# - Is there a difference between return myVar vs. return (myVar)? -

I was looking at some example C # code, and found that the returns of () in an example are wrapped. I've always done this: return myRV; Does it matter: return (myRV); update: this was the question. Thanks for the fun question! In practice, there is no difference. Principle can be a difference. There are three interesting points in the C # specification, where it can present a difference First of all, consider the following for the conversion type of anonymous activities and handing over the expression tree: function & lt; Int & gt; F1 () {returns () = & gt; 1; } Fx & lt; Int & gt; F2 () {return (= = 1);} F1 is clearly legal. What is F2 ? Technically, no section 6.5 says that a lambda expression has a conversion for a corresponding representative type. Is this lambda expression ? No. This is a bracket expression in which there is an lambda expression . The Visual C # compiler violates a small device here and your logi...

c# - File.Copy() sync or asycn? -

I am using the file. To copy the code (source, destination, true) from local to remote overwrite option. In my case, Dest is a mapped network drive: file. Copy (source, destination, true); UnMapDrive (); // Unmap network drive The problem I have is that the source file may be locked so that I will not be able to remove the file from the local. I think this may be due to the file. Copy () The call is not certain whether it syncs a process or not. In other words, what is the source file released after the call? Yes, it is issued and file. Copy method prevents execution until the copy operation is complete. The file may be available for reading, but may be locked for deletion. Check with what process the source file is locking.

iPhone SDK: How can I programatically determine which tab button has been pressed? -

I have a tab bar with 4 buttons on it. When the user presses the A button, I want to call Function A. When user presses the B button, I want to call function B I have implemented the UITBBrDAGate. I have this code and it is expected when the button is pressed on any tabbar - (zero) tabbar: (UITabBar *) tabbar selected: (UITabBarItem *) item What I see is the code snippet that shows which button should be detected Thanks to iwat's comments below I'm easy to edit it. > }

asp.net mvc - Custom model binder for a property -

मेरे पास एक निम्न नियंत्रक क्रिया है: [एचटीटीपी पोस्ट] सार्वजनिक व्यू रिजल्ट डोसमिंग (मायमोल्ड मॉडल ) {// कुछ वापसी देखें (); } MyModel इस तरह दिखता है: सार्वजनिक वर्ग MyModel {सार्वजनिक स्ट्रिंग propertyA {get; सेट;} सार्वजनिक IList & lt; int & gt; संपत्ति बी {प्राप्त करें; सेट;}} तो डिफ़ॉल्टमोडेलबैन्डर को बिना किसी समस्या के बाँध चाहिए। केवल एक चीज यह है कि मैं प्रॉपर्टीबी बंधन के लिए विशेष / कस्टम बाइंडर का उपयोग करना चाहता हूं और मैं इस बांधने की पुन: उपयोग करना चाहता हूं। इसलिए मैंने सोचा था कि समाधान को मॉडलबीण्डर एट्रिब्यूट को प्रॉपर्टीबी से पहले रखना होगा जो निश्चित रूप से काम नहीं करता है (मॉडलबेंडर एट्रिब्यूट को किसी प्रॉपर्टी पर अनुमति नहीं है)। मैं दो समाधान देखता हूं: 1) मॉडल के बजाए एक्शन मापदंडों का उपयोग करने के लिए जिसे मैं पसंद नहीं करता (मॉडल में कई गुण हैं ...) इस तरह से: सार्वजनिक व्यूResult DoSomething (स्ट्रिंग प्रॉपर्टी A, [ModelBinder (typeof (MyModelBinder)) propertyB) ... 2।) एक नया प्रकार बनाने के लिए MyCustomType कहें: सूची औ...

flex - How to create very dynamic menu like Picnik's? -

Picnik का बाएं हाथ मेनू: मूल विशेषताएं: घटकों की तरह Accordion (लेकिन कई आइटम चुने जा सकते हैं) प्रत्येक स्टैक में कई बच्चे को स्टैक किया गया है पूरे मेनू का आकार बदलता है, इसके आधार पर कि कितने ढेर चुना जाता है और एक यदि आवश्यक हो तो स्क्रॉलबार भी दिखाया जाता है तो मैं इस तरह एक मेनू बनाने के बारे में कैसे जा सकता हूं? बूट करने के लिए कोई संकेत? धन्यवाद! आप VBox के संयोजन का प्रयास कर सकते हैं , संकुचित पैनलों और सूचियों () से आपको सभी उपकरणों की आवश्यकता होनी चाहिए। यह मेरी दृष्टि: (क्योंकि मुझे पाइप और डैश के साथ चित्र करना पसंद है) VBOX ------------------------- | | | Collapsing Panel -------- | | | | | | | टाइल सूची ---------- | | | | | | | | | | | टाइल | | | | | | टाइल | | | | | ------------------ | | | ----------------------- | | | | Collapsing Panel -------- | | | | | | | टाइल सूची ---------- | | | | | | | | | | | टाइल | | | | | | टाइल | | | | | ------------------ | | | ----------------------- | | | | Collapsing Panel -------- | | | | | | | टाइल सू...

what is armel and how armel relate to arm? -

On the link I found that Armell's interpretation is very little in the form of Atian ARM. But what is the weapon in this case? This ARM is running in small-endian mode.

sql - Constructing dates in TSQL -

एक तिथि बनाने की कोशिश कर रहा है: CAST ('9/1 /' + YEAR (GETDATE ()) AS Datetime) AS test2 लेकिन यह काम नहीं करता है? क्या '9/1/2010' जैसा कुछ करना चाहते हैं? आप संख्या के साथ स्ट्रिंग '9/1' को जोड़ नहीं सकते हैं: YEAR (GETDATE ()) , इसलिए इसे आज़माएं: CAST का चयन करें ('9/1 /' + कन्वर्ट (वर्चार (4), YEAR (GETDATE ())) Datetime ) AS test2

Installing numpy broke NLTK (OS X 10.6.2, Python 2.6) -

I had a working installation of NLTK (PI-26-NLTK) on Mac (OS X 10.6.2). Then I installed numpy. Now when I try to import nltk, I get this: gt; & Gt; Import nltk traceback (most recent call final): File "& lt; stdin>", line 1, & lt; Module & gt; The file "nltk / __init__.py", line 83, & lt; Module & gt; Import from Collocations * File "nltk / collocations.py", line 39, & lt; Module & gt; Nlt From Metrics Import, Attached Musers, Bigram ASSOC, Méisers, Trigram Essos Méisers file "nltk / metrics / __ init__.py", line 14, & lt; Module & gt; Score import * file from "nltk / metric / score", line 15, & lt; Module & gt; Bitai file from Scipy.stats.stats "/ Library / Framworks / Python. Framework / version-2.6 / Leib / Python 2 / site-package / SC / seat /__INIT__.py", in line 7, in & lt; Module & gt; Import from statistics * File "/ Library / Framworks / Python. F...

c# - How to get FormValueProvider instance in a Custom Model Binder in ASP.NET MVC 2 -

I am using MVC 2 RC I have a custom model binder, which is posted in MVC 1.0 The prices were redistributed: var value = binding content box. Value provider Where (x => x.Key.StartsWith ("prefix")); Foreign Currency (Variable Values ​​in Values) {/ * Something * /} In Version 2, I can not do this now. I think I need to use FormValueProvider in my custom model binder in any way, but I do not know how to get it. The value provider is a read / write property that you have tried to do: var formValueProvider = new form-value provider (controller consort); BindingContext.ValueProvider = formValueProvider; I discussed this, but I have not used myself to be honest. Edit: I'm not sure if someone has a good solution for this scenario, but I think you're the Controller Consort. Can reach. HttpContext.Request I know this does not seem right, but if your needs are so low I suspect that there is only one way to get them.

undefined - Can a value be uninitialized, but still defined, in Perl? -

Running ActiveState Perl 5.10.1 on Win32. How is this code: dead (defined ($ r->; unparsed_uri = ~ '/ (logout.pl.)' $ ')); Dies with ... 1 , while changing the same line to say: die ( $ R-> gt; Unparsed_uri = ~ '/ (logout.pl)? $'); Use undefined value in ... dies defined so far Initialize ? I thought undefined means undefined. In the first case, the matching operation is taking place in the scalar In the second case, this array is in context Almost as you wrote: my @ group = $ r-> gt; Unparsed_uri = ~ '/ (logout.pl))'; Die @ group; If the $ r-> unparsed_uri corresponds to the pattern, but $ 1 is undefined because the matching string with "/" Finished, then the @ group will be an array of length 1, in which an element will be undef . Put it together, it seems as if you want to: die (undef);

colors - Change background colour for Visual Studio -

हम दृश्य स्टूडियो में पृष्ठभूमि का रंग कैसे बदल सकते हैं? यह इंगित कर सकता है कि "पोस्ट-टेक्स्ट" आइटमप्रॉप = "टेक्स्ट"> आप कुछ दिलचस्प संसाधनों के लिए यहां लिंक है:

Viewing Content Of Blob In phpMyAdmin -

Sorry for the noob question, but what is the vertical button, and how can I see the content of a blob Earlier versions of Phpmyadmin had a setting named $ cfg This will allow you to view the contents of Blobs in the browser. You should note that this would be the cause of chaos that you were collecting binary files in the Blines because you will see endless goblive in the browser window. There are some people (like my) who decided that their applications need to use blob types to keep a lesson (at that time a good decision was taking place, and I remember that I had some thinking in my part ) However phpmyadmin decided to disappoint while disliking this configuration setting. There may be a lot of support requests in understanding this, apparently it was thinking that people had to take on the types of text area. The video displaying pleasure has moved to the user interface instead of the configuration. The easiest way when you are browsing is to click the link: + O...

r - Show an ASCII character -

I want to show a block ASCII character █ (this ASCII code is 219), how Can I show it in terminal? I am using RGui on WinXP You can do otherwise Use backslash to avoid redirecting characters: print ("\ 245") yen character ( ¥ ) displays in my 245 octal format, so the above expression ASCII (or GUI encoding that is using) is printing 165 characters. 213 octal is 333 but does not make any sense) Unicode characters on R-GUI Also supported: cyrillic_d & lt; - "\ u0414" print (Cyrillic_D) output D .

php - Illegal offset type -

I am having trouble uploading a file via php, I check the file type at the beginning of the process and I get an error. This is what I am getting the error: WARNING: Invalid offset type / balblabla print it out $ $ _FILES array ([Name] => JPG.jpg [type] => image / jpeg [tmp_name] => / tmp / phpHlrNY8 [error] => 0 [size] => 192221)) function checkFile ($ file, $ type) {if_array ($ _ files [ $ File] [I 'type'], $ type)) // { This is the line of code that the function calls if (checkFile ($ _FILES ['picture'], The array ("image / JPEG")) == true) {/ // do stuff}} // end if I have used this code on dozens of my own servers Due to websites, I guess it is a different configuration option. How can I modify my code so that it works on this separate server? You are passing an array, string / integer on your checkFile function Not index To fix this, do one of the changes: Change the checkfile so that it can be use...

c# - disable mouse wheel on itemscontrol in wpf -

I have a user control in which there is a scrollover, then one of the hair controls like hair boxes, radio buttons, and listboxes etc. The bunch is. In it I can use the mouse wheel until my mouse is able to scroll to the ground inside a listback, then the mouse wheel moves to the event list. Is there a way to send the list back to the parent control on those events? Like this question, removal list box from parent control gets suggested () is not a solution. I have tried Zero ListBox_PreviewMouseWheel (Object Sender, MouseWheelEventArgs e) {e. Handle = true; } But that also does not work Thank you The answer you have given is the same as your problem The reason is that the listbox in your scroll weaver (which is composed of a scrollwizard between the other things) has grabbed the mousewheel event and took it, preventing it from bubbling and thus showing the scroll weaver To do this, use the following extremely simple control templates for your list box. Do not pay ...

python - Django ORM's "related data" loading behavior -

In LINQ (I came from C # background), you can manually load the data ("xxx" by including the data for the inserted table) to ctx.MainTable.Include (" subtabile "); In the above code, each instance of the menu item is loaded and all the subtable data are also loaded. If "Include" is not called, then the subtebable property of each metabyll will return. What are the same methods for Django ORM? If not, then what is the default designated behavior for seats as above? Check it out: You Follow Relationships To do a select_related query set and pre-fetch related rows. Normally, you do not waste too much time unless you know that the personal projection made by ORM is very slow. When you simply name the related object field: x = MainTable.objects.get (id = "some object") y = x.subTable The related subtab line will be ORM what's going to be lazy. You can not get a table entirely in memory QuerySets are "lazy...

java - making elements of an array null -

क्या ये दो एक ही बातें हैं? के लिए (int i = 0; i & lt; Array.length; i ++) {सरणी [i] = नल; } और सरणी = नल; अंतर दिखाने के लिए एक छोटा स्निपेट: // एक सरणी चर घोषित करें जो एक संदर्भ पकड़ सकता है। स्ट्रिंग [] सरणी; // इसे रिक्त करना, यह इंगित करने के लिए कि यह कुछ भी उल्लेख नहीं करता है सरणी = नल; // इस बिंदु पर शून्य है, लेकिन कोई वास्तविक सरणी के लिए केवल एक सरणी शुरू किया गया है। // अब एक सरणी आवंटित करें सरणी = नया स्ट्रिंग [3]; // अब अलग-अलग सरणी तत्वों को शून्य बनाते हैं। हालांकि वे पहले से ही अशक्त हैं। के लिए (int i = 0; i & lt; सरणी.लांबी; i ++) {सरणी [i] = नल; } // इस बिंदु पर हमारे पास एक सरणी चर है, जो एक सरणी के संदर्भ में है, // जिसका व्यक्तिगत तत्व शून्य हैं I

php - Script to find if a similar question exists -

G'day, I am creating a frequently asked question system, and users Should be able to see if a similar question is asked. Just wondering if anyone is aware of a script (preferably PHP, or Javascript, or possibly an action), which any kind of A would do? Thank you. I think the best You can hope for a simple search engine: split words into question and record words against the question table question (question_id, word) Then a question like a new question To get a table query (id, text, ....) ID $ x with question: SELECT prev.id , Questions with common questions as prev.text, count (*) , Prev_words words, curr_words where curr_words.question_id = $ x and curr_words words = prev_words.word and prev_words.question_id = prev.id group ID, COUNT (*) Text command Diissi limit .....? You can definitely implement more detailed methods on returning shortlists - but this will definitely be the first step. c.

linux - Implementing basic file system -

As a college project, I need to implement a basic file system from within a file. How about to go? What do I need to know? Requirements include having a daemon process in the background Also, applications using this system need to connect to the server using the Unix domain socket The file system should have the following capabilities: List files are stored with them Create files Allow changes to files Delete files it out if it can help If you want to create a file system in user space, FUSE can help.

Can all keys be represented as a single char in c++? -

I have searched around and can not find a way to represent arrow keys, is it also in C ++ possible? I hope this will be like \ t or \ n for the tab and the new line respectively. Whenever I search for the characters of Exodus, there are only five or six famous characters. No short answer. The long answer is that the standard ANSI character set (decimal 1 to decimal 31, inclusive) has many control letters, of which there are control codes for linefeed, cart back, end of file, and on this much. Some are generally defined as arrows and escape keys, but only for compatibility with terminals. The standard PC keyboard sends a 2- or 3-byte control code that represents the key to be pressed, in what state it is, that the control / alt / shift key is pressed, and some Other Things To see how you want to handle them, you will want to see the "key code". They are handled differently between the operating system and the base library you use, and their meaning is different de...

windows - How to invoke NdrClientCall2() function directly? -

Does anybody know that the code can be called in the rpcrt4.dll code in the NdrClientCall2 () function Is it or how it can be used? We have gone through MSDN support, but no examples / samples have been found to use this function. Please provide help. Thank you. Usually you never call it directly - this requires a very difficult parameter Which is prepared in a particularly difficult manner. Instead, you use IDL to specify your RPC interface, compile it with MIDL and it gives you a client proxy that calls that function with the appropriate parameters.

.net - Writing a text file -

I am using VB.NET and, I want to write a text file from the database. Open a text file, read data from the database and then type in the text file. code. cmd = New SqlCommand ("Select ID, Name," from the table ", con) dr = cmd.ExecuteReader while DR.Read () Dim Data String Data = File As ReadAllText (dr.Item ("PersonID")) File.WriteAllText ("D: \ test.txt", data) end The above code is showing error, how to write a text file VB.NET code help In your code you are not actually in the database Try reading this: author = new streamer ("D: \ test.txt") using Dr. Reed () slow down D = dr.GetInt32 (0) Dim Names = dr.GetString () 1) Dim Dept = dr.GetString (2) Writer. WriteLine (String.Format ("{0} {1} {2}", ID, name , Department) Using End End

visual c++ - Difference between intellisense and compiler in VS.NET C++ 2010 -

क्या निम्न कानूनी C ++ कोड है: class C {static public int x; }; यह दृश्य स्टूडियो 2008 सी ++ और विज़ुअल स्टूडियो 2010 सी ++ (बीटा 2) में ठीक संकलित करता है। लेकिन स्थैतिक सदस्य एक्स सार्वजनिक नहीं होता। दृश्य स्टूडियो 2010 बीटा 2 में अनुभव भी अजनबी है Intellisense एक त्रुटि "एक पहचानकर्ता की उम्मीद" की रिपोर्ट है, लेकिन संकलक नहीं करता है। विजुअल स्टूडियो 2008 कोई त्रुटि नहीं देता है। तो सवाल ये हैं: क्या यह कानूनी सी ++ कोड है? इसका अर्थ क्या है? यह कानूनी C ++ नहीं है यह एक कानूनी सी # है, इसलिए यही कारण है कि एमएस आईडीई की गड़बड़ी हुई। सही: सार्वजनिक: स्थिर int x;

php - Adds an empty directory in the archive -

मैं संग्रह में खाली निर्देशिका जोड़ना चाहता हूं। ziparchive :: addEmptyDir यह फ़ंक्शन इसे जोड़ता है लेकिन मैं केवल रूट मान रहा हूँ कि मैं इसे जोड़ना चाहता हूं / dir / dir / मैं नहीं कर सकता & lt; php $ zip = new ziparchive; यदि ($ ज़िप- & gt; खुला ('test.zip') === सच) {if ($ zip- & gt; addEmptyDir ('newDirectory')) {गूंज 'एक नई रूट निर्देशिका बनाया'; } Else {गूंज 'निर्देशिका नहीं बना सका'; } $ ज़िप- & gt; बंद (); } Else {गूंज 'असफल'; }? & Gt; यह रूट में इसे जोड़ता है कि मैं उप डायर में नया डायर कैसे जोड़ सकता हूँ // एक निर्देशिका, // सब-निर्देशिका और फ़ाइलों को एक ज़िप संग्रह समारोह addFolderToZip ($ dir, $ zipArchive, $ zipdir = '') में जोड़ने के लिए समारोह {if (is_dir ($ Dir)) {if ($ dh = opendir ($ dir)) {// निर्देशिका जोड़ें $ zipArchive- & gt; addEmptyDir ($ dir); // सभी फ़ाइलों के माध्यम से लूप जबकि (($ file = readdir ($ dh))! == false) {// यदि यह एक फ़ोल्डर है, तो फ़ंक्शन फिर से...

dom - Why are Nodes and Elements different in XML? What was the rationale? -

After writing the code running on XML for a while, I have always thought that the reason for having both nodes and elements is ? (We know). Both tags (more or less) and represent different ways, just make the code complicated. Are there any special semantics or practical reasons, or is it true that a committee of DOM Spectac originated? The node element has a base class - pretty much everything in the XML document is a node, because the example & lt ;! ENTITY ... & gt; & Lt; Xml a = "myAttribute" & gt; Some text & lt ;! - a comment - & gt; & Lt; / XML & gt; In the example above: & lt ;! ENTITY ... & gt; is a unit & lt; Xml ... is an element a = "myAttribute" is a attribute some text one Text node is & lt ;! - a comment - & gt; is a comment In all the above examples, myAttribute is also a text node.