Tuesday, 15 May 2012

reverse engineering - How do libraries such as discutils/to interact with .PSD files work? -


I see a lot of projects, including some degree reverse engineering (some things I know very little). For example, there was an API to interact with .psd files (remove layers, add layers, add masking, etc.) on codeproject and also has a Desudit Library for C #, which interacts with ISO files. (Not sure the library's featuretakers are exactly).

I know that these types of applications need to be reverse engineering, but how can I get more information about such programs (code is open source and I will see it, but How do I have some guides to make such programs)? Obviously this is more than just putting the C # methods together.

Thanks

Partial support for the management of GIMP PSD files on their implementation Take a look and start from there.


boost - C++ swap problem in inheritance scenario -


I want to add swap functionality to two existing C ++ classes. One class gets from the other. I want the examples of each class to be swapable with examples of only one class. To make this semi-concrete, say that I have the classes Fu and Bar are received from the bar fu. I define Fu :: Swap (Foo End) and Bar :: swap (bar end). Time :: Swap Delegate Fu :: Swap I want Foo :: Swap to work only on Fu instances and work Bar: swap only on bar instances: I can not understand the method of implementing this requirement.

Here's a sample of what is giving me trouble:

  Include # lt; Algorithm & gt; # Include & lt; Iostream & gt; Structure fu {int x; Foo (int x): x (x) {}; Virtual Zero Swap (Foo and others) {std :: cout & lt; & Lt; __PRETTY_FUNCTION__ & lt; & Lt; Std :: endl; Std :: swap (this->; x, other.x); }; }; Structure bar: Public fu {int y; Bar (int x, int y): fu (x), y (y) {}; Virtual Zero Swap (bar and others) {std :: cout & lt; & Lt; __PRETTY_FUNCTION__ & lt; & Lt; ""; Fu :: swap (other); Std :: swap (this-> y, other.y); }; }; Zero display (Foo and F1, Foo and F2, Bar and B 34, Bar and B 56) {Namespace Stead. Cout & lt; & Lt; "F1:" & lt; & Lt; F1.x & lt; & Lt; Endl; Cout & lt; & Lt; "F2:" & lt; & Lt; F2.x & lt; & Lt; Endl; Cout & lt; & Lt; "B 34:" & lt; & Lt; B34.x & lt; & Lt; "" & Lt; & Lt; B34.y & lt; & Lt; Endl; Cout & lt; & Lt; "B 56:" & lt; & Lt; B56.x & lt; & Lt; "" & Lt; & Lt; B56.y & lt; & Lt; Endl; } Ent Main (Int arzak, four ** argv) {{FU F1 (1), F2 (2); Bar B34 (3,4), B 56 (5,6); Std :: cout & lt; & Lt; Std :: endl & lt; & Lt; "Initial value:" & lt; & Lt; Std :: endl; Performance (F1, F2, B34, B56); } {FU F1 (1), F2 (2); Bar B34 (3,4), B 56 (5,6); Std :: cout & lt; & Lt; Std :: endl & lt; & Lt; "After identical swap:" & lt; & Lt; Std :: endl; F1.swap (F2); // desired b34.swap (b56); // desired display (F1, F2, B34, B56); } {FU F1 (1), F2 (2); Bar B34 (3,4), B 56 (5,6); Std :: cout & lt; & Lt; Std :: endl & lt; & Lt; "Odd Members After Swap:" & lt; & Lt; Std :: endl; // b56.swap (f2); // Not compiled, excellent f1.swap (b34); // Do not compile it, but make sure how the display (f1, f2, b34, b56); } Return 0; }  

Here is the output:

  Initial value: f1: 1 f2: 2 b34: 3 4 b56: 5 6 after uniform swap: virtual zero Foo :: Swap (Foo & amp;) Virtual Void Bar :: Swap (Bar & amp;) Virtual Zero Foo: Swap (FU) F1: 2F2: 1B 34: 5 6B 56: 3 4 Odd Members swap after: Virtual Zero Foo:: Swap (Foo and F) F1: 3F2: 2B 34: 1 4B 56: 5 6  

You can see where f1.swap (b34) "sliced" b 34 leads me to a potentially bad way Do not like it, either compiled or not blown at runtime. Due to participating heritage, I feel that if I use a non-member or friend swap implementation, then I would go to the same problem.

It is helpful but the code is available.

This usage case arises because Multi_array meets mult_array_ref, it only makes sense to swap multi_array_refs with multi-functional and multidimensional.

(some laughing solutions)

Add a protected virtual method, isBaseFoo () , Make it right in fu, and false in the bar, the swap method for foo can check that its argument is BaseFoo () == true.

Evil, and only detects the problem at the time, but I can not think of anything better, though Charles Bailey's answer may be better, if you allow dynamic_cast then <


iphone - touchtouchEnded is not getting called after touchesBegan and touchMoved -


I have a strange effect with touch Sometimes when I swipe the screen slowly, touch and Touch is touched, but it is called touch, which slightly screw up my visual movements. How is it possible that touch-ended calls are not made? And leaves the screen without running my finger or anything like this !! Any tips or suggestions to understand this behavior? I really need touch to clear my attitude.

Thank you for any advice

I suspect you < Code> was tampered with: Together: without whom touched cases have been added: Together: is being invoked Have you applied that method ?


mobile - Can anyone guess what protocol these packets belong to? -


We see that these packets should be injected into FTP-DTP channels during a downlink file transfer over Telstra's NXTG mobile network. Used to be. We are not sure whether these are network-level packets, like injecting our 3G modem (HC25 based) or something like a firewall stream.

Using a tool we saw that the preparation of PPP fails with protocol length errors, so they most likely have the possibility of mobile network packets.

I hope someone will have to identify the signature of the packet so that I can pursue it with the appropriate vendor.

There is definitely one format for these packets: -

Packet 1: 00 00 00 24C4B8 7B1A0907F 43 0f a1 08 00 45 00 01 10 F 4 4 00 00 40 06 2 F13 CB 7 A 9 DE 9 7 BD DD 71 7 7 A ADE 04 06 8 C 61 5 A A 9 01 F 7 0 CEB 50 10 FF FF 58 B900 00

Packet 2: 00 00 00 24C4B8 7B1A00907F 43 0 FA1 08 00 45 00 00 FF 6B 50 00 00 40 06 B 8 22 CB 7 A 9 DE 9 7 BD DD 71 7 7A Aad 04 06 8 C 61 7 B 82 01 F 7 C EB 50 10 FF FF A3 79 00 00

Packet 3: 00 00 00 24c4b8 7b1a01 90 7f 43ff 0f 080045 00 02 205b 50 00 00 40 06 C7 01 CB7A 9DE 9 7BDD 71 527A Ed 04 068C61 7C 59 01F7CEB 50 10FF FF E250D 00 00

< P> Packet 4: 00 00 00 24c4b8 7b1a00 90f 43ff0a1 08 00 45 00 01 38d8 52 00 00 40 06 4a7 cb 7a 9d E 9 7BD 71 527A AAD 04 068C 62 42F 9 01F7 0 CEB 50 10FF FF 20 91 00 00 Packet 5: 00 00 00 24C4B8 7 B1A 00 90 7F 43 FE 08 08 45 45 00 00 D08 00 00 40 06 D6 49 CB 7 A 9 DE 9 7 BD DD 71 7 7 7 EE 04 08 4b FB 0 B8F350D51 1A 50 10FF FF E988 00 00

< P> These are common Eepi look like packets but the front was tagged with two additional 00 bytes. It is not certain why this will happen, but they appear from 00-90-7f-43-0f-a1 (watchguard) to 00-24-C4-B8-7B-1A (Cisco).

IP header 45 00 01 10F 4 4 00 00 40 06 2F13 CB7A9DE 9 7BD052 52

TCP header 7A Ed 04 06 8C 61 5D A 9 01 F7 is 0c EB 50 10FF FF 58B 9 00 00

so you can get the remaining details from there.


networking - How can I re-establish a network connection in a Perl script? -


I have a Perl code that goes to a particular website and removes the required data if I lose my connection. I have a problem: the script stops working. How can I resume the Perl script connection and start the process from where it is paused? Can I use Pearl to resume the connection if such a person can guide me with steps.

It is not possible to do a transport-level network (such as TCP / IP) Afterwards you can not get it back And the HTTP protocol does not provide a high level way of doing this.

You have to open a new HTTP connection on the server and restart your withdrawal. Whether you have to restart from the beginning, or from where the relationship was broken when you can resume close to the time of what you are bringing, how the website presents, and the client-side tool Are using to


OSGi unit testing without step that packages bundles -


A bundle related to jar up and bundle is needed. I hope this works without intermediate steps.

Imagine the ability to pack packages on your classpace so that the package can create X and Y bundle XY and make Package X and Jade Bundle Xs. The bundle XZ package will not be able to see "Y" but package X can import one service from XY. Any comments if this is possible or if a similar examination case / library exists?

I think that using the Tiny PACS bundle with OPS 4J is looking for you .


c# - Is there any way to profile .NET Framework? -


We have a complex client-server application that was developed using the .NET Framework and uses SQL Server 2005 is. We use LinqToSql but we manage the life time of all connections and we pass an open connection from any datacontent that has been created. We have also used Microsoft WF in this product.

When the server works about one or two, then we end up with some "reclaimed connection", which means that we have some SQL connections We are using all of the code and we have reviewed all the code and have used the potential means to ensure that we are closing any other connections which we are making May include. It seems almost impossible to be open for connections because there are few places where we use them.

Is there a way to find out that SqlConnection.Open () or SqlConnection.Close () . We need to know where these methods go and who was the caller (maybe it's a call stack.)

thanks

You can use or add to Visual Studio.


combobox - WPF Devexpress ComboBoxEdit Items -


I am using the DevelopX combobox addit ingredient in my WPF app. I assign values ​​for this:

  Private zero users1_Load () {DataTable dtCat = SqlHelper.GetTable ("base_UserCategory_Select", new string [] {}); Datarov Dr. = DTcit. NewRow (); Dr. ["UserCategoryID"] = 0; Dr. ["Category"] = "& lt; All & gt;"; Dr. ["issystem"] = "wrong"; DtCat.Rows.InsertAt (Dr., 0); ComboBoxEdit1.ItemsSource = dtCat.DefaultView; ComboBoxEdit1.SelectedIndex = 1; }  

My xaml:

  & lt; Dxe: combo box edit height = "20" margin = "14,64,0,0" name = "comboBoxEdit1" DisplayMember = "CategoryName" ValueMember = "UserCategoryID" vertical alignment = "top" XMLN: DXE = "http: // Schemas.devexpress.com/winfx/2008/xaml/editors "horizontal alignment =" left "width =" 254 "/>  

But the problem is that in this blanket I look at my ID (value members), when I expand it, I see the display value. What is the problem, how to do all the places, see text value, not my id ..?

Add ComboBoxEdit to your xaml

  IsTextEditable = "False " 

This is a known problem with control, I use DX controls, and personally I think that their silverlight and WPF control are quite long behind the rest of the markets. (His Silverlight control is still a beta, arguably when there is a bug in the combobox edit, then the WPF control Micro beta should also be considered). You may want to be in MS control until DX fixes your nonsense.


c++ - What do you think about mapmalloc? -


I found a memory profile:

It should be light and fast. Can anyone share any experience with it?

Why do not you use it? It should have similar functionality and it is maintained.


How to undo "Create directory for solution" in Visual Studio -


I have a C # project that is wrapped in a solution. When I created this project, To make a directory "checked-box incorrectly marked. I now in the same folder as the project. I would like to move the SLN file. The problem is, if I move it (and change the project path along with a text editor) I get all kinds of errors when I open the solution I try to create a new solution and "try to add an existing project Done ", but this causes similar errors.

Any suggestions on how to manage this situation?

Thank you!

On the solution node of the Explorer panel pane, select 'Top menu -> File -> Save Solan as you like. '. Save the solution file as your project in the same folder (assuming what you want).

Move everything to the project folder outside the Solutions folder.

First worked for me, but if you have coded some complete path in your code or referenced assemblies / projects, then you may need to fix them after you open the VS in the solution.

PS: Before trying before backup: P


java - convert a recursive structure to xml with jsp -


मान लें कि मेरे पास रिकर्सिव डेटा संरचना है

  class tree {निजी ट्री सही; निजी पेड़ छोड़ दिया; निजी इंट डेटा; ....}  

मैं इसे jsp के साथ एक्सएमएल में परिवर्तित करना चाहता हूं, इसलिए मेरा यूआई पेड़ विजेट अजाक्स के साथ एक्सएमएल पृष्ठ को लोड कर सकता है और एक पेड़ का निर्माण कर सकता है (विस्तार योग्य / दुर्गम नोड्स आदि) )।

