Friday 15 July 2011

c# - xVal and jQuery Submit Button -


I have a simple form, it has a field and a submit button. I hide the submit button. The submit button is actually triggered with an anchor tag which calls a JavaScript method that uses jQuery to get the element and executes a click () it works fine Does, form posts and records have been successfully written in DB

So now I am trying to add xVal for verification to the simple client side verification.

It does not work when I click on the anchor tag. However, if I un-hide the submit button and try to post the form with it, instead of using the anchor tag, which is called the JS method, it works. So basically I'm trying to figure out why this does not work when using the JS method to click on the submit button.

Any great ideas? thanks a lot!

This is some code ...

  & lt; Div id = "manufacturerButtons" class = "moduleRow" & gt; & Lt;% = Html.ActionImage (Url.Content ("~ / content / Icons / bullet_go_back.png"), "Back to Admin", "Admin", "Admin")%> | & Lt; A class = "action image" href = "javascript: addManufacturer ();" & Gt; & Lt; Img border = "0" src = "& lt;% = Url.Content (" ~ / content / icons / accept.png ")%>" & Gt; & Amp; Nbsp; & Lt; Span & gt; Add productive & lt; / Time & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Div class = "moduleContent" & gt; & Lt; Div id = "manufacturer firm" & gt; & Lt; Div class = "moduleRow" & gt; & Lt; H3 & gt; New Creator & lt; / H3 & gt; & Lt; / Div & gt; & Lt; Div class = "moduleRow" & gt; & Lt;% Html.BeginForm ("new creator", "administrator", FormMethod.Post); & Gt%; & Lt; Table class = "Nobber" range = "0" cellpadding = "0" cell area = "0" & ​​gt; & Lt; TR & gt; & Lt; Td style = "width: 125px" & gt; & Lt; H6 & gt; Name: & lt; / H6 & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt;% = Html.TextBox ("name")%> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; Tr style = "display: none;" & Gt; & Lt; TD & gt; & Amp; Nbsp; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Input type = "submit" id = "btnAdd" name = "btnAdd" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt;% Html.EndForm (); & Gt%; & Lt;% = Html.ClientSideValidation & lt; Tool manufacturer & gt; ()%> & Lt; / Div & gt; & Lt; / Div & gt;  

Javascript:

  function addManufacturer () {// $ ('form'). Submit (); // does not work either while attempting to validate $ ('# BTNAD'). Click (); Back true; }  

What do you need to do to verify jQuery on your form? Try:

  $ ('form'). Valid ();  

To submit a form to successful validation, try:

  $ ('form'). Validate ({submitHandler: function (form submit);}}};  

Note that 'form' should be a valid jQuery selector for your form ...


Retrieving SQL Server Extended Properties From C# -


We detail the details of our SQL Server database by creating table and column levels, we expand detailed properties, we usually enter them via SSMS .

My question is this. I am creating a C # application, where I want to read the expanded properties of a specific table and its related column

Can anyone show me how I can go about doing this?

Thanks - Randy

Read this: And see if there is anything that you In your situation, you can do it.


Using SVNBridge with TFS (not CodePlex) -


I am trying to use my TFS server using SVN Bridge so that I can disconnect. I tried to use a server-based and client-based solution. I'm just returning the internal server 500 errors. I'm not sure I'm connecting properly on the site.

The other posts I have read about SVN Bridge are specially about codepacks and connect it through a CodePlex specific URL.

I am trying to connect to my own TFS server and wondering how to properly formulate the URL. Do I need to do something special for this? I feel like I have tried everything, is there any success in doing any such work?

Therefore the problem is partly related to TFS 2010 beta 2. This issue is being tracked here:

Thank you.

Not sure that you are still looking for an answer, but I just better my weekend This is happening to work, mostly with trial and error, so here's what I learned.

You can download no zip files and if you are using TFS-2010 then do anything. Instead, you download the Essential source code and compile this thing for yourself

You must do this on a computer that installs the IIS to use the website's project.

If you do not have VS-2008 installed, you can upgrade the entire solution of VS-2010 and everything will be OK. I also changed the goal of website project to 4.0 framework with the least issues. I had to unload the testrequirefitties client project and tools.Hipsepend project to achieve the remaining projects for the construction of projects.

After you have created this project, you need to follow those two steps which are given on the order of obtaining bits in the right place on the web server once it is complete You web The config file needs to be tuned.

Here are the app settings you need to change and the values ​​you want to use:

  & lt; Add key = "logpath" value = "- directory-URI tokie plug in in" /> & Lt; Add Key = "DomainIncludesProjectName" value = "False" /> & Lt; Add key = "TfsUrl" value = "http: // - tfsServerName--: 8080 / tfs / - Project Selection -" /> & Lt; Add Key = "ReadAllUserDomain" value = "- yourDomain--" /> & Lt; Add key = "ReadAllUserName" value = "- domainUserName--" /> & Lt; Add key = "ReadAllUserPassword" value = "- domainUserNamePassword--" />  

If you have decided to upgrade website to 4.0 frame, do not forget that you need to update the application pool because it was probably made as 2.0.

You've almost done that the website has been established. You still need to install some functionality counter from SvnBridge. PerfCounter.Installer After complexity of the project, just copy those bits to the same server on which you have installed the website and have run the exe.

This does not work

OK is the last but not least security. I am not using digest protection because all of my Users have Windows login, so I used anonymous access and then disabled all other types of access except for Windows authentication.

Windows authentication did not work for all users, after seeing some remote source code, it became clear that basic authentication was the only option that was going to work. I needed the users to log in as their form and then that user name was passed in TFS so that it can be done as check-in, to be recorded to the right user.

RP


javascript - jQuery html() converting braces to html entities (sometimes) -


असल में:

मेरे पास यह HTML है:

  & lt; Div id = "foo" & gt; & lt; img src = "/ foo / bar / {var} / foo" alt = "{var}" & gt; & lt; / div & gt;  

कॉल करते समय (फ़ायरफ़ॉक्स में jQuery का उपयोग करते हुए):

  $ ("# foo")। Html ()  
< P> मुझे मिलता है:

  & lt; img src = "/ foo / bar /% 7bvar% 7d / foo" alt = "{var}" & gt;  

मेरा इच्छित आउटपुट है:

  & lt; img src = "/ foo / bar / {var} / foo" alt = "{var}" & gt;  

यहाँ क्या हो रहा है? यह कैसे हल करने के लिए कोई सुझाव है?

मुझे लगता है मुझे समाधान है अगर समाधान HTML संस्थाओं रूपांतरण को पूर्ववत करने के लिए regex का उपयोग करने के लिए होता है ब्रेसिज़ के बजाय पैनर्स का उपयोग करना एक ही परिणाम (विभिन्न HTML संस्थाओं के साथ) का कारण बनता है।

संपादित करें : मैंने इसे स्क्वायर ब्रैकेट्स ( [ और < ] ), और पैरों और ब्रेसिज़ के विपरीत, ब्रैकेट HTML संस्थाओं में परिवर्तित नहीं होते हैं। क्या पैरों और ब्रेसेस के पास कुछ विशेष अर्थ है?

आप शायद जावास्क्रिप्ट यूनेशस्क फ़ंक्शन का उपयोग कर सकते हैं


iphone - how to select multiple image with UIImagePickerController -


संभव डुप्लिकेट:

मैं iPhone विकास में एक नौसिखिया हूं, साइट मुझे बहुत मदद देती है लेकिन अब, मैं एक मुसीबत से मिलती हूं, मैं एक फोटो सेल्बम में एक से अधिक फोटो का चयन करना चाहता हूं, लेकिन जब मैं UIImagePickerController का उपयोग करता हूं, तो मैं सिर्फ एक फोटो प्राप्त कर सकता हूं, क्या आप मुझे बता सकते हैं कि अधिक फ़ोटो कैसे चुनिये? धन्यवाद।

सबसे अच्छा संबंध है,

ofllm

आपको अपना खुद का दृश्य नियंत्रक बनाना होगा जो कि आप वर्तमान में चयन कर रहे फिल्मों की सूची करेंगे। एक समय में अपनी सूची को एक छवि बनाने के लिए UIImagePickerController का उपयोग करें UIImagePickerController में कोई भी एकाधिक चयन उपलब्ध नहीं है।


c++ - Updating text in a C Win32 API STATIC control drawn with WS_EX_TRANSPARENT -


I have some static labels and buttons on it I make all the labels a transparent background so I can call background red . In the callback, I process the WM_CTLCOLORSTATIC message, set the control ID with GetDlgCtrlID () and then:

  SetBkMode (HDC) wParam, TransNet); // Stable Control BKGD Transparent Return (INT_PTR) (HBRUSH) GetStockObject (NULL_BRUSH);  

So far the form is drawn, the background is red and the label text is drawn to the top.

After the user interaction, I need to change the text, so I issue a SetDlgItemText () message and attract the new text. The problem is that the old text is not being erased, and the new text is pulled over it.

After reading today to some extent, it seems that the problem is the controlling parent (form) which is responsible for the drawing background. This means that when you change the label text, the control overlines the new text, but the form does not automatically show the background again.

The question is how do I redo rectangle area labeled control (preferably without subclassing)?

Added:

I have tried the following:

  HWND hctrl; Hctrl = GetDlgItem (HWD, Control ID); Redrawondo (HTTRL, 0, 0, RDW_UPDENEVE) RDWOOLHLRRNRDW_FRAMAMANDU || RDWYADADT || RDW_ARAC (RDWNTNLPANT); // RDW_UPDATENOW  

and:

I do not handle WM_PAINT messages at all, only:

  case WM_CTLCOLORSTATIC: SetBkMode ((HDC) WPAMAM, transnenet); Return (INT_PTR) (HBRUSH) GetStockObject (NULL_BRUSH); Int Library: :: SetCollectText (Int'l ControlId, String STECT) // Dialog Out {Ent Rated; Retal = Setdalguitum Text (hwd, control id, sText.c_str ()); RECT RECT; Hw & htl; Hctrl = GetDlgItem (HWD, Control ID); GetClientRect (hctrl, and rect); Map Window Points (HTTL, HWND, (PINT *) and REXT, 2); Invalid note (hwd, and riket, true); Return rate; }  

Mark, thank you for doing this work.

Use illegal use on capture rectangle by control.

RECT rect; GetClientRect (hctrl, and rect); Invalid note (HTTL, and Riket, true); Map Window Points (HTTL, HWND, (PINT *) and REXT, 2); Redrawondo (HWD, and reactivity, faucet, RDW_ARAC | RDWNAVANDAdit);

c# - embedding a simple ActiveX control got Class not Registered error -


I have just developed a very simple ActiveX control (using a VSNet wizard, also a line) Not changed), and compiled it. After running "Regsvr32 ax1.ocx", I have created a new C # WinFrom project and drag the ActiveX control into the form. Then I create and run it, the error says:

  registered Class (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))  

