Posts

Showing posts from September, 2010

sql - How to find current transaction level? -

आप SQL सर्वर पर मौजूदा डाटाबेस का लेनदेन स्तर कैसे पा सकते हैं? इसे चलाएं: का चयन करें लेनदेन_अनुक्रमणिका_लिवल WHEN 0 तब तक 'अनिर्दिष्ट' है जब 1 'पुनःअनुवादित' जब 2 'रीड कॉमेंट' WHEN 3 फिर 'पुनरावृत्त' जब 4 तब 'सीरियलाइज करने योग्य' जब 5 'स्नैपशॉट' अंत तक TRANSACTION_ISOLATION_LEVEL से sys.dm_exec_sessions जहां session_id = @@ SPID

inversion of control - Using Castle Windsor and the NHibernate facility on shared hosting -

I am trying to use Windsor and NHibernate in a middle-confident environment and I have some problems with permissions I'm going I have read this through other questions, but I am using Windsor's NHiberNate facility which I have not discussed. There is dependency on the castle for any reason. Service. Transportation assembly when the container starts. It then tries to create and example: Castle Service. Transaction CallantAxActivia Manager () A security exception is raised as a callcontactactivity manager. In system. Remoting Messaging Call signal which only if you have permission for infrastructure, I guess that do not do middle trust apps. Does anyone know a way around this trustworthy security problem? Should I dump the NHibernate facility manually and register it with the container? You can register at TLSActivityManager in the container (for type IActivityManager) DefaultTransactionManager (used by NHibernateIntegrationFacility ) Then using this ActivityM

validation - An example of xVal with ASP.NET WebForms? -

This is a two question. Is it possible to take advantage of the automatic client-side legalization with ASP.NET webform? If so, is there any example available? I think that xVal will be ASP.NET validation control. These controls will be equal to WebVorms & lt;% = Html.ClientSideValidation ()%> For MVC but before that I have a lot of depth Junk, I want to see if anyone has tried it. (And yes I tried, but the results were not very useful.) to: I think it should be optimized for XLL to work with ASP.NET webform. However, to keep the xVal project centered, I do not want to try to add that support nor would I like to make the MVC experience as streamlined as possible. Though feel free to go to yourself! -, xVal coordinator So when I have some time, I will see if I can not modify the xVal source to work with the webform . Update : I have created a CodePlex project for this. See for details.

apache - Different page provided for Google Crawl -

I created a Twitter client which is only a page: index.html When used, it pulls in content from JSON feeds to populate various columns. The problem is that any traffic coming from Google except for searches on the domain name of the site is coming. The reason for this is that Google crawls index.html only when it is empty and the user sees before entering any Twitter user name. How can I make Google Spider, when I try to crawl index.html instead of crawl just index.html (or additionally) index # CNN (i.e. site.com/#CNN ) Or index.html # whitehouse, which will also crawl all the contents of these pages and thus will be accessible to users searching for the terms in it. I do not think an index (#) will ever be included in its index in Google. Provide an alternate URL, such as site.com/CNN

iphone set a fixed font size for UILabels -

There are many UILBels of different sizes on my view. I want all UILABLLES to have the same font size, regardless of How wide or how long my wombs are, I've tried many settings in IB but nothing seems to get me fixed font size. I'm sure I'm missing something easy, can someone give me clues? Turn off "adjust to fit" in font size preferences label attributes or Label.adjustsFontSizeToFitWidth = set;

Strange Java error with annotations -

Try typing: list & lt; Object & gt; List; @SuppressWarnings ("uncheck") list = (list & gt; object & gt;) new object (); This << p> list can not be sorted in a way I understand how this annotation works. Even the logic behind it knows? Edit: Thanks for the quick reply I knew that this works if even the assignment is made a declaration. You comment on the manifesto, not just the assignment. This compiled: @SuppressWarnings ("uncheck") list & lt; Object & gt; List = (list & gt; object & gt;) new object (); See Jawadox for List targets. And if you look, then it says: local variable declaration (no target Arbitrary statement, so any annotation possibly can not go there and still allows it to be compiled.)

C# write a simple string from winforms --> cmd prompt telnet -

I have to give a simple string from the command window (floating telnet), ac # vanfarm app ... The easiest way? I tried the following, but not all or nothing at the time of redirecting standard or input - the winforms app is not to start CMD window ... CMD window may already be running - I thought how to communicate with it - Is there 1 or 2 there? ' Please help! process p = new process); Serial swift; // Streamrider SR; // StreamReader mistake; ProcessStartInfo psi = New ProcessStart Infos (@ "CMD.exe", @ "/ c Telnet 192.168.0.10"); Private Zero Start {psi.WindowStyle = Process WindowStyle.Normal; Psi.RedirectStandardOutput = false; Psi.RedirectStandardInput = True; Psi.UseShellExecute = false; Psi.CreateNoWindow = false; P.StartInfo = psi; P.Start (); } Private Zero write_to_cmd (Object Sender, EventArgs e) {psi.RedirectStandardInput = true; Sw = p.StandardInput; //// sr = p.StandardOutput; //// err= p.StandardError; //sw.autooflush = true; If

Emacs reselect region, as Vim shortcut 'gv' does -

