Wednesday, 15 July 2015

excel - Dividing time to get a percentage -


This is my setup: I am creating a log for a time event that I am doing (think It seems like running), split in split time with a compressed time, formatted as [hh: mm: ss.000] time values.

What I want to do is to find out how much time is in the form of a percentage of cumulative time

What I'm going to do, basically A6 (Segment) ) / A10 (cumulative time) * 100 , although this formula certainly does not work.

If the stop clock time (start with 0 in A0) So try below B2 in the form of suits and percentages:

  = (A2-A1) / A $ 10  

java - im trying to get the index of a character using only the charAt and length methods for strings -


I am trying to get an index of letters, only four art and long ways to use stars. This is the same question that asks: Declare a public law, which takes a character parameter named Indexof and gives the indicator in the stored string of the first occurrence of that character -1 or if the character is not found. This is what I have to do.

  public int indexOf (char c) {for (i = 0; i & lt; string.length - 1; i ++) {if (string.charAt (c) == string .charAt (i)) {return i; Other {return -1; }}  

You to loop 0 to length () - 1 , and test the value parity of charAt (index) with the given character


Translate query to Laravel Eloquent Model -


How do I translate the following query into a format that can parse Laravel ?

Select the posts, titles from posts, albums where post. Id !: album. Post_id

now have ORM links

< P> a

So far I have

post with I :: ('album') -> select ('id', 'title') - > Get ();

I do not know how to declare the condition

Please read the docs again, I think If you use a well known ORM, then the biggest reason for its relationship is "yes"

you can query for

An example in a link is just fill in your query and you're done.


cannot seem to get bitmap from view in android -


My problem is similar to one.

my code to work with the method

P>

  private bitmap getBitmapFromView (View v) {v.setDrawingCacheEnabled (true); Wkmasur (Measurespeskmakemeasurespes (0, Measurespeskunspesifaiad), Measurespeskmakemeasurespes (0, Measurespeskunspesifaiad)); V.layout (0, 0, v.getmesuredWidth), v.getMeasuredHeight ()); V.buildDrawingCache (true); Bitmap b = bitmap.kreatebitmap (v.getDrawingCache ()); V.setDrawingCacheEnabled (false); // Clear drawing cache returns b; }  

But today I after changes have changed the XML layout files I line Bitmap b = Bitmapkkretebitmap (v.getDrawingCache ()) NullPointerException Receiving. I

  public static bitmap loadBitmapFromView (View v) {Bitmap b = Bitmap.createBitmap (v.getLayoutParams (). Width method  getBitmapFromView  try to change Key, V.getLayoutParams (). Height, Bitmap.sf. ARGB_8888); Canvas C = new canvas (B); V.layout (0, 0, v.getLayoutParams (). Width, v.getLayoutParams (). Height); V.draw (c); Return b; }  

But this did not help, I get null in the first line.

The situation is: I am trying to convert the view into bitmap. But I'm doing this without displaying the scene on the screen. Again, it all worked until I changed the content of the XML layout file. The change was not too big I just removed the stuff and removed - yes it was removed - some sub-scenes.

In any case, I know that there is no problem with my layout file because I can display it on screen if I want to; Which I have done as part of troubleshooting.

Someone has suggested using a handler to call getDrawingCache () . If he answers this question, how would I write that code?

Update

  View View = activity.getLayoutInflater () increase. (R Layout My_view, blank, incorrect); FindViewsByIds (see); // where I inflate sub-views and add content to them  

After

createBitmapFromView is executed when the view is measured.

  public static zero performance when see (Last View View, Final Runnab Runner) {if (view.getMeasuredHeight () == 0 || view.getMeasuredWidth () == 0) {view.getViewTreeObserver (). AddOnGlobalLayoutListener (New ViewTreeObserver.OnGlobalLayoutListener) {@Override Public Layer on Public Zero () {runnable.run (); RemoveGlobalOnLayoutListener (see, this);}}); } And {runnable.run (); }} Public static bitmap createBitmapFromView (View) {Bitmap bitmap = Bitmap.createBitmap (view.getMeasuredWidth (), view.getMeasuredHeight (), Bitmap.Config.ARGB_8888); Canvas canvas = new canvas (bitmap); View.draw (canvas); Return bitmap; } @TargetApi (Build.VERSION_CODES.JELLY_BEAN) public to view static void removeGlobalOnLayoutListener (see, ViewTreeObserver.OnGlobalLayoutListener listener) {try {view.getViewTreeObserver () removeOnGlobalLayoutListener (listener). } Hold (Noschamparter E. E) {view.getViewTreeObserver (). RemoveGlobalOnLayoutListener (listener); }} ExecuteWhenViewMeasured (see, new Runnabel) {@Override Public Zero Run () {bitmap bitmap = createBitmapFromView (see);}});  

Java generics - Don't allow subclasses -


I have a question about generic, then say that I have 3 squares "foo", "bar" (which fu Subclass is), a square "factory" and an interface "test interface". I want to write a general method, which only allows objects that implement the "straight" interface, so there is no subclass. This is very difficult for me, because Java 8 seems "smart" compared to Java 7.