XML इस तरह से कुछ दिखाई देगा:

  & lt; पेड़ & gt; & LT; पेड़ & gt; & Lt; डेटा मान = "5" / & gt; & Lt; / पेड़ & lt; वृक्ष & gt; & Lt; डेटा मान = "1" / & gt; & LT; पेड़ & gt; & Lt; डेटा मान = "5" / & gt; & Lt; / पेड़ & lt; वृक्ष & gt; & Lt; डेटा मान = "1" / & gt; & Lt; / पेड़ & gt; & Lt; / पेड़ & gt; & Lt; / पेड़ & gt;  

क्या ऐसी पुनरावर्ती संरचना जेस्प से उत्पन्न हो सकती है? कैसे करें?

इसे आज़माएं:

  वर्ग ट्री {ट्री सही; पेड़ छोड़ दिया; इंट डेटा; सार्वजनिक स्ट्रिंग toXmlString () {स्ट्रिंगबइल्डर s = नया स्ट्रिंगबिल्डर (); s.append ( "& LT; पेड़ & gt;"); S.append ("& lt; डेटा मान = \" "+ डेटा +" \ "/ & gt;"); अगर (सही! = नल) s.append (right.toXmlString ()); अगर (बाएं! = नल) s.append (left.toXmlString ()); s.append ( "& lt; / पेड़ & gt;"); वापसी s.toString (); }}  

कुछ उपयोग:

  ट्री टी = नया वृक्ष (); // पेड़ को मूल्य भरें .... स्ट्रिंग xml = t.toXmlString ();  

video - IPhone, MPMoviePlayerController how to disable zooming when double tap on the screen? -


How can I disable the weird double tap behavior while playing a movie using MPMoviePlayerController.

Double tap creates some of my gestures in the overlay scene to stop working on the zoom / unzomed and double tap area of ​​the movie.

I just had one problem:

  self.moviePlayerViewController .view.userInteractionEnabled = NO;  

eclipse - Opening an existing Java project -


Can someone help me open the existing Java project using Eclipse or Netbeans? This is a specific project on SourceForge.

All I have to do is to do just this project to run. But, this seems like a challenge at this time because I'm totally new to Java (I'm a C # net developer).

  • Download .jar from sourceforge, save it from anywhere on your PC.
  • Open Eclipse.
  • You need the "Package Explorer" window
  • Right click, New -> Project, and select "Java Project"
  • Click Next
  • Give your project a name, basically anything can be done, although the naming criteria are
  • You now have a new project called MyProject in the Package Explorer window.
  • Now import the jar into your project:
  • Create a folder in your project that you will place a jar in "MyProject", right-click on New -> Folder and give it a name Give "x-jars"
  • This folder will be created under MyProject, it's a real (system) folder, and you want to copy your jar into this folder. This folder will be located on your file system, which is ~ eclipsy-workspace / microprocesses / x-jars /
  • When copying to the X-Jars folder, select my project in the back and refresh Press F5. Jar will now appear under your X-Jar folder (you can extend a folder contents by clicking on small triangles)
  • You now really want to use your jar:
  • Right-click on "src" under MyProject (src is where you place all your Java classes) -> Package, and give each standard conference a name like: com.mydomain.smpp and click Finish Please.
  • Right click on the package as a result and click on New -> Class, and give it a name, like MyTest, and click Finish.
  • You will now have a java class skeleton in your main eclipse editor. This class package com. Madoman lives in SMPP. All sections should be in the package.
  • Finally you need to make sure that the x-jars folder is included in your build (compilation) path. Right click on MyProject, click Build Path -> Build Path, click "Add JARS" on the Library tab, and select the X-Jars folder in MyProject.
  • And so is it. I can not help installing a test SMPP app / class because no document or published API is visible, but to use the jar, you have to do this.

.net - Where is System.ServiceModel.Web.dll? -


I am developing a Windows service that exposes a WCF service that can be used by the Silverlight application , As mentioned in this blog post:

The problem I am facing is that I have to use it, which is in the System.ServiceModel.Web.dll assembly It is defined, but when I try to add a reference to that assembly in the project A (add reference to Visual Studio - using the .NET tab), no assembly with that name.

So, I am doing something wrong, this is not part of the assembly. NET Framework, or is it a bug in Visual Studio? The way I am using the VS2010 beta 2 and project targets. NET Framework 4

Are you targeting .NET4 full or customer profiles? Later system Service delivery The web assembly is not included.


c# - Reflection-effect on tag other than img clientside -


I need to reflect a dynamically generated box containing an image, in addition to some text on the background, all the sequential With fade and beauty.

I got the jQuery plugin to reflect images as I want, but there is no way to give the same treatment to the common elements.

First of all, you need to create a box, take a snapshot of that area, and then flip it to server server; Thus, a unique background image is being prepared for each box.

Since I've only snatched the depth of the system. Drawing (which I think contains the necessary equipment), and do not think I will need it in the near future,
I think if this client is able to handle it, will it be more?


Get stored procedure parameters' type -


I need to read the parameter type of procedures stored in the Firebird database.

I am capable if they are input or output parameters, then read their names, but where can I get their type? Or how do you solve it?

You must use a combination of RDB $ PROCEDURE_PARAMETERS and RDB $ FIELDS view, as shown below:

  select rdb $ process_name, rdb $ process_parameters.rdb $ parameter_name, rdb $ fields.rdb $ fields_name, rdb $ Fields.rdb $ rdb from $ function_type_immeter, rdb $ fields WHERE rdb $ fields.rdb $ field_name = rdb $ process_parameters.rdb $ field_source  

Field type value in RDB is $ FIELDS as follows Defined:

 BLOB - 261 CHAR - 14 Seating - 40 d_flot - 11 double - 27flow T - 10 INNT 64 - 16 Integer - 8 Quad - 9 Smalling - 7 Date - 12 Time - 13 TIMESTAMP - 35 VARCHAR - 37 

For more information about these types of definitions, see Interface language reference .


networking - Is transactions over machine boundary (via tcp-ip) possible? -


Theoretically, a protocol can define where a machine has some remote calls on another machine (or more than one) , And where in any part of the process, if any of the machines (or operations) fail, or the communication drops, everything has rolled back? (As soon as the database can be done)

I say at the hardware level, because always it says that no nuclear processor operation (without testing and setting) is a nuclear operation (a very important component of the transaction) Can create)

But from now on we are talking about many machines, it is not flying.

For example how difficult it would be to say: I have a protocol to issue an order on a remote machine, and a reaction is returned. It is possible that the method is called, but during the transit of the reaction, the connection dies. It can also be very well that the machine that performs the operation, thinks that everything was fine, but the receiving machine has never received the answer.

Adding AEC does not help, transit

Interested in reading the thoughts of others (and to know that 27 years ago some professors had already come up with a solid concrete solution).

R

Yes, this problem already exists (more or less) Has been done :)

What you are searching for is that you are searching.

In transaction processing, database and computer networking, the two-step committed protocol (2 pcs) is a type of nuclear commitment protocol. It is a distributed algorithm that coordinates all processes that do not participate in distributed nuclear transactions, transactions (roll back) system failures (either process, network node, communication, etc. failure) In many cases of incorporation, the protocol achieves its goal, and thus it is widely used.


objective c - Questions About The Foundation And NS Library -


I am an objective learner and I do not have a Mac, so let me get my Linux GNUSTIP, but if I If the program develops, then the end user will need to install GNUStep (eg .net) and then I thought how I could solve it, then I had an idea: "Make it from scratch!" , But to do this now I need to know what are the most important things in the NS and Foundation headers? Thank you.

Nonop makes an excellent point: the foundation is a very complex and well-tested structure; Somewhere on the lines of 10 or 15 years (someone would have to hit me with the exact date of the initial days).

Perhaps the most important part of the foundation structure is NSObject . One type of single root class that is derived from all the objects is one of the biggest powers of the phase.

Applying your own Obj-C root class should be an interesting exercise.

Edit: If I do not mention some of the other important features: I use the implementation-stack collection archive ( NSArray , NSDictionary , < Code> NSSet code>), the string ( NSString ), utility class ( NSProcessInfo , NSUserDefaults ), sorting tool ( NSCoder ), ...

This is a broad framework to say the least.


c# - Which Excel Interop objects to clean up myself and which to clean up by GC.Collect() -


Question:

I would like to ask a question to answer questions to clear Excel interop items There were several solutions (as if wrappers do not use more than one point, kill excel processing), but I like the problem most ().

What it basically says is that you do not worry too much about floating around all contexts. You are just a few key people (like ApplicationClass , workbook and worksheet ). You first prepare garbage collection to clear all the objects and then clear your main references by clearly calling Marshal.FinalReleaseComObject (in the opposite order of importance).

Now I have two questions about this.
First: How can I determine which object I need to keep reference to? In it, it only keeps limits , worksheets , workbooks and ApplicationClasses . Second: If there are more objects

update 1:

P> Recommended by Matasy The only important thing is that the app is released for the last time, though in my following sentence: "You must also release your named reference in the order of importance mentioned: Range objects first, worksheets, workbooks, And then finally your Excel application object. " This means that there is more ordering.

nobugz indicates that setting everything to null and then collecting garbage will be enough, but it seems that the contrasts with the lower quote Is: "You will think, then, you can set all your variables = nothing and then call GC.Collect () in the end, and this is sometimes However, Microsoft Office applications are unfortunately, setting your variable = nothing and then GC.Collect () caller CTO's release does not guarantee orders.. "

Update 2:

Some additional information: In my application, I do so many things with a chart. I am establishing many properties etc. As I think, there are many places where I create a new com object, I tried to make sure that I never used double dots, and I did not have to use the Marshall.FinalRailCom object I tried to call those who ended with me. I did not use the cover approach because it would present a lot of nesting victim.
My app did not close after its work ended but ... when I asked my app to do the same thing again, it was close. Of course a new Excel Exe opened which was not closed. Now I have removed everything from Marshall. Funierrech Com Objects Calls and apps do exactly the same thing. EXCEL.exe remains, unless I tell my app to do the job again, but then a new EXCEL.exe starts and stays Edit: Also, when I tell my app to perform other non-com related tasks, after some time, EXCEL.exe disappears, but now no new EXCEL.exe

"post-text "Itemprop =" text ">

You have no problem finding potential references in your code Minister should, they will field in your class (SAS). Or local variable in cleanup method, it is not possible that the list given in the links is just the object, which you will likely have to store in a field. Others may also be able to keep Excel as the only thing to keep alive as a commodity object.

I do not think I recommend Jackman approach to advocating links, it hides a potential life reference, for an RCW that wraps up a dead COM interface, the best you can do for the RCW object In the worst, it crashes your program with an exception when it accidentally references the object. Bugs, to make sure that you can easily find them. All you have to do is set to clear your references, the order does not make any difference, then it is gathered.


python - Suppress linebreak on file.write -


While writing a text file, some files. Write examples include a lineback in the output file and other 't. I leave no line breaks, where I tell them. Code:

  for wks.wc.items () in workcases: out.write (doc) # It works fine, there is no linebrick for word in wordlist: if wc In the words: out.write "\ t% d"% wc [word] #linebreaks Others appear: out.write ("\ t0") # After each of these. Write ("\ n") # There were mixed spaces / tabs in this line  

What am I missing?

Update

I should take a clue from the code pasted in SE. For some reasons, the last line contains a mixture of spaces and tabs, such as the Blind in the textmate "outside of the word" ... appears outside the loop - but interpreter Changing the spaces in the loop tab that was being solved solved the problem.

Thank you for your input.

file.write () does not add any new lines if your There is no \ n s in the string written by.

But the word in your word list by using a new line out.write ("\ n") for each, is that what you want?

  for doc, in wc wordcounts.items (): Word.write (doc) # This works fine, there is no lineback for word in the word list: if the word wc: Out.write ("\ t% d"% wc [word]) #linebreaks Others appear: out.write ("T0") # After each of these. Type "NEWLINE" on each writing ("\ n") # & lt; NEWLINE!  

Perhaps you indented out.write ("\ n") too far ???


c# - Moq'ing the raising of events multiple times -


In a special unit test, I am trying to increase an event several times and then after the last event a property value I'm trying to increase. has been raised. I have something like this

  public zero turnarite () {var mokfu = new fake & lt; IFoo & gt; (); Some services some service = new service (); SomeService.Foo = Mokfu.Object; Mockfoo.rise (eff = gt; fu vice versa + = faucet, event araz. Empty); Mockfoo.rise (eff = gt; fu vice versa + = faucet, event araz. Empty); Mockfoo.rise (eff = gt; fu vice versa + = faucet, event araz. Empty); Mokfu Verify (foo = & gt; foo.Orientation = Orientation. Vest); }  

Orientation was actually changed only in the past (as I believe the incident is only taking once). Am I doing something wrong? This is the first time that I have used the country, so I am probably missing something.

Cheers J

Edit ... The right code should have been used

  Public ZeroTurnlight () {Var mocfu = new fake & lt; IFoo & gt; (); Some services some service = new service (); SomeService.Foo = Mokfu.Object; Mockfu.setupproperty (foo = & gt; foo.Orientation); Mockfoo.rise (eff = gt; fu vice versa + = faucet, event araz. Empty); Mockfoo.rise (eff = gt; fu vice versa + = faucet, event araz. Empty); Mockfoo.rise (eff = gt; fu vice versa + = faucet, event araz. Empty); Decide. Arequal (Mockfu.Object.orientation, Orientation.South); }  

mockFoo.Raise should be ok, lift up The event three times ... Can you place a breakpoint in the event handler and check how often it is called?

Here is another possible mistake as I can see, that you should first start tracking the Mac before you can verify it (and before you increase the events): all sets / Gets to the property:

  // Start "Tracking" set / this property to Mokfu .Setupproperty (Foo => Foo.Orientation);  

python - 2 Axes Reportlab Graph -


html>

I have been able to create graph of 2 axis in ReportLab by overlapping a bitrate and linepoint. Here are some similar to a code to be interested in:

  import drawings from reportlab.graphics.shapes, color makeMarker reportlab.graphics.charts from reportlab.graphics.widgets.markers. VerticalBarChart LinePlot drawing import import reportlab.graphics.charts.lineplots from barcharts import = drawing (400, 200) data = [(13, 5, 20, 22, 37, 45, 19, 4)] noOfBars = len (data [ 0]) BC = VerticalBarChart () bc.x = 50 bc.y = 50 bc.height = 125 bc.width = 300 bc.data = data bc.valueAxis.valueMin = 0 bc.valueAxis.valueMax = 50 bc.categoryAxis .categoryNames = ['Jan-99', 'Feb-99', 'March-99', 'April-99', 'May-99', 'Jun-99', 'Jul-99', 'August-99 '] Drawing joint (BC) date 3 = [[(0.5, 4), (1.5, 3), (2.5, 4), (3.5, 6), (4.5, 4), (5.5, 2), (6.5, 5) (7.5, 6) ]] L.P. = Lineplot () Lpkksh = Bskksh Lpky = Bsky Lpkhait = Bskhait Lpkvidth = Bskvidth Lpkdeta = Dt3 Lpkjoinedlines = 1 Lpklains [0] Ksinbl = makeMarker ( 'Circle') lp.lines [0] .strokeColor = colors.blue lp.lineLabelFormat = '% 2.0' lp.xValueAxis.valueMin = 0 lp.xValueAxis.valueMax = noOfBars lp.yValueAxis.valueMin = 0 lp. YValueAxis.valueMax = 8 lp.xValueAxis.visible = False lp.yValueAxis.visible = False #Hide 2nd plot its Yaxis drawing.add (LP) y2Axis = YValueAxis () # 2 Yaxis replication in y2Axis.setProperties (lp.yValueAxis .getProperties ()) y2Axis.setPosition (lp.x + lp.width, lp.y, lp.height) y2Axis.tickRight = 5 y2Axis.tickLeft = 0 y2Axis.configure (data3) y2Axis.visible = true drawing.add ( Y2Axis) renderPDF.drawToFile (drawing, '../tmp/barline.pdf')  

The only problem is that the label of 2 Pointing inside of F. I would like them to be a graph!

Thanks in advance

I have done this recently

  y2Axis.labels.dx = 10  

Should do the trick for you.


vb6 - How to properly remove all connections to an Access Database -


यह वीबी 6 कोड का एक स्निपेट है:

  myProjectDaoDB.Close FileCopy myName, TempFile  

जहां myName एक डेटाबेस का पथ है यह डेटाबेस संभवतः पहली पंक्ति में बंद है ऐसा लगता है कि डाटाबेस को बंद करने से डेटाबेस के सभी तरीकों को ठीक से निकालने के लिए पर्याप्त नहीं है जब मैं प्रोग्राम चलाता हूं, मुझे '70' की रन-टाइम त्रुटि मिलती है: अनुमति अस्वीकृत मुझे पता है कि उपयोगकर्ता अनुमतियों के साथ कोई वास्तविक समस्या नहीं है। यह त्रुटि केवल डेटाबेस को सहेजने के बाद ही होती है, इसलिए मुझे यकीन है कि कुछ ठीक से बंद नहीं किया जा रहा है।

जब डेटाबेस खुला है, तो एक लॉक फाइल बनाई जाती है अगर मैं डेटाबेस में कोई भी बदलाव किए बिना इस कोड को चलाता हूं, तो लॉक फ़ाइल को पहली पंक्ति के बाद हटा दिया जाता है। जब मैं डेटाबेस में परिवर्तन करता हूँ, तो लॉक फ़ाइल हटाई नहीं जाती है। जब कोई डाटाबेस बंद करने की कोशिश करता है तो कोई भी त्रुटियाँ नहीं होती हैं, इसलिए यह अभी भी क्यों है?

अपडेट: मैंने यह पता लगाने के लिए कदम उठाया है कि त्रुटि के दौरान डेटाबेस के पास कौन कनेक्शन है परिणामों के अनुसार, जब मैं डेटाबेस में परिवर्तन किए बिना कनेक्शन को बंद करने की कोशिश करता हूं, तो यह केवल मेरा जुड़ा हुआ है। जब मैं परिवर्तन करता हूँ, मैं दो बार से जुड़ा हुआ हूं I ऐसा लगता है कि myProjectDaoDB.Close सभी कनेक्शन बंद नहीं कर रहा है। क्या है?

क्या आपने सभी रिकॉर्डेट्स बंद कर दिए हैं और उनके ऑब्जेक्ट को कुछ भी नहीं सेट कर दिया है?

< / div>

ruby on rails - What is the best strategy to combine IntrAnet and Web-exposed website? -


I was thinking that someone has some insights on this issue.

A small background :

We are using tracks to build an internal company from an old Debugging and Visual Basic based system, which Works as an intranet for internal printing.

Dilemma

Now we need to replace an old customer-facing website in Java, which will connect to our internal systems. To use, we want to be able to draw information such as inventory, order placement, details of our internal system's account details and make it live on the site. The reason for this is that we order the website through fax and amp; Phone and sometimes we are walking-ins, sometimes (very difficult you), even in the inventory update on our old Java site, we get an opportunity to order the last limit, because we Sell ​​the same item to 2 customers within half an hour. It is usually fixed within a day, but we want to avoid this in the future.

The real question

Does anyone have a suggestion about how to accomplish this is a better way?

These are the three options I see:

a) Create a separate rail app on the web server, which will connect to it similar DB which connects to our internal app.

  • +++ plus: live data - the same thing that we see inside our internal app, i.e. the real time in the order, the list has expired

  • - Minimum: Potential security risk, duplication of code - that is, I need to duplicate all the controllers, models, ideas etc.