In VIM, the visual block can be remembered with 'GV' command so that multiple commands are easily implemented Could. (E.g., commenting, indent, then do_something_fun). In Emacs, how can this be achieved? [C-XC-X] works only when the current cursor position stays in the place where the previous block was finished. If the previous block was changed, the nearest 'register from the point' and 'jumper register' is to go through. Just curious if the command made in an MACX is making it in one shot. If the transient icon mode is off, the area is always active if it is turned on ), You can set the sign-even-if-inactive to allow area command to work if the area is not highlighted. However, note that you can cycle back through the previous mark posts using cubic C-SPC - this will pop up the mark ring once you return If you want to go, then the C-X-C-X will highlight the area that you want (to feel for it to play with this feature can be a little bit, bu

How do I find the database file on an Android virtual device? -

My plan is to create a database on a virtual device and then add a database to my app's distribution. However, I could not find the database file. Is it on my hard disk? How do I get it? I tried to use ADB, I did "ls" and then was actually intimidated with this obscure list of directories: sqlite_stmt_journals cache sdcard etc. system System ssbin proc init.rc init.goldfish.rc init default.prop data Root dev Even when I / the data / data / CD on your package / The database is still not accessible to the actual database file. I can not use sqlite3 or drag on it. What is a way to change permissions? This works fine on my emulator, but the actual device fails on the ADB bridge / data / data / database / IDB db. In this /data/data/your.package.here/databases , Where represents your package associated with your application, as defined in your .package.here in your AndroidManifest.xml file.

c# - Programming against Access 2007? -

How do I program in C # against Access 2007? I do not see any VSTO template for this. I just need to define a schema, let the user fill in my data, and then read all my programs and return it to my program. Reading part is easy ... How do I create an MS Access database in the program, and how do I lock the user to know about closing the current database? Thank you, Roy You can create a reference for Microsoft ActiveX Data Objects and Some interop work will be required. UPDATE Obviously this post is a little late and does not include some specific details for Access 2007. Using the JAT provider will not work with the new ACDB file format. You must use the 2007 Office System Driver - Data Connectivity Components (You Can Download It. As mentioned in the comment below, you must change your connection string to use the following provider Will be: Microsoft.ACE.OLEDB.12.0 .

.net - How to get Emacs fill-paragraph to work on inline XML code doc in my C# modules? -

This question is similar, but for C # I have a comment like this: /// & lt; Summary & gt; /// In these colonies, and should themselves declare themselves by sending an unanimous state /// continuous state /// the declaration of nature and donation is legally 1. 1. 1. /// & lt; / Summary & gt; ////// & lt; Comment & gt; /// & lt; Paragraph & gt; /// If you receive a written explanation from the phrase "Project Gutenberg", then /// with whom you are redistributing /// Project Gutenberg gives you specific permission. /// & lt; / Paragraph & gt; /// & lt; / Comment & gt; and I would like the phrase paragraph to fill the just text , and place markup elements on their separate lines, such as < Code> /// & lt; Summary & gt; / / In these colonies, and to declare themselves first with unanimous consent, we should send a permanent state of nature and donation to 1.E.1. /// & lt; / Summary & gt; //////

git svn - Git svn rebase fails -

मैं एक एसवीएन रेपो ट्रैक करने के लिए git svn का उपयोग करता हूँ अपूर्ण डेटा: डेल्टा स्रोत अप्रत्याशित रूप से समाप्त हो गया यह एक बड़ा रेपो है, जिसमें एक लंबा इतिहास है। बस मूल एकल संशोधन को आकर्षित करना लगभग 9 0 मीन लिया, इसलिए मैं फिर से शक्ल नहीं करना चाहता। क्या यह पता लगाने के लिए कोई भी तरीका है कि कौन सी फ़ाइल त्रुटि के कारण हो रही है या इस समस्या का कोई समाधान? > यह SO प्रश्न के समान हो सकता है, जिसमें यह । यह इस समस्या पर पिछले वर्ष की अवधि में 2008 में चर्चा करता है। उस समय, उपयोगकर्ता ने कोशिश की: इस स्थिति को ठीक करने के लिए मैं एसवीएन से पूरी फाइल सामग्री लेता हूं अगले संशोधन यह डंप और धीमा है, लेकिन यह काम करता है। क्या आप Git (या msysGit) का उपयोग कर रहे हैं? यह एक ज्ञात मुद्दा है, और मुझे यकीन नहीं है कि यह निश्चित रूप से तय हो गया है। पहले, क्या आप अपने एसटीवीएन के जीआईटी आयात के दौरान कुछ सीआरएलएफ रूपांतरण कर रहे हैं?

vb.net - Using Access 2007 Queries From VB .NET -

build all the necessary questions I have been connected through the use of a database setup which I ODBC, Access files Already and I would be easy to call them from within my application. I am using Visual Basic .NET and this is what I have tried so far ..... Thanks in advance, any help you can offer. Ben dim command OdbcCommand = new OdbcCommand command.Connection = CNX command.CommandText = "sp_InsertClient" As command.CommandType = CommandType.StoredProcedure '// == ==== ABN paramenter make ============= dim param1 OdbcParameter = new OdbcParameter ( "inABN", as ABN) param1.Direction = ParameterDirection.Input param1.DbType = DbType.String 'ABN parameter command.Parameters.Add (param1) dim dataAdapter add OdbcDataAdapter = new OdbcDataAdapter (order) dataAdapter.InsertCommand = command cnx.Open (effort) dataAdapt er.InsertCommand.ExecuteNonQuery () capture MessageBox as former exception. Show (ex.Message, "Error", _ MessageBoxButton

c# - i want to capture all tags not having a specific tag -

I want to capture all the tags with the name 'strong', I & lt; STRONG *? & Lt; You can use / strong & gt; This is working just fine, but I do not want to capture these tags if the 'span' tag comes in these tags, then I'll see the & lt; STRONG Something like * (^ (SPAN)). *? & Lt; / Strong & gt; This is sample text & lt; STRONG & gt; For technical & lt; SPAN id = PageBreak & gt; 101 & lt; / SPAN & gt; Please & lt; / Strong> & Lt; SPAN ID = Pageback Type = "4" & gt; 56 & lt; / SPAN & gt; & Lt; Strong & gt; Visit & lt; / Strong> I want to capture the second strong tag and not the first Konrad is right. But if you do not care about the impending doom then you / gt; W +? & Lt; \ / STRONG & gt; / If they include any word that is tags > '& lt; Span & gt; , but there is no doubt that anything will fail from normal ... back to

tsql - SQL Server function to pass type as param -

Is it possible to type paragraph on the SQL function? Thanks in advance. The parameter type is defined in the function header, as a result it is always the same within the function. When you pass in a parameter that is different from the defined type parameter type, then the SQL Server defines the function best according to the parameter type. I have some functions that I just want to work like what you are, the way I work around this issue, define the function parameter as varchar (x) And then the parameter calls to any required CVONVERT () or function to call the function on the incoming parameter. as return COALESCE start ( '' '' + @ InputStr + '' '', 'null') end GO announced @DateValue Date set @ DATEVALUE = GETDATE () print '@DateValue =' + dbo.QuoteValue (@DateValue) print '@DateValue =' + dbo.QuoteValue (CONVERT (varchar , @ DATEVALUE, 121)) If you want to work with dates or numbers, then what you can do, f

ios - Is there a library or framework for setting preferences from within an iPhone application? -

Settings on the iPhone. Using the app is not difficult. Actually Xcode does most of the work for you Simply add settings to your project.Bundle and you do not have almost any price there. At the moment I am developing an application for the iPhone for which the user needs to fill several "forms". Add multiple key-values, several modal views with some sliders and "dropdown" menus. So the same thing is similar to the settings. Making forms by me is a huge task in my opinion, so I am thinking that there is a framework for such actions. Unfortunately, it seems that Apple does not provide its own solution, perhaps someone knows about a framework or an article on the web that best describes the best practices. If you are not able to understand which pattern I am mentioning, then I have created a screenshot: Check Out This is used in some apps and it is maintained actively (self and group of others).

linux - Installing a prebuilt binary on Android: "not found" -

I am trying to install a prebalt binary in a custom Android image. For this I have copied it to a new directory in the Android.mk file with prebuilt / android-arm / : LOCAL_PATH: = are $ (call my-dir) $ include (CLEAR_VARS) LOCAL_SRC_FILES: = binary_name LOCAL_MODULE: = binary_name LOCAL_MODULE_CLASS: = executables include $ (BUILD_PREBUILT) so if I run Make system_image binary_name , the binary file is copied to / bin / in the system image. And if I run the emulator, I can see the binary file in / system / bin . ( ELF 32-bit permissions, other executables ( -rwxr-XR-x ) and are the same as file , LSB executable by the one hand is binary, ARM, version 1 (SysV), dynamically connected (uses libs), stripped ) but when I run on the emulator, it says:. # binary_name binary_name: not found I've straced it and what I can see: # Strace binary_name execve ("/ system / bin / binary_name", ["binary_name"], [/ * 9 wars * /]) -1 - write ENOENT (s

c - Write simultaneousely to two streams -

Is there a way to connect two methods (or file descriptor) together so that writing a stream is also second? (C, linux) Thank you. User LaLato is correct, but Linux, the function you are searching for is fopencookie < / Code> is the result of correcting examples of Laalto for Linux: int my_writefn (Zero * cookie, const char * data, int n) {FILE ** files = ( FILE **) Cookie; Filitt (data, n, 1, file [0]); Return filitt (data, n, 1, file [1]); } Int nop (zero) {return 0; } Cookie_io_functions_t my_fns = {nil *), (zero *) my_writefn, (zero *) noop, (zero *) noop}; File * files [2] = ...; FILE * f = fopencookie ((Zero *) files, "w", my_fns); // ... use the F as you wish ... When you write to f , the system will enter your my_writefn Function To pass things that were passed on fwrite , to simplify things, you may also want to convert buffering to line file for your file stream: setvbuf (f, null, _IOLBF, 0); This is read from any stream connected t

ctypes - How to do cleanup reliably in python? -

I have some CTPP binding, and for each body.No, I should call the body. The rest of the remaining allocation routines I am bound to the library is not isolated from the rest code (they can be said about anywhere), and to use two useful features, I need to make cyclical reference. I think it will be solved if I find a reliable way of hooking the destructor for an object. (Weak RF) I want to give callback, before data has been deleted. So obviously this code megafil when I put it in velocity: body: body in body: def __init __ (self, mass, inertia) : Self. _body = body.New (mass, inertia) def __del __ (self): print '__del __% r'% Self Free (self ._a) ... def set_velocity_func (self, function): self _body.contents.velocity_func = ctypes_wrapping (func) I also tried to solve it through the weakreference, with those things, which still looks worse, only large scale But more is unpredictable. Even if I do not put in Velocity_func, then at least the circle will appear

design - Silverlight - Examples of awesome demo applications NEEDED! -

In the company I am working, the new project will start soon. I would like to use Silverlight 2.0, but I need to explain to the upcoming CEO and Photoshop / Effections to use Silverligt for the upcoming project. These people are - let's say - rather than flash / apple based, but for me Silverlight seems a fair solution as a .NET developer: -) I have a list of benefits from the developer's perspective but I can have commercial applications in these applications, but most Important features are: Fancy graphics - not a developer Comfortable and interesting UI, Functionality which is difficult to implement in Flash Thank you. I think people really like: is one of my favorites:

Resources to learn and understand state-of-the-art web development in Java? -

I am trying to learn web development in Java and, what I have seen so far, I think it is easy Endless numbers of libraries, frameworks, techniques are available. A lot of books focus on some specific components (Spring, Hibernate, JSP, ...) and only give examples of "Hello World". I am looking for books or web resources which give you a complete understanding of the picture and "real world" examples, in which many frameworks, techniques, are included in the same example. Can you recommend any book? Thank you! I like the old one) This clearly evolves the approach of applications using POJOs Explains and therefore Spring, Hibernate and many other popular frameworks

