Posts

Showing posts from January, 2013

.net - How can I use System.Web.Caching.Cache in a Console application? -

Reference: .Net 3.5, C # I want to see the caching mechanism in my console application. Instead of searching the wheel, I would like to use the System.Web.Caching.Cache (and this is the final decision, I can not use other caching frameworks, why not ask ). However, it seems that System.Web.Caching.Cache should only be run in a valid HTTP context. My very simple snippet looks like this: using the system; Using System.Web.Caching; Using System.Web; Cache c = new cache (); Try {c.Insert ("a", 123); } Hold (Exception Pre) {Console.WriteLine ("Can not be inserted to the cache, exception:"); Console.WriteLine (ex); } And the result is: The cache can not be included in the exception: System.NullReferenceException: Object is not set to an instance of reference object . On MyWeb.Caching.Cache.Instert (string key, object value) on MyClass.RunSnippet () So obviously, I'm doing something wrong here, any thoughts? HttpContext.Current.Cache . thanks a

sql - Most Efficient MySQL query to update a table from identical memory table -

I am implementing memory cache for a table that looks like this (simplified): < P> Item1 (integer), item 2 (integer), cnt (integer) In the original table thus contains millions of pairs. And it updates fast. To make it even more efficient, I want to add new additions to the same memory table and update the actual table on the disk by cronn from time to time. The cron should do the following: If there is a similar combination in the non-memory table for each memory then the count in counting count increases from memory table. If there is no such pair, then make it count with memory table. How can I flush (from the memory table to the actual table) the most efficient? Note: Environment MySQL 5.0.45 PHP 5.2.6 CentOS You can use the query - but it depends on the primary key or on the main table on the UNIQUE index. INSERT < Master_table & gt; & Gt; (Item 1, Item 2, CNT) Selection Item 1, Item 2, Cnt FORA & lt; Memory_table & gt; & Gt;

WPF Grid - align it's children automatically -

Is there a property like vertical content alignment to align the grid children or do I have to do it manually? If most of the grid children are of the same type then you can use styles, for example, put it on it. Beginning of the grid will align all text boxes & lt; Grid & gt; & Lt; Grid.Resources & gt; & Lt; Style TargetType = "Textbox" & gt; & Lt; Setter property = "horizontal alignment" value = "true" /> & Lt; / Style & gt; & Lt; /Grid.Resources> . . . If you have only some types of control inside the grid, then it is very useful.

pygtk - clearing newline char from gtk.Textbuffer -

I have a gtk.TextBuffer that should be cleared after entering the same number of chat programs as input box . I'm just setting buffer back in empty string. However, the new line given from the entry is not removed, and during the next input, a blank line ends up on the cursor. Moving the cursor to the first gtk.Iter does not help. By default, "Gobject.connect ()" The handler is said before. You can change the "gobject.connect_after ()" . def inserttext_cb (text_buffer, position, text, lenght) is required to use: if text == '\ n': Text_buffer.set_text ('') text_view = gtk.TextView ( ) Text_view.get_buffer () Connect_after ('dot-text', insert_text_cb)

c# - How to make source code a part of XML documentation and not violate DRY? -

I want to add some parts of the source code to XML documents. I copy & amp; Some & lt; Code & gt; Paste the source code element to, like this: /// & lt; Summary & gt; /// Hello world, in a very basic way: /// & lt; Code & gt; /// System.console Weidline ("Hello World!"); /// System Console Wrightite ("Press any key to exit."); /// System.console Readkey (); /// & lt; / Code & gt; /// & lt; / Summary & gt; Static zero main () {System.Console.WriteLine ("Hello World!"); System.Console.WriteLine ("Press any key to exit."); System.Console.ReadKey (); } It will be painful to maintain it. Are there any other possibilities to add source code to XML document in C #? I am processing XML documentation with Sandcastle and would like to create a technical support file (* .cm) from it. I would like to add parts or entire method bodies to that assist file. Edit: Thanks for the comment from slide_url

javascript - How to produce documentation for vars only with JSDoc? -

I have a javascript file that contains a number of global wires that are commented, but JSDoc says "documentation Nothing to do, going out " Here's a sample: / ** * Name of client list * @ type string * @Finial * / var CLIENTS_LIST_NAME = "client"; Is there a way to prepare documents for this .js file? It seems that you are using a project called my old Pearl based JSDK PMM. I recommend you to upgrade to my new project called JSDOK Toolkit. The syntax of the new project is mostly a superset of the tag used in the old project, but to see the full list of all supported tags. The following JSDOk toolkit will work in: / ** * Name of the client list * @ type string * @content * / varCLIENTS_LIST_NAME = "client";

visual c++ - Are different compilers' C++ virtual inheritance implementations incompatible? -