b) Create a separate rail app on the web server, which will connect to a different db from our internal app.

  • +++ plus: less security risks
  • --- Minimum: additional effort to sync Web DB and internal DB (or using a web service) IKE REST-API), additional code to reduce inventory and order # build, Duplication of code - that is, I need to duplicate all the controllers, models, ideas etc. which deal with the order.

C) Expose the internal app on the web

  • +++ Plus: All the above problems have been eliminated, this is a very "dry" er method.
  • --- Minuses: Too many security headaches more complex login systems - A & amp; For internal users using a LDAP

So what is the idea? Has anyone had similar problem solving? Please keep in mind that our company has limited resources - that is, a developer who is dedicated to it. So it should be one of those "rights" and "smart" solutions, "do not solve money / people / resources on this".

Thank you.

I will probably create separate controllers for the public site and you can use ActiveResource to draw data from internal applications. Can be used.

Edit - Take a look at Fixed Link and Added API Link


In Lua, how do I remove a table within a table? -


उदाहरण के लिए:

  आइटम = {[753] = {}, [1 9 2] = {}, [789] = {}, [7 9] = {}, [790] = {}, [776] = {},}  

मैं 789 को हटाना चाहूंगा और इसके अंदर के सभी डेटा। मैंने दोनों कोशिश की: table.remove (आइटम, 2); और टेबल। निकालें (आइटम, 78 9); (मुझे यकीन नहीं था कि अनुक्रमण कैसे काम करता है) कोई भाग्य नहीं।

