Friday, 15 August 2014

java - Convert List<Tuple> to List<Bean> -


I do not want to show all my attributes on a table, so I want to select only some columns then their values Map the bean, use some of Hibernate's transformers. Lius Tobin (T. Class) , but use JPA and Criteria.

Send me a list & lt; Tupal & gt; , I'll call it list & lt; T & gt; How can I change the form of

, as the title says, is it possible?

can argue object constructor within the query within JPQL / parameters so that the query returns those objects for you. . For example: "SELECT new package.BeanClass (e.attribute1, e.attribute2) Entity e"

With basic SQL queries, if you are using JPA 2.1, you can use the same example Constructor Silent can be used to build:

But if you are not able to use JPA 2.1, then you will need a provider-specific solution such as


PHP & MySQL - How to add images to query result? -


I am building a car rental system for school and I was thinking that I How to show the correct image of the car for the user when searching the database: For example:

The user wants to see all Toyota in Oslo with a picture of the picture in the car. The name of the picture is' ToyotaAvensensis. Jpg '

Now what I want is the image of the Toyota Evanescence display in the division that contains information about that particular car

I have images stored on my school FTP server and I Get information from a database

I get the search function to work with all the information and I'm just stuck on images like this

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

A database in your database In the "Add Image" and enter related images every time the name you add a new unit in the database. You can name the pictures for a pattern after that, get the associated picture and display it with HTML.


actionscript 3 - AS3 Going to prevFrame from child -


OK, I have a problem changing the frame. (I would say that this step-by-step) was originally made from JPEG -> Movie Clip (Record), and I manually created the button in this movie clip. Then by Edchil (Record) in Mainclass, I added it on stage. Now I have made a functional button with modifications on the class records, and now by clicking on it I want to go to PrevFrame.

  Public Class Main Class MovieClip {var x: boolean = false; Static Var Ramka 3: Movie Clip; Public Function Mainclass () {stop (); This.addEventListener (Event.ENTER_FRAME, RRR); } Function rrr (): zero {if (x == false) {x = true; RAM 3 = new record (); RAM 3.x = Stage. Stagewidth / 20; Ram3.y = Stage. Stage High / 4; Ram3.width = stage.stageWidth / 1.1; RAM 3 Heights = stage. Stage high / 2; AddChild (record); }}  

Record category:

  expansion of public class record movie clip {public function record () {Restart.addEventListener (MouseEvent.CLICK, RestartGame) ; MainMenu.addEventListener (MouseEvent.CLICK, RestartGame); } RestartGame function (Event: MouseEvent): Zero {var button: DisplayObject = DisplayObject (event.currentTarget); If (button == restart) {Goto Andspot (2); // is nothing} if (button == main menu) {}}  


excel - VBA SysCmd Compile error (Sub or Function not defined) -


I am new to developing code for VBA, I am working on the function that runs with Excel document, The purpose is to upload the user credentials to pass the files SharePhase, when I compile it I error on SysCmd (not defined sub or function), please advise ... Thanks in advance.

is triggered by function Excel,

  public sub CopyToSharePoint () Error Goto err_Copy dim xmlhttp dim sharepointUrl dim sharepointFileName object as dim Tsin dim sBody dim LobjXML dim username string dim as PW string dim retval dim as I rounded as the date as integer dim early as dim TotFiles, end date set FSO as object as dim FSO = CreateObject ( "Scripting.FileSystemObjec t ") Dim Fldr in kind 'folder Set file as dim f object Fldr = fso.GetFolder (" c: \ vba2sharepoint \ ") username =" Mysharepointusername@domain.com "pw =" mysharepointpassword "Seyrpointuarel = "https://mysite.sharepoint.com/sites/xyz-uat/_layouts/15/start.aspx# / A1docsuat /" set LobjXML = CreateObject ( "Microsoft.XMLHTTP") TotFiles = fldr.Files.Count each f Fldr.files is in sharepointFileName = sharepointUrl & f.Name set Tsin = f.OpenAsTextStream sBody = tsIn.ReadAll tsIn.Close xmlhttp set = CreateObject ( "MSXML2.XMLHTTP.6.0") xmlhttp.Open "PUT", sharepointFileName, false, username, PW xmlhttp.Send sBody i = i + 1 retval = SysCmd (acSysCmdSetStatus, "file" & amp; I I & amp; & copy "of the" amp; TotFiles & amp; "...") set Next f retval = SysCmd (acSysCmdClearStatus) LobjXML = Nothing set FSO = nothing err_Copy: MsgBox Err & amp; "" & Amp; Err.Description If error & lt; & Gt; 0 Then MSBBF er and Android "" & Amp; Err.Description restart Next End then End Sub  

SysCmd < / Code> is an MS Access method (), not an Excel method.

You want to set the status bar text directly to a Application.StatusBar object as a pass string.

Modal msg like string msg = "new statebar" application. Statusbar = msg application. STATUSbar = "Other Text"

Either either of the previous two rows will be set to change the status bar text custom text, set it to vbNullString Please.

  Application.StatusBar = vbNullString  

View this Excel property reference.


sql - Show the previous date from an incomplete date list in MySQL -


I have a database where records are not kept every day, though I need to calculate balance changes between dates where There are records (except dates where there are no entries).

For example, I want to see such a result:

  trade_date balance prev_date prev_balance diff 2014-01-16 -2648 2014-01-13 436 -3084 2014-02 -04 37 2014-01-16 -2648 2685 2014-02-11 37 2014-02-04 37 2014-02-12 37 2014-02-11 37 2014-02-21 -9633 2014-02-12 37 -9670 2014-03-03 396 2014-02-21-9633 10029 2014-04-02 -10252 2014 -03-03 396 -10648 2014-04-03 -7033 2014-04-02 -10252 3219 2014-05- 21 -6849 2014-04-03 -7033 184 Unfortunately I do not know the interval between the present and the previous dates because it is always different so I can not do anything like this. Like DATE_SUB  

This is what I have done:

  from select * (select business_date, balance by table 1 order by business_date) d LEFT JOIN (choose business_date as prev_date, trade_data Balance as the balance before order of Table 2) a.prev_date & gt; D.business_date  

but it only returns a bunch of tap for the previous column.

All the things I have read on this topic include making dates for the table, but this will not work for me because my date list is incomplete, I only want to include dates whose We have records for

Any suggestion about accessing this will be very much in your first derived table 'D', generate a line number and include in:

To do this I have written this.

jquery - Amount field allowed - only digits 0-9, upto two decimal places and $ -


Hi - I have this Reggae which now gives the user only a key in -09 digits and two decimal places . What should be amended in this reggae to accept '$' also? [Example link for regex] [1]
regex: this.value = this.value.replace (/ ^ (\ d + \.? \ D? \ D?)?. * / G, '$ 1');

Follow your regex:

  ^ (\ d + \. \ D? \ D?)?. *  

You have to add the \ $ symbol like this:

  ^ (\ $ \ D + \.? \ D? \ D?)?. * ^ --- Here, and avoid the character  

BTW, if you do not want to capture Dadar, you can do the symbol:

  ^ (\ $ \ D + \.? \ D? \ D?) ?. *  

MySQL: Trigger to Insert New Row in One Table When Another Table has a Row Inserted -


I want to insert a new line in an existing table, when the row is inserted in another table. There are many examples of this, though I am not able to find anyone with a trigger. Here's my code. What am I doing wrong? Trigger is not just firing:

  USE 'MTFDFRF'; Each line inserted in delimiters $$ `StationTrouble` (` _rowid_`, `fullname`,` username`, `email5`,` controlnumber````````````` for `problemdescription`, then insert the insert trigger on` StationTrouble_temp` Select 'StationTrouble_temp`, `appaerentcause`,` observed`, `reportstatus`,` _submitted_`, `_fromaddress_`,` _flags_`, `_transactid_`,` submittername`, `other submitter`) rowid_, full name, user Name, email5, controlnumber, station, problemdescription, appaerentcause, celebrated, reportstatus, _submitted_, _fromaddress_, _flags_, _transactid_, submittername, othersubmitter from StationTrouble_temp;  

You use the new keyword to enter new ones If the trigger where the trigger is executed, then it should be

in the form from
  Delimiter $$ to create a trigger trigger on `StationTrouble_temp` after each line` `StationTrouble_temp` StationTrouble` starts entering (`_rowid_`,` fullname`, `username`,` email5`, `controlnumber`,` station`, `problemdescription`,` appaerentcause`, `observed`,` reportstatus`, `_submitted_`, `_fromaddress_`,` _flags_`, `_transactid_`, 'submit,', 'other Google 'value (new.rowid_, new.fullname, new.username, new.em) Ail5, new.controlnumber, new.station, new.problemdescription, new.appaerentcause, new.observed, new.reportstatus, new._submitted_ , New._fromaddress_, new._flags_, new._transactid_, new.submittername, new.othersubmitter); End ; $$  

java - Strange behavior when testing multi-threading in junit -


I collided with a problem that caused me to get stumped for some time. I am sure this is something about Junty which I do not quite understand about.

Let's take a very simple class:

  package package. Import java.util.logging.Level; Import java.util.logging.Logger; Public square sleeper {@Override Public Zero Run ()) {try {thread} sleep (5000l) attempts; System.out.println ("snoozed"); } Hold (Prerupted East) East) {Logger.getLogger (Sleeper Class .getName ()). Log (level .spee, blank, east); }}}  

Write a very simple test for thread

  package. Import org.junit.Test; Public Class Sleeperast {@Test Public Zero Test Snooze ()) throws an exception (new thread (new sleeper). Start ();} Public static zero main (string ... args) {new thread (new sleeper) ). Start ();}}  

You will see that I have included a "main" method inside the test class when you invite Junit to execute "testSnooze" , Then the test immediately goes out without thread.

If If you call the main method, the thread runs fine;

> <>> To the north of Thomastets, I would suggest to consider testing the method without calling Start () of the thread. .

The purpose of testing the code written by us, We should not test the code which we have not written - hence for unit testing, run ()
The method should be directly enough.

However, we should check that the code we have written works with the code that we did not write . As simple as the thread in the case, I think it will be included in the acceptance test (black box test at the entry point on the system), there is no real way to write the integration test.


java - Encoding URL contains Arabic words -


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

  • 6 जवाब

मेरे पास ऑडियो फ़ाइल के लिए url है जिसमें कुछ अरबी शब्द और रिक्त स्थान शामिल हैं

  http://globalmedia.cc/Testing/CMS/main/ مسلسلات / مسلسلات كوميدية / يوميات ونيس / الحلقة الثانية एमपी 3  