multithreading - Static initializers and thread synchronization (.NET) -

Static interpreters are executed once before the first reference of the class. This means that once every single class can be reached, an investigation should be performed that stable initial actions are performed for the class. It seems that multi-level environment with non-destructive static initialization can be a source of contention due to synchronization in classes when class is accessed through multiple threads. My question is, what is the best way to reduce the effect of such underlying lock on class definitions introduced by static analytic? The execution of a stationary constructor triggers the following event in an application domain: An example of a class is created. Any static members of the class are referenced In order to handle concurrent issues, the responsibility of the class loader should be the constant constraint.

sql - Passing datetime to a stored procedure & add a 1 sec to datetime -

Here are two things that I want to accomplish. The list I want to pass on my stored procedure in the following format ('2007-05-28 00:00:00') from time to time, but It does not seem that unless I want to increase from one second to @SEAL_DATE, {ts '2007-05-28 00:00: 00'} The next thing is So that it can be used to see the dates of entry and the dates between each other. / P> In advance thank you set to QUOTED_IDENTIFIER on ANSI_NULLS set as ALTER process [dbo] [getSealRecordDate] (@SEAL_DATE DATETIME) - "Transfer", "FGFSTRANSFERS", "FGFSTRANSFERS", "FGFSTRANSFERS", "DATE", "FGFSTransferDetails". "TRANSFER_ID", "FGFSTRANSFERS". "TRANSFER_ID", "FGFSTRANSFERS". "Total", "FGFSTransferDetails." "Total", "FGFSCUSTOMERS". "CMF_NAME_1", "FGFSCUSTOMERS". "CMF_NAME_2" from ( "FGFSInvestm

xml - StAX parsing from Java NIO channel -

I am trying to get a stream of XML events on a Java NIO channel. I am new to both NIO and steak parsing, so I can see something with little ease :) My search has inspired me to implement several Sachs and stocks, but all these inputstream And work on input sources - -Non channel Two close attempts made by me have been made to get the inststream from the channel and to create a piped intestream: // method 1 P IpedOutputStream out = new PipedOutputStream (); InputStream = new (outside) in PipedInputStream; Printer author = new printer (out); // Method 2 InputStream = channel.socket (). GetInputStream () // Method 3 IputStream = In the Channel New inputstream (channel); After that: XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance () .createXMLStreamReader (in); // ... When the code above is used with 1 method, the XMLMLStreamReader blocks it to create when the method 2/3 is used, So they immediately throw illegal blocking exceptions (I understand why). Maybe