यह उतना आसान है शून्य मान होता है, तो यह ऐसा है जैसा कि

  आइटम [789] = शून्य  

कुंजी मौजूद नहीं है।

  & gt; टी = {[5] = {}, [10] = {}}> के लिए, वी में जोड़े (टी) प्रिंट करते हैं (कश्मीर, वी) अंत 5 तालिका: 0037 सीबीसी 10 10 तालिका: 0037 सीबीई 8 & gt; टी [5] = शून्य & gt; के लिए, वी (पी) जोड़े (टी) प्रिंट में (कश्मीर, वी) समापन 10 तालिका: 0037CBE8  

यह भी देखें। (यद्यपि ऑनलाइन संस्करण लिआ 5.0 के लिए लिखा गया है, यह अभी भी लुआ 5.1 पर लागू होता है)

... आप उसे हटाने के लिए किसी तालिका फ़ील्ड को शून्य प्रदान कर सकते हैं।

जब आप अपने अनुक्रमणिका में शून्य असाइन करते हैं, तो यह उस स्पष्ट रूप से को उस अनुक्रमणिका में पहले संग्रहीत नहीं किया गया था; लेकिन वहां जो संग्रहीत किया गया था, उसके लिए संदर्भ गणना को कम करता है, संभवतः इसे कचरा संग्रह के लिए योग्य बनाता है।


asp.net - create three stored procedures (select/update/insert) per table or as needed? -


asp.net का उपयोग करना, sql सर्वर 2008, winserver2003

हमारे पास लगभग 20 फ़ील्ड के साथ लगभग 10 टेबल हैं प्रत्येक ...

हमारे पास लगभग 30 वेब फॉर्म हैं जहां प्रत्येक फॉर्म कुछ / सभी तालिकाओं से खेतों में कुछ भिन्नता का उपयोग करता है ...

प्रत्येक फ़ॉर्म के पास अपनी 'डाटासेट' है तालिकाओं का उपयोग करता है हालांकि, उस डेटासेट को बनाने के लिए, प्रत्येक चयनित तालिका पर एक चयनित * संग्रहित प्रक्रिया को कहा जाता है। डेटासेट फ़ॉर्म / कोड के माध्यम से अपडेट हो जाता है, और एक सामान्य सम्मिलित या अद्यतन संग्रहीत कार्यविधि को प्रत्येक डेटासेट कहा जाता है, प्रत्येक फ़ील्ड को पैरामीटर के रूप में पारित करना। यद्यपि फूला हुआ है, वहां प्रति तालिका में केवल 3 संग्रहित प्रक्रियाएं मौजूद हैं, जो कि सभी रूपों के द्वारा उपयोग की जाती हैं, 30 कुल संग्रहीत कार्यविधियों के बराबर होती हैं।

क्या यह केवल कस्टम प्रपत्र / अपडेट / खेतों कि फार्म की जरूरत है ... इस तरह कुल कुल 90 कुल प्रक्रियाओं? उस नंबर को रूपों में वृद्धि के रूप में बढ़ सकता है ...

क्या संग्रहीत कार्यविधियों में कोई विशेष कार्यक्षमता है या क्या वे सिर्फ बुनियादी सख्त कोडित बयानों जैसे "SELECT * FROM टेबल" चलाते हैं?

यदि वे सिर्फ मूल विवरण चलाते हैं, तो संभवतः संग्रहीत कार्यविधियों से छुटकारा पाने और गतिशील SQL का उपयोग करना बेहतर होगा। इससे आपको रखरखाव कार्य की मात्रा कम होनी चाहिए। डायनेमिक एसक्यूएल के साथ पुराने प्रदर्शन की चिंता अब प्रासंगिक नहीं है क्योंकि SQL सर्वर के कैशिंग और संकलन प्रणाली अब बेहतर है सुरक्षा चिंताएं अप्रचलित भी हैं, क्योंकि आप अब डायनामिक क्वेरी में पैरामीटरियोजन का उपयोग कर सकते हैं।


accessing data from the model using script/console (Ruby on Rails) -


I am looking to write a Ruby script which I can load in Rail Console, which I Data will be accessed. was made. I have created a model using the following command and it is populated with data:

  Script / Generated students generate the given name: string middle_name: string family_name: string date_of_birth : Date grade_point_average: decimal start_date: date  

For example, how do I get a script to print a list of names of all students? Is there a resource that describes this in detail? I can not find anything Thanks!

  • Steve

  students = student All students. Students | P. student.name expiration  

Is there an API to GlassFish Admin Console? -


We've inherited the development of just one web application which uses GlassFish Setup Instructions We have a connection pool, JDBC These are all manual steps for processing and setting up JMMS. I'm wondering if there is an API that can allow us to do all this work automatically (like with a script)?

Thank you!

have you seen the ASDMM utility? You can script it to call the utility to set up resource pools, database connection information, message queue processing, etc.

Here's a link

You can use the org.glassfish.api.admin.AdminCommand API to do an automatically, say in Java.

This can help.

Here are some examples for using the API.

Bob.

This console admin is a docs to expand utility


functional programming - How to use 'oneof' in quickCheck (Haskell) -


I am trying to write a support that changes Sudoku and then checks that it is still valid.