मैंने कोशिश की

  यूआरआई यूरी = नया यूआरआई (url.getProtocol (), url.getUserInfo (), url.getHost (), url.getPort (), url.getPath ( ), Url.getQuery (), url.getRef ()); Url = uri.toURL ();  

परिणाम // काम नहीं कर रहा है

  http://globalmedia.cc/Testing/CMS/main/ مسلسلات / مسلسلات% 20 كوميدية% 20 /  

जब मैं लेकिन गूगल क्रोम में यह लिंक फिर इसे कॉपी फिर से हो गया है

  http: // globalmedia सीसी / परीक्षण / सीएमएस / मुख्य /% D9% 85% D8% बी 3% D9% 84% D8% बी 3% D9% 84% D8% ए 7% D8% ए.ए. /% D9% 85% D8% बी 3% D9% 84% D8% बी 3% D9% 84% D8% ए 7% D8% ए.ए.% 20% D9% 83% D9% 88% D9% 85% D9% 8A% D8% वायुसेना% D9% 8A% D8% A9% 20 /% D9 % 8A% D9% 88% D9% 85% D9% 8A% D8% ए 7% D8% ए.ए.% 20% D9% 88% D9% 86% D9% 8A% D8% बी 3 /% D8% ए 7% D9% 84% डी 8% एडी% डी 9% 84% डी 9% 82% डी 8% ए 9% 20% डी 8% ए 7% डी 9% 84% डी 8% एबी% डी 8% ए 7% डी 9% 86% डी 9% 8 ए% डी 8% ए 9. एमपी 3   

और यह मेरे लिए काम किया मैं क्या करना चाहता हूं जो Google क्रोम जावा कोड द्वारा करता है? संकेत: यूआरएल खुराक पैरामीटर नहीं है, इसलिए मैं यूआरएल को एन्कोड करना चाहता हूं। कोई भी मदद!

इसे आज़माएं:

  स्ट्रिंग यूआरएल = "http : //globalmedia.cc/Testing/CMS/main/ مسلسلات / مسلسلات كوميدية / يوميات ونيس / الحلقة الثانية एमपी 3 "; कोशिश {urlEncoded = URLEncoder.encode (url, "utf-8"); } पकड़ (असमर्थित एन्कोडिंग अपवाद ई) {e.printStackTrace (); } System.out.println ("एन्कोडेड यूआरएल:" + urlEncoded);  

javascript - Call function which is in window resized event from within window scroll event? -


I have a variable size and a function that depends on it. As the variable depends on the screen width and if the width changes, then I'll have to place it inside the window resize event. However I want to call it with other events like column events.