xml serialization - Serialize nullable fields from an object c# -

I am trying to serialize an object which is empty field, if there is no data in the field The field has been removed from the serialized output. Does anybody suggest working on this? Is there a way to decide that empty fields have been emptied? This is when "propertyname_specified = false" apply XmlElementAttribute to you To do: [XmlElement (IsNullable = true)] Public string DummyField {get; Set; }

.net - Converting GUID to String -

यह काम क्यों नहीं करता? संदेशबॉक्स ("F6D8C47B-46E6-4E93-A393-00085ACA2242 ") .स्टाइल। (" - "," ") आप पर toString को बुला रहे हैं MsgBox, नहीं Guid, जो जाहिरा तौर पर पहले से ही एक स्ट्रिंग है। प्रयास करें ("F6D8C47B-46E6-4E93-A393-00085ACA2242")। बदलें ("-", ""))

MySQL DB quad-directional synchronization without master server? -

I need to install 4 MySQL servers. I have to support each of them reading and writing, so a master server (Which only accepts write) is out of question I need data between these 4 synchronized servers. It does not matter to me whether they have an independent connection or if they are connected from time to time, I looked on the MySQL replication page but I did not find it useful to require it. What is the best way to do this? This is called multi master replication, there are tools like mmm to help complete it. Although warnings can be made, it can be a very long manual process to recover from replication failures, because you will end up with the situation, where you are unsure that the data copy is more than the date .

devexpress - Install D5 (& third party comps) on a machine with Delphi 2007? -

I've got a Delphi 2007 VM that includes a proper up-to-date report builder and dev Express Suite. Use for a particular project for a particular client. For the same client, I also have a D5 VM that is to use a different (old, older) version of the Report Builder and some of the different (Dev Expressre) components Version) This will test and normal maintenance for my client, if I can install D5 (and versions of components used by it) on D 2007 VM, and there is a 'uber VM' in which Everything that involves the client's nature That's why I have to keep 'different' different versions of components. Hope that you have not left all to sleep with bored - just thought that if any tips or tips I want before I try to do this I thought that the D2007 machine But it would be easy to insert D5 (to avoid the process of re-registration of existing VM drives etc. plus plus one D 2007 installation), but if D-2007 is easier to add D5 then I can do this Think that w

textbox - Vertical Text in Reporting Services (Bottom-Up) -

I would like to display vertical down-up of my text in the text box in the reporting services. I already have the WritingMode property of the text box Going and going to 'TB-RL' can top-down but there is no alternative to the bottom-up. I did some research and really avoid making an image and put it in the text box ... Any thoughts?! Thanks! I am trying to do the same with vertical text bottom-up. Unfortunately 'TB-LR' has not been accepted as a valid value. I know that you said that you did not want to create an image, but this is the only solution. I am using the following to get the desired result.

What are canonical URLs and how do they affect your SEO? -

I've heard people mention the canonical URL tag, but I do not know what it means or what its purpose is < / P> What is it and how does SEO affect? Canonical URLs are used when you have other different URLs that actually redirected Without pointing out the same content. So assume that your domain is example.com ; www.example.com and example.com are two different URLs, and if you want them to have a standard (canonical) URL (for example, Example.com < / Code>), search engines use two URLs completely with different pages. Due to this, link popularity of two URLs is divided, which is clearly very bad for SEO.

xml - XSD date format overriding -

I'm defining an XSD I need to define that element which takes the date in the format yyyymmdd i How can I define any restriction in XSD to accept this format only? You always restrict it to a common type of string, based on a regular expression: & lt; X: simple type name = "formatted type" & gt; & Lt; Xs: restriction base = "xs: string" & gt; & Lt; Xs: pattern value = "\ d {8}" /> & Lt; / XS: Ban & gt; & Lt; / XS: simpleType & gt; If you really want to get smart, you can zoom in to regular expression even more for a date (for example, the environment is only 01 - 12 May be further): & lt; X: simple type name = "formatted type" & gt; & Lt; Xs: restriction base = "xs: string" & gt; & Lt; Xs: pattern value = "\ d {4} (0 [1-9] | 1 [012]) (0 [1-9] | [12] [0-9] | 3 [01])" /> ; & Lt; / XS: Ban & gt; & Lt; / XS: simpleType & gt; Mark

c# console application - prevent default exception dialog -

I have a simple application with a single application that is launched from time to time on a server. Sometimes inexplicable exceptions occur in the application and default stop / retry / ignore dialogue pops up. I need to stop the ADIL from appearing in some way and just have to output the exception to the stranger and close the application. So I tried - with the catch statement closed all the codes in the main method, but it does not help at all - the exception dialog is sometimes displayed. The main () code looks like this: Try {RunApplication (); } Hold (exception exc) {Console.Error.WriteLine (exc.ToString ()); Console.Error.WriteLine (exc.StackTrace); If (exc.InnerException! = Null) {Console.Error.WriteLine (exc.InnerException.ToString ()); Console.Error.WriteLine (exc.InnerException.StackTrace); } environment. EXT (666); } This try-catching section should not catch all unrestricted exceptions and popup AFAIK at any time. Am I forgetting something? Or is there any set

c++ - Select() system call in threads? -

I am reading data from multiple serial ports. Currently, I set up a custom signal handler (by setting the handler on file descriptor information ) And using the thread to wade the thread. I was searching for a way to separate threads with unique signal handlers, in this regard I came to know that to use the system call. Now I have the following questions: If I am using a thread (QT) then where should I place the selected system call to monitor the serial port? Is the selected system call thread safe? Is this CPU intensive because there are many things in my app with GUI updates? Please mind, if you find these questions ridiculous, I have never used such a mechanism for serial communication. select this definition definition I personally poll I recommend - it has a better interface and the system can handle the descriptor in any number instead of the defining range. If I understand correctly, then based on the status of some of the distributors you have based