However, I'm not sure how to use the "one" - function. Can you give me some hint, please?

  prop_candidates :: Sudoku - & gt; Child Prospects Su = Sudoku New SU & amp; IsOkay newSu where newSu = update su aBlank aCandidate aCandidate = oneof [return x | X & lt; - Candidates su aBank] aBlank = oneof [return x | X & lt;  

Here's more information ...

 Type  POS = (Int, Int) Update: Sudoku - & Gt; Status - & gt; Maybe int -> Sudoku Spaces :: Sudoku - & gt; [POS] Candidate :: Sudoku - & gt; Status - & gt; [IT] [return x | X & LT; - (empty example)] :: (Monad M) => [M POS]  

I have a core with this support for 3 hours, so any idea is welcome!

What I was running is that you have a type of mixture i.e., aBlank is not a POS , but there is a gene poos , so update a blank aCandidate does not make any sense! In fact, what you want is a way to make an early Sudoku a new Sudoku; In other words, a function

  similarly Sudoku :: Sudoku -> General Sudoku  

Now we can write it:

  Similar Sudoku su = a bulk & lt; - element (emptyness) - simple than one [back x |  

Or even simple:

  Similar sudoku    
< P> and looks like property

  prop_similar:: sudoku - & gt; Gen Bool prop_similar su = do newSu & lt; - Sasadudoki Suvata (Sudoku Nsu & amp; Ike Oi Nsu)  

Due to the example

  Testable Bull Testable Prop = & gt; Testable (General prop) (arbitrary A, show, testable prop) = & gt; Testable (a -> Sahara)  

Sudoku -> General Bull is testable as well (to handle example unchecked sudoku ).


vb.net - Error with the Using Statement and Lazy Initialized Property -


A invalid operation expiration will be thrown in the code below: ConnectionString property has not been started. Calling on line in the method of loading exceptions. Open (). If I use try-end statement instead of using the statement, then everything works correctly as well as anyone can interpret SqlClient.SqlConnection, with the exception statement being used? Private connection SomeEntity Private _Connection SqlClient.SqlConnection Private _ConnectionString String as protected ReadOnly property connection () If the _Connection is nothing, then _Connection = New SqlClient.SqlConnection (_ConnectionString) End then return _Connection from the end to the other end property using the Connection.Open connection () as the public sub-new go (as byVal connectionstring string) _ConnectionString = connectionstring end subsystem subload (ByVal key as integer). End End End End Class

You have failed to mention an important piece of information: This is the first time the load () succeeds, but then remains unsuccessful for ever. Using the

, the settlement () is called the O.N using the block using the variable used. In your scenario:

  1. The load () is called
  2. Using the received connection call property property
  3. _Connection a new one SqlConnection is set to
  4. < P>

    The SqlConnection object still exists, and is still indicated by _Connection, it is no longer in a useful state, because it is displacement () D. When the second call (to load) comes in:

    1. The load () is called
    2. Using the statement the call receives the connection property < / Li>
    3. _Connection is still pointing to a (useless) SqlConnection object, so it is not nothing, and a new SqlConnection object returns
    4. (useless) connection
    5. Do not get ready to open () is called on the connection - in an unavoidable condition And invalid operation triggers exceptions

    You are mixing anti-views for connection management, keeping the connection object around as a member of the class indicates that you have someEntity Want to keep alive connections for the life of the object, but using the use indicates that you can create and destroy the connection with each use to fly Are there.


sql server - How to merge XML in T-SQL? -


It does not appear that any amount in reading the docs will help me look at the simplified example:

 declare @ table 1 table (id int, parent xml) @ table1 value (1, 'root & gt; & lt; / root & gt;') @ table2 Announce the table Id int, Guts xml) Type @ table1 t1 from Inner Invert @ Table 2 T2 on t1 @ Table 2 Values ​​(1, ' O Mom! & Lt; / Guts & gt;') Select t1.parent .query ('') id = t2.id  

What is the query function to generate this result? Will be ridden?

  & lt; Root & gt; & Lt; Guts & gt; Hey Mom! & Lt; / Dare & gt; & Lt; / Root & gt; The following is not set based, but it will help you (SQL2008 only)  


ruby on rails - net/http and posting data to Google Checkout -


I am trying to post the form data to Google Checkout using the following code:

  X = Net :: HTTP.post_form (URI.parse ('https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/ [merchant_number_ here]'), @presse)  

When I try to use this line, I get the following error:

Make Payments Controller in Errno :: ECONNRESET

/ P>

Any thoughts on what could be wrong?

method post_form attempts to connect to Yuri on HTTPS, HTTPS should clearly tell you Net / HT that a secure connection should be used. You should do the following script. You can use the set_debug_output method to debug feedback from Google.

  is required 'pure / http' required 'net / https' url = URI.parse (' http: //checkout.google.com/api/checkout/v2 / CheckoutForm / Merchant / 1234567890 ') req = Net :: HTTP :: Post.new (url.path) req.set_form_data ({' my '=>' Params'}) res = Net :: HTTP.new ( Url.host, url.port) res.use_ssl = true # response to stderr for rib res.set_debug_output $ stderr res.start {| Http | Http.request (req)}  

javascript - How to expire a cookie in 30 minutes using jQuery? -


How to eliminate a cookie in 30 minutes? I am using a jQuery cookie, I am able to do something like that.

  $ Cookie ("example", "foo", {expiration: 1});  

This is for 1 day. But how can we set the end time for 30 minutes

30 min 30 * 60 * Add the current date to specify the expiration date 30 minutes to 1000 milliseconds in the future.

  var date = new date (); Var minutes = 30; Date.SsetTime (date.getTime () + (min * 60 * 1000)); $ .cookie ("example", "foo", {expiration: date});  

javascript - jQuery slideDown / slideUp not working in IE7 -


So I'm using a very basic jQuery. Slide Down which is working in FF, Safari, and Chrome, will not work at all in IE 7. Here's the script:


  // Top mailing list animation $ (document) drop Down .ready (function () {$ ('div # top_mailing_hidden') Hide (); slide ("slow");}); // Collapse panel $ ("input # top_mailing") "$ 1" ("input # topmailing"). .blur (function () {$ ("div # top_mailing_hidden") SlideUp ("Slow");});});  

I am researching for hours and found something about a bug related to SlideUp / Below which causes it to fail in IE 7 when the descendants of Posten Used on: Definitive Element: This animation is happening within a situation: Nine fixed, however, I have tried to wrap the internal elements with the situation: relative but no benefit, I still have to Nothing gets Also, note that the Niv element is hidden with jQuery, this function is also working in IE 7, however, there are no slides / downs.

Here is the related CSS:

  / * -------------- Top dropdown mailing list -------- ----------- * / #top_nav div # top_mailing {true name; Width: 351 pixels; Padding: 0 10px 10px 5px; Background: url (images / top_mailing_bg.png) not center-repeat; Status: Completed; Top: 0; Correct: 0; Color: #fff; Lesson: 0-1px 0px # 222; } #top_mailing #top_mailing_hidden {font-size: .7em; Text align: center; Status: Relative; Height: 30px; Zoom: 1; } #top_mailing #top_mailing_hidden div {} #top_mailing #top_mailing_hidden a {color: # acffc0; font-weight: bold; } #top_mailing #top_mailing_viewable {height: 30px; font-weight: bold; Font size: .9em; Padding-top: 5px; }  

jQuery's slideup () , Work with IE7 in slideDown and slideToggle () Status: relative elements Do not do it. Some slide problems can be solved by adding

  zoom: 1;  

For sliding containers and / or elements.

Let us call & lt; Table & gt; for the layout to solve some sliding problems.


actionscript 3 - Flash Combo Box... set the text field to selected value? -


Hey everyone .. I'm really new to flash. I have a combo box and I am using it 'default index' property so that it can be given a default value (a value that is at first (0) index). Setting this property in my action script selects the value in the dropdown but it does not add the selected value to the text field of the combo box. how do you do this? None of my selection has any effect on the text field.

Here is a sample of my code. The combo box list is properly populated and the price is selected in the list. However, once you select the value in the list, the list of combo box closes and nothing remains in the text field of the combo box.

  comboBoxData.insert (0, {data: 1, label: "Show me something specific"}); For (I'm In Animation) {comboBoxData.push ({Data: i.uri, label: "somevalue"}); } ComboBox.dataProvider = comboBoxData; ComboBox.selectedIndex = 0; ComboBox.text = comboBox.selectedIndex; This._lockroot = true;  

My solution is using AS2.

Thank you!

- Nick

I think you need to add some code. I do not really understand whether you have a text field and a Cambodia? If this is the case, you can do something to give selected indexes in the text field

  combo_cmb.selectedIndex = 1; Text_txt.text = c.selectedIndex; Var Listener ObjectPM: object = new object (); ListenerObjectPM.change = function (Event Object: Object) {text_txt.text = combo_cmb.selectedIndex; } Combo_cmb.addEventListener ("Change", Source Listener PM);  

If you want to print the labels in the text area, then you text_txt.text = combo_cmd.selectedItem.label; You can change the value of or print the data if you want it to be text_txt.text = combo_cmb.selectedItem.data; Change to . If not, you can write code, so I can better understand what you are trying to do.


php - Finding a path in a multidimensional array for a certain ID -


मेरे पास एक सरणी है जो इस तरह से संग्रहीत है:

  [0] = & gt; अर्रे ([आईडी] = & gt; 1 [cat_name] = & gt; c1) [1] = & gt; Array ([id] = & gt; 5 [cat_name] = & gt; c21) [1] Array ([id] = & gt; 2 [cat_name] = & gt; c2 [copii] = & gt; अर्रे ([0] = & gt; = & Gt; अर्रे ([आईडी] = & gt; 6 [cat_name] = & gt; सी 22))) [2] = & gt; Array ([id] = & gt; 3 [cat_name] = & gt; c3 [copii] = & gt; अर्रे ([0] = & gt; अरे ([आईडी] = & gt; 7 [cat_name] = & gt; c31 [copii] = एरे ([0] = & gt; ऐरे ([आईडी] = & gt; 9 [cat_name] => सी 311))) [1] = & gt; अरे ([आईडी] = & gt; 8 [cat_name] = & gt; C32)))  

मैं एक निश्चित आईडी के लिए मार्ग खोजने का एक आसान तरीका ढूंढने की कोशिश कर रहा हूं I अब मैं सभी संभव सरणियों के माध्यम से पुनरावृति और मार्ग ढूंढने के लिए foreach का उपयोग कर रहा हूं।

उदाहरण:

  id = 1: route [0] [id] = 1, मार्ग [0] [cat_name] = सी 1 आईडी = 5: मार्ग [0] [आईडी] = 2, मार्ग [0] [cat_name] = सी 2 मार्ग [1] [आईडी] = 5, मार्ग [1] [cat_name] = सीए 21 आईडी = 9: मार्ग [0] [आईडी] = 3, मार्ग [0] [cat_name] = सी 3 मार्ग [1] [आईडी] = 7, मार्ग [1] [cat_name] = c31 मार्ग [2] [आईडी] = 9, मार्ग [2] [cat_name] = c311  

यदि मेरा प्रश्न कोई मतलब नहीं है, तो मैं इसका एक अच्छा समाधान खोजने के लिए खर्च किए गए घंटे पर दोष देता हूं ...

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

असल में आप एक फ़ंक्शन कॉल करेंगे जो कि सरणी, खोजने के लिए आईडी और पथ का प्रतिनिधित्व करने वाला स्ट्रिंग / एरे होता है। प्रारंभिक पैरामीटर के लिए रिक्त स्ट्रिंग या रिक्त एरे के साथ कॉल करें।

फ़ंक्शन में आप ऐसा करेंगे:

  • शीर्ष कोड के शीर्ष स्तर के माध्यम से एक foreach चलाएं > $ सरणी
  • यदि आप $ id को ढूंढ रहे हैं, तो $ पथ लौटाएं।
  • < Li> यदि कोई सरणी मान एक उप ऐरे है, तो वर्तमान आईडी नोड को जोड़कर फ़ंक्शन को फिर से कॉल करें - जैसे कि $ foundPath = findPath ($ array, $ id, $ path)
  • यदि $ foundPath कुछ देता है, तो आपको अपना रास्ता मिल गया है और वह वापस लौट सकता है।
  • अगर उसे कुछ भी नहीं मिला ( $ पाया पाथ नीचे के रूप में झूठी या शून्य है), इसे छोड़ दें और लूप के अगले पुनरावृत्त पर जाएं।
  • पाश के अंत में, अगर आपको कुछ नहीं मिला है, तो झूठी वापसी करें या नल।

उम्मीद है कि मदद करता है!


javascript - Toggle effect problem when using for-loop in IE7 -


I am a web designer who is trying to hang on javascript and jquery, and I want to learn how to write less, a more concise code - to avoid ridicule by developers at work;)

I have this snippet:

  // checkbox checkbox $ ('. - Option-checkbox1'). Click (function () {$ ('product-optional-toggle1'). Toggle ('sharp');}); $ ('Product-optional-checkbox2'). Click (function () {$ ('product-optional-toggle2'). Toggle ('sharp');}); $ ('Product-optional-checkbox3'). Click (function () {$ ('Product-Optional-Toggle 3') Toggle ('Sharp');}); // hide divs $ ('product-optional-toggle1'). Hide (); Hide $ ('. Product-optional-toggle2'). Hide $ ('. Product-optional-toggle3').  

... which I want to reduce using for-loop, such as:

 for  (var i = 1; i & lt ; 4; ++ i) {$ ('product-optional-checkbox' + i). Click (function () {$ (this) .Parent ('div'). ('Div') Toggle ('sharp').;}); $ ('Product-optional-toggle' + i). Css ({display: 'none'}); };  

It works fine in FF, although it is toggled twice in IE 7. Does anyone know who is there to solve this kind of problem?

Going to parents, the descent is getting many divs?

In your example, you can change it:

  $ (this). Parent ('div'). 'Div') on current ('sharp')  

With the same code as the original example:

  $ ('product-optional-toggle' + i). Toggle ('sharp');  

