Posts

Showing posts from August, 2010

ruby on rails - How should I structure controller actions that share templates? -

Assume that I have a user model, and a invoice Model related_to: user with association. Now I am creating a new action for my InvoicesController , and the scene will be sung, a selection of scenes for this user's selection- Element will be from this invoice. So I need to bring those users somewhere; My tendency is to leave out seeing this kind of thing, I end up with: def new @users = User.all end form Submit create . When creation fails for some reason, I render the view of the action of new action. def invoice = invoice. New Perm [: Invoice] If Invoice. Flash [: notice] = 'invoice created!' Redirect_to: Action => 'Show' ,: ID = & gt; Invoice.id other @ user = user.all render: action = & gt; The end of the 'new' end But as you can see, in order to reproduce the new action, I have to bring users back . This is just an example, but keep in mind that I have some forms with many select elements filled with database...

Examples of filling pdf form with iText in ColdFusion -

Find some examples of iText 5 and ColdFusion 7. I have to fill out some PDF forms Data from DB Examples of all the iText and Cold Fusion which I have received are at least 4 years old and use the previous version of iText. One of my previous questions is an example on how to do this:

django - pisa : adding images to PDF output -

I am using a standard example from the Web to convert a DjangoView / Template into PDF. Is there an easy way to include images in the template (either a URL or a reference to the server) so that they will be shown on the PDF? import from django.http import from httppps django.template.loader import render_to_string import imported import.contact django.conf import settings from django.template import. Pisa Imported as StringIO Import CGI Import OS DEM DM_Manthelli (Request, Year, Month): Pasteed as PISA in Pisa form: HTML = render_to_string ('report / dmmonthly.html', {'pagesize': 'A4',}, context_instance = RequestContext (Request)) Results = StringIO StringIO () pdf = pisa.pisaDocument (StringIO.StringIO (html.encode ("UTF-8")), dest = results, link_callback = fetch_resources) Otherwise pdf.err: return HttpResponse (Result.getvalue (), mimetype = 'application / pdf') httprespacespection ('Greillance took your PDF!% S...

.net - "Access to the system path is denied" when using 'System.IO.Directory.Delete' -

I am using System.IO.Directory.Delete and delete the system folder I am trying to get such errors as 'my music', 'my video' etc., but I'm getting errors like "access to system path" C: \ users \ jbloggs \ Saved Games 'Disapproved' Although I can remove these folders without any problems in the Explorer, I have full permission for these folders. My code: Public static zero ClearAttributes (string currentDir) {if (Directory.Exists (currentDir)) {string [] subdirectories = directory. Gate Directories (Current Dear); Foreacha (string die in sub-diures) Cleatulates (DIR); String [] files = files = directory Gatefiles (current dior); File (string files in the file) .net property (file, file. Attributes); }} Usage: Try {ClearAttributes (FolderPath); System.IO.Directory.Delete ("C: \\ user \\ jbloggs \\ saved games \", true); } Hold (IOException east) {message Box.Show (ex.Message); } Yes, that folder has a "read only...

layout - Display Element borders in Flex App? -

Is there a way to set boundaries around the elements of a Flex application (MXML)? I am portraying a photo that Firebug does with the Inspection Button for HTML (see what I'm saying). The reason for doing this is that I have trouble with some layouts. There is another tool that lets you navigate your UI and inspect properties.

iphone - Using different delegates for NSXmlParser -

I'm trying to figure out the best way to design something, I'm writing an iPhone app and for the most part I am using async calls for a web service. This means that I'm setting up a URLConnection camera, I start making calls and calls me back when the data is available or an exception occurs. It works well and I think that is the right way to handle things. For example: I request a list of people from a web service. As a result, there are XML person elements in the list, which will be translated into object-c "person" objects by my XmlDelegate When I call the function to get the person, then I will say "Personal Deliigate" I am a protocol with a person called "person reakyavide: (person *) p". Therefore, every time I get a complete person object, then I call that method and all is well. Therefore, my expansion view (or search result view) just gets the element because they are available The problem occurs when I need to get more spe...

python - How do I extend the Django Group model? -

You can extend a user, in addition to adding additional properties, a way to extend the built-in Django Group object Is objection? With the user object, you can do the following: class UserProfile (models.Model): user = models.OneToOneField (user) and Add AUTH_PROFILE_MODULE = 'app.UserProfile' to the Settings.py file that is: Profile = user Objects.jet (id = 1) .get_profile () Is this group equal to this approach for the extension? If not, can I take an alternative approach? You can create a model, group, add your own fields, and add any custom queries to Use the model manager to return. Here is a small example, which shows that I am expanding the group to represent families associated with a school: from django.contrib.auth.models import groups, users Family Family Manager (models.Manager): "We set limited queries to families who currently enroll students, for example: Family: has_students.all ()" "def get_query_set (self): return ...

html - Is it "safe" to use schemeless protocol URIs on public websites? Ex. //www.example.com/dir/file -

इस सवाल का पहले से ही एक उत्तर है: 6 जवाब एचटीएमएल में छवियों को संदर्भित करते समय, सीएसएस, जावास्क्रिप्ट, इत्यादि ... मैं कभी-कभी http या https स्कीम भाग के बिना लिंक का उपयोग करते हैं। & lt; img src = "// www.example.com/dir/file.gif" alt = "" / & gt; और मेरे पास अभी तक किसी भी ब्राउज़र पर गड़बड़ी नहीं हुई है (मुझे पता है का)। मैंने देखा है कि कुछ अन्य सार्वजनिक साइट इसका इस्तेमाल भी करते हैं, लेकिन कई नहीं। मैं ई-कॉमर्स साइट पर इस सिंटैक्स के साथ Google jQuery सीडीएन का संदर्भ भी देता हूं: & lt; script src = "// ajax.googleapis.com/ajax/ .." प्रकार = "टेक्स्ट / जावास्क्रिप्ट" & gt; & lt; / script & gt; जाहिर है, मैं केवल ऐसा करता हूं जब मुझे पता है कि सर्वर के दोनों http और https क्षमताओं हैं तो मेरा सवाल है यह क्या नुकसान हो सकता है? क्या नुकसान या डाउनसाइड? यह किसी भी तरह से नुकसान नहीं पहुंचाएगा। दरअसल, यदि आप src = "http://ajax.googleapis.com/ajax/ .. लिखते हैं और आपका उपय...

C: Question about Beej's networking guide... Is there an assumption here? -

I was just going through the network through the networking guide and I'm curious about this part of the code (in particular "From here" "and" here "): // (Main; loop; // for read_fds = master; copy it (if selected (FDMX + 1, and READ_FDS, NOUL, NOUL, NOUL) == -1 (Returns ("Select"); Exit (4);} // Run through the existing connection that searches for existing data (i = 0; i & lt; = fdmax; i ++) {if (FD_ISSET ( I, and read_fds)) {// We've got one !! if (i == listener) {// addrlen = sizeof remoteaddr; newfd = acceptable to add new connections (listener, (stroke, Socador *) and remoder , And Adrilon); if (newfd == -1) {false ("accept");} Other {FD_SET (newfd, & master); // Add to master set if (newfd> fdmax) {// max Keep track of fdmax = newfd; printf ("selectserver: new connection to% s on socket" socket% d \ n ", inet_ntop (remoteaddr.ss_family, get_in_addr (struct sockaddr *) and remander), remote, IN...

ASP.NET Multithreadthing and timing out long-running operations -

I have a web service that needs to call for a database operation if the operation takes longer than 10 seconds So I need to get out of Operation and Rollback, I understand that it can only be done by preparing a thread to complete a long process and then it can end the thread if it takes longer is. Can you suggest how it can be done or I can be pointing to instances where such a situation is being managed. Formatting between asp.net and desktop applications is similar, can I use the threading concepts of a desktop application and apply it to a web service or there is no difference in it. Thanks I can tell you that this can be a serious headache . Finishing threads without your cooperation can create all types of undetermined and unpredictable behavior. But if you really want to do this, then starting a background thread in ASP.NET is like a net desktop application. The meaning of John is about threading not being similar to a desktop application, how only ASPNET engine han...

Can SQL Server Compact be used as both a Source and Destination in SSIS? -

I am thinking that the SSL server compressed version can be used as a source and destination in an SSIS dataflow. I know that I can set up a SQLMOBILE Connection Manager, and I have got some information that mentions it to be used as a destination, but nothing to use it as a source. What I have to do is transfer data from one SQL Server compact file to another. This OLE DB can be used. The problem is that SQL Server CE OSE is not supported by the SSIS user interface to create DB connections. But it is possible for some to make an OLE DB connection, and then manually using the property window changes the connection string. And of course, change the name of the connection. The connection string may be something like: data source = "d: \ path \ mydb.sdf"; Provider = Microsoft .SQLSERVER.CE.OLEDB.3.5; Of course, the provider must match the SQL Server CE version to use the field. It is possible to make an OLE DB connection for each SDF database file. It is...

css - Changing content of php page -

I wanted to know if there is something like a content holder in PHP ... as we use in asp Are there. I have my index.php and I want only one part if the page is updated, then I am using CSS. I was thinking about making a copy of index.php, for example, where to register.php again to change the CSS tags, how is it done? There are parts that are fixed in index.php. For example: list categories, sub categories I now want to apply a registration section. The list of categories should still be and should change the part of index.php. ASP Object outside the net box is oriented, while PHP is not. As such, there is no native "placeholder" for PHP if you want this kind of functionality, you should use the MVC framework such as Or, you can create your own plain template. For example, here's a simple page: & lt; Php include ("header.php"); Included ("navigation.php"); ? & Gt; & Lt; H1 & gt; About us & lt; / H1> & Lt; P ...

Is there a way to find the cardinality (size) of an enum in C++? -

Can someone write a function that gives the number of elements in an enum? For example, I have defined: enum E {x, y, z}; Then F (E) returns 3. no If this happens, you will not see so much code like this: enum E {VALUE_BLAH, VALUE_OTHERBLAH, ... VALUE_FINALBLAH, VALUE_COUNT} Note that this code is also an indication for the solution (bad) - if you add the last "guard" element, and clearly do not tell the value of enum areas, the last "COUNT "Element will be the value you are looking for - this is because the enum calculation is zero-based: enum B {ONE, // in value = 0 two , in the value = 1 THREE, // in value = 2 COUNT // in value = 3 - without Een cardinality}

c++ - Center an OpenGL window with GLUT -

I have an open GL window which is 640x480 which I need to center in the center of the screen. I used previously: glutInitWindowPosition (GetSystemMetrics (SM_CXSCREEN) -640) / 2, (GetSystemMetrics (SM_CYSCREEN) -480) / 2); what worked but now when I compile ... linking ... 1> Project1.obj: Error LNK2028: Unsolved Token (0A000372) "extern" function "int __cdcl main (int, four * *)" (? Main @@ $ $ hayapppad @ z) 1 & gt; Obj: Error LNK2019: Unsolved exotic symbol referenced in the function "int __cdecl main (int, char * *)", "extern", referenced in Project 1, "int __standard GetSystemMetrics (int)" (? GetSystemMetrics @@ $$ J14YGHH @ Z) C "int __stdcall GetSystemMetrics (int)" (GetSystemMetrics @@ $ $ J14YGHH @ Z) "(? Main @ @ $$ HiPPP @ Z) 1> C: \ user \ My Computer \ Document \ School Content \ CS445 \ Project1 \ Debug \ Project1.exe: Fatal error LNK1120: 2 unsolved embedded Any help please, it ...

JavaScript: Closures help -

In this I have an empty .js file that contains this code: cart. CheckoutNow = {...} // alias if (TypeTouchNow) === 'undefined') {CheckoutNow = Cart.CheckoutNow; } And {warnings ('checkout now has a variable already in the window.'); } How can I see the // alias code at the top of the page, but it can execute after the cart. Checkout is now declared? This will work, but I do not like that you have to call the following warning (): alias = function () {if (typeof ( CheckoutNow) == = 'undefined') {CheckoutNow = Cart Checkout now; } And {warnings ('checkout now has a variable already in the window.'); }}; Cart Checkout = = {...}; Aka (); Without explanation why you are trying to do this, I'm going I think that this is a better code for the organization. If this is the case, I will split your JavaScript into some files on this pattern, and will be included in your page in this order: // namespace.js if (typeof cart === 'undef...

php - What are the bones of a Powerful CMS -

I am working to improve my own CMS in a company, if you make your own CMS As far as I know these things can be most important: Template Engine (Capacity of caching) A php framework (znnd) A javascript framework OOP coding style Security issues (I do not know that How to do An auto updater script (thinking how I can do it) PHP4 / PHP5 > MVC Multiple DB ORM DB Objects Caching Templates Validation Ajax Math Module Module EDP Routing

partitioning - Programmatically name FILEGROUP in SQL server? -

I am trying to write a stored procedure which will create a new FILEGROUP based on a set date parameter. What I see is a 'FILEGROUP' which is called something like '2010_02_01' What I get is 'PartitionName' called 'FILEGROUP' Optional Process (DBO). [SP_CREATE_DATE_FILEGROUP] @ DECLARE @ PartitionName as a Participation Date VARCHAR (10); BEGIN SET @partitionName = REPLACE (left (convert (VARCHAR, partition date, 120), 10), '-', '_'); Change Database MSP Location Location FIREGROUP [@PartitionName]; END You're about to end using it to use sp_executesql Announce something like @ sql nvarchar (4000) setl @sql = 'ALTER DATABASE MSPLocation ADD FILEGROUP [' + @ PartitionName + ']' exec sp_executesql @sql

Convert public/private key strings to RSA xmlstring -

itemprop = "text"> My partner gave me an RSA public key which looks like this: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKCScKK + roLfbUYf6PGNIf6Ej8R5EqSTjlRABTu7T0FxR / B6iurI80jktW9 + ZKu4jFnFJ8oYx24raD3x5KhJZR2VCBEEbtYpPq / 5E25v + LIKFbx8sNkMvEACZdAWyeQcEookGfKDER4PGrB35bntcO2SnItTZc8BOI3jAOBXTeBO16NwIDAQAB I know that the modulus and exponent in a public key, I have seen an XML RSA key file; But I do not know how to remove those parts with this simple string. Can anyone know what I am trying to do? This is a base-64 encoded topic PublicKinfo (see) for an RSA public key written in That is, as you saw, an RSA measurement and public exponent.

c# - Develop a similar to Microsoft's 5 star developer exam soft? (Quiz Engine) -

I have a project where I need to make an ASP.NET application similar to Microsoft's 5 Star Developer Exam. I mean there should be many questions with many options, some questions have only one correct answer and some others have many correct answers. And time-controlled is obviously a DB where everything is to be stored and to keep historical data. Is there something already free on FWK 3.5C #? Is there any structure already made, I need to speed up the project time, if something has already been done, can I use it for my project? Are you clearly working in MS Frame so that you have seen the Semblio? This is a new (ISH) MS product for creating interactive course content. It appears to integrate with NAT etc. Comes to SDK with prebuilt templates etc.

qt4 - QProgressBar Error -

I am trying to add QProgressBar to my code, but there are some problems. I have to go through the designer and in the code progress bar added, I QprogressBar object to do with the pointer on a separate thread because it QProgressBar updated as data processing, however, I get this message: ../../src/xcb_lock.c: 77 : _XGetXCBBuffer: intent (`(int) ((xcb_req) - (dpy-> request))> = 0) 'failed i am Ubuntu 8.10 (2.6.27-11) on Qt-4.5.0 L am. I also tried QT-4.3.5 in RHEL 5 (2.6.18) and I got a different error, some error, like the X error, like the QPaint error, it seems that when I start with my main app edition loop I update the progress bar. Please help Nimesh QWidget class And all its subclasses, which contain QProgressBar , are not reentrant and can not be used outside the main thread. See the following document: You are getting errors because you are trying to update QProgressBar from outside the main thread. The preferred method of updating the progress ...

java - Can i use JCheckbox to show "mixed state" -

It is possible to grade the jackfxbox in windows, to show that the collection of data that does not display all the items The same value Is it also possible with a Junkbox? how to do this? There is no way to do this.

c# - Difference between Covariance & Contra-variance -

I am having trouble understanding the difference between empathy and immorality. The question is, "What is the difference between sympathy and corruption?" Sovereignty and depravity are the properties of a mapping function that connects one member of a set with another. More specifically, a mapping can be a cult or anti in relation to relationship on that set. Consider the following two subsets of the set of all C # types. First: {animal, tiger, fruit, banana}. And secondly, this is clearly related to the set: {IEnumerable & lt; Animals>, IEnumerable & lt; Tiger & gt;, IEnumerable & lt; Feet & gt ;, IEnumerable & lt; Banana & gt; } There is an mapping operation from the first set to the second set. For each T in the first set, in the second set related type IEnumerable & lt; T & gt; . Or, in a nutshell, mapping T → IE & lt; T & gt; . Note that this is a "thin arrow". So far with me? ...

video - I want to start Qt -

I want to know the best source to know Qt I found some books but I believe the video is more attractive to me Do you have any information about Qt learning video? If you have a presentation or something like this then I would be very happy. There are people for training Qt also comes with very good examples / html>

How do I create a Unicode directory on Windows using Perl? -

मुझे यूनिकोड युक्त निर्देशिका नाम बनाने में संघर्ष है मैं Windows XP और Perl Camelbox 5.10.0 पर हूं। अब तक मैं का उपयोग करने के लिए फाइल :: पथ qw (make_path) को निर्देशिका बनाने के लिए किया था - जो जब तक ठीक काम नहीं करता फाइल के लिए Win32API :: फ़ाइल qw (CreateFileW) फ़ाइल नाम UTF-16LE एन्कोडेड है तो ठीक काम करता है। क्या निर्देशिकाओं के लिए कुछ समान है? यद्यपि यह अस्तित्व में नहीं है तो यूनिकोड पथ को बनाने के लिए या शायद एक पैरामीटर CreateFileW को बताने के लिए? धन्यवाद, नीले CreateDirectory और दोस्तों को एक इंटरफ़ेस प्रदान करता है: Win32 :: CreateDirectory (डायरेक्टरी) डायरेक्टरी बनाता है और सफलता पर सही मान देता है विस्तृत त्रुटि सूचना के लिए विफलता पर $ ^ E की जांच करें। निर्देशक में सिस्टम कोडपेज के बाहर यूनिकोड वर्ण हो सकते हैं। निर्देशिका बन जाने के बाद आप Win32 :: GetANSIPathName () का इस्तेमाल कर सकते हैं, जिसे सिस्टम कॉल और बाहरी कार्यक्रमों में भेजा जा सकता है। पिछला उत्तर : नोट: इसे रिकॉर्ड के लिए यहां रखते हुए क्योंकि आप सीधे...

objective c - How to insert data into a SQLite database in iPhone -

I'm new to iPhone development. I want to include some data in my database and want to retrieve it and I want to display it in a table. I've created database data. Sqlite with table 'user' in the table there are two values, id (varchar) and name (varchar). I have inserted 3 rows of data in the table "Enter user value ('1', 'xxxx');" In the terminal window I "testDb" made a navigation-based application, I have two ways - (void) Make editableCopyOfDatabaseIfNeeded {NSLog (@ "make editable copy of the database"); // First, test of survival success success; NSFileManager * fileManager = [NSFileManager defaultManager]; NSError * error; NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, yes); NSString * document directory = [path item overindexx: 0]; NSString * writableDBPath = [Document Directory stringBapensitting path comparison: @ "Dataciclit"]; Success = [file manage...

flex - call from Javascript to ActionScript -

There is no way to call javascript to not use JSON objects. Thanks, Sun The external interface can be your friend: or (I'm not sure the second link will work, though ...)

layout - css sticky footer without scrollbar -

How to remove the scroller from the sticky footer at the bottom of the page (not below the window)? When I extract the content and height = 100% from the sidebar, I am no longer taking scroller. However, while doing so, my content and sidebar do not fill up all the places in the footer. DOCTYPE HTML PUBLIC "- // W3C // DTD XHTML 1.0 Transcription // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Meta content = "text / html; charset = UTF-8" http-equiv = "content-type" /> & Lt; Title & gt; Untitled 13 & lt; / Title & gt; & Lt; Style media = "all" type = "text / css" & gt; * {Margin: 0; Padding: 0; } Html, body, # wapar, look {height: 100%; } #wop, #footer {width: 750px; Margin: 0 auto; } #wap {background: # CFF; } Html, body {color: # 000; Background: # a7a09a; } Body ...

java - How to generate meaningful list names in JAX-WS web services -

मेरे पास & lt; xs: element ref = "आइटम" minOccurs = "0" maxOccurs = "unbounded" / & gt; और इसे मेरे wsdl में संदर्भित किया गया है। जब मैं जावा कोड बनाने के लिए wsimport का उपयोग करता हूं, तो कक्षा को सूची & lt; आइटम & gt; आइटम; क्या इस क्षेत्र को आइटम या itemList जैसा कुछ और अधिक मानक नाम देना है? मैं xs: element वस्तुओं का नाम नहीं देना चाहता हूँ क्योंकि तब मुझे आइटम नामक वर्ग मिलेगा, जो कि उतना बुरा है। ठीक है, ऐसा लगता है कि इसे हल करना है: इसके बजाय & lt; xs : तत्व रिफ = "आइटम" minOccurs = "0" maxOccurs = "unbounded" / & gt; मैंने उपयोग किया & lt; xs: जटिल टाइप नाम = "आइटम" & gt; ... & lt; / x: जटिल टाइप & gt; & Lt; xs: तत्व का नाम = "आइटम सूची" प्रकार = "आइटम" minOccurs = "0" maxOccurs = "unbounded" / & gt; जिसके परिणाम स्वरूप कोड: सूची & lt; आइटम & gt; सामान की सूची; ...

java - How to start a local port on user's computer (Edited question) -

In the past, I have not been able to prepare my question clearly. This will try my last time = | Actually, I want to do something like this website: They are providing an IFrame which points to a port on the local host. You will not see anything in the iframe if you do not have the applet running (which can be found here: ninjavideo.net/applet.php). I want to write a script which is some applet PHP is doing, but I do not think that they are only using php code because it will not run on computers that do not have php installed. Do you think they are using Java / C to do this? A is basically a piece of java code by a webpage It is served and is believed to be used on the client machine. You can get more information about applets if you are also green for Java, then I would advise to go ahead. This is serving the applet code to the PHP script server so that the client can download it.

c# - Why must "stride" in the System.Drawing.Bitmap constructor be a multiple of 4? -

I am writing an application for which I should take a proprietary bitmap format (an MVTEEC HLMJ) and convert it to a system Drafting in C # Bitmap Only one of the proprietary functions given to help me include writing to file in addition to the use of the "get pointer" function. This function is very good, it gives me a hint for pixel data, width, height and type of image. My problem is that when I make my system. Drawing Constructor using bitmap: New system. Drawing Bitmap (width, height, stretch, format, scan) I need to specify "stride" is a valuable value of 4. This can be a problem because I'm sure what type of bitmap will hit my function I believe I end with a bitmap of 111x111 pixels, I have no way to run this function except for adding a bogus column to my image or subtracting 3 columns. Is there any way I can sneak around the boundaries? It goes back to initial CPU designs the fastest way to crack through bitmap bits When starting ...

url - JavaScript: Replace hexadecimal character -

I have a string like "% 2Fu% 2F2069290% 2F" in JavaScript (extracted from Gone) a web page). How do I get a human-readable version of that string? short version : decodericompany () Use the. Tall version : You can use unescape () in the old versions of JavaScript, but it has been removed because it only has LATIN1 / Works fine for ISO8859-1 codeet, so you actually want to use decodeurIComponent () , which is supported by all modern browsers. var c = decodeurIComponent ("% 2Fu% 2F2069290% 2F"));

ASP.Net User Control Event Bubbling (C#) -

Thank you very much in the past I have done my due diligence and have researched for 2 days, but I think online tutorials I can not wrap my mind around the description of Status: Lead programmer up and quit the firm's owner know that I have some (novice) to wire functionality between written two custom user control on the side of VB.NET and me intranet app (Written in C # - a small idea to answer professionals - I'm fluent in Visual Studio ... but still learning C #). Here is a simple description of control, but we hope that we can go in the right direction: UserControl_1 contains multiple linkbutton when clicked, then in UserControl_2 one should change the value of the SelectParameter selected ObjectDataSource: & asp: LinkButton ID = "OpenBtn1" runat = "server" text display = "Open Request" / & Gt; & Lt; Asp: LinkButton id = "Closed Btn1" runat = "server" text = "Show closed request" /> Use...

sql - creating function using newID() -

मुझे यह त्रुटि हो रही है: कोई विचार? साइड-इफेक्टिंग का अमान्य उपयोग या फ़ंक्शन के अंदर 'न्यूड' में समय-निर्भर ऑपरेटर। मैं MS-SQL Server 2005 के साथ काम कर रहा हूं। यहाँ टी-एसक्यूएल स्टेटमेंट है: फ़ंक्शन बनाएं [डीबीओ]। [गेटन्यूएनम्बर] () रिटर्न पूर्णांक के रूप में आरंभ करें @ कोड इंट सेट @code = (SELECT CAST (newid () AS द्विआधारी (3) के रूप में)) रिटर्न (@ कोड) END फ़ंक्शन आपको नईआईडी का उपयोग नहीं करने देगा, लेकिन इसके आसपास काम किया जा सकता है। दृश्य चुनें vwGetNewNumber के रूप में चुनें कास्ट (कास्ट (नया () () (बाइनरी AS) ) के रूप में) प्राथमिकता के रूप में) समारोह बनाएँ [डीबीओ]। [GetNewNumber] () आरएएस के रूप में शुरू होता है घोषित करें @ कोड इंट vwGetNewNumber रिटर्न (@ कोड) END से शीर्ष 1 @ कोड = NextID चुनें फिर आप का चयन करें dbo चुन सकते हैं। [GetNewNumber] () के रूप में योजना बनाई।

XML and C# - Help pulling information from a certain element -

So I do not know this at all about the word, but here it goes. Now my application can pull information about XM user without problem. Sample XML: & lt; Status type = "array" & gt; & Lt; Status & gt; & Lt; ID & gt; ID1 & lt; / Id & gt; & Lt; Text & gt; The text that I read at 1 & lt; / Text & gt; & Lt; Users & gt; & Lt; Name & gt; User 1 & lt; / Name & gt; & Lt; SCREEN_NAME & gt; User1_Screen & lt; / SCREEN_NAME & gt; & Lt; Location & gt; Location_User1 & lt; / Location & gt; & Lt; Details & gt; User1_Description & lt; / Details & gt; & Lt; / User & gt; & Lt; / Status & gt; & Lt; Status & gt; & Lt; ID & gt; ID2 & lt; / Id & gt; & Lt; Text & gt; The text that I read at 2 & lt; / Text & gt; I want to stretch. & Lt; Users & gt; & Lt; Name & gt; User 2 & lt; / Name & gt; & ...

Get Qt to use the native Windows copy file widget -

Using the actual folders used as an example, I want to get the following two widgets in QT (backend Files are similar, but the file system is not quite right): and I know that QT can save the country saved-file widget (using QFileDialog still methods) , But this folder can be copied / copied file In areas as well? Any suggestions? You may have to call Windows directly for it, it should be possible that your GCC or MSC Use the + compiler You will need to fill up the SHFILEOPSTRUCT , but it should not cause too many problems.

c++ - creating arrays in nvidia cuda kernel -

Hello, I wanted to know whether it is possible to do the following in the Nvidia Kuda kernel: __global__ zero count (long * C1, long size, ...) {... long D [1000]; ...} or lower __global__ zero count (long * c1, long size, ...) {... long D [ Shape]; ...} You can do the first example, I have not tried Second . However, if you can help it, then you want to do this to give your program a new look. You do not want to assign 4000 bytes of memory to your kernel. This will be a great use of CUDA local memory, because you will not be able to fit everything in registers. CUDA local memory is slow (400 cycles of memory latency).

Named arguments: C# vs Python -

Both C # and Python allow the designated arguments, so that you can write something like this: foo (bar) : 1) . This is great, especially in combination with alternative arguments. My question is: What are the differences between C # and Python, if any? I do not have any interest in what is "best", but there are differences and possible motivations behind these differences. And if someone knows the differences with other languages ​​"This feature (ruby or purpose-maybe, maybe), it can also be interesting. Edit to create CommunityWiki Not only does Python allow you to capture the given logic of the unspecified name in a specific word, but instead lets you open a trunk in the arguments: & gt; & Gt; & Gt; Diff F (alpha, beta, gamma): ... print alpha, beta, gamma ... & gt; & Gt; & Gt; F (** {'alpha': 1, 'beta': 2, 'gamma': 3}) 1 2 3 and pass them the stream below: & gt; & Gt; & Gt; Diff ...

xml - How can I escape HTML character entities when using ColdFusion function XMLFormat()? -

मेरे पास HTML का निम्न ब्लॉक है: & lt; p & gt; त्वरित ब्राउन लोमड़ी आलसी कुत्ते पर कूदता है & mdash; आलसी कुत्ते पर त्वरित भूरे रंग की लपट लटकता है। & Lt; / p & gt; & Lt; p & gt; त्वरित भूरा लोमड़ी आलसी कुत्ते पर कूदता है & mdash; तेज, भूरी लोमडी आलसी कुत्ते के उपर कूद गई। & Lt; br & gt; त्वरित भूरा लोमड़ी आलसी कुत्ते पर कूदता है & amp; mdash; तेज, भूरी लोमडी आलसी कुत्ते के उपर कूद गई। यह मान्य XHTML नहीं है हालांकि, मुझे इस HTML को XML दस्तावेज़ में शामिल करना होगा। & lt; से & amp; lt; और & gt; को बदलने के लिए XMLFormat () का उपयोग करने की कोशिश की और के लिए, जो महान काम करता है दुर्भाग्यवश, यह और से और amp; amp; mdash; को रूपांतरित करता है, जो मान्य नहीं है और सीएफ़एक्सएमएल टैग में एक अपवाद फेंकता है। & lt; cfxml चर = "myXML" & gt; & LT; सामग्री & gt; #XMLFormat (myHTML) # & lt; / सामग्री & gt; & Lt; / cfxml & gt; मैं यह कैसे काम करूं? आपके पास कुछ विक...

vim - How to let cscope use absolute path in cscope.out file? -

After loading a cscope.out in veem, I see the Vim's "PWD" in the same directory as cscope.out Is required under the file, which may be due to the path relative to the use of that cscope while generating the tag file. So if there is a way to force cscope to use the full path in your tag-cscope.out, then this is the PWD of your non-session session, similar to that directory, which is under cscope.out file. / P> When you import cscope.out, you can supply the prefix, i.e. : Cscope /path/to/cscope.out/path/to/ src / code add Then your searches will be turned on: Cscope Tags: foobar # line filename / context / line 1 21 / path / to / src / code /foobar_file.c

jquery - php + jqgrid + export to excel -

Is there a way to export data from jqgrid to Excel? I report this using a jqgrid which I think is weird but I need to save or print this report in some way, because information is kept. Does anybody know anyway ?? This is my view, just add this code to your js / html file JqGrid ('navGrid', '#pager', {visible: true, del: wrong, add: wrong, edit: wrong, excel: true} ) .NavButtonAdd ('#pager', {caption: "Export to Excel ", Buttonon:" UI-icon-save ", onclick button: function () {exportExcel ();}, position:" last "}); Function Export Excl () {var mya = New Array (); My = $ ("# list") getDataIDs () .; // Get all IDs var data = $ ("#list"). GetRowData (mya [0]); Get the first line to get // labels var colNames = new Array (); Var ii = 0; (Var i in data) {colNames [ii ++] = i;} // capture call name var html = ""; (I = 0; i & lt; mya.length; i ++) for {data = $ ("#list"). GetRowData (Ma...

c# - Performance Counters not being released -

All: I am using some custom display counters that I have created, Examples are, with the lifetime of "process". Problem: When I VS I want to debug in, if I stop this process and start it again, then I get an exception when my code attempt to make my display counter an exception indicates that extremist counters are already present and I can not make them until the ownership process is issued to them. Once I get this error, there is only one way - I have to shut down and restart the Visual Studio - it seems that VS My process gets ownership of the Lifetime Performance Counter, though it was actually made from the proprietary process. With any thought what can I do about it? BTW: The problem only appears when my code actually writes to a display counter before it's switched off. I think that you are fighting with the hosting studio hosting process, it is a subsidiary. Which hosts CLR to improve debugging experience, whenever you get a project loaded in VS,...

user interface - Dock a control in native C++ -

I know how to do this. Net but in Basic Win32, how does one control? Thanks Dock it at the bottom of your original window You write a code to do this, or use a library that uses that functionality. If you intend to use raw Win32, handle the WM_SIZE message for the container, calculate where the tracker should be, and put it there. Roughly (0, height-trackbar_height, width, trackbar_heite). Apparently, still visiting.

Run multiple java main methods in eclipse -

I am running Eclipse 3.5 and I have a constant problem that I have 6 -7 clicks to test my program. Instead, click the Play button. The problem is that I am writing a networking application and thus I have run configuration for "server" and "client". Then, to test my program, I have to start the server, then a customer, then another client etc. Is it automated automatically in a run configuration? You can call the main method directly to any class, for example, if you have a server and client class and you have a If you want to run the server and two clients, then this is what you can do. public class server {public zero main (last string .... Args) {last server s = new server (); S.config ($ args); S.run (); }} Public class client {public zero principal (final string ... $ Args) {end customer C = new customer (); C.config ($ args); C.run (); }} Public class Test_ServerClient {Public Zero Main (last string ... $ Args) {Server.main ('server1.cfg');...

sign in with google account in asp.net -

I am currently using this example in the URL so that I can access the website using my Google website. This example uses url What is the other way to log in through a Google Account other than using a contact feed? please tell me. Google OpenID supports DotNetOpenAuth.

How to start process over ssh that doesn't terminate when session ends? -

Is there a way to start the process using ssh, when the ssh session is ending? I want a job to run on the computer, which is running in SSH IND without me having to open the connection. You can use (assuming you're SSHing in * Nix Server)

project management - If you could add only ne tool or Process -

Let's make a company that is probably doing the wrong thing in relation to software development. We believe that management, which imagines falling software from trees, furiously accepts that there may be a small problem and eventually "try something" For everyone is ready. Some should be free (in dollar form) and "non-disruptive" Actually, if you choose something for nothing, it does not mention it in your next performance review. (Because the dear leader will take credit), but you may get the privilege of giving a second "some" suggestion to "try" (of course, if you choose, wrongly, management will shoot a puppy and A cat Chcha will put the whole thing would be over already than your Hordn-Death March). Choose wisely because you have only one option And for thinking of removing any person as being subjective, I can only say that " You are unmarried parents of your lucky children, your fellow developers and project managers...

windows - How do backup apps which create a system image handle disk changes during the image creation process? -

I created a backup disk image of my disk yesterday and the software told me that this process has been asked to close all Windows programs Successfully I did this, but I was wondering what happens when some programs still write for the disc, even during this process. Windows 7 is a complex system and of course, various log files and these are continuously written (the disk has a partition in which Windows is also installed). What is the algorithm in this case? Microsoft calls snapshotting, or 'shadow copy',

Python: convert script from procedural to OOP style -

I have written that this easy munin plugin has been written for the average fan speed of the graph and I have it in OOP again I want to - strictly as a drill to learn. There is no clue, although where to start, it seems like giving some directions to anyone or even an example of how this script should appear, when it is done, I will call it another script again I will use it again in OOP style; For re-learning purposes. Import System Import Subprocess CMD = "/ USR / SBI / Omerport Chassis Fans" .split () #Munein sys.argv [1] to "" (an empty argument), remove it . Sys.argv = [xs.x for X in sys.argv] if len (sys.argv)> 1: If sys.argv [1]. Liquid () == "Autoconfig": print "Autoconfig" alip sys.argv [1]. Flowers () == "Config": Print "Graph_title Average Fan Speed" Print "Article - Base 1000-L" Print "Graph- Level Speed ​​(RPM)" Print "Graphic Chassis" Print "Graph_Inffa This article sh...

Combining Java and C without gcj -- move C to Java or Java to C? -

First of all, I have no experience doing this. But like the introduction of any good program, I have a problem that needs to be corrected, so I am ready to learn. So many of you are already familiar with PDFTK, different PDF-related tasks, as far as I can tell that most of these features are available in newer, lighter libraries / extensions Available, except for one (and perhaps its only reason still exists): Merge form data files (FDF and XFDF) with a form, PDF and output as a new file. The problem is that my server does not have GCJ, which is fundamental to creating / compiling PDFTK. I do not know if this is because I am on Solaris or if it is due to some other Sesadmin level, but I am not getting GCJ anytime soon. And as far as I can get there, there are no pre-compiled binaries for Solaris. So I think the Mac file and C code can be rewritten to import the Java Library. ) Straight through Javac. But I'm not sure where exactly to start from. I know everything: Wh...

denormalization - Cyclic reference in a database table -

I am quite ashamed to ask this, but recently there is a situation where I have three different one another Explain to me the types of banking institutions related to Imagine a bank table that contains details of a regulated bank or a regular bank, which operates rural branches or rural branches operated under the branches of this bank or retail bank which does not fall In this hierarchy but only with the rural branch. Earlier, I decided to keep 4 separate tables for the barriers of the FK (i. One governing bank, In the operation of branches, rural branch and retail bank branch) one. But since I went to create a communication table, I was confused because there could be a transaction between any of these institutions (example: rural branch and retail branch, etc. among rural branches etc.) it meant that I Only record the "source"; The 'Destination' ID of the banking unit, but to keep some data, the application logic to determine which queries are included for t...

sql - Why does Perl's DBIx::Class $resultset->update fail on complex search queries? -

I have a Pearl search that looks like this: My $ rs = Shift- & gt; Search ({-and = & gt; [{'for_revocation' = & gt; 1}, [{status = & gt; {'no_in' => ['abort', 'abort']}}, {status = & Gt; Canceled, update = & gt; {'& lt;' = & gt; \ 'Now () - Interval 1 hour'}},]]}); And then I do .. $ rs-> Update ({status = & gt; 'Revoke'}); but I get an error ... DBI Exception: DBD :: mysql :: st Execution Failed: There is an error in your SQL syntax; To use the statement '1' near '' REVOCATION '' for the correct syntax, check the manual related to your MySQL server edition [for the statement "update wmv_attempt SET status =? WHERE (RERE (0xadf93a8 ) For REVOCATION?) With "ParamValues: 0 = 'cancel', 1 = 1] (eval 20 9 38) line 1 If I enter $ rs- > Gt; It looks like using the as_query () to search the SQL: It looks like: SELECT .... from...

c# - Object graphs and web services -

I'm really new to web services and need to create a webservice that can deal with the object graph. My statutory example would be a CRM web service giving a customer number and returning the "object" of a type of company with the property of contact. Service: Public category company {.... public list & lt; Contacts & gt; Contact {get} {...}}} It would be great to be able to create a web site so that it can be easily used with Visual Studio so that it can work directly Company and related contacts ... Is this possible? Thanks Friedrich Instead of web services of ASMX, you (WCF) Using it will be better. With this, you can define data contracts with such characteristics: [DataContract] public class company {[datamember] public contact [] contact {Get; Set; }}

sql - Select Count(Distinct Value) returns 1 -

I am preparing a query in 2005 which looks something like this: SELECT COUNT (separate column name) from the table where the call is not named When I run the query with COUNT (), this value returns 1. When I run it without COUNT () , Then the SSMS report is correct, such as 212 records. The column datatip in question is of numerical (16, 0). For those people who can ask, the query is completely: vnrolment at vEmployers INNER from SELECT COUNT (DISTINCT O_ID) O_ID = E_EnrolmentEmployer WHERE E_START & gt ; = '01 -AUG-2008 'and' E_START & lt; '01-AUG-2009 'and' O_ID 'are not in zero and O_ID (select O_ID from vEmployers on Violomment OIID = E_EnrolmentEmployer WHERE E_Start & lt; '01 -AUG-2008' and e_start> gt; = '01 -AUG-2007 ') This query basically gives a professional shape to repeat between the two 12 months period. So I'm surprised that "COUNT (separate column name)" 1 is specifying ...

cocoa - Using CoreData with an object? -

itemprop = "text"> This is an introductory question: Every tutorial I supported on the database on the coreata has an object model with all the relationships and whatnot I have seen Start out with drawing But my app will be like a simple drawing app, the Illustrator light or the Omnigraphle looks. I have an object in the memory for the page and after that there are many element objects. How do you use cordata for this? I just do not need an ending code, only signs or thoughts. Every program design starts (or should start) data model . The data model stores not only the data for the program but also the logical connection between the pieces of the data. The data model is the guts of the program and everything else is one or more interfaces which displays the data model in some way. Take the example of a simple drawing program that pulls a polygon. Logically, the program will start with a document. In core data this data will be represented by a document unit...

Concatenate multiple CSS files into one -

What is the best way to add multiple CSS files to a CSS file? I want to reduce the following .. & lt; Link href = "css / 1.css" rel = "stylesheet" type = "text / css" media = "all" & gt; & Lt; Link href = "css / 2.css" rel = "stylesheet" type = "text / css" media = "all" & gt; & Lt; Link href = "css / 3.css" rel = "stylesheet" type = "text / css" media = "all" & gt; .. in .. & lt; Link href = "css / 1-3.css" rel = "stylesheet" type = "text / css" media = "all" & gt; Just do cat css / *. Css & gt; CSS / 1-3.css does not move. Long because cat -method has three referenced CSS in HTML file Order matches the arguments for the cat from the original order of files Lt; Link href = "css / one.css" rel = "stylesheet" type = "text / css"...

java - Check if a file is an image -

I am using JAI and am making a file on it: Plain Image IMG = JAI ("File Load", MyFileName); When the file exists, I check it before the line. The image magnetic project has the ability to identify the image and there is a Java cover for the image magic , Which is called JMK, which I think you might want to consider instead of changing the wheel again: I am using image magics all the time, It also includes its "detection" feature from the command line and it has failed to identify a photo. It needed that feature completely and JMG had not yet existed, but I used to command Java code for Runtime.XAC () ImageMagick identity And it used to work perfectly. Nowadays, JMG has existed, perhaps it is not necessary now (but I have not tried JMGC yet). Note That it just gives more than the format, for example: $ Identification tmp3.jpg tmp3.jpg JPEG 1680x1050 1680x1050 + 0 + 0 Direct class 8-bit 293 $ 582kb $ detection tmp.png tmp.png PNG 1012x90...

Strategies for testing multi-user desktop application -

We are developing multi-user desktop applications with C # 3.5, Windows Forms and SQL 2008. Examination - 1) Execution - How does the user behave when they are accessing multiple database databases? 2) How to simulate a conflict, and test how the user is helping the user. Thanks We need to see that the application db level I will suggest for the stored functionality SQLQueryStress - Using the SQL Server Query Performance Testing Tool How to communicate with the Web services or stored process calls Alternatively, if I suggest using a VSTT test through web services, get good information of VSTT and > SQL 2008 has data services - stored exposures You work as a web service

jquery - Html to image in javascript or python -

Just a dumb question ... is there any way you can create an image, say PNG, the contents of an html With the page, with a simple click of a button? Thanks to anyone who answers Thank you for your reply but what I need is a JavaScript or Python code that allows me to create an image from a table or a device. Here is the code: It's WebKit Requires the best works on Xvfb (or X) and Qt4, and Ubuntu.

html - How to customize error output in Zend_Form for table layout -

"itemprop =" text "> I need the following form layout for output: This element and label is required to be centered vertically and the errors must be with the same indentation as the element. Can I get it with the use of this decorator or may I need to change my markup? After the You will use the decorator. For the most straightforward example of a custom decorator, especially check out the My_Decorator_SimpleInput Decorator. So you can do something with rows of My_Decorator_SimpleInput Zend_Form_Decorator_Abstract {protected $ _format = '& lt; TR & gt; & Lt; TD & gt; & Lt; Label for = "% s" & gt;% s & lt; / Labels & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Input id = "% s" name = "% s" type = "text" value = "% s" /> & Lt; / TD & gt; & Lt; / TR & gt; '; Public Function Render ($ content) {$ element = $ this- & gt...

Javascript/CSS Rollover menu -

My previous customer contacted me about doing a rollovers menu for my website. They have two different businesses, and want to create an image menu from their main site, which shows the links to each of their other businesses and their sites. I know it is possible to make a rollover menu using Javascript and CSS, but one thing he asked me, I'm not sure. To quote him: I basically want to be the only one who is big and bright. I think it would be clear if they spin like conveyor belt. For example ... if I have 10 businesses but there are only 5 shows on the page ... as if the person clicks the mouse over the "over button" or clicks, then the next business graphic Will reveal. Is this possible? Is there a big project to do something like this? How can I go about doing this? Looks like a carousel there.

vb.net - "Reference required" error when referencing NServiceBus assembly from another project -

We are trying to write an application that uses the NServiceBus library in a VB.NET environment. We have been obstructed by errors like the following: Essential reference to the assembly 'Ensebes, version = 2.0.0.1071, culture = neutral, public keynote = 9fc386479f8a226c' implemented interface 'NSSRSBIS IMessageHandler 1 '. Add one to your project. Our project is already included in the same NServiceBus 2.0 RC2 distribution in the context of NServiceBus.dll and NServiceBus.Core.dll. Steps to reproduce: Create a new VB Class Library Project (.NET 3.5) Forms of References Add NServiceBus.dll and NServiceBus.Core.dll. Place the following code in Class 1: Import NServiceBus.Sagas.Impl Class Test Folk Function (Fu) Return as SagaMessageHandler Nothing End Function Closing Class You should now see the above compiler error. There are no compilation errors in the same project written in C #. How about any idea about solving this problem? (And, yes...

c - Setting std=c99 flag in GCC -

I was wondering if there was a file in which I could set the -std = c99 flag So that I do not have to set it for every compilation. I am using GCC 4.4 on Ubuntu. Instead of calling / usr / bin / gcc , Use / usr / bin / c99 . This is the single-unix-approved method of implementing a C99 compiler on a Ubuntu system, it returns a script that is to add GCC to -std = c99 flag After saying, that is exactly what you want.

c# - Custom Paging Repeater Control next and previous events happen after databind -

To I have inherited and paging functionality of a custom repeater control repeater, but when I click the next page button for the first time It does refresh the control, but if I do not change it then it changes the page completely after that click the page. I know what that problem is, when I next button it does a postback, then after that the NextButton event is controlled, the data is bound to the repeater, and so on. Is there any way I can change the order of page load events ?? Or is the event controlled after reloading ?? Repeater forced I have included my custom repeater class bellow: using System.Web.UI.WebControls; Using System.Web.UI; Using System.Data; Using System.Collections; Using the system; Namespace ASPresentation.Controls {[ToolboxData ( "& LT; CC: PagedRepeater runat = server & gt; & lt; / cc: PagedRepeater & gt;")] to get the public square PagedRepeater: Repeater {public int PageSize {; Set; } Public Entry Ongoing Page Index {g...