performance - Rails: How do I minimize DB hits here? Eager loading isn't applicable -

This question is probably a bit specific, but I think it's also interesting than normal POV. Rail applications can subscribe to other users in the app. When I show a list of users, I have to check if the current user is subscribed to users in the list. If she is subscribed, then I show buttons and other ways to unsubscribe. Because the whole thing relies on the current user, I can not use curious loading. So when I show 20 users in the list, I generate 20 additional hits on DB, which seems to be bad for me. I am thinking of a good way to solve this problem. The best solution I have so far so far is to load the ID of users subscribing to session sessions in the session during log-ins and then check every user against the ID in the session. But it may be possible to take other issues when the user has subscribed to many people. Apart from this, I'm not sure that this is the best way to load all subscriptions, even if the user never sees the user list during this session

memory - Checking the amount of available RAM within a running program -

One of my friends was asked to write a program during a job interview, which measures the amount of available RAM is. The expected response was using malloc () in a binary-search manner: until the failure message is received, the size of the part is reduced, and the amount of memory allocated in a nutshell is large and large Allocation to the part. I believe that this method will not measure the quantity of virtual, physical, memory, but I find curiosity about this matter. What is the use of RAM from within the program, asking to do without exec (dmesg | grep -i memory) ? You are right: malloc () does not make any difference between physical or virtual memory In fact, This is the complete point of virtual memory: to make irrelevant to such details programs. You can find out but it is OS-specific, for example.

wpf - Does Caliburn provide a way to get a reference to the container from anywhere? -

I am currently roaming with Rob Eisenberg's Caliber framework. An example of how the caliber service should be resolved from the container, but given the available documentation. This is something on the lines of this: SimpleContainer Container = New Simple Container (); CaliburnFramework .ConfigureCore (Container) with .commonDialogs () .with Display Framework () Start (); Var service = container.gate instance (type (IService)) as a service; However, whatever I remember, there is a way to get the container reference anywhere in the app. By this way: var service = caliber. Container.Get Instance (typewise (ISWARE)) service; Do I have to build a custom static class that holds in the context of the container or is it already built in the caliber? Thank you and thank you in advance! itemprop = "text"> Caliburn's latest trunk version automatically registers the container on the framework startup as a service locator. You just have to refer to th

flash cs4 - How do I get the user's screen resolution in ActionScript 3? -

Can the action script 3 determine the user's screen resolution? stage.fullScreenHyight and stage.fullScreenWidth Take a look at

Inviting Friends and Sharing a report between them through Facebook api using php -

I have created a Facebook application that retrieves user friend list. Now, I want to give an option to invite friends through my application and I want to give an option to share the reports between the invited friends through PPP through the Facebook API. How do I get it? help please. Send invitations and both tags use the request. Friends are selected through the best. There are detailed options on this page. Note that these are all FBML solutions, there is no way to create invitations or requests through Facebook API without user interaction. "The solution to the poor man", though in my experience it has a very rude solution.

usb drive - How Do I Eject a Volume in Java? -

How can I remove a volume with Java, cross platforms? I have a program on a removable drive (USB memory card reader), and once this is done, I want to remove / unmount / remove memory card from the program (depending on whether Which OS are talking in the language). Is there a reliable cross-platform method to do this? Perhaps no answer is you ' not To my knowledge, there is not a single established platform to do this. For that matter, I've never come to do this in a Java way. A allows to expel, but only on Windows. , Java USB Library Tools do not even point out on exit. They do not work in all platforms, so even if they do this, then it will not help you. My suggestion: Give some scripts or executives to each step, and then press again a process as needed.

Java exec on Unix -

I have a Java code that is running on Unix (both AIX and Linux), but it does not work. If I run this code the file q1.01 is not compressed, and no exception has been thrown to me (file q1.01 is present, and I hope that after running the order q1.01.z file). Command Prompt If I type "which is abbreviated" it reports back with "/ usr / bin / compress" if I type "/ usr / bin / compress q1.01" command at the UNIX prompt, then it works fine Does anyone have any thoughts on what may be wrong? string cmd = "/ usr / bin / compress q1.01"; Runtime.getRuntime () Executive (cmd). [edit later: the problem was in the initial statement; OP was passing wildcard and not q.01. So apart from the part in bold my answer is wrong. I am saying that I am leaving it after comment.] It is a program name without any argument Trying to run / usr / bin / compress . The Runtime.exec () method has many variations. You are using the version, which just take

.net - How to create a rounded rectangle at runtime in Windows Forms with VB.NET/C#? -