In this line:

  ((System.ComponentModel.ISupportInitialize) (this.axax11)) . EndInit ();  

The entire function is:

  Private Zero initial element () {System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager (typeof (Form1) ); This.axax11 = New Axax1Lib.Axax1 (); ((System.ComponentModel.ISupportInitialize) (this.axax11)) BeginInit () .; This.SuspendLayout (); // // axax11 // this.axax11.Enabled = true; This.axax11.Location = new System.Drawing.Point (103, 90); This.axax11.Name = "axax11"; This.axax11.OcxState = ((System.Windows.Forms.AxHost.State) (resources.GetObject ("axax11.OcxState"))); This.axax11.Size = New system Drawing Size (100, 50); This.axax11.TabIndex = 0; // // form1 // this. Auto Scalements = New System. Drawing. Size F (6f, 13f); This.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; This.ClientSize = New system Drawing. Size (284, 262); This.Controls.Add (this.axax11); This.Name = "Form 1"; this. Text = "form1"; ((System.ComponentModel.ISupportInitialize) (this.axax11)) EndInit () .; This.ResumeLayout (wrong); }  

I think you wrote your anticox control in unmanaged C ++ code is. You will either need to create a 64-bit version of this control or you will need to force it to use the .NET program to run in 32-bit mode. The latter is fine soon, project + properties, build tab, platform target = x86.


objective c - iPhone programming cellForRowAtIndexPath not called even after delegate set -


I am trying to create and drag the populated UITableView through an array. I have created a UIViewController and have set UIViewController as my tableview rep. However, it seems that my cell-endindexapath method is not called when the tableview is made, so my table is never populated, what do I understand here? (All labels are initialized in that function, because I'm trying to create main menu using only one table, all entries will be fixed).

  // Apply loadView to create a visible hierarchy Programmically, without using a nibb - (zero) load view {prefTable = [[UITableView alloc] initWithFrame: CGRectMake (0 , 0, 320, 480) Style: UITableViewStylePlain]; [Prefibal Set Deliget: Self]; // NSIndexSet * tmpIndRange = [[NSIndexSet Alok] initWithIndexesInRange: NSMakeRange (0,1)]; // [insert prefTable symbol: tmpIndRange withRowAnimation: UITableViewRowAnimationNone]; // [tmpIndRange release]; LabelArray = [[NSMUTABELRAIL] Initvid Capacity: 10]; [Labeled add object: NSLoclyged string (@ "account id", @ "c_accidid")]; [Label Array Ad Object: NSLoclyged String (@ "Site ID", @ "Site_ID")]; [Labeled add object: NSLoclyged string (@ "station id", @ "station_id")]; [Labeled add object: NSLlighted string (@ "encryption key", @ "ANC_Key")]; [Labeled add object: NSLoclyged string (@ "encryption on", @ "ANCII")]; PlaceholderRay = [[NSMutableArray alloc] initWithCapacity: 10]; [Labeled add object: NSLlighted string (@ "Required", @ "Required")]; [Labeled add object: NSLlighted string (@ "Required", @ "Required")]; [Labeled add object: NSLlighted string (@ "Required", @ "Required")]; [Labeled add object: NSLlighted string (@ "Required", @ "Required")]; [Labeled add object: NSLlighted string (@ "Required", @ "Required")]; Self.view = prefTable; } - (BOOL) textFieldShouldReturn: (UITextField *) textField {NSInteger currenttag = textField.tag; NSLog (@ "% d", textField.tag); // account id = textField.text; // station id = textField.text; // siteId = textField.text; [TextField Resigns First Responder]; Yes come back } - (UITableViewCell *) TableView: (UITableView *) Table View CellForAindindpath: (NSIndexPath *) Index Path {Fixed NSString * CellIdentifier = @ "cell"; UITableViewCell * cell = [tableview] dequeueReusableCellWithIdentifier: CellIdentifier]; If (cell == null) {cell = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: CellIdentifier] autorelease]; } // Set up the cell ... [cell setAssetry type: UITableViewCellAccessoryNone]; [Cell.textLabel setText: [LabelOreOutIndexX: indexpath.ro]]; // ((TextInputTableCell *) cell) .textField.placeholder = [placeholderOreObjectIndex: indexPath.row]; Return cell; } - (NSInteger) numberOfSectionsInTableView: (UITableView *) tableview {return1; } - (NSInteger) Table view: (UITableView *) Table view numberoffrose injection: (NSInteger) section {return4; }  

In addition, would it be better if I assigned the menu item by using the data source? It seems that section headers can only be assigned using a data source. Thanks!

"post-text" itemprop = "text">

Table view: cellForRowAtIndexPath: is part of UITableView Datasource Protocol - is not UITableViewDelegate You will need to create your controller UITableView's data source:

  prefTable.dataSource = self;  

.net - How many objects can LINQ used to create per second? -


I used Linq to insert objects into the database. But if I create 20 objects within 1 second If I use the thread, then failed to add 20 items to the system database.

And I found out that it is not possible due to the limit of SQL Server, so is Linq possible, any one idea? How can I make 20 records or more in 1 second within 1 second?

You mentioned that if you are using Threads to enter 20 records in your database If you are using the same database reference, this may be your problem. I do not believe the L2S database context object thread is secure.

Randy


optimization - When was this clock bought? -


The clock on the gym wall also shows the names of the day and the day of the month. This morning it was shown on Tuesday - 23. < / P>

The day clearly revolves around the cycle of 7 - and the "Tuesday" month correctly shown, however, probably rotates through a circle of 31 and "23" wrong methods Shows - today is December 1 (i.e. not on November 31). Therefore this error has been gradually acquired over time.

Given the assumption that no one is ever able to reset the clock, what is the most spectacular, fast, customized way to suggest some possible dates of the time when this watch is new The brand was bought.

(Bonus credits to show the clock, when the clock will again show the correct day / number combination.)

01-Oct-17 is when the clock will again show the correct day / number combination.


Retrieving display value of lookup field in Dynamics CRM C# plugin -


I am trying to retrieve the display value of the lookup field in a plugin for MS Dynamics CRM 4.0. The value of the attribute is a GUID that indicates to another entity (the owner of the sale in this case). The "normal" attribute I get from a code like this:

  CRMDTime serviceOrDRDATT = (CRMDTime) unit ["Submit"]; ServiceOrderDate = serviceOrderDateDT.Value.ToString ();  

Any ideas on how to do this for the display value of the lookup field?

  owner's owner lookup = (owner) unit ["owner"]; String owner name = owner lookup.name;  

Logging into a two different log file types in Codeigniter -


Is it possible for CI (Navy) to enter two different files with two different controllers?

Is there any third party logging libraries available for CI?

I was looking for it but nothing could be found. I tweaked the code and it works fine I posted it in the CI forum

Take a look maybe it will serve your purpose.


c# - How to write a WCF service with in-memory persistent storage? -


I wrote a WCF service, but the data stored in the service implementation does not occur between calls, even here What can I do with a static variable that is not stored?

The service implementation is as follows:

  public class storage: ISO, secure {secure static item} _data; #region IStorage members enter public Zero (object [] data) {lock (_data) {_data = _data.Concat (data) .toArray (); }} Select public object []Never () {lock (_data) {return (object []) _data. Clone (); Service Host is a console application:  
  Fixed zero main (string [] args) {ServiceHost serviceHost = New service host (TypeSpeedStorage); ServiceHost.Open (); Console.lightline ("service is running, please enter 'to exit ...'); Console.ReadLine ();}  

By default, the WCF instanceMode is set to per call, which means the data used in the service is specific to that client call.

On service

  [ServiceBehavior (InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single)] Try adding to the public class MyService: IService  

Service a singleton .


c# - AOP interception attribute -


Therefore, I have this problem, and no one is able to help. So instead of keeping it away, I'm going to throw it out for alternative cat skin alternatives.

I currently have the following:

  Public Interface ICustomerService {Customer Customer (Int id); } Public Sector Customer Service: IC Customer Service {Public Customer GetCustomer (int id) {...}}  

... and IOC setup with unity, and at the same time interception Configuring:

IUnityContainer ioc = New Unity Container (); Ioc.RegisterType & lt; ICustomerService, CustomerService & gt; (). Configure & lt; Interception & gt; () .SetInterceptorFor & lt; ICustomerService & gt; (New interface interceptor ());

What I want to do is to be able to set up features in the interface like this:

  Public Interface ICustomerService {[Log] Customer GetCustomer ( Int id); }  

... such as definition:

  public class log attitudes: handler attribute {create public override icill handlerHandler (IUNTT container) {return new loghoulder ( ); }}  

... and then I want to logging all the logHandler class which I like:

  public class logheader: icillhandler {public return return What is a tracing / logging system where I want to receive namespace.class where the handler log has been named (IncognitionInvocation Input, GetNextHandlerDelegate getNext) {... Log Content}}  

Methodname, and parent namespace.clas.this is the name that is called. I have not made any attempt to use the "input" iptv invocation parameter, whose information I want, this issue gives input, the "ICustomerService" interface, while parents checking for a stackframe for parents Implemented class (e.g. customer service) means that when I try to create a tree structure as the use of namespace.class.methodname in the form of units ID, then the ID and the parent found Does not.

[Parameter] The attribute is not really working, because what can I put there? If I put the name of the interface, then I still have the same problem where one has an ID interface and the parent is the implementation class. And, I can not put the name of the implementation class in the attribute on the interface, because it has dashed the purpose of having an interface in the first place!

So, this dilemma has anyone got fresh ideas?

I have finished using PostSharp to implement logging in this way.


php - Rename pdf file to be downloaded on fly -


Given: All uploaded PDF files on the server are prefixes with timestamps, later users can download these files again. Could.

Question: When I give the option of downloading a PDF file, the name of the file looks ugly and long. How can I change something like this name so that when the user downloads this file, the name does not look weird?

Do I have to make a copy, because there is no alternative to rename the original file? Will there not be an additional overhead for each downloadable file? Obviously there will be another additional step to delete the copied file?

Is it possible to download the file completely on the client side after changing the file name?

What do you suggest?

Something like this:

   

wcf - Getting System.ServiceModel.CommunicationObjectAbortedException from a single client -


We have a customer in the area who installs our client app on a new machine when they try and Login; Which calls a WCF web service; They get the following error:

System.ServiceModel.CommunicationObjectAbortedException

"Communications object, System.ServiceModel.Channels.ServiceChannel, can not be used for communication because it was aborted is."

They installed on another machine, and there was no problem in it. With no problems, the app is installed in many places.

Any idea why it does not work on a machine? The machine is running Windows 7, but the app is running on other machines with Windows 7.

Any ideas will be appreciated.

How are you making your calls for service?

Whatever you have said, something like service call is failing and you are trying anyway

Post some code?

In this way,

Android - Use WebView to evaluate a javascript string and return the value -


Given that the scripting in Android is not basically supported and wrapping the library such as javax.script.ScriptEngine your app Will make it too big, is it possible to send JavaScript strings for an invisible webvive and evaluate the string and return the result (the second string) to you?

I want to go this route because I want to save all my script so my app can remain small for the disc.

edit

I need a Java code, not in other ways to evaluate the JavaScript string. addJavascriptInterface () does not help.

Can it be done? Yes, addJavascriptInterface () and browser by sending a javascript: URL, similar to a bookmarklet.

A very simple answer, which will use very little memory and will be executed very fast, do not use javascript.


c# - Can you call PadLeft inside a databound server control? -


Say I have a label inside a gridview template column and I place the text on the databound item, "order-end". Is there a way I can call? Toaster (). Pad left (7, '0')? In the form of a label it stands:

  & lt; Asp: Label ID = "lblOrderID" runat = "server" text = '& lt;% #' WW '+ DataBinder.Eval (container.datetime), "order id")% & gt; '/ & Gt; 

PaddleFit requires four axes, I can not use my single quote because I already surround the value in a quote and do not double quote due to the databinker can. Aval expression Is there another way that I can work it on one line?

You can inline (I 'I will leave it for someone else because I can answer it For VS is not open).

But I call it a formatted order ID by adding a method to codebihind. Or better, the format method is put in a stable helper square, so it is available on a page that requires a formatted order ID.

If you are bound in the collection of orders, then something like this:

  public stable string GetFormattedOrderId (object datagram) {order order = (order) dataItem; Return String.Format ("WW {0: N7}", order.OrderId); \ // Or order back. OrderAud. ToString (). Pad Left ... if you want  

or if you are bound to datatable, then something like this:

  Public Stabilized String GetFormattedOrderId (Object Datagram ) {DataRow row = (DataRow) dataItem; Return String.Format ("WW {0: N7}", line ["OrderId"]); }  

Then you can have formatted order ID in any of your markups:

  '<% # myFormattingHelper.GetFormattedOrderId (container. Data format)% & gt; ' 

unit testing - Rhino mocks - does this test look sensible? -


I have prepared the following tests using rhino socks. Is my test valid and more experienced people with jokes understand?

I am a little confused that I have to be emulating the Dynamicmock () or Strict Mac () methods to make a valid test.

This test is a test that the add method was applied to ICachingStrategy supplied with the supplied parameters.

  object o = new object (); Date time d = new date time (date time.N. year, date time.Now death, date time.Now day + 1, 0, 0, 0); Cashstoragestyle = CashStagestyle out of place; String F = "test"; // Organize stubStrategy = MockRepository.GenerateStub & lt; ICachingStrategy & gt; (); Var stubEncoder = MockRepository.GenerateStub & lt; ICacheItemEncoder & gt; (); StubStrategy.Stub (x = & gt; x.Add (O, D, S, F)). Return ("Test: Key"); StubEncoder.Stub (x = & gt; x.Encode (O, S)). Return (o); _mocks.ReplayAll (); // work ICache c = new cache (stubstraw, stub encoder); C. Add (O, D, S, F); // StubStrategy.AssertWasCalled (x = & gt; x.Add (O, D, S, F)) says;  

The question is: Is this successful? Do you expect this? If the answer is yes and yes, then the exam is good. You can test the test by complying to call it Add in its implementation. If the add () method is not called, the test should fail.

There are related documents that show the difference between stub and socks. The mandatory difference is that the stubbs "will not allow any examination to fail." They are just for testing code work, further recommend that wherever possible, the stubs above the mocks should be preferred.

Your test is valid for me because you are primarily interested in the fact that the add () method was called, and you have explicitly called that call Are pushing. You are not testing other methods of calls, so you are racking them instead of joking.


jQuery find next/prev elements of a certain class but not necessarily siblings -


Next, previous, next, now and all previous methods are very useful, but if you are not trying to find the elements The key element I want to do is something like this:

  & lt; Div & gt; & Lt; Span id = "click" & gt; Hello & lt; / Span & gt; & Lt; / Div & gt; & Lt; Div & gt; & Lt; P class = "search" & gt; World & gt; & Lt; / P & gt; & Lt; / Div & gt;  

When click on ID , I want to match the class from the next element to Find , in which case The click elements are not brothers or will not work.

I was working on it today's own problem, here it is that with whom I came

  / ** * Find the next element that matches a certain selector is different from * in the next () * that searches for the parent of the current element * Find the selector for the ultimate selector * @latest steps (optional) to find the number of steps, default 1 * @ in the absolute field (optional) Jais, the default document extensive * / $ is Fn.findNext = function (selector, move, scope) given {// move? Then pars (step) for integer {steps = Math.floor (steps); } And if (step === 0) {// stupid case :) it's back; } Else {// Other, try var next = this.next (selector); If (next.length) return forward; // FAST FAIL FAIL, STRIPLY STEP :) STEPS = 1; } // set scope for document or user-defined area = (scope)? $ (Area): $ (document); // Find the children who are matched with the selector: children used to serve as exclusions = this.find (selector); // search in parent (s) = $ (this); While (grass [0]! = Scope [0]) // // Grass of a level above = hay.parent (); // Except children of the current element - / / - Exclude the children of the current element - Add the current element (document will be added in sequence) var rs = hay.find (selector) .not (children) .add ($ (this) ); // var id = rs.index (this) + move the desired number of steps; // results found? Then return (ID & gt; -1 & amp; amp; ID & lt; rslength) Refund $ (Rs [ID]); } // Return blank results return $ ([]); }  

in your example

   

You can now

  $ ('# click')). FindNext ('find.example.com). Html ('test 123');  

I doubt it will perform well on large structures, but here it is :)


sql - Divide does nothing -


I am trying to create percentile scores, my query generates the correct rank, but the division does nothing (rank score Instead of in the column)

  "/" (rank () "over" (by order "disk io")  

I also After selecting it, it has tried to generate rank and divided it, but it has only one result.

 (code "SELECT ...") "/" ("disk io score" Enumeration (*)) "Score" ... from (.... rank) "object" "... ...  

thanks, buzzie

  Select "System_Name", "/" (the command by "disk ioO"), "disk io", "disk io"  
Div class = "post-text" itemprop = "text">

Looks like you're using composite COUNT (*) instead of analytical.

Try:

  SELECT RANK () over (...) / COUNT (*) over (...)  

and you post the full query ( GROUP BY section)?


javascript - Get a Div Value in JQuery -


मेरे पास एक ऐसा पृष्ठ है जिसमें निम्नलिखित div तत्व है:

  & lt; div id = " MyDiv "class =" myDivClass "शैली =" "& gt; कुछ मान & lt; / div & gt;  

मैं JQuery के माध्यम से या मानक जेएस के जरिए मूल्य ("कुछ मान") कैसे प्राप्त करूं? मैंने कोशिश की:

  var mb = document.getElementById ("myDiv");  

लेकिन डिबगर कंसोल "mb is null" दर्शाता है बस इस मूल्य को कैसे प्राप्त करें यह सोचकर।

---- अद्यतन करें ---- जब मैं सुझाव प्राप्त करता हूं, मुझे मिलती है: $ फ़ंक्शन नहीं है

यह एक JQuery का हिस्सा है इवेंट हैंडलर जहां मैं एक बटन पर क्लिक करते समय मूल्य पढ़ने की कोशिश कर रहा हूं I हेन्डलर फ़ंक्शन काम कर रहा है लेकिन यह jQuery के मान की व्याख्या नहीं कर सकता है:

  jQuery ('# gregsbutton')। क्लिक करें (फ़ंक्शन () {var mb = $ ('# mydiv' ) .text (); चेतावनी ("div के मान है:" + mb.value);});  

<पूर्व> myDivObj = document.getElementById ("myDiv"); यदि (myDivObj) {चेतावनी (myDivObj.inner एचटीएमएल); } और {चेतावनी ("एलियन मिला"); }

ऊपर कोड आंतरिक HTML दिखाएगा, अर्थात यदि आपने div के अंदर html टैग का उपयोग किया है तो यह उन लोगों को भी दिखाएगा। शायद यह आपके द्वारा अपेक्षित नहीं है। तो एक अन्य समाधान का उपयोग करने के लिए है: आंतरिक टेक्स्ट / टेक्स्ट कंटेंट प्रॉपर्टी [thanx से bobince, उसकी टिप्पणी देखें]

  function showDivText () {divObj = document.getElementById ("myDiv"); अगर (divObj) {if (divObj.textContent) {// एफएफ चेतावनी (divObj.textContent); } Else {// IE चेतावनी (divObj.innerText); // चेतावनी (divObj.inner एचटीएमएल); }}}  
पर क्लिक करें

Scala TreeMap strangeness; implementing a reverse-order ordering -


I have a map [long, string] , which I want to be repeated in descending order I have keys. The way I decided to do this, it was as follows:

  var m: sorted map [long, string] = treemark. Mautai (L: Long) => M ++ = Map (2L -> "Hello", 1L -> "World", 3L -> "Chris") Println (m) // map (3 -> Chris, 1 -> world, 2 - & gt; hello)  

I'm sure I can not understand Why this does not work and can only assume that I have made some stupid mistake. Of course, the following works:

  var m: sorted map [long, string] = tree mark. Empty (Long: Long) => New Order [Long] {DF (Compare: Long) = -l.compare (a)}) m ++ = Map (2L -> "Hello", 1L -> "World", 3L -> "Chris") println (m) // map (3 -> Chris, 2 -> Hello, 1 - & gt; World) < / Code> 

difficult Let's run that sorting:

  scala> (-3L) .Compare (1l) race 13: int = -1 scale & gt; (-1 L). Comparison (2l) race 14: int = -1  

We therefore conclude that 3 & lt; 1 & lt; 2. Which works the following:

def (a: long) = -l.compare (a)

Come on, let us To make sure that what we are doing is insert some brackets there

  def (a: long) = - (l.compare (a))  

Ok, so the answer is clear. You are reducing the result of comparison , and that is why it works, it is something different from the first time.


iphone - How to save and read a CGLayerRef, in a NSmutableArray -


I have a question about CGLayerRef "Elements" (because they are not the object!)

In

How can I archive and read CGLayerRef in this code?

To get a good framerate on my draw, my app, I want to store a list of CGLayerRef created from bitmap.

This is the code for store in NSMutableArray

  CGLayerRef imageLayer; // make my layer ... // init my NSMutableArray if (layerTable == zero) {layerTable = [[NSMutableArray alloc] init]; } // and archive my CGCLayer in NSValue [layerTable addObject] in this array: [[NSValue alloc] initWithBytes: imageLayer objctype: "CGLayerRef"]];  

Now the code for DrawRect in my view:

To attract "realIdp" is an integer to identify the layer.

  - (zero) DrawConnect: (CGCTEXTIF reference) {// Other code ... // Here I want to read my CGLARF // test with NSVL, but I want NSVLU NSVL * Val = [LayerTable ObjectOutIndex: Real IDP] does not know. ; CGLayerRef LayerTouch; [Val Mill Value: Layer Toshaw]; // Perhaps an error CGContextDrawLayerInRect (reference, imageRect, layerToShow); }  

Here, the code for change in my ID:

  - (zero) showThisId: (int) IDP {realIdp = idp; [Self-setday display]; };    

You have left the @ encod instruction:

[Layer Usable AddObject: [[NSVL Allocess] Init Withbits: Image Layer Object Type: "CGLARRF"]];

should read:

[layerTable addObject: [[NSValue alloc] initWithBytes: imageLayer objctype: @encode (CGLayerRef)]];

You have to give the address of a buffer at [NSValue getValue:] . So this line:

  [val getValue: layerToShow];  

should be:

  [val getValue: & amp; Show layer];  

I think that should work


mysql - Personalized Welcome Messages -


How do I create a welcome message on my home page with that user's name?

The Dynamic Drag Recordset field does not work on my page:

  & lt; Cfoutput & gt; # Recorsetset1 User Name # & lt; / Cfoutput & gt;  

This is using the first username in the table, as a user I am not logged in. Do I have to add something in my application? CFC page?

Note: If you show all the code (how you enter How do you ask for datasets?), It will help us assist you.

A few very common advice for now.

The reason for this is that all of you (Or at least more than one) records when you only show the first record from the output once the CF dataset, you can see it by looping on the dataset Are:

    # Recordset # Username # & lt; / cfoutput & gt; & lt  

It should show all your records.

As Jason has told you to give your user Only one record should be selected. When you login, save the user # (usually the primary key, id) in session scope (say, in session.userid ) and later this Use it in a variety of questions Switch to (I do not know your query, so it is just to show the idea):

  & lt; Cfquery data-sensor = "datasetname" name = "recordset 1" & gt; Select user by user name where id = & lt; Cfqueryparam cfsqltype = "cf_sql_integer" value = "# session.userid #" /> & Lt; / Cfquery & gt;  

Understand that if you have unique ID as PK, then you will get only one record in Records 1, so your initial output will show the correct username.


Strategy for avoiding a common sql development error (misleading result on join bug) -


Sometimes when I'm writing a little complex selection statement with some joints, the wrong key column is sometimes combined statement Used to still return the results that are valid.

Since the auto numbering value (initially in development in particular) decreases in all the same categories (sub 100s or so) SELECT Sill generates some results. These results are often found to be valid at first glance and a problem is not detected, much later, making debugging more difficult has been made familiar with the data structures and code. (Dev's mind got disturbed.)

I have spent many hours on another issue which I have run several times before. I carefully designate my tables and columns, write my SQL methods in practice, but this is an issue that I do not think it is to avoid competition. It comes back and bites me on average twice a year for productivity.

My question is this: Does anyone have to come in a clever way to avoid this? What do I think is a normal SQL bug / mistake?

I have thought of trying an auto-number to start with the initial values, but it feels silent and tries to keep such a plan straight for the data. Models with dozens of tables ... any better ideas?

PS

I am very careful and systematic in the name of my tables and columns, get Patti ITID column in the patient table, facility facility etc. is. This problem is a habit of raising when it is included in the tables included, where the link takes the additional meaning such as related PatentID, Refining Patients ID, Favorite ITMID etc.

Try to limit the result to a record when typing the long complex SELECT statement For example, the value Take that you have this huge huge CMS system and you have to write internal reports because the report that comes with it is very awesome. You see that there are about 500 tables. Your selection statement is included in 30 of these tables. Your result should be limited by using a WHERE block to your line number.

I recommend that all these code be written and normalized for all cases, break the problem and use WHERE and limit the count of the line only say a record Check all the fields, if they If you look ok, break it and return more code to your code. You should make normal only after further investigation.

It bites much of us which keeps adding to it as long as it does not look right, but after the blau accountant runs the report, it shows that for 4 lakhs P.O. In fact the telephone bill for the whole year was messed up in any way!


jquery - How to implement Server push / long polling / comet using PHP and Javascript -


How can I apply Comet / Server push design patterns using PHP and Javascript? Basically what I want to do:

  • The user clicks on a 'Submit' button
  • JavaScript shows a message like 'processing 0/100 item'
  • Once a new item is processed, php / server pushes an update, and javascript changes the message to '2/100 items processing, 3/100 items and so on'.

How can I do this? Any links / info please?

There are some difficult topics with comet scaling with PHP, an option would be a mother-in-law solution, such as (Disclaimer: I work there). In this way you do not have to worry about any behind the scenes stuff, and you can only get your server-push functionality.


winapi - Open CD/DVD door with a Windows API call? -


How do I open a CD / DVD door with a Windows API call?

If you are using .NET, this will work:

This was the first link to come

This was the second one:.


serialization - jQuery to serialize only elements within a div -


मैं jQuery.serialize () के समान प्रभाव प्राप्त करना चाहूंगा, लेकिन मैं चाहूंगा

नमूना परिणाम:

  एकल = एकल 2 और एकाधिक = एकाधिक और amp; रेडियो = रेडियो 1  

कोई समस्या नहीं है बस निम्नलिखित का उपयोग करें यह बिल्कुल रूप से एक प्रकार की धारावाहिक रूप से व्यवहार करेगा, बल्कि इसके बजाय एक div की सामग्री का उपयोग करेगा।

  $ ('# divId: input')। Serialize ();  

प्रदर्शन के लिए जांचें (कोड के लिए)


c++ - Lightweight debugging on embedded Linux -


I am developing an application that runs on small Linux-based SBC (~ 32 MB RAM). Unfortunately, my app was too big to run under the GDB recently. Is anyone aware of any good, lightweight debugging methods that I can use in embedded Linux? Even the stack of a thread will be very helpful in being able to see the trace.

I should mention that this application is written in C ++ and runs many threads, so GDBrovorver does not go as it does not work

Great

Gdbserver definitely works with multi-threaded applications, I am currently working with 25 threads on an embedded project And I use gdbserver all the time.

  information threads  

lists all threads in the system

  threads < Thread number information by thread & gt;  

Switches to that thread of execution.

  Threads XXX apply to & lt; Command & gt;  

runs on the thread specified by XXX, which can also be 'All', so if you want a back trace from all running threads then

  Apply thread all BT  

Once you are in the execution flow of the given thread, your specific commands work in a single threaded process.


c++ - Member value changes between successive calls of the same function -


मेरे पास एक संज्ञानात्मक एंटीटी वर्ग है, इस तरह परिभाषित:

  कक्षा संज्ञानात्मक दूरी: सार्वजनिक वस्तु {सार्वजनिक: संज्ञानात्मक अंत (FuzzyCognitiveMap fcm, SystemState s); ~ संज्ञानात्मक अंतर (); टेम्पलेट & lt; typename T & gt; शून्य रजिस्टर बदलें (std :: स्ट्रिंग संदर्भ, टी मान); बूल ऑपरेटर! = (कॉन्स्ट संज्ञानात्मक एंटीटी & amp; आरए) कॉन्स्ट; निजी: FuzzyCognitiveMap m_fuzzyCognitiveMap; SystemState m_systemState; Std :: vector & lt; सिस्टमस्टेट & gt; RunFuzzyCognitiveMap (); };  

जैसा कि दिखाया गया है, एक संज्ञानात्मक अंतराल में SystemState ऑब्जेक्ट है, जिसके बदले में संकल्पना का एक सदिश है ऑब्जेक्ट्स (केवल सबसे प्रासंगिक लाइनें दिखाई जाती हैं):

  class SystemState {public: SystemState (); ~ सिस्टमस्टेट (); शून्य AddConcept (संकल्पना c) {m_L.push_back (c); } Std :: vector & lt; Concept & gt; m_L; };   संज्ञानात्मक अंतः :: रजिस्टर बदलें  के अंदर, मैं संभावित कारण के रूप में एक संकल्पना को चिह्नित करता हूं ( Concept :: IsPotentialCause (bool)  जो पारित मूल्य के साथ केवल एक निजी सदस्य निर्धारित करता है): 

  टेम्पलेट & lt; typename T & gt; शून्य संज्ञानात्मक अंतः :: रजिस्टरचेंज (std :: स्ट्रिंग संदर्भ, टी मान) {std :: string name = context.substr (context.find_last_of ("/") +1); Int pos = m_systemState.FindConcept (नाम); यदि (pos & gt; -1) {int intValue = value? 1: 0; M_systemState.m_L [pos] .SetConceptValue (intValue, गलत); अगर (m_systemState.m_L [pos]। चेक व्हायरेशन ()) {m_systemState.m_L [pos] .IsPotentialCause (सत्य); // इस अवधारणा को संभावित कारण के रूप में चिह्नित करें (int कारण = 0; कारण & lt; m_systemState.GetSize (); कारण ++) {if ((cause! = Pos) & amp; (m_systemState.m_L [कारण] .MayBeCause ))) {M_fuzzyCognitiveMap.UpdateFuzzyCognitiveMapEntry (कारण, स्थिति, m_systemState); M_systemState.m_L [कारण] .IsPotentialCause (गलत); }}}}}  

क्या होता है, जैसे कि रजिस्टर बदलें को दूसरी बार कहा जाता है, संकल्पना जिसे संभावित रूप में चिह्नित किया गया था कारण, अधिक चिह्नित नहीं है। मैं जीडीबी चलाने की कोशिश कर रहा था और मुझे यकीन है कि वह सदस्य कहीं और सेट नहीं किया गया है।

मुझे यकीन नहीं है कि इस छोटी सी जानकारी के लिए मुझे इस तरह के व्यवहार के बारे में कुछ संकेत देने के लिए पर्याप्त है (मैं नहीं SystemState और संकल्पना दोनों वर्गों के कोड के साथ पोस्ट को बाढ़ना चाहते हैं।

सादर, जिपर

अगर यह एक बहु-थ्रेडेड सिस्टम था, तो मैं कहूंगा कि यह साझा की गई एक क्लासिक केस की तरह लगता है, जो अयोग्य राज्य है जो ठीक से सिंक्रनाइज़ नहीं हुआ था।

यदि आपके पास बहु-थ्रेडेड स्थिति नहीं है, तो मैं कहूंगा कि उस चर पर एक घड़ी सेट करें और देखें कि यह क्या बदलता है।


algorithm - Finding elements that are present in one set not the other -


I have two sets A and B

  A - 1 2 6B - - 1 2 3 4  

When I set A with B, I need to get value 6 as the output and 4 value as the output when set B A Is compared to.

I wonder what would be the best algorithm to do this? I have written one, but it has got quadratic complexity, it basically repeats a set and inside the loop, the second set repeats the value to check the existence. I am considered ineligible as such.

Context

I have a set of values ​​in the database, which I am the UI. Users can remove or add new items to the list and press the "Save Changes" button, which will continue to make all the changes in the database. So here I insert new added items into the database and delete deleted items.

So I pass the set in which the items have been added and already existed. I load another set that contains all the items from the database. Now if I apply the above algorithm to set A (new list) with set A (database list) and take the items in the set and not in the set, I get all newly added items I will compare it with Seta, and all the items present in the set and not in the set are deleted. I am open to suggestions for better algorithms.

Any help would be great.

If both sets are sorted then both sets can start from the beginning and through them Let's compare, compare the first elements to see which other sets are missing. It works in linear time.

For the ordered sets, first order them in the O (n log (n)) and then by comparing them in linear time, o (n log (n)). Based on the details of your application, it is possible to keep this set sorted all the time, which makes it easier to compare them when needed.


java - How much should I add when resizing an array? -


I am competing with another student to make the fastest version of our homework work, and I For a demonstration reasons, ArrayList (Resizing the array, the benchmark time can be cut from 56 seconds to 4), but I am thinking that I should change the size of the array every time I need it. Particularly the relevant parts of my code are as follows:

  Private node [] list; Private integer size; // Number of items in the list Private static final end; // Each time the public MyClass () {list = How to change the size of the list by the new node [N]; } Add Public Zero (Node New Node) {If (size == list.length) {List = Arrays.copyOf (List, Size + N); } Catalog [size] = newnode; Size ++; }  

TL; DR: What should I do N ?

It is recommended to repeat the size of the array during the recycling of the linear line by doubling the size Cost increases.

The simple idea is that there are two costs associated with the value of the size:

  • Copy of the display costs - the cost of copying elements from the previous array to the new, and < / Li>
  • Memory Overhead Cost - The cost of allocated memory is not used.

If you resize the array by adding an element at a time, the memory overhead is zero, but the cost of the copy becomes quadratic if you were to allocate too many slots. The cost of copying will be linear, but memory overhead is very high.

Doubling is a linear amortized cost (i.e., for a long time, the cost of copying is linear in relation to the size of the array), and you are guaranteed that you do not waste more than half the population.

Update: Apparently Java's array list expands (3/2). It makes a bit more memory conservative, but a little higher cost in case of duplication. Your use will not harm the benchmarking.

Minimum Improvement: Resizing the doubling cost will refine the linear, but it will ensure that you have continuous continuous time insertion. Check it out.


c# - If Base class is marked Serializable are all child classes marked too? -


I have a complete list of entity sections, which I need to serialize (due to the session being stored in SQL , But this is the second story).

I've added the attribute [serializable] and all look fine.

All my unit classes are extended from the same base class. If I mark the base class as serial jub, does it mean that all children have been marked as serial jubil?

Thanks

No, the inheritance has not been inherited.

When you increase the class, it is possible to add such features that can not be sorted by nature, so the .NET framework can not assume that you have all the detail of the serializable base class too serialized is.

This is the reason why you must explicitly specify the [serializable] attribute on each category.


java - What technology stack to choose -


For the benchmark below, what a technology stack will be the best fit?

  1. Cross-platform (Linux / Windows).
  2. Ability to run as a service (daemon)
  3. Powerful Object-Oriented Data Access (O / R-Mapping)
  4. Multiple Database Support (MsSql, Oracle, MySQl, SqlLite, Postgress)
  5. Web application can be tested (unit and integration test).
  6. Appropriate
  7. Proper or free licensing (price of OS, database etc.)
  8. Very small Dev Team (1-5 people).
  9. The team's Windows / Net background.

I will easily choose .net as a platform with ASP.NET MVC / NHibernate. I am good at .NET and I have been doing it for about 3 years or so. So this is the easiest option for me.

But Mono has many issues running on ASP.NET. Mostly I found those people on the net But the people I know are:

  • Various versions of mono on different hosts
  • Different behaviors of some objects on different platforms (Idea has some time in his blog
  • Legal with MS

Let me especially Ruby Like a language, but it is also not certain that it satisfies the points 2, 3, 4 There is a need for many tricks for

For Java, I can not do this for some reason. Every time I have to write a set / set for a property, I come back to C #.

  • What language will be in the best position?
  • If there is no .NET.2 / 3 then I will go to Java.

    Can related techniques be useful?

  • The good news is that some excellent O / R mapping packages in Ruby ActiveRecord (which That is a part of the rail) Try O / R mapping in Ruby is far easier than Java - there you do not need code generation to complete a stable type system, to activate ActiveCracked function call. Uses method_missing .

    OK for database drivers - they are Ruby binding for the most major database.

    If you are interested in Ruby, Ruby on Rail will cover most of your needs (except to work with a team that is most familiar to Windows / .NET) you can also train on JRuby (Which is compiled in Ruby, JVM).


zipcode - How to get the city from a Canadian zip code? -


Do you have Canadian experience to get a city from a zip code?

Is there a free web service to get a city name by passing a Canadian zip code or can regular expressions be useful?

Any thoughts?

Thank you!

You may want to use to do this.


python - Looking for advice on how to develop applets for Gnome / Ubuntu -


I am a Linux (mostly Ubuntu) user with a proper understanding of how the system works (although I definitely do No from a Linux master!). In the past I have developed small cross-platform desktop applications in Python / GTK and I have distributed them to the clients as contained files traces, so that only dependencies are python and GTK.

Now, I want to develop a small applet for Ubuntu , that I would like to release under GPL 2 or 3.

Especially these new steps are I know I have to learn to achieve my goal (this is very possible there are some other Which is unknown to me, though!):

  • With integrated GNOME: I want to be available as an applet in my application workstation.
  • Using D-Bus: Specifically I want the OSD-notification framework for the new Ubuntu to my applet, but to communicate with other applets for other repetition There is also a potential feature.
  • Packaging: I would like to set up a public PPA application will reach the alpha stage, but I would also like to you

Of course the official The document will be my first source of knowledge, but - very useful answers based on my decision which I had received here - I decided to seek the additional advice such as the example:

  1. Based on your experience, will you advise me to learn those steps in advance (as the knowledge of those people will influence the way my core coding functionality) or do you have gnome / d Integration with -bus and packaging will consider the integration as "high encryption level", which can later be added to core functionality (note: D-Bus will only be used to push the data in the input Eta will be charged with a webservice)?
  2. Would you advise me to separate my package into two packages (back-end and front-end) or put together in one package?
  3. Do you know any useful source, can you advise me to learn anything?
  4. Are you aware of any common "beginning mistakes" I should know about this?

These questions do not have complete meaning, though: If you think that I am missing something from the general picture, then you are welcome to tell me in the right direction!

Thank you in advance for your time!

PS: Should I fail to explain my ultimate goal, but take a look: What I want to achieve is similar to the context of the user interface (which means: displaying the position of applet And should click on it to open the application, so you can configure the applet and perform various operations).

Well, you are on the list of pythons, so you pynotify . It wraps up DBS, and gives you a straightforward API to manipulate the OSD-notification system.

  & gt; & Gt; & Gt; Import Pineefact & gt; & Gt; & Gt; Pynotify.init ("Lil 'Applet") true & gt; & Gt; & Gt; Note = pynotify.Notification (... pynotify.get_app_name (), ... "Lill Applet wants you know something.", ... "/ usr / share / icons / human / 48x48 / status / dialog- Information.png ") & gt; & Gt; & Gt; Note. Shows () is true  

This shows a notification that looks like this:

  [] ** Lil 'applet ** [ ICON] [] Lil 'applet wants to know something about you  

asp.net - How to extract duplicate value in arraylist in c# -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 21 उत्तर

मेरे पास एक सरणी सूची है एक प्रकार की सूची है, लेकिन सभी मान दोहराए गए हैं।

विशेष रूप से, मेरी ब्लॉग यूआरएल मेरी सरणी सूची में दो बार है। मैं डुप्लिकेट कैसे निकाल सकता हूं?


jquery - Before and after callback -


I use great plugin

You have a plugin before and after a callback method How can you add that which is not it

Could not use start and sort order?


Facebook Connect Dialog Box doesn't close -


I am trying to use Facebook Connect on my website (which mostly uses ASP.NET). When the user clicks on the "Connect" button, opens the "connect url" in the app settings within the connect dialog, how can I open the target URL in the page with the "connect" button?

My button is:

  & lt; Fb: login-button size = "large" onlogin = "window.location.reload ();" & gt;  

Please check what I'm saying exactly (single page website)

Thank you.

In this way it works for me:

  Lt; Fb: login-button onlogin = "document.location.href = document .location.href;" & gt; & Lt; / Fb: Login button for & gt;  

If you delete the onlogin attribute, it also turns off (this is the default behavior). It seems that the code you got in the online feature is a subset of javascript, is it possible?

I wrote a Facebook Connect tutorial : -)


Is there any way to read out the "naturalWidth" of an image with jquery? -


I tried to do something like this:

  var height = $ (this). NaturalHeight;  

but it does not work

grease

$ this CSS ('height', 'auto'); Var height = $ this.height ();

php - When in optimization phase, would it be smart to pass all array by ref? -


In PHP, when we optimize the application phase (I'm talking about an app that is thousands of users) (Where does not matter to me what happens after they pass them to the function) will be smart to pass by the referee?

In PHP arrays, copy-on-written words mean that unless it has been modified Until then, new storage is not allocated for the new array. For example:

  $ a = array (1,2,3); $ B = $ A; // $ b digit $ 1 $ b [1] = 4 for memory locations; // $ B is copied and amended  

Passing through the reference can cause a difference if there are too many passes between different approaches and all these are localized Scope is constantly modified, however, it will change the words of the application, which means that this change is possible only if the arrays are not being modified.

This means that there is no use in passing the array as a reference. Do not do that.


regex - PHP Email Array Regular Expression -


ईमेल की एक सूची, बनाया गया:

  "प्रथमनाम अंतिम" & lt; ईमेल @ Address.com & gt ;, "न्यूफस्ट न्यूलास्ट" & lt; email2@address.com>  

मैं इसे केवल ईमेल पते की स्ट्रिंग सरणी में कैसे बना सकता हूं (मुझे नामों की आवश्यकता नहीं है)।

में आपका एक प्रयास हो सकता है अन्यथा आपको अपना खुद का पता पार्स बनाने चाहिए।


c# - Using Microsoft T4 to create data access classes -


I'm new to T4, but I've stumbled it and it looks very useful.

I am trying to generate some simple DA classes and a certain part of my code needs some advice.

How do I create a given code already, I have a table name and column name (in this case the table " Agreement " and the column " Agreement id < / Em> "," ContactId ", etc.)?

  if ((Ordinal_TableName_ColumnName1 == -1) || (ordinal_TableName_ColumnName2 == -1) || (ordinal_TableName_ColumnName3 == -1) || (ordinal_TableName_ColumnName4 == -1)) // Not interested in set {set Ordian (reader); } While (reader.HasRows ()) {returnCollection.Add (new unit (reader);}  

-1 is the default value and due to failure of the condition.

Audiences have fixed integer values ​​for the location only in some static DataReader results, they are set using the setordinals (Data Reader Reader) method.

Thanks Anthony

< P>

answer detected.

for (int i = 0; i & lt; table. Calculation; i ++) {written (string.format ("(ordinal_ {0} _ {1}. Z "), table .name, table.column [i] .name)); if (i> (table.Columns). Count - 1)) {WriteLine (" || ")}}}

thanks, ant


r - Assigning values from if-else blocks (how does it work?) -


I think you can assign a value with conditional an if-else block.

  y & lt; - if (condition) 1 else 2  

I realize that the use case for this is limited: If you have vectorised the code, you can ifelse instead Function is an executable gain: if-else in case of scalar on my machine 35x faster than ifelse (although you can call it millions of times to note it Need a difference).

It's annoying to me that I can not do this thing because this code works & mdash; I was surprised that it does not just make an error.

Another example shows if the block behaves like a function & mdash; They automatically return the last value in the block (although you can not use the return statement in them.)

  y  
  if (TRUE) sys.frames () #NULL  

Can anyone tell me what's going on hood, please?

me

Let me note that I Why can not work because this code works - I was surprised that it does not just make an error.

Why do you think so? What happens is that we have

  1. y assigning an expression
  2. if that expression is if () .. .
  3. Enter either TRUE or FALSE in trial
  4. one of the two branches is forwarded
  5. Evaluating the related code
  6. Its final value is known as the value on the right
  7. Assume the value I have been y

I think logical


.net - IL / CLR / DLR References? -


I want to know more about IL and CLR / DLR under the hood. A friend of mine has recommended the book "Inside Microsoft .Net IL Assembler", but when it came in 2002, I am afraid that at this point it is very old.

Can any other up-to-date books or websites be used by someone who understands the .NET language to learn more about the internal work of IL and CLR is? Maybe my answer is a bit late, but "MS Press - Inside Microsoft. Net IL Assembler" is really excellent. Remember: Frame 3.X only adds new sections and functionality The underlying technique is still the same, so the book still stands at least FW 3.5.

On behalf of ECMA, and some hard work, you have everything you need.


How to save data on excel xls file using perl? -


I am able to use the excel file using .csv in perl like this:

  print "content-type: application / vnd.ms-excel \ n"; Print "Content-Disposal: Attachment; filename = \" file name.xls \ "\ n \ n"; Print "Fruit, Cost";  

# Then looping on the results.

Still I need to save it as .xls because I want to use colors. Can anyone help you?

The library is written entirely in Perl, so you only need to upload the CPAN library on your web site Need and specify specific locations. You should start the Library document and the code snippet below.

  #! Use / usr / bin / perl -w hard; Use Lib qw (./ lib); #Downloaded Spreadsheet for Written Recovery Library :: WrittenExcel; # Print the header "content-type: app / vnd.ms-excel \ n"; Print "Content-Disclosure: Attachment; File Name = Rollchart.org.org.excel \ n \ n"; # Create a new workbook and create a worksheet in my $ workbook = spreadsheet :: WrittenExcel- & gt; Add new ("-"). My $ Worksheet = $ Workbook-> Add_worksheet ("colorful example"); # Text of red my $ format = $ workbook-> Add_format (); Create a new format with $ format & gt; Set_color ('red'); #Header $ worksheet- & gt; Type (0, 0, "fruit.", $ Format); $ Worksheet- & gt; Type (0, 1, "cost", $ format); # Add data $ worksheet- & gt; Type (1, 0, "apple"); $ Worksheet- & gt; Type (1, 1, "10.25"); # Close the workbook $ Workbook-> Close ();  

flex - Refresh GroupCollection of an AdvancedDatagrid - the sorted Arraycollection gets Randomized -


I have an advanced data grid which is populated by an array collection.

I ordered ArrayCollection according to the date (one of its properties), it shows from the past for the future. The thing is, if I refresh the collection collection (for immediate performance in the datagrid), after the order of ArrayCollection is sorted, the sequence of dates in ArrayCollection is again fried, but the population of the population displays immediately.

Then in the amount: From the array selection:> Sorting> Refresh Grouping Collection> AdWords populates the Data Grid, but the formulation is not sorted anymore.

Has anyone stumbled on such an obstacle first?

resolve:

  private function populateGrid () : Zero { 

gc.source = siteTrafficData; Gc.refresh ();

adv_dg.validateNow ();

Sort Sort: Sort = New Sort (); Sort.fields = [new ordering ("date")]; IHierarchicalCollectionView (adv_dg.dataProvider) .sort = sort; IHierarchicalCollectionView (adv_dg.dataProvider) .refresh (); }


javascript - Sails.js log transport depend on environment -


I have a Sails.js project that I want to add LogEntries support for event logging. However, I would like to use LogEntries only in some environments

For example, in development I do not want to fill the log with development garbage.

  // config / log.js var loginarios = Required ('le_node'); Var log = (sails.config.environment === 'development')? Sails.log: logentries.logger ({token: 'YOUR_TOKEN'}); Module.exports.log = {log: {custom: log}}  

But with this I get an error that sails is not defined because the That is not available in sails object configuration files like config / log.js . In this case how can custom log transportation be used on the basis of environment?

What appears to be the correct config / log.js file Was not modified but to modify the environment configuration file:

  // config / env / production.js var logentries = ('le_node'); Var log = logentries.logger ({token: 'YOUR_TOKEN'}); Modules.export.log = {log: {custom: log}}  

This way only custom logging will occur in the production environment.


Is there a way to write comments in modern Cobol? -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 4 जवाब

मैं भी देख रहा हूँ मैं अपने कोबोल कार्यक्रम में टिप्पणी कैसे जोड़ सकता हूं मुझे पता है कि कोबोल का आधुनिक संस्करण एक ऐसा तरीका है जहां टिप्पणियां लिखी जा सकती हैं लेकिन मुझे यह अनिश्चित है कि यह कैसे करना है।

  • * & gt; इनलाइन से-एंड- लाइन टिप्पणी, फिक्स्ड और फ्री फॉर्म (निश्चित रूप में * & gt; को कॉलम 7 या उससे अधिक होना होगा)।
  • * कॉलम में
  • * एक निश्चित फ़ॉर्म में, नि: शुल्क फॉर्म के लिए एक्सटेंशन, अनुशंसित नहीं है क्योंकि इससे अस्पष्ट कोड हो सकता है।
  • और कुछ पहचान विभाजन शीर्षक पैराग्राफ, उदाहरण के लिए यादृच्छिक में अनुमति दी गई है, अब अप्रचलित चिह्नित है, लेकिन अभी भी इसका उपयोग किया गया है।

स्मार्ट COBOL टिप्पणी अब ROBODoc में समर्थित है, नवीनतम संस्करण कोबोल के लिए बढ़ाया गया है


javascript - Get a method from the same object -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 2 जवाब
  var foo = {This.bar = function () {}, this.baz = new this.bar ()}  

यह काम नहीं करेगा मुझे foo.baz एक foo.baz होना चाहिए। मैं इसे कैसे करूं?

फू एक वस्तु है, एक उदाहरण नहीं, इसलिए आप नहीं कर सकते

  var foo = function () {this.bar = function ()) में "यह" कीवर्ड का प्रयोग करें (या सेमीिकलन, आदि।)  

) {}, This.baz = new this.bar ()} new foo ();

या:

  var foo = {बार: फ़ंक्शन () {}} foo.baz = new foo.bar ()  < / प्री> 

ffmpeg - PHP exec() and backslash \ -


मैं exec पर निम्न कमांड को चलाने की कोशिश कर रहा हूं:

  ffmpeg -y - मैं video.mp4 \ -ss 1067 -i video.mp4 -c copy -bsf: v h264_mp4toannexb -f mpegts -t 32 tmp / कटौती / 6.ts \ -ss 1215 -i video.mp4 -c copy -bsf: v यदि मैं इस कमांड की प्रतिलिपि बनाता हूं और उसे एक शेल पर चलाता है तो सब कुछ महान काम करता है, वीडियो काटा जाता है, सही है।       
  [NULL @ 052a0060] '\' के लिए एक उपयुक्त आउटपुट स्वरूप ढूंढने में असमर्थ  

: अमान्य तर्क

यहां तक ​​कि अगर मैं इस तरह से आदेश चिपकाएँ:

  & lt;? Php $ command = 'ffmpeg -y -i video.mp4 \ -ss 1067 -i video.mp4 -c copy -bsf: v h264_mp4toannexb -f mpegts -t 32 tmp / कटौती / 6.ts \ -ss 1215 -i video.mp4 -c copy -bsf: v h264_mp4toannexb -f mpegts -टी 32 टीएमपी / कटौती / 7 एस '; Echo $ command.chr (10); $ वापसी = 0; $ आउटपुट = एरे (); Exec ($ आदेश, $ आउटपुट, $ वापसी); ? & Gt;  

क्या मुझे कुछ याद आ रहा है? मैंने कोशिश की है, बैकस्लैश से बचने के लिए, और कुछ भी नहीं।

यह खिड़कियों और यूनिक्स दोनों में होता है, त्रुटियाँ बिल्कुल समान हैं।

क्या हो रहा है पर कोई भी विचार इस के साथ?

बैकस्लैश (\) शेल स्क्रिप्ट में, इस मामले में, केवल तो इसे लाइन ब्रेक () को अनदेखा कर दें

तो एक पंक्ति में बैकस्लैश के बिना कमांड चलाने की कोशिश करें:

  & lt;? Php $ command = 'ffmpeg -y -i video.mp4 -ss 1067 -i video.mp4 -c copy -bsf: v h264_mp4toannexb -f mpegts -t 32 tmp / कटौती / 6.ts -ss 1215 -i video.mp4 -c copy -bsf: v h264_mp4toannexb -f एमपीईजीटी -टी 32 टीएमपी / कटौती / 7 एस '; (...)? & Gt;  

timer - Run code every X seconds (Java) -


This is not necessarily important, I'm just curious to see what others think. I know it's useless, it's just for fun.

Now I know how to do this, it is quite easy. I am just trying to find a way to do this so that no new variable is required to crowd my class.

Here's how I will:

  Float Time Passed = 0f; Public Zero update () {timepassed + = deltatime; // DeltaTime is just a variable that represents the time passed from one update in seconds to another time (this is a float) if (timepace> = 5) {// code is every 5 seconds time Passed - = 5f; }}  

What do I want to know, if there is a way to do this, the variables passed without time I have a statetime variable (time since the start of the loop) What I use for other things which can be used for it.

If the goal is to actually run the code in every x seconds, then my first option is to use . Timer Another option is to use the Scheduled Exclaration Service, which adds two enhancements when you use it. Timer (better exception handling, for one).

I try to avoid swing. Timer, because I like to leave the EDT (event dispatch thread) uncluttered

Many people write a "sports loop" that is close to what you started. A search on "Game Rope" might depend on you, depending on whether you want to keep a steady rate or not.

Occasionally, in a situation where one does not want to constantly test and reset, one can add two functions through the use of an "end" operation, for example, if you and one integer For 63, you have to repeat through 0-63. It works well on those categories which have the power of 2.

Depending on the structure of your calling code, you can pass the parameter as "statetime" variable and this is your desired x If you do so, then I believe that the call code One step in "Reset" will reset to zero.

Another idea is "starttime" in the update method, after that, your timer will see the difference between current timemales and start-up to see if X seconds have passed or not. Then, the code that calls you, it should probably set a new "start-up" as part of the process. The good thing about this method is that there is no need to increase in the past.

As long as I churn the ideas: future can also create and test "target time" variables if currentTimeMillis () - target time> 0.

Starttime or target time can be irreversible, which depends on the use often, gives a little bit more.


javascript - How to edit the contents of a file on button click? PHP? -


number.txt :

  1  

index.php :

  & lt; php $ handle = file_get_contents ("number.txt"); ? & Gt; & Lt; फ़ॉर्म एक्शन = "" विधि = "पोस्ट" & gt; & Lt; बटन वर्ग = "क्लिक करें" & gt; & lt; / button & gt; & Lt; / प्रपत्र & gt;  

मैं इसे कैसे कैसे बनाऊँगा जब उपयोगकर्ता बटन पर क्लिक करेगा, तो फ़ाइल number.txt संपादित हो जाएगी, ताकि वह 1 से 2 में बदल जाए? और फिर 3, 4, 5 और इतने पर?

बटन पर क्लिक करने से एक की संख्या में वृद्धि होगी

मान लीजिए कि मैं बटन पर क्लिक करता हूं, अगर मैं Number.txt , अब मैं देखूंगा:

  2  

बस दोहराए जाने के लिए, नंबर नाम की एक फ़ाइल है Txt और उस फ़ाइल में सामग्री "1" (उद्धरणों के बिना) है। अब, index.php पृष्ठ पर, एक फ़ॉर्म जिसमें बटन होता है। एक बार जब आप बटन पर क्लिक करते हैं, तो numbers.txt फाइल को फिर से लिखा जाएगा ताकि उसका मान एक बार ऊपर जा सके (प्रत्येक बार बटन क्लिक किया जाए) - इस स्थिति में फ़ाइल number.txt में अब सामग्री "2" (उद्धरणों के बिना) होनी चाहिए।

मुझे पूरा यकीन है कि मैं यह कैसे करूँगा, इसलिए किसी भी मदद की सराहना की जाती है।

फाइल जमा करने और उसे संभालने के फॉर्म में देखें (या तो के माध्यम से fopen / fwrite / fclose या file_get_contents / file_put_contents के माध्यम से) यह आपके ऊपर वर्णित कार्यक्षमता है:

  & lt; h2 & gt; क्लिक करें & lt; / h2 & gt; & Lt; फ़ॉर्म एक्शन = "" विधि = "पोस्ट" & gt; & Lt; बटन नाम = "क्लिक करें" वर्ग = "क्लिक करें" & gt; मुझे क्लिक करें! & Lt; / button & gt; & Lt; / प्रपत्र & gt; & Lt;? Php if (isset ($ _ POST ['click'])) {$ filename = "number.txt"; $ Before_editing = file_get_contents ($ filename); "फाइल की सामग्री" गूंज $ फ़ाइल नाम "संपादन करने से पहले:"। $ Before_editing "& Lt; br & gt;"; File_put_contents ($ फाइलनाम, "2"); $ After_editing = file_get_contents ($ filename); "फाइल की सामग्री" गूंज $ फ़ाइल नाम "संपादन के बाद:" $ के बाद_एडिटिंग "& Lt; br & gt;"; }? & Gt;  

ध्यान दें कि एक बार जब आप इस स्क्रिप्ट को चलाते हैं, फाइल की सामग्री number.txt को "2" में फिर से लिखा जाता है। कुछ परिवर्तन देखने के लिए आपको मैन्युअल रूप से इसे संपादित करना होगा।


सवाल में परिवर्तन के आधार पर, यह कोड है जो बटन क्लिक किए जाने पर हर बार संख्या मान को बढ़ाता है: < / P>

  & lt; h2 & gt; क्लिक करें & lt; / h2 & gt; & Lt; फ़ॉर्म एक्शन = "" विधि = "पोस्ट" & gt; & Lt; बटन नाम = "क्लिक करें" वर्ग = "क्लिक करें" & gt; मुझे क्लिक करें! & Lt; / button & gt; & Lt; / प्रपत्र & gt; & Lt;? Php if (isset ($ _ POST ['click'])) {$ filename = "number.txt"; $ Content = file_get_contents ($ filename); Preg_match ("# \ d + #", $ सामग्री, $ before_editing); $ Number_before = $ before_editing [0]; गूंज "में नंबर" $ फ़ाइल नाम "क्लिक करने से पहले:"। $ संख्या_ पहले "& Lt; br & gt;"; File_put_contents ($ filename, ++ $ number_before); $ Content = file_get_contents ($ filename); Preg_match ("# \ d + #", $ सामग्री, $ after_editing); $ Number_after = $ after_editing [0]; गूंज "में नंबर" $ फ़ाइल नाम "क्लिक करने के बाद:"। $ Number_after "& Lt; br & gt;"; }? & Gt;  

dompdf - Running 'php load_font.php' fails: "No such file or directory" -


मैं चलाने की कोशिश कर रहा हूं:

php load_font.php मोंटेसेराट ./Montserrat-Bold.otf < / P>

(जैसा कि वर्णित है:)

लेकिन इसका परिणाम निम्न त्रुटि में होता है:

  चेतावनी: require_once (/ applications / MAMP / htdocs / project / Wp-content/themes/project/vendor/dompdf/dompdf/lib/php-font-lib/classes/Font.php): स्ट्रीम को खोलने में विफल: / अनुप्रयोग / MAMP / htdocs / project / अपेक्षित खोलने के लिए आवश्यक '/ अनुप्रयोग / MAMP / htdocs / project / wp-content / themes / project / wp-content / themes / project / vendor / dompdf / dompdf / dompdf_config.inc.php पंक्ति 332 पर गंभीर त्रुटि: require_once () Vendor / dompdf / dompdf / lib / php-font-lib / classes / font.php '(include_path ='।: / Applications / MAMP / bin / php / php5.5.14 / lib / php ') में / अनुप्रयोग / MAMP /  

क्यों

>

javascript - datatables ajax reload from new source -


How can I reload the dataset with the new AJAX functionality?

I think that space is a problem

  function Load_table (Talikanam, src) {var oTable = $ ( '#' + tableName) Kdetatebl ({ ' bProcessing ': true,' bServerSide ': true,' responsible ': true,' Saksakssoars ': Sarsiar,' Fansrhwardeta ': function (Ssosoars, Aoadata, Fan-callback) {$ .ajaks ({' data type '' Jason ',' Type ':' Post ',' URL ': OSOS,' Data ': Aadata,' Success': fnCallback});},}); }  

Try reloading it from a different data source:

  $ ("input [type =" button "]"). (Click on 'X', function () {oTable.ajax.url ( 'newsource') Klod (); alert ( 'Data source:' + oTable.ajax.url ());});   Warning output: src: newsource   

browser load table Source: oldsource

< Div class = "post-text" itemprop = "text">

The solution to any problem that I have in this problem in the future is:

Reloading the data from a different source to:

Detatebl object DOM table element not to view or you will receive a Riiniteelaijheshn error:

Step 1: clear data: < Pre> $ ('# your_table_name'). Datatale () clear ();

Step 2: Delete the DataTable object

  $ ('# your_table_name'). Datatale () Destroyed ();  

If you are using hair lines it is very important to click the listener from the

  $ ( "#your_table_name tbody"). Off ("click", "Td.details-control");  

Redirect datatables:

  loadTable ('newsource', 'your_table_name')  

and your loadTable function < ("B processing": True, 'Biswaruside': True, 'Responsive': True, "SDOM": '& lt;' toolbar "LFRATETET", "F"> R, SAGXSource ': Src,}); // Inchildro ()}


python - Error while comparing dates in different formats -


I get the following error when the codenippet is executing below, I created "DueDate" and "Date", what This is because both of them are in different time formats? How to convert to "Date Created" as "vs Date"

Error: -

 < Code> Type Error: - 'Text' and 'datetime.datetime'  

Code SNIPPET: -

  If ((none!): Unsupported operation type (s) = DueDate) and (DueDate - CreatedDate) .days & lt; 1)):  

Sample Input: -

  Due Date 2/6/2015 Created Date 2015 -02-03 20: 15: 47.950000  

You need to change your date The string for the datetime object. There is no underlying conversion in the string from the datetime object. You can try something like the following.

  Import date time = "3/17/2015" # I used place instead of now to create your datetime object Gone Datetime_object = datetime.datetime.now () due_date = datetime.datetime.strptime (date, "% m /% d /% Y") If set_data! = None and (datetime_object - due_date). Day & lt; 1: print ("clever messaging")  

edit

Thanks for comment by @JFSBeeton I time.strptime . See the comments below for details.


gwt super dev mode - GWT Superdevmode interposing code server for CSS files -


I am trying to go from classic to super dev mode and see a problem later. The problem is two times. First of all, it is trying to use the code server to give CSS files on the web page. As a result, there is a line of element in the web page:

  & lt; Link rel = "stylesheet" href = "http://127.0.0.1:9876/tdome/../source/standard.css">  

You can see that this code is piping the reference through the server, which is running on port 9876. Now, this will not be a big deal, but it will not be. In the resulting page the styles of that file are missing directly on the code server. This URL: ... gives "server error" Eclipse is a null pointer throwing exception. It seems that jealousy / tdome trees are not in the file with just the existing files Recreating and peeping around the names of the names, Eclipse sometimes says that it is ignoring the request. Sometimes it says that the file does not exist, and sometimes (when it really matters, like here), it gives the tap pointer a reception. Web server.Java 2007, on the fly, so I need to leave Supddwom to leave these references alone, or to get the service for the file. any idea? Many thanks -

Well, I did not really find any way to serve Super Dev mode. Where are they But I came to know where they are, where they are. Perhaps others have general knowledge: Make a 'public' directory next to 'your-project.gwt.xml' file and keep them there. The references about them are in that XML file and no qualification is required - just file name is not a directory path, Super Dev mode will package them, serve them, and let you run on them.


javascript - XMLHttpRequest calls do not include If-Modified-Since header -


I have a simple caching mechanism on the server, which sets the recommended last-modified header And this also responds to the if-modified-to- header is a sample of the response headings:

  Date: Tuesday, March 17, 2015 20:40:14 GMT Last modified: Mon, 16 Mar 2015 09:47:28 GMT  

Once navigated to the page, is included in the browser and if-modified-from < / Code> Aniro Header and broke correctly with 304 status response.

However, when I request using jQuery (and this behavior remains for a simple XMLHttpRequest) if-modified-from header is not sent.

Simple code to reproduce it:

  var xhr = new XMLHttpRequest (); Xhr.open ("get", "http: //localhost/some/page.html", true); Xhr.send ();  

Such code always generates 200 responses, even if it was previously cached. I've seen it in Firefox 36 and Chromium 41.

Why is not header included in calls generated from XMLHttpRequest?

It seems that this was a user error because I can not reproduce it.


jQuery slide panel back up -


I have a panel that has a responsive carousel, so I need to preserve the container height which means that I I can not use it

  display: none  

so I have protected the height and it is looking at the position from the top , When the user slides a button

I need to allow the user to click on the button again and slide it.

What do I have here:

  $ (('' '' '' '' '' '' '' '' ',');});  

It slides down the panel. I added a class by thinking that I can target the button again and slide it up but it is not working.

Thanks for any help.

You should include a switch to check that your Carousell is already open, you Can slide it again See him in this Bela

  $ ('a.mycourses'). ('Click', function () (if ($ (this) .hasClass ('open')) {$ ('' top ':' -100 '), 1000); $ (this) .removeClass ( 'Open');} and {$ ('#cortacart'). Animate ({'Top': '0'}, 1000); $ (this) .addClass ('Open');}});  

mysql - Difficulty with unusual many to many select query -


I have just started learning MySQL, I'm researching it for a few hours, unfortunately I can not find the solution I suspect it is very easy, I do not know how to do it. I have not found any such situation here or on other sites.

Here are some example data

  Computer + ---------------- - + id computer | Name 1 Compie 00 2 | Komp002 computer_has_software + --------------------------------------- + Computer_ID computer | Software_itware1 | 1 1 | 2 Software + ------------------ + idsoftware | Name 1 Notepad 2 | Eclipse 3 | Firefox 4 | Google chrome  

As you can see, both Notepad and Eclipse are installed in komp001 .

I want a query that will tell me whether the software is available but not installed on komp001 i.e. komp001 not all software

I hope to get answers from Firefox and Google Chrome.

Software + ------------------------ + idsoftware | Name 3 Firefox 4 | Google Chrome

  SELECTs * As a software from SEFT (Select * Computer_Hess_Worwerware with WHERE computer_idcomputer = 1) as CSDSOSware = ChesesoftwareAdware as WHSER CHSsoftware_idsoftware NULL  

java - Change constructor template in Eclipse so it calls setter(s) -


For a sample rectangle class, the creator automatically generated in Eclipse using code templates,

  public rectangle (double width, double side) {this.width = width; This.height = Height; }  

However, the setter is designed to handle, I should like it (without changing myself)

  the public rectangle (double Width, double side) {set width (width); SetHeight (height); }  

Appreciate any help!

An anti-pattern calling agent is an ovevrridable method and this is why eclipse does not support it is. Due to being a superclass constructor, the subclass moves in front of the constructor, so before executing the sub-class constructor, the overwritten method will be applied in subclass. If the overriding method relies on an initialization performed by a sub-class constructor, then the method does not behave as expected.


python - Repeat x-axis values using myplotlib -


I have data below and I want to plot the graph by repeating the x-axis.

  | 30 | | 0.650297475 | | 40 | | 0.657665519 | | 50 | | 0.669169 975 | | 60 | | 0.69 5916956 | | 50 | | 0.6802548 94. | 40 | | 0.663912144 | | 30 | | 0.653692469 | | 20 | | 0.644423894 | | 10 | | 0.637784575 | | 0 | | 0.626213656 | | 10 | | 0.63776 963 9. | 20 | | 0.643006988 | | 30 | | 0.646742206 | | 50 | | 0.668539731 | | 60 | | 0.6 949 59 9 31. | 50 | | 0.679511669 | | 40 | | 0.6633013 | | 30 | | 0.653026313 | | 20 | | 0.644 97036 9. | 10 | | 0.63772 925. | 0 | | 0.6264 9 4163 | | 20 | | 0.643006456 | | 30 | | 0.646692806 | | 40 | | 0.656562469 | | 50 | | 0.668683988 | | 60 | | 0.69528 9 806 | | 50 | | 0.680420325 | | 40 | | 0.663145675 | | 30 | | 0.654077156 | I am trying to plot it by using myplotlib  
  x = class (lan (x_axis)) fig = plt.figure () Ax = plt.gca () Ax.ticklabel_format (useOffset = False) ax.set_xticks (x_axis, minor = true) CH1 = ax.plot (x, y_axis) ax.legend ([parameter]) #, bbox_to_anchor = (1.05, 1), loc = 2, bordersasseds = 0 fig. ("Plotfile_get_vendor_version_here" + ".png") plt.close (fig)  

but the x-axis value ends at 30. I understand that due to this range function can I fix it in some way. I would be really useful for support.

Regards, Wind

You need ax.set_xticks () and the portions printed in the ax.set_xticklabels (to) to:

  NMP imports as imports Matplotlib.pyplot plt # as the data: x_axis = np.array ([30., 40., 50., 60., 50., 40, 30., 20., 10., 0., 10., 20 ., 30., 50., 60., 50., 40., 30., 20., 10., 0., 20., 30., 40., 50., 60., 50., 40., 30.] y_axis = np.array ([0.65029748, 0.65766552, 0.66916997, 0.69591696, 0.65369247, 0.64442389, 0.63778457, 0.62621366, 0.63776906, 0.6430069 9, 0.64674221, 0.66853973, 0.69495993, 0.67951167, 0.6633013, 0.65752631, 0.64497037, 0.6 3772925, 0.6264 9416, 0.64300646, 0.64669281, 0.65656247, 0.66868399, 0.69528981, 0.68042033, 0.66314567, 0.65407716] x = range (LAN (x_axis)) figs, X = Plt.subplots (1, 1) ax.set_xticks (x) # Set Tick Status # Labels are created as integers: ax.set_xticklabels (["{: d}". Format (int (v))] in x_axis to v) Ax.plot (x, y_axis) fig.canvas.draw () # actually figure Enter draw plt.show () # GUI loop N-interactive interpreters) < / Code> 

Alternatively you can try to do something like


java - issue testing async web service in SoapUI -


I am running a multi-threaded load test using the simplified open source version. I am testing an asynchronous web-service, I send a request for service through sopi, these requests are queued for execution later, and the web service later sends a notification response

< P> I am using a MockService to capture these notification responses. I now need to map each response back to the request, so that the soap u was originally sent so that latency can be tracked by the reply of the request. To do this, I was going to define a concurrent HashMap The test phase that sends the request will update hashmap with the request ID and the current time. When my MockService receives a notification response, then that hashp is used to get the start time of that request ID.

There is a problem facing me that I have to declare Hasmap in a circle where all threads use the same Hashp and MockService is also used.

If I declare my Hampshire in a Groovy testing phase, then each stage when the test phase executes, its own copy will be made, which is what I do not want to do.

My question is, is there a way to declare my hammerspace in a "global" radius in Sopuri so that all the test threads (and my Mokservivis) can access the same Hashup Exam?

I tried to declare it in TestSuite's setup script and add it in the TestSuite context, but that does not work.

Can anyone help with this?


java - Spring boot WAR size with different embedded servers -


I am experimenting with spring boot and I realized that when I use the embedded tomcat server the resulting size is smaller when I use JetE or even the rest of the server Keep even with dependencies down.

How is this possible? ... It is believed that the Undertro and Jetties should be ultralight compared to Tomcat.

The size is:

Tomato ~ 18 MB

Bottom ~ 21 MB

JT ~ 24 MB

None of these looks very big for me because this dummy is the other endpoint. These are my dependencies:

  & lt; Dependency & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-web & lt; / ArtifactId> & Lt; Exclusions & gt; & Lt; Exclusion & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-badge & lt; / ArtifactId> & Lt; / Exclusion & gt; & Lt; / Exclusions & gt; & Lt; / Dependencies & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-jersey & lt; / ArtifactId> & Lt; / Dependencies & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-promoter & lt; / ArtifactId> & Lt; / Dependencies & gt; & Lt ;! - & lt; Dependency & gt; - & gt; & Lt ;! - & lt; GroupId> Org.springframework.boot & lt; / GroupId> - & gt; & Lt ;! - & lt; ArtifactId & gt; Spring-boot-starter-tomcat & lt; / ArtifactId> - & gt; & Lt ;! - & lt; / Dependencies & gt; - & gt; & Lt ;! - & lt; Dependency & gt; - & gt; & Lt ;! - & lt; GroupId> Org.springframework.boot & lt; / GroupId> - & gt; & Lt ;! - & lt; ArtifactId & gt; Spring-boot-starter-bandwidth & lt; / ArtifactId> - & gt; & Lt ;! - & lt; / Dependencies & gt; - & gt; & Lt; Dependency & gt; & Lt; Group & gt; Org.springframework.boot & lt; / Group & gt; & Lt; ArtifactId & gt; Spring-boot starter-jet & lt; / ArtifactId> & Lt; / Dependencies & gt; & Lt ;! - & lt; Dependency & gt; - & gt; & Lt ;! - & lt; GroupId> Org.springframework.boot & lt; / GroupId> - & gt; & Lt ;! - & lt; ArtifactId & gt; Spring-boot-starter-test & lt; / ArtifactId> - & gt; & Lt ;! - & lt; Scope & gt; Test & lt; / Scope & gt; - & gt; & Lt ;! - & lt; / Dependencies & gt; - & gt; & Lt; / Dependencies & gt; Spring boot includes three sample applications,  spring-boot-sample-JT ,  spring-boot-sample-Tomket , and  spring-boot-sample-Auda , at least, and very similar, with functionality. With the Spring Boot 1.2.2.RELEASE, the archives are: 

  • spring-boot-sample-jt - 12MB
  • Spring-boot-sample-tomcat - 9.8MB
  • spring-boot-sample-flow - 9.6 MB

As you can see Tomcat and Undertave are very similar and JT Artifact is ~ 20% bigger.

The size of the gap is a significant cause JSP support does not support JSP and Spring boot is not included in JSP support Tomkat default ~ Jetty-based collection of 1.7 MB Akselis by Java compiler Used for JSP compilation. If you are not using you want to use the jetty and JSPs, you can exclude org.eclipse.jetty: jetty-jsp dependency. This reduces the size of jetty-based artifact to 8.8 MB.