$ (window). Reset (if ($ (window) Width ()> 1200) {var size = "big";} else {var size = "small";} show show (param) {if (size == " (".") {$ (". Result.hidden"). Piece (0, 3) .removeClass ('hidden') .Every (some function);} Otherwise if (size == "small") {$ (". Result.hidden "). Piece (0, 2) .removeClass ('hidden'). Each (some function);}}}); $ (Window) .scroll (function () {if ($ (window) .scrollTop () + $ (window) .height () & gt; $ (document) .height () - 50) {showRow ();} });

You can do this, showRow a global look And the size of the window is in it, so that you can say it inside the shape and to scroll. It seems that you wanted to use showRow inside your shape if you do not have any other code inside the resize, you can completely delete it in the first example

  var showRow = function () {if ($ (window). Width () & gt; 1200) {var size = "big"; } And {var size = "small"; } If (size == "big") {$ ("result." Piece (0, 3) .removeClass ('hidden'). Each (some function); } And if (size == "small") {$ (".ultult.hidden"). Piece (0, 2) .removeClass ('hidden'). Each (some function); }} $ (Window). Reset (function () {showRow (); // other code}); $ (Window) .scroll (function () {if ($ (window) .scrollTop () + $ (window) .height () & gt; $ (document) .height () - 50) {showRow ();} });  

If you do not want to use showRow inside resizing, then start

  // window in the SessionVir window Season = $ (Window) Wide ()> 1200? "Bigger"; Var showRow = function () {if (windowSize == "big") {$ ("Result.hidden"). Piece (0, 3) .removeClass ('hidden'). Each (some function); } And if (windowSize == "small") {$ (".ultult.hidden"). Piece (0, 2) .removeClass ('hidden'). Each (some function); }} $ (Window). Resize (function () {if ($ (window). Width ()> 1200) {windowSize = "big"; else} {windowSize = "small"}} // other code}); $ (Window) .scroll (function () {if ($ (window) .scrollTop () + $ (window) .height () & gt; $ (document) .height () - 50) {showRow ();} });  

php - How can I SELECT field FROM table WHERE id=variable? -


I have a variable of logged in user ( $ steamid ) which I need to use Select the specific field from the database and resume I am using the following code, but it is working incorrectly. All database information is correct, tables, columns, and variables are not misspelled. Not sure what I'm doing.

  & lt ;? Php $ con = mysqli_connect ("private", "private", "private", "private"); // Check connection if (mysqli_connect_errno ()) {echo "failed to connect to MySQL:". Mysqli_connect_error (); } $ Sql ​​= "select` banale from` asappler` where` steamid` = '$ steam id' "; ($ Result = mysqli_query ($ con, $ sql)) {// Get field information for all fields ($ field_fone = mysqli_fetch_field ($ result)) {printf ("banana:% n", $ field->) ; } // Free results set mysqli_free_result ($ result); } Mysqli_close ($ con); ? & Gt;  

No errors are shown, it only "bananas": nothing after this. I think I did not do it correctly, did anybody know what I did wrong? Here is a screenshot of my database table, so that you know what it looks like. Try it out:

  $ query = Mysqli_Query ($ con,    

if If this does not work, then there is a problem in the format STEAM_ID. You can try trimming the ID in only one number, and STEAM_x: x: can add it later.

< / Html>

string - Censor words in c -


I am working on a function that censors the words I have created this function and it works, except That it accepts only one argument. For example, when I do "./a.out test & lt; example.txt", then it is censored in "example.txt" by replacing "test.txt" instead of "test.txt". But when I add another, like "./a.out test test2", it changes only "test", not both "test" and "test2".

Can anyone help me with my function? I do not know what I'm doing.

Here is the function:

  #include & lt; Assert.h & gt; # Include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; #include & lt; String.h & gt; Int main (Int arc, four ** argv) {emphasis (argc> 1); Char fileRead [4096]; Four places [] = "sensor"; Size_t word_len = strlen (argv [1]); Whereas (fgets (fileRead, sizeof (fileRead), stdin) = 0) {char * start = fileRead; Char * word_at; While ((word_at = strstr (start, argv [1])) = 0) {printf ("%. *% S", (int) (word_at - start), start, change); Start = word_at + word_len; } Printf ("% s", start); } Printf ("\ n"); Return (0); }  

I suggest you have a mid loop on argv element 1 to argc - 1 . In each repetition, it will process the line to sensitize the same logic, as if your function is now only for the first argument.

  int arg; (Arg = 1; arg and lt; organi; arg = + 1) {/ * ... sensor argv [arg] ... * /}  

Note that you Then, by dropping by () , logic access is avoided in such a way that naturally avoids reaching out of its range of argv (if No logic is specified, anything will run without program censoring).


ip - Replace bits with number C -


I'm working on editing IPv6 addresses. I have a data structure like: uint16_t u16 [8] , representing an IPv6 address.

Example:

  ff1e: 0000: 0000: 0000: 0011: 22ff: fa 33: 4402  

I want to change the specific bit groups with numbers. For example, suppose I have the variable uint16_t var whose value is 256 . Then I would like to change the second bit group like this:

  ff1e: 0256: 0000: 0000: 0011: 22ff: fee 33: 4402  

Unfortunately

  UIPAAP6AdD_T-> U16 [1] = heroic;  

gives

  ff1e: 0101: 0000: 0000: 0011: 22ff: fa 33: 4402  

Hexadecimal number version I have not got any clue how this can change and it is difficult for Google (English is not my native language). Any quick suggestions?

Edit: uip_ip6addr_t

  defined UPIIP_IP_APIADD_T {uint8_t u8 [16]; / * Initial, should come first. * / Uint16_t u16 [8]; } Uip_ip6addr_t;  

Line to print:

  printf ("% 02x% 02x:% 02x% 02x:% 02x% 02x:% 02x% 02x: % 02x% 02x:% 02x% 02x:% 02x% 02x:% 02x% 02x ", ((uint8_t *) adr) [0], ((uint8_t *) adr) [1], ((uint8_t *) edit) [2], ((uint8_t *) Endor) [3], ((uint8_t *) ADR) [4], ((UIT 8_T *) ADR) [5], ((UIT 8_T *) Endor) [6] (UIT 8_T) *] ADR [7], (UIT 8_T *) ADR) [8], (UIT 8_T *) ADR) [9], (UIT 8_T *) Endor) [10] , ((UIT 8_T *) and the endor), [11], (Uint8_t *), [12], ((uint8_t *) ADR) [13], ((uint8_t *) ADR) [14], ((uint8_t * ) Endor) [15])  

This line has another IP address Prints from

Well, your code is actually working: '0101' changed from hex to decimal format, '0257' will print.

I think you should have printf ("% x:% x:% x:% x:% X:% x:% x:% x", ipaddr- & gt; u16 [ 0], ipaddr-> u16 [1], ipad-> U16 [2], ipad-> U16 [3], ipad-> U16 [4], ipad-> U16 [ 5], IPDR-> U16 [6], IPDR-> U16 [7]); .

forma tint string printed '0257' by "% 04zu:% 04zu:% 04zu:% 04zu:% 04zu:% 04zu:% 04zu:% 04zu" (According to your first result hex).

EDIT: I wrote a little faster, '0x101' in the comment is '0257'.


php - Relay request for payment to PayPal via intermediate API -


I have created a REST service in PHP for many client applications. One of the requirements of the service is to process the payment of products sold in client applications. I think I will need to recover the authorization URL from PayPal and it will need to be forwarded forward for forwarding client applications and then an authorization code / token will be returned which is valid with the rest of the service paypal May be. Does anyone know of any examples that apply to paypal like this?


javascript - Understanding execution model and event loop -


I have read a lot of articles about the JavaScript single-threaded performance model, event-loop, and the line of events.

One thing though is not clear though. I made a bela to clarify my question:

  & lt; Button onClick = "window.compute ()" & gt; Calculate & lt; / Button & gt; & Lt; Button onClick = "warning ('tax')" & gt; Do something else & lt; / Button & gt; Window.compute = function count () {var results = 0; For (var i = 0; i & lt; 100000; i ++) {for (var j = 0; j & lt; 100000; j ++) {Results = i + j; }}; Var textNode = document.createTextNode (results); Document.body.appendChild (textnode);  

}

If you click the "Calculate" button, it will take some time and the page will be blocked. But if you click on the "do something else" button, while the page is still hanging, it will still be added to the queue and it will be executed after our calculation is finished.

So if JS is single-threaded, then is the UI event put in the event line while we are doing some more computing?

Single-threaded UI events are putting in the event queue, while we do something else Computing?

Not obviously :-) This is one of the other threads in a browser, which is responsible for this, in this case UI events (which, in turn, are supplied by the OS) In fact, there are many things running in parallel to the JS engine, for example, for example thread (which) are managing network connections (and the amount of AJAX events).


javascript - JS Regex to match a string within HTML tags that aren't <a> -


I am using jQuery to highlight summaries within an article, and struggling with my regex Am

I am trying to match a specific word which is a word within an HTML tag (and Is not in any particular feature like), is not part of the second word and is not already there & lt; A & gt; tag.

Then I have a & lt; Abbr & gt; I will wrap the tag and a glossary with a link.

I have found a little way, my current ridge looks like this:

  (\> [^ \ & gt;] * \ W) abrr ( \ W [^ \ & gt; =] * \ & lt;)  

Where "ABRR" is an abbreviation, which I am trying to match. This type of works, but if ABRR is not the first word of a line, or if it is a and lt; A & gt; is inside the tag.

"abbr" I want to match:

  & lt; P & gt; Home Ebid ipsum & lt; / P & gt; & Lt; P & gt; ABBR Leram ABRR & lt; / P & gt; & Lt; Ul & gt; & Lt; Li & gt; ABBR ABRR & lt; / Li & gt; & Lt; Li & gt; Abbr & lt; / Li & gt; & Lt; / Ul & gt;  

While I do not match any of these:

  & lt; P & gt; & Lt; A href = "abbr.html" & gt; ABBR & Lt; / A & gt; & Lt; / P & gt; & Lt; Img src = "abbr.jpg" /> & Lt; P & gt; Lormabbripsum & lt; / P & gt;  

To do this, I am choosing to place all the HTML within my article for the purpose of replacing a string. My JS looks like this

  $ GetJSON ("glossary", function (data) {var str = $ ('article-entity'). Html (); var i; for (I = 0; i  

We can use the limitations of words 'b' in terms of words, however Is not right. Suppose you were looking for IA. It will get a match in the CIA. Because the term words are part of the boundaries.

In addition to this, we can use the positive Lookhead (LA) and Negative LookAheads (NLA) for look forward and decide on the basis of the content.

I do not think regex is ideal because of the word boundary issue and because while casting such a wide net in an HTML document, things can get hair (if you have non-ideal HTML) / ^ [^ & Gt;] *) \ b # token: \ b # word limit abbr # literal abbruck \ token: \ b # word limit (? = # Open ola (?! # Nella [^ & gt;] * # Negative character class (inner characters are included) # None: & gt; # * Repeats zero or more often # / Literate & lt; / a & gt;) # Close NLA [^> * Repeats zero or more times #Literal & lt;) # Close LA


php - SQL SELECT and UPDATE at the same time -


I have a very simple selection that looks like this:

  by item Select Path WHERE id = 17  

Now in the table item is a column count , which is what I want to increment every time

Not so, the way to do this in a single question.

You can do something like this:

  Start transactions; Update .... Select ... COMMIT;  

How to compare values between string and BigInteger in java -


  स्ट्रिंग str = "1234"; स्ट्रिंग स्ट्र 2 = "1234"; बिगइंटेजर बड़ाइं = नया बिगइंटेगर ("1234"); ऑब्जेक्ट v1 = str; वस्तु v2 = str2; ऑब्जेक्ट v3 = bigInt; Println ( "CONDITION1 == & gt; & gt;" + v1.equals (v2)); System.out.println ("कंडीशन 2 == & gt; & gt;" + v1.equals (v3)); ` 

आउटपुट:

  Condition1 = = & Gt; सच condition2 ==>  

दूसरी स्थिति (v1.equals (v3)) का परिणाम झूठे क्यों है, हालांकि मान समान हैं?। दो स्थितियों में अंतर? दूसरी हालत के परिणाम को कैसे सच्चा बनाया जाए?

के रूप में @ रोहित जैन ने टिप्पणी की वे एक ही प्रकार के नहीं हैं । यदि आपके मामले में

   
   / P> 
  bigInt.toString ()। बराबर (str1)  

सच वापस आएगा।


oracle - Transpose rows into columns in SQL -


I have data for 2 weeks, coming out of a complex 'statement' -

  DATE WEEKDAY CODE 2015/01/05 Monday A 2015/01/06 Tuesday a 2015/01/07 Wednesday P 2015/01/08 Thursday A 2015/01/06 Friday P 2015/01/12 Monday P 2015 / 01/13 Tuesday P 2015/01/14 Wednesday P 2015/01/15 Thursday P 2015/01/16 Friday P  

And I want to move in two weeks like this - < / P>

  WEEK Monday Tuesday Wednesday Thursday Friday 2015/01/05 AAPEP 2015/01/12 With PPPPP select PS_Att_Piwot_data AS (--------------) * (Select (case ('Monday', 'Tuesday', 'Wednesday', ' Thursday, 'Friday')) PIVOT for weekends (maximum CODED) weekend = School days ends after 'Monday.'  

My script is giving results like Monday '' Tuesday '' Wednesday '' Thursday '' Friday (Null) (Null) PPPP 2015/01/12 P (Null) (Null) (empty) (zero) 2015/01/05 A (faucet) (faucet) ) (Null) (r Expressed)

Please help me with the axis statement. Thank you,

It seems that what might happen next to you:

< ('05 / 01/2015 ', '05 / 01/2015', 'dd / mm / yyyy') DT, 'Monday' day of the week, 'A' code with Dual Union Select All Select ('06 / 01/2015 ',' Wednesday 'working day,' DD / MM / YY 'DT,' Tuesday 'workday, select' A 'code from dual union ('07 / 01 / 2015 ',' DD / MM / Yay '), Select all from' P 'Code Dual Union ('08 / 01/2015', 'dd / mm / yyyy') Dot Please select all from 'A' Code Dual Union, select 'Everyone' ('09/01 / DD / MM / YY' DT, 'Friday' Workday, 'P' Code Dual Union Select all '12 / 01/2015 ',' dd / mm / yyyy ') dt,' Monday 'on the afternoon, select all from' P 'Code Dual Union ('13 / 01/2015', 'DD / MM / Yay ') DT,' Tuesday 'workday, select all from' P 'Code Dual Union ('14 / 01/2015', 'DD / Me M / yyyy') DT, 'Wednesday' Workday, 'P' Code Select all from Dual Union ('15 / 01/2015 ',' DD / mm / yay ') DT,' Thursday 'workdesign, select all from' P 'code Dual Union ('16 / 01/2015', 'dd / mm / yyyy') dt, 'Friday' workday, two From 'P' code) - End the copy of your data in the table named sample_data * (select trunc (dt, 'iw') week_start_dt, weekdays, code from sample_data) Pivot (max (code) for week ('Monday' As of Monday, 'Tuesday' Tuesday, 'Wednesday' as Wednesday, 'Thursday' as Thursday, 'Friday' as Friday)) week_start_dt Order by: WEEK_START_DT Monday Thursday Wednesday Friday Friday ------------- ------------- --------- -------- - ----- 2015/01/05 AAPAP 2015/01/12 PPPP

I sincerely expect that WEEKDAY comes from DT column in your real code is !


c++ - difference between classes and structure -


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

  • 28 जवाब

मैंने पढ़ा है कि मुख्य अंतर कक्षा और संरचना के बीच यह है कि वर्ग संदर्भ प्रकार और संरचना मूल्य प्रकार है क्या कोई मुझे समझा सकता है कि मूल्य प्रकार और संदर्भ प्रकार का अर्थ ...?

आपको एक अलग भाषा के बारे में सोचना होगा सी ++ में, वर्ग प्रकार समान रूप से एक ही हैं, चाहे आप उन्हें class या struct कीवर्ड से परिचित कराएं।

एकमात्र अंतर यह है कि आधार वर्ग और सदस्यों को डिफ़ॉल्ट रूप से सार्वजनिक रूप से सार्वजनिक किया जाता है यदि आप उपयोग करते हैं struct , और निजी अगर आप वर्ग का उपयोग करते हैं।

संदर्भ प्रकारों को & amp; या & amp;


google app engine - How to filter in datastore using objectify for a Date property ? -


How to filter the datestore using the object for the date property? I have an institution that looks under the piege class. At this time the stamp is a property which holds the date value.

  Public Class Travel Entry {Private String Device ID; Guadatata to the private string; Private string location; Private Deadly Timestamp; Public Travel Entry () {setTimeStamp (this.timeStamp); } Public string getDeviceId () {return deviceId; } Public Zero Set Device ID (string device id) {this.deviceId = deviceId; } Public string getPushedGeoData () {return pushGoData; } Public Zero Set PushedGeoData (string pushGeoData) {this pushgeoData = pushGeoData; } Public string getLocation () {return location; } Public Zero Set Location (string location) {this.location = location; } Public Date getTimeStamp () {Time return stamp; } Public Zero Settimestamp (Date Timestamp) {if (Timestamp == empty) {this.timeStamp = new date (); } And {this.timeStamp = timeStamp; }}}  

How do I query or filter a date property using an object? I want to retrieve all those institutions which are of those special dates and times.

It is described in all documents:

Filter by the @ index field and then the desired date value.


Error : Too few arguments in Google Maps API Python client -


I have installed Google Maps API client for Python on Mac OS with Python 2.7.

The customer ID and customer secret I received I tried to run one of Google's samples uploaded, which is a coordinate sample

When I run it I get an error,

  Coordination I am new to using the Google API What logicals do I need to pass? I update my code and client_secretes.json with my Client ID 


How to make a Cell in Excel Reference itself -


I have a table containing the risk points column. I want to type a formula to check each cell and To determine if the cell is empty, then make the value of cell 100, and leave the cells current values. The code I'm trying to use (for cell D2) is as follows:

= IF (ISBLANK (D2), 100, D2)

Let me do this There is a problem in the reason of the inability to reference a cell easily and I believe that by putting this formula into the cell, any idea can be overwritten with the present value of cells?

Assume that the processes you want to work with are D2 From D100 . Try this small macro:

  Sub OneHundred () Dim R Range Set R Range Set R = Range ("D2: D100"). Cells.Special Seals (xlCellTypeBlanks) r.Value = 100 End All  

Adjust the range to meet your needs.


javascript - how to detect if webpage has changed? -


Assume that I am a user on the page of my site.

I update this page on my server, but users will not know the difference until the user reloads the page.

How can a JavaScript function detect the difference and reload the page?

A solution can use a timer that reloads the page every second but causes too much traffic?

You are asking that the function is a server can push information like a browser.

Otherwise, you can also create an Ajax request that will test the current version of the page displayed in the browser and verify that it has not been updated on the server side or not. Once it is ascertained that the server has a new version of the page, your script can tell the user (it is bad behavior to reload without user consent).

To avoid excessive calls to the server, you should ensure that your Ajax request is only launched from time to time (2 minutes? 5 minutes? More?), And any other request currently Its going on.


c# - group list by property and where it appears more than once -


I have a list of type student items.

  Public class student {string FirstName string surname int edge}  

I want that the group students together with the same surname together and Return a list of aliases where an alias appears more than once.

Blog Smith

Blogs Smith

/ Pre>

Here's the code that I am currently using that works but there is a way to return a novel to my Linux statement that is specified to appear more than once?

  var Res = hldList.GroupBy (hld => hld.myid). Ollist (); Foreign currency (var id in reset) {var total = id.Count ();  1) // do something  

SurName and count those that are more than 1:

  var duplicate SurNames = ldList.GroupBy (hld => hld.Surname). Where (g = & gt; g calculation ()> 1). Select (x = & gt; x.Key) .Olist ();  

insert and update in vb.net with access index out of range -


I have an application I want to do it 1 - Enter the details first 2 - Receive invoice 3 (maximum) - with ID Enter the details of the invoice, it gives me this error index out of range.

  Enter private entries () as the date of the invoice date as dated date = Today the integer in the form of DIDIID ID as an integral slow client, as a low note string if the clients.Visible = true Then user id = 1 client = 2 note = "cache" other userid = 2 client = 6 note = "credit" and dim query 1 as "string" = "insert in invoice" ([purchased], client, [note] , User id, total, disk) value ('' & amp; cite (invoiceday) & amp; "',' & amp; Clientid & amp; amp; ", & quot; & amp; note & amp; & quot;, & quot;, & amp; userid & amp;; & quot ;, & quot; totalprice.Text & amp; & quot; & quot; & quot; & quot; & quot; & quot; & amp; ; Txtdis.Text & amp; "')" Each line contains DatasearchViewRow as dvsale.Rows dim query string = "as inserting samselect2 (QUERY1) for dim maxinvoice integer maxinvoice = invoiceid ()' '; Maxinvoice + 1 & amp; & Amp; "'invoicede (invoiceid, barcode, doaname, quantity, value, qtyprice) value in (& quot; & quot; row & quot; row & quot; row & quot; row & quot; row (" barcode " Price ("denum"). Price & amp; "'," "& Amp; line Seals (" Quantity "). Value &"', "" & Amp; line Seals ("Value") Value & amp; "," & # 39; Amp; line Seals ("Tacti"). Value & amp; ";)" Samselect2 (Query) Next End Sub  

This samselect2 < / P>

  class of public sub-samselect2 (byVal SQL string) attempt to thief. Open () cmd .Connection = thief .CommandText = SQL pre-capture exceptions (ex.Message, MsgBoxStyle.Exclamation) as the MsgBox con.Close (try) da.Dispose () End Sub  
and the maximum number of invoiceid

  private function invoiceid () checkConnection () in the form of a slow strQ string = "MaxInvoice" OleDbCommand as the slow cmdQ = new OleDbCommand (Strq, con) dim result = cmdQ.ExecuteScalar () If there is no result, then anything as integer = dvd = 0 returns x or returned The final function  

on the end of the result, however I can not fully understand your question I am looking for a few things: 1) It appears that invoiceID is not an automatic incremental identification area, and it should probably be. (See "Identity".) If this happens, you can enter all the fields except one and specify, and the number will automatically increment 2) for you ... in each, you through each loop With maximum repetition max max increase. Although you are using Max-Vice + 1, this will be the same number every time.

However, if you make an invoice ID an identity field, then everyone should be unnecessary.


sql - How to aggregate alias column in activerecord? -


मान लीजिए कि निम्न तालिका है:

  उत्पाद (आईडी: पूर्णांक, श्रेणी: स्ट्रिंग, लागत: फ्लोट)  

और आप इस क्वेरी को activerecord के साथ करना चाहते हैं:

  उत्पाद। चयन ("लागत + 1000 के रूप में incremented_cost")। समूह (: श्रेणी) .sum ('incremented_cost') ActiveRecord :: वक्तव्यअवैध: पीजी :: अपरिभाषित कॉलम: त्रुटि: स्तंभ "incremented_cost" मौजूद नहीं है  

उदाहरण काफी सरल है, हालांकि यह अच्छी तरह से समस्या का प्रतिनिधित्व करता है: मैं एक संशोधित फ़ील्ड के लिए एक उपनाम कैसे निर्दिष्ट कर सकता हूं और इसका उपयोग एक समग्र कार्य में कर सकता हूँ?

मेरा लक्ष्य एक Activerecord_Relation को वापस करना है, जहां किसी समूह पर संभावित रूप से उपनाम फ़ील्ड पर एग्रीग्रेन्स को गणना करना संभव है। समस्या यह है कि "समूह" सशर्त है और मैं डेटा पाइपलाइन रखना चाहूंगा।

चयन करें विधि काम नहीं करती क्योंकि यह किसी रिश्ते के फ़ील्ड नाम नहीं बदलती है यदि आप "एएस" का प्रयोग करते हैं तो उपनाम (लिंक देखें) तक पहुंचना संभव है। हालांकि यह कुल कार्यों में काम नहीं करता है देखें:

# इंजेक्ट का उपयोग करना यह मेरे लिए एक अच्छा समाधान नहीं है, मैं सरणियों से निपटना नहीं चाहता।

उदाहरण के लिए यह कोड देता है सही परिणाम है, लेकिन यह मेरे लिए एक अच्छा समाधान नहीं है:

  उत्पाद। चयन ("लागत + 1000 के रूप में incremented_cost")। इंजेक्शन (0) करें | एसीसी, रिकॉर्ड | एसीसी + रिकार्ड.incremented_cost एंड  


php - Websocket without command line? -


I'm trying to modify the web socket app in the server by using the web interface without using the command prompt. How to do it and how to do it? I used exec () and system () commands but was not successful

how to start / stop service For passing some specific message about. The idea is that the service is working on non-stop, but when the service detects the "stop" message, it will stop responding to any other message except the "Start" message.


javascript - Check if one of li doesnt have a class -


I'm having trouble with this condition: I have a series of Li's with the class, and I execute the code None of this wants to be a class.

For example:

  & lt; Ul class = "list-synthese" & gt; & Lt; Li class = "hidden" & gt; Lorem & lt; / Li & gt; & Lt; Li class = "hidden" & gt; Lorem & lt; / Li & gt; & Lt; Li class = "hidden" & gt; Lorem & lt; / Li & gt; & Lt; Li class = "hidden" & gt; Lorem & lt; / Li & gt; & Lt; Li & gt; Published in & lt; / Li & gt; & Lt; / Ul & gt;  

What do I want to do here:

  if $ ('list.synthese & gt; li') hasnotclass ('hidden') {mycode ; }  

Hope someone can help me! Thanks! :)

You can use the : not selector. You also have the wrong selector for the UL element:

  if ($ ('.list-synthese & gt; li: no (.hidden)'). Length) {mycode; }  

c# - Using .NET 4.5 code in Unity 5 -


I am working on the game using Unity 3D version 5. The game should already use strict business rules programmed in C # .NET4. Using the 5 engine Xamarin / Mono, we hope to make it useful on Windows, Android, and others ...

I tried to make the engine in DLL and it was in the form of a managed plugin in unity Used in But Unity uses the old version of Mono to compile the whole game and refuses to use the .NET 4.5 DLS.

I really needed to use this code, I thought it was downgrading to .NET 3.5, but this is not an acceptable solution that has already been done on the engine.

Regarding Android, I think use the xamine to get the Netme Android code and use it as the original plugin in Unity. Now I need a solution for Windows. I am looking for ways to use the C # code in C + code to create unmanaged DLLs, but I understand that COM interop, C ++ / CLI or other methods Which way is applicable in the middle.

Does anybody know how to add codes in some / little effort at Unity?

It seems that Unity is upgrading to 4.6+ and is now available in beta


Find next greater element in AVL tree -


Let's say I'm following the AVL tree and my job is to get the element of the next element (i.e. 7 for 6) What algorithm can I use?

AVL tree

Again you walk through the nodes and if you are found node 6, then you can return the deep left children ..

< P> pseudo code:

  function find_bigger_key (key, node): If node = null then tap and return if node.key = key then min_node (node) and if the key is & lt; Node.key again find_bigger_key (key, node.left) return_bigger_key (key, node.right) function min_node (node): if node.ltree = null then return the node back and return min_node (node.ltree)  

This is just an example of how you can do it, but it depends on what your AVLTE object model looks like.

An example implementation in Python:

  class AVLTree (object): def __init __ (self, key, ltree = none, rtree = none): self. Key = key; Self.ltree = ltree; Self.rtree = rtree; # Some other features here ... # some other methods here ... def find_bigger_key (self, key): if not self: no return elif self.key == key: if self.rtree: return self.rtree Min_node () Other: Return any elif self.key & gt; Key: return self.left.find_bugger_key (key) Other: return self.find_bigger_key (key)  

An example of a dragon output:

  & Gt; & Gt; & Gt; # ATree is an avltree object that is your example & gt; & Gt; & Gt; Key = 6> gt; & Gt; Found_node = aTree.find_bigger_key (key) & gt; & Gt; & Gt; Print (found_node) >> 7 >> & gt; & Gt; Key = 7> gt; & Gt; & Gt; Found_node = aTree.find_bigger_key (key) & gt; & Gt; & Gt; Print (found_node) none  

oauth - Download files in Javascript with OAuth2 -


I am developing single-pages with Javascript + AngularJS on the client side and the Spring MVC + Spring Security Oath 2 on the server Party The Spring MVC acts as a RES controller for any AJAX request from the page.

For authorization, the script sends an "authorization: carrier ..." header with each AJX request. It works fine when requesting small amounts of data. To download XML files (export user data) I download them via AAgx, using OAuth 2 header and saving the file in the browser. Creating:

  var blob = new blob ([data. Data], {'type': "text / xml"}); Var a = document.createElement ("a"); A.href = window.URL.createObjectURL (blob); A.download = "download-file-" + new date (). ToISOString () + ".xml"; A.click ();  

This approach works but

  • uses RAM and is therefore inappropriate for large file downloads
  • Proper progress / Loading does not show the bar

So, the question is: Is there a better way of downloading files with OAuth 2 authentication? JavaScript does not allow specifying the header when redirecting, and does not allow authorization token through the OAuth URL parameter. I either use

  • header-from-URL encoded token,
  • Instead of OAuth2, cookie-half instead of OAuth2, I'm thinking of adding a special spring MVC controller method to provide a URL that redirects the encoded HTTP request. Damage to the authorization

If anyone can do if there are similar problems, share please your approach to this problem?

Spring-protection- This is very easy in oauth2 2.0. 7.RELEASE:

Just pass the entry token as the access_token request parameter:

  window.open ("service / export? Access_token = "+ AccessToken");  

Now, this access token will appear in plain text in the download history, so a "logout" option should be applied properly for proper security, or download a "form Post".


sql - Simple sqlite query with ascending order -


I have been working with QT and using sqlite when I write it:

  QSqlQuery q = db_.exec ("Select '" "from history";);  

It works as expected, but I did not find anything with it:

  QSqlQuery q = db_.exec ("SLECT *" "History "" By ORDER ID ASC;);  

This table is created:

  db_.exec ("If no history exists then create table (" ID primary primary attribute is not zero, "" URL text, "" real of the day, "" real of the month, "" year real, "" real, "" minute real, "" second real "););   

Thanks

except for select * and between and history and ORDER - try:

  QSqlQuery Q = db_.exec ("SELECT *" "from history" "ORDER id asc";);  

c# - How to create a configurable Asynctimeout -


I would like to set a configurable timeout value for my AsyncController I know that we have [asyncTimeout (5000) )] to decorate a method with attribute and we are able to use value with a const variable. I would like to use a fixed variable so that I can do a more configurable way to set the deadline after compiling.

Reading it seems like there is a property that can be called a timeout.

Here's what I have tried, that is.

  [http pps] Public Zero DwarfsSync (Miley Query) {AsyncManager.Timeout = TestTimeout; // Testimet 120000 is a static entity for the async manager. Breakthrough Operation Incorporation (); (Do work) ...}  

It seems that the AsyncManager.Timeout value is not being used and instead of throwing the timeout expression after the default 45 seconds.

Is there a way to set the value of this timeout when compiling time?

You AsyncTimeoutAttribute this way

  Public class CustomAsyncTimeoutAttribute: AsyncTimeoutAttribute {Public CustomAsyncTimeoutAttribute (): Base (Params.TimeOut) {}}  

Where Parameters. There is a static timeout variable in the timeout .

Or you can try it (just copy / paste base asyncTimeout functionality):

  public class CustomAsyncTimeoutAttribute: AsyncTimeoutAttribute {public CustomAsyncTimeoutAttribute ( ): Base (0) {} Public Override Zero OnActionExecuting (ActionExecutingContext FilterContext) {if (filterContext == null) Throw new logic NullException ("filterContext"); Var managerContainer = filterContext.Controller IAsyncManagerContainer; If (managerContainer == zero) new invalid operation throw exception ("Operation timed out."); ManagerContainer.AsyncManager.Timeout = // You can get your timeout parameter from the resource (i.e. config file, database, etc.); Base.OnActionExecuting (filterContext); }}  

In addition, you should mark your action method with async keywork, your method should be work or Work & lt; T & gt; , and your method should have the last parameter cancellation token , otherwise AsyncTimeout will not work.

For example:

  [customAsyncTimeoutAttribute] public async job execution function (/ * some parameters /, canceled token token)  
< / Div>

GridView with Fix Header for each column in Android -


I can not find any specific way that could make Android GridView headers for each column in each asp.net By way of: How to create a Custom GrideView in Android because the default does not support the GridView header. I found some useful libraries, but its sole support for the whole GridView is not for header specific column, see. , I would also like to sort the column like header click:


ruby on rails - How to restart nginx using circle CI? -


I have a Rail application installed using Circle CI after automatic creation by Search CI, but I want to restart Nginx server, I've added " sudo service nginx restart " in my circle.iml

  error: sudo service nginx restart return exit code 1 nginx: unknown service function fail: sudo service nginx restart  

I also configured / deploy.rb

  To: deploy: restart,: Clear_cache the roles (web) perform: sudo, "service nginx restart" end end  

still does not restart the Nginx server?

Trying to start nginx with circle.yml Because the command will run on the CI server, not your intended web server.

Not sure why the attempt to restart with Capistrano is fai gender.

If you are using a passenger with nginx, the second way to restart the nginx server on a Rail app is to create a tmp / restart.txt file in the app directory / Modify

See and for clarification.

config / deploy.rb applies the following code snippet logic:

  Namespace: Deploy the "Restart the App" task : Restart the roles (: app), in :: sequence, wait: 5 execute: touch, release_path.joined ('tmp / restart.txt') and end  

c++ - How do I simplify this cmake file? -


I have this CMakeLists.txt.
By pattern it seems that there is a better and cleaner way to do this.

  QT5_WRAP_CPP (windowUImok ../../include/QtDisplay/WindowUI.hpp) QT5_WRAP_CPP (MainWindows_moke ../../include/QtDisplay/MainWindow.hpp) QT5_WRAP_CPP (editor_moc ../) ../include/QtDisplay/SpiderEditor.hpp) QT5_WRAP_CPP (Output_moke../../include/QtDisplay/OutputPane.hpp) add_library (Display WindowUIp MainWindows.cppaderEditor CPP OutputPenny CPP $ {windowsUImoc} $ {MAIN WINDOW_VOK} $ {editor_moc } $ {Output_moc}) qt5_use_modules (display widget core)  

I do not have much information about the conventions used in Senkel So I called 'solution' can not see.

Are you looking for something like this:

  set (Display_src Set $ ​​{PROJECT_SOURCE_DIR} / WindowUI.cpp $ {PROJECT_SOURCE_DIR} / Manwindo CPP $ {PROJECT_SOURCE_DIR} / SpeedAditor.cpp $ {PROJECT_SOURCE_DIR} / Autuppany CPP) (Display_hdr $ {PROJECT_SOURCE_DIR} /../ .. / include / QtDisplay / WindowUI.hpp $ {PRO JECT_SOURCE_DIR} /../../ contains / QtDisplay / MainWindow.hpp $ {PROJECT_SOURCE_DIR} /../../ included / QtDisplay / SpiderEditor.hpp $ {PROJECT_SOURCE_DIR} /../ .. / Include / QtDisplay / OutputPane .hpp) qt5_wrap_cpp (Display_hdr_moc $ {Display_hdr}) add_library (Display $ {Display_src} $ {Display_hdr_moc} Display) # QT 5.2+ Target_Link_Libb Ari (display Q5 :: widgets) for # QT 5.1 # Qt5_use_modules (Display Widget Core)  

Exporting data to excel from sql server is not working -


I am using the code below to export the data to Excel. This is working fine when the Excel file is empty but when I update to clear the file, the inserted query is executed successfully, but Excel is showing blank.

  update openrowset ('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0; Database = E: \ .. \ .xlsx;', 'Column 1, Column 2, Column 3 [Sheet 1 $] ') Set Column 1 = Faucet, Column 2 = Zero, Column 3 = Moisten OpenOrgeST (' Microsoft. ACE OLEDB.0.1.0 '' Excel 12.0; Database = E: \. \ .xlsx; ' , Select from 'SELECT * FROM [Sheet1 $]') Table 1, Column 2, Column 3 Table_name  

I

I have read online, then OpenRoseet is read-only so that instead you have OP ENDATESOURCE is required to use. Try something like this.

  Update OPENDATASOURCE ('Microsoft.ACE.OLEDB.12.0', 'Data Source = E: \ ... \ YourExcelFile.xlsx ;; Extended Properties = Excel 12.0') ... [ Sheet1 $] Set Column 1 = Faucet, Column 2 = Zero, Column 3 = Openedset ('Microsoft. ACE OLEDB .12.0', 'Data Source = E: \ ... \ YourExcelFile.xlsx; Extended Properties = Excel 12.0 ') ... [Sheet 1 $] select column 1, column 2, column 3, table_name  

apache - Rewrite one main page to 404 but not other ones -


I have the following three rewriting rules that tell users based on payment forms, which users are those that work fine Do:

  RewriteRule ^ / marketing / employees $ https://www.example.com/marketing/payroll/forms/salary-payment-form.shtml?stafftype=EXAMPLE [R, L] RewriteRule ^ / marketing / other staff $ https://www.example.com/marketing/payroll/forms/salary-payment-form.shtml?stafftype=HR [R, L] RewriteRule ^ / marketing / other2- employees $ Https: //www.example.com/marketing/payroll/forms/salary-payment-form.shtml? Stafftype = EXAMPLE \ Commercial \ Ltd [R, L]  

I have a rule so that if someone goes to the main URL, they will get only 404 - I can add the URL given below. Have tried, but is not working:

  RewriteCond% {REQUEST_URI} ^ / marketing / payroll /forms/salary-payment-form.shtml$ RewriteRule ^ / marketing / payroll / forms / Salary payment non-form.shtml $ - [R = 404, L]  

When I put it all above 404 is getting the URL - how can I restrict it So that just above Security main URL 404 gives and does not redirect to specific pages? Try

% {REQUEST_URI} (% {QUERY_STRING} ):

  RewriteCond % {QUERY_STRING} ^ $ RewriteRule ^ / Marketing / Payroll / Forms / Salary Payments Non-form.shtml $ - [R = 404, L]  

sql - Adding Auto-Generated SQLSERVER Scrips within if statements (Begin, End) -


I am trying to create a large script of the database changes created for each release in SQLServer-2008. For each release, all the scripts are wrapped in a statement of BEGIN and END tags for that release.

Most script scripts are okay manually, but if I want to do something like a new field in the middle of a table, but at the end of that the SQLSERVER auto-generated script is quite large, a Trigger , temp table , etc.

I noticed that I had to remove all the geo statements in all the scripts. After removing all of them, I still get the following error:

Message 156, level 15, state1, line 10641 keyword has the wrong syntax 'TRIGGER'

Then I tried to wrap all the triggers in the EXEC ('') statement and I still get an error:

message 105, level 15, state 1, process T_I_ProoformaWhatIf, character string 'after line 5 unimaginative quotation marks)' masterdbows Below is a example of a script that I set in IF, BEGIN, END:

  Can not be set on SET QUOTED_IDENTIFIER SET ARITHABORT ON set NUMERIC_ROUNDABORT SET CONCAT_NULL_YIELDS_NULL on ANSI_NULL set on ANSI_PADDING ANSI_WARNINGS COMMIT sign on Transpactation Go to create table dbo.Tmp_Table1 (id ET not zero identity (1, 1), column 1 NIT void, column 2 int no zero, column 3 nv archar (50) not NULL, NewColumn nvarchar (50) zero, Column4 boat (53) zero, Column5 boat (53) zero) Rathmic] GO ALTER table dbo.Tmp_Table1 set (LOCK_ESCALATION = table) GO set identity_insert dbo.Tmp_Table1 exists (select from * dbo.Table1) EXEC ('dbo.Tmp_Table1 (number, column1, column2, column3, newColumn , Column4, Column5) from the selection number, column1, column2, column3, newColumn, Column4, to Column5 with dbo.Table1 (HOLDLOCK TABLOCKX)) Go Set Identity_insert dbo.Tmp_Table1 Separate from Drop Table dbo. Table1 GO executed sp_rename N'dbo.Tmp_Table1 ', N'Table1', 'Object' Go ALTER table dbo.Table1 Add barrier PK_Table1 with primary key cluster (column 1, column 3, column 3) Create [primary] trigger on STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON [DBO]. [T_I_Table1] DBO.Table 1 ON on Master. INSERT AS DECLARE @ User Name varchar (50) SELECT @UserName = REPLACE (MasterCart (from CAST (con text_info as VARCHAR (50)), CHAR (0), '') dbo .sysprocesses WHERE spid = @@ spid IF (ASCII (user name) & lt;> 0) Startup Table1 set InsertUserId = @username, InsertDate = GetDate (), UpdateUserId = @Username, updated = GetDate () From where the Table1.Id = inserted.Id end another update Table1 set InsertDate = GetDate (), updated start = GetDate () inserted from where Table1.Id = inserted.Id originated GO TRIGGER [dbo] We do. [T_U_Table1] Announcement of the update on dbo.Table1 @ Select username (50) for varchar @ user name = REPLACE (cast (context_info (50)) as of vARCHAR, CHAR (0), '') master. From dbo.sysprocesses, where spin1@@ spid IF (ASCII (user name) of & lt;> 0) start update table1 set UpdateUserId = @ User Name, updated = GetDate () where Table1 was inserted. Id = inserted.Id end restart update Table1 set updated = GetDate () inserted where Table1.Id = inserted.Id is selected to end Has_Perms_By_Name COMMIT (N'dbo.Table1 ',' and As ALT_Per, Has_Perms_By View_def_Per, Has_Perms_By_Name (N'dbo.Table1 ',' Object ',' Control ') as Contr_Per  

Any suggestion or advice better to do this whole thing will be great.

This again stops working by wrapping the triggers in the excise ('').

Here are 2 tricks:

  1. Get all go extract details
  2. in EXEC ('') Wrap like trigger statement

    make EXEC ('TRIGGER [dbo]. [T_U_Table1] ON dbo.Table1') .. ...


java - Random LazyInitializationException with @OneToMany -


I have a legacy database with the following tables:

  Police ID (PK)  

I have a JPA unit Police

  @Entity Public Category Police Serializable { @ ID Private Long ID @ on Tommy (Fetch = Frettype.LAGY) @Join column (value = {@Join column (name = "id", referenced column name = "id")}) Private set & lt; Contract & gt; Contracts; }  

The contract unit looks like this:

@Entiree Public class contract implementation serializable {@ id private long ID; @ ID Private Long Version; Private string type; @OneToMany (fetch = FetchType.LAZY) @JoinColumn ({@JoinColumn (name = "code", referenced column name = "type")}) @ where (segment = "tab = 'type'") private set & lt; Code & gt; type; }

Code:

  @Entii public class code applies the Serializable {@Id Private String tab; @ Id personal string code; The name of the private string; } In the code table there are many different keys / values ​​for different applications in my case where I need one, from my contract "tab = 'type'" and code = Type is required.  

My problem is that if I have more than one contract for the police, then I'm Randoli? In my testcase, I do the following:

  public static zero main (string [] args) {int countErrors = 0; {Try {POLICE (;); for int i = 0; i & lt; 15; i ++); } Hold (exception e) {e.printStackTrace (); CountErrors ++; }} System.err.println ("Errors:" + Counter Errors); } Private static zero read policy () throws an exception {EntityManagerFactory Factory = EntityManagerFactoryHelper.getFactory (Continuity Suggestion TEST_STAGE); EntityManager em = factory.createEntityManager (); TypedQuery & LT; Police & gt; NameQuery = em.createNamedQuery (...); The result of police = has been nominated. Gatinglingericelt (); Set up & lt; Contract & gt; Contract = results. Gate contract (); Contract Contract = Contract Director () Next (); Set up & lt; Code & gt; Type = contract .getType (); // There should be a set with an entry system. Out.println (type.size ()); // & lt; --- The possibility for the exception !! Em.close (); }  

I try to see this whole thing in loop 15 times. In about 5-8 attempts, I get the Lease Initialization exception. The second time it works.

Any thoughts about this? Why not fail it all the time?

Just encountered this one. Being the key word 'random' one of my colleagues faced this exception on my laptop constantly, while I never did that. He can only generate exceptions on IE & amp; Edge

Finally realized that it was supposed to do with tomat versions, he was running an old version, while I had a later version - 8.5.8. He upgraded local Tomcat to this version and the exception was not encountered.


File Upload ASP.NET MVC (getting error) -



File Upload ASP.NET MVC (getting error) -

i trying add together feature asp.net web application allow user upload file contains list of courses student. added upload feature view , created new method in controller. every time select file , click upload, next error: "an exception of type 'system.nullreferenceexception' occurred". guessing file variable coming null? below controller code , view code:

view:

<div id="uploadcourselist"> @using (html.beginform("uploadcourselist", "managestudentcourses", formmethod.post, new { enctype = "multipart/form-data" })) { @html.antiforgerytoken() @html.textboxfor(x => model.userid, @model.userid, new { @class = "addcoursetxtboxid" }) <table class="courselisttable"> <tr> <th colspan="4"> upload course of study list </th> </tr> <tr> <td> select file: </td> <td> <input type="file" name="file" id="file" /> </td> <td> <input type="submit"> </td> </tr> </table> } </div>

controller

public partialviewresult uploadcourselist(httppostedfilebase file, courselistviewmodel modelview) { if (file.contentlength > 0 && file != null) { string path = path.combine(server.mappath("~/content/courselist"), path.getfilename(file.filename)); file.saveas(path); } homecoming partialview("~/views/managestudentcourses/listcourses.cshtml"); }

you have 2 main problems here:

the attribute on form tag should enctype, not encrypt. you cannot send files using ajax.beginform, @ to the lowest degree not @ think. quick solution utilize html.beginform() instead, if unacceptable, need @ third-party plugin illustration plupload.

asp.net-mvc file-upload asp.net-ajax

excel - Multiply two ranges/arrays cell by cell -



excel - Multiply two ranges/arrays cell by cell -

i'm trying write excel udf (user defined function) takes 2 ranges , multiplies first cell in range1 first cell in range2, sec cell in range1 sec cell in range2, , on, stores result in array.

imagine array1 in cells a1:a4 {1,0,1,2} , array2 in cells b1:b4 {1,1,0,1}. function vectormult(a1:a4, b1:b4) homecoming {1,0,0,2}.

function vectormult(array1 range, array2 range) variant 'takes 2 ranges , multiplies cell1 cell1, cell2 cell2, etc _ , stores in vector array dim result() variant dim largerarray range dim smallerarray range dim integer 'determine smaller range determine ubound in result() array if array1.cells.count >= array2.cells.count set largerarray = array1 set smallerarray = array2 else set largerarray = array2 set smallerarray = array1 end if redim result(1 smallerarray.cells.count) 'this part fails = 1 smallerarray.cells.count result(i) = largerarray.item(i).value * smallerarray.item(i).value next vectormult = result end function

i had envisioned writing more general function accepted unlimited paramarray args() , parsed each arg array, can't solve seemingly simple cell iterator function. think vba handle stepping through range in default manner like

range(somerange).item(i)

but doesn't... it's worth, seem right values when substitute right row/column indeces item function, below; result works on 1 cell (instead of array). need figure out how pass "i".

'substitute item(1,1) item(i) , work = 1 smallerarray.cells.count result(i) = largerarray.item(1,1).value * smallerarray.item(1,1).value next

the index function performs task of delivering array of modified info blanking out row_num , column_num parameters in array form, e.g. index((a1:a4)*(b1:b4),,). size of ranges has match should unless referencing named ranges dynamically alter shape. examples (using sample data):

=sum(index((a1:a4)*(b1:b4),,)) '◄ 3 =min(index((a1:a4)*(b1:b4),,)) '◄ 0 =max(index((a1:a4)*(b1:b4),,)) '◄ 2 =average(index((a1:a4)*(b1:b4),,)) '◄ 0.75

fwiw, utilize form of index provide many standard formulas when seems array formula work. processed array not require ctrl+shift+enter.

minif, maxif , modeif standard formulas

for excel 2010 , higher, new aggregate function additional functionality.

excel vba excel-vba

vb.net - Consuming a XML webservice API -



vb.net - Consuming a XML webservice API -

i'm attempting to consume xml webservice. service asterix based pbx called switchvox. each request should in form of xml, xml beingness returned in response. code follows, able api homecoming error saying request empty.

dim xml string xml = "" xml = xml & " <request method=""switchvox.users.extensions.getinfo"">" xml = xml & " <parameters>" xml = xml & " <extensions>" xml = xml & " <extension>104</extension>" xml = xml & " </extensions>" xml = xml & " </parameters>" xml = xml & " </request>" dim url string = "https://pbx/xml" dim webrequest__1 httpwebrequest = directcast(webrequest.create(url), httpwebrequest) webrequest__1.method = "post" webrequest__1.credentials = new networkcredential("user", "pass") webrequest__1.contenttype = "text/xml" webrequest__1.contentlength = xml.length using requestwriter2 new streamwriter(webrequest__1.getrequeststream()) requestwriter2.write(xml) end using dim resp httpwebresponse = directcast(webrequest__1.getresponse(), httpwebresponse) dim responsedata string = string.empty using responsereader new streamreader(webrequest__1.getresponse().getresponsestream()) responsedata = responsereader.readtoend() end using

don't ever utilize string manipulation (including concatenation) generate xml. utilize xml api linq xml. you're lucky using vb.net, in can utilize xml literals feature build xml easily, , more correctly. seek this:

public function getinfo() xelement dim xml xelement = <request method="switchvox.users.extensions.getinfo"> <parameters> <extensions> <extension>104</extension> </extensions> </parameters> </request> const url string = "https://pbx/xml" dim webrequest__1 httpwebrequest = directcast(webrequest.create(url), httpwebrequest) webrequest__1.method = "post" webrequest__1.credentials = new networkcredential("user", "pass") webrequest__1.contenttype = "text/xml" webrequest__1.contentlength = xml.tostring().length using requestwriter2 new streamwriter(webrequest__1.getrequeststream()) requestwriter2.write(xml.tostring()) end using using resp httpwebresponse = directcast(webrequest__1.getresponse(), httpwebresponse) using responsestream = resp.getresponsestream() homecoming xelement.load(responsestream) end using end using end function

xml vb.net web-services

java - libGDX How to match user click to object position? -



java - libGDX How to match user click to object position? -

i'm trying develop own game next kilobolt.com tutorial , altering i'm trying create, found myself in pickle...

a bit of background: in zombie bird tutorial, within bird object there onclick() method beingness called within touchdown() method of different class implement inputprocessor. when game run , user tap screen, bird react going bit.

what want know: seek create bit more detailed, require user tap exact position of bird on screen while moves, , every time bird beingness tapped, calls animation.

i tried few codes found in google , modified them when did not work, game crashed.

being new game developing inquire of please bare incompetence.

i create 2 circle objects libgdx's circle class. 1 circle follow bird on screen, while other 1 positioned based on user touches screen. if statement like:

if(user.getcircle().intersects(bird.getcircle()) && screen.istouched()) animation();

not complicated, not best way implement, it's something.

java android libgdx

java - Display sum from array with 5 indices -



java - Display sum from array with 5 indices -

this simple application in declare array containing 5 elements. utilize enhanced loop iterate length of array. imported scanner object user input next number, calculate sum. sum displays 0, not application suppose output. here application: //application create array hold 5 indices , inquire user input each index number //calculate , display sum of indices in console window.

import java.util.scanner; public class findsum { public static void main (string [ ] args) { scanner input = new scanner(system.in); int [ ] number = new int [ 5]; // instantiate array int sum = number[0];//initialize sum array index 0 system.out.print("enter number: " );//prompt user input (int i:number)//uses enhanced loop { number[i] = input.nextint();//reads input if(i<number.length)//evaluates status { system.out.print("enter next number: ");//prompt next input number }else sum += number[i];//initializes sum number array }//end enhanced loop system.out.println("\nthe sum " +sum); }//end method main }//end class findsum

change enhanced for loop regular for loop,

for (int = 0; < number.length; i++)

the issue number contains 0 each iteration of loop assigns 0 i. also, need remove logic

// if(i<number.length)//wouldn't in loop body if status weren't true. // { system.out.print("enter next number: ");//prompt next input number // }else sum += number[i];//add number sum.

java arrays

cordova datepicker plugin not working in iOS8: UITableView dataSource is not set -



cordova datepicker plugin not working in iOS8: UITableView dataSource is not set -

after updated ios8, cordova datepicker plugin not work. crashed next message:

terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'uitableview datasource not set'

but don't see uitableview related code in plugin source code. don't know, maybe there internal uitableview in uidatepicker?

here code(i remove non-relative code easy reading):

- (uipopovercontroller *)createpopover:(nsmutabledictionary *)options { uiview *datepickerview = [[uiview alloc] initwithframe:cgrectmake(0, 0, pickerviewwidth, pickerviewheight)]; if(!self.datepicker){ self.datepicker = [self createdatepicker:options frame:frame]; [self.datepicker addtarget:self action:@selector(datechangedaction:) forcontrolevents:uicontroleventvaluechanged]; } nsdateformatter *formatter = [self createisodateformatter:@"yyyy-mm-dd't'hh:mm:ss'z'" timezone:[nstimezone defaulttimezone]]; nsstring *datestring = [options objectforkey:@"date"]; self.datepicker.date = [formatter datefromstring:datestring];// if remove line, works fine [datepickerview addsubview:self.datepicker]; uiviewcontroller *datepickerviewcontroller = [[uiviewcontroller alloc]init]; datepickerviewcontroller.view = datepickerview; uipopovercontroller *popover = [[uipopovercontroller alloc] initwithcontentviewcontroller:datepickerviewcontroller]; popover.delegate = self; [popover setpopovercontentsize:cgsizemake(pickerviewwidth, pickerviewheight) animated:no]; [popover presentpopoverfromrect:anchor inview:self.webview.superview permittedarrowdirections:uipopoverarrowdirectionany animated:yes]; homecoming popover; }

this line:

self.datepicker.date = [formatter datefromstring:datestring];

finally leads crash, , debug, found value of datestring is:

2014-10-17t10:0:00z

2014-10-17t20:0:00z

and crash sec display, first time ok

could please give me clue? thanks

finally find out issue:

the source code of cordova datepicker, reuse uidatepicker instance:

if(!self.datepicker){ self.datepicker = [self createdatepicker]; [self.datepicker addtarget]; }

and, works fine in ios7, lead crash in ios8.

in ios8, don't share uidatepicker instance in multi uiview, modify code to:

// in ios8, uidatepicker couldn't shared in multi uiviews, cause crash. create new uidatepicker instance every time if ([[[uidevice currentdevice] systemversion] floatvalue] >= 8.0) { self.datepicker = [self createdatepicker:options frame:frame]; [self.datepicker addtarget:self action:@selector(datechangedaction:) forcontrolevents:uicontroleventvaluechanged]; }else{ if(!self.datepicker){ self.datepicker = [self createdatepicker:options frame:frame]; [self.datepicker addtarget:self action:@selector(datechangedaction:) forcontrolevents:uicontroleventvaluechanged]; } }

hope can help me

uitableview cordova datepicker ios8 uidatepicker

hadoop - How to do I run encrypted distcp from hdfs to s3? -



hadoop - How to do I run encrypted distcp from hdfs to s3? -

i re-create info our hadoop cluster (on premise) s3. can unencrypted. can run s3cmd set client side encryption. how do distcp client side encryption ?

hadoop amazon-s3 distcp

javascript - Angular JS - Sharing controller between directives -



javascript - Angular JS - Sharing controller between directives -

can't seem figure out why not working...

what i'm trying do:

i need able share controller maincontent directive directive focus , maintain getting error: cannot set property 'element' of undefined.

i'm practically copying/pasting illustration : https://www.codeschool.com/screencasts/egghead-io-flexible-angular-directives : i'm not sure why isn't working?

relevant code:

//html <maincontent id="maincontent"> <focus>whatever</focus> </maincontent> //js angular.module('home', []) .directive('maincontent', maincontent) .directive('focus', focus); maincontent.$inject = []; function maincontent() { homecoming { restrict: 'e', scope: {}, controller: function($scope) { $scope.element = ''; } } } focus.$inject = []; function focus() { homecoming { restrict: 'e', transclude: true, template: '<div id="focus"><div ng-transclude></div></div>', require: '^?maincontent', // tried 'maincontent' && '^maincontent' link: function(scope, elem, attrs, ctrl) { ctrl.element = 'such wow'; } }; }

(yes, know syntax isn't mutual follows style guides project) in advance, help much appreciated!

javascript angularjs controller angularjs-directive

groovy - Whats the correct way to get Gradle to inform GroovyShell where the dependancies the script requires are? -



groovy - Whats the correct way to get Gradle to inform GroovyShell where the dependancies the script requires are? -

i've got gradle downloading dependancies , passing these groovy script i'm calling gralde task (as gradle doesn't seem allow me utilize grape).

the code below way i've been able working. right way?

build.gradle:

configurations { shell } // specify dependancies dependencies { // groovy script task dependancies shell 'org.codehaus.groovy.modules.http-builder:http-builder:0.6' shell 'org.codehaus.groovy:groovy-all:2.3.0' // actual application dependancies compile ... } task cleanupartifactory (dependson: configurations.shell) << { //now add together dependencies root classloader: urlclassloader loader = groovyobject.class.classloader configurations.shell.each {file file -> loader.addurl(file.tourl()) } new groovyshell().run(file('scripts/artifactory.groovy')) }

just treat groovy scripts classes , run them javaexec.

here's example

task yourtask(type: javaexec, dependson: classes) { description = "does stuff" if (project.hasproperty('args')) { // fancy regex args '-pargs="-a -b -c"' , passing them main class def myargs = (project.args =~ /([^\s"']+)|["']([^'"]*)["']/).collect{it[1] ?: it[2]} args myargs } main = 'your.groovyclass' classpath configurations.compile, configurations.runtime, sourcesets.main.output }

the "args" bit can phone call task with

gradle yourtask -pargs="-a -b somevalue"

passing values straight through class.

on subject of grape, have working configuration both allows me call/compile groovy class gradle, , allow grab notation work able phone call script directly.

in groovy class add together appropriate grab , import, e.g.:

@grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.6') import groovyx.net.http.*

in build.gradle project, add together following:

configurations { ivy } dependencies { ivy 'org.apache.ivy:ivy:2.3.0' } tasks.withtype(groovycompile) { groovyclasspath += configurations.ivy }

now can phone call groovy script straight with

groovy /path/to/the/groovyclass -a -b somevalue

or utilize gradle task defined earlier.

if don't add together bit of ivy code, class grab in fails compile through gradle.

groovy gradle

MS Access Transactions Not Working With MySQL -



MS Access Transactions Not Working With MySQL -

i'm have problem transactions, in ms access 2007 using odbc source mysql 5.6 database. essentially, i'm inserting 'master' record, , inserting 'child' records in table. however, records committed when explicitly roll them back.

a simplified version of function follows:

dim ws workspace: set ws = dbengine.workspaces(0) dim db database: set db = currentdb dim newid& ws.begintrans ' insert "master" record s = "insert ..." db.execute s ' new record id using passthrough query mysql newid = gfmysql_getnewid ' insert multiple "child" records, using newid s = "insert ..." db.execute s if vbyes = msgbox("commit?", vbquestion + vbyesno) ws.committrans else ws.rollback goto exit_handler end if

this has me stumped, if has suggestion appreciate it!

mysql transactions ms-access-2007

model view controller - Post kendo grid values -



model view controller - Post kendo grid values -

below kendo grid

@(html.kendo().grid<cs.web.models.people.groupdetailmodel>() .name("grid") .events(e => e.databound("lineitems_databound")) .htmlattributes(new { style = "overflow:hidden;", @class = "normalgrid" }) .columns(columns => { columns.bound(p => p.groupid).hidden(); columns.bound(p => p.groupname).title("group name").width(30); columns.bound(p => p.department).title("department name").width(30); columns.bound(p => p.isblindsettingsenable).title("blind group") .clienttemplate("<input type=\"checkbox\" #= isblindsettingsenable ? \"checked=checked\": \"\" # enabled=\"enabled\" />") .width(30); columns.bound("department").title("remove") .clienttemplate("<a href='javascript:void(0)' title='remove' onclick='return removeusergrouprelation(+#=groupid#+);'> <img alt='remove' src='" + @url.content("~/content/images/delete_icon.png") + "' /></a>") .width(30); }) .sortable() .scrollable(scrollable => scrollable.virtual(false)) .datasource(datasource => datasource .ajax() .read(read => read.action("getassignedgroups", "people") .data("setroutesvalues") ) //new { merchantid = viewbag.merchantid, startdate = model.startdate, enddate = model.enddate } ) .tablehtmlattributes(new { @class = "grid_1" }) )

below javascript code

var userid = '@viewbag.userid' $.ajax({ url: '@url.action("savegroupsuserdetails")', type: "post", datatype: "json", data: { models: kendo.stringify($("#grid").data("kendogrid").datasource.view()), userid: userid }, success: function (result) { } });

here in kendo grid there checkbox column.when check or uncheck checkbox @ client sied(in browser).and post via give javascript $.ajax post,it not post values of checkboxes have changed on client browser,it shows values binded server side.

so,my question want updated values post on server modified on client browser.

i shall thankfull if provide me answer.

i believe because looking @ actual value of datasource , not grid itself. grid non-editable. manually throwing inputs grid , these not effect datasource.

you can take 2 approaches kind of update.

you can leave grid way have set , handle update solely though java script. need dataitems need update manually jquery.

you can lookup of check boxes in grid check, relevant dataitem manually. here short illustration showing how dataitem row in grid.

//checkbox jquery object referencing 1 of checkboxes var row = $(checkbox).closest("tr"); var grid = $("#grid").data("kendogrid"); var info = grid.dataitem(row);

once have of dataitems relevant can post update. have reload grid updated status of these items.

overall not preferred way kind of update kendo grid.

i suggest sec method.

this site pulling examples from: http://demos.telerik.com/aspnet-mvc/grid/editing

first need create kendo grid editable .editable(editable => editable.mode(grideditmode.incell)). not need custom template adds checkbox anymore. automatically add together them when editing grid now.

you need set datasource have update function , have server expect update.

your datasource binding

.datasource(datasource => datasource .ajax() .batch(true) .read("editing_read", "grid") .update("editing_update", "grid") )

and server side code

[acceptverbs(httpverbs.post)] public actionresult editing_update([datasourcerequest] datasourcerequest request, [bind(prefix = "models")]ienumerable<productviewmodel> products) { if (products != null && modelstate.isvalid) { foreach (var product in products) { productservice.update(product); } } homecoming json(products.todatasourceresult(request, modelstate)); }

by returning json object grid auto update new values. preferred way edit grid.

model-view-controller kendo-ui grid

javascript - broken chrome-mobile date input cancel behavior? -



javascript - broken chrome-mobile date input cancel behavior? -

if open datepicker(input type='date') in chrome mobile, alter date, click cancel... new date. cancel doesn't in chrome mobile input type='date'. how can prepare this? event gets fired when click 'cancel'?

i want if user selects cancel, date not change. seems if how command should function. mobile chrome command has cancel, clear, , set options, cancel , set seem perform exact same.

basic input fiddle

<input type='date'></input>

javascript html google-chrome mobile input

Need help creating a javascript or a bootstrap like popup modal for a form submission in Telesope meteor app? -



Need help creating a javascript or a bootstrap like popup modal for a form submission in Telesope meteor app? -

hi i'm using meteor site http://www.telesc.pe , need help making submit form link open in pop window or javascript overlay vs new page close button.

any suggestions?

newtometeor

thanks!

you should able utilize bootstrap modals via bootstrap-3 package.

meteor add together mizzao:bootstrap-3

then refer boostrap documentation. should pretty easy.

javascript meteor popup window

UIScrollView and Autolayout: ContentOffset is changing but content view is not moving -



UIScrollView and Autolayout: ContentOffset is changing but content view is not moving -

i have been trying implement autolayout on uiscrollview have been struggling. here description of main view, top bottom: navigation bar -> scroll view -> uitextfield, of stretch horizontally across screen. here constraints these 3 views:

//vertical constraints; appears working fine [self.view addconstraints:[nslayoutconstraint constraintswithvisualformat:@"v:|-navheight-[_inputscrollview][_inputfield(inputfieldheight)]|" options:0 metrics:metricsdict views:viewsdict]]; //horizontal constraints; these appear working fine [self.view addconstraints:[nslayoutconstraint constraintswithvisualformat:@"h:|[_inputscrollview]|" options:0 metrics:metricsdict views:viewsdict]]; [self.view addconstraints:[nslayoutconstraint constraintswithvisualformat:@"h:|[_inputfield]|" options:0 metrics:metricsdict views:viewsdict]];

next, countless uiscrollview/autolayout tutorials suggest, added subview uiscrollview deed content view many other subviews, added dynamically @ runtime. when application launches there nil in content view. here constraints content view like:

//left constraint, pinning content view left border of screen nslayoutconstraint *leftconstraint = [nslayoutconstraint constraintwithitem:_contentview attribute:nslayoutattributeleading relatedby:0 toitem:self.view attribute:nslayoutattributeleading multiplier:1.0 constant:0]; [self.view addconstraint:leftconstraint]; //right constraint, pinning content view left border of screen nslayoutconstraint *rightconstraint = [nslayoutconstraint constraintwithitem:_contentview attribute:nslayoutattributetrailing relatedby:0 toitem:self.view attribute:nslayoutattributetrailing multiplier:1.0 constant:0]; [self.view addconstraint:rightconstraint]; //top constraint, setting top of content view //to offset top of main view //by height of navigation bar nslayoutconstraint *topconstraint = [nslayoutconstraint constraintwithitem:_contentview attribute:nslayoutattributetop relatedby:0 toitem:self.view attribute:nslayoutattributetop multiplier:1.0 constant:navheight.floatvalue]; [self.view addconstraint:topconstraint]; //bottom constraint, setting bottom of content view //to offset bottom of main view //height of text field. nslayoutconstraint *bottomconstraint = [nslayoutconstraint constraintwithitem:_contentview attribute:nslayoutattributebottom relatedby:0 toitem:self.view attribute:nslayoutattributebottom multiplier:1.0 constant:-inputfieldheight.floatvalue]; [self.view addconstraint:bottomconstraint];

after these views laid out, height of content view equal height of scroll view. have alwaysbouncevertical property set yes, expect see scrolling. when scroll on screen, content offset of scroll view change! implemented scrollviewdidscroll , logged contentoffset screen. however, content view not move @ all. set background color of scroll view reddish , background color of content view black. when contentoffset changing, still never see of reddish scrollview. content view subview of scrollview, why in world frame not changing?! help so so appreciated. thanks!

i had set constraints in next way:

1) tie content view scroll view adding top, bottom, left, , right constraints (e.g. top of content view = top of scroll view). 2) define explicit height , width constraints content view. in case, , in cases, constants these constraints should based off of height/width of content view's subviews.

once implemented design scrolling worked appropriately.

uiscrollview autolayout nslayoutconstraint contentoffset

vb.net - Handling exception on missing reference -



vb.net - Handling exception on missing reference -

is possible somehow in vb.net handle exception thrown when reference has not been copied right directory. unable find way include dll file system.io.sqlite application.

currently if user copies/installs exe file uncaught exception error due missing dll file. gracefully explain issue , terminate program, or @ to the lowest degree give them alternative disable sqlite portion of it.

if have modules, need remove private/public declarations of dll. if have startup form, remove private/public declarations of dll.

every private/public declaration in module of startup form processed before first line of code, cannot that.

with above done, can check create sure dll existing in directory doing this:

if not io.file.exists("system.io.sqlite.dll") ...

vb.net exception-handling filenotfoundexception

html5 - How to adjust the color with rgb value? -



html5 - How to adjust the color with rgb value? -

i have created login form using html5 , css3.

here html5 code login form:

<section id="content"> <form action=""> <h1>login form</h1> <div> <input type="text" placeholder="username" required="" id="username" /> </div> <div> <input type="password" placeholder="password" required="" id="password" /> </div> <div> <input type="submit" value="log in" /> </div> </form><!-- form --> </section><!-- content -->

here jsfiddle: http://jsfiddle.net/q4bvl9mw/1/

i want alter login button black , hover state silver color.

may know exact place can adjust color properties.

can help me? in advance.

[edited]

try this:

demo on fiddle css: #content form input[type="submit"] { background: rgb(254, 231, 154); background: -moz-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(126, 126, 126, 1) 100%); background: -webkit-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(126, 126, 126, 1) 100%); background: -o-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(126, 126, 126, 1) 100%); background: -ms-linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(126, 126, 126, 1) 100%); background: linear-gradient(top, rgba(0, 0, 0, 1) 0%, rgba(126, 126, 126, 1) 100%); -webkit-border-radius: 30px; -moz-border-radius: 30px; -ms-border-radius: 30px; -o-border-radius: 30px; border-radius: 30px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.8) inset; -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.8) inset; -ms-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.8) inset; -o-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.8) inset; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.8) inset; border: 1px solid rgb(0, 0, 0); color: #000; cursor: pointer; font: bold 15px helvetica, arial, sans-serif; height: 35px; margin: 20px 0 35px 15px; position: relative; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); width: 120px; } #content form input[type="submit"]:hover { background: -moz-linear-gradient(top, rgba(126, 126, 126, 1) 0%, rgba(0, 0, 0, 1) 100%); background: -webkit-linear-gradient(top, rgba(126, 126, 126, 1) 0%, rgba(0, 0, 0, 1) 100%); background: -o-linear-gradient(top, rgba(126, 126, 126, 1) 0%, rgba(0, 0, 0, 1) 100%); background: -ms-linear-gradient(top, rgba(126, 126, 126, 1) 0%, rgba(0, 0, 0, 1) 100%); background: linear-gradient(top, rgba(126, 126, 126, 1) 0%, rgba(0, 0, 0, 1) 100%); }

html5 css3