I create a rounded round rectangle over the wound and make it a picturebox (already created and hidden) windows In the form. Do you have any idea how can I apply it? This method fills a rounded rectangle on a graphic object (VB code): Pre> public subfill references (byVal g as illustration, in the form of graphics, as in the form of rectangles, as byval as integer, byVal b as brush) dim mode like Drawing2D .SmoothingMode = g.SmoothingMode g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed ​​g.FillPie (B, Rx, RI, D, D, 180, 90) g. Philippi (B, Rx + R., Withth-D, RI, D, D, 270, 90) Philippi (B, Rx, RI + R.Hight-D, D, D, 90, 90) Philippi (B, Rx + R.Width - d, ry + r.Height - d, d, d, 0, 90) g.FillRectangle (b, cInt (rx + d / 2), ry, r.Width - d , CInt (d / 2)). Filtratengel (B, Rx, CINT (RI + D / 2), R. Withth, CINT (R.Hight-D)). Filtratengel (B, CINT (Rx + D / 2), CINT (RI + R.Hy-D / 2), CINT (R-Width-D) CINT (D / 2) G. SMTuringMode = Mode and All To cal

api - Why does the Java List interface not support getLast()? -

I am trying to understand the API incompatibility in the Java standard storage library. To get the last item in the list or in the AbstraList list, although one can simulate with size and getIndex (). However, the Linkedist supports that function. Any idea why it was decided not to support this method in the interface? java.util.list interface getLast () because designers have 'minimal interface' This is in contrast to a 'human interface' (such as used) that attempts to provide ways to do general Operations (e.g. getLast () ). As there are many uses, such a basic concept can be kept as a list, there can be more interfaces than this. See Martin Fowler and details for more information. The class provides equally designated methods to obtain, remove, and insert an element. These operations should be linked to the linked lists used in the form of stacks, qi, or double-end queue (decks) at the beginning and end of the list. Allows It was p

serialization - What needs to be Serializable in this Java situation? -

I have a class Thing: public abstract class Thing {// stop package Immediately out. Actually, there will be no such thing. Actually Thing Thing () {} will be a runtime class; Creating Public Static Items () (New Explanation 1); } Making Public Static Cheese Special () {New Special Ting (2); }} Final Class Special Tying 1 Things Expands the final category special tieing 2 {/ * etc etc} / Actually I want to Commodities are eligible for serialized to the customer, and to know that the serials are eligible for the client, which category (SAS) is to implement serial jabal? And which serial virionuid is needed? You need to mark Thing as the serialabel and it Will be received by special type 1 and specialty2 . You do not have not to add serial version UID to any category but you are recommended that you do it; In this way you can control the version of classes between the client and the server code - see the related question.

How can I check for the existence of an XML node in Flex/AS3? -

For each recurrence, false detects trace in the loop given below, even if there Nodes are named with 6 out of 8 possible values ​​??? It only happens when my name is in place. Is there any other way to check node values? & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Mx: application xmlns: mx = "http://www.adobe.com/2006/mxml" layout = "full" & gt; & Lt; Mx: script & gt; & Lt ;! [CDATA [Private namespace ltrs = "letters"; Use namespace liter; Private variable myArray: array = ["A", "B", "C", "D", "E", "F", "G", "H"]; Private Function CheckXML (): Zero {for each (var p: string in miere) {trace (myXML.hasOwnProperty (p) .toString ()); // false return; }}]] & Gt; & Lt; / Mx: script & gt; & Lt; Mx: XML id = "myXML" & gt; & Lt; Root xmlns = "letters" & gt; & Lt;

c# - Type to use to set Attributes in an ASP.NET Control? -

I'm trying to add an attribute in a web page control. text box txt = new text box (); Txt.Attributes ["Foo"] = "Bar" I have to put it in a method, but my problem is that I do not know what type of element I will send - maybe An input can be select one, in short I need this method below, but what is oControl ? In VB, I used to call it only one object . Protected Zero SetAttrib (oControl) {oControl.Attributes ["Foo"] = "Bar"} Thanks I think you want: Protected Zero SetAttrib (WebControl oControl) {oControl.Attributes ["Foo"] = "bar"}

Can a Ruby method yield as an iterator or return an array depending on context? -

In Ruby I have an arbitrary method that generates many values, so that it can be handed over to any block: < / P> DEF arbitrary yield 1 yield 2 yield 3 yield 4 end arbitrary {| X | Say x} I would like to modify this method so that if there is no block, it only gives value as an array. This build will also work: myarray = arbitrary p a -----> [1, 2, 3, 4, 5] Is this possible in Ruby? There is a syntax for this: def arbitrary (& amp; ; Block) value = [1, 2, 3, 4] If the block value | Yield vs end and val and end Note: can be replaced with yield v : < / P> block.call v

c# - Excel interop: _Worksheet or Worksheet? -

I am currently writing about dynamic typing, and I give an example of Excel Interp. I have already reduced any office interop, and it shows the use of the _Worksheet interface for C # 4, but it also has a worksheet interface. I do not know what the difference is. My unmanned simple demo app (shown below) works fine either - but if the best practice points to one or the other, then I will use it properly. / P> using the system; Using System.Linq; Using Excel = Microsoft.Office.Interop.Excel; Class DynamicExcel {static zero main () {var app = new Excel.app {visible = true}; App.Workbooks.Add (); // can use Excel._worksheet instead. Which is good Excel Worksheet Work Sheet = App. ActiveSite; Start Excel.Range = Worksheet Cell [1, 1]; Excel.Range end = workSheet.Cells [1, 20]; WorkSheet.get_Range (start, end) .Value2 = Noteworthy. Category (1, 20) .oir (); }} I'm trying to avoid full depth dip in com or office interoperability, just highlighting the new features of C

Distance from Point To Line great circle function not working right. -

I need to get distance from distance / LNG point. I undoubtedly need to follow the great circle. I found a great article on this but the code is not working right. Either I am doing something wrong or missing something. This is the function in question. If necessary, look for the link for other functions. var R = 3961.3 LatLon.crossTrack = function (lat1, lon1, lat2, lon2, lat3, lon3) {var d13 = LatLon.distHaversine Lat1, lon1, lat3, lon3); Var brng12 = lotalon. Bearing (lat1, lon1, lat2, lon2); Var brng13 = lotalon. Effect (lat1, lon1, lat3, lon3); Var dXt = Math.Sin (Math (D13 / R) * Math (Bronze13-Brande 12)) * R; Return DXT; } lat / lon1 = -94.127592, 41.81762 latitude / lon2 = -94.087257, 41.848202 lat / lon3 = -94.046875, 41.791057 It reports 0.865 miles, the actual distance is 4.2 9 0.9 miles How does any clue determine this? I'm not a mathematician, it's just long in the tooth programmer. Most triangular tasks require radians. What degree are

math - How to take any number and get a number between 1-3 -

I have three colors in an array, array ('blue', 'red', 'green') , and in my loop, I want to be able to print blue, red, green, blue, red, green color. I know that I can reset only one counter of every 3 loops, and I can use it to use the color I want - 1, 2, 3, reset, 1, 2, 3, reset etc. Is there an easy way to get current loop count, like 5 or 7, and 2? Or near 6 or 9 and get 3? Am I getting some simple math solutions about this? What you are looking for is the modulo operator '%'; arrayIndex = LoopCount% 3; Basically it means that the number divides by 3 and gives me the remainder ... so this is equal to 0 1 2 0 1 2 0 1 2, etc ... < / P> Edit: If you are using a language that creates an array index on 1, you can do this: arrayIndex = LoopCount% 3 + 1;

iphone - Loading a view controller from viewDidLoad -

Hello, I want to create a tabbar application in the iPhone using X-code. I have a splash screen and after that I have my home screen where I want to create a tabbar in that scene. So, I create a tabbar in my ViewDidLoad method. - (zero) viewDidoad {in NSLog (@ "Home"); TabBarController = [[UITabBarController alloc] init]; HomeViewController = [[HomeViewController alloc] init]; NextViewController = [[NextViewController alloc] init]; TabBarController.viewControllers = [NSArray arrayWithObjects: homeViewController, Next ViewController, Zero]; Window = [[UIWindow alloc] initWithFrame: [UIScreen main screen]. Bounce]; [Add windowSubviewview: Tabbar controller. picture]; [Window-making and knowledgeable]; [Super viewedload]; } Now when I compile & amp; Run, this home will call Viv again & amp; Again and when I tap on another tab it will not call NextView. Do not you add home viu controllers repeatedly because the scene is in the visual veui controller ..

multithreading - Thread specific memory with language features -

Is there any such language that supports process common memory in place of one address, a mechanism like function call ? process int x; Thread int y; attribute in C #

c# - Asp.Net resource manager always returns neutral culture resources -

I am using embedded .resx to localize the asp.net application It seems that what is the current culture, neutral culture resources always return. I am using the value to retrieve the value, as follows: protected string GetResource (name of string) {localization. Rerscore Resourcenaser.Great String (name, system. Threading thread.contentrade.CondentCulture); } I specified in a page that culture is "es-PE" (Peru). When I break into the GetResource function, I can verify that the current culture is "es-PE" and the resource manager has a resource resource related to this culture. However, returning strings are always from a neutral culture set. The files I am embedding are named as follows: ResCore.resx ResCore.es.resx < / Li> ResCore.es-PE.resx Any help is appreciated. why are not you using or

syntax - simple php problem -

ठीक है, तो यहां स्निपेट है: // याद रखना मेरी $ cookie_name = 'db_auth '; $ Cookie_time = (3600 * 24 * 30); // 30 दिन // जांचें कि क्या उपयोगकर्ता चेक बॉक्स को चेक करता है अगर ($ याद है == 1) {setcookie ($ cookie_name, 'username ='। $ Username।, समय () + $ cookie_time); } किसी कारण से यह टूट जाता है और मैं क्यों नहीं देख सकता यह एक बड़ा फ़ंक्शन का हिस्सा है जो जब मैं इस स्निपेट को बाहर करता हूं तो ठीक काम करता है। किसी भी विचार? आपकी दूसरी पंक्ति में "$ username" के बाद एक अतिरिक्त डॉट है।

sql server - ASP.NET MVC newbie: can't get aspnet_regsql.exe to work -

I just followed Web Developer Express 2008 and MVC Framework (all omission, was installed in the SQL Server Express process) . I followed the initial steps, defined by IDE databases and defined tables (worked fine). To further define my table, which relies heavily on user base, I had to figure out how to add the user table to my newly created database (That's why I used tables with foreign keys I can create the user table), so I "jumped" into the authentication and authorization section in the manual, where they need to run "aspnet_regsql.exe" from "C: \ windows \ Microsoft.NET \ Framework \ v2.0.50727" Kata is mentioned. . I found the file and ran it. It asks for a server name and some default (this is the beginning of my computer name). I do not remember clearly mentioning any name during the establishment of Visual Web Developer, I think this is a default one. "Windows authentication" has been selected. I can also choose "SQL

java - efficient algorithm to compare similarity between sets of numbers? -

I have a large number of numbers, each set has 10 numbers and I need to delete all those set whose Near 5 or more numbers (unroded) matches are from any other set. For example: set 1: {12,14,222,998,1,89,43,22,7654,23} set 2: {44,23,64 , 76,987,3,2345,443,431,88} set 3: {998,22,7654,345,112,32, 89,9842,31,23} above the set number of 10 Looking at the 3 set and Set 3 will be considered a duplicate because they have 5 mail numbers, in this case I will delete set 3 (because it is considered equal to 1 set). I have more than 10000 sets to compare and I want to do it very efficiently. I'm ending it and I can not think of it in an efficient manner (it would be good to do this at a single pass). Any ideas? Thanks! Mike You should reconsider your requirements because it is in operation Also, do not have a well-defined result, for example, set this: set 1: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } Set 2: {6, 7, 8, 9, 10, 11, 12, 13, 14, 15} Set 3: {11, 12, 13, 14, 15, 16, 1

project steps in web application design/programming -

I am starting to work on web applications and I have been with almost the functional specification: < P> Where do I go now? Can I start working on building HTML and CSS? Can I start building backend body of code? (Server-side email verification and installation of database data-entry functions) Can I start working on client-side scripting? (Javascript / jquery) Can I start working on database structure? Is these things the best practice order? Thank you! Okay, you have created a great idea, now this "description" is used to call the functional user interface Time to expand into a mockup. Why? One device says that an app is "what to do". It can be very detailed about it, but the full user interface says that what exactly is an app "actually does" After all, users really care about who is actually under the hood? In our experience, we find that the user interface design and refine (for example, valid HTML) before the f

c# - Best way to build member pages with EF and ASP.NET controls? -

I am trying to build that website in which there is a member section, and to find a faster and efficient way I'm struggling to create an end user page, which will drag user's data. For example, the user's "My Account" page They should be able to view and edit just data. Will you use the Entity Framework Entity Data Source Control? And tie it in a formivouv, description, or list view? How do you allow automatic updates, and can always filter views for a user's record? It seems that many data controls are ready to deal with many records. Or am I missing something? There are lofty options that help you build such scenes. I like MVC these days because the designer generates as many times as you need to see. There is also a way to modify templates because they are T4 templates. There is also that can dynamically generate HTML from the EF model. I played it with little and you were very impressed with the exit from the box.

django - How to give initial value in modelform -

How do I provide the initial value for the field in ModelForm? Example: class form 1 (forms.Form): title = forms.CharField (initial = "hello") what would be equivalent to this ModelForm The basic syntax is something like this: class Form2 (djangoforms.ModelForm): class meta: model = some model regions = ('title',) What I am trying to do is generate a CRUD. Since I am doing this in an Appenin project, I can not use general ideas. Appengine has provided us the djangoforms.ModelForm which works like the ModelForm of the DEGENGO, but uses APINgin's Datastore. I need the above functionality "Edit" part. Normally, you can pass the model object that you want to use for the example keyword ARGU Editing in form: Form2 (example = somemodelobject) , but I do not know if it works on GAE, you can always send the constructor of your form to the initial dictionary, like form 2 (initial = {"title": "blahblah"})

Put Some Folder as PATH in Windows CE -

In Windows CE, how to put a folder in the form of a path, especially one HPC 2000 (Germana 720) ), Put in a path like Windows XP or 2000 or Vista, that you javac or ruby ​​ and program runs in CMD . Remember that if I have to use Registry Editor then I have installed one. Thanks! Windows CE does not support environmental variables, nor is it an idea of ​​the work folder. Everything should be done with a fully qualified path.

python - how to tell a variable is iterable but not a string -

I have a function that takes an argument that can be either an item or a double item: DEF iterative (RGR) if #arg is a walkable: print "yes" and: print "no" is such that: Yes >>> Iterated (["F", "F"]) Yes >>> Not repeat ("FF") The problem is that the string is technically permeable, so when I'm trying to arg [1] Not just ValueError could not hold I do not want to use isinstance (), because it has told me is not good practice (either). Use utility (I do not think why it is bad behavior) is not an import type if it is not (arg, types.StringTypes): Note that the use of string type ensures that we have some ambiguous type of string Do not forget about On the top, this derived string also works for sections. Pre-< MyString (str): Passed Evernance (Mysterrine (""), Type. String Type) # True In addition, Want to keep an eye on Cheers. NB: Behavior has not been changed

asp.net mvc - Having troubles calling a Controller Post Method -

यह मेरी विधि है [स्वीकार वीरब्स (एचटीपीवीर्ब्स.पोस्ट)] सार्वजनिक शून्य सेवइमेज (फॉर्मकॉलेक्शन FormValues) {बाइट [] सामग्री = कन्वर्ट.फॉंबबेस 64 स्ट्रिंग (अनुरोध। फ़ार्म ["फ़ाइल"]); System.IO.File.WriteAllBytes (Server.MapPath (Request.Form ["name"]), सामग्री); } इस क्रिया स्क्रिप्ट विधि से पोस्ट हो रही है: सार्वजनिक फ़ंक्शन एन्कोड औरस्वेव (e: MouseEvent = null): शून्य {var date: date = नई तारीख़(); Var द्वारा: बाइटअरे = PNGEnc.encode (canvas.main_bdata); Var req: URLRequest = नया URLRequest (server_path + "होम / सेवइमेज"); Var पैराम्स: URLVariables = नया URLVariables (); Params.file = Base64.encodeByteArray (द्वारा); Params.name = "MyImage.png"; Req.method = URLRequestMethod.POST; Req.data = params; Var ldr: URLLoader = नया URL लोडर (अनुरोध); Ldr.addEventListener (इवेंट। कॉमप्ले, पूरा); ldr.load (अनुरोध); कार्य पूर्ण (ई: ईवेंट): शून्य {navigateToURL (नया URLRequest ("?" + Math.random ()), "_self"); }} लेकिन जब

PHP Session with an Incomplete Object -

I am getting an error I do not know how to do it right, so I wonder if I can get some help . This error is Fatal error: process_form () [& lt; A href = 'function.process-form' & gt; Function.process-form & lt; / A & gt;]: The script tried to execute a method or use the property of an incomplete object. Please make sure that the class definition & amp; Quot; Template & quot; The object you are trying to work on was loaded _before_ unserialize () to light 44 / <> I get this error in the process_form () function. So what do I get from this point of thinking, I did not load the class for the template. Include what I actually did on the top 'inc / item.class.php'; Do I have to re-add it to the function? There is a code for a special page with error, you can see that I have everything like it should be. Where did I go wrong? & lt ;? Includes Php 'inc / prep.php'; Include 'inc / header.class.php'; Include 'in

iphone - Can I increase the animation speed of presentModalViewController? -

I am writing a drawing application that shows toolview controller when clicking an item in the toolbar. However, many of my beta testers have reported that the tool palate opens slowly and I am using standard current model view controller: animated: call to display the tools, and I want to wrap it in the code block Have tried: [UIView startAnimations: zero reference: zero]; [UIView Set Animation Duration: 0.1]; [Self current model view controller: animated settings: yes]; [UIView commitAnimations]; Unfortunately, that does not work if you say animated: No, it works better, but the underlying drawing canvas scene is removed immediately (because the controller thinks that this Is not visible anymore), and therefore the animation happens on a white background. Before it will be ready to give some advice? I appreciate it! A similar question is asked. You can also change the speed using this technique, but in my experiment, it is more than an empty background, as you've

php - Ajax/Flash file uploads with a progress bar? -

I'm looking for a simple solution that: Easy to integrate < / Li> Allow multiple file uploads Show file while uploading a file Any ideas? I've tried swfupload and it's a real pain to integrate it. No competition. Required. Easy to setup, small to very powerful Very good.

Need citation for Extension Interface pattern in Java -

One of the following Java interface design of an object without changing the client allows to expand. Additional detail can be applied to the object interface. The client can ask for objects to the interface is that it does apply. I read about it in a blog post, but my Google skills again failed to find blog posts. I am not advocating the design of the qualifications. I just want to find a blog post. For example, a domain model for transport vehicles to imagine. The implementation of this interface is that each vehicle body: public interface Extendable {/ ** * Object asks if this extension is to provide the ultimate extension intephesa * * * @ requested extensions to apply * @ return the object to the requested extension, or if not available, then {@code null}. * / & Lt; T & gt; T query extensions (Class & lt; T & gt; extension interface); } Fixed-wing aircraft flight control surface, but not other types of vehicle. For the convenience of the control surfaces

c# - SQLite Parameter Issue with Guids -

While I'm having problems matching the guides while using parameters, when I type something like userguide = 'Grid Here'. This works, but Userguide = @GuideHair is not like that. Anyone have any ideas? (user guded text not primary key, first name text, last name text) Sample data: Log in user (user guad, first name, last name) value ('e7bf9773-8231-44af-8d53-e624f0433 943', 'Bobby', 'bomstone') Delete statement (working): Delete from user where userguude = 'e7bf9773-8231-44af-8d53-e624f0433 943' Delete statement (work Is not doing): Remove from user where userguid = @ userguide Here is a C # program that is showing my problem: using the system; Using System.Data.SQLite; Namespace SQLite_Sample_App {class program} {static zero main (string [] args) {doo}; Console.Read (); } Static zero () (SQLiteConnection MyConnection = New SQLiteConnection ("Data Source =: Memory:; Version = 3; New = True")) {My