However, it would be better to terminate all the numbers and just use the .product-optional-checkbox range. Thus you can add a click function to all elements of that category at a time and avoid the loop:

  $ ('product-optional-checkbox'). Click the stuff (function () {// $ (this)});  

spring - HandlerExceptionResolver for annotated controller -


I have an annotated controller in which several mathidas are mapped on the URL. Like this:

  @Controller Public Class Category Controller {@RequestMapping throws parseException @RequestMapping of public zeroes addcategories (@RequestParam (value = "data") string jsonData) Value = "/ getNext") Public Zero getNext (@RequestParam) String jsonData throws ParseException ...}  

Methods to parse the json request and Take action to do something. The parsing request can be checked ParseException which I can handle in the law or its signature throws I like the second approach because it gives me additional code Do not try / hold. So the question is how to configure and code handler for controller methods?

You should see spring documents.

  @Controller Public Class Category Controller {@ExceptionHandler (ParseException.class) Public ModelAndView Handle ParaseExc (ParseException ex) {// ...} @RequestMapping (value = "/ addcategories") Public Zero AddCategories (@RequestParam (value = "data") string jsonData throws ParseException}  

Or if you want to handle these exceptions, then it is in the form of Spring MVC Bean in its XML configuration Declare all your controllers in.


php - "Catchall" Properties in C#? -


क्या सी # में एक "कैचॉल" गेटर प्रॉपर्टी बनाना संभव है?

  class xyzFactory {सार्वजनिक स्थिर ऑब्जेक्ट यह। * (स्ट्रिंग का नाम) {get new name ();}}}  

PHP में आप

  // स्थिर स्थिरांक 5.3 के लिए नया है, इसलिए मैंने इसे यहां नहीं रखा। वर्ग xyzFactory {सार्वजनिक _get ($ name) {वापसी $ name ();}}  

<पी > आप इस तरह के एक हैक के साथ प्राप्त कर सकते हैं

  xyzFactory.Instance.Name  

जहां स्थैतिक इंस्टेंस गुण प्रकार है गतिशील

और आप डायनामिक ओबाइज वर्ग से व्युत्पन्न xyzFactory बनाते हैं।

  सार्वजनिक xyzFactory: DynamicObject {निजी स्थिर xyzFactory _instance = new xyzFactory (); निजी xyzFactory () {} pubic static dynamic instance {get_instance;}} सार्वजनिक ओवरराइड bool TryGetMember (GetMemberBinder binder, आउट ऑब्जेक्ट परिणाम) {...}}  

javascript - How to move OpenLayers Vector programmatically? -


The API documentation says that vector does not have any method.

I know how to move the vector by adding controls to the user to go. Therefore, if the user can move the vector, then the program should be a method of transferring it to B. But I can not understand how to do it.

Object, moving not into vector, move, resize, shape and transform these methods.

Note that you will not find any method defined on the OpenLayers.Geometry base object, but note only on the proper object (note that there are many levels of legacy in Open Layers geometry) is a good example.

You can find a great example of progressing open-layer vectors programmatically.


activerecord - After upgrading to Castle Trunk and NHibernate 2.1.0.4000 My Integration tests crash TestDriven.Net -


I have an old mono rail / activivercard, I am also doing some work.

Recently I decided to upgrade the application to Castle Trunk & amp; NHibernate 2.1.0.4000 GA and now I am searching for some issues with running tests:

First of all - when using TestDriven.Net to run integration tests that work against the database, this TestDriven .NET is completely crashing, or all test completes execution, then TestDriven.Net hangs up. This upgrade has never happened before

TestDriven.Net crashes, here's what the event is written to log when.

Defect Bucket 1467169527, Type 1 Event Name: Appcrash Answer: Not Available Taxi Number: 0

Problem Signature: P1: ProcessInvocation86.exe P2: 2.22.2468.0p 3: 4a26845c P4: KERNELBASE.dll P5: 6.1.7600.16385 P6: 4a5bdbdf P7: e053534f P8: 0000b727 Second thing - when the proxy class is finally being () 'D', exceptions are being logged then - It seems that when it is logged twice, it is when TestDriven.Net accidents

here is the stack trace for the exception.

NHibernate.LazyInitializationException: Getting Started [MyApp.Core.Models.TestExecutionPackage # 15d9eb96-faf0- 4b4b-9c5c-9cd400065430] - Could not start the proxy - No session. Start at NHibernate.Proxy.AbstractLazyInitializer.In () at NHibernate.Proxy.AbstractLazyInitializer.GetImplementation) NHibernate.ByteCode.Castle.LazyInitializer.Intercept (IInvocation invocation) in Castle. Dynamic proxy. In the castle Proxies Execute Test Execution Packaging Proxies ()

The same behavior will crash MSBill on our CI server too.

What's really strange is that the principle thrown in the finals should be swallowed in exceptions according to MSDN Docs:

If last or override finally throws an exception, the runtime ignores the exception

= "lesson">

Never got enough of this issue, but I made almost a simple task by creating my own Azmi Lazy Initializer implementation Second was finished then I check the final method on the invoice, as shown below:

  /// & lt; Summary & gt; Try the actual property / method using the /// proxy or use the real / T object immediately and can not operate the proxy method. /// & lt; / Summary & gt; /// & lt; Param name = "invocation" & gt; & Lt; See cref = "IInvocation" /> From the generated castle Dynamic Proxy & Lt; / Param & gt; Public Virtual Zero Blocking (Try IInvocation Orientation) {Try (invocation.Method.Name == "Finalize") {Return;} If (_constructed) {// Normal LazyInitializer can detect it if it can be handled / To begin with / proxy or start the actual class invocation. Return = base.Invoke (invocation.Method, invocation.Arguments, Invocation needs .Proxy); // Base LazyInitializer can not meet it so we can not complete the actual class (Invocation.ReturnValue == InvokeImplementation) {invocation.ReturnValue = invocation.Method.Invoke (GetImplementation) (), // Law / Property needed to invoke against invocation.) Logic; return;} and {return;}} Else {// TODO: Find the equivalent of 'method.invokeSuper' of CGLIB; Return;} } Catch (target invocation exception tie) {// Promote internal exception so that the exception to the proxy can be thrown in as //. Real object exceptions_expression StackTrace.Invoke (tie.InnerException, new object [] {}) ; Throw tie. Inner exposure; }}  

Vim Ruby hash indentation -


I am using veem for ruby ​​development and I have some problem problem i when i type ruby ​​hash , Then I see an evil indentant:

  {{here it is}}  

How is it possible to solve?

I am using vimfiles.

python - Xcode gcc exit status 1 -


First of all I am very new to all of this.
I recently upgraded to Snow Leopard and installed Xcode + iPhone Dev Package, 3.1.2 I went to install the Django framework + MYSQLDB handler during the build phase, the terminal shows me the GCC exit status 1 error But I have already installed the encoded?

Where am I going?

Besides, while trying to fix things, I had installed the exode that came with Snow Leopard DVD. Still the same error

Now I think that I should completely remove Xcode and should install a fresh one?

What ver.3.1.2 is for specific 32-bit? Please help me

Here's the full error:

  Amit-Verma-MacBook: mysql-python-1.2.2 amitverma $ gcc-4.0 i686-apple- Darwin10-gcc-4.0 1: An Input Files Amit-Vermas-MacBook: mysql-python-1.2.2 Amphitheat $ python setup.py build running build_py MySQLdb / release.py - & gt; Build / Libkmacosx-L0k3-I386-2k5 / MySQLdb running build_ext building '_mysql' extension GCC -sisraot / developer / SDK / Maksaks 10.4 Yuesdike -fno-strict-aliasing -vino-long double-non-Seepeepi- Precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info = (1,2,2, 'last', 0) -D__version__ = 1.2.2-I / usr / local / mysql / included - I / Library / Frameworks / Pythonkframework / versions / 2.5 / include / python2.5 -c _mysql.c -o Build / temp.macosx-10.3-i386-2.5 / _mysql.o -g -Os -arch x86_64 - fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL cc1: error: unrecognized command line option "-Wno-long-do Uble "error: failed with order 'gcc' failure status 1  

I'm not sure That is, if you have solved your problem, after upgrading from Mac OS 10.4 to 10.6, I have got the exact same issues.

After some blog posts, on a hip, I was pointing setup.py to an old GCC version (GCC-2.0).

CC = '/ usr / bin / gcc-4.0' Python setup.py build

There were some alerts in the build.

  Running build build_p MySQLdb / release.py - & gt; Copy Build / lib.macosx-running 10.3-i386-2.5 / MySQLdb build_ext building '_mysql' extension /usr/bin/gcc-4.0-isysroot/developer/sdks/macosx10.4u.sdk -fno- strict-aliasing - not-long -double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -divron_info = (1,2,3, 'gamma', 1) -D__version ___ = 1.2. 3c1-I / Usr / local / mysql / include -i / library / frameworks / Python.framework / version / 2.5 / included / python2.5 -c _mysql.c -o build / temp.macosx-10.3-i386-2.5 / _mysql.o -g -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL file from _mysql.c included: 36: /usr/local/mysql/include/my_config.h:1050:12 : Warning: "HAVE_WCSCOLL" rescheduled Included in L / Library / Framework / Python. Framework / Version-2.5 / Includes / Python2.5 / Python.h: 8, from pymemcompat.h: 10, _mysql.c to :: Library / Framework / Python. Framework / Version / 2.5 / / Python 2/5 / pyconfig.h: 724: 1: Warning: This is the location of the previous definition GCC -arc i386 -You PPC -sisrot / developer / SDK / Maksaks 10.4 U SDK -ji- Bundle-embedded dynamic_club build / temp.macosx-10.3-i386-2.5 / _mysql.o - L / USR / local / ISSLL / Lib-LMIISL-client_r-lz -lm -lmygcc -o build / lib.macosx-10.3-i386 -2.5 / _mysql.so LD: Warning: build / temp.macosx-10.3-i386-2.5 /_mysql.o, File is not required architecture: Warning: / usr / local / mysq In l / lib / libmysqlclient_r.dylib, the file does not belong to the required architecture: Warning: in / usr / local / mysql / lib / libmygcc A, the file does not belong to the required architecture  

ran again at the same command.

Now everything works magically now and it also goes through the set. The module works as the candidate.


insert - iterating over linq entity column -


मुझे linq

के साथ एक रिकॉर्ड सम्मिलित करने की आवश्यकता है

एक फार्म पोस्ट से डेटा के साथ मेरे नाम का एक नाम है .. तो नाम = मान और amp; name2 = value2 आदि। प्रकार स्वरूप

में शुरू किया गया है, मुझे इन सभी मूल्यों को तालिका में प्रवेश करने की आवश्यकता है, लेकिन निश्चित रूप से तालिका फ़ील्ड टाइप की जाती हैं, और मुझे इसे डालने से पहले डेटा टाइप करना होगा

मैं स्पष्ट रूप से निश्चित रूप से

  linqtableobj.columnproperty = convert.to (जो मान) कर सकता हूं;  

लेकिन मेरे पास तालिका में कई स्तंभ हैं, और फ़ॉर्म से वापस आने वाले डेटा में हमेशा तालिका में सभी फ़ील्ड शामिल नहीं हैं

मैंने सोचा कि मैं लिंक्स ऑब्जेक्ट्स कॉलम, उनके डेटाटाइम को प्राप्त करने के लिए - फॉर्म डेटा से उपयुक्त मान को कन्वर्ट करने के लिए इस्तेमाल किया जाता है, लेकिन फिर भी

  linqtableobj.columnproterty = converted value  

... यदि टेबल में प्रत्येक स्तंभ के लिए एक है

  foreach (newlinqrowobj में col) {newlinqobj [col] = convert.changetype (namevaluecollection [col। नाम], col.datatype)}  

स्पष्ट रूप से मैं ऐसा नहीं कर सकता, लेकिन ऐसा कुछ भी संभव है .. या

क्या स्तंभों के चारों ओर लूप के लिए संभव है नए 'रिकार्ड' के रूप में मूल्यों की स्थापना मैं .. और मुझे लगता है कि रूपांतरण करने के लिए उस बिंदु पर प्रकार हथियाने लगता है

स्टम्प्ड मैं

धन्यवाद nat

यदि आपके पास कुछ डेटा प्रकार हैं जो सौ से भिन्न होते हैं Ent संपत्तियों, और आप एक अलग अलग प्रकार के साथ एक अलग तरह के डेटा प्रकार की प्रतिलिपि बनाना चाहते हैं, तो किसी तरह कहीं आपके कोड में आपको सौ अलग "मैपिंग" निर्देशों को परिभाषित करना होगा। इससे कोई फर्क नहीं पड़ता कि आप किस रूपरेखा का उपयोग कर रहे हैं, या "मानचित्रण" निर्देश सी # कोड, XML तत्वों, लैम्ब्डा फ़ंक्शंस, स्वामित्व "सामग्री", या जो भी हैं

यह ध्यान में रखते हुए, प्रति संपत्ति कोड की एक पंक्ति रखने वाला मुझे सबसे तेज़, सबसे सरल, सबसे पठनीय और रखरखाव समाधान की तरह लग रहा है।

< / html>

flash - What headers does a SWF file send when requesting data from a URL -


डेटा के साथ अनुरोध करते समय:

  & lt; param value = "data-file = http : //url-to-my/json.script "name =" flashvars "& gt;  

एक SWF फ़ाइल के माध्यम से, क्या अनुरोध प्रकार प्राप्त होगा ऐसा नहीं लगता है "xmlhttprequest" क्या यह ब्राउज़र से अनुरोध के समान है?

एक्सएमएलएचटीटीपीआरक्वईस्ट ब्राउज़र के समान अनुरोध-वास्तुकला का उपयोग करता है , इसलिए कोई अंतर नहीं होगा फ्लैश-ऐप का उपयोग करते समय अलग-अलग हो सकता है कि एकमात्र ऐसा उपयोगकर्ता-एजेंट HTTP- अनुरोध के शीर्ष लेख में सबमिट किया गया है। उपरोक्त परिदृश्य में मैं मानता हूं कि एक साधारण GET- अनुरोध किया जाता है।

शुभकामनाएं, फेबियन


connection string - Is it possible (and how) to add ConnectionString to app.config at runtime in C#? -


I have a console application that receives the connection string as a parameter. I have to set a connection string in app.config with the 'connection' string and the parameters given in the form of SQL Connection String.

I received this with the help of Thx links for the answer:

var config = ConfigurationManager.OpenExeConfiguration (ConfigurationUserLevel.None); Var connectionStringSettings = New connection string settings ("connection string", _arguments ["connectionString"], "system data. SQLLient"); Config.ConnectionStrings.ConnectionStrings.Add (connectionStringSettings); Config.Save (ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection ("connectionStrings");

Follow this reply and see below .. ..

< P> Yes - have a look at this.

);


c# - what happens to ASP.NET exceptions from created non-threadpool thread? -


A ASP.NET Web application creates a non-threaded thread like a thread below:

 Private static bool _refreshInProcess = false; Public representative zero refresher (); Private Stable Thread _ Refresher; Private Static Zero CreateAndStartRefreshThread (Refresh Refresh) {_refresher = New Thread (New Thread Start (Refresh)); _refresher.Start (); } Private Static Zero Refresh () {LoadAllSystemData (); } Fixed Public Zero CheckStatus () {DateTime timeStamp = DateTime.Now; Time Span = Timestamp. Subtract (_cacheTimeStamp); If (span.Hours> = 24) {if (Monitor.TryEnter (_cacheLock)) {try {if (! _refreshInProcess) {_refreshInProcess = true; CreateAndStartRefreshThread (fresh); }} Finally {Monitor. Extras (_cacheLock); }}}} Fixed Public Nine LoadAllSystemData () {try (if !! Database.Connected) {if (! OpenDatabase ()) new exception throw ("(Unable to connect to database)"); } SystemData newData = new system data (); Load Tables (Refund Data); Load Classes (Refund Data); Loaded Soldiers (Refused Data); _allData = newData; _cacheTimeStamp = DateTime.Now; // is the only place where the timestamp updtd} finally {_refreshInProcess = false; }} 

and LoadAllSystemData are also called as a single lock-protected section anywhere in the form of checkstats. Both calls are in their efforts - those who have hold-blocks too.

Now my question is 1. Load load system system throws an exception, what happens when the method is called in a refresh with a non-threaded thread? No one can catch it

  1. What happens when it is done 1000 times? Are these exceptions stored somewhere else and thus there is pressure on this system and eventually it causes memory exhaustion or something to crash?

  2. Is there a good solution for them to wait without making thread thread threads to eliminate the thread?

Thanks a lot!

  1. If the exception is raised in the non-threadpulge thread in the background and in the end it Not controlled by any cache block, it is promoted as long as it does not reach the beginning of the stack. Then the thread eliminates its execution - the exception is not stored anywhere, then the thread has been dropped in the context of its exception.
  2. Exception is expensive in NAT, so if you guess that 1000 times this happens, maybe this is not an exception, but there is only one part of your application flow and you should not take exception.
  3. If you want to catch exceptions from background activity, as an alternative you can use the BeginInvoke / EndInvoke methods of the representative. If there is no exception in the background operation, then it will be given in the end-inkok call.

java - StringBuffer append("") -


I am currently reapplying an application using a lot:

  stringbuff buff 1 = new stringbuffer (""); Buff1.append ("Some Value A"); Buff1.append (""); Buff1.append ("Some Value B");  

The codec did not think that code lines were fooled, is there any reason I can not use the app ("") for string buffer?

It is very likely that the code was generated by some refactoring device and to remove the encoder Unnecessary lines were not bothered for


c# - Is it possible to refactor this to use generics? -


LINQ से निकाय के लिए, मेरे पास निम्न कोड है:

  public Foo GetFooByID (int आईडी) {वापसी _ डीबी.फू.पहले (एम = & gt; एम.आई.डी. == आईडी); } सार्वजनिक बार GetBarByID (इंट आईडी) {रिटर्न _ डी बी.बार.पहला (एम = & gt; एम.आई.डी. == आईडी); }  

क्या इस पर जेनरिक का इस्तेमाल करने के लिए रीफैक्टर का कोई तरीका है?

आप LINQ से SQL विधि की तरह कुछ कर सकते हैं:

  सार्वजनिक टी GetById & lt; T & gt; (int आईडी) {वापसी _db.GetTable & lt; T & gt; ()। पहले (एम = & gt; m .ID = आईडी); }  

तब आप इसे ऐसा कहते हैं:

  GetById & lt; फ़ू & gt; (10); GetById & LT; बार & gt; (10);  

html - Firefox label element border cut off with position relative -


I have some custom check boxes with which I am working. When you select them the focus class joins them. When this happens, the boundary appears around it. For most browsers, the boundary element looks like a square around the element, though the left border in Firefox is cut if you correct this situation, fix the problem. Although I do not want to do this for position purposes I have made an open example here:

Notice when you see in Firefox what this looks like on Chrome. How can I behave like chrome?

Here is the html code:

  & lt; Div class = "textContainter" & gt; & Lt; Label class = "input-control checkbox focus" & gt; "Input id =" class "all" class = "class all input-control" type = "checkbox" name = "status" value = "item 1" tabindex = "-1" check "=" checked "/> ;    test item 1  

Here is the CSS

  label.input-control {display: Inline-block;}. TextContainter Focus {Outline: 1px Dotted! Important;} Input-Control, Input-Control. Input-Control -Body {status: relative;} Label input-control input {left: -9999px; position: absolute;} Label.input-control.checkbox. Input-control-img {background-image: url ("http: // blogs. Digitss.com/wp-content/ upload / 2010/04 / fancy-radio-checkbox page ");} Label.input-control.input-control-img {background-position: 0; background-repeat: any duplication No; width: 20px;} label.input - control period {cursor: indicator; swim left; height: 20px;}  

So far this place of input elements on the left End

  label.input- control input {left: -9999px; Status: Completed; }  

The label spreads along the frame as well (at least in Firefox).

Control {display: inline-block; Hidden flurry; }


connect to SQL server on Parallel VM from R -


I have Rustuo installed on Mac, and in parallel VM is SQL Server Management Studio. Now, I am trying to use RODBC package with SQL Server with R.DBC package. I think I have installed the SQL Server driver on my computer I am not familiar with the databases are the following work:

  1. Set-up user DSN 'orca4' in parallel VM (Windows 7), Driver's name 'SQL Server Native Client 11.0' (it was successfully tested). Run R. ODBC Connect ('Orca 4'), he gave me the message '[IODBC] [Driver Manager] The name of the data source has not been found and no default driver is specified. The driver could not be loaded '

  2. Then I tried cnend; - odbcDriver Connect (Connection = "Driver = {SQL Server Native Client 11.0}; Server = '1244gfgfgr'; Database = 'NewHome'; Reliable_connection = Yes;") I got a similar message Error: State IM003, Code -1988948897, Message [IODBC] [Driver Manager] The specified driver can not be loaded

Can anyone tell me what's the problem here?

This customer is required by DSN, not the server you want to make a DSN on your Mac Which can access R I do not know how to do this on OSX, but it seems that this link can help:


compilation - Vim-LaTeX - How to auto close brackets and how to compile using vim-commands -


I would like to know how the typing (, {{or [once it was used once the Vime-Latex was used I would also like to know how to do this so that my cursor ends inside the bracket because the VIM closes the bracket. So far, I try to write the following in my .vimrc-file, but it does .tex-files Does not work in:

  inoremap {{}  Inoremap {{{inoremap {} {}  Left  & Gt; inoremap (()  Inoramap (((inoremap () () (& amp;) Left> Inromem [[]  Inoremap [[Inomemap [] [ ]  Anyone who knows how to solve this? Another question: I am currently compiling Latex files in VIM-Latex But is there a way to do this using vim-command?  
 :  

to define compile mapping

uses vim-latex specific pattern : it's Called depends on the plugin AP (or Aimapis?) If you want to define the mapping, while IMAP is nearby, you can make better use of its functions. Otherwise you will follow the weird behavior.

Regarding compatibility with the bracketing system and IAPAP, I find that mapping has been established before defining its mapping to define corresponding mapping. Characters opening brackets (assuming the () related pair will insert a placeholder (such as a Vimelet-Latex) + the cursor will be moved to the correct location (-> (& Lt; cursor & gt;) & lt; + placeholder + & gt; . And closing the bracket key will jump to the placeholder (and thus close the bracket pair) if the cursor is just before the closing bracket characters I'm not sure this is what you are looking for However, context can be analyzed for precise behavior. For example, see Markdown Bracket Mapping.

Edit: Regarding the command, you always (Untested)


c - Running a separate process within a parent process -


I am creating a basic process that creates a child using Kanka (), and then a shared memory block That can be accessed by both parent and child I have created child processes using the WIN32 api (by creating many .exe files and running them all and then calling them using the createProcess () function Do), but a little bit of steps for Linux The Chitta.

I have created a separate file in which the child has the code. I think I will make the hair process using the fork, then to call the other C file (pid == 0) in the hair process Use command (exec)? Do I Need to Run Another File Before? Or can it just be sitting in one directory?

Any help is appreciated

thanks

< P> After the fork (), there are two processes, parents and children, in the parent process, the fork system calls the child's process id. In the hair process, the fork returns (0). So, if the return value of fork () is zero, then you can call a exec system call with the executable file name for the child process.


google app engine - GAE weapp2 Access-Control-Allow-Origin Error -


I get this error when using webapp2 user authentication

Before the redirection I have access header How do I add?

Redirect code: self.redirect (Users.create_login_url (self.request.uri))

Code:

 < Code> class certify (webapp2.RequestHandler): def mill (auto): user = users.get_current_user () cookie_value = self.request.cookies.get ('user') if user == cookie_value and user! = None: self.response.headers ['content type'] = 'text / plain' itself .response.write ('success') Other: self request. Title ['access-control-permission-origin'] = '*' self.redirect (users.create_login_url (self.request.uri))  

  DEF redirect (self, Yuri, permanent = fault, Ebert = Fell, code = none, body = none)  

and

  DEF redirect (Yuri, permanent = fault, abot = fault, code = none, body = none, request = none, feedback = none)  

So, I think you should call the other (if You want to pass the response object):

return webapp2.redirect (users.create_login_url (self.request.uri), correct, wrong, none, none, none , Self.response)

view


javascript - Google Sheets Annotated Timeline display exact values? -


I do not know I did some research on y-axis and showing the exact value at the top of the graph, and Found the following:

Display the exact value?

Determines that to save space, display a small, rounded version on top of the graph; False indicates that it may be right-click to view and select a value on the pull-down menu. For example, if set to false, 56.13 km can be displayed as 56123.45.

I do not have to display an exact value, rather than a " pull-down menu rounded version, nor any other settings. That script can be used externally and while creating your graph using Google Script Library, but my data is within a sheet, which means that I am not using a webstick using Google Drive and Values ​​displayed I have given it a little importance until I realized that when I hover over the chart, although the lines go up and down (value for big and small value for respect), the top of the chart The displayed value for more points is given the same value according to the decimal.

I divide the values ​​from 1000 and display them in decimal form with suffix Say that the " units (x1000) " but the effect is still the same, they are rounds for 2 dp

I also tried to change the format of those cells which The values ​​include and nothing happened. Is there a specific way or method to use the " Display Precision Value? in Google Drive? Is there any type of settings I have not missed? I used to use Google Script as well If there is a code that will change the settings of the chart to be fully displayed.

Best regards!

I got the solution since Google Drive provided the exact values There is no way to dictate, or I do not know any method or not, I did what I did Google Script to create a query that pulls data from the sheet. How do I transfer this chart? How can I and I use a local host to display the chart locally on my computer which is a workaround for Google Drive. Used:

   gt; Top & gt; Script type = "text / javascript" src = "https://www.google.com / Jsapi? Autoload = {'modules': [{'name': 'visualization', 'version': '1', 'package': ['annotationchart']}] "& gt; & Lt; / Script & gt; & Lt; Script type = 'text / javascript' & gt; Google.load ('Visualization', '1', {'Package': ['Annotation Chart']}); Google.setOnLoadCallback (drawChart); Function drawChart () {var query = new google.visualization.Query ('URL & amp; gid = 1800788428 and range = B: C'); // Note that the URL stands for the link of the sheet which can be obtained by sharing the document. Query.send (handleQueryResponse); } Function Handle Rescue Response (Response) {If (response.isError ()) {Warning ('Error in Query:' + response.getMessage () + '' + response.getDetailedMessage ()); Return; } Var data = response.getDataTable (); Var chart = New google.visualization.AnnotationChart (document.getElementById ('chart_div')); Var option = {displayAnnotations: true}; Chart.draw (data, options); } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = 'chart_div' style = 'width: 900px; Height: 500px; '& Gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

The part of adding the URL to run the query was a bit difficult. Once you publish the document (from the top right corner), you can copy a link from the pop-up, which is basically the same from the browser, but "" in it? Usp = sharing "is an additional additional criteria? Then you tell the query that the" gid "is the part to go to the sheet; the gid number from the browser link in the sharing link In the end, tell the query that by selecting and amp; category = in the end with the desired columns and rows, select which category to choose from, an annotation chart will be prepared, By default displaying exact values . For some reason, if the values ​​are still round, then you can add the following code:

  var option = {displayAnnotations: true displayExactValues: true}; 

  • For information about creating an annotation chart

python - Passing a String to A pyqt Application -


I am writing a pyqt application that will take a wifi password behind a password protected site, I have to write a QT The application that will use the form to provide my Pyro script with the username and password, then return all that information and it will be inserted into the previously left empty label. Here's Qt code:

  from PyQt4.QtGui import QApplication, QWidget, QLabel, QComboBox, QLineEdit, QPushButton import sys import wifiRetriever qt_app = QApplication (sys.argv) class pyGui (QWidget): def __init __ (self): # Start the object as a QWidget QWidget .__ init __ (self) # We, main window of # to set ourselves size, since we control the whole layout self.setMinimumSize (400 , 185) self.setWindowTitle ('some public WiFi') # With this effect, make the control as their guardian and #make your status personal Set as default; Each line has a label labeled for # other control # user name field labeled self.username_lbl = QLabel ('username', manually) self.username_lbl.move (5, 5) self.username = QLineEdit (self) self.username Set Placeholder Text ("Some Usernames") Allow labeling between # Label and blankbox-box for 100px and # 5px each for left borders, and #smart #smartself.username.setMinimumWidth (285) # this five Keep the pixels labeled for self.username.move (110, 5) # for the label self.password_lbl = QLabel ('Pa Word: 'Self) # 5 pixel indent, the last pair is less than 25 pixels widgets self.password_lbl.move (5, 50) # recipient control is an entry text box self.password = QLineEdit (self) # Add some ghost text to enter self.password.setPlaceholderText the sort of thing ( "a password") Greetings self.password.setMinimumWidth (285) as the salutation # the same indent but 25 pixels at self.password.move (110, 50) As the same width # then it decreases 45 pixels: (self, 'guest wifi password is') # Costs as well as indent others, but the # character self.password.setEchoMode (QLineEdit.Password) # Greeting widget indicates self.guestWifi_lbl = QLabel labeled Hide # by physical separation, function self.guestWifi_lbl.move (5, 100) # Greeting widget also has a label self.greeting = QLabel ('', itself) # The same indent is in the form of other self-control. Self.greeting.move (175, 100) # Build button is a push button self Build_button = QPushButton ('submit', manually) # Keep it on the bottom right, # other interactive widgets from the sync itself. Build_button.setMinimumWidth (145) self.build_button.move (250, 150) def run (manually): # Show form self.show () # qt_app run qt application. Exec_ () app = pygui () app.run () ` 

And here is the Python script, (I know that it works because I already print it from the value of the script Instead of returning it in the form of a.)

  #! BeautifulSoup import BeautifulSoup import re def /usr/bin/python2.7 import getWifiPassword (username, password) Urllib2 Getpass: URL = 'someurl' # username = getpass._raw_input ( 'What's your username? " ) # password = getpass.unix_getpass ( 'password') P = urllib2.HTTPPasswordMgrWithDefaultRealm () p.add_password (No, URL, username, password) handler = urllib2.HTTPBasicAuthHandler (P) opener = urllib2.build_opener (handler ) Urllib2.install_opener (opener) page = urllib2.urlopen (url) .read () soup = BeautifulSoup (page) data = date Soup.findAll ('Strong') for D in A: value = re.sub (".? & Lt; * & gt;" "", str (d)) return value  
< P> Any help would be greatly appreciated as Qt and GTK actually kick my butt. Thanks!


ruby on rails - Pry keeps breaking although I removed binding.pry -


मणि 'pry-rails' का उपयोग करना मैं bundle exec rails c उत्पादन को चलाता हूं और मणि-सीडी मंगॉइड निष्पादित करता हूं। फिर संपादित करें lib / mongoid / sessions / storage_options.rb को चलाकर storage_options.rb खोला गया। मैंने कुछ पंक्ति में एक ब्रेकपॉइंट (बंधन।) रख दिया और फ़ाइल को बंद कर दिया। मैंने कुछ परीक्षण किया और ठीक से डीबग किया। जब मैं वापस आया और ब्रेकपॉइंट से छुटकारा पा लिया, Pry उसी बिंदु पर रोकता रहा, हालांकि बाध्यकारी। अब नहीं है (कम से कम जो मैं कंसोल पर देखता हूं) और जब मैं फ़ाइल को संपादित करता हूँ :

इससे पहले:

  से: / यूज़र्स / बोरजगावो /। आरबीएएन / संस्करण 2/2 / lib / ruby/gems/2.1.0/bundler/ruby/ 2.1.0 / रत्न / मौंगॉइड -4.0.2 / लिबर / मोंगॉइड / सत्र / स्टोरेज_ोपिप्शन। आरबी @ लाइन 134 मंगॉएड :: सत्र :: स्टोरेजओपॉशन :: क्लासडेथ विधि #__ मूल्यांकन करना: 12 9: # @ रिटर्न [प्रतीक] प्रतीक के रूप में मूल्य । 130: # 131: # @since 3.1.0 132: def __evaluate___ (नाम) 133: बाइंडिंग.पीरी = & gt; 134: वापसी शून्य जब तक नाम 135: name.respond_to? (: Call)? Name.call.to_sym: name.to_sym 136: अंत 137: अंत 138: अंत 13 9: अंत 140: अंत [1] pry (उपयोगकर्ता) & gt;  

के बाद:

  से: / यूज़र्स / बोरजगावो /। Rbenv /versions/2.1.2/lib/ruby/gems/2.1.0/bundler /ruby/2.1.0/gems/mongoid-4.0.2/lib/mongoid/sessions/storage_options.rb @ रेखा 134 मौनगेट :: सत्र :: संग्रहण विकल्प :: क्लासमैथिप्स #__ मूल्यांकन करना__: 129: # रेटन [प्रतीक] मूल्य एक प्रतीक के रूप में 130: # 131: # @ 3.1.0 132: def __evaluate __ (नाम) 133: वापसी शून्य जब तक कि नाम = & gt; 134: name.respond_to? (: कॉल)? Name.call.to_sym: name.to_sym 135: अंत 136: अंत 137: अंत 138: अंत 13 9: अंत [1] pry (उपयोगकर्ता) & gt;  

ऐसा क्यों होता है? मैं ब्रेकपॉइंट कैसे हटा सकता हूं?

आपको अपने सर्वर को पुनरारंभ करना होगा, अन्यथा रूबी पुनः लोड नहीं करेगी फ़ाइल और आपके परिवर्तन नहीं देखेंगे।


java - Jenkins unable to connect to ldaps://server -


I'm trying to connect Jenkins to the LDAP server. I have set the configuration to Jenkins, but I get your message is:

Unable to connect to ldaps: //ldap.my.server.com: javax.naming.CommunicationException: simple bind failed: ldap .my.server.com: 636 [root exception javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: find valid certification path Unable to Request Goal]

I know because my SSL certificate is self signed, but why Is there any way that I can ignore it in Jenkins is?

Your trusted server does not trust the server certificate. If it is self-signed then you have to export it to the server and it will have to be imported into your customer truststore, still better, sign it.


ubuntu - Running Qt5 GUI in Docker -


I am trying to run the GOI app (V-REP) inside the Dock, which has been suggested:

Have read the answers to similar questions and tried and tried xauth but keep getting the same error. Using i

I appreciate any suggestions and appreciate how to use VNC program to actually connect, because I'm not familiar with that process.

The program is run:

  Make Docker-Run-VAP  

If they are useful, then they are.


java - Android Intercept Unhandled Exceptions -


So I want to prevent unconfirmed exceptions and I am doing this:

  thread .setDefaultUncaughtExceptionHandler (new thread). UncategorizedAppsHandler () {@Override to send public zero uncaughtException (Thread T, Throws E) {// LOGS System.exit (2);}}) to my custom code;  

Anyway, can I execute my custom code and then handle it with exceptions and resume it normally? system.exit is not working as trusted because I believe that I'm having some hanging problems.

You must first obtain the default handler. Then send the handler to the blocker and the error System.exit ... is a bad idea.

Then you make a custom exception handler as you did:

  The public class implements the CustomExceptionHandler thread. UncaughtExceptionHandler {Private Final Thread .UncaughtExceptionHandler DefaultUEH; Public CustomExceptionHandler (Thread.UncaughtExceptionHandler defaultUEH) {this.defaultUEH = defaultUEH; } @ Override public empty trace string (ex); String StackTrace = Log .getStackTraceString (ex); String Time = New Date (SystemCurrentTime) ToString (); String message = ex.getMessage (); // Send Logs ... Default: H. Enqueued Expression (thread, pre); }}  

So basically set the default exception handler (in the best use custom application category to drop it in all parts) if not already set (Not required in application):

  thread. Unwanted Exhibit Handler DefaultUH = Thread.GetDigitalAnrollExceptionHandler (); If (Default (EEH example customExceptionHandler)) {Thread.setDefaultUncaughtExceptionHandler (New CustomExceptionHandler (defaultUEH)); }  

I have written it (delete the BuildConfig.DEBUG check) to start the email client directly. If no email client is installed, then you have to catch the ActivityNotFoundException