Then there is an example:

  Public Interface Test Interface & lt; Expansion of T-Test Interface & lt; T & gt; & Gt; Public Square Foo Exam Interface & lt; Foo & gt; {}  

  Expands the public class bar {/ code>   

  Fu {}  

  Public class factory {Public stable and lieutenant; Expands T's Test Interface & lt; T & gt; & Gt; T doSth (T-ARGE) {return arg; }}  

OK, these are my classes. I now want to allow Foo-objects in this case because of the doSth (T arg) method This is the only class that implements the "straight" interface.

Obviously sth will no longer compile in this way:

b> factory.dos (new bar);

Since the bar TestInterface & lt; Bars & gt;

OK, my problem is now, that this line will compile without any issues:

  FUF = FACTORY. Doth (new bar);  

Although the normal parameters should also apply the interface to T and T with their own class (sorry, actually do not know how to say it, hope you know it That's what I mean) The compiler accepts "bar" as the parameter

then the compiler should "behave like okay, the bar does not fit, but maybe a super class would fit." And then it "sees" that it works with Superlex "Foo". And then the bar will be explained like fu because every time there is some type of fu or something like that ?? At least this is how I imagine it.

OK, if I try to compile the line with Java 7, then it fails. So it seems that the Java 8 is a bit smarter with type-arasher ?!

There is no way to allow subclasses in Java 9, so that it will not be compiled ?:

  Foo F = Factory.doth (new bar) );  

Hope you will understand my problem, I'm rarely writing in English.

Greetings

Reasons Foo F = Factory.dom (new bar ()); Works in Java 8 and Java is not 7 because Java 8 has a better type of estimate in Java 7 this type is estimated:

  FUF = Factory. & Lt; Bars & gt; Dasath (new bar ());   

Bar TestInterface , but this is TestInterface & lt; Foo & gt; is applied by inheritance to the Java 8 type of estimation, and this type would be estimated:

  FUF = Factory & Lt; Foo & gt; Dasath (new bar ());  

Note that factory. & Lt; Foo & gt; DoSth () expects that Foo as argument is applied to new bar () implications on foo that works fine Does.

I am afraid that there is no way around it. You will always be able to uplift an object in your superclass. You can create Foo last , but it does not allow full subclassing of Foo .


python - Resolving TypeError str doesn't support the buffer API -


I am trying to match the following code, but I run in a TypeError: type str buffer is not supported API does How can this be solved?

  file = open ("C: \\ user \\ sagars \\ desktop \\ newips.json", "rb") i = 0 y = "not for line in file" Information available for "IP": z = line print (z) if y in z: print ("can not be parsed") Other: print ("can pars!")  
< / Div>

You are reading the file as binary (instead of 'rb' which is probably messing it up) This code snippet is slightly more idiotic:

  open As ('C: \\ user \\ sagars \\ desktop \\ newips.json', 'r') f: line = F.readline () if y in line: print ("can not be parsed ") And: print (" can pars! ")  

Java, operator overloading and "+" operator for String -


I suspect operator overloading in Java. I know that the Java operator does not support overloading, but then the "+" operator is doing it in a valid Java program:

  import java.util *; Import java.lang *; Import java.io * *; Class operator ologingtest {public static zero main (string [] args) java.lang.Exception throws {string str1 = "operator"; String str2 = "overloading"; String str3 = str1 + str2; Println (str3); }} Stout: Operator overloading  

This operator is not "overloaded", it is pre-installed String Consensitivity Operator Designated Operator,

15.18.1 String Coordination Operator +

If only one operand expression type is string, then string conversion (§5.1.11) is used to prepare strings at run time on other operands. The result of the string combination is a reference to the string object, which is a combination of two operand strings.

In other words, when Java sees

  string races = string obz + some obj;  someObj.toString () . 


Filter column values (different) one by one using Excel VBA -


I'm trying to filter the values ​​of column one. The price under the filter is different every time is there any way that the macro can capture it.

  Sub Macro 1 () Sheets ("Open"). Choose less than 0 invoice values. ActiveSheet.Range ("$ A $ 1: $ R $ 2700") Auto Filter Field: = 11, Criteria1:. = "& Lt; 0", _ operator: = xlAnd 'Selected Country ActiveSheet.Range ("$ A $ 1: $ R $ 2700") Auto Filter Field: = 3, Criteria1. : = "ARG" 'Selected invoice # ActiveSheet.Range ("$ A $ 1: $ R $ 2700") Auto Filter Field:. = 7, Criteria1 :. = "1,007,225" category ("G528") Select ActiveSheet.Range ("$ A $ 1: $ R $ 2700") Auto Filter Field:. = 7, Criteria1: = "1,015,678" ActiveSheet.Range ("$ A $ 1: $ R $ 2700".) Auto Filter Field: = 7, Criteria1: = "1,018,523" range ("G1"). Choose ActiveSheet.Range ("$ A $ 1: $ R $ 2700"). AutoFilter Field: = 7, Criteria 1: = "1018962" end sub  

stuff your . Find the set using the AutoFilter field in the Nested Variant array and by using Rank . With LBound and UBound .

  sub a1Multi_Filter () as Dim V Long, vCRITs version as dim vKey version, dCOL7s New Scripting.Dictionary dCOL7s.CompareMode = BinaryCompare vCRITs = array (array as 11 , Array (7, "1015678"), _ Array (7, "1018523", "Array"), _ Array (3, "ARAG"), _ Array (7, "1007225"), _ ), _Arere (7, "1018962") for ActiveSheet.Cells (1, 1) V.CurrentRegion .AutoFilter = LBound (vCRITs, 1) to UBound (vCRITs, 1) .AutoFilter field: = vCRITs (v ) (0), Criteria1: = vCRITs (v) (1) "Pause and processing for effect" MSBBX "array presets" & amp; Chr (10) & "Filt ("0") & amp; "for" & amp; VCRITs (v) (1); & amp; nbsp; (0, 0) & amp; "On the Columns" & amp; Crow (64 + VCRTS (V) ) .AutoFilter field: = vCRITs (v) (0) Next v. AutoFilter for v = 2 .Rows.Count if cinchool (lane (V, 7). Value) and not dCOL7s.Exists (.csells (v , 7) .Value) then _dCOL7s.Add key: = cells (v, 7) .Value, Item: for each vKey = 7 Next to V. dCOL7s.Keys' V = 0 (DCOL 7. Number -1). Autofilter field: = DCOL 7 Item (VKA), Criterion 1: = Message for Pause and Processing for Effects Box "Column 7 Special" & amp; Chr (10) & amp; "Filtered" & amp; . Leaf (0, 0) & amp; "On column" & amp; Crow (64 + DCOL 7. Item (VKA) & amp; "For" & amp; VKey .AutoFilter Field: = dCOL7s.Item (vKey) with the next vKey end dCOL7s.RemoveAll: Set dCOL7s = Something End  

I leave you many rooms for processing and messaging The text should be used to help explain the elements of the variant array (A).

After setting field arguments and set criteria for the criteria, uses for ... next loop for the limitations of the processing of lower and upper limitations of the first rank . Each set has been applied in turn and I stopped it with an Assembled box, showing the AutoFilter category, filtered field and filter criteria. After 'processing', auto filters for the area are cleared in preparation for the next.

Appendix:

I added the unique items in a scripting dictionary from the collection column, and then each key has the same . AutoFilter is bicycle through the document key and item, using filters and criteria as the . To use a scripting dictionary, you should go to VBE's device ► References and add Microsoft scripting runtime to the project. It should be added only once; Not for every computer that it can run but if a new project has been started which uses a scripting dictionary, then that project should also be added.


How to get two files from the terminal to be used by a class (as in java.io.File) -


So I'm taking two files (most likely) and passing them through a terminal in a class , Which will be used later in the input and scan with a buffered reader. Although I am having difficulty finding out how to do this through the terminal and not only call indiscriminate file names in the code.

The end result of the call should look like this

  java & lt; Class & gt; FileA.txt fileB.txt  

or

  Java & lt; Class & gt; Desktop / FileAntest Document / File B.txt  

Can use:

  public static zero main (string algos []) {if (args.length & lt; 2) throw new exception runtime ("2 arges should be!"); File file 1 = new file (args [0]); File file 2 = new file (args [1]); }  

jax rs - How to get RESTEasy to use system web proxy? -


I am using a lush client in Java 8 with RESTEasy 3.0.10. As an implementation of the funnel windows 7 64-bit uses RESTEasy in place of the Apache httpclient 4.2.6.

I have to manually specify a web proxy for the httpclient, so if I configure a in my code ResteasyClientBuilder use a specially configured ApacheHttpClient4Engine , use my RESTEasy client connection correctly proxy.

My problem is that I would use the java.net.useSystemProxies system property so that my Java program which is configured in the Proxy Windows Internet Options, will use , So that my Java program will work seamlessly with other programs and it is not necessary that it can be specifically configured. It works fine for connections using Java's native HTTP connection. But the RESTEasy / Apache httpclient apparently opens a straightforward socket and makes its HTTP communication at a low level.

When I tell Java to use the system proxy, Java actually routs the httpclient connection to the proxy. But for some reason, the httpclient thinks this is a SOCKS proxy --- or some other --- the request bar is talking to:

  java.net.SocketException: SOCKS proxy can not connect: connection timed out are: java.net.Socket.connect (Socket.java:589) org.apache.http.conn.scheme.PlainSocketFactory.connectSocket (at JavaknetkSocksSocketImplkconnect ( SocksSocketImpl.java:429) connected on Org.apache.http.impl.conn.ManagedClientConnectionImpl.open (org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection PlainSocketFactory.java:127) to (DefaultClientConnectionOperator.java:180) (ManagedClientConnectionImpl.java:294) .apache.http.impl.client.DefaultRequestDirector.tryConnect org.ap On ache.http.impl.client.DefaultRequestDirector.execute (DefaultRequestDirector.java:479) (DefaultRequestDirector.java:643) on Org.apache.http.impl.client.AbstractHttpClient.exec on org.apache.http.impl.client .AbstractHttpClient.execute (AbstractHttpClient.java:906). Ort.exe (AbstractHttpClient.java:805) org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke at (ApacheHttpClient4Engine.java:283) at org.jboss. Resteasy.client.jaxrs.internal.ClientInvocation.invoke (Client Invocation. Java: 407) at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.get (ClientInvocationBuilder.java:159) having  

close SOCKS routing another default proxy selector And in reality this same system prevents the httpclient socket from being routed to the proxy --- but then the HTTP connection completely overrides the proxy, which aims to ignore.

I'm guessing here that the httpclient only asks for one socket, and the Java system looks at the proxy and assumes that the socket connection is for a sock proxy, even if I guess If the Java Sockets have been passed in the Web Proxy, then the httpclient will not know anything about it and as a result the correct proxy format of the HTTP request has not been seen. Or will you see in any manner that java.net.useSystemProxies is turned on, and will change its request? But how will it know if the system proxy is actually in effect or not?

So I'm completely at a standstill. If I java.net.useSystemProxies on thee, and turn on the normal HTTP requests in Java, so they use the system configured web proxy I I made system-configured web proxy How can I tell RESTEasy / httpclient to use?


APACHE PIG CAN'T LOAD BAG -


I have a file test.txt with the following bag:

  {(es , (1,), (D, 1), (PA, 1), (RO, 1), (such, 1)} {(SS, 1), (D, 1), (this, 2) , (1), (Ps, 1), (ro, 1), (such, 1)} {(es, 1), (d, 1), (such, 1)}  
P> I want to load them into pigs

  as A = load 'test.txt' (language_bag: bag {t: (a: chararray, f: int)});  

And I get the following error.

[main] error org.apache.pig.tools.grunt.Grunt- Error 1200: mismatch input '; 'RIGHT_PAREN Expectation'

Description on logfile: /homes/ruthgavi/Projects/Conferences/PigScripts/pig_1426528460732.log

Does anyone help me to understand that What I am doing: (

It may be useful.

  A = Load Test.txt "(language_bag: bag {t: tuple (a: charrray, f: int)}); c = foreach; generated language_bag.a, language_bag.f; dump c;  

junit - Trouble with assertEquals (Java) -


I'm trying to make a game of "rock, paper, scissors". I have such tests:

  @Test Public Zero Rockbatscissors () {assertEquals (rock, rock.vs (scissors)); }  

I think it should be enough to form a function, for example:

  Public square rock {Object vs (scissors) } Rock(); } Object vs (Paper P) {Return new paper (); } Object vs (Rock R) {New Rock (Return); } Boolean equivalent (rock R) {return true; } Boolean equivalent (Paper P) {return false; } Boolean par (scissors) {return false; }}  

(I know that I should add the Hashkod function, by the way) I run the test and only I get the failure. What am i doing

equal () code> emphasis () Which takes object as the argument. Right now, you have not overridden the object # equals () method, but use your own 3 equal method, which will not even be used, and thus the default The object class method is used, which compares the context.

You have to give the following implementation:

  / ** * Terrible 'par ()' method implementation. Just for display purpose * / @ Override public boolean equivalent (object oBJ) {Oz example for returning to rock; }  

timeout - mysql workbench "Lost connection to mysql server" -


Firstly, I need to indicate that I have run a SQL file on Wikipedia dump on my machine and I may have to update many settings about the index size available on memory and some other settings. I just want to mention that those large SQL queries were successfully run and About if there was no problem.

Now I have a table pjlnx (pl_from, pl_title) which appears in each Wikipedia page, for example the data (1, "title1"), (1, "title) 2 "), (2," title 3 "), (2," title 1 "). I want to create a table which is titled by group group pl_fr for this, this is my SQL query (I am using workbench):

  SET @@ group_concat_max_len = 150000;  

I found an error in running this query: Link to the table "The connection to mysql server was lost during the query" (the keyword playlist, group_concat (pl_title, '')) and the system Asked me again for the password. So I searched and found. So I changed net_read_timeout to 1000 and connect_timeout to 60. This problem did not resolve, so I changed the query:

  SET @@ group_concat_max_len = 150000; Create table concatpagelinks (select pl_from, GROUP_CONCAT (pl_title, '') as link pagelinks group by pl_from 0,1000)  

Still the same problem, and surprisingly That every time the query runs for 600.495 seconds and the error occurs.

You can try to change the timeout value in the workspace. Visit: → Edit → Preferences → SQL Editor → Time to Read DBMS Connection

For more information, refer to this post:

Or in price Try to increase: Edit → Preferences → SQL Editor → DBMS Connections Keep Live Interval


ios - How to write in a new shader file in SceneKit: consecutive statements on a line must be separated by ;? -


I'm starting with SceneKit and shaders, I created a fast file, changed its name to its name. Shader, and I added this:

  Uniform sample is 2D RTBL; // This horizontal blot should be changed by changing the VC2 vTexCoord to the text provided; Const Float Blur Size = 1.0 / 512.0; Zodiac + = Texture 2D (RTLR, vC2 (vTexCoord.x, vTexCoord.y - 4.0 * Blur Size)) * 0.05; Zodiac + = Texture 2D (RTLL, VTexCoord.y - 3.0 * Blur Size) * 0.09; Zodiac + = Texture 2D (RTL, VTexCoord.y - 2.0 * Blur Size)) * 0.12; Zodiac + = Texture 2D (vTexCoord.x, vTexCoord.y - blurSize)) * 0.15; Zodiac + = Texture 2D (vTexCoord.x, vTexCoord.y)) * 0.16; Yoga + = Texture 2D (RTLL, vTexCoord.x, vTexCoord.y + Blur Size) * 0.15; Zodiac + = Texture 2D (RTLL, VTexCoord.y + 2.0 * Blur Size) * 0.12; Zodiac + = Texture 2D (RTLL, VTexCoord.y + 3.0 * Blur Size) * 0.09; Zodiac + = texture 2d (rtblr, vc 2 (vTexCoord.x, vTexCoord.y + 4.0 * blur size)) * 0.05; Gl_FragColor = sum; Blue Tutorial  

But I get 3 errors on 3 first rows: It asks me to add a ; :

Enter image details here

I have not understood the problem

thanks

I created a fast file It has changed its name to MyFragment.shader

This is your problem.

When you add a file to your project, Xcode determines what kind of file this is. If you make SWIFT files, then it will compile with Swift Compiler. (And the swift compiler will not expect to write the contents of that file in Swift, not GLSL.)

You do not want to compile your shaders as a native (CPU) source when your app runs So by OpenLL the shader (for the GPU) is compiled, so that you copy them to your bundle and send it to GL (in your case via the sineaket), when you are ready to use them Be the first one.

The file processing rules in your project are not automatically changed when you rename the file type extension. (This is because you can use a different extension than the default of Xcode for some file types.) So, here are two fixes for two different references:

Build for an existing file Change the rules

Whatever you've got, you probably do not want to recreate some parts of your project, you just want to tell Zedod to treat your shader as a shader, Swift source In the Select your project in the Navigator, go to the Build phase and myFragment.shader Copy to copy the compiled sources bundle resources.

Enter image details here

Add a new file right Creating Rules

You can avoid the above after creating new shader files If you create a new file by using the empty file template, then it is already bundled with the resource Will be considered as a form, so you do not need to do anything further.

Enter image details here

Similarly, if you .shader or .fsh or .vsh (or actually anything that is not SWIFT / C / OBJC / etc source file) your project , Which will be considered as bundled processing by default.


wordpress - Mailchimp Batch Subscribe 2.0 Returns False on 500+ records (PHP) -


I have a PHP script to update Mailchimp using the batch-subscribe from my WordPress userlist. ()

When I send about 400 records, everything works fine. All records have been added, and I get a return from the number of extra records from the API, etc.

If I have around 600 or more (I have 730 customers), then all records are added to the scam, but the API returns false, I check it again with false ===, and it's wrong is. I did not get any error - it just returns false (but all records are added to the mailchap).

Mailchimp says "Max batch size varies depending on the amount of data in each record, although you have 5k-10k records based on your experience."

I'm not close to that, and every record is being added to the mailchip list just fine. I did not get a refund from the API.

I increased my timeout value to 5 minutes. I also switched to using different records, suspecting that I might have a record with something that is messing it up, but there was a similar behavior with its various records.

I'm using the DrewM library interface with Mailchimp API version 2.0 I'm sure that the DrewM is using the post for the request, and it does. ()

Any thoughts that are happening due to this?

Here is the code:

  function mailchip dialupdate () {set_time_limit (300); $ Api = get_mc_api (); $ McListId = get_mc_mailing_list (); $ MailChimp = New \ Drewm \ MailChimp ($ api);  

...

  foreach ($ $ bloggers as a user) {$ userinfo = get_userdata ($ user-> ID); $ Location = ... // code to obtain the location $ merge_vars = array ('FNAME' => $ userinfo- & gt; first_name, 'name' = & gt; $ userinfo- & gt; last_name, 'MMERGE3' => $ userinfo- & gt; user_login, // username 'MMERGE6' => $ location // location); $ Batch [] = array ('email' = & gt; array ('email' = & gt; $ user- & gt; user_mail), 'merge_wars' = & gt; $ merge_vars); } // and forehack // mailchap calls $ reval = $ MailChimp- & gt; Call ('lists / batch-subscribed', array ('id' => $ MCLIIID, // your mailchip list id 'batch' => $ batch, 'update_existing' => true)); If ($ retval === false) {resonant "mailcip API returned"; } Echo: 'Added:' $ ['add_count'] "
"; Resonance 'updated:' $ retal ['update_count'] "
"; Echo 'Errors:' $ Retal ['error_count'] "
"; }

With support from Mailchimp support, I can trace the problem and solve it Was able to.

The issue was actually in the Dru M envelope. The content-length section of the header was apparently not working correctly on long calls. I removed it, and everything started working fine.

The basic section of the DrewM code (not working):

  $ result = file_get_contents ($ url, null, stream_context_create (array ('http' = & gt; ; Array ('protocol_version' => 1.1, 'user_agent' => 'PHP-MCAPI / 2.0', 'method' = & gt; 'POST', 'header' = & gt; "content-" content \ R \ n "." Strlen ($ json_data). "\ R \ n", 'content' = & gt; $ json_data,),)));  

Update section of code (function):

  $ result = file_get_contents ($ url, null, stream_context_create (array ('http' = & gt; Array ('protocol_version' => 1.1, 'user_agent' = & gt; 'PHP-MCAPI / 2.0', 'method' = & gt; 'POST', 'header' => "content-type: app / Jason \ r \ N "." Connection: Closed \ r \ n ", 'Content' = & gt; $ json_data,),)));  

hibernate - Spring Data JPA map the result to Non-Entity POJO -


मेरे पास एक देशी क्वेरी के साथ स्प्रिंग डेटा संग्रह पद्धति है

  @Query (value = "जी का चयन करें *, ग्राम * से समूह जी वाम group_members शामिल हों ग्राम पर g.group_id = gm.group_id और gm.user_id =:।। userId कहां g.group_id =: ग्रुप", nativeQuery = true) GroupDetails getGroupDetails (@param ( "यूज़रआईडी") पूर्णांक उपयोगकर्ता आईडी, परम ("समूह आईडी") पूर्णांक समूह आईडी);  

और मैं नॉन-यूनिट POJO GroupDetails के लिए परिणाम मैप करना चाहता हूं।

क्या यह संभव है और यदि ऐसा है, तो क्या आप एक उदाहरण प्रदान करें?

orid के जवाब के रूप में मान लिया जाये कि GroupDetails आप जेपीए 2.1 की कोशिश की है?

  @SqlResultSetMapping (नाम = "groupDetailsMapping", वर्ग = {@ConstructorResult (targetClass = GroupDetails.class, कॉलम = {@ColumnResult (नाम = "GROUP_ID"), @ColumnResult (नाम = "USER_ID")} )}) @NamedNativeQuery (नाम = "getGroupDetails", क्वेरी = "जी का चयन करें *, ग्राम * से समूह जी वाम group_members शामिल हों ग्राम पर g.group_id = gm.group_id और gm.user_id =:।। userId कहां g.group_id = : ग्रुप ", resultSetMapping =" groupDetailsMapping ")  

और उपयोग रिपोजिटरी इंटरफ़ेस में निम्नलिखित:

  GroupDetails getGroupDetails (@param (" उपयोगकर्ता id ") पूर्णांक userId , परम ("समूह आईडी") पूर्णांक ग्रो upId);  

स्प्रिंग डाटा जेपीए के अनुसार, वसंत पहले नामित क्वेरी अपने विधि नाम से मेल खाते की तलाश करेगा - का उपयोग करके ऐसा @NamedNativeQuery , @SqlResultSetMapping और @ कॉन्स्ट्रस्ट्रर रिजल्ट आपको उस व्यवहार को प्राप्त करने में सक्षम होना चाहिए


php - why it output: the query is empty -


  mysql_select_db ($ डेटाबेस) या मर ("डेटाबेस का चयन करने में असमर्थ"); यदि (isset ($ _GET ['projectID'])) {$ query = "चयन करें taskID, नाम, start date, कार्य से कार्य समाप्त WHERE projectID =" $ _GET ['प्रोजेक्टआईडी'] "ऑर्डर ऑफ़ टास्कआईडी एएससी"; } $ Result = mysql_query ($ query) या die ("क्वेरी निष्पादित करने में असमर्थ:"। Mysql_error ()); गूंज "& lt;; DOCTYPE html & gt; & lt; html & gt;"; जबकि ($ पंक्ति = mysql_fetch_array ($ परिणाम, MYSQL_ASSOC)) {गूंजती "& lt; tr & gt;"; गूंज "& lt; td & gt;"; गूंज "& lt; a href = 'q7.php? ProjectID ="। $ _GET ['प्रोजेक्टआईडी'] 'और टास्कआईडी =' $ पंक्ति ['टास्कआईडी'] " '& Gt;"; गूंज "& lt; / td & gt;"; गूंज "& lt; td & gt;"। $ पंक्ति ['नाम']। "& Lt; / td & gt;"; गूंज "& lt; td & gt;"। $ पंक्ति ['स्टार्टडेट']। "& Lt; / td & gt;"; गूंज "& lt; td & gt;"। $ पंक्ति ['समाप्ति']। "& Lt; / td & gt;"; गूंज "& lt; / tr & gt;"; }  

मैं प्रोजेक्ट आईडी की जानकारी का उत्पादन करने की कोशिश कर रहा हूं, जो कि किसी अन्य php से मिलती है। लेकिन आउटपुट है: क्वेरी खाली है। कोड में क्या गलत है? मैंने उन कोडों को छोड़ दिया है जो इससे कोई फर्क नहीं पड़ता कृपया मुझे कुछ सलाह दें।

परियोजना आईडी ठीक से पारित नहीं किया गया है। और निम्नलिखित कोड में गुजर रहा है क्या आप कृपया बग को समझने में मेरी मदद कर सकते हैं?

  गूंज "& lt; form method = 'get' action = 'q6.php' & gt;"; "परियोजनाओं और नामों को प्रतिध्वनित करें:"; गूंज "& lt; चुनें & gt;"; जबकि ($ पंक्ति = mysql_fetch_array ($ परिणाम, MYSQL_ASSOC)) {गूंजता "& lt; विकल्प मान = '"। $ पंक्ति [' projectID ']।' 'चौड़ाई =' 150 '& gt; "; प्रति पंक्ति गूंज ['projectID']। ":"। $ पंक्ति ['नाम']; गूंज "& lt; / option & gt;"; } गूंजती "& lt; / select & gt;"; गूंज "& lt; input type = 'submit' name = 'submit' मान = 'जमा करें' & gt;"; गूंज "& lt; / form & gt;";  

क्वेरी स्ट्रिंग सेट करने के बाद अपनी क्वेरी निष्पादित करने की कोशिश करें:

<पूर्व> गूंज "& lt;; DOCTYPE html & gt; & lt; html & gt;"; अगर (isset ($ _GET ['projectID'])) {mysql_select_db ($ डेटाबेस) या मर ("डेटाबेस का चयन करने में असमर्थ"); $ Query = "चुनें taskID, नाम, start date, कार्य से endDate WHERE projectID ="। $ _GET ['प्रोजेक्टआईडी'] "ऑर्डर ऑफ़ टास्कआईडी एएससी"; $ परिणाम = mysql_query ($ क्वेरी) या मर ("क्वेरी निष्पादित करने में असमर्थ:"। Mysql_error ()); जबकि ($ पंक्ति = mysql_fetch_array ($ परिणाम, MYSQL_ASSOC)) {गूंजती "& lt; tr & gt;"; गूंज "& lt; td & gt;"; गूंज "& lt; a href = 'q7.php? ProjectID ="। $ _GET ['प्रोजेक्टआईडी'] 'और टास्कआईडी =' $ पंक्ति ['टास्कआईडी'] " '& Gt;"; गूंज "& lt; / td & gt;"; गूंज "& lt; td & gt;"। $ पंक्ति ['नाम']। "& Lt; / td & gt;"; गूंज "& lt; td & gt;"। $ पंक्ति ['स्टार्टडेट']। "& Lt; / td & gt;"; गूंज "& lt; td & gt;"। $ पंक्ति ['समाप्ति']। "& Lt; / td & gt;"; गूंज "& lt; / tr & gt;"; }} और {गूंज '$ _GET [\' projectID \ '] सेट नहीं है!'; गूंज '$ _GET ='; var_dump ($ _ जीईटी); }

इसलिए जब आप अपना फॉर्म बनाते हैं तो आपको अपने चयन के लिए एक नाम सेट करना चाहिए:

  गूंज & lt; चयन करें नाम = "प्रोजेक्टआईडी" & gt; ;  

java - spring-amqp will not insert message using AmqpTemplate.convertAndSend() -


Here is a small spring program that is expected to place a message in the rabbit Qi:

 < Code> Public class main {public static zero main (string [] args throws IOException {Annotation Config Applications Contact Reference = New Animation ConfiP ApplicationContacts (QE Configuration.class); AmqpTemplate Template = context.getBean (AmqpTemplate.class); Template.convertAndSend ("asdflk ..."); Context.destroy (); }}  

as follows:

  @configure public class Qi configuration {@Bean Public connectionFinal Connection Fighter (New) Caching Connection Factory ("192.168 1.39 "); } @ Bean Public RabbitTemplate rabbitTemplate () {New Rabbit Template (connectionFactory ()); }}  

When I check the contents of the queue on the server, nothing gets involved. I also tried to set the name of the exchange or the name of the queue on the place of the rabbit, but still does not show anything on the server

The log of the application does not show any errors, but it logs [Main] DEBUG osamqp.rabbit.core.RabbitTemplate - Callback execution on rabbit MQ channel: Cached Rabbit Channel: AMQChannel (amqp: // guest @ 192.168.1.3 9: 5672 /, 1) 17: 28: 02.441 [Main] Debug OSMMPP.BBT.core Trillion Template - Publishing Message on Exchange [], RoutingKey = []

Any ideas what is wrong?

I had to queue as a parameter in the call to convert: AndSend (): < / P>

  template.convertAndSend ("hello2", "asdflk ...");  

Still wondering if Spring-AMPP does not throw exceptions. Nobody knows that when no queue is given, where are the messages delivered?


Prompt for user input using python asyncio.create_server instance -


I am learning about Python 3 asyncio library, and I have participated in a small problem sent by the client Instead of email echo, I'm trying to optimize the ecosver instance from Python Docs to prompt for user input.

I thought it would be as easy to add a call to the input , But surely the input () will be blocked So that unless the user input causes problems.

Ideally I would like to continue to get data from the customer, even when nothing happens to "say" to the server is somewhat like a chat client where each connection is to chat with the server I want to be able to switch every individual connection and send the necessary input from stdin. Almost like a P2P chat client

consider the following modified EchoServer code:.

Class EchoServerClientProtocol asyncio Import (asyncio.Protocol): def connection_made (auto, transport): peername = Transport.get_extra_info ('peername') Print ('Connection to'). Format (name name)) self.transport = transport def data_received (self, data): message = data.decode () print ('Received data: {! R}'. Format (message)) Answer = Input () Print ('Send: {! R}'. Format (Answer) self.transport.write (reply.encode ()) # Print (Client Clock Socket ') #self.transport.close () loop = asyncio.get_event_loop ( ) # Each customer relationship will create a new protocol example Coro = loop.create_server (EchoServerClientProtocol, '127.0.0.1', 8888) server = loop.run_until_complete (coro) # until pressed CTRL + c print requests Go Defense is (are served on ''). Format (server.sockets [0] .getsockname ()) Try: loop.run_forever () except for KeyboardInterrupt: pass # server server.close off () loop.run_until_complete (server.wait_closed ()) loop.close () < / Code>

I will go to stdin on the input form on the server side and specify which connection to send the connection to the connected client still?

A callback to run when you have data available on sys.stdin Schedule, and then use to pass stdin data from your data_received method:

  import sys import asyncio def got_stdin_data (cue): asyncio.async (Q.put (sys.stdin.readline ()) class EchoServerClientProtocol (asyncio.Protocol): def connection_made (self, transport): peername = transport (., 'By name') '(' contact name ') format . (Format) (name)) self.transport = transport def data_failed (self, data): message = data.decode () print ('received data: {! R}'. Format (message)) fut = asyncio.async ( Q.get ()) fut.add_done_callback (self.write_reply) def write_reply (self, fut): responses = fut.result () print ('send: {! R}'. Format (answer)) self.transport.write (Reply.encode ()) # print ('close client socket') #self.transport.close () q = asyncio.Queue () loop = asyncio.get_event_loop () loop.add_reader (sys.stdin, got_stdin_data, cue ) # Each customer relationship is a new protocol example Coro = loop.create_server (EchoServerClientProtocol, '127.0.0.1', 8888) all R = loop.run_until_complete (will create code) #Until pressed CTRL + c, requests are pressed ('Serving' {} '. Format (server.sockets [0] .getsockname ())) Try: In addition to the keyboard interrupt: loop.run_forever (): close the # server server .coule () loop.run_until_complete (server.wait_closed ()) loop.close ()  

The only difficult thing is how we do queueput / que.get methods; Both are corline, which can not be used in the callback or protocol in the example methods by yielding yield . Instead, we schedule them with the event loop using asyncio.async , and then add_done_callback get () method call.


c# - Datatype.Date how to set minimum date to Today? -


itemprop = "text">

I created a datepicker using MVC5 DataType.Date:

  [data type (Data Type Date)] Public Date Time Arrival Date {Received; Set; }  

Can I set at least available dates for today and disable all past dates?

Alternatively, is there an option to disable a custom range of dates?

I have tried to create a custom DateRangeValidator using that, but with that I get the following error:

Here's my date range validator:

  Public Date Time First Date = Date Time Today.Date; // Get Public Datetime Secondend {Receive; Set; } Protected Override ValidationResult if (DATETIME date, ValidationContext validationContext) {// your validation logic (if date> = DbFunctions.TruncateTime (FirstDate)) {return ValidationResult.Success; } And {new verification return ("date is not valid."); }}  

"itemprop =" lesson ">

try creating a custom accreditation feature with your own logic :

  Public Seal Class PresentOrFutureDateAttribute: ValidationAttribute {Protected Override ValidationResult if (Object Value, validationContext validationContext) {// Your Validation Logic (Convert.ToDateTime (Value) & gt; = DateTime Today) {return ValidationResult.Success; } And {new verification return ("previous date is not allowed."); }}}  

javascript - Images placed with .append() / .load() not taking on the styles they should be -


There are some types of "display containers" of my website, in which the content is used by .load () , which is selected based on the item. These display containers can be a few different states, which can be based on your viewing on mobile devices, such as some containers containing words spacing in all the containers, giving images in the breathing room or correcting the contents. Set to stop.

Now, if I include images in these containers from the beginning - it is that they are part of the initial domus - everything looks okay with the word-spacing If it is a state in which the containers are called, or if you are on mobile then the material will be appropriate.

The problem is, when the content is added to these containers, whether it is to carry .load () from a different document, where it is stored Is going, or .append () , it is not taking on these properties.

I have made a bela shown. Unfortunately, I can not show the .load () function due to being able to use it only on the same domain () pages, but you can still see what I'm talking about I am .append () towards things

In short;

Images in the DOM initially work image details enter here added to the DOM / Loaded images Enter image details here When the mix (some elements are initialized, some elements are added) This is also true for images placed in their different ways. Enter image details here

If you examine the source of the initial / loaded mix All the elements look similar, first there are 2 images which keep proper spacing, while the rest do not have it.

Enter image details here

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

If you add some space between images, then when adding them, will treat images like "words" and apply the space.


java - ContainerResponseFilter not executed -


I want to create a REST-API with Jax-Rs with enabled enabled. So how did I do it and found it:

The solution is a response filter, which adds some header information in every response, so that the user's browser can know that the cross domain There is permission to enter.

Because I have tried any request (received, post and option) when ResponseFilter is not executed, I googled again and found it:

@Leflo gave a good answer, which seems to be the logic (to remove annotation @ premaching) did so, but still my filter is not applied, when I request an HTTP-HTT.

This is my code:

  import javax.ws.rs.container .ContainerRequestContext; Import javax.ws.rs.container.ContainerResponseContext; Import javax.ws.rs.container.ContainerResponseFilter; Import javax.ws.rs.ext.Provider; Import java.io.IOException; @Provider Public Sector RESTServiceResponseFilter Applies Container Response Filters {@Override Public Zero Filter (ContainerQuest Content Containing Container Reference Contains, Container Response Contact ParContainerResponseContext) IOException throws {parContainerResponseContext.getHeaders (). Add ("access-control-permission-origin", "*"); ParContainerResponseContext.getHeaders (). Add ("access-control-permission-credentials", "true"); ParContainerResponseContext.getHeaders (). Add ("access-control-permission-methods", "GET, POST, DELETE, PUT"); ParContainerResponseContext.getHeaders (). Add ("access-control-permission-header", "content-type"); }}  

I kept on googling and found out that I forgot to add the web.xml filter so I also did the following:

  & lt ; Servlet & gt; & Lt; Display-name & gt; Webinterface.api & lt; / Display-name & gt; & Lt; Servlet-name & gt; JX-RS Rest Servlet & lt; / Servlet-name & gt; & Lt; Servlet category & gt; Com.sun.jersey.spi.container.servlet.ServletContainer & lt; / Servlet category & gt; & Lt; Init-param & gt; & Lt; Ultimate Name & gt; Com.sun.jersey.config.property.packages & lt; / Lastname & gt; & Lt; Ultimate Price & gt; De.tsystems.lbus.apprestserver & lt; / Super-valued & gt; & Lt; / Init-param & gt; & Lt; Init-param & gt; & Lt; Ultimate Name & gt; Com.sun.jersey.spi.container.ContainerResponseFilters & lt; / Lastname & gt; & Lt; Ultimate Price & gt; De.apprestserver.filter.RESTServiceResponseFilter & lt; / Super-valued & gt; & Lt; / Init-param & gt; & Lt; Load-On-Startup & gt; 1 & lt; / Load-on-startup & gt; & Lt; / Servlet & gt; & Lt; Servlet-mapping & gt; & Lt; Servlet-name & gt; JX-RS Rest Servlet & lt; / Servlet-name & gt; & Lt; URL pattern & gt; / TNR / * & lt; / URL pattern & gt; & Lt; / Servlet-mapping & gt;  

I do not have any other ideas anymore and you want to ask, if you have a solution for me maybe thanks in advance!

You are using jersey 1 ( com.sun. in your web.xml). The implementation of the filter you are using (or show) jersey 2. There is a subtle difference, but this is a big difference. The latter will not work with Jersey 1.

And the fact is that even compiled (if this is the case) means that you have to get rid of some dependency. You have a class JX-RS2 class (interface). Dependence of any JX-RS / Jersey 2, you may get rid of them They do not play well (maybe not the cause of the issue, but to release any confusion they get rid of)

  • jersey1 == com.sun.jersey
  • jersey2 == org.glassfish.jersey (to get rid of)
  • JX-RS2 API == javax.ws

View


linux - Adding current date and time into a bash script echo command -


I have a script that takes several hours to finish. I would like to add an existing date and time in a countermand command which prints the screen every time the stage is completed.

Then my command creates and incorporates approximately 20 databases. It takes several hours to insert some database, so I would like to print time to complete each stage on the screen so that you can know Where to be restored in this process. Even I have so far away.

  #! * .sql in db_file for / bin / sh Do mysqladmin $ {DB_File %% - *} Echo $ {DB_File %% - *} has been created Date +% x_% X mysql $ {DB_File %% - *} & lt; $ DB_File to enter $ DB_File in database dated in the date +% x_% X done  

Should work:

 for  in DB_File * .sql; Do mysqladmin $ {DB_File %% - *} has been created $ {DB_File %% - *} `date '+% F% T" `mysql $ {DB_File %% - *} & lt; $ DB_File is used by the  result  of the date command, using $ $ DB_File in the database using backquote. If you need any other date format, see what the "date --help" offer is. 


ios - Finding the distance in points between the top of the phone screen to the start of the image preview in the camera -


I am trying to create a custom camera overlay and move on to know the height of the black toolbar right above the image preview Need a photo Does anyone know how I can go about finding it? I'm guessing tired test and error, but I'm worried that the size is different for different iPhone models. Any help would be really appreciated!

Enter image details here

< / Html>

css - Is it possible to render a box-shadow in internet explorer while using Perch CMS? -


मैं

  & lt; meta http-equiv = "x-ua- संगत "सामग्री =" आईई = किनारे "/>  

और

  शीर्ष लेख {-webkit-box-shadow: inset 0px-18px 99px -53px rgba (0, 0, 0, 0.75); -मोझ-बॉक्स-छाया: इनसेट 0px -18px 99px -53px आरजीबीए (0, 0, 0, 0.75); बॉक्स-छाया: इनसेट 0 पीएक्स -18 पीएक्स 99 पीएक्स -53 पीएक्स आरजीबीए (0, 0, 0, 0.75); }  

यह IE 11 मेट्रो सहित इंटरनेट एक्सप्लोरर के प्रत्येक संस्करण में प्रदर्शित नहीं हो रहा है। मैं browserstack.com के माध्यम से परीक्षण कर रहा हूं और मेरे पास IE की वास्तविक प्रतिलिपि नहीं है। धन्यवाद!

अपडेट: मूल प्रश्न इस तथ्य को संबोधित कर रहा था कि मेरा बॉक्स-छाया सीएसएस IE के किसी भी संस्करण में रेंडर नहीं कर रहा था।

ने मुझे दिया सुराग कि

  & lt;; doctype html & gt;  

को पृष्ठ की पहली पंक्ति पर होना चाहिए। समस्या यह है कि मैं पर्च सीएमएस का उपयोग कर रहा हूं जिसके लिए पेज की पहली पंक्ति पर पीएचपी की एक पंक्ति की आवश्यकता होती है। प्रश्न अब हो जाता है: क्या पर्च सीएमएस का उपयोग करते समय इंटरनेट एक्सप्लोरर में एक बॉक्स छाया प्रदान करना संभव है?

यह कोशिश करो कृपया अपने कार्य को लाइन 2 या एक नई लाइन पर बंद php टैग के बाद रखें। इसलिए जब पृष्ठ में पीएचपी एक ब्राउज़र में गाया जाता है तो आपका कार्यप्रणाली अब पहली पंक्ति होनी चाहिए।


asp.net mvc - RequestContext - RouteData does not contain action -


That's why I've created Factory own controller and I'm overloaded GetControllerSessionBehavior to increase MVC behavior.

My custom work will have to use the reflection on the action called to me. Although I stumbled on a strange issue - I can not retrieve the action by accessing RequestContext. RouteData

While setting a breeding sample for it I was not able to reproduce the error.

Is anyone aware of the possible reasons for this, or in some other way, how to get the action by calling a method with the request reference?

  public class CustomControllerFactory: DefaultControllerFactory {protected override session Steshivier GetControllerSessionBehavior (RequestContext Anurodcontekst type controller type) {if (request! Var controller action = requestContext.RouteData.Values ​​[ "action"]; Var action = controller action. ToString (); Var action method type = controller. GETMember (action, member type. method, Baindingflagkinstens | Baindingflag. public). Frstor default (); if (action method = = R Person) return to base. GetControllerSessionBehavior (requestContext, controller type); Var cattr = actionMethod.GetCustomAttribute & lt; Satrstetakshnattivet & gt; (); if (cattr! = Null) return cattr. Word; Return Adharkgetkantrolr Satrbavik ( Request Context, Controller Type);}}  

The action that I can just say right but my controller can not access the action name within the factory:

  [Route ("Open / {Createmodel: bool?} / {TlpId: int} / {siteId: int?}")] Public ActionSultal Open ( At TLPID, INT SIDID, BULL? Vsmodel = true) {}  

Any ideas welcome.

Update:

The problem is related to the routing attribute. It is working properly, but it does not work in production for me.

On the way it got - once the answer is given, I feel that I will also have the proper solution.

Update 2:

Interesting breeding mcc version 5.0.0.0, production 5.2.2. Probable start of bug?

I can confirm that 5.0.0 and 5.1.1 I have reported this issue, however, in my use Microsoft was able to provide an acceptable solution.

in

On the other hand, the problem you look like a criminal to feature routing nested named root key MS_DirectRouteMatches Is stored. I'm not sure which version has actually changed, but I know that this v5 + happened.

So, to fix your problem, you will need to check the existence of the nested Rutadata collection, and instead use common case in the case.

  varDataData = requestContext.RouteData; If (Margdetakvolukkantenski ( "MS_DirectRouteMatches")) {Margdeta = ((Aianimrabl & lt; Rutdeta & gt;) Margdeta. Value [ "MS_DirectRouteMatches"]). first (); } Var Controller Action = Route Data Value ["action"]; Var Action = Controller Action. ToString ();  

BTW - In the provided by you, the asker had assumed that there is a possibility where a request can match more than one route. But this is not possible - a request will match 0 or 1 route, but will never be more than one.


How to read child nodes of a parent node from XML using java -


  & lt; चालान & gt; & LT; ओ बीएस & gt; & LT; ओब & gt; & LT; कोड & gt; एबीसी & lt; / कोड & gt; & Lt; / ओब & gt; & LT; ओब & gt; & LT; कोड & gt; 123 & lt; / कोड & gt; & Lt; / ओब & gt; & Lt; / ओ बीएस & gt; & Lt; / चालान & gt; & LT; चालान & gt; & LT; ओ बीएस & gt; & LT; ओब & gt; & LT; कोड & gt; डीईएफ़ & lt; / कोड & gt; & Lt; / ओब & gt; & Lt; / ओ बीएस & gt; & Lt; / चालान & gt; & Lt; / चालान & gt;  

ठीक है, मेरा सवाल यह है, मेरे पास यह एक्सएमएल है, जो मेरे पास बाहरी प्रणाली से आएगा, इसमें बड़ी संख्या में 'इनवॉइस' नोड हो सकते हैं और एक 'इनवॉइस' नोड में बड़ा हो सकता है 'कोड' नोड्स की संख्या मैं 'इनवॉइस' नोड्स के 'कोड' नोड्स को पढ़ना चाहता हूं और उन्हें इस तरह से एक सरणी में सहेजना चाहता हूं: चालान [1] .कोड [1] = एबीसी चालान [1] .कोड [2] = 123 चालान [2] .कोड [1] = डीईएफ JavaA में XPathExpression का उपयोग करके यह कैसे करें नीचे मेरी एक्सपेथ अभिव्यक्ति है जो काम नहीं कर रही है।

  expr = xpath.compile ("// चालान / चालान / आक्षेप / ओब / कोड / पाठ ()");  

कृपया 'इनवॉइस' नोड्स की संख्या और 'कोड' नोड्स में उच्चतर उत्तर दें

आपका एक्सएमएल अच्छी तरह से संरचित नहीं है शुरुआत में एक & lt; चालान & gt; गुम है उचित संरचना निम्नलिखित है:

  & lt; चालान & gt; & LT; चालान & gt; & LT; ओ बीएस & gt; & LT; ओब & gt; & LT; कोड & gt; एबीसी & lt; / कोड & gt; & Lt; / ओब & gt; & LT; ओब & gt; & LT; कोड & gt; 123 & lt; / कोड & gt; & Lt; / ओब & gt; & Lt; / ओ बीएस & gt; & Lt; / चालान & gt; & LT; चालान & gt; & LT; ओ बीएस & gt; & LT; ओब & gt; & LT; कोड & gt; डीईएफ़ & lt; / कोड & gt; & Lt; / ओब & gt; & Lt; / ओ बीएस & gt; & Lt; / चालान & gt; & Lt; / चालान & gt;  

आप परिभाषित xpath अभिव्यक्ति सही है मैं निम्न आदेशों के साथ गति के लिए अजगर (और एलएक्स्यूल लाइब्रेरी) के साथ परीक्षण किया है:

  से आयात करें एट्री पेड़ = etree.parse ('yourfile.xml') रूट = tree.getroot () रूट .xpath ('// चालान / इनवॉइस / ऑब्स / ओब / कोड / टेक्स्ट ()')  

और मुझे आपके द्वारा प्राप्त सरणी मिली:

  ['एबीसी', '123', 'डीईएफ']  

Issues when increasing Azure Instance Count -


I have problems with one of our customer's websites, we have recently increased the numbers from 1 to 2 is. The site is more sensitive now, but it is behaving very strange, the website uses Cithifinity CMS when any content is updated, then it is not visible when others see it balanced by adding an example to what I have read. A balanced atmosphere is created. Is this really happening? If so, how can I personally use each example?

Any help would be greatly appreciated.

I need to tell sitefin what part of the load balanced environment can I say.


c# - How to copy docx footers from one file to existing file -


Here I need to:

Let me remove any footer from a word document (doc) the wanted. Then add a new footer with page numbers. I have been able to achieve these solutions.

Here is the catch: 1) I need to leave the "N" pages, thus the number starts only on "number". 2) Strange numbers are on the right side, even numbers are on the left.

Background: This is part of a huge parsing, which is a document of editing and organizes documents. I have chosen OpenXML on Interop because it is easy to meet my needs so far and in most cases.

Here's my idea:

I am a "template doctor" through which I manually created footnotes as per the requirement. I want to open the source doctor, remove the footers and then copy the footers from "template doctor" and then continue to parse the doctor.

After removing "Template doctor", I have found that in it there are 3 footers, I'm guessing: for a "no / wagon footer", on the left hand side, a right hand

I have examined many other links, but my problem seems uniquely. / P>

This is my fax code:

  Private zero paging123 (string destination dock, string source doc) {{WordprocessingDocument sourceTemplate = WordprocessingDocument.Open (sourceDoc, true)) {using (WordprocessingDocument wordDoc = WordprocessingDocument.Open (destinationDoc, true)) {// Delete all existing footers wordDoc.MainDocumentPart.DeleteParts (wordDoc.MainDocumentPart.FooterParts); IEnumerable & LT; FooterPart & gt; FooterPartSource = sourceTemplate.MainDocumentPart.FooterParts; & Lt; String & gt; DestIds = New list & lt; String & gt; (); & Lt; FooterPart & gt; DestFoots = new list & lt; FooterPart & gt; (); // Copy the novel footer, the new source doc foreach (var fp in footerPartSource) into the source {// Create a new footer part, FooterPart footerPart = wordDoc.MainDocumentPart.AddNewPart & lt; FooterPart & gt; (); // Get Pastor Parts String Footer ID Source id = sourceTemplate.MainDocumentPart.GetIdOfPart (footer); DestIds.Add (footerPartId); DestFoots.Add (footerPart); } IEnumerable & lt; Section Properties & gt; Section = word doc.mandocumentpart.dext.bode.alments & lt; Section Properties & gt; (); Forehack (different sections in sections) {// Remove existing references in the footer section. Remove all children & lt; FooterReference & gt; (); {Section.PrependChild & lt; for Intuit = 0; I & lt; 3; i ++) FooterReference & gt; (New footerReference () {id = destIds [i]}); }}}}}  

My work code for adding a single footer to this document is:

  Private Zero PagingWorking {string document} {using ( WordProogging Document Word Doc = Word Processing Document. Open (Document, True)) // current footer Word Doc. Main Document Format Deliverparts (word dock.mandocumentpart.footerparts); // Create a new footer section FooterPart footerPart = wordDoc.MainDocumentPart.AddNewPart & lt; FooterPart & gt; (); // Find footer ID of the footer's footsteps. Advertising id = words Main document page GetIdOfPart (footer); FooterPart.Footer = MyFooter (); // method gives a footer object // get the section property and FooterRefernce is new ID IEnumerable & lt; SectionProperties & gt; Section = word doc.mandocumentpart.dext.bode.alments & lt; Section Properties & gt; (); Forehack (different sections in sections) {// Remove existing references in the footer section. Remove all children & lt; FooterReference & gt; (); // Create a new footer reference node section. Piped child & lt; Footnote line & gt; (New footreference () {id = footer}}; If you have removed it, thank you for your time. 

no solution, only one two indicators

in each section of the document, the primary Can be the first page, even the weird page footer and header can be.

For manipulation page ranking, you must use the field code. Those fields will be updated if the document is open in the Microsoft Word

Regards,

Michael


How to remove string characters except first in java -


In Java, I have the string:

  James Me, Jack Jones  

I want to skip the characters except the first and add the dot retrun to which should look like J. Jones

How do I do this?

I have tried to do this

 for  (int i = 1; i & lt; str.length (); i ++) {if (i % 2 == 0) {dot = str.replaceAll ("[az]", "."); JTextArea2.setText (dot); }}  

but instead of all the lower case charatcers

You can optionally use it, which works like you

  string A = "James May"; String [] b = a.split (""); String C = B [0] .charAt (0) + "."; For (int i = 1; i & lt; b.length; i ++) {c + = b [i] + ""; } System.out.println (c);  

Or if you want something that uses it many times: (credit to Avinash Raj)

  string A = "James May, Jack Jones , Jame Martinez "; String [] b = asptt (","); String c = b [0]. ReplaceFirst ("(? & Lt; = ^.) \\ S +", "."); For (int i = 1; i & lt; b.length; i ++) {c + = "," + b [i] .replaceFirst ("(? & Lt; = ^.) \\ S +" , "."); } System.out.println (c);  

node.js - Jelastic - How to change server date and time to UTC? -


I am trying to convert my jellystick server environment clock to UTC.

I tried:

  hwclock --systohc  

but my server (CentOS) in any way would be hwclock does not recognize the order Maybe they removed it, I do not know. I tried to search my docs but I did not know how to change the server clock.

Any thoughts?

Normally you are expected to manipulate the timezone at the server level (such as php.ini Set the timezone for your needs in).

If you have to change the time zone at the server level (for example, to make Cron more understandable), you can contact your hosting provider's support team for this.

Clock must be synchronized correctly with NTP at the platform level itself, so it is only about switching between time zones ...


Elasticsearch: Match query returns wrong results (Java API) -


मेरे पास निम्न समस्या है: जब मैं यह कमांड निष्पादित करता हूँ

  curl -XGET "localhost : 9200 / ग्राहक / बाहरी / _ खोज? सुंदर "-d @ json.txt  

जहां json.txt इस तरह दिखता है:

  {" query " : {"मैच": {"_id": "1"}}}  

मुझे निम्न आउटपुट मिलता है (मैं इसे छोटा करता था):

  { "हिट": {"कुल": 1, "अधिकतम_एसकोर": 1.0, "हिट": [{"_index": "ग्राहक", "_type": "बाहरी", "_id": "1", "_score" : 1.0, "_source": {"name": "Jan", "age": 99, "address": {"city": "KKKKKKK", "zip": "xxxx"}}}}}  

अब मैं जावा एपीआई का उपयोग करके ऐसा करने की कोशिश कर रहा हूं, लेकिन मैं इसे प्राप्त करने के लिए अभी भी प्रबंधित नहीं कर सकता (मैं 8 भिन्न अनुमोदन की कोशिश की)। मुझे हमेशा 0 हिट मिलते हैं कोड में अब मैं स्रोत फ़ाइल सीधे एक स्रोत के रूप में सेट कर रहा हूं, लेकिन जैसा कि आप देख सकते हैं मैंने XContentBuilder और WrapperQueryBuilder संस्करणों का उपयोग करने की कोशिश की लेकिन कुछ भी काम नहीं किया यहां मेरा कोड है:

  सार्वजनिक शून्य प्रोसेक्शन (स्ट्रिंग फ़ाइलपाथ, स्ट्रिंग इंडेक्स, स्ट्रिंग ... प्रकार) {स्ट्रिंग स्रोत = कनवर्टफ़ाइलटॉस्ट्रिंग (फ़ाइलपथ); // XContentBuilder क्वेरी = नल; // try {// JSONObject json = नया JSONObject (source.trim ()); // query = कन्वर्टजसनटोक्स कंटेंटबिइल्डर (जेएसएन); //} पकड़ (...) {...} // WrapperQueryBuilder क्वेरी = QueryBuilders.wrapperQuery (स्रोत); SearchResponse प्रतिक्रिया = client.prepare खोज (अनुक्रमणिका) .setSource (स्रोत) // .setQuery (क्वेरी) .setTypes (प्रकार) .get (); }  

एक प्रतिक्रिया के रूप में मुझे कोई हिट नहीं मिलता है:

  {"hits": {"total": 0, "max_score": null , "हिट": []}}  

मुझे आशा है कि किसी के पास इस कारण के बारे में एक विचार है क्योंकि मैं समाधान ढूंढने की कोशिश करने से पहले ही बीमार हूं: /

सर्वोत्तम नया "उत्तर" के लिए प्रयास करें लेकिन मैं अपने प्रश्न को संपादित नहीं कर सकता। तो मुझे लगता है कि मुंह बाहर है लेकिन मुझे नहीं पता कि अब प्रगति कैसे की जाए जब मैं डिबग मोड में चलाता हूं तो यह ठीक काम करता है (मैं इसे एक JUnit परीक्षण में उपयोग कर रहा हूं)। इसलिए मैंने सोचा कि मैं कनेक्शन को जल्दी से बंद कर रहा हूँ, इसलिए मैंने एक थ्रेड। नींद (5000) जोड़ा, लेकिन यह अभी भी विफल रहता है। यह केवल डिबग मोड में काम करता है: / अगर इसके महत्वपूर्ण मैं TransportClient का उपयोग कर रहा हूं।

यह थोड़ा अजीब है लेकिन मुझे आशा है कि किसी को कारण पता हो सकता है ...

चीयर्स, जन

संपादित करें:

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


java - Android button disappears after running AsyncTask -


I am creating a project as an app that connects to a device on the network (a specific device) . After clicking the button, which calls AsyncTask , the button disappears and is not clickable.

I am using class from this library:

The relevant code:

  // ... int numAdded = addResultsToDatabase (item) ; If (! DeviceInitTask.isCancelled () & amp; amp; added & gt; 0) {string device = "device"; If (numAdded> 1) {devices = "devices"; } Toast. Mektekst (Nulokldiwais Skenl Rispols Aektivitikis, "Added" + Nanbrtab. Convert (non-aided) + "+ devices, toast. Elananacti_elang). Show (); // device to the list Activity Intent intent = new Intent (NewLocalDeviceScanResultsActivity .This, DeviceListActivity.class); startActivity (intent), end ();} other {// buttons disappear} // ...  

the above code OnClickListener code> button within Renkangl object. addResultsToDatabase method is as follows:

  // ... list & l t; String [] & gt; device = new Arresuchi & lt; & gt; (); for (int i = 0; i & lt; items. size (); i ++) {ScanResultsRecyclerViewAdapter.ListItem items = Items .get (i); if (item. Selected from) (string) [string =] device = new string [4]; device [0] = item.get description (); trim (); device [1] = item .getHost (). trim (); device [2] = item.getLoginUsername (). trim (); device [3] = item.getLoginPassword (). trim (); Deviceskadd (device); }} // Try connecting and get results deviceInitTask = new LocalDeviceInitTask (this, device); DeviceInitTask.execute (); // ...  

Just tries to connect to the device, log in using the given username and password, and if successful, auth fulfills token and end is . If it can not connect, then this canal (true) is called from the work and the toast is shown.

Note that I am checking that logging fails, so numAdded == 0 .

I am being harmed as it is happening due to the code above the code still following in the view. Visual is. button.invalidate () does not work.

The only thing that works so far, obviously, to recreate the activity, but it is not ideal because the user has lost the input and this is not just good practice.

Any advice?

======================

EDIT: So now each device has a different instead of running asyncTask , all connected is a task, and the results are controlled by instead onPostExecute task.get () . The end result is the same - the button disappears.

=======================

UPDATE: I 've stepped through code in debug mode And found that the button disappears after creating the DefaultHttpClient object (org.apache.http.impl.client). I am going to step in that class and see if I can know why this happens.

Please check that you try to disable the button within the doInBackground () method of your asynctask If so, you need to disable the code with the onPostExecute () method. Because the UI Thread can not be modified from doInBackground ()


playframework - Could not fetch the updated list of templates. Using the local cache. Check your proxy settings or increase the timeout -


I am trying to install the installer with PlayStylwork and this problem occurs:

< P> `C: \ WINDOWS \ System32> Getting the latest list of catalyst new templates ...

  The updated list of templates could not be fetched. Using Local Cache View your proxy settings or increase expiration for more information: http://typesafe.com/activator/docs Browse the list of templates: http://typesafe.com/activator/templatesIn Choose from template templates or enter template name: 1) Minimum-aka-Java-Seed 2) Minimum-Acacia-seed 3) Minimum-Java 4) Min-Slal 5) Play-Java 6) Play-Scala (Hit T to see the list of all templates B) & gt;  

`` But the WiFi Internet is connected and worked well

My Sugestion - Remove the actual game version and download the other - New course add the way to play for your windows environment variable (I am assuming you are usind windows)


javascript - How to verify an foreign key in Strongloop? -


I have a list of categories and a list of places, there is a categorieId in the foreign key in each place.

categorie.json:

place.json:

I try to verify whether the category id exists or not. For this, I redefine the method of making one in the square. In the place category, I find that the class ID is present in the category. If I have found it, then I call the method of the method to insert data in place. But remembering this uptrend method creates a method ... If I do not call the Apache method, then the data does not get included. How strong can I verify and data?

script.js:

  module.exports = function (app) {var Place = App.models.place; Var Classification = AP Models.categorie; Place.create = function (data, callback) {console.log ("avant find"); Console.log (data.id); Categorie.findById (data.categorieId, function (err, instance) {console.log ("find") if (mistake) {throw throw;} if (example == empty) {new error; throw error;} console.log ("Upset"); place aperta (data, callback);}); }; };  

You should redefine the remote method, not the ORM method.

Another approach, if you use Relational DB, then create foreign key barriers.

Here is the SQL query, where location and categorie are the table names: Add optional table location Insert category category_plus_ics foreign key (categorieId) Delete the references (id) on deleted SET NULL;


Hazelcast client multiple instances -


I want to access data from Hazelcast server using the Hazellcast client. I am using threads in my hazelcast client when executing threads equally, first thread client.shutdown () and executes other threads in execution,

< P> My program exception: Internal Removal Denied Function: Because Customer is Closing .

What is the solution for this?

The hazelcast client thread is secure and can be reused. I suggest shutting down shutdown for your clients.

See similar SO questions


dependencies - maven: how to remove a dependency from all modules of a project -


I have to clear a project that has a lot of modules, now most of those modules (or most) Dependency, which I want to remove An easy way to do this?

To give some more references: The version of this dependency is managed in parent palm (dependency management). Therefore, removing the version makes the module non-manufactured. I do not know if he can help in some way.

is the device (where you will search for your dependency entry and replace it with an empty string), But unless a large number is like a quadruple module, I will remove the Dependency Management section to fail the building, remove the dependency where the version-information is missing. .

As I know all the palm There is no plugin available to remove dependency from XML, so I do not see it as a specific Maven function, but more or less a specific search and folders work to replace multiple files in multiple files


html - making a nav bar in bootstrap -


I'm trying to create a bootstrap nav bar like this:

I can only manage one:

And here is my code:

   

This is not too sensitive How can I make a responsive nav bar properly?

If you take a look at, you will notice that there are many errors in your code:

  • You have two navbar-header elements, you only have one more multiple and lt; Ul class = "nav navbar-nav" & gt; Element,
  • You can access your & lt; Navbar elements ( & lt; ul class = "nav navbar-nav" & gt; ) need to be wrapped in the div category = "Navbar-collapse collapse" & gt; to make the element responsive,
  • you own NAV can get rid of CSS so that you can already get the Navbar-fixed-top ,
  • you and lt; Ul class = "nav nav-pills" & gt; , where you can directly access & lt; A class = "dropdown-toggle" & gt;

etc ...

Perhaps you should try again to create the Naubar properly from the documentation.


c# - How to use reflection to show properties of Web Service with a List<CustomClass> -


I have successfully applied the answer. However, when I have a list, it does not work when I have participated through this medium, it is here that has returned to me:

  AccountData Result: 'AccountFound' Account List : 'Custom websiteServiceView Test applications. Service Mods Custom Classoptput Data + Data List [] ' 

This item is in the X item and I need to list all the properties for each one.

 < Code> Zero AddPropertiesToTextbox (object output, text box txt) {PropertyInfo [] piData = null;  

Is it the best way for me today? PiData = Utility.GetPublicProperties (Output. GetType ()); Foreach (PropertyInfoPI in PIdata) {if (pi.Name.ToLower ()! = "ExtensionData") {textResult.Text = = string.Format ("{0}: '{1}'", PIIMAM, P GATEVALU ( Output, empty)); TextResult.Text = Environmental.NewLine; Public class output data [[DataConnect] Public class account data {{Database}] public string accountstats {receive; Set; } [Datamember] get public string first name { Set; } [Datamember] public string LastName {get; Set; }} [DataContract] Public Enum AccountData Result [[EnumMember] None, [EnumMember] AccountFound, [EnumMember] NoAccounts} [Database] Public List & lt; AccountData & gt; Receive datalists { Set; } [Datamember] Public AccountData Results Account Data Result {get; Set; }}

You can check the definition of PropertyInfo type

  if (pi.PropertyType.GetGenericTypeDefinition () == Type (list & lt; & gt;)) {// recurse through properties}  

c# - COM+ dll component name is missing after adding it to Component Services -


I have created C ++ in C ++ using an ATL project. After the COM + dll is added to component services, it does not show the name of the component. A link for the screen shot is given below,

I went through a lot of tutorials but could not find a suitable solution. Is there a way to reveal names because COM + dll needs a name to use as WCF

The name does not appear because it is not set in the .rgs file. I have a sample below, changing the code accordingly, then it should show the component name

  HKCR {FEDTab = 'RepDO class' {CLSID = s' {8949D894-3C9B-4430-8C66} -7B2DC3DE7F2D} '} DataObjects.RepDO =' RepDO class' {CLSID = s' {8949D894-3C9B-4430-8C66-7B2DC3DE7F2D} 'CurVer = s' FEDTab'} NoRemove CLSID {{ForceRemove 8949D894-3C9B-4430-8C66 -7B2DC3DE7F2D} = 'ProcessImage class' {ProgID =' FEDTab 'VersionIndependentProgID = s' DataObjects.RepDO' ForceRemove Programmable InprocServer32 = '% Module%' {Val ThreadingModel = s' both '} TypeLib = s' {C40C7D67- 7D49-4291-B0C2-10DAA7824FD0} 'version = s' 1.0'}}  

file should be found inside the ATL project folder Awareness is .rgs


javascript - Is it possible to do something like beforeall with mustache? -


मेरे पास निम्न टेम्प्लेट है:

  & lt; div class = "photoList" & gt; {{#photos}} & lt; img src = "{{columnPhoto.url}}" डेटा-ज़ूम-यूआरएल = "{{original_size.url}}" / & gt; {{/ Photos}} & lt; / div & gt;  

कभी-कभी {{#photos}} खाली है या सेट नहीं है, उन मामलों में, मैं div .photolist जोड़ना नहीं चाहता, यह संभव है ?

  {{# photos.length}} & lt; div वर्ग = "फोटोलाइस्ट" & gt ; {{#photos}} & lt; img src = "{{columnPhoto.url}}" डेटा-ज़ूम-यूआरएल = "{{original_size.url}}" / & gt; {{/ Photos}} & lt; / div & gt; {{/photos.length}}  

java - Mutation not killed when it should be with a method with an auto-injected field -


मेरे पास निम्न है:

  सार्वजनिक वर्ग UnsetProperty कमांड तक विस्तारित {@Resource Private SetProperty setProperty ; सार्वजनिक स्ट्रिंग पार्स (स्ट्रिंग [] आर्ग्स) {if (args.length! = 4) {नया रनटाइम एक्सपैशन ("तर्कों की गलत संख्या। अपेक्षित 4. समझे" + args.length); } स्ट्रिंग प्रकाशक = आर्ग्स [0]; स्ट्रिंग संस्करण = आर्ग्स [1]; स्ट्रिंग मोड = आर्ग्स [2]; स्ट्रिंग संपत्ति = आर्ग्स [3]; / * * एक संपत्ति की स्थापना रद्द करने के लिए मौजूदा संपत्ति को रद्द करके किया जाता है। * तकनीकी रूप से, पुरानी संपत्ति में बदलाव नहीं होता है, एक नया संशोधन एक उच्च संशोधन संख्या के साथ किया जाता है, और यह एक प्रामाणिक हो जाता है। * /  setProperty.setProperty (प्रकाशक, संस्करण, मोड, संपत्ति, रिक्त, गलत);  वापसी ""; }}  

और निम्नलिखित परीक्षण:

  सार्वजनिक वर्ग UnsetPropertyTest कमांडटास्ट विस्तारित {@Configuration सार्वजनिक स्थिर क्लास कॉन्फ़िग {@Bean (name = "mockSetProperty") सार्वजनिक सेटप्रोपेर्टी getSetProperty () {वापसी नकली (SetProperty.class); } @बीन सार्वजनिक UnsetProperty getUnsetProperty () {नई UnsetProperty () लौटें; }} @ रिसोर्स @ इंजेक्टमॉक्स निजी यूनसेटप्रॉपर्टी अनसेट प्रॉपर्टी; @ रिसोर्स (नाम = "मॉकसेटप्रॉपर्टी") निजी सेटप्रोपेर्टी सेटप्रॉपर्टी; // ... SNIP ... @Test सार्वजनिक शून्य टेस्टकास्टसैटप्रॉपर्टीविद्योरप्रकाशीपैमेटर्स () फेंकता है SQLException, TaboolaException {अंतिम स्ट्रिंग [] args = new string [] {"प्रकाशक", "संस्करण", "मोड", "संपत्ति"}; अंतिम स्ट्रिंग आउटपुट = unsetProperty.parse (args); सत्यापित करें (setProperty) .setProperty ("प्रकाशक", "संस्करण", "मोड", "संपत्ति", रिक्त, गलत); // उपरोक्त पंक्ति में उत्परिवर्तन को मारना चाहिए था! verifyNoMoreInteractions (setProperty); assertThat (उत्पादन) .isEqualTo ( ""); }}  

अपेक्षित के रूप में परीक्षा पास हो गई है जब मैं इसे पीआईटी से चलाता हूं, तो मुझे निम्न परिणाम मिलता है

  33 1. मेरी / पैकेज / सेटपॉर्फ़टी :: सेट प्रॉपर्टी → बचाए गए कॉल  

लाइन # 33 वर्ग कोड में हाइलाइट किया गया है

परीक्षण की जांच की इस प्रकार हैं:।

  • <कोड> my.package.UnsetPropertyTest.testCallsSetPropertyWithCorrectParameters (my.package.UnsetPropertyTest) < / code> (32 एमएस)
  • my.package.UnsetPropertyTest.testUnsetThrowsForIncorrectNumberOfParameters (my.package.UnsetPropertyTest) (3 एमएस)

अब:

  • जब मैं टेस्ट इनवॉल्व पैरामीटर ( args ) को बदलता है तो परीक्षण विफल रहता है। जैसा कि उम्मीद है
  • जब मैं दावा बदलता हूं ( सत्यापित करें (सेटप्रॉपर्टी) .setProperty (...) ) तर्क विफल रहता है। जैसी उम्मीद थी।
  • जब मैं मैन्युअल रूप से बाहर टिप्पणी समारोह कॉल पहले कोड ब्लॉक में प्रकाश डाला, परीक्षण विफल रहता है।

क्यों उत्परिवर्तन जीवित रहने करता है?

मैं जावा 8, मोकीकी 1.9.5 और पीआईटी 1.1.4 का उपयोग कर रहा हूं।


jsf - How to update value of EditableValueHolder in action listener? -


itemprop = "text">

I have this JSF (provided by Java EE7, Glassfish 4.1 + PrimFace 5.1) in which the database connection such as host name Information, port number, etc. Part of this form is also a URL field. I want this field to be editable, but I want to be able to set the value based on other fields.

To do this, I created a button with an action listener where I created the data and generated new URL value. Then I want to put the new value in the URL field and want to use that value instead of the data posted. To achieve the ingredient I have tried and to set the present value.

XHTML:

  and lieutenant  

; P: Input Text id = "url" size = "50" value = "# {database.url}" /> & Lt; P: Command button icon = "ui-icon-arrowrefresh-1-w" instant = "true" action-id = "# {database.createConnectionURL ('Naming Container')}" & gt; & Lt; P: Ajax update = "url" /> & Lt; / P: CommandButton & gt;

Bean (experiment):

  UIcomputer urlComponent = Faces.getViewRoot (). FindComponent (Naming Container + "URL"); If (Editable Validator of the URL Component Presentation) {EditableValueHolder editValHolder = (EditableValueHolder) urlComponent; EditValHolder.setSubmittedValue (urlValue); } Faces.getContext (). RenderResponse ();    

instant = "true" is left with a JSF 1.x, when it was not possible to set only on a special input and / or buttons, it was more often than that instead it was misused to process only for a specific set and / or button. You can not use it better when JSF2Ajax comes in your hands

With JSF2 Ajax you can only use execute = "..." Or process only a specific set of input / button for the execution of the primary formus process = "..." .

  & lt; P: inputText id = "url" size = "50" value = "# {database.url}" /> & Lt; P: Command button icon = "ui-icon-arrowrefresh-1-w" process = "@ this" verb = "# {database.createConnectionURL ('naming container')}" update = "url" />  

Then you can simply update the model value.

  Create Public Zero CONNECTIONURL (String Naming Container) {// ... url = urlValue; }  

Note that I have & lt; P: ajax update & gt; in & lt; P: commandButton & gt; went back. Maybe you could & lt; H: commandButton & gt; were mixing with.


unrelated , in solid problems, dealing with components with OmniFaces Use the utility class better.


eclipse emf - In GEF how to avoid overlapping links on each other and on other GEF elements -


I have numbers or figures to represent a flow chart on the GEF canvas. Now these flow charts are coupled and our There are several flowcharts now, the problem is that each geographical figure has 1 or more links which are added between 2 elements. As the number of elements is high, the links are crossing each other, as well as the links are crossing the other GEF elements. This creates a messy picture / diagram.

I want to avoid something like that, which means that I want to ensure that the links do not cross each other, as well as the links do not cross the other elements. Is there any way I can do in GEF? In GEF, I think some bendpoint is called, but for that I believe, we have to give some argument so that they do not overlap so that they do not overlap. Is there any readymade / auto logic available which we can use to do this?

use eclipse.draw2d.ShortestPathConnectionRouter router for org links See GEF Flow Example Plugin. You want to implement its behavior ( org.eclipse.gef.examples.flow plug-in project)


javascript - Transfering data via ajax to php -


First of all, thanks for answering. I solve the problem with the format, but I have a new problem in the transfer of data by AJAX in my php.

Ajax sends data like this:

  $ Ajax ({Url: 'http: //localhost/test-fullcalendar/php/add_evento.php', data: 'title =' + title + 'and start =' + start + '& end =' + End, type: "post", success: function (jsn) {warning ('ok');}}); Received like  

and add_evento.php:

  $ title = $ _ POST ['title']; $ = $ _ Post ['start'] start; $ End = $ _ post ['end'];  

It says 'undefined index' in all the variables, so I included 'isset' to anyone. After this I echoed the variable and nobody got the data correctly, everyone did not show anything. I try to change the data line to:

  data: {title: title, start: start, end: end},  

and method To get the post and still not working

How can I see how I am sending data correctly? Im writing alerts (datatylet); Do not show anything inside the AJAX function

Your data is incorrect Try it:

< Pre> $ Ajax ({url: 'http: //localhost/test-fullcalendar/php/add_evento.php', data: {"title": title, "start": start, "end": end}, type: "post ", Success: function (jsn) {alert ('ok' ;;}}; if type:" POST " you can access data with $ _ POST And if you can access type: "GET" code> with $ _ GET


c# - Passing constructor parameter to Nunit Base class -


itemprop = "text">

I have a base class to generate duplicate test methods. Public Interface IService1 {} Public Interface IService2: IService1 {} [TestFixture] Public Essentials MyBase {Private Redoni IService1 Service; Secure MyBase (IService1 service) {this.service = service; } [Test] Public Zero test1 () {//service.callmethod}}

I have implemented this base class in another test class like this:

 

returns this error: No suitable constructor found .

[TestFixture] MyBase , as an abstract class, it can not be made, so it is not really a stability.

NUnit knows only That's how to call the default constructor for your class, so your test fixtures should be the default constructor with your example code, you come from service MyTest constructor Are hoping to come in ?

An alternative approach that can be used to get to represent the creation of object classes of children from the same kind of thing that the original parent. So you end up with something like this:

  Public abstract class MyBase {[Test] Public Zero test1 () {GetService (). Callmethod (); } Public abstract IService1 GetService (); } [TestFeacense] Public Class MyTest: MyBase (Private IISSE 2 Service; [Set Up] Public Zero Setup () {service = A.Fake & lt; IService2 & gt; ();} Public Override IService1 GetService () {Return Service ;}}  

Then the child class allows the parent class to obtain the service object context requirement to implement the basic method GetService . < / P>


xslt - Strange behavior with xsl:result-document from within Altova XML with Saxon -


मेरी इनपुट फ़ाइल:

  & lt; फ़ोल्डर्स & gt; & Lt; फ़ोल्डर का नाम = "एक" स्तर = "1" मेटाडेटाफ़ाइल = "LVM20metadata.tsv" & gt; & Lt; subfolder name = "a / er" level = "2" फिल्टर = "नहीं" / & gt; & Lt; subfolder name = "a / ir" स्तर = "2" फिल्टर = "हां" / & gt; & Lt; सबफ़ोल्डर का नाम = "ए / आर" स्तर = "2" फिल्टर = "नहीं" / & gt; & Lt; उपफ़ोल्डर का नाम = "एक / या" स्तर = "2" फिल्टर = "हां" / & gt; & Lt; / फ़ोल्डर & gt; & Lt; फ़ोल्डर का नाम = "बी" स्तर = "1" मेटाडेटाफ़ाइल = "LVM21metadata.tsv" & gt; & Lt; subfolder name = "b / er" level = "2" फिल्टर = "नहीं" / & gt; & Lt; subfolder name = "b / ir" level = "2" फिल्टर = "हां" / & gt; & Lt; सबफ़ोल्डर का नाम = "बी / आर" स्तर = "2" फ़िल्टर = "नहीं" / & gt; & Lt; सबफ़ोल्डर का नाम = "बी / या" स्तर = "2" फ़िल्टर = "हां" / & gt; & Lt; / फ़ोल्डर & gt; & Lt; / फ़ोल्डरों & gt;  

मेरी स्टाइलशीट:

  & lt; xsl: स्टाइलशीट संस्करण = "2.0" xmlns: xsl = "http://www.w3.org/1999 / एक्सएसएल / ट्रांसफ़ॉर्म "एक्सएमएलएन: एक्सएस =" http://www.w3.org/2001/XMLSchema "xmlns: fn =" http://www.w3.org/2005/xpath-functions "बाहर-परिणाम- उपसर्ग = "एफएन एक्सएस" & gt; & Lt; xsl: टेम्पलेट मैच = "/" & gt; & LT; XSL: लागू-टेम्पलेट्स / & gt; & Lt; / XSL: टेम्पलेट & gt; & Lt; xsl: टेम्पलेट मैच = "फ़ोल्डर्स" & gt; & LT; XSL: लागू-टेम्पलेट्स / & gt; & Lt; / XSL: टेम्पलेट & gt; & Lt; xsl: टेम्पलेट मैच = "फ़ोल्डर" & gt; & Lt; xsl: परिणाम-दस्तावेज़ विधि = "xml" स्टैंडअलोन = "हां" href = "{@ नाम} .xml" & gt; & LT; हैलो & gt; & lt; / हैलो & gt; & Lt; / XSL: परिणाम-दस्तावेज़ & gt; & Lt; / XSL: टेम्पलेट & gt; & Lt; / XSL: स्टाइलशीट & gt;  

यह दो परिणाम-दस्तावेज नहीं बनाता है ऐसा क्यों है? (Saxon9he का उपयोग करते हुए)

क्या यह दो एक्सएमएल दस्तावेजों को a.xml और b.xml नामों के साथ नहीं बनाया जाना चाहिए?

यह वास्तव में एक ज्ञात विशेषता है (या बग, यदि आप चाहें) यदि आप अपनी स्टाइलशीट ओक्सीजन से चलाते हैं, या आपके मामले में अल्टोवा मुझे यकीन नहीं है कि वर्तमान संस्करणों में अभी भी यह "सुविधा" है, लेकिन यह निम्नानुसार काम करती है:

  • अगर कोई प्राथमिक परिणाम दस्तावेज़ नहीं है (यानी, एक खाली अनुक्रम उत्पन्न होता है)
  • और एक माध्यमिक परिणाम दस्तावेज़ है (जैसे xsl: परिणाम-दस्तावेज़ )
  • उपयोगकर्ता इंटरफ़ेस में ऐसे ऐसे पहले परिणाम दस्तावेज़ दिखाएं
  • किसी भी अन्य परिणाम दस्तावेज़ को सामान्य रूप से बनाया जाना

मेरा मानना ​​है कि इसका कारण प्राथमिक उपकरण को पुनर्निर्देशित करने के लिए उपकरण किसी प्रकार के URIResolver का उपयोग करते हैं अगर कोई आउटपुट नहीं है, तो UriResolver नहीं बुलाया जाता है, लेकिन उसके बाद अगले माध्यमिक आउटपुट द्वारा कॉल किया जाता है, जिसके परिणामस्वरूप इस व्यवहार का परिणाम होता है। यही कारण है कि यह फाइल आपके सिस्टम के अस्थायी फ़ाइल स्थान में समाप्त हो जाती है (आपको प्राथमिक आउटपुट दस्तावेज़ यहां "सामान्य" रूपान्तरण के साथ मिल जाएगा)।

जब भी मैं यह मुठभेड़ करता हूं और नहीं व्यवहार की तरह, साधारण समाधान एक डमी प्राथमिक परिणाम दस्तावेज़ बनाने के लिए है आपके मामले में ऐसा कुछ हो सकता है:

  & lt; xsl: टेम्पलेट मैच = "/" & gt; & Lt; root & gt; प्राथमिक परिणाम दस्तावेज़, कृपया ध्यान दें, अन्य फ़ाइलें देखें। & Lt; / root & gt; & LT; XSL: लागू-टेम्पलेट्स / & gt; & Lt; / XSL: टेम्पलेट & gt;  

मेरा मानना ​​है कि एक सिस्टम संपत्ति या वातावरण चर है जो आप पूछ सकते हैं कि यह UI में चल रहा है या नहीं, या उसके अनुपस्थिति में, एक आबंटन कमांडलाइन के लिए एक पैरामीटर जोड़ें जो एक स्थिर पैरामीटर सेट करता है (दुर्भाग्य से, यह केवल XSLT 3.0 में काम करता है), जिसे आप उपयोग-जब में उपयोग कर सकते हैं।


node.js - Authentication with Node/Express/Socket.IO -



node.js - Authentication with Node/Express/Socket.IO -

i have node/socket.io/express server that's connected html file (like so). visiting web address connects server. trying set scheme by, said server beingness run on multiple computers @ time , way of sort of username , password authentication, visiting webpage specific credentials connects 1 of computers same credentials running server.

ive seen mention of "redis" previous similar questions pretty old , im wondering if there newer or improve way of achieving this.

you won't find lot of up-to-date documentation since express 4 kind of new, allow me seek remedy here :

authentication in express 4.x , socket.io 1.x

let's start confusion think you're making:

what redis?

redis info construction engine. allows store key/values pairs, nil more (in context). thing can when building authentication scheme storing data, user info, session ids, etc. in case, can share store between multiple machines, same way you'd share database, or text file.

redis

authenticate user node/express server

one of ways can using passport. passport middleware dedicated authentication on node.js. made utilize express , relatively easy setup. there excellent tutorial series on how setup passport express application, won't detail part, please take time go through series, it's invaluable knowledge.

here's link first part, 1 i'll focus on next step.

add socket.io mix

socket.io doesn't have access session cookies create in part 1. remedy that, utilize passport-socketio module.

passport-socketio requires local session store, opposed memory store. means need way store session info somewhere, ring bell?

exactly, redis.

you can seek other stores, mongodb or mysql, redis fastest.

in example, i'll assume express app , passport operational , focus on adding socket.io app.

setup :

var session = require('express-session'); //you should have line in app var passportsocketio = require("passport.socketio"); var io = require("socket.io")(server); var redisstore = require('connect-redis')(session); var sessionstore = new redisstore({ // create session store host: 'localhost', port: 6379, }); app.use(session({ store: sessionstore, //tell express store session info in redis store secret: 'mysecret' })); io.use(passportsocketio.authorize({ //configure socket.io cookieparser: cookieparser, secret: 'mysecret', // create sure it's same 1 gave express store: sessionstore, success: onauthorizesuccess, // *optional* callback on success fail: onauthorizefail, // *optional* callback on fail/error }));

connect-redis session store bundle uses redis (in case name isn't obvious).

final step : function onauthorizesuccess(data, accept){ console.log('successful connection socket.io'); accept(); //let user through } function onauthorizefail(data, message, error, accept){ if(error) accept(new error(message)); console.log('failed connection socket.io:', message); accept(null, false); } io.sockets.on('connection', function(socket) { console.log(socket.request.user); });

the user object found in socket.request contain user info logged in user, can pass around, or whatever need point.

note : setup different socket.io < 1.x

node.js authentication express socket.io credentials

php - MySQL create table failing to create table -



php - MySQL create table failing to create table -

i trying create table using mysql , php not understand why fails maybe can help me.

<?php $dbh = new pdo('mysql:host=localhost;dbname=test', 'root', ''); $createcontextuallinksettingstable = $dbh->prepare(" create table if not exists contextuallinksettings ( window_onload text, use_monetizer text, apple_link_check text, amazon_link_check text, clickbank_link_check text, commission_junction_link_check text, ebay_link_check text, linkshare_link_check text, ad_timer text, use_apple text, use_amazon text, use_clickbank text, use_commission_junction text, use_ebay text, use_linkshare text, apple_affiliate_token text, apple_campaign_value text, apple_country text, amazon_associate_id text, amazon_aws_access_key_id text, amazon_aws_secret_key text, amazon_country text, clickbank_affiliate_id text, clickbank_customisation text, clickbank_affiliate_tracking_id text, microsoft_client_id text, microsoft_client_secret text, commission_junction_site_id text, commission_junction_api_key text, commission_junction_country text, commission_junction_currency_type text, commission_junction_low_price text, commission_junction_high_price text, ebay_app_id text, ebay_country text, ebay_sort_order text, ebay_category_id text, linkshare_token text, linkshare_advertiser_mid text, main_path text, use_monetizer text, popup_font_color text, popup_link_color text, popup_link_hover_color text, popup_link_font_color text, popup_link_link_color text, popup_link_link_hover_color text, apple_explicit text, apple_link_check text, apple_auto_generated text, amazon_auto_generated text, amazon_link_check text, commission_junction_advertiser_relationship text, commision_junction_cache_duration text, commission_junction_auto_generated text, commission_junction_link_check text, linkshare_auto_generated text, linkshare_link_check text, clickbank_auto_generated text, clickbank_language text, clickbank_font_color text, clickbank_link_color text, clickbank_link_hover_color text, clickbank_link_check text, ebay_auto_generated text, ebay_link_check text ); "); $createcontextuallinksettingstable->execute(); ?>

if remove entries after main path create table, why this. if remove after main_path text creates table why?

sql error 1060. duplicate column name.

you have duplicated use_monetizer column there.

for long statements - consider using tool helps in sql.

if have database on localhost - mysql workbench best idea.

if using hosting server - has phpmyadmin installed.

and should larn using php mysql. don't know how read error message.

you can start learning here: php academy on youtube

php mysql