Posts

Showing posts from July, 2011

design - What is the use/advantage of function overloading? -

फ़ंक्शन ओवरलोडिंग का उपयोग / लाभ क्या है? उदाहरण के लिए ओवरलोड: (अच्छा) फ़ंक्शन व्यक्ति [] FindPersons (स्ट्रिंग नेमऑफ़र्स) {...} फ़ंक्शन व्यक्ति [] FindPersons (तिथि की तारीख OfBirth) {...} फ़ंक्शन व्यक्ति [] FindPersons ( Int age, string dogsName) {...} 'विशिष्ट नाम' फ़ंक्शन के लिए बेहतर है: (खराब) फ़ंक्शन व्यक्ति [] FindPersonsByName ( {...} फ़ंक्शन व्यक्ति [] FindPersonsByDOB (तिथि की तारीख OfBirth) {...} फ़ंक्शन व्यक्ति [] FindPersonsByAgeAndDogsName (int age, string dogsName) {...} इस तरह से सांकेतिक शब्दों में बदलनेवाला एक क्लाइंट लिख रहा है जो इन कार्यों को कॉल / खपत करता है एक उच्च स्तर की वैचारिक सोच ("> स्थिर टाइपिंग के साथ, उपयोग पैरामीटर के आधार पर लागू अधिभार से मेल करने के लिए कंपाइलर को छोड़ दिया जाएगा। डायनामिक टाइपिंग के लिए, यह समान मैच अप रन टाइम पर होगा, संभवत: असफल हो जाने पर कोई उचित मिलान नहीं मिलता है।

c# - Multiple cleanup actions on VS2008 Unit Testing -

The questions are very easy and I should know how many cleaning tests should be prepared. I have some tests, and each test creates a separate file, I want to bind the cleaning action for each, so I can delete the specified files for each test. Example: [TestMethod] Public Zero TestMethodA () {// do stuff} [TestMethod] Public Zero TestMethodB () {// do stuff} [TestCleanup] Public Zero CleanUpA () {// Clean A} [TestCleanup] Public Zero CleanUpB () {// Clean B} Any ideas? Potentially, there are some options that I can see. A simple solution that can work for you, should be a class-level variable in your unit test class that stores the path of the file used by the current performance test. Each test provides that current file path to that variable. Then you can use a cleanup method that uses that variable to clean the file. There is another idea, but a significant refactoring may be required, instead of using a dependency-injection approach, your code from the abstract...

C optimization question -

I think the fastest way is to write some code I have a loop that connects in ints is. The loop will be executed several times, and so I have tried to compare it to check whether any operx is zero, so they should not be added as they are: If (work1 == 0) {if (work2 == 0) tempAnswer = toCarry; Else tempAnswer = work2 + toCarry; } And if (work2 == 0) tempAnswer = work1 + toCarry; Else tempAnswer = work1 + work2 + toCarry; I believe that if the nested is already an optimization on the top, then it & amp; Amp; Amp; Amp; Amp; Amp; And compared with writing a series of comparisons, because I (task 1 == 0) more than once. Unfortunately, I will not be able to say how many times the work 1 and work2 are zero, then assume that it can be balanced distribution of every possible outcome of the IF statement. So, in that light, the above code is more than just written tempAnswer = work1 + work2 + toCarry or because of all comparisons, there are many drages? Thanks This is ...

javascript - embedding a website inside a modal box on a different domain -

I need to embed an iframe on a different domain, when click on a model box that opens using the fancy box . This will do something like this. The user clicks the image once loads a model box (FCBOX) which holds the iframe I need to do this because the faxbox needs to be taken on the screen 960x700 in majority How do I do this? Some should like it to see how to use it for more information & lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "http://fancybox.net/js/fancybox/jquery.fancybox-1.3.1.pack.js" & gt; & Lt; / Script & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "http://fancybox.net/js/fancybox/jquery.fancybox-1.3.1.css" media = "screen" /> & Lt; ...

c# - Shorthand for instantiation and initialization using an extension method -

Is there any cloak to use the extension method to instantiate and start an object? My goal is Example: // ... Completely code the code needed to cover the appropriate code for the client It is necessary to start and get started. Code - I want to avoid the construction of tap example MyType t = null; T = t. Gate test instances (); // ... // extension method public stable class MyTypeExtensions {public static MyType GetTestInstance (this MyTypeT) {var ctorInjectedDependency = blah; Return the new MyType (ctorInjectedDependency); }} Perhaps something similar will be to your needs: Public Class MyType {Public MyType (string S) {property = s; } Public String Property {Received; Set; }} Public stable class MyTypeExtensions {Public static object GetTestInstance (thus type) {var ctorInjectedDependency = "blah"; Var ctorInfo = t.GetConstructor (new [] {typef (string)}); Return ctorInfo.Invoke (new object [] {ctorInjectedDependency}); } GetStateInstance Public Relat...

What does container invalidation in C++ mean? -

I have learned about the term invalidation in the context of C ++ Containers Can explain what that means? It seems that while looping over the container, the elements of any container are not allowed to be modified. Thanks, Boda Sido "itemproc =" text "> Containers are not invalidated - Iterators that refer to container elements are invalid. / P> An Iterator A special item is the Iterator valid within a container, as long as the item stays inside the container and the container does not rearrange itself internally, when one of two things happens , Then an Iterator becomes invalid, because the left The medicinal Iterator is no longer valid as a handle in the container. The most obvious way to invalidate an erratator is by removing its referenced item from the collection, example: std :: set & lt; int> s.insert (4); s.insert (2); std :: set & lt; int & gt; :: iter itr = s.find (4 ); // IRR 4 Stud :: COAT and LT; A more subtle way ...

c# - How can I Insert/Update into two related tables in one command? -

Data_t: DataID is the primary key that identifies 1, A database exists with two tables Data_t: 1. Apart from this, another field is 'LEFT' TINYINT Data_Link_t: DataID PK and FK where DataId exists in data_t. Apart from this, another field 'Right' Smallling Coming from the Microsoft Access Environment to C # and SQL Server I am looking for a good method to import a record in this relationship. . is included in the record, which is included in both sides of this conjunction (possibly up to 5000 records to be put up / update at a time) in any type of LINQ list type order the whole batch is processed Bonus to do, but even if it is recorded by record, the main goal is that both parties of this record should be processed in one step. Countless approaches and I am seeing a lot of people how should I go so that I thought faster to ask ordinary people. Is LINQ the option to add / update a large list of LINQ to SQL? Should I record by record? What approach shoul...

c# - Best way to take screenshots of tests in Selenium 2? -

I would like a way to get a screenshot of my functional tests, I'm currently using Selenium 2 with C # binding. To make sure the desired page is displayed I want to take a screenshot at the end of the exam. Are there any special tools from which you know that I can include in my C # code which will trigger a screenshot? I could not find a manufactured Selenium 2 solution (without seeing it). To do a screenshot in Selenium 2, you need to do the following: driver = new firefox driver (); // Driver drivers should work in other browser drivers Navigate (). GoToUrl ("http://www.theautomatedtester.co.uk"); Screenshots SS = ((ITakesScreenshot) driver) .GetScreenshot (); // As you wish it is now string screenshot = ss.AsBase64EncodedString; Byte [] screenshotAsByteArray = ss.AsByteArray; Ss.SaveAsFile ("filename", ImageFormat.Png); // ss.ToString (); // string screenshot = ss.AsBase64EncodedString; use any of the equally manufactured image; That code sho...

ResignFirstResponder doesn't dismiss the keyboard (iPhone) -

I have searched through this site that I am not getting any solution to the problem which is facing it now Hope someone can help. I have created a UIAlertView to prompt the user to enter their name in an iPhone app. UIAlertView * enterNameAlert = [[UIAlertView alloc] initWithTitle: otherButtonTitles canceled NSLocalizedString (, nil "or" @): @ "message" Enter your name: @ "\ n \ n \ N "Representative: self-cancelButtonTitle NSLocalizedString (@" OK ", not equal to), zero]; UITextField * enterNameField = [[UITextField alloc] initWithFrame: CGRectMake (16, 83, 252, 25)]; EnterNameField.keyboardAppearance = UIKeyboardAppearanceAlert; EnterNameField.borderStyle = UITextBorderStyleRoundedRect; EnterNameField.autocorrectionType = UITextAutocorrectionTypeNo; EnterNameField.clearButtonMode = UITextFieldViewModeWhile edit; EnterNameField.returnKeyType = UIReturnKeyDone; EnterNameField.delegate = self; [EnterNameField Be the FirstResponder]; [Ente...

Setting Image Width/Height in codebehind - ASP.NET, C# -

I am trying to determine the width and height of images in a dentist in codebehind. This plan has to do some complex work based on the width / height, so setting the width and height of 50% in the ASPX file is not an option. For some reasons I always get 0 for width and height. Image1.ImageUrl, though what do I expect any thoughts? Image system Web. UI. Vaibong Image is not a system. Drawing Image. Secure zero data list 9_item data bound (object sender, data list event ARG E) {image image 1 = (image) e. Item.FindControl ("Image1"); Double height = image 1. height. value; Double width = image1.Width.Value; Height = height * 0.5; Width = width * 0.5; Image 1 Het = new unit (height); Image1.Width = new unit (width); } Remember with a img tag, default Do not set width and height in this case, unless you do not set the width and height , They will be 0 (or undefined). If you need the actual (image, pixels) width and height, then you have to find out th...

delphi - Passing methods as parameters on a deserialized form with no ClassType -

I'm effectively trying to deserialize a form. One of the items in the serial form, which takes a series of events in the form of parameters. Now that I do not have the class type of the object, when I am deserializing, I have a method that Adder has been declared this way: process TMyDeserializer.AddMethod (ControlName, EventName: string; MethodAddr: Pointer); Var TargetControl: TControl; Method: TM method; If not assigned (TempForm) then exit; If TempForm.Name = ControlName then targetControl: = TempForm Other TargetControl: = TempForm.FindChildControl (ControlName); If assigned (target control) starts with method. Code: Add method; Method.Data: = TargetControl; SetMethodProp (Target Control, Event Name, Method); End; End; so that I can keep the by-laws in different controls, as I have deserialized them, I need to add the problem as a list of parameters (not for control ). E.g. SetUpEvents (EventHandler 1: TNotifyEvent; EventHandler 2: TNotifyEvent); Where Even...

delphi - How to check if a socket client-server is on same network? -

I am working with socket and on this I am using TIdTCPClient and TIdTCPServer. I need to check whether the TIdTCPServer TIdTCP client connects on the same network. How can I do this? You need to know the customer's subnet mask like that Comparison sockets do not expose that information, so you have to ask the OS directly (for example, on Windows, you can connect client's connected local IP to GetAdaptersInfo () or GetAdapterAddresses () ). After you have a mask, you can mask the IP of the client and the server's IP with it and see if the resulting values ​​are the same or not.

database design - DB structure: two tables or one? -

I have two pieces of data: 1) User and 2) Portfolio Each user has only one portfolio. In the registration process, the user must fill in the following fields: First name Last name Porfolio title Portfolio URL Password At this time my DB structure looks like this: create tab 'user' (`id`int (11 ) Faucet AUTACCRment, `e-mail 'varchar (80) No, the password is not password varchar (128),' first name 'varchar (30) tap,' last name 'varchar (30) not tap,` ip' varchar (15) No tap, 'Last visit' int ( 10) No tap, 'Status' tinton (1) tap default' 2 ',' created 'int (10) tap, primary key (`id`), unique key id_UNIQUE` (` id`), unique key' email_uniec '(`Email`)) engine = InnoDB Authentication = 1 DEFAULT CHARSET = utf8; Tables' portfolio '(`user ID') (` 11 '),' title 'varchar (255) no tap,' url 'varchar (45) tap, `theme` tinton (2) tap default' 1 '` font' Tinto (2) ta...

jquery - JavaScript Code Organization Suggestions/Code Review -

I am working on a large site that has a lot of custom (page specific JS) Main. JS and Page-specific There are JS files. P> I am currently specifying all onclick events inline like onclick = "MYSITE.message.send ... - is this a better way? Multiple $ (" # button " (Function () {}); seems like more work ... var MYSITE = MYSITE: {}; var MYSITE {bookmark: {add: Function (contentId, UserId) {var data = {contentId: contentId, userId: userId}; $ .ajax ({url: "/ left / bookmark /", type: "post", data: data, complete: function ) {If (Response.error) {alert (response.error);} else {alert ("Successful Security ");}}});}} Message: {/ * & lt; a onclick =" MYSIT E.message.send ( '1234', '1234'); "Href =" javascript: zero (0); "& Gt; Bok Mark & ​​lt; / a & gt; * / Send: function (contentId, userId) {var data = {contentId: contentId, userId: userId}; $ .aex ({url:" / left...

.net - Using interrelated listboxes to represent available combinations in Windows Form/Control -

After I am trying to provide an easy way for my users to select a desired shipment method (ie : UPS land) without knowing it related shipment. Courier (i.e.: UPS, FedEx, OurTruck, to be determined) Service (ie: There are three major aspects of each shipmentmethod which have specific identification grounds, 2Day10am , To be determined) Billing (i.e.: sender, 3rd party, to be determined) Do I want to have a listbox for each of these pieces so that Users can set each part individually and speed up the content of the other two listboxes As to follow the example of the change will Available shipment ways :. | SMID | Courier | Service | Billing | + ============================================= - - ?? - ?? TBD TBD TBD? - ??? - SH TBD TBD Shipper - ??? - 3p TBD TBD 3-Perty? -555- ?? TBD Ground TBD? -555-SH TBD Ground Shipper? -D 55-3 p TBD Ground 3 Parti U - ??? - ?? UPS TBD TBD U - ??? - SH UPS TBD Shipper U - ??? - 3P UPS TBD3 Party U-D5- ?? UPS Ground TBD U-D55-SH UPS Gr...

javascript - Can ScrollWheel be disabled in a custom street view? -

I am creating a site and I have a page that takes an address and uses it 2D Roadmap style google-map and after that, street view for that address. My problem is that these two maps are spread across the entire width of the site and the user is likely to go to the mouse while scrolling and get confused with his inability to scroll down and scroll down. (While zooming in a map) Disabling it for 2D maps was very compatible // To disable the scroll wheel in 2D map, map var map = {zoom: 12 , Center: latlng, scrollwheel: wrong, mapTypeId: google.maps.MapTypeId.ROADMAP}; Map = new google.maps.Map (document.getElementById ("map_canvas"), map options); // Panorama Ver is not working to disable the scroll wheel in panorama = {status: result [0] .geometry.location, scrollwheel: false}; Panorama = New google.maps.StreetViewPanorama (document.getElementById ("map_canvas2"), Panorama options); But Street View does not allow me to disable the scroll wheel by using th...

jira - python -- for with an if statement -

I do not understand that when I run my code, if statement is not run for each statement is. Even when found that the number is greater than 0! Def findpattern (commit_msg): pattern = re.compile ("\ w \ w * - \ d \ d *") group = pattern. Opaque (commit_msg) found = getIterLength (group) Get printed if found & gt; 0: Issues for the match in the group = print: printed "print-matched issues:" auth = soap.login (jirauser, passwd) print match.group (0) getIssue (auth, match.group (0)) issues = Issues + 1 other: sys.exit ("no issue was found.") "Retrieved issue:" + str (issues) Any help would be appreciated, I I'm peating my head over it for an hour. Your getIterLength () searching for function length Tired of the Iterator returned by finder () . You will then need a new iterator instance for the loop. Instead, I will resume your code like this: def findpattern (commit_msg): pattern = re.compile ("\ w \ w * - \ d \ d *...

database - Mysql custom sequence generator ( like oracle) -

I have two auto_increment columns per table, but mysql only allows for an auto_increment column. . So, I tried to copy the Oracle sequence using my own table Here is the schema create the table logical_id_seq (logical_id integer auto_increment, primary key (logical_id) ). Table mytable (physical_id integer auto_increment, logical_id integer no parent reference (logical_id), data varchar (20), version_start_date datetime do not empty, version_end_date datetime not null, primary key (physical_id), foreign key (logical_id) reference logical_id_seq Logical_id), unique key (logical_id, version_start_date, version_and_date)); Therefore, the sequence of the logical_id_seek table is used as the generator. Create new entity: Enter new entry in logical_id_sec read last_insert_id () from logical_id_seq. Use the above value to insert a new line in the table. Let me tell you a little more context on logical_id and physical_id. I want to create a time travel database, which mean...

Multi-user Mercurial repositories over SSH? -

I have a centralized mercury repository that I want to provide access through SSH. I have a Chown Route: developers at the repository-R repository directory, so all users of the group 'developers' should be using. So, I clone, my initial files are user A, commit, pushed, done. Now, I go as user b, clone, add a file, commit and push. But then, when I make a bridge, I make an update and change that file as User A and then try to push me, for changes / var Clicking on / hg / repository 1 changes found to add changes adding file changes transaction canceled! Rollback completed: Permission denied: /var/hg/repository/.hg/store/data/test.i Am I missing a configuration step? Should not I use SSH? Edit I've found that using sticky bits solves the problem: is this a bad solution? Sticky group bits are the right way to do this; In addition to this, it was such a matter that the user's peer It is important to determine that the group will be reading / writing f...

How do I get Visual Studio to output new files in a different directory (ideally the source directory from a out of source cmake build) -

I am in the process of adding limiter support to a project and found that, after exiting the source studio project, Visual Studio By adding new files through them, they are put in the build directory, and not in the source directory. It's subtle. Is there a way to make a change where VS Adds new file, and can I set it in CMakeLists.txt file? You can choose output directory for the limiter in this way: Use this for Visual Studio projects: set

Copying ComboBox Items to a StringCollection in C# -

मैं एक comboBox में एक StringCollection में वस्तुओं का एक संग्रह कैसे कॉपी कर सकता हूँ मेरे सी # आवेदन में? मुझे केवल प्रत्येक आइटम के लिए स्ट्रिंग टेक्स्ट को अपने संबंधित क्रम में कैप्चर करने में रुचि है मैं एक एमआरयू फ़ाइल सूची बनाने की कोशिश कर रहा हूं जो सत्रों के बीच सहेजी गई है, इसलिए मैं comboBox.Items से स्ट्रिंग कॉलिंग गुण। सेटिंग.डिफ़ॉल्ट। सबसे हाल ही में उपयोग किए गएHexFiles कॉपी करना चाहूंगा। आपके विचारों या सुझावों की सराहना की जाएगी धन्यवाद। आपको कंबैबॉक्स.इटम पर लूप करने में सक्षम होना चाहिए और बस stringcollection.Add () का उपयोग करें संग्रह में स्ट्रिंग जोड़ने के लिए। टॉस्ट्रिंग पद्धति के अनुसार वर्णित किया जाएगा: हालांकि कॉम्बो बॉक्स आमतौर पर पाठ आइटम प्रदर्शित करने के लिए प्रयोग किया जाता है, आप किसी भी ऑब्जेक्ट को जोड़ सकते हैं कॉम्बो बॉक्स सामान्यतया, कॉम्बो बॉक्स में एक ऑब्जेक्ट का प्रतिनिधित्व उस ऑब्जेक्ट के टूस्ट्रिंग विधि से लौटा गया स्ट्रिंग है। यदि आप इसके बजाय प्रदर्शित ऑब्जेक्ट का सदस्य होना चाहते हैं, तो सदस्य को चुनें जो कि प्रदर्शित सद...

dataframe - R: aggregate columns of a data.frame -

I have a data frame that looks like this & gt; Head (DF) Memory Memory Memory naive inexperienced 10472501 6.075714 5.898929 6.644946 6.023901 6.332126 8.087944 7.520194 10509163 6.168941 6.495393 5.951124 6.052527 6.404401 7 , 152890 8.335509 10496091 10.125575 9.966211 10.075613 10.310952 10.090649 11.803949 11.274480 10427035 6.644921 6.658567 6.569745 6.499243 6.990852 8.010784 7.798154 10503695 8,379494 8,153917 8,246484 8,390747 8,346748 9,540236 9.0 9 1740 10451763 10.986717 11.233819 10.643245 10.230697 10.541396 12.248487 11.823138 I Memory Meaning of the column and the meaning of the naive. Columns Total Function rows aggregate This is data.frame possibly a large number Security may be lines, and so the original assumes data Gross colnames can be transposing being implemented by .frame I feel bad, and Generally disturbed: & gt; (T (Total (T (D (D), List (Colnames (DF)), mean))) [1] [2] Group 1 "Memory" "Navek" 10472501 ...

php - Twitter disabling basic authentication - what does this mean? -

According to apiwiki.twitter.com: "Original authentication is going to be removed on August 16, 2010" and their OAuth API The new method of authentication will be. I am new to Twitter API and I do not know the obvious what it applies to. I am trying to create a simple app for posting on Twitter via HTML form - what Do I have to use the Oath System? Or the OAuth system is just for the app (as it is contained). If I want to use this, then official libraries and code samples from Twitter (which I see for PHP is inactive) Does this mean that Will any Twitter app / widget stop working until August 16? What is wrong with HTTPS and POST? What is wrong? There is a very useful OAuth library for PHP (oauth.googlecode.com/svn/code/php/) Take a look at code 4.22dh.com/oauth/ for simple examples of using OAuth as well. It helps me more than dev.twitter.com, which is good for reference. I have used OAuth.php (among others) in about 2pm.

eclipse - Why is the Android emulator skipping my return statement? -

I have an unexpected behavior in my Android 1.5 application under Windows emulator and debugging with Eclipse here is the generalization of code here : if (some conditions) {System.out.println ("found here"); Return "A"; } If (some other condition) returns "B" returns "C"; If I step through this code with the debugger, then if someCondition is true, then "got it here" but then The final return jumps into the statement as if he is going to execute that line, what can I tell, it is returning "a", but it is confusing because it seems to be "c." Going back. If the someCondition is incorrect, and some other restrictions is correct, debugger steps for the "B" line return - This final return does not jump to the statement and then leaves the expected method. Any thoughts? Remember that your program has not been executed and debugged, the Java code has been written - this is Java Code i...

In asp.net, does the the JIT compiler noramlly just comile the IL code once or it compiles every time a page is requested? -

I doubt the pre-case if yes, do not you think the name of Jet is misleading? As far as I know, jit is a hybrid in nature, one of the reasons for its name is. Actually it uses a V-Table where all the functions are mapped during its first part. Jet determines whether to compile based on whether or not they have been described statically or not. Fixed compiled code is cached & amp; It is not compiled again, but besides this, it runs a normal translation every time So it is not whether it compiles once or every time, but the fact is that it is going on & Amp; Determines to compile & amp; Not every time during just in time run time

how to close specific serial port in C++ MFC smart device application? -

How to turn off the specific serial port in C + + MFC smart device application? How is a port open? And how to stop it? I am using this "ex: to close the handle You should use the function found with the CreateFile .

ruby - Which version of Rails should I use -

I am looking to create a web interface for an existing ruby ​​app and I am trying to figure out To use which version of the train - the latest version 2.3 or the soon-to-be-released version 3.0. The reason for using 2.3 is very simple: this is the current version and it is stable. My reasons for considering 3.0 are: My app uses Ruby 1.9 and Rail 2.3 Ruby does not support 1.9 Rail 3.0 is supposed to be the framework. If I am starting a new project then I think that I will have to migrate it when I get ready to go to Rail Packer 3.0, instead I can 'correct' for the first time. Is 3.0 really so much better? Is it stable for adequate use or am I just asking for trouble? Anyone have any idea how difficult it will be to migrate from 2.3 to 3.0? Rail 3 has already been released. Use it now in production Most plugins have been updated for this. Pros: Speed, new active record interface, route, mailer, more semantic, better integration with rack. The list is up and...

pagination missing in Magento catalogue page -

For some reason, pagination on my Magento catalog page is just missing. Any ideas? tried and it now works in catalogue.xml (app) Layouts folder under) and Both in the 'Category Layered Navigation Layouts' and 'Default Layout of the Segment' line

c++ - How to load a string from the resource of a different process? -

I need to load a string that has been placed in a different processing resource DLL, provided the process must be run Call time I tried the following code - HMODULE hRes =: Load Library (_T ("SomeResource.dll")); TCHAR buffer [50]; :: LoadString (HRS, IDSISOMIMIID, buffer, 50); This code is working fine while running in debug mode. But LoadLibrary returns zero in release mode. Why? Am I missing something? Please help me I am using the VC7.1 compiler. This might be locate "SomeResource.dll" Problem When you run from the debugger, the path of the executable project starts with. If DLL can get it from there it's OK. When you run from outside the IDE, the executable is started from a separate folder. It can be that DLL can not be found from there.

drupal - How to get and set the delta value? -

How can I affect the delta parameter value? Where can this be set? I am beginning with Drupal, but I know my way around PHP and other CMS apps eg Joomla I have worked on my first Drupal module and need to create a module with multiple blocks. I know how to switch based on the $ op parameter, but the delta value always seems to be the default value defined in the function declaration which block I can choose to process and display Am I $ Delta can be set so that the delta can be used to switch to other block view using the module colonization? Thanks in advance. is used to define another displayed block. When you are producing data for $ op = 'list' , define the delta, it is sent back to the hook when it is for $ op = 'view' Is called . $ Delta Logic Therefore whatever you define if you define the red, green and blue colors in your list array that the block is displayed then what will it pass? See if MiB will help you

t4 - Can CodeDom add Source Code Files to a Project? -

Image
I'm using CodeDom to generate some code. It works great, but I have not found any way to include source code files generated in the project. I started generating T4 and code because this project supports integration with files Do anyone know whether the codedom also supports this functionality? I would like to take a second look at codeDom, if it supports only one attribute. Here is an example of how I file a source code with codedom: Secure Zero CreateSourceFile (CodeCompileUnit codeCompileUnit, string filename, Extension with string filename description ) {FileNameWithExtension = string.Format ("{0}. {1}", filename, CodeProvider.FileExtension); Var indentedTextWriter = New IndentTextUpter (new streamer (filename extension, incorrect), tabstring;); CodeProvider.GenerateCodeFromCompileUnit (codeCompileUnit, indentedadvertiser, new CodeGeneratorOptions ()); IndentedTextWriter.Close (); } This works fine, but it only outputs the file (probably bin folder) to t...

Strategy for Storing Large Amount of Ordered, but Reorderable Data in Database? -

If you have a large amount of data in a specific quantity (say one million lines), then in a special order To come back, one way to do this clearly is to just put that numerical index on each line and order by that index. However, if you want to create a new line in the middle of that data, then you must either expect that there is a difference between the two rows placed between the lines, or you need to set up the table "Status = Position + 1 where position> new_position "which is potentially slow and not scalable. Is there a clever strategy to deal with this? Do I just hope to leave the big gap between my rows (possibly the lines of space with the background process). Is there a database similar to a linked list? Edit: I know which index and how traditional order is done (Read my first sentence.) I am thinking that to put a new line in the middle of a command structure The data structure is, therefore the boundary questions can still be done. A traditional next ...

What is a good strategy for dealing with large javascript code in asp.net MVC projects? -

I am trying to understand the best way to manage my javascript code for my MVC project. Due to the workflow of some page pages on my site, the user interface is very heavy with JavaScript. To simplify the development and debugging, I split all of my Javascript into four .js files, Initializations.js , which allows any type of jquery control and field To control the initials, DataRetrieval.js which contains all functions for receiving and displaying data through AJAX, DataModification.js , which can be used through Ajax Send data modifications to server There are all functions for the user, and there are utility functions to help in utilities.js . Structuring it in this way is not just the fact that I know which file has a specific function based on the function, but it keeps my javascript files too small. It also helps in debugging because I can see the script directly from the debugger of Chrome, that file can choose and I need to debug the function easily. The one I am r...

Python: is there a C-like for loop available? -

Can I do something in Python? (I = L; i; ++) for : if some condition: i + = 1 print I me Depending on the condition, some values ​​should be able to quit Edit: All solutions suggest sorting the initial range in one way or another, based on the condition already known to date. This is not useful for me, so let me explain what I want to do. I want to parse some CMD line abigrants manually (i.e. no depot), where there are certain parameters in each 'keyword', something like this: in category i (0, len (argv ) Arg == 'arg ==' --flag1 ': opt1 = argv [i + 1] i + = 1 if arg ==' - if arg == '- arg = argv [i] for : arg = argv [i] -otherother ': optX = argv [i + 1] opty = argv [i + 2] optZ = argv [i + 3] i + = 3 release ... You can do two things to solve your problem: Separated with a comma So Con require that being grouped in value following options, you can use getopt , or you can use a different module. Or more delicate your resources...

command line interface - Performance of desktop computer vs Amazon EC2, CLI instructions -

I am trying to create a string of CDI commands to do some things in a jerk in different things Tried: Connect several AAC files in a large number, 33 files 10 MB (MP3 BOX) Taking a small PNG file and It has made some changes (ImageMagak) Run the file in external HD (copying file to move to S3 Do something send me an email (sendEmail) I'm running this terminal ( A 2008 iMac) and it takes approximately 40 seconds to complete it while completing it. Ramdisk is the most time consumed by files (MM4 BOX) and third (Atomicpresley) functions for files. Now I wonder how different EC 2 examples will handle the work here plays an important role here, RAM speed or processing speed? Will the "High-memory quadrupler XL Large Instance" with 26 EC2 computing units be about 6 times higher for their work, with their "high memory extra large examples" with 6,5 EC2 computing units? How fast will my 2.8 GHz C2D / 4GB 800 MHz RAM be compared to IMAC? It is ver...

java - Regex exclusion behavior -

OK, so I know that this question has been asked many times in different forms, but I have a specific syntax Having trouble with I have a big string in which there are html snippets. I have to search each link tag which is not already a target = attribute (so that I can add one as needed). ^ ((?! Target!) * Text that leads me to 'Goal', and & lt; A. +? & Gt; [\ W \ w] +? & Lt; / A & gt; will give me a link, but the place where I am stuck is an example: Any suggestions? Using DOM or XPAT is not really an option because this snippet does not constitute HTML. If you insist on doing this with a regx like this should help. . & lt; A (?! [^ & Gt;] * target =) [^ & gt;] * & gt; *? & Lt; / A & gt; This does not mean that 100% may be right technically speaking in one tag,> from one end to another, so it will not work for all HTML tags. NB I work with PHP, you may have to make some syntax adjustments for Java.

java - Converting Strings to booleans when converting XML to JSON -

This block of code essentially takes a JAXB object and converts it to JSONObject StringWriter StringWriter = new stringwriter (); Marshaller.marshal (jaxbObj, stringWriter); Try {JSONObject jsonObject = XML.toJSONObject (stringWriter.toString ()); . Resp.getOutputStream () write (jsonObject.toString (2) .getBytes ()); } Hold (JasonXExtension) {New Service Exception ("Jasonson could not be parsed", e); } Unfortunately, this change is not a string like "true" in a boolean, it says, preventing a person with a bad front from doing so. I think I want to map values ​​in JSONObject in any way, calling each one I think is a better way any ideas? Well, JACAB will not produce JSON to start itself, so you are using Apart from this (maybe using jerseys), maybe there is something in the package in question. But why try to do this with the org.json object? Just use the regular Java Bean with the expected type, make sure that any input you have is no magic, just...

cocoa - Find out the working folder in a Foundation executable? -

I have a console program that is connected to the Foundation framework on the Mac However, How to find strong> Folders in executable? Although the tool is not in the bundle, you can still do some NSBundle Can be used. For example: NSString * binaryPath = [[NSBundle main bundle] executable path]; NSString * Executable Folder = [Binary Path String Bideling Text Text Company];

c# - changing textblock to textbox loses data bindings - -

This is a wpf / c # app - I have a grid where I used the text box and the data binding is fine Was there. I later created another grid using text blocks. Both worked well but when I changed the text boxes in the second grid in the text, all stopped showing the same data. I have copied both C # LINQ code and XAML code, which provide data for binding, recompiled, closed for Notepad saved ++, and VS (8) . After reopening the project, I started the code again, but I still do not get any data. Any ideas that will help, will be greatly appreciated. DBC.Wonders have # code from V var vendDetail = where v.vendorID == select new sale {v.Address1, v.Address2, CSZ = V.City + "," + v.State + "" + v.zip, v.phone, v.fax, v.contact, v.Terms, v.email}; GrVendorData.DataContext = vendDetail; and XML code: & lt; Text box x: name = "txtVendorAddr1" text = "{binding path = address1}" background = "alisblue" grid. Rau = "2...

.net - How to Cause an HttpModule to be Invoked Before the First Request? -

I have several applications that I'm deploying in the .NET / IIS environment. For these applications, I have registered the implementation of IHttpModule in the system.web / httpModules section of web.config. In the implementation of I IHttpModule, I have an Init () method that starts some daemon thread and starts logging The application has started. My problem is that Init () is not called up to the first HTTP request, it comes in. Is there a way to force the system to move forward and execute its modules rather than wait for HTTP requests first? If you are on IIS 7, you can use the IIS application warm-up module to make sure Your application is always running: Check the application pool settings too, so it is not being shut down and is being restarted whenever there is no activity at all. Otherwise I would advise you to create an NT service and put your daemon threads there.

iphone - HTTP POST request not working over 3G -

निम्न HTTP पोस्ट अनुरोध करते समय: NSMutableURLRequest * अनुरोध = [NSMutableURL अनुरोध अनुरोध के साथ: यूआरएल]; [सेट करेंएचटीटीपीप्रणाली: @ "पोस्ट"]; NSURLResponse * urlResponse = शून्य; NSError * त्रुटि = शून्य; // निष्पादित करें NSData * responseData = [NSURLConnectionSynchronousRequest भेजें: अनुरोध लौट रहा है रिस्पांस: और urlResponse त्रुटि: & amp; त्रुटि]; अगर (प्रतिक्रियाडेटा) {// blah} वाईफाई के माध्यम से कनेक्ट होने पर मुझे एक वैध प्रतिक्रिया मिलती है, लेकिन जब 3 जी से अधिक जुड़ा नहीं होता। प्रतिक्रिया डेटा वस्तु 3 डी पर वापस आते समय भी (0x0) नहीं बना पाती। मुझे केसीएफआईआरडॉममैन सीएफ नेटवर्क नेटवर्क 303 प्राप्त होता है। जवाब 242k JSON होने चाहिए। कोई भी मदद की बहुत सराहना की जाएगी। ऐसा लग रहा था कि समस्या पीठ एंड सिस्टम और मोबाइल नेटवर्क के बीच थी। हेडर सूचना को पाठ स्वरूप में बदलने से केवल समस्या हल हो।

ASP.NET MVC - Routing Engine Appending Unexpected Values -

I have a route that points to both taking the same action and based on the route data supplied I like the way one can be selected on the other The problem is that the routing engine automatically adds the root values ​​that I'm not explicitly telling this. route. New {pageNbr = @ "\ d +"}, new [] {"Web", "New", "MapRoute" ("Products_Search_Paged", "products / search / page {pageNBR}", new {controller = "product", verb = "search" .components.Controllers "}); Routes.MapRoute ("Products_Search", "Product / Search", New {Admin = "Product", Action = "Search"}, New [] {"Web.Components.Controllers"}); Note that the only difference between the two routes is in addition to Products_Search_Paged in / page {pageNbr} . The problem I am facing is that when I / products / search / page2? For example, if I see Url.Action ("search," produ...

iphone - How do you custom format the textfield? -

I know NSNumberFormatter allows you some flexibility in customizing the text field, but if you need a more specific format , How do you do it For example: Timecode "03: 50: 02: 25"? or the end of the string "6,264 ft"? Thank you. But it is more useful to filter the input. Formatting of the input after the text is entered .

Remove first char of string C -

After the im, compile my current code and on how to confuse the first character of im series and remove Fix it by trying to keep the balance. My code: char * newStr (char * charBuffer) {int len ​​= strlen (charBuffer); Int i = 1; Four V; If (charBuffer [0] == 'A' || charBuffer [0] == 'Q') {for (i = 1; I & lt; lane; i ++) v = v + charBuffer [i]; } V = v + '\ 0'; Return vi; } GCC: "WARNING: Return indicator creates an integer without integer" Also: "four * newStr (four * charBuffer)" remain the same So that String does not work like this in C. You can summarize all the characters in the buffer v in the variable you can not use to add +. . Try this: newStr (four * charBuffer) Try this: Try this: {Int length = strlen (charBuffer); Four * str; If (length & lt; = 1) {str = (four *) malloc (1); Str [0] = '\ 0'; } Other {str = (four *) maulok (length); Strcpy (str, and four buffers [1]); } Return str; } o...

php - Automatic highlight code in a wordpress blog -

I have an automatically-installed WordPress blog that is full of Python snippets and I want to highlight them (source code Colour) . I tried to install some plugins, but they need to edit all my posts that add some ethers to the pre-tags. Do I have to pre-tag the plugins or other plugins in WordPress? You can create a simple plugin that will register "filter". This filter will apply to all your posts: function enhance_pre_tag_filter ($ content) {$ content = preg_replace ('/ / lt; pre & gt; /', '& lt; pre python_tags & Gt; ', $ content); Return $ content; } Foreach (array '(the_content', 'the_title', 'comment_text') as $ filter) add_filter ($ filter, 'enhance_pre_tag_filter', 9);

c# - Bind Collection to StackPanel -

I want to get a collection of objects and tie it in the stackpack so that basically 4 elements in the collection inside the stack Ho. The panel that says should produce 4 buttons. I tried to do it ... but I think that its correct approach is not anyway. I had datatompled this kind of idea in the past. Please correct me if I am wrong. I have a fake model Public class Mockmodd {public supervision collection & lt; Mock node & gt; Nodes; Public Mock Model () {nodes = New Observation Collection & lt; MockNode & gt; (); }} Public Square Mock Node {Public MockNode () {} Private string itemname; Public string itemName {receive {this.itemname return; } Set {this.itemname = value; }}} In the code I set DataContext like this ... // Init Model Mock model myModel = new MockModel (); For (int i = 0; i and xaml & lt; StackPanel X: Name = "tStack" & gt; & Lt; ItemsControl ItemSource = "{Binding Nodes}" & gt; & Lt; Ite...

how can i create a matrix using vector with lag using matlab -

vector = 3 4 8 5 2 1 6 मैट्रिक्स मुझे बनाना है 3 0 0 4 3 0 8 4 3 5 8 4 2 5 8 1 2 5 6 1 2 यह पहले से ही था में लिपटा । यद्यपि आप इस उदाहरण में एक वर्ग मैट्रिक्स बनाने की कोशिश नहीं कर रहे हैं, आप अभी भी इस तरह के फ़ंक्शन का उपयोग कर सकते हैं: M = toeplitz (वेक्टर, [वेक्टर ( 1) 0 0]);

asp.net - ASPX files sometimes readonly when debugging in Visual Studio 2010 Premium -

I'm running a Visual Studio 2010 Premium on Vista 32-bit machine and I have noticed that sometimes when I have a website Project Debugging I can not edit an aspx file if I close the file and open it again I can edit it. Has anyone else encountered this problem? The only extensions I have installed are VS Productivity Power Tools and Power Commands. I also have this problem (using Windows 7 or XP) when: I do not already have a .SPX file in Visual Studio 2010 I'm running a web app in debug mode The lock occurs when I open and then try to edit any .aspx page (such as touching HTML slightly) which is currently viewing through a web browser when abg Is run in debug mode. I have not found any solution for this problem yet, but when I am creating, I "browse ..." as a workaround for loading and viewing the page. (Right click solution explorer) HTML Improvement You can not debug codes but this file does not lock.

Objective-C preprocessor available? -

Does anyone know that source code of Objective-C is still available from the time of pre-processor? Thank you. (rewrite has been written below) Objective-C can be repeated in C. (And some are being used to compile the objective-c for Xbox and Windows). Here are some discussions:

.net - Connecting to SQL Server Database C#-WinForms -

I have a desktop app that I am doing and I want that the user must log in before it The program can be used to use the full extent. I have created a database on www.winhost.com (where my site hosted), but now I do not know what to do. I went to google and msdn and would like to know how to add new lines / columns programmaticly in this new database which is currently empty and information about how I can update the database with new account information Can get it. I do not expect code or anything, just a few simple tutorials or something else, because I did not find I'm still looking for ... Here's the beginner's guide to using C # using SQL Server: Hope it helps :)

iphone - Access a NSMutableArray of an object -

I post this topic because I have a problem with my iPhone application since 3 days I hope that Someone can help me because I am being mad. Here's the thing: I fill XML data with an object user, in my application's representative, with XML Parser. This object contains many NSStrings and an NSMutableArrays that includes the album of the object type. My problem is this: I can display all the data of the user's XML data with an internal function, but when I am trying to get the data, in my view the array controller, it does not work Does. I mean, it crashes as it is strange because I can access the app delegate.asser XMLData.NSString, but my app's delegate.User XMLData.NSMutableArray Here's my code: // Initializaiton Represent UserXMLData = [[User XMLData alloc] init]; UserXMLData.myArray = [[NSMutableArray alloc] init]; UserXMLData.h @interface user XMLData: NSObject {// user data NSString * userId; // Content NSMutableArray * myArray; } @property (n...

sql - default a column with empty string -

क्या एक कॉलम का डिफ़ॉल्ट मान एक रिक्त स्ट्रिंग '' के बजाय NULL ? हां - एक डिफ़ॉल्ट बाधा का उपयोग करें: ड्रॉप तालिका यदि उदाहरण '`` `टेस्ट`; टेबल बनाओ 'उदाहरण'। `टेस्ट` (` string_test` varchar (45) नल डिफॉल्ट '') इंजन = InnoDB DEFAULT CHARSET = latin1;

PHP is it possible to convert array to vars and pass them somewhere -

In short, what I want is a type of export () function (but not exported), it creates a new variable Returns the number of symbols in the symbol table and the number of wars created. I am trying to figure out what the function is possible to declare function foo ($ bar, $ falcon) {var_dump (func_get_args ()); } and then pass an array so that each value represents the array. Just wondering if this is possible (it does not seem like that). I need dynamic loading for this, so the number of arguments, the size of the array can be different - please do not offer to pass it foo ($ Arrival ['bar']); and so on. Then, the ideal point of view will look like foo (array ('foo' => 1 ',' bar '= & gt;' 2 ' ..., 'zzz' => 64)); function fu ($ foo, $ bar, ..., $ zzz) {} for declaration As far as I remember that some dynamic language lists can be remembered (or maybe I am wrong). (I want to create dynamically par...

unix - Periodic Script- Daemon- -

ux and I need to delete a specific file every day. I should do a shell script or something else, for example With a simple command for # rm But I need to add this script to init, or to change this script in daemon that run this script every day at 20:00 and delete the file. I think the above process is, but I can be wrong. Can you please guide me in this situation. Thanks a lot. You have to set up one.

decimal point in SQL Server -

I tried to calculate a calculation in SQL Server and recover the value with 2 decimal point. However, it always gives me the value in 0 for 2 decimal point. Does anyone know what is happening there? Example: Select Convert (Decimal (5,2), ((2 * 100) / 1 9), 2) Clients 'Exam' Returns are always 10.00 instead of 10.53 SELECT Convert (Decimal (5,2), ((2 * 100.0) / 1 9), 2) As a 'Customer Test' Result: 10.53 I chose 100% to change 100% because I'm guessing you're trying to calculate one percent and that 100 in your final query Ntr be hardcoded. I'm guessing that the other two values ​​(2 and 19) will later change to read from the integer fields in your table.

java - How to update a label to make it display new text? -

I am making an application in Netbeen and want a status label that shows what the program is in any way Is the moment There is a ton of code, but it's too much to do: Just pretend that label is a label that has already been put into the program and each function is an expensive task that takes seconds. statusLabel.setText ("Complete Task 1"); System.out.println ("Completing the Task 1"); . This.getFrame () repaint (); // I call this function and two functions below it but the label still does not change. StatusLabel.updateUI (); // does not seem to do much statusLabel.revalidate (); // does not seem to do much this.completeTask1 (); StatusLabel.setText ("Task 2 Complete"); System.out.println ("Completing Task 2"); StatusLabel.revalidate (); . This.getFrame () repaint (); ... It runs until the UI has completed 4 tasks. Labels are not updated during the entire process until each task is completed, and then it says "Completing the...

Problem with emacs lisp shell process arguments -

I am trying to run the P4V command directly with XMX. After pulling in PL in MLX, I have written the following: (defun p4v-command (cmd) (create get-buffer-p4-output-buffer-name) ;; (Kill-buffer p4-output-buffer-name);; To ensure a duplicate (call-process "P4V" zero (get-buffer-p4- output-buffer-name) zero "-P" (P4-get-p4-port) "-U" username "" -C "(P4-present-customer)" -CMD "(shell-quote-logic (concrete CMD" (buffer-name)))) (Display-buffer p4-output-buffer-name) ) I am trying to get the following for the shell command (when CMD is equal): However, when I execute the above function with prevdiff, I get the following error P4V: Unrecognized Logic '' 'prompt' for 'CMD' option. It seems that the call process is to split the quoted string "prevdiff file.txt" in India is the universal argument and P4V is only acting on the first one It does not appear to be the order that I...

How Create a View Like the Default Android EditContact View? -

Specifically, I'm curious about how they performed the phone number entry, where they added additional phone number fields The user clicks a little add button when I was initially thought that was done with a ListView, and I got a ListView to work, but the rest of the list scrolls the list independently of the screen, which looks bad is. So I was wondering what is the best approach for something like this? Am I on the right track with ListView and I'm missing something which prevents me from behaving like my scroll container? Maybe a Custom Adapter view or maybe adding rows to a dynamically with TableLayout? I'm not sure who works best. It is quite difficult to read through the contact editor of Super-Duper Overkill Modularization of the Editor's Activity reason. I think a vertical liner layout where you directly direct new view with [View.inflate] [1]; Alternatively, call on the linear layout to add the method to the Edit / Layout [1] :, int, android.view....

iis - coldfusion9 Htttp 404.2 error -

Hello, I have Windows Vista and ColdFusion 9 when I try to access them, I get the following error Can not work because of restriction list settings. Error code: 0x800704ec Notification: ExecuteRequestHandler module: Isapi module requested URL: http: // localhost: 80 / physical path: C: \ ColdFusion9 \ wwwroot logon user: anonymous logon method: anonymous handler: aboMapperCustom-175270243 I restarted the CF services / application server and did not work. Then I checked in IIS / Web sites / IAPI and CGI sanctions which are empty. When I click on the IIS / (right hand side) mylapTopName / Application Pools and Web sites / default websites. Should I link to "C: \ ColdFusion9 \ wwwroot" default websites ?? What should I do to correct it? Can you please tell me that you have configured the Cold Fusion installation? At the time of installation, you can configure ColdFusion so that it uses IIS webroot. \ Inetpub \ wwwroot Thanks, Sea

javascript - Creating an Interactive bar Chart out of Google Analytics Data -

I want to create a chart once from google analytics data. There is a current inequality of bar chart in my site I am developing an ASP.NET website and see it using PHP and jQuery to overlay analytics chart. It is also paid. What my customer would like is such a tool that draws charts from analytics without PHP component. To wit. A similar tool using ASP.NET and jquery / javascript. What should I do, that tool is free to get (open source). What are my options? Regards, naveenj Have you seen other free uses Google's visualization API: Google Chart API: There are some examples of using Analytics data with those chartered libraries

c# - CallBack in WCF? -

How do we easily use callbacks in WCF with events and delegates? If a customer requests or someone how is it possible? A cleaner model operates an event using a published / subscription method on both methods Read to get.

sql server - Cursor inside Trigger not working -

Use [DDB] GO GO ANSI_NULLS set QUOTED_IDENTIFIER set to be different from Create TRIGGER [dbo]. [Requeststrigger] running [DBO]. [Request] After INSERT, start updating as @ email VARCHAR (400); DECLARE @ First name VARCHAR (400); DECLARE @requestno VARCHAR (400); DECLARE @lastname VARCHAR (400); DECLARE @statusid INT; Select inserted.requestno, contacts.firstname, contacts.lastname, contacts.email request_contacts, contact, inserted where request_contacts.requestid = inserted.requestid and contacts.contactid = request_contacts.contactid and request_contacts.notification = 1 and announced thecursor cursor contacts .notification = 1; SET @statusid = (Selected StatSat); If @Statusad = 4 and @inctused & lt; & Gt; Set the set set on apple set (deleted Szcatsatsat); @ Requestno, @ firstname, @ lastname, @ email while @@ FETCH_STATUS check not bring the next thecursor = 0 start EXEC MAIL_SEND @ email, @ firstname, @ requestno, @ lastname; Before FETCH @ requestno, @firstname, @ l...

database - 'Followers' and efficiency -

I am preparing an app that will include users 'following' each other's activity, in twitter sense, but I am not much experienced with database / query design / efficiency, what are the best practices for managing this, etc. to avoid losses? Can I make a huge load on DB if I did not do it properly (or even?). If it makes a difference, then it is possible that people can only be 'relatively' people (but one person can have many followers), although this is not definite, and I do not trust him Would like to Thank you received gratitude by any advice. Easy and easy to complete. If you have a user's table, with each unique ID, you have a TABLE_FOLLOWERS table with the column, USERID and FOLLOWERID For each user, describe all followers as one from one to many relationships. Even with hundreds of assurances on half-decent database servers, it will display good and fast as long as you are using a good database (IE, MS-Access not).