I have a hierarchy of such public interfaces: straight iSwitch Pointer received * for the second implementation interface * / virtual et switch (unsigned inter interface iid, zero ** pistence) = 0; }; Structure IFoo: Public Iswitchable {/ * Methods}; Structure term: Public ISwitchable {/ * Methods; Structure IFooBar: Public IFoo, Public IBR {/ * Methods; The class implementing IFooBar is placed in DLL with factory function. Client code load DLL uses the factory function to create a class installation and uses it according to the interface (they are provided as a header file) The scheme is available in MSWC and Broland C + + The client code created by builder 6 works fine with DLL created by code. I introduce virtual heritage in the hierarchy: struct IFoo: public virtual ISwitchable {/ * methods}; Structure Term: Public Virtual Isavacable Eligible {/ * Methods; And when in the same situation (MSVC, client code by the builder by the builder) gives an example of class

security - Network share access issue - migrating asp.net web site from 2000 to xp -

I know that this is similar to some other questions, but whatever I can find, T got anywhere It's very polite. I have a small asp.net website, which we use internally for some simple logs, such as time sheets and a support log, they access the Access database on a network share (Using domain users) I'm taking a web site from a virtual machine that runs Windows 2000, which runs Windows XP, and I'm not able to use the database. I get an error: error [HY024] [Microsoft] [ODBC Microsoft Access Driver] '(unknown)' is not a valid path, make sure the path name is spelled correct and it That you are connected to the server on which the file exists. The configuration should be on both sites (or should be): I'm using the data source applet to create system DSNs, so my connection string On the lines of "DSN = timesheet" I use impersonation so that ASP.NET The process uses a domain account. My web The config file has an identity tag with a domain

How can I write a Perl subroutine that works both as a normal subroutine or a class method? -

I am writing a function that is more stable in nature. I want to plug it into the Template Toolkit, which passes through the class name. But I want to do something about it classname-> function ($ args ..) className :: function ($ args ..) inside sub-function {} < / Pre> What is the correct way to handle both cases? Normally, it is not. Sub is either called as a method or it is not. See how this situation is prepared before the package name in the logic list. Now, In a very specific, limited case , you can: shift $ $ [0] eq __PACKAGE__; When sub as the first line in your code is called as a class method, leave the argument first.

cocoa touch - Add name to the Address Book of the iphone -

In the iPhone app, I have details like description, name, address, I need to save the name, address in the iPhone address book is. Please help me how to do this. Thanks in advance. ABAddressBookRef address book = abderracebook creation (); ABRecordRef person = ABPersonCreate (); CFErrorRef error; If (! ABRecordSetValue (person, kABPersonFirstNameProperty, @ "John", & amp; error)) (// ABOUT!) (// ABRecordSetValue (Person, KebarsonLastProperty, @ "Smith", and Error)) (// Error)! (ADA Address Book Save (address book, and error)) // // eror} You can set other properties! With the other kABxx constants.

.net 3.5 - How to bind inverse boolean properties in WPF? -

I have an object that has a IsReadOnly property if this property is true, then I I would like to set the IsEnabled property on the button (for example). I have to believe that I can do it as easily as IsEnabled = "{Binding Path =! IsReadOnly}" but it flies with WPF does not. Do I have all the style settings? Just as any other bowl is set inversion of any other hair, it seems very simple enough for some. & gt; button. Style & gt; & Lt; Style TargetType = "{x: type button}" & gt; & Lt; Style.Triggers & gt; & Lt; DataTrigger Binding = "{Binding Path = IsReadOnly}" Value = "True" & gt; & Lt; Setter property = "iced" value = "wrong" /> & Lt; / DataTrigger & gt; & Lt; Datatrigger binding = "{binding path = iside only}" value = "wrong" & gt; & Lt; Setter Property = "Iceded" value = "true" /> & Lt; / DataTrigger &

java - ct-props-correct error when parsing schema -

I am using a JXAB XJC tool to generate some Java interface files from XSD. I am running into a problem where I am making a mistake of a ton of form: org.xml.sax.SAXParseException: ct-props-correct.4: error for type 'COCT_MT110200CA.PayeeRole'. The duplicate attribute uses the same name and the target namespace is specified. The name of the duplicate feature is 'nullFlavor'. The related parts of the schema are as follows: & lt; X: complex type name = "COCT_MT110200CA .Holder" & gt; & Lt; XS: Sequence & gt; & Lt; Xs: group ref = "infrastructurewrite aliment" /> & Lt; Xs: element name = "pieirol" type = "cocT_mt110200 ca. drinkerolol" minors = "1" max ockers = "1" & gt; & Lt; / XS: element & gt; & Lt; / XS: sequence & gt; & Lt; Xs: attribute group riff = "infrastructure value" /> & Lt; Xs: attribute name = "null flavor" type

javascript - How to make .unclick = unbind('click' in jquery? -

I need a shortcut notation for 'unbind' (click on 'Unbind'. / P> I think you want something like this: $ .fn ['Unclick'] = Function () {return.unbind ('click');} The following two lines are equivalent: $ (...). Unbind ('Click'); $ (...). Unclick (); for all events (list of events copied from): < Pre> var events = ('blurring, focus, weight, resize, scroll, etc. Load, click, click, '+' mousezoon, mouseup, mouseover, mouseover, mouseout, mouseover, '+' mouseover (',',;); JQuery.each (Events, Function (Eye, Name) {jQuery. Fn ['un' + name] = function (change, selection, submit, keydown, keypress, key, error)) {back to this unbund (name);};}); < / Div>

c++ - Boost asio ip tcp iostream Error Detection -

Greetings I'm just starting to promote: In the beginning of the ASIO Library and promoting some of the early difficulties. : Asio :: ip :: tcp :: iostream My question has two parts: 1) How does an iostream connect by using a host and port number? I and [boost.org] examples can work fine in coded form. The server explicitly specifies the port: boost :: asio :: io_service io_service; Tcp :: End Point Endpoint (TCP :: V4 (), 13); TCP :: acceptor acceptor (io_service, end point); Port 13 is a famous port for "time of day" service. The client's example connects by specifying a host and service name: tcp :: iostream s (argv [1], "time of day"); For my own application, I want to put the server on an arbitrary port and connect to the number as shown below: Server: < / P> Promotion: asio :: io_service io_service; Tcp :: End Point Endpoint (TCP :: V4 (), Port); TCP :: acceptor acceptor (io_service, end point); Acceptor.accept (* this-

SAS Proc SQL Database Table Insert -

Using SAS Proq SQL, is there a way to insert records from a SAS dataset into a table in an open SQL Server connection? proc sql exec; Connect from Sqlservr to DataSrc (server = my-db-srvr database = SasProcSqlTest); Select objects as table * * Connection from datasource * (selection * FROM tblItem); Updated item set name = name + name, value * 2; Choose from TblItem (name, price) name, price item; Disconnect from dataset; Skip; Run; leave; Run; For my knowledge, using pass pass through SQL stops you on the database server SAS Documentation says that you should primarily make a library reference for the database and then database tables should be treated like SAS tables. In your case it is only normal proc sql, it should mean at least in the latest SAS versions, but not optimal for large tables. What we have done to circumvent it Create a table Pass through update Temporary database - The table should not be session-specific Drop the table in Temp DB, in the table

.net - Creating controls in a non-UI thread -

I have a plug-in model in which various complex user controls are stored in DLL and load on run time Use of Instituted Activator. Create InstanceForm (DLPPit, ClassName). Since I'm loading a lot of these so I wanted to do it in the background, keeping my UI responsiveness by creating a new thread for loading. Control is done primarily and is shown when necessary. It works fine - unless I try to establish an asset on one of the nested controls on one of these user controls, e.g. In the event handler of a button, which throws a cross threading exception, I realize that every time I use a property, I can check the incognito, but I do not have to worry about that , When users write code for control (especially because others do not always miss these bits of code). So my question is, am I trying to, or how best to go about loading these controls in the background, I or it is basically impossible and do I have to control Sticking to the main thread? I hope that the inform

TinyMCE/MCImageManager path problems -

I am making all kinds of strange issues with the path in tinyMCE. I'm not sure if I have to do with MCIme Money, then I will try to summarize my setup: I've got a net website. Right now the application is rooted tiny_mce is hosted in ~ / tiny_mce, the image manager plugin ~ / tiny_mce / plugins / imagemanager ~ / upload, where I want the images To be uploaded / managed ~ / tiny_mce / plugins / imagemanager / web.config has this key: & lt; Add key = "filesystem.rootpath" value = "../ .. / code / in the add key =" preview.urlprefix "value =" {proto}: // {Host} / ap / / / / gt; account root is not on the hostname route due to the account (seriously, I should not have had this hardcode ... but this is another issue) So far the best - When I browse with the Image dialog in TinyMCE, I get an image browser and it browses the correct folder When I select an image the strangeity starts "Insert / Edit Image. In the "Image U

tsql - T-SQL looping to create a recordset -

I have some stored procedures that I need to write against a dirty animal in a database. Requires a loop through and using the application table from the application table, draw the value out of the other tables (some concurrent / average / etc values). I have so far: declare the app to declare the app cursor to select IID by clicking on the OPEN app FETCH from the app @ID on the ID WHILE @@ FETCH_STATUS = 0 start a.NAME_LAST, a.NAME_FIRST, ca.status, (SELECT AVG (number) WHERE application_id = @id from review, (SELECT count (*) WHERE application_id = @id from review) application One from, committee_apps where are the applications Aapplication_id = ca.application_id and a.application_id = @id FETCH next app add-off app apple app deluxe app The results I want from the app, but I'm sure There's a cleaner way, and I do not think it's a better way to do it correctly than to jump in a mental manner today, because it sounds really ugly for me. In addition, it seems

deployment - Visual Studio: Setup Project - !Condition -

In a visual studio setup project, how do I get the reverse of a condition? Specifically, I am looking to run a script if no file exists (i.e. the present condition is false). Check for your property 'wrong', instead of being the 'MYPROPERTY' condition, MYPROPERTY = False '(and yes, despite your best tendency, use a single' = 'no' == ')

transactions - Controlling NHibernate ITransaction with StructureMap? -

I am using StructureMap as my ORM as my IoC container and NHibernate I have found an example online That shows how ISessionFactory and anion is produced with StrapCap, so the factory is a singleton and the session is based on HTTP contact. It works great, but then I started using the NH profiler, in which I was told that I should always use the transaction. So, I thought, why not let StructureMap do the same for me? Here's how I start StructureMax: ObjectFactory.Initialize (x => {x.ForRequestedType} & Lt; ISessionFactory & gt; () .CacheBy (InstanceScope.Singleton) by Default.Is.Constructed (cfg.BuildSessionFactory); x.ForRequestedType & lt; ISession & gt; () .CacheBy (Instancescope Hybrid). Default .is.connected (context => gtc: context.getInstance & lt; ISessionFactory & gt; (.) Openness ()) x. Forerexest type & lt; ITRsction & gt; () .CacheBy (InstanceScope.Hybrid) .Default By I.s.Constructed (context => context.GetInstance &

c++ - Windows XP Style: Why do we get dark grey background on static text widgets? -

We are writing windows desktop app using C ++ and Win32. Our dialog box has an ugly look with "Windows XP style": the background of the static text is gray. While the dialog box background is too gray, this is not a problem, but inside a tab control, where the background is white, the brown background for the text is very noticeable. First we have done many of our drawing of control, but these days we are trying to use Enfell as standard as possible, and avoid overriding the maximum standard behavior. We are using Win32 API, which is getting a while but I think the problem happens with ATL also. We are creating a dialog template. Text is a "static" control (0x0082 ) In the style we have set for the style is "SS_LEFT" Text Control is inside a tab control: "SysTabControl32" with only one flag: WS_CLIPSIBLINGS is set to use it with SS_WHITERECT and WS_EX_TRANSPARENT and other settings Have done, no benefit . All this is pulled with standar

c# - Conversion of text data into date -

I have a situation in which I have to change the text data in a date. I have used the following code to do this! string s = textbox1.Text; If (String.IsNullOrEmpty (s)) {textBox2.Text = "Please enter a date."; } And {datetime DT = date time.ps (s); String day = dt.day.ToString (); String month = dt.Month.ToString (); String year = dt. year. Toasting (); S = day + "/" + month + "/" + year; Textbox2.Text = s; } This will only change the following formats of data. 10/10/09 or 10/10/2009 ---- Changed Date ------ 10/10/2009 12/13/2009 Or 12/13/9 ---- converted date ------- 12/13/2009 10/16 ---- changed date ---------- ------------- 16/10/2009 2009/12/10 ---- Date changed -------------- ---- 10/12/2009 The following formats are not found 16/10-dd / mm 06020 9 or 06022009 ddmmyyyy 13122009 mmddyyyy 20091213 yyyymmdd 20091312 yyyyddmm 20.07.2009 / 20.07 2009 / 20-07-2009 / 20-07-09 Anybody can help me with this I am very n

reporting services - how can i add a .jpg file in local report(.rdlc) in c# withour storing the pics in database -

How can I add a .jpg file to the local report in the pics store in C # withour database < / Div> There are three ways to get an image on the Microsoft Reporting Document. Database Embedded External I think you know how Chalky's database of your question gives an excellent example of how to do an embedded image (This is usually what I'm taking.) In the end, external images are external for you, you can set the property on the external to the image and either refernece a file path or a URL in the value property can also be done. Finally you have also set the external image property to the code: i.e. Report Viewer1.LocalReport.EnableExternalImages = true; Hope that helps.

sql server - Minimum permissions required for an updatable query (Access Project) -

In an Access Project (ADP) with a SQL backend, the minimum permissions required for access to be able to be updated Are Records come back from a view with a view, still block the direct SELECT on the underlying table? For example: Table: Table1 column: ID, column1, column2, column3, column 4 See: View1 Selection ID, Column 1, Column 2, Column 3 to Table 1, where column 1 = 'Something' < P> As the database owner or role db_owner (or roles db_datareader , db_datawriter ), records can be updated when accessed Is bound to the scene. However, if the user is not a member of these, the archive can not be updated through access. I allowed SELECT , from UPDATE to view 1 and SELECT to Table1 and < Code> Update to Table1 (does not work on UPDATE on any view). I also declined from UPDATE to column 1 because I do not want the user to update that column. If I'm connected to the SQL database (SQL Server Management Studio) with these

websphere - Oracle connections problem -

We are currently seeing the following error in our Oracle Audience Log. TNS-12502: TNS: Customer did not get any CONNECT_DATA We connect to this Oracle 10G database from Applications running on Websphere 6.1 Any ideas to fix this Could this be the reason or cause of any suggestion? Thanks Damon You can get it if you open a process quickly And closing closing the network port (such as 1521). This can be a fugitive process or harbor breeze.

jquery - How to clear the value of a javascript variable? -

I am using a javascript wizard to control the running of an AJAX call. Call starts with one click event (on "#week _tag " div) and only needs to be run once per page load. The same click event also has a sliding panel ("#week_summary") Toggles the display where data from the AJAX call is shown. In the example below, I am trying to use a variable and a statement, when the Ajax call is called the "#week _tag " sliding panel by the user name Second time to close The vera status is set to "first" when "page" is loaded, and AJAX is set to "after" after the call. If the WAR state status is equal to "before", then the call is in progress, otherwise the "#week_summary" bus has been toggled. This is not working because I do not know how to give "status" to the second value of "latter". Any ideas? $ (document) .ready (function () {var status = "before"; alert ("before:&qu

c# - Best practice for giving back extra information from a Validate function -

I have a class employee to ensure that all these fields have populated with valid values, save I want to be able to validate it before the class users can call valid () call before calling or they can directly call the save () and save () call again (valuyet) And if the verification fails, then possibly throw exceptions Is obtained. Now, my (main) question is this; If my valid () function returns a simple shell, then how do I tell the user's class which is wrong, i.e. "not across email", "id not unique" etc. For this purpose I just want to give the error string to the human user, but the principle is the same if I want the list of error codes (except that using bitmap is more logical). I can use the Out parameter in my valid function, but I think it is frowned on. Instead of returning to a bool, I test a string from my work and just test if it is empty (no error) - but it does not look messy and right. I can simply create a single stratus for this

sql server - TSQL: Select from set of columns with lowest positive value -

उदाहरण स्कीमा: RowID मात्रा ModifiedPrice GroupPrice CustomPrice SalePrice ------- -------------------------------------------------- ------------------- 1 5 20.00 0 15.00 17.00 2 2 14.00 7.00 22.00 0 3 9 10.00 10.00 0 11.00 के आधार पर यह उदाहरण तालिका, मैं सबसे मूल्यवान / सरल तरीके से संभवतः चार * मूल्य कॉलम के बीच न्यूनतम शून्य-शून्य मान चुनने में सक्षम होना चाहूंगा। उदाहरण आउटपुट: राउड मात्रा अंतराल --------------------------- --- 1 से 5 15.00 2 2 7.00 3 से 9 10.00 अतिरिक्त जानकारी के लिए, डीबी SQL सर्वर 2005 है। SELECT RowId, मात्रा, (SELECT MIN (price)) से (मूल्य संशोधित मूल्य के रूप में चुनें यूनिअस सभी का चयन समूह मूल्य यूनियन सब का चयन करें कस्टमपर्च यूनियन सभी का चयन करें बिक्री मूल्य) qi WHERE मूल्य & gt ; 0) से mytable यह मामला बयानों का एक समूह की तुलना में अधिक पठनीय है नोट इस बारे में है, लेकिन है कि । 4 मामला बयान के रूप में के रूप में धीमी गति से बार यहां परीक्षण स्क्रिप्ट जो पार्स करता है और पैदावार सही परिणाम है:। CREATE TABL

java - Counting Line Numbers in Eclipse -

I have a java project in Eclipse that contains ~ 10 packages and ~ 10 class files per package. Is there any way to determine the total line of code for the entire project? I'm familiar with other tools (for example, code analyzer, WC, etc.), but I want to know that there is no way to do this or to confirm that there is no way to do this. Here is a good matrix plug-ins that shows the number of lines of code and more: Has been done:

ruby - How to stop thinking "relationally" -

At work, we have recently started a project using a thoughtbase (a document oriented database). I am having difficulty learning all my relational DB knowledge. I was wondering how many of you overcome this obstacle? How do you stop thinking relationally and begin to think initially (I apologize for making that word). Any suggestions? Helpful hints? Edit : If there is a difference in it, then we will notify Ruby & amp; CouchPotato to connect to database Editing 2 : I had trouble answering. I chose one who helped me to learn the most, although I think, there is no real "right" answer, I think. I think, after adding a couple of pages on this subject after perusing, it Depends on all types of data. RDBMSes represent a top-down approach, where you are the database designer, which will emphasize the structure of all the data present in the database. You determine that the first, last, middle of a person Name and a home address etc. You can apply it using RD

dependency injection - Different ways to inject dependencies in ASP.NET MVC Controllers? -

In most of the samples I've seen on the Web, DI is done in MVC controllers like this < Code> Public Product Controller (IProductRepository Rep) {this._rep = RIP; } A custom Controller Faititer is used and it uses the structure of the choice and the repository is injected. Above the top ex> Public Procure Controller () {this._rep = ObjectFactory.GetInstance & lt; IProductRepository & gt; (); } This will get the same result, but the custom controller factory is not required. As far as the test is concerned, the test app can have a different bootstrap, in such a way that when controllers are being tested they can get fake treasures and if used for real They will get real people First of all, the service locator hides dependency. In its second example, seeing the public interface alone, it There is no way to know that the product controller needs a repository. What's more, I think I'll have to meet it. IProductRepository repositor

objective c - how to count tap in simulator? -

मैं सिम्युलेटर में डबल टैप कैसे गिनाता हूं? - (शून्य) स्पर्श करता है: एजेंसी: (एनएसएसईटी *) एवेन्ट से छूता है: (यूआईईवेंट *) इवेंट {यूआईटीच * स्पर्श = [किसी भी ऑब्जेक्ट को छूता है]; अगर (touch.tapCount == 2) {// अपने सामान यहां हैं}}

c# - How to determine what object[] passed as parameter contains? -

I think this problem should be sorted by reflection (a technique I'm not sure about) Could. My code is getting some code objects that XML has been serialized at runtime. When I get it and cancel it one area, then I am having some problems. There is an area in which the following data can be a combination of classes (simple to clarity): class key value type type {public string key; Public string value; } Class key vulnerabilitypair {public string key; Public string [] value; } I get it in my code as an object [] and I need to set it on runtime to determine exactly what it is so that I have an interface on a local object CallValueListPair [] data2) P> I have to deal with the following matters: Adding to the item [] : Nothing, in which case I doSomeWork (empty, zero); The only keyway pair type type, in which case I call DoSomeWork (KeyValuePairType [], Null); An array of KeyValueListPair only, in that case I doSomework (empty, KYvalewerPear []),

c# - Converting Web Service to WCF -

I've recently written a cover for the Apple X Web Service (C #) - this is a product that is part of the software AG Adbus. Offering The web service interface is really primitive and I have written the cover to make it easy to use. The cover is in use on web applications (C # + espants), but I want to use a Windows client, it is using WCF to write WCF services with scratches or just existing in WCF Wrap the wrapper better? Is the wrapper in a different class library? If not, you can take wrappers to a class ibrory library and allow ASP.Net App and Windows Client app to consume it. This will end any adder wrapper and abstract layer. This Windows will allow the customer to consume the service directly through the ASP.Net application. If you wrap the existing cover as a WCF service, call service to your ASP.NET app from the Windows client, which will rotate around and make another call for the service that is the consumer . The above recommendations will be borne. If there are

c# - create printbatch to print multiply flowdocuments -

How to print multiply flowddomets in a batch? The following code should print different documents but should be printed. This sample works only properly if you print on the XPS printer. var printDialog = new PrintDialog (); If (printDialog.ShowDialog () == true) {var xpsDocumentWriter = PrintQueue.CreateXpsDocumentWriter (printDialog.PrintQueue); Fork (different person in person) {var doc = Application.LoadComponent (new Uri ("Template.xaml", Urikkind.Relative)) as a flow document; Doc.DataContext = Individual; Var paginator = ((IDocumentPaginatorSource doc) .DocumentPaginator; XpsDocumentWriter.Write (paginator); }} assigning DataContext to thread these issues After doing this, make sure the thread uses its waiting queue: Dispatcher. Current Dispatch Invoc (Dispatcher Propagata. System Idel, new Dispatcher Operation Callback (_ = & gt; null), zero);

cannot see bin folder in fckeditor download -

I tried downloading a fcditor but after removing it from zip, there was no bin file: < P> Am I dense? Where is the bin file? FCKEditor is just javascript and CSS files, NAT is in integration. Note that one you downloaded is also required.

PHP simple proxy -

I need a simple proxy PHP function / script that can download a file from a foreign domain, and let me Allows also to modify data retransmit before data (in the form of wire) "Any ideas better than" Readfile ($ url) "?? file_get_contents (), popen (), Http_get () or the methods and functions that you might want to see You can use regex or simple straw_reale () depending on what you are downloading and how you want to change it.

ajax - Twice postback in ASP.NET -

My page is completely postback twice, I'm using master page with AJAX is. + ------------------------------ --------- ------ + | Web User Control with AJAX Tabs Control + --------------------------------------------- + | | | | | Col1 | Content placeholder | Col3 | | | | | | | | | + --------------------------------------------- +// Code > The AJAX tab container is with AutoPostback running in the web user control. I have created several ASPX pages using this masterpage. The content place holder also controls a web user based on the page. Whenever I go to the page by clicking on the tab, the page becomes fully postbacked twice. I could not understand what the reason is. This makes reporting difficult because it requires double time. Please go here - get ideas. I can not loginid. When the page directive autoeventwireup is correct and you attach an event to OnInit, things like page_load, those events Will be raised twice, it will look like a double postback. It c

javascript - How do I wait until the user has finished writing down in a text input to call a function? -

I am preparing a web site and I want to be able to call 1 second function after the end user input. I tried to use on the Kue, but waited for 1 second after the first keystroke. Does anyone know how this would be possible? Another similar approach without the globe: var typewatch = Function () {var timer = 0; Return work (callback, ms) {clear timeout (timer); Timer = settimeout (callback, ms); }} (); ... & lt; Input type = "text" onKeyUp = "trivch (function () {warning ('time has passed!');}, 1000);" / & gt; You can snippet it.

vb.net - .NET 1.1 WSDL - Unable to use IntPtr (WindowsIdentity.Token) as input param on WebMethod (ASMX Web Service) -

We are using a inherited winforms VB.NET 1.1 application ASMX web services which are in a strange situation. Trying to send a user identity from a WindowsIdentity object as a parameter for a webmeter. I would like to add a 'hack: comment'. System Security. Principal. Windows Identity GetCurrent () Token type is IntPtr, the first problem is that the WSDL is being generated, does not support interpetric with the 'unsupported type' error. I know this is a big WTF question and looks insecure, so any simple helper option is welcome but there are many obstacles on how to change the system, including complications with hosting environment. So I like to get my data in the web service to save a lot of other headaches. Error generation from WSDL: Problem 1 Error generation from WSDL: The method can not be reflected in userClass.TestSendIntPtr. - & gt; There was an error showing 'token' - & gt; System.IntPtr is an unsupported type. An alternati

java - digital clock -

Any inclusion class available to display digital clock in java ?? I think there is no one built in it, but they are quite easy to develop. There is one that you can use here is a

What methods are available to implement a text editor in Java? -

What methods are available to implement text editor in Java? The class will be a good start. It is a good idea to take a look at examples and explanations and to place classes from. / P>

c# - Web browser stealing focus -

I have two winforms that load together for the first time with a web browser and in the second form The second form is always controlled, the second form does not receive any mouse events, while the first form loads, after closing the first form, the second form receives all the mouse events. How do I solve this problem Please use the code to show for your second form , Although this should be something like this: form2 myForm2 = new form 2 (); Form2.Show (this); It is not very likely that your web browser is generating it.

bootstrapping - Zend framework common code for all the controllers -

I have a login button in the header of the website. This header is programmed in the HTML jnd framework's ideas / layout / homefile. I have a hidden form in this layout that starts with the jQuery thickbox inline content display integration. Reason, I just want to call an AJAX call to get a small entry form. I am creating a form using Zend_Form and the problem is that I have to do all the controllers after checking that the user is logged in or not. I want to keep this farm generation in one place, say in bootstrap and then there is an argument in bootstrap that if the user is logged in, do not create the form. I do not know the bootstrap is the right place to do this or should I place it in some other place. Therefore, I should instantiate the form so that the user is available everywhere if the user is not logged in. Create your own base controller that extends to Zend_Controller_Action, after which your controller I do not know what is "jQuery thickbox inli

php - How to set a file in cron job -

I need to run a php file every minute, so I tried to set up the cronabose with cPanel but with this message Sending mail "Input file can not be opened:" My php file is inside public_html / schoolerp / cron.php I did: / usr / local / bin / php -f /public_html/schoolerp/cron.php Am I doing something wrong, please tell me whether I am setting it up correctly, and If i am wrong please Help it to correct ... "post-text" itemprop = "text"> Use the full path Make sure that The script is accessible, check access The cronx will take all the output of your script by default and send it to your email You can redirect the output of your command Can I stop sending the email to prevent the cron file or to / dev / null in the local file for future references I will suggest to Nupreshit, it is good for debugging and when something goes wrong. I think that should do something like this: / usr / local / bin / php -f /public_html/schoolerp/cron

php - client->soapFunction(); and soapCall not returning data but getLastResponse does -

By separating the code from the code I used with the code given below. If I $ client-> function (); However this object ID # 2 returns. $ client = New SOAP client ("http: //blackbird.integrated.local/PricingTool/WebService.asmx?wsdl", array ('trace' = & gt; true)); // resonant $ client-> __ SOP ('TestSoAP', array ('yes' => 1')); $ Client- & gt; GetDAAAvailablility (array ('Parto' = & gt; '100C')); Echo $ client- & gt; __getLastResponse (); I am wondering why this is so, and I am doing the wrong way to call the soap work correctly. The problem was a bug in the previous version of PHP, updating the latest version, Required request was made.

iphone - How can I write a complex CGPath or vector image to disk? -

Can I write bytes of CGPTH on the disk and then read them later? Is there an easy way to store SVG style paths on disk? I have a very complex SVG file (~ 500K) which I would like to convert to a binary format for easy storage and load on the iPhone. Given the SVG file, only lines and beijer decreases, which map all core graphics path perfectly for primitives. Thank you very much, Carl CM < Callback calls for each control point of code> CGPathApply a CGPathRef . You can use it to write control point on disk.

algorithm - LinkedIn type friends connection required in php -

I am creating a custom social network for one of my clients. In this I have user friend of CSV as shown below in user table UID user_name friends 1 John 2 2 jack 3,1 3 gary 2,4 4 Joey 3 In the above scenario, if the logged user is John and if he visits Joey's profile page, then there should be a connection between them < P> John-> Jack-> Gary-> JOI I am able to establish a connection at level 1 If J JOI's profile visits, so I am able to set the following: Jack-Gary -> JOI But for the second level I need the same routine that I I do not know that is the right solution + I can not even apply it. So, can anyone help me with this? Thanks in advance, Sky P: SI is not in a position to change the DB architecture tion: ( Here are some BFS codes that I wrote in Ruby; You should give a good enough idea that things work for PHP to translate it The other changes you make are the graphs with the DB query to get the friends of the current us

Accessing Windows system variables in Java 1.4 -

What is the best / easiest way to get the values ​​of environment variables in Windows when using J2SE 1.4? You definitely have no way to reach the environment variable from the Java API. Runtime with such code. The only way to gain with XAC: process p = null; Runtime R = Runtime. Tot Timetime (); String OS = System.getProperty ("os.name"). ToLowerCase (); // System.out.println (OS); If (OS index ("Windows 9")> gt; -1) {p = r.exec ("command.com / c set"); } And ((OS.indexOf ("nt")> gt; -1) (OS.indexOf ("windows 2000")> 1) (OS.indexOf ("windows xp") & Gt; - 1)) {// Thank you for Xenfran for Xand Fix! P = r.exec ("cmd.exe / c set"); } Although you can use Java variables to thank you for system .getProperties (); But you only have some NV variables mapped by JVM, and additional data that you can provide with the "-KK = value" on the Java command line For more information < /

How do I change the zone offset for a time in Ruby on Rails? -

I have a variable foo that has a time, say at 4 o'clock, but the field offset is wrong, that is it Wrong time zone How do I change the time zone? When I print it I Fri Jun 26 07:00:00 UTC 2009 Then there is no offset , And I would like to set Offset to -4 or the Eastern Standard Time. I just want to be able to set offset the property of the time object, but is not it available? You can not explicitly say how you get actual variables but since you have time class I think you get the time to use it and I will tell it in my answer Time zone is actually part of the time class (in your case the timezone showed as UTC has gone). Time. Now as part of the time, the offset will return from UTC. Respond now. & gt; & Gt; Local = time.Now => 2012-08-13 08:36:50 +0000 & gt; & Gt; Local.hour = & gt; 8 & gt; & Gt; Local.min = & gt; 36 & gt; & Gt; ... in this case I have to be in the same time zone as GMT Changing between

objective c - iPhone network performance -

I have a question and I'm open to suggestions (very strange!) I'm writing an iPhone app, which requests a server (URL of the parameter) as a response, the iPhone XML receives all right. Right now, I am looking to improve the speed of my actions which takes time to do some work. I have found that, in all the tasks downloaded, XML parsing, sending requests, pushing the request, parsing objects from XML), it takes the longest time to download the actual XML. Now, my XML files are very, very, very simple and very, very, very small. I mainly read them like RSS and read them in UTIB. My app works very well, and there is nothing that really feels slow, but there is an application in the app store that does something similar to my application, but The way it is faster and feels more 'fast', if you know what I mean. It also has a great facility to load headlines from RSS feeds one by one. Currently I am experimenting with the compression of my data, but compression

.net - Why won't C# inline functions with struct parameters? -

We learn that C # methods with Strapt write not as a formal parameter Is it due to the potential dependence on the stack It is, e.g. For recurring? If so, can I benefit by changing the structure criteria in such ref parameters? Public int short {return array 1 [i] + array 2 [i]; } turns: amount public int (ref Int i) {return array 1 [i] + array 2 [i]; } Edit: I went to a test, but I can not find anything inline. Here's what I've tried: class program {Private Static String Results; Static zero main (string [] args) {Console.WriteLine (MethodBase.GetCurrentMethod (.name)); Console.WriteLine (); M1 (); Console.WriteLine (results); } Private Static Zero M1 () {Results = MethodBase.GetCurrentMethod (). Name; }} It prints "M1" as the second line, which indicates that they did not inline. I made a release build and took any idea with it Ctrl-F5 (to not attach the debugger)? As John said, it would have a very old post I can confirm the following cod

java - Are tasks parallelized when executed via an ExecutorCompletionService? -

I deposited 5 jobs for one, but it executed in jobs such as looks Goes away. The executable service provided to the creator of the company has been created using the new Cash Flat. Am I doing anything wrong? UPDATE Every job is basically querying a database & amp; Code has been closed for some calculation executable service. I have just changed the callbones with my own custom callbell implementation. Expiring Termination Service Anything To do this, how it works, this is an easy way to get the result. Executor. NewcachedThreadPool works differently by default, threads that can parallel, have been given: The tasks are free, and Do not do this in sync with the same object; You have multiple hardware CPU threads The last point is worthy of an explanation. Although there is no guarantee, in practice, Sun JVM supports the currently executed thread, so it has never changed in favor of the other one. This means that your 5 tasks can be executed sequentiall

c# - Are public events asynchronous? Do they execute on a separate thread? -

Is the public event asynchronous? Do they execute on a different thread? The events that are triggered are triggered by the event. This means, if the event has been raised by the GUI thread, the event handler is executed in the GUI thread for that event. If the event is extended by some background thread, event handlers are executed in that background thread. Whatever the threader handler is executing, that method is executed in a synchronous manner. As an additional note, if you have an event handler, for the event that has been raised from the category that is working in the background, when that event is triggered The event handler will be called in the background thread. Which means, you will need to use control. Inuk or any other mechanism to pass data to a GUI thread, so that the form can be modified.

performance - pl/sql Stored procedure... where does the execution time go? -

I'm currently detecting a performance leak in a stored procedure last "end" (I before ) before putting an accurate timestamp after an initial "start" and that process seems abt. 10 seconds to finish, however, I have to wait 2 minutes + to finish it. Can anyone tell me where the rest of the time goes? I am using Oracle SQL Dev but it does not look useless for the rest of the time, the process is locked on the related table: ( Thank you very much for the educator. Edit: Thanks again for your input :) Here is the stripped code for the process, depending on the number of items to be processed, in the first part ABT 10 to 40 seconds, the second volume is a few milliseconds, although this process takes 2 to 8 minutes to run. Also, the table that destroys the data is locked for some time, due to which the inserts are postponed. BTW, there is no difference in starting this as a scheduled job. Process to create or change process is MY_PROCEDURE start_proc

c# - Drawing an Image to a subItem in the ListView -

My listview is set in Detail view with the following column header: Image Name || Image space || Image size || Image Preview I would like to know what is the way to draw an image in the fourth column there. The only way I know, set this.listview1.OwnerDraw = true this.listView1.DrawColumnHeader + new system.windows.form.diallistview columnheaderAventHandler (listView1_DrawColumnHeader); This.listView1.DrawItem + new system.window.form. Drilledistimate event handler (listView1_DrawItem); This.listView1.DrawSubItem + = New System.window.form.aldlistViewsubewithIvageHandler (listView1_DrawSubItem); The problem with this is that I have to handle all the catalogs myself ... I was wondering if there is a better way of attracting a subtitle in the image or if someone How to handle DrawSubItem events only? listView1_DrawColumnHeader and listView1_DrawItem event handler in It should be e.DrawDefault = true; This will use the default drawing implementation for column

Why am I getting an "Undefined variable" notice in PHP? -

तो मेरे पास निम्न है: & lt;? Php show_form (); ? & Gt; & Lt; form id = "add" method = "post" action = "addIssue.php" & gt; नाम: & lt;? Php input_text ('नाम', 'str_name', $ डिफ़ॉल्ट, '1'); ? & Gt; & Lt; इनपुट वर्ग = "जमा करें" प्रकार = "सबमिट करें" मान = "डाउनलोड शुरू करें" / & gt; & Lt; इनपुट प्रकार = "छिपा हुआ" नाम = "_ सबमिट करें जांच" मान = "1" / & gt; & Lt; / प्रपत्र & gt; & Lt;? Php फ़ंक्शन show_form ($ errors = '') {// यदि फ़ॉर्म सबमिट किया गया है, तो सबमिट किए गए पैरामीटर से डिफ़ॉल्ट प्राप्त करें (खाली ($ _ POST ['_ submitCheck']) या! $ _ POST ['_ submitCheck']) { // अपने स्वयं के डिफ़ॉल्ट सेट करें $ defaults = array ('str_name' = & gt; ''); } और {$ डिफ़ॉल्ट = $ _POST; }} // इको टेक्स्ट बॉक्स फंक्शन इनपुट_टेक्स्ट ($ elem_id, $ element_name, $ values, $ tab = '&#

wpf - Hide a ContentControl -

Below is a good piece of artwork that represents a WPF form, in which a list box on the left and a content on the right side is ----- ----- | One | | C. | B | | ----- ------- You should create a style Use the trigger to determine the content controls, and 0 items in the list, such as: & lt; ListBox x: name = "uiList" & gt; ... & lt; / ListBox & gt; & Lt; ContentControl & gt; & Lt; ContentControl.Content & gt; & Lt; Text box text = "There are items in the list." / & Gt; & Lt; /ContentControl.Content> & Lt; ContentControl.Style & gt; & Lt; Style TargetType = "{x: Type Content Control}" & gt; & Lt; Style.Triggers & gt; & Lt; Datatrigger binding = "{binding element name = ui list, path = item.count}" value = "0" & ​​gt; & Lt; Setter property = "visibility" value = "collapsed" /> & Lt; / DataTrigger & gt; & Lt; /S

Removing header from a flat file in BizTalk -

What is the easiest way to remove header row from a flat file in BizTalk? I have applied it by creating a separate schema for the header row (and one for body) and then set the headerspecam property in the 'Configure Pipeline' dialog in the header schema that I just created and the protected property property is incorrect. My problem is, however, with this solution I need to create a schema, which does nothing other than that, so I can remove the header row. I believe what you said is the way to do it. I had to do a project on which I am working and chose for additional schema. Another option, the flat file will have to be written for the minor stage executed before disabling the file. The decode phase will also work, but it seems that the desmombal stage is created for this type of work. This second option will remove the header row more generally and can be used in many different schemas so that you do not have to create a separate header schema for each flat fil

c# - Killing a .NET thread -

I have created a thread by running a certain method. But sometimes I would like to kill the thread, even if it is still working. how can I do this? I tried threads Ebert () but it shows a message box that says "thread aborted". What should I do? thread. Assistant is dangerous. Instead, you should cooperate with the thread so that it can be stopped peacefully. The thread needs to be designed so that it can be asked to kill itself, for example when you want to stop the thread, the boolean containing the flag that you set to false then the thread As if works (go) {/ * if the thread can block in a sleep or wait , then you By calling them can break it from those tasks. Thread should be ready for a threaded interpolation exposure : to try (keep running) {/ do the job. Hold (threaded interrupted exception exception) {/ * Clear * /}

protocols - Is x.224 specification freely available? -

I need to implement a normal check that uses the "open" Microsoft RDP protocol but this protocol is X. 224 refers to the specification and ITU wants money to download it. Is there a free version of the x.224 protocol available? While I recommend a free version X.224 RFC1950 says this: ITU-T recommendation X.224, contract D, "checksum algorithm," November 1993, pp 144, 145. (available from Gopher: //info.itu.ch). ITU-T X.244 is similar to ISO 8073 . ISO 8073 is available at.

gtk - Run a function every X minutes - Python -

I am using Python and PGTK I am interested in running a certain function, which receives data from serial port And it saves it every few minutes. Currently, I am using the sleep () function in the time library. To be able to process, I have the installation of my system: import time time = 300 # 5 minutes while (1): time 1 = time.time () reader ( ) # Read data from serial port processing () # Accessories with serial data, in which time to dump the file 2 = time.time Time () Processing time = time 2 - time 1 truth = weighty - processing time. Sleep (salvage) This setup allows me to interrupt the 5-minute reading of data from the serial port. My problem is that I want to stop my readerial () function which is running every 5 minutes and wants to be able to work all the time instead of using time. Sleep () function. Any suggestions on how to solve this problem? Multiple threading? Comes in between? Please keep in mind that I am using Python. Thank you. Do not use suc

sql - MS Access Query Syntax Error in FROM -

For an assignment, I ordered the customer's last name, order date, product ID, product cloth, quantity, and Unit Price This table contains. Sis ( CID , this is a table and the user should be INNERJOIN, even though it can be used. Last, first, call ) ( OrdID , OrdDate, SHIPDATE CID) Manu ( ManuID , name, phone, city) Prods ( prid < / Strong>, ManuID, category) ProdFabric ( prid , textile , value) order line ( OrdId , PID , Fabric , Volume) Bold means it is part of the primary key or the overall key. The query I entered, but I keep getting a syntax error on it and it keeps the command highlighted for some reason (after Cus INNERJOIN). Select Last, OrdDate, ProdskPrID, fabric, quantity, price Cus INNERJOIN order INNERJOIN Orderline INNERJOIN on OrderLine.PrID = ProdFabric.PrID on ProdFabric and Orderline.Fabric = ProdFrabric.Fabric On and Cus.CID = Orders.CID and Orders.OrdID = Orderlin e.OrdID; What is the reason for this and how do I solve it

matrix - Very large matrices using Python and NumPy -

is a very useful library, and by using it I have found that it is capable of controlling the matrix which is quite large (10000 x 10000) is easily but struggling with huge (trying to make a matrix of 50000 x 50000), obviously, it is largely due to memory requirements. Is there a way to create basically heavy metrics in NumPy (without many terabytes of RAM) in some way (1 million to 1 million) PyTables and NumPy are the way to go. PyTables will store data in HDF format on disk, with optional compression. My datasets often get 10x compression, which is easy to deal with tens or millions of rows. It is very fast; My 5-year laptops can decrease through a SQL-like group aggregation data in 1000,000 rows / seconds through a python-based solution is not bad! Again it is easy to access the data as a NumPy recara: data = table [row_from: row_to] HDF Library takes care of reading and related to NumPy changes in related parts of the data.

java - How can I make Japanese characters appear correctly in a JTextField? -

I have copied the URL and pasted that URL into a JTextField Shows ([] [] ... [].) How can I solve this problem instead of "メ イ ン ペ ー ジ" of those characters so that the URL can be shown correctly? Similarly, when I copy the URL (in any language) in this message box, it appears that it is not in the form of a class .. thanks You should have a font installed on the computer on which your app is running. If this is an English version of Windows (or any other non-Japanese version, I think), then you may need to download and install the font. You can get it here.

c++ - How to signify to the compiler that a function always throws? -

Always returns a function to a function when calling the function, then the compiler often warns that all the control paths have a value Do not return. Legally so zero always (tropho) {"something"; } Bool fu () {if (cond) always money (); And come back to the truth; // Alert C4715 here} Is there any way that always does it? I know that I throw another after the function call : {always trance (); Throw "dummy"; } And I know that I can explicitly disable the warning. But I was wondering if there is a more elegant solution. With Visual C ++, you can use __declspec (Noreturn).